@limrun/ui 0.9.0-rc.9 → 0.13.3-rc.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.
Files changed (67) hide show
  1. package/README.md +25 -8
  2. package/dist/app-store-relay/index.cjs +9 -0
  3. package/dist/app-store-relay/index.d.ts +102 -0
  4. package/dist/app-store-relay/index.js +430 -0
  5. package/dist/app-store-relay/react.cjs +1 -0
  6. package/dist/app-store-relay/react.d.ts +15 -0
  7. package/dist/app-store-relay/react.js +65 -0
  8. package/dist/browser-storage-BJ__DGJ6.mjs +202 -0
  9. package/dist/browser-storage-C1jQLXat.js +1 -0
  10. package/dist/client-Bk1N3XIF.mjs +228 -0
  11. package/dist/client-CnbCWvCs.js +1 -0
  12. package/dist/components/device-install/index.d.ts +1 -2
  13. package/dist/core/device-install/apple/provisioning.d.ts +55 -4
  14. package/dist/core/device-install/operations/limbuild-client.d.ts +15 -1
  15. package/dist/core/device-install/storage/browser-storage.d.ts +9 -5
  16. package/dist/core/device-install/types.d.ts +4 -1
  17. package/dist/device-build/index.cjs +1 -0
  18. package/dist/device-build/index.d.ts +4 -0
  19. package/dist/device-build/index.js +84 -0
  20. package/dist/device-build/react.cjs +1 -0
  21. package/dist/device-build/react.d.ts +20 -0
  22. package/dist/device-build/react.js +66 -0
  23. package/dist/device-build/signing.d.ts +20 -0
  24. package/dist/device-install/index.cjs +1 -1
  25. package/dist/device-install/index.d.ts +18 -3
  26. package/dist/device-install/index.js +570 -76
  27. package/dist/device-install/react.cjs +1 -1
  28. package/dist/device-install/react.d.ts +23 -1
  29. package/dist/device-install/react.js +93 -2
  30. package/dist/hooks/index.d.ts +1 -1
  31. package/dist/index-BXg7HdIs.mjs +11547 -0
  32. package/dist/index-CMeQfhYy.js +22 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.ts +0 -2
  35. package/dist/index.js +502 -495
  36. package/dist/limbuild-client-CFJhYsRx.mjs +79 -0
  37. package/dist/limbuild-client-C_CMNLYV.js +1 -0
  38. package/dist/provisioning-CdseoMJQ.mjs +239 -0
  39. package/dist/provisioning-D2ZZQeyX.js +1 -0
  40. package/package.json +21 -1
  41. package/src/app-store-relay/index.test.ts +74 -0
  42. package/src/app-store-relay/index.ts +447 -0
  43. package/src/app-store-relay/react.ts +125 -0
  44. package/src/components/device-install/index.ts +1 -2
  45. package/src/core/device-install/apple/provisioning.test.ts +84 -0
  46. package/src/core/device-install/apple/provisioning.ts +91 -7
  47. package/src/core/device-install/operations/limbuild-client.ts +33 -3
  48. package/src/core/device-install/storage/browser-storage.ts +29 -14
  49. package/src/core/device-install/types.ts +5 -1
  50. package/src/device-build/index.ts +42 -0
  51. package/src/device-build/react.ts +128 -0
  52. package/src/device-build/signing.ts +94 -0
  53. package/src/device-install/index.ts +49 -3
  54. package/src/device-install/react.ts +180 -1
  55. package/src/hooks/index.ts +1 -1
  56. package/src/index.ts +1 -4
  57. package/vite.config.ts +4 -0
  58. package/dist/components/device-install/device-install-dialog.d.ts +0 -5
  59. package/dist/device-install-dialog-CqxDEH85.mjs +0 -443
  60. package/dist/device-install-dialog-jvqQ-fuo.js +0 -2
  61. package/dist/device-install-dialog.css +0 -1
  62. package/dist/hooks/use-device-install.d.ts +0 -73
  63. package/dist/use-device-install-CAPli9MR.js +0 -31
  64. package/dist/use-device-install-H8dqqvbR.mjs +0 -13624
  65. package/src/components/device-install/device-install-dialog.css +0 -325
  66. package/src/components/device-install/device-install-dialog.tsx +0 -495
  67. package/src/hooks/use-device-install.ts +0 -1219
@@ -1,4 +1,95 @@
1
- import { u as a } from "../use-device-install-H8dqqvbR.mjs";
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";
4
+ function F({
5
+ apiUrl: a,
6
+ token: v,
7
+ log: e = x
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]);
12
+ 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);
19
+ let t;
20
+ 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));
26
+ return;
27
+ } finally {
28
+ n(void 0);
29
+ }
30
+ }, [i, e]), B = u(async () => {
31
+ if (!a || !r)
32
+ throw new Error("Select a USB device before pairing.");
33
+ n("pair"), c(void 0), f(!1);
34
+ try {
35
+ await i();
36
+ const t = await q({
37
+ limbuildApiUrl: a,
38
+ token: v,
39
+ log: e,
40
+ target: r
41
+ }), s = await j(t.pairRecord, {
42
+ productName: r.hello.productName
43
+ });
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;
45
+ } catch (t) {
46
+ await l(r, e), f(!0), c(p(t));
47
+ return;
48
+ } finally {
49
+ n(void 0);
50
+ }
51
+ }, [a, i, r, e, v]), E = u(async () => {
52
+ if (!a || !r || !o)
53
+ throw new Error("Select and pair a USB device before starting installation.");
54
+ n("install"), c(void 0);
55
+ try {
56
+ return await i(), w.current = await C({
57
+ limbuildApiUrl: a,
58
+ 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;
63
+ } catch (t) {
64
+ await l(r, e), c(p(t));
65
+ return;
66
+ } finally {
67
+ n(void 0);
68
+ }
69
+ }, [a, i, r, e, o, v]), I = u(() => {
70
+ i(), e("Device relay stopped");
71
+ }, [i, e]);
72
+ return {
73
+ device: r,
74
+ pairRecord: o,
75
+ busyAction: h,
76
+ error: P,
77
+ pairConfirmationRequired: S,
78
+ hasPairRecord: !!o,
79
+ canPair: !!a && !h && !!r,
80
+ canInstall: !!a && !h && !!r && !!o,
81
+ requestUSBAccess: A,
82
+ pairBrowser: B,
83
+ startInstallation: E,
84
+ stopRelay: I,
85
+ clearError: () => c(void 0)
86
+ };
87
+ }
88
+ function x() {
89
+ }
90
+ function p(a) {
91
+ return a instanceof Error ? a.message : String(a);
92
+ }
2
93
  export {
3
- a as useDeviceInstall
94
+ F as useDeviceInstallRelay
4
95
  };
@@ -1 +1 @@
1
- export * from './use-device-install';
1
+ export {};