@funnest/charts-ui 0.11.65 → 0.11.66

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/i18n.d.ts CHANGED
@@ -316,6 +316,7 @@ export declare const STRINGS: {
316
316
  moreToolsDown: string;
317
317
  lockView: string;
318
318
  unlockView: string;
319
+ hideNavButtons: string;
319
320
  lockRatio: string;
320
321
  settingAutoScale: string;
321
322
  hintAutoScale: string;
@@ -722,6 +723,7 @@ export declare const STRINGS: {
722
723
  moreToolsDown: string;
723
724
  lockView: string;
724
725
  unlockView: string;
726
+ hideNavButtons: string;
725
727
  lockRatio: string;
726
728
  settingAutoScale: string;
727
729
  hintAutoScale: string;
package/dist/index.js CHANGED
@@ -751,6 +751,7 @@ var STRINGS = {
751
751
  moreToolsDown: "\uC544\uB798 \uB3C4\uAD6C \uB354 \uBCF4\uAE30",
752
752
  lockView: "\uCC28\uD2B8 \uACE0\uC815",
753
753
  unlockView: "\uCC28\uD2B8 \uACE0\uC815 \uD480\uAE30",
754
+ hideNavButtons: "\uD655\uB300\xB7\uC774\uB3D9 \uBC84\uD2BC \uC228\uAE30\uAE30 (\uCC28\uD2B8 \uC124\uC815\uC5D0\uC11C \uB2E4\uC2DC \uCF1C\uC694)",
754
755
  lockRatio: "\uAC00\uACA9 \uCD95 \uBE44\uC728 \uACE0\uC815",
755
756
  settingAutoScale: "\uC790\uB3D9 \uB9DE\uCDA4",
756
757
  hintAutoScale: "\uD654\uBA74\uC5D0 \uBCF4\uC774\uB294 \uCE94\uB4E4\uC5D0 \uB9DE\uCDB0 \uAC00\uACA9 \uCD95\uC744 \uB298\uC774\uACE0 \uC904\uC5EC\uC694. \uAC00\uACA9 \uCD95\uC744 \uB04C\uC5B4 \uC9C1\uC811 \uB9DE\uCD94\uBA74 \uAEBC\uC9C0\uACE0, \uAC00\uACA9 \uCD95\uC744 \uB354\uBE14\uD074\uB9AD\uD558\uBA74 \uB2E4\uC2DC \uCF1C\uC838\uC694.",
@@ -1159,6 +1160,7 @@ var STRINGS = {
1159
1160
  moreToolsDown: "More tools below",
1160
1161
  lockView: "Lock chart",
1161
1162
  unlockView: "Unlock chart",
1163
+ hideNavButtons: "Hide zoom & scroll buttons (turn them back on in chart settings)",
1162
1164
  lockRatio: "Lock price to bar ratio",
1163
1165
  settingAutoScale: "Auto (fit to screen)",
1164
1166
  hintAutoScale: "The price axis stretches to fit the candles on screen. Dragging the axis turns it off; double-click the axis to turn it back on.",
@@ -2078,8 +2080,11 @@ var CSS = (
2078
2080
  opacity: 0;
2079
2081
  transition: opacity 0.15s;
2080
2082
  }
2081
- .fnc-body:hover .fnc-nav, .fnc-nav:focus-within { opacity: 1; }
2083
+ /* Shown while the mouse is near the chart's bottom (overlay.tsx): unseen, they don't take clicks either. */
2084
+ .fnc-nav.is-near, .fnc-nav:focus-within { opacity: 1; }
2085
+ .fnc-nav:not(.is-near):not(:focus-within):not(.fnc-nav-locked) .fnc-btn { pointer-events: none; }
2082
2086
  .fnc-nav .fnc-btn { width: 32px; height: 32px; }
2087
+ .fnc-nav .fnc-sep { align-self: center; height: 18px; margin: 0 1px; }
2083
2088
  .fnc-realtime {
2084
2089
  position: absolute;
2085
2090
  display: flex;
@@ -2491,9 +2496,6 @@ var CSS = (
2491
2496
  .fnc-resizing-x, .fnc-resizing-x * { cursor: col-resize !important; user-select: none; }
2492
2497
  .fnc-resizing-y, .fnc-resizing-y * { cursor: row-resize !important; user-select: none; }
2493
2498
  .fnc-parking { display: none; }
2494
- /* Navigation controls follow the hovered pane, not the whole widget. */
2495
- .fnc-multi .fnc-body:hover .fnc-nav { opacity: 0; }
2496
- .fnc-multi .fnc-stage:hover .fnc-nav, .fnc-multi .fnc-nav:focus-within { opacity: 1; }
2497
2499
  .fnc-pane-max {
2498
2500
  position: absolute;
2499
2501
  top: 6px;
@@ -8315,6 +8317,7 @@ function PriceAxisPlus({ ctx }) {
8315
8317
  // src/components/overlay.tsx
8316
8318
  var ZOOM_STEP = 1.25;
8317
8319
  var CONTROL_OFFSET = 52;
8320
+ var NAV_NEAR = 100;
8318
8321
  var dirClass = (v3) => v3 > 0 ? "fnc-up" : v3 < 0 ? "fnc-down" : "fnc-flat";
8319
8322
  function IndicatorControls({ ctx, id, controls }) {
8320
8323
  const set = (key, value) => ctx.chart.setIndicatorControl(id, key, value);
@@ -8721,14 +8724,35 @@ function NavControls({ ctx }) {
8721
8724
  }),
8722
8725
  [ctx.chart]
8723
8726
  );
8727
+ const nav = T2(null);
8728
+ const [near, setNear] = d2(false);
8724
8729
  const { plotWidth, panesHeight } = s3.layout;
8730
+ const shown = (showButtons || locked) && !(s3.replay.active || s3.replay.selecting);
8731
+ A2(() => {
8732
+ const overlay = nav.current?.closest(".fnc-overlay");
8733
+ const host = overlay?.parentElement;
8734
+ if (!shown || !overlay || !host) return;
8735
+ const move = (e3) => {
8736
+ if (e3.pointerType !== "mouse") return;
8737
+ const r3 = overlay.getBoundingClientRect();
8738
+ const x2 = e3.clientX - r3.left;
8739
+ const y3 = e3.clientY - r3.top;
8740
+ setNear(x2 >= 0 && x2 <= plotWidth && y3 >= panesHeight - NAV_NEAR && y3 <= panesHeight + 30);
8741
+ };
8742
+ const leave = () => setNear(false);
8743
+ host.addEventListener("pointermove", move);
8744
+ host.addEventListener("pointerleave", leave);
8745
+ return () => {
8746
+ host.removeEventListener("pointermove", move);
8747
+ host.removeEventListener("pointerleave", leave);
8748
+ };
8749
+ }, [shown, plotWidth, panesHeight]);
8725
8750
  if (plotWidth <= 0) return null;
8726
8751
  const top = panesHeight - CONTROL_OFFSET;
8727
8752
  const page = () => Math.max(1, Math.round(plotWidth / ctx.chart.timeScale.barSpacing / 3));
8728
8753
  const button = (label, onClick, icon) => /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": label, "aria-label": label, onClick, children: icon });
8729
- const replaying = s3.replay.active || s3.replay.selecting;
8730
8754
  return /* @__PURE__ */ a3($, { children: [
8731
- (showButtons || locked) && !replaying && /* @__PURE__ */ a3("div", { class: locked ? "fnc-nav fnc-nav-locked" : "fnc-nav", style: { left: `${plotWidth / 2}px`, top: `${top}px` }, children: [
8755
+ shown && /* @__PURE__ */ a3("div", { ref: nav, class: `fnc-nav${locked ? " fnc-nav-locked" : ""}${near ? " is-near" : ""}`, style: { left: `${plotWidth / 2}px`, top: `${top}px` }, children: [
8732
8756
  !locked && button(t3.zoomOut, () => ctx.chart.zoom(1 / ZOOM_STEP), /* @__PURE__ */ a3(MinusIcon, {})),
8733
8757
  !locked && button(t3.zoomIn, () => ctx.chart.zoom(ZOOM_STEP), /* @__PURE__ */ a3(PlusIcon, {})),
8734
8758
  !locked && button(t3.scrollBack, () => ctx.chart.scrollBars(-page()), /* @__PURE__ */ a3(ChevronLeftIcon, {})),
@@ -8744,7 +8768,11 @@ function NavControls({ ctx }) {
8744
8768
  onClick: () => ctx.chart.setSettings({ lockView: !locked }),
8745
8769
  children: /* @__PURE__ */ a3(LockIcon, { open: !locked })
8746
8770
  }
8747
- )
8771
+ ),
8772
+ !locked && /* @__PURE__ */ a3($, { children: [
8773
+ /* @__PURE__ */ a3("div", { class: "fnc-sep" }),
8774
+ button(t3.hideNavButtons, () => ctx.chart.setSettings({ navigationButtons: false }), /* @__PURE__ */ a3(SmallCloseIcon, {}))
8775
+ ] })
8748
8776
  ] }),
8749
8777
  !s3.atRealtime && /* @__PURE__ */ a3(
8750
8778
  "button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-ui",
3
- "version": "0.11.65",
3
+ "version": "0.11.66",
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.65"
45
+ "@funnest/charts": "0.11.66"
46
46
  },
47
47
  "devDependencies": {
48
48
  "preact": "^11.2.0"