@playruo/embed 1.3.0 → 1.3.2

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/dist/index.d.cts CHANGED
@@ -17,6 +17,12 @@ interface DemoCompletedPayload {
17
17
  reason?: string;
18
18
  storeUrl?: string;
19
19
  }
20
+ type PlayruoEventPayload = Record<string, unknown> & {
21
+ action?: string;
22
+ category?: string;
23
+ event?: string;
24
+ name?: string;
25
+ };
20
26
 
21
27
  interface PlayruoEmbedActions {
22
28
  /** Start the demo session */
@@ -44,10 +50,17 @@ interface PlayruoEmbedProps {
44
50
  onReady?: () => void;
45
51
  onStateChange?: (state: PlayruoEmbedState) => void;
46
52
  onDemoCompleted?: (data: DemoCompletedPayload) => void;
53
+ onEvent?: (data: PlayruoEventPayload) => void;
47
54
  onPurchaseRequest?: (data: {
48
55
  storeUrl: string;
49
56
  }) => void;
50
57
  onError?: (error: string) => void;
58
+ /**
59
+ * Forward playruo_event messages to the parent window when the package host
60
+ * itself is embedded in another iframe. Direct host pages already receive the
61
+ * original iframe postMessage.
62
+ */
63
+ forwardEventsToParent?: boolean;
51
64
  /**
52
65
  * Single render entry point representing the current status.
53
66
  * Provides status, message, and available actions based on current state.
@@ -103,7 +116,14 @@ interface PlayruoStreamStartMessage {
103
116
  interface PlayruoStreamStopMessage {
104
117
  type: "playruo_stream_stop";
105
118
  }
106
- type PlayruoEmbedMessage = PlayruoReadyMessage | PlayruoStateUpdateMessage | PlayruoPurchaseRequestMessage | PlayruoDemoCompletedMessage | PlayruoErrorMessage | PlayruoSessionOverMessage | PlayruoStreamStartMessage | PlayruoStreamStopMessage;
119
+ interface PlayruoRequestExitFullscreenMessage {
120
+ type: "REQUEST_EXIT_FULLSCREEN";
121
+ }
122
+ interface PlayruoEventMessage {
123
+ type: "playruo_event";
124
+ data: PlayruoEventPayload;
125
+ }
126
+ type PlayruoEmbedMessage = PlayruoReadyMessage | PlayruoStateUpdateMessage | PlayruoPurchaseRequestMessage | PlayruoDemoCompletedMessage | PlayruoErrorMessage | PlayruoSessionOverMessage | PlayruoStreamStartMessage | PlayruoStreamStopMessage | PlayruoRequestExitFullscreenMessage | PlayruoEventMessage;
107
127
  interface PlayruoInternalMessage {
108
128
  type: "playruo";
109
129
  action: "tryNowClick" | "exitFullscreen" | "mute" | "unmute";
@@ -136,4 +156,4 @@ interface BuildUrlParams {
136
156
  */
137
157
  declare const buildEmbedUrl: ({ operation, storeUrl }: BuildUrlParams) => string;
138
158
 
139
- export { type DemoCompletedPayload, EmbedTester, type EmbedTesterProps, type PlayruoDemoCompletedMessage, PlayruoEmbed, type PlayruoEmbedActions, type PlayruoEmbedMessage, type PlayruoEmbedProps, type PlayruoEmbedRenderState, type PlayruoEmbedState, type PlayruoErrorMessage, type PlayruoInternalMessage, type PlayruoPurchaseRequestMessage, type PlayruoReadyMessage, type PlayruoSessionOverMessage, type PlayruoStateUpdateMessage, type PlayruoStreamStartMessage, buildEmbedUrl, isPlayruoEmbedMessage, isPlayruoInternalMessage };
159
+ export { type DemoCompletedPayload, EmbedTester, type EmbedTesterProps, type PlayruoDemoCompletedMessage, PlayruoEmbed, type PlayruoEmbedActions, type PlayruoEmbedMessage, type PlayruoEmbedProps, type PlayruoEmbedRenderState, type PlayruoEmbedState, type PlayruoErrorMessage, type PlayruoEventMessage, type PlayruoEventPayload, type PlayruoInternalMessage, type PlayruoPurchaseRequestMessage, type PlayruoReadyMessage, type PlayruoRequestExitFullscreenMessage, type PlayruoSessionOverMessage, type PlayruoStateUpdateMessage, type PlayruoStreamStartMessage, type PlayruoStreamStopMessage, buildEmbedUrl, isPlayruoEmbedMessage, isPlayruoInternalMessage };
package/dist/index.d.ts CHANGED
@@ -17,6 +17,12 @@ interface DemoCompletedPayload {
17
17
  reason?: string;
18
18
  storeUrl?: string;
19
19
  }
20
+ type PlayruoEventPayload = Record<string, unknown> & {
21
+ action?: string;
22
+ category?: string;
23
+ event?: string;
24
+ name?: string;
25
+ };
20
26
 
21
27
  interface PlayruoEmbedActions {
22
28
  /** Start the demo session */
@@ -44,10 +50,17 @@ interface PlayruoEmbedProps {
44
50
  onReady?: () => void;
45
51
  onStateChange?: (state: PlayruoEmbedState) => void;
46
52
  onDemoCompleted?: (data: DemoCompletedPayload) => void;
53
+ onEvent?: (data: PlayruoEventPayload) => void;
47
54
  onPurchaseRequest?: (data: {
48
55
  storeUrl: string;
49
56
  }) => void;
50
57
  onError?: (error: string) => void;
58
+ /**
59
+ * Forward playruo_event messages to the parent window when the package host
60
+ * itself is embedded in another iframe. Direct host pages already receive the
61
+ * original iframe postMessage.
62
+ */
63
+ forwardEventsToParent?: boolean;
51
64
  /**
52
65
  * Single render entry point representing the current status.
53
66
  * Provides status, message, and available actions based on current state.
@@ -103,7 +116,14 @@ interface PlayruoStreamStartMessage {
103
116
  interface PlayruoStreamStopMessage {
104
117
  type: "playruo_stream_stop";
105
118
  }
106
- type PlayruoEmbedMessage = PlayruoReadyMessage | PlayruoStateUpdateMessage | PlayruoPurchaseRequestMessage | PlayruoDemoCompletedMessage | PlayruoErrorMessage | PlayruoSessionOverMessage | PlayruoStreamStartMessage | PlayruoStreamStopMessage;
119
+ interface PlayruoRequestExitFullscreenMessage {
120
+ type: "REQUEST_EXIT_FULLSCREEN";
121
+ }
122
+ interface PlayruoEventMessage {
123
+ type: "playruo_event";
124
+ data: PlayruoEventPayload;
125
+ }
126
+ type PlayruoEmbedMessage = PlayruoReadyMessage | PlayruoStateUpdateMessage | PlayruoPurchaseRequestMessage | PlayruoDemoCompletedMessage | PlayruoErrorMessage | PlayruoSessionOverMessage | PlayruoStreamStartMessage | PlayruoStreamStopMessage | PlayruoRequestExitFullscreenMessage | PlayruoEventMessage;
107
127
  interface PlayruoInternalMessage {
108
128
  type: "playruo";
109
129
  action: "tryNowClick" | "exitFullscreen" | "mute" | "unmute";
@@ -136,4 +156,4 @@ interface BuildUrlParams {
136
156
  */
137
157
  declare const buildEmbedUrl: ({ operation, storeUrl }: BuildUrlParams) => string;
138
158
 
139
- export { type DemoCompletedPayload, EmbedTester, type EmbedTesterProps, type PlayruoDemoCompletedMessage, PlayruoEmbed, type PlayruoEmbedActions, type PlayruoEmbedMessage, type PlayruoEmbedProps, type PlayruoEmbedRenderState, type PlayruoEmbedState, type PlayruoErrorMessage, type PlayruoInternalMessage, type PlayruoPurchaseRequestMessage, type PlayruoReadyMessage, type PlayruoSessionOverMessage, type PlayruoStateUpdateMessage, type PlayruoStreamStartMessage, buildEmbedUrl, isPlayruoEmbedMessage, isPlayruoInternalMessage };
159
+ export { type DemoCompletedPayload, EmbedTester, type EmbedTesterProps, type PlayruoDemoCompletedMessage, PlayruoEmbed, type PlayruoEmbedActions, type PlayruoEmbedMessage, type PlayruoEmbedProps, type PlayruoEmbedRenderState, type PlayruoEmbedState, type PlayruoErrorMessage, type PlayruoEventMessage, type PlayruoEventPayload, type PlayruoInternalMessage, type PlayruoPurchaseRequestMessage, type PlayruoReadyMessage, type PlayruoRequestExitFullscreenMessage, type PlayruoSessionOverMessage, type PlayruoStateUpdateMessage, type PlayruoStreamStartMessage, type PlayruoStreamStopMessage, buildEmbedUrl, isPlayruoEmbedMessage, isPlayruoInternalMessage };