@sonatel-os/strapi-plugin-tcg 0.0.0-stage → 0.3.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/README.md +143 -2
- package/dist/_chunks/App-B-WZGNkc.js +5204 -0
- package/dist/_chunks/App-CS_cVYEI.mjs +5202 -0
- package/dist/_chunks/SettingsPage-DNWXuY8j.js +191 -0
- package/dist/_chunks/SettingsPage-fGiEcX6l.mjs +191 -0
- package/dist/_chunks/api-BgR-fpDp.mjs +1012 -0
- package/dist/_chunks/api-hTExOv_J.js +1011 -0
- package/dist/_chunks/en-B2j8rFto.js +39 -0
- package/dist/_chunks/en-C33hmbtk.mjs +39 -0
- package/dist/_chunks/fr-B2Toyhf9.js +37 -0
- package/dist/_chunks/fr-JWwsoAzl.mjs +37 -0
- package/dist/_chunks/index-CRbzJppw.js +107 -0
- package/dist/_chunks/index-ClDgxnnH.mjs +108 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/server/index.js +5055 -0
- package/dist/server/index.mjs +5056 -0
- package/package.json +82 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const en = {
|
|
4
|
+
"menu.label": "TCG",
|
|
5
|
+
"settings.title": "TCG",
|
|
6
|
+
"settings.link": "Configuration",
|
|
7
|
+
"nav.dashboard": "Dashboard",
|
|
8
|
+
"nav.seasons": "Seasons",
|
|
9
|
+
"nav.cards": "Cards",
|
|
10
|
+
"nav.packs": "Packs & QR codes",
|
|
11
|
+
"nav.players": "Players",
|
|
12
|
+
"nav.booth": "Booth",
|
|
13
|
+
"nav.audit": "Audit log",
|
|
14
|
+
"season.current": "Season",
|
|
15
|
+
"season.none": "No season yet",
|
|
16
|
+
"season.create": "New season",
|
|
17
|
+
"action.save": "Save",
|
|
18
|
+
"action.cancel": "Cancel",
|
|
19
|
+
"action.delete": "Delete",
|
|
20
|
+
"action.create": "Create",
|
|
21
|
+
"action.edit": "Edit",
|
|
22
|
+
"action.back": "Back",
|
|
23
|
+
"action.refresh": "Refresh",
|
|
24
|
+
"common.loading": "Loading…",
|
|
25
|
+
"common.empty": "Nothing here yet.",
|
|
26
|
+
"common.search": "Search",
|
|
27
|
+
"common.saved": "Saved.",
|
|
28
|
+
"common.deleted": "Deleted.",
|
|
29
|
+
"dashboard.title": "Dashboard",
|
|
30
|
+
"dashboard.subtitle": "What is happening in the game right now.",
|
|
31
|
+
"booth.title": "Booth",
|
|
32
|
+
"booth.subtitle": "Type or scan a redemption code, check the cards, hand the reward over.",
|
|
33
|
+
"nav.live": "Live boosts",
|
|
34
|
+
"nav.rewards": "Rewards",
|
|
35
|
+
"nav.goals": "Sets & badges",
|
|
36
|
+
"nav.guide": "How it works",
|
|
37
|
+
"guide.title": "How the game works"
|
|
38
|
+
};
|
|
39
|
+
exports.default = en;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
"menu.label": "TCG",
|
|
3
|
+
"settings.title": "TCG",
|
|
4
|
+
"settings.link": "Configuration",
|
|
5
|
+
"nav.dashboard": "Dashboard",
|
|
6
|
+
"nav.seasons": "Seasons",
|
|
7
|
+
"nav.cards": "Cards",
|
|
8
|
+
"nav.packs": "Packs & QR codes",
|
|
9
|
+
"nav.players": "Players",
|
|
10
|
+
"nav.booth": "Booth",
|
|
11
|
+
"nav.audit": "Audit log",
|
|
12
|
+
"season.current": "Season",
|
|
13
|
+
"season.none": "No season yet",
|
|
14
|
+
"season.create": "New season",
|
|
15
|
+
"action.save": "Save",
|
|
16
|
+
"action.cancel": "Cancel",
|
|
17
|
+
"action.delete": "Delete",
|
|
18
|
+
"action.create": "Create",
|
|
19
|
+
"action.edit": "Edit",
|
|
20
|
+
"action.back": "Back",
|
|
21
|
+
"action.refresh": "Refresh",
|
|
22
|
+
"common.loading": "Loading…",
|
|
23
|
+
"common.empty": "Nothing here yet.",
|
|
24
|
+
"common.search": "Search",
|
|
25
|
+
"common.saved": "Saved.",
|
|
26
|
+
"common.deleted": "Deleted.",
|
|
27
|
+
"dashboard.title": "Dashboard",
|
|
28
|
+
"dashboard.subtitle": "What is happening in the game right now.",
|
|
29
|
+
"booth.title": "Booth",
|
|
30
|
+
"booth.subtitle": "Type or scan a redemption code, check the cards, hand the reward over.",
|
|
31
|
+
"nav.live": "Live boosts",
|
|
32
|
+
"nav.rewards": "Rewards",
|
|
33
|
+
"nav.goals": "Sets & badges",
|
|
34
|
+
"nav.guide": "How it works",
|
|
35
|
+
"guide.title": "How the game works"
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
en as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fr = {
|
|
4
|
+
"menu.label": "TCG",
|
|
5
|
+
"settings.title": "TCG",
|
|
6
|
+
"settings.link": "Configuration",
|
|
7
|
+
"nav.dashboard": "Tableau de bord",
|
|
8
|
+
"nav.seasons": "Saisons",
|
|
9
|
+
"nav.cards": "Cartes",
|
|
10
|
+
"nav.packs": "Packs",
|
|
11
|
+
"nav.players": "Joueurs",
|
|
12
|
+
"nav.booth": "Stand",
|
|
13
|
+
"nav.audit": "Audit",
|
|
14
|
+
"season.current": "Saison",
|
|
15
|
+
"season.none": "Aucune saison",
|
|
16
|
+
"season.create": "Nouvelle saison",
|
|
17
|
+
"action.save": "Enregistrer",
|
|
18
|
+
"action.cancel": "Annuler",
|
|
19
|
+
"action.delete": "Supprimer",
|
|
20
|
+
"action.create": "Créer",
|
|
21
|
+
"action.edit": "Modifier",
|
|
22
|
+
"action.back": "Retour",
|
|
23
|
+
"action.refresh": "Actualiser",
|
|
24
|
+
"common.loading": "Chargement…",
|
|
25
|
+
"common.empty": "Rien pour le moment.",
|
|
26
|
+
"common.search": "Rechercher",
|
|
27
|
+
"common.saved": "Enregistré.",
|
|
28
|
+
"common.deleted": "Supprimé.",
|
|
29
|
+
"dashboard.title": "Tableau de bord",
|
|
30
|
+
"dashboard.subtitle": "Ce qui se passe dans le jeu en ce moment.",
|
|
31
|
+
"booth.title": "Stand",
|
|
32
|
+
"booth.subtitle": "Saisissez ou scannez un code de retrait, vérifiez les cartes, remettez la récompense.",
|
|
33
|
+
"nav.live": "En direct",
|
|
34
|
+
"nav.rewards": "Récompenses",
|
|
35
|
+
"nav.goals": "Sets & badges"
|
|
36
|
+
};
|
|
37
|
+
exports.default = fr;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const fr = {
|
|
2
|
+
"menu.label": "TCG",
|
|
3
|
+
"settings.title": "TCG",
|
|
4
|
+
"settings.link": "Configuration",
|
|
5
|
+
"nav.dashboard": "Tableau de bord",
|
|
6
|
+
"nav.seasons": "Saisons",
|
|
7
|
+
"nav.cards": "Cartes",
|
|
8
|
+
"nav.packs": "Packs",
|
|
9
|
+
"nav.players": "Joueurs",
|
|
10
|
+
"nav.booth": "Stand",
|
|
11
|
+
"nav.audit": "Audit",
|
|
12
|
+
"season.current": "Saison",
|
|
13
|
+
"season.none": "Aucune saison",
|
|
14
|
+
"season.create": "Nouvelle saison",
|
|
15
|
+
"action.save": "Enregistrer",
|
|
16
|
+
"action.cancel": "Annuler",
|
|
17
|
+
"action.delete": "Supprimer",
|
|
18
|
+
"action.create": "Créer",
|
|
19
|
+
"action.edit": "Modifier",
|
|
20
|
+
"action.back": "Retour",
|
|
21
|
+
"action.refresh": "Actualiser",
|
|
22
|
+
"common.loading": "Chargement…",
|
|
23
|
+
"common.empty": "Rien pour le moment.",
|
|
24
|
+
"common.search": "Rechercher",
|
|
25
|
+
"common.saved": "Enregistré.",
|
|
26
|
+
"common.deleted": "Supprimé.",
|
|
27
|
+
"dashboard.title": "Tableau de bord",
|
|
28
|
+
"dashboard.subtitle": "Ce qui se passe dans le jeu en ce moment.",
|
|
29
|
+
"booth.title": "Stand",
|
|
30
|
+
"booth.subtitle": "Saisissez ou scannez un code de retrait, vérifiez les cartes, remettez la récompense.",
|
|
31
|
+
"nav.live": "En direct",
|
|
32
|
+
"nav.rewards": "Récompenses",
|
|
33
|
+
"nav.goals": "Sets & badges"
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
fr as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const react = require("react");
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const icons = require("@strapi/icons");
|
|
5
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
6
|
+
const v = glob[path];
|
|
7
|
+
if (v) {
|
|
8
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
9
|
+
}
|
|
10
|
+
return new Promise((_, reject) => {
|
|
11
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
12
|
+
reject.bind(
|
|
13
|
+
null,
|
|
14
|
+
new Error(
|
|
15
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
16
|
+
)
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const PLUGIN_ID = "tcg";
|
|
22
|
+
const Initializer = ({ setPlugin }) => {
|
|
23
|
+
const ref = react.useRef(setPlugin);
|
|
24
|
+
react.useEffect(() => {
|
|
25
|
+
ref.current(PLUGIN_ID);
|
|
26
|
+
}, []);
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx(icons.Sparkle, {});
|
|
30
|
+
const fqn = (uid) => `plugin::${PLUGIN_ID}.${uid}`;
|
|
31
|
+
const one = (uid) => [{ action: fqn(uid), subject: null }];
|
|
32
|
+
const PERMISSIONS = Object.freeze({
|
|
33
|
+
access: one("access"),
|
|
34
|
+
dashboardRead: one("dashboard.read"),
|
|
35
|
+
seasonsRead: one("seasons.read"),
|
|
36
|
+
seasonsWrite: one("seasons.write"),
|
|
37
|
+
cardsRead: one("cards.read"),
|
|
38
|
+
cardsWrite: one("cards.write"),
|
|
39
|
+
packsRead: one("packs.read"),
|
|
40
|
+
packsWrite: one("packs.write"),
|
|
41
|
+
packsQr: one("packs.qr"),
|
|
42
|
+
playersRead: one("players.read"),
|
|
43
|
+
playersWrite: one("players.write"),
|
|
44
|
+
redemptionsRead: one("redemptions.read"),
|
|
45
|
+
redemptionsFulfill: one("redemptions.fulfill"),
|
|
46
|
+
auditRead: one("audit.read"),
|
|
47
|
+
rewardsRead: one("rewards.read"),
|
|
48
|
+
rewardsWrite: one("rewards.write"),
|
|
49
|
+
liveRead: one("live.read"),
|
|
50
|
+
liveWrite: one("live.write"),
|
|
51
|
+
settingsRead: one("settings.read"),
|
|
52
|
+
settingsWrite: one("settings.write")
|
|
53
|
+
});
|
|
54
|
+
const prefixPluginTranslations = (dictionary, pluginId) => Object.keys(dictionary).reduce((acc, key) => {
|
|
55
|
+
acc[`${pluginId}.${key}`] = dictionary[key];
|
|
56
|
+
return acc;
|
|
57
|
+
}, {});
|
|
58
|
+
const index = {
|
|
59
|
+
register(app) {
|
|
60
|
+
app.addMenuLink({
|
|
61
|
+
to: `plugins/${PLUGIN_ID}`,
|
|
62
|
+
icon: PluginIcon,
|
|
63
|
+
intlLabel: { id: `${PLUGIN_ID}.menu.label`, defaultMessage: "TCG" },
|
|
64
|
+
permissions: PERMISSIONS.access,
|
|
65
|
+
Component: async () => {
|
|
66
|
+
const { App } = await Promise.resolve().then(() => require("./App-B-WZGNkc.js"));
|
|
67
|
+
return App;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
app.createSettingSection(
|
|
71
|
+
{ id: PLUGIN_ID, intlLabel: { id: `${PLUGIN_ID}.settings.title`, defaultMessage: "TCG" } },
|
|
72
|
+
[
|
|
73
|
+
{
|
|
74
|
+
id: `${PLUGIN_ID}-settings`,
|
|
75
|
+
to: PLUGIN_ID,
|
|
76
|
+
intlLabel: { id: `${PLUGIN_ID}.settings.link`, defaultMessage: "Configuration" },
|
|
77
|
+
permissions: PERMISSIONS.settingsRead,
|
|
78
|
+
Component: async () => {
|
|
79
|
+
const { SettingsPage } = await Promise.resolve().then(() => require("./SettingsPage-DNWXuY8j.js"));
|
|
80
|
+
return SettingsPage;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
);
|
|
85
|
+
app.registerPlugin({
|
|
86
|
+
id: PLUGIN_ID,
|
|
87
|
+
initializer: Initializer,
|
|
88
|
+
isReady: false,
|
|
89
|
+
name: PLUGIN_ID
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
async registerTrads({ locales }) {
|
|
93
|
+
return Promise.all(
|
|
94
|
+
locales.map(async (locale) => {
|
|
95
|
+
try {
|
|
96
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-B2j8rFto.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B2Toyhf9.js")) }), `./translations/${locale}.json`, 3);
|
|
97
|
+
return { data: prefixPluginTranslations(data, PLUGIN_ID), locale };
|
|
98
|
+
} catch {
|
|
99
|
+
return { data: {}, locale };
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
exports.PERMISSIONS = PERMISSIONS;
|
|
106
|
+
exports.PLUGIN_ID = PLUGIN_ID;
|
|
107
|
+
exports.index = index;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useRef, useEffect } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Sparkle } from "@strapi/icons";
|
|
4
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
5
|
+
const v = glob[path];
|
|
6
|
+
if (v) {
|
|
7
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
8
|
+
}
|
|
9
|
+
return new Promise((_, reject) => {
|
|
10
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
11
|
+
reject.bind(
|
|
12
|
+
null,
|
|
13
|
+
new Error(
|
|
14
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const PLUGIN_ID = "tcg";
|
|
21
|
+
const Initializer = ({ setPlugin }) => {
|
|
22
|
+
const ref = useRef(setPlugin);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
ref.current(PLUGIN_ID);
|
|
25
|
+
}, []);
|
|
26
|
+
return null;
|
|
27
|
+
};
|
|
28
|
+
const PluginIcon = () => /* @__PURE__ */ jsx(Sparkle, {});
|
|
29
|
+
const fqn = (uid) => `plugin::${PLUGIN_ID}.${uid}`;
|
|
30
|
+
const one = (uid) => [{ action: fqn(uid), subject: null }];
|
|
31
|
+
const PERMISSIONS = Object.freeze({
|
|
32
|
+
access: one("access"),
|
|
33
|
+
dashboardRead: one("dashboard.read"),
|
|
34
|
+
seasonsRead: one("seasons.read"),
|
|
35
|
+
seasonsWrite: one("seasons.write"),
|
|
36
|
+
cardsRead: one("cards.read"),
|
|
37
|
+
cardsWrite: one("cards.write"),
|
|
38
|
+
packsRead: one("packs.read"),
|
|
39
|
+
packsWrite: one("packs.write"),
|
|
40
|
+
packsQr: one("packs.qr"),
|
|
41
|
+
playersRead: one("players.read"),
|
|
42
|
+
playersWrite: one("players.write"),
|
|
43
|
+
redemptionsRead: one("redemptions.read"),
|
|
44
|
+
redemptionsFulfill: one("redemptions.fulfill"),
|
|
45
|
+
auditRead: one("audit.read"),
|
|
46
|
+
rewardsRead: one("rewards.read"),
|
|
47
|
+
rewardsWrite: one("rewards.write"),
|
|
48
|
+
liveRead: one("live.read"),
|
|
49
|
+
liveWrite: one("live.write"),
|
|
50
|
+
settingsRead: one("settings.read"),
|
|
51
|
+
settingsWrite: one("settings.write")
|
|
52
|
+
});
|
|
53
|
+
const prefixPluginTranslations = (dictionary, pluginId) => Object.keys(dictionary).reduce((acc, key) => {
|
|
54
|
+
acc[`${pluginId}.${key}`] = dictionary[key];
|
|
55
|
+
return acc;
|
|
56
|
+
}, {});
|
|
57
|
+
const index = {
|
|
58
|
+
register(app) {
|
|
59
|
+
app.addMenuLink({
|
|
60
|
+
to: `plugins/${PLUGIN_ID}`,
|
|
61
|
+
icon: PluginIcon,
|
|
62
|
+
intlLabel: { id: `${PLUGIN_ID}.menu.label`, defaultMessage: "TCG" },
|
|
63
|
+
permissions: PERMISSIONS.access,
|
|
64
|
+
Component: async () => {
|
|
65
|
+
const { App } = await import("./App-CS_cVYEI.mjs");
|
|
66
|
+
return App;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
app.createSettingSection(
|
|
70
|
+
{ id: PLUGIN_ID, intlLabel: { id: `${PLUGIN_ID}.settings.title`, defaultMessage: "TCG" } },
|
|
71
|
+
[
|
|
72
|
+
{
|
|
73
|
+
id: `${PLUGIN_ID}-settings`,
|
|
74
|
+
to: PLUGIN_ID,
|
|
75
|
+
intlLabel: { id: `${PLUGIN_ID}.settings.link`, defaultMessage: "Configuration" },
|
|
76
|
+
permissions: PERMISSIONS.settingsRead,
|
|
77
|
+
Component: async () => {
|
|
78
|
+
const { SettingsPage } = await import("./SettingsPage-fGiEcX6l.mjs");
|
|
79
|
+
return SettingsPage;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
);
|
|
84
|
+
app.registerPlugin({
|
|
85
|
+
id: PLUGIN_ID,
|
|
86
|
+
initializer: Initializer,
|
|
87
|
+
isReady: false,
|
|
88
|
+
name: PLUGIN_ID
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
async registerTrads({ locales }) {
|
|
92
|
+
return Promise.all(
|
|
93
|
+
locales.map(async (locale) => {
|
|
94
|
+
try {
|
|
95
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-C33hmbtk.mjs"), "./translations/fr.json": () => import("./fr-JWwsoAzl.mjs") }), `./translations/${locale}.json`, 3);
|
|
96
|
+
return { data: prefixPluginTranslations(data, PLUGIN_ID), locale };
|
|
97
|
+
} catch {
|
|
98
|
+
return { data: {}, locale };
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
PLUGIN_ID as P,
|
|
106
|
+
PERMISSIONS as a,
|
|
107
|
+
index as i
|
|
108
|
+
};
|