推进 INI 面板 shell handoff package
This commit is contained in:
@@ -135,6 +135,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
|
||||
"getShellSessionHandoffRenderState",
|
||||
"getShellSessionHandoffActionPlan",
|
||||
"getShellSessionHandoffChecklist",
|
||||
"getShellSessionHandoffPackage",
|
||||
"getLauncherLinks",
|
||||
"getControlPageApiMethods",
|
||||
],
|
||||
@@ -715,6 +716,35 @@ export function createIniPanelShellSessionHandoffChecklist({
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellSessionHandoffPackage({
|
||||
shellIntegrationManifest = createIniPanelShellIntegrationManifest(),
|
||||
launchApiManifest = shellIntegrationManifest.launchApiManifest ?? createIniPanelLaunchApiManifest(),
|
||||
controlPageApiManifest = shellIntegrationManifest.controlPageApiManifest ?? createControlPageBrowserApiManifest(),
|
||||
snapshot = createIniPanelShellSessionHandoffSnapshot(),
|
||||
renderState = createIniPanelShellSessionHandoffRenderState(snapshot),
|
||||
actionPlan = createIniPanelShellSessionHandoffActionPlan({ snapshot, renderState }),
|
||||
checklist = createIniPanelShellSessionHandoffChecklist({ actionPlan, renderState }),
|
||||
} = {}) {
|
||||
return {
|
||||
apiName: "ini-panel-shell-session-handoff-package",
|
||||
packageVersion: 1,
|
||||
phase: checklist.phase,
|
||||
ready: Boolean(checklist.ready),
|
||||
statusLine: checklist.statusLine,
|
||||
manifests: {
|
||||
shellIntegration: shellIntegrationManifest,
|
||||
launchApi: launchApiManifest,
|
||||
controlPageApi: controlPageApiManifest,
|
||||
launchMethods: Array.isArray(launchApiManifest?.methods) ? [...launchApiManifest.methods] : [],
|
||||
controlPageMethods: Array.isArray(controlPageApiManifest?.methods) ? [...controlPageApiManifest.methods] : [],
|
||||
},
|
||||
snapshot,
|
||||
renderState,
|
||||
actionPlan,
|
||||
checklist,
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
|
||||
const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries);
|
||||
const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest);
|
||||
@@ -750,6 +780,15 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
actionPlan: shellSessionHandoffActionPlan,
|
||||
renderState: shellSessionHandoffRenderState,
|
||||
});
|
||||
const shellSessionHandoffPackage = createIniPanelShellSessionHandoffPackage({
|
||||
shellIntegrationManifest,
|
||||
launchApiManifest: shellIntegrationManifest.launchApiManifest,
|
||||
controlPageApiManifest: shellIntegrationManifest.controlPageApiManifest,
|
||||
snapshot: shellSessionHandoffSnapshot,
|
||||
renderState: shellSessionHandoffRenderState,
|
||||
actionPlan: shellSessionHandoffActionPlan,
|
||||
checklist: shellSessionHandoffChecklist,
|
||||
});
|
||||
return {
|
||||
pages: entries.map(({ id, href, title }) => ({
|
||||
id,
|
||||
@@ -769,6 +808,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
shellSessionHandoffRenderState,
|
||||
shellSessionHandoffActionPlan,
|
||||
shellSessionHandoffChecklist,
|
||||
shellSessionHandoffPackage,
|
||||
launchApiSchema: createIniPanelLaunchApiSchema(),
|
||||
launchApiManifest: createIniPanelLaunchApiManifest(entries),
|
||||
isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest,
|
||||
@@ -783,6 +823,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
createShellSessionHandoffRenderState: createIniPanelShellSessionHandoffRenderState,
|
||||
createShellSessionHandoffActionPlan: createIniPanelShellSessionHandoffActionPlan,
|
||||
createShellSessionHandoffChecklist: createIniPanelShellSessionHandoffChecklist,
|
||||
createShellSessionHandoffPackage: createIniPanelShellSessionHandoffPackage,
|
||||
controlPage: {
|
||||
browserApiSchema: createControlPageBrowserApiSchema(),
|
||||
browserApiManifest: createControlPageBrowserApiManifest(),
|
||||
|
||||
Reference in New Issue
Block a user