@drghaliasri/butex 7.2.0 → 7.2.2
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 +1 -0
- package/dist/document.d.mts +8 -0
- package/dist/document.d.ts +8 -0
- package/dist/document.js +38 -2
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +38 -2
- package/dist/document.mjs.map +1 -1
- package/dist/document2-cli.js +107 -2
- package/dist/document2-cli.js.map +1 -1
- package/dist/document2.d.mts +8 -0
- package/dist/document2.d.ts +8 -0
- package/dist/document2.js +107 -2
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +107 -2
- package/dist/document2.mjs.map +1 -1
- package/dist/index.d.mts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.global.js +109 -11
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +109 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +109 -11
- package/dist/index.mjs.map +1 -1
- package/dist/react-document.d.mts +2 -0
- package/dist/react-document.d.ts +2 -0
- package/dist/react-document.js +230 -40
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +230 -40
- package/dist/react-document.mjs.map +1 -1
- package/dist/react-document2-preview.d.mts +2 -0
- package/dist/react-document2-preview.d.ts +2 -0
- package/dist/react-document2-preview.js +91 -0
- package/dist/react-document2-preview.js.map +1 -1
- package/dist/react-document2-preview.mjs +91 -0
- package/dist/react-document2-preview.mjs.map +1 -1
- package/dist/react-document2.d.mts +8 -0
- package/dist/react-document2.d.ts +8 -0
- package/dist/react-document2.js +230 -40
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +230 -40
- package/dist/react-document2.mjs.map +1 -1
- package/dist/react.d.mts +16 -0
- package/dist/react.d.ts +16 -0
- package/dist/react.js +230 -40
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +230 -40
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -115,6 +115,10 @@ type EditorNode = {
|
|
|
115
115
|
kind: EditorNodeKind;
|
|
116
116
|
expr: string;
|
|
117
117
|
characterFont?: CharacterFontId;
|
|
118
|
+
/** Minimal upstream source identity used only while the node remains unchanged. */
|
|
119
|
+
sourceLatex?: string;
|
|
120
|
+
/** Existing editor node reused for wrapper commands that need editable content. */
|
|
121
|
+
wrapperCommand?: '\\unit' | '\\mathtt' | '\\mathbf' | '\\boldarabic';
|
|
118
122
|
superscript: EditorChain | null;
|
|
119
123
|
subscript: EditorChain | null;
|
|
120
124
|
leftDelimExpr: string;
|
|
@@ -166,6 +170,8 @@ type EditorSession = {
|
|
|
166
170
|
arabicReverseNumberTyping: boolean;
|
|
167
171
|
/** Font applied to newly typed char nodes. */
|
|
168
172
|
currentCharacterFont: CharacterFontId;
|
|
173
|
+
/** Structured command wrapper applied to newly typed chars; kept separate from fonts. */
|
|
174
|
+
currentCharacterWrapper: '\\boldarabic' | null;
|
|
169
175
|
/** Digit glyph form used for editor display and LaTeX preview output. */
|
|
170
176
|
currentDigitForm: DigitFormId;
|
|
171
177
|
caret: EditorCaret;
|
|
@@ -697,6 +703,15 @@ declare const ATOMIC_OPERATOR_COMMANDS: {
|
|
|
697
703
|
readonly title: "اللانهاية";
|
|
698
704
|
readonly svg_path: null;
|
|
699
705
|
};
|
|
706
|
+
readonly top: {
|
|
707
|
+
readonly id: "top";
|
|
708
|
+
readonly category: "operators1";
|
|
709
|
+
readonly Tex: "\\top";
|
|
710
|
+
readonly mirror: false;
|
|
711
|
+
readonly Label: "⊤";
|
|
712
|
+
readonly title: "المنقول";
|
|
713
|
+
readonly svg_path: null;
|
|
714
|
+
};
|
|
700
715
|
readonly times: {
|
|
701
716
|
readonly id: "times";
|
|
702
717
|
readonly category: "operators1";
|
|
@@ -1527,6 +1542,7 @@ declare function moveCaretVertical(session: EditorSession, direction: 'up' | 'do
|
|
|
1527
1542
|
/** One-shot: forces the next insertChar/insertNumber to start a new leaf instead of merging. No-op in split mode. */
|
|
1528
1543
|
declare function breakLeafTyping(session: EditorSession): EditorSession;
|
|
1529
1544
|
declare function setCurrentCharacterFont(session: EditorSession, fontId: CharacterFontId): EditorSession;
|
|
1545
|
+
declare function setCurrentBoldCharacterStyle(session: EditorSession): EditorSession;
|
|
1530
1546
|
declare function toggleTakweenCharacterFont(session: EditorSession): EditorSession;
|
|
1531
1547
|
declare function setCurrentDigitForm(session: EditorSession, digitForm: DigitFormId): EditorSession;
|
|
1532
1548
|
declare function insertChar(session: EditorSession, expr: string): EditorSession;
|
|
@@ -1656,6 +1672,7 @@ type EditorRuntimeApi = {
|
|
|
1656
1672
|
toggleArabicReverseNumberTyping: () => void;
|
|
1657
1673
|
toggleTakweenCharacterFont: () => void;
|
|
1658
1674
|
setCurrentCharacterFont: (fontId: CharacterFontId) => void;
|
|
1675
|
+
setCurrentBoldCharacterStyle: () => void;
|
|
1659
1676
|
setCurrentDigitForm: (digitForm: DigitFormId) => void;
|
|
1660
1677
|
insertDelimiterByKind: (kind: 'paren' | 'bracket' | 'brace' | 'vert' | 'Vert') => void;
|
|
1661
1678
|
insertFraction: () => void;
|
|
@@ -1846,6 +1863,7 @@ declare const index_sessionHasStandardCommands: typeof sessionHasStandardCommand
|
|
|
1846
1863
|
declare const index_setArabicReverseNumberTyping: typeof setArabicReverseNumberTyping;
|
|
1847
1864
|
declare const index_setArrayColumnAlignment: typeof setArrayColumnAlignment;
|
|
1848
1865
|
declare const index_setCaret: typeof setCaret;
|
|
1866
|
+
declare const index_setCurrentBoldCharacterStyle: typeof setCurrentBoldCharacterStyle;
|
|
1849
1867
|
declare const index_setCurrentCharacterFont: typeof setCurrentCharacterFont;
|
|
1850
1868
|
declare const index_setCurrentDigitForm: typeof setCurrentDigitForm;
|
|
1851
1869
|
declare const index_setExpr: typeof setExpr;
|
|
@@ -1862,7 +1880,7 @@ declare const index_toggleTakweenCharacterFont: typeof toggleTakweenCharacterFon
|
|
|
1862
1880
|
declare const index_undoRedoCanRedo: typeof undoRedoCanRedo;
|
|
1863
1881
|
declare const index_undoRedoCanUndo: typeof undoRedoCanUndo;
|
|
1864
1882
|
declare namespace index {
|
|
1865
|
-
export { index_ACCENT_COMMANDS as ACCENT_COMMANDS, index_ACCENT_CSS as ACCENT_CSS, index_ATOMIC_COMMANDS as ATOMIC_COMMANDS, index_ATOMIC_COMMAND_CSS as ATOMIC_COMMAND_CSS, index_ATOMIC_OPERATOR_COMMANDS as ATOMIC_OPERATOR_COMMANDS, index_ATOMIC_OPERATOR_COMMAND_CSS as ATOMIC_OPERATOR_COMMAND_CSS, type index_AccentCommandId as AccentCommandId, type index_AccentCommandSpec as AccentCommandSpec, type index_AccentPlacement as AccentPlacement, type index_AtomicCommandCategory as AtomicCommandCategory, type index_AtomicCommandId as AtomicCommandId, type index_AtomicCommandSpec as AtomicCommandSpec, type index_AtomicOperatorCommandCategory as AtomicOperatorCommandCategory, type index_AtomicOperatorCommandId as AtomicOperatorCommandId, type index_AtomicOperatorCommandSpec as AtomicOperatorCommandSpec, index_BUTEX_EDITOR_CSS as BUTEX_EDITOR_CSS, index_BUTEX_FRAGMENT_MIME as BUTEX_FRAGMENT_MIME, index_CHARACTER_FONT_OPTIONS as CHARACTER_FONT_OPTIONS, index_CHARACTER_FONT_SPECS as CHARACTER_FONT_SPECS, type index_CharacterFontId as CharacterFontId, type index_CharacterFontSpec as CharacterFontSpec, index_DEFAULT_UNDO_HISTORY_MAX_DEPTH as DEFAULT_UNDO_HISTORY_MAX_DEPTH, index_DELIMITER_CSS as DELIMITER_CSS, type index_DigitFormId as DigitFormId, type index_EditorCaret as EditorCaret, type index_EditorChain as EditorChain, type index_EditorDebugEntry as EditorDebugEntry, type index_EditorFragment as EditorFragment, type index_EditorNode as EditorNode, type index_EditorNodeKind as EditorNodeKind, type index_EditorRuntimeApi as EditorRuntimeApi, type index_EditorRuntimeOptions as EditorRuntimeOptions, type index_EditorSelectionRange as EditorSelectionRange, type index_EditorSession as EditorSession, type index_EditorSide as EditorSide, type index_EditorSyncMap as EditorSyncMap, type index_EditorSyncState as EditorSyncState, type index_EnvColumnAlignment as EnvColumnAlignment, index_FRAC_CSS as FRAC_CSS, type index_GridEnvName as GridEnvName, index_MATRIX_ENV_CSS as MATRIX_ENV_CSS, type index_MatrixEnvStyle as MatrixEnvStyle, index_NON_DEFAULT_CHARACTER_FONT_SPECS as NON_DEFAULT_CHARACTER_FONT_SPECS, index_OVERSET_CSS as OVERSET_CSS, index_SQRT_CSS as SQRT_CSS, index_STANDARD_COMMANDS as STANDARD_COMMANDS, index_STANDARD_COMMAND_CSS as STANDARD_COMMAND_CSS, type index_SpacingCommandSpec as SpacingCommandSpec, type index_SpacingDirection as SpacingDirection, type index_StandardCommandSpec as StandardCommandSpec, type index_StandardCommandTex as StandardCommandTex, index_UNDERSET_CSS as UNDERSET_CSS, type index_UndoRedoStacks as UndoRedoStacks, index_accentCommandIdFromTex as accentCommandIdFromTex, index_accentCommandSpec as accentCommandSpec, index_accentCommandsList as accentCommandsList, index_activeSideLabel as activeSideLabel, index_activeTreeKey as activeTreeKey, index_addMatrixColumn as addMatrixColumn, index_addMatrixRow as addMatrixRow, index_addSub as addSub, index_addSup as addSup, index_atomicCommandSpec as atomicCommandSpec, index_atomicCommandsByCategory as atomicCommandsByCategory, index_atomicOperatorCommandSpec as atomicOperatorCommandSpec, index_atomicOperatorCommandsByCategory as atomicOperatorCommandsByCategory, index_breakLeafTyping as breakLeafTyping, index_buildInitialSyncMap as buildInitialSyncMap, index_buildNodeBody as buildNodeBody, index_buildNodeScripts as buildNodeScripts, index_caretStep as caretStep, index_characterFontSpec as characterFontSpec, index_characterFontSpecByMacro as characterFontSpecByMacro, index_clearSelection as clearSelection, index_cloneEditorSession as cloneEditorSession, index_collectCaretPositions as collectCaretPositions, index_copySelection as copySelection, index_coveredNodeIds as coveredNodeIds, index_createAccentNode as createAccentNode, index_createAtomicCommandNode as createAtomicCommandNode, index_createAtomicOperatorCommandNode as createAtomicOperatorCommandNode, index_createDelimiterNode as createDelimiterNode, index_createEditorChain as createEditorChain, index_createEditorNode as createEditorNode, index_createEditorRuntime as createEditorRuntime, index_createEditorSession as createEditorSession, index_createFracNode as createFracNode, index_createGridEnvNode as createGridEnvNode, index_createMatrixEnvNode as createMatrixEnvNode, index_createOversetNode as createOversetNode, index_createSqrtNode as createSqrtNode, index_createStarterSession as createStarterSession, index_createUndersetNode as createUndersetNode, index_createUndoRedoStacks as createUndoRedoStacks, index_cutSelection as cutSelection, index_deleteBackward as deleteBackward, index_deleteForward as deleteForward, index_deleteStructure as deleteStructure, index_deserializeFragment as deserializeFragment, index_extendSelectionByStep as extendSelectionByStep, index_findChainById as findChainById, index_findNodeById as findNodeById, index_formatDigits as formatDigits, index_fragmentToPlainText as fragmentToPlainText, index_horizontalCaretDelta as horizontalCaretDelta, index_injectBuTeXEditorStyles as injectBuTeXEditorStyles, index_insertAccent as insertAccent, index_insertAccentPair as insertAccentPair, index_insertAlignedEnv as insertAlignedEnv, index_insertArrayEnv as insertArrayEnv, index_insertAtomicCommand as insertAtomicCommand, index_insertAtomicOperatorCommand as insertAtomicOperatorCommand, index_insertChar as insertChar, index_insertDelimiterPair as insertDelimiterPair, index_insertDivideOperator as insertDivideOperator, index_insertFirstDerivative as insertFirstDerivative, index_insertFraction as insertFraction, index_insertLimitsSeriesTemplate as insertLimitsSeriesTemplate, index_insertMatrixEnv as insertMatrixEnv, index_insertNumber as insertNumber, index_insertOperator as insertOperator, index_insertOverset as insertOverset, index_insertSecondDerivative as insertSecondDerivative, index_insertSqrt as insertSqrt, index_insertUnderset as insertUnderset, index_isSelectionActive as isSelectionActive, index_isSpacingCommandSpec as isSpacingCommandSpec, index_isStandardCommandTex as isStandardCommandTex, index_mirrorBuTeXOperatorsInTex as mirrorBuTeXOperatorsInTex, index_moveCaret as moveCaret, index_moveCaretHorizontal as moveCaretHorizontal, index_moveCaretVertical as moveCaretVertical, index_nodeChildChains as nodeChildChains, index_normalizeSelection as normalizeSelection, index_passiveTreeKey as passiveTreeKey, index_pasteFragment as pasteFragment, index_pasteText as pasteText, index_pushUndoRedoSnapshot as pushUndoRedoSnapshot, index_regenerateFragmentIds as regenerateFragmentIds, index_removeMatrixColumn as removeMatrixColumn, index_removeMatrixRow as removeMatrixRow, index_removeSub as removeSub, index_removeSup as removeSup, index_renderArabicLatexFromSession as renderArabicLatexFromSession, index_renderChainArabic as renderChainArabic, index_renderChainEnglish as renderChainEnglish, index_renderEnglishLatexFromSession as renderEnglishLatexFromSession, index_restoreRedo as restoreRedo, index_restoreUndo as restoreUndo, index_runtimeStatusText as runtimeStatusText, index_selectNode as selectNode, index_serializeSelection as serializeSelection, index_sessionHasStandardCommands as sessionHasStandardCommands, index_setArabicReverseNumberTyping as setArabicReverseNumberTyping, index_setArrayColumnAlignment as setArrayColumnAlignment, index_setCaret as setCaret, index_setCurrentCharacterFont as setCurrentCharacterFont, index_setCurrentDigitForm as setCurrentDigitForm, index_setExpr as setExpr, index_setMatrixEnvStyle as setMatrixEnvStyle, index_setRenderError as setRenderError, index_setSelectionFromMouse as setSelectionFromMouse, index_setSplitLeafTyping as setSplitLeafTyping, index_shouldMirrorOperatorDisplay as shouldMirrorOperatorDisplay, index_standardCommandSpec as standardCommandSpec, index_switchSide as switchSide, index_syncSelectionToCaret as syncSelectionToCaret, index_syncStateSummary as syncStateSummary, index_toggleTakweenCharacterFont as toggleTakweenCharacterFont, index_undoRedoCanRedo as undoRedoCanRedo, index_undoRedoCanUndo as undoRedoCanUndo };
|
|
1883
|
+
export { index_ACCENT_COMMANDS as ACCENT_COMMANDS, index_ACCENT_CSS as ACCENT_CSS, index_ATOMIC_COMMANDS as ATOMIC_COMMANDS, index_ATOMIC_COMMAND_CSS as ATOMIC_COMMAND_CSS, index_ATOMIC_OPERATOR_COMMANDS as ATOMIC_OPERATOR_COMMANDS, index_ATOMIC_OPERATOR_COMMAND_CSS as ATOMIC_OPERATOR_COMMAND_CSS, type index_AccentCommandId as AccentCommandId, type index_AccentCommandSpec as AccentCommandSpec, type index_AccentPlacement as AccentPlacement, type index_AtomicCommandCategory as AtomicCommandCategory, type index_AtomicCommandId as AtomicCommandId, type index_AtomicCommandSpec as AtomicCommandSpec, type index_AtomicOperatorCommandCategory as AtomicOperatorCommandCategory, type index_AtomicOperatorCommandId as AtomicOperatorCommandId, type index_AtomicOperatorCommandSpec as AtomicOperatorCommandSpec, index_BUTEX_EDITOR_CSS as BUTEX_EDITOR_CSS, index_BUTEX_FRAGMENT_MIME as BUTEX_FRAGMENT_MIME, index_CHARACTER_FONT_OPTIONS as CHARACTER_FONT_OPTIONS, index_CHARACTER_FONT_SPECS as CHARACTER_FONT_SPECS, type index_CharacterFontId as CharacterFontId, type index_CharacterFontSpec as CharacterFontSpec, index_DEFAULT_UNDO_HISTORY_MAX_DEPTH as DEFAULT_UNDO_HISTORY_MAX_DEPTH, index_DELIMITER_CSS as DELIMITER_CSS, type index_DigitFormId as DigitFormId, type index_EditorCaret as EditorCaret, type index_EditorChain as EditorChain, type index_EditorDebugEntry as EditorDebugEntry, type index_EditorFragment as EditorFragment, type index_EditorNode as EditorNode, type index_EditorNodeKind as EditorNodeKind, type index_EditorRuntimeApi as EditorRuntimeApi, type index_EditorRuntimeOptions as EditorRuntimeOptions, type index_EditorSelectionRange as EditorSelectionRange, type index_EditorSession as EditorSession, type index_EditorSide as EditorSide, type index_EditorSyncMap as EditorSyncMap, type index_EditorSyncState as EditorSyncState, type index_EnvColumnAlignment as EnvColumnAlignment, index_FRAC_CSS as FRAC_CSS, type index_GridEnvName as GridEnvName, index_MATRIX_ENV_CSS as MATRIX_ENV_CSS, type index_MatrixEnvStyle as MatrixEnvStyle, index_NON_DEFAULT_CHARACTER_FONT_SPECS as NON_DEFAULT_CHARACTER_FONT_SPECS, index_OVERSET_CSS as OVERSET_CSS, index_SQRT_CSS as SQRT_CSS, index_STANDARD_COMMANDS as STANDARD_COMMANDS, index_STANDARD_COMMAND_CSS as STANDARD_COMMAND_CSS, type index_SpacingCommandSpec as SpacingCommandSpec, type index_SpacingDirection as SpacingDirection, type index_StandardCommandSpec as StandardCommandSpec, type index_StandardCommandTex as StandardCommandTex, index_UNDERSET_CSS as UNDERSET_CSS, type index_UndoRedoStacks as UndoRedoStacks, index_accentCommandIdFromTex as accentCommandIdFromTex, index_accentCommandSpec as accentCommandSpec, index_accentCommandsList as accentCommandsList, index_activeSideLabel as activeSideLabel, index_activeTreeKey as activeTreeKey, index_addMatrixColumn as addMatrixColumn, index_addMatrixRow as addMatrixRow, index_addSub as addSub, index_addSup as addSup, index_atomicCommandSpec as atomicCommandSpec, index_atomicCommandsByCategory as atomicCommandsByCategory, index_atomicOperatorCommandSpec as atomicOperatorCommandSpec, index_atomicOperatorCommandsByCategory as atomicOperatorCommandsByCategory, index_breakLeafTyping as breakLeafTyping, index_buildInitialSyncMap as buildInitialSyncMap, index_buildNodeBody as buildNodeBody, index_buildNodeScripts as buildNodeScripts, index_caretStep as caretStep, index_characterFontSpec as characterFontSpec, index_characterFontSpecByMacro as characterFontSpecByMacro, index_clearSelection as clearSelection, index_cloneEditorSession as cloneEditorSession, index_collectCaretPositions as collectCaretPositions, index_copySelection as copySelection, index_coveredNodeIds as coveredNodeIds, index_createAccentNode as createAccentNode, index_createAtomicCommandNode as createAtomicCommandNode, index_createAtomicOperatorCommandNode as createAtomicOperatorCommandNode, index_createDelimiterNode as createDelimiterNode, index_createEditorChain as createEditorChain, index_createEditorNode as createEditorNode, index_createEditorRuntime as createEditorRuntime, index_createEditorSession as createEditorSession, index_createFracNode as createFracNode, index_createGridEnvNode as createGridEnvNode, index_createMatrixEnvNode as createMatrixEnvNode, index_createOversetNode as createOversetNode, index_createSqrtNode as createSqrtNode, index_createStarterSession as createStarterSession, index_createUndersetNode as createUndersetNode, index_createUndoRedoStacks as createUndoRedoStacks, index_cutSelection as cutSelection, index_deleteBackward as deleteBackward, index_deleteForward as deleteForward, index_deleteStructure as deleteStructure, index_deserializeFragment as deserializeFragment, index_extendSelectionByStep as extendSelectionByStep, index_findChainById as findChainById, index_findNodeById as findNodeById, index_formatDigits as formatDigits, index_fragmentToPlainText as fragmentToPlainText, index_horizontalCaretDelta as horizontalCaretDelta, index_injectBuTeXEditorStyles as injectBuTeXEditorStyles, index_insertAccent as insertAccent, index_insertAccentPair as insertAccentPair, index_insertAlignedEnv as insertAlignedEnv, index_insertArrayEnv as insertArrayEnv, index_insertAtomicCommand as insertAtomicCommand, index_insertAtomicOperatorCommand as insertAtomicOperatorCommand, index_insertChar as insertChar, index_insertDelimiterPair as insertDelimiterPair, index_insertDivideOperator as insertDivideOperator, index_insertFirstDerivative as insertFirstDerivative, index_insertFraction as insertFraction, index_insertLimitsSeriesTemplate as insertLimitsSeriesTemplate, index_insertMatrixEnv as insertMatrixEnv, index_insertNumber as insertNumber, index_insertOperator as insertOperator, index_insertOverset as insertOverset, index_insertSecondDerivative as insertSecondDerivative, index_insertSqrt as insertSqrt, index_insertUnderset as insertUnderset, index_isSelectionActive as isSelectionActive, index_isSpacingCommandSpec as isSpacingCommandSpec, index_isStandardCommandTex as isStandardCommandTex, index_mirrorBuTeXOperatorsInTex as mirrorBuTeXOperatorsInTex, index_moveCaret as moveCaret, index_moveCaretHorizontal as moveCaretHorizontal, index_moveCaretVertical as moveCaretVertical, index_nodeChildChains as nodeChildChains, index_normalizeSelection as normalizeSelection, index_passiveTreeKey as passiveTreeKey, index_pasteFragment as pasteFragment, index_pasteText as pasteText, index_pushUndoRedoSnapshot as pushUndoRedoSnapshot, index_regenerateFragmentIds as regenerateFragmentIds, index_removeMatrixColumn as removeMatrixColumn, index_removeMatrixRow as removeMatrixRow, index_removeSub as removeSub, index_removeSup as removeSup, index_renderArabicLatexFromSession as renderArabicLatexFromSession, index_renderChainArabic as renderChainArabic, index_renderChainEnglish as renderChainEnglish, index_renderEnglishLatexFromSession as renderEnglishLatexFromSession, index_restoreRedo as restoreRedo, index_restoreUndo as restoreUndo, index_runtimeStatusText as runtimeStatusText, index_selectNode as selectNode, index_serializeSelection as serializeSelection, index_sessionHasStandardCommands as sessionHasStandardCommands, index_setArabicReverseNumberTyping as setArabicReverseNumberTyping, index_setArrayColumnAlignment as setArrayColumnAlignment, index_setCaret as setCaret, index_setCurrentBoldCharacterStyle as setCurrentBoldCharacterStyle, index_setCurrentCharacterFont as setCurrentCharacterFont, index_setCurrentDigitForm as setCurrentDigitForm, index_setExpr as setExpr, index_setMatrixEnvStyle as setMatrixEnvStyle, index_setRenderError as setRenderError, index_setSelectionFromMouse as setSelectionFromMouse, index_setSplitLeafTyping as setSplitLeafTyping, index_shouldMirrorOperatorDisplay as shouldMirrorOperatorDisplay, index_standardCommandSpec as standardCommandSpec, index_switchSide as switchSide, index_syncSelectionToCaret as syncSelectionToCaret, index_syncStateSummary as syncStateSummary, index_toggleTakweenCharacterFont as toggleTakweenCharacterFont, index_undoRedoCanRedo as undoRedoCanRedo, index_undoRedoCanUndo as undoRedoCanUndo };
|
|
1866
1884
|
}
|
|
1867
1885
|
|
|
1868
1886
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -115,6 +115,10 @@ type EditorNode = {
|
|
|
115
115
|
kind: EditorNodeKind;
|
|
116
116
|
expr: string;
|
|
117
117
|
characterFont?: CharacterFontId;
|
|
118
|
+
/** Minimal upstream source identity used only while the node remains unchanged. */
|
|
119
|
+
sourceLatex?: string;
|
|
120
|
+
/** Existing editor node reused for wrapper commands that need editable content. */
|
|
121
|
+
wrapperCommand?: '\\unit' | '\\mathtt' | '\\mathbf' | '\\boldarabic';
|
|
118
122
|
superscript: EditorChain | null;
|
|
119
123
|
subscript: EditorChain | null;
|
|
120
124
|
leftDelimExpr: string;
|
|
@@ -166,6 +170,8 @@ type EditorSession = {
|
|
|
166
170
|
arabicReverseNumberTyping: boolean;
|
|
167
171
|
/** Font applied to newly typed char nodes. */
|
|
168
172
|
currentCharacterFont: CharacterFontId;
|
|
173
|
+
/** Structured command wrapper applied to newly typed chars; kept separate from fonts. */
|
|
174
|
+
currentCharacterWrapper: '\\boldarabic' | null;
|
|
169
175
|
/** Digit glyph form used for editor display and LaTeX preview output. */
|
|
170
176
|
currentDigitForm: DigitFormId;
|
|
171
177
|
caret: EditorCaret;
|
|
@@ -697,6 +703,15 @@ declare const ATOMIC_OPERATOR_COMMANDS: {
|
|
|
697
703
|
readonly title: "اللانهاية";
|
|
698
704
|
readonly svg_path: null;
|
|
699
705
|
};
|
|
706
|
+
readonly top: {
|
|
707
|
+
readonly id: "top";
|
|
708
|
+
readonly category: "operators1";
|
|
709
|
+
readonly Tex: "\\top";
|
|
710
|
+
readonly mirror: false;
|
|
711
|
+
readonly Label: "⊤";
|
|
712
|
+
readonly title: "المنقول";
|
|
713
|
+
readonly svg_path: null;
|
|
714
|
+
};
|
|
700
715
|
readonly times: {
|
|
701
716
|
readonly id: "times";
|
|
702
717
|
readonly category: "operators1";
|
|
@@ -1527,6 +1542,7 @@ declare function moveCaretVertical(session: EditorSession, direction: 'up' | 'do
|
|
|
1527
1542
|
/** One-shot: forces the next insertChar/insertNumber to start a new leaf instead of merging. No-op in split mode. */
|
|
1528
1543
|
declare function breakLeafTyping(session: EditorSession): EditorSession;
|
|
1529
1544
|
declare function setCurrentCharacterFont(session: EditorSession, fontId: CharacterFontId): EditorSession;
|
|
1545
|
+
declare function setCurrentBoldCharacterStyle(session: EditorSession): EditorSession;
|
|
1530
1546
|
declare function toggleTakweenCharacterFont(session: EditorSession): EditorSession;
|
|
1531
1547
|
declare function setCurrentDigitForm(session: EditorSession, digitForm: DigitFormId): EditorSession;
|
|
1532
1548
|
declare function insertChar(session: EditorSession, expr: string): EditorSession;
|
|
@@ -1656,6 +1672,7 @@ type EditorRuntimeApi = {
|
|
|
1656
1672
|
toggleArabicReverseNumberTyping: () => void;
|
|
1657
1673
|
toggleTakweenCharacterFont: () => void;
|
|
1658
1674
|
setCurrentCharacterFont: (fontId: CharacterFontId) => void;
|
|
1675
|
+
setCurrentBoldCharacterStyle: () => void;
|
|
1659
1676
|
setCurrentDigitForm: (digitForm: DigitFormId) => void;
|
|
1660
1677
|
insertDelimiterByKind: (kind: 'paren' | 'bracket' | 'brace' | 'vert' | 'Vert') => void;
|
|
1661
1678
|
insertFraction: () => void;
|
|
@@ -1846,6 +1863,7 @@ declare const index_sessionHasStandardCommands: typeof sessionHasStandardCommand
|
|
|
1846
1863
|
declare const index_setArabicReverseNumberTyping: typeof setArabicReverseNumberTyping;
|
|
1847
1864
|
declare const index_setArrayColumnAlignment: typeof setArrayColumnAlignment;
|
|
1848
1865
|
declare const index_setCaret: typeof setCaret;
|
|
1866
|
+
declare const index_setCurrentBoldCharacterStyle: typeof setCurrentBoldCharacterStyle;
|
|
1849
1867
|
declare const index_setCurrentCharacterFont: typeof setCurrentCharacterFont;
|
|
1850
1868
|
declare const index_setCurrentDigitForm: typeof setCurrentDigitForm;
|
|
1851
1869
|
declare const index_setExpr: typeof setExpr;
|
|
@@ -1862,7 +1880,7 @@ declare const index_toggleTakweenCharacterFont: typeof toggleTakweenCharacterFon
|
|
|
1862
1880
|
declare const index_undoRedoCanRedo: typeof undoRedoCanRedo;
|
|
1863
1881
|
declare const index_undoRedoCanUndo: typeof undoRedoCanUndo;
|
|
1864
1882
|
declare namespace index {
|
|
1865
|
-
export { index_ACCENT_COMMANDS as ACCENT_COMMANDS, index_ACCENT_CSS as ACCENT_CSS, index_ATOMIC_COMMANDS as ATOMIC_COMMANDS, index_ATOMIC_COMMAND_CSS as ATOMIC_COMMAND_CSS, index_ATOMIC_OPERATOR_COMMANDS as ATOMIC_OPERATOR_COMMANDS, index_ATOMIC_OPERATOR_COMMAND_CSS as ATOMIC_OPERATOR_COMMAND_CSS, type index_AccentCommandId as AccentCommandId, type index_AccentCommandSpec as AccentCommandSpec, type index_AccentPlacement as AccentPlacement, type index_AtomicCommandCategory as AtomicCommandCategory, type index_AtomicCommandId as AtomicCommandId, type index_AtomicCommandSpec as AtomicCommandSpec, type index_AtomicOperatorCommandCategory as AtomicOperatorCommandCategory, type index_AtomicOperatorCommandId as AtomicOperatorCommandId, type index_AtomicOperatorCommandSpec as AtomicOperatorCommandSpec, index_BUTEX_EDITOR_CSS as BUTEX_EDITOR_CSS, index_BUTEX_FRAGMENT_MIME as BUTEX_FRAGMENT_MIME, index_CHARACTER_FONT_OPTIONS as CHARACTER_FONT_OPTIONS, index_CHARACTER_FONT_SPECS as CHARACTER_FONT_SPECS, type index_CharacterFontId as CharacterFontId, type index_CharacterFontSpec as CharacterFontSpec, index_DEFAULT_UNDO_HISTORY_MAX_DEPTH as DEFAULT_UNDO_HISTORY_MAX_DEPTH, index_DELIMITER_CSS as DELIMITER_CSS, type index_DigitFormId as DigitFormId, type index_EditorCaret as EditorCaret, type index_EditorChain as EditorChain, type index_EditorDebugEntry as EditorDebugEntry, type index_EditorFragment as EditorFragment, type index_EditorNode as EditorNode, type index_EditorNodeKind as EditorNodeKind, type index_EditorRuntimeApi as EditorRuntimeApi, type index_EditorRuntimeOptions as EditorRuntimeOptions, type index_EditorSelectionRange as EditorSelectionRange, type index_EditorSession as EditorSession, type index_EditorSide as EditorSide, type index_EditorSyncMap as EditorSyncMap, type index_EditorSyncState as EditorSyncState, type index_EnvColumnAlignment as EnvColumnAlignment, index_FRAC_CSS as FRAC_CSS, type index_GridEnvName as GridEnvName, index_MATRIX_ENV_CSS as MATRIX_ENV_CSS, type index_MatrixEnvStyle as MatrixEnvStyle, index_NON_DEFAULT_CHARACTER_FONT_SPECS as NON_DEFAULT_CHARACTER_FONT_SPECS, index_OVERSET_CSS as OVERSET_CSS, index_SQRT_CSS as SQRT_CSS, index_STANDARD_COMMANDS as STANDARD_COMMANDS, index_STANDARD_COMMAND_CSS as STANDARD_COMMAND_CSS, type index_SpacingCommandSpec as SpacingCommandSpec, type index_SpacingDirection as SpacingDirection, type index_StandardCommandSpec as StandardCommandSpec, type index_StandardCommandTex as StandardCommandTex, index_UNDERSET_CSS as UNDERSET_CSS, type index_UndoRedoStacks as UndoRedoStacks, index_accentCommandIdFromTex as accentCommandIdFromTex, index_accentCommandSpec as accentCommandSpec, index_accentCommandsList as accentCommandsList, index_activeSideLabel as activeSideLabel, index_activeTreeKey as activeTreeKey, index_addMatrixColumn as addMatrixColumn, index_addMatrixRow as addMatrixRow, index_addSub as addSub, index_addSup as addSup, index_atomicCommandSpec as atomicCommandSpec, index_atomicCommandsByCategory as atomicCommandsByCategory, index_atomicOperatorCommandSpec as atomicOperatorCommandSpec, index_atomicOperatorCommandsByCategory as atomicOperatorCommandsByCategory, index_breakLeafTyping as breakLeafTyping, index_buildInitialSyncMap as buildInitialSyncMap, index_buildNodeBody as buildNodeBody, index_buildNodeScripts as buildNodeScripts, index_caretStep as caretStep, index_characterFontSpec as characterFontSpec, index_characterFontSpecByMacro as characterFontSpecByMacro, index_clearSelection as clearSelection, index_cloneEditorSession as cloneEditorSession, index_collectCaretPositions as collectCaretPositions, index_copySelection as copySelection, index_coveredNodeIds as coveredNodeIds, index_createAccentNode as createAccentNode, index_createAtomicCommandNode as createAtomicCommandNode, index_createAtomicOperatorCommandNode as createAtomicOperatorCommandNode, index_createDelimiterNode as createDelimiterNode, index_createEditorChain as createEditorChain, index_createEditorNode as createEditorNode, index_createEditorRuntime as createEditorRuntime, index_createEditorSession as createEditorSession, index_createFracNode as createFracNode, index_createGridEnvNode as createGridEnvNode, index_createMatrixEnvNode as createMatrixEnvNode, index_createOversetNode as createOversetNode, index_createSqrtNode as createSqrtNode, index_createStarterSession as createStarterSession, index_createUndersetNode as createUndersetNode, index_createUndoRedoStacks as createUndoRedoStacks, index_cutSelection as cutSelection, index_deleteBackward as deleteBackward, index_deleteForward as deleteForward, index_deleteStructure as deleteStructure, index_deserializeFragment as deserializeFragment, index_extendSelectionByStep as extendSelectionByStep, index_findChainById as findChainById, index_findNodeById as findNodeById, index_formatDigits as formatDigits, index_fragmentToPlainText as fragmentToPlainText, index_horizontalCaretDelta as horizontalCaretDelta, index_injectBuTeXEditorStyles as injectBuTeXEditorStyles, index_insertAccent as insertAccent, index_insertAccentPair as insertAccentPair, index_insertAlignedEnv as insertAlignedEnv, index_insertArrayEnv as insertArrayEnv, index_insertAtomicCommand as insertAtomicCommand, index_insertAtomicOperatorCommand as insertAtomicOperatorCommand, index_insertChar as insertChar, index_insertDelimiterPair as insertDelimiterPair, index_insertDivideOperator as insertDivideOperator, index_insertFirstDerivative as insertFirstDerivative, index_insertFraction as insertFraction, index_insertLimitsSeriesTemplate as insertLimitsSeriesTemplate, index_insertMatrixEnv as insertMatrixEnv, index_insertNumber as insertNumber, index_insertOperator as insertOperator, index_insertOverset as insertOverset, index_insertSecondDerivative as insertSecondDerivative, index_insertSqrt as insertSqrt, index_insertUnderset as insertUnderset, index_isSelectionActive as isSelectionActive, index_isSpacingCommandSpec as isSpacingCommandSpec, index_isStandardCommandTex as isStandardCommandTex, index_mirrorBuTeXOperatorsInTex as mirrorBuTeXOperatorsInTex, index_moveCaret as moveCaret, index_moveCaretHorizontal as moveCaretHorizontal, index_moveCaretVertical as moveCaretVertical, index_nodeChildChains as nodeChildChains, index_normalizeSelection as normalizeSelection, index_passiveTreeKey as passiveTreeKey, index_pasteFragment as pasteFragment, index_pasteText as pasteText, index_pushUndoRedoSnapshot as pushUndoRedoSnapshot, index_regenerateFragmentIds as regenerateFragmentIds, index_removeMatrixColumn as removeMatrixColumn, index_removeMatrixRow as removeMatrixRow, index_removeSub as removeSub, index_removeSup as removeSup, index_renderArabicLatexFromSession as renderArabicLatexFromSession, index_renderChainArabic as renderChainArabic, index_renderChainEnglish as renderChainEnglish, index_renderEnglishLatexFromSession as renderEnglishLatexFromSession, index_restoreRedo as restoreRedo, index_restoreUndo as restoreUndo, index_runtimeStatusText as runtimeStatusText, index_selectNode as selectNode, index_serializeSelection as serializeSelection, index_sessionHasStandardCommands as sessionHasStandardCommands, index_setArabicReverseNumberTyping as setArabicReverseNumberTyping, index_setArrayColumnAlignment as setArrayColumnAlignment, index_setCaret as setCaret, index_setCurrentCharacterFont as setCurrentCharacterFont, index_setCurrentDigitForm as setCurrentDigitForm, index_setExpr as setExpr, index_setMatrixEnvStyle as setMatrixEnvStyle, index_setRenderError as setRenderError, index_setSelectionFromMouse as setSelectionFromMouse, index_setSplitLeafTyping as setSplitLeafTyping, index_shouldMirrorOperatorDisplay as shouldMirrorOperatorDisplay, index_standardCommandSpec as standardCommandSpec, index_switchSide as switchSide, index_syncSelectionToCaret as syncSelectionToCaret, index_syncStateSummary as syncStateSummary, index_toggleTakweenCharacterFont as toggleTakweenCharacterFont, index_undoRedoCanRedo as undoRedoCanRedo, index_undoRedoCanUndo as undoRedoCanUndo };
|
|
1883
|
+
export { index_ACCENT_COMMANDS as ACCENT_COMMANDS, index_ACCENT_CSS as ACCENT_CSS, index_ATOMIC_COMMANDS as ATOMIC_COMMANDS, index_ATOMIC_COMMAND_CSS as ATOMIC_COMMAND_CSS, index_ATOMIC_OPERATOR_COMMANDS as ATOMIC_OPERATOR_COMMANDS, index_ATOMIC_OPERATOR_COMMAND_CSS as ATOMIC_OPERATOR_COMMAND_CSS, type index_AccentCommandId as AccentCommandId, type index_AccentCommandSpec as AccentCommandSpec, type index_AccentPlacement as AccentPlacement, type index_AtomicCommandCategory as AtomicCommandCategory, type index_AtomicCommandId as AtomicCommandId, type index_AtomicCommandSpec as AtomicCommandSpec, type index_AtomicOperatorCommandCategory as AtomicOperatorCommandCategory, type index_AtomicOperatorCommandId as AtomicOperatorCommandId, type index_AtomicOperatorCommandSpec as AtomicOperatorCommandSpec, index_BUTEX_EDITOR_CSS as BUTEX_EDITOR_CSS, index_BUTEX_FRAGMENT_MIME as BUTEX_FRAGMENT_MIME, index_CHARACTER_FONT_OPTIONS as CHARACTER_FONT_OPTIONS, index_CHARACTER_FONT_SPECS as CHARACTER_FONT_SPECS, type index_CharacterFontId as CharacterFontId, type index_CharacterFontSpec as CharacterFontSpec, index_DEFAULT_UNDO_HISTORY_MAX_DEPTH as DEFAULT_UNDO_HISTORY_MAX_DEPTH, index_DELIMITER_CSS as DELIMITER_CSS, type index_DigitFormId as DigitFormId, type index_EditorCaret as EditorCaret, type index_EditorChain as EditorChain, type index_EditorDebugEntry as EditorDebugEntry, type index_EditorFragment as EditorFragment, type index_EditorNode as EditorNode, type index_EditorNodeKind as EditorNodeKind, type index_EditorRuntimeApi as EditorRuntimeApi, type index_EditorRuntimeOptions as EditorRuntimeOptions, type index_EditorSelectionRange as EditorSelectionRange, type index_EditorSession as EditorSession, type index_EditorSide as EditorSide, type index_EditorSyncMap as EditorSyncMap, type index_EditorSyncState as EditorSyncState, type index_EnvColumnAlignment as EnvColumnAlignment, index_FRAC_CSS as FRAC_CSS, type index_GridEnvName as GridEnvName, index_MATRIX_ENV_CSS as MATRIX_ENV_CSS, type index_MatrixEnvStyle as MatrixEnvStyle, index_NON_DEFAULT_CHARACTER_FONT_SPECS as NON_DEFAULT_CHARACTER_FONT_SPECS, index_OVERSET_CSS as OVERSET_CSS, index_SQRT_CSS as SQRT_CSS, index_STANDARD_COMMANDS as STANDARD_COMMANDS, index_STANDARD_COMMAND_CSS as STANDARD_COMMAND_CSS, type index_SpacingCommandSpec as SpacingCommandSpec, type index_SpacingDirection as SpacingDirection, type index_StandardCommandSpec as StandardCommandSpec, type index_StandardCommandTex as StandardCommandTex, index_UNDERSET_CSS as UNDERSET_CSS, type index_UndoRedoStacks as UndoRedoStacks, index_accentCommandIdFromTex as accentCommandIdFromTex, index_accentCommandSpec as accentCommandSpec, index_accentCommandsList as accentCommandsList, index_activeSideLabel as activeSideLabel, index_activeTreeKey as activeTreeKey, index_addMatrixColumn as addMatrixColumn, index_addMatrixRow as addMatrixRow, index_addSub as addSub, index_addSup as addSup, index_atomicCommandSpec as atomicCommandSpec, index_atomicCommandsByCategory as atomicCommandsByCategory, index_atomicOperatorCommandSpec as atomicOperatorCommandSpec, index_atomicOperatorCommandsByCategory as atomicOperatorCommandsByCategory, index_breakLeafTyping as breakLeafTyping, index_buildInitialSyncMap as buildInitialSyncMap, index_buildNodeBody as buildNodeBody, index_buildNodeScripts as buildNodeScripts, index_caretStep as caretStep, index_characterFontSpec as characterFontSpec, index_characterFontSpecByMacro as characterFontSpecByMacro, index_clearSelection as clearSelection, index_cloneEditorSession as cloneEditorSession, index_collectCaretPositions as collectCaretPositions, index_copySelection as copySelection, index_coveredNodeIds as coveredNodeIds, index_createAccentNode as createAccentNode, index_createAtomicCommandNode as createAtomicCommandNode, index_createAtomicOperatorCommandNode as createAtomicOperatorCommandNode, index_createDelimiterNode as createDelimiterNode, index_createEditorChain as createEditorChain, index_createEditorNode as createEditorNode, index_createEditorRuntime as createEditorRuntime, index_createEditorSession as createEditorSession, index_createFracNode as createFracNode, index_createGridEnvNode as createGridEnvNode, index_createMatrixEnvNode as createMatrixEnvNode, index_createOversetNode as createOversetNode, index_createSqrtNode as createSqrtNode, index_createStarterSession as createStarterSession, index_createUndersetNode as createUndersetNode, index_createUndoRedoStacks as createUndoRedoStacks, index_cutSelection as cutSelection, index_deleteBackward as deleteBackward, index_deleteForward as deleteForward, index_deleteStructure as deleteStructure, index_deserializeFragment as deserializeFragment, index_extendSelectionByStep as extendSelectionByStep, index_findChainById as findChainById, index_findNodeById as findNodeById, index_formatDigits as formatDigits, index_fragmentToPlainText as fragmentToPlainText, index_horizontalCaretDelta as horizontalCaretDelta, index_injectBuTeXEditorStyles as injectBuTeXEditorStyles, index_insertAccent as insertAccent, index_insertAccentPair as insertAccentPair, index_insertAlignedEnv as insertAlignedEnv, index_insertArrayEnv as insertArrayEnv, index_insertAtomicCommand as insertAtomicCommand, index_insertAtomicOperatorCommand as insertAtomicOperatorCommand, index_insertChar as insertChar, index_insertDelimiterPair as insertDelimiterPair, index_insertDivideOperator as insertDivideOperator, index_insertFirstDerivative as insertFirstDerivative, index_insertFraction as insertFraction, index_insertLimitsSeriesTemplate as insertLimitsSeriesTemplate, index_insertMatrixEnv as insertMatrixEnv, index_insertNumber as insertNumber, index_insertOperator as insertOperator, index_insertOverset as insertOverset, index_insertSecondDerivative as insertSecondDerivative, index_insertSqrt as insertSqrt, index_insertUnderset as insertUnderset, index_isSelectionActive as isSelectionActive, index_isSpacingCommandSpec as isSpacingCommandSpec, index_isStandardCommandTex as isStandardCommandTex, index_mirrorBuTeXOperatorsInTex as mirrorBuTeXOperatorsInTex, index_moveCaret as moveCaret, index_moveCaretHorizontal as moveCaretHorizontal, index_moveCaretVertical as moveCaretVertical, index_nodeChildChains as nodeChildChains, index_normalizeSelection as normalizeSelection, index_passiveTreeKey as passiveTreeKey, index_pasteFragment as pasteFragment, index_pasteText as pasteText, index_pushUndoRedoSnapshot as pushUndoRedoSnapshot, index_regenerateFragmentIds as regenerateFragmentIds, index_removeMatrixColumn as removeMatrixColumn, index_removeMatrixRow as removeMatrixRow, index_removeSub as removeSub, index_removeSup as removeSup, index_renderArabicLatexFromSession as renderArabicLatexFromSession, index_renderChainArabic as renderChainArabic, index_renderChainEnglish as renderChainEnglish, index_renderEnglishLatexFromSession as renderEnglishLatexFromSession, index_restoreRedo as restoreRedo, index_restoreUndo as restoreUndo, index_runtimeStatusText as runtimeStatusText, index_selectNode as selectNode, index_serializeSelection as serializeSelection, index_sessionHasStandardCommands as sessionHasStandardCommands, index_setArabicReverseNumberTyping as setArabicReverseNumberTyping, index_setArrayColumnAlignment as setArrayColumnAlignment, index_setCaret as setCaret, index_setCurrentBoldCharacterStyle as setCurrentBoldCharacterStyle, index_setCurrentCharacterFont as setCurrentCharacterFont, index_setCurrentDigitForm as setCurrentDigitForm, index_setExpr as setExpr, index_setMatrixEnvStyle as setMatrixEnvStyle, index_setRenderError as setRenderError, index_setSelectionFromMouse as setSelectionFromMouse, index_setSplitLeafTyping as setSplitLeafTyping, index_shouldMirrorOperatorDisplay as shouldMirrorOperatorDisplay, index_standardCommandSpec as standardCommandSpec, index_switchSide as switchSide, index_syncSelectionToCaret as syncSelectionToCaret, index_syncStateSummary as syncStateSummary, index_toggleTakweenCharacterFont as toggleTakweenCharacterFont, index_undoRedoCanRedo as undoRedoCanRedo, index_undoRedoCanUndo as undoRedoCanUndo };
|
|
1866
1884
|
}
|
|
1867
1885
|
|
|
1868
1886
|
/**
|
package/dist/index.global.js
CHANGED
|
@@ -203,6 +203,18 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
|
|
|
203
203
|
font-family: ${BUTEX_DIWANI_OUTLINE_FONT_STACK} !important;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
.butex-bold-text {
|
|
207
|
+
font-family: var(--font-display-ar, Amiri), "Noto Serif Arabic", serif;
|
|
208
|
+
font-weight: 700;
|
|
209
|
+
direction: rtl;
|
|
210
|
+
unicode-bidi: isolate;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.butex-bold-text mjx-utext {
|
|
214
|
+
font-family: var(--font-display-ar, Amiri), "Noto Serif Arabic", serif !important;
|
|
215
|
+
font-weight: 700;
|
|
216
|
+
}
|
|
217
|
+
|
|
206
218
|
.butex-takween-text {
|
|
207
219
|
font-family: ${BUTEX_TAKWEEN_FONT_STACK};
|
|
208
220
|
direction: rtl;
|
|
@@ -820,6 +832,7 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
|
|
|
820
832
|
latexFontCommand: "\\maghribi",
|
|
821
833
|
latexFontFamily: "Almaghribi Warsh Quran",
|
|
822
834
|
browserFontStack: '"Almaghribi Warsh Quran", Amiri, "Segoe UI", Tahoma, sans-serif',
|
|
835
|
+
importAliases: ["\\maghribi"],
|
|
823
836
|
svgLayoutKey: "maghribi"
|
|
824
837
|
}
|
|
825
838
|
];
|
|
@@ -849,12 +862,15 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
|
|
|
849
862
|
parser.Push(node);
|
|
850
863
|
}
|
|
851
864
|
function registerFontTextCommands(CommandMap) {
|
|
852
|
-
const mappings =
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
((
|
|
856
|
-
|
|
857
|
-
|
|
865
|
+
const mappings = {
|
|
866
|
+
boldarabic: ((parser, name) => fontText("butex-bold-text", parser, name)),
|
|
867
|
+
...Object.fromEntries(
|
|
868
|
+
NON_DEFAULT_CHARACTER_FONT_SPECS.filter((font) => font.mathJaxClass).map((font) => [
|
|
869
|
+
font.macro.replace(/^\\/, ""),
|
|
870
|
+
((parser, name) => fontText(font.mathJaxClass, parser, name))
|
|
871
|
+
])
|
|
872
|
+
)
|
|
873
|
+
};
|
|
858
874
|
new CommandMap(COMMAND_MAP5, mappings);
|
|
859
875
|
return COMMAND_MAP5;
|
|
860
876
|
}
|
|
@@ -2152,6 +2168,15 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
|
|
|
2152
2168
|
title: "\u0627\u0644\u0644\u0627\u0646\u0647\u0627\u064A\u0629",
|
|
2153
2169
|
svg_path: null
|
|
2154
2170
|
},
|
|
2171
|
+
top: {
|
|
2172
|
+
id: "top",
|
|
2173
|
+
category: "operators1",
|
|
2174
|
+
Tex: "\\top",
|
|
2175
|
+
mirror: false,
|
|
2176
|
+
Label: "\u22A4",
|
|
2177
|
+
title: "\u0627\u0644\u0645\u0646\u0642\u0648\u0644",
|
|
2178
|
+
svg_path: null
|
|
2179
|
+
},
|
|
2155
2180
|
times: {
|
|
2156
2181
|
id: "times",
|
|
2157
2182
|
category: "operators1",
|
|
@@ -2940,6 +2965,11 @@ ${BUTEX_FONT_FACE_CSS}
|
|
|
2940
2965
|
|
|
2941
2966
|
${CHARACTER_FONT_CSS}
|
|
2942
2967
|
|
|
2968
|
+
.node-value--bold {
|
|
2969
|
+
font-family: var(--font-display-ar, Amiri), "Noto Serif Arabic", serif;
|
|
2970
|
+
font-weight: 700;
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2943
2973
|
.chain {
|
|
2944
2974
|
display: inline-flex;
|
|
2945
2975
|
align-items: center;
|
|
@@ -3254,6 +3284,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3254
3284
|
setArabicReverseNumberTyping: () => setArabicReverseNumberTyping,
|
|
3255
3285
|
setArrayColumnAlignment: () => setArrayColumnAlignment,
|
|
3256
3286
|
setCaret: () => setCaret,
|
|
3287
|
+
setCurrentBoldCharacterStyle: () => setCurrentBoldCharacterStyle,
|
|
3257
3288
|
setCurrentCharacterFont: () => setCurrentCharacterFont,
|
|
3258
3289
|
setCurrentDigitForm: () => setCurrentDigitForm,
|
|
3259
3290
|
setExpr: () => setExpr,
|
|
@@ -3384,6 +3415,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3384
3415
|
forceSplitNextLeaf: session.forceSplitNextLeaf,
|
|
3385
3416
|
arabicReverseNumberTyping: session.arabicReverseNumberTyping,
|
|
3386
3417
|
currentCharacterFont: session.currentCharacterFont ?? "default",
|
|
3418
|
+
currentCharacterWrapper: session.currentCharacterWrapper ?? null,
|
|
3387
3419
|
currentDigitForm: session.currentDigitForm ?? "western",
|
|
3388
3420
|
caret: { ...session.caret },
|
|
3389
3421
|
selection: session.selection ? { ...session.selection } : null,
|
|
@@ -3456,6 +3488,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3456
3488
|
forceSplitNextLeaf: false,
|
|
3457
3489
|
arabicReverseNumberTyping: true,
|
|
3458
3490
|
currentCharacterFont: "default",
|
|
3491
|
+
currentCharacterWrapper: null,
|
|
3459
3492
|
currentDigitForm: "western",
|
|
3460
3493
|
caret: {
|
|
3461
3494
|
chainId: englishTree.id,
|
|
@@ -3658,6 +3691,14 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3658
3691
|
return `${node.expr}${latinScripts(node, options)}`;
|
|
3659
3692
|
}
|
|
3660
3693
|
if (node.kind === "char") {
|
|
3694
|
+
if (node.sourceLatex) {
|
|
3695
|
+
return `${node.sourceLatex}${latinScripts(node, options)}`;
|
|
3696
|
+
}
|
|
3697
|
+
if (node.wrapperCommand) {
|
|
3698
|
+
const expr = formatDigits(node.expr, selectedDigitForm(options));
|
|
3699
|
+
const wrapper = node.wrapperCommand === "\\boldarabic" ? "\\mathbf" : node.wrapperCommand;
|
|
3700
|
+
return `${wrapper}{${escapeText(expr)}}${latinScripts(node, options)}`;
|
|
3701
|
+
}
|
|
3661
3702
|
return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
|
|
3662
3703
|
}
|
|
3663
3704
|
if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
|
|
@@ -3711,6 +3752,10 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3711
3752
|
if (node.kind === "char") {
|
|
3712
3753
|
const expr = formatDigits(node.expr, selectedDigitForm(options));
|
|
3713
3754
|
const content = renderCharContent(node, options);
|
|
3755
|
+
if (node.wrapperCommand) {
|
|
3756
|
+
const wrapper = node.wrapperCommand === "\\mathbf" ? "\\boldarabic" : node.wrapperCommand;
|
|
3757
|
+
return arabicScripts(node, `${wrapper}{${content}}`, options);
|
|
3758
|
+
}
|
|
3714
3759
|
return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
|
|
3715
3760
|
}
|
|
3716
3761
|
if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
|
|
@@ -4557,6 +4602,16 @@ ${STANDARD_COMMAND_CSS}
|
|
|
4557
4602
|
}
|
|
4558
4603
|
session.sync[nodeId].expr = english.node.expr === arabic.node.expr ? "synced" : "diverged";
|
|
4559
4604
|
}
|
|
4605
|
+
function clearSourceIdentity(session, nodeId) {
|
|
4606
|
+
const english = findNodeById(session.englishTree, nodeId);
|
|
4607
|
+
const arabic = findNodeById(session.arabicTree, nodeId);
|
|
4608
|
+
if (english) {
|
|
4609
|
+
delete english.node.sourceLatex;
|
|
4610
|
+
}
|
|
4611
|
+
if (arabic) {
|
|
4612
|
+
delete arabic.node.sourceLatex;
|
|
4613
|
+
}
|
|
4614
|
+
}
|
|
4560
4615
|
function syncSelectionToCaret(session) {
|
|
4561
4616
|
const activeKey = activeTreeKey(session.activeSide);
|
|
4562
4617
|
const tree = session[activeKey];
|
|
@@ -5140,7 +5195,10 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5140
5195
|
const next = cloneEditorSession(session);
|
|
5141
5196
|
const englishNode = createEditorNode(kind, expr);
|
|
5142
5197
|
const arabicNode = createEditorNode(kind, expr);
|
|
5143
|
-
if (kind === "char" &&
|
|
5198
|
+
if (kind === "char" && next.currentCharacterWrapper === "\\boldarabic") {
|
|
5199
|
+
englishNode.wrapperCommand = "\\boldarabic";
|
|
5200
|
+
arabicNode.wrapperCommand = "\\boldarabic";
|
|
5201
|
+
} else if (kind === "char" && (next.currentCharacterFont ?? "default") !== "default") {
|
|
5144
5202
|
englishNode.characterFont = next.currentCharacterFont;
|
|
5145
5203
|
arabicNode.characterFont = next.currentCharacterFont;
|
|
5146
5204
|
}
|
|
@@ -5155,8 +5213,12 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5155
5213
|
function shouldReverseArabicNumber(session) {
|
|
5156
5214
|
return session.activeSide === "arabic" && session.arabicReverseNumberTyping;
|
|
5157
5215
|
}
|
|
5158
|
-
function
|
|
5159
|
-
|
|
5216
|
+
function characterTypingStyleOf(node) {
|
|
5217
|
+
if (node.kind !== "char") return "none";
|
|
5218
|
+
return node.wrapperCommand ? `wrapper:${node.wrapperCommand}` : `font:${node.characterFont ?? "default"}`;
|
|
5219
|
+
}
|
|
5220
|
+
function currentCharacterTypingStyle(session) {
|
|
5221
|
+
return session.currentCharacterWrapper ? `wrapper:${session.currentCharacterWrapper}` : `font:${session.currentCharacterFont ?? "default"}`;
|
|
5160
5222
|
}
|
|
5161
5223
|
function tryMergeLeafTyping(session, kind, fragment) {
|
|
5162
5224
|
const engLocated = findChainById(session.englishTree, session.caret.chainId);
|
|
@@ -5169,14 +5231,14 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5169
5231
|
let prepend = false;
|
|
5170
5232
|
if (i > 0) {
|
|
5171
5233
|
const prev = nodes[i - 1];
|
|
5172
|
-
if (prev.kind === kind && (kind !== "char" ||
|
|
5234
|
+
if (prev.kind === kind && (kind !== "char" || characterTypingStyleOf(prev) === currentCharacterTypingStyle(session))) {
|
|
5173
5235
|
targetId = prev.id;
|
|
5174
5236
|
prepend = false;
|
|
5175
5237
|
}
|
|
5176
5238
|
}
|
|
5177
5239
|
if (!targetId && i < nodes.length) {
|
|
5178
5240
|
const fwd = nodes[i];
|
|
5179
|
-
if (fwd.kind === kind && (kind !== "char" ||
|
|
5241
|
+
if (fwd.kind === kind && (kind !== "char" || characterTypingStyleOf(fwd) === currentCharacterTypingStyle(session))) {
|
|
5180
5242
|
targetId = fwd.id;
|
|
5181
5243
|
prepend = true;
|
|
5182
5244
|
}
|
|
@@ -5197,6 +5259,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5197
5259
|
englishHit.node.expr = `${englishHit.node.expr}${fragment}`;
|
|
5198
5260
|
arabicHit.node.expr = `${arabicHit.node.expr}${fragment}`;
|
|
5199
5261
|
}
|
|
5262
|
+
clearSourceIdentity(session, targetId);
|
|
5200
5263
|
markExprSync(session, targetId);
|
|
5201
5264
|
return true;
|
|
5202
5265
|
}
|
|
@@ -5235,9 +5298,17 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5235
5298
|
function setCurrentCharacterFont(session, fontId) {
|
|
5236
5299
|
const next = cloneEditorSession(session);
|
|
5237
5300
|
next.currentCharacterFont = fontId;
|
|
5301
|
+
next.currentCharacterWrapper = null;
|
|
5238
5302
|
appendDebug(next, "setCurrentCharacterFont", fontId);
|
|
5239
5303
|
return next;
|
|
5240
5304
|
}
|
|
5305
|
+
function setCurrentBoldCharacterStyle(session) {
|
|
5306
|
+
const next = cloneEditorSession(session);
|
|
5307
|
+
next.currentCharacterFont = "default";
|
|
5308
|
+
next.currentCharacterWrapper = "\\boldarabic";
|
|
5309
|
+
appendDebug(next, "setCurrentBoldCharacterStyle", "\\boldarabic");
|
|
5310
|
+
return next;
|
|
5311
|
+
}
|
|
5241
5312
|
function toggleTakweenCharacterFont(session) {
|
|
5242
5313
|
return setCurrentCharacterFont(session, (session.currentCharacterFont ?? "default") === "takween" ? "default" : "takween");
|
|
5243
5314
|
}
|
|
@@ -5786,6 +5857,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5786
5857
|
englishHit.node.expr = englishHit.node.expr.slice(0, -1);
|
|
5787
5858
|
arabicHit.node.expr = arabicHit.node.expr.slice(0, -1);
|
|
5788
5859
|
}
|
|
5860
|
+
clearSourceIdentity(next, id);
|
|
5789
5861
|
markExprSync(next, id);
|
|
5790
5862
|
next.selectedStructureNodeId = null;
|
|
5791
5863
|
syncSelectionToCaret(next);
|
|
@@ -5835,6 +5907,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5835
5907
|
englishHit.node.expr = englishHit.node.expr.slice(1);
|
|
5836
5908
|
arabicHit.node.expr = arabicHit.node.expr.slice(1);
|
|
5837
5909
|
}
|
|
5910
|
+
clearSourceIdentity(next, node.id);
|
|
5838
5911
|
markExprSync(next, node.id);
|
|
5839
5912
|
next.selectedStructureNodeId = null;
|
|
5840
5913
|
syncSelectionToCaret(next);
|
|
@@ -5861,6 +5934,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5861
5934
|
return session;
|
|
5862
5935
|
}
|
|
5863
5936
|
activeNode.node.expr = expr;
|
|
5937
|
+
clearSourceIdentity(next, nodeId);
|
|
5864
5938
|
markExprSync(next, nodeId);
|
|
5865
5939
|
appendDebug(next, "setExpr", nodeId);
|
|
5866
5940
|
return next;
|
|
@@ -5878,6 +5952,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
5878
5952
|
forceSplitNextLeaf: false,
|
|
5879
5953
|
arabicReverseNumberTyping: true,
|
|
5880
5954
|
currentCharacterFont: "default",
|
|
5955
|
+
currentCharacterWrapper: null,
|
|
5881
5956
|
currentDigitForm: "western",
|
|
5882
5957
|
caret: {
|
|
5883
5958
|
chainId: englishRoot.id,
|
|
@@ -6015,6 +6090,9 @@ ${STANDARD_COMMAND_CSS}
|
|
|
6015
6090
|
if (cssClass) {
|
|
6016
6091
|
value.classList.add(cssClass);
|
|
6017
6092
|
}
|
|
6093
|
+
if (node.wrapperCommand === "\\boldarabic" || node.wrapperCommand === "\\mathbf") {
|
|
6094
|
+
value.classList.add("node-value--bold");
|
|
6095
|
+
}
|
|
6018
6096
|
}
|
|
6019
6097
|
const surfaceExpr = node.kind === "operator" ? divideOperatorSurfaceExpr(node.expr, side) : node.expr;
|
|
6020
6098
|
value.textContent = surfaceExpr === "" ? "\u25A1" : formatDigits(surfaceExpr, digitForm);
|
|
@@ -6890,6 +6968,10 @@ ${STANDARD_COMMAND_CSS}
|
|
|
6890
6968
|
applyTransient((prev) => setCurrentCharacterFont(prev, fontId));
|
|
6891
6969
|
focusInput();
|
|
6892
6970
|
},
|
|
6971
|
+
setCurrentBoldCharacterStyle: () => {
|
|
6972
|
+
applyTransient((prev) => setCurrentBoldCharacterStyle(prev));
|
|
6973
|
+
focusInput();
|
|
6974
|
+
},
|
|
6893
6975
|
setCurrentDigitForm: (digitForm) => {
|
|
6894
6976
|
applyStructural((prev) => setCurrentDigitForm(prev, digitForm));
|
|
6895
6977
|
focusInput();
|
|
@@ -7612,6 +7694,15 @@ ${STANDARD_COMMAND_CSS}
|
|
|
7612
7694
|
var SVG_FONT_ATTR = "data-butex-svg-font";
|
|
7613
7695
|
var EM = 1e3;
|
|
7614
7696
|
var FALLBACK_CHAR_WIDTH = 0.72;
|
|
7697
|
+
var BOLD_LAYOUT = {
|
|
7698
|
+
key: "bold",
|
|
7699
|
+
stack: 'Amiri, "Noto Serif Arabic", serif',
|
|
7700
|
+
height: 0.75,
|
|
7701
|
+
depth: 0.25,
|
|
7702
|
+
drawScale: 1,
|
|
7703
|
+
baselineShift: 0,
|
|
7704
|
+
fontWeight: 700
|
|
7705
|
+
};
|
|
7615
7706
|
var FONT_LAYOUTS = Object.fromEntries(
|
|
7616
7707
|
NON_DEFAULT_CHARACTER_FONT_SPECS.filter((font) => font.svgLayoutKey && font.browserFontStack).map((font) => {
|
|
7617
7708
|
const key = font.svgLayoutKey;
|
|
@@ -7632,6 +7723,9 @@ ${STANDARD_COMMAND_CSS}
|
|
|
7632
7723
|
);
|
|
7633
7724
|
function fontLayoutForClass(className) {
|
|
7634
7725
|
const classes = className.split(/\s+/);
|
|
7726
|
+
if (classes.includes("butex-bold-text")) {
|
|
7727
|
+
return BOLD_LAYOUT;
|
|
7728
|
+
}
|
|
7635
7729
|
for (const font of NON_DEFAULT_CHARACTER_FONT_SPECS) {
|
|
7636
7730
|
if (font.mathJaxClass && font.svgLayoutKey && classes.includes(font.mathJaxClass)) {
|
|
7637
7731
|
return FONT_LAYOUTS[font.svgLayoutKey] ?? null;
|
|
@@ -7684,12 +7778,14 @@ ${STANDARD_COMMAND_CSS}
|
|
|
7684
7778
|
y: 0,
|
|
7685
7779
|
"font-family": fontStack,
|
|
7686
7780
|
"font-size": EM,
|
|
7781
|
+
"font-weight": fontStack === BOLD_LAYOUT.stack ? BOLD_LAYOUT.fontWeight : void 0,
|
|
7687
7782
|
"text-anchor": "end",
|
|
7688
7783
|
direction: "rtl",
|
|
7689
7784
|
"unicode-bidi": "isolate",
|
|
7690
7785
|
"dominant-baseline": "alphabetic",
|
|
7691
7786
|
style: {
|
|
7692
7787
|
"font-family": fontStack,
|
|
7788
|
+
"font-weight": fontStack === BOLD_LAYOUT.stack ? BOLD_LAYOUT.fontWeight : void 0,
|
|
7693
7789
|
direction: "rtl",
|
|
7694
7790
|
"unicode-bidi": "isolate"
|
|
7695
7791
|
}
|
|
@@ -7789,6 +7885,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
7789
7885
|
transform: `scale(${formatSvgNumber(font.drawScale)},${formatSvgNumber(-font.drawScale)})`,
|
|
7790
7886
|
"font-family": font.stack,
|
|
7791
7887
|
"font-size": EM,
|
|
7888
|
+
"font-weight": font.fontWeight,
|
|
7792
7889
|
"text-anchor": "end",
|
|
7793
7890
|
direction: "rtl",
|
|
7794
7891
|
"unicode-bidi": "isolate",
|
|
@@ -7797,6 +7894,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
7797
7894
|
[SVG_FONT_ATTR]: font.key,
|
|
7798
7895
|
style: {
|
|
7799
7896
|
"font-family": font.stack,
|
|
7897
|
+
"font-weight": font.fontWeight,
|
|
7800
7898
|
direction: "rtl",
|
|
7801
7899
|
"unicode-bidi": "isolate"
|
|
7802
7900
|
}
|