@maestro_io/maestro-web-sdk 1.0.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/dist/BetsIcon-UrnN4lvP.js +22 -0
- package/dist/BetsIcon-UrnN4lvP.js.map +1 -0
- package/dist/FantasyIcon-DmloKsq_.js +24 -0
- package/dist/FantasyIcon-DmloKsq_.js.map +1 -0
- package/dist/KeyPlayErrorStateView-Dk89rtUq.js +112 -0
- package/dist/KeyPlayErrorStateView-Dk89rtUq.js.map +1 -0
- package/dist/KeyPlaysIcon-Br9gu_Zu.js +24 -0
- package/dist/KeyPlaysIcon-Br9gu_Zu.js.map +1 -0
- package/dist/KeyPlaysView-Br-88ytG.js +174 -0
- package/dist/KeyPlaysView-Br-88ytG.js.map +1 -0
- package/dist/PlayIcon-CNKWNaLP.js +24 -0
- package/dist/PlayIcon-CNKWNaLP.js.map +1 -0
- package/dist/StatsIcon-Ds4hriWX.js +25 -0
- package/dist/StatsIcon-Ds4hriWX.js.map +1 -0
- package/dist/WarningIcon-BuzZKL26.js +24 -0
- package/dist/WarningIcon-BuzZKL26.js.map +1 -0
- package/dist/index-BaSckwps.js +2998 -0
- package/dist/index-BaSckwps.js.map +1 -0
- package/dist/index-DXErYNZH.js +151 -0
- package/dist/index-DXErYNZH.js.map +1 -0
- package/dist/index-q5GKgbOd.js +56 -0
- package/dist/index-q5GKgbOd.js.map +1 -0
- package/dist/index.d.ts +382 -0
- package/dist/maestro-web-sdk.esm.js +6 -0
- package/dist/maestro-web-sdk.esm.js.map +1 -0
- package/dist/maestro-web-sdk.umd.js +3 -0
- package/dist/maestro-web-sdk.umd.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import t, { useSyncExternalStore as r } from "react";
|
|
2
|
+
import { S as m, d as l, P as y } from "./index-BaSckwps.js";
|
|
3
|
+
const u = {
|
|
4
|
+
borderRadius: 6,
|
|
5
|
+
display: "flex",
|
|
6
|
+
justifyContent: "center",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
cursor: "pointer",
|
|
9
|
+
width: "100%",
|
|
10
|
+
border: "none"
|
|
11
|
+
}, d = (e) => {
|
|
12
|
+
const n = {
|
|
13
|
+
...u,
|
|
14
|
+
...e.style
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ t.createElement("button", { style: n, ...e }, e.children);
|
|
17
|
+
}, E = t.lazy(() => import("./KeyPlaysIcon-Br9gu_Zu.js")), g = t.lazy(() => import("./PlayIcon-CNKWNaLP.js")), h = t.lazy(() => import("./BetsIcon-UrnN4lvP.js")), v = t.lazy(() => import("./StatsIcon-Ds4hriWX.js")), N = t.lazy(() => import("./FantasyIcon-DmloKsq_.js")), P = t.lazy(() => import("./WarningIcon-BuzZKL26.js")), b = {
|
|
18
|
+
keyPlays: E,
|
|
19
|
+
play: g,
|
|
20
|
+
bets: h,
|
|
21
|
+
stats: v,
|
|
22
|
+
fantasy: N,
|
|
23
|
+
warning: P
|
|
24
|
+
}, i = (e) => /* @__PURE__ */ t.createElement("div", { style: { width: e.width, height: e.height } }), f = (e) => {
|
|
25
|
+
const n = b[e.iconName];
|
|
26
|
+
return n ? /* @__PURE__ */ t.createElement(
|
|
27
|
+
t.Suspense,
|
|
28
|
+
{
|
|
29
|
+
fallback: /* @__PURE__ */ t.createElement(i, { width: e.width, height: e.height })
|
|
30
|
+
},
|
|
31
|
+
/* @__PURE__ */ t.createElement(
|
|
32
|
+
n,
|
|
33
|
+
{
|
|
34
|
+
iconName: e.iconName,
|
|
35
|
+
height: e.height,
|
|
36
|
+
width: e.width
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
) : /* @__PURE__ */ t.createElement(i, { width: e.width, height: e.height });
|
|
40
|
+
}, S = 10009, w = ({ onBack: e, onLeft: n, active: a }) => {
|
|
41
|
+
t.useEffect(() => {
|
|
42
|
+
const s = new AbortController();
|
|
43
|
+
return window.addEventListener(
|
|
44
|
+
"keydown",
|
|
45
|
+
(o) => {
|
|
46
|
+
a && ((o.keyCode === S || o.key === "b") && (e == null || e(o)), (o.key === "ArrowLeft" || o.keyCode === 37) && (n == null || n(o)));
|
|
47
|
+
},
|
|
48
|
+
{ signal: s.signal }
|
|
49
|
+
), () => {
|
|
50
|
+
s.abort();
|
|
51
|
+
};
|
|
52
|
+
}, [a, e, n]);
|
|
53
|
+
}, A = (e) => {
|
|
54
|
+
const n = m.getMaestroEventViewModel();
|
|
55
|
+
e.dataset.focused = "false", l.pause(), n.delegate.startFocusManagement();
|
|
56
|
+
}, z = (e) => {
|
|
57
|
+
const { ref: n, focused: a } = l.useFocusable({
|
|
58
|
+
focusKey: `PANEL_NAV_BUTTON_${e.index}`,
|
|
59
|
+
onFocus: e.onEnter
|
|
60
|
+
});
|
|
61
|
+
return w({
|
|
62
|
+
active: e.index === 0 && a,
|
|
63
|
+
onLeft: () => {
|
|
64
|
+
A(n.current);
|
|
65
|
+
}
|
|
66
|
+
}), /* @__PURE__ */ t.createElement(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: [
|
|
70
|
+
"panel-nav-button-container",
|
|
71
|
+
"T02",
|
|
72
|
+
e.active ? "panel-nav-button-active" : ""
|
|
73
|
+
].join(" "),
|
|
74
|
+
ref: n
|
|
75
|
+
},
|
|
76
|
+
/* @__PURE__ */ t.createElement(d, null, /* @__PURE__ */ t.createElement(f, { iconName: e.iconName, height: 36, width: 36 })),
|
|
77
|
+
e.children
|
|
78
|
+
);
|
|
79
|
+
}, I = (e) => {
|
|
80
|
+
const { ref: n, focusKey: a } = l.useFocusable({
|
|
81
|
+
focusKey: "PANEL_NAVIGATION"
|
|
82
|
+
});
|
|
83
|
+
return /* @__PURE__ */ t.createElement(l.FocusContext.Provider, { value: a }, /* @__PURE__ */ t.createElement("div", { className: "panel-navigation", ref: n }, e.items.map((s, o) => /* @__PURE__ */ t.createElement(
|
|
84
|
+
z,
|
|
85
|
+
{
|
|
86
|
+
iconName: s.iconName,
|
|
87
|
+
key: s.title,
|
|
88
|
+
index: o,
|
|
89
|
+
onEnter: s.onEnter,
|
|
90
|
+
active: s.active
|
|
91
|
+
},
|
|
92
|
+
s.title
|
|
93
|
+
))));
|
|
94
|
+
}, c = new y(), T = t.lazy(
|
|
95
|
+
() => import("./KeyPlaysView-Br-88ytG.js")
|
|
96
|
+
), _ = {
|
|
97
|
+
keyPlays: /* @__PURE__ */ t.createElement(T, null),
|
|
98
|
+
bets: /* @__PURE__ */ t.createElement("div", { className: "panel-coming-soon T02" }, "Bets - Coming Soon"),
|
|
99
|
+
stats: /* @__PURE__ */ t.createElement("div", { className: "panel-coming-soon T02" }, "Stats - Coming Soon"),
|
|
100
|
+
fantasy: /* @__PURE__ */ t.createElement("div", { className: "panel-coming-soon T02" }, "Fantasy - Coming Soon")
|
|
101
|
+
}, C = () => {
|
|
102
|
+
const e = r(
|
|
103
|
+
(a) => c.currentPanelObservable.subscribe(a),
|
|
104
|
+
() => c.currentPanel
|
|
105
|
+
), n = [
|
|
106
|
+
{
|
|
107
|
+
iconName: "keyPlays",
|
|
108
|
+
onEnter: () => {
|
|
109
|
+
c.currentPanel = "keyPlays";
|
|
110
|
+
},
|
|
111
|
+
title: "KEY PLAYS",
|
|
112
|
+
active: e === "keyPlays"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
iconName: "bets",
|
|
116
|
+
onEnter: () => {
|
|
117
|
+
c.currentPanel = "bets";
|
|
118
|
+
},
|
|
119
|
+
title: "BETS",
|
|
120
|
+
active: e === "bets"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
iconName: "stats",
|
|
124
|
+
onEnter: () => {
|
|
125
|
+
c.currentPanel = "stats";
|
|
126
|
+
},
|
|
127
|
+
title: "STATS",
|
|
128
|
+
active: e === "stats"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
iconName: "fantasy",
|
|
132
|
+
onEnter: () => {
|
|
133
|
+
c.currentPanel = "fantasy";
|
|
134
|
+
},
|
|
135
|
+
title: "FANTASY",
|
|
136
|
+
active: e === "fantasy"
|
|
137
|
+
}
|
|
138
|
+
];
|
|
139
|
+
return /* @__PURE__ */ t.createElement("div", { className: "sdk--panel-manager" }, /* @__PURE__ */ t.createElement(I, { items: n }), /* @__PURE__ */ t.createElement("div", { className: "sdk--panel-wrapper" }, /* @__PURE__ */ t.createElement(t.Suspense, { fallback: null }, _[e])));
|
|
140
|
+
}, L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
141
|
+
__proto__: null,
|
|
142
|
+
default: C
|
|
143
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
144
|
+
export {
|
|
145
|
+
d as B,
|
|
146
|
+
f as I,
|
|
147
|
+
A as d,
|
|
148
|
+
L as i,
|
|
149
|
+
w as u
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=index-DXErYNZH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DXErYNZH.js","sources":["../src/components/atoms/BaseButton/BaseButton.tsx","../src/components/atoms/SvgIcon/Icon.tsx","../src/hooks/use-remote-control.ts","../src/helpers/deliver-focus.ts","../src/components/molecules/PanelNavButton/PanelNavButton.tsx","../src/components/organisms/PanelNavigation/PanelNavigation.tsx","../src/components/core/PanelManager/PanelManager.tsx"],"sourcesContent":["import React from 'react';\nimport { ButtonHTMLAttributes } from 'react';\n\nconst ButtonStyle: React.CSSProperties = {\n borderRadius: 6,\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n cursor: 'pointer',\n width: '100%',\n border: 'none',\n};\n\ntype Props = {\n ref?: React.RefObject<HTMLButtonElement>;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\nconst BaseButton = (props: Props) => {\n const style = {\n ...ButtonStyle,\n ...props.style,\n };\n\n return (\n <button style={style} {...props}>\n {props.children}\n </button>\n );\n};\n\nexport default BaseButton;\n","import React from 'react';\n\nconst LazyKeyPlaysIcon = React.lazy(() => import('./KeyPlaysIcon'));\nconst LazyPlayIcon = React.lazy(() => import('./PlayIcon'));\nconst LazyBetsIcon = React.lazy(() => import('./BetsIcon'));\nconst LazyStatsIcon = React.lazy(() => import('./StatsIcon'));\nconst LazyFantasyIcon = React.lazy(() => import('./FantasyIcon'));\nconst LazyWarningIcon = React.lazy(() => import('./WarningIcon'));\n\nconst ICONS_MAP = {\n keyPlays: LazyKeyPlaysIcon,\n play: LazyPlayIcon,\n bets: LazyBetsIcon,\n stats: LazyStatsIcon,\n fantasy: LazyFantasyIcon,\n warning: LazyWarningIcon,\n};\n\nexport type IconsName = keyof typeof ICONS_MAP;\n\nexport type IconProps = {\n iconName: IconsName;\n width: number;\n height: number;\n};\n\nconst Skeleton = (props: Omit<IconProps, 'iconName'>) => (\n <div style={{ width: props.width, height: props.height }} />\n);\n\nconst Icon = (props: IconProps) => {\n const Icon = ICONS_MAP[props.iconName];\n if (!Icon) {\n return <Skeleton width={props.width} height={props.height} />;\n }\n\n return (\n <React.Suspense\n fallback={<Skeleton width={props.width} height={props.height} />}\n >\n <Icon\n iconName={props.iconName}\n height={props.height}\n width={props.width}\n />\n </React.Suspense>\n );\n};\n\nexport default Icon;\n","import React from 'react';\n\ntype Props = {\n active: boolean;\n onBack?: (e: KeyboardEvent) => void;\n onLeft?: (e: KeyboardEvent) => void;\n};\n\nconst BACK_KEY_CODE = 10009;\n\nconst useRemoteControl = ({ onBack, onLeft, active }: Props) => {\n React.useEffect(() => {\n const abort = new AbortController();\n\n window.addEventListener(\n 'keydown',\n (e) => {\n if (!active) {\n return;\n }\n\n if (e.keyCode === BACK_KEY_CODE || e.key === 'b') {\n onBack?.(e);\n }\n\n if (e.key === 'ArrowLeft' || e.keyCode === 37) {\n onLeft?.(e);\n }\n },\n { signal: abort.signal }\n );\n\n return () => {\n abort.abort();\n };\n }, [active, onBack, onLeft]);\n};\n\nexport default useRemoteControl;\n","import { pause } from '@noriginmedia/norigin-spatial-navigation';\nimport SDK from '..';\n\n/**\n * @description Useful when you want to lose the focus of the SDK and delegate it to the Client App.\n */\nconst deliverFocus = (e: HTMLElement) => {\n const eventVm = SDK.getMaestroEventViewModel();\n e.dataset['focused'] = 'false';\n pause();\n eventVm.delegate.startFocusManagement();\n};\n\nexport default deliverFocus;\n","import { PropsWithChildren } from 'react';\nimport BaseButton from '@/components/atoms/BaseButton/BaseButton';\nimport Icon, { IconsName } from '@/components/atoms/SvgIcon/Icon';\nimport './PanelNavButton.styles.css';\nimport { useFocusable } from '@noriginmedia/norigin-spatial-navigation';\nimport useRemoteControl from '@/hooks/use-remote-control';\nimport deliverFocus from '@/helpers/deliver-focus';\nimport React from 'react';\n\ntype PanelNavButtonProps = {\n iconName: IconsName;\n index: number;\n onEnter: () => void;\n active: boolean;\n} & PropsWithChildren;\n\nconst PanelNavButton = (props: PanelNavButtonProps) => {\n const { ref, focused } = useFocusable({\n focusKey: `PANEL_NAV_BUTTON_${props.index}`,\n onFocus: props.onEnter,\n });\n\n useRemoteControl({\n active: props.index === 0 && focused,\n onLeft: () => {\n deliverFocus(ref.current as HTMLDivElement);\n },\n });\n\n return (\n <div\n className={[\n 'panel-nav-button-container',\n 'T02',\n props.active ? 'panel-nav-button-active' : '',\n ].join(' ')}\n ref={ref}\n >\n <BaseButton>\n <Icon iconName={props.iconName} height={36} width={36} />\n </BaseButton>\n {props.children}\n </div>\n );\n};\n\nexport default PanelNavButton;\n","import PanelNavButton from '@/components/molecules/PanelNavButton';\nimport { IconsName } from '@/components/atoms/SvgIcon/Icon';\nimport './PanelNavigation.styles.css';\nimport {\n FocusContext,\n useFocusable,\n} from '@noriginmedia/norigin-spatial-navigation';\nimport React from 'react';\n\ntype PanelNavigationProps = {\n items: {\n title: string;\n onEnter: () => void;\n iconName: IconsName;\n active: boolean;\n }[];\n};\n\nconst PanelNavigation = (props: PanelNavigationProps) => {\n const { ref, focusKey } = useFocusable({\n focusKey: 'PANEL_NAVIGATION',\n });\n\n return (\n <FocusContext.Provider value={focusKey}>\n <div className=\"panel-navigation\" ref={ref}>\n {props.items.map((item, index) => (\n <PanelNavButton\n iconName={item.iconName}\n key={item.title}\n index={index}\n onEnter={item.onEnter}\n active={item.active}\n >\n {item.title}\n </PanelNavButton>\n ))}\n </div>\n </FocusContext.Provider>\n );\n};\n\nexport default PanelNavigation;\n","import React, { useSyncExternalStore } from 'react';\nimport { PanelManagerViewModel } from '@/view-models/PanelManagerViewModel';\nimport './PanelManager.styles.css';\nimport PanelNavigation from '@/components/organisms/PanelNavigation';\nimport { MaestroPanelType } from '@/models/IPanel';\n\nconst panelManagerViewModel = new PanelManagerViewModel();\n\nconst LazyKeyPlays = React.lazy(\n () => import('@/modules/key-plays/view/KeyPlaysView')\n);\n\nconst PANELS_MAP: Record<MaestroPanelType, React.ReactNode> = {\n keyPlays: <LazyKeyPlays />,\n bets: <div className=\"panel-coming-soon T02\">Bets - Coming Soon</div>,\n stats: <div className=\"panel-coming-soon T02\">Stats - Coming Soon</div>,\n fantasy: <div className=\"panel-coming-soon T02\">Fantasy - Coming Soon</div>,\n};\n\nconst PanelManager = () => {\n const activePanel = useSyncExternalStore(\n (l) => panelManagerViewModel.currentPanelObservable.subscribe(l),\n () => panelManagerViewModel.currentPanel\n );\n\n const PANEL_ITEMS: {\n title: string;\n onEnter: () => void;\n iconName: MaestroPanelType;\n active: boolean;\n }[] = [\n {\n iconName: 'keyPlays',\n onEnter: () => {\n panelManagerViewModel.currentPanel = 'keyPlays';\n },\n title: 'KEY PLAYS',\n active: activePanel === 'keyPlays',\n },\n {\n iconName: 'bets',\n onEnter: () => {\n panelManagerViewModel.currentPanel = 'bets';\n },\n title: 'BETS',\n active: activePanel === 'bets',\n },\n {\n iconName: 'stats',\n onEnter: () => {\n panelManagerViewModel.currentPanel = 'stats';\n },\n title: 'STATS',\n active: activePanel === 'stats',\n },\n {\n iconName: 'fantasy',\n onEnter: () => {\n panelManagerViewModel.currentPanel = 'fantasy';\n },\n title: 'FANTASY',\n active: activePanel === 'fantasy',\n },\n ];\n\n return (\n <div className=\"sdk--panel-manager\">\n <PanelNavigation items={PANEL_ITEMS} />\n <div className=\"sdk--panel-wrapper\">\n <React.Suspense fallback={null}>\n {PANELS_MAP[activePanel]}\n </React.Suspense>\n </div>\n </div>\n );\n};\n\nexport default PanelManager;\n"],"names":["ButtonStyle","BaseButton","props","style","LazyKeyPlaysIcon","React","LazyPlayIcon","LazyBetsIcon","LazyStatsIcon","LazyFantasyIcon","LazyWarningIcon","ICONS_MAP","Skeleton","Icon","BACK_KEY_CODE","useRemoteControl","onBack","onLeft","active","abort","e","deliverFocus","eventVm","SDK","pause","PanelNavButton","ref","focused","useFocusable","PanelNavigation","focusKey","FocusContext","item","index","panelManagerViewModel","PanelManagerViewModel","LazyKeyPlays","PANELS_MAP","PanelManager","activePanel","useSyncExternalStore","l","PANEL_ITEMS"],"mappings":";;AAGA,MAAMA,IAAmC;AAAA,EACvC,cAAc;AAAA,EACd,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AACV,GAMMC,IAAa,CAACC,MAAiB;AACnC,QAAMC,IAAQ;AAAA,IACZ,GAAGH;AAAA,IACH,GAAGE,EAAM;AAAA,EACX;AAEA,yCACG,UAAO,EAAA,OAAAC,GAAe,GAAGD,EAAA,GACvBA,EAAM,QACT;AAEJ,GC1BME,IAAmBC,EAAM,KAAK,MAAM,OAAO,4BAAgB,CAAC,GAC5DC,IAAeD,EAAM,KAAK,MAAM,OAAO,wBAAY,CAAC,GACpDE,IAAeF,EAAM,KAAK,MAAM,OAAO,wBAAY,CAAC,GACpDG,IAAgBH,EAAM,KAAK,MAAM,OAAO,yBAAa,CAAC,GACtDI,IAAkBJ,EAAM,KAAK,MAAM,OAAO,2BAAe,CAAC,GAC1DK,IAAkBL,EAAM,KAAK,MAAM,OAAO,2BAAe,CAAC,GAE1DM,IAAY;AAAA,EAChB,UAAUP;AAA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,EAAA,cAAA,OAAA,EAAI,WAAU,qBACb,GAAA,gBAAAA,EAAA,cAACA,EAAM,UAAN,EAAe,UAAU,QACvBgC,EAAWE,CAAW,CACzB,CACF,CACF;AAEJ;;;;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import n, { useLayoutEffect as s } from "react";
|
|
2
|
+
const o = "BentonSans-Medium", c = {
|
|
3
|
+
colors: {
|
|
4
|
+
// Accent colors
|
|
5
|
+
accentPrimary: "#FFFFFF",
|
|
6
|
+
// Secondary accent colors
|
|
7
|
+
accentSecondary: "#3C3F47",
|
|
8
|
+
// Tertiary accent colors
|
|
9
|
+
accentTertiary: "#0C0C0E",
|
|
10
|
+
// Surface Colors
|
|
11
|
+
surface1: "#080A0C",
|
|
12
|
+
surface2: "#12141A",
|
|
13
|
+
surface3: "#1B1E26",
|
|
14
|
+
surface4: "#242833",
|
|
15
|
+
surface5: "#363C4D",
|
|
16
|
+
surface6: "#3E4759",
|
|
17
|
+
// Highlight colors
|
|
18
|
+
highlightPrimary: "#FFFFFF",
|
|
19
|
+
highlightSecondary: "#9A9EA9",
|
|
20
|
+
highlightTertiary: "#0A0C0F",
|
|
21
|
+
// Alert colors
|
|
22
|
+
alertConfirmation: "#43D48F",
|
|
23
|
+
alertWarning: "#F58B00",
|
|
24
|
+
alertError: "#FF0000",
|
|
25
|
+
// Text colors
|
|
26
|
+
text100: "#F8F9FA",
|
|
27
|
+
text200: "#C2C5CB",
|
|
28
|
+
text300: "#8D919D",
|
|
29
|
+
text400: "#5C606B",
|
|
30
|
+
text500: "#0C0C0E"
|
|
31
|
+
},
|
|
32
|
+
typography: {
|
|
33
|
+
body: o,
|
|
34
|
+
headline: o
|
|
35
|
+
}
|
|
36
|
+
}, t = c.colors, r = c.typography, F = (a) => (s(() => (Object.keys(t).forEach((e) => {
|
|
37
|
+
document.documentElement.style.setProperty(
|
|
38
|
+
`--sdk-${e}`,
|
|
39
|
+
t[e]
|
|
40
|
+
);
|
|
41
|
+
}), Object.keys(r).forEach((e) => {
|
|
42
|
+
document.documentElement.style.setProperty(
|
|
43
|
+
`--sdk-font-${e}`,
|
|
44
|
+
r[e]
|
|
45
|
+
);
|
|
46
|
+
}), () => {
|
|
47
|
+
Object.keys(t).forEach((e) => {
|
|
48
|
+
document.documentElement.style.removeProperty(`--sdk-${e}`);
|
|
49
|
+
}), Object.keys(r).forEach((e) => {
|
|
50
|
+
document.documentElement.style.removeProperty(`--sdk-font-${e}`);
|
|
51
|
+
});
|
|
52
|
+
}), []), /* @__PURE__ */ n.createElement("div", { className: "sdk-wrapper" }, a.children));
|
|
53
|
+
export {
|
|
54
|
+
F as default
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=index-q5GKgbOd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-q5GKgbOd.js","sources":["../src/services/ThemeManager/constants.ts","../src/components/core/App/App.tsx"],"sourcesContent":["import ITheme, {\n BORDER_RADIUS,\n TEXT_CAPITALIZATION,\n THEME_MODES,\n THEME_TYPES,\n} from '@/models/ITheme';\n\nconst FONT_FAMILY = 'BentonSans-Medium';\n\nexport const DARK_THEME: ITheme = {\n _id: '6274067af74b66a544018dac',\n button: {\n borderRadius: BORDER_RADIUS.rounded,\n textCapitalization: TEXT_CAPITALIZATION.uppercase,\n },\n colors: {\n // Accent colors\n accentPrimary: '#FFFFFF',\n\n // Secondary accent colors\n accentSecondary: '#3C3F47',\n\n // Tertiary accent colors\n accentTertiary: '#0C0C0E',\n\n // Surface Colors\n surface1: '#080A0C',\n surface2: '#12141A',\n surface3: '#1B1E26',\n surface4: '#242833',\n surface5: '#363C4D',\n surface6: '#3E4759',\n\n // Highlight colors\n highlightPrimary: '#FFFFFF',\n highlightSecondary: '#9A9EA9',\n highlightTertiary: '#0A0C0F',\n\n // Alert colors\n alertConfirmation: '#43D48F',\n alertWarning: '#F58B00',\n alertError: '#FF0000',\n\n // Text colors\n text100: '#F8F9FA',\n text200: '#C2C5CB',\n text300: '#8D919D',\n text400: '#5C606B',\n text500: '#0C0C0E',\n },\n creator: '016901e60000000000000000',\n name: 'Dark Mode',\n type: THEME_TYPES.CLASSIC,\n mode: THEME_MODES.DARK,\n owner: '016901e60000000000000000',\n typography: {\n body: FONT_FAMILY,\n headline: FONT_FAMILY,\n },\n};\n","import React, { PropsWithChildren, useLayoutEffect } from 'react';\nimport { DARK_THEME } from '@/services/ThemeManager/constants';\nimport './App.styles.css';\n\nconst colors = DARK_THEME.colors;\nconst typography = DARK_THEME.typography;\n\nconst App = (props: PropsWithChildren) => {\n useLayoutEffect(() => {\n Object.keys(colors).forEach((key) => {\n document.documentElement.style.setProperty(\n `--sdk-${key}`,\n colors[key as keyof typeof DARK_THEME.colors]\n );\n });\n\n Object.keys(typography).forEach((key) => {\n document.documentElement.style.setProperty(\n `--sdk-font-${key}`,\n typography[key as keyof typeof DARK_THEME.typography]\n );\n });\n\n return () => {\n Object.keys(colors).forEach((key) => {\n document.documentElement.style.removeProperty(`--sdk-${key}`);\n });\n\n Object.keys(typography).forEach((key) => {\n document.documentElement.style.removeProperty(`--sdk-font-${key}`);\n });\n };\n }, []);\n\n return <div className=\"sdk-wrapper\">{props.children}</div>;\n};\n\nexport default App;\n"],"names":["FONT_FAMILY","DARK_THEME","colors","typography","App","props","useLayoutEffect","key","React"],"mappings":";AAOA,MAAMA,IAAc,qBAEPC,IAAqB;AAAA,EAMhC,QAAQ;AAAA;AAAA,IAEN,eAAe;AAAA;AAAA,IAGf,iBAAiB;AAAA;AAAA,IAGjB,gBAAgB;AAAA;AAAA,IAGhB,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA;AAAA,IAGV,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,mBAAmB;AAAA;AAAA,IAGnB,mBAAmB;AAAA,IACnB,cAAc;AAAA,IACd,YAAY;AAAA;AAAA,IAGZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AAAA,EAMA,YAAY;AAAA,IACV,MAAMD;AAAA,IACN,UAAUA;AAAA,EAAA;AAEd,GCvDME,IAASD,EAAW,QACpBE,IAAaF,EAAW,YAExBG,IAAM,CAACC,OACXC,EAAgB,OACd,OAAO,KAAKJ,CAAM,EAAE,QAAQ,CAACK,MAAQ;AACnC,WAAS,gBAAgB,MAAM;AAAA,IAC7B,SAASA,CAAG;AAAA,IACZL,EAAOK,CAAqC;AAAA,EAC9C;AAAA,CACD,GAED,OAAO,KAAKJ,CAAU,EAAE,QAAQ,CAACI,MAAQ;AACvC,WAAS,gBAAgB,MAAM;AAAA,IAC7B,cAAcA,CAAG;AAAA,IACjBJ,EAAWI,CAAyC;AAAA,EACtD;AAAA,CACD,GAEM,MAAM;AACX,SAAO,KAAKL,CAAM,EAAE,QAAQ,CAACK,MAAQ;AACnC,aAAS,gBAAgB,MAAM,eAAe,SAASA,CAAG,EAAE;AAAA,EAAA,CAC7D,GAED,OAAO,KAAKJ,CAAU,EAAE,QAAQ,CAACI,MAAQ;AACvC,aAAS,gBAAgB,MAAM,eAAe,cAAcA,CAAG,EAAE;AAAA,EAAA,CAClE;AACH,IACC,EAAE,GAEG,gBAAAC,EAAA,cAAA,OAAA,EAAI,WAAU,cAAA,GAAeH,EAAM,QAAS;"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
declare type AthleteId = string;
|
|
2
|
+
|
|
3
|
+
export declare type Environment = 'development' | 'staging' | 'production';
|
|
4
|
+
|
|
5
|
+
declare interface IKeyPlay {
|
|
6
|
+
id: string;
|
|
7
|
+
description: string;
|
|
8
|
+
homeTeamName: string;
|
|
9
|
+
awayTeamName: string;
|
|
10
|
+
homeTeamScore?: number;
|
|
11
|
+
awayTeamScore?: number;
|
|
12
|
+
clipID: string;
|
|
13
|
+
teamImageUrl?: string;
|
|
14
|
+
playerImageUrl?: string;
|
|
15
|
+
thumbnailImageUrl?: string;
|
|
16
|
+
section?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This is the public API that the app can use to make calls to the SDK related to the currently-loaded event.
|
|
21
|
+
*/
|
|
22
|
+
export declare interface IMaestroEvent {
|
|
23
|
+
/**
|
|
24
|
+
* @description Tells the SDK that the user just started playing a new key play clip at the given index.
|
|
25
|
+
*/
|
|
26
|
+
didStartPlayingClip(index: number): void;
|
|
27
|
+
/**
|
|
28
|
+
* @description Tells the SDK that the user just stopped playing a key play clip at the given index.
|
|
29
|
+
*/
|
|
30
|
+
didStopPlayingClip(index: number): void;
|
|
31
|
+
/**
|
|
32
|
+
* @description Tells the SDK that the user tried to play the clip but it failed to play back.
|
|
33
|
+
*/
|
|
34
|
+
didFailToPlayClip(index: number): void;
|
|
35
|
+
/**
|
|
36
|
+
* @description Updates the SDK with the latest progress in the playback of the currently-played key play clip, from 0 to 1.
|
|
37
|
+
*/
|
|
38
|
+
didUpdatePlaybackProgressOfClip(index: number, to: number): void;
|
|
39
|
+
/**
|
|
40
|
+
* @description Tells the SDK that the app displayed the MaestroPanel.
|
|
41
|
+
*/
|
|
42
|
+
didShowPanel(): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* @description Tells the SDK that the app hid the MaestroPanel.
|
|
45
|
+
*/
|
|
46
|
+
didHidePanel(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* @description Alerts the SDK that the current event does not support key plays.
|
|
49
|
+
*/
|
|
50
|
+
currentEventDoesNotSupportKeyPlays(): void;
|
|
51
|
+
/**
|
|
52
|
+
* @description Retrieves the event ID for the currently loaded event.
|
|
53
|
+
*/
|
|
54
|
+
getCurrentEventID(): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* @description Retrieves the array index of the key play clip that is currently being played.
|
|
57
|
+
*/
|
|
58
|
+
getCurrentlyPlayingClipIndex(): number | null;
|
|
59
|
+
/**
|
|
60
|
+
* @description Retrieves the array index of the key plays clip that was most recently played.
|
|
61
|
+
*/
|
|
62
|
+
getLastPlayedClipIndex(): number | null;
|
|
63
|
+
/**
|
|
64
|
+
* @description Retrieves the progress (between 0 and 1) of the currently-played key play clip.
|
|
65
|
+
*/
|
|
66
|
+
getCurrentClipPlaybackProgress(): number | null;
|
|
67
|
+
/**
|
|
68
|
+
* @description Retrieves the number of key plays.
|
|
69
|
+
*/
|
|
70
|
+
getKeyPlaysCount(): number | null;
|
|
71
|
+
/**
|
|
72
|
+
* @description Tells the SDK to start managing focus.
|
|
73
|
+
*/
|
|
74
|
+
startFocusManagement(): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* @description Feeds the SDK new key plays data. A null value indicates a failure to retrieve the data.
|
|
77
|
+
*/
|
|
78
|
+
updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @description Interface for the client app to implement in order to handle Maestro TV SDK events.
|
|
83
|
+
*/
|
|
84
|
+
export declare interface IMaestroEventDelegate {
|
|
85
|
+
/**
|
|
86
|
+
* @description Allows the SDK to tell the client app that the user has encountered an error screen for lack of valid key
|
|
87
|
+
plays data, indicating the client app should call `updateKeyPlaysData` as soon as possible.
|
|
88
|
+
*/
|
|
89
|
+
userRequestedNewKeyPlaysData(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Allows the SDK to request the client app play a particular key plays clip, given its array index in the key plays list. Note that the `MaestroKeyPlaysResponse` subdivides the key plays by section, so the `index` referenced here assumes the client app has access to a flattened list of the key plays, disregarding the sectional subdivisions.
|
|
92
|
+
*/
|
|
93
|
+
playClip(atIndex: number): void;
|
|
94
|
+
/**
|
|
95
|
+
* @description SDK can notify the client app when its time to handle the focus management
|
|
96
|
+
*/
|
|
97
|
+
startFocusManagement(): Promise<void>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export declare interface IMaestroKeyPlaysResponse {
|
|
101
|
+
entities: {
|
|
102
|
+
team: Record<TeamId, IMaestroKeyPlaysTeam>;
|
|
103
|
+
athlete: Record<AthleteId, MaestroKeyPlaysAthlete>;
|
|
104
|
+
};
|
|
105
|
+
sections: MaestroKeyPlaysSection[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare interface IMaestroKeyPlaysTeam {
|
|
109
|
+
id: string;
|
|
110
|
+
displayName: string;
|
|
111
|
+
shortName: string;
|
|
112
|
+
color: string;
|
|
113
|
+
alternateColor: string;
|
|
114
|
+
homeAway: string;
|
|
115
|
+
displayOrder: string;
|
|
116
|
+
logoRef: string;
|
|
117
|
+
logoDarkRef: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
This is the MaestroKit top-level API for initializing and configuring the framework. It encompasses all functionality that is not specific to an event.
|
|
122
|
+
*/
|
|
123
|
+
declare interface IMaestroManager {
|
|
124
|
+
/**
|
|
125
|
+
* @description Configure the MaestroWebSDK.
|
|
126
|
+
* @param {SDKConfigParams} configParams - Configuration parameters
|
|
127
|
+
* @param {SDKConfigParams['environment']} configParams.environment - The type of environment to use. Defaults to 'development'.
|
|
128
|
+
* @param {SDKConfigParams['pollFrequency']} configParams.pollFrequency - The frequency in seconds to poll for updates. Defaults to 5.0.
|
|
129
|
+
* @param {SDKConfigParams['progressUpdateFrequency']} configParams.progressUpdateFrequency - The frequency in seconds to update progress. Defaults to 0.1.
|
|
130
|
+
* @param {SDKConfigParams['siteID']} configParams.siteID - The site ID to use for the SDK.
|
|
131
|
+
* @param {SDKConfigParams['jwt']} configParams.jwt - The JWT token to use for authentication.
|
|
132
|
+
* @param {SDKConfigParams['userID']} configParams.userID - The user ID of the logged account.
|
|
133
|
+
*/
|
|
134
|
+
configure(configParams: SDKConfigParams): void;
|
|
135
|
+
/**
|
|
136
|
+
Tells the SDK the user has opened an event in the app's player.
|
|
137
|
+
Arguments:
|
|
138
|
+
- eventID: The Event ID for the event opened in the player.
|
|
139
|
+
- delegate: an instance of the app's implementation of IMaestroEventDelegate
|
|
140
|
+
The function returns an instance of MaestroEventViewModel, which includes an implementation of IMaestroEvent. IMaestroEvent represents the app-facing portion of the MaestroKit API related to the currently-loaded event. So after `userDidStartWatchingEvent` is called, the SDK has access to the API detailed in `MaestroEventDelegate` for making calls to the app, and the app has access to the API detailed in `IMaestroEvent` for making calls to the SDK.
|
|
141
|
+
*/
|
|
142
|
+
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate): Promise<IMaestroEvent>;
|
|
143
|
+
/**
|
|
144
|
+
* @description Tells the SDK the user has closed an event that was open in the app's player.
|
|
145
|
+
* @param eventID
|
|
146
|
+
*/
|
|
147
|
+
userDidStopWatchingEvent(eventID: string): void;
|
|
148
|
+
/**
|
|
149
|
+
* @description Authenticates user.
|
|
150
|
+
* @param id - The user's ID.
|
|
151
|
+
* @param jwt - The user's jwt.
|
|
152
|
+
*/
|
|
153
|
+
authenticateUser(id: string, jwt: string): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Logs out currently-authenticated user.
|
|
156
|
+
*/
|
|
157
|
+
deauthenticateUser(): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Gets the site ID for the SDK
|
|
160
|
+
* @returns The site ID
|
|
161
|
+
*/
|
|
162
|
+
getSiteID(): string | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Gets the JWT token for authentication
|
|
165
|
+
* @returns The JWT token
|
|
166
|
+
*/
|
|
167
|
+
getJwt(): string | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Gets the user ID for the SDK
|
|
170
|
+
* @returns The user ID
|
|
171
|
+
*/
|
|
172
|
+
getUserID(): string | undefined;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare const KEY_PLAYS_ERROR_STATE: {
|
|
176
|
+
readonly unsupportedEvent: "unsupportedEvent";
|
|
177
|
+
readonly unpopulatedEvent: "unpopulatedEvent";
|
|
178
|
+
readonly tabLoadFailure: "tabLoadFailure";
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
declare const KEY_PLAYS_LOAD_FAILURE_STATUS: {
|
|
182
|
+
readonly noFailure: "noFailure";
|
|
183
|
+
readonly recentFailure: "recentFailure";
|
|
184
|
+
readonly nonRecentFailure: "nonRecentFailure";
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
declare type KeyPlayItem = {
|
|
188
|
+
title: string;
|
|
189
|
+
items: IKeyPlay[];
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
declare type KeyPlayLoadFailureStatus = (typeof KEY_PLAYS_LOAD_FAILURE_STATUS)[keyof typeof KEY_PLAYS_LOAD_FAILURE_STATUS];
|
|
193
|
+
|
|
194
|
+
declare type KeyPlaysErrorState = (typeof KEY_PLAYS_ERROR_STATE)[keyof typeof KEY_PLAYS_ERROR_STATE];
|
|
195
|
+
|
|
196
|
+
declare class KeyPlaysViewModel {
|
|
197
|
+
currentlyPlayingClipIndex: Observable<number | null>;
|
|
198
|
+
lastPlayedClipIndex: Observable<number | null>;
|
|
199
|
+
currentClipPlaybackProgress: Observable<number | null>;
|
|
200
|
+
errorState: Observable<KeyPlaysErrorState | null>;
|
|
201
|
+
failedClips: Observable<{
|
|
202
|
+
[key: string]: KeyPlayLoadFailureStatus;
|
|
203
|
+
}>;
|
|
204
|
+
items: Observable<KeyPlayItem[]>;
|
|
205
|
+
isCurrentlyPlaying(index: number): boolean;
|
|
206
|
+
setKeyPlays(items: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
207
|
+
private cleanErrors;
|
|
208
|
+
playKeyPlay(atIndex: number): Promise<void>;
|
|
209
|
+
parseNetworkResponse(response: IMaestroKeyPlaysResponse): KeyPlayItem[];
|
|
210
|
+
get allItems(): IKeyPlay[];
|
|
211
|
+
clipID(forKeyPlayAtIndex: number): string | undefined;
|
|
212
|
+
handleKeyPlayLoadFailure(forKeyPlayAtIndex: number): void;
|
|
213
|
+
loadFailureStatus(forKeyPlayAtIndex: number): KeyPlayLoadFailureStatus;
|
|
214
|
+
clearLoadFailureStatus(forKeyPlayAtIndex: number): void;
|
|
215
|
+
userRequestedNewKeyPlaysData(): Promise<void>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare class MaestroEventViewModel extends ViewModel implements IMaestroEvent {
|
|
219
|
+
private _eventId;
|
|
220
|
+
private _title;
|
|
221
|
+
private _isLive;
|
|
222
|
+
delegate: IMaestroEventDelegate;
|
|
223
|
+
keyPlaysViewModel: KeyPlaysViewModel;
|
|
224
|
+
constructor(eventId: string | undefined, delegate: IMaestroEventDelegate);
|
|
225
|
+
deinit(): void;
|
|
226
|
+
updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
227
|
+
startFocusManagement(): Promise<void>;
|
|
228
|
+
didStartPlayingClip(index: number): void;
|
|
229
|
+
didStopPlayingClip(index: number): void;
|
|
230
|
+
didFailToPlayClip(index: number): void;
|
|
231
|
+
didUpdatePlaybackProgressOfClip(index: number, to: number): void;
|
|
232
|
+
didShowPanel(): Promise<void>;
|
|
233
|
+
didHidePanel(): Promise<void>;
|
|
234
|
+
didShowOverlay(): Promise<void>;
|
|
235
|
+
didHideOverlay(): Promise<void>;
|
|
236
|
+
currentEventDoesNotSupportKeyPlays(): void;
|
|
237
|
+
getCurrentEventID(): string;
|
|
238
|
+
getCurrentlyPlayingClipIndex(): number | null;
|
|
239
|
+
getLastPlayedClipIndex(): number | null;
|
|
240
|
+
getCurrentClipPlaybackProgress(): number | null;
|
|
241
|
+
getKeyPlaysCount(): number;
|
|
242
|
+
get eventId(): Observable<string>;
|
|
243
|
+
get title(): Observable<string>;
|
|
244
|
+
get isLive(): Observable<boolean>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
declare interface MaestroKeyPlay {
|
|
248
|
+
description: string;
|
|
249
|
+
team: string;
|
|
250
|
+
wallClock: string;
|
|
251
|
+
displayClock: string;
|
|
252
|
+
shortPeriod: string;
|
|
253
|
+
scoringPlay: boolean;
|
|
254
|
+
athlete: string;
|
|
255
|
+
thumbnail: string;
|
|
256
|
+
thumbnailType: string;
|
|
257
|
+
clipID: string;
|
|
258
|
+
awayScore?: string;
|
|
259
|
+
homeScore?: string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare interface MaestroKeyPlaysAthlete {
|
|
263
|
+
id: string;
|
|
264
|
+
shortName: string;
|
|
265
|
+
headshot: string;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
declare interface MaestroKeyPlaysSection {
|
|
269
|
+
title: string;
|
|
270
|
+
items: MaestroKeyPlay[];
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Main SDK class that serves as the entry point for the Maestro TV SDK
|
|
275
|
+
* Follows a singleton pattern similar to the Swift implementation
|
|
276
|
+
*/
|
|
277
|
+
declare class MaestroWebSDK implements IMaestroManager {
|
|
278
|
+
private static instance;
|
|
279
|
+
private renderer;
|
|
280
|
+
private siteID?;
|
|
281
|
+
private jwt?;
|
|
282
|
+
private userID?;
|
|
283
|
+
private maestroEventViewModel;
|
|
284
|
+
private constructor();
|
|
285
|
+
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate): Promise<IMaestroEvent>;
|
|
286
|
+
userDidStopWatchingEvent(_: string): void;
|
|
287
|
+
authenticateUser(_: string, __: string): Promise<void>;
|
|
288
|
+
deauthenticateUser(): Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* @description Returns the MaestroWebSDK instance
|
|
291
|
+
* @returns {MaestroWebSDK} - The MaestroWebSDK instance
|
|
292
|
+
*/
|
|
293
|
+
static getInstance(): MaestroWebSDK;
|
|
294
|
+
configure(configParams: SDKConfigParams): void;
|
|
295
|
+
/**
|
|
296
|
+
* Checks if this is an authorized client based on siteID
|
|
297
|
+
*/
|
|
298
|
+
get isAuthorizedClient(): boolean;
|
|
299
|
+
/**
|
|
300
|
+
* Sets the site ID for the SDK
|
|
301
|
+
* @param siteID The site ID to set
|
|
302
|
+
*/
|
|
303
|
+
setSiteID(siteID?: string): void;
|
|
304
|
+
getSiteID(): string | undefined;
|
|
305
|
+
/**
|
|
306
|
+
* Sets the JWT token for authentication
|
|
307
|
+
* @param jwt The JWT token to set
|
|
308
|
+
*/
|
|
309
|
+
setJwt(jwt: string): void;
|
|
310
|
+
getJwt(): string | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* Sets the user ID for the SDK
|
|
313
|
+
* @param userID The user ID to set
|
|
314
|
+
*/
|
|
315
|
+
setUserID(userID: string): void;
|
|
316
|
+
getUserID(): string | undefined;
|
|
317
|
+
/**
|
|
318
|
+
* Gets the event view model
|
|
319
|
+
* @returns The current event view model
|
|
320
|
+
*/
|
|
321
|
+
getMaestroEventViewModel(): MaestroEventViewModel;
|
|
322
|
+
renderPanel(id: string): Promise<() => void>;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Basic observable implementation for view models
|
|
327
|
+
*/
|
|
328
|
+
declare class Observable<T> {
|
|
329
|
+
private listeners;
|
|
330
|
+
private _value;
|
|
331
|
+
constructor(initialValue: T);
|
|
332
|
+
get value(): T;
|
|
333
|
+
set value(newValue: T);
|
|
334
|
+
subscribe(listener: (value: T) => void): () => void;
|
|
335
|
+
private notify;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
declare const SDK: MaestroWebSDK;
|
|
339
|
+
export default SDK;
|
|
340
|
+
|
|
341
|
+
declare type SDKConfigParams = {
|
|
342
|
+
/**
|
|
343
|
+
* The type of environment to use. Defaults to `development`. The available options are `development`, `staging`, and `production`.
|
|
344
|
+
*/
|
|
345
|
+
environment?: 'development' | 'staging' | 'production';
|
|
346
|
+
/**
|
|
347
|
+
* The frequency in seconds to poll for updates. Defaults to 5.0.
|
|
348
|
+
*/
|
|
349
|
+
pollFrequency?: number;
|
|
350
|
+
/**
|
|
351
|
+
* The frequency in seconds to update progress. Defaults to 0.1.
|
|
352
|
+
*/
|
|
353
|
+
progressUpdateFrequency?: number;
|
|
354
|
+
/**
|
|
355
|
+
* The site ID to use for the SDK.
|
|
356
|
+
*/
|
|
357
|
+
siteID?: string;
|
|
358
|
+
/**
|
|
359
|
+
* The JWT token to use for authentication.
|
|
360
|
+
*/
|
|
361
|
+
jwt?: string;
|
|
362
|
+
/**
|
|
363
|
+
* The user ID of the logged account.
|
|
364
|
+
*/
|
|
365
|
+
userID?: string;
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
declare type TeamId = string;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Base view model that implements reactive properties
|
|
372
|
+
*/
|
|
373
|
+
declare abstract class ViewModel {
|
|
374
|
+
private _isLoading;
|
|
375
|
+
private _error;
|
|
376
|
+
get isLoading(): Observable<boolean>;
|
|
377
|
+
get error(): Observable<string | null>;
|
|
378
|
+
protected setLoading(loading: boolean): void;
|
|
379
|
+
protected setError(error: string | null): void;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export { }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.sdk-wrapper{font-family:Arial,Helvetica,sans-serif;color:var(--sdk-text100)}.T01{font-size:1.125rem;font-weight:400;line-height:1.5rem}.T02{font-size:1.125rem;font-weight:700;line-height:1.5rem}.T05_ALT{font-size:1.313rem;font-weight:700;line-height:1.75rem}.T10{font-size:1.438rem;font-weight:700;line-height:2rem}.T20{font-size:1.688rem;font-weight:500;line-height:2.25rem}.T30{font-size:1.813rem;font-weight:700;line-height:2.25rem}.T70{font-size:3rem;font-weight:900;line-height:3.5rem}.sdk--panel-manager{padding:3.75rem 3.75rem 3.75rem 3rem;padding-bottom:0;display:flex;flex-direction:column;gap:3.75rem}.sdk--panel-manager .panel-coming-soon{display:flex;justify-content:center}.panel-nav-button-container{display:flex;flex-direction:column;align-items:center;gap:.625rem;color:var(--sdk-text300);flex:1}.panel-nav-button-container path{fill:var(--sdk-highlightSecondary)}.panel-nav-button-container button{padding:8px 0;background-color:var(--sdk-surface3);min-width:6.5rem;transition:background-color .2s ease-in-out,color .3s ease-in-out}.panel-nav-button-container[data-focused=true],.panel-nav-button-container:hover,.panel-nav-button-active{color:var(--sdk-text100)}.panel-nav-button-container[data-focused=true] path,.panel-nav-button-container:hover path{fill:var(--sdk-highlightTertiary)}.panel-nav-button-container[data-focused=true] button,.panel-nav-button-container:hover button{background-color:var(--sdk-accentPrimary)}.panel-nav-button-active button{background-color:var(--sdk-surface5)}.panel-nav-button-active path{fill:var(--sdk-highlightPrimary)}.panel-navigation{display:flex;flex-direction:row;align-items:center;gap:.75rem;overflow-x:auto;scrollbar-width:none}.key-play-card{display:flex;flex-direction:column;border-radius:.625rem;background-color:var(--sdk-surface2);contain:content;border:.188rem solid transparent;transition:border-color .2s ease-in-out;position:relative}.key-play-card progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:8px;background-color:var(--sdk-surface6);box-shadow:0 1px 3px #10111366 inset;overflow:hidden;border-radius:0;position:absolute;bottom:0}.key-play-card .error-state{position:absolute;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:var(--sdk-surface2);gap:1rem}.key-play-card .error-state path{fill:var(--sdk-alertWarning)}.key-play-card .non-recent-error-state{position:absolute;top:1.125rem;right:1.125rem}.scrollable-gradient{position:relative}.scrollable-gradient:before{content:"";position:absolute;left:0;right:0;top:0;height:3.625rem;z-index:0;transition:z-index .3s ease}.scroll-container-scrolled:before{z-index:1;background:linear-gradient(0deg,#080a0c00 0%,var(--sdk-surface1) 100%)}.scrollable-gradient:after{content:"";position:absolute;left:0;right:0;bottom:0;height:6rem;background:linear-gradient(180deg,#080a0c00 0%,var(--sdk-surface1) 100%)}.key-plays-view{display:flex;flex-direction:column;gap:1rem;overflow-y:auto;max-height:calc(100vh - 86px - 7.5rem);scrollbar-width:none;scroll-behavior:smooth;overscroll-behavior:contain}.key-plays-view .key-plays-section:last-child{margin-bottom:4rem}.key-plays-view::-webkit-scrollbar{display:none}.key-plays-section{display:flex;flex-direction:column;gap:1rem;position:relative}.key-plays-section-title{position:sticky;top:0;z-index:1;margin:0}.key-plays-section-items{display:flex;flex-direction:column;gap:20px}.key-plays-section:last-of-type{margin-bottom:0}.key-plays-bottom-padding{height:calc(100vh - 240px);min-height:400px;width:100%}.key-play-card{display:flex;flex-direction:column;border-radius:.625rem;background-color:var(--sdk-surface2);contain:content;border:3px solid transparent;transition:border-color .2s ease-in-out}.key-play-card[data-focused=true]{border-color:var(--sdk-highlightPrimary)}.key-play-card-content{display:grid;grid-template-columns:1fr 2fr}.key-play-card-content .cardImage{width:100%;height:100%;object-fit:cover}.key-play-card-content .text-content{padding:2.75rem 2.25rem 2.75rem 1.5rem;align-items:center;display:flex}.key-play-card-content .multi-line{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;text-overflow:ellipsis}.key-play-card progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:8px;background-color:var(--sdk-surface6);box-shadow:0 1px 3px #10111366 inset;overflow:hidden;border-radius:0}.key-play-card progress::-webkit-progress-bar,.key-play-card progress::-moz-progress-bar{background-color:var(--sdk-surface6)}.key-play-card progress::-webkit-progress-value{background-color:var(--sdk-highlightPrimary)}.key-play-card .score{display:flex;align-items:center;justify-content:center;padding:10px;gap:4rem;background-color:var(--sdk-surface4)}.key-play-card .score-team{display:flex;align-items:center;gap:1rem}.action-button{padding:23px 0;background-color:var(--sdk-accentSecondary);color:var(--sdk-text100)}.action-button:hover,.action-button[data-focused=true]{background-color:var(--sdk-accentPrimary);color:var(--sdk-text500)}.sdk--key-play-error-state-unsupportedEvent{padding:2.25rem 1.5rem 0;display:flex;flex-direction:column;gap:1rem}.sdk--key-play-error-state-unsupportedEvent:after{background:linear-gradient(180deg,#0000,#ffffff14)}.sdk--key-play-error-state-unsupportedEvent h3{margin:0}.sdk--key-play-error-state-unsupportedEvent p{margin:0;color:var(--sdk-text200)}.sdk--key-play-error-state-unpopulatedEvent{overflow-y:hidden;max-height:calc(100vh - 86px - 7.5rem);padding:2.25rem 1.5rem 0;scrollbar-width:none;display:flex;flex-direction:column;gap:6.25rem}.sdk--key-play-error-state-unpopulatedEvent h3{margin:0}.sdk--key-play-error-state-unpopulatedEvent p{margin:0;color:var(--sdk-text200)}.sdk--key-play-error-state-unpopulatedEvent .main-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem}.sdk--key-play-error-state-unpopulatedEvent .unpopulatedEvent-examples{display:flex;flex-direction:column;gap:1rem;position:relative}.sdk--key-play-error-state-unpopulatedEvent .unpopulatedEvent-examples:after{content:"";width:100%;height:100%;position:absolute;bottom:0;background:linear-gradient(0deg,#000,#0000 92.2%)}.sdk--key-play-error-state-unpopulatedEvent .unpopulatedEvent-examples .example{display:flex;gap:1rem;padding:1.75rem 1.5rem;border-radius:.625rem;background-color:var(--sdk-surface3);height:8rem}.sdk--key-play-error-state-tabLoadFailure{display:flex;flex-direction:column;gap:1rem;border-radius:.625rem;border:.188rem solid transparent;transition:border-color .2s ease-in-out;padding:1.5rem;background-color:var(--sdk-surface4)}.sdk--key-play-error-state-tabLoadFailure h3{margin:0}.sdk--key-play-error-state-tabLoadFailure p{margin:0;height:5.375rem}')),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
import { S as f } from "./index-BaSckwps.js";
|
|
3
|
+
export {
|
|
4
|
+
f as default
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=maestro-web-sdk.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maestro-web-sdk.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|