@yomotech/view-toolkit 1.0.68 → 1.0.69

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.
@@ -174,11 +174,11 @@ const DATA_OBJECT_PLACES = {
174
174
  placeholder: 'option.placeholder',
175
175
  tooltip: 'option.tooltip',
176
176
  required: 'option.required',
177
- validation: 'option.required, option.fieldData.validation (minLength, maxLength, pattern, minimum, maximum)',
177
+ validation: 'option.required, option.fieldData.validation (minLength, maxLength, pattern, minimum, maximum; between fields: notBefore, notAfter, requiredWhen, minDuration, maxDuration)',
178
178
  value: 'option.fieldData.default (start value; a placeholder such as {{quantity}} or {{id}} too)',
179
179
  default: 'option.fieldData.default',
180
180
  data: 'option.fieldData.validation.enum and option.labels (a fixed list of choices)',
181
- loginUser: 'option.fromUser (the placeholder is taken from the signed-in user)',
181
+ loginUser: 'option.fieldData.default "{{user.x}}" (a field of the signed-in user\'s record, environment.login.user; option.fromUser is gone)',
182
182
  currency: 'option.numberStyle "currency" and option.fieldData.currency',
183
183
  decimalPoint: 'option.decimals',
184
184
  format: 'option.displayFormat "custom" and option.customDisplayFormat (a date pattern)',
@@ -698,6 +698,11 @@ function alignRowsOf(center) {
698
698
  return center?.option?.alignRows === true;
699
699
  }
700
700
 
701
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-14
702
+ // - new: layout rule colour - an open app keyboard or docked calendar has the page's colour (or the project's own
703
+ // keyboard colour); hotel's keyboard took the green of a Book button behind the dialog
704
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-12
705
+ // - new: pick by position (1 = first entry) and check filled - a list of live data, the entries are not known
701
706
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-07
702
707
  // - new: simulatorOnly - a flow that only the simulators run, the preview leaves it out (point 204, user)
703
708
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-05
@@ -776,7 +781,7 @@ const STEP_KINDS = ['open', 'menu', 'tap', 'type', 'pick', 'press', 'scroll', 'o
776
781
  /** What an expect step can check - one of them per step. */
777
782
  const EXPECT_KINDS = ['value', 'shows', 'keyboard', 'list', 'message', 'visible', 'hidden', 'locked', 'blocked', 'inFrame',
778
783
  'page', 'records', 'recordsAtLeast', 'listLoaded', 'pdf', 'samePlace', 'cartCount', 'toast', 'checked', 'unchecked', 'cardRows',
779
- 'formatted', 'translated', 'fieldVisible', 'restored', 'layout'];
784
+ 'formatted', 'translated', 'fieldVisible', 'restored', 'layout', 'filled'];
780
785
  /** How a value is shown in the language's form (expect formatted). */
781
786
  const FORMATS = ['date', 'time', 'datetime', 'number', 'currency'];
782
787
  /** Languages written right to left - not tested until right-to-left is supported (decision 2026-10-30). */
@@ -994,7 +999,8 @@ function localeRenderings(value, as, lang, currency, dateDisplay = 'language') {
994
999
  /**
995
1000
  * The layout rules (OFFENE-PUNKTE 143), judged on what a runner measured: beyond (an element leaves the frame
996
1001
  * sideways), sideways (the page scrolls sideways), overlap (two fields / buttons cover each other), narrow (a text
997
- * gets fewer than 3 characters a line), row (fields of one row do not stand on one line). Pixels tolerate 2.
1002
+ * gets fewer than 3 characters a line), row (fields of one row do not stand on one line), colour (an open keyboard or
1003
+ * calendar not in the page's colour). Pixels tolerate 2.
998
1004
  */
999
1005
  function layoutProblems(snap) {
1000
1006
  const problems = [];
@@ -1011,6 +1017,12 @@ function layoutProblems(snap) {
1011
1017
  if (Math.max(...tops) - Math.min(...tops) > tol)
1012
1018
  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(', ')})` });
1013
1019
  });
1020
+ // keyboard and calendar have the page's colour (or the project's own keyboard colour) - not a button's (2026-11-14)
1021
+ const rgb = (c) => (String(c).match(/[\d.]+/g) || []).slice(0, 3).map(Number).join(',');
1022
+ for (const p of snap.panels || []) {
1023
+ if (rgb(p.background) !== rgb(p.expected))
1024
+ problems.push({ rule: 'colour', detail: `${p.name} background ${p.background} differs from the page ${p.expected}` });
1025
+ }
1014
1026
  for (const s of snap.scrollers || []) {
1015
1027
  if (s.left < -tol || s.right > snap.width + tol)
1016
1028
  problems.push({ rule: 'beyond', detail: `area "${s.name}" leaves the frame (${Math.round(s.left)}–${Math.round(s.right)} of ${snap.width})` });
@@ -1202,7 +1214,7 @@ function checkTestFlow(flow, data) {
1202
1214
  add('intoMissing', n);
1203
1215
  break;
1204
1216
  case 'pick':
1205
- if (!text(step.pick))
1217
+ if (!(Number.isInteger(step.pick) && step.pick >= 1) && !text(step.pick))
1206
1218
  add('stepNameMissing', n, { kind });
1207
1219
  if (!text(step.in))
1208
1220
  add('inMissing', n);
@@ -1290,7 +1302,7 @@ function checkExpect(e, n, add) {
1290
1302
  if (e.formatted === 'currency' && !/^[A-Z]{3}$/.test(String(e.currency || '')))
1291
1303
  add('currencyMissing', n);
1292
1304
  }
1293
- if (kind === 'fieldVisible' && !text(e.fieldVisible))
1305
+ if ((kind === 'fieldVisible' || kind === 'filled') && !text(e[kind]))
1294
1306
  add('stepNameMissing', n, { kind });
1295
1307
  if ((kind === 'translated' || kind === 'restored' || kind === 'layout') && e[kind] !== true)
1296
1308
  add('notTrue', n, { kind });
@@ -2006,6 +2018,11 @@ function headerScrollOf(header) {
2006
2018
  return HEADER_SCROLLS.includes(own) ? own : 'fixed';
2007
2019
  }
2008
2020
 
2021
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-13
2022
+ // - new: check "addon:<name>" on save (backend), saveAll and submit (browser and backend) - the add-on checks the record
2023
+ // before it is kept or sent (OFFENE-PUNKTE 225 B)
2024
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-12
2025
+ // - new: perUser belongs to every browser source with data_url - records kept per signed-in user (record-format.ts)
2009
2026
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-10
2010
2027
  // - new: waitsForFilter - a source that names its filters (dataSource.filters) waits for them
2011
2028
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-07
@@ -2048,7 +2065,7 @@ const CALL_KINDS = {
2048
2065
  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).',
2049
2066
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
2050
2067
  methods: ['GET', 'POST'],
2051
- browser: ['data_url'],
2068
+ browser: ['data_url', 'perUser'],
2052
2069
  backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'dataKey', 'loadOnFilter', 'emptyMessage', 'errorMessage'],
2053
2070
  },
2054
2071
  link: {
@@ -2070,35 +2087,35 @@ const CALL_KINDS = {
2070
2087
  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.',
2071
2088
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
2072
2089
  methods: ['POST', 'PUT'],
2073
- browser: ['data_url', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
2074
- backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'afterSuccess', ...MESSAGES],
2090
+ browser: ['data_url', 'perUser', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
2091
+ backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'check', 'transform', 'afterSuccess', ...MESSAGES],
2075
2092
  },
2076
2093
  saveAll: {
2077
2094
  does: 'A header button sends all records of the page to the backend, one by one or in one call.',
2078
2095
  storages: ['database'], defaultStorage: 'database', addressKey: 'data_url',
2079
2096
  methods: ['POST', 'PUT'],
2080
2097
  browser: [],
2081
- backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'sendMode', 'afterSuccess', ...MESSAGES],
2098
+ backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'check', 'transform', 'sendMode', 'afterSuccess', ...MESSAGES],
2082
2099
  },
2083
2100
  submit: {
2084
2101
  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.',
2085
2102
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'localstorage', addressKey: 'data_url',
2086
2103
  methods: ['POST', 'PUT'],
2087
- browser: ['data_url', 'key', 'afterSuccessPage', ...MESSAGES],
2088
- backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'afterSuccess', 'afterSuccessPage', ...MESSAGES],
2104
+ browser: ['data_url', 'perUser', 'key', 'check', 'afterSuccessPage', ...MESSAGES],
2105
+ backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'check', 'transform', 'afterSuccess', 'afterSuccessPage', ...MESSAGES],
2089
2106
  },
2090
2107
  delete: {
2091
2108
  does: 'A button deletes the record - from the browser storage or at the backend; it asks first.',
2092
2109
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
2093
2110
  methods: ['DELETE', 'POST'],
2094
- browser: ['data_url', 'confirmDelete', 'deleteMessage', ...MESSAGES],
2111
+ browser: ['data_url', 'perUser', 'confirmDelete', 'deleteMessage', ...MESSAGES],
2095
2112
  backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'key', 'confirmDelete', 'deleteMessage', ...MESSAGES],
2096
2113
  },
2097
2114
  rowAction: {
2098
2115
  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").',
2099
2116
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
2100
2117
  methods: ['GET', 'POST', 'PUT', 'DELETE'],
2101
- browser: ['data_url', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
2118
+ browser: ['data_url', 'perUser', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
2102
2119
  backend: ['data_url', 'proxy', 'method', 'passToken', 'key', 'afterSuccessSet', ...MESSAGES],
2103
2120
  },
2104
2121
  login: {
@@ -2618,6 +2635,12 @@ function translateCaptions(schema, texts, { inPlace = false, values = false } =
2618
2635
  return target;
2619
2636
  }
2620
2637
 
2638
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-14
2639
+ // - fix: "text gets N characters a line" only for a text that wraps - a short word on one line
2640
+ // ("jj", "ffff") was reported as too narrow (hotel test G-01/A-01/C-01)
2641
+ // - fix: with a dialog open only what stands in it is measured - a button of the page behind was reported as
2642
+ // covering a dialog field (hotel C-02)
2643
+ // - new: panels - background of an open app keyboard / docked calendar and the colour the page asks for
2621
2644
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
2622
2645
  // - new: boxes say whether they stand in the top bar (inBar)
2623
2646
  // - new: cardRows - in a card list with aligned rows, per row the tops of the cards' button elements
@@ -2656,6 +2679,9 @@ function probeLayoutSnapshot() {
2656
2679
  const doc = globalThis.document;
2657
2680
  const win = globalThis;
2658
2681
  const shown = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; };
2682
+ // an open dialog covers the page: only what stands in it is measured (the page behind is hidden by design)
2683
+ const dialog = [...doc.querySelectorAll('.p-dialog')].find((d) => shown(d));
2684
+ const measured = (el) => shown(el) && (!dialog || dialog.contains(el));
2659
2685
  const rowOf = (el) => {
2660
2686
  const parent = el.parentElement;
2661
2687
  if (!parent)
@@ -2684,24 +2710,31 @@ function probeLayoutSnapshot() {
2684
2710
  };
2685
2711
  const boxes = [];
2686
2712
  for (const el of [...doc.querySelectorAll('[data-vl-field]')]) {
2687
- if (!shown(el) || el.closest('[data-vl-record]'))
2713
+ if (!measured(el) || el.closest('[data-vl-record]'))
2688
2714
  continue;
2689
2715
  const r = el.getBoundingClientRect();
2690
2716
  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') });
2691
2717
  }
2692
2718
  for (const el of [...doc.querySelectorAll('[data-vl-action], button')]) {
2693
- if (!shown(el) || el.closest('[data-vl-field], section[data-vl-custom-keyboard], .left-wrap'))
2719
+ if (!measured(el) || el.closest('[data-vl-field], section[data-vl-custom-keyboard], .left-wrap'))
2694
2720
  continue;
2695
2721
  const r = el.getBoundingClientRect();
2696
2722
  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') });
2697
2723
  }
2698
2724
  for (const el of [...doc.querySelectorAll('label, .vl-control__label, .vl-control__value')]) {
2699
2725
  const t = String(el.innerText || '').trim();
2700
- if (!t || !shown(el))
2726
+ if (!t || !measured(el))
2701
2727
  continue;
2702
2728
  const r = el.getBoundingClientRect();
2703
- const size = parseFloat(getComputedStyle(el).fontSize) || 14;
2704
- 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) });
2729
+ const css = getComputedStyle(el);
2730
+ const size = parseFloat(css.fontSize) || 14;
2731
+ // a text on one line is never too narrow (short words like "jj" are as wide as themselves);
2732
+ // characters a line are counted only when the text wraps onto more lines
2733
+ const line = parseFloat(css.lineHeight) || size * 1.2;
2734
+ const wraps = r.height > line * 1.5;
2735
+ // no key at all on one line: an undefined value comes back from the device as null
2736
+ boxes.push({ kind: 'text', name: t.slice(0, 20), left: r.left, top: r.top, right: r.right, bottom: r.bottom,
2737
+ ...(wraps ? { charsPerLine: Math.floor(r.width / (size * 0.55)) } : {}), scroller: scrollerOf(el) });
2705
2738
  }
2706
2739
  // the top bar (header + page X): where it stands, what it should do, and whether the page is scrolled
2707
2740
  const bar = doc.querySelector('.vl-top-bar');
@@ -2724,8 +2757,34 @@ function probeLayoutSnapshot() {
2724
2757
  if (tops.length > 1)
2725
2758
  cardRows.push(tops);
2726
2759
  }
2760
+ // keyboard and calendar panel look like the page (user 2026-10-13): their background against the page's - the page
2761
+ // area (.center-wrap) or the first coloured element above it, white at last; a project's own keyboard colour
2762
+ // (--vl-keyboard-background) is what it asked for (2026-11-14: hotel's keyboard took the green of a Book button)
2763
+ const colourOf = (start) => {
2764
+ for (let e = start; e; e = e.parentElement) {
2765
+ const c = getComputedStyle(e).backgroundColor;
2766
+ if (c && c !== 'transparent' && !/rgba\(.*,\s*0\)$/.test(c))
2767
+ return c;
2768
+ }
2769
+ return 'rgb(255, 255, 255)';
2770
+ };
2771
+ let expected = colourOf(doc.querySelector('.center-wrap') || doc.body);
2772
+ const own = doc.body ? String(getComputedStyle(doc.body).getPropertyValue('--vl-keyboard-background') || '').trim() : '';
2773
+ if (own && doc.createElement) {
2774
+ const probe = doc.createElement('i');
2775
+ probe.style.backgroundColor = own;
2776
+ doc.body.appendChild(probe);
2777
+ expected = getComputedStyle(probe).backgroundColor || expected;
2778
+ probe.remove();
2779
+ }
2780
+ const panels = [];
2781
+ for (const [name, selector] of [['keyboard', 'section[data-vl-custom-keyboard]'], ['calendar', '.model-datepicker-panel--docked']]) {
2782
+ const el = [...doc.querySelectorAll(selector)].find((x) => shown(x));
2783
+ if (el)
2784
+ panels.push({ name, background: getComputedStyle(el).backgroundColor, expected });
2785
+ }
2727
2786
  return { width: win.innerWidth, height: win.innerHeight, scrollsSideways: doc.documentElement.scrollWidth > win.innerWidth + 2, boxes,
2728
- scrollers: scrollers.map(({ el, ...s }) => s), header, cardRows };
2787
+ scrollers: scrollers.map(({ el, ...s }) => s), header, cardRows, panels };
2729
2788
  }
2730
2789
  /** Whether a field (data-vl-path with a dot, else data-vl-field) stands visible above an open keyboard: '' or why not. */
2731
2790
  function probeFieldVisible(key) {