@limrun/ui 0.9.0-rc.4 → 0.9.0-rc.5
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.
- package/README.md +0 -9
- package/dist/components/inspect-overlay.d.ts +33 -0
- package/dist/components/remote-control.d.ts +86 -0
- package/dist/core/ax-fetcher.d.ts +49 -0
- package/dist/core/ax-tree.d.ts +99 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1491 -777
- package/package.json +8 -17
- package/src/components/inspect-overlay.css +223 -0
- package/src/components/inspect-overlay.tsx +437 -0
- package/src/components/remote-control.tsx +547 -9
- package/src/core/ax-fetcher.test.ts +418 -0
- package/src/core/ax-fetcher.ts +377 -0
- package/src/core/ax-tree.test.ts +491 -0
- package/src/core/ax-tree.ts +416 -0
- package/src/demo.tsx +93 -10
- package/src/index.ts +17 -2
- package/vite.config.ts +2 -6
- package/vitest.config.ts +23 -0
- package/dist/components/device-install/device-install-dialog.d.ts +0 -5
- package/dist/components/device-install/index.d.ts +0 -2
- package/dist/core/device-install/apple/client.d.ts +0 -17
- package/dist/core/device-install/apple/crypto.d.ts +0 -20
- package/dist/core/device-install/apple/gsa-srp.d.ts +0 -26
- package/dist/core/device-install/apple/index.d.ts +0 -5
- package/dist/core/device-install/apple/provisioning.d.ts +0 -161
- package/dist/core/device-install/apple/relay.d.ts +0 -29
- package/dist/core/device-install/index.d.ts +0 -4
- package/dist/core/device-install/operations/index.d.ts +0 -6
- package/dist/core/device-install/operations/limbuild-client.d.ts +0 -28
- package/dist/core/device-install/operations/operations.d.ts +0 -32
- package/dist/core/device-install/operations/relay-client.d.ts +0 -25
- package/dist/core/device-install/operations/relay-protocol.d.ts +0 -27
- package/dist/core/device-install/operations/usbmux.d.ts +0 -32
- package/dist/core/device-install/operations/webusb.d.ts +0 -21
- package/dist/core/device-install/storage/browser-storage.d.ts +0 -44
- package/dist/core/device-install/storage/index.d.ts +0 -1
- package/dist/core/device-install/types.d.ts +0 -48
- package/dist/device-install/index.cjs +0 -1
- package/dist/device-install/index.d.ts +0 -3
- package/dist/device-install/index.js +0 -78
- package/dist/device-install/react.cjs +0 -1
- package/dist/device-install/react.d.ts +0 -1
- package/dist/device-install/react.js +0 -4
- package/dist/device-install-dialog-86RDdoK9.js +0 -2
- package/dist/device-install-dialog-CnyDWf0q.mjs +0 -462
- package/dist/device-install-dialog.css +0 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/use-device-install.d.ts +0 -73
- package/dist/use-device-install-CbGVvwPp.js +0 -31
- package/dist/use-device-install-j1Gekpl4.mjs +0 -13623
- package/src/components/device-install/device-install-dialog.css +0 -325
- package/src/components/device-install/device-install-dialog.tsx +0 -513
- package/src/components/device-install/index.ts +0 -2
- package/src/core/device-install/apple/client.ts +0 -152
- package/src/core/device-install/apple/crypto.ts +0 -202
- package/src/core/device-install/apple/gsa-srp.ts +0 -127
- package/src/core/device-install/apple/index.ts +0 -5
- package/src/core/device-install/apple/provisioning.ts +0 -298
- package/src/core/device-install/apple/relay.ts +0 -221
- package/src/core/device-install/index.ts +0 -4
- package/src/core/device-install/operations/index.ts +0 -6
- package/src/core/device-install/operations/limbuild-client.ts +0 -104
- package/src/core/device-install/operations/operations.ts +0 -217
- package/src/core/device-install/operations/relay-client.ts +0 -255
- package/src/core/device-install/operations/relay-protocol.ts +0 -71
- package/src/core/device-install/operations/usbmux.ts +0 -270
- package/src/core/device-install/operations/webusb-dom.d.ts +0 -54
- package/src/core/device-install/operations/webusb.ts +0 -105
- package/src/core/device-install/storage/browser-storage.ts +0 -263
- package/src/core/device-install/storage/index.ts +0 -1
- package/src/core/device-install/types.ts +0 -65
- package/src/device-install/index.ts +0 -3
- package/src/device-install/react.ts +0 -1
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use-device-install.ts +0 -1210
|
@@ -1,462 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as p, useId as T, useEffect as k } from "react";
|
|
3
|
-
import { u as D } from "./use-device-install-j1Gekpl4.mjs";
|
|
4
|
-
import './device-install-dialog.css';function A(t) {
|
|
5
|
-
var r, s, a = "";
|
|
6
|
-
if (typeof t == "string" || typeof t == "number") a += t;
|
|
7
|
-
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
8
|
-
var d = t.length;
|
|
9
|
-
for (r = 0; r < d; r++) t[r] && (s = A(t[r])) && (a && (a += " "), a += s);
|
|
10
|
-
} else for (s in t) t[s] && (a && (a += " "), a += s);
|
|
11
|
-
return a;
|
|
12
|
-
}
|
|
13
|
-
function m() {
|
|
14
|
-
for (var t, r, s = 0, a = "", d = arguments.length; s < d; s++) (t = arguments[s]) && (r = A(t)) && (a && (a += " "), a += r);
|
|
15
|
-
return a;
|
|
16
|
-
}
|
|
17
|
-
const x = [
|
|
18
|
-
{
|
|
19
|
-
id: "signing",
|
|
20
|
-
title: "Prepare signing",
|
|
21
|
-
description: "Choose Apple ID login or upload certificates, then confirm the target developer device."
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "connect",
|
|
25
|
-
title: "Connect and pair",
|
|
26
|
-
description: "Connect the iPhone with WebUSB, then pair this browser so installs can use the device."
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: "build",
|
|
30
|
-
title: "Check and build",
|
|
31
|
-
description: "Verify the device and provisioning profile are ready, then start the signed build."
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: "install",
|
|
35
|
-
title: "Start installation",
|
|
36
|
-
description: "Relay the last successful device build to the paired iPhone."
|
|
37
|
-
}
|
|
38
|
-
];
|
|
39
|
-
function $({
|
|
40
|
-
disabled: t,
|
|
41
|
-
...r
|
|
42
|
-
}) {
|
|
43
|
-
const [s, a] = p(!1), [d, u] = p("signing"), [o, N] = p(), [_, w] = p(""), [b, P] = p(""), [f, I] = p(""), S = T(), e = D(r);
|
|
44
|
-
k(() => {
|
|
45
|
-
u(e.currentStep);
|
|
46
|
-
}, [e.currentStep]);
|
|
47
|
-
const C = (c, h) => {
|
|
48
|
-
e.setSigningFiles({
|
|
49
|
-
[c]: h.currentTarget.files?.[0]
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
return /* @__PURE__ */ l("div", { className: "lr-device-install", children: [
|
|
53
|
-
/* @__PURE__ */ i(
|
|
54
|
-
"button",
|
|
55
|
-
{
|
|
56
|
-
type: "button",
|
|
57
|
-
className: "lr-device-install__trigger",
|
|
58
|
-
disabled: t || !r.apiUrl,
|
|
59
|
-
onClick: () => a(!0),
|
|
60
|
-
children: "Install to iPhone"
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
s && /* @__PURE__ */ i("div", { className: "lr-device-install__backdrop", role: "presentation", children: /* @__PURE__ */ l(
|
|
64
|
-
"section",
|
|
65
|
-
{
|
|
66
|
-
"aria-labelledby": S,
|
|
67
|
-
"aria-modal": "true",
|
|
68
|
-
className: "lr-device-install__dialog",
|
|
69
|
-
role: "dialog",
|
|
70
|
-
children: [
|
|
71
|
-
/* @__PURE__ */ l("header", { className: "lr-device-install__header", children: [
|
|
72
|
-
/* @__PURE__ */ l("div", { children: [
|
|
73
|
-
/* @__PURE__ */ i("h2", { id: S, children: "Install to a real iPhone" }),
|
|
74
|
-
/* @__PURE__ */ i("p", { children: "Prepare signing, connect and pair the device, build, then install from this browser." })
|
|
75
|
-
] }),
|
|
76
|
-
/* @__PURE__ */ i("button", { type: "button", className: "lr-device-install__icon-button", onClick: () => a(!1), children: "Close" })
|
|
77
|
-
] }),
|
|
78
|
-
e.error && /* @__PURE__ */ i("div", { className: "lr-device-install__error", children: e.error }),
|
|
79
|
-
/* @__PURE__ */ i("div", { className: "lr-device-install__steps", children: x.map((c, h) => /* @__PURE__ */ l(
|
|
80
|
-
R,
|
|
81
|
-
{
|
|
82
|
-
index: h + 1,
|
|
83
|
-
step: c,
|
|
84
|
-
active: e.currentStep === c.id,
|
|
85
|
-
open: d === c.id,
|
|
86
|
-
status: e.stepStatuses[c.id],
|
|
87
|
-
onToggle: () => u(c.id),
|
|
88
|
-
children: [
|
|
89
|
-
c.id === "signing" && /* @__PURE__ */ l("div", { className: "lr-device-install__step-body", children: [
|
|
90
|
-
/* @__PURE__ */ l("div", { className: "lr-device-install__choice-grid", children: [
|
|
91
|
-
/* @__PURE__ */ l(
|
|
92
|
-
"button",
|
|
93
|
-
{
|
|
94
|
-
type: "button",
|
|
95
|
-
className: m(
|
|
96
|
-
"lr-device-install__choice",
|
|
97
|
-
o === "apple-id" && "lr-device-install__choice--active"
|
|
98
|
-
),
|
|
99
|
-
onClick: () => N("apple-id"),
|
|
100
|
-
children: [
|
|
101
|
-
/* @__PURE__ */ i("strong", { children: "Apple ID login" }),
|
|
102
|
-
/* @__PURE__ */ i("span", { children: "Sign in, choose team, bundle ID, devices, then generate signing assets." })
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
),
|
|
106
|
-
/* @__PURE__ */ l(
|
|
107
|
-
"button",
|
|
108
|
-
{
|
|
109
|
-
type: "button",
|
|
110
|
-
className: m(
|
|
111
|
-
"lr-device-install__choice",
|
|
112
|
-
o === "upload" && "lr-device-install__choice--active"
|
|
113
|
-
),
|
|
114
|
-
onClick: () => N("upload"),
|
|
115
|
-
children: [
|
|
116
|
-
/* @__PURE__ */ i("strong", { children: "Upload certificates" }),
|
|
117
|
-
/* @__PURE__ */ i("span", { children: "Use an existing .p12 certificate and provisioning profile." })
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
] }),
|
|
122
|
-
o === "apple-id" && /* @__PURE__ */ l("div", { className: "lr-device-install__section-panel", children: [
|
|
123
|
-
/* @__PURE__ */ l("div", { className: "lr-device-install__grid", children: [
|
|
124
|
-
/* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
125
|
-
/* @__PURE__ */ i("span", { children: "Apple ID" }),
|
|
126
|
-
/* @__PURE__ */ i(
|
|
127
|
-
"input",
|
|
128
|
-
{
|
|
129
|
-
type: "email",
|
|
130
|
-
autoComplete: "username",
|
|
131
|
-
placeholder: "name@example.com",
|
|
132
|
-
value: _,
|
|
133
|
-
onChange: (n) => w(n.currentTarget.value)
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
] }),
|
|
137
|
-
/* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
138
|
-
/* @__PURE__ */ i("span", { children: "Apple ID password" }),
|
|
139
|
-
/* @__PURE__ */ i(
|
|
140
|
-
"input",
|
|
141
|
-
{
|
|
142
|
-
type: "password",
|
|
143
|
-
autoComplete: "current-password",
|
|
144
|
-
placeholder: "Password stays in this browser",
|
|
145
|
-
value: b,
|
|
146
|
-
onChange: (n) => P(n.currentTarget.value)
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
] }),
|
|
150
|
-
!e.hasReusableAppleCertificate && /* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
151
|
-
/* @__PURE__ */ i("span", { children: "Generated .p12 password" }),
|
|
152
|
-
/* @__PURE__ */ i(
|
|
153
|
-
"input",
|
|
154
|
-
{
|
|
155
|
-
type: "password",
|
|
156
|
-
placeholder: "Used when exporting Apple certificate",
|
|
157
|
-
onChange: (n) => e.setSigningFiles({ certificatePassword: n.currentTarget.value })
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
] })
|
|
161
|
-
] }),
|
|
162
|
-
/* @__PURE__ */ l("div", { className: "lr-device-install__actions", children: [
|
|
163
|
-
/* @__PURE__ */ i(
|
|
164
|
-
"button",
|
|
165
|
-
{
|
|
166
|
-
type: "button",
|
|
167
|
-
className: "lr-device-install__secondary",
|
|
168
|
-
disabled: t || !r.apiUrl || !_ || !b || e.busyAction === "signing",
|
|
169
|
-
onClick: () => void e.startAppleIDLogin({
|
|
170
|
-
accountName: _,
|
|
171
|
-
password: b
|
|
172
|
-
}),
|
|
173
|
-
children: e.appleSigningStatus === "authenticating" ? "Signing in..." : "Sign in with Apple ID"
|
|
174
|
-
}
|
|
175
|
-
),
|
|
176
|
-
/* @__PURE__ */ l("span", { className: "lr-device-install__hint", children: [
|
|
177
|
-
"Apple password is used only by browser-side SRP. Status: ",
|
|
178
|
-
e.appleSigningStatus
|
|
179
|
-
] })
|
|
180
|
-
] }),
|
|
181
|
-
e.appleSigningStatus === "two-factor-required" && /* @__PURE__ */ l("div", { className: "lr-device-install__grid", children: [
|
|
182
|
-
/* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
183
|
-
/* @__PURE__ */ i("span", { children: "Two-factor code" }),
|
|
184
|
-
/* @__PURE__ */ i(
|
|
185
|
-
"input",
|
|
186
|
-
{
|
|
187
|
-
type: "text",
|
|
188
|
-
inputMode: "numeric",
|
|
189
|
-
autoComplete: "one-time-code",
|
|
190
|
-
value: f,
|
|
191
|
-
onChange: (n) => I(n.currentTarget.value)
|
|
192
|
-
}
|
|
193
|
-
)
|
|
194
|
-
] }),
|
|
195
|
-
/* @__PURE__ */ i(
|
|
196
|
-
"button",
|
|
197
|
-
{
|
|
198
|
-
type: "button",
|
|
199
|
-
className: "lr-device-install__secondary",
|
|
200
|
-
disabled: !f || e.busyAction === "signing",
|
|
201
|
-
onClick: () => void e.submitAppleTwoFactorCode(f),
|
|
202
|
-
children: "Submit Apple ID code"
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
] }),
|
|
206
|
-
e.appleTeams.length > 0 && /* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
207
|
-
/* @__PURE__ */ i("span", { children: "Apple Developer team" }),
|
|
208
|
-
/* @__PURE__ */ i(
|
|
209
|
-
"select",
|
|
210
|
-
{
|
|
211
|
-
value: e.selectedAppleTeamID ?? "",
|
|
212
|
-
onChange: (n) => e.setSelectedAppleTeamID(n.currentTarget.value || void 0),
|
|
213
|
-
children: e.appleTeams.map((n, y) => {
|
|
214
|
-
const v = n.teamId ?? (n.providerId === void 0 ? void 0 : String(n.providerId)) ?? n.publicProviderId ?? "";
|
|
215
|
-
return /* @__PURE__ */ l("option", { value: v, children: [
|
|
216
|
-
n.name ?? "Apple Developer Team",
|
|
217
|
-
" ",
|
|
218
|
-
v ? `(${v})` : ""
|
|
219
|
-
] }, `${v}-${y}`);
|
|
220
|
-
})
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
] }),
|
|
224
|
-
e.appleDevices.length > 0 && /* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
225
|
-
/* @__PURE__ */ i("span", { children: "Apple Developer devices" }),
|
|
226
|
-
/* @__PURE__ */ i(
|
|
227
|
-
"select",
|
|
228
|
-
{
|
|
229
|
-
multiple: !0,
|
|
230
|
-
value: e.selectedAppleDeviceIDs,
|
|
231
|
-
onChange: (n) => e.setSelectedAppleDeviceIDs(
|
|
232
|
-
Array.from(n.currentTarget.selectedOptions).map((y) => y.value)
|
|
233
|
-
),
|
|
234
|
-
children: e.appleDevices.map((n) => /* @__PURE__ */ l(
|
|
235
|
-
"option",
|
|
236
|
-
{
|
|
237
|
-
value: n.deviceId ?? "",
|
|
238
|
-
children: [
|
|
239
|
-
n.name ?? n.model ?? "Apple device",
|
|
240
|
-
" ",
|
|
241
|
-
n.deviceNumber ?? ""
|
|
242
|
-
]
|
|
243
|
-
},
|
|
244
|
-
n.deviceId ?? n.deviceNumber
|
|
245
|
-
))
|
|
246
|
-
}
|
|
247
|
-
)
|
|
248
|
-
] }),
|
|
249
|
-
e.applePortalSummary && /* @__PURE__ */ l("p", { className: "lr-device-install__hint", children: [
|
|
250
|
-
"Found ",
|
|
251
|
-
e.applePortalSummary.certificateCount,
|
|
252
|
-
" certificates and",
|
|
253
|
-
" ",
|
|
254
|
-
e.applePortalSummary.profileCount,
|
|
255
|
-
" provisioning profiles."
|
|
256
|
-
] }),
|
|
257
|
-
e.hasReusableAppleCertificate && /* @__PURE__ */ i("p", { className: "lr-device-install__hint", children: "Reusing the certificate and private key stored in this browser." }),
|
|
258
|
-
/* @__PURE__ */ i(
|
|
259
|
-
"button",
|
|
260
|
-
{
|
|
261
|
-
type: "button",
|
|
262
|
-
className: "lr-device-install__primary",
|
|
263
|
-
disabled: t || !e.canPrepareAppleSigningAssets,
|
|
264
|
-
onClick: () => void e.prepareAppleSigningAssets(),
|
|
265
|
-
children: e.appleSigningStatus === "preparing-assets" ? "Preparing signing assets..." : "Generate certificate and profile"
|
|
266
|
-
}
|
|
267
|
-
)
|
|
268
|
-
] }),
|
|
269
|
-
o === "upload" && /* @__PURE__ */ l("div", { className: "lr-device-install__section-panel", children: [
|
|
270
|
-
/* @__PURE__ */ l("div", { className: "lr-device-install__grid", children: [
|
|
271
|
-
/* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
272
|
-
/* @__PURE__ */ i("span", { children: "Certificate (.p12)" }),
|
|
273
|
-
/* @__PURE__ */ i(
|
|
274
|
-
"input",
|
|
275
|
-
{
|
|
276
|
-
type: "file",
|
|
277
|
-
accept: ".p12,application/x-pkcs12",
|
|
278
|
-
onChange: (n) => C("certificateFile", n)
|
|
279
|
-
}
|
|
280
|
-
)
|
|
281
|
-
] }),
|
|
282
|
-
/* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
283
|
-
/* @__PURE__ */ i("span", { children: "Provisioning profile" }),
|
|
284
|
-
/* @__PURE__ */ i(
|
|
285
|
-
"input",
|
|
286
|
-
{
|
|
287
|
-
type: "file",
|
|
288
|
-
accept: ".mobileprovision",
|
|
289
|
-
onChange: (n) => C("provisioningProfileFile", n)
|
|
290
|
-
}
|
|
291
|
-
)
|
|
292
|
-
] }),
|
|
293
|
-
/* @__PURE__ */ l("label", { className: "lr-device-install__field", children: [
|
|
294
|
-
/* @__PURE__ */ i("span", { children: "Uploaded .p12 password" }),
|
|
295
|
-
/* @__PURE__ */ i(
|
|
296
|
-
"input",
|
|
297
|
-
{
|
|
298
|
-
type: "password",
|
|
299
|
-
placeholder: "Export password",
|
|
300
|
-
onChange: (n) => e.setSigningFiles({ certificatePassword: n.currentTarget.value })
|
|
301
|
-
}
|
|
302
|
-
)
|
|
303
|
-
] })
|
|
304
|
-
] }),
|
|
305
|
-
/* @__PURE__ */ i("p", { className: "lr-device-install__hint", children: "The provisioning profile will be checked against the connected iPhone before the build starts." })
|
|
306
|
-
] }),
|
|
307
|
-
e.hasSigningAssets && /* @__PURE__ */ i("p", { children: "Signing assets are stored in this browser for the selected bundle and device." })
|
|
308
|
-
] }),
|
|
309
|
-
c.id === "connect" && /* @__PURE__ */ l("div", { className: "lr-device-install__step-body", children: [
|
|
310
|
-
/* @__PURE__ */ i("p", { children: "WebUSB works in Chromium browsers on secure origins. Connect the iPhone over USB, approve the browser permission prompt, then pair this browser." }),
|
|
311
|
-
/* @__PURE__ */ l("div", { className: "lr-device-install__actions", children: [
|
|
312
|
-
/* @__PURE__ */ i(
|
|
313
|
-
"button",
|
|
314
|
-
{
|
|
315
|
-
type: "button",
|
|
316
|
-
className: "lr-device-install__primary",
|
|
317
|
-
disabled: t || !e.canRequestUSBAccess,
|
|
318
|
-
onClick: () => void e.requestUSBAccess(),
|
|
319
|
-
children: e.busyAction === "usb" ? "Selecting iPhone..." : "Allow USB access"
|
|
320
|
-
}
|
|
321
|
-
),
|
|
322
|
-
/* @__PURE__ */ i(
|
|
323
|
-
"button",
|
|
324
|
-
{
|
|
325
|
-
type: "button",
|
|
326
|
-
className: "lr-device-install__secondary",
|
|
327
|
-
disabled: t || !e.canPairBrowser,
|
|
328
|
-
onClick: () => void e.pairBrowser(),
|
|
329
|
-
children: e.busyAction === "pair" ? "Pairing..." : e.pairConfirmationRequired ? "Confirm pair record" : "Pair browser"
|
|
330
|
-
}
|
|
331
|
-
)
|
|
332
|
-
] }),
|
|
333
|
-
e.device && /* @__PURE__ */ i("div", { className: "lr-device-install__device", children: `${e.device.productName ?? "iPhone"} ${e.device.serialNumber ?? ""}`.trim() }),
|
|
334
|
-
e.pairConfirmationRequired && /* @__PURE__ */ l("p", { children: [
|
|
335
|
-
"Unlock the iPhone and tap ",
|
|
336
|
-
/* @__PURE__ */ i("strong", { children: "Trust" }),
|
|
337
|
-
" in the system dialog, then confirm the pair record."
|
|
338
|
-
] }),
|
|
339
|
-
/* @__PURE__ */ i("p", { children: e.hasPairRecord ? "Pair record is stored locally. Continue to the build check." : "Pair this browser once before building and installing." })
|
|
340
|
-
] }),
|
|
341
|
-
c.id === "build" && /* @__PURE__ */ l("div", { className: "lr-device-install__step-body", children: [
|
|
342
|
-
/* @__PURE__ */ l("div", { className: "lr-device-install__checklist", children: [
|
|
343
|
-
/* @__PURE__ */ i(g, { label: "Signing assets", ready: e.hasSigningInputs, pendingText: "Ready to verify" }),
|
|
344
|
-
/* @__PURE__ */ i(g, { label: "USB device", ready: !!e.device }),
|
|
345
|
-
/* @__PURE__ */ i(g, { label: "Pair record", ready: e.hasPairRecord }),
|
|
346
|
-
/* @__PURE__ */ i(
|
|
347
|
-
g,
|
|
348
|
-
{
|
|
349
|
-
label: "Profile includes connected device",
|
|
350
|
-
ready: e.connectedDeviceInProfile,
|
|
351
|
-
pendingText: "Checked when the build starts"
|
|
352
|
-
}
|
|
353
|
-
)
|
|
354
|
-
] }),
|
|
355
|
-
e.device && e.appleTeams.length > 0 && !e.connectedAppleDeviceRegistered && /* @__PURE__ */ i(
|
|
356
|
-
"button",
|
|
357
|
-
{
|
|
358
|
-
type: "button",
|
|
359
|
-
className: "lr-device-install__secondary",
|
|
360
|
-
disabled: t || !!e.busyAction,
|
|
361
|
-
onClick: () => void e.registerConnectedAppleDevice(),
|
|
362
|
-
children: "Register connected iPhone"
|
|
363
|
-
}
|
|
364
|
-
),
|
|
365
|
-
/* @__PURE__ */ i(
|
|
366
|
-
"button",
|
|
367
|
-
{
|
|
368
|
-
type: "button",
|
|
369
|
-
className: "lr-device-install__primary",
|
|
370
|
-
disabled: t || !e.canBuild,
|
|
371
|
-
onClick: () => void e.startDeviceBuild(),
|
|
372
|
-
children: e.busyAction === "build" ? "Starting build..." : "Start device build"
|
|
373
|
-
}
|
|
374
|
-
),
|
|
375
|
-
/* @__PURE__ */ l(
|
|
376
|
-
"details",
|
|
377
|
-
{
|
|
378
|
-
className: "lr-device-install__build-logs",
|
|
379
|
-
open: e.buildLogPanelOpen,
|
|
380
|
-
onToggle: (n) => e.setBuildLogPanelOpen(n.currentTarget.open),
|
|
381
|
-
children: [
|
|
382
|
-
/* @__PURE__ */ l("summary", { children: [
|
|
383
|
-
"Build logs (",
|
|
384
|
-
e.buildStatus,
|
|
385
|
-
")"
|
|
386
|
-
] }),
|
|
387
|
-
/* @__PURE__ */ i("pre", { children: e.buildLogs.length > 0 ? e.buildLogs.filter((n) => n.type !== "meta").map((n) => n.data).join(`
|
|
388
|
-
`) : "Build logs will appear here while the device build is running." })
|
|
389
|
-
]
|
|
390
|
-
}
|
|
391
|
-
)
|
|
392
|
-
] }),
|
|
393
|
-
c.id === "install" && /* @__PURE__ */ l("div", { className: "lr-device-install__step-body", children: [
|
|
394
|
-
/* @__PURE__ */ i(
|
|
395
|
-
"button",
|
|
396
|
-
{
|
|
397
|
-
type: "button",
|
|
398
|
-
className: "lr-device-install__primary",
|
|
399
|
-
disabled: t || !e.canInstall,
|
|
400
|
-
onClick: () => void e.startInstallation(),
|
|
401
|
-
children: e.busyAction === "install" ? "Installing..." : "Install last build"
|
|
402
|
-
}
|
|
403
|
-
),
|
|
404
|
-
/* @__PURE__ */ i("button", { type: "button", className: "lr-device-install__secondary", onClick: e.stopRelay, children: "Stop relay" })
|
|
405
|
-
] })
|
|
406
|
-
]
|
|
407
|
-
},
|
|
408
|
-
c.id
|
|
409
|
-
)) }),
|
|
410
|
-
/* @__PURE__ */ l("footer", { className: "lr-device-install__logs", children: [
|
|
411
|
-
/* @__PURE__ */ i("h3", { children: "Progress" }),
|
|
412
|
-
/* @__PURE__ */ i("ol", { children: e.logs.map((c, h) => /* @__PURE__ */ i("li", { children: c }, `${h}-${c.slice(0, 24)}`)) })
|
|
413
|
-
] })
|
|
414
|
-
]
|
|
415
|
-
}
|
|
416
|
-
) })
|
|
417
|
-
] });
|
|
418
|
-
}
|
|
419
|
-
function R({
|
|
420
|
-
index: t,
|
|
421
|
-
step: r,
|
|
422
|
-
active: s,
|
|
423
|
-
open: a,
|
|
424
|
-
status: d,
|
|
425
|
-
onToggle: u,
|
|
426
|
-
children: o
|
|
427
|
-
}) {
|
|
428
|
-
return /* @__PURE__ */ l("article", { className: m("lr-device-install__step", s && "lr-device-install__step--active"), children: [
|
|
429
|
-
/* @__PURE__ */ l(
|
|
430
|
-
"button",
|
|
431
|
-
{
|
|
432
|
-
type: "button",
|
|
433
|
-
className: "lr-device-install__step-header",
|
|
434
|
-
"aria-expanded": a,
|
|
435
|
-
onClick: u,
|
|
436
|
-
children: [
|
|
437
|
-
/* @__PURE__ */ i("div", { className: "lr-device-install__step-number", children: t }),
|
|
438
|
-
/* @__PURE__ */ l("div", { children: [
|
|
439
|
-
/* @__PURE__ */ i("h3", { children: r.title }),
|
|
440
|
-
/* @__PURE__ */ i("p", { children: r.description })
|
|
441
|
-
] }),
|
|
442
|
-
/* @__PURE__ */ i("span", { className: m("lr-device-install__status", `lr-device-install__status--${d}`), children: d === "complete" ? "✓ Completed" : d })
|
|
443
|
-
]
|
|
444
|
-
}
|
|
445
|
-
),
|
|
446
|
-
a && o
|
|
447
|
-
] });
|
|
448
|
-
}
|
|
449
|
-
function g({
|
|
450
|
-
label: t,
|
|
451
|
-
ready: r,
|
|
452
|
-
pendingText: s = "Not ready"
|
|
453
|
-
}) {
|
|
454
|
-
return /* @__PURE__ */ l("div", { className: "lr-device-install__check-row", children: [
|
|
455
|
-
/* @__PURE__ */ i("span", { children: t }),
|
|
456
|
-
/* @__PURE__ */ i("strong", { children: r === void 0 ? s : r ? "Ready" : "Needs attention" })
|
|
457
|
-
] });
|
|
458
|
-
}
|
|
459
|
-
export {
|
|
460
|
-
$ as D,
|
|
461
|
-
m as c
|
|
462
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.lr-device-install{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.lr-device-install__trigger,.lr-device-install__primary,.lr-device-install__secondary,.lr-device-install__icon-button{border:1px solid #d1d5db;border-radius:8px;cursor:pointer;font:inherit}.lr-device-install__trigger,.lr-device-install__primary{background:#111827;color:#fff;padding:8px 12px}.lr-device-install__secondary,.lr-device-install__icon-button{background:#fff;color:#111827;padding:8px 12px}.lr-device-install__trigger:disabled,.lr-device-install__primary:disabled,.lr-device-install__secondary:disabled{cursor:not-allowed;opacity:.55}.lr-device-install__backdrop{align-items:center;background:#1118278c;display:flex;inset:0;justify-content:center;padding:24px;position:fixed;z-index:50}.lr-device-install__dialog{background:#fff;border-radius:16px;box-shadow:0 24px 80px #0f172a47;color:#111827;max-height:min(90vh,900px);max-width:880px;overflow:auto;padding:24px;width:100%}.lr-device-install__header{align-items:flex-start;display:flex;gap:16px;justify-content:space-between;margin-bottom:18px}.lr-device-install__header h2,.lr-device-install__step h3,.lr-device-install__logs h3{margin:0}.lr-device-install__header p,.lr-device-install__step p,.lr-device-install__logs{color:#4b5563}.lr-device-install__error{background:#fef2f2;border:1px solid #fecaca;border-radius:10px;color:#991b1b;margin-bottom:14px;padding:10px 12px}.lr-device-install__steps{display:grid;gap:12px}.lr-device-install__step{border:1px solid #e5e7eb;border-radius:12px;padding:14px}.lr-device-install__step--active{border-color:#111827}.lr-device-install__step-header{align-items:flex-start;background:transparent;border:0;color:inherit;cursor:pointer;display:grid;gap:12px;grid-template-columns:auto 1fr auto;padding:0;text-align:left;width:100%}.lr-device-install__step-number{align-items:center;background:#111827;border-radius:999px;color:#fff;display:flex;font-size:13px;font-weight:700;height:28px;justify-content:center;width:28px}.lr-device-install__status{border-radius:999px;font-size:12px;padding:3px 8px;text-transform:capitalize}.lr-device-install__status--idle{background:#f3f4f6;color:#4b5563}.lr-device-install__status--active{background:#dbeafe;color:#1d4ed8}.lr-device-install__status--complete{background:#dcfce7;color:#166534}.lr-device-install__status--error{background:#fee2e2;color:#991b1b}.lr-device-install__step-body{display:grid;gap:12px;margin-top:12px}.lr-device-install__choice-grid{display:grid;gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}.lr-device-install__choice{background:#fff;border:1px solid #d1d5db;border-radius:10px;color:inherit;cursor:pointer;display:grid;gap:6px;padding:12px;text-align:left}.lr-device-install__choice span{color:#4b5563;font-size:13px}.lr-device-install__choice--active{border-color:#111827;box-shadow:0 0 0 1px #111827}.lr-device-install__section-panel{border:1px solid #e5e7eb;border-radius:12px;display:grid;gap:12px;padding:12px}.lr-device-install__grid{display:grid;gap:10px;grid-template-columns:repeat(3,minmax(0,1fr))}.lr-device-install__field{display:grid;gap:6px}.lr-device-install__field span{color:#374151;font-size:13px;font-weight:600}.lr-device-install__field input,.lr-device-install__field select{border:1px solid #d1d5db;border-radius:8px;font:inherit;padding:8px 10px}.lr-device-install__actions{align-items:center;display:flex;flex-wrap:wrap;gap:10px}.lr-device-install__hint{color:#6b7280;font-size:13px}.lr-device-install__checklist{border:1px solid #e5e7eb;border-radius:10px;display:grid;overflow:hidden}.lr-device-install__check-row{align-items:center;display:flex;gap:12px;justify-content:space-between;padding:10px 12px}.lr-device-install__check-row+.lr-device-install__check-row{border-top:1px solid #e5e7eb}.lr-device-install__check-row strong{color:#111827;font-size:13px}.lr-device-install__build-logs{border:1px solid #e5e7eb;border-radius:10px;overflow:hidden}.lr-device-install__build-logs summary{cursor:pointer;font-weight:600;padding:10px 12px}.lr-device-install__build-logs pre{background:#0f172a;color:#e5e7eb;margin:0;max-height:240px;overflow:auto;padding:12px;white-space:pre-wrap}.lr-device-install__device{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;padding:10px}.lr-device-install__logs{border-top:1px solid #e5e7eb;margin-top:18px;padding-top:14px}.lr-device-install__logs ol{display:grid;gap:6px;list-style:none;margin:8px 0 0;max-height:160px;overflow:auto;padding:0}.lr-device-install__logs li{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:12px;white-space:pre-wrap}@media (max-width: 760px){.lr-device-install__choice-grid,.lr-device-install__grid{grid-template-columns:1fr}.lr-device-install__step-header{grid-template-columns:auto 1fr}.lr-device-install__status{grid-column:2}}
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-device-install';
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { AppleDeveloperPortalDevice, AppleDeveloperPortalAppID, AppleDeveloperPortalTeam, BuildLogLine, DeviceInstallBuildStatus, DeviceInstallBusyAction, DeviceInstallStep, DeviceInstallStepStatus } from '../core/device-install';
|
|
2
|
-
type DeviceInstallStepStatuses = Record<DeviceInstallStep, DeviceInstallStepStatus>;
|
|
3
|
-
export type UseDeviceInstallOptions = {
|
|
4
|
-
apiUrl?: string;
|
|
5
|
-
token?: string;
|
|
6
|
-
};
|
|
7
|
-
export type UseDeviceInstallResult = {
|
|
8
|
-
currentStep: DeviceInstallStep;
|
|
9
|
-
stepStatuses: DeviceInstallStepStatuses;
|
|
10
|
-
device?: DeviceInstallDevice;
|
|
11
|
-
hasPairRecord: boolean;
|
|
12
|
-
hasSigningAssets: boolean;
|
|
13
|
-
hasSigningInputs: boolean;
|
|
14
|
-
pairConfirmationRequired: boolean;
|
|
15
|
-
logs: string[];
|
|
16
|
-
buildLogs: BuildLogLine[];
|
|
17
|
-
buildStatus: DeviceInstallBuildStatus;
|
|
18
|
-
appleSigningStatus: DeviceInstallAppleSigningStatus;
|
|
19
|
-
appleTeams: AppleDeveloperPortalTeam[];
|
|
20
|
-
appleDevices: AppleDeveloperPortalDevice[];
|
|
21
|
-
appleAppIDs: AppleDeveloperPortalAppID[];
|
|
22
|
-
applePortalSummary?: ApplePortalSummary;
|
|
23
|
-
selectedAppleTeamID?: string;
|
|
24
|
-
selectedAppleDeviceIDs: string[];
|
|
25
|
-
connectedAppleDeviceRegistered: boolean;
|
|
26
|
-
connectedDeviceInProfile?: boolean;
|
|
27
|
-
hasReusableAppleCertificate: boolean;
|
|
28
|
-
appleBundleID: string;
|
|
29
|
-
buildLogPanelOpen: boolean;
|
|
30
|
-
busyAction?: DeviceInstallBusyAction;
|
|
31
|
-
error?: string;
|
|
32
|
-
canBuild: boolean;
|
|
33
|
-
canPrepareAppleSigningAssets: boolean;
|
|
34
|
-
canRequestUSBAccess: boolean;
|
|
35
|
-
canPairBrowser: boolean;
|
|
36
|
-
canInstall: boolean;
|
|
37
|
-
setSigningFiles: (files: DeviceInstallSigningFiles) => void;
|
|
38
|
-
setAppleBundleID: (bundleID: string) => void;
|
|
39
|
-
setSelectedAppleDeviceIDs: (deviceIDs: string[]) => void;
|
|
40
|
-
setBuildLogPanelOpen: (open: boolean) => void;
|
|
41
|
-
startAppleIDLogin: (input: DeviceInstallAppleIDLoginInput) => Promise<void>;
|
|
42
|
-
submitAppleTwoFactorCode: (code: string) => Promise<void>;
|
|
43
|
-
setSelectedAppleTeamID: (teamID: string | undefined) => void;
|
|
44
|
-
clearAppleIDLogin: () => void;
|
|
45
|
-
registerConnectedAppleDevice: () => Promise<void>;
|
|
46
|
-
prepareAppleSigningAssets: () => Promise<void>;
|
|
47
|
-
startDeviceBuild: () => Promise<void>;
|
|
48
|
-
requestUSBAccess: () => Promise<void>;
|
|
49
|
-
pairBrowser: () => Promise<void>;
|
|
50
|
-
startInstallation: () => Promise<void>;
|
|
51
|
-
stopRelay: () => void;
|
|
52
|
-
};
|
|
53
|
-
export type DeviceInstallAppleSigningStatus = 'idle' | 'authenticating' | 'two-factor-required' | 'authenticated' | 'preparing-assets' | 'assets-ready' | 'using-cached-profile' | 'error';
|
|
54
|
-
export type DeviceInstallDevice = {
|
|
55
|
-
serialNumber?: string;
|
|
56
|
-
productName?: string;
|
|
57
|
-
manufacturerName?: string;
|
|
58
|
-
};
|
|
59
|
-
export type DeviceInstallSigningFiles = {
|
|
60
|
-
certificateFile?: File;
|
|
61
|
-
provisioningProfileFile?: File;
|
|
62
|
-
certificatePassword?: string;
|
|
63
|
-
};
|
|
64
|
-
export type DeviceInstallAppleIDLoginInput = {
|
|
65
|
-
accountName: string;
|
|
66
|
-
password: string;
|
|
67
|
-
};
|
|
68
|
-
export type ApplePortalSummary = {
|
|
69
|
-
certificateCount: number;
|
|
70
|
-
profileCount: number;
|
|
71
|
-
};
|
|
72
|
-
export declare function useDeviceInstall({ apiUrl, token, }: UseDeviceInstallOptions): UseDeviceInstallResult;
|
|
73
|
-
export {};
|