@everymatrix/tournament-card 0.1.0 → 0.1.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/client/index.js +3782 -0
- package/client/package.json +27 -0
- package/client/style.css +1 -0
- package/package.json +14 -16
- package/server/index.js +102 -0
- package/server/package.json +27 -0
- package/wc/components/TournamentCard-BvNMQx8f.js +6715 -0
- package/wc/components/TournamentCard-tI6pPdfP.cjs +4 -0
- package/wc/package.json +27 -0
- package/wc/style.css +1 -0
- package/wc/wc/tournament-card.cjs +1 -0
- package/wc/wc/tournament-card.js +14 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@everymatrix/tournament-card",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./client/index.js",
|
|
6
|
+
"module": "./client/index.js",
|
|
7
|
+
"types": "./client/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./client/index.d.ts",
|
|
11
|
+
"node": "./server/index.js",
|
|
12
|
+
"default": "./client/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./wc": { "default": "./wc/tournament-card.js" }
|
|
15
|
+
}
|
|
16
|
+
,
|
|
17
|
+
"files": ["client/", "server/", "wc/"],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"svelte": "^5.0.0"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@everymatrix/tournament-details": "0.0.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/client/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.svelte-1q5hm0x,.svelte-1q5hm0x:before,.svelte-1q5hm0x:after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}.CardContainer.svelte-1q5hm0x{display:flex;flex-direction:column;border-radius:6px;background-color:var(--emw-color-bg-secondary, #333232);height:100%;max-width:400px;justify-content:space-between}.CardContainer.svelte-1q5hm0x .ViewDetailsButton:where(.svelte-1q5hm0x){width:100%;background-color:var(--emw-color-bg-elements, #4A4A4A);color:var(--emw-color-typography, #ffffff);border-radius:6px;padding:8px 0;border:none;outline:none;transition:background-color .2s ease,transform .15s ease}.CardContainer.svelte-1q5hm0x .ViewDetailsButton:where(.svelte-1q5hm0x):hover{background-color:var(--emw-color-bg-primary, #212121);cursor:pointer}.CardContainer.svelte-1q5hm0x .ViewDetailsButton:where(.svelte-1q5hm0x):active{transform:scale(.9)}.CardContainer.svelte-1q5hm0x .TournamentButtonsWrapper:where(.svelte-1q5hm0x){display:flex;gap:16px;width:100%;padding:0 16px 16px}.CardContainer.svelte-1q5hm0x .TournamentButtonsWrapper:where(.svelte-1q5hm0x) .ButtonPrimary:where(.svelte-1q5hm0x){display:block;width:100%;background-color:var(--emw-color-primary, #FF1D4E);color:var(--emw-color-typography, #ffffff);border-radius:6px;padding:8px 0;border:none;outline:none;text-align:center;text-decoration:none;cursor:pointer;transition:background-color .2s ease,transform .15s ease}.CardContainer.svelte-1q5hm0x .TournamentButtonsWrapper:where(.svelte-1q5hm0x) .ButtonPrimary:where(.svelte-1q5hm0x):hover{background-color:var(--emw-color-primary-hover, #ff3a65);cursor:pointer}.CardContainer.svelte-1q5hm0x .TournamentButtonsWrapper:where(.svelte-1q5hm0x) .ButtonPrimary:where(.svelte-1q5hm0x):active{transform:scale(.9)}.CardContainer.svelte-1q5hm0x .TournamentButtonsWrapper:where(.svelte-1q5hm0x) .ButtonPrimary:where(.svelte-1q5hm0x).Enrolled{pointer-events:none;filter:saturate(50%)}.CardContainer.svelte-1q5hm0x .TournamentButtonsWrapper:where(.svelte-1q5hm0x) .ButtonSecondary:where(.svelte-1q5hm0x){display:block;width:100%;background-color:transparent;color:var(--emw-color-typography, #ffffff);border:1px solid var(--emw-color-primary, #FF1D4E);border-radius:6px;padding:8px 0;outline:none;text-align:center;text-decoration:none;cursor:pointer;transition:background-color .2s ease,transform .15s ease}.CardContainer.svelte-1q5hm0x .TournamentButtonsWrapper:where(.svelte-1q5hm0x) .ButtonSecondary:where(.svelte-1q5hm0x):hover{background-color:var(--emw-color-bg-primary, #212121);cursor:pointer}.CardContainer.svelte-1q5hm0x .TournamentButtonsWrapper:where(.svelte-1q5hm0x) .ButtonSecondary:where(.svelte-1q5hm0x):active{transform:scale(.9)}.Spinner.svelte-1q5hm0x{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:var(--emw-color-typography, #ffffff);border-radius:50%;animation:svelte-1q5hm0x-spin .6s linear infinite}@keyframes svelte-1q5hm0x-spin{to{transform:rotate(360deg)}}
|
package/package.json
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/tournament-card",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
5
|
+
"main": "./client/index.js",
|
|
6
|
+
"module": "./client/index.js",
|
|
7
|
+
"types": "./client/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
10
|
+
"types": "./client/index.d.ts",
|
|
11
|
+
"node": "./server/index.js",
|
|
12
|
+
"default": "./client/index.js"
|
|
11
13
|
},
|
|
12
|
-
"./
|
|
13
|
-
|
|
14
|
+
"./wc": {
|
|
15
|
+
"default": "./wc/tournament-card.js"
|
|
16
|
+
}
|
|
14
17
|
},
|
|
15
18
|
"files": [
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"angular",
|
|
20
|
-
"esnext/"
|
|
19
|
+
"client/",
|
|
20
|
+
"server/",
|
|
21
|
+
"wc/"
|
|
21
22
|
],
|
|
22
23
|
"publishConfig": {
|
|
23
24
|
"access": "public"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@everymatrix/tournament-details": "*"
|
|
27
25
|
}
|
|
28
|
-
}
|
|
26
|
+
}
|
package/server/index.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as $ from "svelte/internal/server";
|
|
2
|
+
import { addMessages, _ } from "svelte-i18n";
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
|
+
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
5
|
+
import TournamentDetails from "@everymatrix/tournament-details";
|
|
6
|
+
function addNewMessages(lang, dict) {
|
|
7
|
+
addMessages(lang, dict);
|
|
8
|
+
}
|
|
9
|
+
const TRANSLATIONS = {
|
|
10
|
+
en: {
|
|
11
|
+
Unstarted: "Coming soon",
|
|
12
|
+
Running: "Live",
|
|
13
|
+
Closed: "Ended",
|
|
14
|
+
Closing: "Ended",
|
|
15
|
+
startDateLabel: "Start Date:",
|
|
16
|
+
viewDetailsButton: "View Details",
|
|
17
|
+
detailsButton: "Details",
|
|
18
|
+
loginButton: "Login",
|
|
19
|
+
registerButton: "Register",
|
|
20
|
+
endsInLabel: "Ends in:",
|
|
21
|
+
joinButton: "Join",
|
|
22
|
+
daysLabel: "Days",
|
|
23
|
+
enrolledLabel: "Enrolled"
|
|
24
|
+
},
|
|
25
|
+
tr: {
|
|
26
|
+
Unstarted: "Yakında",
|
|
27
|
+
Running: "Canlı",
|
|
28
|
+
Closed: "Sona erdi",
|
|
29
|
+
Closing: "Sona erdi",
|
|
30
|
+
startDateLabel: "Başlangıç Tarihi:",
|
|
31
|
+
viewDetailsButton: "Detayları Gör",
|
|
32
|
+
detailsButton: "Detaylar",
|
|
33
|
+
loginButton: "Giriş Yap",
|
|
34
|
+
registerButton: "Kayıt Ol",
|
|
35
|
+
endsInLabel: "Bitiş:",
|
|
36
|
+
joinButton: "Join",
|
|
37
|
+
daysLabel: "Günler",
|
|
38
|
+
enrolledLabel: "Kayıtlı"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
dayjs.extend(customParseFormat);
|
|
42
|
+
const isServer = () => typeof window === "undefined";
|
|
43
|
+
function TournamentCard_impl($$renderer, $$props) {
|
|
44
|
+
$$renderer.component(($$renderer2) => {
|
|
45
|
+
var $$store_subs;
|
|
46
|
+
const {
|
|
47
|
+
tournament,
|
|
48
|
+
isLoggedIn,
|
|
49
|
+
language,
|
|
50
|
+
endpoint,
|
|
51
|
+
session,
|
|
52
|
+
navigationHref = null,
|
|
53
|
+
platform,
|
|
54
|
+
hidden = false
|
|
55
|
+
} = $$props;
|
|
56
|
+
let newlyEnrolled = false;
|
|
57
|
+
Object.keys(TRANSLATIONS).forEach((item) => {
|
|
58
|
+
addNewMessages(item, TRANSLATIONS[item]);
|
|
59
|
+
});
|
|
60
|
+
const isTournamentClosed = () => {
|
|
61
|
+
return new Date(tournament.endTime) < /* @__PURE__ */ new Date();
|
|
62
|
+
};
|
|
63
|
+
$$renderer2.push(`<div class="CardContainer svelte-1q5hm0x"${$.attr_style("", { display: hidden ? "none" : "flex" })}>`);
|
|
64
|
+
TournamentDetails($$renderer2, {
|
|
65
|
+
tournament,
|
|
66
|
+
language,
|
|
67
|
+
enrolled: tournament.playerEnrolled || newlyEnrolled
|
|
68
|
+
});
|
|
69
|
+
$$renderer2.push(`<!----> <div class="TournamentButtonsWrapper svelte-1q5hm0x">`);
|
|
70
|
+
if (!isLoggedIn) {
|
|
71
|
+
$$renderer2.push("<!--[-->");
|
|
72
|
+
$$renderer2.push(`<button class="ButtonSecondary svelte-1q5hm0x">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("registerButton"))}</button> <button class="ButtonPrimary svelte-1q5hm0x">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("loginButton"))}</button>`);
|
|
73
|
+
} else {
|
|
74
|
+
$$renderer2.push("<!--[!-->");
|
|
75
|
+
if (isTournamentClosed()) {
|
|
76
|
+
$$renderer2.push("<!--[-->");
|
|
77
|
+
$$renderer2.push(`<button class="ViewDetailsButton svelte-1q5hm0x">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("viewDetailsButton"))}</button>`);
|
|
78
|
+
} else {
|
|
79
|
+
$$renderer2.push("<!--[!-->");
|
|
80
|
+
if (isServer()) {
|
|
81
|
+
$$renderer2.push("<!--[-->");
|
|
82
|
+
$$renderer2.push(`<a class="ButtonSecondary svelte-1q5hm0x"${$.attr("href", `${navigationHref}/${tournament.id}`)}>${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("detailsButton"))}</a>`);
|
|
83
|
+
} else {
|
|
84
|
+
$$renderer2.push("<!--[!-->");
|
|
85
|
+
$$renderer2.push(`<button class="ButtonSecondary svelte-1q5hm0x">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("detailsButton"))}</button>`);
|
|
86
|
+
}
|
|
87
|
+
$$renderer2.push(`<!--]--> <button${$.attr_class(`ButtonPrimary ${tournament.playerEnrolled || newlyEnrolled ? "Enrolled" : ""}`, "svelte-1q5hm0x")}${$.attr("disabled", tournament.playerEnrolled || newlyEnrolled, true)}>`);
|
|
88
|
+
{
|
|
89
|
+
$$renderer2.push("<!--[!-->");
|
|
90
|
+
$$renderer2.push(`${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("joinButton"))}`);
|
|
91
|
+
}
|
|
92
|
+
$$renderer2.push(`<!--]--></button>`);
|
|
93
|
+
}
|
|
94
|
+
$$renderer2.push(`<!--]-->`);
|
|
95
|
+
}
|
|
96
|
+
$$renderer2.push(`<!--]--></div></div>`);
|
|
97
|
+
if ($$store_subs) $.unsubscribe_stores($$store_subs);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
TournamentCard_impl as default
|
|
102
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@everymatrix/tournament-card",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./client/index.js",
|
|
6
|
+
"module": "./client/index.js",
|
|
7
|
+
"types": "./client/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./client/index.d.ts",
|
|
11
|
+
"node": "./server/index.js",
|
|
12
|
+
"default": "./client/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./wc": { "default": "./wc/tournament-card.js" }
|
|
15
|
+
}
|
|
16
|
+
,
|
|
17
|
+
"files": ["client/", "server/", "wc/"],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"svelte": "^5.0.0"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@everymatrix/tournament-details": "0.0.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
}
|
|
27
|
+
}
|