@brightcove/components-embed-code-modal 1.0.7 → 1.0.8

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 (181) hide show
  1. package/.eslintignore +7 -0
  2. package/.eslintrc +23 -0
  3. package/.github/workflows/ci.yml +23 -0
  4. package/.husky/pre-commit +4 -0
  5. package/.nvmrc +1 -0
  6. package/.prettierignore +7 -0
  7. package/.prettierrc +5 -0
  8. package/.release-it.json +40 -0
  9. package/.whitesource +3 -0
  10. package/CHANGELOG.md +387 -0
  11. package/CODEOWNERS +37 -0
  12. package/PULL_REQUEST_TEMPLATE.md +17 -0
  13. package/__tests__/EmbedCode.test.tsx +51 -0
  14. package/__tests__/InteractivityProject.test.tsx +50 -0
  15. package/__tests__/PlayerPreview.test.tsx +23 -0
  16. package/__tests__/TabsHeader.test.tsx +19 -0
  17. package/__tests__/TabsSection.test.tsx +46 -0
  18. package/__tests__/TitleWithTooltip.test.tsx +45 -0
  19. package/__tests__/VideoPlayer.test.tsx +38 -0
  20. package/__tests__/embedCodeGenerator.test.ts +111 -0
  21. package/__tests__/util.test.ts +89 -0
  22. package/babel.config.json +17 -0
  23. package/build/README.md +109 -0
  24. package/build/package.json +100 -0
  25. package/etc/wildcard.brightcove.com.key +27 -0
  26. package/etc/wildcard.brightcove.com.pem +96 -0
  27. package/jest/jest.setup.js +62 -0
  28. package/jest/jest.stub.js +4 -0
  29. package/jest.config.js +24 -0
  30. package/package.json +15 -5
  31. package/scripts/create-dist-pkg-prod.js +18 -0
  32. package/src/index.ts +17 -0
  33. package/src/js/EmbedCodeModal.tsx +105 -0
  34. package/src/js/components/CustomSettingsDropdown.tsx +184 -0
  35. package/src/js/components/EmbedCopySection.tsx +130 -0
  36. package/src/js/components/ModalContainer.tsx +367 -0
  37. package/src/js/components/NoPlayerModal.tsx +42 -0
  38. package/src/js/components/PlayerPreview.tsx +116 -0
  39. package/src/js/components/TabsHeader.tsx +31 -0
  40. package/src/js/components/TabsSection.tsx +74 -0
  41. package/src/js/components/TitleWithTooltip.tsx +39 -0
  42. package/src/js/components/VideoLinks.tsx +83 -0
  43. package/src/js/components/VideoPlayer.tsx +324 -0
  44. package/src/js/components/index.ts +9 -0
  45. package/src/js/components/prism/PrismLiveModal.tsx +162 -0
  46. package/src/js/components/prism/PrismPlayerControls.tsx +343 -0
  47. package/src/js/components/prism/PrismPlayerPreview.tsx +98 -0
  48. package/src/js/components/prism/index.ts +3 -0
  49. package/src/js/constants/baseUrls.ts +4 -0
  50. package/src/js/constants/embed.ts +12 -0
  51. package/src/js/constants/player.ts +32 -0
  52. package/src/js/constants/pluginsRegistry.ts +30 -0
  53. package/src/js/hooks/useGetPlayers.ts +12 -0
  54. package/src/js/i18n.ts +43 -0
  55. package/src/js/services/players-api.ts +26 -0
  56. package/src/js/services/url-shortener.ts +10 -0
  57. package/src/js/types/EmbedCodeModalProps.ts +72 -0
  58. package/src/js/types/EmbedCodeProps.ts +13 -0
  59. package/src/js/types/brightcoveEmbedCode.d.ts +18 -0
  60. package/src/js/types/players.ts +64 -0
  61. package/src/js/types/react-i18next.d.ts +8 -0
  62. package/src/js/types/studioModule.ts +7 -0
  63. package/src/js/utils/addPluginsDataToPlayers.ts +59 -0
  64. package/src/js/utils/call.ts +31 -0
  65. package/src/js/utils/dimensions.ts +53 -0
  66. package/src/js/utils/embedCodeGenerator.ts +120 -0
  67. package/src/js/utils/featureSwitches.ts +16 -0
  68. package/src/js/utils/util.ts +153 -0
  69. package/src/module.tsx +280 -0
  70. package/src/styles/CustomSettingsDropdown.sass +42 -0
  71. package/src/styles/EmbedCode.sass +30 -0
  72. package/src/styles/EmbedCodeModal.sass +76 -0
  73. package/src/styles/base.sass +1 -0
  74. package/src/styles/prism/PrismLiveModal.sass +155 -0
  75. package/src/styles/theme.sass +11 -0
  76. package/src/styles/typings.td.ts +9 -0
  77. package/src/translations/en.json +61 -0
  78. package/src/translations/es.json +61 -0
  79. package/src/translations/fr.json +61 -0
  80. package/src/translations/ja.json +61 -0
  81. package/src/translations/ko.json +61 -0
  82. package/src/translations/zh.json +61 -0
  83. package/src/types/studio.ts +197 -0
  84. package/tsconfig.json +34 -0
  85. package/webpack.config.js +117 -0
  86. /package/{__tests__ → build/__tests__}/EmbedCode.test.d.ts +0 -0
  87. /package/{__tests__ → build/__tests__}/EmbedCode.test.d.ts.map +0 -0
  88. /package/{__tests__ → build/__tests__}/InteractivityProject.test.d.ts +0 -0
  89. /package/{__tests__ → build/__tests__}/InteractivityProject.test.d.ts.map +0 -0
  90. /package/{__tests__ → build/__tests__}/PlayerPreview.test.d.ts +0 -0
  91. /package/{__tests__ → build/__tests__}/PlayerPreview.test.d.ts.map +0 -0
  92. /package/{__tests__ → build/__tests__}/TabsHeader.test.d.ts +0 -0
  93. /package/{__tests__ → build/__tests__}/TabsHeader.test.d.ts.map +0 -0
  94. /package/{__tests__ → build/__tests__}/TabsSection.test.d.ts +0 -0
  95. /package/{__tests__ → build/__tests__}/TabsSection.test.d.ts.map +0 -0
  96. /package/{__tests__ → build/__tests__}/TitleWithTooltip.test.d.ts +0 -0
  97. /package/{__tests__ → build/__tests__}/TitleWithTooltip.test.d.ts.map +0 -0
  98. /package/{__tests__ → build/__tests__}/VideoPlayer.test.d.ts +0 -0
  99. /package/{__tests__ → build/__tests__}/VideoPlayer.test.d.ts.map +0 -0
  100. /package/{__tests__ → build/__tests__}/embedCodeGenerator.test.d.ts +0 -0
  101. /package/{__tests__ → build/__tests__}/embedCodeGenerator.test.d.ts.map +0 -0
  102. /package/{__tests__ → build/__tests__}/util.test.d.ts +0 -0
  103. /package/{__tests__ → build/__tests__}/util.test.d.ts.map +0 -0
  104. /package/{index.js → build/index.js} +0 -0
  105. /package/{index.js.map → build/index.js.map} +0 -0
  106. /package/{src → build/src}/index.d.ts +0 -0
  107. /package/{src → build/src}/index.d.ts.map +0 -0
  108. /package/{src → build/src}/js/EmbedCodeModal.d.ts +0 -0
  109. /package/{src → build/src}/js/EmbedCodeModal.d.ts.map +0 -0
  110. /package/{src → build/src}/js/components/CustomSettingsDropdown.d.ts +0 -0
  111. /package/{src → build/src}/js/components/CustomSettingsDropdown.d.ts.map +0 -0
  112. /package/{src → build/src}/js/components/EmbedCopySection.d.ts +0 -0
  113. /package/{src → build/src}/js/components/EmbedCopySection.d.ts.map +0 -0
  114. /package/{src → build/src}/js/components/ModalContainer.d.ts +0 -0
  115. /package/{src → build/src}/js/components/ModalContainer.d.ts.map +0 -0
  116. /package/{src → build/src}/js/components/NoPlayerModal.d.ts +0 -0
  117. /package/{src → build/src}/js/components/NoPlayerModal.d.ts.map +0 -0
  118. /package/{src → build/src}/js/components/PlayerPreview.d.ts +0 -0
  119. /package/{src → build/src}/js/components/PlayerPreview.d.ts.map +0 -0
  120. /package/{src → build/src}/js/components/TabsHeader.d.ts +0 -0
  121. /package/{src → build/src}/js/components/TabsHeader.d.ts.map +0 -0
  122. /package/{src → build/src}/js/components/TabsSection.d.ts +0 -0
  123. /package/{src → build/src}/js/components/TabsSection.d.ts.map +0 -0
  124. /package/{src → build/src}/js/components/TitleWithTooltip.d.ts +0 -0
  125. /package/{src → build/src}/js/components/TitleWithTooltip.d.ts.map +0 -0
  126. /package/{src → build/src}/js/components/VideoLinks.d.ts +0 -0
  127. /package/{src → build/src}/js/components/VideoLinks.d.ts.map +0 -0
  128. /package/{src → build/src}/js/components/VideoPlayer.d.ts +0 -0
  129. /package/{src → build/src}/js/components/VideoPlayer.d.ts.map +0 -0
  130. /package/{src → build/src}/js/components/index.d.ts +0 -0
  131. /package/{src → build/src}/js/components/index.d.ts.map +0 -0
  132. /package/{src → build/src}/js/components/prism/PrismLiveModal.d.ts +0 -0
  133. /package/{src → build/src}/js/components/prism/PrismLiveModal.d.ts.map +0 -0
  134. /package/{src → build/src}/js/components/prism/PrismPlayerControls.d.ts +0 -0
  135. /package/{src → build/src}/js/components/prism/PrismPlayerControls.d.ts.map +0 -0
  136. /package/{src → build/src}/js/components/prism/PrismPlayerPreview.d.ts +0 -0
  137. /package/{src → build/src}/js/components/prism/PrismPlayerPreview.d.ts.map +0 -0
  138. /package/{src → build/src}/js/components/prism/index.d.ts +0 -0
  139. /package/{src → build/src}/js/components/prism/index.d.ts.map +0 -0
  140. /package/{src → build/src}/js/constants/baseUrls.d.ts +0 -0
  141. /package/{src → build/src}/js/constants/baseUrls.d.ts.map +0 -0
  142. /package/{src → build/src}/js/constants/embed.d.ts +0 -0
  143. /package/{src → build/src}/js/constants/embed.d.ts.map +0 -0
  144. /package/{src → build/src}/js/constants/player.d.ts +0 -0
  145. /package/{src → build/src}/js/constants/player.d.ts.map +0 -0
  146. /package/{src → build/src}/js/constants/pluginsRegistry.d.ts +0 -0
  147. /package/{src → build/src}/js/constants/pluginsRegistry.d.ts.map +0 -0
  148. /package/{src → build/src}/js/hooks/useGetPlayers.d.ts +0 -0
  149. /package/{src → build/src}/js/hooks/useGetPlayers.d.ts.map +0 -0
  150. /package/{src → build/src}/js/i18n.d.ts +0 -0
  151. /package/{src → build/src}/js/i18n.d.ts.map +0 -0
  152. /package/{src → build/src}/js/services/players-api.d.ts +0 -0
  153. /package/{src → build/src}/js/services/players-api.d.ts.map +0 -0
  154. /package/{src → build/src}/js/services/url-shortener.d.ts +0 -0
  155. /package/{src → build/src}/js/services/url-shortener.d.ts.map +0 -0
  156. /package/{src → build/src}/js/types/EmbedCodeModalProps.d.ts +0 -0
  157. /package/{src → build/src}/js/types/EmbedCodeModalProps.d.ts.map +0 -0
  158. /package/{src → build/src}/js/types/EmbedCodeProps.d.ts +0 -0
  159. /package/{src → build/src}/js/types/EmbedCodeProps.d.ts.map +0 -0
  160. /package/{src → build/src}/js/types/players.d.ts +0 -0
  161. /package/{src → build/src}/js/types/players.d.ts.map +0 -0
  162. /package/{src → build/src}/js/types/studioModule.d.ts +0 -0
  163. /package/{src → build/src}/js/types/studioModule.d.ts.map +0 -0
  164. /package/{src → build/src}/js/utils/addPluginsDataToPlayers.d.ts +0 -0
  165. /package/{src → build/src}/js/utils/addPluginsDataToPlayers.d.ts.map +0 -0
  166. /package/{src → build/src}/js/utils/call.d.ts +0 -0
  167. /package/{src → build/src}/js/utils/call.d.ts.map +0 -0
  168. /package/{src → build/src}/js/utils/dimensions.d.ts +0 -0
  169. /package/{src → build/src}/js/utils/dimensions.d.ts.map +0 -0
  170. /package/{src → build/src}/js/utils/embedCodeGenerator.d.ts +0 -0
  171. /package/{src → build/src}/js/utils/embedCodeGenerator.d.ts.map +0 -0
  172. /package/{src → build/src}/js/utils/featureSwitches.d.ts +0 -0
  173. /package/{src → build/src}/js/utils/featureSwitches.d.ts.map +0 -0
  174. /package/{src → build/src}/js/utils/util.d.ts +0 -0
  175. /package/{src → build/src}/js/utils/util.d.ts.map +0 -0
  176. /package/{src → build/src}/module.d.ts +0 -0
  177. /package/{src → build/src}/module.d.ts.map +0 -0
  178. /package/{src → build/src}/styles/typings.td.d.ts +0 -0
  179. /package/{src → build/src}/styles/typings.td.d.ts.map +0 -0
  180. /package/{src → build/src}/types/studio.d.ts +0 -0
  181. /package/{src → build/src}/types/studio.d.ts.map +0 -0
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,23 @@
1
+ name: CI/CD
2
+
3
+ on:
4
+ push:
5
+ branches: ['**']
6
+
7
+ permissions:
8
+ id-token: write
9
+ contents: write
10
+
11
+ jobs:
12
+ cd:
13
+ uses: brightcove/cd_workflows/.github/workflows/library-cd.yml@v1
14
+ with:
15
+ publish-dir: "."
16
+ skip: |
17
+ lint-test
18
+ typecheck
19
+ format:check
20
+ test:ci
21
+ dry-run: false
22
+ secrets:
23
+ npm-token: ${{ secrets.NPM_PUBLISH_TOKEN }}
@@ -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
+ 22.16.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,387 @@
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
+
10
+ ## [1.0.7] - 2026-05-22
11
+ ### Fixed
12
+ - Normalize Custom aspect ratio to fluid before calling `brightcoveEmbedCode`, fixing crash in Prism Embed on Web modal
13
+
14
+ ## [1.0.6] - 2026-05-07
15
+ ### Fixed
16
+ - Translate `dvr.inputLabel` and `dvr.inputDescription` in `es`, `fr`, `ja`, `ko`, `zh-Hant` (previously shipped as verbatim English)
17
+
18
+ ## [1.0.5] - 2026-04-16
19
+ ### Changed
20
+ - Externalize all dependencies to reduce bundle from 22MB to ~102KB
21
+ - Move large deps to peerDependencies (prism-core, player-embed-code, react-player-loader, i18next, react-i18next, react-query)
22
+ - Remove unused externals (react-dnd, react-dnd-html5-backend)
23
+ - Update studio-api-services peerDep to ^7.0.0
24
+
25
+ ## [1.0.4] - 2026-02-04
26
+ ### Fixed
27
+ - Live Prism Embed Modal Fixes
28
+
29
+ ## [1.0.3] - 2026-01-28
30
+ ### Fixed
31
+ - Deploy issues
32
+
33
+ ## [1.0.2] - 2026-01-28
34
+ ### Fixed
35
+ - Deploy issues
36
+
37
+ ## [1.0.0] - 2026-01-28
38
+ ### Added
39
+ - [PUBLISHING-618](https://brightcove.atlassian.net/browse/PUBLISHING-618) Update Embed code modal to use the Prism theme for Live
40
+
41
+ ## [0.8.5] - 2025-08-06
42
+ ### Added
43
+ - [PUBLISHING-340](https://brightcove.atlassian.net/browse/PUBLISHING-340) Include Ad Configuration in studio-ui-kit_studio-components-embed-code-modal
44
+
45
+ ## [0.8.4] - 2025-08-05
46
+ ### Changed
47
+ - [PLAYCUST-3043](https://brightcove.atlassian.net/browse/PLAYCUST-3043) Update to node v22.9.0
48
+
49
+ ## [0.8.2] - 2024-10-31
50
+ ### Added
51
+ - [PLAYCUST-2953](https://brightcove.atlassian.net/browse/PLAYCUST-2953) Add translations
52
+
53
+ ## [0.8.1] - 2024-10-22
54
+ ### Fixed
55
+ - [PLAYCUST-3157](https://brightcove.atlassian.net/browse/PLAYCUST-3157) Fix dvr default state and render logic
56
+
57
+ ## [0.8.0] - 2024-10-21
58
+ ### Added
59
+ - [PLAYCUST-3157](https://brightcove.atlassian.net/browse/PLAYCUST-3157) Add support for low latency
60
+
61
+ ## [0.7.2] - 2024-10-03
62
+ ### Added
63
+ - [PLAYCUST-3082](https://brightcove.atlassian.net/browse/PLAYCUST-3082) Update Embed Code Modal Library in Live 2.0
64
+
65
+ ## [0.7.1] - 2024-09-24
66
+ ### Fixed
67
+ - [PLAYCUST-2882](https://brightcove.atlassian.net/browse/PLAYCUST-2882) Fix iframe embed code aspect ratio padding
68
+
69
+ ## [0.7.1] - 2024-09-24
70
+ ### Fixed
71
+ - [PLAYCUST-2937](https://brightcove.atlassian.net/browse/PLAYCUST-2937) playerListForSelection breaking the module when being an empty array
72
+
73
+ ## [0.7.0] - 2024-09-23
74
+ ### Added
75
+ - [PLAYCUST-2938](https://brightcove.atlassian.net/browse/PLAYCUST-2938) Add DVR livePlaybackToken option
76
+
77
+ ## [0.6.0] - 2024-08-14
78
+ ### Added
79
+ - [PLAYCUST-2595](https://brightcove.atlassian.net/browse/PLAYCUST-2595) Display custom settings for Project type
80
+
81
+ ### Fixed
82
+ - [PLAYCUST-2595](https://brightcove.atlassian.net/browse/PLAYCUST-2595) Horizontal scroll getting displayed when expanding custom settings section
83
+ - [PLAYCUST-2584](https://brightcove.atlassian.net/browse/PLAYCUST-2584) Use correct aspect ratio class
84
+
85
+ ## [0.5.1] - 2024-07-22
86
+ ### Fixed
87
+ - [PLAYCUST-2799](https://brightcove.atlassian.net/browse/PLAYCUST-2799) Disable iframe for MAPs enabled player
88
+
89
+ ## [0.5.0] - 2024-04-17
90
+ ### Changed
91
+ - [PLAYCUST-2449](https://brightcove.atlassian.net/browse/PLAYCUST-2449) Remove Player Preview and links when player is of type outstream
92
+
93
+ ### Fixed
94
+ - [PLAYCUST-2455](https://brightcove.atlassian.net/browse/PLAYCUST-2455) Fix viewer ID tracking validation
95
+
96
+ ## [0.4.4] - 2024-03-29
97
+ ### Added
98
+ - [PLAYCUST-2249](https://brightcove.atlassian.net/browse/PLAYCUST-2249) Support for interactivityProjectId
99
+
100
+ ## [0.4.3] - 2024-03-29
101
+ ### Added
102
+ - [PLAYCUST-2368](https://brightcove.atlassian.net/browse/PLAYCUST-2368) Disable iframe publish for Viewer ID Tracking
103
+ - [PLAYCUST-2249](https://brightcove.atlassian.net/browse/PLAYCUST-2249) Player select component
104
+
105
+ ## [0.4.2] - 2023-12-29
106
+ ### Fixed
107
+ - [PLAYCUST-2002](https://brightcove.atlassian.net/browse/PLAYCUST-2002) Demo site not working
108
+
109
+ ## [0.4.1] - 2023-11-24
110
+ ### Fixed
111
+ - [PLAYCUST-2050](https://brightcove.atlassian.net/browse/PLAYCUST-2050) Fix Javascript tab crash
112
+
113
+ ## [0.4.0] - 2023-11-02
114
+ ### Added
115
+ - [PLAYCUST-1941](https://brightcove.atlassian.net/browse/PLAYCUST-1941) Preselect favorite player in Video Embed
116
+ - [PLAYCUST-1946](https://brightcove.atlassian.net/browse/PLAYCUST-1946) Custom settings dropdown for TYPE VIDEO
117
+
118
+ ### Changed
119
+ - [PLAYCUST-1469](https://brightcove.atlassian.net/browse/PLAYCUST-1469) `preview` link from Player Type now redirects to preview-players.brightcove.net
120
+
121
+ ## [0.3.7] - 2023-09-18
122
+ ### Added
123
+ - [PLAYCUST-1947](https://brightcove.atlassian.net/browse/PLAYCUST-1947)`embedCodeProperties` prop for the Embed Code generation
124
+
125
+ ## [0.3.6] - 2023-07-19
126
+ ### Fixed
127
+ - [PLAYCUST-1720](https://brightcove.atlassian.net/browse/PLAYCUST-1720) Fix typography for iframe text from `iFrame` to `iframe`
128
+ - [PLAYCUST-1899](https://brightcove.atlassian.net/browse/PLAYCUST-1899) Create player with v2 interactivity plugin
129
+
130
+ ## [0.3.5] - 2023-04-19
131
+ ### Changed
132
+ - [PLAYCUST-1618](https://brightcove.atlassian.net/browse/PLAYCUST-1618) [BREAKING] Change prop name from `playerPayload` to `data`
133
+
134
+ ## [0.3.4] - 2023-03-23
135
+ ### Fixed
136
+ - Internal: Updated peerDependencies
137
+
138
+ ## [0.3.3] - 2023-03-23
139
+ ### Fixed
140
+ - [PLAYCUST-1648](https://brightcove.atlassian.net/browse/PLAYCUST-1648) Project Player Preview when player has been created
141
+
142
+ ## [0.3.2] - 2023-03-07
143
+ ### Fixed
144
+ - [PLAYCUST-1637](https://brightcove.atlassian.net/browse/PLAYCUST-1637) Fixed Project Player Preview
145
+ - [PLAYCUST-1624](https://brightcove.atlassian.net/browse/PLAYCUST-1624) Update no player modal text to reference players module
146
+
147
+ ## [0.3.1] - 2023-03-02
148
+ ### Fixed
149
+ - [PLAYCUST-1625](https://brightcove.atlassian.net/browse/PLAYCUST-1625) Check for Interactivity Plugin using Registry ID OR Name
150
+
151
+ ## [0.3.0] - 2023-03-01
152
+ ### Changed
153
+ - [PLAYCUST-1625](https://brightcove.atlassian.net/browse/PLAYCUST-1625) Check for Interactivity Plugin using Registry ID
154
+
155
+ ## [0.2.2] - 2023-02-21
156
+ ### Changed
157
+ - [LIVE-2447](https://brightcove.atlassian.net/browse/LIVE-2447) Default playerID to be the first in the list
158
+
159
+ ## [0.2.1] - 2023-02-15
160
+ ### Fixed
161
+ - [LIVE-2447](https://brightcove.atlassian.net/browse/LIVE-2447) Update peerDependencies and dependencies
162
+
163
+ ## [0.2.0] - 2023-02-08
164
+ ### Fixed
165
+ - [LIVE-2447](https://brightcove.atlassian.net/browse/LIVE-2447) Interactivity params for preview, player and embed code
166
+
167
+ ## [0.1.28] - 2023-02-01
168
+ ### Added
169
+ - [LIVE-2455](https://brightcove.atlassian.net/browse/LIVE-2455) Create Player if no Interactivity-enabled Player is found
170
+ - [LIVE-2533](https://brightcove.atlassian.net/browse/LIVE-2533) Embed Code Modal Translations
171
+
172
+ ## [0.1.27] - 2022-12-21
173
+ ### Added
174
+ - [LIVE-2448](https://brightcove.atlassian.net/browse/LIVE-2448) Interactivity attribute to react player loader when using the interactivity modal
175
+
176
+ ## [0.1.26] - 2022-11-18
177
+ ### Added
178
+ - Support for Interactivity player
179
+
180
+ ## [0.1.25] - 2022-10-06
181
+ ### Added
182
+ - Campaign Plugin and Plugins notice for Player embed
183
+
184
+ ### Changed
185
+ - VideoPayload type
186
+
187
+ ## [0.1.24] - 2022-09-29
188
+ ### Changed
189
+ - Export for payload types
190
+
191
+ ## [0.1.23] - 2022-09-28
192
+ ### Added
193
+ - Export for `PlayerPayload`
194
+
195
+ ### Fixed
196
+ - Typings in `package.json`
197
+
198
+ ## [0.1.22] - 2022-09-27
199
+ ### Fixed
200
+ - Type exports for build
201
+
202
+ ## [0.1.21] - 2022-09-01
203
+ ### Added
204
+ - Player type context
205
+
206
+ ### Changed
207
+ - **BREAKING CHANGE** `video` prop to `data`
208
+
209
+ ## [0.1.20] - 2022-08-11
210
+ ### Fixed
211
+ - Video title truncation small fix
212
+
213
+ ## [0.1.19] - 2022-08-09
214
+ ### Fixed
215
+ - PLAYCUST-1254 add support for safari clipboard
216
+ - PLAYCUST-1254 make sure peerDep for @brightcove/react-player-loader matches with media-four module
217
+ - remove unused variables
218
+ - Long video titles are now truncated
219
+
220
+ ## [0.1.18] - 2022-08-03
221
+ ### Changed
222
+ - upgrade `@brightcove/studio-components` to 7.0.0
223
+ - remove deprecated props
224
+
225
+ ## [0.1.17] - 2022-07-26
226
+ ### Changed
227
+ - Add `@brightcove/react-player-loader` as peerDependency so its handled by parent module
228
+
229
+ ## [0.1.16] - 2022-07-22
230
+ ### Changed
231
+ - Removed older design
232
+
233
+ ### Fixed
234
+ - Translation strings when copying url
235
+ - Support custom css on player configuration by using iframes
236
+ - Translation string when Campaign player is selected
237
+
238
+ ## [0.1.15] - 2022-07-13
239
+ ### Added
240
+ - Sort players dropdown
241
+
242
+ ### Fixed
243
+ - Trigger Toast notifications up to parent module
244
+
245
+ ## [0.1.14] - 2022-07-05
246
+ ### Fixed
247
+ - Hide iFrame embed code for Campaign-enabled players
248
+
249
+ ## [0.1.13] - 2022-06-29
250
+ ### Added
251
+ - Shorten url on preview button click
252
+
253
+ ### Fixed
254
+ - Show Config Message only for players with non-bc plugins
255
+
256
+ ## [0.1.12] - 2022-06-24
257
+ ### Fixed
258
+ - Remove extra preview button
259
+
260
+ ## [0.1.11] - 2022-06-20
261
+ ### Added
262
+ - Add Copy URL and Preview button
263
+
264
+ ## [0.1.10] - 2022-06-01
265
+ ### Changed
266
+ - update custom copy field
267
+
268
+ ## [0.1.9] - 2022-05-26
269
+ ### Changed
270
+ - `CopyField` to use latest `studio-components` version
271
+
272
+ ### Fixed
273
+ - Keep Javascript enabled for campaign players
274
+
275
+ ## [0.1.8] - 2022-05-26
276
+ ### Added
277
+ - Prevent iFrame from being copied when the selected player is campaign
278
+
279
+ ## [0.1.7] - 2022-05-23
280
+ ### Fixed
281
+ - `EmbedCodeModalTypes` export change to value instead of type
282
+
283
+ ## [0.1.6] - 2022-05-18
284
+ ### Added
285
+ - Notice when player selected has plugins
286
+ - Update iFrame/Javascript code snippet when selected player changes
287
+ - Player preview using ReactPlayerLoader
288
+ - Player preview link updates with player selected
289
+
290
+ ### Fixed
291
+ - Only fetch list of players when modal is open
292
+
293
+ ## [0.1.5] - 2022-05-10
294
+ ### Added
295
+ - Feature switch for new enhancements
296
+ - Component now receives a `type` prop
297
+ - Fetch list of players
298
+
299
+ ### Changed
300
+ - Design updates
301
+
302
+ ## [0.1.4] - 2022-04-28
303
+ ### Added
304
+ - KACL validation
305
+
306
+ ### Fixed
307
+ - Missing docs link in tooltip
308
+
309
+ ## [0.1.3] - 2022-04-12
310
+ ### Changed
311
+ - Toaster moved to be inside modal content
312
+
313
+ ## [0.1.2] - 2022-02-23
314
+ ### Changed
315
+ - Style tweaks for the modal
316
+
317
+ ## [0.1.1] - 2021-12-21
318
+ ### Added
319
+ - Trigger open when video object gets passed into props
320
+
321
+ ## 0.1.0 - 2021-11-26
322
+ ### Added
323
+ - Initial commit of embed code modal component
324
+
325
+ [Unreleased]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v1.0.6...HEAD
326
+ [1.0.6]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v1.0.5...v1.0.6
327
+ [1.0.5]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v1.0.4...v1.0.5
328
+ [1.0.4]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v1.0.3...v1.0.4
329
+ [1.0.3]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v1.0.2...v1.0.3
330
+ [1.0.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v1.0.0...v1.0.2
331
+ [1.0.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.8.5...v1.0.0
332
+ [0.8.5]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.8.4...v0.8.5
333
+ [0.8.4]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.8.2...v0.8.4
334
+ [0.8.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.8.1...v0.8.2
335
+ [0.8.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.8.0...v0.8.1
336
+ [0.8.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.7.2...v0.8.0
337
+ [0.7.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.7.1...v0.7.2
338
+ [0.7.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.7.1...v0.7.1
339
+ [0.7.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.7.0...v0.7.1
340
+ [0.7.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.6.0...v0.7.0
341
+ [0.6.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.5.1...v0.6.0
342
+ [0.5.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.5.0...v0.5.1
343
+ [0.5.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.4...v0.5.0
344
+ [0.4.4]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.3...v0.4.4
345
+ [0.4.3]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.2...v0.4.3
346
+ [0.4.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.1...v0.4.2
347
+ [0.4.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.0...v0.4.1
348
+ [0.4.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.7...v0.4.0
349
+ [0.3.7]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.6...v0.3.7
350
+ [0.3.6]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.5...v0.3.6
351
+ [0.3.5]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.4...v0.3.5
352
+ [0.3.4]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.3...v0.3.4
353
+ [0.3.3]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.2...v0.3.3
354
+ [0.3.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.1...v0.3.2
355
+ [0.3.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.0...v0.3.1
356
+ [0.3.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.2.2...v0.3.0
357
+ [0.2.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.2.1...v0.2.2
358
+ [0.2.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.2.0...v0.2.1
359
+ [0.2.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.28...v0.2.0
360
+ [0.1.28]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.27...v0.1.28
361
+ [0.1.27]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.26...v0.1.27
362
+ [0.1.26]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.25...v0.1.26
363
+ [0.1.25]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.24...v0.1.25
364
+ [0.1.24]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.23...v0.1.24
365
+ [0.1.23]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.22...v0.1.23
366
+ [0.1.22]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.21...v0.1.22
367
+ [0.1.21]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.20...v0.1.21
368
+ [0.1.20]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.19...v0.1.20
369
+ [0.1.19]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.18...v0.1.19
370
+ [0.1.18]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.17...v0.1.18
371
+ [0.1.17]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.16...v0.1.17
372
+ [0.1.16]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.15...v0.1.16
373
+ [0.1.15]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.14...v0.1.15
374
+ [0.1.14]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.13...v0.1.14
375
+ [0.1.13]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.12...v0.1.13
376
+ [0.1.12]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.11...v0.1.12
377
+ [0.1.11]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.10...v0.1.11
378
+ [0.1.10]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.9...v0.1.10
379
+ [0.1.9]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.8...v0.1.9
380
+ [0.1.8]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.7...v0.1.8
381
+ [0.1.7]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.6...v0.1.7
382
+ [0.1.6]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.5...v0.1.6
383
+ [0.1.5]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.4...v0.1.5
384
+ [0.1.4]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.3...v0.1.4
385
+ [0.1.3]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.2...v0.1.3
386
+ [0.1.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.1...v0.1.2
387
+ [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
+ });