@mearl/client 2.20.5 → 2.20.6

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.
@@ -332,7 +332,13 @@ function validateStructuredOptions(value) {
332
332
  'defaultMaskAlpha',
333
333
  'defaultTapClose',
334
334
  ],
335
- ['heightRatioParam', 'tapCloseSelectors', 'silentTapClose'],
335
+ [
336
+ 'heightRatioParam',
337
+ 'tapCloseSelectors',
338
+ 'silentTapClose',
339
+ 'maxWidthPx',
340
+ 'maxWidthMinAppVersion',
341
+ ],
336
342
  ],
337
343
  };
338
344
  for (const [key, [required, optional]] of Object.entries(shapes)) {
@@ -340,15 +346,19 @@ function validateStructuredOptions(value) {
340
346
  continue;
341
347
  fields(value[key], required, optional, key);
342
348
  for (const [field, item] of Object.entries(value[key])) {
343
- const valid = field.startsWith('default') && field !== 'defaultTargetHost'
344
- ? field === 'defaultTapClose'
345
- ? typeof item === 'boolean'
346
- : typeof item === 'number'
347
- : field === 'silentTapClose'
348
- ? typeof item === 'boolean'
349
- : ['schemes', 'targetHostSuffixes', 'tapCloseSelectors'].includes(field)
350
- ? strings(item)
351
- : text(item);
349
+ const valid = field === 'maxWidthPx'
350
+ ? typeof item === 'number' && Number.isFinite(item) && item > 0
351
+ : field === 'maxWidthMinAppVersion'
352
+ ? typeof item === 'string' && /^\d+(?:\.\d+)*$/.test(item)
353
+ : field.startsWith('default') && field !== 'defaultTargetHost'
354
+ ? field === 'defaultTapClose'
355
+ ? typeof item === 'boolean'
356
+ : typeof item === 'number'
357
+ : field === 'silentTapClose'
358
+ ? typeof item === 'boolean'
359
+ : ['schemes', 'targetHostSuffixes', 'tapCloseSelectors'].includes(field)
360
+ ? strings(item)
361
+ : text(item);
352
362
  if (!valid)
353
363
  invalid(`${key}.${field}`);
354
364
  }
@@ -92,6 +92,10 @@ export interface AppImagePickerConfig {
92
92
  region: string;
93
93
  }
94
94
  export interface AppOverlayConfig {
95
+ /** 半弹层最大 CSS 像素宽度,仍受所在视口和 maxWidth 比例参数约束。 */
96
+ maxWidthPx?: number;
97
+ /** 最大宽度限制开始生效的客户端版本,未设置时适用于所有版本。 */
98
+ maxWidthMinAppVersion?: string;
95
99
  enabledParam: string;
96
100
  topRatioParam: string;
97
101
  /** 弹层高度占屏比例参数,与 topRatioParam 二选一即可。 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mearl/client",
3
- "version": "2.20.5",
3
+ "version": "2.20.6",
4
4
  "description": "Unified Mearl SDK & CLI for local and remote browsers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -63,8 +63,8 @@
63
63
  "commander": "^15.0.0",
64
64
  "fastest-levenshtein": "^1.0.16",
65
65
  "ws": "^8.18.0",
66
- "@mearl/cloud-types": "2.20.5",
67
- "@mearl/provider": "2.20.5"
66
+ "@mearl/cloud-types": "2.20.6",
67
+ "@mearl/provider": "2.20.6"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/node": "^24.9.1",