@funnest/charts-ui 0.6.14 → 0.6.15

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 CHANGED
@@ -80,6 +80,8 @@ export interface WidgetContext {
80
80
  intervalGroups: readonly IntervalGroup[];
81
81
  searchCategories: readonly SearchCategory[];
82
82
  searchExchanges: readonly SearchExchange[];
83
+ /** Rows per exchange before a "모두 보기" (0: all). */
84
+ searchPreviewPerExchange: number;
83
85
  /** IANA zone used for the status-bar clock (KST for Korean users by default). */
84
86
  displayTimezone: string;
85
87
  showLogo: boolean;
package/dist/i18n.d.ts CHANGED
@@ -124,6 +124,7 @@ export declare const STRINGS: {
124
124
  allSymbols: string;
125
125
  favorites: string;
126
126
  exchanges: string;
127
+ showAllIn: string;
127
128
  noFavorites: string;
128
129
  navigate: string;
129
130
  openAction: string;
@@ -268,6 +269,7 @@ export declare const STRINGS: {
268
269
  allSymbols: string;
269
270
  favorites: string;
270
271
  exchanges: string;
272
+ showAllIn: string;
271
273
  noFavorites: string;
272
274
  navigate: string;
273
275
  openAction: string;
package/dist/index.js CHANGED
@@ -549,6 +549,7 @@ var STRINGS = {
549
549
  allSymbols: "\uC804\uCCB4",
550
550
  favorites: "\uC990\uACA8\uCC3E\uAE30",
551
551
  exchanges: "\uAC70\uB798\uC18C",
552
+ showAllIn: "{exchange} {n}\uAC1C \uBAA8\uB450 \uBCF4\uAE30 \u203A",
552
553
  noFavorites: "\uC990\uACA8\uCC3E\uAE30\uD55C \uC885\uBAA9\uC774 \uC5C6\uC5B4\uC694. \u2606\uB97C \uB20C\uB7EC \uCD94\uAC00\uD574 \uBCF4\uC138\uC694",
553
554
  navigate: "\uC774\uB3D9",
554
555
  openAction: "\uC5F4\uAE30",
@@ -693,6 +694,7 @@ var STRINGS = {
693
694
  allSymbols: "All",
694
695
  favorites: "Favorites",
695
696
  exchanges: "Exchanges",
697
+ showAllIn: "All {n} on {exchange} \u203A",
696
698
  noFavorites: "No favorites yet \u2014 tap \u2606 to add one",
697
699
  navigate: "navigate",
698
700
  openAction: "open",
@@ -1934,8 +1936,25 @@ function SymbolSearch({ ctx }) {
1934
1936
  const favoriteRows = filter(favorites).filter((f4) => !q2 || f4.name.toLowerCase().includes(q2) || f4.symbol.toLowerCase().includes(q2));
1935
1937
  const showRecent = view.kind === "all" && !q2 && recent.length > 0;
1936
1938
  const recentRows = showRecent ? filter(recent) : [];
1937
- const resultRows = view.kind === "favorites" ? favoriteRows : filter(results ?? []);
1939
+ const allResults = view.kind === "favorites" ? favoriteRows : filter(results ?? []);
1940
+ const preview = ctx.searchPreviewPerExchange;
1941
+ const more = /* @__PURE__ */ new Map();
1942
+ let resultRows = allResults;
1943
+ if (preview > 0 && view.kind === "all" && !exchange) {
1944
+ const seen = /* @__PURE__ */ new Map();
1945
+ const total = /* @__PURE__ */ new Map();
1946
+ for (const r3 of allResults) total.set(r3.exchange, (total.get(r3.exchange) ?? 0) + 1);
1947
+ resultRows = [];
1948
+ for (const r3 of allResults) {
1949
+ const n2 = (seen.get(r3.exchange) ?? 0) + 1;
1950
+ seen.set(r3.exchange, n2);
1951
+ if (n2 > preview) continue;
1952
+ resultRows.push(r3);
1953
+ if (n2 === preview && (total.get(r3.exchange) ?? 0) > preview) more.set(resultRows.length - 1, { exchange: r3.exchange, count: total.get(r3.exchange) });
1954
+ }
1955
+ }
1938
1956
  const rows = [...recentRows, ...resultRows];
1957
+ const exchangeLabel = (name) => ctx.searchExchanges.find((e3) => e3.name === name)?.label?.[locale] ?? name;
1939
1958
  A2(() => setActive(0), [query, category, exchange, view, results]);
1940
1959
  A2(() => {
1941
1960
  listRef.current?.querySelector(`[data-index="${active}"]`)?.scrollIntoView({ block: "nearest" });
@@ -2085,7 +2104,13 @@ function SymbolSearch({ ctx }) {
2085
2104
  ] }),
2086
2105
  recentRows.map((info, i3) => row2(info, i3, true)),
2087
2106
  (recentRows.length > 0 || view.kind === "favorites") && /* @__PURE__ */ a3("div", { class: "fnc-sr-section", children: view.kind === "favorites" ? t3.favorites : t3.symbols }),
2088
- loading && !results && view.kind === "all" ? Array.from({ length: 6 }, () => /* @__PURE__ */ a3("div", { class: "fnc-sr-skeleton", "aria-hidden": "true" })) : resultRows.map((info, i3) => row2(info, recentRows.length + i3, false)),
2107
+ loading && !results && view.kind === "all" ? Array.from({ length: 6 }, () => /* @__PURE__ */ a3("div", { class: "fnc-sr-skeleton", "aria-hidden": "true" })) : resultRows.map((info, i3) => {
2108
+ const m3 = more.get(i3);
2109
+ return m3 ? /* @__PURE__ */ a3($, { children: [
2110
+ row2(info, recentRows.length + i3, false),
2111
+ /* @__PURE__ */ a3("button", { class: "fnc-sr-more", onClick: () => (setView({ kind: "all" }), setExchange(m3.exchange)), children: t3.showAllIn.replace("{exchange}", exchangeLabel(m3.exchange)).replace("{n}", m3.count.toLocaleString(locale === "ko" ? "ko-KR" : "en-US")) })
2112
+ ] }) : row2(info, recentRows.length + i3, false);
2113
+ }),
2089
2114
  !loading && rows.length === 0 && /* @__PURE__ */ a3("div", { class: "fnc-empty", children: view.kind === "favorites" && favorites.length === 0 ? t3.noFavorites : t3.noResults })
2090
2115
  ] })
2091
2116
  ] }),
@@ -3228,6 +3253,8 @@ var CSS = (
3228
3253
  .fnc-sr-side-item em { font-style: normal; font-size: 12px; color: var(--fnc-text-2); }
3229
3254
  .fnc-sr-side-logo { flex: none; width: 18px; height: 18px; border-radius: 5px; object-fit: cover; background: var(--fnc-surface); }
3230
3255
  .fnc-sr-spark-slot { display: inline-flex; flex: none; width: 72px; height: 24px; }
3256
+ .fnc-sr-more { display: block; width: calc(100% - 16px); margin: 2px 8px 8px; padding: 8px 12px; border-radius: var(--fnc-radius); background: var(--fnc-surface); color: var(--fnc-text-2); font-size: 13px; font-weight: 600; text-align: left; }
3257
+ .fnc-sr-more:hover { color: var(--fnc-text); }
3231
3258
  .fnc-sr-side-item:hover { background: var(--fnc-surface); }
3232
3259
  .fnc-sr-side-item[aria-pressed='true'] { background: var(--fnc-surface); font-weight: 700; }
3233
3260
  .fnc-chip-token {
@@ -4255,6 +4282,7 @@ function createPane(shell, config) {
4255
4282
  intervalGroups: config.intervalGroups,
4256
4283
  searchCategories: config.searchCategories,
4257
4284
  searchExchanges: config.searchExchanges ?? [],
4285
+ searchPreviewPerExchange: config.searchPreviewPerExchange ?? 0,
4258
4286
  displayTimezone: config.displayTimezone,
4259
4287
  showLogo: config.symbolLogo,
4260
4288
  searchHotkey: config.searchHotkey,
@@ -4330,6 +4358,7 @@ function createTradingChart(container, options) {
4330
4358
  onFavoriteIntervalsChange,
4331
4359
  searchCategories = DEFAULT_SEARCH_CATEGORIES,
4332
4360
  searchExchanges = [],
4361
+ searchPreviewPerExchange = 0,
4333
4362
  storageKey = "funnest-charts",
4334
4363
  searchHotkey = true,
4335
4364
  symbolLogo = true,
@@ -4360,6 +4389,7 @@ function createTradingChart(container, options) {
4360
4389
  intervalGroups,
4361
4390
  searchCategories,
4362
4391
  searchExchanges,
4392
+ searchPreviewPerExchange,
4363
4393
  symbolLogo,
4364
4394
  searchHotkey,
4365
4395
  drawingToolbar,
@@ -4430,6 +4460,7 @@ function createMultiChart(container, options) {
4430
4460
  onFavoriteIntervalsChange,
4431
4461
  searchCategories = DEFAULT_SEARCH_CATEGORIES,
4432
4462
  searchExchanges = [],
4463
+ searchPreviewPerExchange = 0,
4433
4464
  storageKey = "funnest-charts",
4434
4465
  searchHotkey = true,
4435
4466
  symbolLogo = true,
@@ -4501,6 +4532,7 @@ function createMultiChart(container, options) {
4501
4532
  intervalGroups,
4502
4533
  searchCategories,
4503
4534
  searchExchanges,
4535
+ searchPreviewPerExchange,
4504
4536
  symbolLogo,
4505
4537
  searchHotkey,
4506
4538
  drawingToolbar,
package/dist/pane.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface PaneConfig {
12
12
  intervalGroups: readonly IntervalGroup[];
13
13
  searchCategories: readonly SearchCategory[];
14
14
  searchExchanges?: readonly SearchExchange[];
15
+ searchPreviewPerExchange?: number;
15
16
  symbolLogo: boolean;
16
17
  drawingToolbar: boolean;
17
18
  attribution: boolean;
@@ -24,6 +24,11 @@ export interface TradingChartOptions extends Omit<ChartOptions, 'datafeed'> {
24
24
  searchCategories?: readonly SearchCategory[];
25
25
  /** Exchanges listed in the symbol search sidebar from the start, with logos (counts fill in as results come). */
26
26
  searchExchanges?: readonly SearchExchange[];
27
+ /**
28
+ * Symbol search: rows per exchange shown at first, each followed by "N개 모두 보기" when there
29
+ * are more (picking the exchange lists them all). Default 0: everything at once.
30
+ */
31
+ searchPreviewPerExchange?: number;
27
32
  /**
28
33
  * localStorage key prefix for UI preferences (favorite intervals, recent searches).
29
34
  * Default 'funnest-charts'. Pass null to keep them in memory only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-ui",
3
- "version": "0.6.14",
3
+ "version": "0.6.15",
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.6.14"
45
+ "@funnest/charts": "0.6.15"
46
46
  },
47
47
  "devDependencies": {
48
48
  "preact": "^11.2.0"