@funnest/charts-ui 0.8.2 → 0.8.3
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/components/price-axis-plus.d.ts +9 -0
- package/dist/context.d.ts +22 -1
- package/dist/i18n.d.ts +2 -0
- package/dist/icons.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +131 -2
- package/dist/pane.d.ts +3 -1
- package/dist/trading-chart.d.ts +5 -1
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WidgetContext } from '../context.js';
|
|
2
|
+
/**
|
|
3
|
+
* The + at the right edge of the plot, on the crosshair's price (mouse only, like most chart
|
|
4
|
+
* sites): a menu of what to do at that price — the app's rows (`priceAxisActions`: an alert…)
|
|
5
|
+
* and a horizontal line. The button holds still while the pointer is on it or its menu is open.
|
|
6
|
+
*/
|
|
7
|
+
export declare function PriceAxisPlus({ ctx }: {
|
|
8
|
+
ctx: WidgetContext;
|
|
9
|
+
}): import("preact").JSX.Element | null;
|
package/dist/context.d.ts
CHANGED
|
@@ -60,13 +60,32 @@ export interface UiState {
|
|
|
60
60
|
export type ContextMenuItem = {
|
|
61
61
|
label: string;
|
|
62
62
|
shortcut?: string;
|
|
63
|
-
disabled?: boolean;
|
|
63
|
+
disabled?: boolean; /** 'alert': a bell before the label. */
|
|
64
|
+
icon?: 'alert';
|
|
64
65
|
onSelect(): void;
|
|
65
66
|
} | 'separator';
|
|
66
67
|
/** Extra right-click items for a click on `chart` (e.g. "create an alert at this price"). */
|
|
67
68
|
export type ContextMenuItems = (target: ChartContextMenu & {
|
|
68
69
|
chart: Chart;
|
|
69
70
|
}) => ContextMenuItem[];
|
|
71
|
+
/**
|
|
72
|
+
* Rows of the + menu on the price axis, at the crosshair's price (mouse only) — e.g. "이 가격에
|
|
73
|
+
* 알림 만들기". A horizontal line at that price is always offered after them.
|
|
74
|
+
*/
|
|
75
|
+
export type PriceAxisActions = (target: {
|
|
76
|
+
price: number;
|
|
77
|
+
chart: Chart;
|
|
78
|
+
}) => ContextMenuItem[];
|
|
79
|
+
/** A button an app adds to the bar of a selected drawing. `icon` 'alert' shows a bell (the label is its tooltip); without one, the label. */
|
|
80
|
+
export interface DrawingAction {
|
|
81
|
+
label: string;
|
|
82
|
+
icon?: 'alert';
|
|
83
|
+
/** On (e.g. the drawing already has an alert): drawn filled, and aria-pressed. */
|
|
84
|
+
pressed?: boolean;
|
|
85
|
+
onSelect(): void;
|
|
86
|
+
}
|
|
87
|
+
/** The app's buttons for the selected drawing (e.g. 알림 on a trend line), or none. */
|
|
88
|
+
export type DrawingActions = (drawing: Drawing, chart: Chart) => DrawingAction[];
|
|
70
89
|
/**
|
|
71
90
|
* A row an app adds to the 도구 (tools) menu, above 차트 설정 — e.g. its own display settings.
|
|
72
91
|
* `icon` is SVG markup (16×16, stroke="currentColor"), from the app itself.
|
|
@@ -125,6 +144,8 @@ export interface WidgetContext {
|
|
|
125
144
|
/** Show the Funnest logo badge on the chart. */
|
|
126
145
|
attribution: boolean;
|
|
127
146
|
contextMenuItems: ContextMenuItems | undefined;
|
|
147
|
+
priceAxisActions: PriceAxisActions | undefined;
|
|
148
|
+
drawingActions: DrawingActions | undefined;
|
|
128
149
|
toolsMenuItems: ToolsMenuItems | undefined;
|
|
129
150
|
legendValues: LegendValues;
|
|
130
151
|
/** The app's own indicator browser for the 지표 button (instead of the built-in picker). */
|
package/dist/i18n.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export declare const STRINGS: {
|
|
|
69
69
|
undo: string;
|
|
70
70
|
tools: string;
|
|
71
71
|
horizontalAt: string;
|
|
72
|
+
atThisPrice: string;
|
|
72
73
|
resetChart: string;
|
|
73
74
|
chartSettingsMore: string;
|
|
74
75
|
redo: string;
|
|
@@ -259,6 +260,7 @@ export declare const STRINGS: {
|
|
|
259
260
|
undo: string;
|
|
260
261
|
tools: string;
|
|
261
262
|
horizontalAt: string;
|
|
263
|
+
atThisPrice: string;
|
|
262
264
|
resetChart: string;
|
|
263
265
|
chartSettingsMore: string;
|
|
264
266
|
redo: string;
|
package/dist/icons.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const CameraIcon: () => import("preact").JSX.Element;
|
|
|
4
4
|
export declare const ExpandIcon: () => import("preact").JSX.Element;
|
|
5
5
|
export declare const CollapseIcon: () => import("preact").JSX.Element;
|
|
6
6
|
export declare const MinusIcon: () => import("preact").JSX.Element;
|
|
7
|
+
export declare const BellIcon: () => import("preact").JSX.Element;
|
|
7
8
|
export declare const PlusIcon: () => import("preact").JSX.Element;
|
|
8
9
|
export declare const ChevronLeftIcon: () => import("preact").JSX.Element;
|
|
9
10
|
export declare const ChevronRightIcon: () => import("preact").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export { createMultiChart } from './multi-chart.js';
|
|
|
8
8
|
export type { MultiChart, MultiChartEvents, MultiChartOptions, MultiChartState, PaneSpec } from './multi-chart.js';
|
|
9
9
|
export { LAYOUT_GROUPS, LAYOUTS, MAX_PANES, paneCount } from './layouts.js';
|
|
10
10
|
export type { LayoutId, SplitNode, SplitSizes } from './layouts.js';
|
|
11
|
-
export type { ContextMenuItem, ContextMenuItems, IntervalGroup, LayoutSync, LegendValues, SearchCategory, SearchExchange, ToolsMenuItem, ToolsMenuItems } from './context.js';
|
|
11
|
+
export type { ContextMenuItem, ContextMenuItems, DrawingAction, DrawingActions, IntervalGroup, PriceAxisActions, LayoutSync, LegendValues, SearchCategory, SearchExchange, ToolsMenuItem, ToolsMenuItems } from './context.js';
|
|
12
12
|
export type { ColorScheme, TradingChart, TradingChartOptions, TradingChartSlots } from './trading-chart.js';
|
|
13
13
|
export { resolutionLabel, STRINGS, stringsOf, type Strings } from './i18n.js';
|
package/dist/index.js
CHANGED
|
@@ -495,6 +495,7 @@ var STRINGS = {
|
|
|
495
495
|
undo: "\uB418\uB3CC\uB9AC\uAE30",
|
|
496
496
|
tools: "\uB3C4\uAD6C",
|
|
497
497
|
horizontalAt: "{price}\uC5D0 \uC218\uD3C9\uC120 \uAE0B\uAE30",
|
|
498
|
+
atThisPrice: "\uC774 \uAC00\uACA9\uC5D0\uC11C\u2026",
|
|
498
499
|
resetChart: "\uCC28\uD2B8 \uCD08\uAE30\uD654",
|
|
499
500
|
chartSettingsMore: "\uCC28\uD2B8 \uC124\uC815\u2026",
|
|
500
501
|
redo: "\uB2E4\uC2DC \uC2E4\uD589",
|
|
@@ -687,6 +688,7 @@ var STRINGS = {
|
|
|
687
688
|
undo: "Undo",
|
|
688
689
|
tools: "Tools",
|
|
689
690
|
horizontalAt: "Horizontal line at {price}",
|
|
691
|
+
atThisPrice: "At this price\u2026",
|
|
690
692
|
resetChart: "Reset chart",
|
|
691
693
|
chartSettingsMore: "Chart settings\u2026",
|
|
692
694
|
redo: "Redo",
|
|
@@ -858,6 +860,10 @@ var CameraIcon = () => /* @__PURE__ */ a3(Icon, { children: [
|
|
|
858
860
|
var ExpandIcon = () => /* @__PURE__ */ a3(Icon, { children: /* @__PURE__ */ a3("path", { d: "M4 8V4h4M16 8V4h-4M4 12v4h4M16 12v4h-4" }) });
|
|
859
861
|
var CollapseIcon = () => /* @__PURE__ */ a3(Icon, { children: /* @__PURE__ */ a3("path", { d: "M8 4v4H4M12 4v4h4M8 16v-4H4M12 16v-4h4" }) });
|
|
860
862
|
var MinusIcon = () => /* @__PURE__ */ a3(Icon, { size: 18, children: /* @__PURE__ */ a3("path", { d: "M5 10h10" }) });
|
|
863
|
+
var BellIcon = () => /* @__PURE__ */ a3(Icon, { size: 18, children: [
|
|
864
|
+
/* @__PURE__ */ a3("path", { d: "M5.5 13.5V9a4.5 4.5 0 0 1 9 0v4.5l1.2 1.5H4.3z" }),
|
|
865
|
+
/* @__PURE__ */ a3("path", { d: "M8.5 17a1.6 1.6 0 0 0 3 0" })
|
|
866
|
+
] });
|
|
861
867
|
var PlusIcon = () => /* @__PURE__ */ a3(Icon, { size: 18, children: /* @__PURE__ */ a3("path", { d: "M5 10h10M10 5v10" }) });
|
|
862
868
|
var ChevronLeftIcon = () => /* @__PURE__ */ a3(Icon, { size: 18, children: /* @__PURE__ */ a3("path", { d: "M12 5l-5 5 5 5" }) });
|
|
863
869
|
var ChevronRightIcon = () => /* @__PURE__ */ a3(Icon, { size: 18, children: /* @__PURE__ */ a3("path", { d: "M8 5l5 5-5 5" }) });
|
|
@@ -1374,6 +1380,7 @@ function SelectionBar({ ctx }) {
|
|
|
1374
1380
|
};
|
|
1375
1381
|
const locked = !!style.locked;
|
|
1376
1382
|
const dash = style.dash ?? "solid";
|
|
1383
|
+
const actions = ctx.drawingActions?.(d3, ctx.chart) ?? [];
|
|
1377
1384
|
const startMove = (e3) => {
|
|
1378
1385
|
e3.preventDefault();
|
|
1379
1386
|
const start = [e3.clientX, e3.clientY];
|
|
@@ -1516,6 +1523,21 @@ function SelectionBar({ ctx }) {
|
|
|
1516
1523
|
}
|
|
1517
1524
|
)) })
|
|
1518
1525
|
] }),
|
|
1526
|
+
actions.length > 0 && /* @__PURE__ */ a3("div", { class: "fnc-sep" }),
|
|
1527
|
+
actions.map((a4) => /* @__PURE__ */ a3(
|
|
1528
|
+
"button",
|
|
1529
|
+
{
|
|
1530
|
+
class: `fnc-btn fnc-selbar-action${a4.icon ? "" : " is-text"}${a4.pressed ? " is-on" : ""}`,
|
|
1531
|
+
"data-tip": a4.label,
|
|
1532
|
+
"aria-label": a4.label,
|
|
1533
|
+
"aria-pressed": a4.pressed,
|
|
1534
|
+
onClick: () => {
|
|
1535
|
+
a4.onSelect();
|
|
1536
|
+
ctx.chart.selectDrawing(null);
|
|
1537
|
+
},
|
|
1538
|
+
children: a4.icon === "alert" ? /* @__PURE__ */ a3(BellIcon, {}) : a4.label
|
|
1539
|
+
}
|
|
1540
|
+
)),
|
|
1519
1541
|
/* @__PURE__ */ a3("div", { class: "fnc-sep" }),
|
|
1520
1542
|
/* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": locked ? t3.unlock : t3.lock, "aria-label": locked ? t3.unlock : t3.lock, "aria-pressed": locked, onClick: () => setStyle({ locked: !locked }), children: /* @__PURE__ */ a3(LockIcon, { open: !locked }) }),
|
|
1521
1543
|
/* @__PURE__ */ a3(
|
|
@@ -2918,7 +2940,7 @@ function Toolbar({ ctx }) {
|
|
|
2918
2940
|
import { browserLocale, createChart } from "@funnest/charts";
|
|
2919
2941
|
|
|
2920
2942
|
// src/components/overlay.tsx
|
|
2921
|
-
import { formatCompact, formatPrice as
|
|
2943
|
+
import { formatCompact, formatPrice as formatPrice4 } from "@funnest/charts";
|
|
2922
2944
|
|
|
2923
2945
|
// src/components/context-menu.tsx
|
|
2924
2946
|
import { formatPrice as formatPrice2 } from "@funnest/charts";
|
|
@@ -2991,6 +3013,7 @@ function ContextMenu({ ctx }) {
|
|
|
2991
3013
|
item.onSelect();
|
|
2992
3014
|
},
|
|
2993
3015
|
children: [
|
|
3016
|
+
item.icon === "alert" && /* @__PURE__ */ a3(BellIcon, {}),
|
|
2994
3017
|
/* @__PURE__ */ a3("span", { children: item.label }),
|
|
2995
3018
|
item.shortcut && /* @__PURE__ */ a3("kbd", { children: item.shortcut })
|
|
2996
3019
|
]
|
|
@@ -2999,6 +3022,87 @@ function ContextMenu({ ctx }) {
|
|
|
2999
3022
|
) });
|
|
3000
3023
|
}
|
|
3001
3024
|
|
|
3025
|
+
// src/components/price-axis-plus.tsx
|
|
3026
|
+
import { formatPrice as formatPrice3 } from "@funnest/charts";
|
|
3027
|
+
function PriceAxisPlus({ ctx }) {
|
|
3028
|
+
const s3 = useStore(ctx.store);
|
|
3029
|
+
const t3 = stringsOf(s3);
|
|
3030
|
+
const [at, setAt] = d2(null);
|
|
3031
|
+
const [open, setOpen] = d2(false);
|
|
3032
|
+
const held = T2(false);
|
|
3033
|
+
const ref = T2(null);
|
|
3034
|
+
A2(
|
|
3035
|
+
() => ctx.chart.on("crosshairMove", (info) => {
|
|
3036
|
+
if (held.current) return;
|
|
3037
|
+
setAt(info && info.source === "mouse" && info.pane === "main" && info.y >= 0 ? { y: info.y, price: info.value } : null);
|
|
3038
|
+
}),
|
|
3039
|
+
[ctx.chart]
|
|
3040
|
+
);
|
|
3041
|
+
A2(() => {
|
|
3042
|
+
if (!open) return;
|
|
3043
|
+
const close = () => {
|
|
3044
|
+
setOpen(false);
|
|
3045
|
+
held.current = false;
|
|
3046
|
+
};
|
|
3047
|
+
const onDown = (e3) => !ref.current?.contains(e3.target) && close();
|
|
3048
|
+
const onKey = (e3) => e3.key === "Escape" && close();
|
|
3049
|
+
document.addEventListener("pointerdown", onDown, true);
|
|
3050
|
+
document.addEventListener("keydown", onKey);
|
|
3051
|
+
return () => {
|
|
3052
|
+
document.removeEventListener("pointerdown", onDown, true);
|
|
3053
|
+
document.removeEventListener("keydown", onKey);
|
|
3054
|
+
};
|
|
3055
|
+
}, [open]);
|
|
3056
|
+
const { plotWidth, panesHeight } = s3.layout;
|
|
3057
|
+
if (!ctx.priceAxisActions || !at || plotWidth <= 0 || at.y > panesHeight || s3.replay.active) return null;
|
|
3058
|
+
const precision = s3.symbol?.pricePrecision ?? 2;
|
|
3059
|
+
const price = Number(at.price.toFixed(precision));
|
|
3060
|
+
const items = open ? [
|
|
3061
|
+
...ctx.priceAxisActions({ price, chart: ctx.chart }),
|
|
3062
|
+
{
|
|
3063
|
+
label: t3.horizontalAt.replace("{price}", formatPrice3(price, precision)),
|
|
3064
|
+
icon: "line",
|
|
3065
|
+
onSelect: () => {
|
|
3066
|
+
const time = ctx.chart.bars[ctx.chart.bars.length - 1]?.time ?? Date.now();
|
|
3067
|
+
ctx.chart.addDrawing({ type: "horizontal", points: [{ time, price }] });
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
] : [];
|
|
3071
|
+
return /* @__PURE__ */ a3(
|
|
3072
|
+
"div",
|
|
3073
|
+
{
|
|
3074
|
+
class: "fnc-axis-plus",
|
|
3075
|
+
ref,
|
|
3076
|
+
style: { left: `${plotWidth - 26}px`, top: `${Math.round(at.y) - 11}px` },
|
|
3077
|
+
onPointerEnter: () => held.current = true,
|
|
3078
|
+
onPointerLeave: () => !open && (held.current = false),
|
|
3079
|
+
children: [
|
|
3080
|
+
/* @__PURE__ */ a3("button", { class: "fnc-axis-plus-btn", "data-tip": t3.atThisPrice, "aria-label": t3.atThisPrice, "aria-expanded": open, onClick: () => setOpen(!open), children: /* @__PURE__ */ a3(PlusIcon, {}) }),
|
|
3081
|
+
open && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-axis-plus-menu", role: "menu", children: items.map(
|
|
3082
|
+
(item) => item === "separator" ? /* @__PURE__ */ a3("div", { class: "fnc-ctx-sep", role: "separator" }) : /* @__PURE__ */ a3(
|
|
3083
|
+
"button",
|
|
3084
|
+
{
|
|
3085
|
+
class: "fnc-menu-item",
|
|
3086
|
+
role: "menuitem",
|
|
3087
|
+
disabled: "disabled" in item ? item.disabled : false,
|
|
3088
|
+
onClick: () => {
|
|
3089
|
+
setOpen(false);
|
|
3090
|
+
held.current = false;
|
|
3091
|
+
setAt(null);
|
|
3092
|
+
item.onSelect();
|
|
3093
|
+
},
|
|
3094
|
+
children: [
|
|
3095
|
+
item.icon === "alert" ? /* @__PURE__ */ a3(BellIcon, {}) : item.icon === "line" ? /* @__PURE__ */ a3(HorizontalLineIcon, {}) : null,
|
|
3096
|
+
/* @__PURE__ */ a3("span", { children: item.label })
|
|
3097
|
+
]
|
|
3098
|
+
}
|
|
3099
|
+
)
|
|
3100
|
+
) })
|
|
3101
|
+
]
|
|
3102
|
+
}
|
|
3103
|
+
);
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3002
3106
|
// src/components/overlay.tsx
|
|
3003
3107
|
var ZOOM_STEP = 1.25;
|
|
3004
3108
|
var CONTROL_OFFSET = 52;
|
|
@@ -3145,7 +3249,7 @@ function Legend({ ctx }) {
|
|
|
3145
3249
|
const bars = ctx.chart.bars;
|
|
3146
3250
|
const bar = hover?.bar ?? bars[bars.length - 1];
|
|
3147
3251
|
const prev = hover ? hover.prev : bars[bars.length - 2];
|
|
3148
|
-
const fmt = (p3) =>
|
|
3252
|
+
const fmt = (p3) => formatPrice4(p3, s3.symbol.pricePrecision);
|
|
3149
3253
|
let values = null;
|
|
3150
3254
|
if (bar && (ctx.legendValues === "always" || hover)) {
|
|
3151
3255
|
const cls = dirClass(bar.close - bar.open);
|
|
@@ -3442,6 +3546,7 @@ function Overlay({ ctx }) {
|
|
|
3442
3546
|
/* @__PURE__ */ a3(Attribution, { ctx }),
|
|
3443
3547
|
/* @__PURE__ */ a3(Legend, { ctx }),
|
|
3444
3548
|
/* @__PURE__ */ a3(NavControls, { ctx }),
|
|
3549
|
+
/* @__PURE__ */ a3(PriceAxisPlus, { ctx }),
|
|
3445
3550
|
/* @__PURE__ */ a3(ReplayBar, { ctx }),
|
|
3446
3551
|
/* @__PURE__ */ a3(SelectionBar, { ctx }),
|
|
3447
3552
|
/* @__PURE__ */ a3(TextEditor, { ctx }),
|
|
@@ -4130,6 +4235,20 @@ var CSS = (
|
|
|
4130
4235
|
@media (hover: none) {
|
|
4131
4236
|
.fnc-nav { display: none; }
|
|
4132
4237
|
}
|
|
4238
|
+
/* The + on the price axis at the crosshair price, and its menu (mouse only). */
|
|
4239
|
+
.fnc-axis-plus { position: absolute; z-index: 25; }
|
|
4240
|
+
.fnc-axis-plus-btn { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--fnc-bg); color: var(--fnc-text-2); box-shadow: 0 0 0 1px var(--fnc-border); }
|
|
4241
|
+
.fnc-axis-plus-btn:hover, .fnc-axis-plus-btn[aria-expanded="true"] { color: var(--fnc-text); background: var(--fnc-surface); }
|
|
4242
|
+
.fnc-axis-plus-menu { position: absolute; top: 26px; left: auto; right: 0; min-width: 200px; white-space: nowrap; }
|
|
4243
|
+
@media (hover: none) {
|
|
4244
|
+
.fnc-axis-plus { display: none; }
|
|
4245
|
+
}
|
|
4246
|
+
.fnc-selbar-action.is-text { width: auto; padding: 0 8px; font-size: 12px; font-weight: 600; }
|
|
4247
|
+
.fnc-selbar-action.is-on { color: var(--fnc-accent); }
|
|
4248
|
+
.fnc-selbar-action.is-on svg path:first-child { fill: currentColor; }
|
|
4249
|
+
.fnc-axis-plus-menu .fnc-menu-item, .fnc-ctx-menu .fnc-menu-item:has(svg) { color: var(--fnc-text); font-weight: 600; }
|
|
4250
|
+
.fnc-axis-plus-menu .fnc-menu-item svg, .fnc-ctx-menu .fnc-menu-item svg { flex: none; color: var(--fnc-text-2); }
|
|
4251
|
+
|
|
4133
4252
|
/* \uAE30\uAC04 \xB7 \uB0A0\uC9DC\uB85C \uC774\uB3D9: a row under the chart. */
|
|
4134
4253
|
.fnc-rangebar-host { flex: none; border-top: 1px solid var(--fnc-border); }
|
|
4135
4254
|
.fnc-rangebar-host:empty { display: none; }
|
|
@@ -5042,6 +5161,8 @@ function createPane(shell, config) {
|
|
|
5042
5161
|
drawingToolbar: config.drawingToolbar,
|
|
5043
5162
|
attribution: config.attribution,
|
|
5044
5163
|
contextMenuItems: config.contextMenuItems,
|
|
5164
|
+
priceAxisActions: config.priceAxisActions,
|
|
5165
|
+
drawingActions: config.drawingActions,
|
|
5045
5166
|
toolsMenuItems: config.toolsMenuItems,
|
|
5046
5167
|
legendValues: config.legendValues ?? "always",
|
|
5047
5168
|
onIndicatorsClick: config.onIndicatorsClick,
|
|
@@ -5128,6 +5249,8 @@ function createTradingChart(container, options) {
|
|
|
5128
5249
|
attribution = true,
|
|
5129
5250
|
colorScheme = "system",
|
|
5130
5251
|
contextMenuItems,
|
|
5252
|
+
priceAxisActions,
|
|
5253
|
+
drawingActions,
|
|
5131
5254
|
toolsMenuItems,
|
|
5132
5255
|
legendValues,
|
|
5133
5256
|
onIndicatorsClick,
|
|
@@ -5162,6 +5285,8 @@ function createTradingChart(container, options) {
|
|
|
5162
5285
|
drawingToolbar,
|
|
5163
5286
|
attribution,
|
|
5164
5287
|
contextMenuItems,
|
|
5288
|
+
priceAxisActions,
|
|
5289
|
+
drawingActions,
|
|
5165
5290
|
toolsMenuItems,
|
|
5166
5291
|
legendValues,
|
|
5167
5292
|
onIndicatorsClick,
|
|
@@ -5240,6 +5365,8 @@ function createMultiChart(container, options) {
|
|
|
5240
5365
|
attribution = true,
|
|
5241
5366
|
colorScheme = "system",
|
|
5242
5367
|
contextMenuItems,
|
|
5368
|
+
priceAxisActions,
|
|
5369
|
+
drawingActions,
|
|
5243
5370
|
toolsMenuItems,
|
|
5244
5371
|
legendValues,
|
|
5245
5372
|
onIndicatorsClick,
|
|
@@ -5316,6 +5443,8 @@ function createMultiChart(container, options) {
|
|
|
5316
5443
|
// One badge for the whole widget, not one per pane.
|
|
5317
5444
|
attribution: attribution && index === 0,
|
|
5318
5445
|
contextMenuItems,
|
|
5446
|
+
priceAxisActions,
|
|
5447
|
+
drawingActions,
|
|
5319
5448
|
toolsMenuItems,
|
|
5320
5449
|
legendValues,
|
|
5321
5450
|
onIndicatorsClick,
|
package/dist/pane.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsxImportSource preact */
|
|
2
2
|
import { type Chart, type ChartOptions, type ChartType, type Datafeed, type Resolution } from '@funnest/charts';
|
|
3
|
-
import type { ContextMenuItems, IntervalGroup, LegendValues, MultiControls, SearchCategory, SearchExchange, ToolsMenuItems, UiState, WidgetContext } from './context.js';
|
|
3
|
+
import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, MultiControls, PriceAxisActions, SearchCategory, SearchExchange, ToolsMenuItems, UiState, WidgetContext } from './context.js';
|
|
4
4
|
import { type Shell } from './shell.js';
|
|
5
5
|
import type { Strings } from './i18n.js';
|
|
6
6
|
import { Store } from './store.js';
|
|
@@ -20,6 +20,8 @@ export interface PaneConfig {
|
|
|
20
20
|
/** Ctrl/⌘+K opens this widget's symbol search (its footer shows the hint only then). */
|
|
21
21
|
searchHotkey: boolean;
|
|
22
22
|
contextMenuItems?: ContextMenuItems | undefined;
|
|
23
|
+
priceAxisActions?: PriceAxisActions | undefined;
|
|
24
|
+
drawingActions?: DrawingActions | undefined;
|
|
23
25
|
toolsMenuItems?: ToolsMenuItems | undefined;
|
|
24
26
|
legendValues?: LegendValues | undefined;
|
|
25
27
|
onIndicatorsClick?: ((chart: Chart) => void) | undefined;
|
package/dist/trading-chart.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsxImportSource preact */
|
|
2
2
|
import { type Chart, type ChartOptions, type ChartType, type Datafeed, type DirectionPreset, type Locale, type ChartState, type Resolution, type ThemeTokens } from '@funnest/charts';
|
|
3
|
-
import type { ContextMenuItems, IntervalGroup, LegendValues, SearchCategory, SearchExchange, ToolsMenuItems } from './context.js';
|
|
3
|
+
import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, PriceAxisActions, SearchCategory, SearchExchange, ToolsMenuItems } from './context.js';
|
|
4
4
|
import type { Strings } from './i18n.js';
|
|
5
5
|
import { type ColorScheme, type TradingChartSlots } from './shell.js';
|
|
6
6
|
export type { ColorScheme, TradingChartSlots } from './shell.js';
|
|
@@ -58,6 +58,10 @@ export interface TradingChartOptions extends Omit<ChartOptions, 'datafeed'> {
|
|
|
58
58
|
* e.g. "이 가격에 알림 만들기". Called on every right-click with the price and time under the pointer.
|
|
59
59
|
*/
|
|
60
60
|
contextMenuItems?: ContextMenuItems;
|
|
61
|
+
/** Rows of the price axis's + menu at the crosshair price (e.g. "이 가격에 알림 만들기"); without it there's no +. */
|
|
62
|
+
priceAxisActions?: PriceAxisActions;
|
|
63
|
+
/** Buttons on the bar of a selected drawing (e.g. 알림 on a trend line) — how phones reach drawing actions. */
|
|
64
|
+
drawingActions?: DrawingActions;
|
|
61
65
|
/**
|
|
62
66
|
* Extra rows for the 도구 (tools) menu, above 차트 설정 — e.g. the app's own display settings.
|
|
63
67
|
* Called each time the menu opens, with the pane's chart.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funnest/charts-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Pro trading UI (toolbar, drawing tools, sheets) for Funnest Charts. Framework-agnostic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chart",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"NOTICE"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@funnest/charts": "0.8.
|
|
45
|
+
"@funnest/charts": "0.8.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"preact": "^11.2.0"
|