@drghaliasri/butex 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +311 -0
- package/dist/document.d.mts +307 -0
- package/dist/document.d.ts +307 -0
- package/dist/document.js +2886 -0
- package/dist/document.js.map +1 -0
- package/dist/document.mjs +2822 -0
- package/dist/document.mjs.map +1 -0
- package/dist/document2.d.mts +353 -0
- package/dist/document2.d.ts +353 -0
- package/dist/document2.js +3321 -0
- package/dist/document2.js.map +1 -0
- package/dist/document2.mjs +3260 -0
- package/dist/document2.mjs.map +1 -0
- package/dist/index.d.mts +1430 -0
- package/dist/index.d.ts +1430 -0
- package/dist/index.global.js +5903 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +5927 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5884 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react-document.d.mts +153 -0
- package/dist/react-document.d.ts +153 -0
- package/dist/react-document.js +9597 -0
- package/dist/react-document.js.map +1 -0
- package/dist/react-document.mjs +9574 -0
- package/dist/react-document.mjs.map +1 -0
- package/dist/react-document2.d.mts +366 -0
- package/dist/react-document2.d.ts +366 -0
- package/dist/react-document2.js +10812 -0
- package/dist/react-document2.js.map +1 -0
- package/dist/react-document2.mjs +10783 -0
- package/dist/react-document2.mjs.map +1 -0
- package/dist/react.d.mts +895 -0
- package/dist/react.d.ts +895 -0
- package/dist/react.js +6955 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +6935 -0
- package/dist/react.mjs.map +1 -0
- package/package.json +92 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles for Arabic RTL radical rendering via double horizontal reflection.
|
|
3
|
+
* Inject once per document (e.g. append a `<style>` tag).
|
|
4
|
+
*/
|
|
5
|
+
declare const BUTEX_CHROME_CSS: string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Minimal typings for MathJax internals used by BuTeX.
|
|
9
|
+
*/
|
|
10
|
+
interface GlobalMathJax {
|
|
11
|
+
_: {
|
|
12
|
+
input: {
|
|
13
|
+
tex: TexModule;
|
|
14
|
+
};
|
|
15
|
+
output?: {
|
|
16
|
+
svg?: SvgOutputModule;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
config?: {
|
|
20
|
+
tex?: {
|
|
21
|
+
packages?: unknown;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
startup?: {
|
|
25
|
+
output?: {
|
|
26
|
+
factory?: unknown;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Minimal shape of MathJax's SVG output internals that the BuTeX SVG text
|
|
32
|
+
* wrapper swaps into. Everything is optional/loose because we only reach in to
|
|
33
|
+
* replace the `mtext` wrapper class.
|
|
34
|
+
*/
|
|
35
|
+
interface SvgOutputModule {
|
|
36
|
+
WrapperFactory?: {
|
|
37
|
+
SvgWrapperFactory?: unknown;
|
|
38
|
+
};
|
|
39
|
+
Wrappers?: {
|
|
40
|
+
SvgWrappers?: Record<string, unknown>;
|
|
41
|
+
mtext?: {
|
|
42
|
+
SvgMtext?: unknown;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
interface TexModule {
|
|
47
|
+
Configuration: {
|
|
48
|
+
Configuration: {
|
|
49
|
+
create(name: string, config: Record<string, unknown>): unknown;
|
|
50
|
+
};
|
|
51
|
+
ConfigurationHandler: {
|
|
52
|
+
set(name: string, configuration: unknown): void;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
HandlerTypes: {
|
|
56
|
+
HandlerType: {
|
|
57
|
+
MACRO: string;
|
|
58
|
+
};
|
|
59
|
+
ConfigurationType: {
|
|
60
|
+
HANDLER: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
TokenMap: {
|
|
64
|
+
CommandMap: new (name: string, mapping: Record<string, ParseMethod>) => unknown;
|
|
65
|
+
};
|
|
66
|
+
NodeUtil: {
|
|
67
|
+
default: {
|
|
68
|
+
setAttribute(node: unknown, attr: string, value: unknown): void;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
type ParseMethod = (parser: TexParserLike, name: string, ...rest: unknown[]) => void;
|
|
73
|
+
interface TexParserLike {
|
|
74
|
+
stack: {
|
|
75
|
+
env: Record<string, unknown>;
|
|
76
|
+
};
|
|
77
|
+
configuration: unknown;
|
|
78
|
+
GetBrackets(name: string): string;
|
|
79
|
+
GetArgument(name: string): string;
|
|
80
|
+
create(kind: string, ...args: unknown[]): unknown;
|
|
81
|
+
Push(node: unknown): void;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Public configuration package id — must appear in `tex.packages`. */
|
|
85
|
+
declare const BUTEX_TEX_PACKAGE = "butex-arabic-math";
|
|
86
|
+
/**
|
|
87
|
+
* Registers the `\arabsqrt` TeX extension with MathJax.
|
|
88
|
+
*
|
|
89
|
+
* Call **once**, synchronously, inside `MathJax.startup.ready()` **before**
|
|
90
|
+
* `MathJax.startup.defaultReady()`, after TeX input code has loaded (see README).
|
|
91
|
+
*/
|
|
92
|
+
declare function registerBuTeX(mathJax: GlobalMathJax): void;
|
|
93
|
+
|
|
94
|
+
declare const BUTEX_EDITOR_CSS: string;
|
|
95
|
+
/**
|
|
96
|
+
* Injects BuTeX editor surface styles into `document.head` if not already present.
|
|
97
|
+
* Browser-only; no-op if `document` is undefined (Node).
|
|
98
|
+
*/
|
|
99
|
+
declare function injectBuTeXEditorStyles(doc?: Document): void;
|
|
100
|
+
|
|
101
|
+
type EditorSide = 'english' | 'arabic';
|
|
102
|
+
type EditorNodeKind = 'char' | 'number' | 'operator' | 'delimiter' | 'frac' | 'sqrt' | 'env' | 'atomicCommand' | 'atomicOperatorCommand';
|
|
103
|
+
type MatrixEnvStyle = 'matrix' | 'pmatrix' | 'bmatrix' | 'Bmatrix' | 'vmatrix' | 'Vmatrix';
|
|
104
|
+
type GridEnvName = MatrixEnvStyle | 'array' | 'aligned';
|
|
105
|
+
type EnvColumnAlignment = 'l' | 'c' | 'r';
|
|
106
|
+
type CharacterFontId = 'default' | 'takween' | 'diwani' | 'diwaniOutline';
|
|
107
|
+
type DigitFormId = 'western' | 'arabicIndic' | 'persianIndic';
|
|
108
|
+
type EditorSyncState = 'synced' | 'diverged';
|
|
109
|
+
type EditorChain = {
|
|
110
|
+
id: string;
|
|
111
|
+
nodes: EditorNode[];
|
|
112
|
+
};
|
|
113
|
+
type EditorNode = {
|
|
114
|
+
id: string;
|
|
115
|
+
kind: EditorNodeKind;
|
|
116
|
+
expr: string;
|
|
117
|
+
characterFont?: CharacterFontId;
|
|
118
|
+
superscript: EditorChain | null;
|
|
119
|
+
subscript: EditorChain | null;
|
|
120
|
+
leftDelimExpr: string;
|
|
121
|
+
rightDelimExpr: string;
|
|
122
|
+
innerExpr: EditorChain | null;
|
|
123
|
+
numerator: EditorChain | null;
|
|
124
|
+
denominator: EditorChain | null;
|
|
125
|
+
radicand: EditorChain | null;
|
|
126
|
+
rootIndex: EditorChain | null;
|
|
127
|
+
envName: GridEnvName | null;
|
|
128
|
+
matrixStyle: MatrixEnvStyle | null;
|
|
129
|
+
matrixRows: EditorChain[][] | null;
|
|
130
|
+
columnAlignments: EnvColumnAlignment[] | null;
|
|
131
|
+
};
|
|
132
|
+
type EditorCaret = {
|
|
133
|
+
chainId: string;
|
|
134
|
+
index: number;
|
|
135
|
+
};
|
|
136
|
+
type EditorSelectionRange = {
|
|
137
|
+
chainId: string;
|
|
138
|
+
anchorIndex: number;
|
|
139
|
+
focusIndex: number;
|
|
140
|
+
};
|
|
141
|
+
type EditorSyncMap = Record<string, {
|
|
142
|
+
expr: EditorSyncState;
|
|
143
|
+
}>;
|
|
144
|
+
type EditorDebugEntry = {
|
|
145
|
+
timestamp: string;
|
|
146
|
+
command: string;
|
|
147
|
+
activeSide: EditorSide;
|
|
148
|
+
englishLatex: string;
|
|
149
|
+
arabicLatex: string;
|
|
150
|
+
renderOk: boolean;
|
|
151
|
+
renderError: string | null;
|
|
152
|
+
note: string;
|
|
153
|
+
};
|
|
154
|
+
type EditorSession = {
|
|
155
|
+
englishTree: EditorChain;
|
|
156
|
+
arabicTree: EditorChain;
|
|
157
|
+
activeSide: EditorSide;
|
|
158
|
+
/** When true, each typed letter/digit inserts a new char/number leaf; when false, merge into adjacent same-kind leaves. */
|
|
159
|
+
splitLeafTyping: boolean;
|
|
160
|
+
/** One-shot: when true, the next insertChar/insertNumber bypasses leaf-merge (used by Space in merge mode). */
|
|
161
|
+
forceSplitNextLeaf: boolean;
|
|
162
|
+
/** When true and active side is Arabic, merged number typing prepends digits (RTL-style); still mirrored on EN/AR. */
|
|
163
|
+
arabicReverseNumberTyping: boolean;
|
|
164
|
+
/** Font applied to newly typed char nodes. */
|
|
165
|
+
currentCharacterFont: CharacterFontId;
|
|
166
|
+
/** Digit glyph form used for editor display and LaTeX preview output. */
|
|
167
|
+
currentDigitForm: DigitFormId;
|
|
168
|
+
caret: EditorCaret;
|
|
169
|
+
/** Whole-node range selection inside a single chain (anchor==focus means no selection). */
|
|
170
|
+
selection: EditorSelectionRange | null;
|
|
171
|
+
selectedNodeId: string | null;
|
|
172
|
+
selectedStructureNodeId: string | null;
|
|
173
|
+
sync: EditorSyncMap;
|
|
174
|
+
debugLog: EditorDebugEntry[];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
declare const ATOMIC_COMMANDS: {
|
|
178
|
+
readonly cos: {
|
|
179
|
+
readonly id: "cos";
|
|
180
|
+
readonly category: "function";
|
|
181
|
+
readonly englishTex: "\\cos";
|
|
182
|
+
readonly arabicTex: "\\arcos";
|
|
183
|
+
readonly arabicLabel: "جتا";
|
|
184
|
+
readonly title: "جيب التمام";
|
|
185
|
+
};
|
|
186
|
+
readonly sin: {
|
|
187
|
+
readonly id: "sin";
|
|
188
|
+
readonly category: "function";
|
|
189
|
+
readonly englishTex: "\\sin";
|
|
190
|
+
readonly arabicTex: "\\arsin";
|
|
191
|
+
readonly arabicLabel: "جا";
|
|
192
|
+
readonly title: "جيب";
|
|
193
|
+
};
|
|
194
|
+
readonly tan: {
|
|
195
|
+
readonly id: "tan";
|
|
196
|
+
readonly category: "function";
|
|
197
|
+
readonly englishTex: "\\tan";
|
|
198
|
+
readonly arabicTex: "\\artan";
|
|
199
|
+
readonly arabicLabel: "ظا";
|
|
200
|
+
readonly title: "ظل";
|
|
201
|
+
};
|
|
202
|
+
readonly cot: {
|
|
203
|
+
readonly id: "cot";
|
|
204
|
+
readonly category: "function";
|
|
205
|
+
readonly englishTex: "\\cot";
|
|
206
|
+
readonly arabicTex: "\\arcot";
|
|
207
|
+
readonly arabicLabel: "ظتا";
|
|
208
|
+
readonly title: "ظل تمام";
|
|
209
|
+
};
|
|
210
|
+
readonly sec: {
|
|
211
|
+
readonly id: "sec";
|
|
212
|
+
readonly category: "function";
|
|
213
|
+
readonly englishTex: "\\sec";
|
|
214
|
+
readonly arabicTex: "\\arsec";
|
|
215
|
+
readonly arabicLabel: "قا";
|
|
216
|
+
readonly title: "قاطع";
|
|
217
|
+
};
|
|
218
|
+
readonly csc: {
|
|
219
|
+
readonly id: "csc";
|
|
220
|
+
readonly category: "function";
|
|
221
|
+
readonly englishTex: "\\csc";
|
|
222
|
+
readonly arabicTex: "\\arcsc";
|
|
223
|
+
readonly arabicLabel: "قتا";
|
|
224
|
+
readonly title: "قاطع تمام";
|
|
225
|
+
};
|
|
226
|
+
readonly arccos: {
|
|
227
|
+
readonly id: "arccos";
|
|
228
|
+
readonly category: "function";
|
|
229
|
+
readonly englishTex: "\\arccos";
|
|
230
|
+
readonly arabicTex: "\\aracos";
|
|
231
|
+
readonly arabicLabel: "قجتا";
|
|
232
|
+
readonly title: "قاطع جيب التمام";
|
|
233
|
+
};
|
|
234
|
+
readonly arcsin: {
|
|
235
|
+
readonly id: "arcsin";
|
|
236
|
+
readonly category: "function";
|
|
237
|
+
readonly englishTex: "\\arcsin";
|
|
238
|
+
readonly arabicTex: "\\arasin";
|
|
239
|
+
readonly arabicLabel: "قجا";
|
|
240
|
+
readonly title: "قاطع جيب";
|
|
241
|
+
};
|
|
242
|
+
readonly arctan: {
|
|
243
|
+
readonly id: "arctan";
|
|
244
|
+
readonly category: "function";
|
|
245
|
+
readonly englishTex: "\\arctan";
|
|
246
|
+
readonly arabicTex: "\\aratan";
|
|
247
|
+
readonly arabicLabel: "قظا";
|
|
248
|
+
readonly title: "قاطع ظل";
|
|
249
|
+
};
|
|
250
|
+
readonly arccot: {
|
|
251
|
+
readonly id: "arccot";
|
|
252
|
+
readonly category: "function";
|
|
253
|
+
readonly englishTex: "\\arccot";
|
|
254
|
+
readonly arabicTex: "\\aracot";
|
|
255
|
+
readonly arabicLabel: "قظتا";
|
|
256
|
+
readonly title: "قاطع ظل التمام";
|
|
257
|
+
};
|
|
258
|
+
readonly arcsec: {
|
|
259
|
+
readonly id: "arcsec";
|
|
260
|
+
readonly category: "function";
|
|
261
|
+
readonly englishTex: "\\arcsec";
|
|
262
|
+
readonly arabicTex: "\\arasec";
|
|
263
|
+
readonly arabicLabel: "ققا";
|
|
264
|
+
readonly title: "قاطع القاطع";
|
|
265
|
+
};
|
|
266
|
+
readonly arccsc: {
|
|
267
|
+
readonly id: "arccsc";
|
|
268
|
+
readonly category: "function";
|
|
269
|
+
readonly englishTex: "\\arccsc";
|
|
270
|
+
readonly arabicTex: "\\aracsc";
|
|
271
|
+
readonly arabicLabel: "ققتا";
|
|
272
|
+
readonly title: "قاطع القاطع التمام";
|
|
273
|
+
};
|
|
274
|
+
readonly cosh: {
|
|
275
|
+
readonly id: "cosh";
|
|
276
|
+
readonly category: "function";
|
|
277
|
+
readonly englishTex: "\\cosh";
|
|
278
|
+
readonly arabicTex: "\\arcosh";
|
|
279
|
+
readonly arabicLabel: "جتزا";
|
|
280
|
+
readonly title: "جيب التمام الزائد";
|
|
281
|
+
};
|
|
282
|
+
readonly sinh: {
|
|
283
|
+
readonly id: "sinh";
|
|
284
|
+
readonly category: "function";
|
|
285
|
+
readonly englishTex: "\\sinh";
|
|
286
|
+
readonly arabicTex: "\\arsinh";
|
|
287
|
+
readonly arabicLabel: "جزا";
|
|
288
|
+
readonly title: "جيب الزائد";
|
|
289
|
+
};
|
|
290
|
+
readonly tanh: {
|
|
291
|
+
readonly id: "tanh";
|
|
292
|
+
readonly category: "function";
|
|
293
|
+
readonly englishTex: "\\tanh";
|
|
294
|
+
readonly arabicTex: "\\artanh";
|
|
295
|
+
readonly arabicLabel: "ظزا";
|
|
296
|
+
readonly title: "ظل الزائد";
|
|
297
|
+
};
|
|
298
|
+
readonly coth: {
|
|
299
|
+
readonly id: "coth";
|
|
300
|
+
readonly category: "function";
|
|
301
|
+
readonly englishTex: "\\coth";
|
|
302
|
+
readonly arabicTex: "\\arcoth";
|
|
303
|
+
readonly arabicLabel: "ظتزا";
|
|
304
|
+
readonly title: "ظل تمام الزائد";
|
|
305
|
+
};
|
|
306
|
+
readonly sum: {
|
|
307
|
+
readonly id: "sum";
|
|
308
|
+
readonly category: "limits_series";
|
|
309
|
+
readonly englishTex: "\\sum";
|
|
310
|
+
readonly arabicTex: "\\arsum";
|
|
311
|
+
readonly arabicLabel: "مجـــ";
|
|
312
|
+
readonly title: "مجموع";
|
|
313
|
+
};
|
|
314
|
+
readonly prod: {
|
|
315
|
+
readonly id: "prod";
|
|
316
|
+
readonly category: "limits_series";
|
|
317
|
+
readonly englishTex: "\\prod";
|
|
318
|
+
readonly arabicTex: "\\arprod";
|
|
319
|
+
readonly arabicLabel: "جـــد";
|
|
320
|
+
readonly title: "جداء";
|
|
321
|
+
};
|
|
322
|
+
readonly lim: {
|
|
323
|
+
readonly id: "lim";
|
|
324
|
+
readonly category: "limits_series";
|
|
325
|
+
readonly englishTex: "\\lim";
|
|
326
|
+
readonly arabicTex: "\\arlim";
|
|
327
|
+
readonly arabicLabel: "نـــــها";
|
|
328
|
+
readonly title: "حد";
|
|
329
|
+
};
|
|
330
|
+
readonly max: {
|
|
331
|
+
readonly id: "max";
|
|
332
|
+
readonly category: "limits_series";
|
|
333
|
+
readonly englishTex: "\\max";
|
|
334
|
+
readonly arabicTex: "\\armax";
|
|
335
|
+
readonly arabicLabel: "أكبر";
|
|
336
|
+
readonly title: "أكبر";
|
|
337
|
+
};
|
|
338
|
+
readonly min: {
|
|
339
|
+
readonly id: "min";
|
|
340
|
+
readonly category: "limits_series";
|
|
341
|
+
readonly englishTex: "\\min";
|
|
342
|
+
readonly arabicTex: "\\armin";
|
|
343
|
+
readonly arabicLabel: "أصغر";
|
|
344
|
+
readonly title: "أصغر";
|
|
345
|
+
};
|
|
346
|
+
readonly sup: {
|
|
347
|
+
readonly id: "sup";
|
|
348
|
+
readonly category: "limits_series";
|
|
349
|
+
readonly englishTex: "\\sup";
|
|
350
|
+
readonly arabicTex: "\\arsup";
|
|
351
|
+
readonly arabicLabel: "أعلى";
|
|
352
|
+
readonly title: "أعلى";
|
|
353
|
+
};
|
|
354
|
+
readonly inf: {
|
|
355
|
+
readonly id: "inf";
|
|
356
|
+
readonly category: "limits_series";
|
|
357
|
+
readonly englishTex: "\\inf";
|
|
358
|
+
readonly arabicTex: "\\arinf";
|
|
359
|
+
readonly arabicLabel: "أدنى";
|
|
360
|
+
readonly title: "أدنى";
|
|
361
|
+
};
|
|
362
|
+
readonly pi: {
|
|
363
|
+
readonly id: "pi";
|
|
364
|
+
readonly category: "function2";
|
|
365
|
+
readonly englishTex: "\\pi";
|
|
366
|
+
readonly arabicTex: "\\arpi";
|
|
367
|
+
readonly arabicLabel: "ط";
|
|
368
|
+
readonly title: "نسبة الدائرة";
|
|
369
|
+
};
|
|
370
|
+
readonly exp: {
|
|
371
|
+
readonly id: "exp";
|
|
372
|
+
readonly category: "function2";
|
|
373
|
+
readonly englishTex: "\\exp";
|
|
374
|
+
readonly arabicTex: "\\arexp";
|
|
375
|
+
readonly arabicLabel: "هـ";
|
|
376
|
+
readonly title: "أسية";
|
|
377
|
+
};
|
|
378
|
+
readonly ln: {
|
|
379
|
+
readonly id: "ln";
|
|
380
|
+
readonly category: "function2";
|
|
381
|
+
readonly englishTex: "\\ln";
|
|
382
|
+
readonly arabicTex: "\\arln";
|
|
383
|
+
readonly arabicRenderTex: "\\prescript{}{\\arexp}{\\arlog}";
|
|
384
|
+
readonly arabicLabel: "لو";
|
|
385
|
+
readonly title: "لوغاريتم طبيعي";
|
|
386
|
+
};
|
|
387
|
+
readonly log: {
|
|
388
|
+
readonly id: "log";
|
|
389
|
+
readonly category: "function2";
|
|
390
|
+
readonly englishTex: "\\log";
|
|
391
|
+
readonly arabicTex: "\\arlog";
|
|
392
|
+
readonly arabicLabel: "لو";
|
|
393
|
+
readonly title: "لوغاريتم";
|
|
394
|
+
};
|
|
395
|
+
readonly det: {
|
|
396
|
+
readonly id: "det";
|
|
397
|
+
readonly category: "function2";
|
|
398
|
+
readonly englishTex: "\\det";
|
|
399
|
+
readonly arabicTex: "\\ardet";
|
|
400
|
+
readonly arabicLabel: "محدد";
|
|
401
|
+
readonly title: "محدد";
|
|
402
|
+
};
|
|
403
|
+
readonly N: {
|
|
404
|
+
readonly id: "N";
|
|
405
|
+
readonly category: "groups";
|
|
406
|
+
readonly englishTex: "\\mathbb{N}";
|
|
407
|
+
readonly arabicTex: "\\arabN";
|
|
408
|
+
readonly arabicLabel: "ط";
|
|
409
|
+
readonly title: "أعداد طبيعية";
|
|
410
|
+
};
|
|
411
|
+
readonly Z: {
|
|
412
|
+
readonly id: "Z";
|
|
413
|
+
readonly category: "groups";
|
|
414
|
+
readonly englishTex: "\\mathbb{Z}";
|
|
415
|
+
readonly arabicTex: "\\arabZ";
|
|
416
|
+
readonly arabicLabel: "ص";
|
|
417
|
+
readonly title: "أعداد صحيحة";
|
|
418
|
+
};
|
|
419
|
+
readonly Q: {
|
|
420
|
+
readonly id: "Q";
|
|
421
|
+
readonly category: "groups";
|
|
422
|
+
readonly englishTex: "\\mathbb{Q}";
|
|
423
|
+
readonly arabicTex: "\\arabQ";
|
|
424
|
+
readonly arabicLabel: "ن";
|
|
425
|
+
readonly title: "أعداد نسبية";
|
|
426
|
+
};
|
|
427
|
+
readonly R: {
|
|
428
|
+
readonly id: "R";
|
|
429
|
+
readonly category: "groups";
|
|
430
|
+
readonly englishTex: "\\mathbb{R}";
|
|
431
|
+
readonly arabicTex: "\\arabR";
|
|
432
|
+
readonly arabicLabel: "ح";
|
|
433
|
+
readonly title: "أعداد حقيقية";
|
|
434
|
+
};
|
|
435
|
+
readonly C: {
|
|
436
|
+
readonly id: "C";
|
|
437
|
+
readonly category: "groups";
|
|
438
|
+
readonly englishTex: "\\mathbb{C}";
|
|
439
|
+
readonly arabicTex: "\\arabC";
|
|
440
|
+
readonly arabicLabel: "ع";
|
|
441
|
+
readonly title: "أعداد عُقدية";
|
|
442
|
+
};
|
|
443
|
+
readonly H: {
|
|
444
|
+
readonly id: "H";
|
|
445
|
+
readonly category: "groups";
|
|
446
|
+
readonly englishTex: "\\mathbb{H}";
|
|
447
|
+
readonly arabicTex: "\\arabH";
|
|
448
|
+
readonly arabicLabel: "ر";
|
|
449
|
+
readonly title: "أعداد رباعية";
|
|
450
|
+
};
|
|
451
|
+
readonly negThinSpace: {
|
|
452
|
+
readonly id: "negThinSpace";
|
|
453
|
+
readonly category: "spacing";
|
|
454
|
+
readonly englishTex: "\\!";
|
|
455
|
+
readonly arabicTex: "\\!";
|
|
456
|
+
readonly arabicLabel: "";
|
|
457
|
+
readonly title: "فراغ سالب رفيع";
|
|
458
|
+
readonly spacing: {
|
|
459
|
+
readonly direction: "negative";
|
|
460
|
+
readonly level: 1;
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
readonly mediumSpace: {
|
|
464
|
+
readonly id: "mediumSpace";
|
|
465
|
+
readonly category: "spacing";
|
|
466
|
+
readonly englishTex: "\\:";
|
|
467
|
+
readonly arabicTex: "\\:";
|
|
468
|
+
readonly arabicLabel: "";
|
|
469
|
+
readonly title: "فراغ متوسط";
|
|
470
|
+
readonly spacing: {
|
|
471
|
+
readonly direction: "positive";
|
|
472
|
+
readonly level: 1;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
readonly thickSpace: {
|
|
476
|
+
readonly id: "thickSpace";
|
|
477
|
+
readonly category: "spacing";
|
|
478
|
+
readonly englishTex: "\\;";
|
|
479
|
+
readonly arabicTex: "\\;";
|
|
480
|
+
readonly arabicLabel: "";
|
|
481
|
+
readonly title: "فراغ عريض";
|
|
482
|
+
readonly spacing: {
|
|
483
|
+
readonly direction: "positive";
|
|
484
|
+
readonly level: 2;
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
readonly quadSpace: {
|
|
488
|
+
readonly id: "quadSpace";
|
|
489
|
+
readonly category: "spacing";
|
|
490
|
+
readonly englishTex: "\\quad";
|
|
491
|
+
readonly arabicTex: "\\quad";
|
|
492
|
+
readonly arabicLabel: "";
|
|
493
|
+
readonly title: "فراغ كبير";
|
|
494
|
+
readonly spacing: {
|
|
495
|
+
readonly direction: "positive";
|
|
496
|
+
readonly level: 3;
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
readonly qquadSpace: {
|
|
500
|
+
readonly id: "qquadSpace";
|
|
501
|
+
readonly category: "spacing";
|
|
502
|
+
readonly englishTex: "\\qquad";
|
|
503
|
+
readonly arabicTex: "\\qquad";
|
|
504
|
+
readonly arabicLabel: "";
|
|
505
|
+
readonly title: "فراغ كبير جدا";
|
|
506
|
+
readonly spacing: {
|
|
507
|
+
readonly direction: "positive";
|
|
508
|
+
readonly level: 4;
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
type AtomicCommandId = keyof typeof ATOMIC_COMMANDS;
|
|
513
|
+
type AtomicCommandCategory = 'function' | 'function2' | 'limits_series' | 'groups' | 'spacing';
|
|
514
|
+
type SpacingDirection = 'positive' | 'negative';
|
|
515
|
+
type AtomicCommandSpec = (typeof ATOMIC_COMMANDS)[AtomicCommandId] & {
|
|
516
|
+
arabicRenderTex?: string;
|
|
517
|
+
};
|
|
518
|
+
type SpacingCommandSpec = AtomicCommandSpec & {
|
|
519
|
+
category: 'spacing';
|
|
520
|
+
spacing: {
|
|
521
|
+
direction: SpacingDirection;
|
|
522
|
+
level: 1 | 2 | 3 | 4;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
declare function atomicCommandsByCategory(category: AtomicCommandCategory): AtomicCommandSpec[];
|
|
526
|
+
declare function isSpacingCommandSpec(spec: AtomicCommandSpec | null): spec is SpacingCommandSpec;
|
|
527
|
+
declare function atomicCommandSpec(id: string): AtomicCommandSpec | null;
|
|
528
|
+
|
|
529
|
+
declare const ATOMIC_OPERATOR_COMMANDS: {
|
|
530
|
+
readonly inf: {
|
|
531
|
+
readonly id: "inf";
|
|
532
|
+
readonly category: "operators1";
|
|
533
|
+
readonly Tex: "\\infty";
|
|
534
|
+
readonly mirror: true;
|
|
535
|
+
readonly Label: "∞";
|
|
536
|
+
readonly title: "اللانهاية";
|
|
537
|
+
readonly svg_path: null;
|
|
538
|
+
};
|
|
539
|
+
readonly times: {
|
|
540
|
+
readonly id: "times";
|
|
541
|
+
readonly category: "operators1";
|
|
542
|
+
readonly Tex: "\\times";
|
|
543
|
+
readonly mirror: false;
|
|
544
|
+
readonly Label: "×";
|
|
545
|
+
readonly title: "ضرب";
|
|
546
|
+
readonly svg_path: null;
|
|
547
|
+
};
|
|
548
|
+
readonly div: {
|
|
549
|
+
readonly id: "div";
|
|
550
|
+
readonly category: "operators1";
|
|
551
|
+
readonly Tex: "\\div";
|
|
552
|
+
readonly mirror: false;
|
|
553
|
+
readonly Label: "÷";
|
|
554
|
+
readonly title: "قسمة";
|
|
555
|
+
readonly svg_path: null;
|
|
556
|
+
};
|
|
557
|
+
readonly pm: {
|
|
558
|
+
readonly id: "pm";
|
|
559
|
+
readonly category: "operators1";
|
|
560
|
+
readonly Tex: "\\pm";
|
|
561
|
+
readonly mirror: false;
|
|
562
|
+
readonly Label: "±";
|
|
563
|
+
readonly title: "زائد أو ناقص";
|
|
564
|
+
readonly svg_path: null;
|
|
565
|
+
};
|
|
566
|
+
readonly mp: {
|
|
567
|
+
readonly id: "mp";
|
|
568
|
+
readonly category: "operators1";
|
|
569
|
+
readonly Tex: "\\mp";
|
|
570
|
+
readonly mirror: false;
|
|
571
|
+
readonly Label: "∓";
|
|
572
|
+
readonly title: "ناقص أو زائد";
|
|
573
|
+
readonly svg_path: null;
|
|
574
|
+
};
|
|
575
|
+
readonly neq: {
|
|
576
|
+
readonly id: "neq";
|
|
577
|
+
readonly category: "operators1";
|
|
578
|
+
readonly Tex: "\\neq";
|
|
579
|
+
readonly mirror: false;
|
|
580
|
+
readonly Label: "≠";
|
|
581
|
+
readonly title: "لا يساوي";
|
|
582
|
+
readonly svg_path: null;
|
|
583
|
+
};
|
|
584
|
+
readonly approx: {
|
|
585
|
+
readonly id: "approx";
|
|
586
|
+
readonly category: "operators1";
|
|
587
|
+
readonly Tex: "\\approx";
|
|
588
|
+
readonly mirror: false;
|
|
589
|
+
readonly Label: "≈";
|
|
590
|
+
readonly title: "تقريبا يساوي";
|
|
591
|
+
readonly svg_path: null;
|
|
592
|
+
};
|
|
593
|
+
readonly sim: {
|
|
594
|
+
readonly id: "sim";
|
|
595
|
+
readonly category: "operators1";
|
|
596
|
+
readonly Tex: "\\sim";
|
|
597
|
+
readonly mirror: false;
|
|
598
|
+
readonly Label: "∼";
|
|
599
|
+
readonly title: "مشابه";
|
|
600
|
+
readonly svg_path: null;
|
|
601
|
+
};
|
|
602
|
+
readonly mid: {
|
|
603
|
+
readonly id: "mid";
|
|
604
|
+
readonly category: "operators1";
|
|
605
|
+
readonly Tex: "\\mid";
|
|
606
|
+
readonly mirror: false;
|
|
607
|
+
readonly Label: "∣";
|
|
608
|
+
readonly title: "يقسم";
|
|
609
|
+
readonly svg_path: null;
|
|
610
|
+
};
|
|
611
|
+
readonly leq: {
|
|
612
|
+
readonly id: "leq";
|
|
613
|
+
readonly category: "operators1";
|
|
614
|
+
readonly Tex: "\\leq";
|
|
615
|
+
readonly mirror: true;
|
|
616
|
+
readonly Label: "≤";
|
|
617
|
+
readonly title: "أصغر من أو يساوي";
|
|
618
|
+
readonly svg_path: null;
|
|
619
|
+
};
|
|
620
|
+
readonly geq: {
|
|
621
|
+
readonly id: "geq";
|
|
622
|
+
readonly category: "operators1";
|
|
623
|
+
readonly Tex: "\\geq";
|
|
624
|
+
readonly mirror: true;
|
|
625
|
+
readonly Label: "≥";
|
|
626
|
+
readonly title: "أكبر من أو يساوي";
|
|
627
|
+
readonly svg_path: null;
|
|
628
|
+
};
|
|
629
|
+
readonly propto: {
|
|
630
|
+
readonly id: "propto";
|
|
631
|
+
readonly category: "operators2";
|
|
632
|
+
readonly Tex: "\\propto";
|
|
633
|
+
readonly mirror: true;
|
|
634
|
+
readonly Label: "∝";
|
|
635
|
+
readonly title: "يتناسب مع";
|
|
636
|
+
readonly svg_path: null;
|
|
637
|
+
};
|
|
638
|
+
readonly in: {
|
|
639
|
+
readonly id: "in";
|
|
640
|
+
readonly category: "operators2";
|
|
641
|
+
readonly Tex: "\\in";
|
|
642
|
+
readonly mirror: true;
|
|
643
|
+
readonly Label: "∈";
|
|
644
|
+
readonly title: "ينتمي إلى";
|
|
645
|
+
readonly svg_path: null;
|
|
646
|
+
};
|
|
647
|
+
readonly notin: {
|
|
648
|
+
readonly id: "notin";
|
|
649
|
+
readonly category: "operators2";
|
|
650
|
+
readonly Tex: "\\notin";
|
|
651
|
+
readonly mirror: false;
|
|
652
|
+
readonly Label: "∉";
|
|
653
|
+
readonly title: "لا ينتمي إلى";
|
|
654
|
+
readonly svg_path: null;
|
|
655
|
+
};
|
|
656
|
+
readonly subset: {
|
|
657
|
+
readonly id: "subset";
|
|
658
|
+
readonly category: "operators2";
|
|
659
|
+
readonly Tex: "\\subset";
|
|
660
|
+
readonly mirror: true;
|
|
661
|
+
readonly Label: "⊂";
|
|
662
|
+
readonly title: "مجموعة جزئية من";
|
|
663
|
+
readonly svg_path: null;
|
|
664
|
+
};
|
|
665
|
+
readonly supset: {
|
|
666
|
+
readonly id: "supset";
|
|
667
|
+
readonly category: "operators2";
|
|
668
|
+
readonly Tex: "\\supset";
|
|
669
|
+
readonly mirror: true;
|
|
670
|
+
readonly Label: "⊃";
|
|
671
|
+
readonly title: "مجموعة شاملة لـ";
|
|
672
|
+
readonly svg_path: null;
|
|
673
|
+
};
|
|
674
|
+
readonly subseteq: {
|
|
675
|
+
readonly id: "subseteq";
|
|
676
|
+
readonly category: "operators2";
|
|
677
|
+
readonly Tex: "\\subseteq";
|
|
678
|
+
readonly mirror: true;
|
|
679
|
+
readonly Label: "⊆";
|
|
680
|
+
readonly title: "مجموعة جزئية أو تساوي";
|
|
681
|
+
readonly svg_path: null;
|
|
682
|
+
};
|
|
683
|
+
readonly supseteq: {
|
|
684
|
+
readonly id: "supseteq";
|
|
685
|
+
readonly category: "operators2";
|
|
686
|
+
readonly Tex: "\\supseteq";
|
|
687
|
+
readonly mirror: true;
|
|
688
|
+
readonly Label: "⊇";
|
|
689
|
+
readonly title: "مجموعة شاملة أو تساوي";
|
|
690
|
+
readonly svg_path: null;
|
|
691
|
+
};
|
|
692
|
+
readonly cap: {
|
|
693
|
+
readonly id: "cap";
|
|
694
|
+
readonly category: "operators2";
|
|
695
|
+
readonly Tex: "\\cap";
|
|
696
|
+
readonly mirror: false;
|
|
697
|
+
readonly Label: "∩";
|
|
698
|
+
readonly title: "تقاطع";
|
|
699
|
+
readonly svg_path: null;
|
|
700
|
+
};
|
|
701
|
+
readonly cup: {
|
|
702
|
+
readonly id: "cup";
|
|
703
|
+
readonly category: "operators2";
|
|
704
|
+
readonly Tex: "\\cup";
|
|
705
|
+
readonly mirror: false;
|
|
706
|
+
readonly Label: "∪";
|
|
707
|
+
readonly title: "اتحاد";
|
|
708
|
+
readonly svg_path: null;
|
|
709
|
+
};
|
|
710
|
+
readonly emptyset: {
|
|
711
|
+
readonly id: "emptyset";
|
|
712
|
+
readonly category: "operators2";
|
|
713
|
+
readonly Tex: "\\emptyset";
|
|
714
|
+
readonly mirror: false;
|
|
715
|
+
readonly Label: "∅";
|
|
716
|
+
readonly title: "المجموعة الخالية";
|
|
717
|
+
readonly svg_path: null;
|
|
718
|
+
};
|
|
719
|
+
readonly nsubseteq: {
|
|
720
|
+
readonly id: "nsubseteq";
|
|
721
|
+
readonly category: "operators2";
|
|
722
|
+
readonly Tex: "\\nsubseteq";
|
|
723
|
+
readonly mirror: true;
|
|
724
|
+
readonly Label: "⊈";
|
|
725
|
+
readonly title: "ليست مجموعة جزئية أو تساوي";
|
|
726
|
+
readonly svg_path: null;
|
|
727
|
+
};
|
|
728
|
+
readonly nsupseteq: {
|
|
729
|
+
readonly id: "nsupseteq";
|
|
730
|
+
readonly category: "operators2";
|
|
731
|
+
readonly Tex: "\\nsupseteq";
|
|
732
|
+
readonly mirror: true;
|
|
733
|
+
readonly Label: "⊉";
|
|
734
|
+
readonly title: "ليست مجموعة شاملة أو تساوي";
|
|
735
|
+
readonly svg_path: null;
|
|
736
|
+
};
|
|
737
|
+
readonly ldots: {
|
|
738
|
+
readonly id: "ldots";
|
|
739
|
+
readonly category: "dots";
|
|
740
|
+
readonly Tex: "\\ldots";
|
|
741
|
+
readonly mirror: false;
|
|
742
|
+
readonly Label: "…";
|
|
743
|
+
readonly title: "نقاط أفقية";
|
|
744
|
+
readonly svg_path: null;
|
|
745
|
+
};
|
|
746
|
+
readonly cdot: {
|
|
747
|
+
readonly id: "cdot";
|
|
748
|
+
readonly category: "dots";
|
|
749
|
+
readonly Tex: "\\cdot";
|
|
750
|
+
readonly mirror: false;
|
|
751
|
+
readonly Label: "·";
|
|
752
|
+
readonly title: "نقطة ضرب";
|
|
753
|
+
readonly svg_path: null;
|
|
754
|
+
};
|
|
755
|
+
readonly cdots: {
|
|
756
|
+
readonly id: "cdots";
|
|
757
|
+
readonly category: "dots";
|
|
758
|
+
readonly Tex: "\\cdots";
|
|
759
|
+
readonly mirror: false;
|
|
760
|
+
readonly Label: "⋯";
|
|
761
|
+
readonly title: "نقاط وسطية أفقية";
|
|
762
|
+
readonly svg_path: null;
|
|
763
|
+
};
|
|
764
|
+
readonly vdots: {
|
|
765
|
+
readonly id: "vdots";
|
|
766
|
+
readonly category: "dots";
|
|
767
|
+
readonly Tex: "\\vdots";
|
|
768
|
+
readonly mirror: false;
|
|
769
|
+
readonly Label: "⋮";
|
|
770
|
+
readonly title: "نقاط عمودية";
|
|
771
|
+
readonly svg_path: null;
|
|
772
|
+
};
|
|
773
|
+
readonly ddots: {
|
|
774
|
+
readonly id: "ddots";
|
|
775
|
+
readonly category: "dots";
|
|
776
|
+
readonly Tex: "\\ddots";
|
|
777
|
+
readonly mirror: true;
|
|
778
|
+
readonly displayMirror: false;
|
|
779
|
+
readonly Label: "⋱";
|
|
780
|
+
readonly title: "نقاط قطرية";
|
|
781
|
+
readonly svg_path: null;
|
|
782
|
+
};
|
|
783
|
+
readonly leftrightarrowDouble: {
|
|
784
|
+
readonly id: "leftrightarrowDouble";
|
|
785
|
+
readonly category: "operators3";
|
|
786
|
+
readonly Tex: "\\Leftrightarrow";
|
|
787
|
+
readonly mirror: false;
|
|
788
|
+
readonly Label: "⇔";
|
|
789
|
+
readonly title: "يكافئ";
|
|
790
|
+
readonly svg_path: null;
|
|
791
|
+
};
|
|
792
|
+
readonly rightleftharpoons: {
|
|
793
|
+
readonly id: "rightleftharpoons";
|
|
794
|
+
readonly category: "operators3";
|
|
795
|
+
readonly Tex: "\\rightleftharpoons";
|
|
796
|
+
readonly mirror: true;
|
|
797
|
+
readonly Label: "⇌";
|
|
798
|
+
readonly title: "اتزان";
|
|
799
|
+
readonly svg_path: null;
|
|
800
|
+
};
|
|
801
|
+
readonly leftarrow: {
|
|
802
|
+
readonly id: "leftarrow";
|
|
803
|
+
readonly category: "operators3";
|
|
804
|
+
readonly Tex: "\\leftarrow";
|
|
805
|
+
readonly mirror: true;
|
|
806
|
+
readonly Label: "←";
|
|
807
|
+
readonly title: "سهم إلى اليسار";
|
|
808
|
+
readonly svg_path: null;
|
|
809
|
+
};
|
|
810
|
+
readonly rightarrow: {
|
|
811
|
+
readonly id: "rightarrow";
|
|
812
|
+
readonly category: "operators3";
|
|
813
|
+
readonly Tex: "\\rightarrow";
|
|
814
|
+
readonly mirror: true;
|
|
815
|
+
readonly Label: "→";
|
|
816
|
+
readonly title: "سهم إلى اليمين";
|
|
817
|
+
readonly svg_path: null;
|
|
818
|
+
};
|
|
819
|
+
readonly leftarrowDouble: {
|
|
820
|
+
readonly id: "leftarrowDouble";
|
|
821
|
+
readonly category: "operators3";
|
|
822
|
+
readonly Tex: "\\Leftarrow";
|
|
823
|
+
readonly mirror: true;
|
|
824
|
+
readonly Label: "⇐";
|
|
825
|
+
readonly title: "سهم مزدوج إلى اليسار";
|
|
826
|
+
readonly svg_path: null;
|
|
827
|
+
};
|
|
828
|
+
readonly rightarrowDouble: {
|
|
829
|
+
readonly id: "rightarrowDouble";
|
|
830
|
+
readonly category: "operators3";
|
|
831
|
+
readonly Tex: "\\Rightarrow";
|
|
832
|
+
readonly mirror: true;
|
|
833
|
+
readonly Label: "⇒";
|
|
834
|
+
readonly title: "سهم مزدوج إلى اليمين";
|
|
835
|
+
readonly svg_path: null;
|
|
836
|
+
};
|
|
837
|
+
readonly leftharpoonup: {
|
|
838
|
+
readonly id: "leftharpoonup";
|
|
839
|
+
readonly category: "operators3";
|
|
840
|
+
readonly Tex: "\\leftharpoonup";
|
|
841
|
+
readonly mirror: true;
|
|
842
|
+
readonly Label: "↼";
|
|
843
|
+
readonly title: "سهم خطافي علوي إلى اليسار";
|
|
844
|
+
readonly svg_path: null;
|
|
845
|
+
};
|
|
846
|
+
readonly rightharpoonup: {
|
|
847
|
+
readonly id: "rightharpoonup";
|
|
848
|
+
readonly category: "operators3";
|
|
849
|
+
readonly Tex: "\\rightharpoonup";
|
|
850
|
+
readonly mirror: true;
|
|
851
|
+
readonly Label: "⇀";
|
|
852
|
+
readonly title: "سهم خطافي علوي إلى اليمين";
|
|
853
|
+
readonly svg_path: null;
|
|
854
|
+
};
|
|
855
|
+
readonly leftharpoondown: {
|
|
856
|
+
readonly id: "leftharpoondown";
|
|
857
|
+
readonly category: "operators3";
|
|
858
|
+
readonly Tex: "\\leftharpoondown";
|
|
859
|
+
readonly mirror: true;
|
|
860
|
+
readonly Label: "↽";
|
|
861
|
+
readonly title: "سهم خطافي سفلي إلى اليسار";
|
|
862
|
+
readonly svg_path: null;
|
|
863
|
+
};
|
|
864
|
+
readonly rightharpoondown: {
|
|
865
|
+
readonly id: "rightharpoondown";
|
|
866
|
+
readonly category: "operators3";
|
|
867
|
+
readonly Tex: "\\rightharpoondown";
|
|
868
|
+
readonly mirror: true;
|
|
869
|
+
readonly Label: "⇁";
|
|
870
|
+
readonly title: "سهم خطافي سفلي إلى اليمين";
|
|
871
|
+
readonly svg_path: null;
|
|
872
|
+
};
|
|
873
|
+
readonly int: {
|
|
874
|
+
readonly id: "int";
|
|
875
|
+
readonly category: "integrals";
|
|
876
|
+
readonly Tex: "\\int";
|
|
877
|
+
readonly mirror: true;
|
|
878
|
+
readonly Label: "∫";
|
|
879
|
+
readonly title: "تكامل";
|
|
880
|
+
readonly svg_path: null;
|
|
881
|
+
};
|
|
882
|
+
readonly iint: {
|
|
883
|
+
readonly id: "iint";
|
|
884
|
+
readonly category: "integrals";
|
|
885
|
+
readonly Tex: "\\iint";
|
|
886
|
+
readonly mirror: true;
|
|
887
|
+
readonly Label: "∬";
|
|
888
|
+
readonly title: "تكامل مزدوج";
|
|
889
|
+
readonly svg_path: null;
|
|
890
|
+
};
|
|
891
|
+
readonly iiint: {
|
|
892
|
+
readonly id: "iiint";
|
|
893
|
+
readonly category: "integrals";
|
|
894
|
+
readonly Tex: "\\iiint";
|
|
895
|
+
readonly mirror: true;
|
|
896
|
+
readonly Label: "∭";
|
|
897
|
+
readonly title: "تكامل ثلاثي";
|
|
898
|
+
readonly svg_path: null;
|
|
899
|
+
};
|
|
900
|
+
readonly iiiint: {
|
|
901
|
+
readonly id: "iiiint";
|
|
902
|
+
readonly category: "integrals";
|
|
903
|
+
readonly Tex: "\\iiiint";
|
|
904
|
+
readonly mirror: true;
|
|
905
|
+
readonly Label: "⨌";
|
|
906
|
+
readonly title: "تكامل رباعي";
|
|
907
|
+
readonly svg_path: null;
|
|
908
|
+
};
|
|
909
|
+
readonly oint: {
|
|
910
|
+
readonly id: "oint";
|
|
911
|
+
readonly category: "integrals";
|
|
912
|
+
readonly Tex: "\\oint";
|
|
913
|
+
readonly mirror: true;
|
|
914
|
+
readonly Label: "∮";
|
|
915
|
+
readonly title: "تكامل مغلق";
|
|
916
|
+
readonly svg_path: null;
|
|
917
|
+
};
|
|
918
|
+
readonly oiint: {
|
|
919
|
+
readonly id: "oiint";
|
|
920
|
+
readonly category: "integrals";
|
|
921
|
+
readonly Tex: "\\oiint";
|
|
922
|
+
readonly mirror: true;
|
|
923
|
+
readonly Label: "∯";
|
|
924
|
+
readonly title: "تكامل سطحي مغلق";
|
|
925
|
+
readonly svg_path: null;
|
|
926
|
+
};
|
|
927
|
+
readonly oiiint: {
|
|
928
|
+
readonly id: "oiiint";
|
|
929
|
+
readonly category: "integrals";
|
|
930
|
+
readonly Tex: "\\oiiint";
|
|
931
|
+
readonly mirror: true;
|
|
932
|
+
readonly Label: "∰";
|
|
933
|
+
readonly title: "تكامل حجمي مغلق";
|
|
934
|
+
readonly svg_path: null;
|
|
935
|
+
};
|
|
936
|
+
};
|
|
937
|
+
type AtomicOperatorCommandId = keyof typeof ATOMIC_OPERATOR_COMMANDS;
|
|
938
|
+
type AtomicOperatorCommandCategory = 'operators1' | 'operators2' | 'operators3' | 'dots' | 'integrals';
|
|
939
|
+
type AtomicOperatorCommandSpec = (typeof ATOMIC_OPERATOR_COMMANDS)[AtomicOperatorCommandId] & {
|
|
940
|
+
displayMirror?: boolean;
|
|
941
|
+
};
|
|
942
|
+
declare function shouldMirrorOperatorDisplay(command: AtomicOperatorCommandSpec | null | undefined): boolean;
|
|
943
|
+
declare function mirrorBuTeXOperatorsInTex(tex: string): string;
|
|
944
|
+
declare function atomicOperatorCommandsByCategory(category: AtomicOperatorCommandCategory): AtomicOperatorCommandSpec[];
|
|
945
|
+
declare function atomicOperatorCommandSpec(id: string): AtomicOperatorCommandSpec | null;
|
|
946
|
+
|
|
947
|
+
declare function createEditorChain(nodes?: EditorNode[]): EditorChain;
|
|
948
|
+
declare function createEditorNode(kind: EditorNode['kind'], expr: string): EditorNode;
|
|
949
|
+
declare function createDelimiterNode(leftDelimExpr: string, rightDelimExpr: string): EditorNode;
|
|
950
|
+
declare function createFracNode(): EditorNode;
|
|
951
|
+
declare function createSqrtNode(): EditorNode;
|
|
952
|
+
declare function createMatrixEnvNode(style: MatrixEnvStyle, rows: number, columns: number): EditorNode;
|
|
953
|
+
declare function createGridEnvNode(envName: GridEnvName, rows: number, columns: number, columnAlignments?: EnvColumnAlignment[]): EditorNode;
|
|
954
|
+
declare function createAtomicCommandNode(commandId: AtomicCommandId): EditorNode;
|
|
955
|
+
declare function createAtomicOperatorCommandNode(commandId: AtomicOperatorCommandId): EditorNode;
|
|
956
|
+
declare function cloneEditorSession(session: EditorSession): EditorSession;
|
|
957
|
+
declare function buildInitialSyncMap(englishTree: EditorChain, arabicTree: EditorChain): EditorSession['sync'];
|
|
958
|
+
declare function createEditorSession(englishTree: EditorChain, arabicTree: EditorChain, activeSide?: EditorSide): EditorSession;
|
|
959
|
+
|
|
960
|
+
type RenderOptions = {
|
|
961
|
+
digitForm?: DigitFormId;
|
|
962
|
+
};
|
|
963
|
+
declare function renderChainEnglish(chain: EditorChain, options?: RenderOptions): string;
|
|
964
|
+
declare function renderChainArabic(chain: EditorChain, options?: RenderOptions): string;
|
|
965
|
+
declare function renderEnglishLatexFromSession(session: EditorSession): string;
|
|
966
|
+
declare function renderArabicLatexFromSession(session: EditorSession): string;
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* Depth-first preorder of all caret slots: for each chain, slot 0, then each node's
|
|
970
|
+
* nested chains (inner → superscript → subscript), then slot after that node, etc.
|
|
971
|
+
* Horizontal moves step through this order without skipping positions.
|
|
972
|
+
*/
|
|
973
|
+
declare function collectCaretPositions(chain: EditorChain): EditorCaret[];
|
|
974
|
+
declare function caretStep(root: EditorChain, caret: EditorCaret, delta: -1 | 1): EditorCaret;
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Single source of truth for child chains of a node.
|
|
978
|
+
* Future node kinds (commands, env, math objects) extend this helper and
|
|
979
|
+
* everything downstream (caret traversal mirroring, copy/paste, selection)
|
|
980
|
+
* keeps working. Today's children: innerExpr / numerator / denominator / rootIndex / radicand / matrix cells / superscript / subscript.
|
|
981
|
+
*/
|
|
982
|
+
declare function nodeChildChains(node: EditorNode): EditorChain[];
|
|
983
|
+
/** Lower/higher slot indices regardless of anchor/focus order. */
|
|
984
|
+
declare function normalizeSelection(sel: EditorSelectionRange): {
|
|
985
|
+
start: number;
|
|
986
|
+
end: number;
|
|
987
|
+
};
|
|
988
|
+
/** A selection is active only when it actually spans at least one node. */
|
|
989
|
+
declare function isSelectionActive(sel: EditorSelectionRange | null): boolean;
|
|
990
|
+
declare function clearSelection(session: EditorSession): EditorSession;
|
|
991
|
+
/**
|
|
992
|
+
* Extend the selection by one slot inside the same chain.
|
|
993
|
+
* Initializes from the current caret when no selection exists.
|
|
994
|
+
* Clamps focus to [0, chain.nodes.length]; collapses selection when it shrinks
|
|
995
|
+
* back to its anchor.
|
|
996
|
+
*/
|
|
997
|
+
declare function extendSelectionByStep(session: EditorSession, delta: -1 | 1): EditorSession;
|
|
998
|
+
/**
|
|
999
|
+
* Mouse-driven selection setter.
|
|
1000
|
+
* - role 'anchor': starts a fresh selection at slotIndex (collapsed).
|
|
1001
|
+
* - role 'focus': updates focus on the existing selection. Cross-chain
|
|
1002
|
+
* focus moves are ignored (drag stays inside one chain).
|
|
1003
|
+
*/
|
|
1004
|
+
declare function setSelectionFromMouse(session: EditorSession, chainId: string, slotIndex: number, role: 'anchor' | 'focus'): EditorSession;
|
|
1005
|
+
/** Ids of whole nodes covered by the current selection in the active tree. */
|
|
1006
|
+
declare function coveredNodeIds(session: EditorSession): string[];
|
|
1007
|
+
|
|
1008
|
+
/** MIME used for the structured BuTeX clipboard fragment. */
|
|
1009
|
+
declare const BUTEX_FRAGMENT_MIME = "application/x-butex-fragment+json";
|
|
1010
|
+
type EditorFragment = {
|
|
1011
|
+
version: 1;
|
|
1012
|
+
source: 'butex-editor';
|
|
1013
|
+
english: EditorNode[];
|
|
1014
|
+
arabic: EditorNode[];
|
|
1015
|
+
};
|
|
1016
|
+
/**
|
|
1017
|
+
* Build a fragment from the active selection by deep-cloning the covered nodes
|
|
1018
|
+
* from BOTH english and arabic trees (mirrored by node id at matching index).
|
|
1019
|
+
* Returns null when the selection is collapsed or invalid.
|
|
1020
|
+
*/
|
|
1021
|
+
declare function serializeSelection(session: EditorSession): EditorFragment | null;
|
|
1022
|
+
/**
|
|
1023
|
+
* Re-id every node and nested chain in both sides of the fragment so they no
|
|
1024
|
+
* longer collide with the live tree. Keeps the EN/AR mirror invariant
|
|
1025
|
+
* (matching ids index-by-index, including in nested child chains).
|
|
1026
|
+
*/
|
|
1027
|
+
declare function regenerateFragmentIds(fragment: EditorFragment): EditorFragment;
|
|
1028
|
+
/** Best-effort parse of a clipboard payload. Returns null when shape is wrong. */
|
|
1029
|
+
declare function deserializeFragment(payload: string): EditorFragment | null;
|
|
1030
|
+
/** Plain-text rendering of the fragment for cross-app clipboard fallback. */
|
|
1031
|
+
declare function fragmentToPlainText(fragment: EditorFragment, side: EditorSide): string;
|
|
1032
|
+
|
|
1033
|
+
/** Maximum number of editable states kept in the past stack (oldest drops first). */
|
|
1034
|
+
declare const DEFAULT_UNDO_HISTORY_MAX_DEPTH = 100;
|
|
1035
|
+
type UndoRedoStacks = {
|
|
1036
|
+
past: EditorSession[];
|
|
1037
|
+
future: EditorSession[];
|
|
1038
|
+
maxDepth: number;
|
|
1039
|
+
};
|
|
1040
|
+
declare function createUndoRedoStacks(maxDepth?: number): UndoRedoStacks;
|
|
1041
|
+
/**
|
|
1042
|
+
* Records the session **before** a user edit so it can be restored later.
|
|
1043
|
+
* Clears the redo branch (standard editor semantics).
|
|
1044
|
+
*/
|
|
1045
|
+
declare function pushUndoRedoSnapshot(stacks: UndoRedoStacks, sessionBeforeEdit: EditorSession): void;
|
|
1046
|
+
/** Restore the previous editable state, or null if there is nothing to undo. */
|
|
1047
|
+
declare function restoreUndo(stacks: UndoRedoStacks, sessionNow: EditorSession): EditorSession | null;
|
|
1048
|
+
/** Restore the next state after an undo, or null if there is nothing to redo. */
|
|
1049
|
+
declare function restoreRedo(stacks: UndoRedoStacks, sessionNow: EditorSession): EditorSession | null;
|
|
1050
|
+
declare function undoRedoCanUndo(stacks: UndoRedoStacks): boolean;
|
|
1051
|
+
declare function undoRedoCanRedo(stacks: UndoRedoStacks): boolean;
|
|
1052
|
+
|
|
1053
|
+
type ParentRelationKind = 'root' | 'superscript' | 'subscript' | 'inner' | 'numerator' | 'denominator' | 'radicand' | 'rootIndex' | 'matrixCell';
|
|
1054
|
+
type ParentRelation = {
|
|
1055
|
+
kind: ParentRelationKind;
|
|
1056
|
+
ownerNodeId: string | null;
|
|
1057
|
+
ownerChainId: string | null;
|
|
1058
|
+
rowIndex?: number;
|
|
1059
|
+
columnIndex?: number;
|
|
1060
|
+
};
|
|
1061
|
+
type LocatedChain = {
|
|
1062
|
+
chain: EditorChain;
|
|
1063
|
+
relation: ParentRelation;
|
|
1064
|
+
};
|
|
1065
|
+
type LocatedNode = {
|
|
1066
|
+
node: EditorNode;
|
|
1067
|
+
chain: EditorChain;
|
|
1068
|
+
index: number;
|
|
1069
|
+
};
|
|
1070
|
+
declare function findChainById(root: EditorChain, chainId: string): LocatedChain | null;
|
|
1071
|
+
declare function findNodeById(root: EditorChain, nodeId: string): LocatedNode | null;
|
|
1072
|
+
declare function activeTreeKey(side: EditorSide): 'englishTree' | 'arabicTree';
|
|
1073
|
+
declare function passiveTreeKey(side: EditorSide): 'englishTree' | 'arabicTree';
|
|
1074
|
+
|
|
1075
|
+
/** Keep highlighted node aligned with caret (keyboard + programmatic caret moves). */
|
|
1076
|
+
declare function syncSelectionToCaret(session: EditorSession): void;
|
|
1077
|
+
declare function switchSide(session: EditorSession): EditorSession;
|
|
1078
|
+
declare function setSplitLeafTyping(session: EditorSession, enabled: boolean): EditorSession;
|
|
1079
|
+
declare function setArabicReverseNumberTyping(session: EditorSession, enabled: boolean): EditorSession;
|
|
1080
|
+
declare function setCaret(session: EditorSession, chainId: string, index: number): EditorSession;
|
|
1081
|
+
declare function moveCaret(session: EditorSession, delta: -1 | 1): EditorSession;
|
|
1082
|
+
declare function horizontalCaretDelta(session: EditorSession, direction: 'left' | 'right'): -1 | 1;
|
|
1083
|
+
declare function moveCaretHorizontal(session: EditorSession, direction: 'left' | 'right'): EditorSession;
|
|
1084
|
+
declare function moveCaretVertical(session: EditorSession, direction: 'up' | 'down'): EditorSession;
|
|
1085
|
+
/** One-shot: forces the next insertChar/insertNumber to start a new leaf instead of merging. No-op in split mode. */
|
|
1086
|
+
declare function breakLeafTyping(session: EditorSession): EditorSession;
|
|
1087
|
+
declare function setCurrentCharacterFont(session: EditorSession, fontId: CharacterFontId): EditorSession;
|
|
1088
|
+
declare function toggleTakweenCharacterFont(session: EditorSession): EditorSession;
|
|
1089
|
+
declare function setCurrentDigitForm(session: EditorSession, digitForm: DigitFormId): EditorSession;
|
|
1090
|
+
declare function insertChar(session: EditorSession, expr: string): EditorSession;
|
|
1091
|
+
declare function insertNumber(session: EditorSession, expr: string): EditorSession;
|
|
1092
|
+
declare function insertOperator(session: EditorSession, expr: string): EditorSession;
|
|
1093
|
+
declare function insertAtomicCommand(session: EditorSession, commandId: AtomicCommandId): EditorSession;
|
|
1094
|
+
declare function insertAtomicOperatorCommand(session: EditorSession, commandId: AtomicOperatorCommandId): EditorSession;
|
|
1095
|
+
declare function insertDelimiterPair(session: EditorSession, leftDelimExpr: string, rightDelimExpr: string): EditorSession;
|
|
1096
|
+
declare function insertFraction(session: EditorSession): EditorSession;
|
|
1097
|
+
declare function insertSqrt(session: EditorSession): EditorSession;
|
|
1098
|
+
declare function insertMatrixEnv(session: EditorSession, style: MatrixEnvStyle, rows: number, columns: number): EditorSession;
|
|
1099
|
+
declare function insertArrayEnv(session: EditorSession, rows: number, columns: number, columnAlignments?: EnvColumnAlignment[]): EditorSession;
|
|
1100
|
+
declare function insertAlignedEnv(session: EditorSession, rows: number, columns: number): EditorSession;
|
|
1101
|
+
declare function setMatrixEnvStyle(session: EditorSession, style: MatrixEnvStyle): EditorSession;
|
|
1102
|
+
declare function setArrayColumnAlignment(session: EditorSession, columnIndex: number, alignment: EnvColumnAlignment): EditorSession;
|
|
1103
|
+
declare function addMatrixRow(session: EditorSession): EditorSession;
|
|
1104
|
+
declare function removeMatrixRow(session: EditorSession): EditorSession;
|
|
1105
|
+
declare function addMatrixColumn(session: EditorSession): EditorSession;
|
|
1106
|
+
declare function removeMatrixColumn(session: EditorSession): EditorSession;
|
|
1107
|
+
declare function addSup(session: EditorSession): EditorSession;
|
|
1108
|
+
declare function addSub(session: EditorSession): EditorSession;
|
|
1109
|
+
declare function removeSup(session: EditorSession): EditorSession;
|
|
1110
|
+
declare function removeSub(session: EditorSession): EditorSession;
|
|
1111
|
+
declare function selectNode(session: EditorSession, nodeId: string | null): EditorSession;
|
|
1112
|
+
declare function deleteStructure(session: EditorSession): EditorSession;
|
|
1113
|
+
declare function deleteBackward(session: EditorSession): EditorSession;
|
|
1114
|
+
declare function deleteForward(session: EditorSession): EditorSession;
|
|
1115
|
+
declare function setExpr(session: EditorSession, nodeId: string, expr: string): EditorSession;
|
|
1116
|
+
declare function createStarterSession(): EditorSession;
|
|
1117
|
+
declare function syncStateSummary(session: EditorSession): string;
|
|
1118
|
+
declare function setRenderError(session: EditorSession, message: string | null): EditorSession;
|
|
1119
|
+
declare function activeSideLabel(side: EditorSide): string;
|
|
1120
|
+
/** Read-only: build a fragment from the active selection (or null when collapsed). */
|
|
1121
|
+
declare function copySelection(session: EditorSession): EditorFragment | null;
|
|
1122
|
+
/** Cut: removes the selection and returns both the cleaned session and the fragment. */
|
|
1123
|
+
declare function cutSelection(session: EditorSession): {
|
|
1124
|
+
session: EditorSession;
|
|
1125
|
+
fragment: EditorFragment | null;
|
|
1126
|
+
};
|
|
1127
|
+
/**
|
|
1128
|
+
* Insert a structured fragment at the caret in the active chain. The fragment
|
|
1129
|
+
* is re-id'd so it can't collide with the live tree, mirrored EN/AR ids are
|
|
1130
|
+
* preserved, and sync entries are populated for every nested node.
|
|
1131
|
+
*/
|
|
1132
|
+
declare function pasteFragment(session: EditorSession, fragment: EditorFragment): EditorSession;
|
|
1133
|
+
/**
|
|
1134
|
+
* Plain-text fallback paste. Each character is dispatched through the existing
|
|
1135
|
+
* typing path so split/merge mode and selection-replace behave the same as
|
|
1136
|
+
* keyboard input. Whitespace is silently skipped in this MVP.
|
|
1137
|
+
*/
|
|
1138
|
+
declare function pasteText(session: EditorSession, text: string): EditorSession;
|
|
1139
|
+
|
|
1140
|
+
type BuildChain$1 = (chain: EditorChain) => HTMLElement;
|
|
1141
|
+
declare function buildNodeScripts(node: EditorNode, buildChain: BuildChain$1): HTMLElement | null;
|
|
1142
|
+
|
|
1143
|
+
declare const DELIMITER_CSS: string;
|
|
1144
|
+
|
|
1145
|
+
declare const FRAC_CSS: string;
|
|
1146
|
+
|
|
1147
|
+
declare const SQRT_CSS: string;
|
|
1148
|
+
|
|
1149
|
+
declare const MATRIX_ENV_CSS: string;
|
|
1150
|
+
|
|
1151
|
+
declare const ATOMIC_COMMAND_CSS: string;
|
|
1152
|
+
|
|
1153
|
+
declare const ATOMIC_OPERATOR_COMMAND_CSS: string;
|
|
1154
|
+
|
|
1155
|
+
type BuildChain = (chain: EditorChain) => HTMLElement;
|
|
1156
|
+
declare function buildNodeBody(node: EditorNode, buildChain: BuildChain, side: EditorSide, digitForm?: DigitFormId): HTMLElement;
|
|
1157
|
+
|
|
1158
|
+
declare function formatDigits(value: string, digitForm?: DigitFormId): string;
|
|
1159
|
+
|
|
1160
|
+
type RuntimeButtonElements = {
|
|
1161
|
+
undoBtn?: HTMLButtonElement | null;
|
|
1162
|
+
redoBtn?: HTMLButtonElement | null;
|
|
1163
|
+
copyBtn?: HTMLButtonElement | null;
|
|
1164
|
+
cutBtn?: HTMLButtonElement | null;
|
|
1165
|
+
splitTypingBtn?: HTMLButtonElement | null;
|
|
1166
|
+
characterFontBtn?: HTMLButtonElement | null;
|
|
1167
|
+
digitFormBtn?: HTMLButtonElement | null;
|
|
1168
|
+
};
|
|
1169
|
+
type EditorRuntimeOptions = {
|
|
1170
|
+
surfaceEl: HTMLElement;
|
|
1171
|
+
initialSession?: EditorSession;
|
|
1172
|
+
buttonElements?: RuntimeButtonElements;
|
|
1173
|
+
outsidePointerIgnoreSelectors?: string[];
|
|
1174
|
+
onSessionChange?: (session: EditorSession) => void;
|
|
1175
|
+
};
|
|
1176
|
+
type EditorRuntimeApi = {
|
|
1177
|
+
render: () => void;
|
|
1178
|
+
destroy: () => void;
|
|
1179
|
+
getSession: () => EditorSession;
|
|
1180
|
+
setSession: (next: EditorSession) => void;
|
|
1181
|
+
performUndo: () => void;
|
|
1182
|
+
performRedo: () => void;
|
|
1183
|
+
performCopy: () => Promise<void>;
|
|
1184
|
+
performCut: () => Promise<void>;
|
|
1185
|
+
performPaste: () => Promise<void>;
|
|
1186
|
+
toggleSide: () => void;
|
|
1187
|
+
toggleSplitLeafTyping: () => void;
|
|
1188
|
+
toggleArabicReverseNumberTyping: () => void;
|
|
1189
|
+
toggleTakweenCharacterFont: () => void;
|
|
1190
|
+
setCurrentCharacterFont: (fontId: CharacterFontId) => void;
|
|
1191
|
+
setCurrentDigitForm: (digitForm: DigitFormId) => void;
|
|
1192
|
+
insertDelimiterByKind: (kind: 'paren' | 'bracket' | 'brace') => void;
|
|
1193
|
+
insertFraction: () => void;
|
|
1194
|
+
insertMatrixEnv: (style: MatrixEnvStyle, rows: number, columns: number) => void;
|
|
1195
|
+
insertArrayEnv: (rows: number, columns: number) => void;
|
|
1196
|
+
insertAlignedEnv: (rows: number, columns: number) => void;
|
|
1197
|
+
insertSqrt: () => void;
|
|
1198
|
+
insertAtomicCommand: (commandId: AtomicCommandId) => void;
|
|
1199
|
+
insertAtomicOperatorCommand: (commandId: AtomicOperatorCommandId) => void;
|
|
1200
|
+
addSup: () => void;
|
|
1201
|
+
addSub: () => void;
|
|
1202
|
+
removeSup: () => void;
|
|
1203
|
+
removeSub: () => void;
|
|
1204
|
+
setMatrixEnvStyle: (style: MatrixEnvStyle) => void;
|
|
1205
|
+
setArrayColumnAlignment: (columnIndex: number, alignment: EnvColumnAlignment) => void;
|
|
1206
|
+
addMatrixRow: () => void;
|
|
1207
|
+
removeMatrixRow: () => void;
|
|
1208
|
+
addMatrixColumn: () => void;
|
|
1209
|
+
removeMatrixColumn: () => void;
|
|
1210
|
+
deleteStructure: () => void;
|
|
1211
|
+
};
|
|
1212
|
+
declare function createEditorRuntime(options: EditorRuntimeOptions): EditorRuntimeApi;
|
|
1213
|
+
declare function runtimeStatusText(session: EditorSession): {
|
|
1214
|
+
activeSide: string;
|
|
1215
|
+
sync: string;
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
declare const index_ATOMIC_COMMANDS: typeof ATOMIC_COMMANDS;
|
|
1219
|
+
declare const index_ATOMIC_COMMAND_CSS: typeof ATOMIC_COMMAND_CSS;
|
|
1220
|
+
declare const index_ATOMIC_OPERATOR_COMMANDS: typeof ATOMIC_OPERATOR_COMMANDS;
|
|
1221
|
+
declare const index_ATOMIC_OPERATOR_COMMAND_CSS: typeof ATOMIC_OPERATOR_COMMAND_CSS;
|
|
1222
|
+
type index_AtomicCommandCategory = AtomicCommandCategory;
|
|
1223
|
+
type index_AtomicCommandId = AtomicCommandId;
|
|
1224
|
+
type index_AtomicCommandSpec = AtomicCommandSpec;
|
|
1225
|
+
type index_AtomicOperatorCommandCategory = AtomicOperatorCommandCategory;
|
|
1226
|
+
type index_AtomicOperatorCommandId = AtomicOperatorCommandId;
|
|
1227
|
+
type index_AtomicOperatorCommandSpec = AtomicOperatorCommandSpec;
|
|
1228
|
+
declare const index_BUTEX_EDITOR_CSS: typeof BUTEX_EDITOR_CSS;
|
|
1229
|
+
declare const index_BUTEX_FRAGMENT_MIME: typeof BUTEX_FRAGMENT_MIME;
|
|
1230
|
+
type index_CharacterFontId = CharacterFontId;
|
|
1231
|
+
declare const index_DEFAULT_UNDO_HISTORY_MAX_DEPTH: typeof DEFAULT_UNDO_HISTORY_MAX_DEPTH;
|
|
1232
|
+
declare const index_DELIMITER_CSS: typeof DELIMITER_CSS;
|
|
1233
|
+
type index_DigitFormId = DigitFormId;
|
|
1234
|
+
type index_EditorCaret = EditorCaret;
|
|
1235
|
+
type index_EditorChain = EditorChain;
|
|
1236
|
+
type index_EditorDebugEntry = EditorDebugEntry;
|
|
1237
|
+
type index_EditorFragment = EditorFragment;
|
|
1238
|
+
type index_EditorNode = EditorNode;
|
|
1239
|
+
type index_EditorNodeKind = EditorNodeKind;
|
|
1240
|
+
type index_EditorRuntimeApi = EditorRuntimeApi;
|
|
1241
|
+
type index_EditorRuntimeOptions = EditorRuntimeOptions;
|
|
1242
|
+
type index_EditorSelectionRange = EditorSelectionRange;
|
|
1243
|
+
type index_EditorSession = EditorSession;
|
|
1244
|
+
type index_EditorSide = EditorSide;
|
|
1245
|
+
type index_EditorSyncMap = EditorSyncMap;
|
|
1246
|
+
type index_EditorSyncState = EditorSyncState;
|
|
1247
|
+
type index_EnvColumnAlignment = EnvColumnAlignment;
|
|
1248
|
+
declare const index_FRAC_CSS: typeof FRAC_CSS;
|
|
1249
|
+
type index_GridEnvName = GridEnvName;
|
|
1250
|
+
declare const index_MATRIX_ENV_CSS: typeof MATRIX_ENV_CSS;
|
|
1251
|
+
type index_MatrixEnvStyle = MatrixEnvStyle;
|
|
1252
|
+
declare const index_SQRT_CSS: typeof SQRT_CSS;
|
|
1253
|
+
type index_SpacingCommandSpec = SpacingCommandSpec;
|
|
1254
|
+
type index_SpacingDirection = SpacingDirection;
|
|
1255
|
+
type index_UndoRedoStacks = UndoRedoStacks;
|
|
1256
|
+
declare const index_activeSideLabel: typeof activeSideLabel;
|
|
1257
|
+
declare const index_activeTreeKey: typeof activeTreeKey;
|
|
1258
|
+
declare const index_addMatrixColumn: typeof addMatrixColumn;
|
|
1259
|
+
declare const index_addMatrixRow: typeof addMatrixRow;
|
|
1260
|
+
declare const index_addSub: typeof addSub;
|
|
1261
|
+
declare const index_addSup: typeof addSup;
|
|
1262
|
+
declare const index_atomicCommandSpec: typeof atomicCommandSpec;
|
|
1263
|
+
declare const index_atomicCommandsByCategory: typeof atomicCommandsByCategory;
|
|
1264
|
+
declare const index_atomicOperatorCommandSpec: typeof atomicOperatorCommandSpec;
|
|
1265
|
+
declare const index_atomicOperatorCommandsByCategory: typeof atomicOperatorCommandsByCategory;
|
|
1266
|
+
declare const index_breakLeafTyping: typeof breakLeafTyping;
|
|
1267
|
+
declare const index_buildInitialSyncMap: typeof buildInitialSyncMap;
|
|
1268
|
+
declare const index_buildNodeBody: typeof buildNodeBody;
|
|
1269
|
+
declare const index_buildNodeScripts: typeof buildNodeScripts;
|
|
1270
|
+
declare const index_caretStep: typeof caretStep;
|
|
1271
|
+
declare const index_clearSelection: typeof clearSelection;
|
|
1272
|
+
declare const index_cloneEditorSession: typeof cloneEditorSession;
|
|
1273
|
+
declare const index_collectCaretPositions: typeof collectCaretPositions;
|
|
1274
|
+
declare const index_copySelection: typeof copySelection;
|
|
1275
|
+
declare const index_coveredNodeIds: typeof coveredNodeIds;
|
|
1276
|
+
declare const index_createAtomicCommandNode: typeof createAtomicCommandNode;
|
|
1277
|
+
declare const index_createAtomicOperatorCommandNode: typeof createAtomicOperatorCommandNode;
|
|
1278
|
+
declare const index_createDelimiterNode: typeof createDelimiterNode;
|
|
1279
|
+
declare const index_createEditorChain: typeof createEditorChain;
|
|
1280
|
+
declare const index_createEditorNode: typeof createEditorNode;
|
|
1281
|
+
declare const index_createEditorRuntime: typeof createEditorRuntime;
|
|
1282
|
+
declare const index_createEditorSession: typeof createEditorSession;
|
|
1283
|
+
declare const index_createFracNode: typeof createFracNode;
|
|
1284
|
+
declare const index_createGridEnvNode: typeof createGridEnvNode;
|
|
1285
|
+
declare const index_createMatrixEnvNode: typeof createMatrixEnvNode;
|
|
1286
|
+
declare const index_createSqrtNode: typeof createSqrtNode;
|
|
1287
|
+
declare const index_createStarterSession: typeof createStarterSession;
|
|
1288
|
+
declare const index_createUndoRedoStacks: typeof createUndoRedoStacks;
|
|
1289
|
+
declare const index_cutSelection: typeof cutSelection;
|
|
1290
|
+
declare const index_deleteBackward: typeof deleteBackward;
|
|
1291
|
+
declare const index_deleteForward: typeof deleteForward;
|
|
1292
|
+
declare const index_deleteStructure: typeof deleteStructure;
|
|
1293
|
+
declare const index_deserializeFragment: typeof deserializeFragment;
|
|
1294
|
+
declare const index_extendSelectionByStep: typeof extendSelectionByStep;
|
|
1295
|
+
declare const index_findChainById: typeof findChainById;
|
|
1296
|
+
declare const index_findNodeById: typeof findNodeById;
|
|
1297
|
+
declare const index_formatDigits: typeof formatDigits;
|
|
1298
|
+
declare const index_fragmentToPlainText: typeof fragmentToPlainText;
|
|
1299
|
+
declare const index_horizontalCaretDelta: typeof horizontalCaretDelta;
|
|
1300
|
+
declare const index_injectBuTeXEditorStyles: typeof injectBuTeXEditorStyles;
|
|
1301
|
+
declare const index_insertAlignedEnv: typeof insertAlignedEnv;
|
|
1302
|
+
declare const index_insertArrayEnv: typeof insertArrayEnv;
|
|
1303
|
+
declare const index_insertAtomicCommand: typeof insertAtomicCommand;
|
|
1304
|
+
declare const index_insertAtomicOperatorCommand: typeof insertAtomicOperatorCommand;
|
|
1305
|
+
declare const index_insertChar: typeof insertChar;
|
|
1306
|
+
declare const index_insertDelimiterPair: typeof insertDelimiterPair;
|
|
1307
|
+
declare const index_insertFraction: typeof insertFraction;
|
|
1308
|
+
declare const index_insertMatrixEnv: typeof insertMatrixEnv;
|
|
1309
|
+
declare const index_insertNumber: typeof insertNumber;
|
|
1310
|
+
declare const index_insertOperator: typeof insertOperator;
|
|
1311
|
+
declare const index_insertSqrt: typeof insertSqrt;
|
|
1312
|
+
declare const index_isSelectionActive: typeof isSelectionActive;
|
|
1313
|
+
declare const index_isSpacingCommandSpec: typeof isSpacingCommandSpec;
|
|
1314
|
+
declare const index_mirrorBuTeXOperatorsInTex: typeof mirrorBuTeXOperatorsInTex;
|
|
1315
|
+
declare const index_moveCaret: typeof moveCaret;
|
|
1316
|
+
declare const index_moveCaretHorizontal: typeof moveCaretHorizontal;
|
|
1317
|
+
declare const index_moveCaretVertical: typeof moveCaretVertical;
|
|
1318
|
+
declare const index_nodeChildChains: typeof nodeChildChains;
|
|
1319
|
+
declare const index_normalizeSelection: typeof normalizeSelection;
|
|
1320
|
+
declare const index_passiveTreeKey: typeof passiveTreeKey;
|
|
1321
|
+
declare const index_pasteFragment: typeof pasteFragment;
|
|
1322
|
+
declare const index_pasteText: typeof pasteText;
|
|
1323
|
+
declare const index_pushUndoRedoSnapshot: typeof pushUndoRedoSnapshot;
|
|
1324
|
+
declare const index_regenerateFragmentIds: typeof regenerateFragmentIds;
|
|
1325
|
+
declare const index_removeMatrixColumn: typeof removeMatrixColumn;
|
|
1326
|
+
declare const index_removeMatrixRow: typeof removeMatrixRow;
|
|
1327
|
+
declare const index_removeSub: typeof removeSub;
|
|
1328
|
+
declare const index_removeSup: typeof removeSup;
|
|
1329
|
+
declare const index_renderArabicLatexFromSession: typeof renderArabicLatexFromSession;
|
|
1330
|
+
declare const index_renderChainArabic: typeof renderChainArabic;
|
|
1331
|
+
declare const index_renderChainEnglish: typeof renderChainEnglish;
|
|
1332
|
+
declare const index_renderEnglishLatexFromSession: typeof renderEnglishLatexFromSession;
|
|
1333
|
+
declare const index_restoreRedo: typeof restoreRedo;
|
|
1334
|
+
declare const index_restoreUndo: typeof restoreUndo;
|
|
1335
|
+
declare const index_runtimeStatusText: typeof runtimeStatusText;
|
|
1336
|
+
declare const index_selectNode: typeof selectNode;
|
|
1337
|
+
declare const index_serializeSelection: typeof serializeSelection;
|
|
1338
|
+
declare const index_setArabicReverseNumberTyping: typeof setArabicReverseNumberTyping;
|
|
1339
|
+
declare const index_setArrayColumnAlignment: typeof setArrayColumnAlignment;
|
|
1340
|
+
declare const index_setCaret: typeof setCaret;
|
|
1341
|
+
declare const index_setCurrentCharacterFont: typeof setCurrentCharacterFont;
|
|
1342
|
+
declare const index_setCurrentDigitForm: typeof setCurrentDigitForm;
|
|
1343
|
+
declare const index_setExpr: typeof setExpr;
|
|
1344
|
+
declare const index_setMatrixEnvStyle: typeof setMatrixEnvStyle;
|
|
1345
|
+
declare const index_setRenderError: typeof setRenderError;
|
|
1346
|
+
declare const index_setSelectionFromMouse: typeof setSelectionFromMouse;
|
|
1347
|
+
declare const index_setSplitLeafTyping: typeof setSplitLeafTyping;
|
|
1348
|
+
declare const index_shouldMirrorOperatorDisplay: typeof shouldMirrorOperatorDisplay;
|
|
1349
|
+
declare const index_switchSide: typeof switchSide;
|
|
1350
|
+
declare const index_syncSelectionToCaret: typeof syncSelectionToCaret;
|
|
1351
|
+
declare const index_syncStateSummary: typeof syncStateSummary;
|
|
1352
|
+
declare const index_toggleTakweenCharacterFont: typeof toggleTakweenCharacterFont;
|
|
1353
|
+
declare const index_undoRedoCanRedo: typeof undoRedoCanRedo;
|
|
1354
|
+
declare const index_undoRedoCanUndo: typeof undoRedoCanUndo;
|
|
1355
|
+
declare namespace index {
|
|
1356
|
+
export { 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_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, type index_CharacterFontId as CharacterFontId, 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_SQRT_CSS as SQRT_CSS, type index_SpacingCommandSpec as SpacingCommandSpec, type index_SpacingDirection as SpacingDirection, type index_UndoRedoStacks as UndoRedoStacks, 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_clearSelection as clearSelection, index_cloneEditorSession as cloneEditorSession, index_collectCaretPositions as collectCaretPositions, index_copySelection as copySelection, index_coveredNodeIds as coveredNodeIds, 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_createSqrtNode as createSqrtNode, index_createStarterSession as createStarterSession, 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_insertAlignedEnv as insertAlignedEnv, index_insertArrayEnv as insertArrayEnv, index_insertAtomicCommand as insertAtomicCommand, index_insertAtomicOperatorCommand as insertAtomicOperatorCommand, index_insertChar as insertChar, index_insertDelimiterPair as insertDelimiterPair, index_insertFraction as insertFraction, index_insertMatrixEnv as insertMatrixEnv, index_insertNumber as insertNumber, index_insertOperator as insertOperator, index_insertSqrt as insertSqrt, index_isSelectionActive as isSelectionActive, index_isSpacingCommandSpec as isSpacingCommandSpec, 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_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_switchSide as switchSide, index_syncSelectionToCaret as syncSelectionToCaret, index_syncStateSummary as syncStateSummary, index_toggleTakweenCharacterFont as toggleTakweenCharacterFont, index_undoRedoCanRedo as undoRedoCanRedo, index_undoRedoCanUndo as undoRedoCanUndo };
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
/**
|
|
1360
|
+
* Typed error from {@link parseBuTeX} when known Arabic commands are malformed.
|
|
1361
|
+
*/
|
|
1362
|
+
declare class BuTeXParserError extends Error {
|
|
1363
|
+
readonly offset: number;
|
|
1364
|
+
constructor(message: string, offset: number);
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
/** MVP Arabic surface commands mapped by normalized parser dispatch */
|
|
1368
|
+
declare const CMD_ROOT_AR = "\u062C\u0630\u0631";
|
|
1369
|
+
declare const CMD_FRAC_AR = "\u0643\u0633\u0631";
|
|
1370
|
+
declare const CMD_COS_AR = "\u062C\u062A\u0627";
|
|
1371
|
+
|
|
1372
|
+
/**
|
|
1373
|
+
* Wrap a literal segment if it consists only of Arabic script letters (no digits/Latin/backslash).
|
|
1374
|
+
* Used for bare identifiers like `س` inside `{...}`.
|
|
1375
|
+
*/
|
|
1376
|
+
declare function wrapArabicLiteralSegment(segment: string): string;
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* Normalize Arabic-friendly BuTeX surface syntax to MathJax-compatible TeX.
|
|
1380
|
+
* Pure string transform — no MathJax dependency.
|
|
1381
|
+
*/
|
|
1382
|
+
declare function parseBuTeX(input: string): string;
|
|
1383
|
+
|
|
1384
|
+
declare function patchBuTeXSvgMath(root: ParentNode): void;
|
|
1385
|
+
|
|
1386
|
+
type BuTeXMathOutput = 'chtml' | 'svg';
|
|
1387
|
+
type RenderBuTeXMathIslandOptions = {
|
|
1388
|
+
display?: boolean;
|
|
1389
|
+
mirrorOperators?: boolean;
|
|
1390
|
+
output?: BuTeXMathOutput;
|
|
1391
|
+
};
|
|
1392
|
+
type RenderBuTeXMathTypesetOptions = {
|
|
1393
|
+
display?: boolean;
|
|
1394
|
+
mirrorOperators?: boolean;
|
|
1395
|
+
};
|
|
1396
|
+
declare function patchBuTeXSvgMathAfterLayout(root: ParentNode): void;
|
|
1397
|
+
/** Convert delimited source text to `\(...\)` / `\[...\]` form. */
|
|
1398
|
+
declare function normalizePreviewMathForMathJax(tex: string): string;
|
|
1399
|
+
/** Normalize delimited TeX for direct MathJax island conversion. */
|
|
1400
|
+
declare function normalizeBuTeXMathInput(tex: string, output?: BuTeXMathOutput): {
|
|
1401
|
+
tex: string;
|
|
1402
|
+
display: boolean;
|
|
1403
|
+
};
|
|
1404
|
+
declare function renderBuTeXMathIsland(tex: string, options?: RenderBuTeXMathIslandOptions): Promise<HTMLElement>;
|
|
1405
|
+
declare function mountBuTeXMathIsland(host: HTMLElement, tex: string, options?: RenderBuTeXMathIslandOptions): Promise<void>;
|
|
1406
|
+
/**
|
|
1407
|
+
* Render via MathJax's document typesetter (`typesetPromise`).
|
|
1408
|
+
* Use for equation-editor preview of raw AST TeX (display `\[...\]` by default).
|
|
1409
|
+
*/
|
|
1410
|
+
declare function mountBuTeXMathTypeset(host: HTMLElement, tex: string, options?: RenderBuTeXMathTypesetOptions): Promise<void>;
|
|
1411
|
+
/** @deprecated Use normalizeBuTeXMathInput instead. */
|
|
1412
|
+
declare function mathJaxInputFromPreviewTex(tex: string): {
|
|
1413
|
+
tex: string;
|
|
1414
|
+
display: boolean;
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* Swap MathJax's SVG `mtext` wrapper for the BuTeX-aware one. Call once, after
|
|
1419
|
+
* the SVG output jax exists (e.g. after `MathJax.startup.defaultReady()`).
|
|
1420
|
+
* No-op if SVG output internals are missing or already patched.
|
|
1421
|
+
*/
|
|
1422
|
+
declare function registerBuTeXSvgTextWrapper(mathJax: GlobalMathJax): void;
|
|
1423
|
+
|
|
1424
|
+
/**
|
|
1425
|
+
* Injects BuTeX CommonHTML styles into `document.head` if not already present.
|
|
1426
|
+
* Browser-only; no-op if `document` is undefined (Node).
|
|
1427
|
+
*/
|
|
1428
|
+
declare function injectBuTeXStyles(doc?: Document): void;
|
|
1429
|
+
|
|
1430
|
+
export { BUTEX_CHROME_CSS, BUTEX_EDITOR_CSS, BUTEX_TEX_PACKAGE, type BuTeXMathOutput, BuTeXParserError, CMD_COS_AR, CMD_FRAC_AR, CMD_ROOT_AR, index as Editor, type RenderBuTeXMathIslandOptions, type RenderBuTeXMathTypesetOptions, injectBuTeXEditorStyles, injectBuTeXStyles, mathJaxInputFromPreviewTex, mirrorBuTeXOperatorsInTex, mountBuTeXMathIsland, mountBuTeXMathTypeset, normalizeBuTeXMathInput, normalizePreviewMathForMathJax, parseBuTeX, patchBuTeXSvgMath, patchBuTeXSvgMathAfterLayout, registerBuTeX, registerBuTeXSvgTextWrapper, renderBuTeXMathIsland, wrapArabicLiteralSegment };
|