@limrun/ui 0.9.0-rc.7 → 0.9.0-rc.8
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/dist/components/inspect-overlay.d.ts +0 -1
- package/dist/components/remote-control.d.ts +2 -13
- package/dist/core/ax-tree.d.ts +0 -2
- package/dist/device-install/index.cjs +1 -1
- package/dist/device-install/index.js +2 -2
- package/dist/device-install/react.cjs +1 -1
- package/dist/device-install/react.js +1 -1
- package/dist/device-install-dialog-DGn2ZdBB.js +2 -0
- package/dist/{device-install-dialog-CnyDWf0q.mjs → device-install-dialog-DgWsZF6o.mjs} +54 -73
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +830 -871
- package/dist/use-device-install-ByUSmeYz.js +31 -0
- package/dist/{use-device-install-j1Gekpl4.mjs → use-device-install-Y42p84we.mjs} +1096 -1095
- package/package.json +1 -1
- package/src/components/device-install/device-install-dialog.tsx +16 -34
- package/src/components/inspect-overlay.css +0 -6
- package/src/components/inspect-overlay.tsx +15 -46
- package/src/components/remote-control.tsx +2 -16
- package/src/core/ax-tree.test.ts +0 -124
- package/src/core/ax-tree.ts +0 -107
- package/src/hooks/use-device-install.ts +35 -26
- package/src/index.ts +3 -4
- package/dist/device-install-dialog-86RDdoK9.js +0 -2
- package/dist/use-device-install-CbGVvwPp.js +0 -31
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
parseProvisioningProfile,
|
|
21
21
|
parseProvisioningProfileBase64,
|
|
22
22
|
profileContainsDevice,
|
|
23
|
+
profileMatchesBundleID,
|
|
23
24
|
proxyProvisioningRequest,
|
|
24
25
|
putAppleGeneratedSigningAssets,
|
|
25
26
|
putPairRecord,
|
|
@@ -158,7 +159,7 @@ export function useDeviceInstall({
|
|
|
158
159
|
const [pairRecord, setPairRecord] = useState<StoredPairRecord | undefined>();
|
|
159
160
|
const [signingAssets, setSigningAssets] = useState<StoredSigningAssets | undefined>();
|
|
160
161
|
const [logs, setLogs] = useState<string[]>([
|
|
161
|
-
'Ready. Prepare signing assets, connect and pair the iPhone,
|
|
162
|
+
'Ready. Prepare signing assets, build, connect and pair the iPhone, then install.',
|
|
162
163
|
]);
|
|
163
164
|
const [buildLogs, setBuildLogs] = useState<BuildLogLine[]>([]);
|
|
164
165
|
const [buildStatus, setBuildStatus] = useState<DeviceInstallBuildStatus>('idle');
|
|
@@ -197,7 +198,7 @@ export function useDeviceInstall({
|
|
|
197
198
|
setStepStatus('signing', ready ? 'complete' : 'active');
|
|
198
199
|
if (ready) {
|
|
199
200
|
setAppleSigningStatus('assets-ready');
|
|
200
|
-
setCurrentStep('
|
|
201
|
+
setCurrentStep('build');
|
|
201
202
|
}
|
|
202
203
|
return next;
|
|
203
204
|
});
|
|
@@ -212,7 +213,7 @@ export function useDeviceInstall({
|
|
|
212
213
|
setAppleBundleID(stored.bundleID);
|
|
213
214
|
setAppleSigningStatus('using-cached-profile');
|
|
214
215
|
setStepStatus('signing', 'complete');
|
|
215
|
-
setCurrentStep('
|
|
216
|
+
setCurrentStep('build');
|
|
216
217
|
log('Using stored signing assets', stored.bundleID);
|
|
217
218
|
});
|
|
218
219
|
return () => {
|
|
@@ -274,13 +275,19 @@ export function useDeviceInstall({
|
|
|
274
275
|
|
|
275
276
|
const resolveSigningAssetsForBuild = useCallback(async () => {
|
|
276
277
|
const requestedBundleID = appleBundleID.trim();
|
|
278
|
+
if (!requestedBundleID || (signingAssets && profileMatchesBundleID(signingAssets.profile, requestedBundleID))) {
|
|
279
|
+
if (signingAssets) {
|
|
280
|
+
log('Using prepared signing assets', signingAssets.bundleID);
|
|
281
|
+
return signingAssets;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
277
284
|
const info = requestedBundleID ? undefined : apiUrl ? await fetchStoredBuildInfo(apiUrl, token).catch(() => undefined) : undefined;
|
|
278
285
|
const bundleID = requestedBundleID || info?.lastBuildConfig?.bundleId;
|
|
279
286
|
if (bundleID) {
|
|
280
287
|
const cached = await getReusableAppleSigningAssets({
|
|
281
288
|
bundleID,
|
|
282
289
|
deviceUDID: selectedDevice?.hello.serialNumber,
|
|
283
|
-
teamID:
|
|
290
|
+
teamID: selectedDeveloperTeamID(),
|
|
284
291
|
});
|
|
285
292
|
if (cached) {
|
|
286
293
|
setAppleSigningStatus('using-cached-profile');
|
|
@@ -325,7 +332,7 @@ export function useDeviceInstall({
|
|
|
325
332
|
setSigningAssets(storedAssets);
|
|
326
333
|
log('Signing assets stored locally', storageBundleId);
|
|
327
334
|
return storedAssets;
|
|
328
|
-
}, [apiUrl, appleBundleID, log,
|
|
335
|
+
}, [apiUrl, appleBundleID, log, selectedDeveloperTeamID, selectedDevice?.hello.serialNumber, signingAssets, signingFiles, token]);
|
|
329
336
|
|
|
330
337
|
const startAppleIDLogin = useCallback(
|
|
331
338
|
async ({ accountName, password }: DeviceInstallAppleIDLoginInput) => {
|
|
@@ -559,7 +566,7 @@ export function useDeviceInstall({
|
|
|
559
566
|
setSigningAssets(cached);
|
|
560
567
|
setAppleSigningStatus('assets-ready');
|
|
561
568
|
setStepStatus('signing', 'complete');
|
|
562
|
-
setCurrentStep('
|
|
569
|
+
setCurrentStep('build');
|
|
563
570
|
log('Using cached Apple signing assets', bundleID);
|
|
564
571
|
return;
|
|
565
572
|
}
|
|
@@ -577,7 +584,7 @@ export function useDeviceInstall({
|
|
|
577
584
|
setSigningAssets(assets);
|
|
578
585
|
setAppleSigningStatus('assets-ready');
|
|
579
586
|
setStepStatus('signing', 'complete');
|
|
580
|
-
setCurrentStep('
|
|
587
|
+
setCurrentStep('build');
|
|
581
588
|
log('Apple signing assets stored locally', `${bundleID} for ${signingDeviceUDID}`);
|
|
582
589
|
} catch (caught) {
|
|
583
590
|
const message = errorMessage(caught);
|
|
@@ -636,7 +643,8 @@ export function useDeviceInstall({
|
|
|
636
643
|
setBuildStatus(status);
|
|
637
644
|
if (status === 'succeeded') {
|
|
638
645
|
setStepStatus('build', 'complete');
|
|
639
|
-
|
|
646
|
+
setStepStatus('connect', 'active');
|
|
647
|
+
setCurrentStep('connect');
|
|
640
648
|
} else if (status === 'failed' || status === 'cancelled') {
|
|
641
649
|
setStepStatus('build', 'error');
|
|
642
650
|
}
|
|
@@ -656,26 +664,25 @@ export function useDeviceInstall({
|
|
|
656
664
|
} finally {
|
|
657
665
|
setBusyAction(undefined);
|
|
658
666
|
}
|
|
659
|
-
}, [apiUrl, log,
|
|
667
|
+
}, [apiUrl, log, resolveSigningAssetsForBuild, setStepStatus, token]);
|
|
660
668
|
|
|
661
669
|
const requestUSBAccess = useCallback(async () => {
|
|
662
670
|
setBusyAction('usb');
|
|
663
671
|
setError(undefined);
|
|
664
672
|
setCurrentStep('connect');
|
|
665
673
|
setStepStatus('connect', 'active');
|
|
674
|
+
let target: DeviceRelayTarget | undefined;
|
|
666
675
|
try {
|
|
667
676
|
await cleanupDeviceAccess();
|
|
668
|
-
|
|
669
|
-
setSelectedDevice(target);
|
|
677
|
+
target = await requestDeviceUSBAccess({ log });
|
|
670
678
|
setPairConfirmationRequired(false);
|
|
671
679
|
const storedPairRecord = await getPairRecord(target.hello.serialNumber);
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
if (!profileContainsDevice(storedSigningAssets.profile, target.hello.serialNumber)) {
|
|
680
|
+
const activeSigningAssets = signingAssets ?? (manualSigningFilesReady ? undefined : await getLatestSigningAssets());
|
|
681
|
+
if (activeSigningAssets) {
|
|
682
|
+
if (!profileContainsDevice(activeSigningAssets.profile, target.hello.serialNumber)) {
|
|
676
683
|
throw new Error('Stored provisioning profile does not include the selected iPhone.');
|
|
677
684
|
}
|
|
678
|
-
setSigningAssets(
|
|
685
|
+
setSigningAssets(activeSigningAssets);
|
|
679
686
|
}
|
|
680
687
|
if (apiUrl && appleIDLoginRef.current) {
|
|
681
688
|
const teamID = selectedDeveloperTeamID();
|
|
@@ -692,10 +699,15 @@ export function useDeviceInstall({
|
|
|
692
699
|
});
|
|
693
700
|
}
|
|
694
701
|
}
|
|
702
|
+
setSelectedDevice(target);
|
|
703
|
+
setPairRecord(storedPairRecord);
|
|
695
704
|
setStepStatus('connect', storedPairRecord ? 'complete' : 'active');
|
|
696
|
-
setCurrentStep(storedPairRecord ? '
|
|
705
|
+
setCurrentStep(storedPairRecord ? 'install' : 'connect');
|
|
697
706
|
log(storedPairRecord ? 'Pair record found' : 'No pair record found', target.hello.serialNumber);
|
|
698
707
|
} catch (caught) {
|
|
708
|
+
await closeDeviceRelayTarget(target, log);
|
|
709
|
+
setSelectedDevice(undefined);
|
|
710
|
+
setPairRecord(undefined);
|
|
699
711
|
const message = errorMessage(caught);
|
|
700
712
|
setError(message);
|
|
701
713
|
setStepStatus('connect', 'error');
|
|
@@ -703,7 +715,7 @@ export function useDeviceInstall({
|
|
|
703
715
|
} finally {
|
|
704
716
|
setBusyAction(undefined);
|
|
705
717
|
}
|
|
706
|
-
}, [apiUrl, cleanupDeviceAccess, log, manualSigningFilesReady, selectedDeveloperTeamID, setStepStatus, token]);
|
|
718
|
+
}, [apiUrl, cleanupDeviceAccess, log, manualSigningFilesReady, selectedDeveloperTeamID, setStepStatus, signingAssets, token]);
|
|
707
719
|
|
|
708
720
|
const pairBrowser = useCallback(async () => {
|
|
709
721
|
if (!apiUrl || !selectedDevice) return;
|
|
@@ -728,7 +740,7 @@ export function useDeviceInstall({
|
|
|
728
740
|
setPairRecord(stored);
|
|
729
741
|
setPairConfirmationRequired(false);
|
|
730
742
|
setStepStatus('connect', 'complete');
|
|
731
|
-
setCurrentStep('
|
|
743
|
+
setCurrentStep('install');
|
|
732
744
|
log('Device paired', 'The pair record was stored locally in this browser.');
|
|
733
745
|
} catch (caught) {
|
|
734
746
|
await closeDeviceRelayTarget(selectedDevice, log);
|
|
@@ -803,10 +815,7 @@ export function useDeviceInstall({
|
|
|
803
815
|
canBuild:
|
|
804
816
|
!!apiUrl &&
|
|
805
817
|
!busyAction &&
|
|
806
|
-
|
|
807
|
-
!!pairRecord &&
|
|
808
|
-
signingInputsReady &&
|
|
809
|
-
connectedDeviceInProfile !== false,
|
|
818
|
+
signingInputsReady,
|
|
810
819
|
canPrepareAppleSigningAssets:
|
|
811
820
|
!!apiUrl &&
|
|
812
821
|
!busyAction &&
|
|
@@ -815,9 +824,9 @@ export function useDeviceInstall({
|
|
|
815
824
|
!!selectedDeveloperTeamID() &&
|
|
816
825
|
selectedAppleDeviceIDs.length > 0 &&
|
|
817
826
|
(!!reusableAppleCertificate || !!signingFiles.certificatePassword),
|
|
818
|
-
canRequestUSBAccess: !busyAction &&
|
|
819
|
-
canPairBrowser: !!apiUrl && !busyAction && !!selectedDevice,
|
|
820
|
-
canInstall: !!apiUrl && !busyAction && !!selectedDevice && !!pairRecord,
|
|
827
|
+
canRequestUSBAccess: !busyAction && buildStatus === 'succeeded',
|
|
828
|
+
canPairBrowser: !!apiUrl && !busyAction && buildStatus === 'succeeded' && !!selectedDevice,
|
|
829
|
+
canInstall: !!apiUrl && !busyAction && buildStatus === 'succeeded' && !!selectedDevice && !!pairRecord,
|
|
821
830
|
setSigningFiles,
|
|
822
831
|
setAppleBundleID,
|
|
823
832
|
setSelectedAppleDeviceIDs,
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { RemoteControl } from './components/remote-control';
|
|
2
2
|
export type { RemoteControlHandle } from './components/remote-control';
|
|
3
|
-
export { DeviceInstallDialog, DeviceInstallRelay } from './components/device-install';
|
|
4
|
-
export { useDeviceInstall } from './hooks/use-device-install';
|
|
5
3
|
|
|
6
4
|
// Accessibility / inspect-mode types and helpers. Exported so customers can
|
|
7
5
|
// build their own side panels, search UIs, or agent-driven inspectors on top
|
|
@@ -9,10 +7,8 @@ export { useDeviceInstall } from './hooks/use-device-install';
|
|
|
9
7
|
export type { AxSnapshot, AxElement, AxRect, AxSelectors, AxPlatform } from './core/ax-tree';
|
|
10
8
|
export type { AxStatus } from './core/ax-fetcher';
|
|
11
9
|
export {
|
|
12
|
-
axCliTapCommand,
|
|
13
10
|
axElementAtPoint,
|
|
14
11
|
axElementSelectorExpression,
|
|
15
|
-
axElementSelectorObject,
|
|
16
12
|
axElementSummary,
|
|
17
13
|
axElementsEqual,
|
|
18
14
|
axSnapshotsEqual,
|
|
@@ -21,3 +17,6 @@ export {
|
|
|
21
17
|
normalizeIosTree,
|
|
22
18
|
AX_UNAVAILABLE_ERROR,
|
|
23
19
|
} from './core/ax-tree';
|
|
20
|
+
|
|
21
|
+
export { DeviceInstallDialog, DeviceInstallRelay } from './components/device-install';
|
|
22
|
+
export { useDeviceInstall } from './hooks/use-device-install';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";require('./device-install-dialog.css');const e=require("react/jsx-runtime"),d=require("react"),w=require("./use-device-install-CbGVvwPp.js");function N(l){var t,a,n="";if(typeof l=="string"||typeof l=="number")n+=l;else if(typeof l=="object")if(Array.isArray(l)){var c=l.length;for(t=0;t<c;t++)l[t]&&(a=N(l[t]))&&(n&&(n+=" "),n+=a)}else for(a in l)l[a]&&(n&&(n+=" "),n+=a);return n}function u(){for(var l,t,a=0,n="",c=arguments.length;a<c;a++)(l=arguments[a])&&(t=N(l))&&(n&&(n+=" "),n+=t);return n}const P=[{id:"signing",title:"Prepare signing",description:"Choose Apple ID login or upload certificates, then confirm the target developer device."},{id:"connect",title:"Connect and pair",description:"Connect the iPhone with WebUSB, then pair this browser so installs can use the device."},{id:"build",title:"Check and build",description:"Verify the device and provisioning profile are ready, then start the signed build."},{id:"install",title:"Start installation",description:"Relay the last successful device build to the paired iPhone."}];function I({disabled:l,...t}){const[a,n]=d.useState(!1),[c,h]=d.useState("signing"),[o,j]=d.useState(),[m,S]=d.useState(""),[x,C]=d.useState(""),[_,A]=d.useState(""),f=d.useId(),i=w.useDeviceInstall(t);d.useEffect(()=>{h(i.currentStep)},[i.currentStep]);const y=(r,p)=>{i.setSigningFiles({[r]:p.currentTarget.files?.[0]})};return e.jsxs("div",{className:"lr-device-install",children:[e.jsx("button",{type:"button",className:"lr-device-install__trigger",disabled:l||!t.apiUrl,onClick:()=>n(!0),children:"Install to iPhone"}),a&&e.jsx("div",{className:"lr-device-install__backdrop",role:"presentation",children:e.jsxs("section",{"aria-labelledby":f,"aria-modal":"true",className:"lr-device-install__dialog",role:"dialog",children:[e.jsxs("header",{className:"lr-device-install__header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:f,children:"Install to a real iPhone"}),e.jsx("p",{children:"Prepare signing, connect and pair the device, build, then install from this browser."})]}),e.jsx("button",{type:"button",className:"lr-device-install__icon-button",onClick:()=>n(!1),children:"Close"})]}),i.error&&e.jsx("div",{className:"lr-device-install__error",children:i.error}),e.jsx("div",{className:"lr-device-install__steps",children:P.map((r,p)=>e.jsxs(T,{index:p+1,step:r,active:i.currentStep===r.id,open:c===r.id,status:i.stepStatuses[r.id],onToggle:()=>h(r.id),children:[r.id==="signing"&&e.jsxs("div",{className:"lr-device-install__step-body",children:[e.jsxs("div",{className:"lr-device-install__choice-grid",children:[e.jsxs("button",{type:"button",className:u("lr-device-install__choice",o==="apple-id"&&"lr-device-install__choice--active"),onClick:()=>j("apple-id"),children:[e.jsx("strong",{children:"Apple ID login"}),e.jsx("span",{children:"Sign in, choose team, bundle ID, devices, then generate signing assets."})]}),e.jsxs("button",{type:"button",className:u("lr-device-install__choice",o==="upload"&&"lr-device-install__choice--active"),onClick:()=>j("upload"),children:[e.jsx("strong",{children:"Upload certificates"}),e.jsx("span",{children:"Use an existing .p12 certificate and provisioning profile."})]})]}),o==="apple-id"&&e.jsxs("div",{className:"lr-device-install__section-panel",children:[e.jsxs("div",{className:"lr-device-install__grid",children:[e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Apple ID"}),e.jsx("input",{type:"email",autoComplete:"username",placeholder:"name@example.com",value:m,onChange:s=>S(s.currentTarget.value)})]}),e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Apple ID password"}),e.jsx("input",{type:"password",autoComplete:"current-password",placeholder:"Password stays in this browser",value:x,onChange:s=>C(s.currentTarget.value)})]}),!i.hasReusableAppleCertificate&&e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Generated .p12 password"}),e.jsx("input",{type:"password",placeholder:"Used when exporting Apple certificate",onChange:s=>i.setSigningFiles({certificatePassword:s.currentTarget.value})})]})]}),e.jsxs("div",{className:"lr-device-install__actions",children:[e.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:l||!t.apiUrl||!m||!x||i.busyAction==="signing",onClick:()=>void i.startAppleIDLogin({accountName:m,password:x}),children:i.appleSigningStatus==="authenticating"?"Signing in...":"Sign in with Apple ID"}),e.jsxs("span",{className:"lr-device-install__hint",children:["Apple password is used only by browser-side SRP. Status: ",i.appleSigningStatus]})]}),i.appleSigningStatus==="two-factor-required"&&e.jsxs("div",{className:"lr-device-install__grid",children:[e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Two-factor code"}),e.jsx("input",{type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:_,onChange:s=>A(s.currentTarget.value)})]}),e.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:!_||i.busyAction==="signing",onClick:()=>void i.submitAppleTwoFactorCode(_),children:"Submit Apple ID code"})]}),i.appleTeams.length>0&&e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Apple Developer team"}),e.jsx("select",{value:i.selectedAppleTeamID??"",onChange:s=>i.setSelectedAppleTeamID(s.currentTarget.value||void 0),children:i.appleTeams.map((s,b)=>{const v=s.teamId??(s.providerId===void 0?void 0:String(s.providerId))??s.publicProviderId??"";return e.jsxs("option",{value:v,children:[s.name??"Apple Developer Team"," ",v?`(${v})`:""]},`${v}-${b}`)})})]}),i.appleDevices.length>0&&e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Apple Developer devices"}),e.jsx("select",{multiple:!0,value:i.selectedAppleDeviceIDs,onChange:s=>i.setSelectedAppleDeviceIDs(Array.from(s.currentTarget.selectedOptions).map(b=>b.value)),children:i.appleDevices.map(s=>e.jsxs("option",{value:s.deviceId??"",children:[s.name??s.model??"Apple device"," ",s.deviceNumber??""]},s.deviceId??s.deviceNumber))})]}),i.applePortalSummary&&e.jsxs("p",{className:"lr-device-install__hint",children:["Found ",i.applePortalSummary.certificateCount," certificates and"," ",i.applePortalSummary.profileCount," provisioning profiles."]}),i.hasReusableAppleCertificate&&e.jsx("p",{className:"lr-device-install__hint",children:"Reusing the certificate and private key stored in this browser."}),e.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:l||!i.canPrepareAppleSigningAssets,onClick:()=>void i.prepareAppleSigningAssets(),children:i.appleSigningStatus==="preparing-assets"?"Preparing signing assets...":"Generate certificate and profile"})]}),o==="upload"&&e.jsxs("div",{className:"lr-device-install__section-panel",children:[e.jsxs("div",{className:"lr-device-install__grid",children:[e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Certificate (.p12)"}),e.jsx("input",{type:"file",accept:".p12,application/x-pkcs12",onChange:s=>y("certificateFile",s)})]}),e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Provisioning profile"}),e.jsx("input",{type:"file",accept:".mobileprovision",onChange:s=>y("provisioningProfileFile",s)})]}),e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Uploaded .p12 password"}),e.jsx("input",{type:"password",placeholder:"Export password",onChange:s=>i.setSigningFiles({certificatePassword:s.currentTarget.value})})]})]}),e.jsx("p",{className:"lr-device-install__hint",children:"The provisioning profile will be checked against the connected iPhone before the build starts."})]}),i.hasSigningAssets&&e.jsx("p",{children:"Signing assets are stored in this browser for the selected bundle and device."})]}),r.id==="connect"&&e.jsxs("div",{className:"lr-device-install__step-body",children:[e.jsx("p",{children:"WebUSB works in Chromium browsers on secure origins. Connect the iPhone over USB, approve the browser permission prompt, then pair this browser."}),e.jsxs("div",{className:"lr-device-install__actions",children:[e.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:l||!i.canRequestUSBAccess,onClick:()=>void i.requestUSBAccess(),children:i.busyAction==="usb"?"Selecting iPhone...":"Allow USB access"}),e.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:l||!i.canPairBrowser,onClick:()=>void i.pairBrowser(),children:i.busyAction==="pair"?"Pairing...":i.pairConfirmationRequired?"Confirm pair record":"Pair browser"})]}),i.device&&e.jsx("div",{className:"lr-device-install__device",children:`${i.device.productName??"iPhone"} ${i.device.serialNumber??""}`.trim()}),i.pairConfirmationRequired&&e.jsxs("p",{children:["Unlock the iPhone and tap ",e.jsx("strong",{children:"Trust"})," in the system dialog, then confirm the pair record."]}),e.jsx("p",{children:i.hasPairRecord?"Pair record is stored locally. Continue to the build check.":"Pair this browser once before building and installing."})]}),r.id==="build"&&e.jsxs("div",{className:"lr-device-install__step-body",children:[e.jsxs("div",{className:"lr-device-install__checklist",children:[e.jsx(g,{label:"Signing assets",ready:i.hasSigningInputs,pendingText:"Ready to verify"}),e.jsx(g,{label:"USB device",ready:!!i.device}),e.jsx(g,{label:"Pair record",ready:i.hasPairRecord}),e.jsx(g,{label:"Profile includes connected device",ready:i.connectedDeviceInProfile,pendingText:"Checked when the build starts"})]}),i.device&&i.appleTeams.length>0&&!i.connectedAppleDeviceRegistered&&e.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:l||!!i.busyAction,onClick:()=>void i.registerConnectedAppleDevice(),children:"Register connected iPhone"}),e.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:l||!i.canBuild,onClick:()=>void i.startDeviceBuild(),children:i.busyAction==="build"?"Starting build...":"Start device build"}),e.jsxs("details",{className:"lr-device-install__build-logs",open:i.buildLogPanelOpen,onToggle:s=>i.setBuildLogPanelOpen(s.currentTarget.open),children:[e.jsxs("summary",{children:["Build logs (",i.buildStatus,")"]}),e.jsx("pre",{children:i.buildLogs.length>0?i.buildLogs.filter(s=>s.type!=="meta").map(s=>s.data).join(`
|
|
2
|
-
`):"Build logs will appear here while the device build is running."})]})]}),r.id==="install"&&e.jsxs("div",{className:"lr-device-install__step-body",children:[e.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:l||!i.canInstall,onClick:()=>void i.startInstallation(),children:i.busyAction==="install"?"Installing...":"Install last build"}),e.jsx("button",{type:"button",className:"lr-device-install__secondary",onClick:i.stopRelay,children:"Stop relay"})]})]},r.id))}),e.jsxs("footer",{className:"lr-device-install__logs",children:[e.jsx("h3",{children:"Progress"}),e.jsx("ol",{children:i.logs.map((r,p)=>e.jsx("li",{children:r},`${p}-${r.slice(0,24)}`))})]})]})})]})}function T({index:l,step:t,active:a,open:n,status:c,onToggle:h,children:o}){return e.jsxs("article",{className:u("lr-device-install__step",a&&"lr-device-install__step--active"),children:[e.jsxs("button",{type:"button",className:"lr-device-install__step-header","aria-expanded":n,onClick:h,children:[e.jsx("div",{className:"lr-device-install__step-number",children:l}),e.jsxs("div",{children:[e.jsx("h3",{children:t.title}),e.jsx("p",{children:t.description})]}),e.jsx("span",{className:u("lr-device-install__status",`lr-device-install__status--${c}`),children:c==="complete"?"✓ Completed":c})]}),n&&o]})}function g({label:l,ready:t,pendingText:a="Not ready"}){const n=t===void 0?a:t?"Ready":"Needs attention";return e.jsxs("div",{className:"lr-device-install__check-row",children:[e.jsx("span",{children:l}),e.jsx("strong",{children:n})]})}exports.DeviceInstallDialog=I;exports.clsx=u;
|