@drghaliasri/butex 7.0.3 → 7.1.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/document2-cli.js +376 -34
- package/dist/document2-cli.js.map +1 -1
- package/dist/document2.d.mts +83 -3
- package/dist/document2.d.ts +83 -3
- package/dist/document2.js +399 -37
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +396 -37
- package/dist/document2.mjs.map +1 -1
- package/dist/react-document2-preview.d.mts +336 -0
- package/dist/react-document2-preview.d.ts +336 -0
- package/dist/react-document2-preview.js +7767 -0
- package/dist/react-document2-preview.js.map +1 -0
- package/dist/react-document2-preview.mjs +7737 -0
- package/dist/react-document2-preview.mjs.map +1 -0
- package/dist/react-document2.d.mts +53 -14
- package/dist/react-document2.d.ts +53 -14
- package/dist/react-document2.js +284 -42
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +281 -41
- package/dist/react-document2.mjs.map +1 -1
- package/package.json +9 -2
package/dist/document2.d.mts
CHANGED
|
@@ -217,6 +217,12 @@ type Document2BlockJson = {
|
|
|
217
217
|
cell_inline_ids?: Document2InlineIdsJson[][];
|
|
218
218
|
columns?: string;
|
|
219
219
|
caption?: string;
|
|
220
|
+
/** Optional formatting sidecar for caption text spans. */
|
|
221
|
+
caption_formats?: TextFormatSpan2Json[];
|
|
222
|
+
/** Stable caption field/token identities; omitted by legacy documents. */
|
|
223
|
+
caption_inline_ids?: Document2InlineIdsJson;
|
|
224
|
+
/** Caption-only structured math sidecar, independent from table cell math_objects. */
|
|
225
|
+
caption_math_objects?: Array<Document2MathObjectJson | null>;
|
|
220
226
|
label?: string;
|
|
221
227
|
caption_enabled?: boolean;
|
|
222
228
|
label_enabled?: boolean;
|
|
@@ -321,7 +327,10 @@ type ListBlock2 = {
|
|
|
321
327
|
type FloatMeta2 = {
|
|
322
328
|
centered: boolean;
|
|
323
329
|
captionEnabled: boolean;
|
|
330
|
+
/** Compatibility source string; captionField is the structured source of truth. */
|
|
324
331
|
caption: string;
|
|
332
|
+
/** Stable inline field used by the editor, commands, preview, and persistence. */
|
|
333
|
+
captionField: InlineField2;
|
|
325
334
|
labelEnabled: boolean;
|
|
326
335
|
label: string;
|
|
327
336
|
};
|
|
@@ -465,7 +474,10 @@ type PreviewBlock2 = {
|
|
|
465
474
|
kind: 'table';
|
|
466
475
|
id: string;
|
|
467
476
|
rows: PreviewInline2[][][];
|
|
477
|
+
/** Compatibility source string for hosts that still read caption directly. */
|
|
468
478
|
caption?: string;
|
|
479
|
+
/** Structured caption rendering path, including MathIsland tokens. */
|
|
480
|
+
captionInlines?: PreviewInline2[];
|
|
469
481
|
label?: string;
|
|
470
482
|
numberLabel?: string;
|
|
471
483
|
metadata?: Document2BlockMetadata;
|
|
@@ -476,7 +488,10 @@ type PreviewBlock2 = {
|
|
|
476
488
|
assetId?: string;
|
|
477
489
|
options: Record<string, string>;
|
|
478
490
|
centered?: boolean;
|
|
491
|
+
/** Compatibility source string for alt text/legacy hosts. */
|
|
479
492
|
caption?: string;
|
|
493
|
+
/** Structured caption rendering path, including MathIsland tokens. */
|
|
494
|
+
captionInlines?: PreviewInline2[];
|
|
480
495
|
label?: string;
|
|
481
496
|
numberLabel?: string;
|
|
482
497
|
metadata?: Document2BlockMetadata;
|
|
@@ -537,9 +552,10 @@ type FloatMetaPatch = {
|
|
|
537
552
|
declare function defaultFloatMeta(): {
|
|
538
553
|
centered: true;
|
|
539
554
|
captionEnabled: false;
|
|
540
|
-
caption:
|
|
555
|
+
caption: string;
|
|
556
|
+
captionField: InlineField2;
|
|
541
557
|
labelEnabled: false;
|
|
542
|
-
label:
|
|
558
|
+
label: string;
|
|
543
559
|
};
|
|
544
560
|
declare function parseFloatMetaFromJson(json: {
|
|
545
561
|
caption?: string;
|
|
@@ -889,6 +905,26 @@ declare class Document2CommandError extends Error {
|
|
|
889
905
|
/** Apply one validated command to canonical JSON without mutating caller input. */
|
|
890
906
|
declare function applyDocument2Command(json: Document2Json, commandInput: Document2Command): Document2Json;
|
|
891
907
|
|
|
908
|
+
type Document2DiffChunkKind = 'added' | 'removed' | 'context';
|
|
909
|
+
type Document2DiffChunk = {
|
|
910
|
+
kind: Document2DiffChunkKind;
|
|
911
|
+
text: string;
|
|
912
|
+
};
|
|
913
|
+
type Document2Diff = {
|
|
914
|
+
version: 1;
|
|
915
|
+
changed: boolean;
|
|
916
|
+
truncated: boolean;
|
|
917
|
+
chunks: Document2DiffChunk[];
|
|
918
|
+
};
|
|
919
|
+
/**
|
|
920
|
+
* Compare two persisted Document2 documents using canonical Document2 import/export
|
|
921
|
+
* semantics and jsdiff's maintained JSON diff implementation.
|
|
922
|
+
*
|
|
923
|
+
* Generated editor identity sidecars are intentionally excluded so equivalent
|
|
924
|
+
* legacy documents do not differ merely because normalization assigned new IDs.
|
|
925
|
+
*/
|
|
926
|
+
declare function diffDocument2(before: Document2Json, after: Document2Json): Document2Diff;
|
|
927
|
+
|
|
892
928
|
type Document2OutlineKind = 'section' | 'subsection' | 'subsubsection' | 'paragraph' | 'list' | 'table' | 'figure' | 'bibliography' | 'raw';
|
|
893
929
|
type Document2OutlineEntry = {
|
|
894
930
|
id: string;
|
|
@@ -899,6 +935,50 @@ type Document2OutlineEntry = {
|
|
|
899
935
|
/** Return a compact top-level outline for a canonical document. */
|
|
900
936
|
declare function document2Outline(json: Document2Json): Document2OutlineEntry[];
|
|
901
937
|
|
|
938
|
+
type Document2CitationIndexEntry = {
|
|
939
|
+
kind: 'cite';
|
|
940
|
+
block_id: string;
|
|
941
|
+
field_id: string;
|
|
942
|
+
token_id: string;
|
|
943
|
+
keys: string[];
|
|
944
|
+
unresolved_keys: string[];
|
|
945
|
+
};
|
|
946
|
+
type Document2CrossReferenceIndexEntry = {
|
|
947
|
+
kind: 'ref';
|
|
948
|
+
ref_command: 'ref' | 'eqref';
|
|
949
|
+
block_id: string;
|
|
950
|
+
field_id: string;
|
|
951
|
+
token_id: string;
|
|
952
|
+
keys: string[];
|
|
953
|
+
unresolved_keys: string[];
|
|
954
|
+
};
|
|
955
|
+
type Document2IndexedLabel = {
|
|
956
|
+
key: string;
|
|
957
|
+
kind: Document2LabelKind;
|
|
958
|
+
caption: string;
|
|
959
|
+
number: number;
|
|
960
|
+
block_id?: string;
|
|
961
|
+
field_id?: string;
|
|
962
|
+
token_id?: string;
|
|
963
|
+
};
|
|
964
|
+
type Document2ReferenceIndex = {
|
|
965
|
+
citations: Document2CitationIndexEntry[];
|
|
966
|
+
cross_references: Document2CrossReferenceIndexEntry[];
|
|
967
|
+
labels: Document2IndexedLabel[];
|
|
968
|
+
unresolved: {
|
|
969
|
+
citation_keys: string[];
|
|
970
|
+
cross_reference_keys: string[];
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
/** Return a detached, read-only view of the registered bibliography catalog. */
|
|
974
|
+
declare function getDocument2References(document: Document2Node): Reference2Json[];
|
|
975
|
+
/**
|
|
976
|
+
* Return semantic citation, cross-reference, and label relationships without
|
|
977
|
+
* changing the document. Entries follow document/token order and preserve the
|
|
978
|
+
* stable IDs already present in the live Document2 node.
|
|
979
|
+
*/
|
|
980
|
+
declare function getDocument2ReferenceIndex(document: Document2Node): Document2ReferenceIndex;
|
|
981
|
+
|
|
902
982
|
type Document2KeyError = 'empty' | 'invalid' | 'duplicate';
|
|
903
983
|
/** NFC-normalize and trim a document key (label or bibliography). */
|
|
904
984
|
declare function normalizeDocument2Key(key: string): string;
|
|
@@ -1063,4 +1143,4 @@ declare function document2Preview(document: Document2Node, output?: Document2Mat
|
|
|
1063
1143
|
*/
|
|
1064
1144
|
declare function document2Latex(document: Document2Node, options?: Document2LatexOptions): string;
|
|
1065
1145
|
|
|
1066
|
-
export { type ArabicDigitsMapping, type ArabicXeLatexPreambleOptions, BUTEX_BASMALA, BUTEX_BASMALA_LINE1, BUTEX_BASMALA_LINE2, BUTEX_BASMALA_SALAWAT, BUTEX_CLOSING_HAMDALA, type BibliographyBlock2, type BlockSelectionRange, type BlockSelectionState, type CiteToken2, DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH, DEFAULT_HIJRI_DATE, DEFAULT_REFERENCE_FIELD_SEPARATOR, type Document2Anchor, type Document2Block, type Document2BlockJson, type Document2BlockMetadata, type Document2Command, Document2CommandError, type Document2CommandErrorCode, type Document2Diagnostic, type Document2Direction, type Document2HijriDate, type Document2HistoryStacks, type Document2ImageAssetRef, type Document2InlineAnchor, type Document2InlineIdsJson, type Document2InlineTokenIdJson, type Document2InlineTokenInput, type Document2Json, type Document2KeyError, type Document2KeyNamespace, type Document2LabelEntry, type Document2LabelKind, type Document2LatexOptions, type Document2ListItemAnchor, type Document2MathObjectJson, type Document2MathOutput, type Document2Meta, type Document2MetaProp, type Document2Node, type Document2OutlineEntry, type Document2OutlineKind, type Document2Preview, type Document2PreviewOptions, type Document2ReferenceAnchor, type Document2TextBlockKind, Document2ValidationError, type Document2ValidationIssue, type Document2ValidationIssueCode, type Document2ValidationResult, type FloatMeta2, type FloatMetaPatch, type FormatCiteLabelOptions, type FormatFloatCaptionTitleOptions, HIJRI_MONTH_IDS, HIJRI_YEAR_MAX, HIJRI_YEAR_MIN, type HijriMonthId, type ImageBlock2, type ImportDocument2Options, type InlineField2, type InlineToken2, type ListBlock2, type ListItem2, type MathIsland2, type MathObject2Json, type MathToken2, type PreviewBlock2, type PreviewInline2, type RawBlock2, type RawMathObject2Json, type RefToken2, type Reference2, type Reference2Json, type ReferenceFieldSeparator, type TableBlock2, type TextBlock2, type TextFormatSpan2Json, type TextStyle2, type TextToken2, absoluteHttpHref, addDocument2ImageBlock, addDocument2ListBlock, addDocument2ListItem, addDocument2Reference, addDocument2TableBlock, addDocument2TextBlock, applyDocument2Command, applyFloatMetaPatch, arabicXeLatexPreambleCmd, arabicXeLatexPreambleFont, arabicXeLatexPreamblePkg, bibliographyEntryBody, bibliographyEntryLatex, butexBasmalaDisplayLatex, butexBasmalaDisplayTex, butexBasmalaTitlingPreamble, butexDiwaniDisplayLatex, butexDiwaniDisplayTex, butexInColumnMaketitleHook, butexMaghribiDisplayLatex, butexMaghribiDisplayTex, citeTokenLatex, clearDocument2ImageAsset, cloneDocument2Meta, cloneDocument2Node, collectDocument2Labels, createDocument2History, createEmptyArabicEquationSession, createEmptyDocument2, createEmptyEquationSession, createEmptyReference2, createInlineField2, defaultFloatMeta, detectInlineSpans2, detectMathSpans2, document2HasAbstract, document2HasMaketitle, document2HasTitleStack, document2HistoryCanRedo, document2HistoryCanUndo, document2KeyError, document2Latex, document2Outline, document2Preview, emptyBlockSelection, emptyDocument2Meta, ensureDocument2BibliographyBlock, extendBlockSelectionFromAnchor, fillDocument2MetaGaps, findFirstInlineField, formatBibliographyNumber, formatCiteLabel, formatFloatCaptionPreview, formatFloatCaptionTitle, formatHijriDate, formatRefLabel, fromDocumentJson2, getArabicXeLatexPreamble, hasXeLatexUnsupportedEmoji, hijriMonthLabel, inlineFieldLatex, insertCiteTokenAtCaret, insertDocument2BlockAfter, insertMathToken, insertMathTokenAtCaret, insertRefTokenAtCaret, isDocument2Valid, isDuplicateDocument2Key, isValidDocument2Key, labelNumberMap, mathNodeFromArabicSession, mathNodeFromSession, mathSourceFromArabicSession, mathSourceFromSession, mathTokenSourceForSide, mathTokenToArabicEditorSession, mathTokenToEditorSession, mergeDocument2Meta, moveDocument2BlockById, moveDocument2BlockRange, moveDocument2Reference, normalizeBlockSelection, normalizeDocument2HijriDate, normalizeDocument2Key, normalizeDocument2Meta, normalizeReferenceFieldSeparator, parseCiteKeys, parseFloatMetaFromJson, parseRefKeys, pushDocument2Snapshot, refTokenLatex, referenceFromJson, referenceNumberMap, remapSelectionAfterRangeMove, removeCiteTokenById, removeDocument2BlockById, removeDocument2BlockRange, removeDocument2ListItem, removeDocument2Reference, removeMathTokenById, removeRefTokenById, replaceMathTokenFromSession, resolveCiteNumbers, restoreDocument2Redo, restoreDocument2Undo, setDocument2References, stripDisplayMathDelimiters, toDocumentJson2, toggleBlockInSelection, toggleTextTokenStyle, updateCiteTokenKeys, updateDocument2ImageAsset, updateDocument2ImageMeta, updateDocument2ImageValue, updateDocument2Meta, updateDocument2Reference, updateDocument2TableMeta, updateDocument2TextBlockCentered, updateMathTokenLabel, updateRefTokenKeys, updateTextToken, validateDocument2 };
|
|
1146
|
+
export { type ArabicDigitsMapping, type ArabicXeLatexPreambleOptions, BUTEX_BASMALA, BUTEX_BASMALA_LINE1, BUTEX_BASMALA_LINE2, BUTEX_BASMALA_SALAWAT, BUTEX_CLOSING_HAMDALA, type BibliographyBlock2, type BlockSelectionRange, type BlockSelectionState, type CiteToken2, DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH, DEFAULT_HIJRI_DATE, DEFAULT_REFERENCE_FIELD_SEPARATOR, type Document2Anchor, type Document2Block, type Document2BlockJson, type Document2BlockMetadata, type Document2CitationIndexEntry, type Document2Command, Document2CommandError, type Document2CommandErrorCode, type Document2CrossReferenceIndexEntry, type Document2Diagnostic, type Document2Diff, type Document2DiffChunk, type Document2DiffChunkKind, type Document2Direction, type Document2HijriDate, type Document2HistoryStacks, type Document2ImageAssetRef, type Document2IndexedLabel, type Document2InlineAnchor, type Document2InlineIdsJson, type Document2InlineTokenIdJson, type Document2InlineTokenInput, type Document2Json, type Document2KeyError, type Document2KeyNamespace, type Document2LabelEntry, type Document2LabelKind, type Document2LatexOptions, type Document2ListItemAnchor, type Document2MathObjectJson, type Document2MathOutput, type Document2Meta, type Document2MetaProp, type Document2Node, type Document2OutlineEntry, type Document2OutlineKind, type Document2Preview, type Document2PreviewOptions, type Document2ReferenceAnchor, type Document2ReferenceIndex, type Document2TextBlockKind, Document2ValidationError, type Document2ValidationIssue, type Document2ValidationIssueCode, type Document2ValidationResult, type FloatMeta2, type FloatMetaPatch, type FormatCiteLabelOptions, type FormatFloatCaptionTitleOptions, HIJRI_MONTH_IDS, HIJRI_YEAR_MAX, HIJRI_YEAR_MIN, type HijriMonthId, type ImageBlock2, type ImportDocument2Options, type InlineField2, type InlineToken2, type ListBlock2, type ListItem2, type MathIsland2, type MathObject2Json, type MathToken2, type PreviewBlock2, type PreviewInline2, type RawBlock2, type RawMathObject2Json, type RefToken2, type Reference2, type Reference2Json, type ReferenceFieldSeparator, type TableBlock2, type TextBlock2, type TextFormatSpan2Json, type TextStyle2, type TextToken2, absoluteHttpHref, addDocument2ImageBlock, addDocument2ListBlock, addDocument2ListItem, addDocument2Reference, addDocument2TableBlock, addDocument2TextBlock, applyDocument2Command, applyFloatMetaPatch, arabicXeLatexPreambleCmd, arabicXeLatexPreambleFont, arabicXeLatexPreamblePkg, bibliographyEntryBody, bibliographyEntryLatex, butexBasmalaDisplayLatex, butexBasmalaDisplayTex, butexBasmalaTitlingPreamble, butexDiwaniDisplayLatex, butexDiwaniDisplayTex, butexInColumnMaketitleHook, butexMaghribiDisplayLatex, butexMaghribiDisplayTex, citeTokenLatex, clearDocument2ImageAsset, cloneDocument2Meta, cloneDocument2Node, collectDocument2Labels, createDocument2History, createEmptyArabicEquationSession, createEmptyDocument2, createEmptyEquationSession, createEmptyReference2, createInlineField2, defaultFloatMeta, detectInlineSpans2, detectMathSpans2, diffDocument2, document2HasAbstract, document2HasMaketitle, document2HasTitleStack, document2HistoryCanRedo, document2HistoryCanUndo, document2KeyError, document2Latex, document2Outline, document2Preview, emptyBlockSelection, emptyDocument2Meta, ensureDocument2BibliographyBlock, extendBlockSelectionFromAnchor, fillDocument2MetaGaps, findFirstInlineField, formatBibliographyNumber, formatCiteLabel, formatFloatCaptionPreview, formatFloatCaptionTitle, formatHijriDate, formatRefLabel, fromDocumentJson2, getArabicXeLatexPreamble, getDocument2ReferenceIndex, getDocument2References, hasXeLatexUnsupportedEmoji, hijriMonthLabel, inlineFieldLatex, insertCiteTokenAtCaret, insertDocument2BlockAfter, insertMathToken, insertMathTokenAtCaret, insertRefTokenAtCaret, isDocument2Valid, isDuplicateDocument2Key, isValidDocument2Key, labelNumberMap, mathNodeFromArabicSession, mathNodeFromSession, mathSourceFromArabicSession, mathSourceFromSession, mathTokenSourceForSide, mathTokenToArabicEditorSession, mathTokenToEditorSession, mergeDocument2Meta, moveDocument2BlockById, moveDocument2BlockRange, moveDocument2Reference, normalizeBlockSelection, normalizeDocument2HijriDate, normalizeDocument2Key, normalizeDocument2Meta, normalizeReferenceFieldSeparator, parseCiteKeys, parseFloatMetaFromJson, parseRefKeys, pushDocument2Snapshot, refTokenLatex, referenceFromJson, referenceNumberMap, remapSelectionAfterRangeMove, removeCiteTokenById, removeDocument2BlockById, removeDocument2BlockRange, removeDocument2ListItem, removeDocument2Reference, removeMathTokenById, removeRefTokenById, replaceMathTokenFromSession, resolveCiteNumbers, restoreDocument2Redo, restoreDocument2Undo, setDocument2References, stripDisplayMathDelimiters, toDocumentJson2, toggleBlockInSelection, toggleTextTokenStyle, updateCiteTokenKeys, updateDocument2ImageAsset, updateDocument2ImageMeta, updateDocument2ImageValue, updateDocument2Meta, updateDocument2Reference, updateDocument2TableMeta, updateDocument2TextBlockCentered, updateMathTokenLabel, updateRefTokenKeys, updateTextToken, validateDocument2 };
|
package/dist/document2.d.ts
CHANGED
|
@@ -217,6 +217,12 @@ type Document2BlockJson = {
|
|
|
217
217
|
cell_inline_ids?: Document2InlineIdsJson[][];
|
|
218
218
|
columns?: string;
|
|
219
219
|
caption?: string;
|
|
220
|
+
/** Optional formatting sidecar for caption text spans. */
|
|
221
|
+
caption_formats?: TextFormatSpan2Json[];
|
|
222
|
+
/** Stable caption field/token identities; omitted by legacy documents. */
|
|
223
|
+
caption_inline_ids?: Document2InlineIdsJson;
|
|
224
|
+
/** Caption-only structured math sidecar, independent from table cell math_objects. */
|
|
225
|
+
caption_math_objects?: Array<Document2MathObjectJson | null>;
|
|
220
226
|
label?: string;
|
|
221
227
|
caption_enabled?: boolean;
|
|
222
228
|
label_enabled?: boolean;
|
|
@@ -321,7 +327,10 @@ type ListBlock2 = {
|
|
|
321
327
|
type FloatMeta2 = {
|
|
322
328
|
centered: boolean;
|
|
323
329
|
captionEnabled: boolean;
|
|
330
|
+
/** Compatibility source string; captionField is the structured source of truth. */
|
|
324
331
|
caption: string;
|
|
332
|
+
/** Stable inline field used by the editor, commands, preview, and persistence. */
|
|
333
|
+
captionField: InlineField2;
|
|
325
334
|
labelEnabled: boolean;
|
|
326
335
|
label: string;
|
|
327
336
|
};
|
|
@@ -465,7 +474,10 @@ type PreviewBlock2 = {
|
|
|
465
474
|
kind: 'table';
|
|
466
475
|
id: string;
|
|
467
476
|
rows: PreviewInline2[][][];
|
|
477
|
+
/** Compatibility source string for hosts that still read caption directly. */
|
|
468
478
|
caption?: string;
|
|
479
|
+
/** Structured caption rendering path, including MathIsland tokens. */
|
|
480
|
+
captionInlines?: PreviewInline2[];
|
|
469
481
|
label?: string;
|
|
470
482
|
numberLabel?: string;
|
|
471
483
|
metadata?: Document2BlockMetadata;
|
|
@@ -476,7 +488,10 @@ type PreviewBlock2 = {
|
|
|
476
488
|
assetId?: string;
|
|
477
489
|
options: Record<string, string>;
|
|
478
490
|
centered?: boolean;
|
|
491
|
+
/** Compatibility source string for alt text/legacy hosts. */
|
|
479
492
|
caption?: string;
|
|
493
|
+
/** Structured caption rendering path, including MathIsland tokens. */
|
|
494
|
+
captionInlines?: PreviewInline2[];
|
|
480
495
|
label?: string;
|
|
481
496
|
numberLabel?: string;
|
|
482
497
|
metadata?: Document2BlockMetadata;
|
|
@@ -537,9 +552,10 @@ type FloatMetaPatch = {
|
|
|
537
552
|
declare function defaultFloatMeta(): {
|
|
538
553
|
centered: true;
|
|
539
554
|
captionEnabled: false;
|
|
540
|
-
caption:
|
|
555
|
+
caption: string;
|
|
556
|
+
captionField: InlineField2;
|
|
541
557
|
labelEnabled: false;
|
|
542
|
-
label:
|
|
558
|
+
label: string;
|
|
543
559
|
};
|
|
544
560
|
declare function parseFloatMetaFromJson(json: {
|
|
545
561
|
caption?: string;
|
|
@@ -889,6 +905,26 @@ declare class Document2CommandError extends Error {
|
|
|
889
905
|
/** Apply one validated command to canonical JSON without mutating caller input. */
|
|
890
906
|
declare function applyDocument2Command(json: Document2Json, commandInput: Document2Command): Document2Json;
|
|
891
907
|
|
|
908
|
+
type Document2DiffChunkKind = 'added' | 'removed' | 'context';
|
|
909
|
+
type Document2DiffChunk = {
|
|
910
|
+
kind: Document2DiffChunkKind;
|
|
911
|
+
text: string;
|
|
912
|
+
};
|
|
913
|
+
type Document2Diff = {
|
|
914
|
+
version: 1;
|
|
915
|
+
changed: boolean;
|
|
916
|
+
truncated: boolean;
|
|
917
|
+
chunks: Document2DiffChunk[];
|
|
918
|
+
};
|
|
919
|
+
/**
|
|
920
|
+
* Compare two persisted Document2 documents using canonical Document2 import/export
|
|
921
|
+
* semantics and jsdiff's maintained JSON diff implementation.
|
|
922
|
+
*
|
|
923
|
+
* Generated editor identity sidecars are intentionally excluded so equivalent
|
|
924
|
+
* legacy documents do not differ merely because normalization assigned new IDs.
|
|
925
|
+
*/
|
|
926
|
+
declare function diffDocument2(before: Document2Json, after: Document2Json): Document2Diff;
|
|
927
|
+
|
|
892
928
|
type Document2OutlineKind = 'section' | 'subsection' | 'subsubsection' | 'paragraph' | 'list' | 'table' | 'figure' | 'bibliography' | 'raw';
|
|
893
929
|
type Document2OutlineEntry = {
|
|
894
930
|
id: string;
|
|
@@ -899,6 +935,50 @@ type Document2OutlineEntry = {
|
|
|
899
935
|
/** Return a compact top-level outline for a canonical document. */
|
|
900
936
|
declare function document2Outline(json: Document2Json): Document2OutlineEntry[];
|
|
901
937
|
|
|
938
|
+
type Document2CitationIndexEntry = {
|
|
939
|
+
kind: 'cite';
|
|
940
|
+
block_id: string;
|
|
941
|
+
field_id: string;
|
|
942
|
+
token_id: string;
|
|
943
|
+
keys: string[];
|
|
944
|
+
unresolved_keys: string[];
|
|
945
|
+
};
|
|
946
|
+
type Document2CrossReferenceIndexEntry = {
|
|
947
|
+
kind: 'ref';
|
|
948
|
+
ref_command: 'ref' | 'eqref';
|
|
949
|
+
block_id: string;
|
|
950
|
+
field_id: string;
|
|
951
|
+
token_id: string;
|
|
952
|
+
keys: string[];
|
|
953
|
+
unresolved_keys: string[];
|
|
954
|
+
};
|
|
955
|
+
type Document2IndexedLabel = {
|
|
956
|
+
key: string;
|
|
957
|
+
kind: Document2LabelKind;
|
|
958
|
+
caption: string;
|
|
959
|
+
number: number;
|
|
960
|
+
block_id?: string;
|
|
961
|
+
field_id?: string;
|
|
962
|
+
token_id?: string;
|
|
963
|
+
};
|
|
964
|
+
type Document2ReferenceIndex = {
|
|
965
|
+
citations: Document2CitationIndexEntry[];
|
|
966
|
+
cross_references: Document2CrossReferenceIndexEntry[];
|
|
967
|
+
labels: Document2IndexedLabel[];
|
|
968
|
+
unresolved: {
|
|
969
|
+
citation_keys: string[];
|
|
970
|
+
cross_reference_keys: string[];
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
/** Return a detached, read-only view of the registered bibliography catalog. */
|
|
974
|
+
declare function getDocument2References(document: Document2Node): Reference2Json[];
|
|
975
|
+
/**
|
|
976
|
+
* Return semantic citation, cross-reference, and label relationships without
|
|
977
|
+
* changing the document. Entries follow document/token order and preserve the
|
|
978
|
+
* stable IDs already present in the live Document2 node.
|
|
979
|
+
*/
|
|
980
|
+
declare function getDocument2ReferenceIndex(document: Document2Node): Document2ReferenceIndex;
|
|
981
|
+
|
|
902
982
|
type Document2KeyError = 'empty' | 'invalid' | 'duplicate';
|
|
903
983
|
/** NFC-normalize and trim a document key (label or bibliography). */
|
|
904
984
|
declare function normalizeDocument2Key(key: string): string;
|
|
@@ -1063,4 +1143,4 @@ declare function document2Preview(document: Document2Node, output?: Document2Mat
|
|
|
1063
1143
|
*/
|
|
1064
1144
|
declare function document2Latex(document: Document2Node, options?: Document2LatexOptions): string;
|
|
1065
1145
|
|
|
1066
|
-
export { type ArabicDigitsMapping, type ArabicXeLatexPreambleOptions, BUTEX_BASMALA, BUTEX_BASMALA_LINE1, BUTEX_BASMALA_LINE2, BUTEX_BASMALA_SALAWAT, BUTEX_CLOSING_HAMDALA, type BibliographyBlock2, type BlockSelectionRange, type BlockSelectionState, type CiteToken2, DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH, DEFAULT_HIJRI_DATE, DEFAULT_REFERENCE_FIELD_SEPARATOR, type Document2Anchor, type Document2Block, type Document2BlockJson, type Document2BlockMetadata, type Document2Command, Document2CommandError, type Document2CommandErrorCode, type Document2Diagnostic, type Document2Direction, type Document2HijriDate, type Document2HistoryStacks, type Document2ImageAssetRef, type Document2InlineAnchor, type Document2InlineIdsJson, type Document2InlineTokenIdJson, type Document2InlineTokenInput, type Document2Json, type Document2KeyError, type Document2KeyNamespace, type Document2LabelEntry, type Document2LabelKind, type Document2LatexOptions, type Document2ListItemAnchor, type Document2MathObjectJson, type Document2MathOutput, type Document2Meta, type Document2MetaProp, type Document2Node, type Document2OutlineEntry, type Document2OutlineKind, type Document2Preview, type Document2PreviewOptions, type Document2ReferenceAnchor, type Document2TextBlockKind, Document2ValidationError, type Document2ValidationIssue, type Document2ValidationIssueCode, type Document2ValidationResult, type FloatMeta2, type FloatMetaPatch, type FormatCiteLabelOptions, type FormatFloatCaptionTitleOptions, HIJRI_MONTH_IDS, HIJRI_YEAR_MAX, HIJRI_YEAR_MIN, type HijriMonthId, type ImageBlock2, type ImportDocument2Options, type InlineField2, type InlineToken2, type ListBlock2, type ListItem2, type MathIsland2, type MathObject2Json, type MathToken2, type PreviewBlock2, type PreviewInline2, type RawBlock2, type RawMathObject2Json, type RefToken2, type Reference2, type Reference2Json, type ReferenceFieldSeparator, type TableBlock2, type TextBlock2, type TextFormatSpan2Json, type TextStyle2, type TextToken2, absoluteHttpHref, addDocument2ImageBlock, addDocument2ListBlock, addDocument2ListItem, addDocument2Reference, addDocument2TableBlock, addDocument2TextBlock, applyDocument2Command, applyFloatMetaPatch, arabicXeLatexPreambleCmd, arabicXeLatexPreambleFont, arabicXeLatexPreamblePkg, bibliographyEntryBody, bibliographyEntryLatex, butexBasmalaDisplayLatex, butexBasmalaDisplayTex, butexBasmalaTitlingPreamble, butexDiwaniDisplayLatex, butexDiwaniDisplayTex, butexInColumnMaketitleHook, butexMaghribiDisplayLatex, butexMaghribiDisplayTex, citeTokenLatex, clearDocument2ImageAsset, cloneDocument2Meta, cloneDocument2Node, collectDocument2Labels, createDocument2History, createEmptyArabicEquationSession, createEmptyDocument2, createEmptyEquationSession, createEmptyReference2, createInlineField2, defaultFloatMeta, detectInlineSpans2, detectMathSpans2, document2HasAbstract, document2HasMaketitle, document2HasTitleStack, document2HistoryCanRedo, document2HistoryCanUndo, document2KeyError, document2Latex, document2Outline, document2Preview, emptyBlockSelection, emptyDocument2Meta, ensureDocument2BibliographyBlock, extendBlockSelectionFromAnchor, fillDocument2MetaGaps, findFirstInlineField, formatBibliographyNumber, formatCiteLabel, formatFloatCaptionPreview, formatFloatCaptionTitle, formatHijriDate, formatRefLabel, fromDocumentJson2, getArabicXeLatexPreamble, hasXeLatexUnsupportedEmoji, hijriMonthLabel, inlineFieldLatex, insertCiteTokenAtCaret, insertDocument2BlockAfter, insertMathToken, insertMathTokenAtCaret, insertRefTokenAtCaret, isDocument2Valid, isDuplicateDocument2Key, isValidDocument2Key, labelNumberMap, mathNodeFromArabicSession, mathNodeFromSession, mathSourceFromArabicSession, mathSourceFromSession, mathTokenSourceForSide, mathTokenToArabicEditorSession, mathTokenToEditorSession, mergeDocument2Meta, moveDocument2BlockById, moveDocument2BlockRange, moveDocument2Reference, normalizeBlockSelection, normalizeDocument2HijriDate, normalizeDocument2Key, normalizeDocument2Meta, normalizeReferenceFieldSeparator, parseCiteKeys, parseFloatMetaFromJson, parseRefKeys, pushDocument2Snapshot, refTokenLatex, referenceFromJson, referenceNumberMap, remapSelectionAfterRangeMove, removeCiteTokenById, removeDocument2BlockById, removeDocument2BlockRange, removeDocument2ListItem, removeDocument2Reference, removeMathTokenById, removeRefTokenById, replaceMathTokenFromSession, resolveCiteNumbers, restoreDocument2Redo, restoreDocument2Undo, setDocument2References, stripDisplayMathDelimiters, toDocumentJson2, toggleBlockInSelection, toggleTextTokenStyle, updateCiteTokenKeys, updateDocument2ImageAsset, updateDocument2ImageMeta, updateDocument2ImageValue, updateDocument2Meta, updateDocument2Reference, updateDocument2TableMeta, updateDocument2TextBlockCentered, updateMathTokenLabel, updateRefTokenKeys, updateTextToken, validateDocument2 };
|
|
1146
|
+
export { type ArabicDigitsMapping, type ArabicXeLatexPreambleOptions, BUTEX_BASMALA, BUTEX_BASMALA_LINE1, BUTEX_BASMALA_LINE2, BUTEX_BASMALA_SALAWAT, BUTEX_CLOSING_HAMDALA, type BibliographyBlock2, type BlockSelectionRange, type BlockSelectionState, type CiteToken2, DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH, DEFAULT_HIJRI_DATE, DEFAULT_REFERENCE_FIELD_SEPARATOR, type Document2Anchor, type Document2Block, type Document2BlockJson, type Document2BlockMetadata, type Document2CitationIndexEntry, type Document2Command, Document2CommandError, type Document2CommandErrorCode, type Document2CrossReferenceIndexEntry, type Document2Diagnostic, type Document2Diff, type Document2DiffChunk, type Document2DiffChunkKind, type Document2Direction, type Document2HijriDate, type Document2HistoryStacks, type Document2ImageAssetRef, type Document2IndexedLabel, type Document2InlineAnchor, type Document2InlineIdsJson, type Document2InlineTokenIdJson, type Document2InlineTokenInput, type Document2Json, type Document2KeyError, type Document2KeyNamespace, type Document2LabelEntry, type Document2LabelKind, type Document2LatexOptions, type Document2ListItemAnchor, type Document2MathObjectJson, type Document2MathOutput, type Document2Meta, type Document2MetaProp, type Document2Node, type Document2OutlineEntry, type Document2OutlineKind, type Document2Preview, type Document2PreviewOptions, type Document2ReferenceAnchor, type Document2ReferenceIndex, type Document2TextBlockKind, Document2ValidationError, type Document2ValidationIssue, type Document2ValidationIssueCode, type Document2ValidationResult, type FloatMeta2, type FloatMetaPatch, type FormatCiteLabelOptions, type FormatFloatCaptionTitleOptions, HIJRI_MONTH_IDS, HIJRI_YEAR_MAX, HIJRI_YEAR_MIN, type HijriMonthId, type ImageBlock2, type ImportDocument2Options, type InlineField2, type InlineToken2, type ListBlock2, type ListItem2, type MathIsland2, type MathObject2Json, type MathToken2, type PreviewBlock2, type PreviewInline2, type RawBlock2, type RawMathObject2Json, type RefToken2, type Reference2, type Reference2Json, type ReferenceFieldSeparator, type TableBlock2, type TextBlock2, type TextFormatSpan2Json, type TextStyle2, type TextToken2, absoluteHttpHref, addDocument2ImageBlock, addDocument2ListBlock, addDocument2ListItem, addDocument2Reference, addDocument2TableBlock, addDocument2TextBlock, applyDocument2Command, applyFloatMetaPatch, arabicXeLatexPreambleCmd, arabicXeLatexPreambleFont, arabicXeLatexPreamblePkg, bibliographyEntryBody, bibliographyEntryLatex, butexBasmalaDisplayLatex, butexBasmalaDisplayTex, butexBasmalaTitlingPreamble, butexDiwaniDisplayLatex, butexDiwaniDisplayTex, butexInColumnMaketitleHook, butexMaghribiDisplayLatex, butexMaghribiDisplayTex, citeTokenLatex, clearDocument2ImageAsset, cloneDocument2Meta, cloneDocument2Node, collectDocument2Labels, createDocument2History, createEmptyArabicEquationSession, createEmptyDocument2, createEmptyEquationSession, createEmptyReference2, createInlineField2, defaultFloatMeta, detectInlineSpans2, detectMathSpans2, diffDocument2, document2HasAbstract, document2HasMaketitle, document2HasTitleStack, document2HistoryCanRedo, document2HistoryCanUndo, document2KeyError, document2Latex, document2Outline, document2Preview, emptyBlockSelection, emptyDocument2Meta, ensureDocument2BibliographyBlock, extendBlockSelectionFromAnchor, fillDocument2MetaGaps, findFirstInlineField, formatBibliographyNumber, formatCiteLabel, formatFloatCaptionPreview, formatFloatCaptionTitle, formatHijriDate, formatRefLabel, fromDocumentJson2, getArabicXeLatexPreamble, getDocument2ReferenceIndex, getDocument2References, hasXeLatexUnsupportedEmoji, hijriMonthLabel, inlineFieldLatex, insertCiteTokenAtCaret, insertDocument2BlockAfter, insertMathToken, insertMathTokenAtCaret, insertRefTokenAtCaret, isDocument2Valid, isDuplicateDocument2Key, isValidDocument2Key, labelNumberMap, mathNodeFromArabicSession, mathNodeFromSession, mathSourceFromArabicSession, mathSourceFromSession, mathTokenSourceForSide, mathTokenToArabicEditorSession, mathTokenToEditorSession, mergeDocument2Meta, moveDocument2BlockById, moveDocument2BlockRange, moveDocument2Reference, normalizeBlockSelection, normalizeDocument2HijriDate, normalizeDocument2Key, normalizeDocument2Meta, normalizeReferenceFieldSeparator, parseCiteKeys, parseFloatMetaFromJson, parseRefKeys, pushDocument2Snapshot, refTokenLatex, referenceFromJson, referenceNumberMap, remapSelectionAfterRangeMove, removeCiteTokenById, removeDocument2BlockById, removeDocument2BlockRange, removeDocument2ListItem, removeDocument2Reference, removeMathTokenById, removeRefTokenById, replaceMathTokenFromSession, resolveCiteNumbers, restoreDocument2Redo, restoreDocument2Undo, setDocument2References, stripDisplayMathDelimiters, toDocumentJson2, toggleBlockInSelection, toggleTextTokenStyle, updateCiteTokenKeys, updateDocument2ImageAsset, updateDocument2ImageMeta, updateDocument2ImageValue, updateDocument2Meta, updateDocument2Reference, updateDocument2TableMeta, updateDocument2TextBlockCentered, updateMathTokenLabel, updateRefTokenKeys, updateTextToken, validateDocument2 };
|