@funnest/charts-ui 0.3.0 → 0.5.0

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.
@@ -0,0 +1,11 @@
1
+ import type { MultiControls, WidgetContext } from '../context';
2
+ import { type LayoutId } from '../layouts';
3
+ /** Mini drawing of a split layout. */
4
+ export declare function LayoutGlyph({ id }: {
5
+ id: LayoutId;
6
+ }): import("preact").JSX.Element;
7
+ /** Toolbar buttons of the multi-chart widget: split layout picker and pane sync toggles. */
8
+ export declare function LayoutMenu({ ctx, multi }: {
9
+ ctx: WidgetContext;
10
+ multi: MultiControls;
11
+ }): import("preact").JSX.Element;
@@ -2,6 +2,7 @@
2
2
  * Mounts a persistent, host-owned element inside Preact-rendered UI. The element outlives
3
3
  * re-renders, so whatever the host app rendered into it (React, Vue, plain DOM) stays intact.
4
4
  */
5
- export declare function Slot({ el }: {
5
+ export declare function Slot({ el, fixed }: {
6
6
  el: HTMLElement;
7
+ fixed?: boolean;
7
8
  }): import("preact").JSX.Element;
package/dist/context.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Chart, ChartLayout, ChartType, Datafeed, Drawing, DrawingType, IndicatorConfig, Locale, Resolution, SymbolInfo } from '@funnest/charts';
2
+ import type { LayoutId } from './layouts';
2
3
  import type { WidgetStorage } from './storage';
3
4
  import type { Store } from './store';
4
5
  export interface UiState {
@@ -71,4 +72,34 @@ export interface WidgetContext {
71
72
  setSearchOpen(open: boolean): void;
72
73
  screenshot(): void;
73
74
  toggleFullscreen(): void;
75
+ /** Present in the multi-chart widget: split layout and sync controls for the toolbar. */
76
+ multi?: MultiControls | undefined;
77
+ }
78
+ /** What linked panes share in the multi-chart widget. */
79
+ export interface LayoutSync {
80
+ /** Mirror the crosshair's time in every pane. */
81
+ crosshair: boolean;
82
+ /** Scroll/zoom every pane to the same time span. */
83
+ time: boolean;
84
+ /** Changing the symbol changes it in every pane. */
85
+ symbol: boolean;
86
+ /** Changing the interval changes it in every pane. */
87
+ interval: boolean;
88
+ }
89
+ export interface MultiState {
90
+ layout: LayoutId;
91
+ sync: LayoutSync;
92
+ /** Index of the pane the toolbar and drawing bar act on. */
93
+ active: number;
94
+ /** A pane temporarily filling the whole grid. */
95
+ maximized: number | null;
96
+ /** The container is too narrow to split: only the active pane shows, with pane tabs. */
97
+ narrow: boolean;
98
+ }
99
+ export interface MultiControls {
100
+ store: Store<MultiState>;
101
+ setLayout(layout: LayoutId): void;
102
+ setSync(patch: Partial<LayoutSync>): void;
103
+ activate(index: number): void;
104
+ toggleMaximize(index?: number): void;
74
105
  }
package/dist/i18n.d.ts CHANGED
@@ -40,6 +40,7 @@ export declare const STRINGS: {
40
40
  settingHighLow: string;
41
41
  settingLastPrice: string;
42
42
  settingVolume: string;
43
+ settingNavButtons: string;
43
44
  settingGridH: string;
44
45
  settingGridV: string;
45
46
  resetDefaults: string;
@@ -93,6 +94,16 @@ export declare const STRINGS: {
93
94
  searching: string;
94
95
  searchHint: string;
95
96
  current: string;
97
+ layout: string;
98
+ sync: string;
99
+ syncCrosshair: string;
100
+ syncTime: string;
101
+ syncSymbol: string;
102
+ syncInterval: string;
103
+ syncHint: string;
104
+ maximizePane: string;
105
+ restorePane: string;
106
+ pane: string;
96
107
  };
97
108
  en: {
98
109
  searchSymbol: string;
@@ -134,6 +145,7 @@ export declare const STRINGS: {
134
145
  settingHighLow: string;
135
146
  settingLastPrice: string;
136
147
  settingVolume: string;
148
+ settingNavButtons: string;
137
149
  settingGridH: string;
138
150
  settingGridV: string;
139
151
  resetDefaults: string;
@@ -187,6 +199,16 @@ export declare const STRINGS: {
187
199
  searching: string;
188
200
  searchHint: string;
189
201
  current: string;
202
+ layout: string;
203
+ sync: string;
204
+ syncCrosshair: string;
205
+ syncTime: string;
206
+ syncSymbol: string;
207
+ syncInterval: string;
208
+ syncHint: string;
209
+ maximizePane: string;
210
+ restorePane: string;
211
+ pane: string;
190
212
  };
191
213
  };
192
214
  export type Strings = (typeof STRINGS)['ko'];
package/dist/icons.d.ts CHANGED
@@ -37,3 +37,6 @@ export declare const CollapseLeftIcon: () => import("preact").JSX.Element;
37
37
  export declare const SettingsIcon: () => import("preact").JSX.Element;
38
38
  /** Funnest brand mark (brand/logo-mark.svg). Colors are fixed on purpose. */
39
39
  export declare const FunnestMark: () => import("preact").JSX.Element;
40
+ export declare const LinkIcon: () => import("preact").JSX.Element;
41
+ export declare const MaximizeIcon: () => import("preact").JSX.Element;
42
+ export declare const RestoreIcon: () => import("preact").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,10 @@
4
4
  * need no framework (React/Vue/Svelte/plain HTML all work).
5
5
  */
6
6
  export { createTradingChart, DEFAULT_FAVORITE_INTERVALS, DEFAULT_INTERVAL_GROUPS, DEFAULT_SEARCH_CATEGORIES, } from './trading-chart';
7
- export type { IntervalGroup, SearchCategory } from './context';
7
+ export { createMultiChart } from './multi-chart';
8
+ export type { MultiChart, MultiChartEvents, MultiChartOptions, MultiChartState, PaneSpec } from './multi-chart';
9
+ export { LAYOUT_GROUPS, LAYOUTS, MAX_PANES, paneCount } from './layouts';
10
+ export type { LayoutId, SplitNode, SplitSizes } from './layouts';
11
+ export type { IntervalGroup, LayoutSync, SearchCategory } from './context';
8
12
  export type { ColorScheme, TradingChart, TradingChartOptions, TradingChartSlots } from './trading-chart';
9
13
  export { resolutionLabel } from './i18n';