@funnest/charts-ui 0.11.22 → 0.11.24
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/context.d.ts +28 -0
- package/dist/i18n.d.ts +18 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +98 -14
- package/dist/pane.d.ts +2 -1
- package/dist/trading-chart.d.ts +3 -1
- package/package.json +2 -2
package/dist/context.d.ts
CHANGED
|
@@ -118,6 +118,33 @@ export interface SettingsToggle {
|
|
|
118
118
|
}
|
|
119
119
|
/** The app's switches for 차트 설정, asked when it opens (for the pane's chart); none: no section. */
|
|
120
120
|
export type SettingsToggles = (chart: Chart) => SettingsToggle[];
|
|
121
|
+
/** A pick-one row in an app's section of 차트 설정 (a select on the right). */
|
|
122
|
+
export interface SettingsChoice {
|
|
123
|
+
label: string;
|
|
124
|
+
hint?: string;
|
|
125
|
+
value: string;
|
|
126
|
+
options: {
|
|
127
|
+
value: string;
|
|
128
|
+
label: string;
|
|
129
|
+
}[];
|
|
130
|
+
onChange(value: string): void;
|
|
131
|
+
}
|
|
132
|
+
/** A row that opens something of the app's (its own dialog), shown as a button. */
|
|
133
|
+
export interface SettingsLink {
|
|
134
|
+
label: string;
|
|
135
|
+
hint?: string;
|
|
136
|
+
/** The button's text. */
|
|
137
|
+
action: string;
|
|
138
|
+
onSelect(): void;
|
|
139
|
+
}
|
|
140
|
+
/** One of the app's sections in a tab of 차트 설정: a title and its rows. */
|
|
141
|
+
export interface SettingsSection {
|
|
142
|
+
tab: 'scale' | 'view';
|
|
143
|
+
title: string;
|
|
144
|
+
rows: (SettingsToggle | SettingsChoice | SettingsLink)[];
|
|
145
|
+
}
|
|
146
|
+
/** The app's own sections for 차트 설정, asked when it opens (for the pane's chart). */
|
|
147
|
+
export type SettingsSections = (chart: Chart) => SettingsSection[];
|
|
121
148
|
/** The app's rows for the 도구 menu, asked each time it opens (for the pane's chart). */
|
|
122
149
|
export type ToolsMenuItems = (chart: Chart) => ToolsMenuItem[];
|
|
123
150
|
/**
|
|
@@ -170,6 +197,7 @@ export interface WidgetContext {
|
|
|
170
197
|
drawingActions: DrawingActions | undefined;
|
|
171
198
|
toolsMenuItems: ToolsMenuItems | undefined;
|
|
172
199
|
settingsToggles: SettingsToggles | undefined;
|
|
200
|
+
settingsSections: SettingsSections | undefined;
|
|
173
201
|
legendValues: LegendValues;
|
|
174
202
|
/** The app's own indicator browser for the 지표 button (instead of the built-in picker). */
|
|
175
203
|
onIndicatorsClick: ((chart: Chart) => void) | undefined;
|
package/dist/i18n.d.ts
CHANGED
|
@@ -113,6 +113,15 @@ export declare const STRINGS: {
|
|
|
113
113
|
hintDrawOnLoad: string;
|
|
114
114
|
hintSymbolWatermark: string;
|
|
115
115
|
settingsSplitLayout: string;
|
|
116
|
+
settingsScope: string;
|
|
117
|
+
scopeOne: string;
|
|
118
|
+
scopeAll: string;
|
|
119
|
+
hintScopeOne: string;
|
|
120
|
+
hintScopeAll: string;
|
|
121
|
+
settingsAxis: string;
|
|
122
|
+
settingsPriceMarks: string;
|
|
123
|
+
settingsShown: string;
|
|
124
|
+
settingsControl: string;
|
|
116
125
|
settingsSplit: string;
|
|
117
126
|
splitSyncCrosshair: string;
|
|
118
127
|
hintSplitSyncCrosshair: string;
|
|
@@ -462,6 +471,15 @@ export declare const STRINGS: {
|
|
|
462
471
|
hintDrawOnLoad: string;
|
|
463
472
|
hintSymbolWatermark: string;
|
|
464
473
|
settingsSplitLayout: string;
|
|
474
|
+
settingsScope: string;
|
|
475
|
+
scopeOne: string;
|
|
476
|
+
scopeAll: string;
|
|
477
|
+
hintScopeOne: string;
|
|
478
|
+
hintScopeAll: string;
|
|
479
|
+
settingsAxis: string;
|
|
480
|
+
settingsPriceMarks: string;
|
|
481
|
+
settingsShown: string;
|
|
482
|
+
settingsControl: string;
|
|
465
483
|
settingsSplit: string;
|
|
466
484
|
splitSyncCrosshair: string;
|
|
467
485
|
hintSplitSyncCrosshair: string;
|
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, MenuIconName, DrawingAction, DrawingActions, IntervalGroup, PriceAxisActions, SettingsToggle, SettingsToggles, LayoutSync, LegendValues, SearchCategory, SearchExchange, ToolsMenuItem, ToolsMenuItems } from './context.js';
|
|
11
|
+
export type { ContextMenuItem, ContextMenuItems, MenuIconName, DrawingAction, DrawingActions, IntervalGroup, PriceAxisActions, SettingsToggle, SettingsToggles, SettingsChoice, SettingsLink, SettingsSection, SettingsSections, 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
|
@@ -548,6 +548,15 @@ var STRINGS = {
|
|
|
548
548
|
hintDrawOnLoad: "\uC885\uBAA9\uC774\uB098 \uC8FC\uAE30\uB97C \uBC14\uAFD4 \uCC28\uD2B8\uB97C \uBD88\uB7EC\uC62C \uB54C \uCE94\uB4E4\uC774 \uC67C\uCABD\uBD80\uD130 \uCC28\uB840\uB85C \uADF8\uB824\uC838\uC694.",
|
|
549
549
|
hintSymbolWatermark: "\uAC00\uACA9 \uC601\uC5ED \uAC00\uC6B4\uB370\uC5D0 \uC885\uBAA9 \uC774\uB984\uACFC \uC8FC\uAE30\uB97C \uD750\uB9AC\uAC8C \uBCF4\uC5EC\uC918\uC694.",
|
|
550
550
|
settingsSplitLayout: "\uB808\uC774\uC544\uC6C3",
|
|
551
|
+
settingsScope: "\uC801\uC6A9 \uBC94\uC704",
|
|
552
|
+
scopeOne: "\uC774 \uCC28\uD2B8\uB9CC",
|
|
553
|
+
scopeAll: "\uBAA8\uB4E0 \uCC28\uD2B8",
|
|
554
|
+
hintScopeOne: "\uBC14\uAFBC \uC124\uC815\uC774 \uC120\uD0DD\uB41C \uCC28\uD2B8 \uD558\uB098\uC5D0\uB9CC \uC801\uC6A9\uB3FC\uC694.",
|
|
555
|
+
hintScopeAll: "\uBC14\uAFBC \uC124\uC815\uC774 \uD654\uBA74\uC758 \uBAA8\uB4E0 \uCC28\uD2B8\uC5D0 \uC801\uC6A9\uB3FC\uC694.",
|
|
556
|
+
settingsAxis: "\uB208\uAE08",
|
|
557
|
+
settingsPriceMarks: "\uAC00\uACA9 \uD45C\uC2DC",
|
|
558
|
+
settingsShown: "\uBCF4\uC774\uB294 \uAC83",
|
|
559
|
+
settingsControl: "\uC870\uC791",
|
|
551
560
|
settingsSplit: "\uAC19\uC774 \uBC14\uAFB8\uAE30",
|
|
552
561
|
splitSyncCrosshair: "\uC2ED\uC790\uC120 \uAC19\uC774 \uBCF4\uAE30",
|
|
553
562
|
hintSplitSyncCrosshair: "\uD55C \uCC28\uD2B8\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB9AC\uBA74 \uB098\uBA38\uC9C0 \uCC28\uD2B8\uC5D0\uB3C4 \uAC19\uC740 \uC2DC\uAC01\uC5D0 \uC138\uB85C\uC120\uC774 \uBCF4\uC5EC\uC694.",
|
|
@@ -899,6 +908,15 @@ var STRINGS = {
|
|
|
899
908
|
hintDrawOnLoad: "Candles draw in from the left when a symbol or interval loads.",
|
|
900
909
|
hintSymbolWatermark: "The symbol and interval, faint in the middle of the price pane.",
|
|
901
910
|
settingsSplitLayout: "Layout",
|
|
911
|
+
settingsScope: "Apply to",
|
|
912
|
+
scopeOne: "This chart",
|
|
913
|
+
scopeAll: "All charts",
|
|
914
|
+
hintScopeOne: "Changes apply to the selected chart only.",
|
|
915
|
+
hintScopeAll: "Changes apply to every chart on screen.",
|
|
916
|
+
settingsAxis: "Scale",
|
|
917
|
+
settingsPriceMarks: "Price marks",
|
|
918
|
+
settingsShown: "Shown",
|
|
919
|
+
settingsControl: "Controls",
|
|
902
920
|
settingsSplit: "Change together",
|
|
903
921
|
splitSyncCrosshair: "Crosshair on every chart",
|
|
904
922
|
hintSplitSyncCrosshair: "Hovering one chart shows a line at the same time on the others.",
|
|
@@ -3749,7 +3767,11 @@ var CSS = (
|
|
|
3749
3767
|
font-size: 12px;
|
|
3750
3768
|
font-weight: 500;
|
|
3751
3769
|
line-height: 1.4;
|
|
3752
|
-
|
|
3770
|
+
/* A short label stays on one line; a longer hint wraps inside the bubble (Korean at spaces). */
|
|
3771
|
+
width: max-content;
|
|
3772
|
+
white-space: normal;
|
|
3773
|
+
word-break: keep-all;
|
|
3774
|
+
overflow-wrap: anywhere;
|
|
3753
3775
|
box-shadow: 0 6px 20px rgb(0 0 0 / 0.28);
|
|
3754
3776
|
pointer-events: none;
|
|
3755
3777
|
opacity: 0;
|
|
@@ -4288,6 +4310,12 @@ var CSS = (
|
|
|
4288
4310
|
.fnc-settings-layouts { padding: 2px 0 6px; }
|
|
4289
4311
|
.fnc-settings-layouts .fnc-layout-opt { width: 40px; height: 32px; }
|
|
4290
4312
|
.fnc-section-info { display: flex; align-items: center; gap: 4px; }
|
|
4313
|
+
/* \uC801\uC6A9 \uBC94\uC704 (split view), in the dialog's head between its title and \xD7. */
|
|
4314
|
+
.fnc-settings-dialog .fnc-dialog-head { gap: 12px; }
|
|
4315
|
+
.fnc-settings-dialog .fnc-dialog-head > b { flex: 1; }
|
|
4316
|
+
.fnc-scope-seg button { min-width: 0; height: 28px; padding: 0 10px; font-size: 12.5px; }
|
|
4317
|
+
.fnc-app-select { max-width: 55%; }
|
|
4318
|
+
.fnc-app-link { flex: none; height: 30px; padding: 0 12px; font-size: 12.5px; }
|
|
4291
4319
|
/* \uC2DC\uC810 \uC5F0\uB3D9's i: a button that opens what each choice does right under the title. */
|
|
4292
4320
|
.fnc-info-btn { border: 0; padding: 0; cursor: pointer; }
|
|
4293
4321
|
.fnc-info-btn[aria-expanded='true'] { color: var(--fnc-text); }
|
|
@@ -4438,6 +4466,8 @@ var CSS = (
|
|
|
4438
4466
|
.fnc-settings-form .fnc-section:first-child { margin-top: 0; }
|
|
4439
4467
|
.fnc-settings-form .fnc-toggle-row { min-height: 40px; }
|
|
4440
4468
|
.fnc-settings-form .fnc-themes, .fnc-settings-form .fnc-settings-seg { margin-bottom: 4px; }
|
|
4469
|
+
/* A choice bar right under its title: as far from it as a switch row's text is (a row has its own air). */
|
|
4470
|
+
.fnc-settings-form .fnc-section + .fnc-settings-seg, .fnc-settings-form .fnc-help + .fnc-settings-seg { margin-top: 6px; }
|
|
4441
4471
|
/* Color rows: the name, then (when changed) back-to-theme, then the square. */
|
|
4442
4472
|
.fnc-color-row { gap: 8px; min-height: 40px; }
|
|
4443
4473
|
.fnc-color-reset { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; color: var(--fnc-text-2); }
|
|
@@ -5015,16 +5045,17 @@ var GRID = [
|
|
|
5015
5045
|
{ key: "gridHorizontal", label: "settingGridH" },
|
|
5016
5046
|
{ key: "gridVertical", label: "settingGridV" }
|
|
5017
5047
|
];
|
|
5018
|
-
var
|
|
5048
|
+
var AXIS_ROWS = [{ key: "lockRatio", label: "lockRatio" }];
|
|
5049
|
+
var PRICE_MARK_ROWS = [
|
|
5019
5050
|
{ key: "lastPriceLine", label: "settingLastPrice" },
|
|
5020
5051
|
{ key: "countdown", label: "settingCountdown" },
|
|
5021
5052
|
{ key: "extendedPriceLine", label: "settingExtendedPrice" },
|
|
5022
|
-
{ key: "highLowMarkers", label: "settingHighLow" }
|
|
5023
|
-
{ key: "lockRatio", label: "lockRatio" }
|
|
5053
|
+
{ key: "highLowMarkers", label: "settingHighLow" }
|
|
5024
5054
|
];
|
|
5025
|
-
var VIEW_ROWS = [
|
|
5026
|
-
|
|
5055
|
+
var VIEW_ROWS = [{ key: "volume", label: "settingVolume" }];
|
|
5056
|
+
var CONTROL_ROWS = [
|
|
5027
5057
|
{ key: "navigationButtons", label: "settingNavButtons" },
|
|
5058
|
+
{ key: "scrollInertia", label: "settingScrollInertia", hint: "hintScrollInertia" },
|
|
5028
5059
|
{ key: "lockView", label: "lockView" }
|
|
5029
5060
|
];
|
|
5030
5061
|
var WATERMARK_ROWS = [
|
|
@@ -5044,7 +5075,6 @@ var TIME_LINK_CHOICES = [
|
|
|
5044
5075
|
];
|
|
5045
5076
|
var MOTION_ROWS = [
|
|
5046
5077
|
{ key: "zoomAnimation", label: "settingZoomAnimation", hint: "hintZoomAnimation" },
|
|
5047
|
-
{ key: "scrollInertia", label: "settingScrollInertia", hint: "hintScrollInertia" },
|
|
5048
5078
|
{ key: "priceAxisAnimation", label: "settingAxisAnimation", hint: "hintAxisAnimation" },
|
|
5049
5079
|
{ key: "priceAnimation", label: "settingPriceAnimation", hint: "hintPriceAnimation" },
|
|
5050
5080
|
{ key: "drawOnLoad", label: "settingDrawOnLoad", hint: "hintDrawOnLoad" }
|
|
@@ -5083,7 +5113,14 @@ function SettingsDialog({ ctx }) {
|
|
|
5083
5113
|
const appToggles = ctx.settingsToggles?.(ctx.chart) ?? [];
|
|
5084
5114
|
A2(() => ctx.chart.on("settingsChange", setSettings), [ctx.chart]);
|
|
5085
5115
|
const close = () => ctx.store.set({ dialog: null });
|
|
5086
|
-
const
|
|
5116
|
+
const split = useSplitCount(ctx) > 1;
|
|
5117
|
+
const [scope, setScope] = d2(() => readScope() === "one" ? "one" : "all");
|
|
5118
|
+
const pickScope = (next) => {
|
|
5119
|
+
setScope(next);
|
|
5120
|
+
writeScope(next);
|
|
5121
|
+
};
|
|
5122
|
+
const set = (patch) => split && scope === "all" && ctx.multi ? ctx.multi.applySettings(patch) : ctx.chart.setSettings(patch);
|
|
5123
|
+
const appSections = ctx.settingsSections?.(ctx.chart) ?? [];
|
|
5087
5124
|
const themeColor = (name) => toHex(getComputedStyle(ctx.root).getPropertyValue(name).trim());
|
|
5088
5125
|
const currentTheme = matchChartTheme(settings);
|
|
5089
5126
|
const palette = ctx.chart.paletteInUse;
|
|
@@ -5103,6 +5140,24 @@ function SettingsDialog({ ctx }) {
|
|
|
5103
5140
|
];
|
|
5104
5141
|
const shown = tabs.some(([k2]) => k2 === tab) ? tab : "look";
|
|
5105
5142
|
const setRow = (key, on) => ctx.multi && WATERMARK_ROWS.some((r3) => r3.key === key) ? ctx.multi.applySettings({ [key]: on }) : set({ [key]: on });
|
|
5143
|
+
const appRows = (tab2) => appSections.filter((sec) => sec.tab === tab2 && sec.rows.length).map((sec) => /* @__PURE__ */ a3($, { children: [
|
|
5144
|
+
/* @__PURE__ */ a3("div", { class: "fnc-section", children: sec.title }),
|
|
5145
|
+
sec.rows.map(
|
|
5146
|
+
(row2) => "checked" in row2 ? /* @__PURE__ */ a3("label", { class: "fnc-row fnc-toggle-row", children: [
|
|
5147
|
+
/* @__PURE__ */ a3("span", { class: "fnc-toggle-label", children: row2.label }),
|
|
5148
|
+
row2.hint && /* @__PURE__ */ a3(Info, { text: row2.hint }),
|
|
5149
|
+
/* @__PURE__ */ a3("input", { type: "checkbox", role: "switch", class: "fnc-switch", checked: row2.checked, onChange: (e3) => (row2.onChange(e3.currentTarget.checked), bump((n2) => n2 + 1)) })
|
|
5150
|
+
] }) : "options" in row2 ? /* @__PURE__ */ a3("label", { class: "fnc-row fnc-toggle-row", children: [
|
|
5151
|
+
/* @__PURE__ */ a3("span", { class: "fnc-toggle-label", children: row2.label }),
|
|
5152
|
+
row2.hint && /* @__PURE__ */ a3(Info, { text: row2.hint }),
|
|
5153
|
+
/* @__PURE__ */ a3("select", { class: "fnc-settings-select fnc-app-select", value: row2.value, onChange: (e3) => (row2.onChange(e3.currentTarget.value), bump((n2) => n2 + 1)), children: row2.options.map((o4) => /* @__PURE__ */ a3("option", { value: o4.value, children: o4.label })) })
|
|
5154
|
+
] }) : /* @__PURE__ */ a3("div", { class: "fnc-row fnc-toggle-row", children: [
|
|
5155
|
+
/* @__PURE__ */ a3("span", { class: "fnc-toggle-label", children: row2.label }),
|
|
5156
|
+
row2.hint && /* @__PURE__ */ a3(Info, { text: row2.hint }),
|
|
5157
|
+
/* @__PURE__ */ a3("button", { type: "button", class: "fnc-action fnc-app-link", onClick: () => (close(), row2.onSelect()), children: row2.action })
|
|
5158
|
+
] })
|
|
5159
|
+
)
|
|
5160
|
+
] }));
|
|
5106
5161
|
const toggles = (rows) => rows.map(({ key, label, hint }) => /* @__PURE__ */ a3("label", { class: "fnc-row fnc-toggle-row", children: [
|
|
5107
5162
|
/* @__PURE__ */ a3("span", { class: "fnc-toggle-label", children: t3[label] }),
|
|
5108
5163
|
hint && /* @__PURE__ */ a3(Info, { text: t3[hint] }),
|
|
@@ -5113,6 +5168,7 @@ function SettingsDialog({ ctx }) {
|
|
|
5113
5168
|
const dialog = /* @__PURE__ */ a3("div", { class: "fnc-backdrop", onPointerDown: (e3) => e3.target === e3.currentTarget && close(), children: /* @__PURE__ */ a3("div", { class: "fnc-dialog fnc-settings-dialog", role: "dialog", "aria-modal": "true", "aria-label": t3.chartSettings, onKeyDown: (e3) => e3.key === "Escape" && close(), children: [
|
|
5114
5169
|
/* @__PURE__ */ a3("div", { class: "fnc-dialog-head", children: [
|
|
5115
5170
|
/* @__PURE__ */ a3("b", { children: t3.chartSettings }),
|
|
5171
|
+
split && /* @__PURE__ */ a3("div", { class: "fnc-seg fnc-scope-seg", role: "radiogroup", "aria-label": t3.settingsScope, children: ["one", "all"].map((k2) => /* @__PURE__ */ a3("button", { type: "button", role: "radio", "aria-checked": scope === k2, "data-tip": k2 === "one" ? t3.hintScopeOne : t3.hintScopeAll, onClick: () => pickScope(k2), children: k2 === "one" ? t3.scopeOne : t3.scopeAll })) }),
|
|
5116
5172
|
/* @__PURE__ */ a3("button", { class: "fnc-btn", "aria-label": t3.close, onClick: close, children: /* @__PURE__ */ a3(CloseIcon, {}) })
|
|
5117
5173
|
] }),
|
|
5118
5174
|
/* @__PURE__ */ a3("div", { class: "fnc-settings-body", children: [
|
|
@@ -5178,16 +5234,21 @@ function SettingsDialog({ ctx }) {
|
|
|
5178
5234
|
toggles(GRID)
|
|
5179
5235
|
] }),
|
|
5180
5236
|
shown === "scale" && /* @__PURE__ */ a3($, { children: [
|
|
5181
|
-
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.
|
|
5237
|
+
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsAxis }),
|
|
5182
5238
|
/* @__PURE__ */ a3("div", { class: "fnc-seg fnc-settings-seg", role: "radiogroup", "aria-label": t3.settingsScale, children: SCALES.map(({ mode, label }) => /* @__PURE__ */ a3("button", { type: "button", role: "radio", "aria-checked": settings.priceScale === mode, onClick: () => set({ priceScale: mode }), children: t3[label] })) }),
|
|
5183
|
-
|
|
5184
|
-
|
|
5239
|
+
toggles(AXIS_ROWS),
|
|
5240
|
+
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsPriceMarks }),
|
|
5241
|
+
toggles(PRICE_MARK_ROWS),
|
|
5242
|
+
appRows("scale")
|
|
5185
5243
|
] }),
|
|
5186
5244
|
shown === "view" && /* @__PURE__ */ a3($, { children: [
|
|
5187
|
-
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.
|
|
5245
|
+
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsShown }),
|
|
5188
5246
|
toggles(VIEW_ROWS),
|
|
5247
|
+
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsControl }),
|
|
5248
|
+
toggles(CONTROL_ROWS),
|
|
5189
5249
|
/* @__PURE__ */ a3("div", { class: "fnc-section", children: t3.settingsWatermark }),
|
|
5190
|
-
toggles(WATERMARK_ROWS)
|
|
5250
|
+
toggles(WATERMARK_ROWS),
|
|
5251
|
+
appRows("view")
|
|
5191
5252
|
] }),
|
|
5192
5253
|
shown === "split" && ctx.multi && /* @__PURE__ */ a3(SplitSettings, { multi: ctx.multi, timeLink: settings.timeLink, t: t3 }),
|
|
5193
5254
|
shown === "motion" && /* @__PURE__ */ a3($, { children: [
|
|
@@ -5218,7 +5279,7 @@ function SettingsDialog({ ctx }) {
|
|
|
5218
5279
|
/* @__PURE__ */ a3(Preview, { ctx, settings, t: t3 })
|
|
5219
5280
|
] }),
|
|
5220
5281
|
/* @__PURE__ */ a3("div", { class: "fnc-form-actions fnc-settings-actions", children: [
|
|
5221
|
-
/* @__PURE__ */ a3("button", { type: "button", class: "fnc-action fnc-action-danger", onClick: () =>
|
|
5282
|
+
/* @__PURE__ */ a3("button", { type: "button", class: "fnc-action fnc-action-danger", onClick: () => set(DEFAULT_CHART_SETTINGS), children: t3.resetDefaults }),
|
|
5222
5283
|
/* @__PURE__ */ a3("button", { type: "button", class: "fnc-action fnc-action-primary", onClick: close, children: t3.done })
|
|
5223
5284
|
] })
|
|
5224
5285
|
] }) });
|
|
@@ -5419,6 +5480,24 @@ function SplitSettings({ multi, timeLink, t: t3 }) {
|
|
|
5419
5480
|
/* @__PURE__ */ a3("div", { class: "fnc-seg fnc-settings-seg fnc-timelink-seg", role: "radiogroup", "aria-label": t3.settingsTimeLink, children: TIME_LINK_CHOICES.map(({ link, label, hint }) => /* @__PURE__ */ a3("button", { type: "button", role: "radio", "aria-checked": timeLink === link, "data-tip": t3[hint], onClick: () => multi.applySettings({ timeLink: link }), children: t3[label] })) })
|
|
5420
5481
|
] });
|
|
5421
5482
|
}
|
|
5483
|
+
var SCOPE_KEY = "fnc-settings-scope";
|
|
5484
|
+
var readScope = () => {
|
|
5485
|
+
try {
|
|
5486
|
+
return localStorage.getItem(SCOPE_KEY);
|
|
5487
|
+
} catch {
|
|
5488
|
+
return null;
|
|
5489
|
+
}
|
|
5490
|
+
};
|
|
5491
|
+
var writeScope = (v3) => {
|
|
5492
|
+
try {
|
|
5493
|
+
localStorage.setItem(SCOPE_KEY, v3);
|
|
5494
|
+
} catch {
|
|
5495
|
+
}
|
|
5496
|
+
};
|
|
5497
|
+
function useSplitCount(ctx) {
|
|
5498
|
+
const m3 = ctx.multi ? useStore(ctx.multi.store) : null;
|
|
5499
|
+
return m3 ? paneCount(LAYOUTS[m3.layout]) : 0;
|
|
5500
|
+
}
|
|
5422
5501
|
|
|
5423
5502
|
// src/components/indicator-dialogs.tsx
|
|
5424
5503
|
function Dialog({ title, onClose, children, wide }) {
|
|
@@ -7146,6 +7225,7 @@ function createPane(shell, config) {
|
|
|
7146
7225
|
drawingActions: config.drawingActions,
|
|
7147
7226
|
toolsMenuItems: config.toolsMenuItems,
|
|
7148
7227
|
settingsToggles: config.settingsToggles,
|
|
7228
|
+
settingsSections: config.settingsSections,
|
|
7149
7229
|
legendValues: config.legendValues ?? "always",
|
|
7150
7230
|
onIndicatorsClick: config.onIndicatorsClick,
|
|
7151
7231
|
slots: shell.slots,
|
|
@@ -7239,6 +7319,7 @@ function createTradingChart(container, options) {
|
|
|
7239
7319
|
priceAxisActions,
|
|
7240
7320
|
drawingActions,
|
|
7241
7321
|
settingsToggles,
|
|
7322
|
+
settingsSections,
|
|
7242
7323
|
toolsMenuItems,
|
|
7243
7324
|
legendValues,
|
|
7244
7325
|
onIndicatorsClick,
|
|
@@ -7276,6 +7357,7 @@ function createTradingChart(container, options) {
|
|
|
7276
7357
|
priceAxisActions,
|
|
7277
7358
|
drawingActions,
|
|
7278
7359
|
settingsToggles,
|
|
7360
|
+
settingsSections,
|
|
7279
7361
|
toolsMenuItems,
|
|
7280
7362
|
legendValues,
|
|
7281
7363
|
onIndicatorsClick,
|
|
@@ -7358,6 +7440,7 @@ function createMultiChart(container, options) {
|
|
|
7358
7440
|
priceAxisActions,
|
|
7359
7441
|
drawingActions,
|
|
7360
7442
|
settingsToggles,
|
|
7443
|
+
settingsSections,
|
|
7361
7444
|
toolsMenuItems,
|
|
7362
7445
|
legendValues,
|
|
7363
7446
|
onIndicatorsClick,
|
|
@@ -7440,6 +7523,7 @@ function createMultiChart(container, options) {
|
|
|
7440
7523
|
priceAxisActions,
|
|
7441
7524
|
drawingActions,
|
|
7442
7525
|
settingsToggles,
|
|
7526
|
+
settingsSections,
|
|
7443
7527
|
toolsMenuItems,
|
|
7444
7528
|
legendValues,
|
|
7445
7529
|
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, DrawingActions, IntervalGroup, LegendValues, MultiControls, PriceAxisActions, SearchCategory, SearchExchange, SettingsToggles, ToolsMenuItems, UiState, WidgetContext } from './context.js';
|
|
3
|
+
import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, MultiControls, PriceAxisActions, SearchCategory, SearchExchange, SettingsSections, SettingsToggles, 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';
|
|
@@ -24,6 +24,7 @@ export interface PaneConfig {
|
|
|
24
24
|
drawingActions?: DrawingActions | undefined;
|
|
25
25
|
toolsMenuItems?: ToolsMenuItems | undefined;
|
|
26
26
|
settingsToggles?: SettingsToggles | undefined;
|
|
27
|
+
settingsSections?: SettingsSections | undefined;
|
|
27
28
|
legendValues?: LegendValues | undefined;
|
|
28
29
|
onIndicatorsClick?: ((chart: Chart) => void) | undefined;
|
|
29
30
|
multi?: MultiControls | 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, DrawingActions, IntervalGroup, LegendValues, PriceAxisActions, SearchCategory, SearchExchange, SettingsToggles, ToolsMenuItems } from './context.js';
|
|
3
|
+
import type { ContextMenuItems, DrawingActions, IntervalGroup, LegendValues, PriceAxisActions, SearchCategory, SearchExchange, SettingsSections, SettingsToggles, 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';
|
|
@@ -66,6 +66,8 @@ export interface TradingChartOptions extends Omit<ChartOptions, 'datafeed'> {
|
|
|
66
66
|
drawingActions?: DrawingActions;
|
|
67
67
|
/** The app's own switches in 차트 설정 (e.g. extended hours for US stocks), asked when it opens. */
|
|
68
68
|
settingsToggles?: SettingsToggles;
|
|
69
|
+
/** The app's own sections in 차트 설정 (가격 축 / 표시 tabs): switches, choices, links to its dialogs. */
|
|
70
|
+
settingsSections?: SettingsSections;
|
|
69
71
|
/**
|
|
70
72
|
* Extra rows for the 도구 (tools) menu, above 차트 설정 — e.g. the app's own display settings.
|
|
71
73
|
* 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.11.
|
|
3
|
+
"version": "0.11.24",
|
|
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.11.
|
|
45
|
+
"@funnest/charts": "0.11.24"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"preact": "^11.2.0"
|