@powerhousedao/reactor-browser 1.8.2 → 1.9.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.
@@ -9,7 +9,7 @@ import { useUserPermissions as S } from "../hooks/useUserPermissions.js";
9
9
  import "document-model/document";
10
10
  import "../hooks/useConnectCrypto.js";
11
11
  import "../hooks/useDocumentDrives.js";
12
- var j = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, a = (t, e, r, o) => {
12
+ var j = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, d = (t, e, r, o) => {
13
13
  for (var s = _(e, r), c = t.length - 1, v; c >= 0; c--)
14
14
  (v = t[c]) && (s = v(e, r, s) || s);
15
15
  return s && j(e, r, s), s;
@@ -17,7 +17,7 @@ var j = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, a = (t, e, r
17
17
  const D = {
18
18
  error: console.error
19
19
  };
20
- function d(t, e, r) {
20
+ function a(t, e, r) {
21
21
  const o = r.value;
22
22
  r.value = function(...s) {
23
23
  if (!this.server)
@@ -75,35 +75,35 @@ class n {
75
75
  }
76
76
  /* eslint-enable @typescript-eslint/no-non-null-assertion */
77
77
  }
78
- a([
79
- d
78
+ d([
79
+ a
80
80
  ], n.prototype, "migrateReadDrive");
81
- a([
82
- d
81
+ d([
82
+ a
83
83
  ], n.prototype, "addReadDrive");
84
- a([
85
- d
84
+ d([
85
+ a
86
86
  ], n.prototype, "getReadDrives");
87
- a([
88
- d
87
+ d([
88
+ a
89
89
  ], n.prototype, "getReadDriveBySlug");
90
- a([
91
- d
90
+ d([
91
+ a
92
92
  ], n.prototype, "getReadDrive");
93
- a([
94
- d
93
+ d([
94
+ a
95
95
  ], n.prototype, "getReadDriveContext");
96
- a([
97
- d
96
+ d([
97
+ a
98
98
  ], n.prototype, "fetchDrive");
99
- a([
100
- d
99
+ d([
100
+ a
101
101
  ], n.prototype, "fetchDocument");
102
- a([
103
- d
102
+ d([
103
+ a
104
104
  ], n.prototype, "deleteReadDrive");
105
- a([
106
- d
105
+ d([
106
+ a
107
107
  ], n.prototype, "onReadDrivesUpdate");
108
108
  const p = new n(), P = A({
109
109
  ...p,
@@ -2,21 +2,21 @@ var E = (s) => {
2
2
  throw TypeError(s);
3
3
  };
4
4
  var b = (s, e, t) => e.has(s) || E("Cannot " + t);
5
- var n = (s, e, t) => (b(s, e, "read from private field"), t ? t.call(s) : e.get(s)), a = (s, e, t) => e.has(s) ? E("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), h = (s, e, t, r) => (b(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t), p = (s, e, t) => (b(s, e, "access private method"), t);
5
+ var o = (s, e, t) => (b(s, e, "read from private field"), t ? t.call(s) : e.get(s)), a = (s, e, t) => e.has(s) ? E("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), h = (s, e, t, r) => (b(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t), p = (s, e, t) => (b(s, e, "access private method"), t);
6
6
  var l, c, y, i, u, w;
7
- const o = class o {
7
+ const n = class n {
8
8
  constructor() {
9
9
  a(this, u);
10
10
  a(this, i);
11
11
  h(this, i, new Promise((e, t) => {
12
- const r = indexedDB.open(n(o, l), 1);
12
+ const r = indexedDB.open(o(n, l), 1);
13
13
  r.onupgradeneeded = () => {
14
- r.result.createObjectStore(n(o, c));
14
+ r.result.createObjectStore(o(n, c));
15
15
  }, r.onsuccess = () => e(r.result), r.onerror = () => t(r.error);
16
16
  }));
17
17
  }
18
18
  async saveKeyPair(e) {
19
- const r = (await p(this, u, w).call(this)).put(e, n(o, y));
19
+ const r = (await p(this, u, w).call(this)).put(e, o(n, y));
20
20
  return new Promise((d, P) => {
21
21
  r.onsuccess = () => {
22
22
  d();
@@ -38,12 +38,12 @@ const o = class o {
38
38
  }
39
39
  };
40
40
  l = new WeakMap(), c = new WeakMap(), y = new WeakMap(), i = new WeakMap(), u = new WeakSet(), w = async function(e = "readwrite") {
41
- return (await n(this, i)).transaction(
42
- n(o, c),
41
+ return (await o(this, i)).transaction(
42
+ o(n, c),
43
43
  e
44
- ).objectStore(n(o, c));
45
- }, a(o, l, "browserKeyDB"), a(o, c, "keyPairs"), a(o, y, "keyPair");
46
- let k = o;
44
+ ).objectStore(o(n, c));
45
+ }, a(n, l, "browserKeyDB"), a(n, c, "keyPairs"), a(n, y, "keyPair");
46
+ let k = n;
47
47
  export {
48
48
  k as BrowserKeyStorage
49
49
  };
@@ -2,7 +2,7 @@ import { atom as e, useAtom as c } from "jotai";
2
2
  import { useMemo as i, useEffect as s } from "react";
3
3
  import { ConnectCrypto as a } from "../crypto/index.js";
4
4
  import { BrowserKeyStorage as d } from "../crypto/browser.js";
5
- const o = (async () => {
5
+ const n = (async () => {
6
6
  const t = new a(new d());
7
7
  return await t.did(), t;
8
8
  })();
@@ -10,21 +10,21 @@ function w() {
10
10
  return i(
11
11
  () => ({
12
12
  async regenerateDid() {
13
- return (await o).regenerateDid();
13
+ return (await n).regenerateDid();
14
14
  },
15
15
  async did() {
16
- return (await o).did();
16
+ return (await n).did();
17
17
  },
18
- sign: async (t) => await (await o).sign(t)
18
+ sign: async (t) => await (await n).sign(t)
19
19
  }),
20
20
  []
21
21
  );
22
22
  }
23
23
  const p = e(void 0);
24
24
  function C() {
25
- const [t, n] = c(p);
25
+ const [t, o] = c(p);
26
26
  return s(() => {
27
- t || o.then((r) => r.did()).then((r) => n(r)).catch(console.error);
27
+ t || n.then((r) => r.did()).then((r) => o(r)).catch(console.error);
28
28
  }), t;
29
29
  }
30
30
  export {
@@ -1,28 +1,28 @@
1
- import { useState as d, useEffect as x } from "react";
2
- function c(u, n, g = console.error) {
3
- const [m, f] = d(n), [v, h] = d(), i = (s) => {
1
+ import { useState as S, useEffect as x } from "react";
2
+ function c(u, o, g = console.error) {
3
+ const [m, f] = S(o), [D, h] = S(), i = (s) => {
4
4
  h(s), g(s);
5
5
  };
6
6
  return x(() => {
7
- f(n);
8
- }, [n]), [m, (s, r, e) => {
9
- h(void 0), f((o) => {
10
- if (!u || !o) return o;
7
+ f(o);
8
+ }, [o]), [m, (s, r, e) => {
9
+ h(void 0), f((n) => {
10
+ if (!u || !n) return n;
11
11
  try {
12
- const t = u(o, s), D = s.scope ?? "global", w = t.operations[D], p = w[w.length - 1];
12
+ const t = u(n, s), v = s.scope ?? "global", d = t.operations[v], p = d[d.length - 1];
13
13
  if (p.error) {
14
- const S = new Error(p.error);
15
- i(S), e == null || e(S);
14
+ const w = new Error(p.error);
15
+ i(w), e == null || e(w);
16
16
  }
17
17
  return r == null || r(p, {
18
- prevState: { ...o },
18
+ prevState: { ...n },
19
19
  newState: { ...t }
20
20
  }), t;
21
21
  } catch (t) {
22
- return i(t), e == null || e(t), o;
22
+ return i(t), e == null || e(t), n;
23
23
  }
24
24
  });
25
- }, v];
25
+ }, D];
26
26
  }
27
27
  export {
28
28
  c as useDocumentDispatch
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/reactor-browser",
3
- "version": "1.8.2",
3
+ "version": "1.9.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -18,22 +18,22 @@
18
18
  "@types/react-dom": "^18.3.1",
19
19
  "react": "^18.3.1",
20
20
  "react-dom": "^18.3.1",
21
- "@powerhousedao/config": "1.15.0",
22
- "@powerhousedao/design-system": "1.22.2",
23
- "@powerhousedao/scalars": "1.21.0",
24
- "document-drive": "1.16.2",
25
- "document-model": "2.18.0",
26
- "document-model-libs": "1.130.0"
21
+ "@powerhousedao/config": "1.16.0",
22
+ "@powerhousedao/design-system": "1.23.0",
23
+ "@powerhousedao/scalars": "1.22.0",
24
+ "document-drive": "1.17.0",
25
+ "document-model": "2.19.0",
26
+ "document-model-libs": "1.131.0"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "^18.3.1",
30
30
  "react-dom": "^18.3.1",
31
- "@powerhousedao/design-system": "1.22.2",
32
- "@powerhousedao/config": "1.15.0",
33
- "document-drive": "1.16.2",
34
- "document-model": "2.18.0",
35
- "@powerhousedao/scalars": "1.21.0",
36
- "document-model-libs": "1.130.0"
31
+ "@powerhousedao/config": "1.16.0",
32
+ "@powerhousedao/design-system": "1.23.0",
33
+ "@powerhousedao/scalars": "1.22.0",
34
+ "document-drive": "1.17.0",
35
+ "document-model": "2.19.0",
36
+ "document-model-libs": "1.131.0"
37
37
  },
38
38
  "dependencies": {
39
39
  "did-key-creator": "^1.2.0",