@drghaliasri/butex 5.2.0 → 5.3.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.d.mts +11 -2
- package/dist/document2.d.ts +11 -2
- package/dist/document2.js +59 -13
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +54 -13
- package/dist/document2.mjs.map +1 -1
- package/dist/react-document2.js +54 -14
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +54 -14
- package/dist/react-document2.mjs.map +1 -1
- package/package.json +1 -1
package/dist/document2.d.mts
CHANGED
|
@@ -496,12 +496,21 @@ declare function applyFloatMetaPatch<T extends ImageBlock2 | TableBlock2>(block:
|
|
|
496
496
|
|
|
497
497
|
type ButexUiLocale = 'ar' | 'en';
|
|
498
498
|
|
|
499
|
-
declare const
|
|
499
|
+
declare const BUTEX_BASMALA_LINE1 = "\u0628\u0650\u0633\u0652\u0645\u0650 \u0627\u0644\u0644\u064E\u0651\u0647\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0652\u0645\u064E\u0670\u0646\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0650\u064A\u0645\u0650";
|
|
500
|
+
declare const BUTEX_BASMALA_SALAWAT = "\u0635\u064E\u0644\u064E\u0651\u0649 \u0627\u0644\u0644\u064E\u0651\u0647\u064F \u0639\u064E\u0644\u064E\u064A\u0652\u0647\u0650 \u0648\u064E\u0633\u064E\u0644\u064E\u0651\u0645\u064E";
|
|
501
|
+
/** Two-line basmala joined for UI / plain-text matchers. */
|
|
502
|
+
declare const BUTEX_BASMALA = "\u0628\u0650\u0633\u0652\u0645\u0650 \u0627\u0644\u0644\u064E\u0651\u0647\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0652\u0645\u064E\u0670\u0646\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0650\u064A\u0645\u0650\n\u0635\u064E\u0644\u064E\u0651\u0649 \u0627\u0644\u0644\u064E\u0651\u0647\u064F \u0639\u064E\u0644\u064E\u064A\u0652\u0647\u0650 \u0648\u064E\u0633\u064E\u0644\u064E\u0651\u0645\u064E";
|
|
500
503
|
declare const BUTEX_CLOSING_HAMDALA = "\u0627\u0644\u0652\u062D\u064E\u0645\u0652\u062F\u064F \u0644\u0650\u0644\u064E\u0651\u0647\u0650 \u0646\u064E\u0641\u064E\u0639\u064E\u0646\u064E\u0627 \u0628\u0650\u0639\u0650\u0644\u0652\u0645\u0650\u0647\u0650";
|
|
501
504
|
/** Display-math body using BuTeX Diwani (for MathJax preview islands). */
|
|
502
505
|
declare function butexDiwaniDisplayTex(text: string): string;
|
|
503
506
|
/** Full display equation for XeLaTeX export. */
|
|
504
507
|
declare function butexDiwaniDisplayLatex(text: string): string;
|
|
508
|
+
/** Two-line Diwani body for MathJax basmala islands. */
|
|
509
|
+
declare function butexBasmalaDisplayTex(): string;
|
|
510
|
+
/** Standalone display equation when there is no \\maketitle (title-less docs). */
|
|
511
|
+
declare function butexBasmalaDisplayLatex(): string;
|
|
512
|
+
/** Titling hooks so the basmala stays attached to the visible title. */
|
|
513
|
+
declare function butexBasmalaTitlingPreamble(): string;
|
|
505
514
|
declare const HIJRI_YEAR_MIN = 1400;
|
|
506
515
|
declare const HIJRI_YEAR_MAX = 1500;
|
|
507
516
|
declare const HIJRI_MONTH_IDS: HijriMonthId[];
|
|
@@ -666,4 +675,4 @@ type Document2PreviewOptions = {
|
|
|
666
675
|
};
|
|
667
676
|
declare function document2Preview(document: Document2Node, output?: Document2MathOutput, equationSide?: EditorSide, previewOptions?: Document2PreviewOptions): Document2Preview;
|
|
668
677
|
|
|
669
|
-
export { type ArabicDigitsMapping, type ArabicXeLatexPreambleOptions, BUTEX_BASMALA, BUTEX_CLOSING_HAMDALA, type BibliographyBlock2, type BlockSelectionRange, type BlockSelectionState, type CiteToken2, DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH, DEFAULT_HIJRI_DATE, type Document2Block, type Document2BlockJson, type Document2Diagnostic, type Document2Direction, type Document2HijriDate, type Document2HistoryStacks, type Document2Json, type Document2LabelEntry, type Document2LabelKind, type Document2LatexOptions, type Document2MathOutput, type Document2Meta, type Document2MetaProp, type Document2Node, type Document2Preview, type Document2PreviewOptions, type FloatMeta2, type FloatMetaPatch, type FormatCiteLabelOptions, HIJRI_MONTH_IDS, HIJRI_YEAR_MAX, HIJRI_YEAR_MIN, type HijriMonthId, type ImageBlock2, type ImportDocument2Options, type InlineField2, type InlineToken2, type ListBlock2, type MathIsland2, type MathObject2Json, type MathToken2, type PreviewBlock2, type PreviewInline2, type RawBlock2, type RefToken2, type Reference2, type Reference2Json, type TableBlock2, type TextBlock2, type TextToken2, addDocument2ImageBlock, addDocument2ListBlock, addDocument2ListItem, addDocument2Reference, addDocument2TableBlock, addDocument2TextBlock, applyFloatMetaPatch, arabicXeLatexPreambleCmd, arabicXeLatexPreambleFont, arabicXeLatexPreamblePkg, bibliographyEntryLatex, butexDiwaniDisplayLatex, butexDiwaniDisplayTex, citeTokenLatex, cloneDocument2Meta, cloneDocument2Node, collectDocument2Labels, createDocument2History, createEmptyArabicEquationSession, createEmptyDocument2, createEmptyEquationSession, createEmptyReference2, createInlineField2, defaultFloatMeta, detectInlineSpans2, detectMathSpans2, document2HasAbstract, document2HasMaketitle, document2HasTitleStack, document2HistoryCanRedo, document2HistoryCanUndo, document2Latex, document2Preview, emptyBlockSelection, emptyDocument2Meta, ensureDocument2BibliographyBlock, extendBlockSelectionFromAnchor, fillDocument2MetaGaps, findFirstInlineField, formatBibliographyNumber, formatCiteLabel, formatHijriDate, formatRefLabel, fromDocumentJson2, getArabicXeLatexPreamble, hijriMonthLabel, inlineFieldLatex, insertCiteTokenAtCaret, insertDocument2BlockAfter, insertMathToken, insertMathTokenAtCaret, insertRefTokenAtCaret, labelNumberMap, mathNodeFromArabicSession, mathNodeFromSession, mathSourceFromArabicSession, mathSourceFromSession, mathTokenSourceForSide, mathTokenToArabicEditorSession, mathTokenToEditorSession, mergeDocument2Meta, moveDocument2BlockById, moveDocument2BlockRange, moveDocument2Reference, normalizeBlockSelection, normalizeDocument2HijriDate, normalizeDocument2Meta, parseCiteKeys, parseFloatMetaFromJson, parseRefKeys, pushDocument2Snapshot, refTokenLatex, referenceFromJson, referenceNumberMap, remapSelectionAfterRangeMove, removeCiteTokenById, removeDocument2BlockById, removeDocument2BlockRange, removeDocument2ListItem, removeDocument2Reference, removeMathTokenById, removeRefTokenById, replaceMathTokenFromSession, resolveCiteNumbers, restoreDocument2Redo, restoreDocument2Undo, setDocument2References, stripDisplayMathDelimiters, toggleBlockInSelection, updateCiteTokenKeys, updateDocument2ImageMeta, updateDocument2ImageValue, updateDocument2Meta, updateDocument2Reference, updateDocument2TableMeta, updateDocument2TextBlockCentered, updateMathTokenLabel, updateRefTokenKeys, updateTextToken };
|
|
678
|
+
export { type ArabicDigitsMapping, type ArabicXeLatexPreambleOptions, BUTEX_BASMALA, BUTEX_BASMALA_LINE1, BUTEX_BASMALA_SALAWAT, BUTEX_CLOSING_HAMDALA, type BibliographyBlock2, type BlockSelectionRange, type BlockSelectionState, type CiteToken2, DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH, DEFAULT_HIJRI_DATE, type Document2Block, type Document2BlockJson, type Document2Diagnostic, type Document2Direction, type Document2HijriDate, type Document2HistoryStacks, type Document2Json, type Document2LabelEntry, type Document2LabelKind, type Document2LatexOptions, type Document2MathOutput, type Document2Meta, type Document2MetaProp, type Document2Node, type Document2Preview, type Document2PreviewOptions, type FloatMeta2, type FloatMetaPatch, type FormatCiteLabelOptions, HIJRI_MONTH_IDS, HIJRI_YEAR_MAX, HIJRI_YEAR_MIN, type HijriMonthId, type ImageBlock2, type ImportDocument2Options, type InlineField2, type InlineToken2, type ListBlock2, type MathIsland2, type MathObject2Json, type MathToken2, type PreviewBlock2, type PreviewInline2, type RawBlock2, type RefToken2, type Reference2, type Reference2Json, type TableBlock2, type TextBlock2, type TextToken2, addDocument2ImageBlock, addDocument2ListBlock, addDocument2ListItem, addDocument2Reference, addDocument2TableBlock, addDocument2TextBlock, applyFloatMetaPatch, arabicXeLatexPreambleCmd, arabicXeLatexPreambleFont, arabicXeLatexPreamblePkg, bibliographyEntryLatex, butexBasmalaDisplayLatex, butexBasmalaDisplayTex, butexBasmalaTitlingPreamble, butexDiwaniDisplayLatex, butexDiwaniDisplayTex, citeTokenLatex, cloneDocument2Meta, cloneDocument2Node, collectDocument2Labels, createDocument2History, createEmptyArabicEquationSession, createEmptyDocument2, createEmptyEquationSession, createEmptyReference2, createInlineField2, defaultFloatMeta, detectInlineSpans2, detectMathSpans2, document2HasAbstract, document2HasMaketitle, document2HasTitleStack, document2HistoryCanRedo, document2HistoryCanUndo, document2Latex, document2Preview, emptyBlockSelection, emptyDocument2Meta, ensureDocument2BibliographyBlock, extendBlockSelectionFromAnchor, fillDocument2MetaGaps, findFirstInlineField, formatBibliographyNumber, formatCiteLabel, formatHijriDate, formatRefLabel, fromDocumentJson2, getArabicXeLatexPreamble, hijriMonthLabel, inlineFieldLatex, insertCiteTokenAtCaret, insertDocument2BlockAfter, insertMathToken, insertMathTokenAtCaret, insertRefTokenAtCaret, labelNumberMap, mathNodeFromArabicSession, mathNodeFromSession, mathSourceFromArabicSession, mathSourceFromSession, mathTokenSourceForSide, mathTokenToArabicEditorSession, mathTokenToEditorSession, mergeDocument2Meta, moveDocument2BlockById, moveDocument2BlockRange, moveDocument2Reference, normalizeBlockSelection, normalizeDocument2HijriDate, normalizeDocument2Meta, parseCiteKeys, parseFloatMetaFromJson, parseRefKeys, pushDocument2Snapshot, refTokenLatex, referenceFromJson, referenceNumberMap, remapSelectionAfterRangeMove, removeCiteTokenById, removeDocument2BlockById, removeDocument2BlockRange, removeDocument2ListItem, removeDocument2Reference, removeMathTokenById, removeRefTokenById, replaceMathTokenFromSession, resolveCiteNumbers, restoreDocument2Redo, restoreDocument2Undo, setDocument2References, stripDisplayMathDelimiters, toggleBlockInSelection, updateCiteTokenKeys, updateDocument2ImageMeta, updateDocument2ImageValue, updateDocument2Meta, updateDocument2Reference, updateDocument2TableMeta, updateDocument2TextBlockCentered, updateMathTokenLabel, updateRefTokenKeys, updateTextToken };
|
package/dist/document2.d.ts
CHANGED
|
@@ -496,12 +496,21 @@ declare function applyFloatMetaPatch<T extends ImageBlock2 | TableBlock2>(block:
|
|
|
496
496
|
|
|
497
497
|
type ButexUiLocale = 'ar' | 'en';
|
|
498
498
|
|
|
499
|
-
declare const
|
|
499
|
+
declare const BUTEX_BASMALA_LINE1 = "\u0628\u0650\u0633\u0652\u0645\u0650 \u0627\u0644\u0644\u064E\u0651\u0647\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0652\u0645\u064E\u0670\u0646\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0650\u064A\u0645\u0650";
|
|
500
|
+
declare const BUTEX_BASMALA_SALAWAT = "\u0635\u064E\u0644\u064E\u0651\u0649 \u0627\u0644\u0644\u064E\u0651\u0647\u064F \u0639\u064E\u0644\u064E\u064A\u0652\u0647\u0650 \u0648\u064E\u0633\u064E\u0644\u064E\u0651\u0645\u064E";
|
|
501
|
+
/** Two-line basmala joined for UI / plain-text matchers. */
|
|
502
|
+
declare const BUTEX_BASMALA = "\u0628\u0650\u0633\u0652\u0645\u0650 \u0627\u0644\u0644\u064E\u0651\u0647\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0652\u0645\u064E\u0670\u0646\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0650\u064A\u0645\u0650\n\u0635\u064E\u0644\u064E\u0651\u0649 \u0627\u0644\u0644\u064E\u0651\u0647\u064F \u0639\u064E\u0644\u064E\u064A\u0652\u0647\u0650 \u0648\u064E\u0633\u064E\u0644\u064E\u0651\u0645\u064E";
|
|
500
503
|
declare const BUTEX_CLOSING_HAMDALA = "\u0627\u0644\u0652\u062D\u064E\u0645\u0652\u062F\u064F \u0644\u0650\u0644\u064E\u0651\u0647\u0650 \u0646\u064E\u0641\u064E\u0639\u064E\u0646\u064E\u0627 \u0628\u0650\u0639\u0650\u0644\u0652\u0645\u0650\u0647\u0650";
|
|
501
504
|
/** Display-math body using BuTeX Diwani (for MathJax preview islands). */
|
|
502
505
|
declare function butexDiwaniDisplayTex(text: string): string;
|
|
503
506
|
/** Full display equation for XeLaTeX export. */
|
|
504
507
|
declare function butexDiwaniDisplayLatex(text: string): string;
|
|
508
|
+
/** Two-line Diwani body for MathJax basmala islands. */
|
|
509
|
+
declare function butexBasmalaDisplayTex(): string;
|
|
510
|
+
/** Standalone display equation when there is no \\maketitle (title-less docs). */
|
|
511
|
+
declare function butexBasmalaDisplayLatex(): string;
|
|
512
|
+
/** Titling hooks so the basmala stays attached to the visible title. */
|
|
513
|
+
declare function butexBasmalaTitlingPreamble(): string;
|
|
505
514
|
declare const HIJRI_YEAR_MIN = 1400;
|
|
506
515
|
declare const HIJRI_YEAR_MAX = 1500;
|
|
507
516
|
declare const HIJRI_MONTH_IDS: HijriMonthId[];
|
|
@@ -666,4 +675,4 @@ type Document2PreviewOptions = {
|
|
|
666
675
|
};
|
|
667
676
|
declare function document2Preview(document: Document2Node, output?: Document2MathOutput, equationSide?: EditorSide, previewOptions?: Document2PreviewOptions): Document2Preview;
|
|
668
677
|
|
|
669
|
-
export { type ArabicDigitsMapping, type ArabicXeLatexPreambleOptions, BUTEX_BASMALA, BUTEX_CLOSING_HAMDALA, type BibliographyBlock2, type BlockSelectionRange, type BlockSelectionState, type CiteToken2, DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH, DEFAULT_HIJRI_DATE, type Document2Block, type Document2BlockJson, type Document2Diagnostic, type Document2Direction, type Document2HijriDate, type Document2HistoryStacks, type Document2Json, type Document2LabelEntry, type Document2LabelKind, type Document2LatexOptions, type Document2MathOutput, type Document2Meta, type Document2MetaProp, type Document2Node, type Document2Preview, type Document2PreviewOptions, type FloatMeta2, type FloatMetaPatch, type FormatCiteLabelOptions, HIJRI_MONTH_IDS, HIJRI_YEAR_MAX, HIJRI_YEAR_MIN, type HijriMonthId, type ImageBlock2, type ImportDocument2Options, type InlineField2, type InlineToken2, type ListBlock2, type MathIsland2, type MathObject2Json, type MathToken2, type PreviewBlock2, type PreviewInline2, type RawBlock2, type RefToken2, type Reference2, type Reference2Json, type TableBlock2, type TextBlock2, type TextToken2, addDocument2ImageBlock, addDocument2ListBlock, addDocument2ListItem, addDocument2Reference, addDocument2TableBlock, addDocument2TextBlock, applyFloatMetaPatch, arabicXeLatexPreambleCmd, arabicXeLatexPreambleFont, arabicXeLatexPreamblePkg, bibliographyEntryLatex, butexDiwaniDisplayLatex, butexDiwaniDisplayTex, citeTokenLatex, cloneDocument2Meta, cloneDocument2Node, collectDocument2Labels, createDocument2History, createEmptyArabicEquationSession, createEmptyDocument2, createEmptyEquationSession, createEmptyReference2, createInlineField2, defaultFloatMeta, detectInlineSpans2, detectMathSpans2, document2HasAbstract, document2HasMaketitle, document2HasTitleStack, document2HistoryCanRedo, document2HistoryCanUndo, document2Latex, document2Preview, emptyBlockSelection, emptyDocument2Meta, ensureDocument2BibliographyBlock, extendBlockSelectionFromAnchor, fillDocument2MetaGaps, findFirstInlineField, formatBibliographyNumber, formatCiteLabel, formatHijriDate, formatRefLabel, fromDocumentJson2, getArabicXeLatexPreamble, hijriMonthLabel, inlineFieldLatex, insertCiteTokenAtCaret, insertDocument2BlockAfter, insertMathToken, insertMathTokenAtCaret, insertRefTokenAtCaret, labelNumberMap, mathNodeFromArabicSession, mathNodeFromSession, mathSourceFromArabicSession, mathSourceFromSession, mathTokenSourceForSide, mathTokenToArabicEditorSession, mathTokenToEditorSession, mergeDocument2Meta, moveDocument2BlockById, moveDocument2BlockRange, moveDocument2Reference, normalizeBlockSelection, normalizeDocument2HijriDate, normalizeDocument2Meta, parseCiteKeys, parseFloatMetaFromJson, parseRefKeys, pushDocument2Snapshot, refTokenLatex, referenceFromJson, referenceNumberMap, remapSelectionAfterRangeMove, removeCiteTokenById, removeDocument2BlockById, removeDocument2BlockRange, removeDocument2ListItem, removeDocument2Reference, removeMathTokenById, removeRefTokenById, replaceMathTokenFromSession, resolveCiteNumbers, restoreDocument2Redo, restoreDocument2Undo, setDocument2References, stripDisplayMathDelimiters, toggleBlockInSelection, updateCiteTokenKeys, updateDocument2ImageMeta, updateDocument2ImageValue, updateDocument2Meta, updateDocument2Reference, updateDocument2TableMeta, updateDocument2TextBlockCentered, updateMathTokenLabel, updateRefTokenKeys, updateTextToken };
|
|
678
|
+
export { type ArabicDigitsMapping, type ArabicXeLatexPreambleOptions, BUTEX_BASMALA, BUTEX_BASMALA_LINE1, BUTEX_BASMALA_SALAWAT, BUTEX_CLOSING_HAMDALA, type BibliographyBlock2, type BlockSelectionRange, type BlockSelectionState, type CiteToken2, DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH, DEFAULT_HIJRI_DATE, type Document2Block, type Document2BlockJson, type Document2Diagnostic, type Document2Direction, type Document2HijriDate, type Document2HistoryStacks, type Document2Json, type Document2LabelEntry, type Document2LabelKind, type Document2LatexOptions, type Document2MathOutput, type Document2Meta, type Document2MetaProp, type Document2Node, type Document2Preview, type Document2PreviewOptions, type FloatMeta2, type FloatMetaPatch, type FormatCiteLabelOptions, HIJRI_MONTH_IDS, HIJRI_YEAR_MAX, HIJRI_YEAR_MIN, type HijriMonthId, type ImageBlock2, type ImportDocument2Options, type InlineField2, type InlineToken2, type ListBlock2, type MathIsland2, type MathObject2Json, type MathToken2, type PreviewBlock2, type PreviewInline2, type RawBlock2, type RefToken2, type Reference2, type Reference2Json, type TableBlock2, type TextBlock2, type TextToken2, addDocument2ImageBlock, addDocument2ListBlock, addDocument2ListItem, addDocument2Reference, addDocument2TableBlock, addDocument2TextBlock, applyFloatMetaPatch, arabicXeLatexPreambleCmd, arabicXeLatexPreambleFont, arabicXeLatexPreamblePkg, bibliographyEntryLatex, butexBasmalaDisplayLatex, butexBasmalaDisplayTex, butexBasmalaTitlingPreamble, butexDiwaniDisplayLatex, butexDiwaniDisplayTex, citeTokenLatex, cloneDocument2Meta, cloneDocument2Node, collectDocument2Labels, createDocument2History, createEmptyArabicEquationSession, createEmptyDocument2, createEmptyEquationSession, createEmptyReference2, createInlineField2, defaultFloatMeta, detectInlineSpans2, detectMathSpans2, document2HasAbstract, document2HasMaketitle, document2HasTitleStack, document2HistoryCanRedo, document2HistoryCanUndo, document2Latex, document2Preview, emptyBlockSelection, emptyDocument2Meta, ensureDocument2BibliographyBlock, extendBlockSelectionFromAnchor, fillDocument2MetaGaps, findFirstInlineField, formatBibliographyNumber, formatCiteLabel, formatHijriDate, formatRefLabel, fromDocumentJson2, getArabicXeLatexPreamble, hijriMonthLabel, inlineFieldLatex, insertCiteTokenAtCaret, insertDocument2BlockAfter, insertMathToken, insertMathTokenAtCaret, insertRefTokenAtCaret, labelNumberMap, mathNodeFromArabicSession, mathNodeFromSession, mathSourceFromArabicSession, mathSourceFromSession, mathTokenSourceForSide, mathTokenToArabicEditorSession, mathTokenToEditorSession, mergeDocument2Meta, moveDocument2BlockById, moveDocument2BlockRange, moveDocument2Reference, normalizeBlockSelection, normalizeDocument2HijriDate, normalizeDocument2Meta, parseCiteKeys, parseFloatMetaFromJson, parseRefKeys, pushDocument2Snapshot, refTokenLatex, referenceFromJson, referenceNumberMap, remapSelectionAfterRangeMove, removeCiteTokenById, removeDocument2BlockById, removeDocument2BlockRange, removeDocument2ListItem, removeDocument2Reference, removeMathTokenById, removeRefTokenById, replaceMathTokenFromSession, resolveCiteNumbers, restoreDocument2Redo, restoreDocument2Undo, setDocument2References, stripDisplayMathDelimiters, toggleBlockInSelection, updateCiteTokenKeys, updateDocument2ImageMeta, updateDocument2ImageValue, updateDocument2Meta, updateDocument2Reference, updateDocument2TableMeta, updateDocument2TextBlockCentered, updateMathTokenLabel, updateRefTokenKeys, updateTextToken };
|
package/dist/document2.js
CHANGED
|
@@ -21,6 +21,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var document2_exports = {};
|
|
22
22
|
__export(document2_exports, {
|
|
23
23
|
BUTEX_BASMALA: () => BUTEX_BASMALA,
|
|
24
|
+
BUTEX_BASMALA_LINE1: () => BUTEX_BASMALA_LINE1,
|
|
25
|
+
BUTEX_BASMALA_SALAWAT: () => BUTEX_BASMALA_SALAWAT,
|
|
24
26
|
BUTEX_CLOSING_HAMDALA: () => BUTEX_CLOSING_HAMDALA,
|
|
25
27
|
DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH: () => DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH,
|
|
26
28
|
DEFAULT_HIJRI_DATE: () => DEFAULT_HIJRI_DATE,
|
|
@@ -38,6 +40,9 @@ __export(document2_exports, {
|
|
|
38
40
|
arabicXeLatexPreambleFont: () => arabicXeLatexPreambleFont,
|
|
39
41
|
arabicXeLatexPreamblePkg: () => arabicXeLatexPreamblePkg,
|
|
40
42
|
bibliographyEntryLatex: () => bibliographyEntryLatex,
|
|
43
|
+
butexBasmalaDisplayLatex: () => butexBasmalaDisplayLatex,
|
|
44
|
+
butexBasmalaDisplayTex: () => butexBasmalaDisplayTex,
|
|
45
|
+
butexBasmalaTitlingPreamble: () => butexBasmalaTitlingPreamble,
|
|
41
46
|
butexDiwaniDisplayLatex: () => butexDiwaniDisplayLatex,
|
|
42
47
|
butexDiwaniDisplayTex: () => butexDiwaniDisplayTex,
|
|
43
48
|
citeTokenLatex: () => citeTokenLatex,
|
|
@@ -166,7 +171,10 @@ function formatDigits(value, digitForm = "western") {
|
|
|
166
171
|
}
|
|
167
172
|
|
|
168
173
|
// src/document2/articleMeta.ts
|
|
169
|
-
var
|
|
174
|
+
var BUTEX_BASMALA_LINE1 = "\u0628\u0650\u0633\u0652\u0645\u0650 \u0627\u0644\u0644\u064E\u0651\u0647\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0652\u0645\u064E\u0670\u0646\u0650 \u0627\u0644\u0631\u064E\u0651\u062D\u0650\u064A\u0645\u0650";
|
|
175
|
+
var BUTEX_BASMALA_SALAWAT = "\u0635\u064E\u0644\u064E\u0651\u0649 \u0627\u0644\u0644\u064E\u0651\u0647\u064F \u0639\u064E\u0644\u064E\u064A\u0652\u0647\u0650 \u0648\u064E\u0633\u064E\u0644\u064E\u0651\u0645\u064E";
|
|
176
|
+
var BUTEX_BASMALA = `${BUTEX_BASMALA_LINE1}
|
|
177
|
+
${BUTEX_BASMALA_SALAWAT}`;
|
|
170
178
|
var BUTEX_CLOSING_HAMDALA = "\u0627\u0644\u0652\u062D\u064E\u0645\u0652\u062F\u064F \u0644\u0650\u0644\u064E\u0651\u0647\u0650 \u0646\u064E\u0641\u064E\u0639\u064E\u0646\u064E\u0627 \u0628\u0650\u0639\u0650\u0644\u0652\u0645\u0650\u0647\u0650";
|
|
171
179
|
function escapeButexTextArg(text) {
|
|
172
180
|
return text.replace(/\\/g, "\\textbackslash{}").replace(/[{}]/g, "\\$&");
|
|
@@ -179,6 +187,27 @@ function butexDiwaniDisplayLatex(text) {
|
|
|
179
187
|
${butexDiwaniDisplayTex(text)}
|
|
180
188
|
\\]`;
|
|
181
189
|
}
|
|
190
|
+
function butexBasmalaDisplayTex() {
|
|
191
|
+
return `${butexDiwaniDisplayTex(BUTEX_BASMALA_LINE1)} \\\\ ${butexDiwaniDisplayTex(BUTEX_BASMALA_SALAWAT)}`;
|
|
192
|
+
}
|
|
193
|
+
function butexBasmalaDisplayLatex() {
|
|
194
|
+
return `\\[
|
|
195
|
+
${butexBasmalaDisplayTex()}
|
|
196
|
+
\\]`;
|
|
197
|
+
}
|
|
198
|
+
function butexBasmalaTitlingPreamble() {
|
|
199
|
+
return [
|
|
200
|
+
"\\usepackage{titling}",
|
|
201
|
+
"\\pretitle{%",
|
|
202
|
+
" \\begin{center}",
|
|
203
|
+
` ${butexDiwaniDisplayTex(BUTEX_BASMALA_LINE1)}\\\\`,
|
|
204
|
+
` ${butexDiwaniDisplayTex(BUTEX_BASMALA_SALAWAT)}`,
|
|
205
|
+
" \\par\\vspace{1.5em}",
|
|
206
|
+
" \\LARGE",
|
|
207
|
+
"}",
|
|
208
|
+
"\\posttitle{\\par\\end{center}}"
|
|
209
|
+
].join("\n");
|
|
210
|
+
}
|
|
182
211
|
var HIJRI_YEAR_MIN = 1400;
|
|
183
212
|
var HIJRI_YEAR_MAX = 1500;
|
|
184
213
|
var HIJRI_MONTH_IDS = [
|
|
@@ -4379,7 +4408,7 @@ function updateDocument2Meta(document2, patch) {
|
|
|
4379
4408
|
|
|
4380
4409
|
// src/document2/arabicPreamble.ts
|
|
4381
4410
|
function arabicXeLatexPreamblePkg(twocolumn = false) {
|
|
4382
|
-
const classOptions = twocolumn ? "12pt,a4paper,twocolumn" : "12pt,a4paper";
|
|
4411
|
+
const classOptions = twocolumn ? "12pt,a4paper,notitlepage,twocolumn" : "12pt,a4paper,notitlepage";
|
|
4383
4412
|
return `
|
|
4384
4413
|
\\documentclass[${classOptions}]{article}
|
|
4385
4414
|
` + String.raw`\usepackage{amsmath,amsfonts,amssymb,mathrsfs,tikz,fancyhdr, mathtools}
|
|
@@ -4701,17 +4730,26 @@ ${block.closing}`;
|
|
|
4701
4730
|
function authorLatex(authors) {
|
|
4702
4731
|
return authors.split(/\n+/).map((line) => line.trim()).filter((line) => line.length > 0).join(" \\\\ ");
|
|
4703
4732
|
}
|
|
4733
|
+
function articleMaketitlePreamble(meta) {
|
|
4734
|
+
if (!document2HasMaketitle(meta)) {
|
|
4735
|
+
return "";
|
|
4736
|
+
}
|
|
4737
|
+
const parts = [butexBasmalaTitlingPreamble()];
|
|
4738
|
+
if (meta.title.trim().length > 0) {
|
|
4739
|
+
parts.push(`\\title{${meta.title.trim()}}`);
|
|
4740
|
+
}
|
|
4741
|
+
if (meta.authors.trim().length > 0) {
|
|
4742
|
+
parts.push(`\\author{${authorLatex(meta.authors)}}`);
|
|
4743
|
+
}
|
|
4744
|
+
parts.push(`\\date{${formatHijriDate(meta.date, { locale: "ar", digitForm: "arabicIndic" })}}`);
|
|
4745
|
+
return parts.join("\n");
|
|
4746
|
+
}
|
|
4704
4747
|
function articleFrontMatterLatex(meta) {
|
|
4705
|
-
const parts = [
|
|
4748
|
+
const parts = [];
|
|
4706
4749
|
if (document2HasMaketitle(meta)) {
|
|
4707
|
-
if (meta.title.trim().length > 0) {
|
|
4708
|
-
parts.push(`\\title{${meta.title.trim()}}`);
|
|
4709
|
-
}
|
|
4710
|
-
if (meta.authors.trim().length > 0) {
|
|
4711
|
-
parts.push(`\\author{${authorLatex(meta.authors)}}`);
|
|
4712
|
-
}
|
|
4713
|
-
parts.push(`\\date{${formatHijriDate(meta.date, { locale: "ar", digitForm: "arabicIndic" })}}`);
|
|
4714
4750
|
parts.push("\\maketitle");
|
|
4751
|
+
} else {
|
|
4752
|
+
parts.push(butexBasmalaDisplayLatex());
|
|
4715
4753
|
}
|
|
4716
4754
|
if (document2HasAbstract(meta)) {
|
|
4717
4755
|
parts.push(`\\begin{abstract}
|
|
@@ -4728,12 +4766,15 @@ function document2Latex(document2, options = {}) {
|
|
|
4728
4766
|
const body = [...front, ...bodyBlocks, closing].filter((part) => part.length > 0).join("\n\n");
|
|
4729
4767
|
const wrapDocument = options.wrapDocument !== false;
|
|
4730
4768
|
if (!wrapDocument) {
|
|
4731
|
-
|
|
4769
|
+
const metaPreamble = articleMaketitlePreamble(meta);
|
|
4770
|
+
return metaPreamble.length > 0 ? `${metaPreamble}
|
|
4771
|
+
|
|
4772
|
+
${body}` : body;
|
|
4732
4773
|
}
|
|
4733
4774
|
const preamble = getArabicXeLatexPreamble({
|
|
4734
4775
|
digitsMapping: options.digitsMapping ?? "arabicdigits",
|
|
4735
4776
|
twocolumn: options.twocolumn === true
|
|
4736
|
-
});
|
|
4777
|
+
}) + "\n" + articleMaketitlePreamble(meta);
|
|
4737
4778
|
return `${preamble}
|
|
4738
4779
|
\\begin{document}
|
|
4739
4780
|
|
|
@@ -4976,7 +5017,7 @@ function blockPreview(block, islands, output, equationSide, document2, previewOp
|
|
|
4976
5017
|
function articleChromePreview(document2, uiLocale, previewOptions) {
|
|
4977
5018
|
const meta = document2.meta ?? emptyDocument2Meta();
|
|
4978
5019
|
const blocks = [
|
|
4979
|
-
{ kind: "basmala", id: "article-basmala", text: BUTEX_BASMALA, tex:
|
|
5020
|
+
{ kind: "basmala", id: "article-basmala", text: BUTEX_BASMALA, tex: butexBasmalaDisplayTex() }
|
|
4980
5021
|
];
|
|
4981
5022
|
if (document2HasMaketitle(meta)) {
|
|
4982
5023
|
blocks.push({
|
|
@@ -5015,6 +5056,8 @@ function document2Preview(document2, output = "svg", equationSide = "arabic", pr
|
|
|
5015
5056
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5016
5057
|
0 && (module.exports = {
|
|
5017
5058
|
BUTEX_BASMALA,
|
|
5059
|
+
BUTEX_BASMALA_LINE1,
|
|
5060
|
+
BUTEX_BASMALA_SALAWAT,
|
|
5018
5061
|
BUTEX_CLOSING_HAMDALA,
|
|
5019
5062
|
DEFAULT_DOCUMENT2_HISTORY_MAX_DEPTH,
|
|
5020
5063
|
DEFAULT_HIJRI_DATE,
|
|
@@ -5032,6 +5075,9 @@ function document2Preview(document2, output = "svg", equationSide = "arabic", pr
|
|
|
5032
5075
|
arabicXeLatexPreambleFont,
|
|
5033
5076
|
arabicXeLatexPreamblePkg,
|
|
5034
5077
|
bibliographyEntryLatex,
|
|
5078
|
+
butexBasmalaDisplayLatex,
|
|
5079
|
+
butexBasmalaDisplayTex,
|
|
5080
|
+
butexBasmalaTitlingPreamble,
|
|
5035
5081
|
butexDiwaniDisplayLatex,
|
|
5036
5082
|
butexDiwaniDisplayTex,
|
|
5037
5083
|
citeTokenLatex,
|