@forgecharts/sdk 1.5.47 → 1.5.49

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.
@@ -1,9 +1,3 @@
1
- /**
2
- * ChartContextMenu — right-click context menu for the chart canvas.
3
- *
4
- * Placed at fixed (x, y) on screen. Clicking outside dismisses it via the
5
- * transparent backdrop. The parent is responsible for calling onClose.
6
- */
7
1
  type Props = {
8
2
  x: number;
9
3
  y: number;
@@ -13,6 +7,6 @@ type Props = {
13
7
  onClearIndicators: () => void;
14
8
  onResetView: () => void;
15
9
  };
16
- export declare function ChartContextMenu({ x, y, onClose, onSettings, onClearDrawings, onClearIndicators, onResetView, }: Props): import("react").JSX.Element;
10
+ export declare function ChartContextMenu({ x, y, onClose, onSettings, onClearDrawings, onClearIndicators, onResetView, }: Props): import("react").ReactPortal | null;
17
11
  export {};
18
12
  //# sourceMappingURL=ChartContextMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartContextMenu.d.ts","sourceRoot":"","sources":["../../../src/react/canvas/ChartContextMenu.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,CAAC,EACD,CAAC,EACD,OAAO,EACP,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,WAAW,GACZ,EAAE,KAAK,+BAkCP"}
1
+ {"version":3,"file":"ChartContextMenu.d.ts","sourceRoot":"","sources":["../../../src/react/canvas/ChartContextMenu.tsx"],"names":[],"mappings":"AAiBA,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,CAAC,EACD,CAAC,EACD,OAAO,EACP,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,WAAW,GACZ,EAAE,KAAK,sCAqCP"}
@@ -1,7 +1,7 @@
1
1
  import React11, { forwardRef, useRef, useState, useEffect, useImperativeHandle, useCallback, createContext, useMemo, useContext, useReducer } from 'react';
2
2
  import { TextStyle, Application, Container, Graphics, Text, FillGradient, CanvasTextMetrics } from 'pixi.js';
3
3
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
- import ReactDOM from 'react-dom';
4
+ import ReactDOM, { createPortal } from 'react-dom';
5
5
 
6
6
  // src/react/canvas/ChartCanvas.tsx
7
7
 
@@ -10288,6 +10288,7 @@ function toOHLCV(bar) {
10288
10288
  function _historyWindow(tf) {
10289
10289
  return 500 * (parseTfSeconds(tf) ?? 3600);
10290
10290
  }
10291
+ var BATCH_SUPPRESSION_MS = 1e4;
10291
10292
  function _pageSize(tf) {
10292
10293
  return 500 * (parseTfSeconds(tf) ?? 3600);
10293
10294
  }
@@ -10323,7 +10324,8 @@ var DatafeedConnector = class {
10323
10324
  */
10324
10325
  _emptyPageStreak = 0;
10325
10326
  /**
10326
- * Safety timer: clears `batchPending` if bar_batch never arrives within 60 s.
10327
+ * Safety timer: clears `batchPending` if bar_batch never arrives, so live
10328
+ * ticks resume. It no longer gates the chart reveal.
10327
10329
  * Prevents the chart from staying blank when a provider doesn't fire onHistoricalReady.
10328
10330
  */
10329
10331
  _batchSafetyTimer = null;
@@ -10398,9 +10400,7 @@ var DatafeedConnector = class {
10398
10400
  loadedFired = true;
10399
10401
  this._cb.onLoaded(symbol, timeframe, engine.getBars().length);
10400
10402
  };
10401
- if (lastBarTime == null) {
10402
- fireLoaded();
10403
- }
10403
+ fireLoaded();
10404
10404
  const prefetchTo = from;
10405
10405
  const prefetchFrom = from - _pageSize(timeframe);
10406
10406
  void this._datafeed.getHistoricalBars(symbol, timeframe, prefetchFrom, prefetchTo - 1).then(({ bars: prefetchedBars }) => {
@@ -10414,8 +10414,7 @@ var DatafeedConnector = class {
10414
10414
  this._batchSafetyTimer = setTimeout(() => {
10415
10415
  batchPending = false;
10416
10416
  this._batchSafetyTimer = null;
10417
- fireLoaded();
10418
- }, 6e4);
10417
+ }, BATCH_SUPPRESSION_MS);
10419
10418
  }
10420
10419
  this._datafeed.subscribeBars(symbol, timeframe, (bar) => {
10421
10420
  if (this._activeUID === uid) {
@@ -18031,7 +18030,7 @@ var DEMONSTRATION_STROKE = "rgba(255, 200, 50, 0.7)";
18031
18030
  var DEMONSTRATION_COLOR = "var(--crosshair-overlay, rgba(255,255,255,0.75))";
18032
18031
 
18033
18032
  // src/version.ts
18034
- var FORGECHARTS_VERSION = "1.5.47" ;
18033
+ var FORGECHARTS_VERSION = "1.5.49" ;
18035
18034
  function applyRuntimeConfig(caps, config) {
18036
18035
  if (!config) return caps;
18037
18036
  const orderEntry = config.enableOrderEntry === false ? false : caps.orderEntry;
@@ -21005,60 +21004,64 @@ function ChartContextMenu({
21005
21004
  onClearIndicators,
21006
21005
  onResetView
21007
21006
  }) {
21008
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21009
- /* @__PURE__ */ jsx("div", { className: "chart-ctx-backdrop", onClick: onClose, onContextMenu: (e) => {
21010
- e.preventDefault();
21011
- onClose();
21012
- } }),
21013
- /* @__PURE__ */ jsxs("div", { className: "chart-ctx-menu", style: { left: x, top: y }, children: [
21014
- /* @__PURE__ */ jsx(
21015
- "button",
21016
- {
21017
- className: "chart-ctx-item",
21018
- onClick: () => {
21019
- onSettings();
21020
- onClose();
21021
- },
21022
- children: "Settings\u2026"
21023
- }
21024
- ),
21025
- /* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
21026
- /* @__PURE__ */ jsx(
21027
- "button",
21028
- {
21029
- className: "chart-ctx-item",
21030
- onClick: () => {
21031
- onResetView();
21032
- onClose();
21033
- },
21034
- children: "Reset Chart View"
21035
- }
21036
- ),
21037
- /* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
21038
- /* @__PURE__ */ jsx(
21039
- "button",
21040
- {
21041
- className: "chart-ctx-item chart-ctx-item--danger",
21042
- onClick: () => {
21043
- onClearIndicators();
21044
- onClose();
21045
- },
21046
- children: "Clear Indicators"
21047
- }
21048
- ),
21049
- /* @__PURE__ */ jsx(
21050
- "button",
21051
- {
21052
- className: "chart-ctx-item chart-ctx-item--danger",
21053
- onClick: () => {
21054
- onClearDrawings();
21055
- onClose();
21056
- },
21057
- children: "Clear Drawings"
21058
- }
21059
- )
21060
- ] })
21061
- ] });
21007
+ if (typeof document === "undefined") return null;
21008
+ return createPortal(
21009
+ /* @__PURE__ */ jsxs(Fragment, { children: [
21010
+ /* @__PURE__ */ jsx("div", { className: "chart-ctx-backdrop", onClick: onClose, onContextMenu: (e) => {
21011
+ e.preventDefault();
21012
+ onClose();
21013
+ } }),
21014
+ /* @__PURE__ */ jsxs("div", { className: "chart-ctx-menu", style: { left: x, top: y }, children: [
21015
+ /* @__PURE__ */ jsx(
21016
+ "button",
21017
+ {
21018
+ className: "chart-ctx-item",
21019
+ onClick: () => {
21020
+ onSettings();
21021
+ onClose();
21022
+ },
21023
+ children: "Settings\u2026"
21024
+ }
21025
+ ),
21026
+ /* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
21027
+ /* @__PURE__ */ jsx(
21028
+ "button",
21029
+ {
21030
+ className: "chart-ctx-item",
21031
+ onClick: () => {
21032
+ onResetView();
21033
+ onClose();
21034
+ },
21035
+ children: "Reset Chart View"
21036
+ }
21037
+ ),
21038
+ /* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
21039
+ /* @__PURE__ */ jsx(
21040
+ "button",
21041
+ {
21042
+ className: "chart-ctx-item chart-ctx-item--danger",
21043
+ onClick: () => {
21044
+ onClearIndicators();
21045
+ onClose();
21046
+ },
21047
+ children: "Clear Indicators"
21048
+ }
21049
+ ),
21050
+ /* @__PURE__ */ jsx(
21051
+ "button",
21052
+ {
21053
+ className: "chart-ctx-item chart-ctx-item--danger",
21054
+ onClick: () => {
21055
+ onClearDrawings();
21056
+ onClose();
21057
+ },
21058
+ children: "Clear Drawings"
21059
+ }
21060
+ )
21061
+ ] })
21062
+ ] }),
21063
+ document.body
21064
+ );
21062
21065
  }
21063
21066
  var SECTIONS = [
21064
21067
  { id: "symbol", label: "Symbol", icon: "\u{1D446}" },