@yomotech/view-toolkit 1.0.52 → 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 +519 -37
- package/fesm2022/yomotech-view-toolkit-catalog.mjs.map +1 -1
- package/fesm2022/yomotech-view-toolkit.mjs +838 -149
- package/fesm2022/yomotech-view-toolkit.mjs.map +1 -1
- package/package.json +3 -2
- package/types/yomotech-view-toolkit-catalog.d.ts +191 -50
- package/types/yomotech-view-toolkit.d.ts +167 -7
|
@@ -1,3 +1,5 @@
|
|
|
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)
|
|
1
3
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
|
|
2
4
|
// - new: maxLinesOf (option.maxLines - a shown text ends with … after n lines), alignRowsOf (card list: the cards of a
|
|
3
5
|
// row equally high, buttons at the bottom; center.option.alignRows, on for new card lists)
|
|
@@ -378,19 +380,19 @@ function temporalPart(property) {
|
|
|
378
380
|
* - send: ISO with the device's offset, 2026-10-18T08:00:00+02:00 (the daily split of the time
|
|
379
381
|
* recording, convertToDailyLogs, stays as it is)
|
|
380
382
|
* - shown and typed: the app language, year with four digits (de 18.10.2026, time 08:05);
|
|
381
|
-
* lists: displayFormat short / medium (default) / long / custom
|
|
383
|
+
* lists: displayFormat short / medium (default) / long / iso (2026-10-30 in every language) / custom
|
|
382
384
|
*/
|
|
383
385
|
const TEMPORAL_TRANSFER = {
|
|
384
386
|
read: 'iso, local wall time, offset dropped',
|
|
385
387
|
send: 'iso with local offset',
|
|
386
388
|
show: 'app language, four-digit year',
|
|
387
|
-
listStyles: ['short', 'medium', 'long', 'custom'],
|
|
389
|
+
listStyles: ['short', 'medium', 'long', 'iso', 'custom'],
|
|
388
390
|
listDefault: 'medium',
|
|
389
391
|
};
|
|
390
392
|
/** The encodings a field can declare (option.fieldData.format). */
|
|
391
393
|
const DATA_FORMATS = ['iso-date', 'iso-time', 'iso-datetime', 'flag', 'decimal'];
|
|
392
394
|
/** How a date or time is shown (option.displayFormat). */
|
|
393
|
-
const DISPLAY_FORMATS = ['short', 'medium', 'long', 'custom'];
|
|
395
|
+
const DISPLAY_FORMATS = ['short', 'medium', 'long', 'iso', 'custom'];
|
|
394
396
|
/** How a number is shown (option.numberStyle). */
|
|
395
397
|
const NUMBER_STYLES = ['decimal', 'currency', 'percent'];
|
|
396
398
|
const setting = (key, label, kind = 'text', values, hint) => ({ key, label, kind, values, hint });
|
|
@@ -429,7 +431,8 @@ function displaySettings(schema, fallback, option) {
|
|
|
429
431
|
if (c === 'multiselect')
|
|
430
432
|
result.push(setting('maxVisible', 'Visible selected items', 'number'));
|
|
431
433
|
if ((['iso-date', 'iso-time', 'iso-datetime'].includes(f) && ['textInput', 'datepicker', 'timepicker', 'dateTimepicker', 'output'].includes(c)) || c === 'dateRangepicker') {
|
|
432
|
-
|
|
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']));
|
|
433
436
|
if (option.displayFormat === 'custom')
|
|
434
437
|
result.push(setting('customDisplayFormat', 'Fixed display pattern', 'text', undefined, 'Use only when every locale must show the same pattern.'));
|
|
435
438
|
result.push(setting('displayTimezone', 'Display timezone', 'text', undefined, 'local, UTC, or an IANA timezone such as Asia/Karachi.'));
|
|
@@ -682,6 +685,18 @@ function alignRowsOf(center) {
|
|
|
682
685
|
return center?.option?.alignRows === true;
|
|
683
686
|
}
|
|
684
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
|
|
685
700
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
|
|
686
701
|
// - change: signIn takes true (the default test user) or a test user's name (Vault, test-signin.ts)
|
|
687
702
|
// - new: TEST_TEMPOS, tempoPause - how fast a run goes, chosen only at "Run tests" (fast, normal, slow)
|
|
@@ -739,7 +754,7 @@ const TEST_DEVICES = ['mobile', 'tablet', 'laptop', 'desktop'];
|
|
|
739
754
|
/** Old spellings of a device, still taken: "phone" is "mobile" (2026-10-31, the preview's word). */
|
|
740
755
|
const OLD_DEVICE_NAMES = { phone: 'mobile' };
|
|
741
756
|
const ORIENTATIONS = ['portrait', 'landscape'];
|
|
742
|
-
const STEP_KINDS = ['open', 'menu', 'tap', 'type', 'pick', 'press', 'scroll', 'openRecord', 'close', 'cart', 'rotate', 'device', 'wait', 'language', 'reload', 'signIn', 'expect'];
|
|
757
|
+
const STEP_KINDS = ['open', 'menu', 'tap', 'type', 'pick', 'press', 'scroll', 'openRecord', 'close', 'cart', 'rotate', 'device', 'wait', 'language', 'reload', 'signIn', 'signOut', 'expect'];
|
|
743
758
|
/** What an expect step can check - one of them per step. */
|
|
744
759
|
const EXPECT_KINDS = ['value', 'shows', 'keyboard', 'list', 'message', 'visible', 'hidden', 'locked', 'blocked', 'inFrame',
|
|
745
760
|
'page', 'records', 'recordsAtLeast', 'samePlace', 'cartCount', 'toast', 'checked', 'unchecked', 'cardRows',
|
|
@@ -796,6 +811,38 @@ function parseDevice(text) {
|
|
|
796
811
|
return null;
|
|
797
812
|
return { device: device, orientation: orientation };
|
|
798
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
|
+
}
|
|
799
846
|
/** The devices a flow runs on. */
|
|
800
847
|
function flowDevices(flow) {
|
|
801
848
|
// an old spelling ("phone") as today's name ("mobile")
|
|
@@ -850,9 +897,11 @@ function dateOrder(lang) {
|
|
|
850
897
|
* (en 10302026, de 30102026), a time as digits with P/A in a 12-hour language (0200P) or 24 hours (1400), a number
|
|
851
898
|
* with the language's decimal sign (de 12,50). Any other text stays as it is - older flows typed the keys themselves.
|
|
852
899
|
*/
|
|
853
|
-
function localeKeys(value, lang) {
|
|
900
|
+
function localeKeys(value, lang, dateDisplay = 'language') {
|
|
854
901
|
const text = String(value);
|
|
855
|
-
|
|
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('');
|
|
856
905
|
const time = (h, min) => {
|
|
857
906
|
if (!uses12Hours(lang))
|
|
858
907
|
return `${h}${min}`;
|
|
@@ -876,11 +925,20 @@ function localeKeys(value, lang) {
|
|
|
876
925
|
return text;
|
|
877
926
|
}
|
|
878
927
|
/** Every way the language writes this value (expect formatted) - the field must show one of them; spaces are made plain. */
|
|
879
|
-
function localeRenderings(value, as, lang, currency) {
|
|
928
|
+
function localeRenderings(value, as, lang, currency, dateDisplay = 'language') {
|
|
880
929
|
const out = new Set();
|
|
881
930
|
const add = (s) => out.add(s.replace(/[\u00a0\u202f]/g, ' ').trim());
|
|
882
931
|
const d = NEUTRAL_DATETIME.exec(value) || NEUTRAL_DATE.exec(value);
|
|
883
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
|
+
}
|
|
884
942
|
try {
|
|
885
943
|
if (as === 'date' && d) {
|
|
886
944
|
const day = new Date(Number(d[1]), Number(d[2]) - 1, Number(d[3]));
|
|
@@ -1141,6 +1199,7 @@ function checkTestFlow(flow, data) {
|
|
|
1141
1199
|
add('languageUnknown', n, { language: String(step.language) });
|
|
1142
1200
|
break;
|
|
1143
1201
|
case 'reload':
|
|
1202
|
+
case 'signOut':
|
|
1144
1203
|
if (step[kind] !== true)
|
|
1145
1204
|
add('notTrue', n, { kind });
|
|
1146
1205
|
break;
|
|
@@ -1213,13 +1272,24 @@ function checkExpect(e, n, add) {
|
|
|
1213
1272
|
}
|
|
1214
1273
|
/**
|
|
1215
1274
|
* How fast a run goes - chosen only where the run is started (preview: the choice beside "Run tests"; devices:
|
|
1216
|
-
* --tempo=…), never in a test (user 2026-11-01):
|
|
1217
|
-
* (a long pause, to watch it). The checks' time limits start after the pause.
|
|
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.
|
|
1218
1277
|
*/
|
|
1219
1278
|
const TEST_TEMPOS = ['fast', 'normal', 'slow'];
|
|
1220
|
-
/**
|
|
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. */
|
|
1221
1286
|
function tempoPause(tempo) {
|
|
1222
|
-
|
|
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;
|
|
1223
1293
|
}
|
|
1224
1294
|
|
|
1225
1295
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
|
|
@@ -1880,6 +1950,18 @@ function headerScrollOf(header) {
|
|
|
1880
1950
|
return HEADER_SCROLLS.includes(own) ? own : 'fixed';
|
|
1881
1951
|
}
|
|
1882
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)
|
|
1883
1965
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-30
|
|
1884
1966
|
// - new: rowAction (an icon of a grid row: any method, default GET - hotel approves with GET), OLD_CALL_KEYS and
|
|
1885
1967
|
// successMessageOf (notifcation.success of older data)
|
|
@@ -1923,10 +2005,10 @@ const CALL_KINDS = {
|
|
|
1923
2005
|
backend: ['url', 'data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dataKey', 'errorMessage'],
|
|
1924
2006
|
},
|
|
1925
2007
|
save: {
|
|
1926
|
-
does: 'A card button sends this one record to the backend.',
|
|
1927
|
-
storages: ['database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
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',
|
|
1928
2010
|
methods: ['POST', 'PUT'],
|
|
1929
|
-
browser: [],
|
|
2011
|
+
browser: ['data_url', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
|
|
1930
2012
|
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'afterSuccess', ...MESSAGES],
|
|
1931
2013
|
},
|
|
1932
2014
|
saveAll: {
|
|
@@ -1937,10 +2019,10 @@ const CALL_KINDS = {
|
|
|
1937
2019
|
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'sendMode', 'afterSuccess', ...MESSAGES],
|
|
1938
2020
|
},
|
|
1939
2021
|
submit: {
|
|
1940
|
-
does: 'A form or dialog button keeps its record in the browser storage or sends it to the backend.',
|
|
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.',
|
|
1941
2023
|
storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'localstorage', addressKey: 'data_url',
|
|
1942
2024
|
methods: ['POST', 'PUT'],
|
|
1943
|
-
browser: ['data_url', 'afterSuccessPage', ...MESSAGES],
|
|
2025
|
+
browser: ['data_url', 'key', 'afterSuccessPage', ...MESSAGES],
|
|
1944
2026
|
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'afterSuccess', 'afterSuccessPage', ...MESSAGES],
|
|
1945
2027
|
},
|
|
1946
2028
|
delete: {
|
|
@@ -1952,9 +2034,9 @@ const CALL_KINDS = {
|
|
|
1952
2034
|
},
|
|
1953
2035
|
rowAction: {
|
|
1954
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").',
|
|
1955
|
-
storages: ['database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
2037
|
+
storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
1956
2038
|
methods: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
1957
|
-
browser: [],
|
|
2039
|
+
browser: ['data_url', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
|
|
1958
2040
|
backend: ['data_url', 'proxy', 'method', 'passToken', 'key', 'afterSuccessSet', ...MESSAGES],
|
|
1959
2041
|
},
|
|
1960
2042
|
login: {
|
|
@@ -1990,26 +2072,16 @@ const NO_CALL_ACTIONS = {
|
|
|
1990
2072
|
function callKindOf(option, place = 'button') {
|
|
1991
2073
|
if (place === 'autocomplete')
|
|
1992
2074
|
return 'select';
|
|
1993
|
-
|
|
1994
|
-
const
|
|
1995
|
-
if (
|
|
1996
|
-
return
|
|
1997
|
-
if (
|
|
1998
|
-
return '
|
|
1999
|
-
if (
|
|
2000
|
-
return 'login';
|
|
2001
|
-
if (inner && NO_CALL_ACTIONS[`innerAction:${inner}`])
|
|
2002
|
-
return null;
|
|
2003
|
-
if (action === 'save')
|
|
2004
|
-
return 'save';
|
|
2005
|
-
if (action === 'delete')
|
|
2006
|
-
return 'delete';
|
|
2007
|
-
if (action && NO_CALL_ACTIONS[`action:${action}`])
|
|
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)
|
|
2008
2082
|
return null;
|
|
2009
2083
|
if (place === 'menu' || place === 'page')
|
|
2010
2084
|
return 'load';
|
|
2011
|
-
if (action === 'get')
|
|
2012
|
-
return 'link';
|
|
2013
2085
|
return null;
|
|
2014
2086
|
}
|
|
2015
2087
|
/** The storage an option means: its storageType (any case, an old value translated), else the kind's default. */
|
|
@@ -2077,6 +2149,317 @@ function checkCall(option, kind) {
|
|
|
2077
2149
|
}
|
|
2078
2150
|
return problems;
|
|
2079
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
|
+
}
|
|
2080
2463
|
|
|
2081
2464
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-31
|
|
2082
2465
|
// - new: one way to put a layout's texts into the app's language, for every container (form, card, grid, dialog,
|
|
@@ -2365,6 +2748,105 @@ function probeField(key) {
|
|
|
2365
2748
|
return { text: i ? String(i.value) : String((w.querySelector('.p-select-label, .p-select') || w).innerText || '').trim(), locked };
|
|
2366
2749
|
}
|
|
2367
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
|
+
}
|
|
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)
|
|
2368
2850
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-30
|
|
2369
2851
|
// - new: the action catalog - what / where / how of a storage or backend call (OFFENE-PUNKTE 144)
|
|
2370
2852
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-23
|
|
@@ -2379,5 +2861,5 @@ function probeField(key) {
|
|
|
2379
2861
|
* Generated bundle index. Do not edit.
|
|
2380
2862
|
*/
|
|
2381
2863
|
|
|
2382
|
-
export { APP_DATA_KEEP, APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BASIC_TYPES, BROWSER_STORAGES, CALL_KEYS, CALL_KINDS, CARD_LAYOUTS, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DISPLAY_FORMATS, DOCUMENT_KINDS, ENTER_KEYS, EXPECT_KINDS, FORMATS, FRAME_PARTS, FRAME_SELECTORS, HEADER_SCROLLS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NO_CALL_ACTIONS, NUMBER_STYLES, OLD_CALL_KEYS, OLD_DEVICE_NAMES, OLD_STORAGES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, PLACEHOLDER_SOURCE, RESULTS_DIR, RESULTS_KEEP, RTL_LANGUAGES, SETTING_MENU_TEXTS, SHOWN_TEXT_KEYS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, STORAGES, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DATA_FILE, TEST_DEVICES, TEST_TEMPOS, TYPE_ALIASES, alignRowsOf, appSettingsMenu, assertFieldSettings, base32Bytes, baseType, basicType, callAttributes, callKindOf, canonicalControl, cardLayoutOf, checkAppSettings, checkCall, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, dataSettings, dateOrder, defaultKeyboard, deviceChoices, displaySettings, effectiveControl, effectiveFormat, enterKeyFor, flowDevices, flowLanguages, headerScrollOf, keyboardFor, languageName, layoutNotes, layoutProblems, localeKeys, localeRenderings, loginMethod, matchesTemplate, maxLinesOf, menuCaption, menuEntries, menuEntryByCaption, menuEntryForPage, menuPage, methodOf, normalizeFormat, pageOf, paginationFor, parseDevice, probeClearAppData, probeField, probeFieldVisible, probeInFrame, probeLayoutSnapshot, probePagePlace, probeRestoreStorage, probeStorageSnapshot, probeUntranslated, readAppSettings, readTestUser, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, storageOf, successMessageOf, tempoPause, temporalPart, testDataRefs, testUserEntry, totp, translateCaptions, uses12Hours, validateSettings, validationSettings, vaultJwtLogin, vaultPlace, waitsForFilter, withTestData };
|
|
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 };
|
|
2383
2865
|
//# sourceMappingURL=yomotech-view-toolkit-catalog.mjs.map
|