@g9tm/lynxcontrols-foundation 1.4.7 → 1.5.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/dist/.tsbuildinfo +1 -1
- package/dist/culture/strings.d.ts +2 -0
- package/dist/culture/strings.d.ts.map +1 -1
- package/dist/culture/strings.js +8 -4
- package/dist/culture/strings.js.map +1 -1
- package/dist/enums/index.d.ts +5 -1
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.js +2 -1
- package/dist/enums/index.js.map +1 -1
- package/dist/icons/generated/glyph-svg.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/route/address.d.ts +68 -0
- package/dist/route/address.d.ts.map +1 -0
- package/dist/route/address.js +282 -0
- package/dist/route/address.js.map +1 -0
- package/dist/route/catalogue.d.ts +131 -0
- package/dist/route/catalogue.d.ts.map +1 -0
- package/dist/route/catalogue.js +236 -0
- package/dist/route/catalogue.js.map +1 -0
- package/dist/route/index.d.ts +7 -0
- package/dist/route/index.d.ts.map +1 -0
- package/dist/route/index.js +6 -0
- package/dist/route/journey.d.ts +147 -0
- package/dist/route/journey.d.ts.map +1 -0
- package/dist/route/journey.js +345 -0
- package/dist/route/journey.js.map +1 -0
- package/dist/route/resolve.d.ts +43 -0
- package/dist/route/resolve.d.ts.map +1 -0
- package/dist/route/resolve.js +116 -0
- package/dist/route/resolve.js.map +1 -0
- package/dist/route/sink.d.ts +62 -0
- package/dist/route/sink.d.ts.map +1 -0
- package/dist/route/sink.js +11 -0
- package/dist/route/sink.js.map +1 -0
- package/dist/route/view.d.ts +60 -0
- package/dist/route/view.d.ts.map +1 -0
- package/dist/route/view.js +104 -0
- package/dist/route/view.js.map +1 -0
- package/dist/services/contracts.d.ts +6 -0
- package/dist/services/contracts.d.ts.map +1 -1
- package/dist/services/contracts.js.map +1 -1
- package/dist/tokens/generated/metrics.d.ts +4 -0
- package/dist/tokens/generated/metrics.d.ts.map +1 -1
- package/dist/tokens/generated/metrics.js +8 -0
- package/dist/tokens/generated/metrics.js.map +1 -1
- package/dist/tokens/generated/palettes.js.map +1 -1
- package/docs/api.md +72 -1
- package/docs/migration/Core.Controls.Shared.md +5 -0
- package/docs/migration/Core.Localization.md +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { G9Error } from '../errors.js';
|
|
2
|
+
import { type G9Address, type G9Segment } from './address.js';
|
|
3
|
+
/** How the ids of one kind look. */
|
|
4
|
+
export interface G9IdCodec {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
test(id: string): boolean;
|
|
7
|
+
/** The canonical text of a valid id. */
|
|
8
|
+
normalize(id: string): string;
|
|
9
|
+
}
|
|
10
|
+
/** A GUID, canonical in lower case. */
|
|
11
|
+
export declare const g9GuidCodec: G9IdCodec;
|
|
12
|
+
/** A codec from a pattern (and an optional normaliser; default: the id as it is). */
|
|
13
|
+
export declare function g9PatternCodec(name: string, pattern: RegExp, normalize?: (id: string) => string): G9IdCodec;
|
|
14
|
+
/** One view parameter of a place (`;q=…`, `;sort=due.desc`). */
|
|
15
|
+
export interface G9ParamDef {
|
|
16
|
+
/** `text`: free text ≤ maxLength · `enum`: one of `values` · `list`: comma-separated, each in `values` when given · `flag`: `1`. */
|
|
17
|
+
readonly type: 'text' | 'enum' | 'list' | 'flag';
|
|
18
|
+
readonly values?: readonly string[];
|
|
19
|
+
/** For `text` (default 64) and each `list` item (default 96). */
|
|
20
|
+
readonly maxLength?: number;
|
|
21
|
+
}
|
|
22
|
+
/** Why going to an address failed (or why a check refused it). */
|
|
23
|
+
export type G9GoFailure = 'bad-address' | 'unknown-kind' | 'not-allowed-here' | 'not-addressable' | 'not-found' | 'no-permission' | 'not-synced' | 'offline' | 'dirty' | 'blocked' | 'busy' | 'timeout' | 'cancelled' | 'superseded' | 'session-ended' | 'failed';
|
|
24
|
+
/** What a place's guard answers. `message` is shown to the person (their language). */
|
|
25
|
+
export type G9GuardResult = {
|
|
26
|
+
readonly ok: true;
|
|
27
|
+
} | {
|
|
28
|
+
readonly ok: false;
|
|
29
|
+
readonly reason: G9GoFailure;
|
|
30
|
+
readonly message?: string;
|
|
31
|
+
};
|
|
32
|
+
/** How a PERSON reaches a place from its parent: the control to tap there. */
|
|
33
|
+
export interface G9Entry {
|
|
34
|
+
/** The control's anchor id, in the parent place. */
|
|
35
|
+
readonly anchor: string;
|
|
36
|
+
readonly gesture?: 'tap' | 'longPress';
|
|
37
|
+
/** Makes the anchor reachable first (a filter that hides the row, a collapsed section). */
|
|
38
|
+
readonly prepare?: () => void | Promise<void>;
|
|
39
|
+
/** What the preparation does, for the person, when it changes what they see. */
|
|
40
|
+
readonly prepareText?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Text in both languages (the catalogue's descriptions, journeys). */
|
|
43
|
+
export interface G9BilingualText {
|
|
44
|
+
readonly fa: string;
|
|
45
|
+
readonly en: string;
|
|
46
|
+
}
|
|
47
|
+
/** One kind of place. `Ctx` is what the app hands every callback (its session, services…). */
|
|
48
|
+
export interface G9PlaceDef<Ctx = unknown> {
|
|
49
|
+
readonly kind: string;
|
|
50
|
+
/** The allowed variants (`task.sampling`, `task.transfer`), or `'*'` for any. Absent = no variant. */
|
|
51
|
+
readonly variants?: readonly string[] | '*';
|
|
52
|
+
/** How the id looks. Absent = a singleton place: it never has an id. */
|
|
53
|
+
readonly id?: G9IdCodec;
|
|
54
|
+
/** Logical parents: kinds, `''` for the root, or `'*'` = a floating place (it may sit on any place, also the root). */
|
|
55
|
+
readonly parents: readonly string[] | '*';
|
|
56
|
+
/** The parent put in when the ancestors must be made up (a singleton chain to the root). Default: none. */
|
|
57
|
+
readonly defaultParent?: string;
|
|
58
|
+
readonly params?: Readonly<Record<string, G9ParamDef>>;
|
|
59
|
+
/** What this KIND is, for the general address, manifests and reports. */
|
|
60
|
+
readonly describe: G9BilingualText;
|
|
61
|
+
/** Breadcrumb text in the current language; may read the entity's own name through ctx. Never empty. */
|
|
62
|
+
title?(segment: G9Segment, ctx: Ctx): string;
|
|
63
|
+
/** Checks before anything is opened or closed: permission, the entity is on this device. */
|
|
64
|
+
guard?(segment: G9Segment, path: readonly G9Segment[], ctx: Ctx): G9GuardResult | Promise<G9GuardResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Opens the place the way the UI does; the router waits for its declaration. `false` = it could not open and the app
|
|
67
|
+
* already told the person why (a missing permission, data that never arrived): the go stops there at once. The wait
|
|
68
|
+
* for `open` itself counts toward `openTimeoutMs` — an `open` that never settles cannot hold the router.
|
|
69
|
+
*/
|
|
70
|
+
open?(segment: G9Segment, path: readonly G9Segment[], ctx: Ctx): void | boolean | Promise<void | boolean>;
|
|
71
|
+
/** How a person gets here from the parent (walk / demo). null = no visible entry: the router opens it itself. */
|
|
72
|
+
entry?(segment: G9Segment, path: readonly G9Segment[], ctx: Ctx): G9Entry | null | Promise<G9Entry | null>;
|
|
73
|
+
/** How long the router waits, from calling `open`, for the declaration (ms). Default 8000. */
|
|
74
|
+
readonly openTimeoutMs?: number;
|
|
75
|
+
}
|
|
76
|
+
/** The kinds the library adds to every catalogue: an undeclared sheet, map mode or page stays visible in the address. */
|
|
77
|
+
export declare const g9GenericKinds: readonly string[];
|
|
78
|
+
/** A structural check of one address against the catalogue. */
|
|
79
|
+
export type G9AddressCheck = {
|
|
80
|
+
readonly ok: true;
|
|
81
|
+
readonly address: G9Address;
|
|
82
|
+
} | {
|
|
83
|
+
readonly ok: false;
|
|
84
|
+
readonly reason: G9GoFailure;
|
|
85
|
+
readonly at: number;
|
|
86
|
+
readonly message: string;
|
|
87
|
+
};
|
|
88
|
+
/** The places of an app, validated: definitions, parents, made-up ancestors, structural checks of an address. */
|
|
89
|
+
export interface G9Catalogue<Ctx = unknown> {
|
|
90
|
+
def(kind: string): G9PlaceDef<Ctx> | undefined;
|
|
91
|
+
kinds(): readonly string[];
|
|
92
|
+
/** A short hash of the structure (kinds, variants, ids, parents): a snapshot is refused across a different one. */
|
|
93
|
+
readonly hash: string;
|
|
94
|
+
/** Is `kind` allowed directly under `parentKind` (`''` = the root)? */
|
|
95
|
+
allowsParent(kind: string, parentKind: string): boolean;
|
|
96
|
+
/** The made-up ancestors of a kind (root first), through `defaultParent`; null when it does not reach the root. */
|
|
97
|
+
defaultAncestors(kind: string): readonly G9Segment[] | null;
|
|
98
|
+
/** Validates and canonicalises a UNIQUE address (ids through their codecs). */
|
|
99
|
+
check(address: G9Address): G9AddressCheck;
|
|
100
|
+
/** The breadcrumb of one segment: the def's title, else its description in `language`. */
|
|
101
|
+
title(segment: G9Segment, ctx: Ctx, language: 'fa' | 'en'): string;
|
|
102
|
+
}
|
|
103
|
+
/** A catalogue that cannot work (a developer error: raised at start-up, never at run time). */
|
|
104
|
+
export declare class G9CatalogueError extends G9Error {
|
|
105
|
+
constructor(message: string);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Builds a catalogue and validates it: unique kinds, names in the grammar, known parents, a `defaultParent` that is a
|
|
109
|
+
* parent and leads to the root through singletons, no cycles. The generic kinds are added.
|
|
110
|
+
* @throws {G9CatalogueError} on any inconsistency.
|
|
111
|
+
*/
|
|
112
|
+
export declare function createCatalogue<Ctx = unknown>(defs: ReadonlyArray<G9PlaceDef<Ctx>>): G9Catalogue<Ctx>;
|
|
113
|
+
/** One kind as a manifest lists it (an assistant's or a QA tool's view of the catalogue). */
|
|
114
|
+
export interface G9CatalogueManifestEntry {
|
|
115
|
+
readonly kind: string;
|
|
116
|
+
readonly variants: readonly string[] | '*' | null;
|
|
117
|
+
readonly id: string | null;
|
|
118
|
+
readonly parents: readonly string[] | '*';
|
|
119
|
+
readonly params: Readonly<Record<string, {
|
|
120
|
+
readonly type: G9ParamDef['type'];
|
|
121
|
+
readonly values?: readonly string[];
|
|
122
|
+
}>>;
|
|
123
|
+
readonly describe: string;
|
|
124
|
+
readonly opens: boolean;
|
|
125
|
+
readonly reachable: boolean;
|
|
126
|
+
/** An example general address of this kind (through its default ancestors), or null. */
|
|
127
|
+
readonly example: string | null;
|
|
128
|
+
}
|
|
129
|
+
/** The catalogue as data (JSON-safe), in one language. */
|
|
130
|
+
export declare function catalogueManifest<Ctx>(catalogue: G9Catalogue<Ctx>, language: 'fa' | 'en'): readonly G9CatalogueManifestEntry[];
|
|
131
|
+
//# sourceMappingURL=catalogue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue.d.ts","sourceRoot":"","sources":["../../src/route/catalogue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAwB,MAAM,WAAW,CAAC;AAOjF,oCAAoC;AACpC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,wCAAwC;IACxC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAID,uCAAuC;AACvC,eAAO,MAAM,WAAW,EAAE,SAIxB,CAAC;AAEH,qFAAqF;AACrF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAmB,GAC7C,SAAS,CAEX;AAED,gEAAgE;AAChE,MAAM,WAAW,UAAU;IACzB,oIAAoI;IACpI,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,kEAAkE;AAClE,MAAM,MAAM,WAAW,GACnB,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB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,EAAE,GAAG,GAAG,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC,CAAC;IACtH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,wFAAwF;IACxF,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,0DAA0D;AAC1D,wBAAgB,iBAAiB,CAAC,GAAG,EACnC,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,EAC3B,QAAQ,EAAE,IAAI,GAAG,IAAI,GACpB,SAAS,wBAAwB,EAAE,CAoBrC"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { G9Error } from "../errors.js";
|
|
2
|
+
import { g9AddressLimits, seg } from "./address.js";
|
|
3
|
+
const GUID = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
4
|
+
const g9GuidCodec = Object.freeze({
|
|
5
|
+
name: 'guid',
|
|
6
|
+
test: (id)=>GUID.test(id),
|
|
7
|
+
normalize: (id)=>id.toLowerCase()
|
|
8
|
+
});
|
|
9
|
+
function g9PatternCodec(name, pattern, normalize = (id)=>id) {
|
|
10
|
+
return Object.freeze({
|
|
11
|
+
name,
|
|
12
|
+
test: (id)=>pattern.test(id),
|
|
13
|
+
normalize
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const g9GenericKinds = Object.freeze([
|
|
17
|
+
'sheet',
|
|
18
|
+
'mode',
|
|
19
|
+
'page'
|
|
20
|
+
]);
|
|
21
|
+
class G9CatalogueError extends G9Error {
|
|
22
|
+
constructor(message){
|
|
23
|
+
super('route-catalogue', message);
|
|
24
|
+
this.name = 'G9CatalogueError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const NAME = /^[a-z][a-z0-9-]*$/;
|
|
28
|
+
function genericDef(kind) {
|
|
29
|
+
const describe = {
|
|
30
|
+
sheet: {
|
|
31
|
+
fa: 'برگه',
|
|
32
|
+
en: 'Sheet'
|
|
33
|
+
},
|
|
34
|
+
mode: {
|
|
35
|
+
fa: 'حالت نقشه',
|
|
36
|
+
en: 'Map mode'
|
|
37
|
+
},
|
|
38
|
+
page: {
|
|
39
|
+
fa: 'صفحه',
|
|
40
|
+
en: 'Page'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
kind,
|
|
45
|
+
variants: '*',
|
|
46
|
+
parents: '*',
|
|
47
|
+
describe: describe[kind]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function fnv1a(text) {
|
|
51
|
+
let h = 0x811c9dc5;
|
|
52
|
+
for(let i = 0; i < text.length; i++){
|
|
53
|
+
h ^= text.charCodeAt(i);
|
|
54
|
+
h = Math.imul(h, 0x01000193) >>> 0;
|
|
55
|
+
}
|
|
56
|
+
return h.toString(16).padStart(8, '0');
|
|
57
|
+
}
|
|
58
|
+
function checkParam(def, value) {
|
|
59
|
+
switch(def.type){
|
|
60
|
+
case 'flag':
|
|
61
|
+
return '1' === value;
|
|
62
|
+
case 'enum':
|
|
63
|
+
return !!def.values && def.values.indexOf(value) >= 0;
|
|
64
|
+
case 'list':
|
|
65
|
+
return value.split(',').every((item)=>{
|
|
66
|
+
var _def_maxLength;
|
|
67
|
+
return '' !== item && item.length <= (null != (_def_maxLength = def.maxLength) ? _def_maxLength : 96) && (!def.values || def.values.indexOf(item) >= 0);
|
|
68
|
+
});
|
|
69
|
+
default:
|
|
70
|
+
var _def_maxLength;
|
|
71
|
+
return value.length <= (null != (_def_maxLength = def.maxLength) ? _def_maxLength : 64);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function createCatalogue(defs) {
|
|
75
|
+
const map = new Map();
|
|
76
|
+
for (const def of defs){
|
|
77
|
+
if (!NAME.test(def.kind) || def.kind.length > g9AddressLimits.kind) throw new G9CatalogueError(`Kind "${def.kind}" is not a valid name.`);
|
|
78
|
+
if (map.has(def.kind) || g9GenericKinds.indexOf(def.kind) >= 0) throw new G9CatalogueError(`Kind "${def.kind}" is defined twice (or is a generic kind).`);
|
|
79
|
+
if (Array.isArray(def.variants)) {
|
|
80
|
+
for (const v of def.variants)if (!NAME.test(v)) throw new G9CatalogueError(`Variant "${def.kind}.${v}" is not a valid name.`);
|
|
81
|
+
}
|
|
82
|
+
if (def.params) {
|
|
83
|
+
for (const p of Object.keys(def.params))if (!NAME.test(p)) throw new G9CatalogueError(`Parameter "${def.kind};${p}" is not a valid name.`);
|
|
84
|
+
}
|
|
85
|
+
map.set(def.kind, def);
|
|
86
|
+
}
|
|
87
|
+
for (const kind of g9GenericKinds)map.set(kind, genericDef(kind));
|
|
88
|
+
for (const def of map.values())if ('*' !== def.parents) {
|
|
89
|
+
for (const parent of def.parents)if ('' !== parent && !map.has(parent)) throw new G9CatalogueError(`Kind "${def.kind}" names an unknown parent "${parent}".`);
|
|
90
|
+
}
|
|
91
|
+
const ancestors = new Map();
|
|
92
|
+
function chain(kind, seen) {
|
|
93
|
+
const cached = ancestors.get(kind);
|
|
94
|
+
if (void 0 !== cached) return cached;
|
|
95
|
+
if (seen.indexOf(kind) >= 0) throw new G9CatalogueError(`defaultParent cycle: ${[
|
|
96
|
+
...seen,
|
|
97
|
+
kind
|
|
98
|
+
].join(' → ')}.`);
|
|
99
|
+
const def = map.get(kind);
|
|
100
|
+
let result = null;
|
|
101
|
+
if ('*' !== def.parents && def.parents.indexOf('') >= 0) result = [];
|
|
102
|
+
else if (void 0 !== def.defaultParent) {
|
|
103
|
+
const parent = map.get(def.defaultParent);
|
|
104
|
+
if (!parent) throw new G9CatalogueError(`Kind "${kind}" has an unknown defaultParent "${def.defaultParent}".`);
|
|
105
|
+
if ('*' !== def.parents && def.parents.indexOf(def.defaultParent) < 0) throw new G9CatalogueError(`Kind "${kind}": defaultParent "${def.defaultParent}" is not one of its parents.`);
|
|
106
|
+
if (parent.id) throw new G9CatalogueError(`Kind "${kind}": defaultParent "${def.defaultParent}" has an id, so it cannot be made up.`);
|
|
107
|
+
const up = chain(def.defaultParent, [
|
|
108
|
+
...seen,
|
|
109
|
+
kind
|
|
110
|
+
]);
|
|
111
|
+
result = up ? [
|
|
112
|
+
...up,
|
|
113
|
+
seg(def.defaultParent)
|
|
114
|
+
] : null;
|
|
115
|
+
if (!up) throw new G9CatalogueError(`Kind "${kind}": defaultParent "${def.defaultParent}" does not lead to the root.`);
|
|
116
|
+
}
|
|
117
|
+
ancestors.set(kind, result);
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
for (const kind of map.keys())chain(kind, []);
|
|
121
|
+
const kinds = Array.from(map.keys()).sort();
|
|
122
|
+
const hash = fnv1a(kinds.map((k)=>{
|
|
123
|
+
var _d_variants, _ref;
|
|
124
|
+
var _d_id;
|
|
125
|
+
const d = map.get(k);
|
|
126
|
+
const variants = '*' === d.variants ? '*' : (null != (_d_variants = d.variants) ? _d_variants : []).slice().sort().join(',');
|
|
127
|
+
const parents = '*' === d.parents ? '*' : d.parents.slice().sort().join(',');
|
|
128
|
+
return `${k}|${variants}|${null != (_ref = null == (_d_id = d.id) ? void 0 : _d_id.name) ? _ref : ''}|${parents}`;
|
|
129
|
+
}).join(';'));
|
|
130
|
+
const allowsParent = (kind, parentKind)=>{
|
|
131
|
+
const def = map.get(kind);
|
|
132
|
+
if (!def) return false;
|
|
133
|
+
if ('*' === def.parents) return true;
|
|
134
|
+
return def.parents.indexOf(parentKind) >= 0;
|
|
135
|
+
};
|
|
136
|
+
return {
|
|
137
|
+
def: (kind)=>map.get(kind),
|
|
138
|
+
kinds: ()=>kinds,
|
|
139
|
+
hash,
|
|
140
|
+
allowsParent,
|
|
141
|
+
defaultAncestors: (kind)=>{
|
|
142
|
+
var _ancestors_get;
|
|
143
|
+
return map.has(kind) ? null != (_ancestors_get = ancestors.get(kind)) ? _ancestors_get : null : null;
|
|
144
|
+
},
|
|
145
|
+
check (address) {
|
|
146
|
+
const out = [];
|
|
147
|
+
for(let i = 0; i < address.segments.length; i++){
|
|
148
|
+
var _s_variant, _s_params;
|
|
149
|
+
const s = address.segments[i];
|
|
150
|
+
const def = map.get(s.kind);
|
|
151
|
+
const refuse = (reason, message)=>({
|
|
152
|
+
ok: false,
|
|
153
|
+
reason,
|
|
154
|
+
at: i,
|
|
155
|
+
message
|
|
156
|
+
});
|
|
157
|
+
if (!def) return refuse('unknown-kind', `"${s.kind}" is not a place of this app.`);
|
|
158
|
+
if (void 0 !== s.variant) {
|
|
159
|
+
if (void 0 === def.variants) return refuse('bad-address', `"${s.kind}" takes no variant.`);
|
|
160
|
+
if ('*' !== def.variants && def.variants.indexOf(s.variant) < 0) return refuse('bad-address', `"${s.kind}.${s.variant}" is not a known variant.`);
|
|
161
|
+
}
|
|
162
|
+
let id = s.id;
|
|
163
|
+
if (def.id) {
|
|
164
|
+
if (!id) return refuse('bad-address', `"${s.kind}" needs an id.`);
|
|
165
|
+
if (!def.id.test(id)) return refuse('bad-address', `"${id}" is not a ${def.id.name} (${s.kind}).`);
|
|
166
|
+
id = def.id.normalize(id);
|
|
167
|
+
} else if (id) return refuse('bad-address', `"${s.kind}" takes no id.`);
|
|
168
|
+
if (s.params) for (const name of Object.keys(s.params)){
|
|
169
|
+
var _def_params;
|
|
170
|
+
const p = null == (_def_params = def.params) ? void 0 : _def_params[name];
|
|
171
|
+
if (!p) return refuse('bad-address', `"${s.kind}" has no parameter "${name}".`);
|
|
172
|
+
if (!checkParam(p, s.params[name])) return refuse('bad-address', `"${s.kind};${name}" has a value it does not take.`);
|
|
173
|
+
}
|
|
174
|
+
const parent = 0 === i ? '' : address.segments[i - 1].kind;
|
|
175
|
+
if (!allowsParent(s.kind, parent)) return refuse('not-allowed-here', `"${s.kind}" cannot sit ${0 === i ? 'at the root' : `under "${parent}"`}.`);
|
|
176
|
+
out.push(seg(s.kind, null != id ? id : null, null != (_s_variant = s.variant) ? _s_variant : null, null != (_s_params = s.params) ? _s_params : null));
|
|
177
|
+
}
|
|
178
|
+
const canonical = void 0 === address.target ? {
|
|
179
|
+
segments: out
|
|
180
|
+
} : {
|
|
181
|
+
segments: out,
|
|
182
|
+
target: address.target
|
|
183
|
+
};
|
|
184
|
+
return {
|
|
185
|
+
ok: true,
|
|
186
|
+
address: canonical
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
title (segment, ctx, language) {
|
|
190
|
+
const def = map.get(segment.kind);
|
|
191
|
+
if (!def) return segment.kind;
|
|
192
|
+
let text = '';
|
|
193
|
+
try {
|
|
194
|
+
var _ref;
|
|
195
|
+
var _def_title;
|
|
196
|
+
text = null != (_ref = null == (_def_title = def.title) ? void 0 : _def_title.call(def, segment, ctx)) ? _ref : '';
|
|
197
|
+
} catch {
|
|
198
|
+
text = '';
|
|
199
|
+
}
|
|
200
|
+
return text.trim() || def.describe[language];
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function catalogueManifest(catalogue, language) {
|
|
205
|
+
return catalogue.kinds().map((kind)=>{
|
|
206
|
+
var _def_params, _def_variants, _ref;
|
|
207
|
+
var _def_id;
|
|
208
|
+
const def = catalogue.def(kind);
|
|
209
|
+
const params = {};
|
|
210
|
+
for (const [name, p] of Object.entries(null != (_def_params = def.params) ? _def_params : {}))params[name] = p.values ? {
|
|
211
|
+
type: p.type,
|
|
212
|
+
values: p.values
|
|
213
|
+
} : {
|
|
214
|
+
type: p.type
|
|
215
|
+
};
|
|
216
|
+
const up = catalogue.defaultAncestors(kind);
|
|
217
|
+
const example = up ? `/${[
|
|
218
|
+
...up.map((s)=>s.kind),
|
|
219
|
+
kind
|
|
220
|
+
].join('/')}` : null;
|
|
221
|
+
return {
|
|
222
|
+
kind,
|
|
223
|
+
variants: null != (_def_variants = def.variants) ? _def_variants : null,
|
|
224
|
+
id: null != (_ref = null == (_def_id = def.id) ? void 0 : _def_id.name) ? _ref : null,
|
|
225
|
+
parents: def.parents,
|
|
226
|
+
params,
|
|
227
|
+
describe: def.describe[language],
|
|
228
|
+
opens: 'function' == typeof def.open,
|
|
229
|
+
reachable: 'function' == typeof def.entry,
|
|
230
|
+
example
|
|
231
|
+
};
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
export { G9CatalogueError, catalogueManifest, createCatalogue, g9GenericKinds, g9GuidCodec, g9PatternCodec };
|
|
235
|
+
|
|
236
|
+
//# sourceMappingURL=catalogue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route/catalogue.js","sources":["../../src/route/catalogue.ts"],"sourcesContent":["import { G9Error } from '../errors';\nimport { type G9Address, type G9Segment, g9AddressLimits, seg } from './address';\n\n// The catalogue of places: which kinds of place an app has, where each may sit (its logical parents), how its id looks,\n// which view parameters it takes, and — supplied by the app — how to check, open and reach one. The router and every\n// consumer (QA, tester reports, links, an assistant) read the same catalogue; the library itself knows no kind but the\n// three generic ones (`sheet`, `mode`, `page`) that keep an undeclared overlay visible in the address.\n\n/** How the ids of one kind look. */\nexport interface G9IdCodec {\n readonly name: string;\n test(id: string): boolean;\n /** The canonical text of a valid id. */\n normalize(id: string): string;\n}\n\nconst GUID = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;\n\n/** A GUID, canonical in lower case. */\nexport const g9GuidCodec: G9IdCodec = Object.freeze({\n name: 'guid',\n test: (id: string) => GUID.test(id),\n normalize: (id: string) => id.toLowerCase(),\n});\n\n/** A codec from a pattern (and an optional normaliser; default: the id as it is). */\nexport function g9PatternCodec(\n name: string,\n pattern: RegExp,\n normalize: (id: string) => string = (id) => id,\n): G9IdCodec {\n return Object.freeze({ name, test: (id: string) => pattern.test(id), normalize });\n}\n\n/** One view parameter of a place (`;q=…`, `;sort=due.desc`). */\nexport interface G9ParamDef {\n /** `text`: free text ≤ maxLength · `enum`: one of `values` · `list`: comma-separated, each in `values` when given · `flag`: `1`. */\n readonly type: 'text' | 'enum' | 'list' | 'flag';\n readonly values?: readonly string[];\n /** For `text` (default 64) and each `list` item (default 96). */\n readonly maxLength?: number;\n}\n\n/** Why going to an address failed (or why a check refused it). */\nexport type G9GoFailure =\n | 'bad-address'\n | 'unknown-kind'\n | 'not-allowed-here'\n | 'not-addressable'\n | 'not-found'\n | 'no-permission'\n | 'not-synced'\n | 'offline'\n | 'dirty'\n | 'blocked'\n | 'busy'\n | 'timeout'\n | 'cancelled'\n | 'superseded'\n | 'session-ended'\n | 'failed';\n\n/** What a place's guard answers. `message` is shown to the person (their language). */\nexport type G9GuardResult =\n | { readonly ok: true }\n | { readonly ok: false; readonly reason: G9GoFailure; readonly message?: string };\n\n/** How a PERSON reaches a place from its parent: the control to tap there. */\nexport interface G9Entry {\n /** The control's anchor id, in the parent place. */\n readonly anchor: string;\n readonly gesture?: 'tap' | 'longPress';\n /** Makes the anchor reachable first (a filter that hides the row, a collapsed section). */\n readonly prepare?: () => void | Promise<void>;\n /** What the preparation does, for the person, when it changes what they see. */\n readonly prepareText?: string;\n}\n\n/** Text in both languages (the catalogue's descriptions, journeys). */\nexport interface G9BilingualText {\n readonly fa: string;\n readonly en: string;\n}\n\n/** One kind of place. `Ctx` is what the app hands every callback (its session, services…). */\nexport interface G9PlaceDef<Ctx = unknown> {\n readonly kind: string;\n /** The allowed variants (`task.sampling`, `task.transfer`), or `'*'` for any. Absent = no variant. */\n readonly variants?: readonly string[] | '*';\n /** How the id looks. Absent = a singleton place: it never has an id. */\n readonly id?: G9IdCodec;\n /** Logical parents: kinds, `''` for the root, or `'*'` = a floating place (it may sit on any place, also the root). */\n readonly parents: readonly string[] | '*';\n /** The parent put in when the ancestors must be made up (a singleton chain to the root). Default: none. */\n readonly defaultParent?: string;\n readonly params?: Readonly<Record<string, G9ParamDef>>;\n /** What this KIND is, for the general address, manifests and reports. */\n readonly describe: G9BilingualText;\n /** Breadcrumb text in the current language; may read the entity's own name through ctx. Never empty. */\n title?(segment: G9Segment, ctx: Ctx): string;\n /** Checks before anything is opened or closed: permission, the entity is on this device. */\n guard?(segment: G9Segment, path: readonly G9Segment[], ctx: Ctx): G9GuardResult | Promise<G9GuardResult>;\n /**\n * Opens the place the way the UI does; the router waits for its declaration. `false` = it could not open and the app\n * already told the person why (a missing permission, data that never arrived): the go stops there at once. The wait\n * for `open` itself counts toward `openTimeoutMs` — an `open` that never settles cannot hold the router.\n */\n open?(segment: G9Segment, path: readonly G9Segment[], ctx: Ctx): void | boolean | Promise<void | boolean>;\n /** How a person gets here from the parent (walk / demo). null = no visible entry: the router opens it itself. */\n entry?(segment: G9Segment, path: readonly G9Segment[], ctx: Ctx): G9Entry | null | Promise<G9Entry | null>;\n /** How long the router waits, from calling `open`, for the declaration (ms). Default 8000. */\n readonly openTimeoutMs?: number;\n}\n\n/** The kinds the library adds to every catalogue: an undeclared sheet, map mode or page stays visible in the address. */\nexport const g9GenericKinds: readonly string[] = Object.freeze(['sheet', 'mode', 'page']);\n\n/** A structural check of one address against the catalogue. */\nexport type G9AddressCheck =\n | { readonly ok: true; readonly address: G9Address }\n | { readonly ok: false; readonly reason: G9GoFailure; readonly at: number; readonly message: string };\n\n/** The places of an app, validated: definitions, parents, made-up ancestors, structural checks of an address. */\nexport interface G9Catalogue<Ctx = unknown> {\n def(kind: string): G9PlaceDef<Ctx> | undefined;\n kinds(): readonly string[];\n /** A short hash of the structure (kinds, variants, ids, parents): a snapshot is refused across a different one. */\n readonly hash: string;\n /** Is `kind` allowed directly under `parentKind` (`''` = the root)? */\n allowsParent(kind: string, parentKind: string): boolean;\n /** The made-up ancestors of a kind (root first), through `defaultParent`; null when it does not reach the root. */\n defaultAncestors(kind: string): readonly G9Segment[] | null;\n /** Validates and canonicalises a UNIQUE address (ids through their codecs). */\n check(address: G9Address): G9AddressCheck;\n /** The breadcrumb of one segment: the def's title, else its description in `language`. */\n title(segment: G9Segment, ctx: Ctx, language: 'fa' | 'en'): string;\n}\n\n/** A catalogue that cannot work (a developer error: raised at start-up, never at run time). */\nexport class G9CatalogueError extends G9Error {\n constructor(message: string) {\n super('route-catalogue', message);\n this.name = 'G9CatalogueError';\n }\n}\n\nconst NAME = /^[a-z][a-z0-9-]*$/;\n\nfunction genericDef<Ctx>(kind: string): G9PlaceDef<Ctx> {\n const describe: Record<string, G9BilingualText> = {\n sheet: { fa: 'برگه', en: 'Sheet' },\n mode: { fa: 'حالت نقشه', en: 'Map mode' },\n page: { fa: 'صفحه', en: 'Page' },\n };\n return { kind, variants: '*', parents: '*', describe: describe[kind] as G9BilingualText };\n}\n\nfunction fnv1a(text: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < text.length; i++) {\n h ^= text.charCodeAt(i);\n h = Math.imul(h, 0x01000193) >>> 0;\n }\n return h.toString(16).padStart(8, '0');\n}\n\nfunction checkParam(def: G9ParamDef, value: string): boolean {\n switch (def.type) {\n case 'flag':\n return value === '1';\n case 'enum':\n return !!def.values && def.values.indexOf(value) >= 0;\n case 'list':\n return value\n .split(',')\n .every(\n (item) =>\n item !== '' && item.length <= (def.maxLength ?? 96) && (!def.values || def.values.indexOf(item) >= 0),\n );\n default:\n return value.length <= (def.maxLength ?? 64);\n }\n}\n\n/**\n * Builds a catalogue and validates it: unique kinds, names in the grammar, known parents, a `defaultParent` that is a\n * parent and leads to the root through singletons, no cycles. The generic kinds are added.\n * @throws {G9CatalogueError} on any inconsistency.\n */\nexport function createCatalogue<Ctx = unknown>(defs: ReadonlyArray<G9PlaceDef<Ctx>>): G9Catalogue<Ctx> {\n const map = new Map<string, G9PlaceDef<Ctx>>();\n for (const def of defs) {\n if (!NAME.test(def.kind) || def.kind.length > g9AddressLimits.kind)\n throw new G9CatalogueError(`Kind \"${def.kind}\" is not a valid name.`);\n if (map.has(def.kind) || g9GenericKinds.indexOf(def.kind) >= 0)\n throw new G9CatalogueError(`Kind \"${def.kind}\" is defined twice (or is a generic kind).`);\n if (Array.isArray(def.variants))\n for (const v of def.variants)\n if (!NAME.test(v)) throw new G9CatalogueError(`Variant \"${def.kind}.${v}\" is not a valid name.`);\n if (def.params)\n for (const p of Object.keys(def.params))\n if (!NAME.test(p)) throw new G9CatalogueError(`Parameter \"${def.kind};${p}\" is not a valid name.`);\n map.set(def.kind, def);\n }\n for (const kind of g9GenericKinds) map.set(kind, genericDef<Ctx>(kind));\n\n for (const def of map.values()) {\n if (def.parents === '*') continue;\n for (const parent of def.parents) {\n if (parent !== '' && !map.has(parent))\n throw new G9CatalogueError(`Kind \"${def.kind}\" names an unknown parent \"${parent}\".`);\n }\n }\n\n const ancestors = new Map<string, readonly G9Segment[] | null>();\n function chain(kind: string, seen: readonly string[]): readonly G9Segment[] | null {\n const cached = ancestors.get(kind);\n if (cached !== undefined) return cached;\n if (seen.indexOf(kind) >= 0) throw new G9CatalogueError(`defaultParent cycle: ${[...seen, kind].join(' → ')}.`);\n const def = map.get(kind) as G9PlaceDef<Ctx>;\n let result: readonly G9Segment[] | null = null;\n if (def.parents !== '*' && def.parents.indexOf('') >= 0) result = [];\n else if (def.defaultParent !== undefined) {\n const parent = map.get(def.defaultParent);\n if (!parent) throw new G9CatalogueError(`Kind \"${kind}\" has an unknown defaultParent \"${def.defaultParent}\".`);\n if (def.parents !== '*' && def.parents.indexOf(def.defaultParent) < 0) {\n throw new G9CatalogueError(`Kind \"${kind}\": defaultParent \"${def.defaultParent}\" is not one of its parents.`);\n }\n if (parent.id)\n throw new G9CatalogueError(\n `Kind \"${kind}\": defaultParent \"${def.defaultParent}\" has an id, so it cannot be made up.`,\n );\n const up = chain(def.defaultParent, [...seen, kind]);\n result = up ? [...up, seg(def.defaultParent)] : null;\n if (!up)\n throw new G9CatalogueError(`Kind \"${kind}\": defaultParent \"${def.defaultParent}\" does not lead to the root.`);\n }\n ancestors.set(kind, result);\n return result;\n }\n for (const kind of map.keys()) chain(kind, []);\n\n const kinds = Array.from(map.keys()).sort();\n const hash = fnv1a(\n kinds\n .map((k) => {\n const d = map.get(k) as G9PlaceDef<Ctx>;\n const variants = d.variants === '*' ? '*' : (d.variants ?? []).slice().sort().join(',');\n const parents = d.parents === '*' ? '*' : d.parents.slice().sort().join(',');\n return `${k}|${variants}|${d.id?.name ?? ''}|${parents}`;\n })\n .join(';'),\n );\n\n const allowsParent = (kind: string, parentKind: string): boolean => {\n const def = map.get(kind);\n if (!def) return false;\n if (def.parents === '*') return true;\n return def.parents.indexOf(parentKind) >= 0;\n };\n\n return {\n def: (kind) => map.get(kind),\n kinds: () => kinds,\n hash,\n allowsParent,\n defaultAncestors: (kind) => (map.has(kind) ? (ancestors.get(kind) ?? null) : null),\n check(address) {\n const out: G9Segment[] = [];\n for (let i = 0; i < address.segments.length; i++) {\n const s = address.segments[i] as G9Segment;\n const def = map.get(s.kind);\n const refuse = (reason: G9GoFailure, message: string): G9AddressCheck => ({\n ok: false,\n reason,\n at: i,\n message,\n });\n if (!def) return refuse('unknown-kind', `\"${s.kind}\" is not a place of this app.`);\n if (s.variant !== undefined) {\n if (def.variants === undefined) return refuse('bad-address', `\"${s.kind}\" takes no variant.`);\n if (def.variants !== '*' && def.variants.indexOf(s.variant) < 0)\n return refuse('bad-address', `\"${s.kind}.${s.variant}\" is not a known variant.`);\n }\n let id = s.id;\n if (def.id) {\n if (!id) return refuse('bad-address', `\"${s.kind}\" needs an id.`);\n if (!def.id.test(id)) return refuse('bad-address', `\"${id}\" is not a ${def.id.name} (${s.kind}).`);\n id = def.id.normalize(id);\n } else if (id) return refuse('bad-address', `\"${s.kind}\" takes no id.`);\n if (s.params) {\n for (const name of Object.keys(s.params)) {\n const p = def.params?.[name];\n if (!p) return refuse('bad-address', `\"${s.kind}\" has no parameter \"${name}\".`);\n if (!checkParam(p, s.params[name] as string))\n return refuse('bad-address', `\"${s.kind};${name}\" has a value it does not take.`);\n }\n }\n const parent = i === 0 ? '' : (address.segments[i - 1] as G9Segment).kind;\n if (!allowsParent(s.kind, parent))\n return refuse('not-allowed-here', `\"${s.kind}\" cannot sit ${i === 0 ? 'at the root' : `under \"${parent}\"`}.`);\n out.push(seg(s.kind, id ?? null, s.variant ?? null, s.params ?? null));\n }\n const canonical: G9Address =\n address.target === undefined ? { segments: out } : { segments: out, target: address.target };\n return { ok: true, address: canonical };\n },\n title(segment, ctx, language) {\n const def = map.get(segment.kind);\n if (!def) return segment.kind;\n let text = '';\n try {\n text = def.title?.(segment, ctx) ?? '';\n } catch {\n text = '';\n }\n return text.trim() || def.describe[language];\n },\n };\n}\n\n/** One kind as a manifest lists it (an assistant's or a QA tool's view of the catalogue). */\nexport interface G9CatalogueManifestEntry {\n readonly kind: string;\n readonly variants: readonly string[] | '*' | null;\n readonly id: string | null;\n readonly parents: readonly string[] | '*';\n readonly params: Readonly<Record<string, { readonly type: G9ParamDef['type']; readonly values?: readonly string[] }>>;\n readonly describe: string;\n readonly opens: boolean;\n readonly reachable: boolean;\n /** An example general address of this kind (through its default ancestors), or null. */\n readonly example: string | null;\n}\n\n/** The catalogue as data (JSON-safe), in one language. */\nexport function catalogueManifest<Ctx>(\n catalogue: G9Catalogue<Ctx>,\n language: 'fa' | 'en',\n): readonly G9CatalogueManifestEntry[] {\n return catalogue.kinds().map((kind) => {\n const def = catalogue.def(kind) as G9PlaceDef<Ctx>;\n const params: Record<string, { type: G9ParamDef['type']; values?: readonly string[] }> = {};\n for (const [name, p] of Object.entries(def.params ?? {}))\n params[name] = p.values ? { type: p.type, values: p.values } : { type: p.type };\n const up = catalogue.defaultAncestors(kind);\n const example = up ? `/${[...up.map((s) => s.kind), kind].join('/')}` : null;\n return {\n kind,\n variants: def.variants ?? null,\n id: def.id?.name ?? null,\n parents: def.parents,\n params,\n describe: def.describe[language],\n opens: typeof def.open === 'function',\n reachable: typeof def.entry === 'function',\n example,\n };\n });\n}\n"],"names":["GUID","g9GuidCodec","Object","id","g9PatternCodec","name","pattern","normalize","g9GenericKinds","G9CatalogueError","G9Error","message","NAME","genericDef","kind","describe","fnv1a","text","h","i","Math","checkParam","def","value","item","_def_maxLength","createCatalogue","defs","map","Map","g9AddressLimits","Array","v","p","parent","ancestors","chain","seen","cached","undefined","result","up","seg","kinds","hash","k","_d_variants","_d_id","d","variants","parents","allowsParent","parentKind","_ancestors_get","address","out","_s_variant","_s_params","s","refuse","reason","_def_params","canonical","segment","ctx","language","catalogueManifest","catalogue","_def_variants","_def_id","params","example"],"mappings":";;AAgBA,MAAMA,OAAO;AAGN,MAAMC,cAAyBC,OAAO,MAAM,CAAC;IAClD,MAAM;IACN,MAAM,CAACC,KAAeH,KAAK,IAAI,CAACG;IAChC,WAAW,CAACA,KAAeA,GAAG,WAAW;AAC3C;AAGO,SAASC,eACdC,IAAY,EACZC,OAAe,EACfC,YAAoC,CAACJ,KAAOA,EAAE;IAE9C,OAAOD,OAAO,MAAM,CAAC;QAAEG;QAAM,MAAM,CAACF,KAAeG,QAAQ,IAAI,CAACH;QAAKI;IAAU;AACjF;AAmFO,MAAMC,iBAAoCN,OAAO,MAAM,CAAC;IAAC;IAAS;IAAQ;CAAO;AAwBjF,MAAMO,yBAAyBC;IACpC,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAAC,mBAAmBA;QACzB,IAAI,CAAC,IAAI,GAAG;IACd;AACF;AAEA,MAAMC,OAAO;AAEb,SAASC,WAAgBC,IAAY;IACnC,MAAMC,WAA4C;QAChD,OAAO;YAAE,IAAI;YAAQ,IAAI;QAAQ;QACjC,MAAM;YAAE,IAAI;YAAa,IAAI;QAAW;QACxC,MAAM;YAAE,IAAI;YAAQ,IAAI;QAAO;IACjC;IACA,OAAO;QAAED;QAAM,UAAU;QAAK,SAAS;QAAK,UAAUC,QAAQ,CAACD,KAAK;IAAoB;AAC1F;AAEA,SAASE,MAAMC,IAAY;IACzB,IAAIC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C3BiD;QACF;IACF;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { formatAddress, type G9Address, G9AddressError, type G9AddressErrorCode, type G9Segment, type G9SegmentInput, g9AddressLimits, generalOf, matchesAddress, parseAddress, sameSegment, sameSegmentState, seg, toSegment, tryParseAddress, } from './address.js';
|
|
2
|
+
export { catalogueManifest, createCatalogue, type G9AddressCheck, type G9BilingualText, type G9Catalogue, G9CatalogueError, type G9CatalogueManifestEntry, type G9Entry, type G9GoFailure, type G9GuardResult, type G9IdCodec, type G9ParamDef, type G9PlaceDef, g9GenericKinds, g9GuidCodec, g9PatternCodec, } from './catalogue.js';
|
|
3
|
+
export { confirmSeconds, type G9AnchorRisk, type G9ConfirmTiming, type G9GuideEffectSpec, type G9Journey, type G9JourneySource, type G9JourneyStep, type G9StepAuthority, type G9Text, type G9Until, type G9WaitFor, g9ConfirmTimingDefaults, g9JourneyLimits, journeyAuthority, textIn, validateJourney, } from './journey.js';
|
|
4
|
+
export { compareLivePlaces, type G9LivePlace, type G9NavigationPlan, type G9ResolvedPath, planNavigation, resolvePath, } from './resolve.js';
|
|
5
|
+
export { type G9ChangeLine, type G9PlaceDeclaration, type G9PlaceHandle, type G9PlaceLayer, type G9RouteSink, g9PlaceLayers, } from './sink.js';
|
|
6
|
+
export { type G9ScrollMark, type G9SegmentView, type G9Snapshot, type G9ViewApplied, parseSnapshot, snapshotRefusal, toScrollMark, } from './view.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/route/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EACb,KAAK,SAAS,EACd,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,eAAe,EACf,SAAS,EACT,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,GAAG,EACH,SAAS,EACT,eAAe,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,gBAAgB,EAChB,KAAK,wBAAwB,EAC7B,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,UAAU,EACf,cAAc,EACd,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,eAAe,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,cAAc,EACd,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,aAAa,EACb,eAAe,EACf,YAAY,GACb,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { G9AddressError, formatAddress, g9AddressLimits, generalOf, matchesAddress, parseAddress, sameSegment, sameSegmentState, seg, toSegment, tryParseAddress } from "./address.js";
|
|
2
|
+
export { G9CatalogueError, catalogueManifest, createCatalogue, g9GenericKinds, g9GuidCodec, g9PatternCodec } from "./catalogue.js";
|
|
3
|
+
export { confirmSeconds, g9ConfirmTimingDefaults, g9JourneyLimits, journeyAuthority, textIn, validateJourney } from "./journey.js";
|
|
4
|
+
export { compareLivePlaces, planNavigation, resolvePath } from "./resolve.js";
|
|
5
|
+
export { g9PlaceLayers } from "./sink.js";
|
|
6
|
+
export { parseSnapshot, snapshotRefusal, toScrollMark } from "./view.js";
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { G9BilingualText } from './catalogue.js';
|
|
2
|
+
/** Who authored a journey. The runner uses the CALLER's source, never the journey's own claim. */
|
|
3
|
+
export type G9JourneySource = 'bundled' | 'assistant' | 'link' | 'tester' | 'qa';
|
|
4
|
+
/** What pressing a control does to data. */
|
|
5
|
+
export type G9AnchorRisk = 'none' | 'commit' | 'destructive';
|
|
6
|
+
/** Text in one language or both. */
|
|
7
|
+
export type G9Text = string | G9BilingualText;
|
|
8
|
+
/** One visual effect of a journey step (JSON-safe; the guide draws it). */
|
|
9
|
+
export type G9GuideEffectSpec = {
|
|
10
|
+
readonly type: 'highlight';
|
|
11
|
+
readonly color?: string;
|
|
12
|
+
readonly opacity?: number;
|
|
13
|
+
readonly ring?: number;
|
|
14
|
+
readonly padding?: number;
|
|
15
|
+
readonly radius?: 'auto' | number;
|
|
16
|
+
readonly pulse?: boolean;
|
|
17
|
+
} | {
|
|
18
|
+
readonly type: 'spotlight';
|
|
19
|
+
readonly scrim?: string;
|
|
20
|
+
readonly padding?: number;
|
|
21
|
+
readonly radius?: 'auto' | number;
|
|
22
|
+
readonly modal?: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
readonly type: 'pointer';
|
|
25
|
+
readonly gesture?: 'tap' | 'longPress' | 'swipeUp' | 'swipeDown' | 'swipeStart' | 'swipeEnd';
|
|
26
|
+
} | {
|
|
27
|
+
readonly type: 'caption';
|
|
28
|
+
readonly text: G9Text;
|
|
29
|
+
readonly title?: G9Text;
|
|
30
|
+
readonly placement?: 'auto' | 'above' | 'below' | 'start' | 'end';
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: 'beacon';
|
|
33
|
+
readonly corner?: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
34
|
+
readonly color?: string;
|
|
35
|
+
} | {
|
|
36
|
+
readonly type: 'badge';
|
|
37
|
+
readonly text: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly type: 'ripple';
|
|
40
|
+
};
|
|
41
|
+
/** When a show / say step moves on. */
|
|
42
|
+
export type G9Until = 'tap' | 'next' | {
|
|
43
|
+
readonly ms: number;
|
|
44
|
+
} | {
|
|
45
|
+
readonly route: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly value: {
|
|
48
|
+
readonly target: string;
|
|
49
|
+
readonly equals?: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** What a wait step waits for (any one of them). */
|
|
53
|
+
export interface G9WaitFor {
|
|
54
|
+
readonly route?: string;
|
|
55
|
+
readonly anchor?: string;
|
|
56
|
+
readonly value?: {
|
|
57
|
+
readonly target: string;
|
|
58
|
+
readonly equals?: string;
|
|
59
|
+
};
|
|
60
|
+
readonly ms?: number;
|
|
61
|
+
}
|
|
62
|
+
/** One step of a journey. */
|
|
63
|
+
export type G9JourneyStep = {
|
|
64
|
+
readonly do: 'go';
|
|
65
|
+
readonly to: string;
|
|
66
|
+
readonly by?: 'jump' | 'user' | 'demo';
|
|
67
|
+
} | {
|
|
68
|
+
readonly do: 'show';
|
|
69
|
+
readonly target: string;
|
|
70
|
+
readonly text?: G9Text;
|
|
71
|
+
readonly effects?: readonly G9GuideEffectSpec[];
|
|
72
|
+
readonly until?: G9Until;
|
|
73
|
+
} | {
|
|
74
|
+
readonly do: 'say';
|
|
75
|
+
readonly text: G9Text;
|
|
76
|
+
readonly until?: G9Until;
|
|
77
|
+
} | {
|
|
78
|
+
readonly do: 'fill';
|
|
79
|
+
readonly target: string;
|
|
80
|
+
readonly value: string;
|
|
81
|
+
readonly by?: 'user' | 'engine';
|
|
82
|
+
} | {
|
|
83
|
+
readonly do: 'select';
|
|
84
|
+
readonly target: string;
|
|
85
|
+
readonly item: string;
|
|
86
|
+
readonly by?: 'user' | 'engine';
|
|
87
|
+
} | {
|
|
88
|
+
readonly do: 'press';
|
|
89
|
+
readonly target: string;
|
|
90
|
+
readonly by?: 'user' | 'engine';
|
|
91
|
+
readonly text?: G9Text;
|
|
92
|
+
} | {
|
|
93
|
+
readonly do: 'wait';
|
|
94
|
+
readonly for: G9WaitFor;
|
|
95
|
+
readonly timeoutMs?: number;
|
|
96
|
+
} | {
|
|
97
|
+
readonly do: 'back';
|
|
98
|
+
};
|
|
99
|
+
/** A journey: validated JSON steps a guide runs on screen. */
|
|
100
|
+
export interface G9Journey {
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly title?: G9Text;
|
|
103
|
+
readonly source: G9JourneySource;
|
|
104
|
+
/** `auto` runs through; `manual` waits for «بعدی» at every step. Default `auto`. */
|
|
105
|
+
readonly pace?: 'auto' | 'manual';
|
|
106
|
+
readonly steps: readonly G9JourneyStep[];
|
|
107
|
+
}
|
|
108
|
+
/** The bounds of a journey. */
|
|
109
|
+
export declare const g9JourneyLimits: Readonly<{
|
|
110
|
+
steps: 40;
|
|
111
|
+
text: 240;
|
|
112
|
+
value: 512;
|
|
113
|
+
id: 64;
|
|
114
|
+
effects: 6;
|
|
115
|
+
waitMs: 120000;
|
|
116
|
+
}>;
|
|
117
|
+
/** Validates untrusted JSON as a journey: unknown keys, bad texts, addresses or ids are refused. */
|
|
118
|
+
export declare function validateJourney(x: unknown): {
|
|
119
|
+
readonly ok: true;
|
|
120
|
+
readonly journey: G9Journey;
|
|
121
|
+
} | {
|
|
122
|
+
readonly ok: false;
|
|
123
|
+
readonly error: string;
|
|
124
|
+
};
|
|
125
|
+
/** Who carries a step out: the engine, the engine after the person's countdown confirmation, or the person. */
|
|
126
|
+
export type G9StepAuthority = 'engine' | 'engine-confirm' | 'user';
|
|
127
|
+
/**
|
|
128
|
+
* The source policy (plan §11.3). `navigate` covers go / show / say / wait; `fill` covers fill and select (a form
|
|
129
|
+
* value, never a save); `press` reads the anchor's risk. An app may only make it stricter.
|
|
130
|
+
*/
|
|
131
|
+
export declare function journeyAuthority(source: G9JourneySource, action: 'navigate' | 'fill' | 'press', risk?: G9AnchorRisk): G9StepAuthority;
|
|
132
|
+
/** Countdown lengths of the confirmation (seconds). */
|
|
133
|
+
export interface G9ConfirmTiming {
|
|
134
|
+
readonly commitSeconds: number;
|
|
135
|
+
readonly destructiveSeconds: number;
|
|
136
|
+
/** Added when the journey came from outside the app (a link). */
|
|
137
|
+
readonly linkExtraSeconds: number;
|
|
138
|
+
/** Multiplies the countdown when the place could not describe its changes. */
|
|
139
|
+
readonly undescribedFactor: number;
|
|
140
|
+
}
|
|
141
|
+
/** The default countdowns: 5 s for a save, 10 s for a delete, +3 s from a link, ×2 when undescribed. */
|
|
142
|
+
export declare const g9ConfirmTimingDefaults: G9ConfirmTiming;
|
|
143
|
+
/** The countdown of one confirmation (whole seconds, ≥ 1). */
|
|
144
|
+
export declare function confirmSeconds(source: G9JourneySource, risk: Exclude<G9AnchorRisk, 'none'>, described: boolean, timing?: G9ConfirmTiming): number;
|
|
145
|
+
/** A text in the person's language. */
|
|
146
|
+
export declare function textIn(t: G9Text, language: 'fa' | 'en'): string;
|
|
147
|
+
//# sourceMappingURL=journey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../src/route/journey.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQnD,kGAAkG;AAClG,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEjF,4CAA4C;AAC5C,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE7D,oCAAoC;AACpC,MAAM,MAAM,MAAM,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