@kirby-tools/licensing 0.1.12 → 0.1.13
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/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +6 -6
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Ref, ComponentPublicInstance } from 'vue';
|
|
2
2
|
|
|
3
|
+
type LicenseKey = string;
|
|
3
4
|
interface License {
|
|
5
|
+
licenseKey: LicenseKey;
|
|
4
6
|
[key: string]: string;
|
|
5
7
|
}
|
|
8
|
+
|
|
6
9
|
interface LicenseOptions {
|
|
7
10
|
label: string;
|
|
8
11
|
apiNamespace: string;
|
|
@@ -15,8 +18,8 @@ declare function useLicense({ label, apiNamespace, }: LicenseOptions): {
|
|
|
15
18
|
assertActivationIntegrity: ({ templateRef, license }: {
|
|
16
19
|
templateRef: Ref<ComponentPublicInstance | null | undefined>;
|
|
17
20
|
license: boolean | string | License;
|
|
18
|
-
}) => Promise<
|
|
21
|
+
}) => Promise<void>;
|
|
19
22
|
openLicenseModal: () => Promise<LicenseModalResult>;
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
export { useLicense };
|
|
25
|
+
export { type License, type LicenseKey, useLicense };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Ref, ComponentPublicInstance } from 'vue';
|
|
2
2
|
|
|
3
|
+
type LicenseKey = string;
|
|
3
4
|
interface License {
|
|
5
|
+
licenseKey: LicenseKey;
|
|
4
6
|
[key: string]: string;
|
|
5
7
|
}
|
|
8
|
+
|
|
6
9
|
interface LicenseOptions {
|
|
7
10
|
label: string;
|
|
8
11
|
apiNamespace: string;
|
|
@@ -15,8 +18,8 @@ declare function useLicense({ label, apiNamespace, }: LicenseOptions): {
|
|
|
15
18
|
assertActivationIntegrity: ({ templateRef, license }: {
|
|
16
19
|
templateRef: Ref<ComponentPublicInstance | null | undefined>;
|
|
17
20
|
license: boolean | string | License;
|
|
18
|
-
}) => Promise<
|
|
21
|
+
}) => Promise<void>;
|
|
19
22
|
openLicenseModal: () => Promise<LicenseModalResult>;
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
export { useLicense };
|
|
25
|
+
export { type License, type LicenseKey, useLicense };
|
package/dist/index.mjs
CHANGED
|
@@ -116,7 +116,7 @@ function useLicense({
|
|
|
116
116
|
}
|
|
117
117
|
isRegistered = true;
|
|
118
118
|
panel.dialog.close();
|
|
119
|
-
panel.notification.success(t("activated")
|
|
119
|
+
panel.notification.success(t("activated"));
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
});
|
|
@@ -124,14 +124,14 @@ function useLicense({
|
|
|
124
124
|
};
|
|
125
125
|
const assertActivationIntegrity = async ({ templateRef, license }) => {
|
|
126
126
|
if (license !== false) {
|
|
127
|
-
return
|
|
127
|
+
return;
|
|
128
128
|
}
|
|
129
129
|
await nextTick();
|
|
130
|
-
if (!templateRef.value) {
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
if (!templateRef.value?.$el || window.getComputedStyle(templateRef.value.$el).display === "none") {
|
|
131
|
+
const message = "Are you trying to hide the activation buttons? Please buy a license.";
|
|
132
|
+
panel.notification.error(message);
|
|
133
|
+
throw new Error(message);
|
|
133
134
|
}
|
|
134
|
-
return true;
|
|
135
135
|
};
|
|
136
136
|
return {
|
|
137
137
|
isLocalhost,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirby-tools/licensing",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.13",
|
|
5
5
|
"packageManager": "pnpm@9.4.0",
|
|
6
6
|
"description": "Shared tooling for licensing in the Panel",
|
|
7
7
|
"author": "Johann Schopplich <hello@johannschopplich.com>",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"release": "bumpp"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"kirbyuse": "^0.
|
|
35
|
+
"kirbyuse": "^0.7.0",
|
|
36
36
|
"vue": "^2.7.16"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|