@carbon/ibmdotcom-web-components 2.42.0 → 2.44.0

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 (112) hide show
  1. package/custom-elements.json +694 -21
  2. package/dist/dotcom-shell.js +2 -2
  3. package/dist/dotcom-shell.min.js +2 -2
  4. package/dist/ibmdotcom-web-components-dotcom-shell.js +2 -2
  5. package/dist/ibmdotcom-web-components-dotcom-shell.min.js +2 -2
  6. package/dist/{index-1c798fbb.js → index-61a58423.js} +1126 -820
  7. package/dist/{index-0582e43b.js → index-ec9bb3a7.js} +325 -325
  8. package/dist/{left-nav-menu-222d7e12.js → left-nav-menu-1ff7160b.js} +2 -2
  9. package/dist/{left-nav-menu-fbe31764.js → left-nav-menu-7d664773.js} +2 -2
  10. package/dist/{left-nav-menu-category-heading-bad5c9a4.js → left-nav-menu-category-heading-3fda0fd5.js} +2 -2
  11. package/dist/{left-nav-menu-category-heading-d40df38d.js → left-nav-menu-category-heading-df0252db.js} +2 -2
  12. package/dist/{left-nav-menu-item-1c789f3b.js → left-nav-menu-item-b217b8fd.js} +2 -2
  13. package/dist/{left-nav-menu-item-d8292202.js → left-nav-menu-item-caa0c565.js} +2 -2
  14. package/dist/{left-nav-menu-section-722a4f08.js → left-nav-menu-section-d00e6604.js} +2 -2
  15. package/dist/{left-nav-menu-section-ad075d07.js → left-nav-menu-section-dbde241d.js} +2 -2
  16. package/dist/{left-nav-overlay-c4bce0ba.js → left-nav-overlay-cd84d0bc.js} +2 -2
  17. package/dist/{left-nav-overlay-6931a643.js → left-nav-overlay-f5867fdc.js} +2 -2
  18. package/dist/{megamenu-category-group-b28f721d.js → megamenu-category-group-251cebcf.js} +2 -2
  19. package/dist/{megamenu-category-group-6a9005b2.js → megamenu-category-group-802948a9.js} +2 -2
  20. package/dist/{megamenu-category-group-copy-09e2b942.js → megamenu-category-group-copy-484e9b27.js} +2 -2
  21. package/dist/{megamenu-category-group-copy-a1712d7f.js → megamenu-category-group-copy-7efee05a.js} +2 -2
  22. package/dist/{megamenu-category-heading-b5cf4e2d.js → megamenu-category-heading-2190977a.js} +2 -2
  23. package/dist/{megamenu-category-heading-d1c1fa95.js → megamenu-category-heading-315eb114.js} +2 -2
  24. package/dist/{megamenu-category-link-aeb6f7d6.js → megamenu-category-link-3d42179f.js} +2 -2
  25. package/dist/{megamenu-category-link-2c38f1b8.js → megamenu-category-link-84c22ab0.js} +2 -2
  26. package/dist/{megamenu-category-link-group-492f73c5.js → megamenu-category-link-group-3cdb6bfc.js} +2 -2
  27. package/dist/{megamenu-category-link-group-c7ade8c5.js → megamenu-category-link-group-94e4b16c.js} +2 -2
  28. package/dist/{megamenu-left-navigation-328b8153.js → megamenu-left-navigation-b5b03849.js} +2 -2
  29. package/dist/{megamenu-left-navigation-015a1a3e.js → megamenu-left-navigation-ee2dc6e8.js} +2 -2
  30. package/dist/{megamenu-overlay-763b7455.js → megamenu-overlay-646b736f.js} +2 -2
  31. package/dist/{megamenu-overlay-a9dcb9ea.js → megamenu-overlay-6a12d82a.js} +2 -2
  32. package/dist/{megamenu-tab-9623c21c.js → megamenu-tab-5490376a.js} +2 -2
  33. package/dist/{megamenu-tab-faaeff5a.js → megamenu-tab-99df887a.js} +2 -2
  34. package/es/components/back-to-top/__stories__/back-to-top.stories.css.js +1 -1
  35. package/es/components/card-group/card-group.css.js +1 -1
  36. package/es/components/card-section-offset/card-section-offset.css.js +1 -1
  37. package/es/components/card-section-simple/card-section-simple.css.js +1 -1
  38. package/es/components/content-block/content-block.css.js +1 -1
  39. package/es/components/content-block-cards/content-block-cards.css.js +1 -1
  40. package/es/components/content-block-media/content-block-media.css.js +1 -1
  41. package/es/components/content-section/content-section.css.js +1 -1
  42. package/es/components/cta-block/cta-block.css.js +1 -1
  43. package/es/components/cta-section/cta-section.css.js +1 -1
  44. package/es/components/dotcom-shell/dotcom-shell.css.js +1 -1
  45. package/es/components/footer/footer-composite.d.ts +10 -10
  46. package/es/components/footer/footer-composite.js +78 -53
  47. package/es/components/footer/footer-composite.js.map +1 -1
  48. package/es/components/footer/footer-container.d.ts +4 -3
  49. package/es/components/footer/footer-container.js +8 -5
  50. package/es/components/footer/footer-container.js.map +1 -1
  51. package/es/components/footer/footer.css.js +1 -1
  52. package/es/components/global-banner/global-banner.css.js +1 -1
  53. package/es/components/leadspace/leadspace.css.js +1 -1
  54. package/es/components/leadspace-with-search/leadspace-with-search.css.js +1 -1
  55. package/es/components/link-list-section/link-list-section.css.js +1 -1
  56. package/es/components/locale-modal/locale-modal.css.js +1 -1
  57. package/es/components/masthead/masthead-cart.d.ts +1 -0
  58. package/es/components/masthead/masthead-cart.js +23 -5
  59. package/es/components/masthead/masthead-cart.js.map +1 -1
  60. package/es/components/masthead/masthead-l1.css.js +1 -1
  61. package/es/components/masthead/masthead.css.js +1 -1
  62. package/es/components/table-of-contents/table-of-contents-cdn.css.js +1 -1
  63. package/es/components/table-of-contents/table-of-contents.css.js +1 -1
  64. package/es/components/table-of-contents/table-of-contents.d.ts +1 -1
  65. package/es/components/table-of-contents/table-of-contents.js +15 -2
  66. package/es/components/table-of-contents/table-of-contents.js.map +1 -1
  67. package/es/components/video-player-v7/defs.d.ts +42 -0
  68. package/es/components/video-player-v7/defs.js +46 -0
  69. package/es/components/video-player-v7/defs.js.map +1 -0
  70. package/es/components/video-player-v7/index.d.ts +11 -0
  71. package/es/components/video-player-v7/index.js +18 -0
  72. package/es/components/video-player-v7/index.js.map +1 -0
  73. package/es/components/video-player-v7/video-player-composite.d.ts +873 -0
  74. package/es/components/video-player-v7/video-player-composite.js +705 -0
  75. package/es/components/video-player-v7/video-player-composite.js.map +1 -0
  76. package/es/components/video-player-v7/video-player-container.d.ts +1219 -0
  77. package/es/components/video-player-v7/video-player-container.js +392 -0
  78. package/es/components/video-player-v7/video-player-container.js.map +1 -0
  79. package/es/components/video-player-v7/video-player.css.js +12 -0
  80. package/es/components/video-player-v7/video-player.d.ts +807 -0
  81. package/es/components/video-player-v7/video-player.js +577 -0
  82. package/es/components/video-player-v7/video-player.js.map +1 -0
  83. package/es/components-react/footer/footer-container.d.ts +1 -1
  84. package/es/components-react/video-player-v7/defs.js +9 -0
  85. package/es/components-react/video-player-v7/video-player-composite.d.ts +32 -0
  86. package/es/components-react/video-player-v7/video-player-container.d.ts +19 -0
  87. package/es/components-react/video-player-v7/video-player.d.ts +37 -0
  88. package/es/globals/scss/themes.css.js +1 -1
  89. package/es/internal/vendor/@carbon/ibmdotcom-services/services/KalturaPlayerV7/KalturaPlayer.js +366 -0
  90. package/es/internal/vendor/@carbon/ibmdotcom-services/services/KalturaPlayerV7/index.js +8 -0
  91. package/es/internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPIv7.d.ts +54 -0
  92. package/es/internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPIv7.js +88 -0
  93. package/es/internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPIv7.js.map +1 -0
  94. package/es/internal/vendor/@carbon/ibmdotcom-services-store/reducers/kalturaPlayerAPIv7.d.ts +18 -0
  95. package/es/internal/vendor/@carbon/ibmdotcom-services-store/reducers/kalturaPlayerAPIv7.js +88 -0
  96. package/es/internal/vendor/@carbon/ibmdotcom-services-store/reducers/kalturaPlayerAPIv7.js.map +1 -0
  97. package/es/internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPIv7.d.ts +77 -0
  98. package/es/internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPIv7.js +36 -0
  99. package/es/internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPIv7.js.map +1 -0
  100. package/lib/components/video-player-v7/defs.js +50 -0
  101. package/lib/components/video-player-v7/defs.js.map +1 -0
  102. package/lib/components-react-node/video-player-v7/defs.js +24 -0
  103. package/lib/internal/vendor/@carbon/ibmdotcom-services/services/KalturaPlayerV7/KalturaPlayer.js +371 -0
  104. package/lib/internal/vendor/@carbon/ibmdotcom-services/services/KalturaPlayerV7/index.js +13 -0
  105. package/lib/internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPIv7.js +104 -0
  106. package/lib/internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPIv7.js.map +1 -0
  107. package/lib/internal/vendor/@carbon/ibmdotcom-services-store/reducers/kalturaPlayerAPIv7.js +94 -0
  108. package/lib/internal/vendor/@carbon/ibmdotcom-services-store/reducers/kalturaPlayerAPIv7.js.map +1 -0
  109. package/lib/internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPIv7.js +39 -0
  110. package/lib/internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPIv7.js.map +1 -0
  111. package/package.json +7 -7
  112. package/scss/components/video-player-v7/video-player.scss +8 -0
@@ -0,0 +1,77 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2020, 2024
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ /**
10
+ * The media data for ibm.com sites
11
+ */
12
+ export interface MediaData {
13
+ /**
14
+ * The media id.
15
+ */
16
+ id: string;
17
+ /**
18
+ * The media description.
19
+ */
20
+ description: string;
21
+ /**
22
+ * The media duration.
23
+ */
24
+ duration: number;
25
+ /**
26
+ * The media name.
27
+ */
28
+ name: string;
29
+ }
30
+ /**
31
+ * The Redux action ID for `MediaPlayerAPI`.
32
+ */
33
+ export declare enum MEDIA_PLAYER_API_ACTION {
34
+ /**
35
+ * One to set the state that the REST call for media data that is in progress.
36
+ */
37
+ SET_REQUEST_MEDIA_DATA_IN_PROGRESS = "SET_REQUEST_MEDIA_DATA_IN_PROGRESS",
38
+ /**
39
+ * One to set the state that the REST call for media data failed.
40
+ */
41
+ SET_ERROR_REQUEST_MEDIA_DATA = "SET_ERROR_REQUEST_MEDIA_DATA",
42
+ /**
43
+ * One to set the given media data.
44
+ */
45
+ SET_MEDIA_DATA = "SET_MEDIA_DATA"
46
+ }
47
+ /**
48
+ * A Redux substate for `MediaPlayerAPI`.
49
+ */
50
+ export interface MediaPlayerAPIState {
51
+ /**
52
+ * The media data, keyed by the media ID.
53
+ */
54
+ mediaData?: {
55
+ [mediaId: string]: MediaData;
56
+ };
57
+ /**
58
+ * The requests for the media data, keyed by the media ID.
59
+ */
60
+ requestsMediaData?: {
61
+ [mediaId: string]: Promise<MediaData>;
62
+ };
63
+ /**
64
+ * The status of whether requests for the media data are in progress, keyed by the media ID.
65
+ */
66
+ requestsMediaDataInProgress?: {
67
+ [mediaId: string]: boolean;
68
+ };
69
+ /**
70
+ * The errors from the requests for the media data, keyed by the media ID.
71
+ */
72
+ errorsRequestMediaData?: {
73
+ [mediaId: string]: Error;
74
+ };
75
+ }
76
+
77
+ //# sourceMappingURL=kalturaPlayerAPIv7.d.ts.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2020, 2024
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+
10
+ /**
11
+ * The media data for ibm.com sites
12
+ */
13
+
14
+ /**
15
+ * The Redux action ID for `MediaPlayerAPI`.
16
+ */
17
+ export let MEDIA_PLAYER_API_ACTION = /*#__PURE__*/function (MEDIA_PLAYER_API_ACTION) {
18
+ /**
19
+ * One to set the state that the REST call for media data that is in progress.
20
+ */
21
+ MEDIA_PLAYER_API_ACTION["SET_REQUEST_MEDIA_DATA_IN_PROGRESS"] = "SET_REQUEST_MEDIA_DATA_IN_PROGRESS";
22
+ /**
23
+ * One to set the state that the REST call for media data failed.
24
+ */
25
+ MEDIA_PLAYER_API_ACTION["SET_ERROR_REQUEST_MEDIA_DATA"] = "SET_ERROR_REQUEST_MEDIA_DATA";
26
+ /**
27
+ * One to set the given media data.
28
+ */
29
+ MEDIA_PLAYER_API_ACTION["SET_MEDIA_DATA"] = "SET_MEDIA_DATA";
30
+ return MEDIA_PLAYER_API_ACTION;
31
+ }({});
32
+
33
+ /**
34
+ * A Redux substate for `MediaPlayerAPI`.
35
+ */
36
+ //# sourceMappingURL=kalturaPlayerAPIv7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kalturaPlayerAPIv7.js","names":["MEDIA_PLAYER_API_ACTION"],"sources":["types/kalturaPlayerAPIv7.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * The media data for ibm.com sites\n */\nexport interface MediaData {\n /**\n * The media id.\n */\n id: string;\n\n /**\n * The media description.\n */\n description: string;\n\n /**\n * The media duration.\n */\n duration: number;\n\n /**\n * The media name.\n */\n name: string;\n}\n\n/**\n * The Redux action ID for `MediaPlayerAPI`.\n */\nexport enum MEDIA_PLAYER_API_ACTION {\n /**\n * One to set the state that the REST call for media data that is in progress.\n */\n SET_REQUEST_MEDIA_DATA_IN_PROGRESS = 'SET_REQUEST_MEDIA_DATA_IN_PROGRESS',\n\n /**\n * One to set the state that the REST call for media data failed.\n */\n SET_ERROR_REQUEST_MEDIA_DATA = 'SET_ERROR_REQUEST_MEDIA_DATA',\n\n /**\n * One to set the given media data.\n */\n SET_MEDIA_DATA = 'SET_MEDIA_DATA',\n}\n\n/**\n * A Redux substate for `MediaPlayerAPI`.\n */\nexport interface MediaPlayerAPIState {\n /**\n * The media data, keyed by the media ID.\n */\n mediaData?: { [mediaId: string]: MediaData };\n\n /**\n * The requests for the media data, keyed by the media ID.\n */\n requestsMediaData?: { [mediaId: string]: Promise<MediaData> };\n\n /**\n * The status of whether requests for the media data are in progress, keyed by the media ID.\n */\n requestsMediaDataInProgress?: { [mediaId: string]: boolean };\n\n /**\n * The errors from the requests for the media data, keyed by the media ID.\n */\n errorsRequestMediaData?: { [mediaId: string]: Error };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAuBA;AACA;AACA;AACA,WAAYA,uBAAuB,0BAAvBA,uBAAuB;EACjC;AACF;AACA;EAHYA,uBAAuB;EAMjC;AACF;AACA;EARYA,uBAAuB;EAWjC;AACF;AACA;EAbYA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;;AAiBnC;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VIDEO_PLAYER_PLAYING_MODE = exports.VIDEO_PLAYER_CONTENT_STATE = exports.BUTTON_POSITION = void 0;
7
+ /**
8
+ * @license
9
+ *
10
+ * Copyright IBM Corp. 2020, 2024
11
+ *
12
+ * This source code is licensed under the Apache-2.0 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ /**
16
+ * Video player's content state.
17
+ */
18
+ let VIDEO_PLAYER_CONTENT_STATE = exports.VIDEO_PLAYER_CONTENT_STATE = /*#__PURE__*/function (VIDEO_PLAYER_CONTENT_STATE) {
19
+ /**
20
+ * A state showing thumbnail.
21
+ */
22
+ VIDEO_PLAYER_CONTENT_STATE["THUMBNAIL"] = "thumbnail";
23
+ /**
24
+ * A state showing/playing the video.
25
+ */
26
+ VIDEO_PLAYER_CONTENT_STATE["VIDEO"] = "video";
27
+ return VIDEO_PLAYER_CONTENT_STATE;
28
+ }({});
29
+ /**
30
+ * Video player's playing mode.
31
+ */
32
+ let VIDEO_PLAYER_PLAYING_MODE = exports.VIDEO_PLAYER_PLAYING_MODE = /*#__PURE__*/function (VIDEO_PLAYER_PLAYING_MODE) {
33
+ /**
34
+ * Plays video inline.
35
+ */
36
+ VIDEO_PLAYER_PLAYING_MODE["INLINE"] = "inline";
37
+ /**
38
+ * Plays video in light box.
39
+ */
40
+ VIDEO_PLAYER_PLAYING_MODE["LIGHTBOX"] = "lightbox";
41
+ return VIDEO_PLAYER_PLAYING_MODE;
42
+ }({});
43
+ let BUTTON_POSITION = exports.BUTTON_POSITION = /*#__PURE__*/function (BUTTON_POSITION) {
44
+ BUTTON_POSITION["TOP_LEFT"] = "top-left";
45
+ BUTTON_POSITION["TOP_RIGHT"] = "top-right";
46
+ BUTTON_POSITION["BOTTOM_RIGHT"] = "bottom-right";
47
+ BUTTON_POSITION["BOTTOM_LEFT"] = "bottom-left";
48
+ return BUTTON_POSITION;
49
+ }({});
50
+ //# sourceMappingURL=defs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defs.js","names":["VIDEO_PLAYER_CONTENT_STATE","exports","VIDEO_PLAYER_PLAYING_MODE","BUTTON_POSITION"],"sources":["components/video-player-v7/defs.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Video player's content state.\n */\nexport enum VIDEO_PLAYER_CONTENT_STATE {\n /**\n * A state showing thumbnail.\n */\n THUMBNAIL = 'thumbnail',\n\n /**\n * A state showing/playing the video.\n */\n VIDEO = 'video',\n}\n\n/**\n * Video player's playing mode.\n */\nexport enum VIDEO_PLAYER_PLAYING_MODE {\n /**\n * Plays video inline.\n */\n INLINE = 'inline',\n /**\n * Plays video in light box.\n */\n LIGHTBOX = 'lightbox',\n}\n\nexport enum BUTTON_POSITION {\n TOP_LEFT = 'top-left',\n TOP_RIGHT = 'top-right',\n BOTTOM_RIGHT = 'bottom-right',\n BOTTOM_LEFT = 'bottom-left',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAFA,IAGYA,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,0BAA1BA,0BAA0B;EACpC;AACF;AACA;EAHYA,0BAA0B;EAMpC;AACF;AACA;EARYA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAYtC;AACA;AACA;AAFA,IAGYE,yBAAyB,GAAAD,OAAA,CAAAC,yBAAA,0BAAzBA,yBAAyB;EACnC;AACF;AACA;EAHYA,yBAAyB;EAKnC;AACF;AACA;EAPYA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAAA,IAWzBC,eAAe,GAAAF,OAAA,CAAAE,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2020
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ 'use strict';
10
+
11
+ Object.defineProperty(exports, '__esModule', {
12
+ value: true,
13
+ });
14
+ var _defs = require('../../components/video-player-v7/defs.js');
15
+ Object.keys(_defs).forEach(function (key) {
16
+ if (key === 'default' || key === '__esModule') return;
17
+ if (key in exports && exports[key] === _defs[key]) return;
18
+ Object.defineProperty(exports, key, {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _defs[key];
22
+ },
23
+ });
24
+ });
@@ -0,0 +1,371 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+ var _windowOrGlobal = _interopRequireDefault(require("window-or-global"));
14
+ var _ref, _process$env$REACT_AP, _process, _process2, _ref2, _process$env$REACT_AP2, _process3, _process4, _ref3, _process$env$REACT_AP3, _process5, _process6, _ref4, _process$env$REACT_AP4, _process7, _process8, _ref5, _process$env$REACT_AP5, _process9, _process0;
15
+ /**
16
+ * Copyright IBM Corp. 2020, 2024
17
+ *
18
+ * This source code is licensed under the Apache-2.0 license found in the
19
+ * LICENSE file in the root directory of this source tree.
20
+ */
21
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
+ /**
24
+ * Sets the Kaltura Partner ID
25
+ *
26
+ * @type {number}
27
+ * @private
28
+ */
29
+ var _partnerId = (_ref = (_process$env$REACT_AP = (_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_APP_KALTURA_PARTNER_ID) !== null && _process$env$REACT_AP !== void 0 ? _process$env$REACT_AP : (_process2 = process) === null || _process2 === void 0 || (_process2 = _process2.env) === null || _process2 === void 0 ? void 0 : _process2.KALTURA_PARTNER_ID) !== null && _ref !== void 0 ? _ref :
30
+ // 1773841;
31
+ 1773841;
32
+
33
+ /**
34
+ * Sets the Kaltura UIConf IDs
35
+ *
36
+ * @type {enum}
37
+ * @private
38
+ */
39
+ var _uiConfIds = {
40
+ VIDEO: (_ref2 = (_process$env$REACT_AP2 = (_process3 = process) === null || _process3 === void 0 || (_process3 = _process3.env) === null || _process3 === void 0 ? void 0 : _process3.REACT_APP_KALTURA_UICONF_ID_VIDEO) !== null && _process$env$REACT_AP2 !== void 0 ? _process$env$REACT_AP2 : (_process4 = process) === null || _process4 === void 0 || (_process4 = _process4.env) === null || _process4 === void 0 ? void 0 : _process4.KALTURA_UICONF_ID_VIDEO) !== null && _ref2 !== void 0 ? _ref2 : 57792212,
41
+ AUDIO: (_ref3 = (_process$env$REACT_AP3 = (_process5 = process) === null || _process5 === void 0 || (_process5 = _process5.env) === null || _process5 === void 0 ? void 0 : _process5.REACT_APP_KALTURA_UICONF_ID_AUDIO) !== null && _process$env$REACT_AP3 !== void 0 ? _process$env$REACT_AP3 : (_process6 = process) === null || _process6 === void 0 || (_process6 = _process6.env) === null || _process6 === void 0 ? void 0 : _process6.KALTURA_UICONF_ID_AUDIO) !== null && _ref3 !== void 0 ? _ref3 : 57792222,
42
+ PLAYLIST: (_ref4 = (_process$env$REACT_AP4 = (_process7 = process) === null || _process7 === void 0 || (_process7 = _process7.env) === null || _process7 === void 0 ? void 0 : _process7.REACT_APP_KALTURA_UICONF_ID_PLAYLIST) !== null && _process$env$REACT_AP4 !== void 0 ? _process$env$REACT_AP4 : (_process8 = process) === null || _process8 === void 0 || (_process8 = _process8.env) === null || _process8 === void 0 ? void 0 : _process8.KALTURA_UICONF_ID_PLAYLIST) !== null && _ref4 !== void 0 ? _ref4 : 57792212,
43
+ REELS: (_ref5 = (_process$env$REACT_AP5 = (_process9 = process) === null || _process9 === void 0 || (_process9 = _process9.env) === null || _process9 === void 0 ? void 0 : _process9.REACT_APP_KALTURA_UICONF_ID_REELS) !== null && _process$env$REACT_AP5 !== void 0 ? _process$env$REACT_AP5 : (_process0 = process) === null || _process0 === void 0 || (_process0 = _process0.env) === null || _process0 === void 0 ? void 0 : _process0.KALTURA_UICONF_ID_REELS) !== null && _ref5 !== void 0 ? _ref5 : 57792212
44
+ };
45
+
46
+ /**
47
+ * The IBM Mediacenter Loader and Player Environment
48
+ * to be called
49
+ *
50
+ * @type {string}
51
+ * @private
52
+ */
53
+ var _ibmEnvironment = process && (process.env.REACT_APP_KALTURA_ENVIRONMENT || process.env.KALTURA_ENVIRONMENT) || 'LATEST';
54
+
55
+ /**
56
+ * All the available enviornments for the Streaming Services Kaltura Player Script
57
+ *
58
+ * @type {enum}
59
+ * @private
60
+ */
61
+ var _ibmEnvironments = {
62
+ DEVELOPMENT: 'development',
63
+ LATEST: 'latest',
64
+ NEXT: 'next'
65
+ };
66
+
67
+ /**
68
+ * Streaming Services Kaltura Player Script URL
69
+ *
70
+ * @private
71
+ */
72
+ var _ibmScriptUrl = function _ibmScriptUrl() {
73
+ var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _ibmEnvironment;
74
+ return "https://1.www.s81c.com/common/mediacenter/player/loader/".concat(_ibmEnvironments[environment], "/loader.js");
75
+ };
76
+
77
+ /**
78
+ * Returns boolean if the _scriptLoading and _scriptLoaded flag is false
79
+ *
80
+ * @private
81
+ */
82
+ function _loadScript() {
83
+ var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _ibmEnvironment;
84
+ _scriptLoading = true;
85
+ var script = document.createElement('script');
86
+ script.src = _ibmScriptUrl(environment);
87
+ script.async = true;
88
+ document.body.appendChild(script);
89
+ }
90
+
91
+ /**
92
+ * Number of times to retry the script ready loop before failing
93
+ *
94
+ * @type {number}
95
+ * @private
96
+ */
97
+ var _timeoutRetries = 50;
98
+
99
+ /**
100
+ * Tracks the number of attempts for the script ready loop
101
+ *
102
+ * @type {number}
103
+ * @private
104
+ */
105
+ var _attempt = 0;
106
+
107
+ /**
108
+ * Tracks the script status
109
+ *
110
+ * @type {boolean} _scriptLoading to track the script loading or not
111
+ * @private
112
+ */
113
+ var _scriptLoading = false;
114
+
115
+ /**
116
+ * Timeout loop to check script state is the _scriptLoaded state or _scriptLoading state
117
+ *
118
+ * @param {Function} resolve Resolve function
119
+ * @param {Function} reject Reject function
120
+ * @private
121
+ */
122
+ function _scriptReady(resolve, reject) {
123
+ var _root$IBM;
124
+ var environment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _ibmEnvironment;
125
+ /**
126
+ * @param {object} root?.IBM.Mediacenter.player if exists then resolve
127
+ */
128
+ if (_windowOrGlobal.default !== null && _windowOrGlobal.default !== void 0 && (_root$IBM = _windowOrGlobal.default.IBM) !== null && _root$IBM !== void 0 && (_root$IBM = _root$IBM.Mediacenter) !== null && _root$IBM !== void 0 && _root$IBM.player) {
129
+ _scriptLoading = false;
130
+ resolve();
131
+ } else if (_scriptLoading) {
132
+ _attempt++;
133
+ if (_attempt < _timeoutRetries) {
134
+ setTimeout(function () {
135
+ _scriptReady(resolve, reject, environment);
136
+ }, 100);
137
+ } else {
138
+ reject();
139
+ }
140
+ } else {
141
+ _loadScript(environment);
142
+ _scriptReady(resolve, reject, environment);
143
+ }
144
+ }
145
+
146
+ /**
147
+ * KalturaPlayerAPI class with methods of checking script state and
148
+ * embed media meta data and api data
149
+ *
150
+ * In order to set the Partner ID/UIConf ID, set the following environment
151
+ * variables:
152
+ *
153
+ * - KALTURA_PARTNER_ID
154
+ * - KALTURA_UICONF_ID
155
+ */
156
+ var KalturaPlayerAPIV7 = /*#__PURE__*/function () {
157
+ function KalturaPlayerAPIV7() {
158
+ (0, _classCallCheck2.default)(this, KalturaPlayerAPIV7);
159
+ }
160
+ return (0, _createClass2.default)(KalturaPlayerAPIV7, null, [{
161
+ key: "checkScript",
162
+ value:
163
+ /**
164
+ *
165
+ * Gets the full _scriptReady state
166
+ *
167
+ * @returns {Promise<*>} Promise kaltura media player file
168
+ */
169
+ function checkScript() {
170
+ var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _ibmEnvironment;
171
+ return new Promise(function (resolve, reject) {
172
+ _scriptReady(resolve, reject, environment);
173
+ });
174
+ }
175
+
176
+ /**
177
+ * Creates thumbnail image url with customizable params
178
+ *
179
+ * @param {object} params param object
180
+ * @param {string} params.mediaId specify the kaltura media id
181
+ * @param {string} params.height specify height in pixels
182
+ * @param {string} params.width specify width in pixels
183
+ * @param {string} params.partnerId specify mediacenter's partner id
184
+ * @returns {string} url of thumbnail image
185
+ * @example
186
+ * import { KalturaPlayerAPI } from '@carbon/ibmdotcom-services';
187
+ *
188
+ * function thumbnail() {
189
+ * const thumbnailData = {
190
+ * mediaId: '1_9h94wo6b',
191
+ * height: '240',
192
+ * width: '320'
193
+ * }
194
+ * const thumbnailUrl = KalturaPlayerAPI.getThumbnailUrl(thumbnailData);
195
+ * }
196
+ */
197
+ }, {
198
+ key: "getThumbnailUrl",
199
+ value: function getThumbnailUrl(_ref6) {
200
+ var _root$IBM2;
201
+ var _ref6$mediaId = _ref6.mediaId,
202
+ mediaId = _ref6$mediaId === void 0 ? '' : _ref6$mediaId,
203
+ _ref6$height = _ref6.height,
204
+ height = _ref6$height === void 0 ? 0 : _ref6$height,
205
+ _ref6$width = _ref6.width,
206
+ width = _ref6$width === void 0 ? 0 : _ref6$width,
207
+ _ref6$partnerId = _ref6.partnerId,
208
+ partnerId = _ref6$partnerId === void 0 ? _partnerId : _ref6$partnerId;
209
+ return (_windowOrGlobal.default === null || _windowOrGlobal.default === void 0 || (_root$IBM2 = _windowOrGlobal.default.IBM) === null || _root$IBM2 === void 0 || (_root$IBM2 = _root$IBM2.Mediacenter) === null || _root$IBM2 === void 0 || (_root$IBM2 = _root$IBM2.player) === null || _root$IBM2 === void 0 || (_root$IBM2 = _root$IBM2.api) === null || _root$IBM2 === void 0 ? void 0 : _root$IBM2.getThumbnail(partnerId, mediaId, width, height)) || '';
210
+ }
211
+
212
+ /**
213
+ * Gets the api data
214
+ * The player api will only call kaltura once and cache the data
215
+ * return the cached information in all subsequential calls
216
+ *
217
+ * @param {string} mediaId The mediaId we're embedding the placeholder for.
218
+ * @param {string} partnerId The mediacenter partner id.
219
+ * @returns {object} object
220
+ * @example
221
+ * import { KalturaPlayerAPI } from '@carbon/ibmdotcom-services';
222
+ *
223
+ * async function getMyVideoInfo(id) {
224
+ * const data = await KalturaPlayerAPI.api(id);
225
+ * console.log(data);
226
+ * }
227
+ */
228
+ }, {
229
+ key: "api",
230
+ value: (function () {
231
+ var _api = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(mediaId) {
232
+ var partnerId,
233
+ _args = arguments;
234
+ return _regenerator.default.wrap(function (_context) {
235
+ while (1) switch (_context.prev = _context.next) {
236
+ case 0:
237
+ partnerId = _args.length > 1 && _args[1] !== undefined ? _args[1] : _partnerId;
238
+ _context.next = 1;
239
+ return this.checkScript().then(function () {
240
+ var _root$IBM3;
241
+ return (_windowOrGlobal.default === null || _windowOrGlobal.default === void 0 || (_root$IBM3 = _windowOrGlobal.default.IBM) === null || _root$IBM3 === void 0 || (_root$IBM3 = _root$IBM3.Mediacenter) === null || _root$IBM3 === void 0 || (_root$IBM3 = _root$IBM3.player) === null || _root$IBM3 === void 0 || (_root$IBM3 = _root$IBM3.api) === null || _root$IBM3 === void 0 ? void 0 : _root$IBM3.getMediaProperties(partnerId, mediaId)) || {};
242
+ });
243
+ case 1:
244
+ return _context.abrupt("return", _context.sent);
245
+ case 2:
246
+ case "end":
247
+ return _context.stop();
248
+ }
249
+ }, _callee, this);
250
+ }));
251
+ function api(_x) {
252
+ return _api.apply(this, arguments);
253
+ }
254
+ return api;
255
+ }()
256
+ /**
257
+ * Gets the embed meta data
258
+ *
259
+ * @param {string} mediaId The mediaId we're embedding the placeholder for.
260
+ * @param {string} targetId The targetId the ID where we're putting the placeholder.
261
+ * @param {object} configuration Determine any extra param or plugin for the player.
262
+ * @param {Function} customReadyCallback Determine any extra functions that should be executed
263
+ * @param {string} partnerId specify mediacenter's partner id
264
+ * on player readyCallback.
265
+ * @returns {object} object
266
+ * @example
267
+ * import { KalturaPlayerAPI } from '@carbon/ibmdotcom-services';
268
+ *
269
+ * function embedMyVideo() {
270
+ * const elem = document.getElementById('foo');
271
+ * const videoid = '12345';
272
+ * KalturaPlayerAPI.embedMedia(videoid, elem);
273
+ * }
274
+ */
275
+ )
276
+ }, {
277
+ key: "embedMedia",
278
+ value: (function () {
279
+ var _embedMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(mediaId, targetId) {
280
+ var configuration,
281
+ customReadyCallback,
282
+ partnerId,
283
+ _args3 = arguments;
284
+ return _regenerator.default.wrap(function (_context3) {
285
+ while (1) switch (_context3.prev = _context3.next) {
286
+ case 0:
287
+ configuration = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
288
+ customReadyCallback = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : function () {};
289
+ partnerId = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : _partnerId;
290
+ _context3.next = 1;
291
+ return this.checkScript().then(function () {
292
+ var legacyPromiseKWidget = /*#__PURE__*/function () {
293
+ var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
294
+ var _configuration$player, _ibmEnvironments$conf, _configuration$player2, _root$IBM4;
295
+ var playerType, playerEnvironment, playerUiConfId, playerConfiguration, isCustomCreated, newVideoDiv, kalturaPlayer, previousVideoDiv;
296
+ return _regenerator.default.wrap(function (_context2) {
297
+ while (1) switch (_context2.prev = _context2.next) {
298
+ case 0:
299
+ playerType = (_configuration$player = configuration === null || configuration === void 0 ? void 0 : configuration.playerType) !== null && _configuration$player !== void 0 ? _configuration$player : 'VIDEO';
300
+ playerEnvironment = (_ibmEnvironments$conf = _ibmEnvironments[configuration.playerEnvironment]) !== null && _ibmEnvironments$conf !== void 0 ? _ibmEnvironments$conf : _ibmEnvironments[_ibmEnvironment];
301
+ playerUiConfId = (_configuration$player2 = configuration.playerUiConfId) !== null && _configuration$player2 !== void 0 ? _configuration$player2 : _uiConfIds[playerType];
302
+ playerConfiguration = _objectSpread({
303
+ playerType: playerType,
304
+ autoPlay: true,
305
+ muted: true,
306
+ loop: false,
307
+ playerMode: 'default',
308
+ environment: playerEnvironment,
309
+ partnerId: partnerId,
310
+ uiConfId: playerUiConfId,
311
+ targetId: targetId
312
+ }, configuration);
313
+ if (playerType === 'VIDEO' || playerType === 'AUDIO') {
314
+ playerConfiguration.entryId = mediaId;
315
+ } else if (playerType === 'PLAYLIST' || playerType === 'REELS') {
316
+ // Implement when both players are ready in Mediacenter
317
+ }
318
+
319
+ /**
320
+ * Process the elements around the player
321
+ */
322
+
323
+ if (!document.getElementById(targetId) && document.querySelector('cds-tabs-extended-media')) {
324
+ newVideoDiv = document.createElement('div');
325
+ newVideoDiv.classList.add("bx--video-player__video");
326
+ newVideoDiv.setAttribute('id', targetId);
327
+ document.body.append(newVideoDiv);
328
+ isCustomCreated = true;
329
+ }
330
+
331
+ /**
332
+ * Embed the player and execute custom callback
333
+ */
334
+ _context2.next = 1;
335
+ return _windowOrGlobal.default === null || _windowOrGlobal.default === void 0 || (_root$IBM4 = _windowOrGlobal.default.IBM) === null || _root$IBM4 === void 0 || (_root$IBM4 = _root$IBM4.Mediacenter) === null || _root$IBM4 === void 0 || (_root$IBM4 = _root$IBM4.player) === null || _root$IBM4 === void 0 ? void 0 : _root$IBM4.embed(playerConfiguration);
336
+ case 1:
337
+ kalturaPlayer = _context2.sent;
338
+ customReadyCallback(kalturaPlayer);
339
+ if (isCustomCreated) {
340
+ previousVideoDiv = document.querySelector('cds-tabs-extended-media').shadowRoot.querySelector(".bx--accordion__item--active cds-video-player").lastChild;
341
+ previousVideoDiv.parentElement.appendChild(document.getElementById(targetId));
342
+ }
343
+ return _context2.abrupt("return", kalturaPlayer);
344
+ case 2:
345
+ case "end":
346
+ return _context2.stop();
347
+ }
348
+ }, _callee2);
349
+ }));
350
+ return function legacyPromiseKWidget() {
351
+ return _ref7.apply(this, arguments);
352
+ };
353
+ }();
354
+ return legacyPromiseKWidget();
355
+ });
356
+ case 1:
357
+ return _context3.abrupt("return", _context3.sent);
358
+ case 2:
359
+ case "end":
360
+ return _context3.stop();
361
+ }
362
+ }, _callee3, this);
363
+ }));
364
+ function embedMedia(_x2, _x3) {
365
+ return _embedMedia.apply(this, arguments);
366
+ }
367
+ return embedMedia;
368
+ }())
369
+ }]);
370
+ }();
371
+ var _default = exports.default = KalturaPlayerAPIV7;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "KalturaPlayerAPI", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _KalturaPlayer.default;
11
+ }
12
+ });
13
+ var _KalturaPlayer = _interopRequireDefault(require("./KalturaPlayer"));