@kirby-tools/licensing 0.2.0 → 0.2.2

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 CHANGED
@@ -16,8 +16,8 @@ interface LicenseModalResult {
16
16
  }
17
17
  declare function useLicense({ label, apiNamespace, }: LicenseOptions): {
18
18
  isLocalhost: boolean;
19
- assertActivationIntegrity: ({ templateRef, license }: {
20
- templateRef: Ref<ComponentPublicInstance | null | undefined>;
19
+ assertActivationIntegrity: ({ component, license }: {
20
+ component: MaybeRef<ComponentPublicInstance | null | undefined>;
21
21
  license: MaybeRef<boolean | string | License>;
22
22
  }) => Promise<void>;
23
23
  openLicenseModal: () => Promise<LicenseModalResult>;
package/dist/index.d.ts CHANGED
@@ -16,8 +16,8 @@ interface LicenseModalResult {
16
16
  }
17
17
  declare function useLicense({ label, apiNamespace, }: LicenseOptions): {
18
18
  isLocalhost: boolean;
19
- assertActivationIntegrity: ({ templateRef, license }: {
20
- templateRef: Ref<ComponentPublicInstance | null | undefined>;
19
+ assertActivationIntegrity: ({ component, license }: {
20
+ component: MaybeRef<ComponentPublicInstance | null | undefined>;
21
21
  license: MaybeRef<boolean | string | License>;
22
22
  }) => Promise<void>;
23
23
  openLicenseModal: () => Promise<LicenseModalResult>;
package/dist/index.mjs CHANGED
@@ -122,15 +122,15 @@ function useLicense({
122
122
  });
123
123
  });
124
124
  };
125
- const assertActivationIntegrity = async ({ templateRef, license }) => {
125
+ const assertActivationIntegrity = async ({ component, license }) => {
126
+ const _component = unref(component);
126
127
  const _license = unref(license);
127
128
  if (_license !== false) {
128
129
  return;
129
130
  }
130
131
  await nextTick();
131
- if (!templateRef.value?.$el || window.getComputedStyle(templateRef.value.$el).display === "none" || window.getComputedStyle(templateRef.value.$el).visibility === "hidden") {
132
- const message = "Are you trying to hide the activation buttons? Please buy a license.";
133
- throw new Error(message);
132
+ if (!_component?.$el || window.getComputedStyle(_component.$el).display === "none" || window.getComputedStyle(_component.$el).visibility === "hidden") {
133
+ throw new Error("Are you trying to hide the activation buttons? Please buy a license.");
134
134
  }
135
135
  };
136
136
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kirby-tools/licensing",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
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>",