@luxalgo/vela 0.9.0 → 0.9.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 (126) hide show
  1. package/dist/{DataProvider-zJGp58kb.d.cts → DataProvider-B5i0_yY4.d.cts} +1 -1
  2. package/dist/{DataProvider-BGlB1zSc.d.ts → DataProvider-CPFgSyAm.d.ts} +1 -1
  3. package/dist/{chunk-4WAHYL7Y.js → chunk-4AMWSBOW.js} +33 -2
  4. package/dist/{chunk-YRCL3WMD.js → chunk-Q7POFYNE.js} +7 -1
  5. package/dist/{chunk-XIRSR3D6.js → chunk-W4WTHJFA.js} +50 -31
  6. package/dist/{contributions-BjefWpxQ.d.ts → contributions-BDx47Vk0.d.ts} +11 -3
  7. package/dist/{contributions-CpCJisTC.d.cts → contributions-BiF6lVvJ.d.cts} +11 -3
  8. package/dist/index.cjs +42 -22
  9. package/dist/index.d.cts +13 -11
  10. package/dist/index.d.ts +13 -11
  11. package/dist/index.js +2 -2
  12. package/dist/{keymap-UolhuXH1.d.ts → keymap-C48ughm6.d.ts} +1 -1
  13. package/dist/{keymap-B9_FLhfJ.d.cts → keymap-W0hiajU6.d.cts} +1 -1
  14. package/dist/locales/ar.cjs +2 -0
  15. package/dist/locales/ar.d.cts +1 -1
  16. package/dist/locales/ar.d.ts +1 -1
  17. package/dist/locales/ar.js +2 -0
  18. package/dist/locales/de.cjs +2 -0
  19. package/dist/locales/de.d.cts +1 -1
  20. package/dist/locales/de.d.ts +1 -1
  21. package/dist/locales/de.js +2 -0
  22. package/dist/locales/en.cjs +2 -0
  23. package/dist/locales/en.d.cts +1 -1
  24. package/dist/locales/en.d.ts +1 -1
  25. package/dist/locales/en.js +2 -0
  26. package/dist/locales/es.cjs +2 -0
  27. package/dist/locales/es.d.cts +1 -1
  28. package/dist/locales/es.d.ts +1 -1
  29. package/dist/locales/es.js +2 -0
  30. package/dist/locales/fr.cjs +2 -0
  31. package/dist/locales/fr.d.cts +1 -1
  32. package/dist/locales/fr.d.ts +1 -1
  33. package/dist/locales/fr.js +2 -0
  34. package/dist/locales/he.cjs +2 -0
  35. package/dist/locales/he.d.cts +1 -1
  36. package/dist/locales/he.d.ts +1 -1
  37. package/dist/locales/he.js +2 -0
  38. package/dist/locales/hi.cjs +2 -0
  39. package/dist/locales/hi.d.cts +1 -1
  40. package/dist/locales/hi.d.ts +1 -1
  41. package/dist/locales/hi.js +2 -0
  42. package/dist/locales/id.cjs +2 -0
  43. package/dist/locales/id.d.cts +1 -1
  44. package/dist/locales/id.d.ts +1 -1
  45. package/dist/locales/id.js +2 -0
  46. package/dist/locales/it.cjs +2 -0
  47. package/dist/locales/it.d.cts +1 -1
  48. package/dist/locales/it.d.ts +1 -1
  49. package/dist/locales/it.js +2 -0
  50. package/dist/locales/ja.cjs +2 -0
  51. package/dist/locales/ja.d.cts +1 -1
  52. package/dist/locales/ja.d.ts +1 -1
  53. package/dist/locales/ja.js +2 -0
  54. package/dist/locales/ko.cjs +2 -0
  55. package/dist/locales/ko.d.cts +1 -1
  56. package/dist/locales/ko.d.ts +1 -1
  57. package/dist/locales/ko.js +2 -0
  58. package/dist/locales/ms.cjs +2 -0
  59. package/dist/locales/ms.d.cts +1 -1
  60. package/dist/locales/ms.d.ts +1 -1
  61. package/dist/locales/ms.js +2 -0
  62. package/dist/locales/pl.cjs +2 -0
  63. package/dist/locales/pl.d.cts +1 -1
  64. package/dist/locales/pl.d.ts +1 -1
  65. package/dist/locales/pl.js +2 -0
  66. package/dist/locales/pt-BR.cjs +2 -0
  67. package/dist/locales/pt-BR.d.cts +1 -1
  68. package/dist/locales/pt-BR.d.ts +1 -1
  69. package/dist/locales/pt-BR.js +2 -0
  70. package/dist/locales/ru.cjs +2 -0
  71. package/dist/locales/ru.d.cts +1 -1
  72. package/dist/locales/ru.d.ts +1 -1
  73. package/dist/locales/ru.js +2 -0
  74. package/dist/locales/th.cjs +2 -0
  75. package/dist/locales/th.d.cts +1 -1
  76. package/dist/locales/th.d.ts +1 -1
  77. package/dist/locales/th.js +2 -0
  78. package/dist/locales/tr.cjs +2 -0
  79. package/dist/locales/tr.d.cts +1 -1
  80. package/dist/locales/tr.d.ts +1 -1
  81. package/dist/locales/tr.js +2 -0
  82. package/dist/locales/vi.cjs +2 -0
  83. package/dist/locales/vi.d.cts +1 -1
  84. package/dist/locales/vi.d.ts +1 -1
  85. package/dist/locales/vi.js +2 -0
  86. package/dist/locales/zh-Hans.cjs +2 -0
  87. package/dist/locales/zh-Hans.d.cts +1 -1
  88. package/dist/locales/zh-Hans.d.ts +1 -1
  89. package/dist/locales/zh-Hans.js +2 -0
  90. package/dist/locales/zh-Hant.cjs +2 -0
  91. package/dist/locales/zh-Hant.d.cts +1 -1
  92. package/dist/locales/zh-Hant.d.ts +1 -1
  93. package/dist/locales/zh-Hant.js +2 -0
  94. package/dist/{options-D4L3_hv_.d.ts → options-B7aL1pbf.d.ts} +1 -1
  95. package/dist/{options-CpegHml_.d.cts → options-I1H2HDWw.d.cts} +1 -1
  96. package/dist/{plugin-DTmulpKM.d.ts → plugin-CbSGKQLB.d.ts} +6 -6
  97. package/dist/{plugin-DpNp4aBi.d.cts → plugin-ZknmqQqo.d.cts} +6 -6
  98. package/dist/plugin.cjs +1 -0
  99. package/dist/plugin.d.cts +7 -7
  100. package/dist/plugin.d.ts +7 -7
  101. package/dist/plugin.js +1 -1
  102. package/dist/providers/binance.d.cts +3 -3
  103. package/dist/providers/binance.d.ts +3 -3
  104. package/dist/providers/coinbase.d.cts +3 -3
  105. package/dist/providers/coinbase.d.ts +3 -3
  106. package/dist/providers/hyperliquid.d.cts +3 -3
  107. package/dist/providers/hyperliquid.d.ts +3 -3
  108. package/dist/{side-panel-CYmH1Opm.d.ts → side-panel-BEQJqSjR.d.cts} +2 -1
  109. package/dist/{side-panel-BqUnpfev.d.cts → side-panel-Ud0SBAnE.d.ts} +2 -1
  110. package/dist/{statusline-model-pGs3Xvp-.d.cts → statusline-model-CwYMw_Yl.d.cts} +7 -4
  111. package/dist/{statusline-model-C3yIY9WE.d.ts → statusline-model-ny7GXRuS.d.ts} +7 -4
  112. package/dist/{types-BlrXRLIR.d.cts → types-Bwf63xGI.d.cts} +4 -1
  113. package/dist/{types-BlrXRLIR.d.ts → types-Bwf63xGI.d.ts} +4 -1
  114. package/dist/ui.d.cts +3 -3
  115. package/dist/ui.d.ts +3 -3
  116. package/dist/vela.global.js +42 -22
  117. package/dist/vela.global.min.js +55 -55
  118. package/dist/widget.cjs +82 -26
  119. package/dist/widget.d.cts +10 -10
  120. package/dist/widget.d.ts +10 -10
  121. package/dist/widget.js +4 -4
  122. package/dist/workspace.cjs +82 -26
  123. package/dist/workspace.d.cts +7 -7
  124. package/dist/workspace.d.ts +7 -7
  125. package/dist/workspace.js +3 -3
  126. package/package.json +1 -1
@@ -6917,6 +6917,7 @@ function mergeConfig(base, patch) {
6917
6917
  mode: isScaleMode(ps.mode) ? ps.mode : base.priceScale.mode,
6918
6918
  log: isBool(ps.log) ? ps.log : base.priceScale.log,
6919
6919
  invert: isBool(ps.invert) ? ps.invert : base.priceScale.invert,
6920
+ priceOnly: isBool(ps.priceOnly) ? ps.priceOnly : base.priceScale.priceOnly,
6920
6921
  borderColor: isColor(ps.borderColor) ? ps.borderColor : base.priceScale.borderColor,
6921
6922
  labelsVisible: isBool(ps.labelsVisible) ? ps.labelsVisible : base.priceScale.labelsVisible,
6922
6923
  currentPriceLine: isBool(ps.currentPriceLine) ? ps.currentPriceLine : base.priceScale.currentPriceLine,
@@ -18777,6 +18778,7 @@ var TEXT20 = {
18777
18778
  indexed: msg("widget.contextMenu.scale.indexed", "Indexed to 100"),
18778
18779
  log: msg("widget.contextMenu.scale.log", "Logarithmic"),
18779
18780
  auto: msg("widget.contextMenu.auto", "Auto (fits data to screen)"),
18781
+ priceOnly: msg("widget.contextMenu.scalePriceOnly", "Scale price chart only"),
18780
18782
  invert: msg("widget.contextMenu.invert", "Invert scale"),
18781
18783
  labels: msg("widget.contextMenu.labels", "Labels"),
18782
18784
  axisLabels: msg("widget.contextMenu.axisLabels", "Price axis labels"),
@@ -18834,6 +18836,9 @@ function scaleWrites(choice, pane) {
18834
18836
  ["logScale", { pane: pane.id, value: log }]
18835
18837
  ];
18836
18838
  }
18839
+ function priceOnlyState(pane, flag) {
18840
+ return mainScale(pane) ? flag : void 0;
18841
+ }
18837
18842
  function invertWrite(next, pane) {
18838
18843
  return mainScale(pane) ? ["invertScale", next] : ["invertScale", { pane: pane.id, value: next }];
18839
18844
  }
@@ -18841,6 +18846,7 @@ function priceAxisItems(s, i18n) {
18841
18846
  const t = (m) => textOf(i18n, m);
18842
18847
  return [
18843
18848
  { id: "auto", label: t(TEXT20.auto), checked: s.auto },
18849
+ ...s.priceOnly === void 0 ? [] : [{ id: "price-only", label: t(TEXT20.priceOnly), checked: s.priceOnly }],
18844
18850
  { id: "invert", label: t(TEXT20.invert), checked: s.invert },
18845
18851
  ...SCALE_CHOICES.map(([choice, label], i) => ({
18846
18852
  id: `scale:${choice}`,
@@ -18889,6 +18895,7 @@ var CONTEXT_MENU_BUILTIN_ORDER = {
18889
18895
  body: { "reset-view": -30, "remove-drawings": -20, "remove-indicators": -10, settings: 1e3 },
18890
18896
  "price-axis": {
18891
18897
  auto: -80,
18898
+ "price-only": -75,
18892
18899
  invert: -70,
18893
18900
  "scale:regular": -60,
18894
18901
  "scale:percent": -50,
@@ -18975,6 +18982,7 @@ var PriceScaleDrawer = class {
18975
18982
  const pane = this.pane;
18976
18983
  const items = priceAxisItems({
18977
18984
  auto: chart.renderer.get("autoScale") !== false,
18985
+ priceOnly: priceOnlyState(pane, this.flag("scalePriceOnly")),
18978
18986
  invert: pane ? pane.invert : this.flag("invertScale"),
18979
18987
  choice: scaleChoiceOf(pane ?? { mode: String(chart.renderer.get("scaleMode") ?? "price"), log: this.flag("logScale") }),
18980
18988
  axisLabels: this.flag("axisLabels"),
@@ -19051,6 +19059,16 @@ var PriceScaleDrawer = class {
19051
19059
  });
19052
19060
  continue;
19053
19061
  }
19062
+ if (item.id === "price-only") {
19063
+ row2(item.label, {
19064
+ checked: item.checked,
19065
+ onClick: () => {
19066
+ chart.renderer.set("scalePriceOnly", !this.flag("scalePriceOnly"));
19067
+ this.render();
19068
+ }
19069
+ });
19070
+ continue;
19071
+ }
19054
19072
  if (item.id === "invert") {
19055
19073
  row2(item.label, {
19056
19074
  checked: item.checked,
@@ -21370,6 +21388,7 @@ function successorNative(entry) {
21370
21388
  const hasInputs = Object.keys(inputs).length > 0;
21371
21389
  return hasInputs || hidden ? { type: next, ...hasInputs ? { inputs } : {}, ...hidden ? { hidden } : {} } : next;
21372
21390
  }
21391
+ var STATUSLINE_PART_KEYS = ["logo", "name", "market", "ohlc", "change"];
21373
21392
  function sanitizeCell(raw) {
21374
21393
  if (raw == null || typeof raw !== "object") return null;
21375
21394
  const c = raw;
@@ -21384,6 +21403,12 @@ function sanitizeCell(raw) {
21384
21403
  if (typeof c.replayWatermark === "boolean") out.replayWatermark = c.replayWatermark;
21385
21404
  if (typeof c.indicatorTitles === "boolean") out.indicatorTitles = c.indicatorTitles;
21386
21405
  if (typeof c.indicatorValues === "boolean") out.indicatorValues = c.indicatorValues;
21406
+ if (c.statuslineParts != null && typeof c.statuslineParts === "object") {
21407
+ const bag = c.statuslineParts;
21408
+ const parts = {};
21409
+ for (const key of STATUSLINE_PART_KEYS) if (typeof bag[key] === "boolean") parts[key] = bag[key];
21410
+ if (Object.keys(parts).length > 0) out.statuslineParts = parts;
21411
+ }
21387
21412
  if (c.rendererConfig != null && typeof c.rendererConfig === "object") out.rendererConfig = c.rendererConfig;
21388
21413
  if (c.drawings != null && typeof c.drawings === "object") out.drawings = c.drawings;
21389
21414
  const ind = c.indicators;
@@ -22390,7 +22415,8 @@ var EngineOrchestrator = class _EngineOrchestrator {
22390
22415
  symbol: this.config.market.symbol ?? "TEST",
22391
22416
  timeframe: this.config.market.timeframe ?? "60",
22392
22417
  symbolInfo: this.feed.symbolInfo?.(this.config.market),
22393
- chartStyle: this.priceStyle
22418
+ chartStyle: this.priceStyle,
22419
+ session: this.config.market.session
22394
22420
  };
22395
22421
  }
22396
22422
  /**
@@ -30049,6 +30075,9 @@ var SceneGraph = class {
30049
30075
  this.logScale = false;
30050
30076
  /** Inverted price axis on the price pane (high at the bottom). Study panes carry their own. */
30051
30077
  this.invertScale = false;
30078
+ /** The price pane's autoscale fits the bars alone: indicator plots, their price lines
30079
+ * and Pine drawings paint where they fall instead of widening the window. */
30080
+ this.scalePriceOnly = false;
30052
30081
  /** Exchange tick size for the active symbol (e.g. 0.01), when known. Drives the
30053
30082
  * price-axis decimals — the instrument's true precision instead of the zoom-derived
30054
30083
  * formula. Undefined until symbol metadata loads (the formula is the fallback). */
@@ -31747,6 +31776,18 @@ var DrawingSceneRenderer = class {
31747
31776
  }
31748
31777
  };
31749
31778
 
31779
+ // src/renderers/native/chrome/tz.ts
31780
+ var DAY_MS3 = 864e5;
31781
+ function displayZone(timeZone, barIntervalMs) {
31782
+ return barIntervalMs >= DAY_MS3 ? "UTC" : timeZone;
31783
+ }
31784
+ function tzOffsetMs(ms, timeZone) {
31785
+ return zoneOffsetMs(ms, timeZone);
31786
+ }
31787
+ function zonedDate(ms, timeZone) {
31788
+ return new Date(ms + tzOffsetMs(ms, timeZone));
31789
+ }
31790
+
31750
31791
  // src/renderers/native/chrome/ticks.ts
31751
31792
  function priceTicks(min, max, target = 6) {
31752
31793
  if (!(max > min) || !Number.isFinite(min) || !Number.isFinite(max)) return [];
@@ -31887,7 +31928,7 @@ var STEP_LADDER = [
31887
31928
  YEAR
31888
31929
  ];
31889
31930
  function formatTimeStamp2(ms, timeZone, barIntervalMs, fmt = ENGLISH_FORMAT, surface = "crosshair") {
31890
- return fmt.timeStamp(ms, { timeZone, withTime: barIntervalMs < DAY2, surface });
31931
+ return fmt.timeStamp(ms, { timeZone: displayZone(timeZone, barIntervalMs), withTime: barIntervalMs < DAY2, surface });
31891
31932
  }
31892
31933
  function pickStep(targetMs) {
31893
31934
  for (const step of STEP_LADDER) if (step >= targetMs) return step;
@@ -32031,14 +32072,6 @@ var PriceAxisTickSource = class {
32031
32072
  }
32032
32073
  };
32033
32074
 
32034
- // src/renderers/native/chrome/tz.ts
32035
- function tzOffsetMs(ms, timeZone) {
32036
- return zoneOffsetMs(ms, timeZone);
32037
- }
32038
- function zonedDate(ms, timeZone) {
32039
- return new Date(ms + tzOffsetMs(ms, timeZone));
32040
- }
32041
-
32042
32075
  // src/renderers/native/chrome/countdown.ts
32043
32076
  function countdownText2(barOpen, barMs, now2, fmt = ENGLISH_FORMAT) {
32044
32077
  if (!(barMs > 0)) return null;
@@ -32752,7 +32785,7 @@ var ChromeRenderer = class {
32752
32785
  ctx.textAlign = "center";
32753
32786
  const y = dataH + (fullH - dataH) / 2;
32754
32787
  const tr = coords.visibleTimeRange();
32755
- const offset = tzOffsetMs((tr.from + tr.to) / 2, scene.timezone);
32788
+ const offset = tzOffsetMs((tr.from + tr.to) / 2, displayZone(scene.timezone, coords.barInterval));
32756
32789
  const target = Math.max(3, Math.min(8, Math.floor(dataW / 64)));
32757
32790
  const ticks = timeTicks(tr.from, tr.to, target, offset, scene.format).map((tick) => ({ ...tick, x: coords.timeToX(tick.time), half: ctx.measureText(tick.label).width / 2 })).filter((tick) => tick.x >= 20 && tick.x <= dataW - 20);
32758
32791
  const GAP = 12;
@@ -33240,6 +33273,7 @@ var TEXT28 = {
33240
33273
  indexedTo100: msg("chart.settings.indexedTo100", "Indexed to 100"),
33241
33274
  logarithmic: msg("chart.settings.logarithmic", "Logarithmic"),
33242
33275
  invertScale: msg("chart.settings.invertScale", "Invert scale"),
33276
+ scalePriceOnly: msg("chart.settings.scalePriceOnly", "Scale price chart only"),
33243
33277
  lastPriceLine: msg("chart.settings.lastPriceLine", "Last price line"),
33244
33278
  lastPriceLabel: msg("chart.settings.lastPriceLabel", "Last price label"),
33245
33279
  countdownToBarClose: msg("chart.settings.countdownToBarClose", "Countdown to bar close"),
@@ -33748,6 +33782,7 @@ var SettingsDialog = class {
33748
33782
  ), "scales.price-scale.mode")
33749
33783
  );
33750
33784
  body.append(sid(this.boolRow(TEXT28.invertScale, config.priceScale.invert, (v) => this.emit({ priceScale: { invert: v } })), "scales.price-scale.invert"));
33785
+ body.append(sid(this.boolRow(TEXT28.scalePriceOnly, config.priceScale.priceOnly, (v) => this.emit({ priceScale: { priceOnly: v } })), "scales.price-scale.price-only"));
33751
33786
  body.append(sid(this.separator(), "scales.price-scale"));
33752
33787
  body.append(sid(this.boolRow(TEXT28.lastPriceLine, config.priceScale.currentPriceLine, (v) => this.emit({ priceScale: { currentPriceLine: v } })), "scales.price-scale.last-price-line"));
33753
33788
  body.append(sid(this.boolRow(TEXT28.lastPriceLabel, config.priceScale.priceLabel, (v) => this.emit({ priceScale: { priceLabel: v } })), "scales.price-scale.last-price-label"));
@@ -41179,7 +41214,7 @@ var BackdropRenderer = class {
41179
41214
  ctx.globalAlpha = gridAlpha;
41180
41215
  ctx.strokeStyle = vertColor;
41181
41216
  const tr = coords.visibleTimeRange();
41182
- const offset = tzOffsetMs((tr.from + tr.to) / 2, scene.timezone);
41217
+ const offset = tzOffsetMs((tr.from + tr.to) / 2, displayZone(scene.timezone, coords.barInterval));
41183
41218
  ctx.beginPath();
41184
41219
  for (const tick of timeTicks(tr.from, tr.to, 8, offset)) {
41185
41220
  const x = Math.round(coords.timeToX(tick.time)) + 0.5;
@@ -41971,7 +42006,7 @@ var NativeRenderer = class {
41971
42006
  this.priceStyleCbs = /* @__PURE__ */ new Set();
41972
42007
  this.priceStyleWillChangeCbs = /* @__PURE__ */ new Set();
41973
42008
  this.name = "native";
41974
- this.features = ["logScale", "currentPriceLine", "priceLabel", "countdown", "upColor", "downColor", "glow", "animZoom", "animPan", "animScroll", "animAutoscale", "animLiveBar", "intro", "zoomAnchor", "axisDrag", "paneResize", "candleZOrder", "candleVisible", "seriesOrder", "highlights", "sessionZones", "gridlines", "axisLabels", "scaleMode", "invertScale", "paneScales", "autoScale", "timezone", "keyboard", "historyChords", "priceStyle", "priceBaseline", "baselinePrice", "settings", "attribution", "dialogHost", "tradeMarkers", "marks", "indicatorTitles", "indicatorValues", "crosshairOverride", "drawingsInteractive", "priceAxisTicks"];
42009
+ this.features = ["logScale", "currentPriceLine", "priceLabel", "countdown", "upColor", "downColor", "glow", "animZoom", "animPan", "animScroll", "animAutoscale", "animLiveBar", "intro", "zoomAnchor", "axisDrag", "paneResize", "candleZOrder", "candleVisible", "seriesOrder", "highlights", "sessionZones", "gridlines", "axisLabels", "scaleMode", "invertScale", "scalePriceOnly", "paneScales", "autoScale", "timezone", "keyboard", "historyChords", "priceStyle", "priceBaseline", "baselinePrice", "settings", "attribution", "dialogHost", "tradeMarkers", "marks", "indicatorTitles", "indicatorValues", "crosshairOverride", "drawingsInteractive", "priceAxisTicks"];
41975
42010
  /** Track cursor proximity to the scroll button on the plot (bubbles from the button too,
41976
42011
  * so moving onto the button doesn't count as leaving). */
41977
42012
  this.onScrollProximityMove = (e) => {
@@ -42130,6 +42165,9 @@ var NativeRenderer = class {
42130
42165
  }
42131
42166
  this.scene.invertScale = Boolean(value);
42132
42167
  break;
42168
+ case "scalePriceOnly":
42169
+ this.scene.scalePriceOnly = Boolean(value);
42170
+ break;
42133
42171
  case "autoScale":
42134
42172
  for (const pane of this.scene.panes.values()) {
42135
42173
  pane.manualScale = value ? null : { ...pane.scale };
@@ -42256,6 +42294,8 @@ var NativeRenderer = class {
42256
42294
  return this.scene.scaleMode;
42257
42295
  case "invertScale":
42258
42296
  return this.scene.invertScale;
42297
+ case "scalePriceOnly":
42298
+ return this.scene.scalePriceOnly;
42259
42299
  case "paneScales":
42260
42300
  return this.paneScaleInfos();
42261
42301
  case "autoScale": {
@@ -42402,6 +42442,7 @@ var NativeRenderer = class {
42402
42442
  mode: this.scene.scaleMode,
42403
42443
  log: this.scene.logScale,
42404
42444
  invert: this.scene.invertScale,
42445
+ priceOnly: this.scene.scalePriceOnly,
42405
42446
  borderColor: s.borderColor ?? t.borderColor,
42406
42447
  labelsVisible: this.scene.showAxisLabels,
42407
42448
  currentPriceLine: this.scene.showPriceLine,
@@ -42516,6 +42557,7 @@ var NativeRenderer = class {
42516
42557
  this.scene.scaleMode = next.priceScale.mode;
42517
42558
  this.scene.logScale = next.priceScale.log;
42518
42559
  this.scene.invertScale = next.priceScale.invert;
42560
+ this.scene.scalePriceOnly = next.priceScale.priceOnly;
42519
42561
  s.borderColor = keepInherit(s.borderColor, next.priceScale.borderColor, prevTheme.borderColor);
42520
42562
  this.scene.showAxisLabels = next.priceScale.labelsVisible;
42521
42563
  this.scene.showPriceLine = next.priceScale.currentPriceLine;
@@ -44497,7 +44539,7 @@ var NativeRenderer = class {
44497
44539
  const pricePane = this.dataWindowPricePane();
44498
44540
  const ohlc = this.dataWindowOHLC(bar, pricePane);
44499
44541
  const parts = [];
44500
- if (bar) parts.push(formatStamp(bar.time, this.scene.timezone));
44542
+ if (bar) parts.push(formatStamp(bar.time, displayZone(this.scene.timezone, this.coords.barInterval)));
44501
44543
  if (ohlc) parts.push(this.t(TEXT35.barSummary, { open: ohlc.o, high: ohlc.h, low: ohlc.l, close: ohlc.c }));
44502
44544
  for (const group of this.dataWindowGroups(idx, pricePane)) {
44503
44545
  for (const row2 of group.rows) parts.push(this.t(TEXT35.valueSummary, { name: row2.label, value: row2.value }));
@@ -44514,7 +44556,7 @@ var NativeRenderer = class {
44514
44556
  const idx = this.hoverLogical != null ? this.hoverLogical : n - 1;
44515
44557
  const bar = this.bars[idx];
44516
44558
  const pricePane = this.dataWindowPricePane();
44517
- const parts = bar ? formatStampParts(bar.time, this.scene.timezone) : { date: "", time: "" };
44559
+ const parts = bar ? formatStampParts(bar.time, displayZone(this.scene.timezone, this.coords.barInterval)) : { date: "", time: "" };
44518
44560
  return { date: parts.date, time: parts.time, ohlc: this.dataWindowOHLC(bar, pricePane), groups: this.dataWindowGroups(idx, pricePane) };
44519
44561
  }
44520
44562
  dataWindowPricePane() {
@@ -44881,7 +44923,8 @@ var NativeRenderer = class {
44881
44923
  if (or) dr = dr ? { min: Math.min(dr.min, or.min), max: Math.max(dr.max, or.max) } : or;
44882
44924
  }
44883
44925
  const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels) || !this.paneHasMeasurableContent(masterModels, dr));
44884
- pane.scaleTarget = computePaneScale(masterModels, this.bars, includeCandles, i0, s1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id), margins);
44926
+ const priceOnly = pane === pricePane && this.scene.scalePriceOnly && includeCandles;
44927
+ pane.scaleTarget = priceOnly ? computePaneScale([], this.bars, true, i0, s1, null, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id), margins) : computePaneScale(masterModels, this.bars, includeCandles, i0, s1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id), margins);
44885
44928
  pane.percentBaseline = pane.kind === "price" ? this.bars[i0]?.close ?? 0 : this.firstVisibleValue(masterModels, i0);
44886
44929
  pane.axisFormat = void 0;
44887
44930
  pane.axisBands = void 0;
@@ -49177,16 +49220,16 @@ var volumeSpecs = [
49177
49220
  ];
49178
49221
 
49179
49222
  // src/core/native-indicators/classics/overlays.ts
49180
- var DAY_MS3 = 864e5;
49223
+ var DAY_MS4 = 864e5;
49181
49224
  function periodKey(anchor, time) {
49182
- if (anchor === "Week") return Math.floor((Math.floor(time / DAY_MS3) + 3) / 7);
49225
+ if (anchor === "Week") return Math.floor((Math.floor(time / DAY_MS4) + 3) / 7);
49183
49226
  if (anchor === "Month" || anchor === "Quarter" || anchor === "Year") {
49184
49227
  const d = new Date(time);
49185
49228
  if (anchor === "Year") return d.getUTCFullYear();
49186
49229
  if (anchor === "Quarter") return d.getUTCFullYear() * 4 + Math.floor(d.getUTCMonth() / 3);
49187
49230
  return d.getUTCFullYear() * 12 + d.getUTCMonth();
49188
49231
  }
49189
- return Math.floor(time / DAY_MS3);
49232
+ return Math.floor(time / DAY_MS4);
49190
49233
  }
49191
49234
  function barInterval(bars) {
49192
49235
  if (bars.length < 2) return 0;
@@ -49288,7 +49331,7 @@ var vwap = {
49288
49331
  const anchor = str3(inputs, "anchor", "Session");
49289
49332
  const src = sourceValues(bars, str3(inputs, "source", "HLC3"));
49290
49333
  const n = bars.length;
49291
- const hidden = bool(inputs, "hideDwm", true) && barInterval(bars) >= DAY_MS3;
49334
+ const hidden = bool(inputs, "hideDwm", true) && barInterval(bars) >= DAY_MS4;
49292
49335
  const values = new Array(n).fill(Number.NaN);
49293
49336
  const bands = VWAP_BANDS.filter((b) => bool(inputs, b.show, b.defOn)).map((b) => ({
49294
49337
  mult: Math.max(0, num3(inputs, b.mult, b.defMult)),
@@ -49362,7 +49405,7 @@ var pivotPoints = {
49362
49405
  compute: (bars, inputs) => {
49363
49406
  const interval = barInterval(bars);
49364
49407
  const requested = str3(inputs, "anchor", PIVOT_AUTO);
49365
- const auto = interval <= 15 * 6e4 ? "Session" : interval < DAY_MS3 ? "Week" : interval <= DAY_MS3 ? "Month" : "Year";
49408
+ const auto = interval <= 15 * 6e4 ? "Session" : interval < DAY_MS4 ? "Week" : interval <= DAY_MS4 ? "Month" : "Year";
49366
49409
  const anchor = requested === "Daily" ? "Session" : requested === "Weekly" ? "Week" : requested === "Monthly" ? "Month" : requested === "Yearly" ? "Year" : auto;
49367
49410
  const kind = str3(inputs, "kind", PIVOT_TRADITIONAL);
49368
49411
  const aggs = /* @__PURE__ */ new Map();
@@ -49448,7 +49491,7 @@ var fiftyTwoWeek = {
49448
49491
  colorInput(NEUTRAL, msg("indicator.n52WeekHighLow.allTimeColor", "All-Time High/Low"), "allTimeColor", msg("indicator.n52WeekHighLow.allTimeColor.tooltip", "Color of the all-time high and all-time low levels."))
49449
49492
  ],
49450
49493
  compute: (bars, inputs) => {
49451
- const span = num3(inputs, "weeks", 52) * 7 * DAY_MS3;
49494
+ const span = num3(inputs, "weeks", 52) * 7 * DAY_MS4;
49452
49495
  const n = bars.length;
49453
49496
  const hi = new Array(n).fill(Number.NaN);
49454
49497
  const lo = new Array(n).fill(Number.NaN);
@@ -50635,7 +50678,7 @@ var Statusline = class {
50635
50678
  };
50636
50679
 
50637
50680
  // src/widget/session-shading.ts
50638
- var DAY_MS4 = 864e5;
50681
+ var DAY_MS5 = 864e5;
50639
50682
  var MINUTE_MS = 6e4;
50640
50683
  function parseWindow(text, allowOvernight = false) {
50641
50684
  if (typeof text !== "string") return null;
@@ -50714,7 +50757,7 @@ function expandSessionZones(spec, from, to) {
50714
50757
  const dtf = civilFormatter(spec.timezone);
50715
50758
  if (!dtf || !Number.isFinite(from) || !Number.isFinite(to)) return { pre, post, extended };
50716
50759
  const seen = /* @__PURE__ */ new Set();
50717
- for (let cursor = from - DAY_MS4; cursor < to + DAY_MS4; cursor += DAY_MS4) {
50760
+ for (let cursor = from - DAY_MS5; cursor < to + DAY_MS5; cursor += DAY_MS5) {
50718
50761
  const civil = civilParts(dtf, cursor);
50719
50762
  const key = civil.year * 1e4 + civil.month * 100 + civil.day;
50720
50763
  if (!Number.isFinite(key) || seen.has(key)) continue;
@@ -50739,7 +50782,7 @@ function expandSessionZones(spec, from, to) {
50739
50782
  }
50740
50783
  return { pre, post, extended: mergeAbutting(extended) };
50741
50784
  }
50742
- var COVER_PAD_MIN_MS = 2 * DAY_MS4;
50785
+ var COVER_PAD_MIN_MS = 2 * DAY_MS5;
50743
50786
  var SessionShadingTracker = class {
50744
50787
  constructor(onZones) {
50745
50788
  this.onZones = onZones;
@@ -50763,7 +50806,7 @@ var SessionShadingTracker = class {
50763
50806
  this.covered = null;
50764
50807
  this.session = opts.session;
50765
50808
  const tfMs = timeframeMs(opts.timeframe);
50766
- this.intraday = Number.isFinite(tfMs) && tfMs < DAY_MS4;
50809
+ this.intraday = Number.isFinite(tfMs) && tfMs < DAY_MS5;
50767
50810
  this.lastRange = opts.range;
50768
50811
  void data.symbolInfo(symbol).catch(() => void 0).then((si) => {
50769
50812
  if (my !== this.epoch) return;
@@ -51325,6 +51368,7 @@ var ChartContextMenu = class {
51325
51368
  const pane = this.lastPane;
51326
51369
  return priceAxisItems({
51327
51370
  auto: this.chart?.renderer.get("autoScale") !== false,
51371
+ priceOnly: priceOnlyState(pane, this.flag("scalePriceOnly")),
51328
51372
  invert: pane ? pane.invert : this.flag("invertScale"),
51329
51373
  choice: scaleChoiceOf(pane ?? { mode: String(this.chart?.renderer.get("scaleMode") ?? "price"), log: this.flag("logScale") }),
51330
51374
  axisLabels: this.flag("axisLabels"),
@@ -51363,6 +51407,8 @@ var ChartContextMenu = class {
51363
51407
  else chart.renderer.set("timezone", resolveTimezone(zone, void 0));
51364
51408
  } else if (id === "auto") {
51365
51409
  chart.renderer.set("autoScale", chart.renderer.get("autoScale") === false);
51410
+ } else if (id === "price-only") {
51411
+ chart.renderer.set("scalePriceOnly", !this.flag("scalePriceOnly"));
51366
51412
  } else if (id === "invert") {
51367
51413
  const pane = this.lastPane;
51368
51414
  const [feature, value] = invertWrite(!(pane ? pane.invert : this.flag("invertScale")), pane);
@@ -51513,6 +51559,9 @@ function instanceDeltas(handle) {
51513
51559
  const props = inputDeltas(handle.props, handle.propValues());
51514
51560
  return inputs || props ? { ...inputs ? { inputs } : {}, ...props ? { props } : {} } : void 0;
51515
51561
  }
51562
+ function statuslinePartEntries(parts) {
51563
+ return Object.entries(parts ?? {}).filter((e) => typeof e[1] === "boolean");
51564
+ }
51516
51565
  function nativeAliases(type, i18n) {
51517
51566
  const entry = nativeIndicatorEntry(type);
51518
51567
  if (!entry) return {};
@@ -51688,6 +51737,7 @@ var ChartCell = class {
51688
51737
  this.inner.on("replay:end", () => this.watermark?.setReplaying(false));
51689
51738
  this.statusline = deps.statusline ? new Statusline(this.host, symbol ?? "", (sym) => this.inner?.data.symbolIcon(sym)) : null;
51690
51739
  this.statusline?.setMeta(seed.timeframe ?? "60", this.state.provider ?? "");
51740
+ for (const [part, visible] of statuslinePartEntries(seed.statuslineParts)) this.statusline?.setPartVisible(part, visible);
51691
51741
  this.statusline?.onChart(this.inner);
51692
51742
  this.statusline?.attachMenu({
51693
51743
  setPart: (part, visible) => this.setStatuslinePart(part, visible),
@@ -52100,6 +52150,7 @@ var ChartCell = class {
52100
52150
  /** Show/hide one status-line segment (the settings dialog's Status line tab). */
52101
52151
  setStatuslinePart(part, visible) {
52102
52152
  this.statusline?.setPartVisible(part, visible);
52153
+ this.deps.onStateDirty();
52103
52154
  this.deps.onStatusPrefsChanged(this.id);
52104
52155
  }
52105
52156
  /** This cell's Status line tab and watermark prefs as one bundle (see {@link CellStatusPrefs}). */
@@ -52582,6 +52633,9 @@ var ChartCell = class {
52582
52633
  if (cs.replayWatermark !== void 0 && cs.replayWatermark !== this.replayWatermarkOn) this.setReplayWatermarkVisible(cs.replayWatermark);
52583
52634
  if (cs.indicatorTitles !== void 0 && cs.indicatorTitles !== this.indicatorTitlesOn) this.setIndicatorTitlesVisible(cs.indicatorTitles);
52584
52635
  if (cs.indicatorValues !== void 0 && cs.indicatorValues !== this.indicatorValuesOn) this.setIndicatorValuesVisible(cs.indicatorValues);
52636
+ for (const [part, visible] of statuslinePartEntries(cs.statuslineParts)) {
52637
+ if (this.statusline && this.statusline.partVisible(part) !== visible) this.setStatuslinePart(part, visible);
52638
+ }
52585
52639
  if (cs.rendererConfig != null) this.inner.renderer.applyConfig(cs.rendererConfig);
52586
52640
  if (cs.drawings != null) this.inner.drawings.fromJSON(cs.drawings);
52587
52641
  if (cs.indicators) this.applyIndicatorLedger(cs.indicators);
@@ -52609,6 +52663,7 @@ var ChartCell = class {
52609
52663
  dehydrate() {
52610
52664
  const live = this.inner?.market;
52611
52665
  const ext = this.inner ? this.dehydrateExt() : Object.keys(this.extState).length > 0 ? { ...this.extState } : void 0;
52666
+ const statuslineParts = this.statusPrefs().parts;
52612
52667
  return {
52613
52668
  ...this.state,
52614
52669
  ...live ? { symbol: live.symbol, provider: live.provider, timeframe: live.timeframe } : {},
@@ -52617,6 +52672,7 @@ var ChartCell = class {
52617
52672
  replayWatermark: this.replayWatermarkOn,
52618
52673
  indicatorTitles: this.indicatorTitlesOn,
52619
52674
  indicatorValues: this.indicatorValuesOn,
52675
+ ...statuslineParts ? { statuslineParts } : {},
52620
52676
  rendererConfig: this.inner?.renderer.getConfig() ?? void 0,
52621
52677
  drawings: this.inner ? this.inner.drawings.toJSON() : void 0,
52622
52678
  // Natives from the chart's SYNC registry read — an async catalog mirror here
@@ -1,10 +1,10 @@
1
- import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-CpegHml_.cjs';
2
- import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-pGs3Xvp-.cjs';
3
- export { g as ChartState, D as DrawingToolsState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-pGs3Xvp-.cjs';
4
- import { K as KeymapManager } from './keymap-B9_FLhfJ.cjs';
5
- import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-CpCJisTC.cjs';
6
- import { b as LocalizationOptions, M as MessageLike, T as Translator, c as LocaleChangedEvent } from './types-BlrXRLIR.cjs';
7
- import { M as MarketDataFeed } from './DataProvider-zJGp58kb.cjs';
1
+ import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-I1H2HDWw.cjs';
2
+ import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-CwYMw_Yl.cjs';
3
+ export { g as ChartState, D as DrawingToolsState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-CwYMw_Yl.cjs';
4
+ import { K as KeymapManager } from './keymap-W0hiajU6.cjs';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-BiF6lVvJ.cjs';
6
+ import { b as LocalizationOptions, M as MessageLike, T as Translator, c as LocaleChangedEvent } from './types-Bwf63xGI.cjs';
7
+ import { M as MarketDataFeed } from './DataProvider-B5i0_yY4.cjs';
8
8
 
9
9
  /** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
10
10
  declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
@@ -1,10 +1,10 @@
1
- import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-D4L3_hv_.js';
2
- import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-C3yIY9WE.js';
3
- export { g as ChartState, D as DrawingToolsState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-C3yIY9WE.js';
4
- import { K as KeymapManager } from './keymap-UolhuXH1.js';
5
- import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-BjefWpxQ.js';
6
- import { b as LocalizationOptions, M as MessageLike, T as Translator, c as LocaleChangedEvent } from './types-BlrXRLIR.js';
7
- import { M as MarketDataFeed } from './DataProvider-BGlB1zSc.js';
1
+ import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-B7aL1pbf.js';
2
+ import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-ny7GXRuS.js';
3
+ export { g as ChartState, D as DrawingToolsState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-ny7GXRuS.js';
4
+ import { K as KeymapManager } from './keymap-C48ughm6.js';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-BDx47Vk0.js';
6
+ import { b as LocalizationOptions, M as MessageLike, T as Translator, c as LocaleChangedEvent } from './types-Bwf63xGI.js';
7
+ import { M as MarketDataFeed } from './DataProvider-CPFgSyAm.js';
8
8
 
9
9
  /** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
10
10
  declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
package/dist/workspace.js CHANGED
@@ -1,6 +1,6 @@
1
- export { ChartCell, GRID_PICKER_MAX, VelaWorkspace, WorkspaceReplay, activeAfterLayout, barClose, decodeState, encodeState, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, sanitizeState, syncTargets, trackOffsets, unregisterLayout } from './chunk-4WAHYL7Y.js';
2
- import './chunk-XIRSR3D6.js';
3
- import './chunk-YRCL3WMD.js';
1
+ export { ChartCell, GRID_PICKER_MAX, VelaWorkspace, WorkspaceReplay, activeAfterLayout, barClose, decodeState, encodeState, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, sanitizeState, syncTargets, trackOffsets, unregisterLayout } from './chunk-4AMWSBOW.js';
2
+ import './chunk-W4WTHJFA.js';
3
+ import './chunk-Q7POFYNE.js';
4
4
  import './chunk-WHPQQYH7.js';
5
5
  import './chunk-PZN4RS4T.js';
6
6
  import './chunk-O6L27KRB.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxalgo/vela",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "The open-source core of Vela by LuxAlgo: a charting library with a native high-performance renderer, drawing tools, pluggable chart types and pluggable scripting engines.",
5
5
  "keywords": [
6
6
  "charting library",