@drghaliasri/butex 6.0.1 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -188,12 +188,27 @@ type Document2Json = {
188
188
  references?: Reference2Json[];
189
189
  blocks: Document2BlockJson[];
190
190
  };
191
+ type Document2InlineTokenIdJson = {
192
+ id: string;
193
+ kind: InlineToken2['kind'];
194
+ start: number;
195
+ end: number;
196
+ };
197
+ type Document2InlineIdsJson = {
198
+ field_id: string;
199
+ tokens: Document2InlineTokenIdJson[];
200
+ };
201
+ type Document2BlockMetadata = {
202
+ source?: 'agent' | 'user';
203
+ };
191
204
  type Document2BlockJson = {
192
205
  /** Stable identity used by headless commands. Legacy JSON may omit it. */
193
206
  id?: string;
194
207
  command: string;
195
208
  value?: string;
196
209
  formats?: TextFormatSpan2Json[];
210
+ inline_ids?: Document2InlineIdsJson;
211
+ metadata?: Document2BlockMetadata;
197
212
  /** Stable host asset identity (e.g. S3 key / UUID); optional for \\includegraphics. */
198
213
  asset_id?: string;
199
214
  math_objects?: Array<Document2MathObjectJson | null>;
@@ -202,6 +217,7 @@ type Document2BlockJson = {
202
217
  items?: Document2ListItemJson[];
203
218
  rows?: string[][];
204
219
  cell_formats?: TextFormatSpan2Json[][][];
220
+ cell_inline_ids?: Document2InlineIdsJson[][];
205
221
  columns?: string;
206
222
  caption?: string;
207
223
  label?: string;
@@ -210,8 +226,10 @@ type Document2BlockJson = {
210
226
  centered?: boolean;
211
227
  };
212
228
  type Document2ListItemJson = {
229
+ id?: string;
213
230
  value: string;
214
231
  formats?: TextFormatSpan2Json[];
232
+ inline_ids?: Document2InlineIdsJson;
215
233
  math_objects?: Array<Document2MathObjectJson | null>;
216
234
  blocks?: Document2BlockJson[];
217
235
  };
@@ -286,6 +304,7 @@ type TextBlock2 = {
286
304
  kind: 'textBlock';
287
305
  command: '\\section' | '\\subsection' | '\\subsubsection' | '\\paragraph';
288
306
  field: InlineField2;
307
+ metadata?: Document2BlockMetadata;
289
308
  /** When true on \\paragraph, center in preview and LaTeX export. */
290
309
  centered?: boolean;
291
310
  };
@@ -300,6 +319,7 @@ type ListBlock2 = {
300
319
  command: '\\begin{itemize}' | '\\begin{enumerate}';
301
320
  closing: '\\end{itemize}' | '\\end{enumerate}';
302
321
  items: ListItem2[];
322
+ metadata?: Document2BlockMetadata;
303
323
  };
304
324
  type FloatMeta2 = {
305
325
  centered: boolean;
@@ -315,6 +335,7 @@ type TableBlock2 = {
315
335
  closing: '\\end{tabular}';
316
336
  columns: string;
317
337
  rows: InlineField2[][];
338
+ metadata?: Document2BlockMetadata;
318
339
  } & FloatMeta2;
319
340
  type ImageBlock2 = {
320
341
  id: string;
@@ -324,18 +345,21 @@ type ImageBlock2 = {
324
345
  /** Host asset identity from wire `asset_id`; preserved across value edits. */
325
346
  assetId?: string;
326
347
  options: Record<string, string>;
348
+ metadata?: Document2BlockMetadata;
327
349
  } & FloatMeta2;
328
350
  type BibliographyBlock2 = {
329
351
  id: string;
330
352
  kind: 'bibliography';
331
353
  command: '\\begin{thebibliography}';
332
354
  closing: '\\end{thebibliography}';
355
+ metadata?: Document2BlockMetadata;
333
356
  };
334
357
  type RawBlock2 = {
335
358
  id: string;
336
359
  kind: 'raw';
337
360
  command: '\\raw';
338
361
  value: string;
362
+ metadata?: Document2BlockMetadata;
339
363
  };
340
364
  type Document2Block = TextBlock2 | ListBlock2 | TableBlock2 | ImageBlock2 | BibliographyBlock2 | RawBlock2;
341
365
  type Document2Node = {
@@ -393,11 +417,13 @@ type PreviewBlock2 = {
393
417
  id: string;
394
418
  level: 1 | 2 | 3;
395
419
  inlines: PreviewInline2[];
420
+ metadata?: Document2BlockMetadata;
396
421
  } | {
397
422
  kind: 'paragraph';
398
423
  id: string;
399
424
  inlines: PreviewInline2[];
400
425
  centered?: boolean;
426
+ metadata?: Document2BlockMetadata;
401
427
  } | {
402
428
  kind: 'list';
403
429
  id: string;
@@ -407,6 +433,7 @@ type PreviewBlock2 = {
407
433
  inlines: PreviewInline2[];
408
434
  blocks: PreviewBlock2[];
409
435
  }>;
436
+ metadata?: Document2BlockMetadata;
410
437
  } | {
411
438
  kind: 'table';
412
439
  id: string;
@@ -414,6 +441,7 @@ type PreviewBlock2 = {
414
441
  caption?: string;
415
442
  label?: string;
416
443
  numberLabel?: string;
444
+ metadata?: Document2BlockMetadata;
417
445
  } | {
418
446
  kind: 'image';
419
447
  id: string;
@@ -423,6 +451,7 @@ type PreviewBlock2 = {
423
451
  caption?: string;
424
452
  label?: string;
425
453
  numberLabel?: string;
454
+ metadata?: Document2BlockMetadata;
426
455
  } | {
427
456
  kind: 'bibliography';
428
457
  id: string;
@@ -437,11 +466,13 @@ type PreviewBlock2 = {
437
466
  venue: string;
438
467
  fieldSeparator: ReferenceFieldSeparator;
439
468
  }>;
469
+ metadata?: Document2BlockMetadata;
440
470
  }
441
471
  /** Preview-only: raw / unknown blocks are omitted from preview until we add proper rendering. */
442
472
  | {
443
473
  kind: 'omit';
444
474
  id: string;
475
+ metadata?: Document2BlockMetadata;
445
476
  };
446
477
 
447
478
  type Document2LabelKind = 'fig' | 'tab' | 'eq';
@@ -188,12 +188,27 @@ type Document2Json = {
188
188
  references?: Reference2Json[];
189
189
  blocks: Document2BlockJson[];
190
190
  };
191
+ type Document2InlineTokenIdJson = {
192
+ id: string;
193
+ kind: InlineToken2['kind'];
194
+ start: number;
195
+ end: number;
196
+ };
197
+ type Document2InlineIdsJson = {
198
+ field_id: string;
199
+ tokens: Document2InlineTokenIdJson[];
200
+ };
201
+ type Document2BlockMetadata = {
202
+ source?: 'agent' | 'user';
203
+ };
191
204
  type Document2BlockJson = {
192
205
  /** Stable identity used by headless commands. Legacy JSON may omit it. */
193
206
  id?: string;
194
207
  command: string;
195
208
  value?: string;
196
209
  formats?: TextFormatSpan2Json[];
210
+ inline_ids?: Document2InlineIdsJson;
211
+ metadata?: Document2BlockMetadata;
197
212
  /** Stable host asset identity (e.g. S3 key / UUID); optional for \\includegraphics. */
198
213
  asset_id?: string;
199
214
  math_objects?: Array<Document2MathObjectJson | null>;
@@ -202,6 +217,7 @@ type Document2BlockJson = {
202
217
  items?: Document2ListItemJson[];
203
218
  rows?: string[][];
204
219
  cell_formats?: TextFormatSpan2Json[][][];
220
+ cell_inline_ids?: Document2InlineIdsJson[][];
205
221
  columns?: string;
206
222
  caption?: string;
207
223
  label?: string;
@@ -210,8 +226,10 @@ type Document2BlockJson = {
210
226
  centered?: boolean;
211
227
  };
212
228
  type Document2ListItemJson = {
229
+ id?: string;
213
230
  value: string;
214
231
  formats?: TextFormatSpan2Json[];
232
+ inline_ids?: Document2InlineIdsJson;
215
233
  math_objects?: Array<Document2MathObjectJson | null>;
216
234
  blocks?: Document2BlockJson[];
217
235
  };
@@ -286,6 +304,7 @@ type TextBlock2 = {
286
304
  kind: 'textBlock';
287
305
  command: '\\section' | '\\subsection' | '\\subsubsection' | '\\paragraph';
288
306
  field: InlineField2;
307
+ metadata?: Document2BlockMetadata;
289
308
  /** When true on \\paragraph, center in preview and LaTeX export. */
290
309
  centered?: boolean;
291
310
  };
@@ -300,6 +319,7 @@ type ListBlock2 = {
300
319
  command: '\\begin{itemize}' | '\\begin{enumerate}';
301
320
  closing: '\\end{itemize}' | '\\end{enumerate}';
302
321
  items: ListItem2[];
322
+ metadata?: Document2BlockMetadata;
303
323
  };
304
324
  type FloatMeta2 = {
305
325
  centered: boolean;
@@ -315,6 +335,7 @@ type TableBlock2 = {
315
335
  closing: '\\end{tabular}';
316
336
  columns: string;
317
337
  rows: InlineField2[][];
338
+ metadata?: Document2BlockMetadata;
318
339
  } & FloatMeta2;
319
340
  type ImageBlock2 = {
320
341
  id: string;
@@ -324,18 +345,21 @@ type ImageBlock2 = {
324
345
  /** Host asset identity from wire `asset_id`; preserved across value edits. */
325
346
  assetId?: string;
326
347
  options: Record<string, string>;
348
+ metadata?: Document2BlockMetadata;
327
349
  } & FloatMeta2;
328
350
  type BibliographyBlock2 = {
329
351
  id: string;
330
352
  kind: 'bibliography';
331
353
  command: '\\begin{thebibliography}';
332
354
  closing: '\\end{thebibliography}';
355
+ metadata?: Document2BlockMetadata;
333
356
  };
334
357
  type RawBlock2 = {
335
358
  id: string;
336
359
  kind: 'raw';
337
360
  command: '\\raw';
338
361
  value: string;
362
+ metadata?: Document2BlockMetadata;
339
363
  };
340
364
  type Document2Block = TextBlock2 | ListBlock2 | TableBlock2 | ImageBlock2 | BibliographyBlock2 | RawBlock2;
341
365
  type Document2Node = {
@@ -393,11 +417,13 @@ type PreviewBlock2 = {
393
417
  id: string;
394
418
  level: 1 | 2 | 3;
395
419
  inlines: PreviewInline2[];
420
+ metadata?: Document2BlockMetadata;
396
421
  } | {
397
422
  kind: 'paragraph';
398
423
  id: string;
399
424
  inlines: PreviewInline2[];
400
425
  centered?: boolean;
426
+ metadata?: Document2BlockMetadata;
401
427
  } | {
402
428
  kind: 'list';
403
429
  id: string;
@@ -407,6 +433,7 @@ type PreviewBlock2 = {
407
433
  inlines: PreviewInline2[];
408
434
  blocks: PreviewBlock2[];
409
435
  }>;
436
+ metadata?: Document2BlockMetadata;
410
437
  } | {
411
438
  kind: 'table';
412
439
  id: string;
@@ -414,6 +441,7 @@ type PreviewBlock2 = {
414
441
  caption?: string;
415
442
  label?: string;
416
443
  numberLabel?: string;
444
+ metadata?: Document2BlockMetadata;
417
445
  } | {
418
446
  kind: 'image';
419
447
  id: string;
@@ -423,6 +451,7 @@ type PreviewBlock2 = {
423
451
  caption?: string;
424
452
  label?: string;
425
453
  numberLabel?: string;
454
+ metadata?: Document2BlockMetadata;
426
455
  } | {
427
456
  kind: 'bibliography';
428
457
  id: string;
@@ -437,11 +466,13 @@ type PreviewBlock2 = {
437
466
  venue: string;
438
467
  fieldSeparator: ReferenceFieldSeparator;
439
468
  }>;
469
+ metadata?: Document2BlockMetadata;
440
470
  }
441
471
  /** Preview-only: raw / unknown blocks are omitted from preview until we add proper rendering. */
442
472
  | {
443
473
  kind: 'omit';
444
474
  id: string;
475
+ metadata?: Document2BlockMetadata;
445
476
  };
446
477
 
447
478
  type Document2LabelKind = 'fig' | 'tab' | 'eq';