@wix/himalaya-cli 0.823.0 → 0.825.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/cli.mjs +146 -84
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -24116,6 +24116,85 @@ var init_FakeServiceProvider = __esm({
|
|
|
24116
24116
|
}
|
|
24117
24117
|
});
|
|
24118
24118
|
|
|
24119
|
+
// ../../core/web-renderer/src/env.ts
|
|
24120
|
+
function isEnvExpr(raw) {
|
|
24121
|
+
return typeof raw === "string" && raw.startsWith(ENV_SENTINEL);
|
|
24122
|
+
}
|
|
24123
|
+
function sizeClassFromWidth(width) {
|
|
24124
|
+
if (width >= 840) return "expanded";
|
|
24125
|
+
if (width >= 600) return "medium";
|
|
24126
|
+
return "compact";
|
|
24127
|
+
}
|
|
24128
|
+
function browserSizeClass() {
|
|
24129
|
+
if (typeof window !== "undefined" && typeof window.innerWidth === "number") {
|
|
24130
|
+
return sizeClassFromWidth(window.innerWidth);
|
|
24131
|
+
}
|
|
24132
|
+
return "compact";
|
|
24133
|
+
}
|
|
24134
|
+
function browserIsRTL() {
|
|
24135
|
+
if (typeof document !== "undefined" && document.documentElement) {
|
|
24136
|
+
const d = (document.documentElement.getAttribute("dir") || "").toLowerCase();
|
|
24137
|
+
if (d === "rtl") return true;
|
|
24138
|
+
if (d === "ltr") return false;
|
|
24139
|
+
if (typeof getComputedStyle === "function") {
|
|
24140
|
+
return getComputedStyle(document.documentElement).direction === "rtl";
|
|
24141
|
+
}
|
|
24142
|
+
}
|
|
24143
|
+
return false;
|
|
24144
|
+
}
|
|
24145
|
+
function ctxEnv(ctx) {
|
|
24146
|
+
return {
|
|
24147
|
+
scheme: ctx.scheme,
|
|
24148
|
+
reduceMotion: ctx.reduceMotion(),
|
|
24149
|
+
sizeClass: ctx.sizeClass ?? browserSizeClass(),
|
|
24150
|
+
isRTL: ctx.isRTL ?? browserIsRTL()
|
|
24151
|
+
};
|
|
24152
|
+
}
|
|
24153
|
+
function envValue(key2, env) {
|
|
24154
|
+
switch (key2) {
|
|
24155
|
+
case "reduceMotion":
|
|
24156
|
+
return env.reduceMotion ? "true" : "false";
|
|
24157
|
+
case "colorScheme":
|
|
24158
|
+
return env.scheme;
|
|
24159
|
+
case "sizeClass":
|
|
24160
|
+
return env.sizeClass;
|
|
24161
|
+
case "isRTL":
|
|
24162
|
+
return env.isRTL ? "true" : "false";
|
|
24163
|
+
default:
|
|
24164
|
+
return void 0;
|
|
24165
|
+
}
|
|
24166
|
+
}
|
|
24167
|
+
function parseEnvExpr(raw) {
|
|
24168
|
+
if (!isEnvExpr(raw)) return null;
|
|
24169
|
+
const rest = raw.slice(ENV_SENTINEL.length);
|
|
24170
|
+
for (const op of ["==", "!="]) {
|
|
24171
|
+
const i = rest.indexOf(op);
|
|
24172
|
+
if (i >= 0) return { key: rest.slice(0, i).trim(), op, operand: rest.slice(i + op.length).trim() };
|
|
24173
|
+
}
|
|
24174
|
+
return { key: rest.trim() };
|
|
24175
|
+
}
|
|
24176
|
+
function evalEnvExpr(raw, env) {
|
|
24177
|
+
const parsed = parseEnvExpr(raw);
|
|
24178
|
+
if (!parsed) return void 0;
|
|
24179
|
+
const value = envValue(parsed.key, env);
|
|
24180
|
+
if (value === void 0) return void 0;
|
|
24181
|
+
if (!parsed.op) return value;
|
|
24182
|
+
const equal = value.toLowerCase() === (parsed.operand ?? "").toLowerCase();
|
|
24183
|
+
return (parsed.op === "==" ? equal : !equal) ? "true" : "false";
|
|
24184
|
+
}
|
|
24185
|
+
function envHidden(raw, env) {
|
|
24186
|
+
const resolved = evalEnvExpr(raw, env);
|
|
24187
|
+
if (resolved === void 0) return void 0;
|
|
24188
|
+
const l = resolved.trim().toLowerCase();
|
|
24189
|
+
return l === "true" || l === "1";
|
|
24190
|
+
}
|
|
24191
|
+
var ENV_SENTINEL;
|
|
24192
|
+
var init_env = __esm({
|
|
24193
|
+
"../../core/web-renderer/src/env.ts"() {
|
|
24194
|
+
ENV_SENTINEL = "$env:";
|
|
24195
|
+
}
|
|
24196
|
+
});
|
|
24197
|
+
|
|
24119
24198
|
// ../../core/web-renderer/src/tokens.ts
|
|
24120
24199
|
function isSerifFamily(family) {
|
|
24121
24200
|
return !!family && SERIF_FAMILY_RE.test(family);
|
|
@@ -25112,6 +25191,7 @@ function shouldRevealError(args) {
|
|
|
25112
25191
|
var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
|
|
25113
25192
|
var init_validation = __esm({
|
|
25114
25193
|
"../../core/ts/src/validation.ts"() {
|
|
25194
|
+
"use strict";
|
|
25115
25195
|
EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
|
|
25116
25196
|
URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
|
|
25117
25197
|
INTEGER_RE = /^[+-]?[0-9]+$/;
|
|
@@ -25216,85 +25296,6 @@ var init_form_bag = __esm({
|
|
|
25216
25296
|
}
|
|
25217
25297
|
});
|
|
25218
25298
|
|
|
25219
|
-
// ../../core/web-renderer/src/env.ts
|
|
25220
|
-
function isEnvExpr(raw) {
|
|
25221
|
-
return typeof raw === "string" && raw.startsWith(ENV_SENTINEL);
|
|
25222
|
-
}
|
|
25223
|
-
function sizeClassFromWidth(width) {
|
|
25224
|
-
if (width >= 840) return "expanded";
|
|
25225
|
-
if (width >= 600) return "medium";
|
|
25226
|
-
return "compact";
|
|
25227
|
-
}
|
|
25228
|
-
function browserSizeClass() {
|
|
25229
|
-
if (typeof window !== "undefined" && typeof window.innerWidth === "number") {
|
|
25230
|
-
return sizeClassFromWidth(window.innerWidth);
|
|
25231
|
-
}
|
|
25232
|
-
return "compact";
|
|
25233
|
-
}
|
|
25234
|
-
function browserIsRTL() {
|
|
25235
|
-
if (typeof document !== "undefined" && document.documentElement) {
|
|
25236
|
-
const d = (document.documentElement.getAttribute("dir") || "").toLowerCase();
|
|
25237
|
-
if (d === "rtl") return true;
|
|
25238
|
-
if (d === "ltr") return false;
|
|
25239
|
-
if (typeof getComputedStyle === "function") {
|
|
25240
|
-
return getComputedStyle(document.documentElement).direction === "rtl";
|
|
25241
|
-
}
|
|
25242
|
-
}
|
|
25243
|
-
return false;
|
|
25244
|
-
}
|
|
25245
|
-
function ctxEnv(ctx) {
|
|
25246
|
-
return {
|
|
25247
|
-
scheme: ctx.scheme,
|
|
25248
|
-
reduceMotion: ctx.reduceMotion(),
|
|
25249
|
-
sizeClass: ctx.sizeClass ?? browserSizeClass(),
|
|
25250
|
-
isRTL: ctx.isRTL ?? browserIsRTL()
|
|
25251
|
-
};
|
|
25252
|
-
}
|
|
25253
|
-
function envValue(key2, env) {
|
|
25254
|
-
switch (key2) {
|
|
25255
|
-
case "reduceMotion":
|
|
25256
|
-
return env.reduceMotion ? "true" : "false";
|
|
25257
|
-
case "colorScheme":
|
|
25258
|
-
return env.scheme;
|
|
25259
|
-
case "sizeClass":
|
|
25260
|
-
return env.sizeClass;
|
|
25261
|
-
case "isRTL":
|
|
25262
|
-
return env.isRTL ? "true" : "false";
|
|
25263
|
-
default:
|
|
25264
|
-
return void 0;
|
|
25265
|
-
}
|
|
25266
|
-
}
|
|
25267
|
-
function parseEnvExpr(raw) {
|
|
25268
|
-
if (!isEnvExpr(raw)) return null;
|
|
25269
|
-
const rest = raw.slice(ENV_SENTINEL.length);
|
|
25270
|
-
for (const op of ["==", "!="]) {
|
|
25271
|
-
const i = rest.indexOf(op);
|
|
25272
|
-
if (i >= 0) return { key: rest.slice(0, i).trim(), op, operand: rest.slice(i + op.length).trim() };
|
|
25273
|
-
}
|
|
25274
|
-
return { key: rest.trim() };
|
|
25275
|
-
}
|
|
25276
|
-
function evalEnvExpr(raw, env) {
|
|
25277
|
-
const parsed = parseEnvExpr(raw);
|
|
25278
|
-
if (!parsed) return void 0;
|
|
25279
|
-
const value = envValue(parsed.key, env);
|
|
25280
|
-
if (value === void 0) return void 0;
|
|
25281
|
-
if (!parsed.op) return value;
|
|
25282
|
-
const equal = value.toLowerCase() === (parsed.operand ?? "").toLowerCase();
|
|
25283
|
-
return (parsed.op === "==" ? equal : !equal) ? "true" : "false";
|
|
25284
|
-
}
|
|
25285
|
-
function envHidden(raw, env) {
|
|
25286
|
-
const resolved = evalEnvExpr(raw, env);
|
|
25287
|
-
if (resolved === void 0) return void 0;
|
|
25288
|
-
const l = resolved.trim().toLowerCase();
|
|
25289
|
-
return l === "true" || l === "1";
|
|
25290
|
-
}
|
|
25291
|
-
var ENV_SENTINEL;
|
|
25292
|
-
var init_env = __esm({
|
|
25293
|
-
"../../core/web-renderer/src/env.ts"() {
|
|
25294
|
-
ENV_SENTINEL = "$env:";
|
|
25295
|
-
}
|
|
25296
|
-
});
|
|
25297
|
-
|
|
25298
25299
|
// ../../core/web-renderer/src/actionParams.ts
|
|
25299
25300
|
function readService(ref, provider) {
|
|
25300
25301
|
if (!provider) return void 0;
|
|
@@ -28578,6 +28579,7 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
|
|
|
28578
28579
|
var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
|
|
28579
28580
|
var init_worker_subtree = __esm({
|
|
28580
28581
|
"../../core/ts/src/worker-subtree.ts"() {
|
|
28582
|
+
"use strict";
|
|
28581
28583
|
init_worker_subtree_safe_types_generated();
|
|
28582
28584
|
WORKER_SUBTREE_CEILINGS = Object.freeze({
|
|
28583
28585
|
maxEncodedBytes: 65536,
|
|
@@ -33718,6 +33720,7 @@ var init_src3 = __esm({
|
|
|
33718
33720
|
var render_descriptor_exports = {};
|
|
33719
33721
|
__export(render_descriptor_exports, {
|
|
33720
33722
|
buildRenderTree: () => buildRenderTree,
|
|
33723
|
+
clientEnvFor: () => clientEnvFor,
|
|
33721
33724
|
collectNativeOnly: () => collectNativeOnly,
|
|
33722
33725
|
isMissingPlaywrightExecutable: () => isMissingPlaywrightExecutable,
|
|
33723
33726
|
pngAvailable: () => pngAvailable,
|
|
@@ -33726,6 +33729,36 @@ __export(render_descriptor_exports, {
|
|
|
33726
33729
|
stabilizePngPage: () => stabilizePngPage,
|
|
33727
33730
|
withRetry: () => withRetry2
|
|
33728
33731
|
});
|
|
33732
|
+
function hiddenBool2(v) {
|
|
33733
|
+
if (typeof v === "boolean") return v;
|
|
33734
|
+
if (typeof v === "number") return v !== 0;
|
|
33735
|
+
if (typeof v === "string") {
|
|
33736
|
+
const l = v.trim().toLowerCase();
|
|
33737
|
+
return l === "true" || l === "1";
|
|
33738
|
+
}
|
|
33739
|
+
return false;
|
|
33740
|
+
}
|
|
33741
|
+
function clientEnvFor(scheme, width, isRTL) {
|
|
33742
|
+
return {
|
|
33743
|
+
scheme,
|
|
33744
|
+
reduceMotion: false,
|
|
33745
|
+
sizeClass: width === void 0 ? "compact" : sizeClassFromWidth(width),
|
|
33746
|
+
isRTL: isRTL === true
|
|
33747
|
+
};
|
|
33748
|
+
}
|
|
33749
|
+
function nodeHidden(modifiers, provider, itemScope, env) {
|
|
33750
|
+
if (modifiers.hidden === true) return true;
|
|
33751
|
+
const hp = modifiers.hiddenPath ?? modifiers.hidden_path;
|
|
33752
|
+
if (typeof hp !== "string" || !hp) return false;
|
|
33753
|
+
const low = hp.trim().toLowerCase();
|
|
33754
|
+
if (low === "true" || low === "1") return true;
|
|
33755
|
+
if (low === "false" || low === "0") return false;
|
|
33756
|
+
if (isEnvExpr(hp)) return env ? envHidden(hp, env) === true : false;
|
|
33757
|
+
if (hp.startsWith("$item") || hp.startsWith("$service:")) {
|
|
33758
|
+
return hiddenBool2(resolveTreeScalar(hp, provider, itemScope));
|
|
33759
|
+
}
|
|
33760
|
+
return false;
|
|
33761
|
+
}
|
|
33729
33762
|
function resolveTreeScalar(v, provider, itemScope) {
|
|
33730
33763
|
if (typeof v !== "string") return v;
|
|
33731
33764
|
if (v.startsWith("$item")) {
|
|
@@ -33776,7 +33809,7 @@ function collectNativeOnly(node) {
|
|
|
33776
33809
|
walk2(node);
|
|
33777
33810
|
return [...found].sort();
|
|
33778
33811
|
}
|
|
33779
|
-
function buildRenderTree(node, path = "$", provider = null, itemScope = void 0, includeRawProps = false) {
|
|
33812
|
+
function buildRenderTree(node, path = "$", provider = null, itemScope = void 0, includeRawProps = false, env = null) {
|
|
33780
33813
|
if (!node || typeof node !== "object") return null;
|
|
33781
33814
|
const obj = node;
|
|
33782
33815
|
const body = obj.body ?? {};
|
|
@@ -33808,6 +33841,17 @@ function buildRenderTree(node, path = "$", provider = null, itemScope = void 0,
|
|
|
33808
33841
|
if (r !== void 0 && r !== null) values[key2] = typeof r === "object" ? JSON.stringify(r) : String(r);
|
|
33809
33842
|
}
|
|
33810
33843
|
}
|
|
33844
|
+
const valuePath = props.valuePath;
|
|
33845
|
+
const asText3 = VALUE_PATH_TEXT.get(type);
|
|
33846
|
+
if (typeof valuePath === "string" && asText3 && (valuePath.startsWith("$service:") || /^\$item\.[^.]/.test(valuePath))) {
|
|
33847
|
+
const r = resolveTreeScalar(valuePath, provider, itemScope);
|
|
33848
|
+
const text2 = asText3(r, props);
|
|
33849
|
+
if (text2 !== void 0) values.value = text2;
|
|
33850
|
+
else if (r !== void 0 && r !== null) {
|
|
33851
|
+
delete values.value;
|
|
33852
|
+
}
|
|
33853
|
+
}
|
|
33854
|
+
if (type === "OtpInput" && props.secure === true) delete values.value;
|
|
33811
33855
|
collectComponentMediaValues(type, props, { provider, itemScope, values, insideMediaProperty: false });
|
|
33812
33856
|
collectResolvedMediaValues(modifiers, "modifiers", {
|
|
33813
33857
|
provider,
|
|
@@ -33816,6 +33860,7 @@ function buildRenderTree(node, path = "$", provider = null, itemScope = void 0,
|
|
|
33816
33860
|
insideMediaProperty: false
|
|
33817
33861
|
});
|
|
33818
33862
|
if (Object.keys(values).length) out.values = values;
|
|
33863
|
+
if (nodeHidden(modifiers, provider, itemScope, env)) out.hidden = true;
|
|
33819
33864
|
const itemsPath = props.itemsPath ?? props.items_path;
|
|
33820
33865
|
if ((type === "LazyList" || type === "Grid") && typeof itemsPath === "string") {
|
|
33821
33866
|
const local = itemsPath.startsWith("$item.");
|
|
@@ -33826,7 +33871,7 @@ function buildRenderTree(node, path = "$", provider = null, itemScope = void 0,
|
|
|
33826
33871
|
(el, i) => buildRenderTree(template, `${id}/${type}[${i}]`, provider, {
|
|
33827
33872
|
...el && typeof el === "object" ? el : { value: el },
|
|
33828
33873
|
__index: i
|
|
33829
|
-
}, includeRawProps)
|
|
33874
|
+
}, includeRawProps, env)
|
|
33830
33875
|
).filter((c) => c != null);
|
|
33831
33876
|
if (kids2.length) out.children = kids2;
|
|
33832
33877
|
return out;
|
|
@@ -33842,7 +33887,7 @@ function buildRenderTree(node, path = "$", provider = null, itemScope = void 0,
|
|
|
33842
33887
|
if (v && typeof v === "object") {
|
|
33843
33888
|
const o = v;
|
|
33844
33889
|
if (o.body && typeof o.body === "object") {
|
|
33845
|
-
const c = buildRenderTree(o, `${id}/${type}`, provider, itemScope, includeRawProps);
|
|
33890
|
+
const c = buildRenderTree(o, `${id}/${type}`, provider, itemScope, includeRawProps, env);
|
|
33846
33891
|
if (c) children.push(c);
|
|
33847
33892
|
} else {
|
|
33848
33893
|
for (const [k, val] of Object.entries(o)) visit(val, `${p}.${k}`);
|
|
@@ -33877,7 +33922,8 @@ async function renderDescriptorWeb(descriptor, tokens, scheme, wantPng, services
|
|
|
33877
33922
|
const provider = services ? new FakeServiceProvider(services) : null;
|
|
33878
33923
|
const stickyHeader = isSduiNode(desc.stickyHeader) ? desc.stickyHeader : void 0;
|
|
33879
33924
|
const stickyFooter = isSduiNode(desc.stickyFooter) ? desc.stickyFooter : void 0;
|
|
33880
|
-
const
|
|
33925
|
+
const clientEnv = clientEnvFor(scheme, width, isRTL);
|
|
33926
|
+
const treeOf = (node, path, prov) => buildRenderTree(node, path, prov, void 0, true, clientEnv);
|
|
33881
33927
|
const renderTree = composeStickyTree(
|
|
33882
33928
|
treeOf(payload, "$", null) ?? void 0,
|
|
33883
33929
|
stickyHeader ? treeOf(stickyHeader, "$.stickyHeader", null) : null,
|
|
@@ -34013,12 +34059,27 @@ async function renderPngBatch(items) {
|
|
|
34013
34059
|
});
|
|
34014
34060
|
}
|
|
34015
34061
|
}
|
|
34016
|
-
var TREE_TEXT_VALUE_PROPS, MEDIA_PLAYER_QUEUE_PROPERTIES, NATIVE_ONLY_TYPES;
|
|
34062
|
+
var TREE_TEXT_VALUE_PROPS, asStringOrNumber, asStringOnly, asOtpCode, VALUE_PATH_TEXT, MEDIA_PLAYER_QUEUE_PROPERTIES, NATIVE_ONLY_TYPES;
|
|
34017
34063
|
var init_render_descriptor = __esm({
|
|
34018
34064
|
"../../core/dev-server/src/render-descriptor.ts"() {
|
|
34019
34065
|
init_FakeServiceProvider();
|
|
34066
|
+
init_env();
|
|
34020
34067
|
init_media_value();
|
|
34021
34068
|
TREE_TEXT_VALUE_PROPS = /* @__PURE__ */ new Set(["text", "title", "label", "value", "placeholder", "message"]);
|
|
34069
|
+
asStringOrNumber = (v) => typeof v === "string" ? v : typeof v === "number" ? String(v) : void 0;
|
|
34070
|
+
asStringOnly = (v) => typeof v === "string" ? v : void 0;
|
|
34071
|
+
asOtpCode = (v, props) => {
|
|
34072
|
+
const whole = asStringOrNumber(v, props);
|
|
34073
|
+
if (whole === void 0) return void 0;
|
|
34074
|
+
const len = typeof props.length === "number" ? props.length : 6;
|
|
34075
|
+
return whole.slice(0, Math.max(0, len));
|
|
34076
|
+
};
|
|
34077
|
+
VALUE_PATH_TEXT = /* @__PURE__ */ new Map([
|
|
34078
|
+
["TextField", asStringOrNumber],
|
|
34079
|
+
["RichTextField", asStringOrNumber],
|
|
34080
|
+
["OtpInput", asOtpCode],
|
|
34081
|
+
["ColorPicker", asStringOnly]
|
|
34082
|
+
]);
|
|
34022
34083
|
MEDIA_PLAYER_QUEUE_PROPERTIES = /* @__PURE__ */ new Set(["items", "itemsPath", "items_path"]);
|
|
34023
34084
|
NATIVE_ONLY_TYPES = /* @__PURE__ */ new Set(["Map", "Video", "Lottie", "Rive", "WebView"]);
|
|
34024
34085
|
}
|
|
@@ -40393,6 +40454,7 @@ function collectObservations(descriptorOrPayload, state) {
|
|
|
40393
40454
|
const out = [];
|
|
40394
40455
|
const walk2 = (node) => {
|
|
40395
40456
|
if (!node) return;
|
|
40457
|
+
if (node.hidden) return;
|
|
40396
40458
|
for (const [field, value] of Object.entries(node.values ?? {})) {
|
|
40397
40459
|
const enc = value !== null && typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
40398
40460
|
out.push(`${node.id}.${field}=${enc}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.825.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": [
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"artifactId": "himalaya-cli"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"falconPackageHash": "
|
|
66
|
+
"falconPackageHash": "5e06eccfd54f4a4994881cefcb68da9d51e6dccb06e0b6b2fd095790"
|
|
67
67
|
}
|