@stll/folio-react 0.35.0 → 0.36.0
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/{CommentsSidebar-l092CpvD.js → CommentsSidebar-CMNMCb-Y.js} +1 -1
- package/dist/compat/eigenpal.d.ts +1 -1
- package/dist/compat/eigenpal.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/{renderAsync-Ddsn6AyR.d.ts → renderAsync-CUKCee5z.d.ts} +14 -0
- package/dist/{renderAsync-CeGgJz8j.js → renderAsync-CzkaClhN.js} +20 -6
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as useDrawerFocus, s as containedHandler } from "./renderAsync-
|
|
1
|
+
import { a as useDrawerFocus, s as containedHandler } from "./renderAsync-CzkaClhN.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 { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-
|
|
1
|
+
import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-CUKCee5z.js";
|
|
2
2
|
import { ForwardRefExoticComponent, JSX, ReactNode, RefAttributes } from "react";
|
|
3
3
|
import { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
|
|
4
4
|
export declare const VERSION = "folio-compat-eigenpal";
|
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-CzkaClhN.js";
|
|
2
2
|
import { t as messages_exports } from "../messages-BmWt6Yeu.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { forwardRef } from "react";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as FolioUIComponents, a as DocxEditorApplyDocumentOperationsOptions, b as FontDefinition, c as DocxEditorRef, d as HighlightPassageResult, f as ToolbarProps, g as FolioButtonProps, h as ColorPreset, i as renderAsync, l as DocxEditorYjsCollaboration, m as EditorMode, n as EditorHandle, o as DocxEditorCollaboration, p as FontOption, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle, u as HighlightPassageOptions, v as FolioUIProvider, y as OutlineItem } from "./renderAsync-
|
|
1
|
+
import { _ as FolioUIComponents, a as DocxEditorApplyDocumentOperationsOptions, b as FontDefinition, c as DocxEditorRef, d as HighlightPassageResult, f as ToolbarProps, g as FolioButtonProps, h as ColorPreset, i as renderAsync, l as DocxEditorYjsCollaboration, m as EditorMode, n as EditorHandle, o as DocxEditorCollaboration, p as FontOption, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle, u as HighlightPassageOptions, v as FolioUIProvider, y as OutlineItem } from "./renderAsync-CUKCee5z.js";
|
|
2
2
|
import { A as HyperlinkDialog, C as ImagePropertiesData, D as ImagePositionDialog, E as ImagePositionData, F as FindReplaceDialog, I as FindReplaceDialogProps, M as HyperlinkDialogProps, N as FootnotePropertiesDialog, O as ImagePositionDialogProps, P as FootnotePropertiesDialogProps, S as InsertImageDialogProps, T as ImagePropertiesDialogProps, _ as InsertTableStyleOption, a as TablePropertiesDialogProps, b as InsertImageDialog, c as SplitCellDialogProps, d as PasteSpecialMode, f as PageSetupDialog, g as InsertTableDialogProps, h as InsertTableDialogData, i as TablePropertiesDialog, j as HyperlinkDialogData, k as HyperlinkBookmarkOption, l as PasteSpecialDialog, m as InsertTableDialog, n as WatermarkDialogProps, o as SplitCellDialog, p as PageSetupDialogProps, r as TableProperties, s as SplitCellDialogData, t as WatermarkDialog, u as PasteSpecialDialogProps, v as InsertSymbolDialog, w as ImagePropertiesDialog, x as InsertImageDialogData, y as InsertSymbolDialogProps } from "./dialogs-BjWjcllk.js";
|
|
3
3
|
import React, { CSSProperties, ForwardRefExoticComponent, JSX, ReactNode, RefAttributes, RefObject } from "react";
|
|
4
4
|
import { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockPreviewRun, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditParagraphIdentity, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAISignatureParty, WordDiffSegment, applyFolioAIEditOperations, createFolioAIEditSnapshot, diffWordSegments, hashFolioAIBlockText, normalizeFolioAIBlockText } from "@stll/folio-core/ai-edits";
|
|
@@ -14,6 +14,7 @@ import { insertImageFromFile, insertPageBreakInView, insertTableInView, insertTa
|
|
|
14
14
|
import { FolioSuggestion, SuggestionAppliedAs, SuggestionKind } from "@stll/folio-core/prosemirror/commands/comments";
|
|
15
15
|
import { TemplateSlashMenuKeyAction, TemplateSlashMenuState, clearTemplateSlashMenu, consumeTemplateSlashQuery, getTemplateSlashMenu, resetTemplateSlashQuery, templateSlashMenuKey } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
16
16
|
import { Document } from "@stll/folio-core/types/document";
|
|
17
|
+
import { FolioDerivedFields, FolioFieldInsertion } from "@stll/folio-core/types/fields";
|
|
17
18
|
import { FindMatch, FindOptions, FindResult, ReplaceAllSummary, ReplaceEligibility } from "@stll/folio-core/utils/findReplace";
|
|
18
19
|
import { OutlineDepth } from "@stll/folio-core/utils/outlineDepth";
|
|
19
20
|
import { PictureWatermark, TextWatermark, Watermark, getDocumentWatermark, setDocumentWatermark } from "@stll/folio-core/watermark";
|
|
@@ -185,4 +186,4 @@ type AutocompleteCaretOverlayProps = {
|
|
|
185
186
|
isStreaming: boolean;
|
|
186
187
|
};
|
|
187
188
|
export declare const AutocompleteCaretOverlay: ({ caret, text, isStreaming }: AutocompleteCaretOverlayProps) => React.JSX.Element | null;
|
|
188
|
-
export { type AIBarStatus, type AIChatMode, type AICitation, type AICitationRange, type AICitationSource, type AIGenerateInput, type AISuggestion, type AISuggestionApplyMode, type AISuggestionPreset, type AISuggestionSeverity, type AISuggestionStatus, type ApplyResult, type AutocompleteCaretOverlayProps, type AutocompleteCaretRect, type BlockRect, type ColorPreset, type CreateEmptyDocumentOptions, DEFAULT_AI_SUGGESTION_PRESETS, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DirectiveKind, type DirectiveRange, type Document, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, type DocxCompatibility, type DocxEditorApplyDocumentOperationsOptions, type DocxEditorCollaboration, type DocxEditorHandle, type DocxEditorProps, type DocxEditorRef, type DocxEditorYjsCollaboration, type EditorHandle, type EditorMode, type EditorReadOnlyReason, type ExtractDocumentStyleSetOptions, type FindMatch, type FindOptions, FindReplaceDialog, type FindReplaceDialogProps, type FindResult, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditParagraphIdentity, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAISignatureParty, type FolioAnonymizationMatch, type FolioAnonymizationTerm, type FolioAutocompleteApi, type FolioAutocompleteState, type FolioBlockId, type FolioButtonProps, type FolioSuggestion, type FolioUIComponents, FolioUIProvider, type FontDefinition, type FontOption, FootnotePropertiesDialog, type FootnotePropertiesDialogProps, type FormattingBarProps, type HighlightPassageOptions, type HighlightPassageResult, type HyperlinkBookmarkOption, HyperlinkDialog, type HyperlinkDialogData, type HyperlinkDialogProps, type ImageMeta, type ImagePositionData, ImagePositionDialog, type ImagePositionDialogProps, type ImagePropertiesData, ImagePropertiesDialog, type ImagePropertiesDialogProps, type ImageRef, InsertImageDialog, type InsertImageDialogData, type InsertImageDialogProps, InsertSymbolDialog, type InsertSymbolDialogProps, InsertTableDialog, type InsertTableDialogData, type InsertTableDialogProps, type InsertTableStyleOption, type KeyboardShortcutScope, type MarkdownOptions, type MarkdownResult, type OutlineDepth, type OutlineItem, PageSetupDialog, type PageSetupDialogProps, PasteSpecialDialog, type PasteSpecialDialogProps, type PasteSpecialMode, type PictureWatermark, type PositionalText, type RenderAsyncOptions, type ReplaceAllSummary, type ReplaceEligibility, type ResolvedAnchor, type ReviewDisplayMode, STELLA_STYLE_SET_NAME, type ScrollToParaIdOptions, SplitCellDialog, type SplitCellDialogData, type SplitCellDialogProps, type SuggestionAppliedAs, type SuggestionKind, type TableProperties, TablePropertiesDialog, type TablePropertiesDialogProps, type TemplatePreviewHiddenRange, type TemplatePreviewSpan, type TemplatePreviewValue, type TemplatePreviewValues, type TemplateSlashMenuKeyAction, type TemplateSlashMenuState, type TextWatermark, type UseWheelZoomOptions, type UseWheelZoomReturn, type Watermark, WatermarkDialog, type WatermarkDialogProps, type WordDiffSegment, type ZoomControlProps, type ZoomLevel, applyFolioAIEditOperations, applySuggestions, buildPositionalText, clearTemplateSlashMenu, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, createStellaStyleDocumentPreset, createStellaStyleSet, deriveBlockId, diffWordSegments, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, fromMarkdown, getDocumentWatermark, getFolioCaretViewportRect, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, insertImageFromFile, insertPageBreakInView, insertTableInView, insertTableOfContentsInView, inspectDocumentStyles, inspectDocumentStylesFromDocx, isFolioBlockId, isSequentialFolioBlockId, isSuggestionStale, normalizeFolioAIBlockText, renderAsync, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setDocumentWatermark, setFocusedSuggestionMeta, setTemplatePreviewValues, templateSlashMenuKey, toMarkdown, toMarkdownResult };
|
|
189
|
+
export { type AIBarStatus, type AIChatMode, type AICitation, type AICitationRange, type AICitationSource, type AIGenerateInput, type AISuggestion, type AISuggestionApplyMode, type AISuggestionPreset, type AISuggestionSeverity, type AISuggestionStatus, type ApplyResult, type AutocompleteCaretOverlayProps, type AutocompleteCaretRect, type BlockRect, type ColorPreset, type CreateEmptyDocumentOptions, DEFAULT_AI_SUGGESTION_PRESETS, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DirectiveKind, type DirectiveRange, type Document, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, type DocxCompatibility, type DocxEditorApplyDocumentOperationsOptions, type DocxEditorCollaboration, type DocxEditorHandle, type DocxEditorProps, type DocxEditorRef, type DocxEditorYjsCollaboration, type EditorHandle, type EditorMode, type EditorReadOnlyReason, type ExtractDocumentStyleSetOptions, type FindMatch, type FindOptions, FindReplaceDialog, type FindReplaceDialogProps, type FindResult, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditParagraphIdentity, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAISignatureParty, type FolioAnonymizationMatch, type FolioAnonymizationTerm, type FolioAutocompleteApi, type FolioAutocompleteState, type FolioBlockId, type FolioButtonProps, type FolioDerivedFields, type FolioFieldInsertion, type FolioSuggestion, type FolioUIComponents, FolioUIProvider, type FontDefinition, type FontOption, FootnotePropertiesDialog, type FootnotePropertiesDialogProps, type FormattingBarProps, type HighlightPassageOptions, type HighlightPassageResult, type HyperlinkBookmarkOption, HyperlinkDialog, type HyperlinkDialogData, type HyperlinkDialogProps, type ImageMeta, type ImagePositionData, ImagePositionDialog, type ImagePositionDialogProps, type ImagePropertiesData, ImagePropertiesDialog, type ImagePropertiesDialogProps, type ImageRef, InsertImageDialog, type InsertImageDialogData, type InsertImageDialogProps, InsertSymbolDialog, type InsertSymbolDialogProps, InsertTableDialog, type InsertTableDialogData, type InsertTableDialogProps, type InsertTableStyleOption, type KeyboardShortcutScope, type MarkdownOptions, type MarkdownResult, type OutlineDepth, type OutlineItem, PageSetupDialog, type PageSetupDialogProps, PasteSpecialDialog, type PasteSpecialDialogProps, type PasteSpecialMode, type PictureWatermark, type PositionalText, type RenderAsyncOptions, type ReplaceAllSummary, type ReplaceEligibility, type ResolvedAnchor, type ReviewDisplayMode, STELLA_STYLE_SET_NAME, type ScrollToParaIdOptions, SplitCellDialog, type SplitCellDialogData, type SplitCellDialogProps, type SuggestionAppliedAs, type SuggestionKind, type TableProperties, TablePropertiesDialog, type TablePropertiesDialogProps, type TemplatePreviewHiddenRange, type TemplatePreviewSpan, type TemplatePreviewValue, type TemplatePreviewValues, type TemplateSlashMenuKeyAction, type TemplateSlashMenuState, type TextWatermark, type UseWheelZoomOptions, type UseWheelZoomReturn, type Watermark, WatermarkDialog, type WatermarkDialogProps, type WordDiffSegment, type ZoomControlProps, type ZoomLevel, applyFolioAIEditOperations, applySuggestions, buildPositionalText, clearTemplateSlashMenu, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, createStellaStyleDocumentPreset, createStellaStyleSet, deriveBlockId, diffWordSegments, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, fromMarkdown, getDocumentWatermark, getFolioCaretViewportRect, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, insertImageFromFile, insertPageBreakInView, insertTableInView, insertTableOfContentsInView, inspectDocumentStyles, inspectDocumentStylesFromDocx, isFolioBlockId, isSequentialFolioBlockId, isSuggestionStale, normalizeFolioAIBlockText, renderAsync, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setDocumentWatermark, setFocusedSuggestionMeta, setTemplatePreviewValues, templateSlashMenuKey, toMarkdown, toMarkdownResult };
|
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-
|
|
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-CzkaClhN.js";
|
|
2
2
|
import { n as FolioUIProvider } from "./folio-ui-DNlnaoih.js";
|
|
3
3
|
import { t as FindReplaceDialog } from "./FindReplaceDialog-DTK6xana.js";
|
|
4
4
|
import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-mDtUjPE_.js";
|
|
@@ -26,6 +26,7 @@ import { EditorSession } from "@stll/folio-core/types/canonicalCapabilities";
|
|
|
26
26
|
import { Comment } from "@stll/folio-core/types/content";
|
|
27
27
|
import { ColorValue, Document, ParagraphAlignment, SdtProperties, Style, Theme } from "@stll/folio-core/types/document";
|
|
28
28
|
import { DeepReadonly, ReadonlyDocument } from "@stll/folio-core/types/documentModel";
|
|
29
|
+
import { FolioDerivedFields, FolioFieldInsertion } from "@stll/folio-core/types/fields";
|
|
29
30
|
import { DocxInput } from "@stll/folio-core/utils/docxInput";
|
|
30
31
|
import { FindMatch, FindOptions, FindResult } from "@stll/folio-core/utils/findReplace";
|
|
31
32
|
import { OutlineDepth } from "@stll/folio-core/utils/outlineDepth";
|
|
@@ -610,6 +611,13 @@ type DocxEditorProps = {
|
|
|
610
611
|
documentBuffer?: DocxInput | null;
|
|
611
612
|
/** Password for Agile-encrypted .docx files (Office 2010+). */
|
|
612
613
|
password?: string | undefined;
|
|
614
|
+
/**
|
|
615
|
+
* Fields whose display text the host derives from the document (numbered
|
|
616
|
+
* references, for one). After each local edit the owned fields show what
|
|
617
|
+
* `displayTexts` gives them, in the same undo step as the edit; a peer in a
|
|
618
|
+
* shared room receives the update with it.
|
|
619
|
+
*/
|
|
620
|
+
derivedFields?: FolioDerivedFields | undefined;
|
|
613
621
|
/** Pre-parsed document (alternative to documentBuffer) */
|
|
614
622
|
document?: Document | null;
|
|
615
623
|
/**
|
|
@@ -1211,6 +1219,12 @@ type DocxEditorRef = {
|
|
|
1211
1219
|
autocomplete: FolioAutocompleteApi;
|
|
1212
1220
|
/** Every occurrence of the `anonymizationTerms`, as text positions. */
|
|
1213
1221
|
getAnonymizationMatches: () => readonly FolioAnonymizationMatch[];
|
|
1222
|
+
/**
|
|
1223
|
+
* Insert a field in place of the body selection: one undo step, a tracked
|
|
1224
|
+
* insertion when suggesting. False when nothing was inserted, as while a
|
|
1225
|
+
* header, footer or note is being edited.
|
|
1226
|
+
*/
|
|
1227
|
+
insertField: (field: FolioFieldInsertion) => boolean;
|
|
1214
1228
|
/** Painted geometry for one block, relative to this editor's scroll root. */
|
|
1215
1229
|
getBlockRect: (blockId: string) => BlockRect | null;
|
|
1216
1230
|
/** Painted geometry for many blocks in one layout read; missing ids are omitted. */
|
|
@@ -47,6 +47,7 @@ import { projectMarkupView, visibleCaretPosition } from "@stll/folio-core/prosem
|
|
|
47
47
|
import { createNoteReferenceFollower, withoutUnreferencedNotes } from "@stll/folio-core/prosemirror/noteReferenceReview";
|
|
48
48
|
import { createAICitationDecorationsPlugin } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
49
49
|
import { AI_SUGGESTION_SEVERITY_CLASS, aiSuggestionDecorationsKey, createAISuggestionDecorationsPlugin } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
50
|
+
import { createDerivedFieldsPlugin } from "@stll/folio-core/prosemirror/plugins/derivedFields";
|
|
50
51
|
import { createSuggestionModePlugin, setSuggestionMode, suggestionModeKey } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
51
52
|
import { createTemplateDirectivesPlugin, templateDirectivesKey } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
52
53
|
import { createTemplatePreviewValuesPlugin, templatePreviewValuesKey } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
@@ -1455,7 +1456,7 @@ const HIDDEN_HOST_STYLES = {
|
|
|
1455
1456
|
* HiddenProseMirror - Off-screen ProseMirror editor for keyboard input
|
|
1456
1457
|
*/
|
|
1457
1458
|
const HiddenProseMirror = forwardRef((props, ref) => {
|
|
1458
|
-
const { document, documentIdentity, experimentalSession, historyShortcuts = "editor", suggestionModeActive = false, suggestionAuthor = "User", onSessionRefusal, styles, theme: _theme, widthPx = 612, readOnly = false, onTransaction, onCanonicalCompositionLayout, getEmbeddedFontFamilyMap, onSelectionChange, externalPlugins = EMPTY_EXTERNAL_PLUGINS, anonymizationTerms, collaboration, canonicalRoom, extensionManager, onEditorViewReady, onCanonicalHistory, onCanonicalHistoryDrop, onEditorViewDestroy, onKeyDown, onCopy, onCut, onPaste, onReadOnlyEditAttempt, onRemoteSelectionsChange, getPrecomputedInitialState } = props;
|
|
1459
|
+
const { document, documentIdentity, experimentalSession, historyShortcuts = "editor", suggestionModeActive = false, suggestionAuthor = "User", onSessionRefusal, styles, theme: _theme, widthPx = 612, readOnly = false, onTransaction, onCanonicalCompositionLayout, getEmbeddedFontFamilyMap, onSelectionChange, externalPlugins = EMPTY_EXTERNAL_PLUGINS, anonymizationTerms, derivedFields, collaboration, canonicalRoom, extensionManager, onEditorViewReady, onCanonicalHistory, onCanonicalHistoryDrop, onEditorViewDestroy, onKeyDown, onCopy, onCut, onPaste, onReadOnlyEditAttempt, onRemoteSelectionsChange, getPrecomputedInitialState } = props;
|
|
1459
1460
|
const hasCollaboration = collaboration !== void 0;
|
|
1460
1461
|
const [collaborationLoad, setCollaborationLoad] = useState(() => ({ status: hasCollaboration ? "loading" : "disabled" }));
|
|
1461
1462
|
if (hasCollaboration !== (collaborationLoad.status !== "disabled")) setCollaborationLoad({ status: hasCollaboration ? "loading" : "disabled" });
|
|
@@ -1474,6 +1475,7 @@ const HiddenProseMirror = forwardRef((props, ref) => {
|
|
|
1474
1475
|
const extensionManagerRef = useRef(extensionManager);
|
|
1475
1476
|
const externalPluginsRef = useRef(externalPlugins);
|
|
1476
1477
|
const anonymizationTermsRef = useRef(anonymizationTerms);
|
|
1478
|
+
const derivedFieldsRef = useRef(derivedFields);
|
|
1477
1479
|
const getPrecomputedInitialStateRef = useRef(getPrecomputedInitialState);
|
|
1478
1480
|
const collaborationRef = useRef(collaboration);
|
|
1479
1481
|
const canonicalRoomRef = useRef(canonicalRoom);
|
|
@@ -1504,6 +1506,7 @@ const HiddenProseMirror = forwardRef((props, ref) => {
|
|
|
1504
1506
|
extensionManagerRef.current = extensionManager;
|
|
1505
1507
|
externalPluginsRef.current = externalPlugins;
|
|
1506
1508
|
anonymizationTermsRef.current = anonymizationTerms;
|
|
1509
|
+
derivedFieldsRef.current = derivedFields;
|
|
1507
1510
|
getPrecomputedInitialStateRef.current = getPrecomputedInitialState;
|
|
1508
1511
|
onTransactionRef.current = onTransaction;
|
|
1509
1512
|
onCanonicalCompositionLayoutRef.current = onCanonicalCompositionLayout;
|
|
@@ -1531,6 +1534,7 @@ const HiddenProseMirror = forwardRef((props, ref) => {
|
|
|
1531
1534
|
getExtensionManager: () => extensionManagerRef.current,
|
|
1532
1535
|
getExternalPlugins: () => externalPluginsRef.current,
|
|
1533
1536
|
getAnonymizationTerms: () => anonymizationTermsRef.current ?? NO_ANONYMIZATION_TERMS,
|
|
1537
|
+
getDerivedFields: () => derivedFieldsRef.current,
|
|
1534
1538
|
getCollaboration: () => collaborationRef.current,
|
|
1535
1539
|
getCollaborationModules: () => collaborationModulesRef.current,
|
|
1536
1540
|
getCanonicalRoom: () => canonicalRoomRef.current,
|
|
@@ -3381,7 +3385,7 @@ function buildFootnoteRenderItems(pageFootnoteMap, footnoteContentMap, doc) {
|
|
|
3381
3385
|
* PagedEditor - Main paginated editing component.
|
|
3382
3386
|
*/
|
|
3383
3387
|
const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
3384
|
-
const { accessibleName, document, documentIO, documentIdentity, experimentalSession, historyShortcuts, fonts: hostFonts, theme: _theme, hasTitlePg = false, 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, onCanonicalHistory, onCanonicalHistoryDrop, externalPlugins = EMPTY_PLUGINS, showTemplateDirectives = true, collaboration, canonicalRoom, 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, onAutocompleteChange, anonymizationTerms, onAnonymizationMatchesChange, selectedAnonymizationCanonical = null, anonymizationSelectionSeq } = props;
|
|
3388
|
+
const { accessibleName, document, documentIO, documentIdentity, experimentalSession, historyShortcuts, fonts: hostFonts, theme: _theme, hasTitlePg = false, 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, onCanonicalHistory, onCanonicalHistoryDrop, externalPlugins = EMPTY_PLUGINS, showTemplateDirectives = true, collaboration, canonicalRoom, 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, onAutocompleteChange, anonymizationTerms, onAnonymizationMatchesChange, derivedFields, selectedAnonymizationCanonical = null, anonymizationSelectionSeq } = props;
|
|
3385
3389
|
const styles = document?.package.styles;
|
|
3386
3390
|
const sectionProperties = useMemo(() => resolveEffectiveSectionProperties(document ? readModel(document).package.document : void 0, hasTitlePg) ?? null, [document, hasTitlePg]);
|
|
3387
3391
|
const getScrollContainer = useCallback(() => {
|
|
@@ -6371,6 +6375,7 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
|
|
|
6371
6375
|
/* @__PURE__ */ jsx(HiddenProseMirror, {
|
|
6372
6376
|
ref: hiddenPMRef,
|
|
6373
6377
|
anonymizationTerms,
|
|
6378
|
+
derivedFields,
|
|
6374
6379
|
document,
|
|
6375
6380
|
documentIdentity,
|
|
6376
6381
|
experimentalSession: usesCanonicalSession(experimentalSession, CANONICAL_GAP.authorityRouting) ? "canonical" : "legacy",
|
|
@@ -14190,7 +14195,7 @@ function useFolioComments({ doc, autoOpenReviewSidebar, anchorPositions, editorC
|
|
|
14190
14195
|
// src/components/DocxEditor.tsx
|
|
14191
14196
|
/** No headings to track while the outline is not shown. */
|
|
14192
14197
|
const NO_HEADINGS = [];
|
|
14193
|
-
const CommentsSidebar = lazy(() => import("./CommentsSidebar-
|
|
14198
|
+
const CommentsSidebar = lazy(() => import("./CommentsSidebar-CMNMCb-Y.js").then((m) => ({ default: m.CommentsSidebar })));
|
|
14194
14199
|
const TextContextMenu = lazy(() => import("./TextContextMenu-jOBgICwD.js").then((m) => ({ default: m.TextContextMenu })));
|
|
14195
14200
|
const loadAttemptSelectiveSave = async () => {
|
|
14196
14201
|
const { attemptSelectiveSave } = await import("@stll/folio-core/docx/selectiveSave");
|
|
@@ -14283,7 +14288,7 @@ const createPagedEditorBinding = () => {
|
|
|
14283
14288
|
/**
|
|
14284
14289
|
* DocxEditor - Complete DOCX editor component
|
|
14285
14290
|
*/
|
|
14286
|
-
const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuffer, password, document: initialDocument, onSave, author = "User", onChange, onFindResultChange, onSelectionChange, onSelectionTextChange, onError, onFontsLoaded: onFontsLoadedCallback, fontFamilies, fonts, theme, showToolbar = true, showZoomControl = true, showReviewControls = true, showHeaderFooterEditing = true, pageRenderer, showMarginGuides = false, marginGuideColor, showRuler: showRulerProp = false, rulerUnit = "inch", initialZoom = 1, enableWheelZoom = true, keyboardShortcuts = DEFAULT_KEYBOARD_SHORTCUT_SCOPE, hostShortcuts: hostShortcutsProp, readOnly: readOnlyProp = false, reviewDisplayMode, showCommentHighlights = true, autoOpenReviewSidebar = true, components, toolbarExtra, className = "", style, placeholder, loadingIndicator, preserveDocumentWhileLoading = false, initialScrollTop, onScrollTopChange, showOutline: showOutlineProp = true, outlineDepth: outlineDepthProp, onOutlineDepthChange, onPrint, onInsertImage, onInsertTable, showTableInsert = true, onInsertPageBreak, onInsertTOC, onCopy, onCut, onPaste, mode: modeProp, onModeChange, onReadonlyEditAttempt, onCompatibilityChange, onEditorViewReady, onCanonicalHistory, onCanonicalHistoryDrop, anonymizationTerms, onAnonymizationMatchesChange, onAnonymizationTermClick, onAutocompleteChange, selectedAnonymizationCanonical = null, anonymizationSelectionSeq, showTemplateDirectives = false, onSlashMenuChange, onSlashMenuKeyAction, customContextMenuItems, onCustomContextAction, comments: commentsProp, onCommentsChange, collaboration, plugins, featureFlags, experimentalSession: experimentalSessionProp, onSelectiveSaveTripwire }, ref) {
|
|
14291
|
+
const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuffer, password, document: initialDocument, onSave, author = "User", onChange, onFindResultChange, onSelectionChange, onSelectionTextChange, onError, onFontsLoaded: onFontsLoadedCallback, fontFamilies, fonts, theme, showToolbar = true, showZoomControl = true, showReviewControls = true, showHeaderFooterEditing = true, pageRenderer, showMarginGuides = false, marginGuideColor, showRuler: showRulerProp = false, rulerUnit = "inch", initialZoom = 1, enableWheelZoom = true, keyboardShortcuts = DEFAULT_KEYBOARD_SHORTCUT_SCOPE, hostShortcuts: hostShortcutsProp, readOnly: readOnlyProp = false, reviewDisplayMode, showCommentHighlights = true, autoOpenReviewSidebar = true, components, toolbarExtra, className = "", style, placeholder, loadingIndicator, preserveDocumentWhileLoading = false, initialScrollTop, onScrollTopChange, showOutline: showOutlineProp = true, outlineDepth: outlineDepthProp, onOutlineDepthChange, onPrint, onInsertImage, onInsertTable, showTableInsert = true, onInsertPageBreak, onInsertTOC, onCopy, onCut, onPaste, mode: modeProp, onModeChange, onReadonlyEditAttempt, onCompatibilityChange, onEditorViewReady, onCanonicalHistory, onCanonicalHistoryDrop, anonymizationTerms, onAnonymizationMatchesChange, onAnonymizationTermClick, derivedFields, onAutocompleteChange, selectedAnonymizationCanonical = null, anonymizationSelectionSeq, showTemplateDirectives = false, onSlashMenuChange, onSlashMenuKeyAction, customContextMenuItems, onCustomContextAction, comments: commentsProp, onCommentsChange, collaboration, plugins, featureFlags, experimentalSession: experimentalSessionProp, onSelectiveSaveTripwire }, ref) {
|
|
14287
14292
|
const experimentalSession = experimentalSessionProp ?? (collaboration?.yXmlFragment === void 0 ? void 0 : "legacy");
|
|
14288
14293
|
const canonicalRoom = collaboration !== void 0 && isCanonicalRoomCollaboration(collaboration) ? collaboration : void 0;
|
|
14289
14294
|
const yjsCollaboration = collaboration !== void 0 && !isCanonicalRoomCollaboration(collaboration) ? collaboration : void 0;
|
|
@@ -14436,6 +14441,11 @@ const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuff
|
|
|
14436
14441
|
onKeyAction: (action) => slashKeyCallback.invoke(action) ?? false
|
|
14437
14442
|
}));
|
|
14438
14443
|
const templatePreviewPlugin = useMemo(() => createTemplatePreviewValuesPlugin(), []);
|
|
14444
|
+
const [derivedFieldsSlot] = useState(() => createCallbackSlot(() => derivedFields));
|
|
14445
|
+
useLayoutEffect(() => {
|
|
14446
|
+
derivedFieldsSlot.commit(() => derivedFields);
|
|
14447
|
+
});
|
|
14448
|
+
const [derivedFieldsPlugin] = useState(() => createDerivedFieldsPlugin(derivedFieldsSlot.invoke));
|
|
14439
14449
|
const [hostPlugins] = useState(() => plugins ?? []);
|
|
14440
14450
|
const editorPlugins = useMemo(() => [
|
|
14441
14451
|
...hostPlugins,
|
|
@@ -14444,7 +14454,8 @@ const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuff
|
|
|
14444
14454
|
aiSuggestionPlugin,
|
|
14445
14455
|
aiCitationPlugin,
|
|
14446
14456
|
...showTemplateDirectives ? [templateDirectivesPlugin, templateSlashMenu] : [],
|
|
14447
|
-
templatePreviewPlugin
|
|
14457
|
+
templatePreviewPlugin,
|
|
14458
|
+
derivedFieldsPlugin
|
|
14448
14459
|
], [
|
|
14449
14460
|
hostPlugins,
|
|
14450
14461
|
yjsCollaboration?.plugins,
|
|
@@ -14454,7 +14465,8 @@ const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuff
|
|
|
14454
14465
|
showTemplateDirectives,
|
|
14455
14466
|
templateDirectivesPlugin,
|
|
14456
14467
|
templateSlashMenu,
|
|
14457
|
-
templatePreviewPlugin
|
|
14468
|
+
templatePreviewPlugin,
|
|
14469
|
+
derivedFieldsPlugin
|
|
14458
14470
|
]);
|
|
14459
14471
|
const lastReportedViewRef = useRef(null);
|
|
14460
14472
|
const reportEditorViewReady = useCallback((view_0) => {
|
|
@@ -16798,6 +16810,7 @@ const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuff
|
|
|
16798
16810
|
getPositionPage: (position_1) => pagedEditorRef.current?.getEditor()?.getPositionPage(position_1) ?? null,
|
|
16799
16811
|
autocomplete: delegateAutocomplete(() => pagedEditorRef.current?.getEditor()?.autocomplete ?? NO_AUTOCOMPLETE),
|
|
16800
16812
|
getAnonymizationMatches: () => pagedEditorRef.current?.getEditor()?.getAnonymizationHighlights().matches ?? NO_ANONYMIZATION_HIGHLIGHTS.matches,
|
|
16813
|
+
insertField: (field) => getActiveEditorStory().type === "body" && (pagedEditorRef.current?.getEditor()?.insertField(field) ?? false),
|
|
16801
16814
|
getBlockRect: (blockId_1) => pagedEditorRef.current?.getBlockRect(blockId_1) ?? null,
|
|
16802
16815
|
getBlockRects: (blockIds) => pagedEditorRef.current?.getBlockRects(blockIds) ?? /* @__PURE__ */ new Map(),
|
|
16803
16816
|
getScrollRoot: () => pagedEditorRef.current?.getScrollRoot() ?? null,
|
|
@@ -17897,6 +17910,7 @@ const DocxEditor = forwardRef(function DocxEditor({ accessibleName, documentBuff
|
|
|
17897
17910
|
pageEndGutter: panelLayout.commentsGutter,
|
|
17898
17911
|
anchorPositionMode: "comments",
|
|
17899
17912
|
anonymizationTerms,
|
|
17913
|
+
derivedFields,
|
|
17900
17914
|
onAnonymizationMatchesChange,
|
|
17901
17915
|
onAnonymizationTermClick,
|
|
17902
17916
|
onAutocompleteChange,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
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.
|
|
81
|
+
"@stll/folio-core": "^0.71.0",
|
|
82
82
|
"@stll/folio-fonts": "^0.1.0",
|
|
83
83
|
"@stll/utf8-boundaries": "0.2.0",
|
|
84
84
|
"@types/react": "^19.3.0",
|