@drghaliasri/butex 5.5.2 → 5.5.4

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.
@@ -5,7 +5,7 @@ type EditorNodeKind = 'char' | 'number' | 'operator' | 'delimiter' | 'frac' | 's
5
5
  type MatrixEnvStyle = 'matrix' | 'pmatrix' | 'bmatrix' | 'Bmatrix' | 'vmatrix' | 'Vmatrix';
6
6
  type GridEnvName = MatrixEnvStyle | 'array' | 'aligned';
7
7
  type EnvColumnAlignment = 'l' | 'c' | 'r';
8
- type CharacterFontId = 'default' | 'takween' | 'diwani' | 'diwaniOutline';
8
+ type CharacterFontId = 'default' | 'takween' | 'diwani' | 'diwaniOutline' | 'maghribi';
9
9
  type DigitFormId = 'western' | 'arabicIndic' | 'persianIndic';
10
10
  type EditorSyncState = 'synced' | 'diverged';
11
11
  type EditorChain = {
@@ -143,7 +143,20 @@ type MathObject2Json = {
143
143
  math_mode: string;
144
144
  lines: ChainJson[];
145
145
  closing: string;
146
+ /** Side used by the delimited source stored in the containing value/cell. */
147
+ source_side?: Document2ParseMode;
148
+ /** Preserve whether LaTeX export should prefer imported AST rendering or editor source. */
149
+ source_owner?: 'imported-structured' | 'editor';
150
+ label_enabled?: boolean;
151
+ label?: string;
152
+ };
153
+ /** Positional metadata for a raw-only span that has no structured equation AST. */
154
+ type RawMathObject2Json = {
155
+ node_type: 'RawMathObject';
156
+ label_enabled?: boolean;
157
+ label?: string;
146
158
  };
159
+ type Document2MathObjectJson = MathObject2Json | RawMathObject2Json;
147
160
  type ReferenceFieldSeparator = ',' | '،';
148
161
  type Reference2Json = {
149
162
  key: string;
@@ -179,7 +192,7 @@ type Document2BlockJson = {
179
192
  formats?: TextFormatSpan2Json[];
180
193
  /** Stable host asset identity (e.g. S3 key / UUID); optional for \\includegraphics. */
181
194
  asset_id?: string;
182
- math_objects?: MathObject2Json[];
195
+ math_objects?: Array<Document2MathObjectJson | null>;
183
196
  options?: Record<string, string>;
184
197
  closing?: string;
185
198
  items?: Document2ListItemJson[];
@@ -195,7 +208,7 @@ type Document2BlockJson = {
195
208
  type Document2ListItemJson = {
196
209
  value: string;
197
210
  formats?: TextFormatSpan2Json[];
198
- math_objects?: MathObject2Json[];
211
+ math_objects?: Array<Document2MathObjectJson | null>;
199
212
  blocks?: Document2BlockJson[];
200
213
  };
201
214
  type Document2Diagnostic = {
@@ -463,6 +476,8 @@ type ButexDocumentEditor2Props = {
463
476
  value: string;
464
477
  }) => string;
465
478
  onDocumentChange?: (document: Document2Node) => void;
479
+ /** Canonical JSON wire format for API/database persistence. */
480
+ onDocumentJsonChange?: (document: Document2Json) => void;
466
481
  onLatexChange?: (latex: string) => void;
467
482
  };
468
483
  type Document2InitialState = {
@@ -470,7 +485,7 @@ type Document2InitialState = {
470
485
  error: string | null;
471
486
  };
472
487
  declare function resolveInitialDocument2(initialDocument: Document2Json | Document2Node | undefined, uiLocale?: ButexUiLocale, documentMeta?: Document2MetaProp): Document2InitialState;
473
- declare function ButexDocumentEditor2({ initialDocument, documentMeta, className, debug, documentDirection, equationSide, editableEquations, previewOnly, uiLocale, mathOutput, digitForm: digitFormProp, onDigitFormChange, resolveImageUrl, onDocumentChange, onLatexChange, }: ButexDocumentEditor2Props): react_jsx_runtime.JSX.Element;
488
+ declare function ButexDocumentEditor2({ initialDocument, documentMeta, className, debug, documentDirection, equationSide, editableEquations, previewOnly, uiLocale, mathOutput, digitForm: digitFormProp, onDigitFormChange, resolveImageUrl, onDocumentChange, onDocumentJsonChange, onLatexChange, }: ButexDocumentEditor2Props): react_jsx_runtime.JSX.Element;
474
489
 
475
490
  type DocumentInsertToolbarProps = {
476
491
  canUndo: boolean;
@@ -5,7 +5,7 @@ type EditorNodeKind = 'char' | 'number' | 'operator' | 'delimiter' | 'frac' | 's
5
5
  type MatrixEnvStyle = 'matrix' | 'pmatrix' | 'bmatrix' | 'Bmatrix' | 'vmatrix' | 'Vmatrix';
6
6
  type GridEnvName = MatrixEnvStyle | 'array' | 'aligned';
7
7
  type EnvColumnAlignment = 'l' | 'c' | 'r';
8
- type CharacterFontId = 'default' | 'takween' | 'diwani' | 'diwaniOutline';
8
+ type CharacterFontId = 'default' | 'takween' | 'diwani' | 'diwaniOutline' | 'maghribi';
9
9
  type DigitFormId = 'western' | 'arabicIndic' | 'persianIndic';
10
10
  type EditorSyncState = 'synced' | 'diverged';
11
11
  type EditorChain = {
@@ -143,7 +143,20 @@ type MathObject2Json = {
143
143
  math_mode: string;
144
144
  lines: ChainJson[];
145
145
  closing: string;
146
+ /** Side used by the delimited source stored in the containing value/cell. */
147
+ source_side?: Document2ParseMode;
148
+ /** Preserve whether LaTeX export should prefer imported AST rendering or editor source. */
149
+ source_owner?: 'imported-structured' | 'editor';
150
+ label_enabled?: boolean;
151
+ label?: string;
152
+ };
153
+ /** Positional metadata for a raw-only span that has no structured equation AST. */
154
+ type RawMathObject2Json = {
155
+ node_type: 'RawMathObject';
156
+ label_enabled?: boolean;
157
+ label?: string;
146
158
  };
159
+ type Document2MathObjectJson = MathObject2Json | RawMathObject2Json;
147
160
  type ReferenceFieldSeparator = ',' | '،';
148
161
  type Reference2Json = {
149
162
  key: string;
@@ -179,7 +192,7 @@ type Document2BlockJson = {
179
192
  formats?: TextFormatSpan2Json[];
180
193
  /** Stable host asset identity (e.g. S3 key / UUID); optional for \\includegraphics. */
181
194
  asset_id?: string;
182
- math_objects?: MathObject2Json[];
195
+ math_objects?: Array<Document2MathObjectJson | null>;
183
196
  options?: Record<string, string>;
184
197
  closing?: string;
185
198
  items?: Document2ListItemJson[];
@@ -195,7 +208,7 @@ type Document2BlockJson = {
195
208
  type Document2ListItemJson = {
196
209
  value: string;
197
210
  formats?: TextFormatSpan2Json[];
198
- math_objects?: MathObject2Json[];
211
+ math_objects?: Array<Document2MathObjectJson | null>;
199
212
  blocks?: Document2BlockJson[];
200
213
  };
201
214
  type Document2Diagnostic = {
@@ -463,6 +476,8 @@ type ButexDocumentEditor2Props = {
463
476
  value: string;
464
477
  }) => string;
465
478
  onDocumentChange?: (document: Document2Node) => void;
479
+ /** Canonical JSON wire format for API/database persistence. */
480
+ onDocumentJsonChange?: (document: Document2Json) => void;
466
481
  onLatexChange?: (latex: string) => void;
467
482
  };
468
483
  type Document2InitialState = {
@@ -470,7 +485,7 @@ type Document2InitialState = {
470
485
  error: string | null;
471
486
  };
472
487
  declare function resolveInitialDocument2(initialDocument: Document2Json | Document2Node | undefined, uiLocale?: ButexUiLocale, documentMeta?: Document2MetaProp): Document2InitialState;
473
- declare function ButexDocumentEditor2({ initialDocument, documentMeta, className, debug, documentDirection, equationSide, editableEquations, previewOnly, uiLocale, mathOutput, digitForm: digitFormProp, onDigitFormChange, resolveImageUrl, onDocumentChange, onLatexChange, }: ButexDocumentEditor2Props): react_jsx_runtime.JSX.Element;
488
+ declare function ButexDocumentEditor2({ initialDocument, documentMeta, className, debug, documentDirection, equationSide, editableEquations, previewOnly, uiLocale, mathOutput, digitForm: digitFormProp, onDigitFormChange, resolveImageUrl, onDocumentChange, onDocumentJsonChange, onLatexChange, }: ButexDocumentEditor2Props): react_jsx_runtime.JSX.Element;
474
489
 
475
490
  type DocumentInsertToolbarProps = {
476
491
  canUndo: boolean;