@forgecharts/sdk 1.5.24 → 1.5.26
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/forgecharts.css +13 -0
- package/dist/index.js +56 -24
- package/dist/index.js.map +1 -1
- package/dist/internal.js +56 -24
- package/dist/internal.js.map +1 -1
- package/dist/pixi/PixiTradingRenderer.d.ts +7 -1
- package/dist/pixi/PixiTradingRenderer.d.ts.map +1 -1
- package/dist/react/canvas/ChartCanvas.d.ts.map +1 -1
- package/dist/react/index.js +70 -24
- package/dist/react/index.js.map +1 -1
- package/dist/react/internal.js +70 -24
- package/dist/react/internal.js.map +1 -1
- package/dist/react/workspace/toolbars/BottomToolbar.d.ts.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/forgecharts.css
CHANGED
|
@@ -1554,6 +1554,19 @@ select {
|
|
|
1554
1554
|
position: relative;
|
|
1555
1555
|
}
|
|
1556
1556
|
|
|
1557
|
+
/* Build identity in the status bar. Muted and monospace so it reads as
|
|
1558
|
+
metadata rather than a control, and never competes with the toolbar
|
|
1559
|
+
buttons beside it. */
|
|
1560
|
+
.bottom-bar-version {
|
|
1561
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
1562
|
+
font-size: 10px;
|
|
1563
|
+
line-height: 1;
|
|
1564
|
+
padding: 0 6px 0 2px;
|
|
1565
|
+
opacity: 0.5;
|
|
1566
|
+
user-select: text;
|
|
1567
|
+
white-space: nowrap;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1557
1570
|
.bottom-bar-right {
|
|
1558
1571
|
display: flex;
|
|
1559
1572
|
align-items: center;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TextStyle, Application, Container, Graphics, Text, FillGradient, CanvasTextMetrics } from 'pixi.js';
|
|
2
|
-
import { forwardRef, useRef, useState,
|
|
2
|
+
import { forwardRef, useRef, useState, useEffect, useImperativeHandle, useCallback, createContext, useMemo, useContext } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
5
|
|
|
@@ -7931,9 +7931,6 @@ var PixiTradingRenderer = class {
|
|
|
7931
7931
|
} else {
|
|
7932
7932
|
this._lineGfx.moveTo(0, y).lineTo(plotWidth, y).stroke({ color, width: lineCrisp.width, alpha });
|
|
7933
7933
|
}
|
|
7934
|
-
if (isDraggableRole(order.role)) {
|
|
7935
|
-
this._drawDragHandle(plotWidth - 26, y, color, alpha);
|
|
7936
|
-
}
|
|
7937
7934
|
const boxY = y - LINE_H / 2;
|
|
7938
7935
|
const roleStr = orderRoleLabel(order.role);
|
|
7939
7936
|
const text = roleStr ? `${roleStr} ${order.qty}` : `${order.side.toUpperCase()} ${order.qty}`;
|
|
@@ -7942,6 +7939,9 @@ var PixiTradingRenderer = class {
|
|
|
7942
7939
|
const pillX = Math.max(0, plotWidth - LABEL_GAP - pillW);
|
|
7943
7940
|
this._boxGfx.roundRect(pillX, boxY, pillW, LINE_H, PILL_R).fill({ color, alpha });
|
|
7944
7941
|
labelIdx = this._drawLabel(text, pillX + pillW / 2, y, labelIdx, labelStyle, true);
|
|
7942
|
+
if (isDraggableRole(order.role)) {
|
|
7943
|
+
this._drawPillDragArrows(pillX + pillW / 2, boxY, color, alpha);
|
|
7944
|
+
}
|
|
7945
7945
|
this._boxGfx.rect(plotWidth, boxY, psWidth, LINE_H).fill({ color, alpha });
|
|
7946
7946
|
labelIdx = this._drawLabel(order.price.toFixed(2), plotWidth + 4, y, labelIdx, labelStyle);
|
|
7947
7947
|
if (isDraggableRole(order.role)) {
|
|
@@ -8073,12 +8073,19 @@ var PixiTradingRenderer = class {
|
|
|
8073
8073
|
* with an up and a down chevron, centred on the line. Signals "drag me
|
|
8074
8074
|
* vertically" the way TradingView's order-line handles do.
|
|
8075
8075
|
*/
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8076
|
+
/**
|
|
8077
|
+
* Up/down chevrons hugging a label pill, marking it draggable.
|
|
8078
|
+
*
|
|
8079
|
+
* Anchored to the pill rather than a fixed x so the affordance stays with
|
|
8080
|
+
* the label wherever it is laid out.
|
|
8081
|
+
*/
|
|
8082
|
+
_drawPillDragArrows(cx, boxY, color, alpha) {
|
|
8083
|
+
const s = 3.5;
|
|
8084
|
+
const gap = 2;
|
|
8085
|
+
const upBase = boxY - gap;
|
|
8086
|
+
this._boxGfx.poly([cx, upBase - s * 1.6, cx + s, upBase, cx - s, upBase]).fill({ color, alpha: alpha * 0.9 });
|
|
8087
|
+
const downBase = boxY + LINE_H + gap;
|
|
8088
|
+
this._boxGfx.poly([cx, downBase + s * 1.6, cx + s, downBase, cx - s, downBase]).fill({ color, alpha: alpha * 0.9 });
|
|
8082
8089
|
}
|
|
8083
8090
|
/** Draws or reuses a label at the given position and returns the next label index. */
|
|
8084
8091
|
_drawLabel(text, x, y, labelIdx, style, centered) {
|
|
@@ -23068,6 +23075,19 @@ var ChartCanvas = forwardRef(
|
|
|
23068
23075
|
);
|
|
23069
23076
|
const drawOverlayRef = useRef(null);
|
|
23070
23077
|
const [priceFraction, setPriceFraction] = useState(priceFractionProp ?? 0.6);
|
|
23078
|
+
const [effectiveTheme, setEffectiveTheme] = useState(theme);
|
|
23079
|
+
useEffect(() => {
|
|
23080
|
+
setEffectiveTheme(theme);
|
|
23081
|
+
}, [theme]);
|
|
23082
|
+
useEffect(() => {
|
|
23083
|
+
const chart = chartRef.current;
|
|
23084
|
+
if (!chart) return;
|
|
23085
|
+
const onThemeChanged = ({ theme: t }) => setEffectiveTheme(t);
|
|
23086
|
+
chart.on("themeChanged", onThemeChanged);
|
|
23087
|
+
return () => {
|
|
23088
|
+
chart.off?.("themeChanged", onThemeChanged);
|
|
23089
|
+
};
|
|
23090
|
+
}, [dataBlocked]);
|
|
23071
23091
|
const selectPointerToolRef = useRef(() => {
|
|
23072
23092
|
});
|
|
23073
23093
|
useImperativeHandle(ref, () => ({
|
|
@@ -24190,29 +24210,41 @@ var ChartCanvas = forwardRef(
|
|
|
24190
24210
|
},
|
|
24191
24211
|
children: [
|
|
24192
24212
|
/* @__PURE__ */ jsx(
|
|
24193
|
-
"
|
|
24213
|
+
"div",
|
|
24194
24214
|
{
|
|
24195
|
-
href: "https://forgecharts.com",
|
|
24196
|
-
target: "_blank",
|
|
24197
|
-
rel: "noopener noreferrer",
|
|
24198
24215
|
style: {
|
|
24199
24216
|
position: "absolute",
|
|
24200
24217
|
bottom: 38,
|
|
24201
24218
|
left: 6,
|
|
24202
24219
|
zIndex: 5,
|
|
24203
|
-
|
|
24220
|
+
display: "flex",
|
|
24221
|
+
flexDirection: "column",
|
|
24222
|
+
alignItems: "flex-start",
|
|
24223
|
+
gap: 1,
|
|
24224
|
+
// Never intercept clicks meant for the chart; the logo re-enables
|
|
24225
|
+
// pointer events on itself below.
|
|
24226
|
+
pointerEvents: "none"
|
|
24204
24227
|
},
|
|
24205
24228
|
children: /* @__PURE__ */ jsx(
|
|
24206
|
-
"
|
|
24229
|
+
"a",
|
|
24207
24230
|
{
|
|
24208
|
-
|
|
24209
|
-
|
|
24210
|
-
|
|
24211
|
-
|
|
24212
|
-
|
|
24213
|
-
|
|
24214
|
-
|
|
24215
|
-
|
|
24231
|
+
href: "https://forgecharts.com",
|
|
24232
|
+
target: "_blank",
|
|
24233
|
+
rel: "noopener noreferrer",
|
|
24234
|
+
style: { lineHeight: 0, pointerEvents: "auto" },
|
|
24235
|
+
children: /* @__PURE__ */ jsx(
|
|
24236
|
+
"img",
|
|
24237
|
+
{
|
|
24238
|
+
src: effectiveTheme === "light" ? logo_light_default : logo_dark_default,
|
|
24239
|
+
alt: "ForgeCharts",
|
|
24240
|
+
style: {
|
|
24241
|
+
height: 48,
|
|
24242
|
+
width: "auto",
|
|
24243
|
+
opacity: 0.55,
|
|
24244
|
+
userSelect: "none"
|
|
24245
|
+
}
|
|
24246
|
+
}
|
|
24247
|
+
)
|
|
24216
24248
|
}
|
|
24217
24249
|
)
|
|
24218
24250
|
}
|