tiptap-markdown-react 0.16.0 → 0.16.1
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/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import Image from "@tiptap/extension-image";
|
|
|
10
10
|
import { TableOfContents } from "@tiptap/extension-table-of-contents";
|
|
11
11
|
import { NodeViewWrapper, ReactNodeViewRenderer, useEditorState, ReactRenderer, NodeViewContent, useEditor, EditorContent } from "@tiptap/react";
|
|
12
12
|
import { createPortal } from "react-dom";
|
|
13
|
-
import { useState, useEffect, useCallback, useRef, useMemo, forwardRef, useImperativeHandle, Fragment as Fragment$1, useId, useContext, createContext } from "react";
|
|
13
|
+
import { useState, useEffect, useCallback, useRef, useMemo, forwardRef, useImperativeHandle, Fragment as Fragment$1, useLayoutEffect, useId, useContext, createContext } from "react";
|
|
14
14
|
import { e as enrichMarkdownCitations, c as styles$8 } from "./ReportContent-CwcppHl8.js";
|
|
15
15
|
import { R as R2, a as a2, b as b2, s as s2 } from "./ReportContent-CwcppHl8.js";
|
|
16
16
|
import { C as CitationRef, i as mergeCommentIntervals, h as mapCommentAnchors, p as prepareChartMarkdown, j as reportChart, b as baseExtensions, f as CommentMark, l as lowlight, m as makeTocGetId, k as parseCodeTokenAsChartOrCodeBlock, a as pureCodeBlock, c as pureImage, n as renderMathInto, o as subscribeMathClick, d as pureChart } from "./extractToc-CheLC9kh.js";
|
|
@@ -2345,7 +2345,14 @@ const MarkdownWysiwygEditor = forwardRef(function MarkdownWysiwygEditor2({
|
|
|
2345
2345
|
() => ({ ...defaultShortcutLabels, ...shortcutLabels }),
|
|
2346
2346
|
[shortcutLabels]
|
|
2347
2347
|
);
|
|
2348
|
-
const shortcutFabTarget =
|
|
2348
|
+
const [shortcutFabTarget, setShortcutFabTarget] = useState(
|
|
2349
|
+
null
|
|
2350
|
+
);
|
|
2351
|
+
const useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
2352
|
+
useIsoLayoutEffect(() => {
|
|
2353
|
+
const target = typeof shortcutFabContainer === "function" ? shortcutFabContainer() : shortcutFabContainer ?? null;
|
|
2354
|
+
setShortcutFabTarget((prev) => prev === target ? prev : target);
|
|
2355
|
+
});
|
|
2349
2356
|
const shortcutFabNode = shortcutPanel && editable ? /* @__PURE__ */ jsx(
|
|
2350
2357
|
"button",
|
|
2351
2358
|
{
|