@wix/himalaya-cli 0.826.0 → 0.827.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/builder.d.ts +85 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +134 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +12 -0
- package/dist/cli.mjs +358 -38
- package/guides/component-reference.json +30 -2
- package/guides/component-reference.md +72 -3
- package/guides/index.json +1 -1
- package/package.json +2 -2
|
@@ -212,16 +212,100 @@ export declare function icon(name: string, opts?: {
|
|
|
212
212
|
size?: number;
|
|
213
213
|
tint?: string;
|
|
214
214
|
}): Component;
|
|
215
|
+
/** One named series of a multi-series {@link chart}. */
|
|
216
|
+
export interface ChartSeriesShape {
|
|
217
|
+
label?: string;
|
|
218
|
+
values?: number[];
|
|
219
|
+
/** `$service:` ONLY — a `$item.` placeholder is stringified to "" by both
|
|
220
|
+
* native per-row substituters, so it renders EMPTY on iOS and Android while
|
|
221
|
+
* resolving on web. Enforced by the descriptor validator. */
|
|
222
|
+
valuesPath?: string;
|
|
223
|
+
color?: string;
|
|
224
|
+
kind?: "line" | "area" | "bar";
|
|
225
|
+
/** Omit for the auto solid → dashed → dotted cycle by series index. */
|
|
226
|
+
stroke?: "solid" | "dashed" | "dotted";
|
|
227
|
+
}
|
|
215
228
|
/** Compact trend chart (sparkline) — line / area / bar. Tier-5: pass
|
|
216
229
|
* `valuesPath` (a `$service:` path to a worker-state number[]) for live data;
|
|
217
230
|
* `values` is a static fallback. Resolves to a native Canvas/Path on both
|
|
218
|
-
* platforms — no charting dependency.
|
|
231
|
+
* platforms — no charting dependency.
|
|
232
|
+
*
|
|
233
|
+
* RFC 0057: pass `series` for a multi-series chart. Every series then shares ONE
|
|
234
|
+
* Y scale, which is the only way to draw a comparison overlay honestly — two
|
|
235
|
+
* stacked single-series charts normalise over their own ranges independently.
|
|
236
|
+
* `series` empty/absent ⇒ exactly the single-series behaviour above. */
|
|
219
237
|
export declare function chart(props: {
|
|
220
238
|
valuesPath?: string;
|
|
221
239
|
values?: number[];
|
|
222
240
|
kind?: "line" | "area" | "bar";
|
|
223
241
|
color?: string;
|
|
224
242
|
height?: number;
|
|
243
|
+
series?: ChartSeriesShape[];
|
|
244
|
+
}, opts?: {
|
|
245
|
+
id?: string;
|
|
246
|
+
}): Component;
|
|
247
|
+
/** RFC 0057 — a proportional breakdown (ring, or a solid pie at `thickness: 0`).
|
|
248
|
+
* Slice `value`s are RAW magnitudes; the renderer computes each share, because a
|
|
249
|
+
* renderer handed percentages that do not sum to 100 cannot draw them honestly. */
|
|
250
|
+
export declare function donutChart(props: {
|
|
251
|
+
slices?: Array<{
|
|
252
|
+
label?: string;
|
|
253
|
+
value?: number;
|
|
254
|
+
color?: string;
|
|
255
|
+
}>;
|
|
256
|
+
/** `$service:` ONLY (array-valued — see {@link ChartSeriesShape.valuesPath}). */
|
|
257
|
+
slicesPath?: string;
|
|
258
|
+
size?: number;
|
|
259
|
+
thickness?: number;
|
|
260
|
+
centerTitle?: string;
|
|
261
|
+
centerSubtitle?: string;
|
|
262
|
+
color?: string;
|
|
263
|
+
}, opts?: {
|
|
264
|
+
id?: string;
|
|
265
|
+
}): Component;
|
|
266
|
+
/** RFC 0057 — labels for a chart or a table. `marker: "dashed"` labels a
|
|
267
|
+
* {@link chart} series drawn with the dashed stroke, which is what makes
|
|
268
|
+
* colour-free series identity readable. `value` is already formatted. */
|
|
269
|
+
export declare function legend(props: {
|
|
270
|
+
items?: Array<{
|
|
271
|
+
label?: string;
|
|
272
|
+
color?: string;
|
|
273
|
+
value?: string;
|
|
274
|
+
marker?: "dot" | "line" | "dashed" | "square";
|
|
275
|
+
}>;
|
|
276
|
+
/** `$service:` ONLY. */
|
|
277
|
+
itemsPath?: string;
|
|
278
|
+
orientation?: "horizontal" | "vertical";
|
|
279
|
+
}, opts?: {
|
|
280
|
+
id?: string;
|
|
281
|
+
}): Component;
|
|
282
|
+
/** RFC 0057 — dimension-by-measure rows. Presentational: no row-tap action.
|
|
283
|
+
* Literal `rows` are POSITIONAL (declared column order); a bound `rowsPath`
|
|
284
|
+
* resolves to objects keyed by `column.key` (arrays are tolerated too). */
|
|
285
|
+
export declare function dataTable(props: {
|
|
286
|
+
columns?: Array<{
|
|
287
|
+
key?: string;
|
|
288
|
+
title?: string;
|
|
289
|
+
align?: "leading" | "center" | "trailing";
|
|
290
|
+
weight?: number;
|
|
291
|
+
}>;
|
|
292
|
+
rows?: Array<{
|
|
293
|
+
id?: string;
|
|
294
|
+
cells?: string[];
|
|
295
|
+
}>;
|
|
296
|
+
/** `$service:` ONLY. */
|
|
297
|
+
rowsPath?: string;
|
|
298
|
+
/** Not `showHeader` — the proto bool defaults to false, so the affirmative
|
|
299
|
+
* spelling would default a table to headerless. */
|
|
300
|
+
hideHeader?: boolean;
|
|
301
|
+
totals?: {
|
|
302
|
+
id?: string;
|
|
303
|
+
cells?: string[];
|
|
304
|
+
};
|
|
305
|
+
/** `$service:` ONLY. */
|
|
306
|
+
totalsPath?: string;
|
|
307
|
+
maxRows?: number;
|
|
308
|
+
zebra?: boolean;
|
|
225
309
|
}, opts?: {
|
|
226
310
|
id?: string;
|
|
227
311
|
}): Component;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -1243,6 +1243,128 @@ export interface ChartProps {
|
|
|
1243
1243
|
color?: TokenName;
|
|
1244
1244
|
/** chart height in pt/dp (default 120) */
|
|
1245
1245
|
height?: number;
|
|
1246
|
+
/**
|
|
1247
|
+
* RFC 0057 — multi-series. EMPTY (or absent) ⇒ this component behaves exactly
|
|
1248
|
+
* as it did before the field existed. NON-EMPTY ⇒ `values`/`valuesPath` above
|
|
1249
|
+
* are ignored and the series list is the data. All series share ONE Y scale,
|
|
1250
|
+
* which is the whole point: two stacked single-series Charts normalize over
|
|
1251
|
+
* their own ranges independently and draw a comparison that inverts whenever
|
|
1252
|
+
* the smaller series has the larger internal range.
|
|
1253
|
+
*/
|
|
1254
|
+
series?: ChartSeries[];
|
|
1255
|
+
}
|
|
1256
|
+
/** One named series inside a multi-series {@link ChartProps}. */
|
|
1257
|
+
export interface ChartSeries {
|
|
1258
|
+
/** legend / accessibility label */
|
|
1259
|
+
label?: string;
|
|
1260
|
+
values?: number[];
|
|
1261
|
+
/**
|
|
1262
|
+
* `$service:` binding → number[] (overrides `values`).
|
|
1263
|
+
*
|
|
1264
|
+
* `$service:` only — a `$item.` placeholder is stringified to "" by both native
|
|
1265
|
+
* per-row substituters, so it would render the chart EMPTY on iOS and Android
|
|
1266
|
+
* while resolving on web. Enforced, not merely documented: see
|
|
1267
|
+
* SERVICE_ONLY_BINDING_PROPS.
|
|
1268
|
+
*/
|
|
1269
|
+
valuesPath?: string;
|
|
1270
|
+
/** color token; absent ⇒ ChartProps.color */
|
|
1271
|
+
color?: TokenName;
|
|
1272
|
+
/** "line" | "area" | "bar"; absent ⇒ ChartProps.kind */
|
|
1273
|
+
kind?: string;
|
|
1274
|
+
/**
|
|
1275
|
+
* "solid" | "dashed" | "dotted". Absent ⇒ AUTO: that cycle indexed by the
|
|
1276
|
+
* series' position, so a two-series chart is solid-against-dashed with no
|
|
1277
|
+
* author effort. Identity is carried by STROKE rather than color by default
|
|
1278
|
+
* because color-only differentiation fails for color-blind viewers and in
|
|
1279
|
+
* monochrome captures — and because the token registry ships no categorical
|
|
1280
|
+
* series ramp to cycle (an undefined color token renders fully transparent
|
|
1281
|
+
* on iOS).
|
|
1282
|
+
*/
|
|
1283
|
+
stroke?: string;
|
|
1284
|
+
}
|
|
1285
|
+
/** One wedge of a {@link DonutChartProps}. */
|
|
1286
|
+
export interface DonutSlice {
|
|
1287
|
+
label?: string;
|
|
1288
|
+
/** RAW magnitude, never a pre-computed percentage — the renderer computes the share. */
|
|
1289
|
+
value?: number;
|
|
1290
|
+
/** color token; absent ⇒ derived from DonutChartProps.color at descending opacity */
|
|
1291
|
+
color?: TokenName;
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* RFC 0057 — a proportional breakdown: a ring, or a solid pie at `thickness: 0`.
|
|
1295
|
+
*/
|
|
1296
|
+
export interface DonutChartProps {
|
|
1297
|
+
slices?: DonutSlice[];
|
|
1298
|
+
/** `$service:` ONLY → [{label, value, color}] (array-valued; see ChartSeries.valuesPath). */
|
|
1299
|
+
slicesPath?: string;
|
|
1300
|
+
/** diameter in pt/dp (default 160) */
|
|
1301
|
+
size?: number;
|
|
1302
|
+
/** ring thickness in pt/dp (default 28); 0 ⇒ a solid pie */
|
|
1303
|
+
thickness?: number;
|
|
1304
|
+
centerTitle?: string;
|
|
1305
|
+
centerSubtitle?: string;
|
|
1306
|
+
/** base token for the derived opacity ramp (default "accentPrimary") */
|
|
1307
|
+
color?: TokenName;
|
|
1308
|
+
}
|
|
1309
|
+
/** One row of a {@link LegendProps}. */
|
|
1310
|
+
export interface LegendItem {
|
|
1311
|
+
label?: string;
|
|
1312
|
+
color?: TokenName;
|
|
1313
|
+
/** optional trailing value, e.g. "42%" — a FORMATTED string, not a number */
|
|
1314
|
+
value?: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* "dot" (default) | "line" | "dashed" | "square". "line"/"dashed" exist so a
|
|
1317
|
+
* legend can label a multi-series Chart's stroke patterns.
|
|
1318
|
+
*/
|
|
1319
|
+
marker?: string;
|
|
1320
|
+
}
|
|
1321
|
+
/** RFC 0057 — labels for a chart or a table. */
|
|
1322
|
+
export interface LegendProps {
|
|
1323
|
+
items?: LegendItem[];
|
|
1324
|
+
/** `$service:` ONLY → [{label, color, value, marker}]. */
|
|
1325
|
+
itemsPath?: string;
|
|
1326
|
+
/** "horizontal" (default, wraps) | "vertical" */
|
|
1327
|
+
orientation?: string;
|
|
1328
|
+
}
|
|
1329
|
+
/** One declared column of a {@link DataTableProps}. */
|
|
1330
|
+
export interface DataTableColumn {
|
|
1331
|
+
/** field name read from a BOUND row object */
|
|
1332
|
+
key?: string;
|
|
1333
|
+
title?: string;
|
|
1334
|
+
/** "leading" (default) | "center" | "trailing" */
|
|
1335
|
+
align?: string;
|
|
1336
|
+
/** flex weight (default 1) */
|
|
1337
|
+
weight?: number;
|
|
1338
|
+
}
|
|
1339
|
+
/** One row of a {@link DataTableProps}. */
|
|
1340
|
+
export interface DataTableRow {
|
|
1341
|
+
/** stable row id (invariant 27) */
|
|
1342
|
+
id?: string;
|
|
1343
|
+
/** POSITIONAL, in declared column order. Strings, already formatted. */
|
|
1344
|
+
cells?: string[];
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* RFC 0057 — dimension-by-measure rows. Presentational: no row-tap action.
|
|
1348
|
+
*/
|
|
1349
|
+
export interface DataTableProps {
|
|
1350
|
+
columns?: DataTableColumn[];
|
|
1351
|
+
rows?: DataTableRow[];
|
|
1352
|
+
/**
|
|
1353
|
+
* `$service:` ONLY → an array of OBJECTS keyed by `column.key`. An array of
|
|
1354
|
+
* arrays (positional, like the literal `rows`) is also accepted.
|
|
1355
|
+
*/
|
|
1356
|
+
rowsPath?: string;
|
|
1357
|
+
/**
|
|
1358
|
+
* `hideHeader`, not `showHeader`: the proto field is a bool that defaults to
|
|
1359
|
+
* false, so the affirmative spelling would default a table to headerless.
|
|
1360
|
+
*/
|
|
1361
|
+
hideHeader?: boolean;
|
|
1362
|
+
totals?: DataTableRow;
|
|
1363
|
+
/** `$service:` ONLY → one row object. */
|
|
1364
|
+
totalsPath?: string;
|
|
1365
|
+
/** 0 / absent ⇒ unbounded */
|
|
1366
|
+
maxRows?: number;
|
|
1367
|
+
zebra?: boolean;
|
|
1246
1368
|
}
|
|
1247
1369
|
/**
|
|
1248
1370
|
* A recorded-audio message bubble — waveform, play/pause, scrubber, duration and
|
|
@@ -2037,6 +2159,18 @@ export type CoreComponentBody = {
|
|
|
2037
2159
|
package: "himalaya";
|
|
2038
2160
|
type: "Chart";
|
|
2039
2161
|
props: ChartProps;
|
|
2162
|
+
} | {
|
|
2163
|
+
package: "himalaya";
|
|
2164
|
+
type: "DonutChart";
|
|
2165
|
+
props: DonutChartProps;
|
|
2166
|
+
} | {
|
|
2167
|
+
package: "himalaya";
|
|
2168
|
+
type: "Legend";
|
|
2169
|
+
props: LegendProps;
|
|
2170
|
+
} | {
|
|
2171
|
+
package: "himalaya";
|
|
2172
|
+
type: "DataTable";
|
|
2173
|
+
props: DataTableProps;
|
|
2040
2174
|
} | {
|
|
2041
2175
|
package: "himalaya";
|
|
2042
2176
|
type: "VoiceNote";
|
|
@@ -8523,6 +8523,10 @@ var CORE_COMPONENTS = /* @__PURE__ */ new Set([
|
|
|
8523
8523
|
"himalaya.Gauge",
|
|
8524
8524
|
"himalaya.Rating",
|
|
8525
8525
|
"himalaya.Chart",
|
|
8526
|
+
// Analytics data-viz — RFC 0057
|
|
8527
|
+
"himalaya.DonutChart",
|
|
8528
|
+
"himalaya.Legend",
|
|
8529
|
+
"himalaya.DataTable",
|
|
8526
8530
|
// Recorded-audio bubble — messenger design G4
|
|
8527
8531
|
"himalaya.VoiceNote",
|
|
8528
8532
|
"himalaya.Marquee",
|
|
@@ -8017,6 +8017,15 @@ function icon(name, opts) {
|
|
|
8017
8017
|
function chart(props, opts) {
|
|
8018
8018
|
return { id: opts?.id ?? auto("chart"), body: { package: "himalaya", type: "Chart", props } };
|
|
8019
8019
|
}
|
|
8020
|
+
function donutChart(props, opts) {
|
|
8021
|
+
return { id: opts?.id ?? auto("donut_chart"), body: { package: "himalaya", type: "DonutChart", props } };
|
|
8022
|
+
}
|
|
8023
|
+
function legend(props, opts) {
|
|
8024
|
+
return { id: opts?.id ?? auto("legend"), body: { package: "himalaya", type: "Legend", props } };
|
|
8025
|
+
}
|
|
8026
|
+
function dataTable(props, opts) {
|
|
8027
|
+
return { id: opts?.id ?? auto("data_table"), body: { package: "himalaya", type: "DataTable", props } };
|
|
8028
|
+
}
|
|
8020
8029
|
function spacer(opts) {
|
|
8021
8030
|
const props = {};
|
|
8022
8031
|
if (opts?.value !== void 0) props.value = opts.value;
|
|
@@ -8489,11 +8498,13 @@ export {
|
|
|
8489
8498
|
chipsInput,
|
|
8490
8499
|
collapsingHeader,
|
|
8491
8500
|
colorPicker,
|
|
8501
|
+
dataTable,
|
|
8492
8502
|
datePicker,
|
|
8493
8503
|
dateStrip,
|
|
8494
8504
|
deriveAppMeta,
|
|
8495
8505
|
disclosureGroup,
|
|
8496
8506
|
divider,
|
|
8507
|
+
donutChart,
|
|
8497
8508
|
emptyBlock,
|
|
8498
8509
|
emptyState,
|
|
8499
8510
|
fab,
|
|
@@ -8511,6 +8522,7 @@ export {
|
|
|
8511
8522
|
label,
|
|
8512
8523
|
labeledContent,
|
|
8513
8524
|
lazyList,
|
|
8525
|
+
legend,
|
|
8514
8526
|
listItem,
|
|
8515
8527
|
lottie,
|
|
8516
8528
|
map,
|