@eloxiv/shell-core 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Host.d.ts +75 -0
- package/dist/Host.d.ts.map +1 -0
- package/dist/Host.js +50 -0
- package/dist/Host.js.map +1 -0
- package/dist/Locale.d.ts +75 -0
- package/dist/Locale.d.ts.map +1 -0
- package/dist/Locale.js +197 -0
- package/dist/Locale.js.map +1 -0
- package/dist/Navigation.d.ts +52 -0
- package/dist/Navigation.d.ts.map +1 -0
- package/dist/Navigation.js +311 -0
- package/dist/Navigation.js.map +1 -0
- package/dist/Redirects.d.ts +56 -0
- package/dist/Redirects.d.ts.map +1 -0
- package/dist/Redirects.js +97 -0
- package/dist/Redirects.js.map +1 -0
- package/dist/ScreenCommands.d.ts +42 -0
- package/dist/ScreenCommands.d.ts.map +1 -0
- package/dist/ScreenCommands.js +101 -0
- package/dist/ScreenCommands.js.map +1 -0
- package/dist/ScreenContext.d.ts +34 -0
- package/dist/ScreenContext.d.ts.map +1 -0
- package/dist/ScreenContext.js +84 -0
- package/dist/ScreenContext.js.map +1 -0
- package/dist/Spaces.d.ts +20 -0
- package/dist/Spaces.d.ts.map +1 -0
- package/dist/Spaces.js +50 -0
- package/dist/Spaces.js.map +1 -0
- package/dist/Theme.d.ts +45 -0
- package/dist/Theme.d.ts.map +1 -0
- package/dist/Theme.js +192 -0
- package/dist/Theme.js.map +1 -0
- package/dist/ViewError.d.ts +41 -0
- package/dist/ViewError.d.ts.map +1 -0
- package/dist/ViewError.js +72 -0
- package/dist/ViewError.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/web/Host.d.ts +133 -0
- package/dist/web/Host.d.ts.map +1 -0
- package/dist/web/Host.js +295 -0
- package/dist/web/Host.js.map +1 -0
- package/dist/web/Tab.d.ts +32 -0
- package/dist/web/Tab.d.ts.map +1 -0
- package/dist/web/Tab.js +42 -0
- package/dist/web/Tab.js.map +1 -0
- package/dist/web/index.d.ts +8 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +8 -0
- package/dist/web/index.js.map +1 -0
- package/package.json +39 -3
- package/src/Host.ts +100 -0
- package/src/Locale.ts +254 -0
- package/src/Navigation.ts +357 -0
- package/src/Redirects.ts +114 -0
- package/src/ScreenCommands.ts +132 -0
- package/src/ScreenContext.ts +115 -0
- package/src/Spaces.ts +72 -0
- package/src/Theme.ts +235 -0
- package/src/ViewError.ts +102 -0
- package/src/index.ts +17 -0
- package/src/web/Host.ts +430 -0
- package/src/web/Tab.ts +71 -0
- package/src/web/index.ts +7 -0
- package/src/web-globals.d.ts +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eloxiv contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @eloxiv/shell-core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Framework-free contracts for building Eloxiv app shells: views, slots, commands, spaces, screen context, theme tokens, locales, and host integration. `@eloxiv/shell-core/web` provides the browser host implementation.
|
|
4
|
+
|
|
5
|
+
Eloxiv is a framework for agent-native applications: a headless kernel, a registry of app-owned modules, and the tools to assemble apps from them. Start with [Getting started](https://github.com/eloxiv/eloxiv/blob/main/docs/getting-started.md).
|
|
6
|
+
|
|
7
|
+
MIT licensed.
|
package/dist/Host.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Host shell contract (decision 7; docs/contracts/host.md) as the interface a host implements: the web
|
|
3
|
+
* (`webHost` in `@eloxiv/shell-core/web`), the registry's Tauri desktop template (`desktop/host.ts`), and later a
|
|
4
|
+
* mobile host. Each capability is reported supported or unsupported; an unsupported one fails with
|
|
5
|
+
* `HostUnsupported`, never silently.
|
|
6
|
+
*
|
|
7
|
+
* `unsupported(capability)` builds the failing operations, so a host implements only what it supports.
|
|
8
|
+
*/
|
|
9
|
+
import { HostUnsupported, type HostCapabilities, type NotificationResponse, type PickedFile, type PushPermission, type PushSubscriptionInfo, type PushToken, type UpdateStatus } from "@eloxiv/contracts";
|
|
10
|
+
export type HostCapability = HostUnsupported["capability"];
|
|
11
|
+
export interface Host {
|
|
12
|
+
readonly capabilities: () => HostCapabilities;
|
|
13
|
+
/** The deep link the app was opened with (own origin or scheme only), or `null`. */
|
|
14
|
+
readonly initialLink: () => Promise<string | null>;
|
|
15
|
+
/** Each deep link the app is asked to open while running (own origin or scheme only). */
|
|
16
|
+
readonly onLink: (listener: (url: string) => void) => () => void;
|
|
17
|
+
readonly secretGet: (key: string) => Promise<string | null>;
|
|
18
|
+
readonly secretSet: (key: string, value: string) => Promise<void>;
|
|
19
|
+
readonly secretDelete: (key: string) => Promise<void>;
|
|
20
|
+
readonly pushPermission: () => Promise<PushPermission>;
|
|
21
|
+
readonly pushSubscribe: (options?: {
|
|
22
|
+
readonly applicationServerKey?: string;
|
|
23
|
+
}) => Promise<PushSubscriptionInfo>;
|
|
24
|
+
readonly pushUnsubscribe: () => Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Native hosts (Host 1.1.0): this installation's APNs or FCM token, after the person's permission, for
|
|
27
|
+
* `notifications.registerInstallation`. A host without native push leaves it out.
|
|
28
|
+
*/
|
|
29
|
+
readonly pushToken?: () => Promise<PushToken>;
|
|
30
|
+
/**
|
|
31
|
+
* Native hosts (Host 1.1.0): each response to a push notification (a tap, or a decision button the host already
|
|
32
|
+
* redeemed with the notification's token), including the one that launched the app. A tap only navigates.
|
|
33
|
+
*/
|
|
34
|
+
readonly onNotificationResponse?: (listener: (response: NotificationResponse) => void) => () => void;
|
|
35
|
+
readonly checkUpdate: () => Promise<UpdateStatus>;
|
|
36
|
+
readonly applyUpdate: () => Promise<void>;
|
|
37
|
+
readonly openFiles: (options?: {
|
|
38
|
+
readonly accept?: ReadonlyArray<string>;
|
|
39
|
+
readonly multiple?: boolean;
|
|
40
|
+
}) => Promise<ReadonlyArray<PickedFile>>;
|
|
41
|
+
readonly saveFile: (file: {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly mediaType: string;
|
|
44
|
+
readonly bytes: Uint8Array;
|
|
45
|
+
}) => Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
export declare const unsupportedError: (host: string, capability: HostCapability) => HostUnsupported;
|
|
48
|
+
/** Operations that fail with HostUnsupported, for the capabilities a host does not implement. */
|
|
49
|
+
export declare const unsupported: (host: string) => {
|
|
50
|
+
deepLinks: {
|
|
51
|
+
initialLink: Host["initialLink"];
|
|
52
|
+
onLink: Host["onLink"];
|
|
53
|
+
};
|
|
54
|
+
secureStorage: {
|
|
55
|
+
secretGet: Host["secretGet"];
|
|
56
|
+
secretSet: Host["secretSet"];
|
|
57
|
+
secretDelete: Host["secretDelete"];
|
|
58
|
+
};
|
|
59
|
+
push: {
|
|
60
|
+
pushPermission: Host["pushPermission"];
|
|
61
|
+
pushSubscribe: Host["pushSubscribe"];
|
|
62
|
+
pushUnsubscribe: Host["pushUnsubscribe"];
|
|
63
|
+
};
|
|
64
|
+
updates: {
|
|
65
|
+
checkUpdate: Host["checkUpdate"];
|
|
66
|
+
applyUpdate: Host["applyUpdate"];
|
|
67
|
+
};
|
|
68
|
+
files: {
|
|
69
|
+
openFiles: Host["openFiles"];
|
|
70
|
+
saveFile: Host["saveFile"];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
/** Secure-storage keys: short and namespaced by the caller (the contract's `SecretKey`). */
|
|
74
|
+
export declare const SECRET_KEY: RegExp;
|
|
75
|
+
//# sourceMappingURL=Host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Host.d.ts","sourceRoot":"","sources":["../src/Host.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,YAAY,CAAC,CAAA;AAE1D,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,YAAY,EAAE,MAAM,gBAAgB,CAAA;IAC7C,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAClD,yFAAy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E,OAAO,CAAA;KAC5B,KAAK,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAA;IACxC,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE;QACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;KAC3B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACpB;AAUD,eAAO,MAAM,gBAAgB,SAAU,MAAM,cAAc,cAAc,oBAC+B,CAAA;AAExG,iGAAiG;AACjG,eAAO,MAAM,WAAW,SAAU,MAAM;IAGpC,SAAS;QACP,WAAW,EAAuB,IAAI,CAAC,aAAa,CAAC;QACrD,MAAM,EAEA,IAAI,CAAC,QAAQ,CAAC;;IAEtB,aAAa;QACX,SAAS,EAA2B,IAAI,CAAC,WAAW,CAAC;QACrD,SAAS,EAA2B,IAAI,CAAC,WAAW,CAAC;QACrD,YAAY,EAA2B,IAAI,CAAC,cAAc,CAAC;;IAE7D,IAAI;QACF,cAAc,EAAkB,IAAI,CAAC,gBAAgB,CAAC;QACtD,aAAa,EAAkB,IAAI,CAAC,eAAe,CAAC;QACpD,eAAe,EAAkB,IAAI,CAAC,iBAAiB,CAAC;;IAE1D,OAAO;QACL,WAAW,EAAqB,IAAI,CAAC,aAAa,CAAC;QACnD,WAAW,EAAqB,IAAI,CAAC,aAAa,CAAC;;IAErD,KAAK;QACH,SAAS,EAAmB,IAAI,CAAC,WAAW,CAAC;QAC7C,QAAQ,EAAmB,IAAI,CAAC,UAAU,CAAC;;CAGhD,CAAA;AAED,4FAA4F;AAC5F,eAAO,MAAM,UAAU,QAAiC,CAAA"}
|
package/dist/Host.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Host shell contract (decision 7; docs/contracts/host.md) as the interface a host implements: the web
|
|
3
|
+
* (`webHost` in `@eloxiv/shell-core/web`), the registry's Tauri desktop template (`desktop/host.ts`), and later a
|
|
4
|
+
* mobile host. Each capability is reported supported or unsupported; an unsupported one fails with
|
|
5
|
+
* `HostUnsupported`, never silently.
|
|
6
|
+
*
|
|
7
|
+
* `unsupported(capability)` builds the failing operations, so a host implements only what it supports.
|
|
8
|
+
*/
|
|
9
|
+
import { HostUnsupported, } from "@eloxiv/contracts";
|
|
10
|
+
const NAMES = {
|
|
11
|
+
deepLinks: "deep links",
|
|
12
|
+
push: "push",
|
|
13
|
+
secureStorage: "secure storage",
|
|
14
|
+
updates: "updates",
|
|
15
|
+
files: "file access",
|
|
16
|
+
};
|
|
17
|
+
export const unsupportedError = (host, capability) => new HostUnsupported({ message: `The ${host} host does not support ${NAMES[capability]}`, capability });
|
|
18
|
+
/** Operations that fail with HostUnsupported, for the capabilities a host does not implement. */
|
|
19
|
+
export const unsupported = (host) => {
|
|
20
|
+
const fail = (capability) => () => Promise.reject(unsupportedError(host, capability));
|
|
21
|
+
return {
|
|
22
|
+
deepLinks: {
|
|
23
|
+
initialLink: fail("deepLinks"),
|
|
24
|
+
onLink: (() => {
|
|
25
|
+
throw unsupportedError(host, "deepLinks");
|
|
26
|
+
}),
|
|
27
|
+
},
|
|
28
|
+
secureStorage: {
|
|
29
|
+
secretGet: fail("secureStorage"),
|
|
30
|
+
secretSet: fail("secureStorage"),
|
|
31
|
+
secretDelete: fail("secureStorage"),
|
|
32
|
+
},
|
|
33
|
+
push: {
|
|
34
|
+
pushPermission: fail("push"),
|
|
35
|
+
pushSubscribe: fail("push"),
|
|
36
|
+
pushUnsubscribe: fail("push"),
|
|
37
|
+
},
|
|
38
|
+
updates: {
|
|
39
|
+
checkUpdate: fail("updates"),
|
|
40
|
+
applyUpdate: fail("updates"),
|
|
41
|
+
},
|
|
42
|
+
files: {
|
|
43
|
+
openFiles: fail("files"),
|
|
44
|
+
saveFile: fail("files"),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** Secure-storage keys: short and namespaced by the caller (the contract's `SecretKey`). */
|
|
49
|
+
export const SECRET_KEY = /^[a-z0-9][a-z0-9._-]{0,127}$/;
|
|
50
|
+
//# sourceMappingURL=Host.js.map
|
package/dist/Host.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Host.js","sourceRoot":"","sources":["../src/Host.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,eAAe,GAQhB,MAAM,mBAAmB,CAAA;AAuC1B,MAAM,KAAK,GAA6C;IACtD,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,gBAAgB;IAC/B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,aAAa;CACrB,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,UAA0B,EAAE,EAAE,CAC3E,IAAI,eAAe,CAAC,EAAE,OAAO,EAAE,OAAO,IAAI,0BAA0B,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAA;AAExG,iGAAiG;AACjG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE;IAC1C,MAAM,IAAI,GAAG,CAAC,UAA0B,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAA;IACrG,OAAO;QACL,SAAS,EAAE;YACT,WAAW,EAAE,IAAI,CAAC,WAAW,CAAwB;YACrD,MAAM,EAAE,CAAC,GAAiB,EAAE;gBAC1B,MAAM,gBAAgB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;YAC3C,CAAC,CAAmB;SACrB;QACD,aAAa,EAAE;YACb,SAAS,EAAE,IAAI,CAAC,eAAe,CAAsB;YACrD,SAAS,EAAE,IAAI,CAAC,eAAe,CAAsB;YACrD,YAAY,EAAE,IAAI,CAAC,eAAe,CAAyB;SAC5D;QACD,IAAI,EAAE;YACJ,cAAc,EAAE,IAAI,CAAC,MAAM,CAA2B;YACtD,aAAa,EAAE,IAAI,CAAC,MAAM,CAA0B;YACpD,eAAe,EAAE,IAAI,CAAC,MAAM,CAA4B;SACzD;QACD,OAAO,EAAE;YACP,WAAW,EAAE,IAAI,CAAC,SAAS,CAAwB;YACnD,WAAW,EAAE,IAAI,CAAC,SAAS,CAAwB;SACpD;QACD,KAAK,EAAE;YACL,SAAS,EAAE,IAAI,CAAC,OAAO,CAAsB;YAC7C,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAqB;SAC5C;KACF,CAAA;AACH,CAAC,CAAA;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG,8BAA8B,CAAA"}
|
package/dist/Locale.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Locale shell contract (docs/contracts/locale.md): a message catalog compiled by Paraglide JS, with
|
|
3
|
+
* locale negotiation (RFC 4647 lookup, then the base locale), writing direction, and Intl formatting in the
|
|
4
|
+
* current locale.
|
|
5
|
+
*
|
|
6
|
+
* A Paraglide project compiles to `messages.js` (one function per message, `m.greeting({ name }, { locale })`)
|
|
7
|
+
* and `runtime.js` (`baseLocale`, `locales`). `paraglideCatalog` adapts the two:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import * as m from "./paraglide/messages.js"
|
|
11
|
+
* import * as runtime from "./paraglide/runtime.js"
|
|
12
|
+
* const locale = makeLocale(paraglideCatalog(runtime, m), { requested: navigator.languages })
|
|
13
|
+
* document.documentElement.dir = locale.current().direction
|
|
14
|
+
* locale.message("greeting", { name: "Mona" })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import { type CatalogInfo, type Negotiated, type TextDirection } from "@eloxiv/contracts";
|
|
18
|
+
/** A compiled message: its text for the parameters, in a locale. */
|
|
19
|
+
export type CompiledMessage = (params: Readonly<Record<string, string | number>>, options: {
|
|
20
|
+
readonly locale: string;
|
|
21
|
+
}) => string;
|
|
22
|
+
export interface MessageCatalog {
|
|
23
|
+
readonly baseLocale: string;
|
|
24
|
+
readonly locales: ReadonlyArray<string>;
|
|
25
|
+
readonly messages: Readonly<Record<string, CompiledMessage>>;
|
|
26
|
+
}
|
|
27
|
+
/** A Paraglide JS project's compiled output (`runtime.js` and `messages.js`) as a catalog. */
|
|
28
|
+
export declare const paraglideCatalog: (runtime: {
|
|
29
|
+
readonly baseLocale: string;
|
|
30
|
+
readonly locales: ReadonlyArray<string>;
|
|
31
|
+
}, messages: Readonly<Record<string, unknown>>) => MessageCatalog;
|
|
32
|
+
/** The writing direction of a locale: from its script, explicit or likely (`ar` is Arab, so rtl). */
|
|
33
|
+
export declare const directionOf: (locale: string) => TextDirection;
|
|
34
|
+
/**
|
|
35
|
+
* RFC 4647 lookup: for each requested tag in order, the tag itself, then each shorter prefix of it (dropping a
|
|
36
|
+
* single-character extension singleton together with what follows it), matched case-insensitively; the default
|
|
37
|
+
* when nothing matches.
|
|
38
|
+
*/
|
|
39
|
+
export declare const lookupLocale: (requested: ReadonlyArray<string>, available: ReadonlyArray<string>, fallback: string) => string;
|
|
40
|
+
export interface Locale {
|
|
41
|
+
readonly catalog: () => CatalogInfo;
|
|
42
|
+
readonly negotiate: (requested: ReadonlyArray<string>) => Negotiated;
|
|
43
|
+
readonly direction: (locale: string) => TextDirection;
|
|
44
|
+
readonly current: () => Negotiated;
|
|
45
|
+
readonly setLocale: (locale: string) => Negotiated;
|
|
46
|
+
readonly message: (id: string, params?: Readonly<Record<string, string | number>>, locale?: string) => string;
|
|
47
|
+
readonly formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
48
|
+
readonly formatDate: (epochMs: number, options?: Intl.DateTimeFormatOptions) => string;
|
|
49
|
+
readonly formatList: (items: ReadonlyArray<string>, type?: "conjunction" | "disjunction") => string;
|
|
50
|
+
readonly plural: (count: number) => Intl.LDMLPluralRule;
|
|
51
|
+
/** Be told when the current locale changes; returns a function that stops listening. */
|
|
52
|
+
readonly subscribe: (listener: (current: Negotiated) => void) => () => void;
|
|
53
|
+
}
|
|
54
|
+
export declare const makeLocale: (catalog: MessageCatalog, options?: {
|
|
55
|
+
readonly requested?: ReadonlyArray<string> | undefined;
|
|
56
|
+
}) => Locale;
|
|
57
|
+
/**
|
|
58
|
+
* A catalog from plain text per locale (`{ en: { greeting: "Hello, {name}" }, ar: { ... } }`): what a module ships
|
|
59
|
+
* for its own screens' words, without a Paraglide project. `{name}` takes the parameter; a message a locale lacks is
|
|
60
|
+
* empty there (so `makeLocale` falls back to the base locale's text, and `missingTranslations` lists it).
|
|
61
|
+
*/
|
|
62
|
+
export declare const textCatalog: (baseLocale: string, texts: Readonly<Record<string, Readonly<Record<string, string>>>>) => MessageCatalog;
|
|
63
|
+
/**
|
|
64
|
+
* Catalogs composed in order, each later one over the earlier (the shell's, then each module's, then the app's own
|
|
65
|
+
* overrides): a message a later catalog has wins in every locale it translates; where it has no text for a locale,
|
|
66
|
+
* the earlier catalogs' text for it is used. The locales are all of theirs; they must share a base locale.
|
|
67
|
+
*/
|
|
68
|
+
export declare const composeCatalogs: (...catalogs: ReadonlyArray<MessageCatalog>) => MessageCatalog;
|
|
69
|
+
/**
|
|
70
|
+
* The messages with no text of their own in `locale` (they show the base locale's), sorted: what a translator still
|
|
71
|
+
* owes, checked in a test so a new message cannot ship untranslated. Messages are called with `params` (default none:
|
|
72
|
+
* a message that needs parameters is called with each name standing for itself).
|
|
73
|
+
*/
|
|
74
|
+
export declare const missingTranslations: (catalog: MessageCatalog, locale: string) => ReadonlyArray<string>;
|
|
75
|
+
//# sourceMappingURL=Locale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Locale.d.ts","sourceRoot":"","sources":["../src/Locale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,U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C,KAAG,cA6B5E,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YAAa,cAAc,UAAU,MAAM,KAAG,aAAa,CAAC,MAAM,CAQvF,CAAA"}
|
package/dist/Locale.js
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Locale shell contract (docs/contracts/locale.md): a message catalog compiled by Paraglide JS, with
|
|
3
|
+
* locale negotiation (RFC 4647 lookup, then the base locale), writing direction, and Intl formatting in the
|
|
4
|
+
* current locale.
|
|
5
|
+
*
|
|
6
|
+
* A Paraglide project compiles to `messages.js` (one function per message, `m.greeting({ name }, { locale })`)
|
|
7
|
+
* and `runtime.js` (`baseLocale`, `locales`). `paraglideCatalog` adapts the two:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import * as m from "./paraglide/messages.js"
|
|
11
|
+
* import * as runtime from "./paraglide/runtime.js"
|
|
12
|
+
* const locale = makeLocale(paraglideCatalog(runtime, m), { requested: navigator.languages })
|
|
13
|
+
* document.documentElement.dir = locale.current().direction
|
|
14
|
+
* locale.message("greeting", { name: "Mona" })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import { MissingMessage, UnsupportedLocale, } from "@eloxiv/contracts";
|
|
18
|
+
/** A Paraglide JS project's compiled output (`runtime.js` and `messages.js`) as a catalog. */
|
|
19
|
+
export const paraglideCatalog = (runtime, messages) => ({
|
|
20
|
+
baseLocale: runtime.baseLocale,
|
|
21
|
+
locales: runtime.locales,
|
|
22
|
+
messages: Object.fromEntries(Object.entries(messages).filter((entry) => typeof entry[1] === "function")),
|
|
23
|
+
});
|
|
24
|
+
/** Scripts written right to left (ISO 15924). */
|
|
25
|
+
const RTL_SCRIPTS = new Set(["Adlm", "Arab", "Hebr", "Mand", "Mend", "Nkoo", "Rohg", "Samr", "Syrc", "Thaa", "Yezi"]);
|
|
26
|
+
/** Languages whose default script is written right to left (for runtimes whose Intl cannot add likely subtags). */
|
|
27
|
+
const RTL_LANGUAGES = new Set([
|
|
28
|
+
"ar",
|
|
29
|
+
"arc",
|
|
30
|
+
"ckb",
|
|
31
|
+
"dv",
|
|
32
|
+
"fa",
|
|
33
|
+
"he",
|
|
34
|
+
"iw",
|
|
35
|
+
"ks",
|
|
36
|
+
"ku-arab",
|
|
37
|
+
"ps",
|
|
38
|
+
"sd",
|
|
39
|
+
"ug",
|
|
40
|
+
"ur",
|
|
41
|
+
"yi",
|
|
42
|
+
]);
|
|
43
|
+
/** The writing direction of a locale: from its script, explicit or likely (`ar` is Arab, so rtl). */
|
|
44
|
+
export const directionOf = (locale) => {
|
|
45
|
+
const parts = locale.split("-");
|
|
46
|
+
const explicit = parts.find((p, i) => i > 0 && p.length === 4);
|
|
47
|
+
if (explicit !== undefined) {
|
|
48
|
+
const script = explicit[0].toUpperCase() + explicit.slice(1).toLowerCase();
|
|
49
|
+
return RTL_SCRIPTS.has(script) ? "rtl" : "ltr";
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const IntlLocaleClass = Intl.Locale;
|
|
53
|
+
const script = IntlLocaleClass === undefined ? undefined : new IntlLocaleClass(locale).maximize?.().script;
|
|
54
|
+
if (script !== undefined)
|
|
55
|
+
return RTL_SCRIPTS.has(script) ? "rtl" : "ltr";
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// Not a tag Intl understands: fall back to the language list.
|
|
59
|
+
}
|
|
60
|
+
return RTL_LANGUAGES.has(parts[0].toLowerCase()) ? "rtl" : "ltr";
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* RFC 4647 lookup: for each requested tag in order, the tag itself, then each shorter prefix of it (dropping a
|
|
64
|
+
* single-character extension singleton together with what follows it), matched case-insensitively; the default
|
|
65
|
+
* when nothing matches.
|
|
66
|
+
*/
|
|
67
|
+
export const lookupLocale = (requested, available, fallback) => {
|
|
68
|
+
const byLower = new Map(available.map((tag) => [tag.toLowerCase(), tag]));
|
|
69
|
+
for (const tag of requested) {
|
|
70
|
+
if (tag === "*")
|
|
71
|
+
continue;
|
|
72
|
+
let subtags = tag.toLowerCase().split("-");
|
|
73
|
+
while (subtags.length > 0) {
|
|
74
|
+
const found = byLower.get(subtags.join("-"));
|
|
75
|
+
if (found !== undefined)
|
|
76
|
+
return found;
|
|
77
|
+
subtags = subtags.slice(0, -1);
|
|
78
|
+
if (subtags.length >= 2 && subtags[subtags.length - 1].length === 1)
|
|
79
|
+
subtags = subtags.slice(0, -1);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return fallback;
|
|
83
|
+
};
|
|
84
|
+
export const makeLocale = (catalog, options = {}) => {
|
|
85
|
+
if (!catalog.locales.includes(catalog.baseLocale)) {
|
|
86
|
+
throw new Error(`The catalog's base locale ${catalog.baseLocale} is not one of its locales`);
|
|
87
|
+
}
|
|
88
|
+
const negotiate = (requested) => {
|
|
89
|
+
const locale = lookupLocale(requested, catalog.locales, catalog.baseLocale);
|
|
90
|
+
return { locale, direction: directionOf(locale) };
|
|
91
|
+
};
|
|
92
|
+
let current = negotiate(options.requested ?? []);
|
|
93
|
+
const listeners = new Set();
|
|
94
|
+
const supported = (locale) => catalog.locales.find((l) => l.toLowerCase() === locale.toLowerCase());
|
|
95
|
+
return {
|
|
96
|
+
catalog: () => ({
|
|
97
|
+
baseLocale: catalog.baseLocale,
|
|
98
|
+
locales: [...catalog.locales],
|
|
99
|
+
messages: Object.keys(catalog.messages).sort(),
|
|
100
|
+
}),
|
|
101
|
+
negotiate,
|
|
102
|
+
direction: directionOf,
|
|
103
|
+
current: () => current,
|
|
104
|
+
setLocale: (locale) => {
|
|
105
|
+
const found = supported(locale);
|
|
106
|
+
if (found === undefined) {
|
|
107
|
+
throw new UnsupportedLocale({ message: `The catalog has no locale ${locale}`, locale });
|
|
108
|
+
}
|
|
109
|
+
current = { locale: found, direction: directionOf(found) };
|
|
110
|
+
listeners.forEach((listener) => listener(current));
|
|
111
|
+
return current;
|
|
112
|
+
},
|
|
113
|
+
message: (id, params = {}, locale) => {
|
|
114
|
+
const compiled = Object.hasOwn(catalog.messages, id) ? catalog.messages[id] : undefined;
|
|
115
|
+
if (compiled === undefined)
|
|
116
|
+
throw new MissingMessage({ message: `The catalog has no message ${id}`, id });
|
|
117
|
+
const target = (locale === undefined ? undefined : supported(locale)) ?? current.locale;
|
|
118
|
+
const text = compiled(params, { locale: target });
|
|
119
|
+
// A compiled message without a translation for the locale falls back to the base locale's text.
|
|
120
|
+
return typeof text === "string" && text !== "" ? text : compiled(params, { locale: catalog.baseLocale });
|
|
121
|
+
},
|
|
122
|
+
formatNumber: (value, numberOptions) => new Intl.NumberFormat(current.locale, numberOptions).format(value),
|
|
123
|
+
formatDate: (epochMs, dateOptions) => new Intl.DateTimeFormat(current.locale, dateOptions).format(epochMs),
|
|
124
|
+
formatList: (items, type = "conjunction") => new Intl.ListFormat(current.locale, { type }).format(items),
|
|
125
|
+
plural: (count) => new Intl.PluralRules(current.locale).select(count),
|
|
126
|
+
subscribe: (listener) => {
|
|
127
|
+
listeners.add(listener);
|
|
128
|
+
return () => listeners.delete(listener);
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* A catalog from plain text per locale (`{ en: { greeting: "Hello, {name}" }, ar: { ... } }`): what a module ships
|
|
134
|
+
* for its own screens' words, without a Paraglide project. `{name}` takes the parameter; a message a locale lacks is
|
|
135
|
+
* empty there (so `makeLocale` falls back to the base locale's text, and `missingTranslations` lists it).
|
|
136
|
+
*/
|
|
137
|
+
export const textCatalog = (baseLocale, texts) => {
|
|
138
|
+
const ids = new Set(Object.values(texts).flatMap((byId) => Object.keys(byId)));
|
|
139
|
+
return {
|
|
140
|
+
baseLocale,
|
|
141
|
+
locales: Object.keys(texts),
|
|
142
|
+
messages: Object.fromEntries([...ids].map((id) => [
|
|
143
|
+
id,
|
|
144
|
+
(params, { locale }) => (texts[locale]?.[id] ?? "").replace(/\{(\w+)\}/g, (whole, name) => name in params ? String(params[name]) : whole),
|
|
145
|
+
])),
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Catalogs composed in order, each later one over the earlier (the shell's, then each module's, then the app's own
|
|
150
|
+
* overrides): a message a later catalog has wins in every locale it translates; where it has no text for a locale,
|
|
151
|
+
* the earlier catalogs' text for it is used. The locales are all of theirs; they must share a base locale.
|
|
152
|
+
*/
|
|
153
|
+
export const composeCatalogs = (...catalogs) => {
|
|
154
|
+
const [first] = catalogs;
|
|
155
|
+
if (first === undefined)
|
|
156
|
+
throw new Error("composeCatalogs needs at least one catalog");
|
|
157
|
+
for (const catalog of catalogs) {
|
|
158
|
+
if (catalog.baseLocale !== first.baseLocale) {
|
|
159
|
+
throw new Error(`Catalogs to compose share a base locale: ${catalog.baseLocale} is not ${first.baseLocale}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const ids = new Set(catalogs.flatMap((catalog) => Object.keys(catalog.messages)));
|
|
163
|
+
const locales = [...new Set(catalogs.flatMap((catalog) => catalog.locales))];
|
|
164
|
+
return {
|
|
165
|
+
baseLocale: first.baseLocale,
|
|
166
|
+
locales,
|
|
167
|
+
messages: Object.fromEntries([...ids].map((id) => [
|
|
168
|
+
id,
|
|
169
|
+
(params, options) => {
|
|
170
|
+
for (let i = catalogs.length - 1; i >= 0; i--) {
|
|
171
|
+
const catalog = catalogs[i];
|
|
172
|
+
const compiled = Object.hasOwn(catalog.messages, id) ? catalog.messages[id] : undefined;
|
|
173
|
+
if (compiled === undefined || !catalog.locales.includes(options.locale))
|
|
174
|
+
continue;
|
|
175
|
+
const text = compiled(params, options);
|
|
176
|
+
if (typeof text === "string" && text !== "")
|
|
177
|
+
return text;
|
|
178
|
+
}
|
|
179
|
+
return "";
|
|
180
|
+
},
|
|
181
|
+
])),
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* The messages with no text of their own in `locale` (they show the base locale's), sorted: what a translator still
|
|
186
|
+
* owes, checked in a test so a new message cannot ship untranslated. Messages are called with `params` (default none:
|
|
187
|
+
* a message that needs parameters is called with each name standing for itself).
|
|
188
|
+
*/
|
|
189
|
+
export const missingTranslations = (catalog, locale) => Object.entries(catalog.messages)
|
|
190
|
+
.filter(([, compiled]) => {
|
|
191
|
+
const params = new Proxy({}, { get: (_, name) => String(name), has: () => true });
|
|
192
|
+
const text = compiled(params, { locale });
|
|
193
|
+
return typeof text !== "string" || text === "";
|
|
194
|
+
})
|
|
195
|
+
.map(([id]) => id)
|
|
196
|
+
.sort();
|
|
197
|
+
//# sourceMappingURL=Locale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Locale.js","sourceRoot":"","sources":["../src/Locale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,cAAc,EACd,iBAAiB,GAIlB,MAAM,mBAAmB,CAAA;AAc1B,8FAA8F;AAC9F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,OAAiF,EACjF,QAA2C,EAC3B,EAAE,CAAC,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,QAAQ,EAAE,MAAM,CAAC,WAAW,CAC1B,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAsC,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAC/G;CACF,CAAC,CAAA;AAEF,iDAAiD;AACjD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AACrH,mHAAmH;AACnH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,IAAI;IAC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C,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IACzC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,EAAE,CAAA;AAChD,CAAC,CAAC;KACD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;KACjB,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The View, Slot and Command shell contracts over the installed modules' manifests: one registry of every
|
|
3
|
+
* view (by id and by route), every slot with its contributions resolved and ordered, and every command-palette
|
|
4
|
+
* entry, with route resolution, deep links and palette search. Pure data over the manifests: no UI framework,
|
|
5
|
+
* no DOM, so the same registry runs in the web shell, the desktop host, a test or the agent.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const shell = shellRegistry(contracts, { origin: "https://app.example.com", scheme: "example" })
|
|
9
|
+
* shell.resolve("/hello/abc?org=acme") // { view: hello.greetings, record: "abc", org: "acme", params: {} }
|
|
10
|
+
* shell.link({ view: "hello.greetings", record: "abc" }).url // https://app.example.com/hello/abc
|
|
11
|
+
* shell.search("greet") // palette matches, best first
|
|
12
|
+
* shell.slot("home.launcher") // contributions from every module, in order
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
import { type AnyModuleContract, type DeepLink, type PaletteEntry, type PaletteMatch, type RouteMatch, type SlotDescriptor, type SlotEntry, type ViewDescriptor, type WrittenLink } from "@eloxiv/contracts";
|
|
16
|
+
export interface ShellRegistryOptions {
|
|
17
|
+
/** The app's web origin (`https://app.example.com`): absolute links use it, and links on it are accepted. */
|
|
18
|
+
readonly origin?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* The app's custom URL scheme (`example`, for `example://open/<path>`), registered by its desktop or mobile
|
|
21
|
+
* host: absolute links use it when there is no origin, and links in it are accepted.
|
|
22
|
+
*/
|
|
23
|
+
readonly scheme?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** The host part of a custom-scheme deep link: `<scheme>://open/<path>`. */
|
|
26
|
+
export declare const SCHEME_HOST = "open";
|
|
27
|
+
export interface ShellRegistry {
|
|
28
|
+
/** Every view, in module installation order, then by id. */
|
|
29
|
+
readonly views: () => ReadonlyArray<ViewDescriptor>;
|
|
30
|
+
readonly view: (id: string) => ViewDescriptor;
|
|
31
|
+
readonly findView: (id: string) => ViewDescriptor | undefined;
|
|
32
|
+
readonly resolve: (path: string) => RouteMatch;
|
|
33
|
+
readonly link: (link: DeepLink) => WrittenLink;
|
|
34
|
+
readonly parseLink: (url: string) => DeepLink;
|
|
35
|
+
readonly slots: () => ReadonlyArray<SlotDescriptor>;
|
|
36
|
+
readonly slot: (id: string) => ReadonlyArray<SlotEntry>;
|
|
37
|
+
readonly commands: () => ReadonlyArray<PaletteEntry>;
|
|
38
|
+
readonly command: (id: string) => PaletteEntry;
|
|
39
|
+
readonly search: (query: string, limit?: number) => ReadonlyArray<PaletteMatch>;
|
|
40
|
+
/** Every installed entity, as `<module>.<entity>` (what ScreenContext references may name). */
|
|
41
|
+
readonly entities: () => ReadonlySet<string>;
|
|
42
|
+
/** The installed modules' names, in installation order. */
|
|
43
|
+
readonly modules: () => ReadonlyArray<string>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The shell registry of an app's installed modules (the generated `eloxiv.modules.ts` contracts). The kernel
|
|
47
|
+
* refuses to start an app whose manifests disagree (`manifestProblems`: duplicate routes, contributions to
|
|
48
|
+
* missing slots, commands opening missing views); the registry also throws on a duplicate id or route, so it
|
|
49
|
+
* never resolves one route two ways.
|
|
50
|
+
*/
|
|
51
|
+
export declare const shellRegistry: (modules: ReadonlyArray<AnyModuleContract>, options?: ShellRegistryOptions) => ShellRegistry;
|
|
52
|
+
//# sourceMappingURL=Navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../src/Navigation.ts"],"names":[],"mapp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