@yomotech/view-toolkit 1.0.47 → 1.0.52
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/fesm2022/yomotech-view-toolkit-catalog.mjs +948 -10
- package/fesm2022/yomotech-view-toolkit-catalog.mjs.map +1 -1
- package/fesm2022/yomotech-view-toolkit.mjs +1948 -846
- package/fesm2022/yomotech-view-toolkit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/yomotech-view-toolkit-catalog.d.ts +361 -7
- package/types/yomotech-view-toolkit.d.ts +442 -32
package/package.json
CHANGED
|
@@ -66,6 +66,24 @@ declare const CONTROL_TYPES: Bag;
|
|
|
66
66
|
declare function effectiveControl(option: Bag | any, schema?: Bag | any, fallback?: string): string;
|
|
67
67
|
/** Controls a value is typed or chosen in - they take a placeholder. */
|
|
68
68
|
declare const PLACEHOLDER_CONTROLS: string[];
|
|
69
|
+
/**
|
|
70
|
+
* How the card field (creditCard) lays out its parts (option.cardLayout): oneRow - Stripe's single line (card number,
|
|
71
|
+
* MM / YY, CVC; the default), twoRows - the number alone, below it expiry and CVC side by side, threeRows - all three
|
|
72
|
+
* below each other. A phone cut the single line off (OFFENE-PUNKTE 103).
|
|
73
|
+
*/
|
|
74
|
+
declare const CARD_LAYOUTS: readonly ["oneRow", "twoRows", "threeRows"];
|
|
75
|
+
type CardLayout = typeof CARD_LAYOUTS[number];
|
|
76
|
+
/** The card field's layout, oneRow when the layout names none or an unknown one. */
|
|
77
|
+
declare function cardLayoutOf(option: Bag | any): CardLayout;
|
|
78
|
+
/**
|
|
79
|
+
* The key at the bottom right of the app keyboard (option.enterKey), set in the Designer per field:
|
|
80
|
+
* done closes the keyboard (default), search sends Enter so the field's action runs (a search starts),
|
|
81
|
+
* next moves on to the next field. The header's search field has search as its default.
|
|
82
|
+
*/
|
|
83
|
+
declare const ENTER_KEYS: readonly ["done", "search", "next"];
|
|
84
|
+
type EnterKey = (typeof ENTER_KEYS)[number];
|
|
85
|
+
/** A field's key at the bottom right: its option.enterKey when known, else the given default. */
|
|
86
|
+
declare function enterKeyFor(option: Bag | any, fallback?: EnterKey): EnterKey;
|
|
69
87
|
/** The toolkit keyboards a field can ask for (option.keyboardType). */
|
|
70
88
|
declare const KEYBOARD_TYPES: readonly ["string", "alpha", "numeric", "email", "date", "time"];
|
|
71
89
|
/** keyboardType values that keep the device's system keyboard. */
|
|
@@ -123,16 +141,32 @@ declare function assertFieldSettings(schema: Bag, fallback: string, option: Bag,
|
|
|
123
141
|
reference: string;
|
|
124
142
|
allowPendingValues?: boolean;
|
|
125
143
|
}): void;
|
|
144
|
+
/**
|
|
145
|
+
* A text shown in a list (card, grid) ends with … after this many lines (option.maxLines, set in the Designer: 1-20);
|
|
146
|
+
* 0 = no limit. The whole text stays on the detail page (user 2026-11-01).
|
|
147
|
+
*/
|
|
148
|
+
declare function maxLinesOf(option: any): number;
|
|
149
|
+
/**
|
|
150
|
+
* A card list's cards of a row are equally high and their buttons stand at the bottom, in line across the row
|
|
151
|
+
* (center.option.alignRows, set in the Designer; on for new card lists, user 2026-11-01).
|
|
152
|
+
*/
|
|
153
|
+
declare function alignRowsOf(center: any): boolean;
|
|
126
154
|
|
|
127
155
|
declare const TESTS_DIR = ".liveforge/tests";
|
|
128
156
|
declare const RESULTS_DIR = ".liveforge/results";
|
|
129
157
|
/** The app's test data, shared by its tests: { customer: { firstName: "Max" }, card: { number: "4242…" } } */
|
|
130
158
|
declare const TEST_DATA_FILE = ".liveforge/test-data.json";
|
|
131
|
-
declare const TEST_DEVICES: readonly ["
|
|
159
|
+
declare const TEST_DEVICES: readonly ["mobile", "tablet", "laptop", "desktop"];
|
|
160
|
+
/** Old spellings of a device, still taken: "phone" is "mobile" (2026-10-31, the preview's word). */
|
|
161
|
+
declare const OLD_DEVICE_NAMES: Record<string, string>;
|
|
132
162
|
declare const ORIENTATIONS: readonly ["portrait", "landscape"];
|
|
133
|
-
declare const STEP_KINDS: readonly ["open", "menu", "tap", "type", "pick", "press", "scroll", "openRecord", "close", "cart", "rotate", "device", "wait", "expect"];
|
|
163
|
+
declare const STEP_KINDS: readonly ["open", "menu", "tap", "type", "pick", "press", "scroll", "openRecord", "close", "cart", "rotate", "device", "wait", "language", "reload", "signIn", "expect"];
|
|
134
164
|
/** What an expect step can check - one of them per step. */
|
|
135
|
-
declare const EXPECT_KINDS: readonly ["value", "shows", "keyboard", "list", "message", "visible", "hidden", "locked", "blocked", "inFrame", "page", "records", "recordsAtLeast", "samePlace", "cartCount", "toast"];
|
|
165
|
+
declare const EXPECT_KINDS: readonly ["value", "shows", "keyboard", "list", "message", "visible", "hidden", "locked", "blocked", "inFrame", "page", "records", "recordsAtLeast", "samePlace", "cartCount", "toast", "checked", "unchecked", "cardRows", "formatted", "translated", "fieldVisible", "restored", "layout"];
|
|
166
|
+
/** How a value is shown in the language's form (expect formatted). */
|
|
167
|
+
declare const FORMATS: readonly ["date", "time", "datetime", "number", "currency"];
|
|
168
|
+
/** Languages written right to left - not tested until right-to-left is supported (decision 2026-10-30). */
|
|
169
|
+
declare const RTL_LANGUAGES: string[];
|
|
136
170
|
/** What has to stay inside the page frame (safe areas, top gap). */
|
|
137
171
|
declare const FRAME_PARTS: readonly ["keyboard", "dialog", "calendar", "list", "menu"];
|
|
138
172
|
declare const LIST_STATES: readonly ["open", "closed"];
|
|
@@ -142,7 +176,7 @@ interface TestExpect {
|
|
|
142
176
|
field?: string;
|
|
143
177
|
/** stored value of the field */
|
|
144
178
|
value?: unknown;
|
|
145
|
-
/** text the field shows (formatted: "12,34 €", "01:00 PM") */
|
|
179
|
+
/** text the field shows (formatted: "12,34 €", "01:00 PM"); a language key (caption) is shown in the run's language */
|
|
146
180
|
shows?: string;
|
|
147
181
|
/** keyboard type that is open (string, alpha, numeric, email, date, time) or "none" */
|
|
148
182
|
keyboard?: string;
|
|
@@ -166,6 +200,24 @@ interface TestExpect {
|
|
|
166
200
|
cartCount?: number | string;
|
|
167
201
|
/** a message shown to the user (its text or its translation key) */
|
|
168
202
|
toast?: string;
|
|
203
|
+
/** the card field (creditCard) stands in so many rows (1-3) and none of its parts is wider than the field */
|
|
204
|
+
cardRows?: number;
|
|
205
|
+
/** a check box / switch (its key) is on - also read-only on a card or in a grid row */
|
|
206
|
+
checked?: string;
|
|
207
|
+
/** a check box / switch (its key) is off */
|
|
208
|
+
unchecked?: string;
|
|
209
|
+
/** with field and value: the field shows the language-neutral value (2026-10-30, 14:00, 12.50) in the language's form */
|
|
210
|
+
formatted?: typeof FORMATS[number];
|
|
211
|
+
/** ISO currency of formatted: currency (EUR, USD) */
|
|
212
|
+
currency?: string;
|
|
213
|
+
/** every text of the page is in the language of the run - none missing, no raw key */
|
|
214
|
+
translated?: true;
|
|
215
|
+
/** the field (its key) stays visible above the open keyboard - not covered */
|
|
216
|
+
fieldVisible?: string;
|
|
217
|
+
/** after the keyboard closed the page stands as before it opened - same place, no empty space */
|
|
218
|
+
restored?: true;
|
|
219
|
+
/** the page passes the layout rules (layoutProblems) */
|
|
220
|
+
layout?: true;
|
|
169
221
|
}
|
|
170
222
|
interface TestStep {
|
|
171
223
|
open?: string;
|
|
@@ -174,6 +226,8 @@ interface TestStep {
|
|
|
174
226
|
tap?: string;
|
|
175
227
|
type?: string;
|
|
176
228
|
into?: string;
|
|
229
|
+
/** with type: the field's n-th input (1-based) - the end of a period (daterange) is 2 */
|
|
230
|
+
at?: number;
|
|
177
231
|
pick?: string;
|
|
178
232
|
in?: string;
|
|
179
233
|
press?: string;
|
|
@@ -187,6 +241,13 @@ interface TestStep {
|
|
|
187
241
|
cart?: true;
|
|
188
242
|
rotate?: Orientation;
|
|
189
243
|
device?: string;
|
|
244
|
+
/** switch the app's language on the way (code: de, en, fr) */
|
|
245
|
+
language?: string;
|
|
246
|
+
/** load the app anew - the language and the sign-in stay */
|
|
247
|
+
reload?: true;
|
|
248
|
+
/** signed in from here on: already signed in - done; else a person signs in (preview, the runner waits) or the
|
|
249
|
+
* runner signs in with the test user (simulators, signin.mjs). A test never types a name or password. */
|
|
250
|
+
signIn?: true | string;
|
|
190
251
|
/** milliseconds */
|
|
191
252
|
wait?: number;
|
|
192
253
|
expect?: TestExpect;
|
|
@@ -196,8 +257,10 @@ interface TestFlow {
|
|
|
196
257
|
description?: string;
|
|
197
258
|
/** writes real data - runs only after an explicit confirmation */
|
|
198
259
|
books?: boolean;
|
|
199
|
-
/** "
|
|
260
|
+
/** "mobile", "tablet:landscape" … - without orientation portrait; none means mobile and tablet ("phone" is still taken) */
|
|
200
261
|
devices?: string[];
|
|
262
|
+
/** the languages the flow runs in: codes, or "all" (the app's left-to-right languages); none: the main language */
|
|
263
|
+
languages?: string[] | 'all';
|
|
201
264
|
steps: TestStep[];
|
|
202
265
|
}
|
|
203
266
|
interface TestProblem {
|
|
@@ -211,11 +274,18 @@ interface StepResult {
|
|
|
211
274
|
ok: boolean;
|
|
212
275
|
reason?: string;
|
|
213
276
|
image?: string;
|
|
277
|
+
/** a failed step's measurements - what is needed to find the cause (samePlace: place, largest place, records when
|
|
278
|
+
* left and back; layout: the boxes; visible/translated: what the page holds instead). Read by people and the AI. */
|
|
279
|
+
details?: Record<string, unknown>;
|
|
280
|
+
/** a passing step's hints - nothing failed, worth a look (layout: a table scrolls sideways) */
|
|
281
|
+
notes?: string[];
|
|
214
282
|
}
|
|
215
283
|
interface FlowResult {
|
|
216
284
|
file: string;
|
|
217
285
|
name: string;
|
|
218
286
|
device: string;
|
|
287
|
+
/** the language the flow ran in */
|
|
288
|
+
language?: string;
|
|
219
289
|
ok: boolean;
|
|
220
290
|
skipped?: 'books';
|
|
221
291
|
/** stopped by the person ("Stop") after this flow's last step in steps */
|
|
@@ -233,6 +303,15 @@ interface TestRun {
|
|
|
233
303
|
flows: FlowResult[];
|
|
234
304
|
}
|
|
235
305
|
declare const DEFAULT_DEVICES: string[];
|
|
306
|
+
/** Every device a test can name: each device, portrait and (for mobile and tablet) landscape - the editor's choices. */
|
|
307
|
+
declare function deviceChoices(): string[];
|
|
308
|
+
/**
|
|
309
|
+
* A placeholder in a text: {{name}} or {{name | fallback}} (the same pattern as validate.py's, via the contract).
|
|
310
|
+
* As a source, so every runner and the Python validator build their own RegExp from it.
|
|
311
|
+
*/
|
|
312
|
+
declare const PLACEHOLDER_SOURCE = "\\{\\{\\s*([^}|]+?)\\s*(?:\\|[^}]*)?\\}\\}";
|
|
313
|
+
/** Whether a shown text is a text with placeholders filled in ("Order 4711 saved" for "Order {{id}} saved"). */
|
|
314
|
+
declare function matchesTemplate(text: string, template: string): boolean;
|
|
236
315
|
/**
|
|
237
316
|
* How many runs the backend keeps in .liveforge/results - defaults, the project configuration can
|
|
238
317
|
* change them: at most `max` runs; while they together are bigger than `maxBytes` (mostly images of
|
|
@@ -261,6 +340,78 @@ declare function parseDevice(text: string): {
|
|
|
261
340
|
declare function flowDevices(flow: TestFlow): string[];
|
|
262
341
|
/** The kind of a step - the first step key it has. */
|
|
263
342
|
declare function stepKind(step: TestStep): string | null;
|
|
343
|
+
/** The languages a flow runs in: its own (right-to-left left out), "all" = the app's left-to-right ones, none = the main one. */
|
|
344
|
+
declare function flowLanguages(flow: TestFlow, appLanguages: string[], main: string): string[];
|
|
345
|
+
/** 12 hours with AM/PM in this language? */
|
|
346
|
+
declare function uses12Hours(lang: string): boolean;
|
|
347
|
+
/** The order of day, month, year in the language's numeric date ("dmy", "mdy", "ymd"). */
|
|
348
|
+
declare function dateOrder(lang: string): string;
|
|
349
|
+
/**
|
|
350
|
+
* The keys a person types for a language-neutral value in this language: a date's digits in the language's order
|
|
351
|
+
* (en 10302026, de 30102026), a time as digits with P/A in a 12-hour language (0200P) or 24 hours (1400), a number
|
|
352
|
+
* with the language's decimal sign (de 12,50). Any other text stays as it is - older flows typed the keys themselves.
|
|
353
|
+
*/
|
|
354
|
+
declare function localeKeys(value: string, lang: string): string;
|
|
355
|
+
/** Every way the language writes this value (expect formatted) - the field must show one of them; spaces are made plain. */
|
|
356
|
+
declare function localeRenderings(value: string, as: typeof FORMATS[number], lang: string, currency?: string): string[];
|
|
357
|
+
/** One element on the page as the runner measured it (layoutProblems). */
|
|
358
|
+
interface LayoutBox {
|
|
359
|
+
/** what it is: field, button, label, text */
|
|
360
|
+
kind: string;
|
|
361
|
+
/** its name for the report (field key, button action, the first words) */
|
|
362
|
+
name: string;
|
|
363
|
+
left: number;
|
|
364
|
+
top: number;
|
|
365
|
+
right: number;
|
|
366
|
+
bottom: number;
|
|
367
|
+
/** characters that fit in a line of its width at its font size (text only) */
|
|
368
|
+
charsPerLine?: number;
|
|
369
|
+
/** the row it belongs to (fields side by side in one layout row) */
|
|
370
|
+
row?: string;
|
|
371
|
+
/** the sideways scrolling area it stands in (a wide table) - reached by swiping there, so it may leave the frame */
|
|
372
|
+
scroller?: string;
|
|
373
|
+
/** it stands in the top bar (header, page X) - the page scrolls under a fixed one */
|
|
374
|
+
inBar?: boolean;
|
|
375
|
+
}
|
|
376
|
+
/** An area that scrolls sideways on its own (a table wider than the screen): its place and how wide its content is. */
|
|
377
|
+
interface LayoutScroller {
|
|
378
|
+
name: string;
|
|
379
|
+
left: number;
|
|
380
|
+
right: number;
|
|
381
|
+
/** the content's width and the width shown */
|
|
382
|
+
content: number;
|
|
383
|
+
shown: number;
|
|
384
|
+
}
|
|
385
|
+
/** What the page shows, measured by a runner: the frame, sideways scrolling, the elements. */
|
|
386
|
+
interface LayoutSnapshot {
|
|
387
|
+
width: number;
|
|
388
|
+
height: number;
|
|
389
|
+
/** the page scrolls sideways (document wider than the frame) */
|
|
390
|
+
scrollsSideways: boolean;
|
|
391
|
+
boxes: LayoutBox[];
|
|
392
|
+
/** the areas that scroll sideways on their own */
|
|
393
|
+
scrollers?: LayoutScroller[];
|
|
394
|
+
/** the top bar (header + page X): its place, its behaviour (header.option.scroll) and how far the page is scrolled */
|
|
395
|
+
header?: {
|
|
396
|
+
top: number;
|
|
397
|
+
bottom: number;
|
|
398
|
+
scroll: string;
|
|
399
|
+
pageTop: number;
|
|
400
|
+
};
|
|
401
|
+
/** card lists with aligned rows (card.alignRows): per row of cards, the tops of their button elements */
|
|
402
|
+
cardRows?: number[][];
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* The layout rules (OFFENE-PUNKTE 143), judged on what a runner measured: beyond (an element leaves the frame
|
|
406
|
+
* sideways), sideways (the page scrolls sideways), overlap (two fields / buttons cover each other), narrow (a text
|
|
407
|
+
* gets fewer than 3 characters a line), row (fields of one row do not stand on one line). Pixels tolerate 2.
|
|
408
|
+
*/
|
|
409
|
+
declare function layoutProblems(snap: LayoutSnapshot): {
|
|
410
|
+
rule: string;
|
|
411
|
+
detail: string;
|
|
412
|
+
}[];
|
|
413
|
+
/** Hints that fail nothing: the areas that scroll sideways (a wide table) - shown with a passing layout check. */
|
|
414
|
+
declare function layoutNotes(snap: LayoutSnapshot): string[];
|
|
264
415
|
/** The test data a flow uses, per step: [{ step, ref: "customer.firstName" }]; ref without "data.". */
|
|
265
416
|
declare function testDataRefs(flow: any): {
|
|
266
417
|
step: number;
|
|
@@ -280,6 +431,56 @@ declare function withTestData(flow: TestFlow, data: any): {
|
|
|
280
431
|
* in it is a problem too (dataUnknown); a placeholder that is no {{data.…}} is one always (dataRefInvalid).
|
|
281
432
|
*/
|
|
282
433
|
declare function checkTestFlow(flow: any, data?: any): TestProblem[];
|
|
434
|
+
/**
|
|
435
|
+
* How fast a run goes - chosen only where the run is started (preview: the choice beside "Run tests"; devices:
|
|
436
|
+
* --tempo=…), never in a test (user 2026-11-01): fast (no pause), normal (a short pause before each step), slow
|
|
437
|
+
* (a long pause, to watch it). The checks' time limits start after the pause.
|
|
438
|
+
*/
|
|
439
|
+
declare const TEST_TEMPOS: readonly ["fast", "normal", "slow"];
|
|
440
|
+
type TestTempo = (typeof TEST_TEMPOS)[number];
|
|
441
|
+
/** The pause before a step in ms; unknown tempo: fast. */
|
|
442
|
+
declare function tempoPause(tempo: string | undefined): number;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* The app's test users (.liveforge/test-data.json testUsers) - name -> where its sign-in data stand in Vault, e.g.
|
|
446
|
+
* { "default": { "vault": "liveforge/tenants/dev/e2e/tm-test/default", "description": "employee" } }. Nothing of it
|
|
447
|
+
* is built into the code (user 2026-11-01: nothing hard-coded); a step names the user: signIn true = "default".
|
|
448
|
+
*/
|
|
449
|
+
interface TestUserEntry {
|
|
450
|
+
/** the Vault entry: KV v2 mount, then the path (liveforge/tenants/dev/e2e/tm-test/default) */
|
|
451
|
+
vault: string;
|
|
452
|
+
description?: string;
|
|
453
|
+
}
|
|
454
|
+
/** The test user a step names (signIn true -> "default") from the app's test data; null when the app has none. */
|
|
455
|
+
declare function testUserEntry(data: any, name: string | true): TestUserEntry | null;
|
|
456
|
+
/** "liveforge/tenants/dev/e2e/tm-test/default" -> the KV v2 mount and the path inside it. */
|
|
457
|
+
declare function vaultPlace(vault: string): {
|
|
458
|
+
mount: string;
|
|
459
|
+
path: string;
|
|
460
|
+
};
|
|
461
|
+
/** The test user as Vault holds it. */
|
|
462
|
+
interface TestUser {
|
|
463
|
+
username: string;
|
|
464
|
+
password: string;
|
|
465
|
+
/** the authenticator key (base32) when the test user has a second factor */
|
|
466
|
+
otpSecret?: string;
|
|
467
|
+
/** the tenant key a freshly installed app asks for (device runners) */
|
|
468
|
+
tenantKey?: string;
|
|
469
|
+
}
|
|
470
|
+
type Fetch = (url: string, init?: any) => Promise<{
|
|
471
|
+
ok: boolean;
|
|
472
|
+
status: number;
|
|
473
|
+
json(): Promise<any>;
|
|
474
|
+
text(): Promise<string>;
|
|
475
|
+
}>;
|
|
476
|
+
/** base32 (RFC 4648, the authenticator apps' form) to bytes. */
|
|
477
|
+
declare function base32Bytes(secret: string): Uint8Array;
|
|
478
|
+
/** The authenticator code (TOTP, RFC 6238: HMAC-SHA1, 30 s, 6 digits) of a key at a time. */
|
|
479
|
+
declare function totp(secret: string, now?: number, subtle?: any): Promise<string>;
|
|
480
|
+
/** A Vault token from a JWT (auth/<mount>/login, role): the GitLab job's ID token or a person's Keycloak token. */
|
|
481
|
+
declare function vaultJwtLogin(fetchFn: Fetch, addr: string, mount: string, role: string, jwt: string): Promise<string>;
|
|
482
|
+
/** A test user from Vault (KV v2 mount and path, vaultPlace of the test data entry). The values never leave this function but in the result. */
|
|
483
|
+
declare function readTestUser(fetchFn: Fetch, addr: string, token: string, mount: string, path: string): Promise<TestUser>;
|
|
283
484
|
|
|
284
485
|
/** The building blocks of the app settings in Main, in the order they are shown. */
|
|
285
486
|
declare const APP_SETTING_BLOCKS: readonly ["startPage", "login", "pagination", "terms", "menu"];
|
|
@@ -454,6 +655,159 @@ declare function appSettingsMenu(menu: any[], center: Bag | any, context?: {
|
|
|
454
655
|
languages?: string[];
|
|
455
656
|
signedIn?: boolean;
|
|
456
657
|
}): any[];
|
|
658
|
+
/** An entry's caption as written in Main: label.caption, a plain label, or caption. */
|
|
659
|
+
declare function menuCaption(item: any): string;
|
|
660
|
+
/** The page an entry opens as tests name it ("pages/sidemenu/books/layout_schema.json" -> "sidemenu/books"); '' without. */
|
|
661
|
+
declare function menuPage(item: any): string;
|
|
662
|
+
/** Every entry of a menu, at any depth (submenu, elements, children), with its path of captions. */
|
|
663
|
+
declare function menuEntries(items: any[] | null | undefined, path?: string[]): {
|
|
664
|
+
item: any;
|
|
665
|
+
caption: string;
|
|
666
|
+
page: string;
|
|
667
|
+
path: string[];
|
|
668
|
+
}[];
|
|
669
|
+
/** The entry that opens a page (its folder under pages/), at any depth. */
|
|
670
|
+
declare function menuEntryForPage(items: any[] | null | undefined, page: string): any;
|
|
671
|
+
/**
|
|
672
|
+
* The entry with this caption that opens a page, at any depth: the caption as written in Main, or - the app shows
|
|
673
|
+
* it translated - the text the language file has for it (texts: written text -> shown text).
|
|
674
|
+
*/
|
|
675
|
+
declare function menuEntryByCaption(items: any[] | null | undefined, caption: string, texts?: Record<string, string>): any;
|
|
676
|
+
/**
|
|
677
|
+
* What the header does when the page scrolls (main/layout_schema.json header.option.scroll, user 2026-11-01):
|
|
678
|
+
* fixed - stays at the top (default, usual for shops and apps on every device); hideOnScroll - moves away while
|
|
679
|
+
* scrolling down and comes back at once when scrolling up ("quick return", room on a phone); scrollsAlong - scrolls
|
|
680
|
+
* away with the page: cart, search and the page X are out of reach after scrolling, and going back from them puts
|
|
681
|
+
* a list at its top (found 2026-11-01, luv2shop a06).
|
|
682
|
+
*/
|
|
683
|
+
declare const HEADER_SCROLLS: readonly ["fixed", "hideOnScroll", "scrollsAlong"];
|
|
684
|
+
type HeaderScroll = (typeof HEADER_SCROLLS)[number];
|
|
685
|
+
/** The header's behaviour when the page scrolls - its option.scroll when known, else fixed. */
|
|
686
|
+
declare function headerScrollOf(header: any): HeaderScroll;
|
|
687
|
+
|
|
688
|
+
/** Where records are kept. The first two stay in the browser, database is the backend. */
|
|
689
|
+
declare const STORAGES: readonly ["localstorage", "sessionstorage", "database"];
|
|
690
|
+
type Storage = (typeof STORAGES)[number];
|
|
691
|
+
declare const BROWSER_STORAGES: readonly string[];
|
|
692
|
+
/** Storage values of older data and what they mean now. */
|
|
693
|
+
declare const OLD_STORAGES: Readonly<Record<string, {
|
|
694
|
+
storageType: Storage;
|
|
695
|
+
loadOnFilter?: boolean;
|
|
696
|
+
}>>;
|
|
697
|
+
/** What an element does with its records - it decides which attributes are offered. */
|
|
698
|
+
type CallKind = 'load' | 'link' | 'select' | 'save' | 'saveAll' | 'submit' | 'delete' | 'login' | 'rowAction';
|
|
699
|
+
interface CallKindRule {
|
|
700
|
+
/** what it does (for the contract and the Designer's help) */
|
|
701
|
+
does: string;
|
|
702
|
+
/** the storages it may use; one only: no choice is offered */
|
|
703
|
+
storages: readonly Storage[];
|
|
704
|
+
/** the storage when none is written */
|
|
705
|
+
defaultStorage: Storage;
|
|
706
|
+
/** the key the address is written under */
|
|
707
|
+
addressKey: 'data_url' | 'url';
|
|
708
|
+
/** the methods, the default first (it is not written) */
|
|
709
|
+
methods: readonly string[];
|
|
710
|
+
/** the attributes with a browser storage (besides storageType) */
|
|
711
|
+
browser: readonly string[];
|
|
712
|
+
/** the attributes with the backend (besides storageType) */
|
|
713
|
+
backend: readonly string[];
|
|
714
|
+
}
|
|
715
|
+
declare const CALL_KINDS: Readonly<Record<CallKind, CallKindRule>>;
|
|
716
|
+
/** Every attribute of storage and call - an option key outside this list is no business of the catalog. */
|
|
717
|
+
declare const CALL_KEYS: readonly string[];
|
|
718
|
+
/** Keys of older data and what they are now - read as before, the Designer writes the new key. */
|
|
719
|
+
declare const OLD_CALL_KEYS: Readonly<Record<string, string>>;
|
|
720
|
+
/** The message after success: successMessage, else the older notification(s).success. */
|
|
721
|
+
declare function successMessageOf(option: any): string;
|
|
722
|
+
/** Actions that keep no records and call nothing - no storage, no attributes of this catalog. */
|
|
723
|
+
declare const NO_CALL_ACTIONS: Readonly<Record<string, string>>;
|
|
724
|
+
/** The kind of an element by its action / innerAction and where it stands (a menu entry or page loads). */
|
|
725
|
+
declare function callKindOf(option: any, place?: 'menu' | 'page' | 'button' | 'autocomplete'): CallKind | null;
|
|
726
|
+
/** The storage an option means: its storageType (any case, an old value translated), else the kind's default. */
|
|
727
|
+
declare function storageOf(option: any, kind: CallKind): Storage;
|
|
728
|
+
/** True when the option waits for its filter fields before loading (loadOnFilter, or the older storageType "filter"). */
|
|
729
|
+
declare function waitsForFilter(option: any): boolean;
|
|
730
|
+
/** The attributes that count for this kind with this storage. */
|
|
731
|
+
declare function callAttributes(kind: CallKind, storage: Storage): readonly string[];
|
|
732
|
+
/** The method an option uses: its own (upper case), else the kind's default; '' when the kind has none. */
|
|
733
|
+
declare function methodOf(option: any, kind: CallKind): string;
|
|
734
|
+
interface CallProblem {
|
|
735
|
+
code: 'storage-unknown' | 'storage-old' | 'storage-not-allowed' | 'attribute-not-for-storage' | 'method-unknown' | 'address-missing';
|
|
736
|
+
key?: string;
|
|
737
|
+
message: string;
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Checks one option against its kind: a known storage the kind may use, only attributes of that storage, a method of
|
|
741
|
+
* the kind, an address for the backend. Keys outside CALL_KEYS (style, visible, …) are not looked at.
|
|
742
|
+
*/
|
|
743
|
+
declare function checkCall(option: any, kind: CallKind): CallProblem[];
|
|
744
|
+
|
|
745
|
+
/** The keys whose text is shown to a person: a caption (label.caption or an element's own), placeholder, tooltip, dialog title. */
|
|
746
|
+
declare const SHOWN_TEXT_KEYS: readonly ["caption", "placeholder", "tooltip", "modalTitle"];
|
|
747
|
+
/**
|
|
748
|
+
* The texts of a layout (or property schema) in the language of `texts` (the language file: written text -> its
|
|
749
|
+
* translation). With values: also a property's start value (a text without {{ }}), as the grid's footer needs.
|
|
750
|
+
* inPlace: changes the given schema (its first texts are remembered); else works on a copy. Missing translation:
|
|
751
|
+
* the written text.
|
|
752
|
+
*/
|
|
753
|
+
declare function translateCaptions<T>(schema: T, texts: Record<string, string> | null | undefined, { inPlace, values }?: {
|
|
754
|
+
inPlace?: boolean;
|
|
755
|
+
values?: boolean;
|
|
756
|
+
}): T;
|
|
757
|
+
|
|
758
|
+
/** Storage keys kept when a flow starts with empty app data: sign-in, tenant, project, accepted terms, the recorder, the runner's own. */
|
|
759
|
+
declare const APP_DATA_KEEP = "token|expires|nonce|pkce|session_state|keycloak|logined|granted_scopes|id_token|okta|tenant|project|terms|networkLogs|vl-test";
|
|
760
|
+
/** Texts on the page still in the main language although the language file has them, or raw keys ("termsShowAgain"). */
|
|
761
|
+
declare function probeUntranslated(texts: Record<string, string>, lang: string, main: string): string[];
|
|
762
|
+
/** What the page shows, measured for the layout rules (layoutProblems): fields, buttons, texts with their boxes. */
|
|
763
|
+
declare function probeLayoutSnapshot(): {
|
|
764
|
+
width: number;
|
|
765
|
+
height: number;
|
|
766
|
+
scrollsSideways: boolean;
|
|
767
|
+
boxes: any[];
|
|
768
|
+
scrollers: any[];
|
|
769
|
+
header?: any;
|
|
770
|
+
cardRows: number[][];
|
|
771
|
+
};
|
|
772
|
+
/** Whether a field (data-vl-path with a dot, else data-vl-field) stands visible above an open keyboard: '' or why not. */
|
|
773
|
+
declare function probeFieldVisible(key: string): string;
|
|
774
|
+
/** Where the page stands: the window's and the scrolling content's place, the page's height (expect restored). */
|
|
775
|
+
declare function probePagePlace(): {
|
|
776
|
+
scrollY: number;
|
|
777
|
+
scrollTop: number;
|
|
778
|
+
height: number;
|
|
779
|
+
};
|
|
780
|
+
/** The app's data in the browser (local and session), without what is kept (keep: APP_DATA_KEEP) - put back after a flow. */
|
|
781
|
+
declare function probeStorageSnapshot(keep: string): {
|
|
782
|
+
local: [string, string][];
|
|
783
|
+
session: [string, string][];
|
|
784
|
+
};
|
|
785
|
+
/** Empties the app's data in the browser (not what is kept); true when something was removed. */
|
|
786
|
+
declare function probeClearAppData(keep: string): boolean;
|
|
787
|
+
/** Puts the app's data back as it was before the flow (probeStorageSnapshot); true when something had changed. */
|
|
788
|
+
declare function probeRestoreStorage(snapshot: {
|
|
789
|
+
local: [string, string][];
|
|
790
|
+
session: [string, string][];
|
|
791
|
+
}, keep: string): boolean;
|
|
792
|
+
/** The parts that must stay inside the screen (expect inFrame), as selectors of the page. */
|
|
793
|
+
declare const FRAME_SELECTORS: Record<string, string>;
|
|
794
|
+
/** A frame part (its selector from FRAME_SELECTORS): null when not shown, else whether it stays inside the screen and its box. */
|
|
795
|
+
declare function probeInFrame(selector: string): {
|
|
796
|
+
in: boolean;
|
|
797
|
+
box: number[];
|
|
798
|
+
width: number;
|
|
799
|
+
height: number;
|
|
800
|
+
} | null;
|
|
801
|
+
/**
|
|
802
|
+
* A field as tests name it (data-vl-path with a dot, else data-vl-field; only shown ones; a key in two DTOs on the page
|
|
803
|
+
* is ambiguous): what it shows and whether it is locked. null when not there; { ambiguous } when the key is not enough.
|
|
804
|
+
*/
|
|
805
|
+
declare function probeField(key: string): {
|
|
806
|
+
text: string;
|
|
807
|
+
locked: boolean;
|
|
808
|
+
} | {
|
|
809
|
+
ambiguous: string[];
|
|
810
|
+
} | null;
|
|
457
811
|
|
|
458
|
-
export { APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BASIC_TYPES, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DISPLAY_FORMATS, DOCUMENT_KINDS, EXPECT_KINDS, FRAME_PARTS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NUMBER_STYLES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, RESULTS_DIR, RESULTS_KEEP, SETTING_MENU_TEXTS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DATA_FILE, TEST_DEVICES, TYPE_ALIASES, appSettingsMenu, assertFieldSettings, baseType, basicType, canonicalControl, checkAppSettings, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, dataSettings, defaultKeyboard, displaySettings, effectiveControl, effectiveFormat, flowDevices, keyboardFor, languageName, loginMethod, normalizeFormat, pageOf, paginationFor, parseDevice, readAppSettings, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, temporalPart, testDataRefs, validateSettings, validationSettings, withTestData };
|
|
459
|
-
export type { AppSettingBlock, AppSettingDef, AppSettings, AppSettingsProblem, Bag, DocumentKind, FlowResult, LoginStorage, LoginWhen, MenuEntryKind, Orientation, Pagination, PaginationAlign, PaginationPlacement, PaginationType, Setting, StepResult, TemporalPart, TermsDocument, TestDevice, TestExpect, TestFlow, TestProblem, TestRun, TestStep };
|
|
812
|
+
export { APP_DATA_KEEP, APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BASIC_TYPES, BROWSER_STORAGES, CALL_KEYS, CALL_KINDS, CARD_LAYOUTS, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DISPLAY_FORMATS, DOCUMENT_KINDS, ENTER_KEYS, EXPECT_KINDS, FORMATS, FRAME_PARTS, FRAME_SELECTORS, HEADER_SCROLLS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NO_CALL_ACTIONS, NUMBER_STYLES, OLD_CALL_KEYS, OLD_DEVICE_NAMES, OLD_STORAGES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, PLACEHOLDER_SOURCE, RESULTS_DIR, RESULTS_KEEP, RTL_LANGUAGES, SETTING_MENU_TEXTS, SHOWN_TEXT_KEYS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, STORAGES, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DATA_FILE, TEST_DEVICES, TEST_TEMPOS, TYPE_ALIASES, alignRowsOf, appSettingsMenu, assertFieldSettings, base32Bytes, baseType, basicType, callAttributes, callKindOf, canonicalControl, cardLayoutOf, checkAppSettings, checkCall, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, dataSettings, dateOrder, defaultKeyboard, deviceChoices, displaySettings, effectiveControl, effectiveFormat, enterKeyFor, flowDevices, flowLanguages, headerScrollOf, keyboardFor, languageName, layoutNotes, layoutProblems, localeKeys, localeRenderings, loginMethod, matchesTemplate, maxLinesOf, menuCaption, menuEntries, menuEntryByCaption, menuEntryForPage, menuPage, methodOf, normalizeFormat, pageOf, paginationFor, parseDevice, probeClearAppData, probeField, probeFieldVisible, probeInFrame, probeLayoutSnapshot, probePagePlace, probeRestoreStorage, probeStorageSnapshot, probeUntranslated, readAppSettings, readTestUser, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, storageOf, successMessageOf, tempoPause, temporalPart, testDataRefs, testUserEntry, totp, translateCaptions, uses12Hours, validateSettings, validationSettings, vaultJwtLogin, vaultPlace, waitsForFilter, withTestData };
|
|
813
|
+
export type { AppSettingBlock, AppSettingDef, AppSettings, AppSettingsProblem, Bag, CallKind, CallKindRule, CallProblem, CardLayout, DocumentKind, EnterKey, FlowResult, HeaderScroll, LayoutBox, LayoutScroller, LayoutSnapshot, LoginStorage, LoginWhen, MenuEntryKind, Orientation, Pagination, PaginationAlign, PaginationPlacement, PaginationType, Setting, StepResult, Storage, TemporalPart, TermsDocument, TestDevice, TestExpect, TestFlow, TestProblem, TestRun, TestStep, TestTempo, TestUser, TestUserEntry };
|