@wix/himalaya-cli 0.1573.0 → 0.1574.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.
Files changed (42) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/message-format.d.ts +59 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +3 -3
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/l10n.mjs +8 -3
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +3 -3
  5. package/dist/cli.mjs +2618 -1172
  6. package/dist/preview-assets.generated.bin +0 -0
  7. package/guides/himi-json-output.md +41 -2
  8. package/guides/himi-mcp.md +1 -1
  9. package/guides/himi-test.md +3 -2
  10. package/guides/iap-products.md +1 -1
  11. package/guides/importing-oneapp-translations.md +115 -0
  12. package/guides/index.json +6 -0
  13. package/guides/one-app-section-mappings.md +16 -4
  14. package/guides/one-app-to-himi-app.md +167 -10
  15. package/guides/qa-builds.md +21 -1
  16. package/guides/templates.md +3 -2
  17. package/guides/testing-himi-apps.md +1 -1
  18. package/package.json +3 -3
  19. package/templates/beauty-salon/dev/index.ts +22 -6
  20. package/templates/beauty-salon-owner/dev/index.ts +22 -6
  21. package/templates/branded-lite/dev/index.ts +22 -6
  22. package/templates/community-club/dev/index.ts +22 -6
  23. package/templates/community-club-owner/dev/index.ts +22 -6
  24. package/templates/events-meetups/dev/index.ts +22 -6
  25. package/templates/events-meetups-owner/dev/index.ts +22 -6
  26. package/templates/gym-fitness/dev/index.ts +22 -6
  27. package/templates/gym-fitness-owner/dev/index.ts +22 -6
  28. package/templates/himi-chat/dev/index.ts +22 -6
  29. package/templates/nonprofit-cause/dev/index.ts +22 -6
  30. package/templates/nonprofit-cause-owner/dev/index.ts +22 -6
  31. package/templates/owner-lite/dev/index.ts +22 -6
  32. package/templates/podcast-creator/dev/index.ts +22 -6
  33. package/templates/podcast-creator-owner/dev/index.ts +22 -6
  34. package/templates/portfolio-creative/dev/index.ts +22 -6
  35. package/templates/portfolio-creative-owner/dev/index.ts +22 -6
  36. package/templates/restaurant/dev/index.ts +22 -6
  37. package/templates/restaurant-owner/dev/index.ts +22 -6
  38. package/templates/retail-store/dev/index.ts +22 -6
  39. package/templates/retail-store-owner/dev/index.ts +22 -6
  40. package/templates/surface-showcase/dev/index.ts +22 -6
  41. package/templates/yoga-studio/dev/index.ts +22 -6
  42. package/templates/yoga-studio-owner/dev/index.ts +22 -6
@@ -18,6 +18,36 @@ export declare function pluralCategory(n: number, locale: string): PluralCategor
18
18
  * table arbitrarily wrong — which is how the obsolete Hebrew `many` rule nearly shipped.
19
19
  */
20
20
  export declare function pluralCategoryFallback(n: number, locale: string): PluralCategory;
21
+ /** Split the body of `{...}` on top-level commas into at most 3 parts.
22
+ *
23
+ * Exported for tools/l10n/import-oneapp.ts, which converts foreign catalogs with the SAME
24
+ * tokenizer `formatMessage` renders with — a second brace scanner would be free to disagree
25
+ * about what is an argument, and the disagreement would surface as a corrupted translation.
26
+ *
27
+ * @internal Tokenizer plumbing for the importer, not SDK surface — do not depend on it
28
+ * from app or worker code. */
29
+ export declare function splitArg(body: string): string[];
30
+ /** One parsed branch: its selector, its body, and where the body sits in the spec. */
31
+ export interface BranchEntry {
32
+ key: string;
33
+ body: string;
34
+ /** Offset of the body's first character in the spec (just past the opening brace). */
35
+ bodyStart: number;
36
+ /** Offset one past the body's last character (the closing brace's position). */
37
+ bodyEnd: number;
38
+ }
39
+ /** Parse `one {…} other {…}` into its branches IN SOURCE ORDER, preserving nested braces,
40
+ * with each body's offsets so a caller can rewrite a body in place.
41
+ *
42
+ * A `Record` cannot carry the order: `Object.entries` lists integer-like keys first, so a
43
+ * rebuild from one reorders `other {a} 1 {b}` — which changes the string, and with it any
44
+ * id derived from the string.
45
+ * @internal Tokenizer plumbing for the importer, not SDK surface. */
46
+ export declare function parseBranchEntries(spec: string): BranchEntry[];
47
+ /** Parse `one {…} other {…}` into its branches, preserving nested braces.
48
+ * Exported for the same reason as `splitArg`.
49
+ * @internal Tokenizer plumbing for the importer, not SDK surface. */
50
+ export declare function parseBranches(spec: string): Record<string, string>;
21
51
  /**
22
52
  * Format an ICU pattern.
23
53
  *
@@ -26,3 +56,32 @@ export declare function pluralCategoryFallback(n: number, locale: string): Plura
26
56
  * that makes a `$t:` miss fall back to its key.
27
57
  */
28
58
  export declare function formatMessage(pattern: string, args?: Record<string, unknown>, locale?: string): string;
59
+ /** Whether `formatMessage` can ever select a branch with this selector for a `plural` or
60
+ * `select` argument. Shared with the importer so "reported" and "kept verbatim" agree.
61
+ * @internal Importer plumbing, not SDK surface. */
62
+ export declare function isBranchSelector(kind: "plural" | "select", key: string): boolean;
63
+ /**
64
+ * Every construct in `pattern` that is OUTSIDE the subset `formatMessage` implements —
65
+ * i.e. everything that would hit one of its degradation branches (verbatim text, raw
66
+ * value, empty branch set) instead of being formatted.
67
+ *
68
+ * This exists for importers (RFC 0054, `himi l10n import`): a catalog converted from a
69
+ * richer MessageFormat dialect must KEEP such a message verbatim — degrading to visible
70
+ * text is this module's contract — but the import report has to NAME it, because "renders
71
+ * its raw ICU source to users" is a decision a human should get to veto. Scanning with the
72
+ * same tokenizer `formatMessage` uses (same quoting rules, same balanced-brace scan, same
73
+ * `splitArg`/`parseBranches`) is what keeps "unsupported" synonymous with "formatMessage
74
+ * would not format this", instead of a second opinion that drifts.
75
+ *
76
+ * Returns human-readable descriptions, one per finding, in source order. Empty = the whole
77
+ * pattern is inside the subset (simple arguments, `plural` with `=N`/`#`, `select`, and
78
+ * `select`/plural nesting that `formatMessage` renders correctly). Two shapes that look
79
+ * nested-and-fine are NOT: `formatMessage` replaces every `#` in a chosen plural branch
80
+ * with that plural's number BEFORE it handles quoting or recurses, so a plural nested in a
81
+ * plural has its own `#` clobbered by the outer one, and a quoted `'#'` renders as the
82
+ * number in quotes. Both are reported.
83
+ *
84
+ * @internal Importer plumbing, not SDK surface — a worker has no reason to ask this;
85
+ * `formatMessage` already degrades gracefully at runtime.
86
+ */
87
+ export declare function unsupportedConstructs(pattern: string): string[];
@@ -10035,9 +10035,9 @@ var PREVIEW_SURFACES = [
10035
10035
  },
10036
10036
  {
10037
10037
  // NOTE: 834 is iPad portrait — six points UNDER the 840 `expanded`
10038
- // breakpoint, so an iPad in portrait resolves to `medium` and gets bottom
10039
- // tabs, becoming a sidebar only in landscape (1112). That is the shipped
10040
- // behaviour of the ladder, not a quirk of this registry.
10038
+ // breakpoint, so an iPad in portrait resolves to `medium`: full-bleed content
10039
+ // and, for responsive navigation, a sidebar (native wide starts at 600).
10040
+ // Landscape (1112) is expanded and applies the readable content measure.
10041
10041
  id: "tablet",
10042
10042
  label: "Tablet",
10043
10043
  chassis: "tablet",
@@ -40,8 +40,8 @@ function splitArg(body) {
40
40
  out.push(body.slice(start));
41
41
  return out;
42
42
  }
43
- function parseBranches(spec) {
44
- const branches = {};
43
+ function parseBranchEntries(spec) {
44
+ const entries = [];
45
45
  let i = 0;
46
46
  while (i < spec.length) {
47
47
  while (i < spec.length && /\s/.test(spec[i])) i++;
@@ -59,9 +59,14 @@ function parseBranches(spec) {
59
59
  depth--;
60
60
  }
61
61
  }
62
- branches[key] = spec.slice(bodyStart, i);
62
+ entries.push({ key, body: spec.slice(bodyStart, i), bodyStart, bodyEnd: i });
63
63
  i++;
64
64
  }
65
+ return entries;
66
+ }
67
+ function parseBranches(spec) {
68
+ const branches = {};
69
+ for (const { key, body } of parseBranchEntries(spec)) branches[key] = body;
65
70
  return branches;
66
71
  }
67
72
  function formatMessage(pattern, args = {}, locale2 = "en") {
@@ -7970,9 +7970,9 @@ var PREVIEW_SURFACES = [
7970
7970
  },
7971
7971
  {
7972
7972
  // NOTE: 834 is iPad portrait — six points UNDER the 840 `expanded`
7973
- // breakpoint, so an iPad in portrait resolves to `medium` and gets bottom
7974
- // tabs, becoming a sidebar only in landscape (1112). That is the shipped
7975
- // behaviour of the ladder, not a quirk of this registry.
7973
+ // breakpoint, so an iPad in portrait resolves to `medium`: full-bleed content
7974
+ // and, for responsive navigation, a sidebar (native wide starts at 600).
7975
+ // Landscape (1112) is expanded and applies the readable content measure.
7976
7976
  id: "tablet",
7977
7977
  label: "Tablet",
7978
7978
  chassis: "tablet",