@kirby-tools/licensing 0.1.6 → 0.1.8

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
@@ -3,7 +3,7 @@ interface LicenseOptions {
3
3
  apiNamespace: string;
4
4
  }
5
5
  interface LicenseModalResult {
6
- isRegistered?: boolean;
6
+ isRegistered: boolean;
7
7
  }
8
8
  declare function useLicense({ label, apiNamespace, }: LicenseOptions): {
9
9
  isLocalhost: boolean;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ interface LicenseOptions {
3
3
  apiNamespace: string;
4
4
  }
5
5
  interface LicenseModalResult {
6
- isRegistered?: boolean;
6
+ isRegistered: boolean;
7
7
  }
8
8
  declare function useLicense({ label, apiNamespace, }: LicenseOptions): {
9
9
  isLocalhost: boolean;
package/dist/index.mjs CHANGED
@@ -56,6 +56,7 @@ function useLicense({
56
56
  return true;
57
57
  };
58
58
  const openLicenseModal = () => {
59
+ let isRegistered = false;
59
60
  return new Promise((resolve) => {
60
61
  panel.dialog.open({
61
62
  component: "k-form-dialog",
@@ -82,8 +83,9 @@ function useLicense({
82
83
  }
83
84
  },
84
85
  on: {
86
+ // Close event will always be triggered, even on submit
85
87
  close: () => {
86
- resolve({});
88
+ resolve({ isRegistered });
87
89
  },
88
90
  submit: async (event) => {
89
91
  const { email, orderId } = event;
@@ -97,9 +99,9 @@ function useLicense({
97
99
  panel.notification.error(error.message);
98
100
  return;
99
101
  }
102
+ isRegistered = true;
100
103
  panel.dialog.close();
101
104
  panel.notification.success(t("activated"), { label });
102
- resolve({ isRegistered: true });
103
105
  }
104
106
  }
105
107
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kirby-tools/licensing",
3
3
  "type": "module",
4
- "version": "0.1.6",
4
+ "version": "0.1.8",
5
5
  "packageManager": "pnpm@9.3.0",
6
6
  "description": "Shared tooling for licensing in the Panel",
7
7
  "author": "Johann Schopplich <hello@johannschopplich.com>",