@forgecharts/sdk 1.5.46 → 1.5.48

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
 
@@ -18029,6 +18029,9 @@ var DEMONSTRATION_RADIUS = 44;
18029
18029
  var DEMONSTRATION_FILL = "rgba(255, 200, 50, 0.18)";
18030
18030
  var DEMONSTRATION_STROKE = "rgba(255, 200, 50, 0.7)";
18031
18031
  var DEMONSTRATION_COLOR = "var(--crosshair-overlay, rgba(255,255,255,0.75))";
18032
+
18033
+ // src/version.ts
18034
+ var FORGECHARTS_VERSION = "1.5.48" ;
18032
18035
  function applyRuntimeConfig(caps, config) {
18033
18036
  if (!config) return caps;
18034
18037
  const orderEntry = config.enableOrderEntry === false ? false : caps.orderEntry;
@@ -21002,60 +21005,64 @@ function ChartContextMenu({
21002
21005
  onClearIndicators,
21003
21006
  onResetView
21004
21007
  }) {
21005
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21006
- /* @__PURE__ */ jsx("div", { className: "chart-ctx-backdrop", onClick: onClose, onContextMenu: (e) => {
21007
- e.preventDefault();
21008
- onClose();
21009
- } }),
21010
- /* @__PURE__ */ jsxs("div", { className: "chart-ctx-menu", style: { left: x, top: y }, children: [
21011
- /* @__PURE__ */ jsx(
21012
- "button",
21013
- {
21014
- className: "chart-ctx-item",
21015
- onClick: () => {
21016
- onSettings();
21017
- onClose();
21018
- },
21019
- children: "Settings\u2026"
21020
- }
21021
- ),
21022
- /* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
21023
- /* @__PURE__ */ jsx(
21024
- "button",
21025
- {
21026
- className: "chart-ctx-item",
21027
- onClick: () => {
21028
- onResetView();
21029
- onClose();
21030
- },
21031
- children: "Reset Chart View"
21032
- }
21033
- ),
21034
- /* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
21035
- /* @__PURE__ */ jsx(
21036
- "button",
21037
- {
21038
- className: "chart-ctx-item chart-ctx-item--danger",
21039
- onClick: () => {
21040
- onClearIndicators();
21041
- onClose();
21042
- },
21043
- children: "Clear Indicators"
21044
- }
21045
- ),
21046
- /* @__PURE__ */ jsx(
21047
- "button",
21048
- {
21049
- className: "chart-ctx-item chart-ctx-item--danger",
21050
- onClick: () => {
21051
- onClearDrawings();
21052
- onClose();
21053
- },
21054
- children: "Clear Drawings"
21055
- }
21056
- )
21057
- ] })
21058
- ] });
21008
+ if (typeof document === "undefined") return null;
21009
+ return createPortal(
21010
+ /* @__PURE__ */ jsxs(Fragment, { children: [
21011
+ /* @__PURE__ */ jsx("div", { className: "chart-ctx-backdrop", onClick: onClose, onContextMenu: (e) => {
21012
+ e.preventDefault();
21013
+ onClose();
21014
+ } }),
21015
+ /* @__PURE__ */ jsxs("div", { className: "chart-ctx-menu", style: { left: x, top: y }, children: [
21016
+ /* @__PURE__ */ jsx(
21017
+ "button",
21018
+ {
21019
+ className: "chart-ctx-item",
21020
+ onClick: () => {
21021
+ onSettings();
21022
+ onClose();
21023
+ },
21024
+ children: "Settings\u2026"
21025
+ }
21026
+ ),
21027
+ /* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
21028
+ /* @__PURE__ */ jsx(
21029
+ "button",
21030
+ {
21031
+ className: "chart-ctx-item",
21032
+ onClick: () => {
21033
+ onResetView();
21034
+ onClose();
21035
+ },
21036
+ children: "Reset Chart View"
21037
+ }
21038
+ ),
21039
+ /* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
21040
+ /* @__PURE__ */ jsx(
21041
+ "button",
21042
+ {
21043
+ className: "chart-ctx-item chart-ctx-item--danger",
21044
+ onClick: () => {
21045
+ onClearIndicators();
21046
+ onClose();
21047
+ },
21048
+ children: "Clear Indicators"
21049
+ }
21050
+ ),
21051
+ /* @__PURE__ */ jsx(
21052
+ "button",
21053
+ {
21054
+ className: "chart-ctx-item chart-ctx-item--danger",
21055
+ onClick: () => {
21056
+ onClearDrawings();
21057
+ onClose();
21058
+ },
21059
+ children: "Clear Drawings"
21060
+ }
21061
+ )
21062
+ ] })
21063
+ ] }),
21064
+ document.body
21065
+ );
21059
21066
  }
21060
21067
  var SECTIONS = [
21061
21068
  { id: "symbol", label: "Symbol", icon: "\u{1D446}" },
@@ -26714,9 +26721,6 @@ function _guessFrontMonth(product, months) {
26714
26721
  }
26715
26722
  return `${product}${months[0]}${currentYear + 1}`;
26716
26723
  }
26717
-
26718
- // src/version.ts
26719
- var FORGECHARTS_VERSION = "1.5.46" ;
26720
26724
  var TIMEZONE_OPTIONS = [
26721
26725
  { label: "UTC", value: "UTC" },
26722
26726
  { label: "Exchange", value: "exchange" },