@yomotech/view-toolkit 1.0.50 → 1.0.56
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 +1408 -12
- package/fesm2022/yomotech-view-toolkit-catalog.mjs.map +1 -1
- package/fesm2022/yomotech-view-toolkit.mjs +1143 -333
- package/fesm2022/yomotech-view-toolkit.mjs.map +1 -1
- package/package.json +3 -2
- package/types/yomotech-view-toolkit-catalog.d.ts +525 -47
- package/types/yomotech-view-toolkit.d.ts +254 -11
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-02
|
|
2
|
+
// - new: display style iso for date fields - 2026-10-30 (with time 14:00) in every language (OFFENE-PUNKTE 80)
|
|
3
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
|
|
4
|
+
// - new: maxLinesOf (option.maxLines - a shown text ends with … after n lines), alignRowsOf (card list: the cards of a
|
|
5
|
+
// row equally high, buttons at the bottom; center.option.alignRows, on for new card lists)
|
|
6
|
+
// - new: ENTER_KEYS, enterKeyFor - the key at the bottom right of the app keyboard (option.enterKey: done, search, next)
|
|
1
7
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-29
|
|
2
8
|
// - new: CARD_LAYOUTS / cardLayoutOf - the card field in one, two or three rows (option.cardLayout, OFFENE-PUNKTE 103)
|
|
3
9
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
@@ -292,6 +298,17 @@ function cardLayoutOf(option) {
|
|
|
292
298
|
const value = option?.cardLayout;
|
|
293
299
|
return CARD_LAYOUTS.includes(value) ? value : 'oneRow';
|
|
294
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* The key at the bottom right of the app keyboard (option.enterKey), set in the Designer per field:
|
|
303
|
+
* done closes the keyboard (default), search sends Enter so the field's action runs (a search starts),
|
|
304
|
+
* next moves on to the next field. The header's search field has search as its default.
|
|
305
|
+
*/
|
|
306
|
+
const ENTER_KEYS = ['done', 'search', 'next'];
|
|
307
|
+
/** A field's key at the bottom right: its option.enterKey when known, else the given default. */
|
|
308
|
+
function enterKeyFor(option, fallback = 'done') {
|
|
309
|
+
const own = option?.enterKey;
|
|
310
|
+
return ENTER_KEYS.includes(own) ? own : fallback;
|
|
311
|
+
}
|
|
295
312
|
/** The toolkit keyboards a field can ask for (option.keyboardType). */
|
|
296
313
|
const KEYBOARD_TYPES = ['string', 'alpha', 'numeric', 'email', 'date', 'time'];
|
|
297
314
|
/** keyboardType values that keep the device's system keyboard. */
|
|
@@ -363,19 +380,19 @@ function temporalPart(property) {
|
|
|
363
380
|
* - send: ISO with the device's offset, 2026-10-18T08:00:00+02:00 (the daily split of the time
|
|
364
381
|
* recording, convertToDailyLogs, stays as it is)
|
|
365
382
|
* - shown and typed: the app language, year with four digits (de 18.10.2026, time 08:05);
|
|
366
|
-
* lists: displayFormat short / medium (default) / long / custom
|
|
383
|
+
* lists: displayFormat short / medium (default) / long / iso (2026-10-30 in every language) / custom
|
|
367
384
|
*/
|
|
368
385
|
const TEMPORAL_TRANSFER = {
|
|
369
386
|
read: 'iso, local wall time, offset dropped',
|
|
370
387
|
send: 'iso with local offset',
|
|
371
388
|
show: 'app language, four-digit year',
|
|
372
|
-
listStyles: ['short', 'medium', 'long', 'custom'],
|
|
389
|
+
listStyles: ['short', 'medium', 'long', 'iso', 'custom'],
|
|
373
390
|
listDefault: 'medium',
|
|
374
391
|
};
|
|
375
392
|
/** The encodings a field can declare (option.fieldData.format). */
|
|
376
393
|
const DATA_FORMATS = ['iso-date', 'iso-time', 'iso-datetime', 'flag', 'decimal'];
|
|
377
394
|
/** How a date or time is shown (option.displayFormat). */
|
|
378
|
-
const DISPLAY_FORMATS = ['short', 'medium', 'long', 'custom'];
|
|
395
|
+
const DISPLAY_FORMATS = ['short', 'medium', 'long', 'iso', 'custom'];
|
|
379
396
|
/** How a number is shown (option.numberStyle). */
|
|
380
397
|
const NUMBER_STYLES = ['decimal', 'currency', 'percent'];
|
|
381
398
|
const setting = (key, label, kind = 'text', values, hint) => ({ key, label, kind, values, hint });
|
|
@@ -414,7 +431,8 @@ function displaySettings(schema, fallback, option) {
|
|
|
414
431
|
if (c === 'multiselect')
|
|
415
432
|
result.push(setting('maxVisible', 'Visible selected items', 'number'));
|
|
416
433
|
if ((['iso-date', 'iso-time', 'iso-datetime'].includes(f) && ['textInput', 'datepicker', 'timepicker', 'dateTimepicker', 'output'].includes(c)) || c === 'dateRangepicker') {
|
|
417
|
-
|
|
434
|
+
// iso: 2026-10-30 (with a time 14:00) in every language
|
|
435
|
+
result.push(setting('displayFormat', 'Display style', 'select', ['short', 'medium', 'long', 'iso', 'custom']));
|
|
418
436
|
if (option.displayFormat === 'custom')
|
|
419
437
|
result.push(setting('customDisplayFormat', 'Fixed display pattern', 'text', undefined, 'Use only when every locale must show the same pattern.'));
|
|
420
438
|
result.push(setting('displayTimezone', 'Display timezone', 'text', undefined, 'local, UTC, or an IANA timezone such as Asia/Karachi.'));
|
|
@@ -651,7 +669,59 @@ function assertFieldSettings(schema, fallback, option, context) {
|
|
|
651
669
|
if (errors.length)
|
|
652
670
|
throw new Error('Invalid field layout: ' + errors.join(' '));
|
|
653
671
|
}
|
|
672
|
+
/**
|
|
673
|
+
* A text shown in a list (card, grid) ends with … after this many lines (option.maxLines, set in the Designer: 1-20);
|
|
674
|
+
* 0 = no limit. The whole text stays on the detail page (user 2026-11-01).
|
|
675
|
+
*/
|
|
676
|
+
function maxLinesOf(option) {
|
|
677
|
+
const n = Math.floor(Number(option?.maxLines));
|
|
678
|
+
return Number.isFinite(n) && n >= 1 && n <= 20 ? n : 0;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* A card list's cards of a row are equally high and their buttons stand at the bottom, in line across the row
|
|
682
|
+
* (center.option.alignRows, set in the Designer; on for new card lists, user 2026-11-01).
|
|
683
|
+
*/
|
|
684
|
+
function alignRowsOf(center) {
|
|
685
|
+
return center?.option?.alignRows === true;
|
|
686
|
+
}
|
|
654
687
|
|
|
688
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-04
|
|
689
|
+
// - change: tempo in seconds (DEFAULT_TEMPO_SECONDS 0.2) - the pause before each step is set at "Run tests"; the names
|
|
690
|
+
// fast, normal, slow stay valid
|
|
691
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-02
|
|
692
|
+
// - new: step signOut - signed out from here on, like a person with the sign-out of the user in the side menu
|
|
693
|
+
// - new: dateDisplay "iso" (a field in display style iso) - localeKeys types a date as yyyymmdd and localeRenderings
|
|
694
|
+
// expects 2026-10-30 (with a time 14:00) in every language; "any" takes the ISO form besides the language's
|
|
695
|
+
// - new: stripeTestPaymentMethod - a test run pays with Stripe's test payment method of a test card (pm_card_visa for
|
|
696
|
+
// 4242 4242 4242 4242) - nobody can type into Stripe's frame; only with a test key (pk_test_), never a live one
|
|
697
|
+
// - new: hasAppKeyboard - only mobile and tablet type on the app's keyboard; a laptop or desktop types on its own, the
|
|
698
|
+
// keyboard checks (isKeyboardCheck: keyboard, fieldVisible, restored, inFrame keyboard) are not for them (luv2shop a05
|
|
699
|
+
// and a09 on the laptop, 2026-11-02) - one list, the runners ask it
|
|
700
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
|
|
701
|
+
// - change: signIn takes true (the default test user) or a test user's name (Vault, test-signin.ts)
|
|
702
|
+
// - new: TEST_TEMPOS, tempoPause - how fast a run goes, chosen only at "Run tests" (fast, normal, slow)
|
|
703
|
+
// - new: layout rule align - with card.alignRows the buttons of a card row stand on one line
|
|
704
|
+
// - fix: overlap - a box scrolled under the fixed header is hidden, not covering (inBar)
|
|
705
|
+
// - new: layout rule header - a fixed header stays in sight; a note when the header scrolls along
|
|
706
|
+
// - new: layout - content in an area that scrolls sideways (a wide table) is reached, not beyond; layoutNotes;
|
|
707
|
+
// StepResult.notes
|
|
708
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-31
|
|
709
|
+
// - new: lists in one place (point 5): RTL_LANGUAGES with ckb and dv (the editor had them, sd was missing there),
|
|
710
|
+
// deviceChoices(), PLACEHOLDER_SOURCE and matchesTemplate (fallback {{x | y}} too, as validate.py)
|
|
711
|
+
// - new: StepResult.details - a failed step's measurements
|
|
712
|
+
// - change: the test device "phone" is called "mobile" (the preview's word); "phone" is still taken as old spelling
|
|
713
|
+
// - new: step signIn - signed in from here on (a person in the preview, the test user on the simulators)
|
|
714
|
+
// - change: expect shows takes a language key too - shown in the language of the run
|
|
715
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-31
|
|
716
|
+
// - new: languages and locale - a flow runs in each of its languages (languages: ["en","de"] or "all" = the app's
|
|
717
|
+
// left-to-right languages; right-to-left is left out until it is supported); step language (switch on the way),
|
|
718
|
+
// step reload; typed values may be language-neutral (2026-10-30, 14:00, 12.50) - localeKeys gives the keys in the
|
|
719
|
+
// language's order and form; expect formatted (date / time / datetime / number / currency in the language's form,
|
|
720
|
+
// localeRenderings) and translated (no text of the page missing in the language)
|
|
721
|
+
// - new: keyboard - expect fieldVisible (the field stays visible above an open keyboard) and restored (the page stands
|
|
722
|
+
// as before the keyboard opened); layout - expect layout and layoutProblems (rules on what the page shows: nothing
|
|
723
|
+
// beyond the frame, no sideways scrolling, no overlapping fields or buttons, no text squeezed into a narrow column,
|
|
724
|
+
// fields of one row on one line) - the runners measure, these rules judge (OFFENE-PUNKTE 143)
|
|
655
725
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-29
|
|
656
726
|
// - new: expect cardRows - the card field's rows (1-3), none of its parts wider than the field (OFFENE-PUNKTE 103)
|
|
657
727
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-29
|
|
@@ -680,16 +750,39 @@ const TESTS_DIR = '.liveforge/tests';
|
|
|
680
750
|
const RESULTS_DIR = '.liveforge/results';
|
|
681
751
|
/** The app's test data, shared by its tests: { customer: { firstName: "Max" }, card: { number: "4242…" } } */
|
|
682
752
|
const TEST_DATA_FILE = '.liveforge/test-data.json';
|
|
683
|
-
const TEST_DEVICES = ['
|
|
753
|
+
const TEST_DEVICES = ['mobile', 'tablet', 'laptop', 'desktop'];
|
|
754
|
+
/** Old spellings of a device, still taken: "phone" is "mobile" (2026-10-31, the preview's word). */
|
|
755
|
+
const OLD_DEVICE_NAMES = { phone: 'mobile' };
|
|
684
756
|
const ORIENTATIONS = ['portrait', 'landscape'];
|
|
685
|
-
const STEP_KINDS = ['open', 'menu', 'tap', 'type', 'pick', 'press', 'scroll', 'openRecord', 'close', 'cart', 'rotate', 'device', 'wait', 'expect'];
|
|
757
|
+
const STEP_KINDS = ['open', 'menu', 'tap', 'type', 'pick', 'press', 'scroll', 'openRecord', 'close', 'cart', 'rotate', 'device', 'wait', 'language', 'reload', 'signIn', 'signOut', 'expect'];
|
|
686
758
|
/** What an expect step can check - one of them per step. */
|
|
687
759
|
const EXPECT_KINDS = ['value', 'shows', 'keyboard', 'list', 'message', 'visible', 'hidden', 'locked', 'blocked', 'inFrame',
|
|
688
|
-
'page', 'records', 'recordsAtLeast', 'samePlace', 'cartCount', 'toast', 'checked', 'unchecked', 'cardRows'
|
|
760
|
+
'page', 'records', 'recordsAtLeast', 'samePlace', 'cartCount', 'toast', 'checked', 'unchecked', 'cardRows',
|
|
761
|
+
'formatted', 'translated', 'fieldVisible', 'restored', 'layout'];
|
|
762
|
+
/** How a value is shown in the language's form (expect formatted). */
|
|
763
|
+
const FORMATS = ['date', 'time', 'datetime', 'number', 'currency'];
|
|
764
|
+
/** Languages written right to left - not tested until right-to-left is supported (decision 2026-10-30). */
|
|
765
|
+
const RTL_LANGUAGES = ['ar', 'fa', 'he', 'ur', 'ps', 'sd', 'yi', 'ckb', 'dv'];
|
|
689
766
|
/** What has to stay inside the page frame (safe areas, top gap). */
|
|
690
767
|
const FRAME_PARTS = ['keyboard', 'dialog', 'calendar', 'list', 'menu'];
|
|
691
768
|
const LIST_STATES = ['open', 'closed'];
|
|
692
|
-
const DEFAULT_DEVICES = ['
|
|
769
|
+
const DEFAULT_DEVICES = ['mobile', 'tablet'];
|
|
770
|
+
/** Every device a test can name: each device, portrait and (for mobile and tablet) landscape - the editor's choices. */
|
|
771
|
+
function deviceChoices() {
|
|
772
|
+
return TEST_DEVICES.flatMap((d) => (d === 'mobile' || d === 'tablet' ? [d, `${d}:landscape`] : [d]));
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* A placeholder in a text: {{name}} or {{name | fallback}} (the same pattern as validate.py's, via the contract).
|
|
776
|
+
* As a source, so every runner and the Python validator build their own RegExp from it.
|
|
777
|
+
*/
|
|
778
|
+
const PLACEHOLDER_SOURCE = '\\{\\{\\s*([^}|]+?)\\s*(?:\\|[^}]*)?\\}\\}';
|
|
779
|
+
/** Whether a shown text is a text with placeholders filled in ("Order 4711 saved" for "Order {{id}} saved"). */
|
|
780
|
+
function matchesTemplate(text, template) {
|
|
781
|
+
const parts = String(template).split(new RegExp(PLACEHOLDER_SOURCE));
|
|
782
|
+
// split with a group keeps the names - every other part is a name
|
|
783
|
+
const fixed = parts.filter((_, i) => i % 2 === 0).map((p) => p.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
|
|
784
|
+
return new RegExp(fixed.join('.+?')).test(String(text));
|
|
785
|
+
}
|
|
693
786
|
/**
|
|
694
787
|
* How many runs the backend keeps in .liveforge/results - defaults, the project configuration can
|
|
695
788
|
* change them: at most `max` runs; while they together are bigger than `maxBytes` (mostly images of
|
|
@@ -710,16 +803,54 @@ function resultsToDelete(runs, keep = RESULTS_KEEP) {
|
|
|
710
803
|
}
|
|
711
804
|
/** "tablet:landscape" → { device: 'tablet', orientation: 'landscape' }; null when unknown. */
|
|
712
805
|
function parseDevice(text) {
|
|
713
|
-
const [
|
|
806
|
+
const [written, orientation = 'portrait'] = String(text || '').split(':');
|
|
807
|
+
const device = OLD_DEVICE_NAMES[written] ?? written;
|
|
714
808
|
if (!TEST_DEVICES.includes(device))
|
|
715
809
|
return null;
|
|
716
810
|
if (!ORIENTATIONS.includes(orientation))
|
|
717
811
|
return null;
|
|
718
812
|
return { device: device, orientation: orientation };
|
|
719
813
|
}
|
|
814
|
+
/**
|
|
815
|
+
* Stripe's test cards and the test payment methods Stripe has for them (stripe.com/docs/testing). A test run cannot
|
|
816
|
+
* type into Stripe's card frame (another site's frame) - the card field pays with the test payment method instead.
|
|
817
|
+
*/
|
|
818
|
+
const STRIPE_TEST_CARDS = {
|
|
819
|
+
'4242424242424242': 'pm_card_visa',
|
|
820
|
+
'4000056655665556': 'pm_card_visa_debit',
|
|
821
|
+
'5555555555554444': 'pm_card_mastercard',
|
|
822
|
+
'378282246310005': 'pm_card_amex',
|
|
823
|
+
'4000000000000002': 'pm_card_chargeDeclined',
|
|
824
|
+
'4000000000009995': 'pm_card_chargeDeclinedInsufficientFunds',
|
|
825
|
+
};
|
|
826
|
+
/**
|
|
827
|
+
* The Stripe test payment method for a card number typed in a test ("4242 4242 4242 4242"), or null: only a test
|
|
828
|
+
* card of STRIPE_TEST_CARDS and only with a test key (pk_test_) - a live key never pays this way.
|
|
829
|
+
*/
|
|
830
|
+
function stripeTestPaymentMethod(cardNumber, publishableKey) {
|
|
831
|
+
if (!/^pk_test_/.test(String(publishableKey || '')))
|
|
832
|
+
return null;
|
|
833
|
+
return STRIPE_TEST_CARDS[String(cardNumber || '').replace(/[\s-]/g, '')] ?? null;
|
|
834
|
+
}
|
|
835
|
+
/** The devices that type on the app's own keyboard. A laptop or desktop types on its own keyboard - nothing opens. */
|
|
836
|
+
const APP_KEYBOARD_DEVICES = ['mobile', 'tablet'];
|
|
837
|
+
/** Does the device ("tablet:landscape") type on the app's keyboard? The keyboard checks are only for those. */
|
|
838
|
+
function hasAppKeyboard(device) {
|
|
839
|
+
const parsed = parseDevice(device);
|
|
840
|
+
return !!parsed && APP_KEYBOARD_DEVICES.includes(parsed.device);
|
|
841
|
+
}
|
|
842
|
+
/** A check about the app's keyboard - made only where the app keyboard opens (hasAppKeyboard). */
|
|
843
|
+
function isKeyboardCheck(e) {
|
|
844
|
+
return !!e && (e.keyboard !== undefined || !!e.fieldVisible || !!e.restored || e.inFrame === 'keyboard');
|
|
845
|
+
}
|
|
720
846
|
/** The devices a flow runs on. */
|
|
721
847
|
function flowDevices(flow) {
|
|
722
|
-
|
|
848
|
+
// an old spelling ("phone") as today's name ("mobile")
|
|
849
|
+
return (flow.devices?.length ? flow.devices : DEFAULT_DEVICES).map((d) => {
|
|
850
|
+
const [name, orientation] = String(d).split(':');
|
|
851
|
+
const now = OLD_DEVICE_NAMES[name] ?? name;
|
|
852
|
+
return orientation ? `${now}:${orientation}` : now;
|
|
853
|
+
});
|
|
723
854
|
}
|
|
724
855
|
/** The kind of a step - the first step key it has. */
|
|
725
856
|
function stepKind(step) {
|
|
@@ -729,6 +860,184 @@ const text = (v) => typeof v === 'string' && v.trim().length > 0;
|
|
|
729
860
|
/** The problems of a flow; an empty list means it can run. */
|
|
730
861
|
/** Step and check keys that hold a number. */
|
|
731
862
|
const NUMBER_KEYS = new Set(['scroll', 'openRecord', 'wait', 'records', 'recordsAtLeast', 'cartCount', 'cardRows']);
|
|
863
|
+
/** 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. */
|
|
864
|
+
function flowLanguages(flow, appLanguages, main) {
|
|
865
|
+
const ltr = (codes) => [...new Set(codes.map((c) => String(c).slice(0, 2).toLowerCase()))].filter((c) => c && !RTL_LANGUAGES.includes(c));
|
|
866
|
+
if (flow.languages === 'all')
|
|
867
|
+
return ltr(appLanguages.length ? appLanguages : [main]);
|
|
868
|
+
if (Array.isArray(flow.languages) && flow.languages.length)
|
|
869
|
+
return ltr(flow.languages);
|
|
870
|
+
return ltr([main]);
|
|
871
|
+
}
|
|
872
|
+
const NEUTRAL_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
873
|
+
const NEUTRAL_TIME = /^(\d{2}):(\d{2})$/;
|
|
874
|
+
const NEUTRAL_DATETIME = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})$/;
|
|
875
|
+
const NEUTRAL_NUMBER = /^-?\d+\.\d+$/;
|
|
876
|
+
/** 12 hours with AM/PM in this language? */
|
|
877
|
+
function uses12Hours(lang) {
|
|
878
|
+
try {
|
|
879
|
+
return new Intl.DateTimeFormat(lang, { hour: 'numeric' }).resolvedOptions().hour12 === true;
|
|
880
|
+
}
|
|
881
|
+
catch {
|
|
882
|
+
return false;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
/** The order of day, month, year in the language's numeric date ("dmy", "mdy", "ymd"). */
|
|
886
|
+
function dateOrder(lang) {
|
|
887
|
+
try {
|
|
888
|
+
return new Intl.DateTimeFormat(lang, { year: 'numeric', month: '2-digit', day: '2-digit' }).formatToParts(new Date(2026, 9, 30))
|
|
889
|
+
.filter((p) => p.type === 'day' || p.type === 'month' || p.type === 'year').map((p) => p.type[0]).join('');
|
|
890
|
+
}
|
|
891
|
+
catch {
|
|
892
|
+
return 'mdy';
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* The keys a person types for a language-neutral value in this language: a date's digits in the language's order
|
|
897
|
+
* (en 10302026, de 30102026), a time as digits with P/A in a 12-hour language (0200P) or 24 hours (1400), a number
|
|
898
|
+
* with the language's decimal sign (de 12,50). Any other text stays as it is - older flows typed the keys themselves.
|
|
899
|
+
*/
|
|
900
|
+
function localeKeys(value, lang, dateDisplay = 'language') {
|
|
901
|
+
const text = String(value);
|
|
902
|
+
// a field in display style iso takes the date as year, month, day in every language
|
|
903
|
+
const order = dateDisplay === 'iso' ? 'ymd' : dateOrder(lang);
|
|
904
|
+
const date = (y, m, d) => order.split('').map((k) => (k === 'd' ? d : k === 'm' ? m : y)).join('');
|
|
905
|
+
const time = (h, min) => {
|
|
906
|
+
if (!uses12Hours(lang))
|
|
907
|
+
return `${h}${min}`;
|
|
908
|
+
const hour = Number(h);
|
|
909
|
+
const h12 = String(hour % 12 === 0 ? 12 : hour % 12).padStart(2, '0');
|
|
910
|
+
return `${h12}${min}${hour < 12 ? 'A' : 'P'}`;
|
|
911
|
+
};
|
|
912
|
+
let m = NEUTRAL_DATETIME.exec(text);
|
|
913
|
+
if (m)
|
|
914
|
+
return `${date(m[1], m[2], m[3])}${time(m[4], m[5])}`;
|
|
915
|
+
m = NEUTRAL_DATE.exec(text);
|
|
916
|
+
if (m)
|
|
917
|
+
return date(m[1], m[2], m[3]);
|
|
918
|
+
m = NEUTRAL_TIME.exec(text);
|
|
919
|
+
if (m)
|
|
920
|
+
return time(m[1], m[2]);
|
|
921
|
+
if (NEUTRAL_NUMBER.test(text)) {
|
|
922
|
+
const sign = new Intl.NumberFormat(lang).formatToParts(1.5).find((p) => p.type === 'decimal')?.value || '.';
|
|
923
|
+
return text.replace('.', sign);
|
|
924
|
+
}
|
|
925
|
+
return text;
|
|
926
|
+
}
|
|
927
|
+
/** Every way the language writes this value (expect formatted) - the field must show one of them; spaces are made plain. */
|
|
928
|
+
function localeRenderings(value, as, lang, currency, dateDisplay = 'language') {
|
|
929
|
+
const out = new Set();
|
|
930
|
+
const add = (s) => out.add(s.replace(/[\u00a0\u202f]/g, ' ').trim());
|
|
931
|
+
const d = NEUTRAL_DATETIME.exec(value) || NEUTRAL_DATE.exec(value);
|
|
932
|
+
const t = NEUTRAL_TIME.exec(value);
|
|
933
|
+
// a field in display style iso: 2026-10-30, with a time 14:00, in every language;
|
|
934
|
+
// "any" - a check that does not know the field's switch takes the ISO form besides the language's
|
|
935
|
+
if ((dateDisplay === 'iso' || dateDisplay === 'any') && d && (as === 'date' || (as === 'datetime' && d[4]))) {
|
|
936
|
+
const iso = `${d[1]}-${d[2]}-${d[3]}`;
|
|
937
|
+
const form = as === 'date' ? iso : `${iso} ${d[4].padStart(2, '0')}:${d[5]}`;
|
|
938
|
+
if (dateDisplay === 'iso')
|
|
939
|
+
return [form];
|
|
940
|
+
add(form);
|
|
941
|
+
}
|
|
942
|
+
try {
|
|
943
|
+
if (as === 'date' && d) {
|
|
944
|
+
const day = new Date(Number(d[1]), Number(d[2]) - 1, Number(d[3]));
|
|
945
|
+
for (const style of [{ year: 'numeric', month: '2-digit', day: '2-digit' }, { year: 'numeric', month: 'numeric', day: 'numeric' },
|
|
946
|
+
{ dateStyle: 'medium' }, { dateStyle: 'long' }, { dateStyle: 'short' }])
|
|
947
|
+
add(new Intl.DateTimeFormat(lang, style).format(day));
|
|
948
|
+
}
|
|
949
|
+
else if ((as === 'time' && t) || (as === 'datetime' && d && d[4])) {
|
|
950
|
+
const at = t ? new Date(2026, 0, 1, Number(t[1]), Number(t[2])) : new Date(Number(d[1]), Number(d[2]) - 1, Number(d[3]), Number(d[4]), Number(d[5]));
|
|
951
|
+
for (const hour of ['2-digit', 'numeric']) {
|
|
952
|
+
const time = new Intl.DateTimeFormat(lang, { hour, minute: '2-digit' }).format(at);
|
|
953
|
+
if (as === 'time')
|
|
954
|
+
add(time);
|
|
955
|
+
else
|
|
956
|
+
for (const style of [{ year: 'numeric', month: '2-digit', day: '2-digit' }, { dateStyle: 'medium' }]) {
|
|
957
|
+
const date = new Intl.DateTimeFormat(lang, style).format(at);
|
|
958
|
+
add(`${date} ${time}`);
|
|
959
|
+
add(`${date}, ${time}`);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
else if (as === 'number' && /^-?\d+(\.\d+)?$/.test(value)) {
|
|
964
|
+
const n = Number(value), decimals = (value.split('.')[1] || '').length;
|
|
965
|
+
add(new Intl.NumberFormat(lang, { minimumFractionDigits: decimals, maximumFractionDigits: decimals }).format(n));
|
|
966
|
+
add(new Intl.NumberFormat(lang).format(n));
|
|
967
|
+
}
|
|
968
|
+
else if (as === 'currency' && /^-?\d+(\.\d+)?$/.test(value) && currency) {
|
|
969
|
+
add(new Intl.NumberFormat(lang, { style: 'currency', currency }).format(Number(value)));
|
|
970
|
+
add(new Intl.NumberFormat(lang, { style: 'currency', currency, currencyDisplay: 'narrowSymbol' }).format(Number(value)));
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
catch { /* an unknown language or currency: no rendering - the check fails with the shown text */ }
|
|
974
|
+
return [...out];
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* The layout rules (OFFENE-PUNKTE 143), judged on what a runner measured: beyond (an element leaves the frame
|
|
978
|
+
* sideways), sideways (the page scrolls sideways), overlap (two fields / buttons cover each other), narrow (a text
|
|
979
|
+
* gets fewer than 3 characters a line), row (fields of one row do not stand on one line). Pixels tolerate 2.
|
|
980
|
+
*/
|
|
981
|
+
function layoutProblems(snap) {
|
|
982
|
+
const problems = [];
|
|
983
|
+
const tol = 2;
|
|
984
|
+
if (snap.scrollsSideways)
|
|
985
|
+
problems.push({ rule: 'sideways', detail: 'the page scrolls sideways' });
|
|
986
|
+
const boxes = snap.boxes.filter((b) => b.right - b.left > 0 && b.bottom - b.top > 0);
|
|
987
|
+
// a fixed header stays in sight however far the page is scrolled (user 2026-11-01)
|
|
988
|
+
const h = snap.header;
|
|
989
|
+
if (h && h.scroll === 'fixed' && (h.top < -tol || h.bottom <= 0))
|
|
990
|
+
problems.push({ rule: 'header', detail: `the header left the screen (${Math.round(h.top)}–${Math.round(h.bottom)}) although it is fixed` });
|
|
991
|
+
// aligned card rows (card.alignRows): the buttons of a row stand on one line (user 2026-11-01)
|
|
992
|
+
(snap.cardRows || []).forEach((tops, i) => {
|
|
993
|
+
if (Math.max(...tops) - Math.min(...tops) > tol)
|
|
994
|
+
problems.push({ rule: 'align', detail: `the buttons of card row ${i + 1} do not stand on one line (${tops.map((t) => Math.round(t)).join(', ')})` });
|
|
995
|
+
});
|
|
996
|
+
for (const s of snap.scrollers || []) {
|
|
997
|
+
if (s.left < -tol || s.right > snap.width + tol)
|
|
998
|
+
problems.push({ rule: 'beyond', detail: `area "${s.name}" leaves the frame (${Math.round(s.left)}–${Math.round(s.right)} of ${snap.width})` });
|
|
999
|
+
}
|
|
1000
|
+
for (const b of boxes) {
|
|
1001
|
+
// in an area that scrolls sideways (a wide table) it is reached by swiping there - not lost (user 2026-11-01)
|
|
1002
|
+
if (!b.scroller && (b.left < -tol || b.right > snap.width + tol))
|
|
1003
|
+
problems.push({ rule: 'beyond', detail: `${b.kind} "${b.name}" leaves the frame (${Math.round(b.left)}–${Math.round(b.right)} of ${snap.width})` });
|
|
1004
|
+
if (b.kind === 'text' && b.charsPerLine !== undefined && b.charsPerLine < 3)
|
|
1005
|
+
problems.push({ rule: 'narrow', detail: `text "${b.name}" gets ${b.charsPerLine} characters a line` });
|
|
1006
|
+
}
|
|
1007
|
+
// what the page scrolled under a fixed header is hidden by it, not covering it (user 2026-11-01): a box outside the
|
|
1008
|
+
// top bar counts only below it
|
|
1009
|
+
const barBottom = h && h.scroll !== 'scrollsAlong' ? h.bottom : 0;
|
|
1010
|
+
// only the part below the header counts - the rest is hidden by it
|
|
1011
|
+
const solid = boxes.filter((b) => (b.kind === 'field' || b.kind === 'button') && (b.inBar || b.bottom > barBottom + tol))
|
|
1012
|
+
.map((b) => (b.inBar ? b : { ...b, top: Math.max(b.top, barBottom) }));
|
|
1013
|
+
for (let i = 0; i < solid.length; i++) {
|
|
1014
|
+
for (let j = i + 1; j < solid.length; j++) {
|
|
1015
|
+
const a = solid[i], c = solid[j];
|
|
1016
|
+
const w = Math.min(a.right, c.right) - Math.max(a.left, c.left);
|
|
1017
|
+
const h = Math.min(a.bottom, c.bottom) - Math.max(a.top, c.top);
|
|
1018
|
+
if (w > tol && h > tol)
|
|
1019
|
+
problems.push({ rule: 'overlap', detail: `${a.kind} "${a.name}" and ${c.kind} "${c.name}" cover each other` });
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
const rows = new Map();
|
|
1023
|
+
for (const b of boxes.filter((x) => x.kind === 'field' && x.row))
|
|
1024
|
+
rows.set(b.row, [...(rows.get(b.row) || []), b]);
|
|
1025
|
+
for (const [row, members] of rows) {
|
|
1026
|
+
if (members.length < 2)
|
|
1027
|
+
continue;
|
|
1028
|
+
const tops = members.map((m) => m.top);
|
|
1029
|
+
if (Math.max(...tops) - Math.min(...tops) > 8)
|
|
1030
|
+
problems.push({ rule: 'row', detail: `fields of row "${row}" do not stand on one line (${members.map((m) => m.name).join(', ')})` });
|
|
1031
|
+
}
|
|
1032
|
+
return problems;
|
|
1033
|
+
}
|
|
1034
|
+
/** Hints that fail nothing: the areas that scroll sideways (a wide table) - shown with a passing layout check. */
|
|
1035
|
+
function layoutNotes(snap) {
|
|
1036
|
+
const notes = (snap.scrollers || []).map((s) => `${s.name} scrolls sideways (${Math.round(s.content)} of ${Math.round(s.shown)} px)`);
|
|
1037
|
+
if (snap.header?.scroll === 'scrollsAlong')
|
|
1038
|
+
notes.push('the header scrolls along - cart, search and the page X are out of reach after scrolling');
|
|
1039
|
+
return notes;
|
|
1040
|
+
}
|
|
732
1041
|
/** {{data.customer.firstName}} - a value of the test data; anything else in braces is no test data. */
|
|
733
1042
|
const DATA_REF = /\{\{\s*([^}]*?)\s*\}\}/g;
|
|
734
1043
|
function stringsOf(node, out = []) {
|
|
@@ -815,6 +1124,9 @@ function checkTestFlow(flow, data) {
|
|
|
815
1124
|
add('nameMissing');
|
|
816
1125
|
if (flow.books !== undefined && typeof flow.books !== 'boolean')
|
|
817
1126
|
add('booksNotBoolean');
|
|
1127
|
+
if (flow.languages !== undefined && flow.languages !== 'all'
|
|
1128
|
+
&& !(Array.isArray(flow.languages) && flow.languages.every((l) => /^[a-z]{2}$/i.test(String(l)))))
|
|
1129
|
+
add('languagesInvalid');
|
|
818
1130
|
if (flow.devices !== undefined) {
|
|
819
1131
|
if (!Array.isArray(flow.devices))
|
|
820
1132
|
add('devicesNotList');
|
|
@@ -882,6 +1194,24 @@ function checkTestFlow(flow, data) {
|
|
|
882
1194
|
if (typeof step.wait !== 'number' || step.wait < 0 || step.wait > 60000)
|
|
883
1195
|
add('waitOutOfRange', n);
|
|
884
1196
|
break;
|
|
1197
|
+
case 'language':
|
|
1198
|
+
if (!/^[a-z]{2}$/i.test(String(step.language || '')))
|
|
1199
|
+
add('languageUnknown', n, { language: String(step.language) });
|
|
1200
|
+
break;
|
|
1201
|
+
case 'reload':
|
|
1202
|
+
case 'signOut':
|
|
1203
|
+
if (step[kind] !== true)
|
|
1204
|
+
add('notTrue', n, { kind });
|
|
1205
|
+
break;
|
|
1206
|
+
case 'signIn':
|
|
1207
|
+
// true: the test user "default"; a name: that test user - both stand in the app's test data (testUsers, with
|
|
1208
|
+
// their Vault entry); nothing about them is in the code
|
|
1209
|
+
if (step.signIn !== true && !(typeof step.signIn === 'string' && /^[a-zA-Z0-9_-]{1,40}$/.test(step.signIn)))
|
|
1210
|
+
add('signInInvalid', n);
|
|
1211
|
+
else if (data !== undefined && !data?.testUsers?.[step.signIn === true ? 'default' : step.signIn]?.vault) {
|
|
1212
|
+
add('testUserUnknown', n, { user: step.signIn === true ? 'default' : String(step.signIn) });
|
|
1213
|
+
}
|
|
1214
|
+
break;
|
|
885
1215
|
case 'expect':
|
|
886
1216
|
checkExpect(step.expect, n, add);
|
|
887
1217
|
break;
|
|
@@ -894,7 +1224,8 @@ function checkExpect(e, n, add) {
|
|
|
894
1224
|
add('expectNotAnObject', n);
|
|
895
1225
|
return;
|
|
896
1226
|
}
|
|
897
|
-
|
|
1227
|
+
// formatted carries its value (the language-neutral one) - that value is no check of its own
|
|
1228
|
+
const kinds = EXPECT_KINDS.filter((k) => k in e && !(k === 'value' && 'formatted' in e));
|
|
898
1229
|
if (kinds.length !== 1) {
|
|
899
1230
|
add(kinds.length ? 'expectSeveralKinds' : 'expectUnknown', n, { keys: Object.keys(e).join(', ') });
|
|
900
1231
|
return;
|
|
@@ -922,10 +1253,124 @@ function checkExpect(e, n, add) {
|
|
|
922
1253
|
add('notTrue', n, { kind });
|
|
923
1254
|
if (kind === 'cardRows' && !(Number.isInteger(e.cardRows) && e.cardRows >= 1 && e.cardRows <= 3))
|
|
924
1255
|
add('countNotNumber', n, { kind });
|
|
1256
|
+
if (kind === 'formatted') {
|
|
1257
|
+
if (!text(e.field))
|
|
1258
|
+
add('fieldMissing', n, { kind });
|
|
1259
|
+
if (!FORMATS.includes(e.formatted))
|
|
1260
|
+
add('formatUnknown', n, { format: String(e.formatted) });
|
|
1261
|
+
if (typeof e.value !== 'string' && typeof e.value !== 'number')
|
|
1262
|
+
add('valueMissing', n, { kind });
|
|
1263
|
+
if (e.formatted === 'currency' && !/^[A-Z]{3}$/.test(String(e.currency || '')))
|
|
1264
|
+
add('currencyMissing', n);
|
|
1265
|
+
}
|
|
1266
|
+
if (kind === 'fieldVisible' && !text(e.fieldVisible))
|
|
1267
|
+
add('stepNameMissing', n, { kind });
|
|
1268
|
+
if ((kind === 'translated' || kind === 'restored' || kind === 'layout') && e[kind] !== true)
|
|
1269
|
+
add('notTrue', n, { kind });
|
|
925
1270
|
if (kind === 'cartCount' && !(Number.isInteger(e.cartCount) && e.cartCount >= 0) && !/^[+-]\d+$/.test(String(e.cartCount)))
|
|
926
1271
|
add('countNotNumber', n, { kind });
|
|
927
1272
|
}
|
|
1273
|
+
/**
|
|
1274
|
+
* How fast a run goes - chosen only where the run is started (preview: the choice beside "Run tests"; devices:
|
|
1275
|
+
* --tempo=…), never in a test (user 2026-11-01): the seconds before each step (user 2026-11-04), or one of the names
|
|
1276
|
+
* fast (no pause), normal (a short pause), slow (a long pause, to watch it). The checks' time limits start after the pause.
|
|
1277
|
+
*/
|
|
1278
|
+
const TEST_TEMPOS = ['fast', 'normal', 'slow'];
|
|
1279
|
+
/**
|
|
1280
|
+
* The seconds before each step when nobody chose. A form takes a typed value only in a later task of the browser: a step
|
|
1281
|
+
* right after the typing found the field still empty; a person's next click is always later (measured 2026-11-04: 0.1 is
|
|
1282
|
+
* enough, 0.2 leaves a margin).
|
|
1283
|
+
*/
|
|
1284
|
+
const DEFAULT_TEMPO_SECONDS = 0.2;
|
|
1285
|
+
/** The pause before a step in ms - from seconds or a name; unknown tempo: fast. */
|
|
1286
|
+
function tempoPause(tempo) {
|
|
1287
|
+
if (tempo === 'normal')
|
|
1288
|
+
return 600;
|
|
1289
|
+
if (tempo === 'slow')
|
|
1290
|
+
return 1800;
|
|
1291
|
+
const seconds = typeof tempo === 'string' && tempo.trim() === '' ? NaN : Number(tempo);
|
|
1292
|
+
return Number.isFinite(seconds) && seconds > 0 ? Math.round(seconds * 1000) : 0;
|
|
1293
|
+
}
|
|
928
1294
|
|
|
1295
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
|
|
1296
|
+
// - new: the test sign-in without the ui-backend (user 2026-11-01: "stelle dir vor es existiert kein ui-backend für
|
|
1297
|
+
// die tests"): a runner signs in to Vault itself (a Vault token, or a JWT - the GitLab job's ID token, the
|
|
1298
|
+
// Designer person's Keycloak token), reads the test user of the app (liveforge/tenants/<tenant>/e2e/<app>/<name>)
|
|
1299
|
+
// - the sign-in data only: the app signs in at its Keycloak itself, the runner fills the app's own window like a
|
|
1300
|
+
// person (user 2026-11-01: "die App muss sich beim Keycloak authentifizieren und bekommt von uns nur die
|
|
1301
|
+
// Anmeldedaten"). totp gives the authenticator code. fetch and crypto.subtle are passed in or global.
|
|
1302
|
+
/** The test user a step names (signIn true -> "default") from the app's test data; null when the app has none. */
|
|
1303
|
+
function testUserEntry(data, name) {
|
|
1304
|
+
const key = name === true ? 'default' : String(name || 'default');
|
|
1305
|
+
const entry = data?.testUsers?.[key];
|
|
1306
|
+
return entry && typeof entry.vault === 'string' && entry.vault.includes('/') ? entry : null;
|
|
1307
|
+
}
|
|
1308
|
+
/** "liveforge/tenants/dev/e2e/tm-test/default" -> the KV v2 mount and the path inside it. */
|
|
1309
|
+
function vaultPlace(vault) {
|
|
1310
|
+
const [mount, ...rest] = String(vault).replace(/^\/+|\/+$/g, '').split('/');
|
|
1311
|
+
return { mount, path: rest.join('/') };
|
|
1312
|
+
}
|
|
1313
|
+
/** base32 (RFC 4648, the authenticator apps' form) to bytes. */
|
|
1314
|
+
function base32Bytes(secret) {
|
|
1315
|
+
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
|
|
1316
|
+
const clean = String(secret || '').toUpperCase().replace(/[^A-Z2-7]/g, '');
|
|
1317
|
+
const out = [];
|
|
1318
|
+
let bits = 0;
|
|
1319
|
+
let value = 0;
|
|
1320
|
+
for (const ch of clean) {
|
|
1321
|
+
value = (value << 5) | alphabet.indexOf(ch);
|
|
1322
|
+
bits += 5;
|
|
1323
|
+
if (bits >= 8) {
|
|
1324
|
+
out.push((value >>> (bits - 8)) & 0xff);
|
|
1325
|
+
bits -= 8;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
return new Uint8Array(out);
|
|
1329
|
+
}
|
|
1330
|
+
/** The authenticator code (TOTP, RFC 6238: HMAC-SHA1, 30 s, 6 digits) of a key at a time. */
|
|
1331
|
+
async function totp(secret, now = Date.now(), subtle = globalThis.crypto?.subtle) {
|
|
1332
|
+
const counter = Math.floor(now / 1000 / 30);
|
|
1333
|
+
const msg = new Uint8Array(8);
|
|
1334
|
+
let c = counter;
|
|
1335
|
+
for (let i = 7; i >= 0; i--) {
|
|
1336
|
+
msg[i] = c & 0xff;
|
|
1337
|
+
c = Math.floor(c / 256);
|
|
1338
|
+
}
|
|
1339
|
+
const key = await subtle.importKey('raw', base32Bytes(secret), { name: 'HMAC', hash: 'SHA-1' }, false, ['sign']);
|
|
1340
|
+
const mac = new Uint8Array(await subtle.sign('HMAC', key, msg));
|
|
1341
|
+
const offset = mac[mac.length - 1] & 0x0f;
|
|
1342
|
+
const code = ((mac[offset] & 0x7f) << 24) | (mac[offset + 1] << 16) | (mac[offset + 2] << 8) | mac[offset + 3];
|
|
1343
|
+
return String(code % 1_000_000).padStart(6, '0');
|
|
1344
|
+
}
|
|
1345
|
+
/** A Vault token from a JWT (auth/<mount>/login, role): the GitLab job's ID token or a person's Keycloak token. */
|
|
1346
|
+
async function vaultJwtLogin(fetchFn, addr, mount, role, jwt) {
|
|
1347
|
+
const answer = await fetchFn(`${addr.replace(/\/+$/, '')}/v1/auth/${mount}/login`, {
|
|
1348
|
+
method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ role, jwt }),
|
|
1349
|
+
});
|
|
1350
|
+
if (!answer.ok)
|
|
1351
|
+
throw new Error(`Vault sign-in refused (${answer.status})`);
|
|
1352
|
+
const token = (await answer.json())?.auth?.client_token;
|
|
1353
|
+
if (!token)
|
|
1354
|
+
throw new Error('Vault gave no token');
|
|
1355
|
+
return token;
|
|
1356
|
+
}
|
|
1357
|
+
/** 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. */
|
|
1358
|
+
async function readTestUser(fetchFn, addr, token, mount, path) {
|
|
1359
|
+
const answer = await fetchFn(`${addr.replace(/\/+$/, '')}/v1/${mount}/data/${path}`, { headers: { 'x-vault-token': token } });
|
|
1360
|
+
if (answer.status === 404)
|
|
1361
|
+
throw new Error(`no test user in Vault at ${mount}/${path}`);
|
|
1362
|
+
if (!answer.ok)
|
|
1363
|
+
throw new Error(`Vault refused reading the test user (${answer.status})`);
|
|
1364
|
+
const data = (await answer.json())?.data?.data || {};
|
|
1365
|
+
if (!data.username || !data.password)
|
|
1366
|
+
throw new Error(`the test user at ${mount}/${path} has no username or password`);
|
|
1367
|
+
return { username: String(data.username), password: String(data.password), otpSecret: data.otpSecret ? String(data.otpSecret) : undefined,
|
|
1368
|
+
tenantKey: data.tenantKey ? String(data.tenantKey) : undefined };
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
|
|
1372
|
+
// - new: HEADER_SCROLLS, headerScrollOf - what the header does when the page scrolls (header.option.scroll):
|
|
1373
|
+
// fixed (default), hideOnScroll (away while scrolling down, back at once when scrolling up), scrollsAlong
|
|
929
1374
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-23
|
|
930
1375
|
// - new: start page, roles and storage of the sign-in (OFFENE-PUNKTE 109): the start page is center.option
|
|
931
1376
|
// and holds for every sign-in setting; a role may have its own start page (login.roles, in the
|
|
@@ -1452,7 +1897,958 @@ function appSettingsMenu(menu, center, context = {}) {
|
|
|
1452
1897
|
}
|
|
1453
1898
|
return [...items, { label: { caption }, icon: 'setting', option: { visible: true }, submenu: added }];
|
|
1454
1899
|
}
|
|
1900
|
+
// ---------------------------------------------------------------- finding a menu entry (2026-10-31)
|
|
1901
|
+
// One way for the app's test runner and the device runner (before: three, searching to different depths and
|
|
1902
|
+
// reading the caption differently - a page under elements / children was not found by the device runner).
|
|
1903
|
+
/** An entry's caption as written in Main: label.caption, a plain label, or caption. */
|
|
1904
|
+
function menuCaption(item) {
|
|
1905
|
+
const label = item?.label;
|
|
1906
|
+
return String((label && typeof label === 'object' ? label.caption : label) ?? item?.caption ?? '');
|
|
1907
|
+
}
|
|
1908
|
+
/** The page an entry opens as tests name it ("pages/sidemenu/books/layout_schema.json" -> "sidemenu/books"); '' without. */
|
|
1909
|
+
function menuPage(item) {
|
|
1910
|
+
return /^pages\/(.+)\/layout_schema\.json$/.exec(String(item?.option?.layout_url ?? ''))?.[1] ?? '';
|
|
1911
|
+
}
|
|
1912
|
+
/** Every entry of a menu, at any depth (submenu, elements, children), with its path of captions. */
|
|
1913
|
+
function menuEntries(items, path = []) {
|
|
1914
|
+
const out = [];
|
|
1915
|
+
for (const item of Array.isArray(items) ? items : []) {
|
|
1916
|
+
if (!item || typeof item !== 'object')
|
|
1917
|
+
continue;
|
|
1918
|
+
const caption = menuCaption(item);
|
|
1919
|
+
out.push({ item, caption, page: menuPage(item), path: [...path, caption] });
|
|
1920
|
+
for (const key of ['submenu', 'elements', 'children']) {
|
|
1921
|
+
if (Array.isArray(item[key]))
|
|
1922
|
+
out.push(...menuEntries(item[key], [...path, caption]));
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
return out;
|
|
1926
|
+
}
|
|
1927
|
+
/** The entry that opens a page (its folder under pages/), at any depth. */
|
|
1928
|
+
function menuEntryForPage(items, page) {
|
|
1929
|
+
return menuEntries(items).find((e) => e.page === page)?.item ?? null;
|
|
1930
|
+
}
|
|
1931
|
+
/**
|
|
1932
|
+
* The entry with this caption that opens a page, at any depth: the caption as written in Main, or - the app shows
|
|
1933
|
+
* it translated - the text the language file has for it (texts: written text -> shown text).
|
|
1934
|
+
*/
|
|
1935
|
+
function menuEntryByCaption(items, caption, texts = {}) {
|
|
1936
|
+
const want = [caption, texts[caption]].filter((t) => typeof t === 'string' && !!t);
|
|
1937
|
+
return menuEntries(items).find((e) => e.page && want.includes(e.caption))?.item ?? null;
|
|
1938
|
+
}
|
|
1939
|
+
/**
|
|
1940
|
+
* What the header does when the page scrolls (main/layout_schema.json header.option.scroll, user 2026-11-01):
|
|
1941
|
+
* fixed - stays at the top (default, usual for shops and apps on every device); hideOnScroll - moves away while
|
|
1942
|
+
* scrolling down and comes back at once when scrolling up ("quick return", room on a phone); scrollsAlong - scrolls
|
|
1943
|
+
* away with the page: cart, search and the page X are out of reach after scrolling, and going back from them puts
|
|
1944
|
+
* a list at its top (found 2026-11-01, luv2shop a06).
|
|
1945
|
+
*/
|
|
1946
|
+
const HEADER_SCROLLS = ['fixed', 'hideOnScroll', 'scrollsAlong'];
|
|
1947
|
+
/** The header's behaviour when the page scrolls - its option.scroll when known, else fixed. */
|
|
1948
|
+
function headerScrollOf(header) {
|
|
1949
|
+
const own = header?.option?.scroll;
|
|
1950
|
+
return HEADER_SCROLLS.includes(own) ? own : 'fixed';
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-03
|
|
1954
|
+
// - new: convertOlderForms - an app's pages and Main written in the new form (OFFENE-PUNKTE 105/145 step 5): every
|
|
1955
|
+
// element's action as withElementAction writes it, a menu entry's call moved into its page (dataSource) when that
|
|
1956
|
+
// page is opened by nothing else (a sign-out entry showing the page afterwards takes its source); what stays (header search field, cart, a page opened in several ways) is listed
|
|
1957
|
+
// - fix: an unknown innerAction is no action (old names it for the check) - it was taken as one
|
|
1958
|
+
// - change: callKindOf reads the new form too (action saveAll / loginForm, innerAction openPage) through elementAction
|
|
1959
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-02
|
|
1960
|
+
// - new: action and innerAction (OFFENE-PUNKTE 105/145): innerAction runs in the app, action calls the backend;
|
|
1961
|
+
// INNER_ACTIONS, BACKEND_ACTIONS, elementAction (reads every older form), withElementAction, checkElementAction,
|
|
1962
|
+
// actionName / actionParams for the code; withPageSource - a page's own data source (dataSource, 145);
|
|
1963
|
+
// loginForm - a sign-in form sending to the backend is a backend action (innerAction login with an address before;
|
|
1964
|
+
// not signIn - that is the test step that signs a test user in)
|
|
1965
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-30
|
|
1966
|
+
// - new: rowAction (an icon of a grid row: any method, default GET - hotel approves with GET), OLD_CALL_KEYS and
|
|
1967
|
+
// successMessageOf (notifcation.success of older data)
|
|
1968
|
+
// - new: the action catalog - the ONE place that says what an element does with its records and which
|
|
1969
|
+
// attributes count for it (OFFENE-PUNKTE 144). Three questions, three places in an option:
|
|
1970
|
+
// what action / innerAction (get, save, delete, saveAll, submit, login …) - CALL_KIND_OF
|
|
1971
|
+
// where storageType: browser (localstorage / sessionstorage) or backend (database) - STORAGES
|
|
1972
|
+
// how only the attributes of that storage and that kind - CALL_KINDS[kind].browser / .backend
|
|
1973
|
+
// The older storageType "filter" is a backend that waits for its filter fields (database + loadOnFilter).
|
|
1974
|
+
// The library, the Designer (<app-call-settings>), the AI contract (capabilities.json) and validate.py read
|
|
1975
|
+
// it from here instead of keeping their own lists. No Angular, no texts.
|
|
1976
|
+
/** Where records are kept. The first two stay in the browser, database is the backend. */
|
|
1977
|
+
const STORAGES = ['localstorage', 'sessionstorage', 'database'];
|
|
1978
|
+
const BROWSER_STORAGES = ['localstorage', 'sessionstorage'];
|
|
1979
|
+
/** Storage values of older data and what they mean now. */
|
|
1980
|
+
const OLD_STORAGES = {
|
|
1981
|
+
filter: { storageType: 'database', loadOnFilter: true },
|
|
1982
|
+
};
|
|
1983
|
+
const MESSAGES = ['successMessage', 'errorMessage'];
|
|
1984
|
+
const CALL_KINDS = {
|
|
1985
|
+
load: {
|
|
1986
|
+
does: 'A menu entry or page shows records: from the browser storage, or loaded from the backend (optionally only once the filter fields are filled).',
|
|
1987
|
+
storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
1988
|
+
methods: ['GET', 'POST'],
|
|
1989
|
+
browser: ['data_url'],
|
|
1990
|
+
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'dataKey', 'loadOnFilter', 'emptyMessage', 'errorMessage'],
|
|
1991
|
+
},
|
|
1992
|
+
link: {
|
|
1993
|
+
does: 'A button opens a detail page that loads its record from the address; the button itself calls nothing.',
|
|
1994
|
+
storages: ['database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
1995
|
+
methods: [],
|
|
1996
|
+
browser: [],
|
|
1997
|
+
backend: ['data_url', 'proxy', 'dataKey'],
|
|
1998
|
+
},
|
|
1999
|
+
select: {
|
|
2000
|
+
does: 'A selection list loads its choices from the backend (option.autocomplete).',
|
|
2001
|
+
storages: ['database'], defaultStorage: 'database', addressKey: 'url',
|
|
2002
|
+
methods: ['POST', 'GET'],
|
|
2003
|
+
browser: [],
|
|
2004
|
+
// option.autocomplete writes url; a selection field of its own (luv2shop countries) data_url
|
|
2005
|
+
backend: ['url', 'data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dataKey', 'errorMessage'],
|
|
2006
|
+
},
|
|
2007
|
+
save: {
|
|
2008
|
+
does: 'A card button sends this one record to the backend, or keeps it in a browser list (data_url = its name): with key a second click takes it out again, maxRecords keeps the newest.',
|
|
2009
|
+
storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
2010
|
+
methods: ['POST', 'PUT'],
|
|
2011
|
+
browser: ['data_url', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
|
|
2012
|
+
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'afterSuccess', ...MESSAGES],
|
|
2013
|
+
},
|
|
2014
|
+
saveAll: {
|
|
2015
|
+
does: 'A header button sends all records of the page to the backend, one by one or in one call.',
|
|
2016
|
+
storages: ['database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
2017
|
+
methods: ['POST', 'PUT'],
|
|
2018
|
+
browser: [],
|
|
2019
|
+
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'sendMode', 'afterSuccess', ...MESSAGES],
|
|
2020
|
+
},
|
|
2021
|
+
submit: {
|
|
2022
|
+
does: 'A form or dialog button keeps its record in the browser storage (with key: a record of the same key value is replaced) or sends it to the backend.',
|
|
2023
|
+
storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'localstorage', addressKey: 'data_url',
|
|
2024
|
+
methods: ['POST', 'PUT'],
|
|
2025
|
+
browser: ['data_url', 'key', 'afterSuccessPage', ...MESSAGES],
|
|
2026
|
+
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'afterSuccess', 'afterSuccessPage', ...MESSAGES],
|
|
2027
|
+
},
|
|
2028
|
+
delete: {
|
|
2029
|
+
does: 'A button deletes the record - from the browser storage or at the backend; it asks first.',
|
|
2030
|
+
storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
2031
|
+
methods: ['DELETE', 'POST'],
|
|
2032
|
+
browser: ['data_url', 'confirmDelete', 'deleteMessage', ...MESSAGES],
|
|
2033
|
+
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'key', 'confirmDelete', 'deleteMessage', ...MESSAGES],
|
|
2034
|
+
},
|
|
2035
|
+
rowAction: {
|
|
2036
|
+
does: 'An icon of a grid row (action column save / delete) calls its address with the row\'s fields ({{field}}) and changes only this row after success - the answer, else afterSuccessSet. A key "{{field}}" with a value shows the icon only on rows where that field has that value (hotel: "{{reservationStatus}}": "PENDING").',
|
|
2037
|
+
storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
2038
|
+
methods: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
2039
|
+
browser: ['data_url', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
|
|
2040
|
+
backend: ['data_url', 'proxy', 'method', 'passToken', 'key', 'afterSuccessSet', ...MESSAGES],
|
|
2041
|
+
},
|
|
2042
|
+
login: {
|
|
2043
|
+
does: 'A sign-in form sends its fields to the backend and keeps the answer (loginResponse, userRoleMapping beside it).',
|
|
2044
|
+
storages: ['database'], defaultStorage: 'database', addressKey: 'url',
|
|
2045
|
+
methods: ['POST'],
|
|
2046
|
+
browser: [],
|
|
2047
|
+
backend: ['url', 'proxy', 'method', 'errorMessage'],
|
|
2048
|
+
},
|
|
2049
|
+
};
|
|
2050
|
+
/** Every attribute of storage and call - an option key outside this list is no business of the catalog. */
|
|
2051
|
+
const CALL_KEYS = [...new Set(['storageType',
|
|
2052
|
+
...Object.values(CALL_KINDS).flatMap((rule) => [...rule.browser, ...rule.backend])])];
|
|
2053
|
+
/** Keys of older data and what they are now - read as before, the Designer writes the new key. */
|
|
2054
|
+
const OLD_CALL_KEYS = {
|
|
2055
|
+
'notifcation.success': 'successMessage',
|
|
2056
|
+
'notification.success': 'successMessage',
|
|
2057
|
+
};
|
|
2058
|
+
/** The message after success: successMessage, else the older notification(s).success. */
|
|
2059
|
+
function successMessageOf(option) {
|
|
2060
|
+
return String(option?.successMessage ?? option?.notification?.success ?? option?.notifcation?.success ?? '').trim();
|
|
2061
|
+
}
|
|
2062
|
+
/** Actions that keep no records and call nothing - no storage, no attributes of this catalog. */
|
|
2063
|
+
const NO_CALL_ACTIONS = {
|
|
2064
|
+
'action:login': 'starts the Keycloak sign-in (a redirect, no call of the app)',
|
|
2065
|
+
'action:logout': 'signs out',
|
|
2066
|
+
'action:cart': 'shows the cart; its data_url is the browser key of the cart (cartInfo)',
|
|
2067
|
+
'innerAction:showModal': 'opens a dialog',
|
|
2068
|
+
'innerAction:cancel': 'closes a dialog',
|
|
2069
|
+
'innerAction:addToCart': 'adds to the cart in the browser',
|
|
2070
|
+
};
|
|
2071
|
+
/** The kind of an element by its action / innerAction and where it stands (a menu entry or page loads). */
|
|
2072
|
+
function callKindOf(option, place = 'button') {
|
|
2073
|
+
if (place === 'autocomplete')
|
|
2074
|
+
return 'select';
|
|
2075
|
+
// what it does in the new form - older forms read the same (innerAction saveAll is action saveAll …)
|
|
2076
|
+
const found = elementAction(option, place === 'button' ? 'button' : 'menu');
|
|
2077
|
+
if (found.action)
|
|
2078
|
+
return BACKEND_ACTIONS[found.action].kind;
|
|
2079
|
+
if (found.innerAction === 'openPage')
|
|
2080
|
+
return 'link';
|
|
2081
|
+
if (found.innerAction)
|
|
2082
|
+
return null;
|
|
2083
|
+
if (place === 'menu' || place === 'page')
|
|
2084
|
+
return 'load';
|
|
2085
|
+
return null;
|
|
2086
|
+
}
|
|
2087
|
+
/** The storage an option means: its storageType (any case, an old value translated), else the kind's default. */
|
|
2088
|
+
function storageOf(option, kind) {
|
|
2089
|
+
const type = String(option?.storageType ?? '').trim().toLowerCase();
|
|
2090
|
+
if (STORAGES.includes(type))
|
|
2091
|
+
return type;
|
|
2092
|
+
if (OLD_STORAGES[type])
|
|
2093
|
+
return OLD_STORAGES[type].storageType;
|
|
2094
|
+
// older data: a method without storageType means the backend (luv2shop's purchase: method post, no storageType)
|
|
2095
|
+
if (!type && option?.method)
|
|
2096
|
+
return 'database';
|
|
2097
|
+
if (!type && option?.localStorage === true)
|
|
2098
|
+
return 'localstorage';
|
|
2099
|
+
if (!type && option?.sessionStorage === true)
|
|
2100
|
+
return 'sessionstorage';
|
|
2101
|
+
return CALL_KINDS[kind].defaultStorage;
|
|
2102
|
+
}
|
|
2103
|
+
/** True when the option waits for its filter fields before loading (loadOnFilter, or the older storageType "filter"). */
|
|
2104
|
+
function waitsForFilter(option) {
|
|
2105
|
+
const type = String(option?.storageType ?? '').trim().toLowerCase();
|
|
2106
|
+
return option?.loadOnFilter === true || OLD_STORAGES[type]?.loadOnFilter === true;
|
|
2107
|
+
}
|
|
2108
|
+
/** The attributes that count for this kind with this storage. */
|
|
2109
|
+
function callAttributes(kind, storage) {
|
|
2110
|
+
const rule = CALL_KINDS[kind];
|
|
2111
|
+
return BROWSER_STORAGES.includes(storage) ? rule.browser : rule.backend;
|
|
2112
|
+
}
|
|
2113
|
+
/** The method an option uses: its own (upper case), else the kind's default; '' when the kind has none. */
|
|
2114
|
+
function methodOf(option, kind) {
|
|
2115
|
+
return String(option?.method || CALL_KINDS[kind].methods[0] || '').toUpperCase();
|
|
2116
|
+
}
|
|
2117
|
+
/**
|
|
2118
|
+
* Checks one option against its kind: a known storage the kind may use, only attributes of that storage, a method of
|
|
2119
|
+
* the kind, an address for the backend. Keys outside CALL_KEYS (style, visible, …) are not looked at.
|
|
2120
|
+
*/
|
|
2121
|
+
function checkCall(option, kind) {
|
|
2122
|
+
const problems = [];
|
|
2123
|
+
const rule = CALL_KINDS[kind];
|
|
2124
|
+
const raw = String(option?.storageType ?? '').trim().toLowerCase();
|
|
2125
|
+
if (raw && !STORAGES.includes(raw) && !OLD_STORAGES[raw]) {
|
|
2126
|
+
problems.push({ code: 'storage-unknown', key: 'storageType', message: `storageType "${option.storageType}" is unknown - ${STORAGES.join(' | ')}` });
|
|
2127
|
+
}
|
|
2128
|
+
if (OLD_STORAGES[raw]) {
|
|
2129
|
+
problems.push({ code: 'storage-old', key: 'storageType', message: `storageType "${raw}" is the older form of storageType "${OLD_STORAGES[raw].storageType}"${OLD_STORAGES[raw].loadOnFilter ? ' with loadOnFilter: true' : ''}` });
|
|
2130
|
+
}
|
|
2131
|
+
const storage = storageOf(option, kind);
|
|
2132
|
+
if (!rule.storages.includes(storage)) {
|
|
2133
|
+
problems.push({ code: 'storage-not-allowed', key: 'storageType', message: `${kind} keeps no records in "${storage}" - ${rule.storages.join(' | ')}` });
|
|
2134
|
+
// the attributes follow the storage - with a wrong one they say nothing more
|
|
2135
|
+
return problems;
|
|
2136
|
+
}
|
|
2137
|
+
const allowed = new Set(['storageType', ...callAttributes(kind, storage)]);
|
|
2138
|
+
for (const key of Object.keys(option ?? {})) {
|
|
2139
|
+
if (CALL_KEYS.includes(key) && !allowed.has(key) && option[key] !== undefined && option[key] !== null && option[key] !== '') {
|
|
2140
|
+
problems.push({ code: 'attribute-not-for-storage', key, message: `${key} means nothing for ${kind} with storage "${storage}"` });
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
if (option?.method && rule.methods.length && !rule.methods.includes(String(option.method).toUpperCase())) {
|
|
2144
|
+
problems.push({ code: 'method-unknown', key: 'method', message: `method "${option.method}" - ${kind} uses ${rule.methods.join(' | ')}` });
|
|
2145
|
+
}
|
|
2146
|
+
// a page without records (a form only) needs no address - only what sends or picks from the backend
|
|
2147
|
+
if (storage === 'database' && kind !== 'link' && kind !== 'load' && !String(option?.[rule.addressKey] ?? option?.data_url ?? option?.url ?? '').trim()) {
|
|
2148
|
+
problems.push({ code: 'address-missing', key: rule.addressKey, message: `${kind} with the backend needs an address (${rule.addressKey})` });
|
|
2149
|
+
}
|
|
2150
|
+
return problems;
|
|
2151
|
+
}
|
|
2152
|
+
/** Actions that stay in the app. */
|
|
2153
|
+
const INNER_ACTIONS = {
|
|
2154
|
+
openPage: { does: 'Opens a page (a detail page of the record) - the page loads its records itself; values of the record go along as {{record.<field>}}.', places: ['button'], keys: ['layout_url'] },
|
|
2155
|
+
filter: { does: 'A form button opens a page with the form\'s fields as filter values: {{filter.<field>}} in the data_url of the button.', places: ['button'], keys: ['layout_url', 'property_url', 'data_url', 'dataKey'] },
|
|
2156
|
+
addToCart: { does: 'Puts the record into the cart in the browser.', places: ['button'], keys: [] },
|
|
2157
|
+
showModal: { does: 'Opens a dialog.', places: ['button'], keys: ['layout_url'] },
|
|
2158
|
+
cancel: { does: 'Closes the dialog without saving; on a form page the fields go back to their start.', places: ['button'], keys: [] },
|
|
2159
|
+
openPdf: { does: 'Shows the PDF whose address stands in a field of the record (propertyKey) inside the app; without an address the button stays away.', places: ['button'], keys: ['propertyKey'] },
|
|
2160
|
+
login: { does: 'Starts the sign-in at Keycloak or Okta (a redirect to their sign-in page) - a form that sends user name and password to the app\'s backend is action loginForm.', places: ['button', 'menu'], keys: [] },
|
|
2161
|
+
logout: { does: 'Signs out.', places: ['button', 'menu'], keys: [] },
|
|
2162
|
+
cart: { does: 'Shows the cart.', places: ['button', 'menu'], keys: [] },
|
|
2163
|
+
copy: { does: 'Copies the values of one data object into another, e.g. the shipping address into the billing address.', places: ['field'], keys: ['from', 'to'] },
|
|
2164
|
+
calculate: { does: 'Shows a value calculated from fields of the record, e.g. quantity × price.', places: ['column'], keys: ['operator', 'fields'] },
|
|
2165
|
+
};
|
|
2166
|
+
/** Actions that call the backend - each with its kind of call (CALL_KINDS). */
|
|
2167
|
+
const BACKEND_ACTIONS = {
|
|
2168
|
+
save: { does: 'Saves the record.', places: ['button'], keys: [], kind: 'save' },
|
|
2169
|
+
saveAll: { does: 'Saves all records of the list.', places: ['button'], keys: [], kind: 'saveAll' },
|
|
2170
|
+
submit: { does: 'Sends the form (e.g. an order).', places: ['button'], keys: [], kind: 'submit' },
|
|
2171
|
+
delete: { does: 'Deletes the record.', places: ['button'], keys: [], kind: 'delete' },
|
|
2172
|
+
loginForm: { does: 'Signs in with the form\'s user name and password at the app\'s backend (a JWT sign-in form).', places: ['button'], keys: ['propertyKey', 'loginResponse', 'userRoleMapping'], kind: 'login' },
|
|
2173
|
+
};
|
|
2174
|
+
/** The operators of calculate. */
|
|
2175
|
+
const CALCULATE_OPERATORS = ['multiply', 'add', 'subtract', 'divide'];
|
|
2176
|
+
/**
|
|
2177
|
+
* What an element does. Older forms are understood: a menu entry's action "get" (opens its page - no action),
|
|
2178
|
+
* its cart / login / logout; a button's action "get" (openPage); innerAction saveAll / submit (backend actions);
|
|
2179
|
+
* innerAction as an object { action: copy | multiply, from, to }.
|
|
2180
|
+
*/
|
|
2181
|
+
function elementAction(option, place) {
|
|
2182
|
+
const action = option?.action;
|
|
2183
|
+
const inner = option?.innerAction;
|
|
2184
|
+
// innerAction as an object: { action: 'copy' | 'multiply', from, to }
|
|
2185
|
+
if (inner && typeof inner === 'object') {
|
|
2186
|
+
const kind = String(inner.action ?? '');
|
|
2187
|
+
if (kind === 'copy')
|
|
2188
|
+
return { innerAction: 'copy', params: { from: inner.from, to: inner.to }, old: 'innerAction:{copy}' };
|
|
2189
|
+
if (kind === 'multiply')
|
|
2190
|
+
return { innerAction: 'calculate', params: { operator: 'multiply', fields: [inner.from, inner.to] }, old: 'innerAction:{multiply}' };
|
|
2191
|
+
return { params: {}, old: `innerAction:{${kind}}` };
|
|
2192
|
+
}
|
|
2193
|
+
// the keys that belong to the action it turns out to be
|
|
2194
|
+
const params = (name) => {
|
|
2195
|
+
const out = {};
|
|
2196
|
+
for (const key of (name ? (INNER_ACTIONS[name] ?? BACKEND_ACTIONS[name])?.keys : undefined) ?? []) {
|
|
2197
|
+
if (option?.[key] !== undefined)
|
|
2198
|
+
out[key] = option[key];
|
|
2199
|
+
}
|
|
2200
|
+
return out;
|
|
2201
|
+
};
|
|
2202
|
+
if (typeof inner === 'string' && inner) {
|
|
2203
|
+
// saveAll and submit call the backend - they belong to action
|
|
2204
|
+
if (BACKEND_ACTIONS[inner])
|
|
2205
|
+
return { action: inner, params: params(inner), old: `innerAction:${inner}` };
|
|
2206
|
+
// a sign-in button that sends the form to a backend address is the backend action loginForm (hotel: POST auth/login)
|
|
2207
|
+
if (inner === 'login' && place === 'button' && String(option?.url ?? option?.data_url ?? '').trim()) {
|
|
2208
|
+
return { action: 'loginForm', params: params('loginForm'), old: 'innerAction:login' };
|
|
2209
|
+
}
|
|
2210
|
+
if (INNER_ACTIONS[inner])
|
|
2211
|
+
return { innerAction: inner, params: params(inner) };
|
|
2212
|
+
// a value no catalog knows does nothing - named for the check, never run
|
|
2213
|
+
return { params: {}, old: `innerAction:${inner}` };
|
|
2214
|
+
}
|
|
2215
|
+
if (typeof action === 'string' && action) {
|
|
2216
|
+
if (BACKEND_ACTIONS[action])
|
|
2217
|
+
return { action, params: params(action) };
|
|
2218
|
+
if (action === 'get') {
|
|
2219
|
+
// a menu entry opens its page - no action; a button opens a (detail) page
|
|
2220
|
+
return place === 'menu' ? { params: {}, old: 'action:get' } : { innerAction: 'openPage', params: params('openPage'), old: 'action:get' };
|
|
2221
|
+
}
|
|
2222
|
+
// cart / login / logout run in the app
|
|
2223
|
+
if (INNER_ACTIONS[action])
|
|
2224
|
+
return { innerAction: action, params: params(action), old: `action:${action}` };
|
|
2225
|
+
return { params: {}, old: `action:${action}` };
|
|
2226
|
+
}
|
|
2227
|
+
return { params: {} };
|
|
2228
|
+
}
|
|
2229
|
+
/** The option written in the new form - keys of the old form removed, everything else kept. */
|
|
2230
|
+
function withElementAction(option, place) {
|
|
2231
|
+
const found = elementAction(option, place);
|
|
2232
|
+
if (!found.old)
|
|
2233
|
+
return option;
|
|
2234
|
+
const out = { ...option };
|
|
2235
|
+
delete out.action;
|
|
2236
|
+
delete out.innerAction;
|
|
2237
|
+
if (found.action)
|
|
2238
|
+
out.action = found.action;
|
|
2239
|
+
if (found.innerAction)
|
|
2240
|
+
out.innerAction = found.innerAction;
|
|
2241
|
+
Object.assign(out, found.params);
|
|
2242
|
+
return out;
|
|
2243
|
+
}
|
|
2244
|
+
/** Problems of an element's action for the check: an unknown value or one in the wrong place. */
|
|
2245
|
+
function checkElementAction(option, place) {
|
|
2246
|
+
const found = elementAction(option, place);
|
|
2247
|
+
const problems = [];
|
|
2248
|
+
if (found.old && !found.action && !found.innerAction && !(place === 'menu' && found.old === 'action:get')) {
|
|
2249
|
+
problems.push(`unknown action "${found.old}"`);
|
|
2250
|
+
}
|
|
2251
|
+
else if (found.old) {
|
|
2252
|
+
problems.push(`older form "${found.old}" - write ${found.action ? `action "${found.action}"` : found.innerAction ? `innerAction "${found.innerAction}"` : 'no action'}`);
|
|
2253
|
+
}
|
|
2254
|
+
const rule = found.innerAction ? INNER_ACTIONS[found.innerAction] : found.action ? BACKEND_ACTIONS[found.action] : undefined;
|
|
2255
|
+
if (rule && !rule.places.includes(place))
|
|
2256
|
+
problems.push(`"${found.innerAction ?? found.action}" does not belong to a ${place}`);
|
|
2257
|
+
return problems;
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* The name of what an element does, in the new form ('' = nothing): save, saveAll, submit, delete, openPage,
|
|
2261
|
+
* addToCart, showModal, cancel, login, logout, cart, copy, calculate. Code asks this instead of comparing action or
|
|
2262
|
+
* innerAction with a value, so older forms (a button's "get", innerAction "saveAll") mean the same.
|
|
2263
|
+
*/
|
|
2264
|
+
function actionName(option, place = 'button') {
|
|
2265
|
+
const found = elementAction(option, place);
|
|
2266
|
+
return found.action ?? found.innerAction ?? '';
|
|
2267
|
+
}
|
|
2268
|
+
/** The keys of what an element does (copy: from, to; calculate: operator, fields; openPage: layout_url). */
|
|
2269
|
+
function actionParams(option, place = 'button') {
|
|
2270
|
+
return elementAction(option, place).params;
|
|
2271
|
+
}
|
|
2272
|
+
/**
|
|
2273
|
+
* The page's own data source (OFFENE-PUNKTE 145): a page loads its records itself - "dataSource" in its
|
|
2274
|
+
* layout_schema.json holds the call (storageType, data_url, method, passToken, params, body, dateFormat, dataKey,
|
|
2275
|
+
* loadOnFilter, proxy, messages) and its data object (property_url). Opened from a menu entry or a button, the
|
|
2276
|
+
* page's source wins; without one the opener's keys count as before.
|
|
2277
|
+
*/
|
|
2278
|
+
function withPageSource(option, pageLayout) {
|
|
2279
|
+
const source = pageLayout?.dataSource;
|
|
2280
|
+
if (!source || typeof source !== 'object')
|
|
2281
|
+
return option;
|
|
2282
|
+
const out = { ...(option || {}) };
|
|
2283
|
+
for (const key of [...CALL_KEYS, ...Object.keys(OLD_CALL_KEYS), 'property_url'])
|
|
2284
|
+
delete out[key];
|
|
2285
|
+
return { ...out, ...source };
|
|
2286
|
+
}
|
|
2287
|
+
/** The setting entries of the menu (the library adds them; they are no pages and carry no call). */
|
|
2288
|
+
const SETTING_ENTRY_FLAGS = ['changeLang', 'projectVersion', 'scrollPagination', 'numberedPagination', 'terms', 'projectPrivacy'];
|
|
2289
|
+
/** The keys of a page's call - they move from the menu entry into the page's dataSource. */
|
|
2290
|
+
const PAGE_SOURCE_KEYS = [...CALL_KEYS, ...Object.keys(OLD_CALL_KEYS).map((key) => key.split('.')[0]), 'property_url'];
|
|
2291
|
+
const captionOf = (node) => {
|
|
2292
|
+
const caption = typeof node?.label === 'object' ? node.label?.caption : node?.caption;
|
|
2293
|
+
if (caption)
|
|
2294
|
+
return String(caption);
|
|
2295
|
+
const reference = String(node?.scope?.reference ?? '');
|
|
2296
|
+
if (reference)
|
|
2297
|
+
return reference.split('/').pop();
|
|
2298
|
+
// an entry with only an icon (luv2shop's sign-out)
|
|
2299
|
+
return node?.icon ? `(${node.icon})` : undefined;
|
|
2300
|
+
};
|
|
2301
|
+
/** An unknown value is left as it is (the Designer decides); everything else is written in the new form. */
|
|
2302
|
+
const known = (found, place) => !found.old || !!(found.action || found.innerAction) || (place === 'menu' && found.old === 'action:get');
|
|
2303
|
+
const converted = (option, place) => known(elementAction(option, place), place) ? withElementAction(option, place) : option;
|
|
2304
|
+
const describe = (found) => found.action ? `action ${found.action}`
|
|
2305
|
+
: found.innerAction ? `innerAction ${found.innerAction}` : 'no action (the entry opens its page)';
|
|
2306
|
+
/** Every node with an option, with where it stands (left.elements[0].submenu[1]). */
|
|
2307
|
+
function eachOption(node, where, visit) {
|
|
2308
|
+
if (Array.isArray(node)) {
|
|
2309
|
+
node.forEach((item, index) => eachOption(item, `${where}[${index}]`, visit));
|
|
2310
|
+
return;
|
|
2311
|
+
}
|
|
2312
|
+
if (!node || typeof node !== 'object')
|
|
2313
|
+
return;
|
|
2314
|
+
if (node.option && typeof node.option === 'object' && !Array.isArray(node.option))
|
|
2315
|
+
visit(node, where);
|
|
2316
|
+
for (const [key, value] of Object.entries(node)) {
|
|
2317
|
+
if (key !== 'option' && key !== 'dataSource')
|
|
2318
|
+
eachOption(value, where ? `${where}.${key}` : key, visit);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
/**
|
|
2322
|
+
* An app written in the new form (OFFENE-PUNKTE 105/145 step 5). files: Main and the pages by their path
|
|
2323
|
+
* (main/layout_schema.json, pages/<path>/layout_schema.json). Returns the changed files (copies - the given ones are
|
|
2324
|
+
* not touched) and the list of every change and of what stays:
|
|
2325
|
+
* - every element's action in the new form (withElementAction: button get -> innerAction openPage, innerAction
|
|
2326
|
+
* submit / saveAll -> action, menu logout / login / cart -> innerAction, copy / multiply -> copy / calculate, a
|
|
2327
|
+
* sign-in form with an address -> action loginForm; a menu entry's get is dropped);
|
|
2328
|
+
* - a menu entry's call (data_url, storageType, method, dataKey, property_url …) moved into its page as dataSource -
|
|
2329
|
+
* only when the menu entries opening that page all carry the same call and nothing else opens it (the page's source
|
|
2330
|
+
* would win over any other opener). It stays at the header search field (its call depends on the typed text), at
|
|
2331
|
+
* the cart (data_url is the cart's storage name) and at a page that has a dataSource already.
|
|
2332
|
+
*/
|
|
2333
|
+
function convertOlderForms(files) {
|
|
2334
|
+
const out = {};
|
|
2335
|
+
const changes = [];
|
|
2336
|
+
const copyOf = (file) => (out[file] ??= JSON.parse(JSON.stringify(files[file])));
|
|
2337
|
+
const main = 'main/layout_schema.json';
|
|
2338
|
+
const pages = Object.keys(files).filter((file) => file.startsWith('pages/') && file.endsWith('layout_schema.json')).sort();
|
|
2339
|
+
const pathOf = (layout) => String(layout ?? '').trim().replace(/^\/+/, '');
|
|
2340
|
+
const isSetting = (option) => SETTING_ENTRY_FLAGS.some((flag) => option?.[flag]);
|
|
2341
|
+
// who opens which page: menu entries (with their call) and elements of pages
|
|
2342
|
+
const menuOpeners = new Map();
|
|
2343
|
+
const otherOpeners = new Map();
|
|
2344
|
+
if (files[main]) {
|
|
2345
|
+
for (const area of ['header', 'left']) {
|
|
2346
|
+
eachOption(files[main][area], area, (node, where) => {
|
|
2347
|
+
const option = node.option;
|
|
2348
|
+
const page = pathOf(option.layout_url);
|
|
2349
|
+
if (!page || isSetting(option))
|
|
2350
|
+
return;
|
|
2351
|
+
const call = {};
|
|
2352
|
+
for (const key of PAGE_SOURCE_KEYS)
|
|
2353
|
+
if (option[key] !== undefined)
|
|
2354
|
+
call[key] = option[key];
|
|
2355
|
+
const list = menuOpeners.get(page) ?? [];
|
|
2356
|
+
list.push({ where, node, call });
|
|
2357
|
+
menuOpeners.set(page, list);
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
for (const file of pages) {
|
|
2362
|
+
eachOption(files[file], '', (node, where) => {
|
|
2363
|
+
const page = pathOf(node.option.layout_url);
|
|
2364
|
+
if (page)
|
|
2365
|
+
otherOpeners.set(page, [...(otherOpeners.get(page) ?? []), `${file} ${where}`]);
|
|
2366
|
+
});
|
|
2367
|
+
}
|
|
2368
|
+
// 1. the menu: its actions, then its calls into the pages
|
|
2369
|
+
if (files[main]) {
|
|
2370
|
+
for (const area of ['header', 'left']) {
|
|
2371
|
+
eachOption(files[main][area], area, (node, where) => {
|
|
2372
|
+
if (isSetting(node.option))
|
|
2373
|
+
return;
|
|
2374
|
+
const found = elementAction(node.option, 'menu');
|
|
2375
|
+
if (!found.old)
|
|
2376
|
+
return;
|
|
2377
|
+
const done = known(found, 'menu');
|
|
2378
|
+
changes.push({ file: main, where, caption: captionOf(node), old: found.old, new: done ? describe(found) : '-', done,
|
|
2379
|
+
reason: done ? undefined : 'unknown action - decide in the Designer', reasonCode: done ? undefined : 'unknown' });
|
|
2380
|
+
});
|
|
2381
|
+
}
|
|
2382
|
+
for (const [page, all] of menuOpeners) {
|
|
2383
|
+
// a sign-out / sign-in entry showing a page afterwards takes the page as it loads itself - it decides nothing
|
|
2384
|
+
const after = all.filter((opener) => ['logout', 'login'].includes(actionName(opener.node.option, 'menu')));
|
|
2385
|
+
const openers = all.filter((opener) => !after.includes(opener));
|
|
2386
|
+
const withCall = openers.filter((opener) => String(opener.call['data_url'] ?? '').trim());
|
|
2387
|
+
if (!withCall.length)
|
|
2388
|
+
continue;
|
|
2389
|
+
const first = withCall[0];
|
|
2390
|
+
const stay = (reasonCode, reason) => withCall.forEach((opener) => changes.push({
|
|
2391
|
+
file: main, where: opener.where, caption: captionOf(opener.node), old: 'call at the menu entry',
|
|
2392
|
+
new: `dataSource in ${page}`, done: false, reason, reasonCode
|
|
2393
|
+
}));
|
|
2394
|
+
if (withCall.some((opener) => opener.node.scope)) {
|
|
2395
|
+
stay('searchField', 'the header search field - its call depends on the typed text');
|
|
2396
|
+
continue;
|
|
2397
|
+
}
|
|
2398
|
+
if (withCall.some((opener) => actionName(opener.node.option, 'menu') === 'cart')) {
|
|
2399
|
+
stay('cart', 'the cart - data_url is the storage name of the cart');
|
|
2400
|
+
continue;
|
|
2401
|
+
}
|
|
2402
|
+
if (!files[page]) {
|
|
2403
|
+
stay('noPage', 'the page does not exist');
|
|
2404
|
+
continue;
|
|
2405
|
+
}
|
|
2406
|
+
if (files[page].dataSource) {
|
|
2407
|
+
stay('hasSource', 'the page has a dataSource already');
|
|
2408
|
+
continue;
|
|
2409
|
+
}
|
|
2410
|
+
const same = JSON.stringify(first.call);
|
|
2411
|
+
if (openers.length !== withCall.length || withCall.some((opener) => JSON.stringify(opener.call) !== same)) {
|
|
2412
|
+
stay('severalWays', `the page is opened by ${openers.length} menu entries in different ways - one data source cannot serve them`);
|
|
2413
|
+
continue;
|
|
2414
|
+
}
|
|
2415
|
+
if (otherOpeners.has(page)) {
|
|
2416
|
+
stay('openedByButtons', `the page is opened by buttons too (${otherOpeners.get(page).join(', ')})`);
|
|
2417
|
+
continue;
|
|
2418
|
+
}
|
|
2419
|
+
copyOf(page).dataSource = { ...first.call };
|
|
2420
|
+
for (const opener of [...withCall, ...after.filter((entry) => String(entry.call['data_url'] ?? '').trim())]) {
|
|
2421
|
+
changes.push({ file: main, where: opener.where, caption: captionOf(opener.node), old: 'call at the menu entry',
|
|
2422
|
+
new: `dataSource in ${page}`, done: true });
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
// write Main: actions in the new form, moved calls removed from the entries
|
|
2427
|
+
const moved = new Set(changes.filter((c) => c.file === main && c.done && c.old === 'call at the menu entry').map((c) => c.where));
|
|
2428
|
+
if (changes.some((c) => c.file === main && c.done)) {
|
|
2429
|
+
const target = copyOf(main);
|
|
2430
|
+
for (const area of ['header', 'left']) {
|
|
2431
|
+
eachOption(target[area], area, (node, where) => {
|
|
2432
|
+
if (isSetting(node.option))
|
|
2433
|
+
return;
|
|
2434
|
+
let option = converted(node.option, 'menu');
|
|
2435
|
+
if (moved.has(where)) {
|
|
2436
|
+
option = { ...option };
|
|
2437
|
+
for (const key of PAGE_SOURCE_KEYS)
|
|
2438
|
+
delete option[key];
|
|
2439
|
+
}
|
|
2440
|
+
node.option = option;
|
|
2441
|
+
});
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
// 2. the pages: every element's action in the new form
|
|
2445
|
+
for (const file of pages) {
|
|
2446
|
+
const found = [];
|
|
2447
|
+
eachOption(files[file], '', (node, where) => {
|
|
2448
|
+
const was = elementAction(node.option, 'button');
|
|
2449
|
+
if (was.old)
|
|
2450
|
+
found.push({ where, caption: captionOf(node), was });
|
|
2451
|
+
});
|
|
2452
|
+
if (!found.length)
|
|
2453
|
+
continue;
|
|
2454
|
+
for (const { where, caption, was } of found) {
|
|
2455
|
+
const done = known(was, 'button');
|
|
2456
|
+
changes.push({ file, where, caption, old: was.old, new: done ? describe(was) : '-', done,
|
|
2457
|
+
reason: done ? undefined : 'unknown action - decide in the Designer', reasonCode: done ? undefined : 'unknown' });
|
|
2458
|
+
}
|
|
2459
|
+
eachOption(copyOf(file), '', (node) => { node.option = converted(node.option, 'button'); });
|
|
2460
|
+
}
|
|
2461
|
+
return { files: out, changes };
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-31
|
|
2465
|
+
// - new: one way to put a layout's texts into the app's language, for every container (form, card, grid, dialog,
|
|
2466
|
+
// header). Before, five walkers did it differently: the card skipped a button's own caption ("Add To Cart" stayed
|
|
2467
|
+
// English), the dialog skipped tooltips, form and grid changed the schema in place, so a second language switch
|
|
2468
|
+
// looked up texts that were already translated. Here the text a field was written with is remembered, so every
|
|
2469
|
+
// switch starts from it - in place or on a copy.
|
|
2470
|
+
/** The keys whose text is shown to a person: a caption (label.caption or an element's own), placeholder, tooltip, dialog title. */
|
|
2471
|
+
const SHOWN_TEXT_KEYS = ['caption', 'placeholder', 'tooltip', 'modalTitle'];
|
|
2472
|
+
/** object -> the texts it was written with, per key - a switch to another language starts from them. */
|
|
2473
|
+
const written = new WeakMap();
|
|
2474
|
+
function original(obj, key) {
|
|
2475
|
+
let seen = written.get(obj);
|
|
2476
|
+
if (!seen)
|
|
2477
|
+
written.set(obj, (seen = {}));
|
|
2478
|
+
if (!(key in seen))
|
|
2479
|
+
seen[key] = obj[key];
|
|
2480
|
+
return seen[key];
|
|
2481
|
+
}
|
|
2482
|
+
/**
|
|
2483
|
+
* The texts of a layout (or property schema) in the language of `texts` (the language file: written text -> its
|
|
2484
|
+
* translation). With values: also a property's start value (a text without {{ }}), as the grid's footer needs.
|
|
2485
|
+
* inPlace: changes the given schema (its first texts are remembered); else works on a copy. Missing translation:
|
|
2486
|
+
* the written text.
|
|
2487
|
+
*/
|
|
2488
|
+
function translateCaptions(schema, texts, { inPlace = false, values = false } = {}) {
|
|
2489
|
+
if (!schema || typeof schema !== 'object')
|
|
2490
|
+
return schema;
|
|
2491
|
+
const target = inPlace ? schema : JSON.parse(JSON.stringify(schema));
|
|
2492
|
+
const dict = texts || {};
|
|
2493
|
+
const walk = (obj) => {
|
|
2494
|
+
if (!obj || typeof obj !== 'object')
|
|
2495
|
+
return;
|
|
2496
|
+
if (Array.isArray(obj)) {
|
|
2497
|
+
obj.forEach(walk);
|
|
2498
|
+
return;
|
|
2499
|
+
}
|
|
2500
|
+
for (const key of [...SHOWN_TEXT_KEYS, ...(values ? ['value'] : [])]) {
|
|
2501
|
+
if (typeof obj[key] !== 'string')
|
|
2502
|
+
continue;
|
|
2503
|
+
const first = original(obj, key);
|
|
2504
|
+
if (key === 'value' && first.includes('{{'))
|
|
2505
|
+
continue;
|
|
2506
|
+
const own = first.trim();
|
|
2507
|
+
obj[key] = (own && dict[own]) || first;
|
|
2508
|
+
}
|
|
2509
|
+
// records (data arrays, autocomplete lists) are data, not layout - not walked
|
|
2510
|
+
for (const [key, value] of Object.entries(obj))
|
|
2511
|
+
if (value && typeof value === 'object' && !(key === 'data' && Array.isArray(value)))
|
|
2512
|
+
walk(value);
|
|
2513
|
+
};
|
|
2514
|
+
walk(target);
|
|
2515
|
+
return target;
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
|
|
2519
|
+
// - new: boxes say whether they stand in the top bar (inBar)
|
|
2520
|
+
// - new: cardRows - in a card list with aligned rows, per row the tops of the cards' button elements
|
|
2521
|
+
// - fix: probeFieldVisible - covered by the keyboard only where both overlap sideways too (landscape: keyboard beside)
|
|
2522
|
+
// - new: probeLayoutSnapshot measures the top bar (header.option.scroll, its place, the page's scroll)
|
|
2523
|
+
// - change: probeLayoutSnapshot names the areas that scroll sideways (scrollers) and what stands in them
|
|
2524
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-31
|
|
2525
|
+
// - new: what the test runners measure on the page, written once (before: the app's runner and the device runner
|
|
2526
|
+
// each had a copy, and they had drifted - the device runner flagged record values as untranslated, found fields
|
|
2527
|
+
// without the visibility check and never put the person's app data back). Every probe is self-contained: it uses
|
|
2528
|
+
// only the page's own objects, so the device runner can send it into the app's web view as it is
|
|
2529
|
+
// (driver.execute(probe, ...args)) and the app's runner calls it directly. Nothing outside a probe may be used in it.
|
|
2530
|
+
/** Storage keys kept when a flow starts with empty app data: sign-in, tenant, project, accepted terms, the recorder, the runner's own. */
|
|
2531
|
+
const APP_DATA_KEEP = 'token|expires|nonce|pkce|session_state|keycloak|logined|granted_scopes|id_token|okta|tenant|project|terms|networkLogs|vl-test';
|
|
2532
|
+
/** Texts on the page still in the main language although the language file has them, or raw keys ("termsShowAgain"). */
|
|
2533
|
+
function probeUntranslated(texts, lang, main) {
|
|
2534
|
+
const doc = globalThis.document;
|
|
2535
|
+
const shown = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; };
|
|
2536
|
+
const found = new Set();
|
|
2537
|
+
const walker = doc.createTreeWalker(doc.body, 4 /* NodeFilter.SHOW_TEXT */);
|
|
2538
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
2539
|
+
const el = node.parentElement;
|
|
2540
|
+
const t = String(node.textContent || '').trim();
|
|
2541
|
+
// a record's value is data, not a text of the app
|
|
2542
|
+
if (!el || !t || !shown(el) || el.closest('[data-vl-record] [data-vl-field] .vl-control__value, [data-vl-record] td, input, textarea, script, style'))
|
|
2543
|
+
continue;
|
|
2544
|
+
if (/^[a-z]+(?:[A-Z][a-z0-9]+)+$/.test(t))
|
|
2545
|
+
found.add(t);
|
|
2546
|
+
else if (lang !== main && texts[t] !== undefined && texts[t] !== t)
|
|
2547
|
+
found.add(t);
|
|
2548
|
+
}
|
|
2549
|
+
return [...found];
|
|
2550
|
+
}
|
|
2551
|
+
/** What the page shows, measured for the layout rules (layoutProblems): fields, buttons, texts with their boxes. */
|
|
2552
|
+
function probeLayoutSnapshot() {
|
|
2553
|
+
const doc = globalThis.document;
|
|
2554
|
+
const win = globalThis;
|
|
2555
|
+
const shown = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; };
|
|
2556
|
+
const rowOf = (el) => {
|
|
2557
|
+
const parent = el.parentElement;
|
|
2558
|
+
if (!parent)
|
|
2559
|
+
return undefined;
|
|
2560
|
+
const cs = getComputedStyle(parent);
|
|
2561
|
+
return cs.display.includes('flex') && !cs.flexDirection.startsWith('column') && !cs.flexWrap.startsWith('wrap')
|
|
2562
|
+
? `${parent.tagName.toLowerCase()}#${[...(parent.parentElement?.children || [])].indexOf(parent)}` : undefined;
|
|
2563
|
+
};
|
|
2564
|
+
// areas that scroll sideways on their own (a wide table): what stands in them is reached by swiping there
|
|
2565
|
+
const scrollers = [];
|
|
2566
|
+
const scrollerOf = (el) => {
|
|
2567
|
+
for (let p = el.parentElement; p && p !== doc.body; p = p.parentElement) {
|
|
2568
|
+
const s = getComputedStyle(p);
|
|
2569
|
+
if (/(auto|scroll)/.test(s.overflowX) && p.scrollWidth > p.clientWidth + 2) {
|
|
2570
|
+
let known = scrollers.find((x) => x.el === p);
|
|
2571
|
+
if (!known) {
|
|
2572
|
+
const r = p.getBoundingClientRect();
|
|
2573
|
+
const name = p.closest('[data-vl-container]')?.getAttribute('data-vl-container') || (p.querySelector('table') ? 'table' : 'area');
|
|
2574
|
+
known = { el: p, name: `${name} ${scrollers.length + 1}`, left: r.left, right: r.right, content: p.scrollWidth, shown: p.clientWidth };
|
|
2575
|
+
scrollers.push(known);
|
|
2576
|
+
}
|
|
2577
|
+
return known.name;
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
return undefined;
|
|
2581
|
+
};
|
|
2582
|
+
const boxes = [];
|
|
2583
|
+
for (const el of [...doc.querySelectorAll('[data-vl-field]')]) {
|
|
2584
|
+
if (!shown(el) || el.closest('[data-vl-record]'))
|
|
2585
|
+
continue;
|
|
2586
|
+
const r = el.getBoundingClientRect();
|
|
2587
|
+
boxes.push({ kind: 'field', name: el.getAttribute('data-vl-field') || '', left: r.left, top: r.top, right: r.right, bottom: r.bottom, row: rowOf(el), scroller: scrollerOf(el), inBar: !!el.closest('.vl-top-bar') });
|
|
2588
|
+
}
|
|
2589
|
+
for (const el of [...doc.querySelectorAll('[data-vl-action], button')]) {
|
|
2590
|
+
if (!shown(el) || el.closest('[data-vl-field], section[data-vl-custom-keyboard], .left-wrap'))
|
|
2591
|
+
continue;
|
|
2592
|
+
const r = el.getBoundingClientRect();
|
|
2593
|
+
boxes.push({ kind: 'button', name: el.getAttribute('data-vl-action') || String(el.innerText || '').trim().slice(0, 20), left: r.left, top: r.top, right: r.right, bottom: r.bottom, scroller: scrollerOf(el), inBar: !!el.closest('.vl-top-bar') });
|
|
2594
|
+
}
|
|
2595
|
+
for (const el of [...doc.querySelectorAll('label, .vl-control__label, .vl-control__value')]) {
|
|
2596
|
+
const t = String(el.innerText || '').trim();
|
|
2597
|
+
if (!t || !shown(el))
|
|
2598
|
+
continue;
|
|
2599
|
+
const r = el.getBoundingClientRect();
|
|
2600
|
+
const size = parseFloat(getComputedStyle(el).fontSize) || 14;
|
|
2601
|
+
boxes.push({ kind: 'text', name: t.slice(0, 20), left: r.left, top: r.top, right: r.right, bottom: r.bottom, charsPerLine: Math.floor(r.width / (size * 0.55)), scroller: scrollerOf(el) });
|
|
2602
|
+
}
|
|
2603
|
+
// the top bar (header + page X): where it stands, what it should do, and whether the page is scrolled
|
|
2604
|
+
const bar = doc.querySelector('.vl-top-bar');
|
|
2605
|
+
const page = doc.querySelector('.center-wrap');
|
|
2606
|
+
const header = bar && shown(bar) ? { top: bar.getBoundingClientRect().top, bottom: bar.getBoundingClientRect().bottom,
|
|
2607
|
+
scroll: bar.getAttribute('data-vl-header-scroll') || 'fixed', pageTop: page ? page.scrollTop : 0 } : undefined;
|
|
2608
|
+
// card lists with aligned rows (alignRows): per row of cards, the top of each card's first element with buttons
|
|
2609
|
+
const cardRows = [];
|
|
2610
|
+
for (const grid of [...doc.querySelectorAll('.vl-cards--aligned')]) {
|
|
2611
|
+
const rows = new Map();
|
|
2612
|
+
for (const card of [...grid.children].filter((c) => shown(c))) {
|
|
2613
|
+
const action = card.querySelector('.card-layout-item--action');
|
|
2614
|
+
if (!action || !shown(action))
|
|
2615
|
+
continue;
|
|
2616
|
+
const top = Math.round(card.getBoundingClientRect().top);
|
|
2617
|
+
const key = [...rows.keys()].find((k) => Math.abs(k - top) <= 2) ?? top;
|
|
2618
|
+
rows.set(key, [...(rows.get(key) || []), action.getBoundingClientRect().top]);
|
|
2619
|
+
}
|
|
2620
|
+
for (const tops of rows.values())
|
|
2621
|
+
if (tops.length > 1)
|
|
2622
|
+
cardRows.push(tops);
|
|
2623
|
+
}
|
|
2624
|
+
return { width: win.innerWidth, height: win.innerHeight, scrollsSideways: doc.documentElement.scrollWidth > win.innerWidth + 2, boxes,
|
|
2625
|
+
scrollers: scrollers.map(({ el, ...s }) => s), header, cardRows };
|
|
2626
|
+
}
|
|
2627
|
+
/** Whether a field (data-vl-path with a dot, else data-vl-field) stands visible above an open keyboard: '' or why not. */
|
|
2628
|
+
function probeFieldVisible(key) {
|
|
2629
|
+
const doc = globalThis.document;
|
|
2630
|
+
const win = globalThis;
|
|
2631
|
+
const shown = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; };
|
|
2632
|
+
const esc = (v) => String(v).replace(/["\\]/g, '\\$&');
|
|
2633
|
+
const all = [...doc.querySelectorAll(key.includes('.') ? `[data-vl-path="${esc(key)}"]` : `[data-vl-field="${esc(key)}"]`)].filter(shown);
|
|
2634
|
+
const w = all[all.length - 1];
|
|
2635
|
+
if (!w)
|
|
2636
|
+
return 'not there';
|
|
2637
|
+
const r = w.getBoundingClientRect();
|
|
2638
|
+
const kbEl = doc.querySelector('section[data-vl-custom-keyboard]');
|
|
2639
|
+
const kb = kbEl && shown(kbEl) ? kbEl.getBoundingClientRect() : null;
|
|
2640
|
+
if (r.top < 0)
|
|
2641
|
+
return `above the frame (${Math.round(r.top)})`;
|
|
2642
|
+
// covered only where field and keyboard overlap - in landscape the keyboard stands beside the page, not below it
|
|
2643
|
+
const overlapX = kb ? Math.min(r.right, kb.right) - Math.max(r.left, kb.left) > 1 : false;
|
|
2644
|
+
if (kb && overlapX && r.bottom > kb.top + 1)
|
|
2645
|
+
return `covered by the keyboard (field to ${Math.round(r.bottom)}, keyboard from ${Math.round(kb.top)})`;
|
|
2646
|
+
if (r.bottom > win.innerHeight + 1)
|
|
2647
|
+
return `below the frame (${Math.round(r.bottom)} of ${win.innerHeight})`;
|
|
2648
|
+
return '';
|
|
2649
|
+
}
|
|
2650
|
+
/** Where the page stands: the window's and the scrolling content's place, the page's height (expect restored). */
|
|
2651
|
+
function probePagePlace() {
|
|
2652
|
+
const doc = globalThis.document;
|
|
2653
|
+
const win = globalThis;
|
|
2654
|
+
const box = [...doc.querySelectorAll('.ant-layout-content, .layout-content, .center-wrap, main, .p-dialog-content')].find((el) => el.scrollHeight > el.clientHeight + 2);
|
|
2655
|
+
return { scrollY: win.scrollY, scrollTop: box ? box.scrollTop : 0, height: doc.documentElement.scrollHeight };
|
|
2656
|
+
}
|
|
2657
|
+
/** The app's data in the browser (local and session), without what is kept (keep: APP_DATA_KEEP) - put back after a flow. */
|
|
2658
|
+
function probeStorageSnapshot(keep) {
|
|
2659
|
+
const win = globalThis;
|
|
2660
|
+
const kept = new RegExp(keep, 'i');
|
|
2661
|
+
const copy = (store) => Object.keys(store).filter((k) => !kept.test(k)).map((k) => [k, store.getItem(k)]);
|
|
2662
|
+
return { local: copy(win.localStorage), session: copy(win.sessionStorage) };
|
|
2663
|
+
}
|
|
2664
|
+
/** Empties the app's data in the browser (not what is kept); true when something was removed. */
|
|
2665
|
+
function probeClearAppData(keep) {
|
|
2666
|
+
const win = globalThis;
|
|
2667
|
+
const kept = new RegExp(keep, 'i');
|
|
2668
|
+
let changed = false;
|
|
2669
|
+
for (const store of [win.localStorage, win.sessionStorage]) {
|
|
2670
|
+
for (const key of Object.keys(store)) {
|
|
2671
|
+
if (kept.test(key))
|
|
2672
|
+
continue;
|
|
2673
|
+
store.removeItem(key);
|
|
2674
|
+
changed = true;
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
return changed;
|
|
2678
|
+
}
|
|
2679
|
+
/** Puts the app's data back as it was before the flow (probeStorageSnapshot); true when something had changed. */
|
|
2680
|
+
function probeRestoreStorage(snapshot, keep) {
|
|
2681
|
+
const win = globalThis;
|
|
2682
|
+
const kept = new RegExp(keep, 'i');
|
|
2683
|
+
let changed = false;
|
|
2684
|
+
const put = (store, before) => {
|
|
2685
|
+
const was = new Map(before);
|
|
2686
|
+
for (const key of Object.keys(store)) {
|
|
2687
|
+
if (kept.test(key) || was.has(key))
|
|
2688
|
+
continue;
|
|
2689
|
+
store.removeItem(key);
|
|
2690
|
+
changed = true;
|
|
2691
|
+
}
|
|
2692
|
+
for (const [key, value] of was) {
|
|
2693
|
+
if (store.getItem(key) !== value) {
|
|
2694
|
+
store.setItem(key, value);
|
|
2695
|
+
changed = true;
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
};
|
|
2699
|
+
put(win.localStorage, snapshot.local);
|
|
2700
|
+
put(win.sessionStorage, snapshot.session);
|
|
2701
|
+
return changed;
|
|
2702
|
+
}
|
|
2703
|
+
/** The parts that must stay inside the screen (expect inFrame), as selectors of the page. */
|
|
2704
|
+
const FRAME_SELECTORS = {
|
|
2705
|
+
keyboard: 'section[data-vl-custom-keyboard]',
|
|
2706
|
+
dialog: '.ant-modal-content, .p-dialog, .cdk-overlay-pane .modal-content',
|
|
2707
|
+
calendar: '.p-datepicker-panel, .p-datepicker:not(.p-datepicker-inline) .p-datepicker-calendar-container',
|
|
2708
|
+
list: '.p-autocomplete-overlay, .p-select-overlay',
|
|
2709
|
+
menu: '.left-wrap',
|
|
2710
|
+
};
|
|
2711
|
+
/** A frame part (its selector from FRAME_SELECTORS): null when not shown, else whether it stays inside the screen and its box. */
|
|
2712
|
+
function probeInFrame(selector) {
|
|
2713
|
+
const doc = globalThis.document;
|
|
2714
|
+
const win = globalThis;
|
|
2715
|
+
const shown = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; };
|
|
2716
|
+
const all = [...doc.querySelectorAll(selector)].filter(shown);
|
|
2717
|
+
const el = all[all.length - 1];
|
|
2718
|
+
if (!el)
|
|
2719
|
+
return null;
|
|
2720
|
+
const b = el.getBoundingClientRect();
|
|
2721
|
+
return { in: b.top >= -1 && b.left >= -1 && b.bottom <= win.innerHeight + 1 && b.right <= win.innerWidth + 1,
|
|
2722
|
+
box: [Math.round(b.left), Math.round(b.top), Math.round(b.right), Math.round(b.bottom)], width: win.innerWidth, height: win.innerHeight };
|
|
2723
|
+
}
|
|
2724
|
+
/**
|
|
2725
|
+
* 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
|
|
2726
|
+
* is ambiguous): what it shows and whether it is locked. null when not there; { ambiguous } when the key is not enough.
|
|
2727
|
+
*/
|
|
2728
|
+
function probeField(key) {
|
|
2729
|
+
const doc = globalThis.document;
|
|
2730
|
+
const shown = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; };
|
|
2731
|
+
const esc = (v) => String(v).replace(/["\\]/g, '\\$&');
|
|
2732
|
+
let w;
|
|
2733
|
+
if (key.includes('.')) {
|
|
2734
|
+
const all = [...doc.querySelectorAll(`[data-vl-path="${esc(key)}"]`)].filter(shown);
|
|
2735
|
+
w = all[all.length - 1];
|
|
2736
|
+
}
|
|
2737
|
+
else {
|
|
2738
|
+
const all = [...doc.querySelectorAll(`[data-vl-field="${esc(key)}"]`)].filter(shown);
|
|
2739
|
+
const paths = [...new Set(all.map((el) => el.getAttribute('data-vl-path')).filter(Boolean))];
|
|
2740
|
+
if (paths.length > 1)
|
|
2741
|
+
return { ambiguous: paths };
|
|
2742
|
+
w = all[all.length - 1];
|
|
2743
|
+
}
|
|
2744
|
+
if (!w)
|
|
2745
|
+
return null;
|
|
2746
|
+
const i = w.querySelector('input:not([type=hidden]), textarea');
|
|
2747
|
+
const locked = !i || i.disabled || i.readOnly || !!w.querySelector('.p-disabled, [aria-disabled=true]');
|
|
2748
|
+
return { text: i ? String(i.value) : String((w.querySelector('.p-select-label, .p-select') || w).innerText || '').trim(), locked };
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-02
|
|
2752
|
+
// - new: one spelling for style properties - the CSS one (font-size, not fontSize), as in style.css and the
|
|
2753
|
+
// templates (user 2026-11-02, replaces camelCase of 2026-10-28). Read both, write CSS. styleSpellingFindings and
|
|
2754
|
+
// normalizeStyleSpelling find and change camelCase in an app's pages (the Designer's "Unify styles"); the look
|
|
2755
|
+
// stays the same - where a block holds a property twice, the value the app shows today is kept.
|
|
2756
|
+
/** "fontSize" -> "font-size", "WebkitLineClamp" -> "-webkit-line-clamp"; a CSS name (and --var) stays. */
|
|
2757
|
+
function cssStyleKey(key) {
|
|
2758
|
+
const k = String(key ?? '').trim();
|
|
2759
|
+
if (k.startsWith('--') || !/[A-Z]/.test(k))
|
|
2760
|
+
return k;
|
|
2761
|
+
return k.replace(/^(Webkit|Moz|ms|O)(?=[A-Z])/, (p) => '-' + p.toLowerCase()).replace(/[A-Z]/g, (c) => '-' + c.toLowerCase());
|
|
2762
|
+
}
|
|
2763
|
+
/** "font-size" -> "fontSize" - for code that reads a property in both spellings. */
|
|
2764
|
+
function camelStyleKey(key) {
|
|
2765
|
+
const k = String(key ?? '').trim();
|
|
2766
|
+
if (k.startsWith('--'))
|
|
2767
|
+
return k;
|
|
2768
|
+
return k.replace(/^-(webkit|moz|ms|o)-/, (_m, p) => (p === 'ms' ? 'ms-' : p[0].toUpperCase() + p.slice(1) + '-'))
|
|
2769
|
+
.replace(/-([a-z])/g, (_m, c) => c.toUpperCase());
|
|
2770
|
+
}
|
|
2771
|
+
/** A property of a style object in either spelling: styleValue(style, 'align-items'). */
|
|
2772
|
+
function styleValue(style, cssName) {
|
|
2773
|
+
if (!style || typeof style !== 'object')
|
|
2774
|
+
return undefined;
|
|
2775
|
+
return style[cssName] ?? style[camelStyleKey(cssName)];
|
|
2776
|
+
}
|
|
2777
|
+
/**
|
|
2778
|
+
* The style object in CSS spelling. A property written twice keeps the later one - the browser applies the keys
|
|
2779
|
+
* in their order, so that is the value the app shows today. classes and non-property values (objects) stay.
|
|
2780
|
+
*/
|
|
2781
|
+
function cssStyle(style) {
|
|
2782
|
+
if (!style || typeof style !== 'object' || Array.isArray(style))
|
|
2783
|
+
return style;
|
|
2784
|
+
const out = {};
|
|
2785
|
+
for (const [k, v] of Object.entries(style)) {
|
|
2786
|
+
const name = k === 'classes' || (v !== null && typeof v === 'object') ? k : cssStyleKey(k);
|
|
2787
|
+
if (name in out)
|
|
2788
|
+
delete out[name]; // keep the order of the winning key
|
|
2789
|
+
out[name] = v;
|
|
2790
|
+
}
|
|
2791
|
+
return out;
|
|
2792
|
+
}
|
|
2793
|
+
/** A key that holds a style object in a page: style, stylePerCard and every …Style (wrapperStyle, labelStyle …). */
|
|
2794
|
+
function isStyleHolder(key, value) {
|
|
2795
|
+
return !!value && typeof value === 'object' && !Array.isArray(value) && (key === 'style' || key === 'stylePerCard' || /Style$/.test(key));
|
|
2796
|
+
}
|
|
2797
|
+
/** Style properties of a page written in camelCase. */
|
|
2798
|
+
function styleSpellingFindings(doc) {
|
|
2799
|
+
const found = [];
|
|
2800
|
+
visitStyles(doc, '', (style, path) => {
|
|
2801
|
+
for (const [k, v] of Object.entries(style)) {
|
|
2802
|
+
if (k === 'classes' || (v !== null && typeof v === 'object'))
|
|
2803
|
+
continue;
|
|
2804
|
+
const css = cssStyleKey(k);
|
|
2805
|
+
if (css !== k)
|
|
2806
|
+
found.push({ path, key: k, css, twice: css in style });
|
|
2807
|
+
}
|
|
2808
|
+
});
|
|
2809
|
+
return found;
|
|
2810
|
+
}
|
|
2811
|
+
/** The page with every style object in CSS spelling, and what was changed. The page is not changed in place. */
|
|
2812
|
+
function normalizeStyleSpelling(doc) {
|
|
2813
|
+
const findings = styleSpellingFindings(doc);
|
|
2814
|
+
if (!findings.length)
|
|
2815
|
+
return { doc, findings };
|
|
2816
|
+
const copy = JSON.parse(JSON.stringify(doc));
|
|
2817
|
+
visitStyles(copy, '', (style, _path, set) => set(cssStyle(style)));
|
|
2818
|
+
return { doc: copy, findings };
|
|
2819
|
+
}
|
|
2820
|
+
function visitStyles(node, path, visit) {
|
|
2821
|
+
if (Array.isArray(node)) {
|
|
2822
|
+
node.forEach((x, i) => visitStyles(x, `${path}[${i}]`, visit));
|
|
2823
|
+
return;
|
|
2824
|
+
}
|
|
2825
|
+
if (!node || typeof node !== 'object')
|
|
2826
|
+
return;
|
|
2827
|
+
const bag = node;
|
|
2828
|
+
for (const [k, v] of Object.entries(bag)) {
|
|
2829
|
+
const here = path ? `${path}.${k}` : k;
|
|
2830
|
+
if (isStyleHolder(k, v)) {
|
|
2831
|
+
const values = Object.values(v);
|
|
2832
|
+
// responsiveStyle / responsiveWrapperStyle: one style object per device
|
|
2833
|
+
if (values.length && values.every((x) => x && typeof x === 'object' && !Array.isArray(x))) {
|
|
2834
|
+
for (const [device, s] of Object.entries(v))
|
|
2835
|
+
visit(s, `${here}.${device}`, (n) => { v[device] = n; });
|
|
2836
|
+
}
|
|
2837
|
+
else {
|
|
2838
|
+
visit(v, here, (n) => { bag[k] = n; });
|
|
2839
|
+
}
|
|
2840
|
+
// a style object can hold another (style.responsiveStyle) - its scalar properties are done, objects go on
|
|
2841
|
+
visitStyles(bag[k], here, visit);
|
|
2842
|
+
continue;
|
|
2843
|
+
}
|
|
2844
|
+
visitStyles(v, here, visit);
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
1455
2847
|
|
|
2848
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-02
|
|
2849
|
+
// - new: style-keys - one spelling for style properties (CSS: font-size)
|
|
2850
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-30
|
|
2851
|
+
// - new: the action catalog - what / where / how of a storage or backend call (OFFENE-PUNKTE 144)
|
|
1456
2852
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-23
|
|
1457
2853
|
// - new: the app settings catalog - Login, Pagination, Terms & Conditions of Main (#166)
|
|
1458
2854
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-19
|
|
@@ -1465,5 +2861,5 @@ function appSettingsMenu(menu, center, context = {}) {
|
|
|
1465
2861
|
* Generated bundle index. Do not edit.
|
|
1466
2862
|
*/
|
|
1467
2863
|
|
|
1468
|
-
export { APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BASIC_TYPES, CARD_LAYOUTS, 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, cardLayoutOf, 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 };
|
|
2864
|
+
export { APP_DATA_KEEP, APP_KEYBOARD_DEVICES, APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BACKEND_ACTIONS, BASIC_TYPES, BROWSER_STORAGES, CALCULATE_OPERATORS, CALL_KEYS, CALL_KINDS, CARD_LAYOUTS, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DEFAULT_TEMPO_SECONDS, DISPLAY_FORMATS, DOCUMENT_KINDS, ENTER_KEYS, EXPECT_KINDS, FORMATS, FRAME_PARTS, FRAME_SELECTORS, HEADER_SCROLLS, INNER_ACTIONS, 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, STRIPE_TEST_CARDS, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DATA_FILE, TEST_DEVICES, TEST_TEMPOS, TYPE_ALIASES, actionName, actionParams, alignRowsOf, appSettingsMenu, assertFieldSettings, base32Bytes, baseType, basicType, callAttributes, callKindOf, camelStyleKey, canonicalControl, cardLayoutOf, checkAppSettings, checkCall, checkElementAction, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, convertOlderForms, cssStyle, cssStyleKey, dataSettings, dateOrder, defaultKeyboard, deviceChoices, displaySettings, effectiveControl, effectiveFormat, elementAction, enterKeyFor, flowDevices, flowLanguages, hasAppKeyboard, headerScrollOf, isKeyboardCheck, isStyleHolder, keyboardFor, languageName, layoutNotes, layoutProblems, localeKeys, localeRenderings, loginMethod, matchesTemplate, maxLinesOf, menuCaption, menuEntries, menuEntryByCaption, menuEntryForPage, menuPage, methodOf, normalizeFormat, normalizeStyleSpelling, pageOf, paginationFor, parseDevice, probeClearAppData, probeField, probeFieldVisible, probeInFrame, probeLayoutSnapshot, probePagePlace, probeRestoreStorage, probeStorageSnapshot, probeUntranslated, readAppSettings, readTestUser, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, storageOf, stripeTestPaymentMethod, styleSpellingFindings, styleValue, successMessageOf, tempoPause, temporalPart, testDataRefs, testUserEntry, totp, translateCaptions, uses12Hours, validateSettings, validationSettings, vaultJwtLogin, vaultPlace, waitsForFilter, withElementAction, withPageSource, withTestData };
|
|
1469
2865
|
//# sourceMappingURL=yomotech-view-toolkit-catalog.mjs.map
|