promogame-player 2.0.7 → 2.0.9

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,14 +1,14 @@
1
1
  import { jsxs as E, jsx as s } from "react/jsx-runtime";
2
2
  import * as M from "react";
3
- import { useState as o, useRef as R, useImperativeHandle as y, useEffect as m, useMemo as $ } from "react";
3
+ import { useState as o, useRef as R, useImperativeHandle as $, useEffect as m, useMemo as b } from "react";
4
4
  import j from "../../hooks/use-broadcast-channel.js";
5
5
  import { cn as p } from "../../utils.js";
6
6
  import { DefaultLoading as x } from "./default-loading.js";
7
7
  const L = M.forwardRef(
8
- ({ className: h, gameLink: t, loadingComponent: r, controlLoading: l, campaign: c }, v) => {
8
+ ({ className: v, gameLink: t, loadingComponent: r, controlLoading: l, campaign: i }, h) => {
9
9
  const [e, w] = o(!1), g = R(null);
10
- y(
11
- v,
10
+ $(
11
+ h,
12
12
  () => ({
13
13
  canvas: g.current,
14
14
  sendMessage: () => {
@@ -18,10 +18,10 @@ const L = M.forwardRef(
18
18
  }),
19
19
  []
20
20
  );
21
- const [n, C] = o(!1), { message: i } = j("defold_channel");
21
+ const [n, C] = o(!1), { message: c } = j("defold_channel");
22
22
  m(() => {
23
- i === "loading_completed" && (console.log("Game init completed"), C(!0));
24
- }, [i]), m(() => {
23
+ c === "loading_completed" && (console.log("Game init completed"), C(!0));
24
+ }, [c]), m(() => {
25
25
  const a = document.createElement("script");
26
26
  return a.src = `${t}/dmloader.js`, a.async = !0, a.onload = () => {
27
27
  window.CUSTOM_PARAMETERS = {
@@ -32,12 +32,12 @@ const L = M.forwardRef(
32
32
  archive_location_filter: (_) => `${t}/archive${_}`,
33
33
  resize_window_callback: () => {
34
34
  }
35
- }, window.EngineLoader.load("canvas", `${t}/luckywheel`);
35
+ }, window.EngineLoader.load("canvas", `${t}/build`);
36
36
  }, document.body.appendChild(a), () => {
37
37
  document.body.removeChild(a);
38
38
  };
39
39
  }, [t]);
40
- const [d, u] = o(!1), f = $(() => {
40
+ const [d, u] = o(!1), f = b(() => {
41
41
  if (!e || !n || l && !d)
42
42
  return !0;
43
43
  }, [e, n, l, d]);
@@ -45,7 +45,7 @@ const L = M.forwardRef(
45
45
  /* @__PURE__ */ s("div", { className: p("absolute inset-0 z-10 flex items-center justify-center", !f && "hidden"), children: f && (r ? /* @__PURE__ */ s(
46
46
  r,
47
47
  {
48
- campaign: c,
48
+ campaign: i,
49
49
  progress: e ? 0.95 : 0.5,
50
50
  loadingCompleted: e && n,
51
51
  closeLoading: () => u(!0)
@@ -53,13 +53,13 @@ const L = M.forwardRef(
53
53
  ) : /* @__PURE__ */ s(
54
54
  x,
55
55
  {
56
- campaign: c,
56
+ campaign: i,
57
57
  progress: e ? 0.95 : 0.5,
58
58
  loadingCompleted: e && n,
59
59
  closeLoading: () => u(!0)
60
60
  }
61
61
  )) }),
62
- /* @__PURE__ */ s("div", { id: "app-container", className: p("canvas-app-container h-full w-full", h, !e && "hidden"), children: /* @__PURE__ */ s(
62
+ /* @__PURE__ */ s("div", { id: "app-container", className: p("canvas-app-container h-full w-full", v, !e && "hidden"), children: /* @__PURE__ */ s(
63
63
  "div",
64
64
  {
65
65
  id: "canvas-container",
@@ -7,6 +7,7 @@ export interface PromogamePlayerProps extends React.RefAttributes<PromogamePlaye
7
7
  authenticateRequestId?: string;
8
8
  authenticateRequestPassword?: string;
9
9
  campaignId?: string;
10
+ ticketCode?: string;
10
11
  checksum?: string;
11
12
  externalUserId?: string;
12
13
  requestedAt?: string;