@drghaliasri/butex 6.1.4 → 7.0.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/README.md +41 -12
- package/dist/document.js +21 -4
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +21 -4
- package/dist/document.mjs.map +1 -1
- package/dist/document2-cli.js +21 -4
- package/dist/document2-cli.js.map +1 -1
- package/dist/document2.d.mts +34 -2
- package/dist/document2.d.ts +34 -2
- package/dist/document2.js +343 -20
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +334 -15
- package/dist/document2.mjs.map +1 -1
- package/dist/index.global.js +104 -6
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +104 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -6
- package/dist/index.mjs.map +1 -1
- package/dist/react-document.js +2066 -599
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +2064 -596
- package/dist/react-document.mjs.map +1 -1
- package/dist/react-document2.d.mts +22 -7
- package/dist/react-document2.d.ts +22 -7
- package/dist/react-document2.js +4019 -1088
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +4000 -1068
- package/dist/react-document2.mjs.map +1 -1
- package/dist/react.d.mts +9 -2
- package/dist/react.d.ts +9 -2
- package/dist/react.js +1954 -507
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1955 -507
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/document2.d.mts
CHANGED
|
@@ -475,6 +475,7 @@ type PreviewBlock2 = {
|
|
|
475
475
|
src: string;
|
|
476
476
|
assetId?: string;
|
|
477
477
|
options: Record<string, string>;
|
|
478
|
+
centered?: boolean;
|
|
478
479
|
caption?: string;
|
|
479
480
|
label?: string;
|
|
480
481
|
numberLabel?: string;
|
|
@@ -905,11 +906,36 @@ type Document2LatexOptions = {
|
|
|
905
906
|
twocolumn?: boolean;
|
|
906
907
|
};
|
|
907
908
|
declare function inlineFieldLatex(field: InlineField2): string;
|
|
908
|
-
declare function document2Latex(document: Document2Node, options?: Document2LatexOptions): string;
|
|
909
909
|
|
|
910
910
|
/** Convert the live editor AST to the canonical JSON wire format. */
|
|
911
911
|
declare function toDocumentJson2(document: Document2Node): Document2Json;
|
|
912
912
|
|
|
913
|
+
type Document2ValidationIssueCode = 'malformed_document' | 'parser_diagnostic' | 'empty_image' | 'unsupported_emoji' | 'key_empty' | 'key_invalid' | 'key_duplicate' | 'empty_citation' | 'missing_citation' | 'empty_reference' | 'missing_reference' | 'reference_kind_mismatch' | 'invalid_equation_label' | 'invalid_table';
|
|
914
|
+
type Document2ValidationIssue = {
|
|
915
|
+
code: Document2ValidationIssueCode;
|
|
916
|
+
path: string;
|
|
917
|
+
blockId?: string;
|
|
918
|
+
tokenId?: string;
|
|
919
|
+
};
|
|
920
|
+
type Document2ValidationResult = {
|
|
921
|
+
valid: boolean;
|
|
922
|
+
issues: Document2ValidationIssue[];
|
|
923
|
+
};
|
|
924
|
+
/** True when the current XeLaTeX text profile cannot render the value reliably. */
|
|
925
|
+
declare function hasXeLatexUnsupportedEmoji(value: string): boolean;
|
|
926
|
+
/**
|
|
927
|
+
* Validate a Document2 draft without mutating it. Detailed issues are kept in
|
|
928
|
+
* BuTeX so React can identify the field while hosts only need the boolean API.
|
|
929
|
+
*/
|
|
930
|
+
declare function validateDocument2(document: Document2Json | Document2Node): Document2ValidationResult;
|
|
931
|
+
/** Public host contract: drafts may be saved, but only valid documents may compile. */
|
|
932
|
+
declare function isDocument2Valid(document: Document2Json | Document2Node): boolean;
|
|
933
|
+
/** Error thrown when LaTeX export is attempted for an invalid Document2 draft. */
|
|
934
|
+
declare class Document2ValidationError extends Error {
|
|
935
|
+
readonly issues: Document2ValidationIssue[];
|
|
936
|
+
constructor(issues: Document2ValidationIssue[]);
|
|
937
|
+
}
|
|
938
|
+
|
|
913
939
|
declare const DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH = 100;
|
|
914
940
|
type Document2HistoryStacks = {
|
|
915
941
|
past: Document2Node[];
|
|
@@ -972,4 +998,10 @@ type Document2PreviewOptions = {
|
|
|
972
998
|
};
|
|
973
999
|
declare function document2Preview(document: Document2Node, output?: Document2MathOutput, equationSide?: EditorSide, previewOptions?: Document2PreviewOptions): Document2Preview;
|
|
974
1000
|
|
|
975
|
-
|
|
1001
|
+
/**
|
|
1002
|
+
* Export a validated Document2 runtime node. Invalid drafts remain saveable,
|
|
1003
|
+
* but compilation must not silently receive unsafe or unreliable LaTeX.
|
|
1004
|
+
*/
|
|
1005
|
+
declare function document2Latex(document: Document2Node, options?: Document2LatexOptions): string;
|
|
1006
|
+
|
|
1007
|
+
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 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 };
|
package/dist/document2.d.ts
CHANGED
|
@@ -475,6 +475,7 @@ type PreviewBlock2 = {
|
|
|
475
475
|
src: string;
|
|
476
476
|
assetId?: string;
|
|
477
477
|
options: Record<string, string>;
|
|
478
|
+
centered?: boolean;
|
|
478
479
|
caption?: string;
|
|
479
480
|
label?: string;
|
|
480
481
|
numberLabel?: string;
|
|
@@ -905,11 +906,36 @@ type Document2LatexOptions = {
|
|
|
905
906
|
twocolumn?: boolean;
|
|
906
907
|
};
|
|
907
908
|
declare function inlineFieldLatex(field: InlineField2): string;
|
|
908
|
-
declare function document2Latex(document: Document2Node, options?: Document2LatexOptions): string;
|
|
909
909
|
|
|
910
910
|
/** Convert the live editor AST to the canonical JSON wire format. */
|
|
911
911
|
declare function toDocumentJson2(document: Document2Node): Document2Json;
|
|
912
912
|
|
|
913
|
+
type Document2ValidationIssueCode = 'malformed_document' | 'parser_diagnostic' | 'empty_image' | 'unsupported_emoji' | 'key_empty' | 'key_invalid' | 'key_duplicate' | 'empty_citation' | 'missing_citation' | 'empty_reference' | 'missing_reference' | 'reference_kind_mismatch' | 'invalid_equation_label' | 'invalid_table';
|
|
914
|
+
type Document2ValidationIssue = {
|
|
915
|
+
code: Document2ValidationIssueCode;
|
|
916
|
+
path: string;
|
|
917
|
+
blockId?: string;
|
|
918
|
+
tokenId?: string;
|
|
919
|
+
};
|
|
920
|
+
type Document2ValidationResult = {
|
|
921
|
+
valid: boolean;
|
|
922
|
+
issues: Document2ValidationIssue[];
|
|
923
|
+
};
|
|
924
|
+
/** True when the current XeLaTeX text profile cannot render the value reliably. */
|
|
925
|
+
declare function hasXeLatexUnsupportedEmoji(value: string): boolean;
|
|
926
|
+
/**
|
|
927
|
+
* Validate a Document2 draft without mutating it. Detailed issues are kept in
|
|
928
|
+
* BuTeX so React can identify the field while hosts only need the boolean API.
|
|
929
|
+
*/
|
|
930
|
+
declare function validateDocument2(document: Document2Json | Document2Node): Document2ValidationResult;
|
|
931
|
+
/** Public host contract: drafts may be saved, but only valid documents may compile. */
|
|
932
|
+
declare function isDocument2Valid(document: Document2Json | Document2Node): boolean;
|
|
933
|
+
/** Error thrown when LaTeX export is attempted for an invalid Document2 draft. */
|
|
934
|
+
declare class Document2ValidationError extends Error {
|
|
935
|
+
readonly issues: Document2ValidationIssue[];
|
|
936
|
+
constructor(issues: Document2ValidationIssue[]);
|
|
937
|
+
}
|
|
938
|
+
|
|
913
939
|
declare const DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH = 100;
|
|
914
940
|
type Document2HistoryStacks = {
|
|
915
941
|
past: Document2Node[];
|
|
@@ -972,4 +998,10 @@ type Document2PreviewOptions = {
|
|
|
972
998
|
};
|
|
973
999
|
declare function document2Preview(document: Document2Node, output?: Document2MathOutput, equationSide?: EditorSide, previewOptions?: Document2PreviewOptions): Document2Preview;
|
|
974
1000
|
|
|
975
|
-
|
|
1001
|
+
/**
|
|
1002
|
+
* Export a validated Document2 runtime node. Invalid drafts remain saveable,
|
|
1003
|
+
* but compilation must not silently receive unsafe or unreliable LaTeX.
|
|
1004
|
+
*/
|
|
1005
|
+
declare function document2Latex(document: Document2Node, options?: Document2LatexOptions): string;
|
|
1006
|
+
|
|
1007
|
+
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 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 };
|
package/dist/document2.js
CHANGED
|
@@ -17,9 +17,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/document2/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
20
|
+
// src/document2/public.ts
|
|
21
|
+
var public_exports = {};
|
|
22
|
+
__export(public_exports, {
|
|
23
23
|
BUTEX_BASMALA: () => BUTEX_BASMALA,
|
|
24
24
|
BUTEX_BASMALA_LINE1: () => BUTEX_BASMALA_LINE1,
|
|
25
25
|
BUTEX_BASMALA_LINE2: () => BUTEX_BASMALA_LINE2,
|
|
@@ -29,6 +29,7 @@ __export(document2_exports, {
|
|
|
29
29
|
DEFAULT_HIJRI_DATE: () => DEFAULT_HIJRI_DATE,
|
|
30
30
|
DEFAULT_REFERENCE_FIELD_SEPARATOR: () => DEFAULT_REFERENCE_FIELD_SEPARATOR,
|
|
31
31
|
Document2CommandError: () => Document2CommandError,
|
|
32
|
+
Document2ValidationError: () => Document2ValidationError,
|
|
32
33
|
HIJRI_MONTH_IDS: () => HIJRI_MONTH_IDS,
|
|
33
34
|
HIJRI_YEAR_MAX: () => HIJRI_YEAR_MAX,
|
|
34
35
|
HIJRI_YEAR_MIN: () => HIJRI_YEAR_MIN,
|
|
@@ -74,7 +75,7 @@ __export(document2_exports, {
|
|
|
74
75
|
document2HistoryCanRedo: () => document2HistoryCanRedo,
|
|
75
76
|
document2HistoryCanUndo: () => document2HistoryCanUndo,
|
|
76
77
|
document2KeyError: () => document2KeyError,
|
|
77
|
-
document2Latex: () =>
|
|
78
|
+
document2Latex: () => document2Latex2,
|
|
78
79
|
document2Outline: () => document2Outline,
|
|
79
80
|
document2Preview: () => document2Preview,
|
|
80
81
|
emptyBlockSelection: () => emptyBlockSelection,
|
|
@@ -91,6 +92,7 @@ __export(document2_exports, {
|
|
|
91
92
|
formatRefLabel: () => formatRefLabel,
|
|
92
93
|
fromDocumentJson2: () => fromDocumentJson2,
|
|
93
94
|
getArabicXeLatexPreamble: () => getArabicXeLatexPreamble,
|
|
95
|
+
hasXeLatexUnsupportedEmoji: () => hasXeLatexUnsupportedEmoji,
|
|
94
96
|
hijriMonthLabel: () => hijriMonthLabel,
|
|
95
97
|
inlineFieldLatex: () => inlineFieldLatex,
|
|
96
98
|
insertCiteTokenAtCaret: () => insertCiteTokenAtCaret,
|
|
@@ -98,6 +100,7 @@ __export(document2_exports, {
|
|
|
98
100
|
insertMathToken: () => insertMathToken,
|
|
99
101
|
insertMathTokenAtCaret: () => insertMathTokenAtCaret,
|
|
100
102
|
insertRefTokenAtCaret: () => insertRefTokenAtCaret,
|
|
103
|
+
isDocument2Valid: () => isDocument2Valid,
|
|
101
104
|
isDuplicateDocument2Key: () => isDuplicateDocument2Key,
|
|
102
105
|
isValidDocument2Key: () => isValidDocument2Key,
|
|
103
106
|
labelNumberMap: () => labelNumberMap,
|
|
@@ -151,9 +154,10 @@ __export(document2_exports, {
|
|
|
151
154
|
updateDocument2TextBlockCentered: () => updateDocument2TextBlockCentered,
|
|
152
155
|
updateMathTokenLabel: () => updateMathTokenLabel,
|
|
153
156
|
updateRefTokenKeys: () => updateRefTokenKeys,
|
|
154
|
-
updateTextToken: () => updateTextToken
|
|
157
|
+
updateTextToken: () => updateTextToken,
|
|
158
|
+
validateDocument2: () => validateDocument2
|
|
155
159
|
});
|
|
156
|
-
module.exports = __toCommonJS(
|
|
160
|
+
module.exports = __toCommonJS(public_exports);
|
|
157
161
|
|
|
158
162
|
// src/document2/ids.ts
|
|
159
163
|
var nextId = 1;
|
|
@@ -1070,14 +1074,22 @@ function labelNumberMap(document2) {
|
|
|
1070
1074
|
}
|
|
1071
1075
|
return map;
|
|
1072
1076
|
}
|
|
1077
|
+
function labelKindWord(kind, uiLocale) {
|
|
1078
|
+
if (kind === "fig") {
|
|
1079
|
+
return uiLocale === "ar" ? "\u0627\u0644\u0634\u0643\u0644" : "Figure";
|
|
1080
|
+
}
|
|
1081
|
+
if (kind === "tab") {
|
|
1082
|
+
return uiLocale === "ar" ? "\u0627\u0644\u062C\u062F\u0648\u0644" : "Table";
|
|
1083
|
+
}
|
|
1084
|
+
return uiLocale === "ar" ? "\u0627\u0644\u0645\u0639\u0627\u062F\u0644\u0629" : "Equation";
|
|
1085
|
+
}
|
|
1073
1086
|
function formatFloatCaptionTitle(kind, number, options = {}) {
|
|
1074
1087
|
const locale = options.uiLocale ?? "ar";
|
|
1075
|
-
const kindWord = kind === "fig" ? locale === "ar" ? "\u0627\u0644\u0634\u0643\u0644" : "Figure" : kind === "tab" ? locale === "ar" ? "\u0627\u0644\u062C\u062F\u0648\u0644" : "Table" : locale === "ar" ? "\u0627\u0644\u0645\u0639\u0627\u062F\u0644\u0629" : "Equation";
|
|
1076
1088
|
const digits = formatBibliographyNumber(number, {
|
|
1077
1089
|
documentDirection: options.documentDirection ?? (locale === "ar" ? "rtl" : "ltr"),
|
|
1078
1090
|
digitForm: options.digitForm ?? (locale === "ar" ? "arabicIndic" : "western")
|
|
1079
1091
|
});
|
|
1080
|
-
return `${
|
|
1092
|
+
return `${labelKindWord(kind, locale)} ${digits}`;
|
|
1081
1093
|
}
|
|
1082
1094
|
function formatFloatCaptionPreview(title, caption, uiLocale = "ar") {
|
|
1083
1095
|
const trimmed = caption?.trim() ?? "";
|
|
@@ -1090,19 +1102,18 @@ function formatFloatCaptionPreview(title, caption, uiLocale = "ar") {
|
|
|
1090
1102
|
function formatRefLabel(keys, document2, refCommand, options = {}) {
|
|
1091
1103
|
const documentDirection = options.documentDirection ?? "rtl";
|
|
1092
1104
|
const digitForm = options.digitForm ?? (documentDirection === "rtl" ? "arabicIndic" : "western");
|
|
1105
|
+
const uiLocale = documentDirection === "rtl" ? "ar" : "en";
|
|
1093
1106
|
const map = labelNumberMap(document2);
|
|
1094
1107
|
const parts = keys.map((key) => {
|
|
1095
1108
|
const hit = map.get(key);
|
|
1096
1109
|
if (!hit) {
|
|
1097
|
-
return "?";
|
|
1110
|
+
return refCommand === "eqref" ? "(?)" : "?";
|
|
1098
1111
|
}
|
|
1099
|
-
|
|
1112
|
+
const digits = formatDigits(String(hit.number), digitForm);
|
|
1113
|
+
const numberLabel = refCommand === "eqref" ? `(${digits})` : digits;
|
|
1114
|
+
return `${labelKindWord(hit.kind, uiLocale)} ${numberLabel}`;
|
|
1100
1115
|
});
|
|
1101
|
-
|
|
1102
|
-
if (refCommand === "eqref") {
|
|
1103
|
-
return `(${body})`;
|
|
1104
|
-
}
|
|
1105
|
-
return body;
|
|
1116
|
+
return parts.join(documentDirection === "rtl" ? "\u060C" : ", ");
|
|
1106
1117
|
}
|
|
1107
1118
|
function stripDisplayMathDelimiters(source) {
|
|
1108
1119
|
const trimmed = source.trim();
|
|
@@ -3888,14 +3899,20 @@ var BUTEX_EDITOR_CSS = `
|
|
|
3888
3899
|
${BUTEX_FONT_FACE_CSS}
|
|
3889
3900
|
|
|
3890
3901
|
.surface {
|
|
3902
|
+
background: var(--butex-surface-bg, linear-gradient(180deg, #ffffff 0%, #fafbfc 100%));
|
|
3891
3903
|
border: 1px solid var(--butex-border, #e2e8f0);
|
|
3892
3904
|
border-radius: 12px;
|
|
3893
|
-
min-height: 100px;
|
|
3894
|
-
padding: 8px 10px;
|
|
3895
|
-
background: var(--butex-surface-bg, linear-gradient(180deg, #ffffff 0%, #fafbfc 100%));
|
|
3896
3905
|
color: var(--butex-surface-fg, #0f172a);
|
|
3897
|
-
outline: none;
|
|
3898
3906
|
cursor: text;
|
|
3907
|
+
max-width: 100%;
|
|
3908
|
+
min-height: 100px;
|
|
3909
|
+
min-width: 0;
|
|
3910
|
+
outline: none;
|
|
3911
|
+
overflow-x: auto;
|
|
3912
|
+
overflow-y: hidden;
|
|
3913
|
+
overscroll-behavior-inline: contain;
|
|
3914
|
+
padding: 8px 10px;
|
|
3915
|
+
touch-action: pan-x pan-y;
|
|
3899
3916
|
transition: box-shadow 0.15s ease, border-color 0.15s ease;
|
|
3900
3917
|
}
|
|
3901
3918
|
|
|
@@ -3960,6 +3977,17 @@ ${CHARACTER_FONT_CSS}
|
|
|
3960
3977
|
50% { opacity: 0; }
|
|
3961
3978
|
}
|
|
3962
3979
|
|
|
3980
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3981
|
+
.surface {
|
|
3982
|
+
scroll-behavior: auto;
|
|
3983
|
+
transition: none;
|
|
3984
|
+
}
|
|
3985
|
+
|
|
3986
|
+
.caret {
|
|
3987
|
+
animation: none;
|
|
3988
|
+
}
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3963
3991
|
.node {
|
|
3964
3992
|
display: inline-flex;
|
|
3965
3993
|
align-items: stretch;
|
|
@@ -7257,6 +7285,287 @@ ${body}
|
|
|
7257
7285
|
`;
|
|
7258
7286
|
}
|
|
7259
7287
|
|
|
7288
|
+
// src/document2/validation.ts
|
|
7289
|
+
var XELATEX_UNSUPPORTED_EMOJI_PATTERN = /[\p{Emoji_Presentation}\p{Emoji_Modifier}\p{Regional_Indicator}\uFE0F\u20E3]/u;
|
|
7290
|
+
function hasXeLatexUnsupportedEmoji(value) {
|
|
7291
|
+
return XELATEX_UNSUPPORTED_EMOJI_PATTERN.test(value);
|
|
7292
|
+
}
|
|
7293
|
+
function addIssue(context, code, path, blockId, tokenId) {
|
|
7294
|
+
context.issues.push({
|
|
7295
|
+
code,
|
|
7296
|
+
path,
|
|
7297
|
+
...blockId ? { blockId } : {},
|
|
7298
|
+
...tokenId ? { tokenId } : {}
|
|
7299
|
+
});
|
|
7300
|
+
}
|
|
7301
|
+
function validateTextValue(context, value, path, blockId, tokenId) {
|
|
7302
|
+
if (hasXeLatexUnsupportedEmoji(value)) {
|
|
7303
|
+
addIssue(context, "unsupported_emoji", path, blockId, tokenId);
|
|
7304
|
+
}
|
|
7305
|
+
}
|
|
7306
|
+
function registerKey(context, key, path, kind, blockId, tokenId) {
|
|
7307
|
+
const normalized = normalizeDocument2Key(key);
|
|
7308
|
+
if (normalized.length === 0) {
|
|
7309
|
+
addIssue(context, "key_empty", path, blockId, tokenId);
|
|
7310
|
+
return;
|
|
7311
|
+
}
|
|
7312
|
+
if (!isValidDocument2Key(normalized)) {
|
|
7313
|
+
addIssue(context, "key_invalid", path, blockId, tokenId);
|
|
7314
|
+
return;
|
|
7315
|
+
}
|
|
7316
|
+
context.keyOwners.push({
|
|
7317
|
+
key: normalized,
|
|
7318
|
+
path,
|
|
7319
|
+
kind,
|
|
7320
|
+
...blockId ? { blockId } : {},
|
|
7321
|
+
...tokenId ? { tokenId } : {}
|
|
7322
|
+
});
|
|
7323
|
+
if (kind !== "reference" && !context.labelKinds.has(normalized)) {
|
|
7324
|
+
context.labelKinds.set(normalized, kind);
|
|
7325
|
+
}
|
|
7326
|
+
}
|
|
7327
|
+
function validateToken(context, token, path, blockId) {
|
|
7328
|
+
if (token.kind === "text") {
|
|
7329
|
+
validateTextValue(context, token.text, `${path}.text`, blockId, token.id);
|
|
7330
|
+
return;
|
|
7331
|
+
}
|
|
7332
|
+
if (token.kind === "cite") {
|
|
7333
|
+
if (token.keys.length === 0) {
|
|
7334
|
+
addIssue(context, "empty_citation", `${path}.keys`, blockId, token.id);
|
|
7335
|
+
}
|
|
7336
|
+
context.pendingCitations.push({ token, path, blockId });
|
|
7337
|
+
return;
|
|
7338
|
+
}
|
|
7339
|
+
if (token.kind === "ref") {
|
|
7340
|
+
if (token.keys.length === 0) {
|
|
7341
|
+
addIssue(context, "empty_reference", `${path}.keys`, blockId, token.id);
|
|
7342
|
+
}
|
|
7343
|
+
context.pendingReferences.push({ token, path, blockId });
|
|
7344
|
+
return;
|
|
7345
|
+
}
|
|
7346
|
+
validateTextValue(context, token.source, `${path}.source`, blockId, token.id);
|
|
7347
|
+
if (!token.labelEnabled) {
|
|
7348
|
+
return;
|
|
7349
|
+
}
|
|
7350
|
+
if (!token.display) {
|
|
7351
|
+
addIssue(context, "invalid_equation_label", `${path}.label`, blockId, token.id);
|
|
7352
|
+
return;
|
|
7353
|
+
}
|
|
7354
|
+
registerKey(context, token.label ?? "", `${path}.label`, "eq", blockId, token.id);
|
|
7355
|
+
}
|
|
7356
|
+
function validateInlineField(context, field, path, blockId) {
|
|
7357
|
+
field.tokens.forEach((token, index) => {
|
|
7358
|
+
validateToken(context, token, `${path}.tokens[${String(index)}]`, blockId);
|
|
7359
|
+
});
|
|
7360
|
+
}
|
|
7361
|
+
function validateBlock(context, block, path) {
|
|
7362
|
+
if (block.kind === "textBlock") {
|
|
7363
|
+
validateInlineField(context, block.field, `${path}.field`, block.id);
|
|
7364
|
+
return;
|
|
7365
|
+
}
|
|
7366
|
+
if (block.kind === "list") {
|
|
7367
|
+
block.items.forEach((item, itemIndex) => {
|
|
7368
|
+
const itemPath = `${path}.items[${String(itemIndex)}]`;
|
|
7369
|
+
validateInlineField(context, item.field, `${itemPath}.field`, block.id);
|
|
7370
|
+
item.blocks.forEach((child, childIndex) => {
|
|
7371
|
+
validateBlock(context, child, `${itemPath}.blocks[${String(childIndex)}]`);
|
|
7372
|
+
});
|
|
7373
|
+
});
|
|
7374
|
+
return;
|
|
7375
|
+
}
|
|
7376
|
+
if (block.kind === "table") {
|
|
7377
|
+
if (block.columns.trim().length === 0 || block.rows.length === 0) {
|
|
7378
|
+
addIssue(context, "invalid_table", path, block.id);
|
|
7379
|
+
}
|
|
7380
|
+
const expectedColumns = block.rows[0]?.length ?? 0;
|
|
7381
|
+
if (expectedColumns === 0 || block.rows.some((row) => row.length !== expectedColumns)) {
|
|
7382
|
+
addIssue(context, "invalid_table", `${path}.rows`, block.id);
|
|
7383
|
+
}
|
|
7384
|
+
block.rows.forEach((row, rowIndex) => {
|
|
7385
|
+
row.forEach((cell, columnIndex) => {
|
|
7386
|
+
validateInlineField(
|
|
7387
|
+
context,
|
|
7388
|
+
cell,
|
|
7389
|
+
`${path}.rows[${String(rowIndex)}][${String(columnIndex)}]`,
|
|
7390
|
+
block.id
|
|
7391
|
+
);
|
|
7392
|
+
});
|
|
7393
|
+
});
|
|
7394
|
+
validateTextValue(context, block.caption, `${path}.caption`, block.id);
|
|
7395
|
+
if (block.labelEnabled) {
|
|
7396
|
+
registerKey(context, block.label, `${path}.label`, "tab", block.id);
|
|
7397
|
+
}
|
|
7398
|
+
return;
|
|
7399
|
+
}
|
|
7400
|
+
if (block.kind === "image") {
|
|
7401
|
+
const hasAssetId = typeof block.assetId === "string" && block.assetId.trim().length > 0;
|
|
7402
|
+
const hasValue = block.value.trim().length > 0;
|
|
7403
|
+
if (!hasAssetId && !hasValue) {
|
|
7404
|
+
addIssue(context, "empty_image", path, block.id);
|
|
7405
|
+
}
|
|
7406
|
+
validateTextValue(context, block.value, `${path}.value`, block.id);
|
|
7407
|
+
validateTextValue(context, block.caption, `${path}.caption`, block.id);
|
|
7408
|
+
if (block.labelEnabled) {
|
|
7409
|
+
registerKey(context, block.label, `${path}.label`, "fig", block.id);
|
|
7410
|
+
}
|
|
7411
|
+
return;
|
|
7412
|
+
}
|
|
7413
|
+
if (block.kind === "raw") {
|
|
7414
|
+
validateTextValue(context, block.value, `${path}.value`, block.id);
|
|
7415
|
+
}
|
|
7416
|
+
}
|
|
7417
|
+
function validateDuplicateKeys(context) {
|
|
7418
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
7419
|
+
for (const owner of context.keyOwners) {
|
|
7420
|
+
const group = grouped.get(owner.key) ?? [];
|
|
7421
|
+
group.push(owner);
|
|
7422
|
+
grouped.set(owner.key, group);
|
|
7423
|
+
}
|
|
7424
|
+
for (const owners of grouped.values()) {
|
|
7425
|
+
if (owners.length < 2) {
|
|
7426
|
+
continue;
|
|
7427
|
+
}
|
|
7428
|
+
for (const owner of owners) {
|
|
7429
|
+
addIssue(context, "key_duplicate", owner.path, owner.blockId, owner.tokenId);
|
|
7430
|
+
}
|
|
7431
|
+
}
|
|
7432
|
+
}
|
|
7433
|
+
function validatePendingReferences(context) {
|
|
7434
|
+
for (const pending of context.pendingCitations) {
|
|
7435
|
+
if (pending.token.keys.some((key) => !isValidDocument2Key(normalizeDocument2Key(key)))) {
|
|
7436
|
+
addIssue(
|
|
7437
|
+
context,
|
|
7438
|
+
"missing_citation",
|
|
7439
|
+
`${pending.path}.keys`,
|
|
7440
|
+
pending.blockId,
|
|
7441
|
+
pending.token.id
|
|
7442
|
+
);
|
|
7443
|
+
}
|
|
7444
|
+
}
|
|
7445
|
+
for (const pending of context.pendingReferences) {
|
|
7446
|
+
for (const key of pending.token.keys) {
|
|
7447
|
+
const normalized = normalizeDocument2Key(key);
|
|
7448
|
+
if (!isValidDocument2Key(normalized)) {
|
|
7449
|
+
addIssue(
|
|
7450
|
+
context,
|
|
7451
|
+
"missing_reference",
|
|
7452
|
+
`${pending.path}.keys`,
|
|
7453
|
+
pending.blockId,
|
|
7454
|
+
pending.token.id
|
|
7455
|
+
);
|
|
7456
|
+
break;
|
|
7457
|
+
}
|
|
7458
|
+
const kind = context.labelKinds.get(normalized);
|
|
7459
|
+
if (kind && pending.token.refCommand === "eqref" !== (kind === "eq")) {
|
|
7460
|
+
addIssue(
|
|
7461
|
+
context,
|
|
7462
|
+
"reference_kind_mismatch",
|
|
7463
|
+
`${pending.path}.keys`,
|
|
7464
|
+
pending.blockId,
|
|
7465
|
+
pending.token.id
|
|
7466
|
+
);
|
|
7467
|
+
break;
|
|
7468
|
+
}
|
|
7469
|
+
}
|
|
7470
|
+
}
|
|
7471
|
+
}
|
|
7472
|
+
function isRecord(value) {
|
|
7473
|
+
return typeof value === "object" && value !== null;
|
|
7474
|
+
}
|
|
7475
|
+
function hasRuntimeDocumentShape(document2) {
|
|
7476
|
+
const value = document2;
|
|
7477
|
+
return isRecord(value) && value.nodeType === "DocumentObject";
|
|
7478
|
+
}
|
|
7479
|
+
function hasWireDocumentShape(document2) {
|
|
7480
|
+
const value = document2;
|
|
7481
|
+
if (!isRecord(value) || value.node_type !== "DocumentObject" || !Array.isArray(value.blocks)) {
|
|
7482
|
+
return false;
|
|
7483
|
+
}
|
|
7484
|
+
if (value.meta !== void 0 && !isRecord(value.meta)) {
|
|
7485
|
+
return false;
|
|
7486
|
+
}
|
|
7487
|
+
if (value.references !== void 0) {
|
|
7488
|
+
if (!Array.isArray(value.references)) {
|
|
7489
|
+
return false;
|
|
7490
|
+
}
|
|
7491
|
+
for (const reference of value.references) {
|
|
7492
|
+
if (!isRecord(reference) || typeof reference.key !== "string" || reference.key.trim().length === 0) {
|
|
7493
|
+
return false;
|
|
7494
|
+
}
|
|
7495
|
+
}
|
|
7496
|
+
}
|
|
7497
|
+
return true;
|
|
7498
|
+
}
|
|
7499
|
+
function resolveDocument(document2) {
|
|
7500
|
+
if (hasRuntimeDocumentShape(document2)) {
|
|
7501
|
+
try {
|
|
7502
|
+
toDocumentJson2(document2);
|
|
7503
|
+
return document2;
|
|
7504
|
+
} catch {
|
|
7505
|
+
return null;
|
|
7506
|
+
}
|
|
7507
|
+
}
|
|
7508
|
+
if (!hasWireDocumentShape(document2)) {
|
|
7509
|
+
return null;
|
|
7510
|
+
}
|
|
7511
|
+
try {
|
|
7512
|
+
return fromDocumentJson2(document2);
|
|
7513
|
+
} catch {
|
|
7514
|
+
return null;
|
|
7515
|
+
}
|
|
7516
|
+
}
|
|
7517
|
+
function validateDocument2(document2) {
|
|
7518
|
+
const resolved = resolveDocument(document2);
|
|
7519
|
+
if (!resolved) {
|
|
7520
|
+
return {
|
|
7521
|
+
valid: false,
|
|
7522
|
+
issues: [{ code: "malformed_document", path: "$" }]
|
|
7523
|
+
};
|
|
7524
|
+
}
|
|
7525
|
+
const context = {
|
|
7526
|
+
issues: [],
|
|
7527
|
+
keyOwners: [],
|
|
7528
|
+
labelKinds: /* @__PURE__ */ new Map(),
|
|
7529
|
+
pendingCitations: [],
|
|
7530
|
+
pendingReferences: []
|
|
7531
|
+
};
|
|
7532
|
+
validateTextValue(context, resolved.meta.title, "$.meta.title");
|
|
7533
|
+
validateTextValue(context, resolved.meta.authors, "$.meta.authors");
|
|
7534
|
+
validateTextValue(context, resolved.meta.abstract, "$.meta.abstract");
|
|
7535
|
+
resolved.references.forEach((reference, index) => {
|
|
7536
|
+
const path = `$.references[${String(index)}]`;
|
|
7537
|
+
registerKey(context, reference.key, `${path}.key`, "reference");
|
|
7538
|
+
validateTextValue(context, reference.authors, `${path}.authors`);
|
|
7539
|
+
validateTextValue(context, reference.title, `${path}.title`);
|
|
7540
|
+
validateTextValue(context, reference.year, `${path}.year`);
|
|
7541
|
+
validateTextValue(context, reference.url, `${path}.url`);
|
|
7542
|
+
validateTextValue(context, reference.venue, `${path}.venue`);
|
|
7543
|
+
});
|
|
7544
|
+
resolved.blocks.forEach((block, index) => {
|
|
7545
|
+
validateBlock(context, block, `$.blocks[${String(index)}]`);
|
|
7546
|
+
});
|
|
7547
|
+
for (const diagnostic of resolved.diagnostics) {
|
|
7548
|
+
addIssue(context, "parser_diagnostic", diagnostic.path);
|
|
7549
|
+
}
|
|
7550
|
+
validateDuplicateKeys(context);
|
|
7551
|
+
validatePendingReferences(context);
|
|
7552
|
+
return {
|
|
7553
|
+
valid: context.issues.length === 0,
|
|
7554
|
+
issues: context.issues
|
|
7555
|
+
};
|
|
7556
|
+
}
|
|
7557
|
+
function isDocument2Valid(document2) {
|
|
7558
|
+
return validateDocument2(document2).valid;
|
|
7559
|
+
}
|
|
7560
|
+
var Document2ValidationError = class extends Error {
|
|
7561
|
+
issues;
|
|
7562
|
+
constructor(issues) {
|
|
7563
|
+
super("Document2 validation failed; invalid drafts cannot be exported to LaTeX.");
|
|
7564
|
+
this.name = "Document2ValidationError";
|
|
7565
|
+
this.issues = issues;
|
|
7566
|
+
}
|
|
7567
|
+
};
|
|
7568
|
+
|
|
7260
7569
|
// src/document2/history.ts
|
|
7261
7570
|
var DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH = 100;
|
|
7262
7571
|
function createDocument2History(maxDepth = DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH) {
|
|
@@ -7464,6 +7773,7 @@ function blockPreview(block, islands, output, equationSide, document2, previewOp
|
|
|
7464
7773
|
src: block.value,
|
|
7465
7774
|
...block.assetId !== void 0 ? { assetId: block.assetId } : {},
|
|
7466
7775
|
options: block.options,
|
|
7776
|
+
centered: block.centered,
|
|
7467
7777
|
...block.captionEnabled && block.caption.trim().length > 0 ? { caption: block.caption.trim() } : {},
|
|
7468
7778
|
...label.length > 0 ? { label, numberLabel: floatNumberLabel(document2, label, previewOptions) } : {},
|
|
7469
7779
|
...block.metadata ? { metadata: { ...block.metadata } } : {}
|
|
@@ -7531,6 +7841,15 @@ function document2Preview(document2, output = "svg", equationSide = "arabic", pr
|
|
|
7531
7841
|
mathIslands
|
|
7532
7842
|
};
|
|
7533
7843
|
}
|
|
7844
|
+
|
|
7845
|
+
// src/document2/validatedLatex.ts
|
|
7846
|
+
function document2Latex2(document2, options = {}) {
|
|
7847
|
+
const validation = validateDocument2(document2);
|
|
7848
|
+
if (!validation.valid) {
|
|
7849
|
+
throw new Document2ValidationError(validation.issues);
|
|
7850
|
+
}
|
|
7851
|
+
return document2Latex(document2, options);
|
|
7852
|
+
}
|
|
7534
7853
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7535
7854
|
0 && (module.exports = {
|
|
7536
7855
|
BUTEX_BASMALA,
|
|
@@ -7542,6 +7861,7 @@ function document2Preview(document2, output = "svg", equationSide = "arabic", pr
|
|
|
7542
7861
|
DEFAULT_HIJRI_DATE,
|
|
7543
7862
|
DEFAULT_REFERENCE_FIELD_SEPARATOR,
|
|
7544
7863
|
Document2CommandError,
|
|
7864
|
+
Document2ValidationError,
|
|
7545
7865
|
HIJRI_MONTH_IDS,
|
|
7546
7866
|
HIJRI_YEAR_MAX,
|
|
7547
7867
|
HIJRI_YEAR_MIN,
|
|
@@ -7604,6 +7924,7 @@ function document2Preview(document2, output = "svg", equationSide = "arabic", pr
|
|
|
7604
7924
|
formatRefLabel,
|
|
7605
7925
|
fromDocumentJson2,
|
|
7606
7926
|
getArabicXeLatexPreamble,
|
|
7927
|
+
hasXeLatexUnsupportedEmoji,
|
|
7607
7928
|
hijriMonthLabel,
|
|
7608
7929
|
inlineFieldLatex,
|
|
7609
7930
|
insertCiteTokenAtCaret,
|
|
@@ -7611,6 +7932,7 @@ function document2Preview(document2, output = "svg", equationSide = "arabic", pr
|
|
|
7611
7932
|
insertMathToken,
|
|
7612
7933
|
insertMathTokenAtCaret,
|
|
7613
7934
|
insertRefTokenAtCaret,
|
|
7935
|
+
isDocument2Valid,
|
|
7614
7936
|
isDuplicateDocument2Key,
|
|
7615
7937
|
isValidDocument2Key,
|
|
7616
7938
|
labelNumberMap,
|
|
@@ -7664,6 +7986,7 @@ function document2Preview(document2, output = "svg", equationSide = "arabic", pr
|
|
|
7664
7986
|
updateDocument2TextBlockCentered,
|
|
7665
7987
|
updateMathTokenLabel,
|
|
7666
7988
|
updateRefTokenKeys,
|
|
7667
|
-
updateTextToken
|
|
7989
|
+
updateTextToken,
|
|
7990
|
+
validateDocument2
|
|
7668
7991
|
});
|
|
7669
7992
|
//# sourceMappingURL=document2.js.map
|