@drghaliasri/butex 7.3.0 → 7.3.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/dist/document.d.mts +1 -1
- package/dist/document.d.ts +1 -1
- package/dist/document.js +36 -1
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +36 -1
- package/dist/document.mjs.map +1 -1
- package/dist/document2-cli.js +56 -1
- package/dist/document2-cli.js.map +1 -1
- package/dist/document2.d.mts +1 -1
- package/dist/document2.d.ts +1 -1
- package/dist/document2.js +56 -1
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +56 -1
- package/dist/document2.mjs.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.global.js +75 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +75 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react-document.js +71 -1
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +71 -1
- package/dist/react-document.mjs.map +1 -1
- package/dist/react-document2-preview.js +50 -1
- package/dist/react-document2-preview.js.map +1 -1
- package/dist/react-document2-preview.mjs +50 -1
- package/dist/react-document2-preview.mjs.map +1 -1
- package/dist/react-document2.d.mts +1 -1
- package/dist/react-document2.d.ts +1 -1
- package/dist/react-document2.js +71 -1
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +71 -1
- package/dist/react-document2.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +71 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +71 -1
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -99,7 +99,7 @@ declare const BUTEX_EDITOR_CSS: string;
|
|
|
99
99
|
declare function injectBuTeXEditorStyles(doc?: Document): void;
|
|
100
100
|
|
|
101
101
|
type EditorSide = 'english' | 'arabic';
|
|
102
|
-
type EditorNodeKind = 'char' | 'number' | 'operator' | 'delimiter' | 'frac' | 'sqrt' | 'overset' | 'underset' | 'accent' | 'env' | 'atomicCommand' | 'atomicOperatorCommand' | 'standardCommand';
|
|
102
|
+
type EditorNodeKind = 'char' | 'number' | 'operator' | 'delimiter' | 'boxed' | 'frac' | 'sqrt' | 'overset' | 'underset' | 'accent' | 'env' | 'atomicCommand' | 'atomicOperatorCommand' | 'standardCommand';
|
|
103
103
|
type MatrixEnvStyle = 'matrix' | 'pmatrix' | 'bmatrix' | 'Bmatrix' | 'vmatrix' | 'Vmatrix';
|
|
104
104
|
type GridEnvName = MatrixEnvStyle | 'array' | 'aligned';
|
|
105
105
|
type EnvColumnAlignment = 'l' | 'c' | 'r';
|
|
@@ -1257,6 +1257,7 @@ declare function atomicOperatorCommandSpec(id: string): AtomicOperatorCommandSpe
|
|
|
1257
1257
|
declare function createEditorChain(nodes?: EditorNode[]): EditorChain;
|
|
1258
1258
|
declare function createEditorNode(kind: EditorNode['kind'], expr: string): EditorNode;
|
|
1259
1259
|
declare function createDelimiterNode(leftDelimExpr: string, rightDelimExpr: string): EditorNode;
|
|
1260
|
+
declare function createBoxedNode(): EditorNode;
|
|
1260
1261
|
declare function createFracNode(): EditorNode;
|
|
1261
1262
|
declare function createSqrtNode(): EditorNode;
|
|
1262
1263
|
declare function createOversetNode(): EditorNode;
|
|
@@ -1613,6 +1614,8 @@ declare function buildNodeScripts(node: EditorNode, buildChain: BuildChain$1): H
|
|
|
1613
1614
|
|
|
1614
1615
|
declare const DELIMITER_CSS: string;
|
|
1615
1616
|
|
|
1617
|
+
declare const BOXED_CSS: string;
|
|
1618
|
+
|
|
1616
1619
|
declare const FRAC_CSS: string;
|
|
1617
1620
|
|
|
1618
1621
|
declare const SQRT_CSS: string;
|
|
@@ -1722,6 +1725,7 @@ type index_AtomicCommandSpec = AtomicCommandSpec;
|
|
|
1722
1725
|
type index_AtomicOperatorCommandCategory = AtomicOperatorCommandCategory;
|
|
1723
1726
|
type index_AtomicOperatorCommandId = AtomicOperatorCommandId;
|
|
1724
1727
|
type index_AtomicOperatorCommandSpec = AtomicOperatorCommandSpec;
|
|
1728
|
+
declare const index_BOXED_CSS: typeof BOXED_CSS;
|
|
1725
1729
|
declare const index_BUTEX_EDITOR_CSS: typeof BUTEX_EDITOR_CSS;
|
|
1726
1730
|
declare const index_BUTEX_FRAGMENT_MIME: typeof BUTEX_FRAGMENT_MIME;
|
|
1727
1731
|
declare const index_CHARACTER_FONT_OPTIONS: typeof CHARACTER_FONT_OPTIONS;
|
|
@@ -1788,6 +1792,7 @@ declare const index_coveredNodeIds: typeof coveredNodeIds;
|
|
|
1788
1792
|
declare const index_createAccentNode: typeof createAccentNode;
|
|
1789
1793
|
declare const index_createAtomicCommandNode: typeof createAtomicCommandNode;
|
|
1790
1794
|
declare const index_createAtomicOperatorCommandNode: typeof createAtomicOperatorCommandNode;
|
|
1795
|
+
declare const index_createBoxedNode: typeof createBoxedNode;
|
|
1791
1796
|
declare const index_createDelimiterNode: typeof createDelimiterNode;
|
|
1792
1797
|
declare const index_createEditorChain: typeof createEditorChain;
|
|
1793
1798
|
declare const index_createEditorNode: typeof createEditorNode;
|
|
@@ -1880,7 +1885,7 @@ declare const index_toggleTakweenCharacterFont: typeof toggleTakweenCharacterFon
|
|
|
1880
1885
|
declare const index_undoRedoCanRedo: typeof undoRedoCanRedo;
|
|
1881
1886
|
declare const index_undoRedoCanUndo: typeof undoRedoCanUndo;
|
|
1882
1887
|
declare namespace index {
|
|
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 };
|
|
1888
|
+
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_BOXED_CSS as BOXED_CSS, 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_createBoxedNode as createBoxedNode, 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 };
|
|
1884
1889
|
}
|
|
1885
1890
|
|
|
1886
1891
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ declare const BUTEX_EDITOR_CSS: string;
|
|
|
99
99
|
declare function injectBuTeXEditorStyles(doc?: Document): void;
|
|
100
100
|
|
|
101
101
|
type EditorSide = 'english' | 'arabic';
|
|
102
|
-
type EditorNodeKind = 'char' | 'number' | 'operator' | 'delimiter' | 'frac' | 'sqrt' | 'overset' | 'underset' | 'accent' | 'env' | 'atomicCommand' | 'atomicOperatorCommand' | 'standardCommand';
|
|
102
|
+
type EditorNodeKind = 'char' | 'number' | 'operator' | 'delimiter' | 'boxed' | 'frac' | 'sqrt' | 'overset' | 'underset' | 'accent' | 'env' | 'atomicCommand' | 'atomicOperatorCommand' | 'standardCommand';
|
|
103
103
|
type MatrixEnvStyle = 'matrix' | 'pmatrix' | 'bmatrix' | 'Bmatrix' | 'vmatrix' | 'Vmatrix';
|
|
104
104
|
type GridEnvName = MatrixEnvStyle | 'array' | 'aligned';
|
|
105
105
|
type EnvColumnAlignment = 'l' | 'c' | 'r';
|
|
@@ -1257,6 +1257,7 @@ declare function atomicOperatorCommandSpec(id: string): AtomicOperatorCommandSpe
|
|
|
1257
1257
|
declare function createEditorChain(nodes?: EditorNode[]): EditorChain;
|
|
1258
1258
|
declare function createEditorNode(kind: EditorNode['kind'], expr: string): EditorNode;
|
|
1259
1259
|
declare function createDelimiterNode(leftDelimExpr: string, rightDelimExpr: string): EditorNode;
|
|
1260
|
+
declare function createBoxedNode(): EditorNode;
|
|
1260
1261
|
declare function createFracNode(): EditorNode;
|
|
1261
1262
|
declare function createSqrtNode(): EditorNode;
|
|
1262
1263
|
declare function createOversetNode(): EditorNode;
|
|
@@ -1613,6 +1614,8 @@ declare function buildNodeScripts(node: EditorNode, buildChain: BuildChain$1): H
|
|
|
1613
1614
|
|
|
1614
1615
|
declare const DELIMITER_CSS: string;
|
|
1615
1616
|
|
|
1617
|
+
declare const BOXED_CSS: string;
|
|
1618
|
+
|
|
1616
1619
|
declare const FRAC_CSS: string;
|
|
1617
1620
|
|
|
1618
1621
|
declare const SQRT_CSS: string;
|
|
@@ -1722,6 +1725,7 @@ type index_AtomicCommandSpec = AtomicCommandSpec;
|
|
|
1722
1725
|
type index_AtomicOperatorCommandCategory = AtomicOperatorCommandCategory;
|
|
1723
1726
|
type index_AtomicOperatorCommandId = AtomicOperatorCommandId;
|
|
1724
1727
|
type index_AtomicOperatorCommandSpec = AtomicOperatorCommandSpec;
|
|
1728
|
+
declare const index_BOXED_CSS: typeof BOXED_CSS;
|
|
1725
1729
|
declare const index_BUTEX_EDITOR_CSS: typeof BUTEX_EDITOR_CSS;
|
|
1726
1730
|
declare const index_BUTEX_FRAGMENT_MIME: typeof BUTEX_FRAGMENT_MIME;
|
|
1727
1731
|
declare const index_CHARACTER_FONT_OPTIONS: typeof CHARACTER_FONT_OPTIONS;
|
|
@@ -1788,6 +1792,7 @@ declare const index_coveredNodeIds: typeof coveredNodeIds;
|
|
|
1788
1792
|
declare const index_createAccentNode: typeof createAccentNode;
|
|
1789
1793
|
declare const index_createAtomicCommandNode: typeof createAtomicCommandNode;
|
|
1790
1794
|
declare const index_createAtomicOperatorCommandNode: typeof createAtomicOperatorCommandNode;
|
|
1795
|
+
declare const index_createBoxedNode: typeof createBoxedNode;
|
|
1791
1796
|
declare const index_createDelimiterNode: typeof createDelimiterNode;
|
|
1792
1797
|
declare const index_createEditorChain: typeof createEditorChain;
|
|
1793
1798
|
declare const index_createEditorNode: typeof createEditorNode;
|
|
@@ -1880,7 +1885,7 @@ declare const index_toggleTakweenCharacterFont: typeof toggleTakweenCharacterFon
|
|
|
1880
1885
|
declare const index_undoRedoCanRedo: typeof undoRedoCanRedo;
|
|
1881
1886
|
declare const index_undoRedoCanUndo: typeof undoRedoCanUndo;
|
|
1882
1887
|
declare namespace index {
|
|
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 };
|
|
1888
|
+
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_BOXED_CSS as BOXED_CSS, 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_createBoxedNode as createBoxedNode, 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 };
|
|
1884
1889
|
}
|
|
1885
1890
|
|
|
1886
1891
|
/**
|
package/dist/index.global.js
CHANGED
|
@@ -183,6 +183,12 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
|
|
|
183
183
|
unicode-bidi: isolate;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
.butex-unit-text,
|
|
187
|
+
.butex-unit-text mjx-utext {
|
|
188
|
+
font-style: normal !important;
|
|
189
|
+
font-weight: 400;
|
|
190
|
+
}
|
|
191
|
+
|
|
186
192
|
.butex-diwani-command {
|
|
187
193
|
font-family: ${BUTEX_DIWANI_FONT_STACK};
|
|
188
194
|
direction: rtl;
|
|
@@ -899,6 +905,16 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
|
|
|
899
905
|
const inner = new TexParserClass(arg, parser.stack.env, parser.configuration).mml();
|
|
900
906
|
parser.Push(inner);
|
|
901
907
|
}
|
|
908
|
+
function unitArgument(parser, name) {
|
|
909
|
+
const text = parser.GetArgument(name);
|
|
910
|
+
const node = parser.create(
|
|
911
|
+
"token",
|
|
912
|
+
"mtext",
|
|
913
|
+
{ class: "butex-unit-text", "data-butex-unit": text },
|
|
914
|
+
text
|
|
915
|
+
);
|
|
916
|
+
parser.Push(node);
|
|
917
|
+
}
|
|
902
918
|
function arabvecArgument(parser, name) {
|
|
903
919
|
const arg = parser.GetArgument(name);
|
|
904
920
|
const TexParserClass = parser.constructor;
|
|
@@ -907,10 +923,11 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
|
|
|
907
923
|
parser.Push(inner);
|
|
908
924
|
}
|
|
909
925
|
var passthroughArgumentTyped = passthroughArgument;
|
|
926
|
+
var unitArgumentTyped = unitArgument;
|
|
910
927
|
var arabvecArgumentTyped = arabvecArgument;
|
|
911
928
|
function registerPassthroughCommandMacros(CommandMap) {
|
|
912
929
|
new CommandMap(COMMAND_MAP7, {
|
|
913
|
-
unit:
|
|
930
|
+
unit: unitArgumentTyped,
|
|
914
931
|
idx: passthroughArgumentTyped,
|
|
915
932
|
arabvec: arabvecArgumentTyped
|
|
916
933
|
});
|
|
@@ -1066,6 +1083,29 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
|
|
|
1066
1083
|
return pair;
|
|
1067
1084
|
}
|
|
1068
1085
|
|
|
1086
|
+
// src/editor/display/boxed.ts
|
|
1087
|
+
var BOXED_CSS = `
|
|
1088
|
+
.boxed-command {
|
|
1089
|
+
display: inline-flex;
|
|
1090
|
+
align-items: center;
|
|
1091
|
+
border: 1.5px solid currentColor;
|
|
1092
|
+
padding: 0.12em 0.22em;
|
|
1093
|
+
min-height: 1.25em;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
.boxed-command > .chain {
|
|
1097
|
+
min-height: auto;
|
|
1098
|
+
}
|
|
1099
|
+
`.trim();
|
|
1100
|
+
function buildBoxedNodeBody(node, buildChain) {
|
|
1101
|
+
const box = document.createElement("span");
|
|
1102
|
+
box.className = "boxed-command";
|
|
1103
|
+
if (node.innerExpr) {
|
|
1104
|
+
box.appendChild(buildChain(node.innerExpr));
|
|
1105
|
+
}
|
|
1106
|
+
return box;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1069
1109
|
// src/editor/display/frac.ts
|
|
1070
1110
|
var FRAC_CSS = `
|
|
1071
1111
|
.frac {
|
|
@@ -2970,6 +3010,13 @@ ${CHARACTER_FONT_CSS}
|
|
|
2970
3010
|
font-weight: 700;
|
|
2971
3011
|
}
|
|
2972
3012
|
|
|
3013
|
+
.node-value--unit {
|
|
3014
|
+
font-style: normal;
|
|
3015
|
+
text-decoration-line: underline;
|
|
3016
|
+
text-decoration-style: dotted;
|
|
3017
|
+
text-underline-offset: 0.2em;
|
|
3018
|
+
}
|
|
3019
|
+
|
|
2973
3020
|
.chain {
|
|
2974
3021
|
display: inline-flex;
|
|
2975
3022
|
align-items: center;
|
|
@@ -3123,6 +3170,8 @@ ${CHARACTER_FONT_CSS}
|
|
|
3123
3170
|
|
|
3124
3171
|
${DELIMITER_CSS}
|
|
3125
3172
|
|
|
3173
|
+
${BOXED_CSS}
|
|
3174
|
+
|
|
3126
3175
|
${FRAC_CSS}
|
|
3127
3176
|
|
|
3128
3177
|
${SQRT_CSS}
|
|
@@ -3167,6 +3216,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3167
3216
|
ATOMIC_COMMAND_CSS: () => ATOMIC_COMMAND_CSS,
|
|
3168
3217
|
ATOMIC_OPERATOR_COMMANDS: () => ATOMIC_OPERATOR_COMMANDS,
|
|
3169
3218
|
ATOMIC_OPERATOR_COMMAND_CSS: () => ATOMIC_OPERATOR_COMMAND_CSS,
|
|
3219
|
+
BOXED_CSS: () => BOXED_CSS,
|
|
3170
3220
|
BUTEX_EDITOR_CSS: () => BUTEX_EDITOR_CSS,
|
|
3171
3221
|
BUTEX_FRAGMENT_MIME: () => BUTEX_FRAGMENT_MIME,
|
|
3172
3222
|
CHARACTER_FONT_OPTIONS: () => CHARACTER_FONT_OPTIONS,
|
|
@@ -3209,6 +3259,7 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3209
3259
|
createAccentNode: () => createAccentNode,
|
|
3210
3260
|
createAtomicCommandNode: () => createAtomicCommandNode,
|
|
3211
3261
|
createAtomicOperatorCommandNode: () => createAtomicOperatorCommandNode,
|
|
3262
|
+
createBoxedNode: () => createBoxedNode,
|
|
3212
3263
|
createDelimiterNode: () => createDelimiterNode,
|
|
3213
3264
|
createEditorChain: () => createEditorChain,
|
|
3214
3265
|
createEditorNode: () => createEditorNode,
|
|
@@ -3347,6 +3398,12 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3347
3398
|
innerExpr: createEditorChain()
|
|
3348
3399
|
};
|
|
3349
3400
|
}
|
|
3401
|
+
function createBoxedNode() {
|
|
3402
|
+
return {
|
|
3403
|
+
...createEditorNode("boxed", ""),
|
|
3404
|
+
innerExpr: createEditorChain()
|
|
3405
|
+
};
|
|
3406
|
+
}
|
|
3350
3407
|
function createFracNode() {
|
|
3351
3408
|
return {
|
|
3352
3409
|
...createEditorNode("frac", ""),
|
|
@@ -3505,8 +3562,9 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3505
3562
|
// src/editor/divideOperator.ts
|
|
3506
3563
|
var DIVIDE_OPERATOR_EN = "/";
|
|
3507
3564
|
var DIVIDE_OPERATOR_AR = "\\";
|
|
3565
|
+
var DIVIDE_OPERATOR_AR_LATEX = "\\backslash";
|
|
3508
3566
|
function isDivideOperatorExpr(expr) {
|
|
3509
|
-
return expr === DIVIDE_OPERATOR_EN || expr === DIVIDE_OPERATOR_AR;
|
|
3567
|
+
return expr === DIVIDE_OPERATOR_EN || expr === DIVIDE_OPERATOR_AR || expr === DIVIDE_OPERATOR_AR_LATEX;
|
|
3510
3568
|
}
|
|
3511
3569
|
function divideOperatorSurfaceExpr(expr, side) {
|
|
3512
3570
|
if (!isDivideOperatorExpr(expr)) {
|
|
@@ -3655,6 +3713,10 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3655
3713
|
if (node.kind === "delimiter" && node.innerExpr) {
|
|
3656
3714
|
return `${node.leftDelimExpr}${renderChainEnglish(node.innerExpr, options)}${node.rightDelimExpr}${latinScripts(node, options)}`;
|
|
3657
3715
|
}
|
|
3716
|
+
if (node.kind === "boxed" && node.innerExpr) {
|
|
3717
|
+
const body = `\\boxed{${renderChainEnglish(node.innerExpr, options)}}`;
|
|
3718
|
+
return `${body}${latinScripts(node, options)}`;
|
|
3719
|
+
}
|
|
3658
3720
|
if (node.kind === "frac" && node.numerator && node.denominator) {
|
|
3659
3721
|
const body = `\\frac{${renderChainEnglish(node.numerator, options)}}{${renderChainEnglish(node.denominator, options)}}`;
|
|
3660
3722
|
return `${body}${latinScripts(node, options)}`;
|
|
@@ -3711,6 +3773,10 @@ ${STANDARD_COMMAND_CSS}
|
|
|
3711
3773
|
const content = `${node.leftDelimExpr}${renderChainArabic(node.innerExpr, options)}${node.rightDelimExpr}`;
|
|
3712
3774
|
return arabicScripts(node, content, options);
|
|
3713
3775
|
}
|
|
3776
|
+
if (node.kind === "boxed" && node.innerExpr) {
|
|
3777
|
+
const content = `\\boxed{${renderChainArabic(node.innerExpr, options)}}`;
|
|
3778
|
+
return arabicScripts(node, content, options);
|
|
3779
|
+
}
|
|
3714
3780
|
if (node.kind === "frac" && node.numerator && node.denominator) {
|
|
3715
3781
|
const content = `\\frac{${renderChainArabic(node.numerator, options)}}{${renderChainArabic(node.denominator, options)}}`;
|
|
3716
3782
|
return arabicScripts(node, content, options);
|
|
@@ -6093,6 +6159,10 @@ ${STANDARD_COMMAND_CSS}
|
|
|
6093
6159
|
if (node.wrapperCommand === "\\boldarabic" || node.wrapperCommand === "\\mathbf") {
|
|
6094
6160
|
value.classList.add("node-value--bold");
|
|
6095
6161
|
}
|
|
6162
|
+
if (node.wrapperCommand === "\\unit") {
|
|
6163
|
+
value.classList.add("node-value--unit");
|
|
6164
|
+
value.title = "\u0648\u062D\u062F\u0629 (unit)";
|
|
6165
|
+
}
|
|
6096
6166
|
}
|
|
6097
6167
|
const surfaceExpr = node.kind === "operator" ? divideOperatorSurfaceExpr(node.expr, side) : node.expr;
|
|
6098
6168
|
value.textContent = surfaceExpr === "" ? "\u25A1" : formatDigits(surfaceExpr, digitForm);
|
|
@@ -6134,6 +6204,9 @@ ${STANDARD_COMMAND_CSS}
|
|
|
6134
6204
|
if (node.kind === "delimiter") {
|
|
6135
6205
|
return buildDelimiterNodeBody(node, buildChain);
|
|
6136
6206
|
}
|
|
6207
|
+
if (node.kind === "boxed") {
|
|
6208
|
+
return buildBoxedNodeBody(node, buildChain);
|
|
6209
|
+
}
|
|
6137
6210
|
if (node.kind === "frac") {
|
|
6138
6211
|
return buildFracNodeBody(node, buildChain);
|
|
6139
6212
|
}
|