@stll/folio-core 0.54.2 → 0.55.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/ai-edits/apply.js +22 -1
- package/dist/ai-edits/headless.js +1 -0
- package/dist/compare/content-types.d.ts +3 -15
- package/dist/controller/canonicalComposition.d.ts +36 -0
- package/dist/controller/canonicalComposition.js +168 -0
- package/dist/controller/canonicalInput.d.ts +45 -0
- package/dist/controller/canonicalInput.js +338 -0
- package/dist/controller/canonicalOperations.d.ts +22 -0
- package/dist/controller/canonicalOperations.js +85 -0
- package/dist/controller/canonicalReview.d.ts +12 -0
- package/dist/controller/canonicalReview.js +19 -0
- package/dist/controller/canonicalSession.d.ts +149 -0
- package/dist/controller/canonicalSession.js +1038 -0
- package/dist/controller/canonicalStoryEditor.d.ts +34 -0
- package/dist/controller/canonicalStoryEditor.js +82 -0
- package/dist/controller/canonicalStructure.d.ts +16 -0
- package/dist/controller/canonicalStructure.js +269 -0
- package/dist/controller/folioEditor.d.ts +1 -1
- package/dist/controller/folioEditor.js +9 -0
- package/dist/controller/headerFooterEditorManager.d.ts +4 -0
- package/dist/controller/headerFooterEditorManager.js +71 -3
- package/dist/controller/hiddenEditorApi.d.ts +35 -0
- package/dist/controller/hiddenEditorApi.js +25 -8
- package/dist/controller/hiddenEditorManager.d.ts +11 -2
- package/dist/controller/hiddenEditorManager.js +456 -30
- package/dist/controller/layoutPipeline.d.ts +1 -1
- package/dist/controller/layoutPipeline.js +2 -0
- package/dist/controller/noteEditorManager.d.ts +4 -0
- package/dist/controller/noteEditorManager.js +113 -15
- package/dist/docx/attributeRemainder.js +1 -0
- package/dist/docx/canonicalSessionInput.d.ts +11 -0
- package/dist/docx/canonicalSessionInput.js +27 -0
- package/dist/docx/canonicalStoryRepack.d.ts +10 -0
- package/dist/docx/canonicalStoryRepack.js +41 -0
- package/dist/docx/contentTypeRegistry.d.ts +8 -0
- package/dist/docx/contentTypeRegistry.js +64 -0
- package/dist/docx/ensureParaIds.d.ts +7 -1
- package/dist/docx/ensureParaIds.js +163 -211
- package/dist/docx/foldedListNumberFields.d.ts +85 -0
- package/dist/docx/foldedListNumberFields.js +267 -0
- package/dist/docx/headerFooterVerbatim.d.ts +14 -1
- package/dist/docx/headerFooterVerbatim.js +95 -2
- package/dist/docx/noteIds.d.ts +5 -0
- package/dist/docx/noteIds.js +6 -2
- package/dist/docx/noteReferenceMark.d.ts +3 -1
- package/dist/docx/noteReferenceMark.js +15 -14
- package/dist/docx/numberingParser.d.ts +3 -1
- package/dist/docx/numberingParser.js +17 -3
- package/dist/docx/packageParts.d.ts +3 -1
- package/dist/docx/packageParts.js +65 -16
- package/dist/docx/paragraphMarkPropertyPresence.d.ts +9 -0
- package/dist/docx/paragraphMarkPropertyPresence.js +21 -0
- package/dist/docx/paragraphParser.js +101 -53
- package/dist/docx/paragraphPropertySource.d.ts +15 -1
- package/dist/docx/paragraphPropertySource.js +76 -22
- package/dist/docx/parser.js +2 -1
- package/dist/docx/reviewHistoryNamespace.d.ts +4 -0
- package/dist/docx/reviewHistoryNamespace.js +4 -0
- package/dist/docx/reviewResolutionProvenance.d.ts +25 -0
- package/dist/docx/reviewResolutionProvenance.js +153 -0
- package/dist/docx/rezip.d.ts +7 -3
- package/dist/docx/rezip.js +107 -45
- package/dist/docx/runConsolidator.d.ts +2 -58
- package/dist/docx/runConsolidator.js +3 -175
- package/dist/docx/runParser.d.ts +2 -1
- package/dist/docx/runParser.js +156 -116
- package/dist/docx/saveDiagnostics.d.ts +11 -0
- package/dist/docx/saveDiagnostics.js +0 -0
- package/dist/docx/selectiveSave.d.ts +2 -1
- package/dist/docx/selectiveSave.js +4 -1
- package/dist/docx/selectiveXmlPatch.d.ts +16 -8
- package/dist/docx/selectiveXmlPatch.js +74 -2
- package/dist/docx/serializer/headerFooterSerializer.d.ts +5 -1
- package/dist/docx/serializer/headerFooterSerializer.js +19 -11
- package/dist/docx/serializer/noteSerializer.d.ts +2 -2
- package/dist/docx/serializer/noteSerializer.js +24 -8
- package/dist/docx/serializer/paragraphSerializer.js +41 -4
- package/dist/docx/serializer/partNamespaces.js +2 -1
- package/dist/docx/serializer/runSerializer.js +3 -1
- package/dist/docx/settingsHeaderFooterUpdate.d.ts +5 -0
- package/dist/docx/settingsHeaderFooterUpdate.js +90 -0
- package/dist/docx/settingsParser.d.ts +1 -2
- package/dist/docx/settingsParser.js +5 -6
- package/dist/docx/storyBlockReplay.d.ts +11 -0
- package/dist/docx/storyBlockReplay.js +367 -0
- package/dist/docx/streamingXmlParser.d.ts +22 -1
- package/dist/docx/streamingXmlParser.js +49 -3
- package/dist/docx/structuralXmlPatch.js +8 -1
- package/dist/docx/verbatimCapture.d.ts +3 -1
- package/dist/docx/verbatimCapture.js +49 -6
- package/dist/i18n/messages/ar.gen.d.ts +5 -0
- package/dist/i18n/messages/ar.gen.js +656 -0
- package/dist/i18n/messages/cs.gen.d.ts +5 -0
- package/dist/i18n/messages/cs.gen.js +656 -0
- package/dist/i18n/messages/de.gen.d.ts +5 -0
- package/dist/i18n/messages/de.gen.js +656 -0
- package/dist/i18n/messages/en.gen.d.ts +5 -0
- package/dist/i18n/messages/en.gen.js +656 -0
- package/dist/i18n/messages/es.gen.d.ts +5 -0
- package/dist/i18n/messages/es.gen.js +656 -0
- package/dist/i18n/messages/et.gen.d.ts +5 -0
- package/dist/i18n/messages/et.gen.js +656 -0
- package/dist/i18n/messages/fr.gen.d.ts +5 -0
- package/dist/i18n/messages/fr.gen.js +656 -0
- package/dist/i18n/messages/he.gen.d.ts +5 -0
- package/dist/i18n/messages/he.gen.js +656 -0
- package/dist/i18n/messages/hi.gen.d.ts +5 -0
- package/dist/i18n/messages/hi.gen.js +656 -0
- package/dist/i18n/messages/hu.gen.d.ts +5 -0
- package/dist/i18n/messages/hu.gen.js +656 -0
- package/dist/i18n/messages/locales.d.ts +5 -0
- package/dist/i18n/messages/locales.js +22 -0
- package/dist/i18n/messages/lt.gen.d.ts +5 -0
- package/dist/i18n/messages/lt.gen.js +656 -0
- package/dist/i18n/messages/lv.gen.d.ts +5 -0
- package/dist/i18n/messages/lv.gen.js +656 -0
- package/dist/i18n/messages/pl.gen.d.ts +5 -0
- package/dist/i18n/messages/pl.gen.js +656 -0
- package/dist/i18n/messages/pt-BR.gen.d.ts +5 -0
- package/dist/i18n/messages/pt-BR.gen.js +656 -0
- package/dist/i18n/messages/sk.gen.d.ts +5 -0
- package/dist/i18n/messages/sk.gen.js +656 -0
- package/dist/i18n/messages/tr.gen.d.ts +5 -0
- package/dist/i18n/messages/tr.gen.js +656 -0
- package/dist/i18n/messages/zh-CN.gen.d.ts +5 -0
- package/dist/i18n/messages/zh-CN.gen.js +656 -0
- package/dist/i18n/messages.d.ts +2 -3
- package/dist/i18n/messages.js +1 -19
- package/dist/internal/noteMarkerAttrs.d.ts +8 -0
- package/dist/internal/noteMarkerAttrs.js +16 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +1 -0
- package/dist/internal/prosemirrorAttrBoundary.d.ts +21 -0
- package/dist/internal/prosemirrorAttrBoundary.js +50 -0
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +1 -0
- package/dist/layout-bridge/convert/footnoteLayout.js +3 -3
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +1 -0
- package/dist/layout-bridge/convert/headerFooterLayout.js +1 -0
- package/dist/layout-bridge/convert/noteReferences.d.ts +1 -3
- package/dist/layout-bridge/convert/noteReferences.js +1 -6
- package/dist/layout-bridge/convert/paragraphRuns.js +2 -4
- package/dist/layout-bridge/convert/toFlowBlocks.d.ts +2 -2
- package/dist/layout-bridge/convert/toFlowBlocks.js +2 -2
- package/dist/managers/DocumentLoaderManager.d.ts +1 -0
- package/dist/managers/DocumentLoaderManager.js +8 -1
- package/dist/markdown/renderBlock.js +15 -1
- package/dist/markdown/renderParagraph.js +9 -13
- package/dist/markdown/renderRuns.js +3 -2
- package/dist/markdown/renderTable.js +2 -0
- package/dist/markdown/types.d.ts +3 -9
- package/dist/prosemirror/attrs/index.d.ts +2 -12
- package/dist/prosemirror/attrs/index.js +22 -48
- package/dist/prosemirror/bookmarkBoundaryAttrs.d.ts +2 -1
- package/dist/prosemirror/canonicalCommands.d.ts +97 -0
- package/dist/prosemirror/canonicalCommands.js +28 -0
- package/dist/prosemirror/commands/pageBreak.js +15 -1
- package/dist/prosemirror/commentReferenceAttrs.d.ts +2 -1
- package/dist/prosemirror/conversion/fromProseDoc.js +91 -19
- package/dist/prosemirror/conversion/listRenderingDefinition.d.ts +6 -0
- package/dist/prosemirror/conversion/listRenderingDefinition.js +97 -0
- package/dist/prosemirror/conversion/toProseDoc.d.ts +4 -3
- package/dist/prosemirror/conversion/toProseDoc.js +51 -11
- package/dist/prosemirror/executeEditorCommand.d.ts +11 -0
- package/dist/prosemirror/executeEditorCommand.js +26 -0
- package/dist/prosemirror/extensions/StarterKit.js +2 -0
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +50 -19
- package/dist/prosemirror/extensions/features/ListExtension.js +18 -5
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +5 -2
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +13 -1
- package/dist/prosemirror/extensions/marks/TextColorExtension.js +3 -2
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +2 -0
- package/dist/prosemirror/extensions/marks/markUtils.js +70 -8
- package/dist/prosemirror/extensions/nodes/NoteMarkerExtension.d.ts +6 -0
- package/dist/prosemirror/extensions/nodes/NoteMarkerExtension.js +36 -0
- package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.js +4 -2
- package/dist/prosemirror/listMarker.d.ts +1 -0
- package/dist/prosemirror/listMarker.js +16 -7
- package/dist/prosemirror/listNumbering.js +26 -5
- package/dist/prosemirror/listRenderingAttrs.d.ts +1 -0
- package/dist/prosemirror/listRenderingAttrs.js +3 -0
- package/dist/prosemirror/markupViewNotes.js +3 -2
- package/dist/prosemirror/moveRangeBoundaryAttrs.d.ts +2 -1
- package/dist/prosemirror/noteReferenceReview.js +5 -3
- package/dist/prosemirror/plugins/suggestionMode.js +50 -2
- package/dist/prosemirror/rangeAnchorAttrs.d.ts +2 -1
- package/dist/prosemirror/runFormattingFromMarks.d.ts +4 -1
- package/dist/prosemirror/runFormattingFromMarks.js +15 -1
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +2 -1
- package/dist/prosemirror/runFormattingInlineCarriers.js +4 -1
- package/dist/prosemirror/schema/marks.d.ts +2 -0
- package/dist/prosemirror/schema/nodes.d.ts +10 -2
- package/dist/prosemirror/textBoxAnchorAttrs.d.ts +2 -1
- package/dist/prosemirror/textInput.js +5 -1
- package/dist/prosemirror/trackedRevisionPath.js +2 -1
- package/dist/prosemirror/trackedRunInlineAtoms.d.ts +1 -0
- package/dist/prosemirror/trackedRunInlineAtoms.js +1 -0
- package/dist/prosemirror/validation.js +4 -0
- package/dist/types/content.d.ts +2 -2
- package/dist/utils/createDocument.js +2 -2
- package/package.json +14 -2
|
@@ -1,17 +1,10 @@
|
|
|
1
|
+
import { cloneDocumentWithParagraphPropertySources } from "../docx/paragraphPropertySource.js";
|
|
1
2
|
import { fromProseDoc } from "../prosemirror/conversion/fromProseDoc.js";
|
|
2
3
|
import { CellSelection } from "prosemirror-tables";
|
|
3
4
|
import { NodeSelection, Selection, TextSelection } from "prosemirror-state";
|
|
4
5
|
import { redo, undo } from "prosemirror-history";
|
|
5
6
|
//#region src/controller/hiddenEditorApi.ts
|
|
6
7
|
/**
|
|
7
|
-
* Hidden-editor imperative API
|
|
8
|
-
*
|
|
9
|
-
* Framework-agnostic method surface for the off-screen ProseMirror editor.
|
|
10
|
-
* Operates on an injected view accessor plus the document context and
|
|
11
|
-
* destruction guard, so the same imperative handle can be driven from the
|
|
12
|
-
* React component or a headless controller without depending on React.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
8
|
* Convert PM state to Document
|
|
16
9
|
*/
|
|
17
10
|
const stateToDocument = (state, originalDoc) => {
|
|
@@ -39,11 +32,25 @@ const createHiddenEditorApi = (deps) => {
|
|
|
39
32
|
isViewRequested: deps.isViewRequested,
|
|
40
33
|
getState: () => deps.getView()?.state ?? null,
|
|
41
34
|
getView: () => deps.getView() ?? null,
|
|
35
|
+
setCanonicalMode: (mode) => !deps.isDestroying() && (deps.setCanonicalMode?.(mode) ?? false),
|
|
36
|
+
resolveCanonicalRevisions: (revisionIds, resolution) => !deps.isDestroying() && (deps.resolveCanonicalRevisions?.(revisionIds, resolution) ?? false),
|
|
37
|
+
getCanonicalDocument: () => {
|
|
38
|
+
const canonical = deps.getCanonicalDocument?.();
|
|
39
|
+
return canonical ? cloneDocumentWithParagraphPropertySources(canonical) : null;
|
|
40
|
+
},
|
|
42
41
|
getDocument: () => {
|
|
42
|
+
const canonical = deps.getCanonicalDocument?.();
|
|
43
|
+
if (canonical) return cloneDocumentWithParagraphPropertySources(canonical);
|
|
43
44
|
const view = deps.getView();
|
|
44
45
|
if (!view) return null;
|
|
45
46
|
return stateToDocument(view.state, deps.getDocumentContext());
|
|
46
47
|
},
|
|
48
|
+
updateCanonicalInputLifecycle: (action) => deps.canonicalOperations?.updateCanonicalInputLifecycle(action) ?? false,
|
|
49
|
+
applyCanonicalStoryHistory: (options) => deps.canonicalOperations?.applyCanonicalStoryHistory(options) ?? false,
|
|
50
|
+
applyCanonicalOperations: (ops) => deps.canonicalOperations?.applyCanonicalOperations(ops) ?? false,
|
|
51
|
+
getCanonicalStorySelection: (story) => deps.canonicalOperations?.getCanonicalStorySelection(story) ?? null,
|
|
52
|
+
getCanonicalStoryProjection: (story) => deps.canonicalOperations?.getCanonicalStoryProjection(story) ?? null,
|
|
53
|
+
replaceCanonicalStoryText: (options) => deps.canonicalOperations?.replaceCanonicalStoryText(options) ?? false,
|
|
47
54
|
focus: () => {
|
|
48
55
|
const view = deps.getView();
|
|
49
56
|
if (!view || view.hasFocus()) return;
|
|
@@ -62,24 +69,34 @@ const createHiddenEditorApi = (deps) => {
|
|
|
62
69
|
executeCommand: (command) => {
|
|
63
70
|
const view = deps.getView();
|
|
64
71
|
if (!view) return false;
|
|
72
|
+
const canonical = deps.executeCanonicalCommand?.(command);
|
|
73
|
+
if (canonical !== void 0) return canonical;
|
|
65
74
|
return command(view.state, (tr) => dispatchTr(view, tr), view);
|
|
66
75
|
},
|
|
67
76
|
undo: () => {
|
|
77
|
+
const canonical = deps.getCanonicalHistory?.();
|
|
78
|
+
if (canonical) return canonical.undo();
|
|
68
79
|
const view = deps.getView();
|
|
69
80
|
if (!view) return false;
|
|
70
81
|
return undo(view.state, (tr) => dispatchTr(view, tr));
|
|
71
82
|
},
|
|
72
83
|
redo: () => {
|
|
84
|
+
const canonical = deps.getCanonicalHistory?.();
|
|
85
|
+
if (canonical) return canonical.redo();
|
|
73
86
|
const view = deps.getView();
|
|
74
87
|
if (!view) return false;
|
|
75
88
|
return redo(view.state, (tr) => dispatchTr(view, tr));
|
|
76
89
|
},
|
|
77
90
|
canUndo: () => {
|
|
91
|
+
const canonical = deps.getCanonicalHistory?.();
|
|
92
|
+
if (canonical) return canonical.canUndo();
|
|
78
93
|
const view = deps.getView();
|
|
79
94
|
if (!view) return false;
|
|
80
95
|
return undo(view.state);
|
|
81
96
|
},
|
|
82
97
|
canRedo: () => {
|
|
98
|
+
const canonical = deps.getCanonicalHistory?.();
|
|
99
|
+
if (canonical) return canonical.canRedo();
|
|
83
100
|
const view = deps.getView();
|
|
84
101
|
if (!view) return false;
|
|
85
102
|
return redo(view.state);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { document_d_exports } from "../types/document.js";
|
|
2
|
+
import { HiddenEditorApi } from "./hiddenEditorApi.js";
|
|
2
3
|
import { HiddenEditorStateReason } from "../layout-engine/layoutInstrumentation.js";
|
|
3
4
|
import { ExtensionManager } from "../prosemirror/extensions/ExtensionManager.js";
|
|
4
5
|
import { RemoteSelection } from "../types/remote-selection.js";
|
|
5
|
-
import {
|
|
6
|
+
import { EditorMode } from "../managers/EditorModeManager.js";
|
|
6
7
|
import { EditorState, Plugin, Transaction } from "prosemirror-state";
|
|
7
8
|
import { EditorView } from "prosemirror-view";
|
|
8
9
|
import * as Yjs from "yjs";
|
|
9
10
|
import { XmlFragment } from "yjs";
|
|
10
11
|
import * as YProseMirror from "y-prosemirror";
|
|
11
12
|
//#region src/controller/hiddenEditorManager.d.ts
|
|
13
|
+
declare const CanonicalSessionRefusalError_base: import("better-result").TaggedErrorClass<"CanonicalSessionRefusalError">;
|
|
14
|
+
declare class CanonicalSessionRefusalError extends CanonicalSessionRefusalError_base<{
|
|
15
|
+
message: string;
|
|
16
|
+
}> {}
|
|
12
17
|
type YProseMirrorModule = typeof YProseMirror;
|
|
13
18
|
type YjsModule = typeof Yjs;
|
|
14
19
|
type CollaborationModules = {
|
|
@@ -55,6 +60,10 @@ type HiddenEditorManagerDeps = {
|
|
|
55
60
|
getCollaborationModules: () => CollaborationModules | null;
|
|
56
61
|
getPrecomputedInitialState: () => EditorState | null | undefined;
|
|
57
62
|
getReadOnly: () => boolean;
|
|
63
|
+
getExperimentalSession?: () => "canonical" | undefined;
|
|
64
|
+
getEditingMode?: () => EditorMode;
|
|
65
|
+
getSuggestionAuthor?: () => string;
|
|
66
|
+
onSessionRefusal?: (reason: string) => void;
|
|
58
67
|
/**
|
|
59
68
|
* Identity of the loaded document as tracked by the adapter's loader: the
|
|
60
69
|
* same value across internal edits (so typing does not trigger an external
|
|
@@ -102,4 +111,4 @@ type HiddenEditorManager = {
|
|
|
102
111
|
};
|
|
103
112
|
declare const createHiddenEditorManager: (deps: HiddenEditorManagerDeps) => HiddenEditorManager;
|
|
104
113
|
//#endregion
|
|
105
|
-
export { CollaborationModules, CreateHiddenEditorStateOptions, HiddenEditorManager, HiddenEditorManagerDeps, HiddenEditorTransactionUpdate, HiddenProseMirrorCollaboration, HiddenProseMirrorRemoteSelection, collectRemoteSelections, createHiddenEditorClipboardHandlers, createHiddenEditorManager, createHiddenEditorState };
|
|
114
|
+
export { CanonicalSessionRefusalError, CollaborationModules, CreateHiddenEditorStateOptions, HiddenEditorManager, HiddenEditorManagerDeps, HiddenEditorTransactionUpdate, HiddenProseMirrorCollaboration, HiddenProseMirrorRemoteSelection, collectRemoteSelections, createHiddenEditorClipboardHandlers, createHiddenEditorManager, createHiddenEditorState };
|