acttrader-charts 1.3.0-beta.3 → 1.3.0-beta.5

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/index.cjs CHANGED
@@ -16914,19 +16914,12 @@ var TradeButton = class {
16914
16914
 
16915
16915
  // src/ui/TradePopover.ts
16916
16916
  var TradePopover = class {
16917
- constructor(theme, lots, symbol, onDraftCreate, labels = DEFAULT_LABELS.trade, onVisibilityChange, adaptiveText = false) {
16917
+ constructor(theme, lots, symbol, onDraftCreate, labels = DEFAULT_LABELS.trade, onVisibilityChange, _adaptiveText = false) {
16918
16918
  this._price = 0;
16919
16919
  this._pricePrecision = 2;
16920
16920
  this._buyOrderType = "limit";
16921
16921
  this._sellOrderType = "limit";
16922
16922
  this._compact = false;
16923
- /**
16924
- * Use the theme's adaptive tooltip text color for the price/lots text instead
16925
- * of a hardcoded white. Opt-in (hanko3.0 mobile header only) so the white-on-
16926
- * white light-theme fix has zero effect on any other broker/white-label, which
16927
- * keep the original pure-white text.
16928
- */
16929
- this._adaptiveText = false;
16930
16923
  this.onDocMouseDown = (e) => {
16931
16924
  if (this.isVisible && !this.el.contains(e.target)) {
16932
16925
  this.hide();
@@ -16938,7 +16931,6 @@ var TradePopover = class {
16938
16931
  this.onDraftCreate = onDraftCreate;
16939
16932
  this.labels = labels;
16940
16933
  this.onVisibilityChange = onVisibilityChange;
16941
- this._adaptiveText = adaptiveText;
16942
16934
  this.el = document.createElement("div");
16943
16935
  Object.assign(this.el.style, {
16944
16936
  position: "absolute",
@@ -17036,11 +17028,11 @@ var TradePopover = class {
17036
17028
  Object.assign(colored.style, { color, fontWeight: "600" });
17037
17029
  const plain = document.createElement("span");
17038
17030
  plain.textContent = ` ${this.lots} ${this.symbol} ${this.labels.at} ${priceStr}`;
17039
- const plainColor = this._adaptiveText ? this.theme.tooltip.text : "#ffffff";
17031
+ const plainColor = this.theme.tooltip.text;
17040
17032
  Object.assign(plain.style, { color: plainColor, fontWeight: "400" });
17041
17033
  btn.append(colored, plain);
17042
17034
  btn.addEventListener("mouseenter", () => {
17043
- btn.style.background = "rgba(255,255,255,0.06)";
17035
+ btn.style.background = this.theme.ui.accentBg;
17044
17036
  });
17045
17037
  btn.addEventListener("mouseleave", () => {
17046
17038
  btn.style.background = "transparent";
@@ -22690,6 +22682,9 @@ var _ChartEngine = class _ChartEngine {
22690
22682
  this.PRICE_AXIS_COUNTDOWN_LS_KEY = "finchart.showPriceAxisCountdown";
22691
22683
  this.loadingOverlayEl = null;
22692
22684
  this.noDataOverlayEl = null;
22685
+ /** Label pills inside the two overlays — painted by `applyOverlayLabelStyles()`. */
22686
+ this.loadingLabelEl = null;
22687
+ this.noDataLabelEl = null;
22693
22688
  // Watermark
22694
22689
  this.logoImage = null;
22695
22690
  // ── State persistence ─────────────────────────────────────────────────────
@@ -24231,12 +24226,11 @@ var _ChartEngine = class _ChartEngine {
24231
24226
  const loadingLabel = document.createElement("span");
24232
24227
  loadingLabel.textContent = this.labels.chart.loading;
24233
24228
  Object.assign(loadingLabel.style, {
24234
- color: "rgba(200,200,200,0.9)",
24235
24229
  fontSize: "13px",
24236
- background: "rgba(0,0,0,0.45)",
24237
24230
  padding: "4px 12px",
24238
24231
  borderRadius: "4px"
24239
24232
  });
24233
+ this.loadingLabelEl = loadingLabel;
24240
24234
  this.loadingOverlayEl.appendChild(loadingLabel);
24241
24235
  this.canvasWrap.appendChild(this.loadingOverlayEl);
24242
24236
  this.noDataOverlayEl = document.createElement("div");
@@ -24255,13 +24249,13 @@ var _ChartEngine = class _ChartEngine {
24255
24249
  const noDataLabel = document.createElement("span");
24256
24250
  noDataLabel.textContent = this.labels.chart.noData;
24257
24251
  Object.assign(noDataLabel.style, {
24258
- color: "rgba(200,200,200,0.9)",
24259
24252
  fontSize: "13px",
24260
- background: "rgba(0,0,0,0.45)",
24261
24253
  padding: "4px 12px",
24262
24254
  borderRadius: "4px"
24263
24255
  });
24256
+ this.noDataLabelEl = noDataLabel;
24264
24257
  this.noDataOverlayEl.appendChild(noDataLabel);
24258
+ this.applyOverlayLabelStyles();
24265
24259
  this.canvasWrap.appendChild(this.noDataOverlayEl);
24266
24260
  }
24267
24261
  if (showUI && !(hideSymbolAndTick && hideOHLCV)) {
@@ -25256,10 +25250,14 @@ var _ChartEngine = class _ChartEngine {
25256
25250
  this.applyScrollToEndBtnStyles();
25257
25251
  this.applyResetViewBtnStyles();
25258
25252
  this.applyMobileDrawingFlyoutTheme();
25259
- if (this.siSymbolSpan) this.siSymbolSpan.style.color = this.theme.axisText;
25260
- if (this.siStreamDot) this.siStreamDot.style.background = this.theme.ui.stream.disconnected;
25253
+ if (this.siSymbolSpan) this.siSymbolSpan.style.color = this.theme.tooltip.text;
25254
+ if (this.siStreamDot) this.siStreamDot.style.background = this.theme.ui.stream[this.streamStatus];
25255
+ this.applyOverlayLabelStyles();
25261
25256
  this.compareLegend?.setTheme(this.theme);
25262
25257
  this.comparePickerModal?.setTheme(this.theme);
25258
+ this.indicatorOverlay?.setTheme(this.theme);
25259
+ for (const overlay of this.subPaneOverlays.values()) overlay.setTheme(this.theme);
25260
+ this.isinPickerModal?.setTheme(this.theme);
25263
25261
  this.scheduleRender();
25264
25262
  this.emitStateChange();
25265
25263
  return this;
@@ -29086,6 +29084,22 @@ var _ChartEngine = class _ChartEngine {
29086
29084
  this.resetPriceAxis();
29087
29085
  this.resetTimeAxis();
29088
29086
  }
29087
+ /**
29088
+ * Paints the "Loading…" / "No data available" pills from the theme. They used
29089
+ * to be a hardcoded dark scrim with pale grey text, which read as a black box
29090
+ * on the light theme; they now track `tooltip` like every other floating
29091
+ * label and are repainted on `setTheme`.
29092
+ */
29093
+ applyOverlayLabelStyles() {
29094
+ for (const el of [this.loadingLabelEl, this.noDataLabelEl]) {
29095
+ if (!el) continue;
29096
+ Object.assign(el.style, {
29097
+ color: this.theme.tooltip.text,
29098
+ background: this.theme.tooltip.background,
29099
+ border: `1px solid ${this.theme.tooltip.border}`
29100
+ });
29101
+ }
29102
+ }
29089
29103
  applyResetViewBtnStyles() {
29090
29104
  if (!this.resetViewBtn) return;
29091
29105
  this.resetViewBtn.innerHTML = iconResetView(this.theme.axisText, 16);