@drghaliasri/butex 7.2.1 → 7.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.
Files changed (48) hide show
  1. package/README.md +1 -0
  2. package/dist/document.d.mts +8 -0
  3. package/dist/document.d.ts +8 -0
  4. package/dist/document.js +37 -2
  5. package/dist/document.js.map +1 -1
  6. package/dist/document.mjs +37 -2
  7. package/dist/document.mjs.map +1 -1
  8. package/dist/document2-cli.js +106 -2
  9. package/dist/document2-cli.js.map +1 -1
  10. package/dist/document2.d.mts +8 -0
  11. package/dist/document2.d.ts +8 -0
  12. package/dist/document2.js +106 -2
  13. package/dist/document2.js.map +1 -1
  14. package/dist/document2.mjs +106 -2
  15. package/dist/document2.mjs.map +1 -1
  16. package/dist/index.d.mts +19 -1
  17. package/dist/index.d.ts +19 -1
  18. package/dist/index.global.js +108 -11
  19. package/dist/index.global.js.map +1 -1
  20. package/dist/index.js +108 -11
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +108 -11
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/react-document.d.mts +2 -0
  25. package/dist/react-document.d.ts +2 -0
  26. package/dist/react-document.js +229 -40
  27. package/dist/react-document.js.map +1 -1
  28. package/dist/react-document.mjs +229 -40
  29. package/dist/react-document.mjs.map +1 -1
  30. package/dist/react-document2-preview.d.mts +2 -0
  31. package/dist/react-document2-preview.d.ts +2 -0
  32. package/dist/react-document2-preview.js +90 -0
  33. package/dist/react-document2-preview.js.map +1 -1
  34. package/dist/react-document2-preview.mjs +90 -0
  35. package/dist/react-document2-preview.mjs.map +1 -1
  36. package/dist/react-document2.d.mts +8 -0
  37. package/dist/react-document2.d.ts +8 -0
  38. package/dist/react-document2.js +229 -40
  39. package/dist/react-document2.js.map +1 -1
  40. package/dist/react-document2.mjs +229 -40
  41. package/dist/react-document2.mjs.map +1 -1
  42. package/dist/react.d.mts +16 -0
  43. package/dist/react.d.ts +16 -0
  44. package/dist/react.js +229 -40
  45. package/dist/react.js.map +1 -1
  46. package/dist/react.mjs +229 -40
  47. package/dist/react.mjs.map +1 -1
  48. 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
  /**
@@ -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;
@@ -850,12 +862,15 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
850
862
  parser.Push(node);
851
863
  }
852
864
  function registerFontTextCommands(CommandMap) {
853
- const mappings = Object.fromEntries(
854
- NON_DEFAULT_CHARACTER_FONT_SPECS.filter((font) => font.mathJaxClass).map((font) => [
855
- font.macro.replace(/^\\/, ""),
856
- ((parser, name) => fontText(font.mathJaxClass, parser, name))
857
- ])
858
- );
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
+ };
859
874
  new CommandMap(COMMAND_MAP5, mappings);
860
875
  return COMMAND_MAP5;
861
876
  }
@@ -2153,6 +2168,15 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
2153
2168
  title: "\u0627\u0644\u0644\u0627\u0646\u0647\u0627\u064A\u0629",
2154
2169
  svg_path: null
2155
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
+ },
2156
2180
  times: {
2157
2181
  id: "times",
2158
2182
  category: "operators1",
@@ -2941,6 +2965,11 @@ ${BUTEX_FONT_FACE_CSS}
2941
2965
 
2942
2966
  ${CHARACTER_FONT_CSS}
2943
2967
 
2968
+ .node-value--bold {
2969
+ font-family: var(--font-display-ar, Amiri), "Noto Serif Arabic", serif;
2970
+ font-weight: 700;
2971
+ }
2972
+
2944
2973
  .chain {
2945
2974
  display: inline-flex;
2946
2975
  align-items: center;
@@ -3255,6 +3284,7 @@ ${STANDARD_COMMAND_CSS}
3255
3284
  setArabicReverseNumberTyping: () => setArabicReverseNumberTyping,
3256
3285
  setArrayColumnAlignment: () => setArrayColumnAlignment,
3257
3286
  setCaret: () => setCaret,
3287
+ setCurrentBoldCharacterStyle: () => setCurrentBoldCharacterStyle,
3258
3288
  setCurrentCharacterFont: () => setCurrentCharacterFont,
3259
3289
  setCurrentDigitForm: () => setCurrentDigitForm,
3260
3290
  setExpr: () => setExpr,
@@ -3385,6 +3415,7 @@ ${STANDARD_COMMAND_CSS}
3385
3415
  forceSplitNextLeaf: session.forceSplitNextLeaf,
3386
3416
  arabicReverseNumberTyping: session.arabicReverseNumberTyping,
3387
3417
  currentCharacterFont: session.currentCharacterFont ?? "default",
3418
+ currentCharacterWrapper: session.currentCharacterWrapper ?? null,
3388
3419
  currentDigitForm: session.currentDigitForm ?? "western",
3389
3420
  caret: { ...session.caret },
3390
3421
  selection: session.selection ? { ...session.selection } : null,
@@ -3457,6 +3488,7 @@ ${STANDARD_COMMAND_CSS}
3457
3488
  forceSplitNextLeaf: false,
3458
3489
  arabicReverseNumberTyping: true,
3459
3490
  currentCharacterFont: "default",
3491
+ currentCharacterWrapper: null,
3460
3492
  currentDigitForm: "western",
3461
3493
  caret: {
3462
3494
  chainId: englishTree.id,
@@ -3659,6 +3691,14 @@ ${STANDARD_COMMAND_CSS}
3659
3691
  return `${node.expr}${latinScripts(node, options)}`;
3660
3692
  }
3661
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
+ }
3662
3702
  return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
3663
3703
  }
3664
3704
  if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
@@ -3712,6 +3752,10 @@ ${STANDARD_COMMAND_CSS}
3712
3752
  if (node.kind === "char") {
3713
3753
  const expr = formatDigits(node.expr, selectedDigitForm(options));
3714
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
+ }
3715
3759
  return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
3716
3760
  }
3717
3761
  if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
@@ -4558,6 +4602,16 @@ ${STANDARD_COMMAND_CSS}
4558
4602
  }
4559
4603
  session.sync[nodeId].expr = english.node.expr === arabic.node.expr ? "synced" : "diverged";
4560
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
+ }
4561
4615
  function syncSelectionToCaret(session) {
4562
4616
  const activeKey = activeTreeKey(session.activeSide);
4563
4617
  const tree = session[activeKey];
@@ -5141,7 +5195,10 @@ ${STANDARD_COMMAND_CSS}
5141
5195
  const next = cloneEditorSession(session);
5142
5196
  const englishNode = createEditorNode(kind, expr);
5143
5197
  const arabicNode = createEditorNode(kind, expr);
5144
- if (kind === "char" && (next.currentCharacterFont ?? "default") !== "default") {
5198
+ if (kind === "char" && next.currentCharacterWrapper === "\\boldarabic") {
5199
+ englishNode.wrapperCommand = "\\boldarabic";
5200
+ arabicNode.wrapperCommand = "\\boldarabic";
5201
+ } else if (kind === "char" && (next.currentCharacterFont ?? "default") !== "default") {
5145
5202
  englishNode.characterFont = next.currentCharacterFont;
5146
5203
  arabicNode.characterFont = next.currentCharacterFont;
5147
5204
  }
@@ -5156,8 +5213,12 @@ ${STANDARD_COMMAND_CSS}
5156
5213
  function shouldReverseArabicNumber(session) {
5157
5214
  return session.activeSide === "arabic" && session.arabicReverseNumberTyping;
5158
5215
  }
5159
- function characterFontOf(node) {
5160
- return node.kind === "char" ? node.characterFont ?? "default" : "default";
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"}`;
5161
5222
  }
5162
5223
  function tryMergeLeafTyping(session, kind, fragment) {
5163
5224
  const engLocated = findChainById(session.englishTree, session.caret.chainId);
@@ -5170,14 +5231,14 @@ ${STANDARD_COMMAND_CSS}
5170
5231
  let prepend = false;
5171
5232
  if (i > 0) {
5172
5233
  const prev = nodes[i - 1];
5173
- if (prev.kind === kind && (kind !== "char" || characterFontOf(prev) === (session.currentCharacterFont ?? "default"))) {
5234
+ if (prev.kind === kind && (kind !== "char" || characterTypingStyleOf(prev) === currentCharacterTypingStyle(session))) {
5174
5235
  targetId = prev.id;
5175
5236
  prepend = false;
5176
5237
  }
5177
5238
  }
5178
5239
  if (!targetId && i < nodes.length) {
5179
5240
  const fwd = nodes[i];
5180
- if (fwd.kind === kind && (kind !== "char" || characterFontOf(fwd) === (session.currentCharacterFont ?? "default"))) {
5241
+ if (fwd.kind === kind && (kind !== "char" || characterTypingStyleOf(fwd) === currentCharacterTypingStyle(session))) {
5181
5242
  targetId = fwd.id;
5182
5243
  prepend = true;
5183
5244
  }
@@ -5198,6 +5259,7 @@ ${STANDARD_COMMAND_CSS}
5198
5259
  englishHit.node.expr = `${englishHit.node.expr}${fragment}`;
5199
5260
  arabicHit.node.expr = `${arabicHit.node.expr}${fragment}`;
5200
5261
  }
5262
+ clearSourceIdentity(session, targetId);
5201
5263
  markExprSync(session, targetId);
5202
5264
  return true;
5203
5265
  }
@@ -5236,9 +5298,17 @@ ${STANDARD_COMMAND_CSS}
5236
5298
  function setCurrentCharacterFont(session, fontId) {
5237
5299
  const next = cloneEditorSession(session);
5238
5300
  next.currentCharacterFont = fontId;
5301
+ next.currentCharacterWrapper = null;
5239
5302
  appendDebug(next, "setCurrentCharacterFont", fontId);
5240
5303
  return next;
5241
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
+ }
5242
5312
  function toggleTakweenCharacterFont(session) {
5243
5313
  return setCurrentCharacterFont(session, (session.currentCharacterFont ?? "default") === "takween" ? "default" : "takween");
5244
5314
  }
@@ -5787,6 +5857,7 @@ ${STANDARD_COMMAND_CSS}
5787
5857
  englishHit.node.expr = englishHit.node.expr.slice(0, -1);
5788
5858
  arabicHit.node.expr = arabicHit.node.expr.slice(0, -1);
5789
5859
  }
5860
+ clearSourceIdentity(next, id);
5790
5861
  markExprSync(next, id);
5791
5862
  next.selectedStructureNodeId = null;
5792
5863
  syncSelectionToCaret(next);
@@ -5836,6 +5907,7 @@ ${STANDARD_COMMAND_CSS}
5836
5907
  englishHit.node.expr = englishHit.node.expr.slice(1);
5837
5908
  arabicHit.node.expr = arabicHit.node.expr.slice(1);
5838
5909
  }
5910
+ clearSourceIdentity(next, node.id);
5839
5911
  markExprSync(next, node.id);
5840
5912
  next.selectedStructureNodeId = null;
5841
5913
  syncSelectionToCaret(next);
@@ -5862,6 +5934,7 @@ ${STANDARD_COMMAND_CSS}
5862
5934
  return session;
5863
5935
  }
5864
5936
  activeNode.node.expr = expr;
5937
+ clearSourceIdentity(next, nodeId);
5865
5938
  markExprSync(next, nodeId);
5866
5939
  appendDebug(next, "setExpr", nodeId);
5867
5940
  return next;
@@ -5879,6 +5952,7 @@ ${STANDARD_COMMAND_CSS}
5879
5952
  forceSplitNextLeaf: false,
5880
5953
  arabicReverseNumberTyping: true,
5881
5954
  currentCharacterFont: "default",
5955
+ currentCharacterWrapper: null,
5882
5956
  currentDigitForm: "western",
5883
5957
  caret: {
5884
5958
  chainId: englishRoot.id,
@@ -6016,6 +6090,9 @@ ${STANDARD_COMMAND_CSS}
6016
6090
  if (cssClass) {
6017
6091
  value.classList.add(cssClass);
6018
6092
  }
6093
+ if (node.wrapperCommand === "\\boldarabic" || node.wrapperCommand === "\\mathbf") {
6094
+ value.classList.add("node-value--bold");
6095
+ }
6019
6096
  }
6020
6097
  const surfaceExpr = node.kind === "operator" ? divideOperatorSurfaceExpr(node.expr, side) : node.expr;
6021
6098
  value.textContent = surfaceExpr === "" ? "\u25A1" : formatDigits(surfaceExpr, digitForm);
@@ -6891,6 +6968,10 @@ ${STANDARD_COMMAND_CSS}
6891
6968
  applyTransient((prev) => setCurrentCharacterFont(prev, fontId));
6892
6969
  focusInput();
6893
6970
  },
6971
+ setCurrentBoldCharacterStyle: () => {
6972
+ applyTransient((prev) => setCurrentBoldCharacterStyle(prev));
6973
+ focusInput();
6974
+ },
6894
6975
  setCurrentDigitForm: (digitForm) => {
6895
6976
  applyStructural((prev) => setCurrentDigitForm(prev, digitForm));
6896
6977
  focusInput();
@@ -7613,6 +7694,15 @@ ${STANDARD_COMMAND_CSS}
7613
7694
  var SVG_FONT_ATTR = "data-butex-svg-font";
7614
7695
  var EM = 1e3;
7615
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
+ };
7616
7706
  var FONT_LAYOUTS = Object.fromEntries(
7617
7707
  NON_DEFAULT_CHARACTER_FONT_SPECS.filter((font) => font.svgLayoutKey && font.browserFontStack).map((font) => {
7618
7708
  const key = font.svgLayoutKey;
@@ -7633,6 +7723,9 @@ ${STANDARD_COMMAND_CSS}
7633
7723
  );
7634
7724
  function fontLayoutForClass(className) {
7635
7725
  const classes = className.split(/\s+/);
7726
+ if (classes.includes("butex-bold-text")) {
7727
+ return BOLD_LAYOUT;
7728
+ }
7636
7729
  for (const font of NON_DEFAULT_CHARACTER_FONT_SPECS) {
7637
7730
  if (font.mathJaxClass && font.svgLayoutKey && classes.includes(font.mathJaxClass)) {
7638
7731
  return FONT_LAYOUTS[font.svgLayoutKey] ?? null;
@@ -7685,12 +7778,14 @@ ${STANDARD_COMMAND_CSS}
7685
7778
  y: 0,
7686
7779
  "font-family": fontStack,
7687
7780
  "font-size": EM,
7781
+ "font-weight": fontStack === BOLD_LAYOUT.stack ? BOLD_LAYOUT.fontWeight : void 0,
7688
7782
  "text-anchor": "end",
7689
7783
  direction: "rtl",
7690
7784
  "unicode-bidi": "isolate",
7691
7785
  "dominant-baseline": "alphabetic",
7692
7786
  style: {
7693
7787
  "font-family": fontStack,
7788
+ "font-weight": fontStack === BOLD_LAYOUT.stack ? BOLD_LAYOUT.fontWeight : void 0,
7694
7789
  direction: "rtl",
7695
7790
  "unicode-bidi": "isolate"
7696
7791
  }
@@ -7790,6 +7885,7 @@ ${STANDARD_COMMAND_CSS}
7790
7885
  transform: `scale(${formatSvgNumber(font.drawScale)},${formatSvgNumber(-font.drawScale)})`,
7791
7886
  "font-family": font.stack,
7792
7887
  "font-size": EM,
7888
+ "font-weight": font.fontWeight,
7793
7889
  "text-anchor": "end",
7794
7890
  direction: "rtl",
7795
7891
  "unicode-bidi": "isolate",
@@ -7798,6 +7894,7 @@ ${STANDARD_COMMAND_CSS}
7798
7894
  [SVG_FONT_ATTR]: font.key,
7799
7895
  style: {
7800
7896
  "font-family": font.stack,
7897
+ "font-weight": font.fontWeight,
7801
7898
  direction: "rtl",
7802
7899
  "unicode-bidi": "isolate"
7803
7900
  }