@mak-98/dirvi-app 0.11.0-beta.4 → 0.11.0-beta.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/dist/application/create-app-api.js +2 -2
- package/dist/application/package-loader.d.ts +2 -2
- package/dist/application/package-loader.d.ts.map +1 -1
- package/dist/domain/initialization.d.ts +1 -0
- package/dist/domain/initialization.d.ts.map +1 -1
- package/dist/domain/shell-api.d.ts +1 -1
- package/dist/domain/shell-api.d.ts.map +1 -1
- package/dist/ui/App.d.ts +5 -1
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +18 -5
- package/dist/ui/AppSetup.d.ts +1 -1
- package/dist/ui/AppSetup.d.ts.map +1 -1
- package/dist/ui/AppSetup.js +2 -43
- package/dist/ui/Shell.d.ts.map +1 -1
- package/dist/ui/Shell.js +6 -7
- package/package.json +3 -3
|
@@ -21,8 +21,8 @@ export function createAppApi(appDefinition) {
|
|
|
21
21
|
return {
|
|
22
22
|
name: appDefinition.displayName,
|
|
23
23
|
rootId: appDefinition.rootId,
|
|
24
|
-
createRoot: appDefinition.createRoot,
|
|
25
|
-
loadBranches: appDefinition.loadChildren,
|
|
24
|
+
createRoot: () => appDefinition.createRoot(treeNodeApi),
|
|
25
|
+
loadBranches: (path) => appDefinition.loadChildren(treeNodeApi, path),
|
|
26
26
|
subscribeToResync: appDefinition.subscribeToResync,
|
|
27
27
|
treeNodeApi,
|
|
28
28
|
foldsApi,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AppPackageReference } from '../domain/app-pack-ref.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppPlugin } from 'dirvi-apis';
|
|
3
3
|
/**
|
|
4
4
|
* In the future will be expanded to load other plugins too.
|
|
5
5
|
*/
|
|
6
6
|
export type PackageLoader = {
|
|
7
|
-
loadAppPlugin: (reference: AppPackageReference) => Promise<
|
|
7
|
+
loadAppPlugin: (reference: AppPackageReference) => Promise<AppPlugin>;
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=package-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-loader.d.ts","sourceRoot":"","sources":["../../src/application/package-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"package-loader.d.ts","sourceRoot":"","sources":["../../src/application/package-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;CACvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialization.d.ts","sourceRoot":"","sources":["../../src/domain/initialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"initialization.d.ts","sourceRoot":"","sources":["../../src/domain/initialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAClE,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-api.d.ts","sourceRoot":"","sources":["../../src/domain/shell-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"shell-api.d.ts","sourceRoot":"","sources":["../../src/domain/shell-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE,CAAC"}
|
package/dist/ui/App.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { AppApi, EffectToAction, IntentToEffect, Reducer, SerializableKey, State } from 'dirvi-lib';
|
|
2
2
|
import type { Config } from '../domain/config.js';
|
|
3
3
|
import type { AppScreenRenderer } from './app-screen-renderer.js';
|
|
4
|
+
import { AppPackageReference } from '../domain/app-pack-ref.js';
|
|
5
|
+
import { ShellApi } from '../domain/shell-api.js';
|
|
4
6
|
type AppProps<Id extends SerializableKey, Value, ViewKey = string> = {
|
|
5
7
|
screenRenderer: AppScreenRenderer;
|
|
8
|
+
shellApi: ShellApi;
|
|
6
9
|
appApi: AppApi<Id, Value, ViewKey>;
|
|
7
10
|
config: Config;
|
|
11
|
+
registeredApps: ReadonlyMap<string, AppPackageReference>;
|
|
8
12
|
initialState: State<Id, Value>;
|
|
9
13
|
reducer: Reducer<Id, Value>;
|
|
10
14
|
intentToEffect: IntentToEffect<Id, Value>;
|
|
@@ -13,6 +17,6 @@ type AppProps<Id extends SerializableKey, Value, ViewKey = string> = {
|
|
|
13
17
|
clipboard?: (value: string) => void;
|
|
14
18
|
onError?: (error: Error) => void;
|
|
15
19
|
};
|
|
16
|
-
export declare function App<Id extends SerializableKey, Value, ViewKey = string>({ screenRenderer, appApi, config, initialState, reducer, intentToEffect, effectToAction, stdout, clipboard, onError, }: AppProps<Id, Value, ViewKey>): import("react").JSX.Element;
|
|
20
|
+
export declare function App<Id extends SerializableKey, Value, ViewKey = string>({ screenRenderer, shellApi, appApi, config, registeredApps, initialState, reducer, intentToEffect, effectToAction, stdout, clipboard, onError, }: AppProps<Id, Value, ViewKey>): import("react").JSX.Element;
|
|
17
21
|
export {};
|
|
18
22
|
//# sourceMappingURL=App.d.ts.map
|
package/dist/ui/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/ui/App.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,MAAM,EAEN,cAAc,EAEd,cAAc,EAEd,OAAO,EACP,eAAe,EACf,KAAK,EAGN,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/ui/App.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,MAAM,EAEN,cAAc,EAEd,cAAc,EAEd,OAAO,EACP,eAAe,EACf,KAAK,EAGN,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAMlD,KAAK,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,IAAI;IACnE,cAAc,EAAE,iBAAiB,CAAC;IAClC,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACzD,YAAY,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1C,cAAc,EAAE,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,wBAAgB,GAAG,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,EACvE,cAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,GACR,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,+BAmU9B"}
|
package/dist/ui/App.js
CHANGED
|
@@ -5,7 +5,7 @@ import { useView } from './hooks/useView.js';
|
|
|
5
5
|
function toError(error) {
|
|
6
6
|
return error instanceof Error ? error : new Error(String(error));
|
|
7
7
|
}
|
|
8
|
-
export function App({ screenRenderer, appApi, config, initialState, reducer, intentToEffect, effectToAction, stdout, clipboard, onError, }) {
|
|
8
|
+
export function App({ screenRenderer, shellApi, appApi, config, registeredApps, initialState, reducer, intentToEffect, effectToAction, stdout, clipboard, onError, }) {
|
|
9
9
|
const ScreenRenderer = screenRenderer;
|
|
10
10
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
11
11
|
const stateRef = useRef(state); // Gives `subscribeToResync` callback a way to
|
|
@@ -72,6 +72,22 @@ export function App({ screenRenderer, appApi, config, initialState, reducer, int
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
switch (effect.effectType) {
|
|
75
|
+
case 'quit':
|
|
76
|
+
setExitStatus(effect.exitMessage);
|
|
77
|
+
return;
|
|
78
|
+
case 'listApps': {
|
|
79
|
+
const appIds = [...registeredApps.keys()];
|
|
80
|
+
const lines = appIds.map((id) => `${id}`);
|
|
81
|
+
setInputState({
|
|
82
|
+
inputMode: 'normal',
|
|
83
|
+
normalBuffer: '',
|
|
84
|
+
});
|
|
85
|
+
feedbackApi.addMessage(['Apps:', ...lines].join('\n'));
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
case 'switchApp':
|
|
89
|
+
void shellApi.openApp(effect.appId, effect.input);
|
|
90
|
+
return;
|
|
75
91
|
case 'dispatchEffectAction':
|
|
76
92
|
const effectActionResult = effectToAction(effect.action, navEntry, state);
|
|
77
93
|
// A completed normal-mode command or submitted Ex command always
|
|
@@ -198,11 +214,8 @@ export function App({ screenRenderer, appApi, config, initialState, reducer, int
|
|
|
198
214
|
case 'unrecognizedCommand':
|
|
199
215
|
feedbackApi.addMessage(`Unrecognized command: ${effect.commandLine}`, 'error');
|
|
200
216
|
return;
|
|
201
|
-
case 'quit':
|
|
202
|
-
setExitStatus(effect.exitMessage);
|
|
203
|
-
return;
|
|
204
217
|
}
|
|
205
|
-
}, [appApi, effectToAction, feedbackApi, navEntry,
|
|
218
|
+
}, [appApi, effectToAction, feedbackApi, navEntry, state, stdout, registeredApps]);
|
|
206
219
|
// ===========================================================================
|
|
207
220
|
// Input hook
|
|
208
221
|
// ===========================================================================
|
package/dist/ui/AppSetup.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ type LoadingAppProps<Id extends SerializableKey, Value, ViewKey = string> = {
|
|
|
12
12
|
stdout?: (message: string) => void;
|
|
13
13
|
clipboard?: (value: string) => void;
|
|
14
14
|
};
|
|
15
|
-
export declare function AppSetup<Id extends SerializableKey, Value, ViewKey = string>({ appScreenRenderer, loadingScreenRenderer,
|
|
15
|
+
export declare function AppSetup<Id extends SerializableKey, Value, ViewKey = string>({ appScreenRenderer, loadingScreenRenderer, initialization, shellApi, appApi, stdout, clipboard, }: LoadingAppProps<Id, Value, ViewKey>): import("react").JSX.Element;
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=AppSetup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSetup.d.ts","sourceRoot":"","sources":["../../src/ui/AppSetup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAS,MAAM,WAAW,CAAC;AAOhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"AppSetup.d.ts","sourceRoot":"","sources":["../../src/ui/AppSetup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAS,MAAM,WAAW,CAAC;AAOhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAI7D,KAAK,eAAe,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,IAAI;IAC1E,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,EAC5E,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,GACV,EAAE,eAAe,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,+BAwFrC"}
|
package/dist/ui/AppSetup.js
CHANGED
|
@@ -2,50 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { createEffectToAction, createIntentToEffect, createReducer, } from 'dirvi-lib';
|
|
4
4
|
import { App } from './App.js';
|
|
5
|
-
export function AppSetup({ appScreenRenderer, loadingScreenRenderer,
|
|
5
|
+
export function AppSetup({ appScreenRenderer, loadingScreenRenderer, initialization, shellApi, appApi, stdout, clipboard, }) {
|
|
6
6
|
const [initialState, setInitialState] = useState();
|
|
7
7
|
const [config, setConfig] = useState(initialization.config);
|
|
8
|
-
// Load the initial configuration and keep it synchronized with changes made
|
|
9
|
-
// by another process or another running dirvi instance.
|
|
10
|
-
// useEffect(() => {
|
|
11
|
-
// let mounted = true;
|
|
12
|
-
// let latestLoad = 0;
|
|
13
|
-
//
|
|
14
|
-
// const loadConfig = (): void => {
|
|
15
|
-
// const loadNumber = ++latestLoad;
|
|
16
|
-
//
|
|
17
|
-
// void configApi
|
|
18
|
-
// .load()
|
|
19
|
-
// .then((nextConfig) => {
|
|
20
|
-
// // Ignore a stale read if a newer config read has begun meanwhile.
|
|
21
|
-
// if (!mounted || loadNumber !== latestLoad) {
|
|
22
|
-
// return;
|
|
23
|
-
// }
|
|
24
|
-
//
|
|
25
|
-
// setConfig(nextConfig);
|
|
26
|
-
// })
|
|
27
|
-
// .catch((cause: unknown) => {
|
|
28
|
-
// if (!mounted || loadNumber !== latestLoad) {
|
|
29
|
-
// return;
|
|
30
|
-
// }
|
|
31
|
-
//
|
|
32
|
-
// const nextError =
|
|
33
|
-
// cause instanceof Error ? cause : new Error(String(cause));
|
|
34
|
-
//
|
|
35
|
-
// setError(nextError);
|
|
36
|
-
// onError?.(nextError);
|
|
37
|
-
// });
|
|
38
|
-
// };
|
|
39
|
-
//
|
|
40
|
-
// // Subscribe before the first load so a change during startup is not missed.
|
|
41
|
-
// const unsubscribe = configApi.subscribeToResync(loadConfig);
|
|
42
|
-
// loadConfig();
|
|
43
|
-
//
|
|
44
|
-
// return () => {
|
|
45
|
-
// mounted = false;
|
|
46
|
-
// unsubscribe();
|
|
47
|
-
// };
|
|
48
|
-
// }, [configApi, onError]);
|
|
49
8
|
// Loading and setting initial state.
|
|
50
9
|
useEffect(() => {
|
|
51
10
|
let mounted = true;
|
|
@@ -84,5 +43,5 @@ export function AppSetup({ appScreenRenderer, loadingScreenRenderer, appApi, ini
|
|
|
84
43
|
if (initialState === undefined) {
|
|
85
44
|
return _jsx(LoadingScreenRenderer, {});
|
|
86
45
|
}
|
|
87
|
-
return (_jsx(App, { screenRenderer: appScreenRenderer, appApi: appApi, config: config, initialState: initialState, reducer: reducer, intentToEffect: intentToEffect, effectToAction: effectToAction, ...(stdout === undefined ? {} : { stdout }), ...(clipboard === undefined ? {} : { clipboard }) }));
|
|
46
|
+
return (_jsx(App, { screenRenderer: appScreenRenderer, shellApi: shellApi, appApi: appApi, config: config, registeredApps: initialization.registeredApps, initialState: initialState, reducer: reducer, intentToEffect: intentToEffect, effectToAction: effectToAction, ...(stdout === undefined ? {} : { stdout }), ...(clipboard === undefined ? {} : { clipboard }) }));
|
|
88
47
|
}
|
package/dist/ui/Shell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../../src/ui/Shell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAItE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IACtD,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE9C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEtC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C,gDAAgD;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,MAAM,EACN,SAAS,GACV,EAAE,aAAa,+
|
|
1
|
+
{"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../../src/ui/Shell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAItE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IACtD,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE9C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEtC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C,gDAAgD;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,MAAM,EACN,SAAS,GACV,EAAE,aAAa,+BAoEf"}
|
package/dist/ui/Shell.js
CHANGED
|
@@ -13,10 +13,6 @@ import { createAppApiApplicator } from '../application/create-app-api.js';
|
|
|
13
13
|
* AppSetup receives the concrete AppApi and mounts the app-specific tree UI.
|
|
14
14
|
*/
|
|
15
15
|
export function Shell({ loadingScreenRenderer, appScreenRenderer, initialAppOptions, initialization, packageLoader, stdout, clipboard, }) {
|
|
16
|
-
const initialAppReference = initialization.registeredApps.get(initialization.initialAppId);
|
|
17
|
-
if (initialAppReference === undefined) {
|
|
18
|
-
throw new Error(`Startup app "${initialization.initialAppId}" has not been registered.`);
|
|
19
|
-
}
|
|
20
16
|
const [appApiApplicator, setAppApiApplicator] = useState(undefined);
|
|
21
17
|
const [appError, setAppError] = useState(undefined);
|
|
22
18
|
const shellApi = useMemo(() => {
|
|
@@ -29,15 +25,14 @@ export function Shell({ loadingScreenRenderer, appScreenRenderer, initialAppOpti
|
|
|
29
25
|
setAppApiApplicator(undefined);
|
|
30
26
|
setAppError(undefined);
|
|
31
27
|
const appPlugin = await packageLoader.loadAppPlugin(appReference);
|
|
32
|
-
const
|
|
33
|
-
const loadedAppApiApplicator = createAppApiApplicator(appDefinitionApplicator);
|
|
28
|
+
const loadedAppApiApplicator = createAppApiApplicator(appPlugin.createAppDefinitionApplicator(input));
|
|
34
29
|
setAppApiApplicator(() => loadedAppApiApplicator);
|
|
35
30
|
},
|
|
36
31
|
};
|
|
37
32
|
}, [initialization.registeredApps, packageLoader]);
|
|
38
33
|
useEffect(() => {
|
|
39
34
|
void shellApi
|
|
40
|
-
.openApp(initialization.initialAppId, initialAppOptions.input)
|
|
35
|
+
.openApp(initialAppOptions.app ?? initialization.initialAppId, initialAppOptions.input)
|
|
41
36
|
.catch((error) => {
|
|
42
37
|
setAppError(error instanceof Error ? error : new Error(String(error)));
|
|
43
38
|
});
|
|
@@ -45,6 +40,10 @@ export function Shell({ loadingScreenRenderer, appScreenRenderer, initialAppOpti
|
|
|
45
40
|
if (appError !== undefined) {
|
|
46
41
|
throw appError;
|
|
47
42
|
}
|
|
43
|
+
const initialAppReference = initialization.registeredApps.get(initialization.initialAppId);
|
|
44
|
+
if (initialAppReference === undefined) {
|
|
45
|
+
throw new Error(`Startup app "${initialization.initialAppId}" has not been registered.`);
|
|
46
|
+
}
|
|
48
47
|
if (appApiApplicator === undefined) {
|
|
49
48
|
const LoadingScreenRenderer = loadingScreenRenderer;
|
|
50
49
|
return _jsx(LoadingScreenRenderer, {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mak-98/dirvi-app",
|
|
3
|
-
"version": "0.11.0-beta.
|
|
3
|
+
"version": "0.11.0-beta.5",
|
|
4
4
|
"description": "Shared React application logic for dirvi hosts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"dirvi-apis": "0.11.0-beta.
|
|
20
|
-
"dirvi-lib": "0.11.0-beta.
|
|
19
|
+
"dirvi-apis": "0.11.0-beta.5",
|
|
20
|
+
"dirvi-lib": "0.11.0-beta.5",
|
|
21
21
|
"zod": "^4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|