@yomotech/view-toolkit 1.0.79 → 1.0.81

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.
@@ -3020,6 +3020,12 @@ function visitStyles(node, path, visit) {
3020
3020
  }
3021
3021
  }
3022
3022
 
3023
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-18
3024
+ // - new: sizes per device, roundings per part, logo and pictures, font roles named like the Designer (point 173 step 2.1,
3025
+ // sketch dev/skizzen/theme-groessen.html) - "standard" is today's look (shown, never put on the page), "devices" lets a
3026
+ // value differ on tablet / web (key@tablet, key@web), "options" are the allowed values of a choice
3027
+ // - new: DESIGN_DEVICE_MEDIA (tablet: 600 wide and high - a phone turned stays mobile; web: from 1280) and themeDeviceCss -
3028
+ // the device values of a theme and the app as @media rules (point 173 step 2.2)
3023
3029
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-09
3024
3030
  // - fix: an app's own menu colours bring the derived ones (muted text, hover, divider) - the theme's stayed on a light menu
3025
3031
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-08
@@ -3034,6 +3040,13 @@ function visitStyles(node, path, visit) {
3034
3040
  // AI contract. Two levels: "basic" is what a person chooses, "advanced" follows from the basic values (from) unless
3035
3041
  // a theme sets it. A style uses var(--vl-..., today's value): without a theme an app looks as before.
3036
3042
  // - new: STANDARD_THEMES, themeVariables - the platform's themes; an app names one in center.theme of Main
3043
+ /** The devices a value may differ on: mobile is the key itself, the others key@tablet / key@web. */
3044
+ const DESIGN_DEVICES = ['tablet', 'web'];
3045
+ /** Where a device starts (CSS media query) - the same for the runtime's theme and the library's styles. */
3046
+ const DESIGN_DEVICE_MEDIA = {
3047
+ tablet: '(min-width: 600px) and (min-height: 600px)',
3048
+ web: '(min-width: 1280px)',
3049
+ };
3037
3050
  const value = (key, group, kind, from) => ({
3038
3051
  key,
3039
3052
  cssVar: `--vl-${key.replace(/\./g, '-')}`,
@@ -3042,6 +3055,30 @@ const value = (key, group, kind, from) => ({
3042
3055
  level: from ? 'advanced' : 'basic',
3043
3056
  ...(from ? { from } : {}),
3044
3057
  });
3058
+ /** A value of the advanced level with today's look as its standard (no "from": nothing else leads to it). */
3059
+ const extra = (key, group, kind, standard, more = {}) => ({
3060
+ key, cssVar: `--vl-${key.replace(/\./g, '-')}`, group, kind, level: 'advanced', standard, ...more,
3061
+ });
3062
+ /** The font roles, named like the Designer: [key part, family from, size, weight, capitals]. */
3063
+ const FONT_ROLES = [
3064
+ ['header', 'font.heading-family', '1.05rem', '700', 'uppercase'],
3065
+ ['page-title', 'font.heading-family', '1.6rem', '700', 'none'],
3066
+ ['section-title', 'font.heading-family', '1.15rem', '700', 'none'],
3067
+ ['label', 'font.family', '0.7rem', '500', 'uppercase'],
3068
+ ['value', 'font.family', '1rem', '400', 'none'],
3069
+ ['value-strong', 'font.heading-family', '1.15rem', '700', 'none'],
3070
+ ['field', 'font.family', '1rem', '400', 'none'],
3071
+ ['button', 'font.family', '0.95rem', '500', 'none'],
3072
+ ['message', 'font.family', '0.85rem', '400', 'none'],
3073
+ ];
3074
+ const fontRole = ([role, family, size, weight, capitals]) => [
3075
+ extra(`text.${role}.family`, 'text', 'font', '', { from: family }),
3076
+ extra(`text.${role}.size`, 'text', 'size', size),
3077
+ extra(`text.${role}.weight`, 'text', 'weight', weight),
3078
+ extra(`text.${role}.case`, 'text', 'choice', capitals, { options: ['none', 'uppercase'] }),
3079
+ extra(`text.${role}.style`, 'text', 'choice', 'normal', { options: ['normal', 'italic'] }),
3080
+ extra(`text.${role}.decoration`, 'text', 'choice', 'none', { options: ['none', 'underline'] }),
3081
+ ];
3045
3082
  const DESIGN_VALUES = [
3046
3083
  value('color.primary', 'colors', 'color'),
3047
3084
  value('color.text', 'colors', 'color'),
@@ -3076,10 +3113,59 @@ const DESIGN_VALUES = [
3076
3113
  value('space.large', 'spacing', 'size', 'space.medium'),
3077
3114
  value('shadow.small', 'depth', 'shadow'),
3078
3115
  value('shadow.large', 'depth', 'shadow', 'shadow.small'),
3116
+ // sizes per device (point 173, 2026-11-18) - today's numbers of the accepted tm-guided card
3117
+ extra('size.button-height', 'sizes', 'size', { mobile: '44px', web: '40px' }, { devices: true }),
3118
+ extra('size.icon-button', 'sizes', 'size', { mobile: '36px', web: '32px' }, { devices: true }),
3119
+ extra('size.field-height', 'sizes', 'size', { mobile: '44px', web: '40px' }, { devices: true }),
3120
+ extra('size.touch-min', 'sizes', 'size', { mobile: '44px', web: '0' }, { devices: true }),
3121
+ extra('space.card', 'sizes', 'size', '16px', { devices: true }),
3122
+ extra('space.card-gap', 'sizes', 'size', '16px', { devices: true }),
3123
+ // roundings per part - all follow shape.radius unless set
3124
+ extra('shape.card-radius', 'shape', 'size', '8px', { from: 'shape.radius' }),
3125
+ extra('shape.field-radius', 'shape', 'size', '8px', { from: 'shape.radius' }),
3126
+ extra('shape.icon-radius', 'shape', 'size', '8px', { from: 'shape.button-radius' }),
3127
+ // logo and pictures: how they stand - which logo and which pictures stay in Media
3128
+ extra('logo.height', 'logo', 'size', { mobile: '30px', tablet: '36px', web: '40px' }, { devices: true }),
3129
+ extra('logo.position', 'logo', 'choice', 'start', { options: ['start', 'center'] }),
3130
+ extra('logo.with-name', 'logo', 'choice', 'show', { options: ['show', 'hide'] }),
3131
+ extra('logo.background', 'logo', 'choice', 'none', { options: ['none', 'card'] }),
3132
+ extra('header.height', 'header', 'size', { mobile: '56px', tablet: '64px', web: '64px' }, { devices: true }),
3133
+ extra('image.radius', 'images', 'size', '8px', { from: 'shape.radius' }),
3134
+ extra('image.ratio', 'images', 'choice', '4 / 3', { options: ['4 / 3', '1 / 1', '16 / 9', 'auto'] }),
3135
+ extra('image.fit', 'images', 'choice', 'cover', { options: ['cover', 'contain'] }),
3136
+ extra('image.inset', 'images', 'choice', 'none', { options: ['none', 'card'] }),
3137
+ extra('image.placeholder', 'images', 'color', '', { from: 'color.border' }),
3138
+ // font roles: family, size, weight, capitals, italic, underline per role
3139
+ ...FONT_ROLES.flatMap(fontRole),
3079
3140
  ];
3080
- /** The value of a key, or undefined. */
3141
+ /** The value of a key, or undefined; a device key (size.button-height@web) names its value when that value has devices. */
3081
3142
  function designValue(key) {
3082
- return DESIGN_VALUES.find((item) => item.key === key);
3143
+ const [base, device] = String(key).split('@');
3144
+ const item = DESIGN_VALUES.find((v) => v.key === base);
3145
+ if (device === undefined)
3146
+ return item;
3147
+ return item?.devices && DESIGN_DEVICES.includes(device) ? item : undefined;
3148
+ }
3149
+ /** The standard of a value on a device (mobile, tablet, web) - today's look; '' when it only follows another value. */
3150
+ function designStandard(item, device = 'mobile') {
3151
+ const standard = item.standard ?? '';
3152
+ if (typeof standard === 'string')
3153
+ return standard;
3154
+ return standard[device] ?? standard.mobile;
3155
+ }
3156
+ /**
3157
+ * The device values of a theme (key@tablet, key@web) as CSS variables per device; {} for a device without any. The
3158
+ * key itself is mobile's and comes from designVariables - a device leaves out what it does not change.
3159
+ */
3160
+ function designDeviceVariables(values) {
3161
+ const result = { tablet: {}, web: {} };
3162
+ for (const [key, raw] of Object.entries(values)) {
3163
+ const device = key.split('@')[1];
3164
+ const item = device ? designValue(key) : undefined;
3165
+ if (item && (device === 'tablet' || device === 'web'))
3166
+ result[device][item.cssVar] = raw;
3167
+ }
3168
+ return result;
3083
3169
  }
3084
3170
  /**
3085
3171
  * The CSS variables of a theme's values: what the theme leaves out follows its "from" chain; a value nothing leads to
@@ -3214,6 +3300,10 @@ function isSafeDesignValue(key, raw) {
3214
3300
  return size.test(v);
3215
3301
  if (item.kind === 'font')
3216
3302
  return /^[\w\s,'"-]+$/.test(v);
3303
+ if (item.kind === 'weight')
3304
+ return /^[1-9]00$/.test(v);
3305
+ if (item.kind === 'choice')
3306
+ return (item.options ?? []).includes(v);
3217
3307
  return /^[\w\s#.,%()/-]+$/.test(v);
3218
3308
  }
3219
3309
  /** The app's own design values (Main center.themeValues) that pass isSafeDesignValue - the others are left out. */
@@ -3246,6 +3336,18 @@ function themeVariables(id, own) {
3246
3336
  }
3247
3337
  return designVariables({ ...(theme?.values ?? {}), ...derived, ...mine });
3248
3338
  }
3339
+ /**
3340
+ * The device values of a theme and the app's own values over it (key@tablet, key@web) as CSS: one @media rule per device
3341
+ * that has any, tablet before web; '' when none. Values pass isSafeDesignValue first (safeDesignValues).
3342
+ */
3343
+ function themeDeviceCss(id, own) {
3344
+ const theme = appTheme(id);
3345
+ const devices = designDeviceVariables({ ...(theme?.values ?? {}), ...safeDesignValues(own) });
3346
+ return ['tablet', 'web']
3347
+ .filter((device) => Object.keys(devices[device]).length)
3348
+ .map((device) => `@media ${DESIGN_DEVICE_MEDIA[device]} { :root { ${Object.entries(devices[device]).map(([name, v]) => `${name}: ${v};`).join(' ')} } }`)
3349
+ .join('\n');
3350
+ }
3249
3351
 
3250
3352
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-09
3251
3353
  // - new: opening hours as data (point 213 worklist 29, user decision A): a week of times per day (day, from, to; a day
@@ -3422,5 +3524,5 @@ function formatPrice(amount, currency, lang, fromWord = '') {
3422
3524
  * Generated bundle index. Do not edit.
3423
3525
  */
3424
3526
 
3425
- 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, CONTACT_ICONS, CONTACT_KINDS, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DEFAULT_TEMPO_SECONDS, DESIGN_VALUES, 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_STYLES, 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, PRICE_CURRENCIES, RESULTS_DIR, RESULTS_KEEP, RTL_LANGUAGES, SETTING_MENU_TEXTS, SHOWN_TEXT_KEYS, STANDARD_THEMES, 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, THEME_FONTS, THEME_PATH, TYPE_ALIASES, WEEK_DAYS, actionName, actionParams, alignRowsOf, appSettingsFooter, appSettingsMenu, appTheme, assertFieldSettings, base32Bytes, baseType, basicType, callAttributes, callKindOf, camelStyleKey, canonicalControl, cardLayoutOf, checkAppSettings, checkCall, checkElementAction, checkPagePagination, checkTestFlow, clone, contactLink, controlChoicesFor, controlsFor, convertOlderForms, cssStyle, cssStyleKey, dataSettings, dateOrder, defaultKeyboard, designValue, designVariables, deviceChoices, displaySettings, effectiveControl, effectiveFormat, elementAction, enterKeyFor, flowDevices, flowLanguages, formatPrice, hasAppKeyboard, headerScrollOf, isKeyboardCheck, isSafeDesignValue, isStyleHolder, keyboardFor, languageName, layoutNotes, layoutProblems, localeKeys, localeRenderings, loginMethod, mapEmbedUrl, matchesTemplate, maxLinesOf, menuCaption, menuEntries, menuEntryByCaption, menuEntryForPage, menuPage, methodOf, normalizeFormat, normalizeStyleSpelling, openingProblems, openingStatus, pageOf, paginationFor, parseDevice, probeClearAppData, probeField, probeFieldVisible, probeInFrame, probeLayoutSnapshot, probePagePlace, probeRestoreStorage, probeStorageSnapshot, probeUntranslated, readAppSettings, readTestUser, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, safeDesignValues, startPage, startPageFor, stepKind, storageOf, stripeTestPaymentMethod, styleSpellingFindings, styleValue, successMessageOf, tempoPause, temporalPart, testDataRefs, testUserEntry, themeFontKnown, themeVariables, totp, translateCaptions, uses12Hours, validAmount, validCurrency, validPlace, validTimeZone, validateSettings, validationSettings, vaultJwtLogin, vaultPlace, waitsForFilter, withElementAction, withPageSource, withTestData, zonedNow };
3527
+ 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, CONTACT_ICONS, CONTACT_KINDS, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DEFAULT_TEMPO_SECONDS, DESIGN_DEVICES, DESIGN_DEVICE_MEDIA, DESIGN_VALUES, 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_STYLES, 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, PRICE_CURRENCIES, RESULTS_DIR, RESULTS_KEEP, RTL_LANGUAGES, SETTING_MENU_TEXTS, SHOWN_TEXT_KEYS, STANDARD_THEMES, 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, THEME_FONTS, THEME_PATH, TYPE_ALIASES, WEEK_DAYS, actionName, actionParams, alignRowsOf, appSettingsFooter, appSettingsMenu, appTheme, assertFieldSettings, base32Bytes, baseType, basicType, callAttributes, callKindOf, camelStyleKey, canonicalControl, cardLayoutOf, checkAppSettings, checkCall, checkElementAction, checkPagePagination, checkTestFlow, clone, contactLink, controlChoicesFor, controlsFor, convertOlderForms, cssStyle, cssStyleKey, dataSettings, dateOrder, defaultKeyboard, designDeviceVariables, designStandard, designValue, designVariables, deviceChoices, displaySettings, effectiveControl, effectiveFormat, elementAction, enterKeyFor, flowDevices, flowLanguages, formatPrice, hasAppKeyboard, headerScrollOf, isKeyboardCheck, isSafeDesignValue, isStyleHolder, keyboardFor, languageName, layoutNotes, layoutProblems, localeKeys, localeRenderings, loginMethod, mapEmbedUrl, matchesTemplate, maxLinesOf, menuCaption, menuEntries, menuEntryByCaption, menuEntryForPage, menuPage, methodOf, normalizeFormat, normalizeStyleSpelling, openingProblems, openingStatus, pageOf, paginationFor, parseDevice, probeClearAppData, probeField, probeFieldVisible, probeInFrame, probeLayoutSnapshot, probePagePlace, probeRestoreStorage, probeStorageSnapshot, probeUntranslated, readAppSettings, readTestUser, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, safeDesignValues, startPage, startPageFor, stepKind, storageOf, stripeTestPaymentMethod, styleSpellingFindings, styleValue, successMessageOf, tempoPause, temporalPart, testDataRefs, testUserEntry, themeDeviceCss, themeFontKnown, themeVariables, totp, translateCaptions, uses12Hours, validAmount, validCurrency, validPlace, validTimeZone, validateSettings, validationSettings, vaultJwtLogin, vaultPlace, waitsForFilter, withElementAction, withPageSource, withTestData, zonedNow };
3426
3528
  //# sourceMappingURL=yomotech-view-toolkit-catalog.mjs.map