@drghaliasri/butex 8.1.3 → 8.2.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.
@@ -324,6 +324,7 @@ type DocumentBookTarget = {
324
324
  kind: DocumentLabelKind | 'section' | 'subsection' | 'subsubsection' | 'chapter' | 'appendix';
325
325
  caption?: string;
326
326
  displayLabel?: string;
327
+ ordinal?: string;
327
328
  manualKey?: string;
328
329
  };
329
330
  type DocumentBookContext = {
@@ -518,10 +519,20 @@ type ButexBookEditorProps = {
518
519
  onRequestImagePick?: ButexDocumentEditorProps['onRequestImagePick'];
519
520
  resolveImageUrl?: ButexDocumentEditorProps['resolveImageUrl'];
520
521
  initialUnitId?: string;
522
+ /** Controlled selection, if supplied. Hosts must handle onRequestActiveUnitChange. */
523
+ activeUnitId?: string | null;
524
+ /** Runs before capture/remount; return false (or reject) to retain the original chapter. */
525
+ beforeUnitChange?: (fromUnitId: string | null, toUnitId: string) => boolean | Promise<boolean>;
526
+ onRequestActiveUnitChange?: (unitId: string) => void;
527
+ /** Notification after the active chapter actually changes, also called on first mount. */
521
528
  onActiveUnitChange?: (unitId: string | null) => void;
529
+ /** Allow the Al-Bayan host to own book structure mutations without duplicate controls. */
530
+ showStructureTools?: boolean;
531
+ /** Host can own its own picker while using the same controlled selection API. */
532
+ showInternalNavigation?: boolean;
522
533
  className?: string;
523
534
  };
524
535
  /** Only the active chapter has a mounted Document editor. Drafts for inactive units stay in memory. */
525
- declare function ButexBookEditor({ manifest, references, resolution, loadUnit, onUnitDraftChange, onStructureCommand, saveStatus, onRequestImagePick, resolveImageUrl, initialUnitId, onActiveUnitChange, className, }: ButexBookEditorProps): react_jsx_runtime.JSX.Element;
536
+ declare function ButexBookEditor({ manifest, references, resolution, loadUnit, onUnitDraftChange, onStructureCommand, saveStatus, onRequestImagePick, resolveImageUrl, initialUnitId, activeUnitId, beforeUnitChange, onRequestActiveUnitChange, onActiveUnitChange, showStructureTools, showInternalNavigation, className, }: ButexBookEditorProps): react_jsx_runtime.JSX.Element;
526
537
 
527
538
  export { ButexBookEditor, type ButexBookEditorProps };
@@ -324,6 +324,7 @@ type DocumentBookTarget = {
324
324
  kind: DocumentLabelKind | 'section' | 'subsection' | 'subsubsection' | 'chapter' | 'appendix';
325
325
  caption?: string;
326
326
  displayLabel?: string;
327
+ ordinal?: string;
327
328
  manualKey?: string;
328
329
  };
329
330
  type DocumentBookContext = {
@@ -518,10 +519,20 @@ type ButexBookEditorProps = {
518
519
  onRequestImagePick?: ButexDocumentEditorProps['onRequestImagePick'];
519
520
  resolveImageUrl?: ButexDocumentEditorProps['resolveImageUrl'];
520
521
  initialUnitId?: string;
522
+ /** Controlled selection, if supplied. Hosts must handle onRequestActiveUnitChange. */
523
+ activeUnitId?: string | null;
524
+ /** Runs before capture/remount; return false (or reject) to retain the original chapter. */
525
+ beforeUnitChange?: (fromUnitId: string | null, toUnitId: string) => boolean | Promise<boolean>;
526
+ onRequestActiveUnitChange?: (unitId: string) => void;
527
+ /** Notification after the active chapter actually changes, also called on first mount. */
521
528
  onActiveUnitChange?: (unitId: string | null) => void;
529
+ /** Allow the Al-Bayan host to own book structure mutations without duplicate controls. */
530
+ showStructureTools?: boolean;
531
+ /** Host can own its own picker while using the same controlled selection API. */
532
+ showInternalNavigation?: boolean;
522
533
  className?: string;
523
534
  };
524
535
  /** Only the active chapter has a mounted Document editor. Drafts for inactive units stay in memory. */
525
- declare function ButexBookEditor({ manifest, references, resolution, loadUnit, onUnitDraftChange, onStructureCommand, saveStatus, onRequestImagePick, resolveImageUrl, initialUnitId, onActiveUnitChange, className, }: ButexBookEditorProps): react_jsx_runtime.JSX.Element;
536
+ declare function ButexBookEditor({ manifest, references, resolution, loadUnit, onUnitDraftChange, onStructureCommand, saveStatus, onRequestImagePick, resolveImageUrl, initialUnitId, activeUnitId, beforeUnitChange, onRequestActiveUnitChange, onActiveUnitChange, showStructureTools, showInternalNavigation, className, }: ButexBookEditorProps): react_jsx_runtime.JSX.Element;
526
537
 
527
538
  export { ButexBookEditor, type ButexBookEditorProps };