@everymatrix/player-elevate-level 1.71.0 → 1.71.1
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/package.json
CHANGED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { html } from "lit";
|
|
2
|
-
import "@everymatrix/player-elevate-level";
|
|
3
|
-
import "@everymatrix/user-login";
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Player/Components/player-elevate-level',
|
|
6
|
-
component: 'player-elevate-level',
|
|
7
|
-
args: {
|
|
8
|
-
endpoint: "",
|
|
9
|
-
session: "",
|
|
10
|
-
playerAvatarUrl: "",
|
|
11
|
-
language: "",
|
|
12
|
-
playerName: "",
|
|
13
|
-
dateFormat: "yyyy-MM-dd",
|
|
14
|
-
clientStyling: "",
|
|
15
|
-
clientStylingUrl: "",
|
|
16
|
-
translationUrl: "",
|
|
17
|
-
mbSource: "",
|
|
18
|
-
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
endpoint: { control: 'text', description: '' },
|
|
21
|
-
session: { control: 'text', description: '' },
|
|
22
|
-
playerAvatarUrl: { control: 'text', description: '' },
|
|
23
|
-
language: { control: 'text', description: '' },
|
|
24
|
-
playerName: { control: 'text', description: '' },
|
|
25
|
-
dateFormat: { control: 'text', description: '' },
|
|
26
|
-
clientStyling: { control: 'text', description: '' },
|
|
27
|
-
clientStylingUrl: { control: 'text', description: '' },
|
|
28
|
-
translationUrl: { control: 'text', description: '' },
|
|
29
|
-
mbSource: { control: 'text', description: '' },
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export default meta;
|
|
33
|
-
const Template = (args) => {
|
|
34
|
-
return html `
|
|
35
|
-
<!-- This component is assumed to send a post message with the session ID -->
|
|
36
|
-
<span>Login with testaccount1 / Pass1234!</span>
|
|
37
|
-
|
|
38
|
-
<user-login
|
|
39
|
-
endpoint="${args.endpointLogin}"
|
|
40
|
-
lang="${args.langLogin}"
|
|
41
|
-
></user-login>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<player-elevate-level
|
|
45
|
-
id="player-elevate"
|
|
46
|
-
endpoint="${args.endpoint}"
|
|
47
|
-
session="${args.session}"
|
|
48
|
-
></player-elevate-level>
|
|
49
|
-
|
|
50
|
-
<!-- Placeholder to display the User Session ID -->
|
|
51
|
-
<div id="session-id-container" style="margin-top: 16px; font-family: sans-serif;">
|
|
52
|
-
<strong>User Session ID:</strong> <span id="user-session-id">Waiting for session ID...</span>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
`;
|
|
57
|
-
};
|
|
58
|
-
export const Default = Template.bind({});
|
|
59
|
-
Default.args = {
|
|
60
|
-
endpoint: "https://demo-new.nwacdn.com",
|
|
61
|
-
session: "",
|
|
62
|
-
endpointLogin: "https://demo-new.nwacdn.com",
|
|
63
|
-
langLogin: "en",
|
|
64
|
-
playerAvatarUrl: "",
|
|
65
|
-
language: "",
|
|
66
|
-
playerName: "",
|
|
67
|
-
dateFormat: "yyyy-MM-dd",
|
|
68
|
-
clientStyling: "",
|
|
69
|
-
clientStylingUrl: "",
|
|
70
|
-
translationUrl: "",
|
|
71
|
-
mbSource: "",
|
|
72
|
-
};
|
|
73
|
-
if (typeof window !== 'undefined') {
|
|
74
|
-
window.addEventListener('message', (event) => {
|
|
75
|
-
var _a;
|
|
76
|
-
if (((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) === 'UserSessionID') {
|
|
77
|
-
const playerElevate = document.getElementById('player-elevate');
|
|
78
|
-
const sessionSpan = document.getElementById('user-session-id');
|
|
79
|
-
if (sessionSpan) {
|
|
80
|
-
sessionSpan.textContent = event.data.session || 'No session ID provided';
|
|
81
|
-
}
|
|
82
|
-
if (playerElevate) {
|
|
83
|
-
// Update the session attribute with the provided session ID.
|
|
84
|
-
playerElevate.setAttribute('session', event.data.session);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|