@funnest/charts-ui 0.5.2 → 0.6.1
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/context-menu.d.ts +8 -0
- package/dist/context.d.ts +20 -2
- package/dist/i18n.d.ts +48 -0
- package/dist/icons.d.ts +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +974 -525
- package/dist/pane.d.ts +2 -1
- package/dist/shell.d.ts +4 -0
- package/dist/trading-chart.d.ts +6 -1
- package/package.json +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WidgetContext } from '../context';
|
|
2
|
+
/**
|
|
3
|
+
* Right-click menu on the chart (mouse only): undo/redo, the host's own items
|
|
4
|
+
* (`contextMenuItems`), a horizontal line at the clicked price, reset and settings.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ContextMenu({ ctx }: {
|
|
7
|
+
ctx: WidgetContext;
|
|
8
|
+
}): import("preact").JSX.Element | null;
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Chart, ChartLayout, ChartType, Datafeed, Drawing, DrawingType, IndicatorConfig, Locale, Resolution, SymbolInfo } from '@funnest/charts';
|
|
1
|
+
import type { Chart, ChartContextMenu, ChartLayout, ChartType, CompareInfo, Datafeed, Drawing, DrawingType, IndicatorConfig, Locale, ReplayStatus, Resolution, SymbolInfo } from '@funnest/charts';
|
|
2
2
|
import type { LayoutId } from './layouts';
|
|
3
3
|
import type { WidgetStorage } from './storage';
|
|
4
4
|
import type { Store } from './store';
|
|
@@ -11,6 +11,8 @@ export interface UiState {
|
|
|
11
11
|
atRealtime: boolean;
|
|
12
12
|
fullscreen: boolean;
|
|
13
13
|
searchOpen: boolean;
|
|
14
|
+
/** What a pick in the symbol search does: switch the symbol, or add it as a comparison. */
|
|
15
|
+
searchTarget: 'symbol' | 'compare';
|
|
14
16
|
chartType: ChartType;
|
|
15
17
|
drawingTool: DrawingType | null;
|
|
16
18
|
selection: Drawing | null;
|
|
@@ -32,7 +34,22 @@ export interface UiState {
|
|
|
32
34
|
favoriteIntervals: Resolution[];
|
|
33
35
|
/** Desktop: the left drawing bar folded away (a small tab brings it back). */
|
|
34
36
|
drawbarCollapsed: boolean;
|
|
37
|
+
canUndo: boolean;
|
|
38
|
+
canRedo: boolean;
|
|
39
|
+
compares: CompareInfo[];
|
|
40
|
+
replay: ReplayStatus;
|
|
35
41
|
}
|
|
42
|
+
/** A row in the chart's right-click menu, or a divider. */
|
|
43
|
+
export type ContextMenuItem = {
|
|
44
|
+
label: string;
|
|
45
|
+
shortcut?: string;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
onSelect(): void;
|
|
48
|
+
} | 'separator';
|
|
49
|
+
/** Extra right-click items for a click on `chart` (e.g. "create an alert at this price"). */
|
|
50
|
+
export type ContextMenuItems = (target: ChartContextMenu & {
|
|
51
|
+
chart: Chart;
|
|
52
|
+
}) => ContextMenuItem[];
|
|
36
53
|
export interface IntervalGroup {
|
|
37
54
|
id: 'minutes' | 'hours' | 'days';
|
|
38
55
|
intervals: Resolution[];
|
|
@@ -59,6 +76,7 @@ export interface WidgetContext {
|
|
|
59
76
|
drawingToolbar: boolean;
|
|
60
77
|
/** Show the Funnest logo badge on the chart. */
|
|
61
78
|
attribution: boolean;
|
|
79
|
+
contextMenuItems: ContextMenuItems | undefined;
|
|
62
80
|
slots: {
|
|
63
81
|
toolbar: HTMLElement;
|
|
64
82
|
toolbarEnd: HTMLElement;
|
|
@@ -69,7 +87,7 @@ export interface WidgetContext {
|
|
|
69
87
|
selectSymbol(symbol: string): void;
|
|
70
88
|
selectResolution(resolution: Resolution): void;
|
|
71
89
|
toggleFavoriteInterval(resolution: Resolution): void;
|
|
72
|
-
setSearchOpen(open: boolean): void;
|
|
90
|
+
setSearchOpen(open: boolean, target?: 'symbol' | 'compare'): void;
|
|
73
91
|
screenshot(): void;
|
|
74
92
|
toggleFullscreen(): void;
|
|
75
93
|
/** Present in the multi-chart widget: split layout and sync controls for the toolbar. */
|
package/dist/i18n.d.ts
CHANGED
|
@@ -41,6 +41,30 @@ export declare const STRINGS: {
|
|
|
41
41
|
settingLastPrice: string;
|
|
42
42
|
settingVolume: string;
|
|
43
43
|
settingNavButtons: string;
|
|
44
|
+
settingCountdown: string;
|
|
45
|
+
settingsScale: string;
|
|
46
|
+
scaleNormal: string;
|
|
47
|
+
scaleLog: string;
|
|
48
|
+
scalePercent: string;
|
|
49
|
+
undo: string;
|
|
50
|
+
horizontalAt: string;
|
|
51
|
+
resetChart: string;
|
|
52
|
+
chartSettingsMore: string;
|
|
53
|
+
redo: string;
|
|
54
|
+
compare: string;
|
|
55
|
+
compareSymbol: string;
|
|
56
|
+
removeCompare: string;
|
|
57
|
+
replay: string;
|
|
58
|
+
replayPick: string;
|
|
59
|
+
replayPlay: string;
|
|
60
|
+
replayPause: string;
|
|
61
|
+
replayStep: string;
|
|
62
|
+
replayExit: string;
|
|
63
|
+
replaySpeed: string;
|
|
64
|
+
replayRestart: string;
|
|
65
|
+
replayDone: string;
|
|
66
|
+
searchIndicators: string;
|
|
67
|
+
moreTools: string;
|
|
44
68
|
settingGridH: string;
|
|
45
69
|
settingGridV: string;
|
|
46
70
|
resetDefaults: string;
|
|
@@ -146,6 +170,30 @@ export declare const STRINGS: {
|
|
|
146
170
|
settingLastPrice: string;
|
|
147
171
|
settingVolume: string;
|
|
148
172
|
settingNavButtons: string;
|
|
173
|
+
settingCountdown: string;
|
|
174
|
+
settingsScale: string;
|
|
175
|
+
scaleNormal: string;
|
|
176
|
+
scaleLog: string;
|
|
177
|
+
scalePercent: string;
|
|
178
|
+
undo: string;
|
|
179
|
+
horizontalAt: string;
|
|
180
|
+
resetChart: string;
|
|
181
|
+
chartSettingsMore: string;
|
|
182
|
+
redo: string;
|
|
183
|
+
compare: string;
|
|
184
|
+
compareSymbol: string;
|
|
185
|
+
removeCompare: string;
|
|
186
|
+
replay: string;
|
|
187
|
+
replayPick: string;
|
|
188
|
+
replayPlay: string;
|
|
189
|
+
replayPause: string;
|
|
190
|
+
replayStep: string;
|
|
191
|
+
replayExit: string;
|
|
192
|
+
replaySpeed: string;
|
|
193
|
+
replayRestart: string;
|
|
194
|
+
replayDone: string;
|
|
195
|
+
searchIndicators: string;
|
|
196
|
+
moreTools: string;
|
|
149
197
|
settingGridH: string;
|
|
150
198
|
settingGridV: string;
|
|
151
199
|
resetDefaults: string;
|
package/dist/icons.d.ts
CHANGED
|
@@ -40,3 +40,15 @@ export declare const FunnestMark: () => import("preact").JSX.Element;
|
|
|
40
40
|
export declare const LinkIcon: () => import("preact").JSX.Element;
|
|
41
41
|
export declare const MaximizeIcon: () => import("preact").JSX.Element;
|
|
42
42
|
export declare const RestoreIcon: () => import("preact").JSX.Element;
|
|
43
|
+
/** Two price lines diverging (compare symbols). */
|
|
44
|
+
export declare const CompareIcon: () => import("preact").JSX.Element;
|
|
45
|
+
export declare const ReplayIcon: () => import("preact").JSX.Element;
|
|
46
|
+
export declare const PlayIcon: () => import("preact").JSX.Element;
|
|
47
|
+
export declare const PauseIcon: () => import("preact").JSX.Element;
|
|
48
|
+
export declare const StepIcon: () => import("preact").JSX.Element;
|
|
49
|
+
/** Plugin tool icon: SVG markup from DrawingDefinition.icon (whole <svg> or just its children). */
|
|
50
|
+
export declare const SvgIcon: ({ markup }: {
|
|
51
|
+
markup: string;
|
|
52
|
+
}) => import("preact").JSX.Element;
|
|
53
|
+
/** Tiny corner triangle on drawing-bar buttons that hold more tools. */
|
|
54
|
+
export declare const CornerIcon: () => import("preact").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export { createMultiChart } from './multi-chart';
|
|
|
8
8
|
export type { MultiChart, MultiChartEvents, MultiChartOptions, MultiChartState, PaneSpec } from './multi-chart';
|
|
9
9
|
export { LAYOUT_GROUPS, LAYOUTS, MAX_PANES, paneCount } from './layouts';
|
|
10
10
|
export type { LayoutId, SplitNode, SplitSizes } from './layouts';
|
|
11
|
-
export type { IntervalGroup, LayoutSync, SearchCategory } from './context';
|
|
11
|
+
export type { ContextMenuItem, ContextMenuItems, IntervalGroup, LayoutSync, SearchCategory } from './context';
|
|
12
12
|
export type { ColorScheme, TradingChart, TradingChartOptions, TradingChartSlots } from './trading-chart';
|
|
13
13
|
export { resolutionLabel } from './i18n';
|