@drghaliasri/butex 7.4.2 → 8.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 +49 -553
- package/dist/{document2-cli.js → document-cli.js} +332 -302
- package/dist/document-cli.js.map +1 -0
- package/dist/document.d.mts +1022 -186
- package/dist/document.d.ts +1022 -186
- package/dist/document.js +6068 -658
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +5928 -618
- package/dist/document.mjs.map +1 -1
- package/dist/react-document-preview.d.mts +338 -0
- package/dist/react-document-preview.d.ts +338 -0
- package/dist/{react-document2-preview.js → react-document-preview.js} +783 -783
- package/dist/react-document-preview.js.map +1 -0
- package/dist/{react-document2-preview.mjs → react-document-preview.mjs} +776 -776
- package/dist/react-document-preview.mjs.map +1 -0
- package/dist/react-document.d.mts +634 -35
- package/dist/react-document.d.ts +634 -35
- package/dist/react-document.js +13259 -4282
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +12617 -3648
- package/dist/react-document.mjs.map +1 -1
- package/dist/react.js +4 -4
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +4 -4
- package/dist/react.mjs.map +1 -1
- package/package.json +7 -17
- package/dist/document2-cli.js.map +0 -1
- package/dist/document2.d.mts +0 -1156
- package/dist/document2.d.ts +0 -1156
- package/dist/document2.js +0 -9137
- package/dist/document2.js.map +0 -1
- package/dist/document2.mjs +0 -8972
- package/dist/document2.mjs.map +0 -1
- package/dist/react-document2-preview.d.mts +0 -338
- package/dist/react-document2-preview.d.ts +0 -338
- package/dist/react-document2-preview.js.map +0 -1
- package/dist/react-document2-preview.mjs.map +0 -1
- package/dist/react-document2.d.mts +0 -754
- package/dist/react-document2.d.ts +0 -754
- package/dist/react-document2.js +0 -23011
- package/dist/react-document2.js.map +0 -1
- package/dist/react-document2.mjs +0 -22981
- package/dist/react-document2.mjs.map +0 -1
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
type EditorSide = 'english' | 'arabic';
|
|
6
|
-
type EditorNodeKind = 'char' | 'number' | 'operator' | 'delimiter' | 'boxed' | 'frac' | 'sqrt' | 'overset' | 'underset' | 'accent' | 'env' | 'atomicCommand' | 'atomicOperatorCommand' | 'standardCommand';
|
|
7
|
-
type MatrixEnvStyle = 'matrix' | 'pmatrix' | 'bmatrix' | 'Bmatrix' | 'vmatrix' | 'Vmatrix';
|
|
8
|
-
type GridEnvName = MatrixEnvStyle | 'array' | 'aligned';
|
|
9
|
-
type EnvColumnAlignment = 'l' | 'c' | 'r';
|
|
10
|
-
type CharacterFontId = 'default' | 'takween' | 'diwani' | 'diwaniOutline' | 'maghribi';
|
|
11
|
-
type DigitFormId = 'western' | 'arabicIndic' | 'persianIndic';
|
|
12
|
-
type EditorSyncState = 'synced' | 'diverged';
|
|
13
|
-
type EditorChain = {
|
|
14
|
-
id: string;
|
|
15
|
-
nodes: EditorNode[];
|
|
16
|
-
/** Complete script authored as \\mathnormal{ordered,index,atoms}. */
|
|
17
|
-
indexSequence?: boolean;
|
|
18
|
-
};
|
|
19
|
-
type EditorNode = {
|
|
20
|
-
id: string;
|
|
21
|
-
kind: EditorNodeKind;
|
|
22
|
-
expr: string;
|
|
23
|
-
characterFont?: CharacterFontId;
|
|
24
|
-
/** Minimal upstream source identity used only while the node remains unchanged. */
|
|
25
|
-
sourceLatex?: string;
|
|
26
|
-
/** Existing editor node reused for wrapper commands that need editable content. */
|
|
27
|
-
wrapperCommand?: '\\unit' | '\\mathtt' | '\\mathbf' | '\\boldarabic';
|
|
28
|
-
superscript: EditorChain | null;
|
|
29
|
-
subscript: EditorChain | null;
|
|
30
|
-
leftDelimExpr: string;
|
|
31
|
-
rightDelimExpr: string;
|
|
32
|
-
innerExpr: EditorChain | null;
|
|
33
|
-
numerator: EditorChain | null;
|
|
34
|
-
denominator: EditorChain | null;
|
|
35
|
-
radicand: EditorChain | null;
|
|
36
|
-
rootIndex: EditorChain | null;
|
|
37
|
-
overExpr: EditorChain | null;
|
|
38
|
-
underExpr: EditorChain | null;
|
|
39
|
-
baseExpr: EditorChain | null;
|
|
40
|
-
envName: GridEnvName | null;
|
|
41
|
-
matrixStyle: MatrixEnvStyle | null;
|
|
42
|
-
matrixRows: EditorChain[][] | null;
|
|
43
|
-
columnAlignments: EnvColumnAlignment[] | null;
|
|
44
|
-
};
|
|
45
|
-
type EditorCaret = {
|
|
46
|
-
chainId: string;
|
|
47
|
-
index: number;
|
|
48
|
-
};
|
|
49
|
-
type EditorSelectionRange = {
|
|
50
|
-
chainId: string;
|
|
51
|
-
anchorIndex: number;
|
|
52
|
-
focusIndex: number;
|
|
53
|
-
};
|
|
54
|
-
type EditorSyncMap = Record<string, {
|
|
55
|
-
expr: EditorSyncState;
|
|
56
|
-
}>;
|
|
57
|
-
type EditorDebugEntry = {
|
|
58
|
-
timestamp: string;
|
|
59
|
-
command: string;
|
|
60
|
-
activeSide: EditorSide;
|
|
61
|
-
englishLatex: string;
|
|
62
|
-
arabicLatex: string;
|
|
63
|
-
renderOk: boolean;
|
|
64
|
-
renderError: string | null;
|
|
65
|
-
note: string;
|
|
66
|
-
};
|
|
67
|
-
type EditorSession = {
|
|
68
|
-
englishTree: EditorChain;
|
|
69
|
-
arabicTree: EditorChain;
|
|
70
|
-
activeSide: EditorSide;
|
|
71
|
-
/** When true, each typed letter/digit inserts a new char/number leaf; when false, merge into adjacent same-kind leaves. */
|
|
72
|
-
splitLeafTyping: boolean;
|
|
73
|
-
/** One-shot: when true, the next insertChar/insertNumber bypasses leaf-merge (used by Space in merge mode). */
|
|
74
|
-
forceSplitNextLeaf: boolean;
|
|
75
|
-
/** When true and active side is Arabic, merged number typing prepends digits (RTL-style); still mirrored on EN/AR. */
|
|
76
|
-
arabicReverseNumberTyping: boolean;
|
|
77
|
-
/** Font applied to newly typed char nodes. */
|
|
78
|
-
currentCharacterFont: CharacterFontId;
|
|
79
|
-
/** Structured command wrapper applied to newly typed chars; kept separate from fonts. */
|
|
80
|
-
currentCharacterWrapper: '\\boldarabic' | null;
|
|
81
|
-
/** Digit glyph form used for editor display and LaTeX preview output. */
|
|
82
|
-
currentDigitForm: DigitFormId;
|
|
83
|
-
caret: EditorCaret;
|
|
84
|
-
/** Whole-node range selection inside a single chain (anchor==focus means no selection). */
|
|
85
|
-
selection: EditorSelectionRange | null;
|
|
86
|
-
selectedNodeId: string | null;
|
|
87
|
-
selectedStructureNodeId: string | null;
|
|
88
|
-
sync: EditorSyncMap;
|
|
89
|
-
debugLog: EditorDebugEntry[];
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
type ButexUiLocale = 'ar' | 'en';
|
|
93
|
-
|
|
94
|
-
type ArabicNodeJson = {
|
|
95
|
-
node_type: string;
|
|
96
|
-
expr?: string;
|
|
97
|
-
name?: string;
|
|
98
|
-
superscript?: ChainJson | null;
|
|
99
|
-
subscript?: ChainJson | null;
|
|
100
|
-
left_delim_expr?: string;
|
|
101
|
-
right_delim_expr?: string;
|
|
102
|
-
inner_expr?: ChainJson;
|
|
103
|
-
optional_args?: ChainJson[];
|
|
104
|
-
mandatory_args?: ChainJson[];
|
|
105
|
-
opening?: string;
|
|
106
|
-
closing?: string;
|
|
107
|
-
lines?: ChainJson[];
|
|
108
|
-
source_latex?: string;
|
|
109
|
-
};
|
|
110
|
-
type ChainJson = {
|
|
111
|
-
node_type: 'ChainClass';
|
|
112
|
-
chain: ArabicNodeJson[];
|
|
113
|
-
};
|
|
114
|
-
declare class State {
|
|
115
|
-
}
|
|
116
|
-
declare class BaseAstNode {
|
|
117
|
-
state: State;
|
|
118
|
-
superscript: ChainNode | null;
|
|
119
|
-
subscript: ChainNode | null;
|
|
120
|
-
nodeType: string;
|
|
121
|
-
sourceLatex: string | null;
|
|
122
|
-
constructor(state?: State | null);
|
|
123
|
-
latex(): string;
|
|
124
|
-
arabicLatex(): string;
|
|
125
|
-
toArabicLatex(): string;
|
|
126
|
-
/** Latin-style scripts: `^{...}` and `_{...}` for english_json rendering. */
|
|
127
|
-
latexScripts(): string;
|
|
128
|
-
/**
|
|
129
|
-
* Arabic scripts use \\prescript{sup}{sub}{content} (matches reference Python output).
|
|
130
|
-
* Call with rendered strings for sup/sub chains (may be empty strings).
|
|
131
|
-
*/
|
|
132
|
-
arabicLatexScripts(sup: string, sub: string, content: string): string;
|
|
133
|
-
}
|
|
134
|
-
declare class ChainNode {
|
|
135
|
-
chain: BaseAstNode[];
|
|
136
|
-
constructor(chain?: BaseAstNode[]);
|
|
137
|
-
latex(): string;
|
|
138
|
-
toEnglishLatex(): string;
|
|
139
|
-
/** RTL: reverse order relative to Latin chain (see test/ref_tests.txt). */
|
|
140
|
-
arabicLatex(): string;
|
|
141
|
-
toArabicLatex(): string;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
type MathNode = {
|
|
145
|
-
nodeType: 'MathObject';
|
|
146
|
-
mathMode: string;
|
|
147
|
-
lines: ChainNode[];
|
|
148
|
-
closing: string;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
type Document2ParseMode = 'english' | 'arabic';
|
|
152
|
-
type Document2MathOutput = 'svg' | 'chtml';
|
|
153
|
-
type Document2Direction = 'rtl' | 'ltr';
|
|
154
|
-
type MathObject2Json = {
|
|
155
|
-
node_type: 'MathObject';
|
|
156
|
-
math_mode: string;
|
|
157
|
-
lines: ChainJson[];
|
|
158
|
-
closing: string;
|
|
159
|
-
/** Side used by the delimited source stored in the containing value/cell. */
|
|
160
|
-
source_side?: Document2ParseMode;
|
|
161
|
-
/** Preserve whether LaTeX export should prefer imported AST rendering or editor source. */
|
|
162
|
-
source_owner?: 'imported-structured' | 'editor';
|
|
163
|
-
label_enabled?: boolean;
|
|
164
|
-
label?: string;
|
|
165
|
-
};
|
|
166
|
-
/** Positional metadata for a raw-only span that has no structured equation AST. */
|
|
167
|
-
type RawMathObject2Json = {
|
|
168
|
-
node_type: 'RawMathObject';
|
|
169
|
-
label_enabled?: boolean;
|
|
170
|
-
label?: string;
|
|
171
|
-
};
|
|
172
|
-
type Document2MathObjectJson = MathObject2Json | RawMathObject2Json;
|
|
173
|
-
type ReferenceFieldSeparator = ',' | '،';
|
|
174
|
-
type Reference2Json = {
|
|
175
|
-
key: string;
|
|
176
|
-
authors?: string;
|
|
177
|
-
title?: string;
|
|
178
|
-
year?: string;
|
|
179
|
-
url?: string;
|
|
180
|
-
venue?: string;
|
|
181
|
-
/** Bibliography field join: LTR `,` or Arabic `،`. Defaults to `،` when omitted. */
|
|
182
|
-
field_separator?: ReferenceFieldSeparator;
|
|
183
|
-
};
|
|
184
|
-
type HijriMonthId = 'محرم' | 'صفر' | 'ربيع الأول' | 'ربيع الآخر' | 'جمادى الأولى' | 'جمادى الآخرة' | 'رجب' | 'شعبان' | 'رمضان' | 'شوال' | 'ذو القعدة' | 'ذو الحجة';
|
|
185
|
-
type Document2HijriDate = {
|
|
186
|
-
day: number;
|
|
187
|
-
month: HijriMonthId;
|
|
188
|
-
year: number;
|
|
189
|
-
};
|
|
190
|
-
type Document2Meta = {
|
|
191
|
-
title: string;
|
|
192
|
-
authors: string;
|
|
193
|
-
date: Document2HijriDate;
|
|
194
|
-
abstract: string;
|
|
195
|
-
};
|
|
196
|
-
type Document2Json = {
|
|
197
|
-
node_type: 'DocumentObject';
|
|
198
|
-
meta?: Document2Meta;
|
|
199
|
-
references?: Reference2Json[];
|
|
200
|
-
blocks: Document2BlockJson[];
|
|
201
|
-
};
|
|
202
|
-
type Document2InlineTokenIdJson = {
|
|
203
|
-
id: string;
|
|
204
|
-
kind: InlineToken2['kind'];
|
|
205
|
-
start: number;
|
|
206
|
-
end: number;
|
|
207
|
-
};
|
|
208
|
-
type Document2InlineIdsJson = {
|
|
209
|
-
field_id: string;
|
|
210
|
-
tokens: Document2InlineTokenIdJson[];
|
|
211
|
-
};
|
|
212
|
-
type Document2BlockMetadata = {
|
|
213
|
-
source?: 'agent' | 'user';
|
|
214
|
-
};
|
|
215
|
-
type Document2BlockJson = {
|
|
216
|
-
/** Stable identity used by headless commands. Legacy JSON may omit it. */
|
|
217
|
-
id?: string;
|
|
218
|
-
command: string;
|
|
219
|
-
value?: string;
|
|
220
|
-
formats?: TextFormatSpan2Json[];
|
|
221
|
-
inline_ids?: Document2InlineIdsJson;
|
|
222
|
-
metadata?: Document2BlockMetadata;
|
|
223
|
-
/** Stable host asset identity (e.g. S3 key / UUID); optional for \\includegraphics. */
|
|
224
|
-
asset_id?: string;
|
|
225
|
-
math_objects?: Array<Document2MathObjectJson | null>;
|
|
226
|
-
options?: Record<string, string>;
|
|
227
|
-
closing?: string;
|
|
228
|
-
items?: Document2ListItemJson[];
|
|
229
|
-
rows?: string[][];
|
|
230
|
-
cell_formats?: TextFormatSpan2Json[][][];
|
|
231
|
-
cell_inline_ids?: Document2InlineIdsJson[][];
|
|
232
|
-
columns?: string;
|
|
233
|
-
caption?: string;
|
|
234
|
-
/** Optional formatting sidecar for caption text spans. */
|
|
235
|
-
caption_formats?: TextFormatSpan2Json[];
|
|
236
|
-
/** Stable caption field/token identities; omitted by legacy documents. */
|
|
237
|
-
caption_inline_ids?: Document2InlineIdsJson;
|
|
238
|
-
/** Caption-only structured math sidecar, independent from table cell math_objects. */
|
|
239
|
-
caption_math_objects?: Array<Document2MathObjectJson | null>;
|
|
240
|
-
label?: string;
|
|
241
|
-
caption_enabled?: boolean;
|
|
242
|
-
label_enabled?: boolean;
|
|
243
|
-
centered?: boolean;
|
|
244
|
-
};
|
|
245
|
-
type Document2ListItemJson = {
|
|
246
|
-
id?: string;
|
|
247
|
-
value: string;
|
|
248
|
-
formats?: TextFormatSpan2Json[];
|
|
249
|
-
inline_ids?: Document2InlineIdsJson;
|
|
250
|
-
math_objects?: Array<Document2MathObjectJson | null>;
|
|
251
|
-
blocks?: Document2BlockJson[];
|
|
252
|
-
};
|
|
253
|
-
type Document2Diagnostic = {
|
|
254
|
-
code: string;
|
|
255
|
-
message: string;
|
|
256
|
-
path: string;
|
|
257
|
-
};
|
|
258
|
-
type Reference2 = {
|
|
259
|
-
id: string;
|
|
260
|
-
key: string;
|
|
261
|
-
authors: string;
|
|
262
|
-
title: string;
|
|
263
|
-
year: string;
|
|
264
|
-
url: string;
|
|
265
|
-
venue: string;
|
|
266
|
-
/** Joins authors/title/venue/year in bibliography display and export. */
|
|
267
|
-
fieldSeparator: ReferenceFieldSeparator;
|
|
268
|
-
};
|
|
269
|
-
type TextStyle2 = {
|
|
270
|
-
bold?: true;
|
|
271
|
-
italic?: true;
|
|
272
|
-
underline?: true;
|
|
273
|
-
};
|
|
274
|
-
type TextFormatSpan2Json = {
|
|
275
|
-
start: number;
|
|
276
|
-
end: number;
|
|
277
|
-
bold?: boolean;
|
|
278
|
-
italic?: boolean;
|
|
279
|
-
underline?: boolean;
|
|
280
|
-
};
|
|
281
|
-
type TextToken2 = {
|
|
282
|
-
id: string;
|
|
283
|
-
kind: 'text';
|
|
284
|
-
text: string;
|
|
285
|
-
style?: TextStyle2;
|
|
286
|
-
};
|
|
287
|
-
type MathToken2 = {
|
|
288
|
-
id: string;
|
|
289
|
-
kind: 'math';
|
|
290
|
-
display: boolean;
|
|
291
|
-
opening: string;
|
|
292
|
-
closing: string;
|
|
293
|
-
source: string;
|
|
294
|
-
sourceSide?: Document2ParseMode;
|
|
295
|
-
math: MathNode | null;
|
|
296
|
-
editable: boolean;
|
|
297
|
-
reason?: string;
|
|
298
|
-
sourceOwner: 'imported-structured' | 'raw' | 'editor';
|
|
299
|
-
/** When true on display math, export as equation env with \\label. */
|
|
300
|
-
labelEnabled?: boolean;
|
|
301
|
-
label?: string;
|
|
302
|
-
};
|
|
303
|
-
type CiteToken2 = {
|
|
304
|
-
id: string;
|
|
305
|
-
kind: 'cite';
|
|
306
|
-
keys: string[];
|
|
307
|
-
};
|
|
308
|
-
type RefToken2 = {
|
|
309
|
-
id: string;
|
|
310
|
-
kind: 'ref';
|
|
311
|
-
keys: string[];
|
|
312
|
-
refCommand: 'ref' | 'eqref';
|
|
313
|
-
};
|
|
314
|
-
type InlineToken2 = TextToken2 | MathToken2 | CiteToken2 | RefToken2;
|
|
315
|
-
type InlineField2 = {
|
|
316
|
-
id: string;
|
|
317
|
-
tokens: InlineToken2[];
|
|
318
|
-
};
|
|
319
|
-
type TextBlock2 = {
|
|
320
|
-
id: string;
|
|
321
|
-
kind: 'textBlock';
|
|
322
|
-
command: '\\section' | '\\subsection' | '\\subsubsection' | '\\paragraph';
|
|
323
|
-
field: InlineField2;
|
|
324
|
-
metadata?: Document2BlockMetadata;
|
|
325
|
-
/** When true on \\paragraph, center in preview and LaTeX export. */
|
|
326
|
-
centered?: boolean;
|
|
327
|
-
};
|
|
328
|
-
type ListItem2 = {
|
|
329
|
-
id: string;
|
|
330
|
-
field: InlineField2;
|
|
331
|
-
blocks: Document2Block[];
|
|
332
|
-
};
|
|
333
|
-
type ListBlock2 = {
|
|
334
|
-
id: string;
|
|
335
|
-
kind: 'list';
|
|
336
|
-
command: '\\begin{itemize}' | '\\begin{enumerate}';
|
|
337
|
-
closing: '\\end{itemize}' | '\\end{enumerate}';
|
|
338
|
-
items: ListItem2[];
|
|
339
|
-
metadata?: Document2BlockMetadata;
|
|
340
|
-
};
|
|
341
|
-
type FloatMeta2 = {
|
|
342
|
-
centered: boolean;
|
|
343
|
-
captionEnabled: boolean;
|
|
344
|
-
/** Compatibility source string; captionField is the structured source of truth. */
|
|
345
|
-
caption: string;
|
|
346
|
-
/** Stable inline field used by the editor, commands, preview, and persistence. */
|
|
347
|
-
captionField: InlineField2;
|
|
348
|
-
labelEnabled: boolean;
|
|
349
|
-
label: string;
|
|
350
|
-
};
|
|
351
|
-
type TableBlock2 = {
|
|
352
|
-
id: string;
|
|
353
|
-
kind: 'table';
|
|
354
|
-
command: '\\begin{tabular}';
|
|
355
|
-
closing: '\\end{tabular}';
|
|
356
|
-
columns: string;
|
|
357
|
-
rows: InlineField2[][];
|
|
358
|
-
metadata?: Document2BlockMetadata;
|
|
359
|
-
} & FloatMeta2;
|
|
360
|
-
type ImageBlock2 = {
|
|
361
|
-
id: string;
|
|
362
|
-
kind: 'image';
|
|
363
|
-
command: '\\includegraphics';
|
|
364
|
-
value: string;
|
|
365
|
-
/** Host asset identity from wire `asset_id`; preserved across value edits. */
|
|
366
|
-
assetId?: string;
|
|
367
|
-
options: Record<string, string>;
|
|
368
|
-
metadata?: Document2BlockMetadata;
|
|
369
|
-
} & FloatMeta2;
|
|
370
|
-
type BibliographyBlock2 = {
|
|
371
|
-
id: string;
|
|
372
|
-
kind: 'bibliography';
|
|
373
|
-
command: '\\begin{thebibliography}';
|
|
374
|
-
closing: '\\end{thebibliography}';
|
|
375
|
-
metadata?: Document2BlockMetadata;
|
|
376
|
-
};
|
|
377
|
-
type RawBlock2 = {
|
|
378
|
-
id: string;
|
|
379
|
-
kind: 'raw';
|
|
380
|
-
command: '\\raw';
|
|
381
|
-
value: string;
|
|
382
|
-
metadata?: Document2BlockMetadata;
|
|
383
|
-
};
|
|
384
|
-
type Document2Block = TextBlock2 | ListBlock2 | TableBlock2 | ImageBlock2 | BibliographyBlock2 | RawBlock2;
|
|
385
|
-
type Document2Node = {
|
|
386
|
-
nodeType: 'DocumentObject';
|
|
387
|
-
meta: Document2Meta;
|
|
388
|
-
references: Reference2[];
|
|
389
|
-
blocks: Document2Block[];
|
|
390
|
-
diagnostics: Document2Diagnostic[];
|
|
391
|
-
};
|
|
392
|
-
type PreviewInline2 = {
|
|
393
|
-
kind: 'text';
|
|
394
|
-
text: string;
|
|
395
|
-
style?: TextStyle2;
|
|
396
|
-
} | {
|
|
397
|
-
kind: 'math';
|
|
398
|
-
id: string;
|
|
399
|
-
tex: string;
|
|
400
|
-
display: boolean;
|
|
401
|
-
output: Document2MathOutput;
|
|
402
|
-
editable: boolean;
|
|
403
|
-
} | {
|
|
404
|
-
kind: 'cite';
|
|
405
|
-
id: string;
|
|
406
|
-
keys: string[];
|
|
407
|
-
label: string;
|
|
408
|
-
} | {
|
|
409
|
-
kind: 'ref';
|
|
410
|
-
id: string;
|
|
411
|
-
keys: string[];
|
|
412
|
-
refCommand: 'ref' | 'eqref';
|
|
413
|
-
label: string;
|
|
414
|
-
};
|
|
415
|
-
type PreviewBlock2 = {
|
|
416
|
-
kind: 'basmala';
|
|
417
|
-
id: string;
|
|
418
|
-
text: string;
|
|
419
|
-
tex: string;
|
|
420
|
-
} | {
|
|
421
|
-
kind: 'titleBlock';
|
|
422
|
-
id: string;
|
|
423
|
-
title?: string;
|
|
424
|
-
authors?: string;
|
|
425
|
-
date?: string;
|
|
426
|
-
} | {
|
|
427
|
-
kind: 'abstract';
|
|
428
|
-
id: string;
|
|
429
|
-
text: string;
|
|
430
|
-
} | {
|
|
431
|
-
kind: 'closing';
|
|
432
|
-
id: string;
|
|
433
|
-
text: string;
|
|
434
|
-
tex: string;
|
|
435
|
-
} | {
|
|
436
|
-
kind: 'heading';
|
|
437
|
-
id: string;
|
|
438
|
-
level: 1 | 2 | 3;
|
|
439
|
-
inlines: PreviewInline2[];
|
|
440
|
-
metadata?: Document2BlockMetadata;
|
|
441
|
-
} | {
|
|
442
|
-
kind: 'paragraph';
|
|
443
|
-
id: string;
|
|
444
|
-
inlines: PreviewInline2[];
|
|
445
|
-
centered?: boolean;
|
|
446
|
-
metadata?: Document2BlockMetadata;
|
|
447
|
-
} | {
|
|
448
|
-
kind: 'list';
|
|
449
|
-
id: string;
|
|
450
|
-
ordered: boolean;
|
|
451
|
-
items: Array<{
|
|
452
|
-
id: string;
|
|
453
|
-
inlines: PreviewInline2[];
|
|
454
|
-
blocks: PreviewBlock2[];
|
|
455
|
-
}>;
|
|
456
|
-
metadata?: Document2BlockMetadata;
|
|
457
|
-
} | {
|
|
458
|
-
kind: 'table';
|
|
459
|
-
id: string;
|
|
460
|
-
rows: PreviewInline2[][][];
|
|
461
|
-
/** Compatibility source string for hosts that still read caption directly. */
|
|
462
|
-
caption?: string;
|
|
463
|
-
/** Structured caption rendering path, including MathIsland tokens. */
|
|
464
|
-
captionInlines?: PreviewInline2[];
|
|
465
|
-
label?: string;
|
|
466
|
-
numberLabel?: string;
|
|
467
|
-
metadata?: Document2BlockMetadata;
|
|
468
|
-
} | {
|
|
469
|
-
kind: 'image';
|
|
470
|
-
id: string;
|
|
471
|
-
src: string;
|
|
472
|
-
assetId?: string;
|
|
473
|
-
options: Record<string, string>;
|
|
474
|
-
centered?: boolean;
|
|
475
|
-
/** Compatibility source string for alt text/legacy hosts. */
|
|
476
|
-
caption?: string;
|
|
477
|
-
/** Structured caption rendering path, including MathIsland tokens. */
|
|
478
|
-
captionInlines?: PreviewInline2[];
|
|
479
|
-
label?: string;
|
|
480
|
-
numberLabel?: string;
|
|
481
|
-
metadata?: Document2BlockMetadata;
|
|
482
|
-
} | {
|
|
483
|
-
kind: 'bibliography';
|
|
484
|
-
id: string;
|
|
485
|
-
items: Array<{
|
|
486
|
-
id: string;
|
|
487
|
-
numberLabel: string;
|
|
488
|
-
key: string;
|
|
489
|
-
authors: string;
|
|
490
|
-
title: string;
|
|
491
|
-
year: string;
|
|
492
|
-
url: string;
|
|
493
|
-
venue: string;
|
|
494
|
-
fieldSeparator: ReferenceFieldSeparator;
|
|
495
|
-
}>;
|
|
496
|
-
metadata?: Document2BlockMetadata;
|
|
497
|
-
}
|
|
498
|
-
/** Preview-only: raw / unknown blocks are omitted from preview until we add proper rendering. */
|
|
499
|
-
| {
|
|
500
|
-
kind: 'omit';
|
|
501
|
-
id: string;
|
|
502
|
-
metadata?: Document2BlockMetadata;
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
type Document2LabelKind = 'fig' | 'tab' | 'eq';
|
|
506
|
-
type Document2LabelEntry = {
|
|
507
|
-
key: string;
|
|
508
|
-
kind: Document2LabelKind;
|
|
509
|
-
caption: string;
|
|
510
|
-
/** Block id for fig/tab, or math token id for eq. */
|
|
511
|
-
ownerId: string;
|
|
512
|
-
number: number;
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
type Document2MetaProp = Partial<Omit<Document2Meta, 'date'>> & {
|
|
516
|
-
date?: Partial<Document2HijriDate>;
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
type ImageAssetRef = {
|
|
520
|
-
assetId: string;
|
|
521
|
-
value?: string;
|
|
522
|
-
label?: string;
|
|
523
|
-
thumbUrl?: string;
|
|
524
|
-
};
|
|
525
|
-
type ImageBlockEditorRenderContext = {
|
|
526
|
-
blockId: string;
|
|
527
|
-
assetId?: string;
|
|
528
|
-
value: string;
|
|
529
|
-
resolvedUrl: string;
|
|
530
|
-
uiLocale: ButexUiLocale;
|
|
531
|
-
onSelectAsset: (ref: ImageAssetRef) => void;
|
|
532
|
-
onClearAsset: () => void;
|
|
533
|
-
defaultUi: ReactNode;
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
/** Controls which responsive interaction workflow a React editor uses. */
|
|
537
|
-
type ButexResponsiveMode = 'auto' | 'desktop' | 'compact';
|
|
538
|
-
|
|
539
|
-
type ButexDocumentEditor2Props$1 = {
|
|
540
|
-
initialDocument?: Document2Json | Document2Node;
|
|
541
|
-
/** Seed article metadata when JSON/node omits fields (JSON wins when present). */
|
|
542
|
-
documentMeta?: Document2MetaProp;
|
|
543
|
-
className?: string;
|
|
544
|
-
debug?: boolean;
|
|
545
|
-
documentDirection?: 'rtl' | 'ltr';
|
|
546
|
-
equationSide?: EditorSide;
|
|
547
|
-
editableEquations?: boolean;
|
|
548
|
-
/** When true, render only the read-only document preview (no toolbar, editor panel, or equation drawer). */
|
|
549
|
-
previewOnly?: boolean;
|
|
550
|
-
uiLocale?: ButexUiLocale;
|
|
551
|
-
/** Selects the responsive interaction workflow. Automatic mode follows the layout viewport. */
|
|
552
|
-
responsiveMode?: ButexResponsiveMode;
|
|
553
|
-
mathOutput?: Document2MathOutput;
|
|
554
|
-
/** Digit shaping for citation and bibliography numbers (western / arabicIndic / persianIndic). */
|
|
555
|
-
digitForm?: DigitFormId;
|
|
556
|
-
onDigitFormChange?: (digitForm: DigitFormId) => void;
|
|
557
|
-
/** Host maps assetId / literal value to a browser-loadable image URL (S3, CDN, local). */
|
|
558
|
-
resolveImageUrl?: (ref: {
|
|
559
|
-
assetId?: string;
|
|
560
|
-
value: string;
|
|
561
|
-
}) => string;
|
|
562
|
-
onRequestImagePick?: (ctx: {
|
|
563
|
-
blockId: string;
|
|
564
|
-
current: ImageAssetRef | null;
|
|
565
|
-
}) => Promise<ImageAssetRef | null> | ImageAssetRef | null;
|
|
566
|
-
listImageAssets?: () => Promise<ImageAssetRef[]> | ImageAssetRef[];
|
|
567
|
-
renderImageBlockEditor?: (ctx: ImageBlockEditorRenderContext) => ReactNode;
|
|
568
|
-
onDocumentChange?: (document: Document2Node) => void;
|
|
569
|
-
/** Canonical JSON wire format for API/database persistence. */
|
|
570
|
-
onDocumentJsonChange?: (document: Document2Json) => void;
|
|
571
|
-
onLatexChange?: (latex: string) => void;
|
|
572
|
-
};
|
|
573
|
-
type Document2InitialState = {
|
|
574
|
-
document: Document2Node;
|
|
575
|
-
error: string | null;
|
|
576
|
-
};
|
|
577
|
-
/** Imperative host API — insert/update figures on the live document without remounting. */
|
|
578
|
-
type ButexDocumentEditor2Ref = {
|
|
579
|
-
/** Insert image block after focused block (same as toolbar figure button). */
|
|
580
|
-
insertImageBlock: (srcOrAsset?: string | ImageAssetRef) => void;
|
|
581
|
-
/** Set path on an existing image block. */
|
|
582
|
-
updateImageBlockValue: (blockId: string, value: string) => void;
|
|
583
|
-
/** Set host asset identity and includegraphics value on an existing image block. */
|
|
584
|
-
updateImageBlockAsset: (blockId: string, ref: ImageAssetRef) => void;
|
|
585
|
-
/** Canonical JSON without host-side AST mutation. */
|
|
586
|
-
getDocumentJson: () => Document2Json;
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
declare function resolveInitialDocument2(initialDocument: Document2Json | Document2Node | undefined, uiLocale?: ButexUiLocale, documentMeta?: Document2MetaProp): Document2InitialState;
|
|
590
|
-
|
|
591
|
-
type ButexDocumentEditor2Props = ButexDocumentEditor2Props$1 & {
|
|
592
|
-
/** Reports whether the current draft is safe for LaTeX compilation. */
|
|
593
|
-
onValidityChange?: (isValid: boolean) => void;
|
|
594
|
-
};
|
|
595
|
-
declare const ButexDocumentEditor2: react.ForwardRefExoticComponent<ButexDocumentEditor2Props$1 & {
|
|
596
|
-
/** Reports whether the current draft is safe for LaTeX compilation. */
|
|
597
|
-
onValidityChange?: (isValid: boolean) => void;
|
|
598
|
-
} & react.RefAttributes<ButexDocumentEditor2Ref>>;
|
|
599
|
-
|
|
600
|
-
type ResolveDocument2ImageUrl = (ref: {
|
|
601
|
-
assetId?: string;
|
|
602
|
-
value: string;
|
|
603
|
-
}) => string | null | undefined;
|
|
604
|
-
declare function DocumentPreview({ blocks, output, documentDirection, uiLocale, digitForm, resolveImageUrl, }: {
|
|
605
|
-
blocks: PreviewBlock2[];
|
|
606
|
-
output: Document2MathOutput;
|
|
607
|
-
documentDirection?: 'rtl' | 'ltr';
|
|
608
|
-
uiLocale?: ButexUiLocale;
|
|
609
|
-
digitForm?: DigitFormId;
|
|
610
|
-
resolveImageUrl?: ResolveDocument2ImageUrl;
|
|
611
|
-
}): react_jsx_runtime.JSX.Element;
|
|
612
|
-
|
|
613
|
-
type ButexDocumentPreviewProps = {
|
|
614
|
-
/** Persisted wire JSON or an already-imported live Document2 node. */
|
|
615
|
-
document: Document2Json | Document2Node;
|
|
616
|
-
className?: string;
|
|
617
|
-
documentDirection?: Document2Direction;
|
|
618
|
-
uiLocale?: ButexUiLocale;
|
|
619
|
-
digitForm?: DigitFormId;
|
|
620
|
-
equationSide?: EditorSide;
|
|
621
|
-
mathOutput?: Document2MathOutput;
|
|
622
|
-
/** Host maps asset identity/value to a browser-loadable URL. Return null/undefined while unavailable. */
|
|
623
|
-
resolveImageUrl?: ResolveDocument2ImageUrl;
|
|
624
|
-
};
|
|
625
|
-
type PreviewDocumentState = {
|
|
626
|
-
document: Document2Node;
|
|
627
|
-
error: string | null;
|
|
628
|
-
};
|
|
629
|
-
declare function resolvePreviewDocument2(input: Document2Json | Document2Node, uiLocale?: ButexUiLocale): PreviewDocumentState;
|
|
630
|
-
/**
|
|
631
|
-
* Dedicated read-only Document2 renderer. This intentionally bypasses the full
|
|
632
|
-
* editor component and derives only the runtime document plus preview model.
|
|
633
|
-
*/
|
|
634
|
-
declare function ButexDocumentPreview({ document, className, documentDirection, uiLocale, digitForm, equationSide, mathOutput, resolveImageUrl, }: ButexDocumentPreviewProps): react_jsx_runtime.JSX.Element;
|
|
635
|
-
|
|
636
|
-
type DocumentInsertToolbarProps = {
|
|
637
|
-
canUndo: boolean;
|
|
638
|
-
canRedo: boolean;
|
|
639
|
-
editableEquations?: boolean;
|
|
640
|
-
uiLocale?: ButexUiLocale;
|
|
641
|
-
digitForm?: DigitFormId;
|
|
642
|
-
selectionCount?: number;
|
|
643
|
-
canMoveSelectionUp?: boolean;
|
|
644
|
-
canMoveSelectionDown?: boolean;
|
|
645
|
-
canFormatText?: boolean;
|
|
646
|
-
activeTextStyles?: TextStyle2;
|
|
647
|
-
onUndo: () => void;
|
|
648
|
-
onRedo: () => void;
|
|
649
|
-
onToggleTextStyle?: (styleName: keyof TextStyle2) => void;
|
|
650
|
-
onMoveSelectionUp?: () => void;
|
|
651
|
-
onMoveSelectionDown?: () => void;
|
|
652
|
-
onDeleteSelection?: () => void;
|
|
653
|
-
onAddSection: () => void;
|
|
654
|
-
onAddSubsection: () => void;
|
|
655
|
-
onAddSubsubsection: () => void;
|
|
656
|
-
onAddParagraph: () => void;
|
|
657
|
-
onAddInlineEquation: () => void;
|
|
658
|
-
onAddDisplayEquation: () => void;
|
|
659
|
-
onAddTable: (rowCount: number, colCount: number) => void;
|
|
660
|
-
onAddList: () => void;
|
|
661
|
-
onAddEnumerate: () => void;
|
|
662
|
-
onAddFigure: () => void;
|
|
663
|
-
onInsertCitation: () => void;
|
|
664
|
-
onInsertInternalRef: () => void;
|
|
665
|
-
onInsertBibliography: () => void;
|
|
666
|
-
onManageReferences: () => void;
|
|
667
|
-
onManageLabels: () => void;
|
|
668
|
-
onOpenArticleMeta?: () => void;
|
|
669
|
-
onDigitFormChange: (digitForm: DigitFormId) => void;
|
|
670
|
-
};
|
|
671
|
-
declare function DocumentInsertToolbar({ canUndo, canRedo, editableEquations, uiLocale, digitForm, selectionCount, canMoveSelectionUp, canMoveSelectionDown, canFormatText, activeTextStyles, onUndo, onRedo, onToggleTextStyle, onMoveSelectionUp, onMoveSelectionDown, onDeleteSelection, onAddSection, onAddSubsection, onAddSubsubsection, onAddParagraph, onAddInlineEquation, onAddDisplayEquation, onAddTable, onAddList, onAddEnumerate, onAddFigure, onInsertCitation, onInsertInternalRef, onInsertBibliography, onManageReferences, onManageLabels, onOpenArticleMeta, onDigitFormChange, }: DocumentInsertToolbarProps): react_jsx_runtime.JSX.Element;
|
|
672
|
-
|
|
673
|
-
type EquationMathMode = 'inline' | 'display';
|
|
674
|
-
type EquationDrawerProps = {
|
|
675
|
-
debug?: boolean;
|
|
676
|
-
session: EditorSession;
|
|
677
|
-
reason?: string | null;
|
|
678
|
-
mathMode: EquationMathMode;
|
|
679
|
-
canDelete?: boolean;
|
|
680
|
-
equationSide?: EditorSide;
|
|
681
|
-
uiLocale?: ButexUiLocale;
|
|
682
|
-
responsiveMode?: ButexResponsiveMode;
|
|
683
|
-
labelEnabled?: boolean;
|
|
684
|
-
label?: string;
|
|
685
|
-
labels?: Document2LabelEntry[];
|
|
686
|
-
references?: Reference2[];
|
|
687
|
-
ownerId?: string;
|
|
688
|
-
onLabelEnabledChange?: (enabled: boolean) => void;
|
|
689
|
-
onLabelChange?: (label: string) => void;
|
|
690
|
-
onMathModeChange: (mode: EquationMathMode) => void;
|
|
691
|
-
onClose: () => void;
|
|
692
|
-
onSave: (session: EditorSession) => void;
|
|
693
|
-
onDelete?: () => void;
|
|
694
|
-
};
|
|
695
|
-
declare function EquationDrawer({ debug, session, reason, mathMode, canDelete, equationSide, uiLocale, responsiveMode, labelEnabled, label, labels, references, ownerId, onLabelEnabledChange, onLabelChange, onMathModeChange, onClose, onSave, onDelete, }: EquationDrawerProps): react_jsx_runtime.JSX.Element;
|
|
696
|
-
|
|
697
|
-
type InlineFieldProps = {
|
|
698
|
-
field: InlineField2;
|
|
699
|
-
blockId?: string;
|
|
700
|
-
references?: Reference2[];
|
|
701
|
-
documentNode?: Document2Node;
|
|
702
|
-
documentDirection?: 'rtl' | 'ltr';
|
|
703
|
-
digitForm?: DigitFormId;
|
|
704
|
-
mathOutput?: Document2MathOutput;
|
|
705
|
-
equationSide?: EditorSide;
|
|
706
|
-
editableEquations?: boolean;
|
|
707
|
-
editableCitations?: boolean;
|
|
708
|
-
uiLocale?: ButexUiLocale;
|
|
709
|
-
onTextChange: (fieldId: string, tokenId: string, text: string) => void;
|
|
710
|
-
onOpenMath: (token: MathToken2, origin: HTMLButtonElement) => void;
|
|
711
|
-
onDeleteMath?: (tokenId: string) => void;
|
|
712
|
-
onOpenCite?: (token: CiteToken2) => void;
|
|
713
|
-
onDeleteCite?: (tokenId: string) => void;
|
|
714
|
-
onOpenRef?: (token: RefToken2) => void;
|
|
715
|
-
onDeleteRef?: (tokenId: string) => void;
|
|
716
|
-
onFieldFocus?: (blockId: string, fieldId: string, textTokenId: string, caretOffset: number, selectionStart: number, selectionEnd: number) => void;
|
|
717
|
-
onMathFocus?: (blockId: string, fieldId: string, tokenId: string) => void;
|
|
718
|
-
onCiteFocus?: (blockId: string, fieldId: string, tokenId: string) => void;
|
|
719
|
-
onRefFocus?: (blockId: string, fieldId: string, tokenId: string) => void;
|
|
720
|
-
onFieldBlur?: () => void;
|
|
721
|
-
};
|
|
722
|
-
declare function InlineField({ field, blockId, references, documentNode, documentDirection, digitForm, mathOutput, equationSide, editableEquations, editableCitations, uiLocale, onTextChange, onOpenMath, onDeleteMath, onOpenCite, onDeleteCite, onOpenRef, onDeleteRef, onFieldFocus, onMathFocus, onCiteFocus, onRefFocus, onFieldBlur, }: InlineFieldProps): react_jsx_runtime.JSX.Element;
|
|
723
|
-
|
|
724
|
-
type MathChipProps = {
|
|
725
|
-
token: MathToken2;
|
|
726
|
-
output?: Document2MathOutput;
|
|
727
|
-
documentDirection?: 'rtl' | 'ltr';
|
|
728
|
-
digitForm?: DigitFormId;
|
|
729
|
-
equationSide?: EditorSide;
|
|
730
|
-
editable?: boolean;
|
|
731
|
-
uiLocale?: ButexUiLocale;
|
|
732
|
-
buttonRef?: (element: HTMLButtonElement | null) => void;
|
|
733
|
-
onOpen: (token: MathToken2, origin: HTMLButtonElement) => void;
|
|
734
|
-
onDelete?: (tokenId: string) => void;
|
|
735
|
-
onFocus?: (tokenId: string) => void;
|
|
736
|
-
onRequestTextFocus?: (tokenId: string, direction: -1 | 1) => void;
|
|
737
|
-
onTextInputFromFocus?: (tokenId: string, text: string) => void;
|
|
738
|
-
};
|
|
739
|
-
declare function MathChip({ token, output, documentDirection, digitForm, equationSide, editable, uiLocale, buttonRef, onOpen, onDelete, onFocus, onRequestTextFocus, onTextInputFromFocus, }: MathChipProps): react_jsx_runtime.JSX.Element;
|
|
740
|
-
|
|
741
|
-
type BuTeXMathOutput = 'chtml' | 'svg';
|
|
742
|
-
|
|
743
|
-
type MathIslandProps = {
|
|
744
|
-
id: string;
|
|
745
|
-
tex: string;
|
|
746
|
-
display: boolean;
|
|
747
|
-
output?: BuTeXMathOutput;
|
|
748
|
-
};
|
|
749
|
-
declare function MathIsland({ id, tex, display, output }: MathIslandProps): react_jsx_runtime.JSX.Element;
|
|
750
|
-
|
|
751
|
-
declare const DOCUMENT2_WIDGET_CSS = "\n.butex-document2-widget {\n --butex-document2-bg: var(--butex-bg, #f8fafc);\n --butex-document2-fg: var(--butex-fg, #0f172a);\n --butex-document2-muted: var(--butex-muted, #64748b);\n --butex-document2-panel: var(--butex-panel, #ffffff);\n --butex-document2-border: var(--butex-border, #e2e8f0);\n --butex-document2-accent: var(--butex-accent, #0d9488);\n --butex-document2-accent-bg: var(--butex-toolbar-hover-bg, rgba(13, 148, 136, 0.08));\n --butex-document2-focus-shadow: var(--butex-focus-shadow, rgba(13, 148, 136, 0.16));\n --butex-document2-danger: var(--butex-danger, #dc2626);\n --butex-document2-error: var(--butex-error, #b91c1c);\n --butex-document2-error-bg: var(--butex-error-bg, #fef2f2);\n --butex-document2-preview-bg: var(--butex-preview-bg, #ffffff);\n --butex-document2-preview-fg: var(--butex-preview-fg, var(--butex-document2-fg));\n --butex-document2-preview-font: \"Amiri\", \"Noto Serif Arabic\", Georgia, \"Times New Roman\", serif;\n --butex-document2-drawer-bg: var(--butex-document2-panel);\n --butex-document2-input-bg: #ffffff;\n --butex-document2-raw-bg: #f8fafc;\n --butex-document2-math-bg: var(--butex-document2-accent-bg);\n --butex-document2-math-border: rgba(13, 148, 136, 0.35);\n --butex-document2-text-token-bg: var(--butex-text-token-bg, color-mix(in srgb, var(--butex-document2-panel) 86%, var(--butex-document2-bg)));\n --butex-document2-text-token-border: var(--butex-text-token-border, color-mix(in srgb, var(--butex-document2-border) 86%, var(--butex-document2-muted)));\n --butex-document2-math-inline-bg: var(--butex-math-inline-bg, color-mix(in srgb, var(--butex-document2-accent) 10%, var(--butex-document2-panel)));\n --butex-document2-math-display-bg: var(--butex-math-display-bg, color-mix(in srgb, var(--butex-document2-accent) 7%, var(--butex-document2-bg)));\n --butex-document2-collapse-bg: var(--butex-collapse-bg, color-mix(in srgb, var(--butex-document2-muted) 8%, var(--butex-document2-panel)));\n --butex-document2-dev-bg: var(--butex-dev-bg, #fffbeb);\n --butex-document2-dev-border: var(--butex-dev-border, #fcd34d);\n --butex-document2-dev-code-bg: var(--butex-dev-inset-bg, #ffffff);\n --butex-document2-dev-code-fg: var(--butex-dev-inset-fg, var(--butex-document2-fg));\n --butex-safe-area-top: env(safe-area-inset-top, 0px);\n --butex-safe-area-right: env(safe-area-inset-right, 0px);\n --butex-safe-area-bottom: env(safe-area-inset-bottom, 0px);\n --butex-safe-area-left: env(safe-area-inset-left, 0px);\n --butex-document2-sticky-top: var(--butex-safe-area-top);\n --butex-document2-z-toolbar: 20;\n --butex-document2-z-popover: 30;\n --butex-document2-z-overlay: 40;\n --butex-document2-z-equation: 50;\n box-sizing: border-box;\n color: var(--butex-document2-fg);\n container-name: butex-document2;\n container-type: inline-size;\n direction: rtl;\n font-family: ui-sans-serif, system-ui, \"Segoe UI\", Tahoma, Arial, sans-serif;\n line-height: 1.45;\n max-width: 100%;\n min-width: 0;\n width: 100%;\n}\n\n.butex-document2-widget *,\n.butex-document2-widget *::before,\n.butex-document2-widget *::after {\n box-sizing: inherit;\n}\n\n.butex-document2-widget__sr-only {\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.butex-document2-widget__shell,\n.butex-document2-widget__editor-panel,\n.butex-document2-widget__blocks,\n.butex-document2-widget__dev,\n.butex-document2-widget__field {\n display: grid;\n gap: 10px;\n max-width: 100%;\n min-width: 0;\n}\n\n.butex-document2-widget__shell,\n.butex-document2-widget__layout,\n.butex-document2-widget__toolbar,\n.butex-document2-widget__panel,\n.butex-document2-widget__block,\n.butex-document2-widget__row {\n max-width: 100%;\n min-width: 0;\n}\n\n.butex-document2-widget__toolbar,\n.butex-document2-widget__panel,\n.butex-document2-widget__block,\n.butex-document2-widget__dev {\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 12px;\n min-width: 0;\n padding: 12px;\n}\n\n.butex-document2-widget__toolbar {\n position: sticky;\n top: var(--butex-document2-sticky-top);\n z-index: var(--butex-document2-z-toolbar);\n box-shadow: 0 4px 16px color-mix(in srgb, var(--butex-document2-fg) 6%, transparent);\n gap: 6px;\n}\n\n.butex-document2-widget__toolbar-insert {\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n}\n\n.butex-document2-widget__mobile-toolbar {\n display: none;\n min-width: 0;\n width: 100%;\n}\n\n.butex-document2-widget__mobile-toolbar-primary {\n align-items: center;\n display: flex;\n flex-wrap: nowrap;\n gap: 6px;\n min-width: 0;\n}\n\n.butex-document2-widget__mobile-view {\n background: var(--butex-document2-bg);\n border: 1px solid var(--butex-document2-border);\n border-radius: 10px;\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n padding: 2px;\n}\n\n.butex-document2-widget__mobile-view button {\n border: 0;\n flex: 1 1 50%;\n min-width: 0;\n white-space: nowrap;\n}\n\n.butex-document2-widget__mobile-view button[aria-pressed=\"true\"] {\n background: var(--butex-document2-panel);\n box-shadow: 0 1px 4px color-mix(in srgb, var(--butex-document2-fg) 12%, transparent);\n}\n\n.butex-document2-widget__mobile-toolbar-actions {\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n}\n\n.butex-document2-widget__mobile-toolbar button {\n min-height: 44px;\n}\n\n.butex-document2-widget__mobile-toolbar .butex-document2-widget__icon-btn {\n min-width: 44px;\n}\n\n.butex-document2-widget__mobile-context {\n align-items: center;\n display: flex;\n flex-wrap: nowrap;\n gap: 6px;\n max-width: 100%;\n min-width: 0;\n overflow-x: auto;\n overscroll-behavior-inline: contain;\n padding-block-start: 6px;\n scrollbar-width: thin;\n}\n\n.butex-document2-widget__command-sheet-backdrop {\n align-items: flex-end;\n background: color-mix(in srgb, #000 35%, transparent);\n display: flex;\n inset: 0;\n justify-content: center;\n padding-bottom: var(--butex-safe-area-bottom);\n padding-left: max(12px, var(--butex-safe-area-left));\n padding-right: max(12px, var(--butex-safe-area-right));\n padding-top: max(12px, var(--butex-safe-area-top));\n position: fixed;\n z-index: var(--butex-document2-z-popover);\n}\n\n.butex-document2-widget__command-sheet {\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 16px 16px 0 0;\n box-shadow: 0 -16px 40px color-mix(in srgb, #000 22%, transparent);\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n max-height: min(78vh, 720px);\n max-height: min(720px, calc(100dvh - max(12px, var(--butex-safe-area-top)) - var(--butex-safe-area-bottom)));\n max-width: 640px;\n min-width: 0;\n overflow: hidden;\n width: 100%;\n}\n\n.butex-document2-widget__command-sheet-header {\n align-items: center;\n border-block-end: 1px solid var(--butex-document2-border);\n display: flex;\n gap: 8px;\n justify-content: space-between;\n min-width: 0;\n padding: 10px 12px;\n}\n\n.butex-document2-widget__command-sheet-body {\n display: grid;\n gap: 12px;\n min-height: 0;\n min-width: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 12px;\n}\n\n.butex-document2-widget__command-group {\n border: 1px solid var(--butex-document2-border);\n border-radius: 10px;\n display: grid;\n gap: 8px;\n min-width: 0;\n padding: 10px;\n}\n\n.butex-document2-widget__command-group h3 {\n font-size: 0.88rem;\n margin: 0;\n}\n\n.butex-document2-widget__command-grid {\n display: grid;\n gap: 6px;\n grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));\n min-width: 0;\n}\n\n.butex-document2-widget__command-grid button {\n min-height: 44px;\n overflow-wrap: anywhere;\n text-align: start;\n}\n\n.butex-document2-widget__command-grid--digits button {\n text-align: center;\n}\n\n.butex-document2-widget__command-grid [aria-selected=\"true\"] {\n background: var(--butex-document2-accent-bg);\n border-color: var(--butex-document2-accent);\n}\n\n.butex-document2-widget__command-subtitle {\n color: var(--butex-document2-muted);\n font-size: 0.82rem;\n font-weight: 600;\n}\n\n.butex-document2-widget__mobile-table-form label {\n display: grid;\n gap: 5px;\n}\n\n.butex-document2-widget__mobile-table-form input,\n.butex-document2-widget__mobile-table-form button {\n min-height: 44px;\n width: 100%;\n}\n\n.butex-document2-widget__sheet-back {\n justify-self: start;\n width: auto !important;\n}\n\n.butex-document2-widget__toolbar-group {\n align-items: center;\n border-inline-start: 1px solid color-mix(in srgb, var(--butex-document2-border) 75%, transparent);\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n padding-inline-start: 6px;\n}\n\n.butex-document2-widget__toolbar-group:first-child {\n border-inline-start: 0;\n padding-inline-start: 0;\n}\n\n.butex-document2-widget__icon-btn {\n align-items: center;\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n color: var(--butex-document2-fg);\n cursor: pointer;\n display: inline-flex;\n font-weight: 700;\n justify-content: center;\n line-height: 1;\n min-height: 30px;\n min-width: 30px;\n padding: 0 6px;\n}\n\n.butex-document2-widget__icon-btn:hover:not(:disabled),\n.butex-document2-widget__icon-btn[aria-pressed=\"true\"] {\n background: var(--butex-document2-accent-bg);\n border-color: var(--butex-document2-accent);\n}\n\n.butex-document2-widget__icon-btn:disabled {\n cursor: not-allowed;\n opacity: 0.45;\n}\n\n.butex-document2-widget__icon-btn--h1 {\n font-size: 1.15rem;\n}\n\n.butex-document2-widget__icon-btn--h2 {\n font-size: 1rem;\n}\n\n.butex-document2-widget__icon-btn--h3 {\n font-size: 0.88rem;\n}\n\n.butex-document2-widget__icon-math-inline {\n font-family: ui-monospace, Consolas, monospace;\n font-size: 0.78rem;\n font-weight: 600;\n}\n\n.butex-document2-widget__icon-math-display {\n font-size: 0.82rem;\n font-weight: 700;\n}\n\n.butex-document2-widget__icon-bibliography {\n display: inline-flex;\n line-height: 0;\n}\n\n.butex-document2-widget__icon-bibliography svg {\n display: block;\n}\n\n.butex-document2-widget__format-btn {\n font-family: \"Amiri\", \"Noto Serif Arabic\", Georgia, serif;\n min-width: 36px;\n}\n\n.butex-document2-widget__format-icon {\n direction: rtl;\n display: inline-block;\n font-size: 0.84rem;\n font-weight: 500;\n}\n\n.butex-document2-widget__format-icon--bold {\n font-weight: 900;\n}\n\n.butex-document2-widget__format-icon--italic {\n font-style: italic;\n transform: skewX(-7deg);\n}\n\n.butex-document2-widget__format-icon--underline {\n text-decoration: underline;\n text-underline-offset: 0.12em;\n}\n\n.butex-document2-widget__format-underline,\n.butex-document2-widget__preview-underline {\n text-decoration: underline;\n text-underline-offset: 0.12em;\n}\n\n.butex-document2-widget__references-menu {\n position: relative;\n}\n\n.butex-document2-widget__references-trigger {\n gap: 5px;\n white-space: nowrap;\n}\n\n.butex-document2-widget__menu-chevron {\n color: var(--butex-document2-muted);\n font-size: 0.8rem;\n}\n\n.butex-document2-widget__references-menu-options {\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n box-shadow: 0 8px 24px color-mix(in srgb, var(--butex-document2-fg) 16%, transparent);\n display: grid;\n gap: 2px;\n inset-inline-start: 0;\n margin-top: 4px;\n max-width: calc(100vw - 24px);\n max-width: calc(100cqw - 16px);\n min-width: 0;\n overflow-x: auto;\n padding: 4px;\n position: absolute;\n top: 100%;\n width: max-content;\n z-index: var(--butex-document2-z-popover);\n}\n\n.butex-document2-widget__references-menu-options button {\n align-items: center;\n background: transparent;\n border: 0;\n border-radius: 6px;\n color: var(--butex-document2-fg);\n cursor: pointer;\n display: grid;\n font: inherit;\n gap: 8px;\n grid-template-columns: 18px 1fr;\n padding: 7px 9px;\n text-align: start;\n}\n\n.butex-document2-widget__references-menu-options button:hover,\n.butex-document2-widget__references-menu-options button:focus-visible {\n background: var(--butex-document2-accent-bg);\n outline: none;\n}\n\n.butex-document2-widget__float-meta {\n display: grid;\n gap: 8px;\n margin-top: 8px;\n}\n\n.butex-document2-widget__float-meta--compact {\n gap: 4px;\n}\n\n.butex-document2-widget__float-meta-toggle {\n align-items: center;\n display: inline-flex;\n gap: 6px;\n font-size: 0.9rem;\n}\n\n.butex-document2-widget__preview-paragraph--centered {\n text-align: center;\n}\n\n.butex-document2-widget__labels-help {\n color: color-mix(in srgb, var(--butex-document2-fg) 72%, transparent);\n font-size: 0.9rem;\n margin: 0 0 10px;\n}\n\n.butex-document2-widget__preview-float {\n margin: 0.75rem 0;\n max-width: 100%;\n min-width: 0;\n text-align: center;\n}\n\n.butex-document2-widget__preview-float--start,\n.butex-document2-widget__preview-float--start figcaption {\n text-align: start;\n}\n\n.butex-document2-widget__preview-float figcaption {\n color: color-mix(in srgb, var(--butex-document2-fg) 80%, transparent);\n font-size: 0.92rem;\n margin-top: 0.4rem;\n text-align: center;\n}\n\n.butex-document2-widget__preview-float-number {\n font-weight: 600;\n}\n\n.butex-document2-widget__preview-ref {\n font-variant-numeric: tabular-nums;\n}\n\n.butex-document2-widget__ref-chip {\n border-style: dashed;\n}\n\n.butex-document2-widget__block-actions {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.butex-document2-widget button.butex-document2-widget__block-collapse {\n align-items: center;\n background: var(--butex-document2-collapse-bg);\n border-color: color-mix(in srgb, var(--butex-document2-border) 70%, var(--butex-document2-muted));\n display: inline-flex;\n font-weight: 800;\n justify-content: center;\n min-height: 26px;\n min-width: 26px;\n padding: 0;\n}\n\n.butex-document2-widget__math-chip-wrap {\n align-items: center;\n display: inline-flex;\n gap: 2px;\n}\n\n.butex-document2-widget__math-chip-wrap[data-display=\"true\"] {\n flex: 1 1 100%;\n justify-content: center;\n width: 100%;\n}\n\n.butex-document2-widget__math-chip-delete {\n background: transparent;\n border: 1px solid color-mix(in srgb, var(--butex-document2-danger) 35%, var(--butex-document2-border));\n border-radius: 6px;\n color: var(--butex-document2-danger);\n cursor: pointer;\n font-size: 0.85rem;\n line-height: 1;\n min-height: 24px;\n min-width: 24px;\n padding: 0;\n}\n\n.butex-document2-widget__table-cell {\n flex: 1 0 8rem;\n min-width: 8rem;\n}\n\n.butex-document2-widget__table-editor-scroll,\n.butex-document2-widget__preview-table-scroll {\n max-width: 100%;\n min-width: 0;\n overflow-x: auto;\n overscroll-behavior-inline: contain;\n touch-action: pan-x pan-y;\n}\n\n.butex-document2-widget__table-editor-scroll > .butex-document2-widget__row {\n flex-wrap: nowrap;\n min-width: max-content;\n width: 100%;\n}\n\n.butex-document2-widget__block--table .butex-document2-widget__inline-text {\n min-height: 3.5em;\n min-width: min(12ch, 100%);\n}\n\n.butex-document2-widget__table-popover {\n display: inline-block;\n position: relative;\n}\n\n.butex-document2-widget__table-popover-panel {\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 10px;\n box-shadow: 0 8px 24px color-mix(in srgb, var(--butex-document2-fg) 12%, transparent);\n display: grid;\n gap: 8px;\n inset-inline-end: 0;\n padding: 10px;\n position: absolute;\n top: calc(100% + 6px);\n max-width: calc(100vw - 24px);\n max-width: calc(100cqw - 16px);\n overflow: auto;\n width: min(220px, calc(100vw - 24px));\n width: min(220px, calc(100cqw - 16px));\n z-index: var(--butex-document2-z-popover);\n}\n\n.butex-document2-widget__table-popover-panel label {\n color: var(--butex-document2-muted);\n display: grid;\n font-size: 0.82rem;\n gap: 4px;\n}\n\n.butex-document2-widget__toolbar-row {\n align-items: center;\n border-block-end: 1px solid color-mix(in srgb, var(--butex-document2-border) 70%, transparent);\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin-block-end: 8px;\n padding-block-end: 8px;\n width: 100%;\n}\n\n.butex-document2-widget__toolbar-row:last-child {\n border-block-end: 0;\n margin-block-end: 0;\n padding-block-end: 0;\n}\n\n.butex-document2-widget__toolbar-label {\n color: var(--butex-document2-muted);\n font-size: 0.78rem;\n font-weight: 600;\n margin-inline-end: 4px;\n white-space: nowrap;\n}\n\n.butex-document2-widget__block-header {\n align-items: center;\n border-block-end: 1px solid color-mix(in srgb, var(--butex-document2-border) 80%, transparent);\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n justify-content: space-between;\n margin-block-end: 10px;\n padding-block-end: 8px;\n}\n\n.butex-document2-widget__block-select {\n accent-color: var(--butex-document2-accent);\n cursor: pointer;\n flex: 0 0 auto;\n height: 1rem;\n margin: 0;\n width: 1rem;\n}\n\n.butex-document2-widget__block--selected {\n background: var(--butex-document2-accent-bg);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--butex-document2-accent) 45%, transparent);\n}\n\n.butex-document2-widget__selection-count {\n color: var(--butex-document2-muted);\n font-size: 0.78rem;\n font-weight: 600;\n padding-inline: 4px;\n white-space: nowrap;\n}\n\n.butex-document2-widget__block-title {\n align-items: center;\n color: var(--butex-document2-fg);\n display: inline-flex;\n gap: 8px;\n font-weight: 700;\n}\n\n.butex-document2-widget__block--section .butex-document2-widget__block-title {\n font-size: 1.12rem;\n}\n\n.butex-document2-widget__block--subsection .butex-document2-widget__block-title {\n font-size: 1.04rem;\n}\n\n.butex-document2-widget__block--subsubsection .butex-document2-widget__block-title {\n font-size: 0.98rem;\n}\n\n.butex-document2-widget__block--paragraph .butex-document2-widget__block-title {\n color: var(--butex-document2-muted);\n font-size: 0.86rem;\n font-weight: 600;\n}\n\n.butex-document2-widget__block--list .butex-document2-widget__block-title,\n.butex-document2-widget__block--table .butex-document2-widget__block-title,\n.butex-document2-widget__block--image .butex-document2-widget__block-title,\n.butex-document2-widget__block--raw .butex-document2-widget__block-title {\n font-size: 0.9rem;\n}\n\n.butex-document2-widget__block--section {\n background: color-mix(in srgb, var(--butex-document2-accent) 9%, var(--butex-document2-panel));\n border-inline-start: 4px solid var(--butex-document2-accent);\n}\n\n.butex-document2-widget__block--subsection {\n background: color-mix(in srgb, var(--butex-document2-accent) 6%, var(--butex-document2-panel));\n border-inline-start: 3px solid color-mix(in srgb, var(--butex-document2-accent) 78%, var(--butex-document2-border));\n}\n\n.butex-document2-widget__block--subsubsection {\n background: color-mix(in srgb, var(--butex-document2-accent) 4%, var(--butex-document2-panel));\n border-inline-start: 3px solid var(--butex-document2-border);\n}\n\n.butex-document2-widget__block--paragraph {\n border-inline-start: 2px solid color-mix(in srgb, var(--butex-document2-muted) 35%, transparent);\n}\n\n.butex-document2-widget__block--list {\n background: color-mix(in srgb, var(--butex-document2-bg) 55%, var(--butex-document2-panel));\n border-inline-start: 3px solid color-mix(in srgb, var(--butex-document2-accent) 55%, var(--butex-document2-border));\n}\n\n.butex-document2-widget__block--table {\n background: color-mix(in srgb, var(--butex-document2-bg) 40%, var(--butex-document2-panel));\n border-inline-start: 3px solid var(--butex-document2-border);\n}\n\n.butex-document2-widget__block--image {\n background: color-mix(in srgb, var(--butex-document2-muted) 6%, var(--butex-document2-panel));\n border-inline-start: 3px dashed color-mix(in srgb, var(--butex-document2-muted) 45%, var(--butex-document2-border));\n}\n\n.butex-document2-widget__block--raw {\n background: color-mix(in srgb, var(--butex-document2-muted) 8%, var(--butex-document2-panel));\n border-inline-start: 3px dashed var(--butex-document2-muted);\n}\n\n.butex-document2-widget__block--collapsed {\n background: var(--butex-document2-collapse-bg);\n}\n\n.butex-document2-widget__block--collapsed .butex-document2-widget__block-header {\n margin-block-end: 8px;\n}\n\n.butex-document2-widget__block-summary {\n background: color-mix(in srgb, var(--butex-document2-panel) 72%, transparent);\n border: 1px dashed color-mix(in srgb, var(--butex-document2-border) 70%, var(--butex-document2-muted));\n border-radius: 8px;\n color: var(--butex-document2-muted);\n font-size: 0.86rem;\n line-height: 1.5;\n min-width: 0;\n overflow-wrap: anywhere;\n padding: 8px 10px;\n}\n\n.butex-document2-widget__list-item-actions {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-block-start: 6px;\n}\n\n.butex-document2-widget__list-item-content {\n display: grid;\n gap: 8px;\n min-width: 0;\n}\n\n.butex-document2-widget__list-footer {\n border-block-start: 1px dashed color-mix(in srgb, var(--butex-document2-border) 85%, transparent);\n margin-block-start: 10px;\n padding-block-start: 10px;\n}\n\n.butex-document2-widget__button--danger:hover {\n border-color: var(--butex-document2-danger);\n color: var(--butex-document2-danger);\n}\n\n.butex-document2-widget__image-src-label {\n color: var(--butex-document2-muted);\n display: block;\n font-size: 0.82rem;\n margin-block-end: 4px;\n}\n\n.butex-document2-widget__toolbar,\n.butex-document2-widget__row {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.butex-document2-widget button {\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n color: var(--butex-document2-fg);\n cursor: pointer;\n min-height: 32px;\n padding: 0 10px;\n}\n\n.butex-document2-widget button:hover,\n.butex-document2-widget button[aria-pressed=\"true\"] {\n background: var(--butex-document2-accent-bg);\n border-color: var(--butex-document2-accent);\n}\n\n.butex-document2-widget button:focus-visible,\n.butex-document2-widget input:focus-visible,\n.butex-document2-widget textarea:focus-visible {\n border-color: var(--butex-document2-accent);\n box-shadow: 0 0 0 3px var(--butex-document2-focus-shadow);\n outline: none;\n}\n\n.butex-document2-widget input {\n background: var(--butex-document2-input-bg);\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n color: var(--butex-document2-fg);\n font: inherit;\n max-width: 100%;\n min-height: 34px;\n min-width: 0;\n padding: 7px 9px;\n}\n\n.butex-document2-widget textarea {\n background: var(--butex-document2-input-bg);\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n color: var(--butex-document2-fg);\n font: inherit;\n line-height: 1.45;\n max-width: 100%;\n min-width: 0;\n padding: 7px 9px;\n}\n\n.butex-document2-widget select {\n max-width: 100%;\n min-width: 0;\n}\n\n.butex-document2-widget__layout {\n align-items: start;\n display: grid;\n gap: 12px;\n grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);\n transition: grid-template-columns 0.22s ease;\n}\n\n.butex-document2-widget__layout--editor-open.butex-document2-widget__layout--preview-open {\n grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);\n}\n\n/* One visible panel: a single track so the panel fills the widget (previewOnly / hide editor / hide preview). */\n.butex-document2-widget__layout--editor-open.butex-document2-widget__layout--preview-closed,\n.butex-document2-widget__layout--editor-closed.butex-document2-widget__layout--preview-open,\n.butex-document2-widget__layout--editor-closed.butex-document2-widget__layout--preview-closed {\n grid-template-columns: minmax(0, 1fr);\n}\n\n.butex-document2-widget__editor-panel,\n.butex-document2-widget__preview-panel {\n max-width: 100%;\n min-width: 0;\n opacity: 1;\n overflow-x: auto;\n overflow-y: auto;\n transform: translateX(0);\n transition:\n opacity 0.18s ease,\n transform 0.22s ease,\n padding 0.22s ease,\n border-width 0.22s ease,\n box-shadow 0.22s ease;\n}\n\n/* When previewOnly (or display:none) leaves a lone panel, span the full grid. */\n.butex-document2-widget__editor-panel:only-child,\n.butex-document2-widget__preview-panel:only-child {\n grid-column: 1 / -1;\n width: 100%;\n}\n\n.butex-document2-widget__layout--editor-closed .butex-document2-widget__editor-panel,\n.butex-document2-widget__layout--preview-closed .butex-document2-widget__preview-panel {\n display: none;\n}\n\n.butex-document2-widget__inline-field {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n max-width: 100%;\n min-width: 0;\n width: 100%;\n}\n\n.butex-document2-widget__inline-text {\n background: var(--butex-document2-text-token-bg);\n border-color: var(--butex-document2-text-token-border);\n box-sizing: border-box;\n flex: 0 1 auto;\n max-width: 100%;\n min-height: 2.75em;\n min-width: 3ch;\n overflow-wrap: break-word;\n overflow-y: hidden;\n resize: none;\n text-align: start;\n white-space: pre-wrap;\n width: auto;\n word-break: break-word;\n}\n\n.butex-document2-widget__inline-text:hover {\n border-color: color-mix(in srgb, var(--butex-document2-text-token-border) 55%, var(--butex-document2-accent));\n}\n\n.butex-document2-widget__inline-text[data-bold=\"true\"] {\n font-weight: 700;\n}\n\n.butex-document2-widget__inline-text[data-italic=\"true\"] {\n font-style: italic;\n}\n\n.butex-document2-widget__inline-text[data-underline=\"true\"] {\n text-decoration: underline;\n text-underline-offset: 0.12em;\n}\n\n.butex-document2-widget__inline-field input {\n min-width: 12ch;\n}\n\n.butex-document2-widget__math-chip {\n background: var(--butex-document2-math-inline-bg);\n border-color: color-mix(in srgb, var(--butex-document2-math-border) 70%, var(--butex-document2-accent));\n border-width: 1.5px;\n direction: ltr;\n display: inline-flex;\n font-family: inherit;\n gap: 4px;\n max-width: 100%;\n min-height: 30px;\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior-inline: contain;\n padding: 3px 7px;\n touch-action: pan-x pan-y;\n unicode-bidi: isolate;\n}\n\n.butex-document2-widget__math-chip:hover,\n.butex-document2-widget__math-chip:focus-visible {\n background: color-mix(in srgb, var(--butex-document2-accent) 12%, var(--butex-document2-panel));\n border-color: var(--butex-document2-accent);\n}\n\n.butex-document2-widget__math-chip[data-editable=\"false\"] {\n border-style: dashed;\n color: var(--butex-document2-muted);\n}\n\n.butex-document2-widget__math-chip[data-display=\"true\"] {\n background: var(--butex-document2-math-display-bg);\n border-color: color-mix(in srgb, var(--butex-document2-accent) 50%, var(--butex-document2-border));\n border-width: 1.5px;\n border-radius: 10px;\n box-shadow: 0 5px 16px color-mix(in srgb, var(--butex-document2-fg) 8%, transparent);\n justify-content: center;\n margin-block: 4px;\n min-height: 54px;\n padding: 10px 12px;\n width: min(100%, 36rem);\n}\n\n.butex-document2-widget__preview {\n background: var(--butex-document2-preview-bg);\n color: var(--butex-document2-preview-fg);\n font-family: var(--butex-document2-preview-font);\n font-size: 1.08rem;\n line-height: 1.9;\n max-width: 100%;\n min-width: 0;\n overflow-wrap: break-word;\n text-align: start;\n word-break: break-word;\n}\n\n.butex-document2-widget__preview h1,\n.butex-document2-widget__preview h2,\n.butex-document2-widget__preview h3,\n.butex-document2-widget__preview p,\n.butex-document2-widget__preview li {\n max-width: 100%;\n overflow-wrap: break-word;\n white-space: normal;\n word-break: break-word;\n}\n\n.butex-document2-widget__preview h1 {\n font-size: 1.75rem;\n font-weight: 700;\n line-height: 1.35;\n margin: 0 0 14px;\n}\n\n.butex-document2-widget__preview h2 {\n font-size: 1.4rem;\n font-weight: 600;\n line-height: 1.4;\n margin: 0 0 12px;\n}\n\n.butex-document2-widget__preview h3 {\n font-size: 1.2rem;\n font-weight: 600;\n line-height: 1.45;\n margin: 0 0 10px;\n}\n\n.butex-document2-widget__preview p {\n margin: 0 0 12px;\n}\n\n.butex-document2-widget__preview ul,\n.butex-document2-widget__preview ol {\n margin: 0 0 12px;\n padding-inline-start: 24px;\n}\n\n.butex-document2-widget__preview ul {\n list-style-type: disc;\n}\n\n.butex-document2-widget__preview ol {\n list-style-type: decimal;\n}\n\n.butex-document2-widget__preview img {\n display: block;\n height: auto;\n max-width: 100%;\n}\n\n.butex-document2-widget__preview table {\n border-collapse: collapse;\n border: 1px solid #000000;\n margin: 12px 0;\n min-width: 100%;\n table-layout: auto;\n width: 100%;\n}\n\n.butex-document2-widget__preview td {\n border: 1px solid #000000;\n max-width: 100%;\n min-width: min(7rem, 70vw);\n min-width: min(7rem, 70cqw);\n overflow-wrap: break-word;\n padding: 6px 8px;\n white-space: normal;\n word-break: break-word;\n}\n\n.butex-document2-widget__math-island {\n direction: ltr;\n display: inline-block;\n line-height: normal;\n margin: 0 2px;\n max-width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior-inline: contain;\n touch-action: pan-x pan-y;\n unicode-bidi: isolate;\n vertical-align: middle;\n}\n\n/* Guard against host CSS resets (e.g. Tailwind Preflight's `svg { display: block }`).\n * MathJax v4 inline line-breaking emits an equation as several sibling <svg> chunks;\n * a block-level svg reset stacks them vertically inside the island. */\n.butex-document2-widget mjx-container svg {\n display: inline;\n}\n\n.butex-document2-widget__math-chip .butex-document2-widget__math-island {\n margin: 0;\n overflow: visible;\n}\n\n.butex-document2-widget__math-island[data-render-state=\"loading\"] {\n opacity: 0.72;\n}\n\n.butex-document2-widget__math-island[data-render-state=\"error\"] {\n color: var(--butex-document2-error);\n font-family: ui-monospace, SFMono-Regular, Consolas, monospace;\n font-size: 0.88rem;\n max-width: 100%;\n overflow-wrap: anywhere;\n white-space: normal;\n}\n\n.butex-document2-widget__math-island[data-display=\"true\"] {\n display: block;\n margin: 10px 0;\n text-align: center;\n}\n\n.butex-document2-widget__math-chip .butex-document2-widget__math-island[data-display=\"true\"] {\n margin: 0;\n}\n\n.butex-document2-widget__raw {\n background: var(--butex-document2-raw-bg);\n border-radius: 8px;\n direction: ltr;\n padding: 8px;\n text-align: left;\n white-space: pre-wrap;\n}\n\n.butex-document2-widget__error {\n background: var(--butex-document2-error-bg);\n border: 1px solid var(--butex-document2-error);\n border-radius: 8px;\n color: var(--butex-document2-error);\n padding: 10px;\n}\n\n.butex-document2-widget__equation-modal {\n align-items: center;\n display: flex;\n inset: 0;\n justify-content: center;\n padding-bottom: max(16px, var(--butex-safe-area-bottom));\n padding-left: max(16px, var(--butex-safe-area-left));\n padding-right: max(16px, var(--butex-safe-area-right));\n padding-top: max(16px, var(--butex-safe-area-top));\n position: fixed;\n overscroll-behavior: none;\n touch-action: none;\n z-index: var(--butex-document2-z-equation);\n}\n\n.butex-document2-widget__equation-modal[data-visible-viewport=\"true\"] {\n bottom: auto;\n height: var(--butex-document2-visible-viewport-height);\n left: var(--butex-document2-visible-viewport-left);\n right: auto;\n top: var(--butex-document2-visible-viewport-top);\n width: var(--butex-document2-visible-viewport-width);\n}\n\n.butex-document2-widget__equation-modal-backdrop {\n background: color-mix(in srgb, var(--butex-document2-fg) 34%, transparent);\n border: 0;\n cursor: pointer;\n display: block;\n height: 100%;\n inset: 0;\n margin: 0;\n padding: 0;\n position: absolute;\n touch-action: none;\n width: 100%;\n}\n\n.butex-document2-widget__equation-modal-panel {\n background: var(--butex-document2-drawer-bg);\n border: 1px solid var(--butex-document2-border);\n border-radius: 12px;\n box-shadow: 0 18px 48px color-mix(in srgb, var(--butex-document2-fg) 18%, transparent);\n display: grid;\n gap: 12px;\n grid-template-rows: auto minmax(0, 1fr) auto;\n max-height: min(90vh, 900px);\n max-height: min(900px, calc(100dvh - max(16px, var(--butex-safe-area-top)) - max(16px, var(--butex-safe-area-bottom))));\n max-width: min(920px, 100%);\n overflow: hidden;\n overscroll-behavior: contain;\n padding: 14px;\n position: relative;\n touch-action: pan-y;\n width: min(920px, 100%);\n z-index: 1;\n}\n\n.butex-document2-widget__equation-modal-body {\n display: grid;\n gap: 12px;\n min-height: 0;\n min-width: 0;\n overflow: auto;\n overscroll-behavior: contain;\n touch-action: pan-y;\n}\n\n.butex-document2-widget__equation-modal-header,\n.butex-document2-widget__equation-modal-actions {\n flex-wrap: nowrap;\n}\n\n/* Map document v2 tokens onto BuTeX equation editor chrome when embedded in this modal. */\n.butex-document2-widget__equation-modal-panel .butex-widget {\n --butex-bg: var(--butex-document2-bg);\n --butex-fg: var(--butex-document2-fg);\n --butex-muted: var(--butex-document2-muted);\n --butex-accent: var(--butex-document2-accent);\n --butex-accent-hover: color-mix(in srgb, var(--butex-document2-accent) 82%, #000000);\n --butex-toolbar-hover-bg: var(--butex-document2-accent-bg);\n --butex-toolbar-hover-border: var(--butex-document2-accent);\n --butex-danger: var(--butex-document2-danger);\n --butex-danger-bg: color-mix(in srgb, var(--butex-document2-danger) 12%, transparent);\n --butex-danger-border: color-mix(in srgb, var(--butex-document2-danger) 48%, transparent);\n --butex-on-accent: #ffffff;\n --butex-border: var(--butex-document2-border);\n --butex-panel: var(--butex-document2-panel);\n --butex-preview-bg: var(--butex-document2-preview-bg);\n --butex-preview-fg: var(--butex-document2-preview-fg);\n --butex-error: var(--butex-document2-error);\n --butex-error-bg: var(--butex-document2-error-bg);\n --butex-error-border: color-mix(in srgb, var(--butex-document2-error) 32%, var(--butex-document2-panel));\n --butex-shadow-md: 0 4px 14px color-mix(in srgb, var(--butex-document2-fg) 10%, transparent);\n --butex-dev-bg: var(--butex-document2-dev-bg);\n --butex-dev-border: var(--butex-document2-dev-border);\n --butex-dev-badge: var(--butex-dev-badge, #b45309);\n --butex-dev-badge-fg: var(--butex-dev-badge-fg, #ffffff);\n --butex-dev-muted: var(--butex-dev-muted, #92400e);\n --butex-dev-inset-bg: var(--butex-document2-dev-code-bg);\n --butex-dev-inset-border: color-mix(in srgb, var(--butex-document2-dev-border) 45%, transparent);\n --butex-dev-inset-fg: var(--butex-document2-dev-code-fg);\n --butex-surface-bg: linear-gradient(\n 180deg,\n var(--butex-document2-panel) 0%,\n color-mix(in srgb, var(--butex-document2-panel) 88%, var(--butex-document2-bg)) 100%\n );\n --butex-surface-fg: var(--butex-document2-fg);\n --butex-focus-border: color-mix(in srgb, var(--butex-document2-accent) 45%, transparent);\n --butex-focus-shadow: var(--butex-document2-focus-shadow);\n --butex-slot-hover: var(--butex-document2-accent-bg);\n --butex-selection-bg: color-mix(in srgb, var(--butex-document2-accent) 34%, transparent);\n --butex-selection-border: color-mix(in srgb, var(--butex-document2-accent) 90%, #0f172a);\n --butex-caret: var(--butex-document2-fg);\n --butex-node-hover: color-mix(in srgb, var(--butex-document2-muted) 14%, transparent);\n --butex-node-selected-bg: var(--butex-document2-accent-bg);\n --butex-node-selected-border: color-mix(in srgb, var(--butex-document2-accent) 45%, transparent);\n --butex-script-border: var(--butex-document2-border);\n --butex-script-bg: color-mix(in srgb, var(--butex-document2-bg) 35%, var(--butex-document2-panel));\n --butex-script-color: var(--butex-document2-muted);\n --butex-delim-color: var(--butex-document2-muted);\n --butex-frac-bar: currentColor;\n --butex-z-popover: var(--butex-document2-z-popover);\n max-width: 100%;\n min-width: 0;\n}\n\n.butex-document2-widget__dev {\n background: var(--butex-document2-dev-bg);\n border-color: var(--butex-document2-dev-border);\n}\n\n.butex-document2-widget__image-editor {\n display: grid;\n gap: 10px;\n min-width: 0;\n}\n\n.butex-document2-widget__image-asset {\n align-items: center;\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n display: flex;\n gap: 12px;\n max-width: 100%;\n min-height: 128px;\n min-width: 0;\n padding: 12px;\n}\n\n.butex-document2-widget__image-asset--empty {\n border-style: dashed;\n justify-content: center;\n}\n\n.butex-document2-widget__image-empty-content,\n.butex-document2-widget__image-asset-main,\n.butex-document2-widget__image-select,\n.butex-document2-widget__image-advanced {\n display: grid;\n gap: 8px;\n min-width: 0;\n}\n\n.butex-document2-widget__image-empty-content {\n justify-items: center;\n text-align: center;\n}\n\n.butex-document2-widget__image-thumb {\n aspect-ratio: 4 / 3;\n background: var(--butex-document2-bg);\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n flex: 0 0 128px;\n height: auto;\n max-width: 38%;\n object-fit: cover;\n width: 128px;\n}\n\n.butex-document2-widget__image-asset-title {\n color: var(--butex-document2-muted);\n display: block;\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.butex-document2-widget__image-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.butex-document2-widget__image-select span,\n.butex-document2-widget__image-src-label {\n color: var(--butex-document2-muted);\n font-size: 0.86rem;\n}\n\n.butex-document2-widget__image-select select {\n background: var(--butex-document2-input-bg);\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n color: var(--butex-document2-fg);\n max-width: 100%;\n min-height: 36px;\n padding: 6px 8px;\n}\n\n.butex-document2-widget__image-select select:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.butex-document2-widget__image-advanced summary {\n color: var(--butex-document2-muted);\n cursor: pointer;\n font-size: 0.86rem;\n}\n\n.butex-document2-widget__dev pre {\n background: var(--butex-document2-dev-code-bg);\n color: var(--butex-document2-dev-code-fg);\n direction: ltr;\n margin: 0;\n max-height: 220px;\n overflow: auto;\n padding: 10px;\n text-align: left;\n white-space: pre-wrap;\n}\n\n.butex-document2-widget__dev-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin: 0 0 10px;\n}\n\n.butex-document2-widget__dev-import {\n display: grid;\n gap: 8px;\n margin-bottom: 12px;\n}\n\n.butex-document2-widget__dev-import textarea {\n background: var(--butex-document2-dev-code-bg);\n border: 1px solid var(--butex-document2-dev-border);\n border-radius: 8px;\n color: var(--butex-document2-dev-code-fg);\n direction: ltr;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n min-height: 180px;\n padding: 10px;\n resize: vertical;\n text-align: left;\n}\n\n.butex-document2-widget__dev-error {\n background: rgba(254, 226, 226, 0.9);\n border: 1px solid rgba(220, 38, 38, 0.45);\n border-radius: 8px;\n color: #991b1b;\n margin: 0;\n padding: 8px 10px;\n white-space: pre-wrap;\n}\n\n.butex-document2-widget__dev-diagnostic {\n background: rgba(251, 191, 36, 0.18);\n border: 1px solid rgba(217, 119, 6, 0.4);\n border-radius: 8px;\n color: #92400e;\n margin: 0;\n padding: 8px 10px;\n}\n\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__toolbar {\n display: block;\n}\n\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__toolbar-insert,\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__desktop-toolbar-control {\n display: none;\n}\n\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__mobile-toolbar {\n display: grid;\n gap: 0;\n}\n\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__layout,\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__layout--editor-open.butex-document2-widget__layout--preview-open,\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__layout--editor-open.butex-document2-widget__layout--preview-closed,\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__layout--editor-closed.butex-document2-widget__layout--preview-open,\n.butex-document2-widget[data-responsive-mode=\"compact\"] .butex-document2-widget__layout--editor-closed.butex-document2-widget__layout--preview-closed {\n grid-template-columns: minmax(0, 1fr);\n}\n\n.butex-document2-widget[data-responsive-mode=\"compact\"][data-mobile-view=\"editor\"] .butex-document2-widget__editor-panel {\n display: grid;\n}\n\n.butex-document2-widget[data-responsive-mode=\"compact\"][data-mobile-view=\"editor\"] .butex-document2-widget__preview-panel,\n.butex-document2-widget[data-responsive-mode=\"compact\"][data-mobile-view=\"preview\"] .butex-document2-widget__editor-panel {\n display: none;\n}\n\n.butex-document2-widget[data-responsive-mode=\"compact\"][data-mobile-view=\"preview\"] .butex-document2-widget__preview-panel {\n display: block;\n}\n\n@media (max-width: 900px) {\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__toolbar {\n display: block;\n }\n\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__toolbar-insert,\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__desktop-toolbar-control {\n display: none;\n }\n\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__mobile-toolbar {\n display: grid;\n gap: 0;\n }\n\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__layout,\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__layout--editor-open.butex-document2-widget__layout--preview-open,\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__layout--editor-open.butex-document2-widget__layout--preview-closed,\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__layout--editor-closed.butex-document2-widget__layout--preview-open,\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"]) .butex-document2-widget__layout--editor-closed.butex-document2-widget__layout--preview-closed {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"])[data-mobile-view=\"editor\"] .butex-document2-widget__editor-panel {\n display: grid;\n }\n\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"])[data-mobile-view=\"editor\"] .butex-document2-widget__preview-panel,\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"])[data-mobile-view=\"preview\"] .butex-document2-widget__editor-panel {\n display: none;\n }\n\n .butex-document2-widget:not([data-responsive-mode=\"desktop\"])[data-mobile-view=\"preview\"] .butex-document2-widget__preview-panel {\n display: block;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .butex-document2-widget__layout,\n .butex-document2-widget__editor-panel,\n .butex-document2-widget__preview-panel,\n .butex-document2-widget__equation-modal-panel,\n .butex-document2-widget__command-sheet {\n animation: none;\n scroll-behavior: auto;\n transition: none;\n }\n}\n\n.butex-document2-widget__cite-chip-wrap {\n align-items: center;\n display: inline-flex;\n gap: 2px;\n margin-inline: 2px;\n max-width: 100%;\n vertical-align: baseline;\n}\n\n.butex-document2-widget__cite-chip {\n background: color-mix(in srgb, var(--butex-document2-accent) 8%, var(--butex-document2-panel));\n border: 1.5px solid color-mix(in srgb, var(--butex-document2-accent) 45%, var(--butex-document2-border));\n border-radius: 6px;\n color: inherit;\n cursor: pointer;\n display: inline-flex;\n font: inherit;\n font-variant-numeric: tabular-nums;\n line-height: 1.3;\n min-height: 28px;\n padding: 2px 8px;\n}\n\n.butex-document2-widget__cite-chip[data-editable=\"false\"] {\n border-style: dashed;\n cursor: default;\n}\n\n.butex-document2-widget__cite-chip:hover,\n.butex-document2-widget__cite-chip:focus-visible {\n background: color-mix(in srgb, var(--butex-document2-accent) 14%, var(--butex-document2-panel));\n border-color: var(--butex-document2-accent);\n}\n\n.butex-document2-widget__cite-chip-delete {\n background: transparent;\n border: none;\n color: var(--butex-document2-muted);\n cursor: pointer;\n font: inherit;\n line-height: 1;\n padding: 0 4px;\n}\n\n.butex-document2-widget__preview-cite {\n color: inherit;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.butex-document2-widget__preview-bibliography,\n.butex-document2-widget__bibliography-editor {\n display: grid;\n gap: 0.5rem;\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.butex-document2-widget__preview-bibliography li,\n.butex-document2-widget__bibliography-editor li {\n display: grid;\n gap: 0.25rem;\n grid-template-columns: auto 1fr;\n max-width: 100%;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.butex-document2-widget__preview-bibliography li > *,\n.butex-document2-widget__bibliography-editor li > * {\n min-width: 0;\n}\n\n.butex-document2-widget__preview-bibliography a,\n.butex-document2-widget__bibliography-editor a {\n overflow-wrap: anywhere;\n word-break: break-word;\n}\n\n.butex-document2-widget__preview-bib-number {\n font-variant-numeric: tabular-nums;\n}\n\n.butex-document2-widget__block--bibliography {\n border-color: color-mix(in srgb, var(--butex-document2-accent) 35%, var(--butex-document2-border));\n}\n\n.butex-document2-widget__digit-form-menu {\n position: relative;\n}\n\n.butex-document2-widget__digit-form-options {\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n box-shadow: 0 8px 24px color-mix(in srgb, #000 16%, transparent);\n display: grid;\n gap: 2px;\n inset-inline-start: 0;\n margin-top: 4px;\n max-width: calc(100vw - 24px);\n max-width: calc(100cqw - 16px);\n overflow-x: auto;\n padding: 4px;\n position: absolute;\n top: 100%;\n z-index: var(--butex-document2-z-popover);\n}\n\n.butex-document2-widget__digit-form-option {\n background: transparent;\n border: none;\n border-radius: 6px;\n color: inherit;\n cursor: pointer;\n font: inherit;\n padding: 6px 10px;\n text-align: start;\n}\n\n.butex-document2-widget__digit-form-option[aria-selected=\"true\"],\n.butex-document2-widget__digit-form-option:hover {\n background: color-mix(in srgb, var(--butex-document2-accent) 12%, var(--butex-document2-panel));\n}\n\n.butex-document2-widget__cite-picker-backdrop,\n.butex-document2-widget__refs-backdrop {\n align-items: center;\n background: color-mix(in srgb, #000 35%, transparent);\n display: flex;\n inset: 0;\n justify-content: center;\n padding-bottom: max(1rem, var(--butex-safe-area-bottom));\n padding-left: max(1rem, var(--butex-safe-area-left));\n padding-right: max(1rem, var(--butex-safe-area-right));\n padding-top: max(1rem, var(--butex-safe-area-top));\n position: fixed;\n z-index: var(--butex-document2-z-overlay);\n}\n\n.butex-document2-widget__cite-picker,\n.butex-document2-widget__refs-panel {\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 12px;\n box-shadow: 0 16px 40px color-mix(in srgb, #000 22%, transparent);\n display: grid;\n gap: 0.75rem;\n grid-template-rows: auto minmax(0, 1fr) auto;\n max-height: min(80vh, 640px);\n max-height: min(640px, calc(100dvh - max(1rem, var(--butex-safe-area-top)) - max(1rem, var(--butex-safe-area-bottom))));\n max-width: 560px;\n overflow: hidden;\n overscroll-behavior: contain;\n padding: 1rem;\n width: min(100%, 560px);\n}\n\n.butex-document2-widget__dialog-body {\n display: grid;\n gap: 0.75rem;\n min-height: 0;\n min-width: 0;\n overflow: auto;\n overscroll-behavior: contain;\n}\n\n.butex-document2-widget__cite-picker-header,\n.butex-document2-widget__refs-header,\n.butex-document2-widget__cite-picker-footer,\n.butex-document2-widget__refs-item-head {\n align-items: center;\n display: flex;\n gap: 0.5rem;\n justify-content: space-between;\n min-width: 0;\n}\n\n.butex-document2-widget__cite-picker-header,\n.butex-document2-widget__refs-header {\n border-block-end: 1px solid var(--butex-document2-border);\n padding-block-end: 0.65rem;\n}\n\n.butex-document2-widget__cite-picker-footer {\n border-block-start: 1px solid var(--butex-document2-border);\n flex-wrap: wrap;\n padding-block-start: 0.65rem;\n}\n\n.butex-document2-widget__cite-picker-list,\n.butex-document2-widget__refs-list {\n display: grid;\n gap: 0.5rem;\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.butex-document2-widget__cite-picker-item,\n.butex-document2-widget__refs-field {\n display: grid;\n gap: 0.25rem;\n min-width: 0;\n}\n\n.butex-document2-widget__cite-picker-item {\n align-items: start;\n grid-template-columns: auto 1fr;\n}\n\n.butex-document2-widget__cite-picker-meta,\n.butex-document2-widget__cite-picker-empty {\n color: var(--butex-document2-muted);\n display: block;\n font-size: 0.92em;\n}\n\n.butex-document2-widget__refs-grid {\n display: grid;\n gap: 0.5rem;\n grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));\n min-width: 0;\n}\n\n.butex-document2-widget__refs-field input {\n background: var(--butex-document2-input-bg, var(--butex-document2-panel));\n border: 1px solid var(--butex-document2-border);\n border-radius: 6px;\n color: inherit;\n font: inherit;\n padding: 0.4rem 0.55rem;\n width: 100%;\n}\n\n.butex-document2-widget__field-error {\n color: #b42318;\n font-size: 0.85em;\n line-height: 1.35;\n margin: 0;\n}\n\n.butex-document2-widget__field-hint {\n color: var(--butex-document2-muted);\n font-size: 0.82em;\n line-height: 1.35;\n margin: 0;\n}\n\n.butex-document2-widget__refs-field input[aria-invalid='true'] {\n border-color: color-mix(in srgb, #b42318 55%, var(--butex-document2-border));\n}\n\n.butex-document2-widget__refs-item {\n border: 1px solid var(--butex-document2-border);\n border-radius: 10px;\n display: grid;\n gap: 0.5rem;\n min-width: 0;\n overflow-wrap: anywhere;\n padding: 0.75rem;\n}\n\n.butex-document2-widget__refs-item-key {\n color: var(--butex-document2-muted);\n font-size: 0.9em;\n font-weight: 500;\n}\n\n.butex-document2-widget__modal-preview {\n background: color-mix(in srgb, var(--butex-document2-panel) 88%, var(--butex-document2-accent-bg));\n border: 1px dashed color-mix(in srgb, var(--butex-document2-accent) 30%, var(--butex-document2-border));\n border-radius: 8px;\n color: inherit;\n font-size: 0.95em;\n line-height: 1.55;\n padding: 0.55rem 0.7rem;\n text-align: center;\n}\n\n.butex-document2-widget__modal-preview-number {\n color: var(--butex-document2-muted);\n font-weight: 600;\n}\n\n.butex-document2-widget__modal-preview-url {\n color: var(--butex-document2-accent);\n word-break: break-all;\n}\n\n.butex-document2-widget__refs-separator-toggle {\n display: inline-flex;\n gap: 0.35rem;\n}\n\n.butex-document2-widget__refs-separator-toggle button {\n background: var(--butex-document2-input-bg, var(--butex-document2-panel));\n border: 1px solid var(--butex-document2-border);\n border-radius: 6px;\n color: inherit;\n cursor: pointer;\n font: inherit;\n font-size: 1.15em;\n line-height: 1;\n min-width: 2.25rem;\n padding: 0.35rem 0.55rem;\n}\n\n.butex-document2-widget__refs-separator-toggle button.is-active {\n background: var(--butex-document2-accent-bg);\n border-color: color-mix(in srgb, var(--butex-document2-accent) 45%, var(--butex-document2-border));\n color: var(--butex-document2-accent);\n font-weight: 700;\n}\n\n.butex-document2-widget__refs-item-actions {\n display: inline-flex;\n gap: 0.25rem;\n}\n\n.butex-document2-widget__primary-btn {\n background: color-mix(in srgb, var(--butex-document2-accent) 82%, #000000);\n border: none;\n border-radius: 8px;\n color: #fff;\n cursor: pointer;\n font: inherit;\n padding: 0.45rem 0.8rem;\n}\n\n.butex-document2-widget__primary-btn:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.butex-document2-widget__article-meta {\n background: color-mix(in srgb, var(--butex-document2-panel) 92%, var(--butex-document2-accent-bg));\n border: 1px solid var(--butex-document2-border);\n border-radius: 10px;\n display: grid;\n gap: 0.75rem;\n margin-bottom: 0.85rem;\n padding: 0.85rem 0.9rem;\n}\n\n.butex-document2-widget__article-meta-header {\n align-items: center;\n display: flex;\n gap: 0.5rem;\n justify-content: space-between;\n}\n\n.butex-document2-widget__article-meta-badge {\n background: var(--butex-document2-accent-bg);\n border: 1px solid color-mix(in srgb, var(--butex-document2-accent) 35%, var(--butex-document2-border));\n border-radius: 999px;\n color: var(--butex-document2-accent);\n font-size: 0.78rem;\n font-weight: 600;\n padding: 0.15rem 0.55rem;\n}\n\n.butex-document2-widget__article-meta-date-preview {\n color: color-mix(in srgb, var(--butex-document2-fg) 70%, transparent);\n font-size: 0.92rem;\n margin: 0.15rem 0 0;\n}\n\n.butex-document2-widget__article-meta-fixed {\n color: color-mix(in srgb, var(--butex-document2-fg) 78%, transparent);\n font-size: 0.95rem;\n line-height: 1.7;\n margin: 0;\n text-align: center;\n}\n\n.butex-document2-widget__article-meta-grid {\n display: grid;\n gap: 0.65rem;\n}\n\n.butex-document2-widget__article-meta-field {\n display: grid;\n gap: 0.3rem;\n font-size: 0.92rem;\n}\n\n.butex-document2-widget__article-meta-field input,\n.butex-document2-widget__article-meta-field textarea {\n background: var(--butex-document2-input-bg, var(--butex-document2-panel));\n border: 1px solid var(--butex-document2-border);\n border-radius: 6px;\n color: inherit;\n font: inherit;\n padding: 0.4rem 0.55rem;\n width: 100%;\n}\n\n.butex-document2-widget__article-meta-date {\n display: grid;\n gap: 0.45rem;\n grid-template-columns: minmax(4rem, 1fr) minmax(7rem, 2fr) minmax(5rem, 1.2fr);\n}\n\n.butex-document2-widget__hijri-menu {\n position: relative;\n}\n\n.butex-document2-widget__hijri-menu-trigger {\n appearance: none;\n background-color: var(--butex-document2-input-bg, var(--butex-document2-panel));\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.2 1.3L6 6.1l4.8-4.8 1.2 1.2L6 8.5 0 2.5z'/%3E%3C/svg%3E\");\n background-position: left 0.65rem center;\n background-repeat: no-repeat;\n background-size: 0.7rem;\n border: 1px solid var(--butex-document2-border);\n border-radius: 8px;\n color: inherit;\n cursor: pointer;\n font: inherit;\n min-height: 2.35rem;\n padding: 0.45rem 0.7rem 0.45rem 1.7rem;\n text-align: start;\n transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;\n width: 100%;\n}\n\n.butex-document2-widget[dir=\"rtl\"] .butex-document2-widget__hijri-menu-trigger {\n background-position: right 0.65rem center;\n padding: 0.45rem 1.7rem 0.45rem 0.7rem;\n}\n\n.butex-document2-widget__hijri-menu-trigger:hover,\n.butex-document2-widget__hijri-menu-trigger[aria-expanded=\"true\"] {\n background-color: color-mix(in srgb, var(--butex-document2-accent-bg) 55%, var(--butex-document2-panel));\n border-color: color-mix(in srgb, var(--butex-document2-accent) 45%, var(--butex-document2-border));\n}\n\n.butex-document2-widget__hijri-menu-trigger:focus-visible {\n border-color: var(--butex-document2-accent);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--butex-document2-accent) 28%, transparent);\n outline: none;\n}\n\n.butex-document2-widget__hijri-menu-list {\n background: var(--butex-document2-panel);\n border: 1px solid var(--butex-document2-border);\n border-radius: 10px;\n box-shadow: 0 12px 28px color-mix(in srgb, #000 18%, transparent);\n inset-inline-start: 0;\n list-style: none;\n margin: 0.3rem 0 0;\n max-height: 14rem;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0.35rem;\n position: absolute;\n scrollbar-color: color-mix(in srgb, var(--butex-document2-muted) 55%, transparent) transparent;\n scrollbar-width: thin;\n top: 100%;\n width: 100%;\n z-index: var(--butex-document2-z-popover);\n}\n\n.butex-document2-widget__hijri-menu-list::-webkit-scrollbar {\n width: 0.55rem;\n}\n\n.butex-document2-widget__hijri-menu-list::-webkit-scrollbar-track {\n background: transparent;\n margin: 0.35rem 0;\n}\n\n.butex-document2-widget__hijri-menu-list::-webkit-scrollbar-thumb {\n background: color-mix(in srgb, var(--butex-document2-muted) 45%, transparent);\n border: 2px solid transparent;\n border-radius: 999px;\n background-clip: padding-box;\n}\n\n.butex-document2-widget__hijri-menu-list::-webkit-scrollbar-thumb:hover {\n background: color-mix(in srgb, var(--butex-document2-accent) 55%, var(--butex-document2-muted));\n background-clip: padding-box;\n border: 2px solid transparent;\n}\n\n.butex-document2-widget__hijri-menu-option {\n background: transparent;\n border: none;\n border-radius: 7px;\n color: inherit;\n cursor: pointer;\n display: block;\n font: inherit;\n padding: 0.45rem 0.65rem;\n text-align: start;\n width: 100%;\n}\n\n.butex-document2-widget__hijri-menu-option:hover,\n.butex-document2-widget__hijri-menu-option[aria-selected=\"true\"] {\n background: color-mix(in srgb, var(--butex-document2-accent) 14%, var(--butex-document2-panel));\n}\n\n.butex-document2-widget__hijri-menu-option:focus-visible {\n outline: 2px solid color-mix(in srgb, var(--butex-document2-accent) 55%, transparent);\n outline-offset: -2px;\n}\n\n.butex-document2-widget__visually-hidden {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.butex-document2-widget__preview-basmala,\n.butex-document2-widget__preview-closing {\n margin: 0.35rem 0 0.85rem;\n}\n\n.butex-document2-widget__preview-basmala .butex-document2-widget__math-island[data-display=\"true\"],\n.butex-document2-widget__preview-closing .butex-document2-widget__math-island[data-display=\"true\"] {\n margin: 0;\n}\n\n.butex-document2-widget__preview-title-block {\n background: color-mix(in srgb, var(--butex-document2-accent-bg) 55%, transparent);\n border: 1px solid color-mix(in srgb, var(--butex-document2-border) 75%, transparent);\n border-radius: 10px;\n margin: 0.5rem 0 1rem;\n padding: 0.85rem 1rem;\n text-align: center;\n}\n\n.butex-document2-widget__preview-article-title {\n font-size: 1.45rem;\n font-weight: 700;\n line-height: 1.35;\n margin: 0 0 0.45rem;\n}\n\n.butex-document2-widget__preview-article-authors,\n.butex-document2-widget__preview-article-date {\n margin: 0.2rem 0;\n}\n\n.butex-document2-widget__preview-article-date {\n color: color-mix(in srgb, var(--butex-document2-fg) 72%, transparent);\n font-size: 0.95rem;\n}\n\n.butex-document2-widget__preview-abstract {\n background: color-mix(in srgb, var(--butex-document2-panel) 88%, var(--butex-document2-muted));\n border: 1px dashed color-mix(in srgb, var(--butex-document2-border) 85%, transparent);\n border-radius: 8px;\n margin: 0.75rem 0 1rem;\n padding: 0.75rem 0.9rem;\n}\n\n.butex-document2-widget__preview-abstract-label {\n font-size: 1rem;\n font-weight: 700;\n margin: 0 0 0.35rem;\n}\n\n.butex-document2-widget__preview-abstract p {\n margin: 0;\n}\n\n.butex-document2-widget__preview-empty-body {\n color: var(--butex-document2-muted);\n font-style: italic;\n text-align: center;\n}\n\n@media (max-width: 768px) {\n .butex-document2-widget__equation-modal {\n align-items: stretch;\n padding: 0;\n }\n\n .butex-document2-widget__equation-modal-panel {\n border: 0;\n border-radius: 0;\n height: 100dvh;\n margin: 0;\n max-height: 100dvh;\n max-width: none;\n padding-bottom: max(8px, var(--butex-safe-area-bottom));\n padding-left: max(8px, var(--butex-safe-area-left));\n padding-right: max(8px, var(--butex-safe-area-right));\n padding-top: max(8px, var(--butex-safe-area-top));\n width: 100%;\n }\n\n .butex-document2-widget__equation-modal[data-visible-viewport=\"true\"] .butex-document2-widget__equation-modal-panel {\n height: 100%;\n max-height: 100%;\n }\n\n .butex-document2-widget__equation-modal-body > .butex-widget,\n .butex-document2-widget__equation-modal-body > .butex-widget > .butex-widget-layout {\n min-height: 0;\n width: 100%;\n }\n}\n\n@media (max-width: 430px) {\n .butex-document2-widget__shell,\n .butex-document2-widget__blocks,\n .butex-document2-widget__editor-panel {\n gap: 8px;\n }\n\n .butex-document2-widget__toolbar,\n .butex-document2-widget__panel,\n .butex-document2-widget__block,\n .butex-document2-widget__dev {\n border-radius: 10px;\n padding: 8px;\n }\n\n .butex-document2-widget__toolbar {\n gap: 4px;\n }\n\n .butex-document2-widget__mobile-toolbar button,\n .butex-document2-widget__cite-picker button,\n .butex-document2-widget__refs-panel button,\n .butex-document2-widget__equation-modal-panel button {\n min-height: 44px;\n }\n\n .butex-document2-widget__command-sheet-backdrop {\n padding-bottom: var(--butex-safe-area-bottom);\n padding-left: var(--butex-safe-area-left);\n padding-right: var(--butex-safe-area-right);\n padding-top: max(8px, var(--butex-safe-area-top));\n }\n\n .butex-document2-widget__command-sheet {\n border-block-end: 0;\n border-radius: 16px 16px 0 0;\n max-height: calc(100vh - 8px);\n max-height: calc(100dvh - max(8px, var(--butex-safe-area-top)) - var(--butex-safe-area-bottom));\n max-width: none;\n }\n\n .butex-document2-widget__article-meta-date,\n .butex-document2-widget__refs-grid {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .butex-document2-widget__image-asset {\n align-items: stretch;\n flex-direction: column;\n padding: 8px;\n }\n\n .butex-document2-widget__image-thumb {\n align-self: center;\n flex-basis: auto;\n max-width: 100%;\n width: min(100%, 14rem);\n }\n\n .butex-document2-widget__image-asset-main,\n .butex-document2-widget__image-select,\n .butex-document2-widget__image-actions {\n width: 100%;\n }\n\n .butex-document2-widget__image-actions button {\n flex: 1 1 8rem;\n }\n\n .butex-document2-widget__image-actions button,\n .butex-document2-widget__image-select select,\n .butex-document2-widget__list-item-actions button,\n .butex-document2-widget__block-collapse,\n .butex-document2-widget__hijri-menu-trigger {\n min-height: 44px;\n }\n\n .butex-document2-widget__references-menu,\n .butex-document2-widget__table-popover,\n .butex-document2-widget__digit-form-menu {\n position: static;\n }\n\n .butex-document2-widget__references-menu-options,\n .butex-document2-widget__table-popover-panel,\n .butex-document2-widget__digit-form-options {\n inset-inline: 8px;\n width: auto;\n }\n\n .butex-document2-widget__equation-modal {\n align-items: stretch;\n padding: 0;\n }\n\n .butex-document2-widget__cite-picker-backdrop,\n .butex-document2-widget__refs-backdrop {\n align-items: stretch;\n padding-bottom: max(8px, var(--butex-safe-area-bottom));\n padding-left: max(8px, var(--butex-safe-area-left));\n padding-right: max(8px, var(--butex-safe-area-right));\n padding-top: max(8px, var(--butex-safe-area-top));\n }\n\n .butex-document2-widget__cite-picker-backdrop,\n .butex-document2-widget__refs-backdrop {\n align-items: flex-end;\n padding-bottom: var(--butex-safe-area-bottom);\n padding-left: var(--butex-safe-area-left);\n padding-right: var(--butex-safe-area-right);\n }\n\n .butex-document2-widget__equation-modal-panel {\n border: 0;\n border-radius: 0;\n gap: 8px;\n height: 100dvh;\n max-height: 100dvh;\n padding-bottom: max(8px, var(--butex-safe-area-bottom));\n padding-left: max(8px, var(--butex-safe-area-left));\n padding-right: max(8px, var(--butex-safe-area-right));\n padding-top: max(8px, var(--butex-safe-area-top));\n }\n\n .butex-document2-widget__cite-picker,\n .butex-document2-widget__refs-panel {\n border-block-end: 0;\n border-radius: 16px 16px 0 0;\n max-height: calc(100vh - 8px);\n max-height: calc(100dvh - max(8px, var(--butex-safe-area-top)) - var(--butex-safe-area-bottom));\n max-width: none;\n padding: 0;\n width: 100%;\n }\n\n .butex-document2-widget__cite-picker-header,\n .butex-document2-widget__refs-header,\n .butex-document2-widget__cite-picker-footer,\n .butex-document2-widget__dialog-body {\n padding: 12px;\n }\n\n .butex-document2-widget__cite-picker-item {\n min-height: 44px;\n padding: 8px;\n }\n}\n";
|
|
752
|
-
declare function injectBuTeXDocument2Styles(doc?: Document): void;
|
|
753
|
-
|
|
754
|
-
export { ButexDocumentEditor2, type ButexDocumentEditor2Props, type ButexDocumentEditor2Ref, ButexDocumentPreview, type ButexDocumentPreviewProps, type ButexResponsiveMode, type ButexUiLocale, DOCUMENT2_WIDGET_CSS, type Document2InitialState, DocumentInsertToolbar, type DocumentInsertToolbarProps, DocumentPreview, EquationDrawer, type ImageAssetRef, InlineField, MathChip, MathIsland, type ResolveDocument2ImageUrl, injectBuTeXDocument2Styles, resolveInitialDocument2, resolvePreviewDocument2 };
|