@cartridge/controller 0.7.13 → 0.7.14-alpha.1

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.1 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.1 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.1 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-CwuOc9_a.js  12.78 kB │ gzip: 5.24 kB │ map: 30.48 kB
23
+ dist/index.js 201.32 kB │ gzip: 34.36 kB │ map: 428.46 kB
24
+ [vite:dts] Declaration files built in 5253ms.
25
25
 
26
- ✓ built in 6.75s
26
+ ✓ built in 6.92s
27
27
 
28
- > @cartridge/controller@0.7.13 build:node /home/runner/work/controller/controller/packages/controller
28
+ > @cartridge/controller@0.7.14-alpha.1 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
@@ -36,16 +36,16 @@ computing gzip size...
36
36
  CLI Cleaning output folder
37
37
  ESM Build start
38
38
  CJS Build start
39
+ "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
39
40
  "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
40
41
  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
- "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
45
42
  ESM dist/node/index.js 21.12 KB
46
43
  ESM dist/node/index.js.map 49.04 KB
47
- ESM ⚡️ Build success in 377ms
44
+ ESM ⚡️ Build success in 346ms
45
+ CJS dist/node/index.cjs 21.89 KB
46
+ CJS dist/node/index.cjs.map 49.25 KB
47
+ CJS ⚡️ Build success in 346ms
48
48
  DTS Build start
49
- DTS ⚡️ Build success in 4225ms
49
+ DTS ⚡️ Build success in 4292ms
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.1 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.1 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-CwuOc9_a.js  12.78 kB │ gzip: 5.24 kB │ map: 30.48 kB
19
+ dist/index.js 201.32 kB │ gzip: 34.36 kB │ map: 428.46 kB
20
+ [vite:dts] Declaration files built in 5111ms.
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.1 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
@@ -32,16 +32,16 @@ computing gzip size...
32
32
  CLI Cleaning output folder
33
33
  ESM Build start
34
34
  CJS Build start
35
- "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
36
35
  "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
37
36
  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
37
+ "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
38
+ CJS dist/node/index.cjs 21.89 KB
39
+ CJS dist/node/index.cjs.map 49.25 KB
40
+ CJS ⚡️ Build success in 278ms
41
41
  ESM dist/node/index.js 21.12 KB
42
42
  ESM dist/node/index.js.map 49.04 KB
43
- ESM ⚡️ Build success in 294ms
43
+ ESM ⚡️ Build success in 278ms
44
44
  DTS Build start
45
- DTS ⚡️ Build success in 4241ms
45
+ DTS ⚡️ Build success in 4487ms
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-CwuOc9_a.js";
3
+ import { F as fn, h as bn, n as yn, a as wn, b as vn } from "./provider-CwuOc9_a.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;
@@ -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();
@@ -963,7 +964,8 @@ class ut {
963
964
  class ft {
964
965
  walletAdapters;
965
966
  constructor() {
966
- this.walletAdapters = /* @__PURE__ */ new Map();
967
+ if (this.walletAdapters = /* @__PURE__ */ new Map(), typeof window > "u")
968
+ return;
967
969
  const e = new gt();
968
970
  e.isAvailable() && this.walletAdapters.set("metamask", e);
969
971
  const t = new mt();
@@ -971,7 +973,7 @@ class ft {
971
973
  const r = new pt();
972
974
  r.isAvailable() && this.walletAdapters.set("argent", r);
973
975
  const o = new ut();
974
- o.isAvailable() && this.walletAdapters.set("rabby", o), typeof window < "u" && (window.wallet_bridge = this);
976
+ o.isAvailable() && this.walletAdapters.set("rabby", o), window.wallet_bridge = this;
975
977
  }
976
978
  getIFrameMethods() {
977
979
  return {
@@ -1218,7 +1220,7 @@ class an extends ze {
1218
1220
  console.error(new y().message);
1219
1221
  return;
1220
1222
  }
1221
- document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
1223
+ typeof document < "u" && document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
1222
1224
  try {
1223
1225
  let e = await this.keychain.connect(
1224
1226
  this.options.policies || {},
@@ -1260,7 +1262,7 @@ class an extends ze {
1260
1262
  console.error(new y().message);
1261
1263
  return;
1262
1264
  }
1263
- return document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
1265
+ return typeof document < "u" && document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
1264
1266
  }
1265
1267
  async openProfile(e = "inventory") {
1266
1268
  if (!this.profile || !this.iframes.profile?.url) {
@@ -2212,7 +2214,7 @@ class pn {
2212
2214
  return this.account ? [this.account] : [];
2213
2215
  }
2214
2216
  isAvailable() {
2215
- return !!this.provider;
2217
+ return typeof window < "u" && !!this.provider;
2216
2218
  }
2217
2219
  getInfo() {
2218
2220
  const e = this.isAvailable();