@funnest/charts-ui 0.11.57 → 0.11.59

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.
Files changed (2) hide show
  1. package/dist/index.js +18 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -4040,6 +4040,7 @@ function toolGroups(defs) {
4040
4040
  }
4041
4041
  return [...groups];
4042
4042
  }
4043
+ var touchDevice = () => typeof matchMedia === "function" && matchMedia("(hover: none)").matches;
4043
4044
  function ToolGroup({
4044
4045
  ctx,
4045
4046
  tools,
@@ -4061,7 +4062,7 @@ function ToolGroup({
4061
4062
  A2(() => {
4062
4063
  if (!open) setSheet(false);
4063
4064
  }, [open]);
4064
- const pointer = (e3) => finger.current = e3.pointerType !== "mouse";
4065
+ const pointer = (e3) => finger.current = e3.pointerType !== "mouse" && touchDevice();
4065
4066
  const openSheet = () => {
4066
4067
  setSheet(true);
4067
4068
  onOpen(true);
@@ -4526,6 +4527,20 @@ function SelectionBar({ ctx }) {
4526
4527
  const [menu, setMenu] = d2(null);
4527
4528
  const [templates, setTemplates] = d2(() => readJson(TEMPLATES_KEY, {}));
4528
4529
  const [naming, setNaming] = d2(null);
4530
+ const bar = T2(null);
4531
+ F2(() => {
4532
+ const pop = bar.current?.querySelector(".fnc-selbar-pop");
4533
+ if (!pop || !bar.current) return;
4534
+ pop.style.maxHeight = "";
4535
+ const host = ctx.root.getBoundingClientRect();
4536
+ const r3 = pop.getBoundingClientRect();
4537
+ const up = r3.bottom <= bar.current.getBoundingClientRect().top + 1;
4538
+ const room = up ? r3.bottom - Math.max(host.top, 0) - 8 : Math.min(host.bottom, innerHeight) - r3.top - 8;
4539
+ if (r3.height > room) {
4540
+ pop.style.maxHeight = `${Math.max(120, Math.floor(room))}px`;
4541
+ pop.style.overflowY = "auto";
4542
+ }
4543
+ }, [menu]);
4529
4544
  if (!d3 || s3.layout.plotWidth <= 0) return null;
4530
4545
  const def = ctx.chart.drawingDefinitions().find((x2) => x2.type === d3.type);
4531
4546
  const style = d3.style ?? {};
@@ -4598,7 +4613,7 @@ function SelectionBar({ ctx }) {
4598
4613
  document.addEventListener("pointermove", move);
4599
4614
  document.addEventListener("pointerup", up);
4600
4615
  };
4601
- return /* @__PURE__ */ a3("div", { class: "fnc-selbar", role: "toolbar", style: { left: `${s3.layout.plotWidth / 2 + offset[0]}px`, top: `${8 + offset[1]}px` }, children: [
4616
+ return /* @__PURE__ */ a3("div", { ref: bar, class: "fnc-selbar", role: "toolbar", style: { left: `${s3.layout.plotWidth / 2 + offset[0]}px`, top: `${8 + offset[1]}px` }, children: [
4602
4617
  /* @__PURE__ */ a3(
4603
4618
  "button",
4604
4619
  {
@@ -8049,7 +8064,7 @@ function useRowTouch(onLong) {
8049
8064
  ref: row2,
8050
8065
  onPointerDown: (e3) => {
8051
8066
  const p3 = press.current;
8052
- p3.touch = e3.pointerType !== "mouse";
8067
+ p3.touch = e3.pointerType !== "mouse" && typeof matchMedia === "function" && matchMedia("(hover: none)").matches;
8053
8068
  p3.long = false;
8054
8069
  stop();
8055
8070
  if (!p3.touch || !onLong || e3.target.closest(".fnc-ind-actions, .fnc-ind-eye, .fnc-ind-controls")) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-ui",
3
- "version": "0.11.57",
3
+ "version": "0.11.59",
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.57"
45
+ "@funnest/charts": "0.11.59"
46
46
  },
47
47
  "devDependencies": {
48
48
  "preact": "^11.2.0"