@glomex/integration-react 1.1431.1 → 1.1435.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,17 +1,15 @@
1
- import { type ExternalMediaItemElement, type MediaItem } from '@glomex/integration-web-component';
2
- import type { DetailedHTMLProps, HTMLAttributes } from 'react';
3
- declare global {
1
+ import { type MediaItem } from '@glomex/integration-web-component';
2
+ declare module 'react/jsx-runtime' {
4
3
  namespace JSX {
5
4
  interface IntrinsicElements {
6
- 'glomex-external-media-item': DetailedHTMLProps<HTMLAttributes<ExternalMediaItemElement> & {
5
+ 'glomex-external-media-item': JSX.IntrinsicElements['div'] & {
7
6
  poster?: string;
8
7
  duration?: number;
9
- type?: string;
10
- }, ExternalMediaItemElement>;
8
+ };
11
9
  }
12
10
  }
13
11
  }
14
12
  /**
15
13
  * React component to define an external media item.
16
14
  */
17
- export declare const ExternalMediaItemReact: (mediaItem: MediaItem) => JSX.Element;
15
+ export declare const ExternalMediaItemReact: (mediaItem: MediaItem) => import("react/jsx-runtime").JSX.Element;
@@ -4,5 +4,5 @@ import { ScriptType } from '@glomex/integration-web-component';
4
4
  * React component to define an external media item.
5
5
  */
6
6
  export const ExternalMediaItemReact = (mediaItem) => {
7
- return (_jsx("glomex-external-media-item", { id: mediaItem.id, poster: mediaItem.poster, duration: mediaItem.duration, "channel-name": 'channelName' in mediaItem ? mediaItem.channelName : undefined, "channel-logo": 'channelLogo' in mediaItem ? mediaItem.channelLogo : undefined, title: mediaItem.title, "aspect-ratio": mediaItem.aspectRatio, "minimum-age": mediaItem.minimumAge, "release-date": mediaItem.releaseDate, "has-product-placement": 'hasProductPlacement' in mediaItem ? mediaItem.hasProductPlacement : undefined, children: mediaItem ? (_jsx("script", { type: ScriptType.EXTERNAL_MEDIA_ITEM, children: JSON.stringify(mediaItem) })) : null }));
7
+ return (_jsx("glomex-external-media-item", { id: mediaItem.id, poster: mediaItem.poster, duration: mediaItem.duration, "channel-name": mediaItem.channel?.name, "channel-logo": mediaItem.channel?.logo, title: mediaItem.title, "aspect-ratio": mediaItem.aspectRatio, "minimum-age": mediaItem.minimumAge, "release-date": mediaItem.releaseDate, "has-product-placement": mediaItem.hasProductPlacement, children: mediaItem ? (_jsx("script", { type: ScriptType.EXTERNAL_MEDIA_ITEM, children: JSON.stringify(mediaItem) })) : null }));
8
8
  };
@@ -1,11 +1,10 @@
1
- import { type GlomexMediaItemElement, type GlomexMediaItemWithOverrides } from '@glomex/integration-web-component';
2
- import type { DetailedHTMLProps, HTMLAttributes } from 'react';
3
- declare global {
1
+ import { type GlomexMediaItemWithOverrides } from '@glomex/integration-web-component';
2
+ declare module 'react/jsx-runtime' {
4
3
  namespace JSX {
5
4
  interface IntrinsicElements {
6
- 'glomex-media-item': DetailedHTMLProps<HTMLAttributes<GlomexMediaItemElement> & {
5
+ 'glomex-media-item': JSX.IntrinsicElements['div'] & {
7
6
  poster?: string;
8
- }, GlomexMediaItemElement>;
7
+ };
9
8
  }
10
9
  }
11
10
  }
@@ -15,4 +14,4 @@ declare global {
15
14
  export declare const GlomexMediaItemReact: (item: {
16
15
  id: string;
17
16
  overrides?: GlomexMediaItemWithOverrides["overrides"];
18
- }) => JSX.Element;
17
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -5,5 +5,5 @@ import { ScriptType } from '@glomex/integration-web-component';
5
5
  */
6
6
  export const GlomexMediaItemReact = (item) => {
7
7
  const { id: mediaItemId, overrides: mediaItemOverrides } = item;
8
- return (_jsx("glomex-media-item", { id: mediaItemId, title: mediaItemOverrides?.title, poster: mediaItemOverrides?.poster, children: _jsx("script", { type: ScriptType.EXTERNAL_MEDIA_ITEM, children: JSON.stringify(mediaItemOverrides || {}) }) }));
8
+ return (_jsx("glomex-media-item", { id: mediaItemId, ...(mediaItemOverrides?.title && { title: mediaItemOverrides.title }), ...(mediaItemOverrides?.poster && { poster: mediaItemOverrides.poster }), children: _jsx("script", { type: ScriptType.EXTERNAL_MEDIA_ITEM, children: JSON.stringify(mediaItemOverrides || {}) }) }));
9
9
  };
@@ -1,14 +1,19 @@
1
1
  import { type GlomexMediaItemWithOverrides, type IntegrationElement, type IntegrationProperties, type MediaItem } from '@glomex/integration-web-component';
2
- import { type CSSProperties, type DetailedHTMLProps, type HTMLAttributes } from 'react';
3
- declare global {
2
+ import { type CSSProperties } from 'react';
3
+ declare module 'react/jsx-runtime' {
4
4
  namespace JSX {
5
5
  interface IntrinsicElements {
6
- 'glomex-integration': DetailedHTMLProps<HTMLAttributes<IntegrationElement> & {
6
+ 'glomex-integration': Omit<JSX.IntrinsicElements['div'], 'ref' | 'children'> & {
7
+ ref?: React.Ref<IntegrationElement | null>;
8
+ children?: React.ReactNode;
7
9
  index?: number;
8
10
  placement?: string;
11
+ 'integration-id'?: string;
12
+ 'playlist-id'?: string;
13
+ 'use-ads-sdk'?: boolean;
14
+ 'top-level-iframe'?: boolean;
9
15
  hidden?: boolean;
10
- style?: CSSProperties;
11
- }, IntegrationElement>;
16
+ };
12
17
  }
13
18
  }
14
19
  }
@@ -14,7 +14,7 @@ function isGlomexMediaItem(item) {
14
14
  * @see {@link IntegrationElementEventMap} for all available events.
15
15
  */
16
16
  export const Integration = forwardRef((props, ref) => {
17
- const { children, integrationId, playlistId, index, hidden, topLevelIframe, placement, mediaItems, configs, preventLoadIntegration, extraContext, ...rest } = props;
17
+ const { children, integrationId, playlistId, index, hidden, topLevelIframe, useAdsSdk, placement, mediaItems, configs, preventLoadIntegration, extraContext, ...rest } = props;
18
18
  const elementRef = useRef(null);
19
19
  if (mediaItems && playlistId) {
20
20
  throw new Error('Cannot specify both mediaItems and playlistId');
@@ -43,5 +43,5 @@ export const Integration = forwardRef((props, ref) => {
43
43
  new Promise((resolve) => window.customElements.whenDefined(ComponentName.INTEGRATION).then(() => resolve()));
44
44
  return element;
45
45
  }, [extraContext]);
46
- return (_jsxs(_Fragment, { children: [integrationId && _jsx("link", { rel: "stylesheet", href: getIntegrationCssUrl(integrationId) }), _jsxs("glomex-integration", { ref: elementRef, "integration-id": integrationId, "playlist-id": playlistId, index: index, hidden: hidden, "top-level-iframe": topLevelIframe, placement: placement, ...rest, children: [mediaItemComponents, children, configs && (_jsx("script", { type: ScriptType.INTEGRATION_CONFIGS, children: JSON.stringify(configs) }))] })] }));
46
+ return (_jsxs(_Fragment, { children: [integrationId && _jsx("link", { rel: "stylesheet", href: getIntegrationCssUrl(integrationId) }), _jsxs("glomex-integration", { ref: elementRef, "integration-id": integrationId, "playlist-id": playlistId, index: index, hidden: hidden, "use-ads-sdk": useAdsSdk, "top-level-iframe": topLevelIframe, placement: placement, ...rest, children: [mediaItemComponents, children, configs && (_jsx("script", { type: ScriptType.INTEGRATION_CONFIGS, children: JSON.stringify(configs) }))] })] }));
47
47
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glomex/integration-react",
3
- "version": "1.1431.1",
3
+ "version": "1.1435.0",
4
4
  "description": "React component to integrate the glomex player",
5
5
  "documentation": "https://docs.glomex.com",
6
6
  "homepage": "https://glomex.com",
@@ -28,7 +28,7 @@
28
28
  "watch": "tsc --build --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@glomex/integration-web-component": "1.1431.1"
31
+ "@glomex/integration-web-component": "1.1435.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "preact": ">=10",
@@ -41,9 +41,9 @@
41
41
  "license": "MIT",
42
42
  "devDependencies": {
43
43
  "@biomejs/biome": "catalog:",
44
- "@types/react": "^16.8.0",
45
- "@types/react-dom": "^16.8.0",
44
+ "@types/react": "^19.2.2",
45
+ "@types/react-dom": "^19.2.2",
46
46
  "typescript": "catalog:"
47
47
  },
48
- "gitHead": "7edd927f899cee302edb5660559f098b8fe4c53d"
48
+ "gitHead": "7bfcf125b01bc8a81bbbbb99d89302422055e5b1"
49
49
  }