@wix/himalaya-cli 0.1060.0 → 0.1062.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +11 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/wix-platform/src/index.d.ts +3 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-platform.mjs +3 -8
- package/dist/cli.mjs +13 -6
- package/guides/sdk-reference.json +1 -1
- package/guides/wix-platform-usage.md +14 -9
- package/package.json +2 -2
|
@@ -90,18 +90,25 @@ export interface NavigationConfig {
|
|
|
90
90
|
* offline dev seam to a REAL Wix backend call — routed through `wixApi`
|
|
91
91
|
* (WixApiCapability), so it is auto-covered by the dev-mode Wix gateway /
|
|
92
92
|
* admin inspector. Members absent / false keep the seam, so unregistered members
|
|
93
|
-
* and non-Wix apps are unaffected. `bi
|
|
94
|
-
*
|
|
95
|
-
* Best-effort: Frog
|
|
96
|
-
*
|
|
93
|
+
* and non-Wix apps are unaffected. `bi` carries the registration-specific
|
|
94
|
+
* params (Frog src/endpoint+variant).
|
|
95
|
+
* Best-effort: Frog may 4xx until a Wix App is registered — the gateway records
|
|
96
|
+
* those real errors, which is itself useful production data. */
|
|
97
97
|
export interface WixPlatformConfig {
|
|
98
98
|
/** Which cross-cutting members make REAL Wix calls (vs the offline seam). */
|
|
99
99
|
real?: {
|
|
100
100
|
bi?: boolean;
|
|
101
|
+
/** No effect: experiments and flags come from the app's served flags
|
|
102
|
+
* (`/v1/flags/<app>/assignments`), never Wix Petri. Kept so existing configs type-check. */
|
|
101
103
|
experiments?: boolean;
|
|
104
|
+
/** No effect — see `experiments`. */
|
|
102
105
|
flags?: boolean;
|
|
106
|
+
/** No effect: the translations-server lookup, Ping registration and the Jot deferred link
|
|
107
|
+
* have no route on any Wix host a himi app reaches, so they always use the seam. */
|
|
103
108
|
i18n?: boolean;
|
|
109
|
+
/** No effect — see `i18n`. */
|
|
104
110
|
ping?: boolean;
|
|
111
|
+
/** No effect — see `i18n`. */
|
|
105
112
|
deeplink?: boolean;
|
|
106
113
|
session?: boolean;
|
|
107
114
|
auth?: boolean;
|
|
@@ -41,7 +41,9 @@ export declare const flags: {
|
|
|
41
41
|
};
|
|
42
42
|
export declare const i18n: {
|
|
43
43
|
/** Resolve a translation key for the current locale; `fallback` (or the key)
|
|
44
|
-
* when unknown.
|
|
44
|
+
* when unknown. Always the native seam: `/_api/translations-server/v1/translation/<key>`
|
|
45
|
+
* has no route on any Wix host a himi app reaches (the same 404 as a made-up path, with or
|
|
46
|
+
* without a token), so `real.i18n` no longer sends it anywhere — it only ever 404ed. */
|
|
45
47
|
t(key: string, fallback?: string): Promise<string>;
|
|
46
48
|
/** Current resolved UI locale (2-letter). */
|
|
47
49
|
locale(): Promise<string>;
|
|
@@ -125,15 +125,10 @@ var flags = {
|
|
|
125
125
|
};
|
|
126
126
|
var i18n = {
|
|
127
127
|
/** Resolve a translation key for the current locale; `fallback` (or the key)
|
|
128
|
-
* when unknown.
|
|
128
|
+
* when unknown. Always the native seam: `/_api/translations-server/v1/translation/<key>`
|
|
129
|
+
* has no route on any Wix host a himi app reaches (the same 404 as a made-up path, with or
|
|
130
|
+
* without a token), so `real.i18n` no longer sends it anywhere — it only ever 404ed. */
|
|
129
131
|
async t(key, fallback) {
|
|
130
|
-
if (isMemberReal("i18n")) {
|
|
131
|
-
try {
|
|
132
|
-
const r2 = await realWix("GET", `/_api/translations-server/v1/translation/${encodeURIComponent(key)}`);
|
|
133
|
-
if (typeof r2?.translation === "string") return r2.translation;
|
|
134
|
-
} catch {
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
132
|
const r = await call("i18nTranslate", { key, fallback: fallback ?? key });
|
|
138
133
|
return r?.value ?? fallback ?? key;
|
|
139
134
|
},
|
package/dist/cli.mjs
CHANGED
|
@@ -6684,6 +6684,7 @@ function resolveTranslation(value, catalog, sourceCatalog) {
|
|
|
6684
6684
|
var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
|
|
6685
6685
|
var init_bindings = __esm({
|
|
6686
6686
|
"../../core/ts/src/bindings.ts"() {
|
|
6687
|
+
"use strict";
|
|
6687
6688
|
BINDING_SIGILS = ["service", "flag", "item", "t"];
|
|
6688
6689
|
BINDING_SIGIL_RE = new RegExp(
|
|
6689
6690
|
`^\\$(?:${BINDING_SIGILS.filter((s) => s !== "t").join("|")})\\b|^\\$t:`
|
|
@@ -42361,7 +42362,7 @@ h1{font-size:20px;font-weight:600;margin:0}.sub{color:var(--muted);font-size:13p
|
|
|
42361
42362
|
.step .lbl{font-size:11px;color:var(--faint);margin-top:4px;text-transform:capitalize}.step.cur .lbl{color:var(--ink);font-weight:600}
|
|
42362
42363
|
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px 16px;box-shadow:var(--shadow)}
|
|
42363
42364
|
.now{display:flex;gap:12px;align-items:flex-start;margin-bottom:16px}.now .msg{font-size:16px}.now .meta{color:var(--muted);font-size:12px}
|
|
42364
|
-
.grid{display:grid;grid-template-columns:320px 1fr;gap:16px;align-items:start}@media (max-width:860px){.grid{grid-template-columns:1fr}.steps .lbl{display:none}}
|
|
42365
|
+
.grid{display:grid;grid-template-columns:320px minmax(0,1fr);gap:16px;align-items:start}@media (max-width:860px){.grid{grid-template-columns:minmax(0,1fr)}.steps .lbl{display:none}}
|
|
42365
42366
|
h2{font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:0 0 10px}
|
|
42366
42367
|
.phone{width:100%;max-width:300px;aspect-ratio:390/844;border-radius:34px;border:9px solid #111;background:#fff;overflow:hidden;margin:0 auto;display:block}
|
|
42367
42368
|
.phone img,.phone iframe{width:100%;height:100%;object-fit:cover;object-position:top;border:0;display:block;cursor:zoom-in}
|
|
@@ -42466,7 +42467,9 @@ function el(tag,cls,txt){var e=document.createElement(tag);if(cls)e.className=cl
|
|
|
42466
42467
|
screens nothing leads to sit in their own last row, a link to a screen that does not exist is a red
|
|
42467
42468
|
stub naming it. Built with DOM calls: a screen id is SVG text, never markup. Past 60 screens only
|
|
42468
42469
|
the ones worth looking at are drawn (unreached, failed) and the summary carries the rest. */
|
|
42469
|
-
|
|
42470
|
+
/* The last map drawn and the width it was wrapped to: an unchanged state never redraws, so a resize has to. */
|
|
42471
|
+
var lastMap=null,mapAvail=0;
|
|
42472
|
+
function drawMap(m){var card=$("appmap"),box=$("mapbox");lastMap=m;clear(box);if(!m){card.hidden=true;return}card.hidden=false;
|
|
42470
42473
|
var un=m.screens.filter(function(x){return !x.reached});
|
|
42471
42474
|
/* "Nothing leads here" only when the crawl saw every link: a link built from list data (a feed's rows,
|
|
42472
42475
|
a home grid) has a target it cannot resolve, and one of those may well open the screen. */
|
|
@@ -42483,17 +42486,20 @@ function drawMap(m){var card=$("appmap"),box=$("mapbox");clear(box);if(!m){card.
|
|
|
42483
42486
|
goes and both ends stay; the full id is always in the node's title. */
|
|
42484
42487
|
var CW=6.5,longest=0;show.forEach(function(x){longest=Math.max(longest,x.id.length)});
|
|
42485
42488
|
var W=Math.round(Math.min(300,Math.max(124,longest*CW+20))),H=28,HG=12,VG=36,P=10,ns="http://www.w3.org/2000/svg",pos={},y=P,width=0,unRow=maxd+2;
|
|
42489
|
+
/* A row wraps to the card: one line of 21 not-reached screens once made the card, and the whole
|
|
42490
|
+
board, 5,500px wide. The width is the box's own (a hidden card measures 0; then a card's width). */
|
|
42491
|
+
var avail=box.clientWidth||760;mapAvail=avail;var per=Math.max(1,Math.floor((avail-2*P+HG)/(W+HG))),LG=10;
|
|
42486
42492
|
function lab(id){var k=Math.floor((W-20)/CW);if(id.length<=k)return id;var a=Math.ceil((k-1)/2),b=Math.floor((k-1)/2);return id.slice(0,a)+"\u2026"+id.slice(id.length-b)}
|
|
42487
42493
|
var svg=document.createElementNS(ns,"svg"),edgesG=document.createElementNS(ns,"g"),nodesG=document.createElementNS(ns,"g");svg.appendChild(edgesG);svg.appendChild(nodesG);
|
|
42488
42494
|
function sv(tag,attrs,txt){var e=document.createElementNS(ns,tag);for(var k in attrs)e.setAttribute(k,String(attrs[k]));if(txt!=null)e.textContent=txt;return e}
|
|
42489
42495
|
for(var r=0;r<rows.length;r++){var row=rows[r];if(!row)continue;
|
|
42490
42496
|
if(r===unRow){nodesG.appendChild(sv("text",{x:P,y:y+10,"class":"mrow"},!m.done?"Not reached yet \u2014 no link to these seen so far":m.unfollowed?"Not seen linked \u2014 "+m.unfollowed+" link"+(m.unfollowed===1?"":"s")+" built from list data could not be followed":"Unreached \u2014 nothing leads here"));y+=16}
|
|
42491
|
-
row.forEach(function(x,i){var nx=P+i*(W+HG);pos[x.id]={x:nx,y:
|
|
42497
|
+
row.forEach(function(x,i){var nx=P+(i%per)*(W+HG),ny=y+Math.floor(i/per)*(H+LG);pos[x.id]={x:nx,y:ny};width=Math.max(width,nx+W+P);
|
|
42492
42498
|
var g=sv("g",{"class":"mnode "+x.status+(x.entry?" entry":"")+(x.reached?"":" unreached")+(x.unfollowed?" unfollowed":""),"data-id":x.id});
|
|
42493
|
-
g.appendChild(sv("rect",{x:nx,y:
|
|
42499
|
+
g.appendChild(sv("rect",{x:nx,y:ny,width:W,height:H,rx:7}));g.appendChild(sv("text",{x:nx+W/2,y:ny+H/2+4,"text-anchor":"middle"},lab(x.id)));
|
|
42494
42500
|
g.appendChild(sv("title",{},x.id+" \xB7 "+x.status+(x.entry?" \xB7 entry":"")+(x.reached?"":" \xB7 unreached")+(x.unfollowed?" \xB7 "+x.unfollowed+" links the crawl could not follow":"")));
|
|
42495
|
-
if(x.unfollowed)g.appendChild(sv("text",{x:nx+W-6,y:
|
|
42496
|
-
y+=H+VG}
|
|
42501
|
+
if(x.unfollowed)g.appendChild(sv("text",{x:nx+W-6,y:ny+10,"text-anchor":"end","class":"mfollow"},"+"+x.unfollowed+"?"));nodesG.appendChild(g)});
|
|
42502
|
+
y+=Math.ceil(row.length/per)*(H+LG)-LG+VG}
|
|
42497
42503
|
m.edges.forEach(function(e){var a=pos[e.from],b=pos[e.to];if(!a||!b)return;var x1=a.x+W/2,y1=a.y+H,x2=b.x+W/2,y2=b.y,my=(y1+y2)/2;
|
|
42498
42504
|
edgesG.appendChild(sv("path",{"class":"medge",d:"M"+x1+" "+y1+" C"+x1+" "+my+" "+x2+" "+my+" "+x2+" "+y2}))});
|
|
42499
42505
|
var by=y;m.broken.forEach(function(e,i){var a=pos[e.from];if(!a)return;var bx=a.x+W+4,yy=a.y+H/2+4+i%2*10;
|
|
@@ -42673,6 +42679,7 @@ function accentNow(){return (getComputedStyle(document.documentElement).getPrope
|
|
|
42673
42679
|
sideways and scrolled horizontally. */
|
|
42674
42680
|
function fit(){var ph=$("focus").querySelector(".phone.vpf");if(!ph)return;var w=ph.clientWidth,h=ph.clientHeight;if(w&&h)ph.style.setProperty("--k",String(Math.min(w/390,h/844)))}
|
|
42675
42681
|
window.addEventListener("resize",fit);
|
|
42682
|
+
window.addEventListener("resize",function(){var b=$("mapbox");if(lastMap&&b&&b.clientWidth&&b.clientWidth!==mapAvail)drawMap(lastMap)});
|
|
42676
42683
|
function favicon(n,bad){try{var c=document.createElement("canvas");c.width=c.height=32;var x=c.getContext&&c.getContext("2d");if(!x)return;x.lineWidth=5;x.strokeStyle="rgba(128,128,128,.35)";x.beginPath();x.arc(16,16,12,0,6.2832);x.stroke();x.strokeStyle=accentNow();x.beginPath();x.arc(16,16,12,-1.5708,-1.5708+6.2832*n/8);x.stroke();if(bad){x.fillStyle="#d33";x.beginPath();x.arc(25,7,6,0,6.2832);x.fill()}$("fav").href=c.toDataURL("image/png")}catch(e){}}
|
|
42677
42684
|
function burst(){var c=$("fx");c.setAttribute("data-bursts",String((+c.getAttribute("data-bursts")||0)+1));if(reduced())return;var x=c.getContext&&c.getContext("2d");if(!x)return;var W=c.width=innerWidth,H=c.height=innerHeight,cols=["#1f7a4d","#3b6fd8","#e0a030","#d4537e",accentNow()],P=[];for(var i=0;i<120;i++)P.push({x:W/2,y:H*.35,vx:(Math.random()-.5)*14,vy:-Math.random()*12-4,c:cols[i%cols.length],r:Math.random()*6.28});var t0=now();(function f(){x.clearRect(0,0,W,H);P.forEach(function(p){p.x+=p.vx;p.y+=p.vy;p.vy+=.35;p.r+=.2;x.save();x.translate(p.x,p.y);x.rotate(p.r);x.fillStyle=p.c;x.fillRect(-4,-2,8,4);x.restore()});if(now()-t0<2200)raf(f);else x.clearRect(0,0,W,H)})()}
|
|
42678
42685
|
function countTo(e,a,b){if(!e)return;if(reduced()){e.textContent=String(b);return}var t0=now();(function f(){var k=Math.min(1,(now()-t0)/900);e.textContent=String(Math.round(a+(b-a)*k));if(k<1)raf(f)})()}
|
|
@@ -3475,7 +3475,7 @@
|
|
|
3475
3475
|
"name": "i18n",
|
|
3476
3476
|
"kind": "const",
|
|
3477
3477
|
"jsdoc": "",
|
|
3478
|
-
"decl": "export const i18n = {\n /** Resolve a translation key for the current locale; `fallback` (or the key)\n * when unknown.
|
|
3478
|
+
"decl": "export const i18n = {\n /** Resolve a translation key for the current locale; `fallback` (or the key)\n * when unknown. Always the native seam: `/_api/translations-server/v1/translation/<key>`\n * has no route on any Wix host a himi app reaches (the same 404 as a made-up path, with or\n * without a token), so `real.i18n` no longer sends it anywhere — it only ever 404ed. */\n async t(key: string, fallback?: string): Promise<string> {\n const r = await call<{ value?: string }>(\"i18nTranslate\", { key, fallback: fallback ?? key });\n return r?.value ?? fallback ?? key;\n },\n /** Current resolved UI locale (2-letter). */\n async locale(): Promise<string> {\n const r = await call<{ locale?: string }>(\"i18nLocale\");\n return r?.locale ?? \"en\";\n },\n};"
|
|
3479
3479
|
},
|
|
3480
3480
|
{
|
|
3481
3481
|
"name": "PingRegistration",
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
**platform-agnostic** — the same JS runs on iOS, Android, macOS and web, with **one documented
|
|
5
5
|
exception**: on web, `auth.signIn()` rejects rather than resolving (see
|
|
6
6
|
[Real vs dev seam](#real-vs-dev-seam-and-best-effort) below). Each
|
|
7
|
-
member dispatches to the native `wix_platform` capability (with an on-device dev seam)
|
|
8
|
-
and
|
|
9
|
-
([opt-in guide](wix-platform-opt-in.md))
|
|
7
|
+
member dispatches to the native `wix_platform` capability (with an on-device dev seam);
|
|
8
|
+
`bi`, `monitoring`, `session` and `auth` take their real backend when the app enables them
|
|
9
|
+
([opt-in guide](wix-platform-opt-in.md)), while `experiments` / `flags` always read the app's
|
|
10
|
+
served flags and `i18n`, `ping` and `deeplink` always answer from the seam. This is the authoritative reference for
|
|
10
11
|
*calling* the members; source of truth is `core/sdk/wix-platform/src/index.ts` +
|
|
11
12
|
[RFC 0042](../core/schema/RFC/0042-wix-platform-sdk.md).
|
|
12
13
|
|
|
@@ -63,12 +64,16 @@ await monitoring.captureError("thing failed", { code: "E1" });
|
|
|
63
64
|
|
|
64
65
|
- With no `wixPlatform.real.<member>`, a member returns the **dev seam** (deterministic
|
|
65
66
|
on-device value; no network). `isMemberReal(member)` reflects the flag.
|
|
66
|
-
- With `real.<member> = true`, REST-shaped
|
|
67
|
-
|
|
68
|
-
falls back to the seam value
|
|
69
|
-
(`
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
- With `real.<member> = true`, the one REST-shaped member that still has a reachable Wix
|
|
68
|
+
route takes it: `auth.signedInstance` mints through the real `wixApi` chokepoint. That is
|
|
69
|
+
**best-effort**: a failure falls back to the seam value, so feature-gating stays correct
|
|
70
|
+
either way. Every method returns a resolved value (or `null`) — never throws on a Wix
|
|
71
|
+
error — so a worker never crashes on the SDK.
|
|
72
|
+
- `real` does nothing for the rest. `experiments` / `flags` always answer from the app's
|
|
73
|
+
served flags (`GET /v1/flags/<app>/assignments`, set with `himi flags`), never Wix Petri;
|
|
74
|
+
`i18n`, `ping` and `deeplink` have no Wix route a himi app can reach (a 404 with or without
|
|
75
|
+
a token), so they always answer from the seam and `real.i18n` / `real.ping` /
|
|
76
|
+
`real.deeplink` are ignored.
|
|
72
77
|
- `bi`, `monitoring`, and `auth` route through their native backends (Frog sink, Sentry
|
|
73
78
|
sink, `WixNativeAuthProvider`) rather than raw `wixApi`, but the calling contract is
|
|
74
79
|
identical — **except `auth.signIn()` on web**, below.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1062.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"artifactId": "himalaya-cli"
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
"falconPackageHash": "
|
|
68
|
+
"falconPackageHash": "4d146293883eafab0850062d46a7da667bdbb7ab5849fe455b318cca"
|
|
69
69
|
}
|