@kirby-tools/licensing 0.1.13 → 0.2.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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref, ComponentPublicInstance } from 'vue';
|
|
2
2
|
|
|
3
|
+
type MaybeRef<T = any> = T | Ref<T>;
|
|
3
4
|
type LicenseKey = string;
|
|
4
5
|
interface License {
|
|
5
6
|
licenseKey: LicenseKey;
|
|
@@ -17,7 +18,7 @@ declare function useLicense({ label, apiNamespace, }: LicenseOptions): {
|
|
|
17
18
|
isLocalhost: boolean;
|
|
18
19
|
assertActivationIntegrity: ({ templateRef, license }: {
|
|
19
20
|
templateRef: Ref<ComponentPublicInstance | null | undefined>;
|
|
20
|
-
license: boolean | string | License
|
|
21
|
+
license: MaybeRef<boolean | string | License>;
|
|
21
22
|
}) => Promise<void>;
|
|
22
23
|
openLicenseModal: () => Promise<LicenseModalResult>;
|
|
23
24
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref, ComponentPublicInstance } from 'vue';
|
|
2
2
|
|
|
3
|
+
type MaybeRef<T = any> = T | Ref<T>;
|
|
3
4
|
type LicenseKey = string;
|
|
4
5
|
interface License {
|
|
5
6
|
licenseKey: LicenseKey;
|
|
@@ -17,7 +18,7 @@ declare function useLicense({ label, apiNamespace, }: LicenseOptions): {
|
|
|
17
18
|
isLocalhost: boolean;
|
|
18
19
|
assertActivationIntegrity: ({ templateRef, license }: {
|
|
19
20
|
templateRef: Ref<ComponentPublicInstance | null | undefined>;
|
|
20
|
-
license: boolean | string | License
|
|
21
|
+
license: MaybeRef<boolean | string | License>;
|
|
21
22
|
}) => Promise<void>;
|
|
22
23
|
openLicenseModal: () => Promise<LicenseModalResult>;
|
|
23
24
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { usePanel, useApi, nextTick } from 'kirbyuse';
|
|
1
|
+
import { usePanel, useApi, unref, nextTick } from 'kirbyuse';
|
|
2
2
|
|
|
3
3
|
const TRANSLATIONS = {
|
|
4
4
|
en: {
|
|
@@ -123,13 +123,13 @@ function useLicense({
|
|
|
123
123
|
});
|
|
124
124
|
};
|
|
125
125
|
const assertActivationIntegrity = async ({ templateRef, license }) => {
|
|
126
|
-
|
|
126
|
+
const _license = unref(license);
|
|
127
|
+
if (_license !== false) {
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
130
|
await nextTick();
|
|
130
|
-
if (!templateRef.value?.$el || window.getComputedStyle(templateRef.value.$el).display === "none") {
|
|
131
|
+
if (!templateRef.value?.$el || window.getComputedStyle(templateRef.value.$el).display === "none" || window.getComputedStyle(templateRef.value.$el).visibility === "hidden") {
|
|
131
132
|
const message = "Are you trying to hide the activation buttons? Please buy a license.";
|
|
132
|
-
panel.notification.error(message);
|
|
133
133
|
throw new Error(message);
|
|
134
134
|
}
|
|
135
135
|
};
|
package/package.json
CHANGED