@stll/folio-react 0.33.0 → 0.33.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.
@@ -1,4 +1,4 @@
1
- import { a as useDrawerFocus, s as containedHandler } from "./renderAsync-C4XgGuNC.js";
1
+ import { a as useDrawerFocus, s as containedHandler } from "./renderAsync-Bvosattm.js";
2
2
  import { useCallback, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
3
3
  import { CheckIcon, MoreVerticalIcon } from "lucide-react";
4
4
  import { useLocale, useTranslations } from "use-intl";
@@ -1,4 +1,4 @@
1
- import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-C4XgGuNC.js";
1
+ import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-Bvosattm.js";
2
2
  import { t as messages_exports } from "../messages-DjrCTI3y.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 { c as ZOOM_PRESETS, d as parseZoom, f as useWheelZoom, i as ZoomControl, l as clampZoom, n as DocxEditor, o as AutocompleteCaretOverlay, r as FormattingBar, t as renderAsync, u as formatZoom } from "./renderAsync-C4XgGuNC.js";
1
+ import { c as ZOOM_PRESETS, d as parseZoom, f as useWheelZoom, i as ZoomControl, l as clampZoom, n as DocxEditor, o as AutocompleteCaretOverlay, r as FormattingBar, t as renderAsync, u as formatZoom } from "./renderAsync-Bvosattm.js";
2
2
  import { n as FolioUIProvider } from "./folio-ui-CEFqJgCh.js";
3
3
  import { t as FindReplaceDialog } from "./FindReplaceDialog-DbbzquBV.js";
4
4
  import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-BBq9iBzN.js";
@@ -29,7 +29,7 @@ import { acceptAIEditRevision, acceptChange, acceptSuggestion, findAIEditRevisio
29
29
  import { blockSdtAttrsToSdtProperties, findBlockSdtMatch, findBlockSdtMatches, removeContentControlTr, setContentControlContentTr, setContentControlValueTr } from "@stll/folio-core/prosemirror/commands/contentControls";
30
30
  import { setContentControlContentBlocksTr } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
31
31
  import { insertPageBreak } from "@stll/folio-core/prosemirror/commands/pageBreak";
32
- import { CLIPBOARD_READ_ERROR_EVENT, buildPlainTextSlice } from "@stll/folio-core/prosemirror/commands/pastePlainText";
32
+ import { CLIPBOARD_READ_ERROR_EVENT, buildPlainTextSlice, pastePlainTextSlice } from "@stll/folio-core/prosemirror/commands/pastePlainText";
33
33
  import { proseDocToBlocks } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
34
34
  import { executeEditorCommand, executeFirstEditorCommand } from "@stll/folio-core/prosemirror/executeEditorCommand";
35
35
  import { ExtensionManager } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
@@ -1358,7 +1358,7 @@ const HIDDEN_HOST_STYLES = {
1358
1358
  * HiddenProseMirror - Off-screen ProseMirror editor for keyboard input
1359
1359
  */
1360
1360
  const HiddenProseMirror = forwardRef((props, ref) => {
1361
- const { document, documentIdentity, experimentalSession, suggestionModeActive = false, suggestionAuthor = "User", onSessionRefusal, styles, theme: _theme, widthPx = 612, readOnly = false, onTransaction, onSelectionChange, externalPlugins = EMPTY_EXTERNAL_PLUGINS, collaboration, extensionManager, onEditorViewReady, onEditorViewDestroy, onKeyDown, onCopy, onCut, onPaste, onReadOnlyEditAttempt, onRemoteSelectionsChange, precomputedInitialState } = props;
1361
+ const { document, documentIdentity, experimentalSession, suggestionModeActive = false, suggestionAuthor = "User", onSessionRefusal, styles, theme: _theme, widthPx = 612, readOnly = false, onTransaction, onCanonicalCompositionEnd, onSelectionChange, externalPlugins = EMPTY_EXTERNAL_PLUGINS, collaboration, extensionManager, onEditorViewReady, onEditorViewDestroy, onKeyDown, onCopy, onCut, onPaste, onReadOnlyEditAttempt, onRemoteSelectionsChange, precomputedInitialState } = props;
1362
1362
  const hasCollaboration = collaboration !== void 0;
1363
1363
  const [collaborationLoad, setCollaborationLoad] = useState(() => ({ status: hasCollaboration ? "loading" : "disabled" }));
1364
1364
  if (hasCollaboration !== (collaborationLoad.status !== "disabled")) setCollaborationLoad({ status: hasCollaboration ? "loading" : "disabled" });
@@ -1379,6 +1379,7 @@ const HiddenProseMirror = forwardRef((props, ref) => {
1379
1379
  const collaborationRef = useRef(collaboration);
1380
1380
  const collaborationModulesRef = useRef(collaborationModules);
1381
1381
  const onTransactionRef = useRef(onTransaction);
1382
+ const onCanonicalCompositionEndRef = useRef(onCanonicalCompositionEnd);
1382
1383
  const onSelectionChangeRef = useRef(onSelectionChange);
1383
1384
  const onEditorViewReadyRef = useRef(onEditorViewReady);
1384
1385
  const onEditorViewDestroyRef = useRef(onEditorViewDestroy);
@@ -1400,6 +1401,7 @@ const HiddenProseMirror = forwardRef((props, ref) => {
1400
1401
  externalPluginsRef.current = externalPlugins;
1401
1402
  precomputedInitialStateRef.current = precomputedInitialState;
1402
1403
  onTransactionRef.current = onTransaction;
1404
+ onCanonicalCompositionEndRef.current = onCanonicalCompositionEnd;
1403
1405
  onSelectionChangeRef.current = onSelectionChange;
1404
1406
  onEditorViewReadyRef.current = onEditorViewReady;
1405
1407
  onEditorViewDestroyRef.current = onEditorViewDestroy;
@@ -1430,6 +1432,7 @@ const HiddenProseMirror = forwardRef((props, ref) => {
1430
1432
  getDocumentIdentity: () => documentIdentityRef.current,
1431
1433
  getDocumentContext: () => documentRef.current,
1432
1434
  onTransaction: (update) => onTransactionRef.current?.(update),
1435
+ onCanonicalCompositionEnd: () => onCanonicalCompositionEndRef.current?.(),
1433
1436
  onSelectionChange: (state) => onSelectionChangeRef.current?.(state),
1434
1437
  onKeyDown: (view, event) => onKeyDownRef.current?.(view, event) ?? false,
1435
1438
  onCopy: () => onCopyRef.current?.(),
@@ -3235,7 +3238,7 @@ function buildFootnoteRenderItems(pageFootnoteMap, footnoteContentMap, doc) {
3235
3238
  * PagedEditor - Main paginated editing component.
3236
3239
  */
3237
3240
  const PagedEditor = forwardRef(function PagedEditor(props, ref) {
3238
- const { accessibleName, document, documentIO, documentIdentity, experimentalSession, fonts: hostFonts, styles, theme: _theme, sectionProperties, headerContent, footerContent, firstPageHeaderContent, firstPageFooterContent, headerContentRId, footerContentRId, firstPageHeaderContentRId, firstPageFooterContentRId, readOnly = false, pageGap = 24, zoom = 1, pageRenderer, markupView, showCommentHighlights = true, showMarginGuides = false, marginGuideColor, onDocumentChange, onReadOnlyEditAttempt, onCopy, onCut, onPaste, onSelectionChange, onSelectionTextChange, onEditorViewReady, externalPlugins = EMPTY_PLUGINS, showTemplateDirectives = true, collaboration, extensionManager, suggestionModeActive = false, suggestionAuthor, onActiveNoteStoryChange, onHeaderFooterDoubleClick, hfEditMode, activeHeaderFooterRId, onBodyClick, className, style, pageEndGutter = 0, sidebarOverlay, scrollContainerRef: scrollContainerRefProp, onHyperlinkClick, onContextMenu, onAnchorPositionsChange, onTotalPagesChange, onError, anchorPositionMode = "comments-and-revisions", onAnonymizationTermClick, selectedAnonymizationCanonical = null, anonymizationSelectionSeq } = props;
3241
+ const { accessibleName, document, documentIO, documentIdentity, experimentalSession, fonts: hostFonts, styles, theme: _theme, sectionProperties, headerContent, footerContent, firstPageHeaderContent, firstPageFooterContent, headerContentRId, footerContentRId, firstPageHeaderContentRId, firstPageFooterContentRId, readOnly = false, pageGap = 24, zoom = 1, pageRenderer, markupView, showCommentHighlights = true, altChunkMarkerText, showMarginGuides = false, marginGuideColor, onDocumentChange, onReadOnlyEditAttempt, onCopy, onCut, onPaste, onSelectionChange, onSelectionTextChange, onEditorViewReady, externalPlugins = EMPTY_PLUGINS, showTemplateDirectives = true, collaboration, extensionManager, suggestionModeActive = false, suggestionAuthor, onActiveNoteStoryChange, onHeaderFooterDoubleClick, hfEditMode, activeHeaderFooterRId, onBodyClick, className, style, pageEndGutter = 0, sidebarOverlay, scrollContainerRef: scrollContainerRefProp, onHyperlinkClick, onContextMenu, onAnchorPositionsChange, onTotalPagesChange, onError, anchorPositionMode = "comments-and-revisions", onAnonymizationTermClick, selectedAnonymizationCanonical = null, anonymizationSelectionSeq } = props;
3239
3242
  const getScrollContainer = useCallback(() => {
3240
3243
  if (scrollContainerRefProp && typeof scrollContainerRefProp === "object") return getEditorScrollRoot(scrollContainerRefProp.current);
3241
3244
  return getEditorScrollRoot(containerRef.current);
@@ -3514,6 +3517,7 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
3514
3517
  columns,
3515
3518
  markupView,
3516
3519
  showCommentHighlights,
3520
+ altChunkMarkerText,
3517
3521
  contentWidth,
3518
3522
  defaultTabStop,
3519
3523
  mirrorMargins,
@@ -3536,6 +3540,7 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
3536
3540
  columns,
3537
3541
  markupView,
3538
3542
  showCommentHighlights,
3543
+ altChunkMarkerText,
3539
3544
  contentWidth,
3540
3545
  defaultTabStop,
3541
3546
  mirrorMargins,
@@ -3617,7 +3622,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
3617
3622
  emptyTemplatePreviewHidden: EMPTY_TEMPLATE_PREVIEW_HIDDEN,
3618
3623
  hyphenationReadiness,
3619
3624
  markupView,
3620
- showCommentHighlights
3625
+ showCommentHighlights,
3626
+ ...altChunkMarkerText === void 0 ? {} : { altChunkMarkerText }
3621
3627
  }, state, options);
3622
3628
  if (outcome.blocks) setBlocks(outcome.blocks);
3623
3629
  if (outcome.measures !== void 0) setMeasures(outcome.measures);
@@ -3655,6 +3661,7 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
3655
3661
  styles,
3656
3662
  markupView,
3657
3663
  showCommentHighlights,
3664
+ altChunkMarkerText,
3658
3665
  layoutInputSignature,
3659
3666
  hyphenationReadiness
3660
3667
  ]);
@@ -6148,6 +6155,7 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
6148
6155
  precomputedInitialState: validPrecomputedInitialState,
6149
6156
  readOnly,
6150
6157
  onTransaction: handleTransaction,
6158
+ onCanonicalCompositionEnd: scheduleLayout,
6151
6159
  onSelectionChange: handleSelectionChange,
6152
6160
  onRemoteSelectionsChange: setRemoteSelections,
6153
6161
  onEditorViewReady: handleEditorViewReady,
@@ -14040,7 +14048,7 @@ function _temp(id_4) {
14040
14048
  // src/components/DocxEditor.tsx
14041
14049
  /** No headings to track while the outline is not shown. */
14042
14050
  const NO_HEADINGS = [];
14043
- const CommentsSidebar = lazy(() => import("./CommentsSidebar-CQJT9gei.js").then((m) => ({ default: m.CommentsSidebar })));
14051
+ const CommentsSidebar = lazy(() => import("./CommentsSidebar-CUCUQpXb.js").then((m) => ({ default: m.CommentsSidebar })));
14044
14052
  const TextContextMenu = lazy(() => import("./TextContextMenu-BxnNvhJg.js").then((m) => ({ default: m.TextContextMenu })));
14045
14053
  const loadAttemptSelectiveSave = async () => {
14046
14054
  const { attemptSelectiveSave } = await import("@stll/folio-core/docx/selectiveSave");
@@ -15752,8 +15760,7 @@ const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuff
15752
15760
  try {
15753
15761
  const text = await navigator.clipboard.readText();
15754
15762
  if (text && !view_12.isDestroyed) {
15755
- const slice = buildPlainTextSlice(text, view_12.state.schema);
15756
- view_12.dispatch(view_12.state.tr.replaceSelection(slice).scrollIntoView());
15763
+ pastePlainTextSlice(view_12, buildPlainTextSlice(text, view_12.state.schema));
15757
15764
  onPaste?.();
15758
15765
  }
15759
15766
  } catch {
@@ -17524,6 +17531,7 @@ const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuff
17524
17531
  documentIdentity: loadedDocumentIdentity,
17525
17532
  markupView: displayMode,
17526
17533
  showCommentHighlights,
17534
+ altChunkMarkerText: t("contentNotDisplayed"),
17527
17535
  ...fonts !== void 0 ? { fonts } : {},
17528
17536
  theme: history.state.package.theme || theme || null,
17529
17537
  sectionProperties: effectiveSectionProperties ?? null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/folio-react",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
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",
@@ -78,7 +78,7 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "@base-ui/react": "1.9.0",
81
- "@stll/folio-core": "^0.66.2",
81
+ "@stll/folio-core": "^0.67.0",
82
82
  "@stll/folio-fonts": "^0.1.0",
83
83
  "@stll/utf8-boundaries": "0.2.0",
84
84
  "@types/react": "^19.3.0",