@glomex/integration-react 1.1299.0 → 1.1300.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.
package/README.md CHANGED
@@ -16,14 +16,15 @@ Our ecosystem is designed to create value for all participants:
16
16
 
17
17
  ## Usage
18
18
 
19
- ### Loading & integrating the player
19
+ ### Loading & integrating the player (TypeScript)
20
20
 
21
- ```ts
22
- import { type React, useRef } from 'react';
23
- import { IntegrationReact, IntegrationEvent } from '@glomex/integration-react';
21
+ ```tsx
22
+ // example: player.tsx
23
+ import { useEffect, useRef, type ComponentProps, type ComponentRef } from 'react';
24
+ import { Integration, IntegrationEvent } from '@glomex/integration-react';
24
25
 
25
- const MyApp = () => {
26
- const integrationRef = useRef<React.ElementRef<typeof IntegrationReact>>(null);
26
+ const Player = (props: ComponentProps<typeof Integration>) => {
27
+ const integrationRef = useRef<ComponentRef<typeof Integration>>(null);
27
28
 
28
29
  const handlePlay = () => {
29
30
  integrationRef.current?.play();
@@ -48,10 +49,9 @@ const MyApp = () => {
48
49
 
49
50
  return (
50
51
  <div>
51
- <IntegrationReact
52
+ <Integration
52
53
  ref={integrationRef}
53
- integrationId="FILL_IN_INTEGRATION_ID"
54
- playlistId="FILL_IN_PLAYLIST_ID"
54
+ {...props}
55
55
  />
56
56
  <button type="button" onClick={handlePlay}>
57
57
  Play
@@ -60,5 +60,25 @@ const MyApp = () => {
60
60
  );
61
61
  };
62
62
 
63
- export default MyApp;
63
+ export default Player;
64
+ ```
65
+
66
+ **Usage** in your component:
67
+
68
+ ```tsx
69
+ // example: app.tsx
70
+ import Player from "./player"
71
+
72
+ export default async function MyApp(props) {
73
+ const params = await props.params
74
+
75
+ return (
76
+ <div>
77
+ <Player
78
+ integrationId="REPLACE_WITH_INTEGRATION_ID"
79
+ playlistId="REPLACE_WITH_PLAYLIST_ID"
80
+ />
81
+ </div>
82
+ );
83
+ }
64
84
  ```
package/build/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { IntegrationReact } from './integration-react';
1
+ export { Integration } from './integration-react';
2
2
  export * from '@glomex/integration-web-component';
package/build/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { IntegrationReact } from './integration-react';
1
+ export { Integration } from './integration-react';
2
2
  // biome-ignore lint/performance/noReExportAll: <explanation>
3
3
  export * from '@glomex/integration-web-component';
@@ -17,7 +17,7 @@ declare global {
17
17
  *
18
18
  * @see {@link IntegrationElementEventMap} for all available events.
19
19
  */
20
- export declare const IntegrationReact: import("react").ForwardRefExoticComponent<IntegrationProperties & {
20
+ export declare const Integration: import("react").ForwardRefExoticComponent<IntegrationProperties & {
21
21
  id?: string;
22
22
  mediaItems?: (string | {
23
23
  id: string;
@@ -8,7 +8,7 @@ import { GlomexMediaItemReact } from './glomex-media-item-react';
8
8
  *
9
9
  * @see {@link IntegrationElementEventMap} for all available events.
10
10
  */
11
- export const IntegrationReact = forwardRef((props, ref) => {
11
+ export const Integration = forwardRef((props, ref) => {
12
12
  const { children, integrationId, playlistId, index, hidden, topLevelIframe, placement, mediaItems, configs, preventLoadIntegration, ...rest } = props;
13
13
  const elementRef = useRef(null);
14
14
  if (mediaItems && playlistId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glomex/integration-react",
3
- "version": "1.1299.0",
3
+ "version": "1.1300.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.1299.0"
30
+ "@glomex/integration-web-component": "^1.1300.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": "0639a6ddf352930238f560cc0887345f7b401d60"
43
+ "gitHead": "52ba21ca8adb9ac37b354f47b8bf10532920badb"
44
44
  }