@cartridge/controller 0.7.13 → 0.7.14-alpha.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.
@@ -1,13 +1,13 @@
1
1
 
2
- > @cartridge/controller@0.7.13 build:deps /home/runner/work/controller/controller/packages/controller
2
+ > @cartridge/controller@0.7.14-alpha.0 build:deps /home/runner/work/controller/controller/packages/controller
3
3
  > pnpm build
4
4
 
5
5
 
6
- > @cartridge/controller@0.7.13 build /home/runner/work/controller/controller/packages/controller
6
+ > @cartridge/controller@0.7.14-alpha.0 build /home/runner/work/controller/controller/packages/controller
7
7
  > pnpm build:browser && pnpm build:node
8
8
 
9
9
 
10
- > @cartridge/controller@0.7.13 build:browser /home/runner/work/controller/controller/packages/controller
10
+ > @cartridge/controller@0.7.14-alpha.0 build:browser /home/runner/work/controller/controller/packages/controller
11
11
  > vite build
12
12
 
13
13
  vite v6.3.4 building for production...
@@ -19,13 +19,13 @@ rendering chunks...
19
19
  [vite:dts] Start generate declaration files...
20
20
  computing gzip size...
21
21
  dist/session.js  11.10 kB │ gzip: 3.45 kB │ map: 59.54 kB
22
- dist/provider-C4iZV8Y5.js  12.78 kB │ gzip: 5.24 kB │ map: 30.48 kB
23
- dist/index.js 201.01 kB │ gzip: 34.30 kB │ map: 427.78 kB
24
- [vite:dts] Declaration files built in 5050ms.
22
+ dist/provider-DAt9mAeP.js  12.78 kB │ gzip: 5.24 kB │ map: 30.48 kB
23
+ dist/index.js 201.33 kB │ gzip: 34.35 kB │ map: 428.49 kB
24
+ [vite:dts] Declaration files built in 5104ms.
25
25
 
26
- ✓ built in 6.75s
26
+ ✓ built in 6.81s
27
27
 
28
- > @cartridge/controller@0.7.13 build:node /home/runner/work/controller/controller/packages/controller
28
+ > @cartridge/controller@0.7.14-alpha.0 build:node /home/runner/work/controller/controller/packages/controller
29
29
  > tsup --config tsup.node.config.ts
30
30
 
31
31
  CLI Building entry: src/node/index.ts
@@ -39,13 +39,13 @@ computing gzip size...
39
39
  "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
40
40
  Entry module "dist/node/index.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
41
41
  "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
42
- CJS dist/node/index.cjs 21.88 KB
43
- CJS dist/node/index.cjs.map 49.24 KB
44
- CJS ⚡️ Build success in 377ms
42
+ CJS dist/node/index.cjs 21.89 KB
43
+ CJS dist/node/index.cjs.map 49.25 KB
44
+ CJS ⚡️ Build success in 355ms
45
45
  ESM dist/node/index.js 21.12 KB
46
46
  ESM dist/node/index.js.map 49.04 KB
47
- ESM ⚡️ Build success in 377ms
47
+ ESM ⚡️ Build success in 356ms
48
48
  DTS Build start
49
- DTS ⚡️ Build success in 4225ms
49
+ DTS ⚡️ Build success in 4235ms
50
50
  DTS dist/node/index.d.ts 5.29 KB
51
51
  DTS dist/node/index.d.cts 5.29 KB
@@ -1,9 +1,9 @@
1
1
 
2
- > @cartridge/controller@0.7.13 build /home/runner/work/controller/controller/packages/controller
2
+ > @cartridge/controller@0.7.14-alpha.0 build /home/runner/work/controller/controller/packages/controller
3
3
  > pnpm build:browser && pnpm build:node
4
4
 
5
5
 
6
- > @cartridge/controller@0.7.13 build:browser /home/runner/work/controller/controller/packages/controller
6
+ > @cartridge/controller@0.7.14-alpha.0 build:browser /home/runner/work/controller/controller/packages/controller
7
7
  > vite build
8
8
 
9
9
  vite v6.3.4 building for production...
@@ -15,13 +15,13 @@ rendering chunks...
15
15
  [vite:dts] Start generate declaration files...
16
16
  computing gzip size...
17
17
  dist/session.js  11.10 kB │ gzip: 3.45 kB │ map: 59.54 kB
18
- dist/provider-C4iZV8Y5.js  12.78 kB │ gzip: 5.24 kB │ map: 30.48 kB
19
- dist/index.js 201.01 kB │ gzip: 34.30 kB │ map: 427.78 kB
20
- [vite:dts] Declaration files built in 5081ms.
18
+ dist/provider-DAt9mAeP.js  12.78 kB │ gzip: 5.24 kB │ map: 30.48 kB
19
+ dist/index.js 201.33 kB │ gzip: 34.35 kB │ map: 428.49 kB
20
+ [vite:dts] Declaration files built in 5123ms.
21
21
 
22
- ✓ built in 6.99s
22
+ ✓ built in 7.05s
23
23
 
24
- > @cartridge/controller@0.7.13 build:node /home/runner/work/controller/controller/packages/controller
24
+ > @cartridge/controller@0.7.14-alpha.0 build:node /home/runner/work/controller/controller/packages/controller
25
25
  > tsup --config tsup.node.config.ts
26
26
 
27
27
  CLI Building entry: src/node/index.ts
@@ -35,13 +35,13 @@ computing gzip size...
35
35
  "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
36
36
  "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
37
37
  Entry module "dist/node/index.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
38
- CJS dist/node/index.cjs 21.88 KB
39
- CJS dist/node/index.cjs.map 49.24 KB
40
- CJS ⚡️ Build success in 294ms
41
38
  ESM dist/node/index.js 21.12 KB
42
39
  ESM dist/node/index.js.map 49.04 KB
43
- ESM ⚡️ Build success in 294ms
40
+ ESM ⚡️ Build success in 332ms
41
+ CJS dist/node/index.cjs 21.89 KB
42
+ CJS dist/node/index.cjs.map 49.25 KB
43
+ CJS ⚡️ Build success in 331ms
44
44
  DTS Build start
45
- DTS ⚡️ Build success in 4241ms
45
+ DTS ⚡️ Build success in 4248ms
46
46
  DTS dist/node/index.d.ts 5.29 KB
47
47
  DTS dist/node/index.d.cts 5.29 KB
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { WalletAccount as Pe, shortString as G, num as Me } from "starknet";
2
- import { R as E, t as Ne, K as De, P as Be, B as ze, N as y, p as Te, A as je } from "./provider-C4iZV8Y5.js";
3
- import { F as fn, h as bn, n as yn, a as wn, b as vn } from "./provider-C4iZV8Y5.js";
2
+ import { R as E, t as Ne, K as De, P as Be, B as ze, N as y, p as Te, A as je } from "./provider-DAt9mAeP.js";
3
+ import { F as fn, h as bn, n as yn, a as wn, b as vn } from "./provider-DAt9mAeP.js";
4
4
  import { connect as Ue } from "starknetkit";
5
5
  import { InjectedConnector as Le } from "starknetkit/injected";
6
6
  import { MetaMaskSDK as Oe } from "@metamask/sdk";
@@ -335,7 +335,7 @@ class be {
335
335
  onConnect: a,
336
336
  methods: i = {}
337
337
  }) {
338
- if (typeof document > "u")
338
+ if (typeof document > "u" || typeof window > "u")
339
339
  return;
340
340
  r && t.searchParams.set("preset", r), this.url = t;
341
341
  const s = document.createElement("iframe");
@@ -351,13 +351,14 @@ class be {
351
351
  ).forEach((m) => {
352
352
  const f = m.parentElement;
353
353
  f && (f.style.visibility = "hidden", f.style.opacity = "0");
354
- }), document.body.style.overflow = "auto";
354
+ }), document.body && (document.body.style.overflow = "auto");
355
355
  },
356
356
  reload: (l) => () => window.location.reload(),
357
357
  ...i
358
358
  }
359
359
  }).promise.then(a), this.resize(), window.addEventListener("resize", () => this.resize());
360
360
  const p = new MutationObserver(() => {
361
+ if (typeof document > "u") return;
361
362
  const l = document.getElementById("controller");
362
363
  document.body && (e === "controller-keychain" && !l || e === "controller-profile") && (document.body.appendChild(d), p.disconnect());
363
364
  });
@@ -369,10 +370,10 @@ class be {
369
370
  document.body && (e === "controller-keychain" && !c || e === "controller-profile") && document.body.appendChild(d), this.onClose = o;
370
371
  }
371
372
  open() {
372
- this.container && (document.body.style.overflow = "hidden", this.container.style.visibility = "visible", this.container.style.opacity = "1");
373
+ !this.container || typeof document > "u" || !document.body || (document.body.style.overflow = "hidden", this.container.style.visibility = "visible", this.container.style.opacity = "1");
373
374
  }
374
375
  close() {
375
- this.container && (this.onClose?.(), document.body.style.overflow = "auto", this.container.style.visibility = "hidden", this.container.style.opacity = "0");
376
+ !this.container || typeof document > "u" || !document.body || (this.onClose?.(), document.body.style.overflow = "auto", this.container.style.visibility = "hidden", this.container.style.opacity = "0");
376
377
  }
377
378
  sendBackward() {
378
379
  this.container && (this.container.style.zIndex = "9999");
@@ -381,7 +382,7 @@ class be {
381
382
  this.container && (this.container.style.zIndex = "10000");
382
383
  }
383
384
  resize() {
384
- if (this.iframe) {
385
+ if (!(!this.iframe || typeof window > "u")) {
385
386
  if (this.iframe.style.userSelect = "none", window.innerWidth < 768) {
386
387
  this.iframe.style.height = "100%", this.iframe.style.width = "100%", this.iframe.style.borderRadius = "0";
387
388
  return;
@@ -528,7 +529,7 @@ class gt {
528
529
  this.MMSDK = new Oe({
529
530
  dappMetadata: {
530
531
  name: "Cartridge Controller",
531
- url: window.location.href
532
+ url: typeof window < "u" ? window.location.href : ""
532
533
  }
533
534
  }), this.isAvailable() && this.MMSDK.sdkInitPromise?.then(() => {
534
535
  this.MMSDK.getProvider()?.request({
@@ -811,7 +812,7 @@ class ut {
811
812
  });
812
813
  }
813
814
  isAvailable() {
814
- return !!this.provider;
815
+ return typeof window < "u" && !!this.provider;
815
816
  }
816
817
  getInfo() {
817
818
  const e = this.isAvailable();
@@ -1218,7 +1219,7 @@ class an extends ze {
1218
1219
  console.error(new y().message);
1219
1220
  return;
1220
1221
  }
1221
- document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
1222
+ typeof document < "u" && document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
1222
1223
  try {
1223
1224
  let e = await this.keychain.connect(
1224
1225
  this.options.policies || {},
@@ -1260,7 +1261,7 @@ class an extends ze {
1260
1261
  console.error(new y().message);
1261
1262
  return;
1262
1263
  }
1263
- return document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
1264
+ return typeof document < "u" && document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
1264
1265
  }
1265
1266
  async openProfile(e = "inventory") {
1266
1267
  if (!this.profile || !this.iframes.profile?.url) {
@@ -2212,7 +2213,7 @@ class pn {
2212
2213
  return this.account ? [this.account] : [];
2213
2214
  }
2214
2215
  isAvailable() {
2215
- return !!this.provider;
2216
+ return typeof window < "u" && !!this.provider;
2216
2217
  }
2217
2218
  getInfo() {
2218
2219
  const e = this.isAvailable();