@wix/himalaya-cli 0.1283.0 → 0.1285.0

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.
@@ -170,6 +170,9 @@ export declare function text(text: string, style?: string, opts?: {
170
170
  animateReveal?: boolean;
171
171
  markdown?: boolean;
172
172
  textDirection?: "auto" | "ltr" | "rtl";
173
+ minimumScaleFactor?: number;
174
+ monospacedDigits?: boolean;
175
+ truncation?: "tail" | "head" | "middle";
173
176
  }): Component;
174
177
  export declare function card(children: Component[], opts?: {
175
178
  id?: string;
@@ -258,6 +261,10 @@ export declare function icon(name: string, opts?: {
258
261
  tint?: string;
259
262
  contentDescription?: string;
260
263
  decorative?: boolean;
264
+ renderingMode?: "monochrome" | "hierarchical" | "palette" | "multicolor";
265
+ weight?: "ultraLight" | "thin" | "light" | "regular" | "medium" | "semibold" | "bold" | "heavy" | "black";
266
+ variableValue?: number;
267
+ effect?: "none" | "bounce" | "pulse" | "variableColor";
261
268
  }): Component;
262
269
  /**
263
270
  * An icon-only tap target that CANNOT be built without a name.
@@ -1563,6 +1570,7 @@ export declare function richText(props: {
1563
1570
  runs: Array<{
1564
1571
  text: string;
1565
1572
  style?: string;
1573
+ color?: string;
1566
1574
  marks?: Array<"bold" | "italic" | "underline" | "code" | "link">;
1567
1575
  linkAction?: ActionShape;
1568
1576
  }>;
@@ -311,7 +311,8 @@ export interface AppConfig {
311
311
  * `NavigationConfig.locale`. `default` must be a supported catalog tag
312
312
  * (`en` / `he` / `es`). `pin: true` ignores the device/browser language so a
313
313
  * Hebrew app stays RTL on an English phone. In-app `locale.set` still wins.
314
- * Omit ⇒ today's follow-the-device behavior.
314
+ * The device/browser language is followed only when it is `default` or listed in
315
+ * `translations`. Omit ⇒ the app runs in English on every device.
315
316
  */
316
317
  locale?: LocaleConfig;
317
318
  /**
@@ -7,7 +7,8 @@ export interface LocaleConfig {
7
7
  /** BCP-47 primary subtag. Must be in `SUPPORTED_LOCALES` at defineApp time;
8
8
  * clients coerce and drop anything else. */
9
9
  default: string;
10
- /** Skip device/browser language. In-app `locale.set` still wins. */
10
+ /** Skip device/browser language, even one listed in `translations`. In-app
11
+ * `locale.set` still wins. */
11
12
  pin?: boolean;
12
13
  /**
13
14
  * RFC 0054 — locale tags this app ships TRANSLATIONS for, beyond `default`.
@@ -17,8 +18,10 @@ export interface LocaleConfig {
17
18
  * the eleven `himi init` templates shipped in. Declaring `translations` is what
18
19
  * makes that gap reportable.
19
20
  *
20
- * Build-time only — inert on the wire, like any field a client does not know
21
- * (invariant 6).
21
+ * Also read by clients at runtime: the device/browser language is followed ONLY
22
+ * when it is `default` or listed here (see `shipsLocale`). Without this an English
23
+ * app on a Hebrew phone resolved `he` and painted English copy right-to-left. An
24
+ * older client ignores the field (invariant 6) and keeps following the device.
22
25
  */
23
26
  translations?: readonly string[];
24
27
  /**
@@ -40,13 +43,25 @@ export declare function isSupportedLocale(tag: string): tag is SupportedLocale;
40
43
  export declare function coerceSupportedLocale(tag: string | undefined | null): SupportedLocale | undefined;
41
44
  export declare function isRTL(locale: string): boolean;
42
45
  export declare function layoutDirection(locale: string): "rtl" | "ltr";
46
+ /**
47
+ * `true` when the app ships copy in `tag`: its source locale (`default`, or `"en"` —
48
+ * the platform's source language — when no supported default is declared) or one of
49
+ * its declared `translations`.
50
+ *
51
+ * This is what decides whether the device/browser language is followed. Production
52
+ * serve swaps no strings by `Accept-Language`: an app only has a translation for a
53
+ * locale it declares, so following any other device language changes the layout
54
+ * direction and nothing else.
55
+ */
56
+ export declare function shipsLocale(app: LocaleConfig | null | undefined, tag: string): boolean;
43
57
  /**
44
58
  * Resolve the app locale.
45
59
  *
46
60
  * 1. Launch override (`-himalaya.locale` / intent extra) if supported.
47
61
  * 2. Explicit user choice (`locale.set`) when `source === "user"`.
48
62
  * 3. If `pin && default` supported → app default (skip device).
49
- * 4. Device/browser tag if supported.
63
+ * 4. Device/browser tag if the app ships it (`shipsLocale`). An app with no
64
+ * `locale` block ships English only, so a Hebrew device does not make it RTL.
50
65
  * 5. `app.default` if supported.
51
66
  * 6. `"en"`.
52
67
  *
@@ -1210,7 +1210,7 @@ export interface AlertDialogProps {
1210
1210
  }
1211
1211
  export type TextMark = "bold" | "italic" | "underline" | "code" | "link";
1212
1212
  export interface TextRun {
1213
- /** Per-run color works on web/RN; iOS/macOS and Android ignore it until #3766. */
1213
+ /** Per-run foreground color overrides the link default on every renderer. */
1214
1214
  color?: TokenName;
1215
1215
  text: string;
1216
1216
  style?: TokenName;
@@ -1218,7 +1218,7 @@ export interface TextRun {
1218
1218
  linkAction?: Action;
1219
1219
  }
1220
1220
  export interface RichTextProps {
1221
- /** Styled runs work everywhere. Run colors work on web/RN; native adoption awaits #3766. */
1221
+ /** Styled runs and explicit run colors work on every renderer. */
1222
1222
  runs: TextRun[];
1223
1223
  }
1224
1224
  export interface ListItemProps {
@@ -7007,6 +7007,13 @@ function isRTL(locale) {
7007
7007
  function layoutDirection(locale) {
7008
7008
  return isRTL(locale) ? "rtl" : "ltr";
7009
7009
  }
7010
+ function shipsLocale(app, tag) {
7011
+ const t = coerceSupportedLocale(tag);
7012
+ if (!t) return false;
7013
+ if (t === (coerceSupportedLocale(app?.default) ?? "en")) return true;
7014
+ const list = app?.translations;
7015
+ return Array.isArray(list) && list.every((x) => typeof x === "string") && list.some((x) => coerceSupportedLocale(x) === t);
7016
+ }
7010
7017
  function resolveAppLocale(opts) {
7011
7018
  const launch = coerceSupportedLocale(opts.launch);
7012
7019
  if (launch) return launch;
@@ -7019,7 +7026,7 @@ function resolveAppLocale(opts) {
7019
7026
  }
7020
7027
  const appDefault = coerceSupportedLocale(opts.app?.default);
7021
7028
  if (opts.app?.pin && appDefault) return appDefault;
7022
- if (device) return device;
7029
+ if (device && shipsLocale(opts.app, device)) return device;
7023
7030
  if (appDefault) return appDefault;
7024
7031
  return "en";
7025
7032
  }
@@ -13589,6 +13596,7 @@ export {
13589
13596
  resolveTabBarPresentation,
13590
13597
  screenDescriptorSchema,
13591
13598
  selectIdiomOverlay,
13599
+ shipsLocale,
13592
13600
  shouldRevealError,
13593
13601
  siteAllowedOrigins,
13594
13602
  siteHost,
@@ -8492,7 +8492,7 @@ function zstack(props) {
8492
8492
  function text(text2, style, opts) {
8493
8493
  return {
8494
8494
  id: opts?.id ?? auto("text"),
8495
- body: { package: "himalaya", type: "Text", props: { text: text2, style, color: opts?.color, maxLines: opts?.maxLines, collapseWhenEmpty: opts?.collapseWhenEmpty, animateValue: opts?.animateValue, animateReveal: opts?.animateReveal, markdown: opts?.markdown, textDirection: opts?.textDirection } }
8495
+ body: { package: "himalaya", type: "Text", props: { text: text2, style, color: opts?.color, maxLines: opts?.maxLines, collapseWhenEmpty: opts?.collapseWhenEmpty, animateValue: opts?.animateValue, animateReveal: opts?.animateReveal, markdown: opts?.markdown, textDirection: opts?.textDirection, minimumScaleFactor: opts?.minimumScaleFactor, monospacedDigits: opts?.monospacedDigits, truncation: opts?.truncation } }
8496
8496
  };
8497
8497
  }
8498
8498
  function card2(children, opts) {
@@ -8546,7 +8546,7 @@ function icon(name, opts) {
8546
8546
  body: {
8547
8547
  package: "himalaya",
8548
8548
  type: "Icon",
8549
- props: { name, size: opts?.size, tint: opts?.tint, ...opts?.contentDescription !== void 0 ? { contentDescription: opts.contentDescription } : {} }
8549
+ props: { name, size: opts?.size, tint: opts?.tint, renderingMode: opts?.renderingMode, weight: opts?.weight, variableValue: opts?.variableValue, effect: opts?.effect, ...opts?.contentDescription !== void 0 ? { contentDescription: opts.contentDescription } : {} }
8550
8550
  }
8551
8551
  };
8552
8552
  return opts?.decorative ? { ...node, modifiers: { accessibilityRole: "decorative" } } : node;