@drghaliasri/butex 3.2.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/document.js +72 -0
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +72 -0
- package/dist/document.mjs.map +1 -1
- package/dist/document2.d.mts +11 -5
- package/dist/document2.d.ts +11 -5
- package/dist/document2.js +207 -35
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +202 -35
- package/dist/document2.mjs.map +1 -1
- package/dist/index.d.mts +81 -4
- package/dist/index.d.ts +81 -4
- package/dist/index.global.js +436 -31
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +436 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +436 -31
- package/dist/index.mjs.map +1 -1
- package/dist/react-document.js +631 -175
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +631 -175
- package/dist/react-document.mjs.map +1 -1
- package/dist/react-document2.d.mts +31 -9
- package/dist/react-document2.d.ts +31 -9
- package/dist/react-document2.js +1151 -411
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +1151 -411
- package/dist/react-document2.mjs.map +1 -1
- package/dist/react.d.mts +80 -1
- package/dist/react.d.ts +80 -1
- package/dist/react.js +631 -175
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +631 -175
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -626,6 +626,24 @@ declare const ATOMIC_OPERATOR_COMMANDS: {
|
|
|
626
626
|
readonly title: "أكبر من أو يساوي";
|
|
627
627
|
readonly svg_path: null;
|
|
628
628
|
};
|
|
629
|
+
readonly coloneqq: {
|
|
630
|
+
readonly id: "coloneqq";
|
|
631
|
+
readonly category: "operators1";
|
|
632
|
+
readonly Tex: "\\coloneqq";
|
|
633
|
+
readonly mirror: true;
|
|
634
|
+
readonly Label: "≔";
|
|
635
|
+
readonly title: "يعرف بأنه يساوي";
|
|
636
|
+
readonly svg_path: null;
|
|
637
|
+
};
|
|
638
|
+
readonly eqqcolon: {
|
|
639
|
+
readonly id: "eqqcolon";
|
|
640
|
+
readonly category: "operators1";
|
|
641
|
+
readonly Tex: "\\eqqcolon";
|
|
642
|
+
readonly mirror: true;
|
|
643
|
+
readonly Label: "≕";
|
|
644
|
+
readonly title: "يساوي بالتعريف";
|
|
645
|
+
readonly svg_path: null;
|
|
646
|
+
};
|
|
629
647
|
readonly propto: {
|
|
630
648
|
readonly id: "propto";
|
|
631
649
|
readonly category: "operators2";
|
|
@@ -789,6 +807,60 @@ declare const ATOMIC_OPERATOR_COMMANDS: {
|
|
|
789
807
|
readonly title: "يكافئ";
|
|
790
808
|
readonly svg_path: null;
|
|
791
809
|
};
|
|
810
|
+
readonly implies: {
|
|
811
|
+
readonly id: "implies";
|
|
812
|
+
readonly category: "operators3";
|
|
813
|
+
readonly Tex: "\\implies";
|
|
814
|
+
readonly mirror: true;
|
|
815
|
+
readonly Label: "⇒";
|
|
816
|
+
readonly title: "يستلزم";
|
|
817
|
+
readonly svg_path: null;
|
|
818
|
+
};
|
|
819
|
+
readonly impliedby: {
|
|
820
|
+
readonly id: "impliedby";
|
|
821
|
+
readonly category: "operators3";
|
|
822
|
+
readonly Tex: "\\impliedby";
|
|
823
|
+
readonly mirror: true;
|
|
824
|
+
readonly Label: "⇐";
|
|
825
|
+
readonly title: "مستلزم من";
|
|
826
|
+
readonly svg_path: null;
|
|
827
|
+
};
|
|
828
|
+
readonly iff: {
|
|
829
|
+
readonly id: "iff";
|
|
830
|
+
readonly category: "operators3";
|
|
831
|
+
readonly Tex: "\\iff";
|
|
832
|
+
readonly mirror: false;
|
|
833
|
+
readonly Label: "⇔";
|
|
834
|
+
readonly title: "إذا وفقط إذا";
|
|
835
|
+
readonly svg_path: null;
|
|
836
|
+
};
|
|
837
|
+
readonly Longrightarrow: {
|
|
838
|
+
readonly id: "Longrightarrow";
|
|
839
|
+
readonly category: "operators3";
|
|
840
|
+
readonly Tex: "\\Longrightarrow";
|
|
841
|
+
readonly mirror: true;
|
|
842
|
+
readonly Label: "⟹";
|
|
843
|
+
readonly title: "سهم مزدوج طويل إلى اليمين";
|
|
844
|
+
readonly svg_path: null;
|
|
845
|
+
};
|
|
846
|
+
readonly Longleftarrow: {
|
|
847
|
+
readonly id: "Longleftarrow";
|
|
848
|
+
readonly category: "operators3";
|
|
849
|
+
readonly Tex: "\\Longleftarrow";
|
|
850
|
+
readonly mirror: true;
|
|
851
|
+
readonly Label: "⟸";
|
|
852
|
+
readonly title: "سهم مزدوج طويل إلى اليسار";
|
|
853
|
+
readonly svg_path: null;
|
|
854
|
+
};
|
|
855
|
+
readonly to: {
|
|
856
|
+
readonly id: "to";
|
|
857
|
+
readonly category: "operators3";
|
|
858
|
+
readonly Tex: "\\to";
|
|
859
|
+
readonly mirror: true;
|
|
860
|
+
readonly Label: "→";
|
|
861
|
+
readonly title: "يؤول إلى";
|
|
862
|
+
readonly svg_path: null;
|
|
863
|
+
};
|
|
792
864
|
readonly rightleftharpoons: {
|
|
793
865
|
readonly id: "rightleftharpoons";
|
|
794
866
|
readonly category: "operators3";
|
|
@@ -1072,6 +1144,8 @@ declare function findNodeById(root: EditorChain, nodeId: string): LocatedNode |
|
|
|
1072
1144
|
declare function activeTreeKey(side: EditorSide): 'englishTree' | 'arabicTree';
|
|
1073
1145
|
declare function passiveTreeKey(side: EditorSide): 'englishTree' | 'arabicTree';
|
|
1074
1146
|
|
|
1147
|
+
type ButexUiLocale = 'ar' | 'en';
|
|
1148
|
+
|
|
1075
1149
|
/** Keep highlighted node aligned with caret (keyboard + programmatic caret moves). */
|
|
1076
1150
|
declare function syncSelectionToCaret(session: EditorSession): void;
|
|
1077
1151
|
declare function switchSide(session: EditorSession): EditorSession;
|
|
@@ -1114,9 +1188,9 @@ declare function deleteBackward(session: EditorSession): EditorSession;
|
|
|
1114
1188
|
declare function deleteForward(session: EditorSession): EditorSession;
|
|
1115
1189
|
declare function setExpr(session: EditorSession, nodeId: string, expr: string): EditorSession;
|
|
1116
1190
|
declare function createStarterSession(): EditorSession;
|
|
1117
|
-
declare function syncStateSummary(session: EditorSession): string;
|
|
1191
|
+
declare function syncStateSummary(session: EditorSession, uiLocale?: ButexUiLocale): string;
|
|
1118
1192
|
declare function setRenderError(session: EditorSession, message: string | null): EditorSession;
|
|
1119
|
-
declare function activeSideLabel(side: EditorSide): string;
|
|
1193
|
+
declare function activeSideLabel(side: EditorSide, uiLocale?: ButexUiLocale): string;
|
|
1120
1194
|
/** Read-only: build a fragment from the active selection (or null when collapsed). */
|
|
1121
1195
|
declare function copySelection(session: EditorSession): EditorFragment | null;
|
|
1122
1196
|
/** Cut: removes the selection and returns both the cleaned session and the fragment. */
|
|
@@ -1153,7 +1227,7 @@ declare const ATOMIC_COMMAND_CSS: string;
|
|
|
1153
1227
|
declare const ATOMIC_OPERATOR_COMMAND_CSS: string;
|
|
1154
1228
|
|
|
1155
1229
|
type BuildChain = (chain: EditorChain) => HTMLElement;
|
|
1156
|
-
declare function buildNodeBody(node: EditorNode, buildChain: BuildChain, side: EditorSide, digitForm?: DigitFormId): HTMLElement;
|
|
1230
|
+
declare function buildNodeBody(node: EditorNode, buildChain: BuildChain, side: EditorSide, digitForm?: DigitFormId, uiLocale?: ButexUiLocale): HTMLElement;
|
|
1157
1231
|
|
|
1158
1232
|
declare function formatDigits(value: string, digitForm?: DigitFormId): string;
|
|
1159
1233
|
|
|
@@ -1169,6 +1243,8 @@ type RuntimeButtonElements = {
|
|
|
1169
1243
|
type EditorRuntimeOptions = {
|
|
1170
1244
|
surfaceEl: HTMLElement;
|
|
1171
1245
|
initialSession?: EditorSession;
|
|
1246
|
+
defaultSide?: EditorSide;
|
|
1247
|
+
uiLocale?: ButexUiLocale;
|
|
1172
1248
|
buttonElements?: RuntimeButtonElements;
|
|
1173
1249
|
outsidePointerIgnoreSelectors?: string[];
|
|
1174
1250
|
onSessionChange?: (session: EditorSession) => void;
|
|
@@ -1178,6 +1254,7 @@ type EditorRuntimeApi = {
|
|
|
1178
1254
|
destroy: () => void;
|
|
1179
1255
|
getSession: () => EditorSession;
|
|
1180
1256
|
setSession: (next: EditorSession) => void;
|
|
1257
|
+
setUiLocale: (locale: ButexUiLocale) => void;
|
|
1181
1258
|
performUndo: () => void;
|
|
1182
1259
|
performRedo: () => void;
|
|
1183
1260
|
performCopy: () => Promise<void>;
|
|
@@ -1210,7 +1287,7 @@ type EditorRuntimeApi = {
|
|
|
1210
1287
|
deleteStructure: () => void;
|
|
1211
1288
|
};
|
|
1212
1289
|
declare function createEditorRuntime(options: EditorRuntimeOptions): EditorRuntimeApi;
|
|
1213
|
-
declare function runtimeStatusText(session: EditorSession): {
|
|
1290
|
+
declare function runtimeStatusText(session: EditorSession, uiLocale?: ButexUiLocale): {
|
|
1214
1291
|
activeSide: string;
|
|
1215
1292
|
sync: string;
|
|
1216
1293
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -626,6 +626,24 @@ declare const ATOMIC_OPERATOR_COMMANDS: {
|
|
|
626
626
|
readonly title: "أكبر من أو يساوي";
|
|
627
627
|
readonly svg_path: null;
|
|
628
628
|
};
|
|
629
|
+
readonly coloneqq: {
|
|
630
|
+
readonly id: "coloneqq";
|
|
631
|
+
readonly category: "operators1";
|
|
632
|
+
readonly Tex: "\\coloneqq";
|
|
633
|
+
readonly mirror: true;
|
|
634
|
+
readonly Label: "≔";
|
|
635
|
+
readonly title: "يعرف بأنه يساوي";
|
|
636
|
+
readonly svg_path: null;
|
|
637
|
+
};
|
|
638
|
+
readonly eqqcolon: {
|
|
639
|
+
readonly id: "eqqcolon";
|
|
640
|
+
readonly category: "operators1";
|
|
641
|
+
readonly Tex: "\\eqqcolon";
|
|
642
|
+
readonly mirror: true;
|
|
643
|
+
readonly Label: "≕";
|
|
644
|
+
readonly title: "يساوي بالتعريف";
|
|
645
|
+
readonly svg_path: null;
|
|
646
|
+
};
|
|
629
647
|
readonly propto: {
|
|
630
648
|
readonly id: "propto";
|
|
631
649
|
readonly category: "operators2";
|
|
@@ -789,6 +807,60 @@ declare const ATOMIC_OPERATOR_COMMANDS: {
|
|
|
789
807
|
readonly title: "يكافئ";
|
|
790
808
|
readonly svg_path: null;
|
|
791
809
|
};
|
|
810
|
+
readonly implies: {
|
|
811
|
+
readonly id: "implies";
|
|
812
|
+
readonly category: "operators3";
|
|
813
|
+
readonly Tex: "\\implies";
|
|
814
|
+
readonly mirror: true;
|
|
815
|
+
readonly Label: "⇒";
|
|
816
|
+
readonly title: "يستلزم";
|
|
817
|
+
readonly svg_path: null;
|
|
818
|
+
};
|
|
819
|
+
readonly impliedby: {
|
|
820
|
+
readonly id: "impliedby";
|
|
821
|
+
readonly category: "operators3";
|
|
822
|
+
readonly Tex: "\\impliedby";
|
|
823
|
+
readonly mirror: true;
|
|
824
|
+
readonly Label: "⇐";
|
|
825
|
+
readonly title: "مستلزم من";
|
|
826
|
+
readonly svg_path: null;
|
|
827
|
+
};
|
|
828
|
+
readonly iff: {
|
|
829
|
+
readonly id: "iff";
|
|
830
|
+
readonly category: "operators3";
|
|
831
|
+
readonly Tex: "\\iff";
|
|
832
|
+
readonly mirror: false;
|
|
833
|
+
readonly Label: "⇔";
|
|
834
|
+
readonly title: "إذا وفقط إذا";
|
|
835
|
+
readonly svg_path: null;
|
|
836
|
+
};
|
|
837
|
+
readonly Longrightarrow: {
|
|
838
|
+
readonly id: "Longrightarrow";
|
|
839
|
+
readonly category: "operators3";
|
|
840
|
+
readonly Tex: "\\Longrightarrow";
|
|
841
|
+
readonly mirror: true;
|
|
842
|
+
readonly Label: "⟹";
|
|
843
|
+
readonly title: "سهم مزدوج طويل إلى اليمين";
|
|
844
|
+
readonly svg_path: null;
|
|
845
|
+
};
|
|
846
|
+
readonly Longleftarrow: {
|
|
847
|
+
readonly id: "Longleftarrow";
|
|
848
|
+
readonly category: "operators3";
|
|
849
|
+
readonly Tex: "\\Longleftarrow";
|
|
850
|
+
readonly mirror: true;
|
|
851
|
+
readonly Label: "⟸";
|
|
852
|
+
readonly title: "سهم مزدوج طويل إلى اليسار";
|
|
853
|
+
readonly svg_path: null;
|
|
854
|
+
};
|
|
855
|
+
readonly to: {
|
|
856
|
+
readonly id: "to";
|
|
857
|
+
readonly category: "operators3";
|
|
858
|
+
readonly Tex: "\\to";
|
|
859
|
+
readonly mirror: true;
|
|
860
|
+
readonly Label: "→";
|
|
861
|
+
readonly title: "يؤول إلى";
|
|
862
|
+
readonly svg_path: null;
|
|
863
|
+
};
|
|
792
864
|
readonly rightleftharpoons: {
|
|
793
865
|
readonly id: "rightleftharpoons";
|
|
794
866
|
readonly category: "operators3";
|
|
@@ -1072,6 +1144,8 @@ declare function findNodeById(root: EditorChain, nodeId: string): LocatedNode |
|
|
|
1072
1144
|
declare function activeTreeKey(side: EditorSide): 'englishTree' | 'arabicTree';
|
|
1073
1145
|
declare function passiveTreeKey(side: EditorSide): 'englishTree' | 'arabicTree';
|
|
1074
1146
|
|
|
1147
|
+
type ButexUiLocale = 'ar' | 'en';
|
|
1148
|
+
|
|
1075
1149
|
/** Keep highlighted node aligned with caret (keyboard + programmatic caret moves). */
|
|
1076
1150
|
declare function syncSelectionToCaret(session: EditorSession): void;
|
|
1077
1151
|
declare function switchSide(session: EditorSession): EditorSession;
|
|
@@ -1114,9 +1188,9 @@ declare function deleteBackward(session: EditorSession): EditorSession;
|
|
|
1114
1188
|
declare function deleteForward(session: EditorSession): EditorSession;
|
|
1115
1189
|
declare function setExpr(session: EditorSession, nodeId: string, expr: string): EditorSession;
|
|
1116
1190
|
declare function createStarterSession(): EditorSession;
|
|
1117
|
-
declare function syncStateSummary(session: EditorSession): string;
|
|
1191
|
+
declare function syncStateSummary(session: EditorSession, uiLocale?: ButexUiLocale): string;
|
|
1118
1192
|
declare function setRenderError(session: EditorSession, message: string | null): EditorSession;
|
|
1119
|
-
declare function activeSideLabel(side: EditorSide): string;
|
|
1193
|
+
declare function activeSideLabel(side: EditorSide, uiLocale?: ButexUiLocale): string;
|
|
1120
1194
|
/** Read-only: build a fragment from the active selection (or null when collapsed). */
|
|
1121
1195
|
declare function copySelection(session: EditorSession): EditorFragment | null;
|
|
1122
1196
|
/** Cut: removes the selection and returns both the cleaned session and the fragment. */
|
|
@@ -1153,7 +1227,7 @@ declare const ATOMIC_COMMAND_CSS: string;
|
|
|
1153
1227
|
declare const ATOMIC_OPERATOR_COMMAND_CSS: string;
|
|
1154
1228
|
|
|
1155
1229
|
type BuildChain = (chain: EditorChain) => HTMLElement;
|
|
1156
|
-
declare function buildNodeBody(node: EditorNode, buildChain: BuildChain, side: EditorSide, digitForm?: DigitFormId): HTMLElement;
|
|
1230
|
+
declare function buildNodeBody(node: EditorNode, buildChain: BuildChain, side: EditorSide, digitForm?: DigitFormId, uiLocale?: ButexUiLocale): HTMLElement;
|
|
1157
1231
|
|
|
1158
1232
|
declare function formatDigits(value: string, digitForm?: DigitFormId): string;
|
|
1159
1233
|
|
|
@@ -1169,6 +1243,8 @@ type RuntimeButtonElements = {
|
|
|
1169
1243
|
type EditorRuntimeOptions = {
|
|
1170
1244
|
surfaceEl: HTMLElement;
|
|
1171
1245
|
initialSession?: EditorSession;
|
|
1246
|
+
defaultSide?: EditorSide;
|
|
1247
|
+
uiLocale?: ButexUiLocale;
|
|
1172
1248
|
buttonElements?: RuntimeButtonElements;
|
|
1173
1249
|
outsidePointerIgnoreSelectors?: string[];
|
|
1174
1250
|
onSessionChange?: (session: EditorSession) => void;
|
|
@@ -1178,6 +1254,7 @@ type EditorRuntimeApi = {
|
|
|
1178
1254
|
destroy: () => void;
|
|
1179
1255
|
getSession: () => EditorSession;
|
|
1180
1256
|
setSession: (next: EditorSession) => void;
|
|
1257
|
+
setUiLocale: (locale: ButexUiLocale) => void;
|
|
1181
1258
|
performUndo: () => void;
|
|
1182
1259
|
performRedo: () => void;
|
|
1183
1260
|
performCopy: () => Promise<void>;
|
|
@@ -1210,7 +1287,7 @@ type EditorRuntimeApi = {
|
|
|
1210
1287
|
deleteStructure: () => void;
|
|
1211
1288
|
};
|
|
1212
1289
|
declare function createEditorRuntime(options: EditorRuntimeOptions): EditorRuntimeApi;
|
|
1213
|
-
declare function runtimeStatusText(session: EditorSession): {
|
|
1290
|
+
declare function runtimeStatusText(session: EditorSession, uiLocale?: ButexUiLocale): {
|
|
1214
1291
|
activeSide: string;
|
|
1215
1292
|
sync: string;
|
|
1216
1293
|
};
|