@stll/folio-react 0.13.1 → 0.13.3
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as containedHandler } from "./renderAsync-
|
|
1
|
+
import { d as containedHandler } from "./renderAsync-DWI5zwPp.js";
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { CheckIcon, MoreVerticalIcon } from "lucide-react";
|
|
4
4
|
import { useLocale, useTranslations } from "use-intl";
|
package/dist/compat/eigenpal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-
|
|
1
|
+
import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-DWI5zwPp.js";
|
|
2
2
|
import { t as messages_exports } from "../messages.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { forwardRef } from "react";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as formatZoom, c as FormattingBar, i as clampZoom, l as ZoomControl, n as DocxEditor, o as parseZoom, r as ZOOM_PRESETS, s as useWheelZoom, t as renderAsync, u as AutocompleteCaretOverlay } from "./renderAsync-
|
|
1
|
+
import { a as formatZoom, c as FormattingBar, i as clampZoom, l as ZoomControl, n as DocxEditor, o as parseZoom, r as ZOOM_PRESETS, s as useWheelZoom, t as renderAsync, u as AutocompleteCaretOverlay } from "./renderAsync-DWI5zwPp.js";
|
|
2
2
|
import { n as FolioUIProvider } from "./folio-ui-BgDDRsUX.js";
|
|
3
3
|
import { t as FindReplaceDialog } from "./FindReplaceDialog-CqKK82nE.js";
|
|
4
4
|
import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-CixRdIiT.js";
|
|
@@ -52,7 +52,7 @@ import { documentFontsAreLoaded, getDocumentFontSet, waitForInitialLayoutFonts }
|
|
|
52
52
|
import { getFootnoteText } from "@stll/folio-core/docx/footnoteParser";
|
|
53
53
|
import { convertHeaderFooterPmDocToContent, convertHeaderFooterToContent } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
|
|
54
54
|
import { templatePreviewDirtyRange } from "@stll/folio-core/layout-bridge/convert/templatePreviewFlow";
|
|
55
|
-
import { clickToPositionDom,
|
|
55
|
+
import { clickToPositionDom, findCollapsedLineEdgeCaretTarget } from "@stll/folio-core/layout-bridge/dom/clickToPositionDom";
|
|
56
56
|
import { resetImeCaretAnchor, syncImeCaretAnchor } from "@stll/folio-core/layout-bridge/dom/imeCaretAnchor";
|
|
57
57
|
import { findBodyEmptyRuns, findBodyPmAnchor, findBodyPmAnchors, findBodyPmSpans } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
|
|
58
58
|
import { clickToPositionInHfSlot, findHfCaretSpan, findHfPmSpans, findHfSlotForTarget, findHfSlotKindForTarget } from "@stll/folio-core/layout-bridge/dom/findHfPmSpans";
|
|
@@ -3529,6 +3529,13 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
3529
3529
|
if (!overlay) return null;
|
|
3530
3530
|
const overlayRect = overlay.getBoundingClientRect();
|
|
3531
3531
|
const spans = findBodyPmSpans(pagesContainerRef.current);
|
|
3532
|
+
const collapsedTarget = findCollapsedLineEdgeCaretTarget(spans, pmPos_0);
|
|
3533
|
+
if (collapsedTarget) return {
|
|
3534
|
+
x: (collapsedTarget.geometry.left - overlayRect.left) / currentZoom,
|
|
3535
|
+
y: (collapsedTarget.geometry.top - overlayRect.top) / currentZoom,
|
|
3536
|
+
height: getLineHeight(collapsedTarget.span),
|
|
3537
|
+
pageIndex: getPageIndex(collapsedTarget.span)
|
|
3538
|
+
};
|
|
3532
3539
|
for (const spanEl of spans) {
|
|
3533
3540
|
const pmStart = Number(spanEl.dataset["pmStart"]);
|
|
3534
3541
|
const pmEnd = Number(spanEl.dataset["pmEnd"]);
|
|
@@ -3554,13 +3561,6 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
3554
3561
|
};
|
|
3555
3562
|
}
|
|
3556
3563
|
if (pmPos_0 >= pmStart && pmPos_0 <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
3557
|
-
const collapsedGeometry = getCollapsedLineEdgeCaretGeometry(spanEl);
|
|
3558
|
-
if (collapsedGeometry) return {
|
|
3559
|
-
x: (collapsedGeometry.left - overlayRect.left) / currentZoom,
|
|
3560
|
-
y: (collapsedGeometry.top - overlayRect.top) / currentZoom,
|
|
3561
|
-
height: getLineHeight(spanEl),
|
|
3562
|
-
pageIndex: getPageIndex(spanEl)
|
|
3563
|
-
};
|
|
3564
3564
|
const textNode = spanEl.firstChild;
|
|
3565
3565
|
const charIndex = Math.min(pmPos_0 - pmStart, textNode.length);
|
|
3566
3566
|
const range = spanEl.ownerDocument.createRange();
|
|
@@ -12593,7 +12593,7 @@ function useFolioComments({ doc, autoOpenReviewSidebar, anchorPositions, editorC
|
|
|
12593
12593
|
* - Error boundary
|
|
12594
12594
|
* - Loading states
|
|
12595
12595
|
*/
|
|
12596
|
-
const CommentsSidebar = lazy(() => import("./CommentsSidebar-
|
|
12596
|
+
const CommentsSidebar = lazy(() => import("./CommentsSidebar-Dlm746vL.js").then((m) => ({ default: m.CommentsSidebar })));
|
|
12597
12597
|
const TextContextMenu = lazy(() => import("./TextContextMenu-Ci7-M4oU.js").then((m) => ({ default: m.TextContextMenu })));
|
|
12598
12598
|
const loadAttemptSelectiveSave = async () => {
|
|
12599
12599
|
const { attemptSelectiveSave } = await import("@stll/folio-core/docx/selectiveSave");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-react",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"description": "React editor for folio: a Word-document (.docx) editor for the browser, built on @stll/folio-core and ProseMirror.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"document-editor",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@fontsource/noto-sans-arabic": "^5.2.7",
|
|
69
69
|
"@fontsource/source-sans-3": "^5.2.9",
|
|
70
70
|
"@fontsource/tinos": "^5.2.7",
|
|
71
|
-
"@stll/folio-core": "^0.
|
|
71
|
+
"@stll/folio-core": "^0.16.0",
|
|
72
72
|
"better-result": "2.10.0",
|
|
73
73
|
"lucide-react": "1.24.0",
|
|
74
74
|
"prosemirror-history": "^1.5.0",
|