@glomex/integration-react 1.1306.0 → 1.1307.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IntegrationElement, type IntegrationProperties, type MediaItem } from '@glomex/integration-web-component';
|
|
1
|
+
import { type GlomexMediaItemWithOverrides, type IntegrationElement, type IntegrationProperties, type MediaItem } from '@glomex/integration-web-component';
|
|
2
2
|
import { type CSSProperties, type DetailedHTMLProps, type HTMLAttributes } from 'react';
|
|
3
3
|
declare global {
|
|
4
4
|
namespace JSX {
|
|
@@ -19,13 +19,7 @@ declare global {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const Integration: import("react").ForwardRefExoticComponent<IntegrationProperties & {
|
|
21
21
|
id?: string;
|
|
22
|
-
mediaItems?: (string |
|
|
23
|
-
id: string;
|
|
24
|
-
overrides: {
|
|
25
|
-
title?: string;
|
|
26
|
-
poster?: string;
|
|
27
|
-
};
|
|
28
|
-
} | MediaItem)[];
|
|
22
|
+
mediaItems?: (string | GlomexMediaItemWithOverrides | MediaItem)[];
|
|
29
23
|
preventLoadIntegration?: boolean;
|
|
30
24
|
configs?: Record<string, unknown>;
|
|
31
25
|
style?: CSSProperties;
|
|
@@ -3,6 +3,11 @@ import { ScriptType, getIntegrationCssUrl, loadIntegrationComponent } from '@glo
|
|
|
3
3
|
import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
4
4
|
import { ExternalMediaItemReact } from './external-media-item-react.js';
|
|
5
5
|
import { GlomexMediaItemReact } from './glomex-media-item-react.js';
|
|
6
|
+
function isGlomexMediaItem(item) {
|
|
7
|
+
return (typeof item === 'object' &&
|
|
8
|
+
item !== null &&
|
|
9
|
+
('overrides' in item || (Object.keys(item).length === 1 && 'id' in item)));
|
|
10
|
+
}
|
|
6
11
|
/**
|
|
7
12
|
* React component for the integration.
|
|
8
13
|
*
|
|
@@ -19,7 +24,7 @@ export const Integration = forwardRef((props, ref) => {
|
|
|
19
24
|
if (typeof item === 'string') {
|
|
20
25
|
return _jsx(GlomexMediaItemReact, { id: item }, `${item}-${keyIndex}`);
|
|
21
26
|
}
|
|
22
|
-
if (
|
|
27
|
+
if (isGlomexMediaItem(item)) {
|
|
23
28
|
return (_jsx(GlomexMediaItemReact, { id: item.id, overrides: item.overrides }, `${item.id}-${keyIndex}`));
|
|
24
29
|
}
|
|
25
30
|
return _jsx(ExternalMediaItemReact, { ...item }, `${item.id}-${keyIndex}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glomex/integration-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1307.0",
|
|
4
4
|
"description": "React component to integrate the glomex player",
|
|
5
5
|
"documentation": "https://docs.glomex.com",
|
|
6
6
|
"homepage": "https://glomex.com",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"watch": "tsc --build --watch"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@glomex/integration-web-component": "^1.
|
|
30
|
+
"@glomex/integration-web-component": "^1.1307.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=16.8.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "2a424fb7203a73ed818e3f58ec4b20c9e56b9b14"
|
|
44
44
|
}
|