@limrun/ui 0.13.3-rc.1 → 0.13.4

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.
Files changed (54) hide show
  1. package/dist/app-store-relay/index.cjs +4 -4
  2. package/dist/app-store-relay/index.js +175 -119
  3. package/dist/app-store-relay/react.cjs +1 -1
  4. package/dist/app-store-relay/react.js +2 -2
  5. package/dist/{browser-storage-BJ__DGJ6.mjs → browser-storage-Cx9eW-bm.mjs} +48 -45
  6. package/dist/browser-storage-jJaIht4K.js +1 -0
  7. package/dist/{client-CnbCWvCs.js → client-ASLtHFLh.js} +1 -1
  8. package/dist/{client-Bk1N3XIF.mjs → client-CGdh8yoJ.mjs} +33 -27
  9. package/dist/components/remote-control.d.ts +144 -0
  10. package/dist/core/device-install/apple/provisioning.d.ts +4 -4
  11. package/dist/device-build/index.cjs +1 -1
  12. package/dist/device-build/index.js +5 -5
  13. package/dist/device-build/react.cjs +1 -1
  14. package/dist/device-build/react.js +15 -13
  15. package/dist/device-install/demo/demo.d.ts +0 -0
  16. package/dist/device-install/index.cjs +1 -1
  17. package/dist/device-install/index.d.ts +1 -1
  18. package/dist/device-install/index.js +134 -121
  19. package/dist/device-install/react.cjs +1 -1
  20. package/dist/device-install/react.js +55 -50
  21. package/dist/{index-BXg7HdIs.mjs → index-DFdCvi2_.mjs} +3 -7
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.js +1336 -1089
  24. package/dist/limbuild-client-CgEncrgx.js +1 -0
  25. package/dist/{limbuild-client-CFJhYsRx.mjs → limbuild-client-D7U7w342.mjs} +4 -2
  26. package/dist/{provisioning-CdseoMJQ.mjs → provisioning-DKbkBO-p.mjs} +11 -11
  27. package/dist/{provisioning-D2ZZQeyX.js → provisioning-Va0PH4Kk.js} +1 -1
  28. package/package.json +1 -1
  29. package/src/app-store-relay/index.test.ts +1 -5
  30. package/src/app-store-relay/index.ts +109 -42
  31. package/src/app-store-relay/react.ts +6 -2
  32. package/src/components/remote-control.tsx +726 -0
  33. package/src/core/device-install/apple/client.ts +29 -22
  34. package/src/core/device-install/apple/crypto.ts +9 -6
  35. package/src/core/device-install/apple/gsa-srp.ts +3 -7
  36. package/src/core/device-install/apple/provisioning.ts +16 -18
  37. package/src/core/device-install/apple/relay.ts +5 -1
  38. package/src/core/device-install/operations/limbuild-client.ts +8 -1
  39. package/src/core/device-install/operations/operations.ts +3 -1
  40. package/src/core/device-install/operations/relay-client.ts +57 -27
  41. package/src/core/device-install/operations/usbmux.ts +3 -3
  42. package/src/core/device-install/operations/webusb.ts +9 -4
  43. package/src/core/device-install/storage/browser-storage.ts +20 -6
  44. package/src/core/device-install/types.ts +1 -7
  45. package/src/device-build/react.ts +4 -1
  46. package/src/device-install/README.md +423 -0
  47. package/src/device-install/demo/demo.css +493 -0
  48. package/src/device-install/demo/demo.tsx +1069 -0
  49. package/src/device-install/demo/index.html +12 -0
  50. package/src/device-install/index.ts +7 -7
  51. package/src/device-install/react.ts +26 -17
  52. package/src/index.ts +1 -1
  53. package/dist/browser-storage-C1jQLXat.js +0 -1
  54. package/dist/limbuild-client-C_CMNLYV.js +0 -1
@@ -1,88 +1,93 @@
1
- import { useState as d, useRef as b, useCallback as u, useEffect as D } from "react";
2
- import { closeDeviceRelayTarget as l, requestUSBAccess as N, pairDevice as q, startDeviceInstall as C } from "./index.js";
3
- import { j as T, k as j } from "../browser-storage-BJ__DGJ6.mjs";
1
+ import { useState as u, useRef as h, useCallback as l, useEffect as D } from "react";
2
+ import { closeDeviceRelayTarget as d, requestUSBAccess as N, pairDevice as q, startDeviceInstall as C } from "./index.js";
3
+ import { j as T, k as j } from "../browser-storage-Cx9eW-bm.mjs";
4
4
  function F({
5
5
  apiUrl: a,
6
6
  token: v,
7
- log: e = x
7
+ log: R = x
8
8
  }) {
9
- const [r, m] = d(), [o, y] = d(), [h, n] = d(), [P, c] = d(), [S, f] = d(!1), w = b(void 0), R = b(void 0), i = u(async () => {
10
- w.current?.close(), w.current = void 0, await l(R.current, e);
11
- }, [e]);
9
+ const [e, m] = u(), [n, y] = u(), [g, s] = u(), [P, i] = u(), [S, f] = u(!1), w = h(void 0), b = h(void 0), r = h(R);
10
+ r.current = R;
11
+ const c = l(async () => {
12
+ w.current?.close(), w.current = void 0, await d(b.current, r.current);
13
+ }, []);
12
14
  D(() => {
13
- R.current = r;
14
- }, [r]), D(() => () => {
15
- i();
16
- }, [i]);
17
- const A = u(async () => {
18
- n("usb"), c(void 0), f(!1);
15
+ b.current = e;
16
+ }, [e]), D(() => () => {
17
+ c();
18
+ }, [c]);
19
+ const A = l(async () => {
20
+ s("usb"), i(void 0), f(!1);
19
21
  let t;
20
22
  try {
21
- await i(), t = await N({ log: e });
22
- const s = await T(t.hello.serialNumber);
23
- return m(t), y(s), e(s ? "Pair record found" : "No pair record found", t.hello.serialNumber), t;
24
- } catch (s) {
25
- await l(t, e), m(void 0), y(void 0), c(p(s));
23
+ await c(), t = await N({ log: r.current });
24
+ const o = await T(t.hello.serialNumber);
25
+ return m(t), y(o), r.current(
26
+ o ? "Pair record found" : "No pair record found",
27
+ t.hello.serialNumber
28
+ ), t;
29
+ } catch (o) {
30
+ await d(t, r.current), m(void 0), y(void 0), i(p(o));
26
31
  return;
27
32
  } finally {
28
- n(void 0);
33
+ s(void 0);
29
34
  }
30
- }, [i, e]), B = u(async () => {
31
- if (!a || !r)
35
+ }, [c]), B = l(async () => {
36
+ if (!a || !e)
32
37
  throw new Error("Select a USB device before pairing.");
33
- n("pair"), c(void 0), f(!1);
38
+ s("pair"), i(void 0), f(!1);
34
39
  try {
35
- await i();
40
+ await c();
36
41
  const t = await q({
37
42
  limbuildApiUrl: a,
38
43
  token: v,
39
- log: e,
40
- target: r
41
- }), s = await j(t.pairRecord, {
42
- productName: r.hello.productName
44
+ log: r.current,
45
+ target: e
46
+ }), o = await j(t.pairRecord, {
47
+ productName: e.hello.productName
43
48
  });
44
- return t.relay.close(), await l(r, e), y(s), f(!1), e("Device paired", "The pair record was stored locally in this browser."), s;
49
+ return t.relay.close(), await d(e, r.current), y(o), f(!1), r.current("Device paired", "The pair record was stored locally in this browser."), o;
45
50
  } catch (t) {
46
- await l(r, e), f(!0), c(p(t));
51
+ await d(e, r.current), f(!0), i(p(t));
47
52
  return;
48
53
  } finally {
49
- n(void 0);
54
+ s(void 0);
50
55
  }
51
- }, [a, i, r, e, v]), E = u(async () => {
52
- if (!a || !r || !o)
56
+ }, [a, c, e, v]), E = l(async () => {
57
+ if (!a || !e || !n)
53
58
  throw new Error("Select and pair a USB device before starting installation.");
54
- n("install"), c(void 0);
59
+ s("install"), i(void 0);
55
60
  try {
56
- return await i(), w.current = await C({
61
+ return await c(), w.current = await C({
57
62
  limbuildApiUrl: a,
58
63
  token: v,
59
- log: e,
60
- target: r,
61
- pairRecord: o
62
- }), e("Device install started", "Installation will continue through the connected iPhone."), w.current;
64
+ log: r.current,
65
+ target: e,
66
+ pairRecord: n
67
+ }), r.current("Device install started", "Installation will continue through the connected iPhone."), w.current;
63
68
  } catch (t) {
64
- await l(r, e), c(p(t));
69
+ await d(e, r.current), i(p(t));
65
70
  return;
66
71
  } finally {
67
- n(void 0);
72
+ s(void 0);
68
73
  }
69
- }, [a, i, r, e, o, v]), I = u(() => {
70
- i(), e("Device relay stopped");
71
- }, [i, e]);
74
+ }, [a, c, e, n, v]), I = l(() => {
75
+ c(), r.current("Device relay stopped");
76
+ }, [c]);
72
77
  return {
73
- device: r,
74
- pairRecord: o,
75
- busyAction: h,
78
+ device: e,
79
+ pairRecord: n,
80
+ busyAction: g,
76
81
  error: P,
77
82
  pairConfirmationRequired: S,
78
- hasPairRecord: !!o,
79
- canPair: !!a && !h && !!r,
80
- canInstall: !!a && !h && !!r && !!o,
83
+ hasPairRecord: !!n,
84
+ canPair: !!a && !g && !!e,
85
+ canInstall: !!a && !g && !!e && !!n,
81
86
  requestUSBAccess: A,
82
87
  pairBrowser: B,
83
88
  startInstallation: E,
84
89
  stopRelay: I,
85
- clearError: () => c(void 0)
90
+ clearError: () => i(void 0)
86
91
  };
87
92
  }
88
93
  function x() {
@@ -228,13 +228,9 @@ class kn {
228
228
  async function vn(t, e, r, d) {
229
229
  let T = new Uint8Array(await wt.hash(Na.h, Vt(Ir(e))));
230
230
  t === "s2k_fo" && (T = Ir(wt.toHex(T)));
231
- const x = await crypto.subtle.importKey(
232
- "raw",
233
- Vt(T),
234
- { name: "PBKDF2" },
235
- !1,
236
- ["deriveBits"]
237
- ), l = await crypto.subtle.deriveBits(
231
+ const x = await crypto.subtle.importKey("raw", Vt(T), { name: "PBKDF2" }, !1, [
232
+ "deriveBits"
233
+ ]), l = await crypto.subtle.deriveBits(
238
234
  {
239
235
  name: "PBKDF2",
240
236
  hash: { name: "SHA-256" },