@kirby-tools/licensing 0.6.2 → 0.6.4
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.
|
@@ -39,13 +39,8 @@ onMounted(() => {
|
|
|
39
39
|
})
|
|
40
40
|
})
|
|
41
41
|
|
|
42
|
-
async function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (isLicenseActive) {
|
|
46
|
-
// Force a reload to refresh the plugin's cached context
|
|
47
|
-
window.location.reload()
|
|
48
|
-
}
|
|
42
|
+
async function handleActivation() {
|
|
43
|
+
await openLicenseModal()
|
|
49
44
|
}
|
|
50
45
|
</script>
|
|
51
46
|
|
|
@@ -69,7 +64,7 @@ async function handleRegistration() {
|
|
|
69
64
|
size="xs"
|
|
70
65
|
icon="key"
|
|
71
66
|
:text="t('activate')"
|
|
72
|
-
@click="
|
|
67
|
+
@click="handleActivation()"
|
|
73
68
|
/>
|
|
74
69
|
</k-button-group>
|
|
75
70
|
</template>
|
|
@@ -31,13 +31,8 @@ const { openLicenseModal } = useLicense({
|
|
|
31
31
|
|
|
32
32
|
const currentLicenseStatus = ref(props.licenseStatus)
|
|
33
33
|
|
|
34
|
-
async function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (isLicenseActive) {
|
|
38
|
-
// Force a reload to refresh the plugin's cached context
|
|
39
|
-
window.location.reload()
|
|
40
|
-
}
|
|
34
|
+
async function handleActivation() {
|
|
35
|
+
await openLicenseModal()
|
|
41
36
|
}
|
|
42
37
|
</script>
|
|
43
38
|
|
|
@@ -52,7 +47,7 @@ async function handleRegistration() {
|
|
|
52
47
|
</k-dropdown-item>
|
|
53
48
|
<k-dropdown-item
|
|
54
49
|
icon="key"
|
|
55
|
-
@click="
|
|
50
|
+
@click="handleActivation()"
|
|
56
51
|
>
|
|
57
52
|
{{ t('activate') }}
|
|
58
53
|
</k-dropdown-item>
|
package/dist/constants.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region src/constants.ts
|
|
2
2
|
const ERROR_KEY_MAP = {
|
|
3
3
|
"Unauthorized": "errors.validation.invalidCredentials",
|
|
4
|
-
"License key not valid for this plugin": "errors.license.
|
|
5
|
-
"License key not valid for this plugin version": "errors.license.
|
|
6
|
-
"License key not valid for this plugin version, please upgrade your license": "errors.license.
|
|
7
|
-
"License key already activated": "errors.
|
|
4
|
+
"License key not valid for this plugin": "errors.license.invalid",
|
|
5
|
+
"License key not valid for this plugin version": "errors.license.incompatible",
|
|
6
|
+
"License key not valid for this plugin version, please upgrade your license": "errors.license.upgradeable",
|
|
7
|
+
"License key already activated": "errors.license.alreadyActivated"
|
|
8
8
|
};
|
|
9
9
|
const INTEGRITY_ERROR = "The activation buttons appear to be hidden. Please purchase a license.";
|
|
10
10
|
const I18N_MESSAGES = {
|
|
@@ -13,56 +13,84 @@ const I18N_MESSAGES = {
|
|
|
13
13
|
"modal.fields.orderId.help": "<a href=\"https://app.lemonsqueezy.com/my-orders\" target=\"_blank\">Find your order number</a> on Lemon Squeezy or <a href=\"mailto:hello@kirby.tools\">contact us</a> if you cannot find it.",
|
|
14
14
|
"errors.validation.missingFields": "Email address and order ID are required",
|
|
15
15
|
"errors.validation.invalidCredentials": "Email address or order ID is incorrect",
|
|
16
|
-
"errors.license.
|
|
17
|
-
"errors.license.
|
|
18
|
-
"errors.license.
|
|
19
|
-
"errors.
|
|
16
|
+
"errors.license.invalid": "License key invalid for this plugin",
|
|
17
|
+
"errors.license.incompatible": "License key invalid for this plugin version",
|
|
18
|
+
"errors.license.upgradeable": "License key invalid for this plugin version. Upgrade now on https://hub.kirby.tools.",
|
|
19
|
+
"errors.license.alreadyActivated": "License key already activated",
|
|
20
20
|
"activate": "Activate",
|
|
21
|
-
"activated": "Plugin activated",
|
|
22
21
|
"buy": "Buy a license",
|
|
23
|
-
"upgrade": "Upgrade"
|
|
22
|
+
"upgrade": "Upgrade",
|
|
23
|
+
"notification.success": "Plugin activated!"
|
|
24
24
|
},
|
|
25
25
|
de: {
|
|
26
26
|
"modal.fields.info": "Dankeschön für den Kauf von {label}! Bitte gib deine E-Mail-Adresse und Bestellnummer ein, um deine Lizenz zu aktivieren.",
|
|
27
27
|
"modal.fields.orderId.help": "<a href=\"https://app.lemonsqueezy.com/my-orders\" target=\"_blank\">Finde deine Bestellnummer</a> bei Lemon Squeezy oder <a href=\"mailto:hello@kirby.tools\">kontaktiere uns</a>, wenn du sie nicht finden kannst.",
|
|
28
28
|
"errors.validation.missingFields": "E-Mail-Adresse und Bestellnummer sind notwendig",
|
|
29
29
|
"errors.validation.invalidCredentials": "E-Mail-Adresse oder Bestellnummer ist falsch",
|
|
30
|
-
"errors.license.
|
|
31
|
-
"errors.license.
|
|
32
|
-
"errors.license.
|
|
33
|
-
"errors.
|
|
30
|
+
"errors.license.invalid": "Lizenzschlüssel ungültig für dieses Plugin",
|
|
31
|
+
"errors.license.incompatible": "Lizenzschlüssel ungültig für diese Plugin-Version",
|
|
32
|
+
"errors.license.upgradeable": "Lizenzschlüssel ungültig für diese Plugin-Version. Aktualisiere jetzt auf https://hub.kirby.tools.",
|
|
33
|
+
"errors.license.alreadyActivated": "Lizenzschlüssel bereits aktiviert",
|
|
34
34
|
"activate": "Aktivieren",
|
|
35
|
-
"activated": "Plugin aktiviert",
|
|
36
35
|
"buy": "Lizenz kaufen",
|
|
37
|
-
"upgrade": "Upgrade"
|
|
36
|
+
"upgrade": "Upgrade",
|
|
37
|
+
"notification.success": "Plugin aktiviert!"
|
|
38
38
|
},
|
|
39
39
|
fr: {
|
|
40
40
|
"modal.fields.info": "Merci d'avoir acheté {label} ! Veuillez saisir votre adresse e-mail et votre numéro de commande pour activer votre licence.",
|
|
41
41
|
"modal.fields.orderId.help": "<a href=\"https://app.lemonsqueezy.com/my-orders\" target=\"_blank\">Trouvez votre numéro de commande</a> sur Lemon Squeezy ou <a href=\"mailto:hello@kirby.tools\">contactez-nous</a> si vous ne le trouvez pas.",
|
|
42
42
|
"errors.validation.missingFields": "Adresse e-mail et numéro de commande requis",
|
|
43
43
|
"errors.validation.invalidCredentials": "Adresse e-mail ou numéro de commande incorrect",
|
|
44
|
-
"errors.license.
|
|
45
|
-
"errors.license.
|
|
46
|
-
"errors.license.
|
|
47
|
-
"errors.
|
|
44
|
+
"errors.license.invalid": "Clé de licence invalide pour ce plugin",
|
|
45
|
+
"errors.license.incompatible": "Clé de licence invalide pour cette version du plugin",
|
|
46
|
+
"errors.license.upgradeable": "Clé de licence invalide pour cette version du plugin. Mettez à niveau maintenant sur https://hub.kirby.tools.",
|
|
47
|
+
"errors.license.alreadyActivated": "Clé de licence déjà activée",
|
|
48
48
|
"activate": "Activer",
|
|
49
|
-
"activated": "Plugin activé",
|
|
50
49
|
"buy": "Acheter une licence",
|
|
51
|
-
"upgrade": "Upgrade"
|
|
50
|
+
"upgrade": "Upgrade",
|
|
51
|
+
"notification.success": "Plugin activé !"
|
|
52
52
|
},
|
|
53
53
|
nl: {
|
|
54
54
|
"modal.fields.info": "Bedankt voor het kopen van {label}! Voer je e-mailadres en bestelnummer in om je licentie te activeren.",
|
|
55
55
|
"modal.fields.orderId.help": "<a href=\"https://app.lemonsqueezy.com/my-orders\" target=\"_blank\">Vind je bestelnummer</a> op Lemon Squeezy of <a href=\"mailto:hello@kirby.tools\">neem contact met ons op</a> als je het niet kunt vinden.",
|
|
56
56
|
"errors.validation.missingFields": "E-mailadres en bestelnummer zijn verplicht",
|
|
57
57
|
"errors.validation.invalidCredentials": "E-mailadres of bestelnummer is onjuist",
|
|
58
|
-
"errors.license.
|
|
59
|
-
"errors.license.
|
|
60
|
-
"errors.license.
|
|
61
|
-
"errors.
|
|
58
|
+
"errors.license.invalid": "Licentiesleutel ongeldig voor deze plugin",
|
|
59
|
+
"errors.license.incompatible": "Licentiesleutel ongeldig voor deze pluginversie",
|
|
60
|
+
"errors.license.upgradeable": "Licentiesleutel ongeldig voor deze pluginversie. Upgrade nu op https://hub.kirby.tools.",
|
|
61
|
+
"errors.license.alreadyActivated": "Licentiesleutel al geactiveerd",
|
|
62
62
|
"activate": "Activeren",
|
|
63
|
-
"activated": "Plugin geactiveerd",
|
|
64
63
|
"buy": "Koop een licentie",
|
|
65
|
-
"upgrade": "Upgrade"
|
|
64
|
+
"upgrade": "Upgrade",
|
|
65
|
+
"notification.success": "Plugin geactiveerd!"
|
|
66
|
+
},
|
|
67
|
+
es: {
|
|
68
|
+
"modal.fields.info": "¡Gracias por comprar {label}! Introduce tu dirección de correo electrónico y número de pedido para activar tu licencia.",
|
|
69
|
+
"modal.fields.orderId.help": "<a href=\"https://app.lemonsqueezy.com/my-orders\" target=\"_blank\">Encuentra tu número de pedido</a> en Lemon Squeezy o <a href=\"mailto:hello@kirby.tools\">contáctanos</a> si no lo encuentras.",
|
|
70
|
+
"errors.validation.missingFields": "La dirección de correo electrónico y el número de pedido son obligatorios",
|
|
71
|
+
"errors.validation.invalidCredentials": "La dirección de correo electrónico o el número de pedido es incorrecto",
|
|
72
|
+
"errors.license.invalid": "Clave de licencia no válida para este plugin",
|
|
73
|
+
"errors.license.incompatible": "Clave de licencia no válida para esta versión del plugin",
|
|
74
|
+
"errors.license.upgradeable": "Clave de licencia no válida para esta versión del plugin. Actualiza ahora en https://hub.kirby.tools.",
|
|
75
|
+
"errors.license.alreadyActivated": "Clave de licencia ya activada",
|
|
76
|
+
"activate": "Activar",
|
|
77
|
+
"buy": "Comprar licencia",
|
|
78
|
+
"upgrade": "Actualizar",
|
|
79
|
+
"notification.success": "¡Plugin activado!"
|
|
80
|
+
},
|
|
81
|
+
it: {
|
|
82
|
+
"modal.fields.info": "Grazie per aver acquistato {label}! Inserisci il tuo indirizzo email e il numero d'ordine per attivare la licenza.",
|
|
83
|
+
"modal.fields.orderId.help": "<a href=\"https://app.lemonsqueezy.com/my-orders\" target=\"_blank\">Trova il tuo numero d'ordine</a> su Lemon Squeezy o <a href=\"mailto:hello@kirby.tools\">contattaci</a> se non riesci a trovarlo.",
|
|
84
|
+
"errors.validation.missingFields": "Indirizzo email e numero d'ordine sono obbligatori",
|
|
85
|
+
"errors.validation.invalidCredentials": "Indirizzo email o numero d'ordine non corretto",
|
|
86
|
+
"errors.license.invalid": "Chiave di licenza non valida per questo plugin",
|
|
87
|
+
"errors.license.incompatible": "Chiave di licenza non valida per questa versione del plugin",
|
|
88
|
+
"errors.license.upgradeable": "Chiave di licenza non valida per questa versione del plugin. Aggiorna ora su https://hub.kirby.tools.",
|
|
89
|
+
"errors.license.alreadyActivated": "Chiave di licenza già attivata",
|
|
90
|
+
"activate": "Attiva",
|
|
91
|
+
"buy": "Acquista licenza",
|
|
92
|
+
"upgrade": "Aggiorna",
|
|
93
|
+
"notification.success": "Plugin attivato!"
|
|
66
94
|
}
|
|
67
95
|
};
|
|
68
96
|
|
package/dist/license.js
CHANGED
|
@@ -33,7 +33,9 @@ function useLicense(licenseOptions) {
|
|
|
33
33
|
onSubmit: async (value) => {
|
|
34
34
|
const isLicenseActive = await activateLicense(value, licenseOptions);
|
|
35
35
|
if (!isLicenseActive) return false;
|
|
36
|
-
panel.notification.success(t("
|
|
36
|
+
panel.notification.success(t("notification.success"));
|
|
37
|
+
await new Promise((resolve) => setTimeout(resolve, 750));
|
|
38
|
+
window.location.reload();
|
|
37
39
|
return { isLicenseActive };
|
|
38
40
|
}
|
|
39
41
|
}))?.isLicenseActive ?? false };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirby-tools/licensing",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.4",
|
|
5
5
|
"packageManager": "pnpm@10.28.0",
|
|
6
6
|
"description": "License system for Kirby Tools plugins within the Kirby Panel",
|
|
7
7
|
"author": "Johann Schopplich <hello@johannschopplich.com>",
|