@mak-98/dirvi-app 0.11.0-beta.7 → 0.11.0-beta.9
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/app-api-applicator.d.ts +12 -0
- package/dist/application/app-api-applicator.d.ts.map +1 -0
- package/dist/application/app-api-applicator.js +1 -0
- package/dist/application/create-app-api.d.ts +3 -3
- package/dist/application/create-app-api.d.ts.map +1 -1
- package/dist/application/create-app-api.js +1 -1
- package/dist/ui/AppSetup.d.ts.map +1 -1
- package/dist/ui/AppSetup.js +8 -3
- package/dist/ui/Shell.d.ts.map +1 -1
- package/dist/ui/Shell.js +6 -1
- package/dist/ui/hooks/useView.d.ts +2 -1
- package/dist/ui/hooks/useView.d.ts.map +1 -1
- package/dist/ui/view.d.ts +2 -1
- package/dist/ui/view.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SerializableKey } from 'dirvi-apis';
|
|
2
|
+
import type { AppApi } from 'dirvi-lib';
|
|
3
|
+
/**
|
|
4
|
+
* Creates and applies the AppApi to a given consumer of it.
|
|
5
|
+
*/
|
|
6
|
+
export type AppApiApplicator = <Result>(appApiConsumer: AppApiConsumer<Result>) => Result;
|
|
7
|
+
/**
|
|
8
|
+
* An operation that can consume an AppApi of any valid concrete type and
|
|
9
|
+
* produce a caller-selected result.
|
|
10
|
+
*/
|
|
11
|
+
export type AppApiConsumer<Result> = <Id extends SerializableKey, Value, ViewKey = string>(appApi: AppApi<Id, Value, ViewKey>) => Result;
|
|
12
|
+
//# sourceMappingURL=app-api-applicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-api-applicator.d.ts","sourceRoot":"","sources":["../../src/application/app-api-applicator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EACpC,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,KACnC,MAAM,CAAC;AAEZ;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,MAAM,IAAI,CACnC,EAAE,SAAS,eAAe,EAC1B,KAAK,EACL,OAAO,GAAG,MAAM,EAEhB,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAC/B,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SerializableKey, AppApi } from 'dirvi-lib';
|
|
2
|
-
import type {
|
|
1
|
+
import type { SerializableKey, AppApi, AppApiApplicator } from 'dirvi-lib';
|
|
2
|
+
import type { AppDefinition, AppDefinitionApplicator } from 'dirvi-apis';
|
|
3
3
|
/**
|
|
4
|
-
* Turns
|
|
4
|
+
* Turns an app owned `AppDefinition` into a host-owned runtime `AppApi`.
|
|
5
5
|
*
|
|
6
6
|
* The plugin's concrete generic types remain hidden by the applicator
|
|
7
7
|
* boundary, while the host creates the matching AppApi specialization.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app-api.d.ts","sourceRoot":"","sources":["../../src/application/create-app-api.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"create-app-api.d.ts","sourceRoot":"","sources":["../../src/application/create-app-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,MAAM,EACN,gBAAgB,EAEjB,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,uBAAuB,EAAE,uBAAuB,GAC/C,gBAAgB,CAQlB;AAED,wBAAgB,YAAY,CAC1B,EAAE,SAAS,eAAe,EAC1B,KAAK,EACL,aAAa,EAAE,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAiE5D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createFoldMethods, createCursorMethods, createUnorderedNavMethods, createOrderedNavMethods, } from 'dirvi-lib';
|
|
2
2
|
import { createTreeMethods, createStateApi, } from 'dirvi-lib';
|
|
3
3
|
/**
|
|
4
|
-
* Turns
|
|
4
|
+
* Turns an app owned `AppDefinition` into a host-owned runtime `AppApi`.
|
|
5
5
|
*
|
|
6
6
|
* The plugin's concrete generic types remain hidden by the applicator
|
|
7
7
|
* boundary, while the host creates the matching AppApi specialization.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSetup.d.ts","sourceRoot":"","sources":["../../src/ui/AppSetup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAqB,eAAe,EAAS,MAAM,WAAW,CAAC;AAO9E,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,K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AAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,GACV,EAAE,eAAe,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,+BAoGrC"}
|
package/dist/ui/AppSetup.js
CHANGED
|
@@ -5,7 +5,6 @@ import { createEffectToAction, createIntentToEffect, createReducer, } from 'dirv
|
|
|
5
5
|
import { App } from './App.js';
|
|
6
6
|
export function AppSetup({ appScreenRenderer, loadingScreenRenderer, initialization, shellApi, appApi, stdout, clipboard, }) {
|
|
7
7
|
const [loadState, setLoadState] = useState();
|
|
8
|
-
const [initialState, setInitialState] = useState();
|
|
9
8
|
// Loading and setting initial state.
|
|
10
9
|
useEffect(() => {
|
|
11
10
|
let mounted = true;
|
|
@@ -46,8 +45,14 @@ export function AppSetup({ appScreenRenderer, loadingScreenRenderer, initializat
|
|
|
46
45
|
const effectToAction = useMemo(() => createEffectToAction(appApi.stateApi, appApi.navMethods), [appApi.navMethods, appApi.stateApi]);
|
|
47
46
|
// --- JSX ---
|
|
48
47
|
const LoadingScreenRenderer = loadingScreenRenderer;
|
|
49
|
-
if (
|
|
48
|
+
if (loadState === undefined || loadState.appApi !== appApi) {
|
|
50
49
|
return _jsx(LoadingScreenRenderer, {});
|
|
51
50
|
}
|
|
52
|
-
|
|
51
|
+
if (loadState.status === 'loading') {
|
|
52
|
+
return _jsx(LoadingScreenRenderer, {});
|
|
53
|
+
}
|
|
54
|
+
if (loadState.status === 'error') {
|
|
55
|
+
throw loadState.error;
|
|
56
|
+
}
|
|
57
|
+
return (_jsx(App, { screenRenderer: appScreenRenderer, shellApi: shellApi, appApi: appApi, initialization: initialization, initialState: loadState.initialState, reducer: reducer, intentToEffect: intentToEffect, effectToAction: effectToAction, ...(stdout === undefined ? {} : { stdout }), ...(clipboard === undefined ? {} : { clipboard }) }));
|
|
53
58
|
}
|
package/dist/ui/Shell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../../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AA0B,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,+BAyEf"}
|
package/dist/ui/Shell.js
CHANGED
|
@@ -36,7 +36,12 @@ export function Shell({ loadingScreenRenderer, appScreenRenderer, initialAppOpti
|
|
|
36
36
|
.catch((error) => {
|
|
37
37
|
setAppError(error instanceof Error ? error : new Error(String(error)));
|
|
38
38
|
});
|
|
39
|
-
}, [
|
|
39
|
+
}, [
|
|
40
|
+
initialAppOptions.app,
|
|
41
|
+
initialAppOptions.input,
|
|
42
|
+
initialization.app.initial,
|
|
43
|
+
shellApi,
|
|
44
|
+
]);
|
|
40
45
|
if (appError !== undefined) {
|
|
41
46
|
throw appError;
|
|
42
47
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { CursorMethods, NavBranch, NavMethods,
|
|
1
|
+
import type { CursorMethods, NavBranch, NavMethods, SerializableKey, State, StateApi } from 'dirvi-lib';
|
|
2
|
+
import type { PresentNode } from 'dirvi-apis';
|
|
2
3
|
import { View } from '../view.js';
|
|
3
4
|
export declare function useView<Id extends SerializableKey, Value>(navNode: NavBranch<Id>, state: State<Id, Value>, stateApi: StateApi<Id, Value>, navNodeApi: NavMethods<Id, Value>, cursorMethods: CursorMethods<Id>, rowCount: number, presentNode: PresentNode<Id>): View;
|
|
4
5
|
//# sourceMappingURL=useView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useView.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,UAAU,
|
|
1
|
+
{"version":3,"file":"useView.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,eAAe,EACf,KAAK,EAAE,QAAQ,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAgB,MAAM,YAAY,CAAC;AAMhD,wBAAgB,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,EACvD,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC,EACtB,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,EACvB,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAC7B,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,EACjC,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC,GAC3B,IAAI,CAyBN"}
|
package/dist/ui/view.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HighlightToken, PresentNode } from 'dirvi-apis';
|
|
2
|
+
import type { Cursor, NavBranch, NavMethods, SerializableKey, CursorMethods } from 'dirvi-lib';
|
|
2
3
|
type ViewRowBase = {
|
|
3
4
|
id: string;
|
|
4
5
|
indent: number;
|
package/dist/ui/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/ui/view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/ui/view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EAET,UAAU,EACV,eAAe,EAAE,aAAa,EAC/B,MAAM,WAAW,CAAC;AAGnB,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,OAAO,GACf,CAAC,WAAW,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,GACF,CAAC,WAAW,GAAG;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,GACF,CAAC,WAAW,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEP,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB,CAAC;AASF,eAAO,MAAM,IAAI;eACJ,EAAE,SAAS,eAAe,EAAE,KAAK,YAChC,SAAS,CAAC,EAAE,CAAC,cACX,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,UACzB,MAAM,CAAC,EAAE,CAAC,iBACH,aAAa,CAAC,EAAE,CAAC,eACnB,WAAW,CAAC,EAAE,CAAC,GAC3B,OAAO,EAAE;WAwCL,EAAE,SAAS,eAAe,EAAE,KAAK,YAC5B,SAAS,CAAC,EAAE,CAAC,cACX,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,UACzB,MAAM,CAAC,EAAE,CAAC,iBACH,aAAa,CAAC,EAAE,CAAC,kBAChB,MAAM,iBACP,MAAM,eACR,WAAW,CAAC,EAAE,CAAC,GAC3B,IAAI;CAOR,CAAC"}
|
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.9",
|
|
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.9",
|
|
20
|
+
"dirvi-lib": "0.11.0-beta.9",
|
|
21
21
|
"zod": "^4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|