@stll/folio-react 0.19.4 → 0.19.5
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-CkF394Ug.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-CkF394Ug.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-CkF394Ug.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";
|
|
@@ -26,7 +26,7 @@ import { resolveFindMatchRange } from "@stll/folio-core/prosemirror/findReplaceS
|
|
|
26
26
|
import { createAICitationDecorationsPlugin } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
27
27
|
import { AI_SUGGESTION_SEVERITY_CLASS, aiSuggestionDecorationsKey, createAISuggestionDecorationsPlugin } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
28
28
|
import { anonymizationDecorationsKey, createAnonymizationDecorationsPlugin, slugAnonymizationLabel } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
29
|
-
import { expectImageAttrs, expectTableAttrs, expectTableCellAttrs,
|
|
29
|
+
import { expectImageAttrs, expectTableAttrs, expectTableCellAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs } from "@stll/folio-core/prosemirror/attrs";
|
|
30
30
|
import { autocompleteSuggestionKey, autocompleteSuggestionPlugin } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
31
31
|
import { createSuggestionModePlugin, setSuggestionMode, suggestionModeKey } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
32
32
|
import { createTemplateDirectivesPlugin, templateDirectivesKey } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
@@ -83,6 +83,8 @@ import { resizeColumnPair } from "@stll/folio-core/paged-layout/tableColumnResiz
|
|
|
83
83
|
import { tableInsertButtonOffset } from "@stll/folio-core/paged-layout/tableInsertButtonGeometry";
|
|
84
84
|
import { getTransactionsDirtyRange } from "@stll/folio-core/paged-layout/transactionDirtyRange";
|
|
85
85
|
import { findStartPosForParaId } from "@stll/folio-core/prosemirror/utils/findParagraphByParaId";
|
|
86
|
+
import { allowsDirectDrawingEdit } from "@stll/folio-core/docx/imageRawXml";
|
|
87
|
+
import { commitImageFloatMove, commitImageInlineMove, commitImageResize, isFloatingImage } from "@stll/folio-core/prosemirror/imageCommit";
|
|
86
88
|
import { buildEmbeddedFontFamilyMap, extractEmbeddedFonts } from "@stll/folio-core/fonts/embeddedFonts";
|
|
87
89
|
import { panic } from "better-result";
|
|
88
90
|
import { collectRemoteSelections, createHiddenEditorManager, createHiddenEditorState } from "@stll/folio-core/controller/hiddenEditorManager";
|
|
@@ -1697,7 +1699,7 @@ function ImageSelectionOverlay({ imageInfo, zoom, isFocused, onResize, onResizeS
|
|
|
1697
1699
|
width: width + BORDER_WIDTH * 2,
|
|
1698
1700
|
height: height + BORDER_WIDTH * 2
|
|
1699
1701
|
} }),
|
|
1700
|
-
/* @__PURE__ */ jsx("div", {
|
|
1702
|
+
imageInfo.allowsDirectEdit && /* @__PURE__ */ jsx("div", {
|
|
1701
1703
|
role: "presentation",
|
|
1702
1704
|
style: {
|
|
1703
1705
|
position: "absolute",
|
|
@@ -1711,7 +1713,7 @@ function ImageSelectionOverlay({ imageInfo, zoom, isFocused, onResize, onResizeS
|
|
|
1711
1713
|
},
|
|
1712
1714
|
onMouseDown: handleBodyMouseDown
|
|
1713
1715
|
}),
|
|
1714
|
-
HANDLES.map(({ pos, x, y }) => /* @__PURE__ */ jsx(Handle, {
|
|
1716
|
+
imageInfo.allowsDirectEdit && HANDLES.map(({ pos, x, y }) => /* @__PURE__ */ jsx(Handle, {
|
|
1715
1717
|
handle: pos,
|
|
1716
1718
|
left: left + width * x - HANDLE_HALF,
|
|
1717
1719
|
top: top + height * y - HANDLE_HALF,
|
|
@@ -2938,11 +2940,13 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
2938
2940
|
const imgTagCandidate = el.tagName === "IMG" ? el : el.querySelector("img");
|
|
2939
2941
|
const element = (imgTagCandidate instanceof HTMLElement ? imgTagCandidate : null) ?? el;
|
|
2940
2942
|
const rect = element.getBoundingClientRect();
|
|
2943
|
+
const node = hiddenPMRef.current?.getView()?.state.doc.nodeAt(pmPos);
|
|
2941
2944
|
return {
|
|
2942
2945
|
element,
|
|
2943
2946
|
pmPos,
|
|
2944
2947
|
width: Math.round(rect.width / zoom),
|
|
2945
|
-
height: Math.round(rect.height / zoom)
|
|
2948
|
+
height: Math.round(rect.height / zoom),
|
|
2949
|
+
allowsDirectEdit: node?.type.name === "image" ? allowsDirectDrawingEdit(expectImageAttrs(node)._docxRawXmlMode) : true
|
|
2946
2950
|
};
|
|
2947
2951
|
}, [zoom]);
|
|
2948
2952
|
const isDraggingRef = useRef(false);
|
|
@@ -3316,8 +3320,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
3316
3320
|
const sel = state_3.selection;
|
|
3317
3321
|
if ("$anchorCell" in sel && typeof sel.forEachCell === "function") {
|
|
3318
3322
|
const selectedRanges = [];
|
|
3319
|
-
sel.forEachCell((
|
|
3320
|
-
selectedRanges.push([pos, pos +
|
|
3323
|
+
sel.forEachCell((node_0, pos) => {
|
|
3324
|
+
selectedRanges.push([pos, pos + node_0.nodeSize]);
|
|
3321
3325
|
});
|
|
3322
3326
|
const allCells = htmlQueryAll(pagesContainerRef.current, ".layout-table-cell");
|
|
3323
3327
|
for (const cellEl of allCells) {
|
|
@@ -3959,8 +3963,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
3959
3963
|
try {
|
|
3960
3964
|
const $pos = doc.resolve(pmPos_3);
|
|
3961
3965
|
for (let d = $pos.depth; d > 0; d--) {
|
|
3962
|
-
const
|
|
3963
|
-
if (
|
|
3966
|
+
const node_1 = $pos.node(d);
|
|
3967
|
+
if (node_1.type.name === "tableCell" || node_1.type.name === "tableHeader") return $pos.before(d);
|
|
3964
3968
|
}
|
|
3965
3969
|
} catch {}
|
|
3966
3970
|
return null;
|
|
@@ -4190,9 +4194,9 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4190
4194
|
if (view_9) {
|
|
4191
4195
|
const $pos_1 = view_9.state.doc.resolve(resizeTablePmStartRef.current + 1);
|
|
4192
4196
|
for (let d_0 = $pos_1.depth; d_0 >= 0; d_0--) {
|
|
4193
|
-
const
|
|
4194
|
-
if (
|
|
4195
|
-
const widths =
|
|
4197
|
+
const node_2 = $pos_1.node(d_0);
|
|
4198
|
+
if (node_2.type.name === "table") {
|
|
4199
|
+
const widths = node_2.attrs["columnWidths"];
|
|
4196
4200
|
if (widths && widths[colIndex] !== void 0 && widths[colIndex + 1] !== void 0) resizeOrigWidthsRef.current = {
|
|
4197
4201
|
left: widths[colIndex],
|
|
4198
4202
|
right: widths[colIndex + 1]
|
|
@@ -4222,10 +4226,10 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4222
4226
|
if (view_10) {
|
|
4223
4227
|
const $pos_2 = view_10.state.doc.resolve(resizeRowTablePmStartRef.current + 1);
|
|
4224
4228
|
for (let d_1 = $pos_2.depth; d_1 >= 0; d_1--) {
|
|
4225
|
-
const
|
|
4226
|
-
if (
|
|
4227
|
-
if (rowIndex <
|
|
4228
|
-
const height =
|
|
4229
|
+
const node_3 = $pos_2.node(d_1);
|
|
4230
|
+
if (node_3.type.name === "table") {
|
|
4231
|
+
if (rowIndex < node_3.childCount) {
|
|
4232
|
+
const height = node_3.child(rowIndex).attrs["height"];
|
|
4229
4233
|
if (height) resizeRowOrigHeightRef.current = height;
|
|
4230
4234
|
else {
|
|
4231
4235
|
const rowEl = target_1.closest(".layout-table")?.querySelector(`[data-row-index="${rowIndex}"]`);
|
|
@@ -4257,9 +4261,9 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4257
4261
|
if (view_11) {
|
|
4258
4262
|
const $pos_3 = view_11.state.doc.resolve(resizeRightEdgePmStartRef.current + 1);
|
|
4259
4263
|
for (let d_2 = $pos_3.depth; d_2 >= 0; d_2--) {
|
|
4260
|
-
const
|
|
4261
|
-
if (
|
|
4262
|
-
const widths_0 =
|
|
4264
|
+
const node_4 = $pos_3.node(d_2);
|
|
4265
|
+
if (node_4.type.name === "table") {
|
|
4266
|
+
const widths_0 = node_4.attrs["columnWidths"];
|
|
4263
4267
|
if (widths_0 && widths_0[colIndex_0] !== void 0) resizeRightEdgeOrigWidthRef.current = widths_0[colIndex_0];
|
|
4264
4268
|
break;
|
|
4265
4269
|
}
|
|
@@ -4462,18 +4466,18 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4462
4466
|
const { left: newLeft, right: newRight } = resizeOrigWidthsRef.current;
|
|
4463
4467
|
const $pos_5 = view_12.state.doc.resolve(pmStart_0 + 1);
|
|
4464
4468
|
for (let d_3 = $pos_5.depth; d_3 >= 0; d_3--) {
|
|
4465
|
-
const
|
|
4466
|
-
if (
|
|
4469
|
+
const node_5 = $pos_5.node(d_3);
|
|
4470
|
+
if (node_5.type.name === "table") {
|
|
4467
4471
|
const tablePos = $pos_5.before(d_3);
|
|
4468
4472
|
const tr = view_12.state.tr;
|
|
4469
|
-
const tableAttrs = expectTableAttrs(
|
|
4473
|
+
const tableAttrs = expectTableAttrs(node_5);
|
|
4470
4474
|
if (!tableAttrs.columnWidths) break;
|
|
4471
4475
|
const widths_1 = [...tableAttrs.columnWidths];
|
|
4472
4476
|
widths_1[colIdx] = newLeft;
|
|
4473
4477
|
widths_1[colIdx + 1] = newRight;
|
|
4474
|
-
tr.setNodeMarkup(tablePos, void 0, mergeTableAttrs(
|
|
4478
|
+
tr.setNodeMarkup(tablePos, void 0, mergeTableAttrs(node_5, { columnWidths: widths_1 }));
|
|
4475
4479
|
let rowOffset = tablePos + 1;
|
|
4476
|
-
|
|
4480
|
+
node_5.forEach((row) => {
|
|
4477
4481
|
let cellOffset = rowOffset + 1;
|
|
4478
4482
|
let cellColIdx = 0;
|
|
4479
4483
|
row.forEach((cell) => {
|
|
@@ -4512,13 +4516,13 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4512
4516
|
const newHeight_0 = resizeRowOrigHeightRef.current;
|
|
4513
4517
|
const $pos_6 = view_13.state.doc.resolve(pmStart_1 + 1);
|
|
4514
4518
|
for (let d_4 = $pos_6.depth; d_4 >= 0; d_4--) {
|
|
4515
|
-
const
|
|
4516
|
-
if (
|
|
4519
|
+
const node_6 = $pos_6.node(d_4);
|
|
4520
|
+
if (node_6.type.name === "table") {
|
|
4517
4521
|
const tablePos_0 = $pos_6.before(d_4);
|
|
4518
4522
|
const tr_0 = view_13.state.tr;
|
|
4519
4523
|
let rowOffset_0 = tablePos_0 + 1;
|
|
4520
4524
|
let idx = 0;
|
|
4521
|
-
|
|
4525
|
+
node_6.forEach((row_0) => {
|
|
4522
4526
|
if (idx === rowIdx) tr_0.setNodeMarkup(tr_0.mapping.map(rowOffset_0), void 0, mergeTableRowAttrs(row_0, {
|
|
4523
4527
|
height: newHeight_0,
|
|
4524
4528
|
heightRule: "atLeast"
|
|
@@ -4547,17 +4551,17 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4547
4551
|
const newWidth_1 = resizeRightEdgeOrigWidthRef.current;
|
|
4548
4552
|
const $pos_7 = view_14.state.doc.resolve(pmStart_2 + 1);
|
|
4549
4553
|
for (let d_5 = $pos_7.depth; d_5 >= 0; d_5--) {
|
|
4550
|
-
const
|
|
4551
|
-
if (
|
|
4554
|
+
const node_7 = $pos_7.node(d_5);
|
|
4555
|
+
if (node_7.type.name === "table") {
|
|
4552
4556
|
const tablePos_1 = $pos_7.before(d_5);
|
|
4553
4557
|
const tr_1 = view_14.state.tr;
|
|
4554
|
-
const tableAttrs_0 = expectTableAttrs(
|
|
4558
|
+
const tableAttrs_0 = expectTableAttrs(node_7);
|
|
4555
4559
|
if (!tableAttrs_0.columnWidths) break;
|
|
4556
4560
|
const widths_2 = [...tableAttrs_0.columnWidths];
|
|
4557
4561
|
widths_2[colIdx_0] = newWidth_1;
|
|
4558
|
-
tr_1.setNodeMarkup(tablePos_1, void 0, mergeTableAttrs(
|
|
4562
|
+
tr_1.setNodeMarkup(tablePos_1, void 0, mergeTableAttrs(node_7, { columnWidths: widths_2 }));
|
|
4559
4563
|
let rowOffset_1 = tablePos_1 + 1;
|
|
4560
|
-
|
|
4564
|
+
node_7.forEach((row_1) => {
|
|
4561
4565
|
let cellOffset_0 = rowOffset_1 + 1;
|
|
4562
4566
|
let cellColIdx_0 = 0;
|
|
4563
4567
|
row_1.forEach((cell_0) => {
|
|
@@ -4750,10 +4754,10 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4750
4754
|
const view_16 = hiddenPMRef.current.getView();
|
|
4751
4755
|
if (view_16) {
|
|
4752
4756
|
const targetPos = { value: null };
|
|
4753
|
-
view_16.state.doc.descendants((
|
|
4757
|
+
view_16.state.doc.descendants((node_8, pos_2) => {
|
|
4754
4758
|
if (targetPos.value !== null) return false;
|
|
4755
|
-
if (
|
|
4756
|
-
if (
|
|
4759
|
+
if (node_8.type.name === "paragraph") {
|
|
4760
|
+
if (node_8.attrs["bookmarks"]?.some((b) => b.name === bookmarkName)) {
|
|
4757
4761
|
targetPos.value = pos_2;
|
|
4758
4762
|
return false;
|
|
4759
4763
|
}
|
|
@@ -4815,8 +4819,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4815
4819
|
} else if (parent.isTextblock) {
|
|
4816
4820
|
const pmAlignedParts = [];
|
|
4817
4821
|
for (let i_0 = 0; i_0 < parent.content.childCount; i_0++) {
|
|
4818
|
-
const
|
|
4819
|
-
pmAlignedParts.push(
|
|
4822
|
+
const node_9 = parent.content.child(i_0);
|
|
4823
|
+
pmAlignedParts.push(node_9.isText ? node_9.text ?? "" : " ".repeat(node_9.nodeSize));
|
|
4820
4824
|
}
|
|
4821
4825
|
const pmAlignedText = pmAlignedParts.join("");
|
|
4822
4826
|
const offset = $pos_8.parentOffset;
|
|
@@ -4847,8 +4851,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4847
4851
|
if (parent_0.isTextblock) {
|
|
4848
4852
|
const pmAlignedParts_0 = [];
|
|
4849
4853
|
for (let i_1 = 0; i_1 < parent_0.content.childCount; i_1++) {
|
|
4850
|
-
const
|
|
4851
|
-
pmAlignedParts_0.push(
|
|
4854
|
+
const node_10 = parent_0.content.child(i_1);
|
|
4855
|
+
pmAlignedParts_0.push(node_10.isText ? node_10.text ?? "" : " ".repeat(node_10.nodeSize));
|
|
4852
4856
|
}
|
|
4853
4857
|
const pmAlignedText_0 = pmAlignedParts_0.join("");
|
|
4854
4858
|
const offset_0 = $pos_9.parentOffset;
|
|
@@ -4959,16 +4963,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4959
4963
|
const handleImageResize = useCallback((pmPos_16, newWidth_2, newHeight_1) => {
|
|
4960
4964
|
const view_20 = hiddenPMRef.current?.getView();
|
|
4961
4965
|
if (!view_20) return;
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
if (!node_10 || node_10.type.name !== "image") return;
|
|
4965
|
-
const tr_3 = view_20.state.tr.setNodeMarkup(pmPos_16, void 0, mergeImageAttrs(node_10, {
|
|
4966
|
-
width: newWidth_2,
|
|
4967
|
-
height: newHeight_1
|
|
4968
|
-
}));
|
|
4969
|
-
view_20.dispatch(tr_3);
|
|
4970
|
-
hiddenPMRef.current?.setNodeSelection(pmPos_16);
|
|
4971
|
-
} catch {}
|
|
4966
|
+
const committed = commitImageResize(view_20, pmPos_16, newWidth_2, newHeight_1);
|
|
4967
|
+
if (committed !== null) hiddenPMRef.current?.setNodeSelection(committed);
|
|
4972
4968
|
}, []);
|
|
4973
4969
|
/**
|
|
4974
4970
|
* Handle image resize start - prevent text selection during resize.
|
|
@@ -4992,8 +4988,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
4992
4988
|
try {
|
|
4993
4989
|
const node_11 = view_21.state.doc.nodeAt(pmPos_17);
|
|
4994
4990
|
if (!node_11 || node_11.type.name !== "image") return;
|
|
4995
|
-
|
|
4996
|
-
if (
|
|
4991
|
+
let committed_0 = null;
|
|
4992
|
+
if (isFloatingImage(node_11)) {
|
|
4997
4993
|
const pages_0 = pagesContainerRef.current?.querySelectorAll(".layout-page");
|
|
4998
4994
|
if (!pages_0 || pages_0.length === 0) return;
|
|
4999
4995
|
let contentEl = null;
|
|
@@ -5013,39 +5009,13 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
5013
5009
|
const dropX = (clientX_1 - contentRect.left) / zoom;
|
|
5014
5010
|
const dropY = (clientY_1 - contentRect.top) / zoom;
|
|
5015
5011
|
const PIXELS_TO_EMU = 914400 / 96;
|
|
5016
|
-
|
|
5017
|
-
const vOffsetEmu = Math.round(dropY * PIXELS_TO_EMU);
|
|
5018
|
-
const newPosition = {
|
|
5019
|
-
horizontal: {
|
|
5020
|
-
posOffset: hOffsetEmu,
|
|
5021
|
-
relativeTo: "margin"
|
|
5022
|
-
},
|
|
5023
|
-
vertical: {
|
|
5024
|
-
posOffset: vOffsetEmu,
|
|
5025
|
-
relativeTo: "margin"
|
|
5026
|
-
}
|
|
5027
|
-
};
|
|
5028
|
-
const tr_4 = view_21.state.tr.setNodeMarkup(pmPos_17, void 0, mergeImageAttrs(node_11, { position: newPosition }));
|
|
5029
|
-
view_21.dispatch(tr_4);
|
|
5030
|
-
hiddenPMRef.current?.setNodeSelection(pmPos_17);
|
|
5012
|
+
committed_0 = commitImageFloatMove(view_21, pmPos_17, Math.round(dropX * PIXELS_TO_EMU), Math.round(dropY * PIXELS_TO_EMU));
|
|
5031
5013
|
} else {
|
|
5032
5014
|
const dropPos = getPositionFromMouse(clientX_1, clientY_1);
|
|
5033
5015
|
if (dropPos === null) return;
|
|
5034
|
-
|
|
5035
|
-
let tr_5 = view_21.state.tr;
|
|
5036
|
-
tr_5 = tr_5.delete(pmPos_17, pmPos_17 + node_11.nodeSize);
|
|
5037
|
-
let selectionPos;
|
|
5038
|
-
if (dropPos <= pmPos_17) {
|
|
5039
|
-
tr_5 = tr_5.insert(dropPos, node_11);
|
|
5040
|
-
selectionPos = dropPos;
|
|
5041
|
-
} else {
|
|
5042
|
-
const adjusted = dropPos - node_11.nodeSize;
|
|
5043
|
-
tr_5 = tr_5.insert(Math.min(adjusted, tr_5.doc.content.size), node_11);
|
|
5044
|
-
selectionPos = Math.min(adjusted, tr_5.doc.content.size - 1);
|
|
5045
|
-
}
|
|
5046
|
-
hiddenPMRef.current?.setNodeSelection(selectionPos);
|
|
5047
|
-
view_21.dispatch(tr_5);
|
|
5016
|
+
committed_0 = commitImageInlineMove(view_21, pmPos_17, dropPos);
|
|
5048
5017
|
}
|
|
5018
|
+
if (committed_0 !== null) hiddenPMRef.current?.setNodeSelection(committed_0);
|
|
5049
5019
|
} catch {}
|
|
5050
5020
|
}, [getPositionFromMouse, zoom]);
|
|
5051
5021
|
const handleImageDragStart = useCallback(() => {
|
|
@@ -5472,8 +5442,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
5472
5442
|
isFocused() {
|
|
5473
5443
|
return getActiveEditorStory().view?.hasFocus() ?? false;
|
|
5474
5444
|
},
|
|
5475
|
-
dispatch(
|
|
5476
|
-
folioEditor.dispatch(
|
|
5445
|
+
dispatch(tr_3) {
|
|
5446
|
+
folioEditor.dispatch(tr_3);
|
|
5477
5447
|
},
|
|
5478
5448
|
undo() {
|
|
5479
5449
|
const target_5 = getActiveEditorStory();
|
|
@@ -12295,7 +12265,7 @@ function useFolioComments({ doc, autoOpenReviewSidebar, anchorPositions, editorC
|
|
|
12295
12265
|
* - Error boundary
|
|
12296
12266
|
* - Loading states
|
|
12297
12267
|
*/
|
|
12298
|
-
const CommentsSidebar = lazy(() => import("./CommentsSidebar-
|
|
12268
|
+
const CommentsSidebar = lazy(() => import("./CommentsSidebar-tGhtc2ZH.js").then((m) => ({ default: m.CommentsSidebar })));
|
|
12299
12269
|
const TextContextMenu = lazy(() => import("./TextContextMenu-Ci7-M4oU.js").then((m) => ({ default: m.TextContextMenu })));
|
|
12300
12270
|
const loadAttemptSelectiveSave = async () => {
|
|
12301
12271
|
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.19.
|
|
3
|
+
"version": "0.19.5",
|
|
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.41.0",
|
|
72
72
|
"better-result": "3.0.1",
|
|
73
73
|
"lucide-react": "1.24.0",
|
|
74
74
|
"prosemirror-history": "^1.5.0",
|