@bendyline/squisq-editor-react 2.11.9 → 2.11.10

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.
@@ -3664,6 +3664,7 @@ function PreviewToolbarControls({ displayMode } = {}) {
3664
3664
  const popoverRef = useRef6(null);
3665
3665
  const popoverTriggerRef = useRef6(null);
3666
3666
  const popoverPanelRef = useRef6(null);
3667
+ const popoverPointerEventRef = useRef6(null);
3667
3668
  const [popoverAnchor, setPopoverAnchor] = useState7(null);
3668
3669
  const updatePopoverPosition = useCallback7(() => {
3669
3670
  const trigger = popoverTriggerRef.current;
@@ -3712,6 +3713,7 @@ function PreviewToolbarControls({ displayMode } = {}) {
3712
3713
  useEffect7(() => {
3713
3714
  if (!popoverOpen) return;
3714
3715
  const handler = (e2) => {
3716
+ if (e2 === popoverPointerEventRef.current) return;
3715
3717
  const target = e2.target;
3716
3718
  if (popoverRef.current?.contains(target)) return;
3717
3719
  if (popoverPanelRef.current?.contains(target)) return;
@@ -4016,36 +4018,46 @@ function PreviewToolbarControls({ displayMode } = {}) {
4016
4018
  children: [
4017
4019
  /* @__PURE__ */ jsx7("div", { className: "squisq-preview-controls-probe", ref: probeRef, "aria-hidden": "true", children: controlKeys.map((key) => renderControl(key, false)) }),
4018
4020
  visibleKeys.length > 0 && /* @__PURE__ */ jsx7("div", { className: "squisq-preview-controls-inline", children: visibleKeys.map((key) => renderControl(key, false)) }),
4019
- hasOverflow && /* @__PURE__ */ jsxs6("div", { className: "squisq-preview-controls-compact", ref: popoverRef, children: [
4020
- /* @__PURE__ */ jsx7(
4021
- "button",
4022
- {
4023
- ref: popoverTriggerRef,
4024
- className: `squisq-toolbar-button${popoverOpen ? " squisq-toolbar-button--active" : ""}`,
4025
- onClick: () => {
4026
- if (popoverOpen) {
4027
- closePopover();
4028
- return;
4021
+ hasOverflow && /* @__PURE__ */ jsxs6(
4022
+ "div",
4023
+ {
4024
+ className: "squisq-preview-controls-compact",
4025
+ ref: popoverRef,
4026
+ onMouseDown: (event) => {
4027
+ popoverPointerEventRef.current = event.nativeEvent;
4028
+ },
4029
+ children: [
4030
+ /* @__PURE__ */ jsx7(
4031
+ "button",
4032
+ {
4033
+ ref: popoverTriggerRef,
4034
+ className: `squisq-toolbar-button${popoverOpen ? " squisq-toolbar-button--active" : ""}`,
4035
+ onClick: () => {
4036
+ if (popoverOpen) {
4037
+ closePopover();
4038
+ return;
4039
+ }
4040
+ updatePopoverPosition();
4041
+ setPopoverOpen(true);
4042
+ },
4043
+ "aria-label": "More preview settings",
4044
+ title: "More preview settings",
4045
+ "aria-expanded": popoverOpen,
4046
+ children: /* @__PURE__ */ jsx7(Icon, { icon: "fa-solid fa-ellipsis" })
4029
4047
  }
4030
- updatePopoverPosition();
4031
- setPopoverOpen(true);
4032
- },
4033
- "aria-label": "More preview settings",
4034
- title: "More preview settings",
4035
- "aria-expanded": popoverOpen,
4036
- children: /* @__PURE__ */ jsx7(Icon, { icon: "fa-solid fa-ellipsis" })
4037
- }
4038
- ),
4039
- popoverOpen && popoverAnchor && /* @__PURE__ */ jsx7(
4040
- "div",
4041
- {
4042
- ref: popoverPanelRef,
4043
- className: "squisq-preview-controls-popover",
4044
- style: { top: popoverAnchor.top, left: popoverAnchor.left },
4045
- children: overflowKeys.map((key) => renderControl(key, true))
4046
- }
4047
- )
4048
- ] })
4048
+ ),
4049
+ popoverOpen && popoverAnchor && /* @__PURE__ */ jsx7(
4050
+ "div",
4051
+ {
4052
+ ref: popoverPanelRef,
4053
+ className: "squisq-preview-controls-popover",
4054
+ style: { top: popoverAnchor.top, left: popoverAnchor.left },
4055
+ children: overflowKeys.map((key) => renderControl(key, true))
4056
+ }
4057
+ )
4058
+ ]
4059
+ }
4060
+ )
4049
4061
  ]
4050
4062
  }
4051
4063
  );
package/dist/index.js CHANGED
@@ -219,7 +219,7 @@ import {
219
219
  useTreeViewData,
220
220
  viewStateFromBinding,
221
221
  writeHeadingViewState
222
- } from "./chunk-MDW5NY3Q.js";
222
+ } from "./chunk-5ZA7YMCP.js";
223
223
  import {
224
224
  EditorProvider,
225
225
  detectLanguageFromFileName,
@@ -5,7 +5,7 @@ import {
5
5
  RawEditor,
6
6
  WysiwygEditor,
7
7
  useEditorContextMenuItems
8
- } from "../chunk-MDW5NY3Q.js";
8
+ } from "../chunk-5ZA7YMCP.js";
9
9
  import {
10
10
  EditorProvider,
11
11
  useEditorContext
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-editor-react",
3
- "version": "2.11.9",
3
+ "version": "2.11.10",
4
4
  "description": "React editor shell with raw/WYSIWYG/preview modes for Squisq documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",