@luxalgo/vela 0.5.1 → 0.5.2

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 (45) hide show
  1. package/dist/{DataProvider-DGesjOJT.d.ts → DataProvider-DTOEXKTI.d.ts} +1 -1
  2. package/dist/{DataProvider-BBQ3Hr21.d.cts → DataProvider-gnzv-dgc.d.cts} +1 -1
  3. package/dist/{chunk-ULIX6AE2.js → chunk-ATPU5CI6.js} +1 -1
  4. package/dist/{chunk-S6F6SQ2L.js → chunk-B5TIKQJ5.js} +60 -7
  5. package/dist/{chunk-EP6NDJYK.js → chunk-LJLZR44Y.js} +4 -2
  6. package/dist/{chunk-AIW3EJUE.js → chunk-P556H6EA.js} +329 -10
  7. package/dist/{chunk-FNOMKHEZ.js → chunk-RRFGWZNJ.js} +1321 -363
  8. package/dist/{chunk-5SE4PL3H.js → chunk-Y7TK4ZWK.js} +1363 -48
  9. package/dist/{contributions-BlV3kb0O.d.cts → contributions-Ci_i3IN2.d.cts} +33 -2
  10. package/dist/{contributions-6N0rbrPC.d.ts → contributions-b6AVrqqG.d.ts} +33 -2
  11. package/dist/{history-DX3Zne3a.d.cts → history-Cf1lVsap.d.cts} +15 -3
  12. package/dist/{history-BTd52YMA.d.ts → history-Ci3M0xLV.d.ts} +15 -3
  13. package/dist/index.cjs +1374 -366
  14. package/dist/index.d.cts +52 -19
  15. package/dist/index.d.ts +52 -19
  16. package/dist/index.js +4 -4
  17. package/dist/{options-DbQholFV.d.cts → options-XTBpbx0s.d.cts} +47 -1
  18. package/dist/{options-DbQholFV.d.ts → options-XTBpbx0s.d.ts} +47 -1
  19. package/dist/{plugin-TN3n-9YN.d.ts → plugin-CnNd7cuF.d.ts} +172 -25
  20. package/dist/{plugin-O34MbXf-.d.cts → plugin-DfH4Y-Om.d.cts} +172 -25
  21. package/dist/plugin.cjs +53 -7
  22. package/dist/plugin.d.cts +4 -4
  23. package/dist/plugin.d.ts +4 -4
  24. package/dist/plugin.js +2 -2
  25. package/dist/providers/binance.d.cts +2 -2
  26. package/dist/providers/binance.d.ts +2 -2
  27. package/dist/providers/coinbase.d.cts +2 -2
  28. package/dist/providers/coinbase.d.ts +2 -2
  29. package/dist/providers/hyperliquid.d.cts +2 -2
  30. package/dist/providers/hyperliquid.d.ts +2 -2
  31. package/dist/ui.cjs +332 -9
  32. package/dist/ui.d.cts +64 -2
  33. package/dist/ui.d.ts +64 -2
  34. package/dist/ui.js +3 -3
  35. package/dist/vela.global.js +1374 -366
  36. package/dist/vela.global.min.js +84 -34
  37. package/dist/widget.cjs +3348 -550
  38. package/dist/widget.d.cts +65 -7
  39. package/dist/widget.d.ts +65 -7
  40. package/dist/widget.js +169 -18
  41. package/dist/workspace.cjs +4251 -1400
  42. package/dist/workspace.d.cts +45 -9
  43. package/dist/workspace.d.ts +45 -9
  44. package/dist/workspace.js +226 -22
  45. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import { u as DrawingTypeKey, a3 as DrawingStyle, S as SerializedDrawing, D as Drawing, av as SeriesKind, O as OHLCV, c as VelaTheme } from './options-DbQholFV.js';
2
- import { b as DataControl } from './contributions-6N0rbrPC.js';
1
+ import { u as DrawingTypeKey, a4 as DrawingStyle, S as SerializedDrawing, D as Drawing, aw as SeriesKind, O as OHLCV, c as VelaTheme } from './options-XTBpbx0s.js';
2
+ import { b as DataControl } from './contributions-b6AVrqqG.js';
3
3
  import './side-panel-CT9ZwIGz.js';
4
4
  import './icons-BZYbJXSV.js';
5
5
  import './keymap-CGOz5F5f.js';
6
- import './DataProvider-DGesjOJT.js';
6
+ import './DataProvider-DTOEXKTI.js';
7
7
 
8
8
  /** What a drawing type contributes to the toolbar + factory (renderer-neutral). */
9
9
  interface DrawingTypeMeta {
@@ -208,7 +208,11 @@ interface SeriesDataEngine {
208
208
  from: number;
209
209
  to: number;
210
210
  }): void;
211
- /** New settings values from the chart-settings dialog (the type's SDK section). */
211
+ /** New settings values from the chart-settings dialog (the type's SDK section).
212
+ * Also delivered once just BEFORE `start()` whenever stored values exist (a
213
+ * persisted config, a market switch recreating the engine) — an engine must
214
+ * accept a pre-start call as pure configuration, so it never fetches on
215
+ * schema defaults the user has edited away. */
212
216
  onSettings?(values: Record<string, unknown>): void;
213
217
  }
214
218
  /** One registered chart type. */
@@ -265,32 +269,126 @@ interface SettingsRowSwatch {
265
269
  /** Names the color for the swatch's tooltip (`'Highlight color'`). */
266
270
  label: string;
267
271
  defval: string;
272
+ /**
273
+ * Optional visibility gate, evaluated live against the values bag exactly like a
274
+ * row's own `when` — lets one toggle row swap its swatch set as another value
275
+ * changes (a mode's two colors while it is on, its one alternative while off).
276
+ * A gated swatch is EXEMPT from the toggle-off dim: its gate already says when
277
+ * it matters, and it may exist specifically for the off state.
278
+ */
279
+ when?: SettingsRowWhen;
280
+ }
281
+ /**
282
+ * An inline LINE-WIDTH dropdown on a toggle row — sits beside the row's color
283
+ * swatches (dimmed with them while the toggle is off) and stores a px number under
284
+ * its own bag key. The control offers the classic drawing-bar weights (1–5 px),
285
+ * each option previewed as a line at that weight.
286
+ */
287
+ interface SettingsRowWidth {
288
+ key: string;
289
+ /** Names the control for its tooltip (`'Line width'`). */
290
+ label: string;
291
+ defval: number;
292
+ }
293
+ /**
294
+ * An inline NUMBER input on a toggle row — sits AHEAD of the row's color swatches
295
+ * (dimmed with them while the toggle is off) and stores a number under its own bag
296
+ * key. For the one value the toggle governs (a percent, a count) — the declarative
297
+ * alternative to a separate `number` row gated on the toggle.
298
+ */
299
+ interface SettingsRowInlineNumber {
300
+ key: string;
301
+ /** Names the input for its tooltip (`'Value area (%)'`). */
302
+ label: string;
303
+ defval: number;
304
+ min?: number;
305
+ max?: number;
306
+ step?: number;
268
307
  }
269
308
  /**
270
- * One declarative settings row. To add a NEW kind, see docs/architecture/settings-rows.md.
309
+ * A select option: a bare string (value = label) or a `[value, label]` pair when the
310
+ * stored id differs from the human-readable text (`['bidAskProfile', 'Bid × Ask Profile']`).
311
+ */
312
+ type SettingsSelectOption = string | readonly [value: string, label: string];
313
+ /**
314
+ * One INLINE CONTROL on a composite `row` — the composable unit every value row is
315
+ * made of. Each keyed control stores under its own bag key; `label` names it for the
316
+ * control's tooltip. A control may carry its own `when` gate (same shape as a row's),
317
+ * evaluated live against the values bag: a gated control appears/disappears as other
318
+ * values change, and is EXEMPT from the row's toggle-off dim — its gate already says
319
+ * when it matters, and it may exist specifically for the off state.
320
+ *
321
+ * - `number` — a compact number input. With `placeholder`, an input at the default
322
+ * value renders EMPTY showing it, and clearing the input stores the default back —
323
+ * the placeholder names the "unset" state (`'Off'` for a 0-disables bound).
324
+ * - `color` — a color swatch opening the shared color picker.
325
+ * - `width` — a line-width dropdown (the classic drawing-bar 1–5 px weights, each
326
+ * option previewed as a line at that weight), storing a px number.
327
+ * - `select` — a dropdown over {@link SettingsSelectOption}s.
328
+ * - `hint` — display-only dimmed text between controls (the `–` of a min–max pair,
329
+ * a unit); stores nothing.
330
+ */
331
+ type SettingsInlineControl = {
332
+ kind: 'number';
333
+ key: string;
334
+ label: string;
335
+ defval: number;
336
+ min?: number;
337
+ max?: number;
338
+ step?: number;
339
+ placeholder?: string;
340
+ when?: SettingsRowWhen;
341
+ } | {
342
+ kind: 'color';
343
+ key: string;
344
+ label: string;
345
+ defval: string;
346
+ when?: SettingsRowWhen;
347
+ } | {
348
+ kind: 'width';
349
+ key: string;
350
+ label: string;
351
+ defval: number;
352
+ when?: SettingsRowWhen;
353
+ } | {
354
+ kind: 'select';
355
+ key: string;
356
+ label: string;
357
+ options: readonly SettingsSelectOption[];
358
+ defval: string;
359
+ when?: SettingsRowWhen;
360
+ } | {
361
+ kind: 'hint';
362
+ text: string;
363
+ };
364
+ /**
365
+ * One declarative settings row. To add a NEW inline control kind, see
366
+ * docs/architecture/settings-rows.md.
271
367
  *
272
368
  * `heading` titles a GROUP of rows: the heading plus everything after it up to the next
273
369
  * heading. In a flat `rows` section headings render as inline group titles; inside
274
- * `instances`/`subsections` they become entries of the pane's group TOC (see
275
- * {@link ChartTypeSettingsSection}).
370
+ * `instances`/`subsections` (or a `layout: 'grouped'` section) they become entries of
371
+ * the pane's group TOC (see {@link ChartTypeSettingsSection}).
276
372
  *
277
373
  * `header` is an in-pane subgroup title: same visual as a flat heading, but inside a
278
374
  * structured pane it stays in the rows column (does NOT become a TOC entry). Use it to
279
375
  * cluster rows inside a TOC group (e.g. Colors / Values under Display).
280
376
  *
281
- * Any row may carry `when` it is shown only while the condition holds.
377
+ * `row` is the COMPOSITE form every value row reduces to: a label, an optional leading
378
+ * `toggle` (a checkbox storing a boolean under `toggle.key`; while off, the row's
379
+ * controls dim and ignore input), and an ordered list of {@link SettingsInlineControl}s
380
+ * in the control column. Any mix of control kinds in any order — no per-combination
381
+ * SDK surface.
282
382
  *
283
- * `range` is a min–max pair on one row (two number inputs storing under `minKey` /
284
- * `maxKey`, both seeded from the shared `defval`). When `placeholder` is given, an
285
- * input holding the default value renders EMPTY showing the placeholder, and clearing
286
- * an input stores the default backso the placeholder names the "unset" state
287
- * (`'Off'` for a 0-disables filter bound).
288
- */
289
- /**
290
- * A select option: a bare string (value = label) or a `[value, label]` pair when the
291
- * stored id differs from the human-readable text (`['bidAskProfile', 'Bid × Ask Profile']`).
383
+ * The remaining kinds are SUGAR over `row` (see {@link normalizeSettingsRow}):
384
+ * - `toggle` a checkbox row; optional inline `number`, color `colors`, and `width`
385
+ * attachments render in that order.
386
+ * - `number` / `color` / `select`one control on its own row.
387
+ * - `range` a min–max pair (two number inputs under `minKey`/`maxKey`, both seeded
388
+ * from the shared `defval`, with `placeholder` naming the unset state).
389
+ *
390
+ * Any row may carry `when` it is shown only while the condition holds.
292
391
  */
293
- type SettingsSelectOption = string | readonly [value: string, label: string];
294
392
  type SettingsRowDescriptor = {
295
393
  kind: 'heading';
296
394
  label: string;
@@ -299,12 +397,23 @@ type SettingsRowDescriptor = {
299
397
  kind: 'header';
300
398
  label: string;
301
399
  when?: SettingsRowWhen;
400
+ } | {
401
+ kind: 'row';
402
+ label: string;
403
+ toggle?: {
404
+ key: string;
405
+ defval: boolean;
406
+ };
407
+ controls: readonly SettingsInlineControl[];
408
+ when?: SettingsRowWhen;
302
409
  } | {
303
410
  kind: 'toggle';
304
411
  key: string;
305
412
  label: string;
306
413
  defval: boolean;
414
+ number?: SettingsRowInlineNumber;
307
415
  colors?: readonly SettingsRowSwatch[];
416
+ width?: SettingsRowWidth;
308
417
  when?: SettingsRowWhen;
309
418
  } | {
310
419
  kind: 'number';
@@ -340,6 +449,39 @@ type SettingsRowDescriptor = {
340
449
  placeholder?: string;
341
450
  when?: SettingsRowWhen;
342
451
  };
452
+ /** A value-carrying row (everything except the key-less `heading`/`header` titles). */
453
+ type SettingsValueRow = Exclude<SettingsRowDescriptor, {
454
+ kind: 'heading' | 'header';
455
+ }>;
456
+ /** The canonical row shape every {@link SettingsValueRow} reduces to (the `row` kind's fields). */
457
+ interface NormalizedSettingsRow {
458
+ label: string;
459
+ toggle?: {
460
+ key: string;
461
+ defval: boolean;
462
+ };
463
+ controls: readonly SettingsInlineControl[];
464
+ when?: SettingsRowWhen;
465
+ }
466
+ /**
467
+ * Reduce a value row to the canonical composite shape — the ONE contract view layers
468
+ * render and the persistence layer enumerates. The sugar kinds map exactly onto their
469
+ * historical rendering: `toggle` attachments in number → colors → width order, `range`
470
+ * as two number controls around a `–` hint (placeholder semantics preserved).
471
+ */
472
+ declare function normalizeSettingsRow(r: SettingsValueRow): NormalizedSettingsRow;
473
+ /** One value a settings row stores: its bag key, runtime type, and registry default. */
474
+ interface SettingsRowValueKey {
475
+ key: string;
476
+ type: 'boolean' | 'number' | 'string';
477
+ defval: boolean | number | string;
478
+ }
479
+ /**
480
+ * EVERY key a row stores (toggle key + each keyed inline control), with its expected
481
+ * type and default — the single enumeration the dialog seeds from and the factory
482
+ * reset restores, so no key can fall through a kind-specific walk.
483
+ */
484
+ declare function settingsRowValueKeys(r: SettingsRowDescriptor): SettingsRowValueKey[];
343
485
  /**
344
486
  * One tab of a section's INSTANCE STRIP — a repeated block of settings (e.g. one of
345
487
  * several overlays a style can paint). The dialog shows a tab per PRESENT instance,
@@ -370,14 +512,15 @@ interface ChartTypeSettingsSubsection {
370
512
  * A chart type's settings tab. Two forms:
371
513
  *
372
514
  * - **Flat**: `rows` only — rendered as one scrollable pane, `heading` rows as inline
373
- * group titles (the historical form).
515
+ * group titles (the historical form). `layout: 'grouped'` upgrades the same rows to
516
+ * the GROUP TOC presentation (below) without declaring an instance strip.
374
517
  * - **Structured**: `instances` (and optionally `subsections`) — the pane opens with an
375
518
  * instance TAB STRIP, and each instance's rows are organized by a GROUP TOC on the
376
- * left built from its `heading` rows (rows before the first heading always show above
377
- * the groups; selecting a TOC entry shows only that group's rows). `subsections` add
378
- * indented rail entries under the section's tab, each a pane with the same TOC
379
- * treatment. A TOC entry hides itself while every row of its group is hidden by
380
- * `when` gates.
519
+ * left of the pane (right of the dialog's tab rail) built from its `heading` rows
520
+ * (rows before the first heading always show above the groups; selecting a TOC entry
521
+ * shows only that group's rows). `subsections` add indented rail entries under the
522
+ * section's tab, each a pane with the same TOC treatment. A TOC entry hides itself
523
+ * while every row of its group is hidden by `when` gates.
381
524
  *
382
525
  * All values — every instance and subsection included — live in the ONE per-type bag
383
526
  * (`config.chartTypes[<id>]`), so consumers keep receiving a single flat object.
@@ -387,6 +530,10 @@ interface ChartTypeSettingsSection {
387
530
  title: string;
388
531
  /** Flat form. Ignored when `instances` is declared. */
389
532
  rows?: readonly SettingsRowDescriptor[];
533
+ /** How `rows` are presented: `'flat'` (default) renders headings as inline group
534
+ * titles; `'grouped'` promotes them to a group TOC beside the rows (the structured
535
+ * pane's presentation, without an instance strip). Ignored with `instances`. */
536
+ layout?: 'flat' | 'grouped';
390
537
  /** Structured form: the pane's instance tab strip. */
391
538
  instances?: readonly ChartTypeSettingsInstance[];
392
539
  /** Indented sub-entries under this section's rail tab. */
@@ -552,4 +699,4 @@ declare const CATEGORICAL: readonly string[];
552
699
  /** Pick a stable categorical color for a string key (same key ⇒ same color). */
553
700
  declare function categoricalColor(key: string): string;
554
701
 
555
- export { stableSeriesId as $, ACCENT as A, BEARISH as B, CATEGORICAL as C, type DrawingTypeMeta as D, TRADE_SHORT as E, categoricalColor as F, chartType as G, HIGHLIGHT as H, INFO as I, chartTypes as J, createDrawing as K, deserializeDrawing as L, MARKER as M, NEUTRAL as N, drawingTypes as O, getDrawingType as P, registerChartType as Q, type RendererLayerArgs as R, SERIES_LINE as S, TRADE_EXIT as T, registerDrawingType as U, VALID as V, WARNING as W, registerRendererDefaults as X, registerRendererLayer as Y, rendererDefaults as Z, rendererLayers as _, ACCENT_BRIGHT as a, tickerModifierIds as a0, unregisterChartType as a1, unregisterRendererDefaults as a2, unregisterRendererLayer as a3, BULLISH as b, type BarTransform as c, type BasePaintingModulation as d, CROSSHAIR as e, type ChartTypeDefinition as f, type ChartTypeSettingsInstance as g, type ChartTypeSettingsSection as h, type ChartTypeSettingsSubsection as i, INVALID as j, type IdentifiableKind as k, type RendererLayerDefinition as l, type RendererLayerInstance as m, SESSION_OFF as n, SESSION_POST as o, SESSION_PRE as p, SLATE as q, SLATE_DEEP as r, type SeriesDataEngine as s, type SeriesDataEngineHost as t, type SettingsRowCondition as u, type SettingsRowDescriptor as v, type SettingsRowSwatch as w, type SettingsRowWhen as x, type SettingsSelectOption as y, TRADE_LONG as z };
702
+ export { normalizeSettingsRow as $, ACCENT as A, BEARISH as B, CATEGORICAL as C, type DrawingTypeMeta as D, type SettingsRowValueKey as E, type SettingsRowWhen as F, type SettingsRowWidth as G, HIGHLIGHT as H, INFO as I, type SettingsSelectOption as J, type SettingsValueRow as K, TRADE_LONG as L, MARKER as M, NEUTRAL as N, TRADE_SHORT as O, categoricalColor as P, chartType as Q, type RendererLayerArgs as R, SERIES_LINE as S, TRADE_EXIT as T, chartTypes as U, VALID as V, WARNING as W, createDrawing as X, deserializeDrawing as Y, drawingTypes as Z, getDrawingType as _, ACCENT_BRIGHT as a, registerChartType as a0, registerDrawingType as a1, registerRendererDefaults as a2, registerRendererLayer as a3, rendererDefaults as a4, rendererLayers as a5, settingsRowValueKeys as a6, stableSeriesId as a7, tickerModifierIds as a8, unregisterChartType as a9, unregisterRendererDefaults as aa, unregisterRendererLayer as ab, BULLISH as b, type BarTransform as c, type BasePaintingModulation as d, CROSSHAIR as e, type ChartTypeDefinition as f, type ChartTypeSettingsInstance as g, type ChartTypeSettingsSection as h, type ChartTypeSettingsSubsection as i, INVALID as j, type IdentifiableKind as k, type NormalizedSettingsRow as l, type RendererLayerDefinition as m, type RendererLayerInstance as n, SESSION_OFF as o, SESSION_POST as p, SESSION_PRE as q, SLATE as r, SLATE_DEEP as s, type SeriesDataEngine as t, type SeriesDataEngineHost as u, type SettingsInlineControl as v, type SettingsRowCondition as w, type SettingsRowDescriptor as x, type SettingsRowInlineNumber as y, type SettingsRowSwatch as z };
@@ -1,9 +1,9 @@
1
- import { u as DrawingTypeKey, a3 as DrawingStyle, S as SerializedDrawing, D as Drawing, av as SeriesKind, O as OHLCV, c as VelaTheme } from './options-DbQholFV.cjs';
2
- import { b as DataControl } from './contributions-BlV3kb0O.cjs';
1
+ import { u as DrawingTypeKey, a4 as DrawingStyle, S as SerializedDrawing, D as Drawing, aw as SeriesKind, O as OHLCV, c as VelaTheme } from './options-XTBpbx0s.cjs';
2
+ import { b as DataControl } from './contributions-Ci_i3IN2.cjs';
3
3
  import './side-panel-CT9ZwIGz.cjs';
4
4
  import './icons-BZYbJXSV.cjs';
5
5
  import './keymap-CGOz5F5f.cjs';
6
- import './DataProvider-BBQ3Hr21.cjs';
6
+ import './DataProvider-gnzv-dgc.cjs';
7
7
 
8
8
  /** What a drawing type contributes to the toolbar + factory (renderer-neutral). */
9
9
  interface DrawingTypeMeta {
@@ -208,7 +208,11 @@ interface SeriesDataEngine {
208
208
  from: number;
209
209
  to: number;
210
210
  }): void;
211
- /** New settings values from the chart-settings dialog (the type's SDK section). */
211
+ /** New settings values from the chart-settings dialog (the type's SDK section).
212
+ * Also delivered once just BEFORE `start()` whenever stored values exist (a
213
+ * persisted config, a market switch recreating the engine) — an engine must
214
+ * accept a pre-start call as pure configuration, so it never fetches on
215
+ * schema defaults the user has edited away. */
212
216
  onSettings?(values: Record<string, unknown>): void;
213
217
  }
214
218
  /** One registered chart type. */
@@ -265,32 +269,126 @@ interface SettingsRowSwatch {
265
269
  /** Names the color for the swatch's tooltip (`'Highlight color'`). */
266
270
  label: string;
267
271
  defval: string;
272
+ /**
273
+ * Optional visibility gate, evaluated live against the values bag exactly like a
274
+ * row's own `when` — lets one toggle row swap its swatch set as another value
275
+ * changes (a mode's two colors while it is on, its one alternative while off).
276
+ * A gated swatch is EXEMPT from the toggle-off dim: its gate already says when
277
+ * it matters, and it may exist specifically for the off state.
278
+ */
279
+ when?: SettingsRowWhen;
280
+ }
281
+ /**
282
+ * An inline LINE-WIDTH dropdown on a toggle row — sits beside the row's color
283
+ * swatches (dimmed with them while the toggle is off) and stores a px number under
284
+ * its own bag key. The control offers the classic drawing-bar weights (1–5 px),
285
+ * each option previewed as a line at that weight.
286
+ */
287
+ interface SettingsRowWidth {
288
+ key: string;
289
+ /** Names the control for its tooltip (`'Line width'`). */
290
+ label: string;
291
+ defval: number;
292
+ }
293
+ /**
294
+ * An inline NUMBER input on a toggle row — sits AHEAD of the row's color swatches
295
+ * (dimmed with them while the toggle is off) and stores a number under its own bag
296
+ * key. For the one value the toggle governs (a percent, a count) — the declarative
297
+ * alternative to a separate `number` row gated on the toggle.
298
+ */
299
+ interface SettingsRowInlineNumber {
300
+ key: string;
301
+ /** Names the input for its tooltip (`'Value area (%)'`). */
302
+ label: string;
303
+ defval: number;
304
+ min?: number;
305
+ max?: number;
306
+ step?: number;
268
307
  }
269
308
  /**
270
- * One declarative settings row. To add a NEW kind, see docs/architecture/settings-rows.md.
309
+ * A select option: a bare string (value = label) or a `[value, label]` pair when the
310
+ * stored id differs from the human-readable text (`['bidAskProfile', 'Bid × Ask Profile']`).
311
+ */
312
+ type SettingsSelectOption = string | readonly [value: string, label: string];
313
+ /**
314
+ * One INLINE CONTROL on a composite `row` — the composable unit every value row is
315
+ * made of. Each keyed control stores under its own bag key; `label` names it for the
316
+ * control's tooltip. A control may carry its own `when` gate (same shape as a row's),
317
+ * evaluated live against the values bag: a gated control appears/disappears as other
318
+ * values change, and is EXEMPT from the row's toggle-off dim — its gate already says
319
+ * when it matters, and it may exist specifically for the off state.
320
+ *
321
+ * - `number` — a compact number input. With `placeholder`, an input at the default
322
+ * value renders EMPTY showing it, and clearing the input stores the default back —
323
+ * the placeholder names the "unset" state (`'Off'` for a 0-disables bound).
324
+ * - `color` — a color swatch opening the shared color picker.
325
+ * - `width` — a line-width dropdown (the classic drawing-bar 1–5 px weights, each
326
+ * option previewed as a line at that weight), storing a px number.
327
+ * - `select` — a dropdown over {@link SettingsSelectOption}s.
328
+ * - `hint` — display-only dimmed text between controls (the `–` of a min–max pair,
329
+ * a unit); stores nothing.
330
+ */
331
+ type SettingsInlineControl = {
332
+ kind: 'number';
333
+ key: string;
334
+ label: string;
335
+ defval: number;
336
+ min?: number;
337
+ max?: number;
338
+ step?: number;
339
+ placeholder?: string;
340
+ when?: SettingsRowWhen;
341
+ } | {
342
+ kind: 'color';
343
+ key: string;
344
+ label: string;
345
+ defval: string;
346
+ when?: SettingsRowWhen;
347
+ } | {
348
+ kind: 'width';
349
+ key: string;
350
+ label: string;
351
+ defval: number;
352
+ when?: SettingsRowWhen;
353
+ } | {
354
+ kind: 'select';
355
+ key: string;
356
+ label: string;
357
+ options: readonly SettingsSelectOption[];
358
+ defval: string;
359
+ when?: SettingsRowWhen;
360
+ } | {
361
+ kind: 'hint';
362
+ text: string;
363
+ };
364
+ /**
365
+ * One declarative settings row. To add a NEW inline control kind, see
366
+ * docs/architecture/settings-rows.md.
271
367
  *
272
368
  * `heading` titles a GROUP of rows: the heading plus everything after it up to the next
273
369
  * heading. In a flat `rows` section headings render as inline group titles; inside
274
- * `instances`/`subsections` they become entries of the pane's group TOC (see
275
- * {@link ChartTypeSettingsSection}).
370
+ * `instances`/`subsections` (or a `layout: 'grouped'` section) they become entries of
371
+ * the pane's group TOC (see {@link ChartTypeSettingsSection}).
276
372
  *
277
373
  * `header` is an in-pane subgroup title: same visual as a flat heading, but inside a
278
374
  * structured pane it stays in the rows column (does NOT become a TOC entry). Use it to
279
375
  * cluster rows inside a TOC group (e.g. Colors / Values under Display).
280
376
  *
281
- * Any row may carry `when` it is shown only while the condition holds.
377
+ * `row` is the COMPOSITE form every value row reduces to: a label, an optional leading
378
+ * `toggle` (a checkbox storing a boolean under `toggle.key`; while off, the row's
379
+ * controls dim and ignore input), and an ordered list of {@link SettingsInlineControl}s
380
+ * in the control column. Any mix of control kinds in any order — no per-combination
381
+ * SDK surface.
282
382
  *
283
- * `range` is a min–max pair on one row (two number inputs storing under `minKey` /
284
- * `maxKey`, both seeded from the shared `defval`). When `placeholder` is given, an
285
- * input holding the default value renders EMPTY showing the placeholder, and clearing
286
- * an input stores the default backso the placeholder names the "unset" state
287
- * (`'Off'` for a 0-disables filter bound).
288
- */
289
- /**
290
- * A select option: a bare string (value = label) or a `[value, label]` pair when the
291
- * stored id differs from the human-readable text (`['bidAskProfile', 'Bid × Ask Profile']`).
383
+ * The remaining kinds are SUGAR over `row` (see {@link normalizeSettingsRow}):
384
+ * - `toggle` a checkbox row; optional inline `number`, color `colors`, and `width`
385
+ * attachments render in that order.
386
+ * - `number` / `color` / `select`one control on its own row.
387
+ * - `range` a min–max pair (two number inputs under `minKey`/`maxKey`, both seeded
388
+ * from the shared `defval`, with `placeholder` naming the unset state).
389
+ *
390
+ * Any row may carry `when` it is shown only while the condition holds.
292
391
  */
293
- type SettingsSelectOption = string | readonly [value: string, label: string];
294
392
  type SettingsRowDescriptor = {
295
393
  kind: 'heading';
296
394
  label: string;
@@ -299,12 +397,23 @@ type SettingsRowDescriptor = {
299
397
  kind: 'header';
300
398
  label: string;
301
399
  when?: SettingsRowWhen;
400
+ } | {
401
+ kind: 'row';
402
+ label: string;
403
+ toggle?: {
404
+ key: string;
405
+ defval: boolean;
406
+ };
407
+ controls: readonly SettingsInlineControl[];
408
+ when?: SettingsRowWhen;
302
409
  } | {
303
410
  kind: 'toggle';
304
411
  key: string;
305
412
  label: string;
306
413
  defval: boolean;
414
+ number?: SettingsRowInlineNumber;
307
415
  colors?: readonly SettingsRowSwatch[];
416
+ width?: SettingsRowWidth;
308
417
  when?: SettingsRowWhen;
309
418
  } | {
310
419
  kind: 'number';
@@ -340,6 +449,39 @@ type SettingsRowDescriptor = {
340
449
  placeholder?: string;
341
450
  when?: SettingsRowWhen;
342
451
  };
452
+ /** A value-carrying row (everything except the key-less `heading`/`header` titles). */
453
+ type SettingsValueRow = Exclude<SettingsRowDescriptor, {
454
+ kind: 'heading' | 'header';
455
+ }>;
456
+ /** The canonical row shape every {@link SettingsValueRow} reduces to (the `row` kind's fields). */
457
+ interface NormalizedSettingsRow {
458
+ label: string;
459
+ toggle?: {
460
+ key: string;
461
+ defval: boolean;
462
+ };
463
+ controls: readonly SettingsInlineControl[];
464
+ when?: SettingsRowWhen;
465
+ }
466
+ /**
467
+ * Reduce a value row to the canonical composite shape — the ONE contract view layers
468
+ * render and the persistence layer enumerates. The sugar kinds map exactly onto their
469
+ * historical rendering: `toggle` attachments in number → colors → width order, `range`
470
+ * as two number controls around a `–` hint (placeholder semantics preserved).
471
+ */
472
+ declare function normalizeSettingsRow(r: SettingsValueRow): NormalizedSettingsRow;
473
+ /** One value a settings row stores: its bag key, runtime type, and registry default. */
474
+ interface SettingsRowValueKey {
475
+ key: string;
476
+ type: 'boolean' | 'number' | 'string';
477
+ defval: boolean | number | string;
478
+ }
479
+ /**
480
+ * EVERY key a row stores (toggle key + each keyed inline control), with its expected
481
+ * type and default — the single enumeration the dialog seeds from and the factory
482
+ * reset restores, so no key can fall through a kind-specific walk.
483
+ */
484
+ declare function settingsRowValueKeys(r: SettingsRowDescriptor): SettingsRowValueKey[];
343
485
  /**
344
486
  * One tab of a section's INSTANCE STRIP — a repeated block of settings (e.g. one of
345
487
  * several overlays a style can paint). The dialog shows a tab per PRESENT instance,
@@ -370,14 +512,15 @@ interface ChartTypeSettingsSubsection {
370
512
  * A chart type's settings tab. Two forms:
371
513
  *
372
514
  * - **Flat**: `rows` only — rendered as one scrollable pane, `heading` rows as inline
373
- * group titles (the historical form).
515
+ * group titles (the historical form). `layout: 'grouped'` upgrades the same rows to
516
+ * the GROUP TOC presentation (below) without declaring an instance strip.
374
517
  * - **Structured**: `instances` (and optionally `subsections`) — the pane opens with an
375
518
  * instance TAB STRIP, and each instance's rows are organized by a GROUP TOC on the
376
- * left built from its `heading` rows (rows before the first heading always show above
377
- * the groups; selecting a TOC entry shows only that group's rows). `subsections` add
378
- * indented rail entries under the section's tab, each a pane with the same TOC
379
- * treatment. A TOC entry hides itself while every row of its group is hidden by
380
- * `when` gates.
519
+ * left of the pane (right of the dialog's tab rail) built from its `heading` rows
520
+ * (rows before the first heading always show above the groups; selecting a TOC entry
521
+ * shows only that group's rows). `subsections` add indented rail entries under the
522
+ * section's tab, each a pane with the same TOC treatment. A TOC entry hides itself
523
+ * while every row of its group is hidden by `when` gates.
381
524
  *
382
525
  * All values — every instance and subsection included — live in the ONE per-type bag
383
526
  * (`config.chartTypes[<id>]`), so consumers keep receiving a single flat object.
@@ -387,6 +530,10 @@ interface ChartTypeSettingsSection {
387
530
  title: string;
388
531
  /** Flat form. Ignored when `instances` is declared. */
389
532
  rows?: readonly SettingsRowDescriptor[];
533
+ /** How `rows` are presented: `'flat'` (default) renders headings as inline group
534
+ * titles; `'grouped'` promotes them to a group TOC beside the rows (the structured
535
+ * pane's presentation, without an instance strip). Ignored with `instances`. */
536
+ layout?: 'flat' | 'grouped';
390
537
  /** Structured form: the pane's instance tab strip. */
391
538
  instances?: readonly ChartTypeSettingsInstance[];
392
539
  /** Indented sub-entries under this section's rail tab. */
@@ -552,4 +699,4 @@ declare const CATEGORICAL: readonly string[];
552
699
  /** Pick a stable categorical color for a string key (same key ⇒ same color). */
553
700
  declare function categoricalColor(key: string): string;
554
701
 
555
- export { stableSeriesId as $, ACCENT as A, BEARISH as B, CATEGORICAL as C, type DrawingTypeMeta as D, TRADE_SHORT as E, categoricalColor as F, chartType as G, HIGHLIGHT as H, INFO as I, chartTypes as J, createDrawing as K, deserializeDrawing as L, MARKER as M, NEUTRAL as N, drawingTypes as O, getDrawingType as P, registerChartType as Q, type RendererLayerArgs as R, SERIES_LINE as S, TRADE_EXIT as T, registerDrawingType as U, VALID as V, WARNING as W, registerRendererDefaults as X, registerRendererLayer as Y, rendererDefaults as Z, rendererLayers as _, ACCENT_BRIGHT as a, tickerModifierIds as a0, unregisterChartType as a1, unregisterRendererDefaults as a2, unregisterRendererLayer as a3, BULLISH as b, type BarTransform as c, type BasePaintingModulation as d, CROSSHAIR as e, type ChartTypeDefinition as f, type ChartTypeSettingsInstance as g, type ChartTypeSettingsSection as h, type ChartTypeSettingsSubsection as i, INVALID as j, type IdentifiableKind as k, type RendererLayerDefinition as l, type RendererLayerInstance as m, SESSION_OFF as n, SESSION_POST as o, SESSION_PRE as p, SLATE as q, SLATE_DEEP as r, type SeriesDataEngine as s, type SeriesDataEngineHost as t, type SettingsRowCondition as u, type SettingsRowDescriptor as v, type SettingsRowSwatch as w, type SettingsRowWhen as x, type SettingsSelectOption as y, TRADE_LONG as z };
702
+ export { normalizeSettingsRow as $, ACCENT as A, BEARISH as B, CATEGORICAL as C, type DrawingTypeMeta as D, type SettingsRowValueKey as E, type SettingsRowWhen as F, type SettingsRowWidth as G, HIGHLIGHT as H, INFO as I, type SettingsSelectOption as J, type SettingsValueRow as K, TRADE_LONG as L, MARKER as M, NEUTRAL as N, TRADE_SHORT as O, categoricalColor as P, chartType as Q, type RendererLayerArgs as R, SERIES_LINE as S, TRADE_EXIT as T, chartTypes as U, VALID as V, WARNING as W, createDrawing as X, deserializeDrawing as Y, drawingTypes as Z, getDrawingType as _, ACCENT_BRIGHT as a, registerChartType as a0, registerDrawingType as a1, registerRendererDefaults as a2, registerRendererLayer as a3, rendererDefaults as a4, rendererLayers as a5, settingsRowValueKeys as a6, stableSeriesId as a7, tickerModifierIds as a8, unregisterChartType as a9, unregisterRendererDefaults as aa, unregisterRendererLayer as ab, BULLISH as b, type BarTransform as c, type BasePaintingModulation as d, CROSSHAIR as e, type ChartTypeDefinition as f, type ChartTypeSettingsInstance as g, type ChartTypeSettingsSection as h, type ChartTypeSettingsSubsection as i, INVALID as j, type IdentifiableKind as k, type NormalizedSettingsRow as l, type RendererLayerDefinition as m, type RendererLayerInstance as n, SESSION_OFF as o, SESSION_POST as p, SESSION_PRE as q, SLATE as r, SLATE_DEEP as s, type SeriesDataEngine as t, type SeriesDataEngineHost as u, type SettingsInlineControl as v, type SettingsRowCondition as w, type SettingsRowDescriptor as x, type SettingsRowInlineNumber as y, type SettingsRowSwatch as z };