@drghaliasri/butex 7.3.6 → 7.4.1

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/react.js CHANGED
@@ -3754,6 +3754,8 @@ function setCurrentDigitForm(session, digitForm) {
3754
3754
  return next;
3755
3755
  }
3756
3756
  function insertChar(session, expr) {
3757
+ const digit = formatDigits(expr, "western");
3758
+ if (/^[0-9]$/.test(digit)) return insertNumber(session, digit);
3757
3759
  const base = replaceSelectionFirst(session);
3758
3760
  if (!base.splitLeafTyping && !base.forceSplitNextLeaf) {
3759
3761
  const next = cloneEditorSession(base);
@@ -3769,17 +3771,18 @@ function insertChar(session, expr) {
3769
3771
  return inserted;
3770
3772
  }
3771
3773
  function insertNumber(session, expr) {
3774
+ const digit = formatDigits(expr, "western");
3772
3775
  const base = replaceSelectionFirst(session);
3773
3776
  if (!base.splitLeafTyping && !base.forceSplitNextLeaf) {
3774
3777
  const next = cloneEditorSession(base);
3775
- if (tryMergeLeafTyping(next, "number", expr)) {
3778
+ if (tryMergeLeafTyping(next, "number", digit)) {
3776
3779
  next.selectedStructureNodeId = null;
3777
3780
  syncSelectionToCaret(next);
3778
3781
  appendDebug(next, "mergeLeaf", `number:${expr}`);
3779
3782
  return next;
3780
3783
  }
3781
3784
  }
3782
- const inserted = insertLeaf(base, "number", expr);
3785
+ const inserted = insertLeaf(base, "number", digit);
3783
3786
  inserted.forceSplitNextLeaf = false;
3784
3787
  return inserted;
3785
3788
  }