react-advanced-odontogram 2.5.0 → 2.7.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/dist/index.d.ts CHANGED
@@ -279,6 +279,25 @@ export declare function CariesCard(): JSX_2.Element;
279
279
  * `DiagnosisKey`/`DX_CODES`. */
280
280
  declare type CaseConditionKey = "jawSizeAnomaly" | "jawBaseAnomaly" | "archRelationAnomaly" | "toothPositionAnomaly" | "malocclusionUnspecified" | "dentofacialFunctional" | "tmjDisorder" | "odontogenicCyst" | "nonOdontogenicCyst" | "jawCystOther" | "oralCystOther" | "salivaryAtrophy" | "salivaryHypertrophy" | "sialadenitis" | "salivaryAbscess" | "salivaryFistula" | "sialolithiasis" | "mucocele" | "salivarySecretion" | "recurrentAphthae" | "stomatitisOther" | "oralCellulitis" | "oralMucositis" | "anodontia" | "hereditaryStructure" | "lipDisease" | "leukoplakia" | "mucosalLesionOther";
281
281
 
282
+ /**
283
+ * The "Case / regional diagnoses" pop-up. Moved out of the perio-status sidebar
284
+ * (`PerioSidebar`) into its own dialog, opened from the "Diagnoses" button next
285
+ * to the Odontogram / Periodontal-status view toggle. Mirrors `CreditsModal`'s
286
+ * dialog contract: `role="dialog"` + `aria-modal`, Escape closes, backdrop click
287
+ * closes, focus is trapped while open and returned to the opener on close.
288
+ *
289
+ * Owns its own `caseConds` state + a single `onStateChange` subscription (like
290
+ * `PerioSidebar` did), so it stays live while open. Rows are code-first and
291
+ * code-sorted (`getCaseConditions` sorts by ICD-10); the add-picker options are
292
+ * code-first (`{icd10} {label}`) and code-sorted too.
293
+ */
294
+ export declare function CaseDiagnosesModal({ open, t, onClose, }: {
295
+ open: boolean;
296
+ /** Translation function — the `t` from `useI18n`. */
297
+ t: (key: string, params?: Record<string, string | number>) => string;
298
+ onClose: () => void;
299
+ }): JSX_2.Element;
300
+
282
301
  declare type ChartMode = "status" | "plan";
283
302
 
284
303
  /** Remove the stored entry for the active (or default) key. */
@@ -313,8 +332,30 @@ declare interface CodingPack {
313
332
  code: string;
314
333
  display: string;
315
334
  }>>;
335
+ /** DX-8: translation-pack displays keyed by a REFINED WHO code (e.g. `K02.1`)
336
+ * that `refineWho` may emit instead of the key's flat code. Falls back to
337
+ * `displays[key]` when absent. */
338
+ refinedDisplays?: Record<string, string>;
316
339
  }
317
340
 
341
+ /**
342
+ * Compare two EXPORTED exams of the same mouth — `before` as charted then,
343
+ * `after` as charted now.
344
+ *
345
+ * `getPlanChanges()` diffs the two charts of ONE exam (what the clinician plans
346
+ * to change); this diffs one chart across TWO exams (what actually changed
347
+ * since last time), which is the question a recall appointment asks. A host
348
+ * keeping a timeline of exports holds both payloads; nothing else is needed.
349
+ *
350
+ * Pure and read-only: it never touches the live charts, so it can be called
351
+ * while the clinician is working, and the active chart is irrelevant to the
352
+ * result. Each payload is hydrated under ITS OWN version rule (the same one
353
+ * `importStatus()` applies), so an old export compares faithfully. Tolerant of
354
+ * a malformed or empty payload — an unreadable tooth compares as the clinical
355
+ * default rather than throwing.
356
+ */
357
+ export declare function compareExams(before: Any, after: Any): ExamComparison;
358
+
318
359
  /**
319
360
  * Tear down the odontogram engine: clear all DOM elements built by the engine,
320
361
  * unsubscribe from i18n changes, and reset internal state. After this call,
@@ -338,6 +379,23 @@ export declare function disablePersistence(): void;
338
379
  */
339
380
  export declare function enablePersistence(options?: PersistenceOptions): void;
340
381
 
382
+ /** What {@link compareExams} answers: the same mouth, charted twice. */
383
+ export declare interface ExamComparison {
384
+ /** Axis-level changes, exactly the shape and labels `getPlanChanges()` uses —
385
+ * `from` is the earlier exam, `to` the later one. */
386
+ changes: PlanChange[];
387
+ /** The periodontal measurements, where the change is numeric rather than a
388
+ * label: per-site probing depth and attachment level, and what moved by a
389
+ * clinically meaningful amount. */
390
+ perio: PerioExamComparison;
391
+ /** The 2017 classification of each exam (derived, with the clinician's own
392
+ * per-axis overrides applied), so a stage or grade that moved is visible. */
393
+ classification: {
394
+ from: FinalPerioClassification;
395
+ to: FinalPerioClassification;
396
+ };
397
+ }
398
+
341
399
  /**
342
400
  * Export the current odontogram as an HL7 FHIR R4 collection Bundle (JSON).
343
401
  * @param options - Optional subject reference (e.g. "Patient/123"); when
@@ -355,7 +413,7 @@ export declare function exportImage(format?: "png" | "jpg"): Promise<void>;
355
413
  /**
356
414
  * Assemble a printable PDF report (jsPDF-native — vector text + raster chart
357
415
  * PNGs, no svg2pdf.js). Gathers all `data` (SVG→PNG
358
- * rasterization via {@link rasterizeSvgToPng}, summary/classification text,
416
+ * rasterization via `rasterizeSvgToPng`, summary/classification text,
359
417
  * `hasAnyPerioData()`), drives the export-progress overlay, then hands off
360
418
  * to the PURE `assemblePdf()` (`src/perioPdf.ts`), which decides section
361
419
  * layout from `opts`/`data` alone.
@@ -370,7 +428,7 @@ export declare function exportImage(format?: "png" | "jpg"): Promise<void>;
370
428
  export declare function exportPdf(opts: PdfExportOptions): Promise<void>;
371
429
 
372
430
  /** Export the full perio chart as PNG/JPG (SVG → canvas @2×, via the
373
- * shared {@link rasterizeSvgToCanvas} raster core). */
431
+ * shared `rasterizeSvgToCanvas` raster core). */
374
432
  export declare function exportPerioImage(format?: "png" | "jpg"): Promise<void>;
375
433
 
376
434
  /** Export the full perio chart as a standalone vector SVG file. */
@@ -409,11 +467,24 @@ export declare type FillingComplexity = "complex" | "simple";
409
467
 
410
468
  export declare function FillingsCard(): JSX_2.Element;
411
469
 
470
+ /** The final (override ?? derived) classification for one axis each — see
471
+ * `getPerioClassification()` in odontogram.ts for the live-state
472
+ * equivalent this mirrors. */
473
+ /** The final periodontal classification of a serialized payload — derived,
474
+ * then overridden per axis by whatever the clinician pinned in `case`.
475
+ * Exported because the exam comparison reports it for both exams. */
476
+ declare interface FinalPerioClassification {
477
+ diagnosis: PerioDiagnosis;
478
+ stage: PerioStage;
479
+ grade: PerioGrade;
480
+ extent: PerioExtent;
481
+ }
482
+
412
483
  /** Formats a tooth number for display using the active numbering system AND
413
- * the milktooth display-remap ({@link getDisplayedToothNumber}) — the exact
484
+ * the milktooth display-remap (`getDisplayedToothNumber`) — the exact
414
485
  * same formatting {@link getOdontogramSummary} uses for every tooth number
415
486
  * it prints (permanent/missing lists, per-section entries, implants). Exported
416
- * so the "What changes" box in App.tsx can label a {@link PlanChange.toothNo}
487
+ * so the "What changes" box in App.tsx can label a `PlanChange.toothNo`
417
488
  * identically, without duplicating the numbering/milktooth logic. */
418
489
  export declare function formatToothLabel(toothNo: number): string;
419
490
 
@@ -475,6 +546,13 @@ export declare function getIcdasEnabled(): boolean;
475
546
  */
476
547
  export declare function getNotesEnabled(): boolean;
477
548
 
549
+ /**
550
+ * Switch the displayed tooth numbering system and re-render all tooth labels.
551
+ * @param system - The target {@link NumberingSystem}.
552
+ */
553
+ /** The numbering system currently displayed. Defaults to `"FDI"`. */
554
+ export declare function getNumberingSystem(): NumberingSystem;
555
+
478
556
  export declare function getOdontogramSummary(): OdontogramSummary;
479
557
 
480
558
  export declare function getPdfSettings(): PdfSettings;
@@ -490,7 +568,7 @@ export declare function getPerioViewMode(): PerioViewMode;
490
568
 
491
569
  /**
492
570
  * Compare the "status" chart against the "plan" chart, tooth by tooth and
493
- * axis by axis (see {@link DIFF_AXES}), and report every axis whose label
571
+ * axis by axis (see `DIFF_AXES`), and report every axis whose label
494
572
  * differs. Pure and read-only: never mutates either chart, never touches the
495
573
  * DOM, never renders — a `parity.test.ts`-safe addition.
496
574
  *
@@ -533,8 +611,33 @@ export declare function getReadOnly(): boolean;
533
611
 
534
612
  export declare function getRootCariesMode(): RootCariesMode;
535
613
 
614
+ /** Current tooth-number size. Defaults to `"normal"`. */
615
+ export declare function getScreenToothNumberSize(): ScreenToothNumberSize;
616
+
617
+ /** Current inter-tooth spacing. Defaults to `"normal"`. */
618
+ export declare function getScreenToothSpacing(): ScreenToothSpacing;
619
+
536
620
  export declare function getSecondaryCariesMode(): SecondaryCariesMode;
537
621
 
622
+ /**
623
+ * The currently selected teeth, as FDI numbers, in the order they were added to
624
+ * the selection. Empty when nothing is selected.
625
+ *
626
+ * Returns a fresh array — changing it never touches the selection. Every
627
+ * selection change fires {@link onStateChange}, so a host can follow the
628
+ * selection by re-reading this in its listener (to price a treatment for the
629
+ * selected teeth, for example).
630
+ *
631
+ * Contributed in a downstream fork (sofia-cluadette/React-Advanced-Odontogram).
632
+ */
633
+ export declare function getSelectedTeeth(): number[];
634
+
635
+ /** Current selection-ring border style. Defaults to `"dashed"`. */
636
+ export declare function getSelectionBorderStyle(): SelectionBorderStyle;
637
+
638
+ /** Current selection-ring colour as `#rrggbb`. Defaults to `"#3b7bff"`. */
639
+ export declare function getSelectionColor(): string;
640
+
538
641
  export declare function getSnomedEnabled(): boolean;
539
642
 
540
643
  /**
@@ -595,12 +698,15 @@ export declare function getSurfaceNotation(): SurfaceNotation;
595
698
  export declare function getToothAnatomy(): ToothAnatomy;
596
699
 
597
700
  /** A tooth's EFFECTIVE coded diagnoses (derived − suppressed + added), reused
598
- * by both the tooltip ({@link getStateSummary}) and the whole-mouth summary
701
+ * by both the tooltip (`getStateSummary`) and the whole-mouth summary
599
702
  * ({@link getOdontogramSummary}). Reads the ACTIVE chart's tooth state (so
600
703
  * it's transparently Status/Plan dual-state aware, like every other per-tooth
601
704
  * getter). A tooth with no state (never touched) has no diagnoses. */
602
705
  export declare function getToothDiagnoses(toothNo: number): ToothDiagnosis[];
603
706
 
707
+ /** Whether the tooth-information panel is shown. Defaults to `true`. */
708
+ export declare function getToothInfoVisible(): boolean;
709
+
604
710
  /**
605
711
  * Get a human-readable summary of all active states for a tooth.
606
712
  * Useful for building custom tooltip or info-panel UIs.
@@ -653,6 +759,10 @@ export declare function isPersistenceEnabled(): boolean;
653
759
  * | zh | Chinese (Simplified) |
654
760
  * | ar | Arabic (RTL — UI mirrors, dental/perio charts pinned LTR) |
655
761
  * | fr | French |
762
+ *
763
+ * The strings themselves live one file per language in `./locales/`. Only
764
+ * English is bundled statically; every other language is a separate chunk
765
+ * fetched the first time it is selected (see `./loader.ts`).
656
766
  */
657
767
  declare type Language = "hu" | "en" | "de" | "es" | "it" | "sk" | "pl" | "ru" | "pt-br" | "zh" | "ar" | "fr";
658
768
 
@@ -717,8 +827,14 @@ export declare type OdontogramPlugin = {
717
827
  * Owns all odontogram shell state, effects, and handlers and provides them to
718
828
  * composed surfaces + modals. Renders only the `.odontogram-root` wrapper around
719
829
  * `children` — no extra DOM node.
830
+ *
831
+ * Holds its first render until the requested `language` has loaded: every UI
832
+ * language but English is a lazily fetched chunk, and mounting before it
833
+ * arrives would paint the whole chart in the English fallback and then repaint
834
+ * it — a visible flash of the wrong language on every page load. English (and
835
+ * any language already loaded) renders on the very first pass, as before.
720
836
  */
721
- export declare function OdontogramProvider({ children, language, onLanguageChange, numberingSystem, onNumberingChange, darkMode, onDarkModeChange, themeConfig, plugins, readOnly: readOnlyProp, enableNotes, enableIcdas, pulpDetailLevel, secondaryCariesMode, rootCariesMode, radiographicDepthMode, cariesDepthEnabled, wearDetailLevel, discolorationDetailLevel, surfaceNotation, showStatusCard: showStatusCardProp, showOrthoCard: showOrthoCardProp, fillingComplexity, onFillingComplexityChange, fillingDefectEnabled: fillingDefectEnabledProp, onFillingDefectEnabledChange, fillingMaterialAvailability, onFillingMaterialAvailabilityChange, fissureSealingEnabled: fissureSealingEnabledProp, onFissureSealingEnabledChange, }: OdontogramProviderProps): JSX_2.Element;
837
+ export declare function OdontogramProvider(props: OdontogramProviderProps): JSX_2.Element;
722
838
 
723
839
  /**
724
840
  * Props for {@link OdontogramProvider} — the full former `OdontogramShell`
@@ -832,7 +948,7 @@ declare type OdontogramProviderProps = {
832
948
  /**
833
949
  * Filling-complexity level for the Fillings card: `"simple"` (one material
834
950
  * per tooth, no per-surface picker) or `"complex"` (per-surface materials,
835
- * default). Contrast with {@link settings.panels} — this one mirrors the
951
+ * default). Contrast with `settings.panels` — this one mirrors the
836
952
  * `fillingComplexity` engine flag (Settings → Fillings). When provided, the
837
953
  * value overrides the engine/UI default; when omitted, whatever the engine
838
954
  * holds (module default or a prior `setFillingComplexity` call) stays put.
@@ -876,6 +992,20 @@ declare type OdontogramProviderProps = {
876
992
  fissureSealingEnabled?: boolean;
877
993
  /** See {@link onFillingComplexityChange} — the fissure-sealing toggle's counterpart. */
878
994
  onFissureSealingEnabledChange?: (enabled: boolean) => void;
995
+ /**
996
+ * Inter-tooth spacing of the on-screen grid (Settings → Odontogram). Mirrors
997
+ * the `screenToothSpacing` engine flag; same controlled/standalone contract
998
+ * as {@link fillingComplexity}.
999
+ */
1000
+ screenToothSpacing?: ScreenToothSpacing;
1001
+ /** Tooth-number size of the on-screen grid; same contract as {@link screenToothSpacing}. */
1002
+ screenToothNumberSize?: ScreenToothNumberSize;
1003
+ /** Selection-ring colour as `#rrggbb`; same contract as {@link screenToothSpacing}. */
1004
+ selectionColor?: string;
1005
+ /** Selection-ring border style; same contract as {@link screenToothSpacing}. */
1006
+ selectionBorderStyle?: SelectionBorderStyle;
1007
+ /** Whether the tooth-information panel is shown; same contract as {@link screenToothSpacing}. */
1008
+ toothInfo?: boolean;
879
1009
  /** The composed UI (surfaces + shell layout). */
880
1010
  children?: ReactNode;
881
1011
  };
@@ -924,28 +1054,6 @@ export declare type OdontogramSummarySection = {
924
1054
  emptyText: string;
925
1055
  };
926
1056
 
927
- /**
928
- * Theme configuration for the Odontogram component.
929
- *
930
- * Allows host applications to override the default color palette without
931
- * modifying CSS files. All properties are optional — only the provided
932
- * values are overridden; the rest fall back to the built-in defaults.
933
- *
934
- * Colors are applied as CSS custom properties (`--odon-*`) on the
935
- * component root element, so they work regardless of whether the host
936
- * uses Tailwind CSS or plain CSS.
937
- *
938
- * @example
939
- * ```tsx
940
- * const myTheme: OdontogramThemeConfig = {
941
- * colors: {
942
- * accent: '#e74c3c',
943
- * background: '#fafafa',
944
- * },
945
- * };
946
- * <App themeConfig={myTheme} />
947
- * ```
948
- */
949
1057
  export declare type OdontogramThemeConfig = {
950
1058
  colors?: {
951
1059
  /** Primary background. Default: `#f3f6fb` (light) / `#0f172a` (dark). */
@@ -965,6 +1073,99 @@ export declare type OdontogramThemeConfig = {
965
1073
  /** Secondary accent (success, selected states). Default: `#12b981`. */
966
1074
  accent2?: string;
967
1075
  };
1076
+ /**
1077
+ * Tooth-artwork colours.
1078
+ *
1079
+ * The drawings carry their colours as palette tokens with today's colour as
1080
+ * the fallback (`fill: var(--odon-tooth-body, #ebebeb)`), so an omitted
1081
+ * key leaves that surface exactly as drawn. Setting a key recolours that
1082
+ * surface across BOTH anatomy profiles at once, even where the classic and
1083
+ * measured artwork happen to be drawn in different shades.
1084
+ *
1085
+ * This is a curated subset. Every token — including the gradient stops and
1086
+ * the per-material restoration colours — can be set by name through
1087
+ * {@link OdontogramThemeConfig.tokens}.
1088
+ */
1089
+ tooth?: {
1090
+ /** The tooth's own silhouette — crown AND root — and every broken or
1091
+ * prepared variant of it.
1092
+ *
1093
+ * In the `classic` profile this is the whole tooth: those drawings are one
1094
+ * shape, with no inner structure. In `measured` it is the outer shell —
1095
+ * enamel over the crown, cementum over the root — around `dentin` below,
1096
+ * which takes this colour unless it is set. Setting only `body` therefore
1097
+ * looks the same in both profiles. */
1098
+ body?: string;
1099
+ /** The dentin core inside the crown and root (`measured` profile only —
1100
+ * the classic drawings have no enamel/dentin boundary to colour).
1101
+ *
1102
+ * Unset, it follows `body`, so the boundary is invisible until you ask
1103
+ * for it. The occlusal view has no core: nothing of the dentin shows from
1104
+ * above. */
1105
+ dentin?: string;
1106
+ /** Crown and root outline. */
1107
+ outline?: string;
1108
+ /** Crown sheen (the "beauty" layer). */
1109
+ highlight?: string;
1110
+ /** The deciduous tooth's silhouette. */
1111
+ milktoothBody?: string;
1112
+ /** Deciduous crown sheen. */
1113
+ milktoothHighlight?: string;
1114
+ /** Occlusal cusp field. */
1115
+ cusp?: string;
1116
+ /** Occlusal fissure lines. */
1117
+ groove?: string;
1118
+ /** Healthy pulp chamber. */
1119
+ pulpHealthy?: string;
1120
+ /** Inflamed pulp. */
1121
+ pulpInflamed?: string;
1122
+ /** Gingiva. */
1123
+ gum?: string;
1124
+ /** Alveolar bone. */
1125
+ bone?: string;
1126
+ /** Caries body. */
1127
+ caries?: string;
1128
+ /** Caries outline. */
1129
+ cariesOutline?: string;
1130
+ /** Bruxism wear facet. */
1131
+ wear?: string;
1132
+ /** Calculus deposit. */
1133
+ calculus?: string;
1134
+ /** Restoration outline. */
1135
+ restorationOutline?: string;
1136
+ /** Dark structural outline. */
1137
+ outlineDark?: string;
1138
+ };
1139
+ /**
1140
+ * Any palette token by its full CSS custom-property name, for the surfaces
1141
+ * {@link OdontogramThemeConfig.tooth} does not name — the per-material
1142
+ * restoration colours (`--odon-rest-gold`, `--odon-fill-composite`, …) and
1143
+ * the e.max / metal-ceramic gradient stops.
1144
+ *
1145
+ * Keys must start with `--odon-`; anything else is ignored, so this cannot
1146
+ * be used to set unrelated custom properties on the host's element.
1147
+ *
1148
+ * @example
1149
+ * { tokens: { "--odon-rest-gold": "#d4af37", "--odon-fill-composite": "#eae0c8" } }
1150
+ */
1151
+ tokens?: Record<string, string>;
1152
+ /**
1153
+ * The tooth-selection highlight.
1154
+ *
1155
+ * Selection is an interaction state, not artwork — it is drawn by the chart
1156
+ * around a tile, not by any tooth drawing — but hosts look for it here when
1157
+ * they are deciding "what colour is everything". It is applied through the
1158
+ * existing session setters (`setSelectionColor` / `setSelectionBorderStyle`),
1159
+ * so it is NOT a CSS custom property and does not appear on the themed
1160
+ * element.
1161
+ *
1162
+ * The dedicated `selectionColor` / `selectionBorderStyle` props on the
1163
+ * provider are the more specific control and win when both are given.
1164
+ */
1165
+ selection?: {
1166
+ color?: string;
1167
+ borderStyle?: SelectionBorderStyle;
1168
+ };
968
1169
  };
969
1170
 
970
1171
  /** A grouped dentition overview: category columns (only non-empty ones) ×
@@ -1036,7 +1237,10 @@ export declare type OdontogramUiContextValue = {
1036
1237
 
1037
1238
  /**
1038
1239
  * Subscribe to odontogram state changes. The callback runs after any tooth
1039
- * state edit, the edentulous toggle, or an import.
1240
+ * state edit, the edentulous toggle, an import, or a change to a session
1241
+ * setting (numbering system, notes, ICDAS, caries/pulp/wear/discoloration
1242
+ * detail, surface notation, fillings, perio display) — so a host that
1243
+ * persists the doctor's preferences can react to the settings modal too.
1040
1244
  *
1041
1245
  * @param cb - Callback invoked on each change.
1042
1246
  * @returns An unsubscribe function.
@@ -1097,9 +1301,12 @@ declare type PdfPerioFontSize = "small" | "normal" | "xlarge";
1097
1301
  declare type PdfPerioLabelPlacement = "center" | "edge";
1098
1302
 
1099
1303
  declare interface PdfSettings {
1100
- /** Placeholder patient name when the case has none (default "John Doe"). */
1304
+ /** Optional placeholder patient name, printed when the case has none. Empty
1305
+ * by default: the report then prints "not specified" (`pdf.field.notSpecified`)
1306
+ * rather than inventing a name. */
1101
1307
  defaultName: string;
1102
- /** Placeholder DOB (ISO `YYYY-MM-DD`) when the case has none. */
1308
+ /** Optional placeholder DOB (ISO `YYYY-MM-DD`), printed when the case has
1309
+ * none. Empty by default, as above. No age is ever derived from it. */
1103
1310
  defaultDob: string;
1104
1311
  /** Show the patient's age (in parentheses) after the DOB. */
1105
1312
  showAge: boolean;
@@ -1192,12 +1399,64 @@ export declare function PerioChart({ open, onClose, inline, }: {
1192
1399
  inline?: boolean;
1193
1400
  }): JSX_2.Element;
1194
1401
 
1402
+ declare type PerioDiagnosis = "health" | "gingivitis" | "periodontitis";
1403
+
1404
+ /** Whole-mouth figures for one exam — the subset of `getPerioSummary()` that
1405
+ * can be derived from a payload alone. */
1406
+ export declare interface PerioExamAggregate {
1407
+ chartedSites: number;
1408
+ bleedingSites: number;
1409
+ /** Bleeding sites ÷ charted sites, as a percentage with one decimal. */
1410
+ bopPercent: number;
1411
+ maxPd: number | null;
1412
+ worstCal: number | null;
1413
+ }
1414
+
1415
+ export declare interface PerioExamComparison {
1416
+ from: PerioExamAggregate;
1417
+ to: PerioExamAggregate;
1418
+ /** Every site whose probing depth or attachment level moved at all, including
1419
+ * sites charted in only one of the two exams. Tooth order is the clinical
1420
+ * `ALL_TEETH` order; sites follow `PERIO_SITES`. */
1421
+ changed: PerioSiteDelta[];
1422
+ /** Sites charted in BOTH exams whose attachment worsened by at least
1423
+ * {@link PROGRESSION_MM} — the clinically meaningful subset of `changed`. */
1424
+ attachmentLoss: PerioSiteDelta[];
1425
+ /** …and improved by at least as much. */
1426
+ attachmentGain: PerioSiteDelta[];
1427
+ /** Sites charted in both whose POCKET deepened by at least {@link PROGRESSION_MM}. */
1428
+ deepened: PerioSiteDelta[];
1429
+ /** Sites charted now but not then, and the other way round. */
1430
+ newlyCharted: number;
1431
+ noLongerCharted: number;
1432
+ }
1433
+
1434
+ declare type PerioExtent = "na" | "localized" | "generalized" | "molar-incisor";
1435
+
1436
+ declare type PerioGrade = "A" | "B" | "C" | "indeterminate";
1437
+
1195
1438
  /** How perio-chart index row labels are rendered. */
1196
1439
  export declare type PerioIndexNameMode = "translated" | "canonical";
1197
1440
 
1198
1441
  /** The 16 toggleable periodontal index rows the Dental Chart can show/hide. */
1199
1442
  export declare type PerioRowId = "plaque" | "bop" | "cal" | "gm" | "pd" | "furcation" | "mobility" | "cej" | "rootConcavity" | "pi" | "gi" | "mpi" | "mbi" | "kg" | "gt" | "miller";
1200
1443
 
1444
+ export declare function PerioSidebar(): JSX_2.Element;
1445
+
1446
+ /** One site, measured in both exams (or in only one of them). */
1447
+ export declare interface PerioSiteDelta {
1448
+ toothNo: number;
1449
+ site: string;
1450
+ /** Probing depth in mm, or `null` when the site was not charted in that exam. */
1451
+ pdFrom: number | null;
1452
+ pdTo: number | null;
1453
+ /** Clinical attachment level (pd + gm) in mm, or `null` when not charted. */
1454
+ calFrom: number | null;
1455
+ calTo: number | null;
1456
+ }
1457
+
1458
+ declare type PerioStage = "na" | "I" | "II" | "III" | "IV" | "indeterminate";
1459
+
1201
1460
  export declare type PerioViewMode = "toggle" | "popup";
1202
1461
 
1203
1462
  export declare type PersistenceOptions = {
@@ -1227,6 +1486,15 @@ declare type PlanChange = {
1227
1486
  */
1228
1487
  export declare type PluginLayer = "base" | "restoration" | "overlay";
1229
1488
 
1489
+ /**
1490
+ * Millimetres of change that count as real movement rather than measurement
1491
+ * noise. Probing is reproducible to about ±1 mm between visits and examiners,
1492
+ * so 2 mm is the threshold the periodontal literature uses for attachment
1493
+ * loss/gain — and the one the 2017 classification's own progression reasoning
1494
+ * rests on. Exported so a caller can report on its own threshold instead.
1495
+ */
1496
+ export declare const PROGRESSION_MM = 2;
1497
+
1230
1498
  export declare type PulpDetailLevel = "simple" | "aae" | "latin";
1231
1499
 
1232
1500
  export declare type RadiographicDepthMode = "off" | "threeLevel" | "detailed";
@@ -1302,25 +1570,16 @@ export declare type RootPerioOption = {
1302
1570
  label: string;
1303
1571
  };
1304
1572
 
1305
- declare type ScreenToothNumberSize = "small" | "normal" | "xlarge";
1573
+ /** Tooth-number font size in the live grid. */
1574
+ export declare type ScreenToothNumberSize = "small" | "normal" | "xlarge";
1306
1575
 
1307
- /**
1308
- * The full set of live setting values + change handlers the modal drives.
1309
- *
1310
- * Every field maps 1:1 to an existing App-level piece of state / module
1311
- * accessor — the modal never owns behavior, it only surfaces the controls.
1312
- * New settings are added here and wired into a tab's `render()`.
1313
- */
1314
- /** On-screen odontogram layout controls (distinct from the PDF/export
1315
- * equivalents). Spacing = inter-tooth gap in the live grid; number size = the
1316
- * tooth-number font size. Session-only, pure CSS via data-attributes on the
1317
- * grid. */
1318
- declare type ScreenToothSpacing = "wide" | "normal" | "close";
1576
+ /** Inter-tooth gap in the live grid. */
1577
+ export declare type ScreenToothSpacing = "wide" | "normal" | "close";
1319
1578
 
1320
1579
  export declare type SecondaryCariesMode = "simple" | "standard" | "full";
1321
1580
 
1322
1581
  /** Selection-ring border style (default dashed). */
1323
- declare type SelectionBorderStyle = "solid" | "dashed" | "dotted";
1582
+ export declare type SelectionBorderStyle = "solid" | "dashed" | "dotted";
1324
1583
 
1325
1584
  /** Apical (AAE) diagnosis on the current selection — clears the periapical
1326
1585
  * lesion subtype unless the diagnosis is (a)symptomatic apical periodontitis. */
@@ -1353,7 +1612,7 @@ export declare function setCariesSurfaceForSelection(id: string, on: boolean): v
1353
1612
  /**
1354
1613
  * Switch the active chart between "status" (current findings) and "plan"
1355
1614
  * (proposed treatment). The first time "plan" is entered, it is deep-cloned
1356
- * from "status" (see {@link cloneChart}); later switches reuse the existing
1615
+ * from "status" (see `cloneChart`); later switches reuse the existing
1357
1616
  * plan chart untouched. Re-renders every tooth from the newly active chart
1358
1617
  * via the SAME full-repaint mechanism `importStatus()` uses, so no new
1359
1618
  * render path is introduced and SVG output stays byte-identical to the
@@ -1393,7 +1652,7 @@ export declare function setDiscolorationToggleForSelection(on: boolean): void;
1393
1652
  * validates `key` against {@link TOOTH_LEVEL_DX_KEYS} and `mode` against
1394
1653
  * {@link VALID_DX_OVERRIDE_VALUE} (or `null`, which clears any existing
1395
1654
  * override for `key`); anything else is a silent no-op. Routed through
1396
- * {@link gateToothEditBatch} directly (not `applyToSelected`) since
1655
+ * `gateToothEditBatch` directly (not `applyToSelected`) since
1397
1656
  * `dxOverrides` has no SVG/DOM side effect to re-render per tooth. */
1398
1657
  export declare function setDxOverrideForSelection(key: string, mode: "add" | "suppress" | null): void;
1399
1658
 
@@ -1464,10 +1723,6 @@ export declare function setModForSelection(id: string, on: boolean): void;
1464
1723
  */
1465
1724
  export declare function setNotesEnabled(value: boolean): void;
1466
1725
 
1467
- /**
1468
- * Switch the displayed tooth numbering system and re-render all tooth labels.
1469
- * @param system - The target {@link NumberingSystem}.
1470
- */
1471
1726
  export declare function setNumberingSystem(system: NumberingSystem): void;
1472
1727
 
1473
1728
  /** Toggle visibility of occlusal-view tiles (premolars and molars). */
@@ -1554,8 +1809,20 @@ export declare function setRootCariesForSelection(value: string): void;
1554
1809
 
1555
1810
  export declare function setRootCariesMode(value: RootCariesMode): void;
1556
1811
 
1812
+ /** Set the tooth-number size. Sanitizes to the literal set; no-op (does not notify) if unchanged. */
1813
+ export declare function setScreenToothNumberSize(value: ScreenToothNumberSize): void;
1814
+
1815
+ /** Set the inter-tooth spacing. Sanitizes to the literal set; no-op (does not notify) if unchanged. */
1816
+ export declare function setScreenToothSpacing(value: ScreenToothSpacing): void;
1817
+
1557
1818
  export declare function setSecondaryCariesMode(value: SecondaryCariesMode): void;
1558
1819
 
1820
+ /** Set the selection-ring border style. Sanitizes to the literal set; no-op (does not notify) if unchanged. */
1821
+ export declare function setSelectionBorderStyle(value: SelectionBorderStyle): void;
1822
+
1823
+ /** Set the selection-ring colour. Anything but a `#rrggbb` hex is ignored; no-op (does not notify) if unchanged. */
1824
+ export declare function setSelectionColor(value: string): void;
1825
+
1559
1826
  /** Toggle visibility of the bone/gum base layer on all teeth. */
1560
1827
  export declare function setShowBase(on: Any): void;
1561
1828
 
@@ -1649,11 +1916,30 @@ declare type SettingsState = {
1649
1916
  onPdfSettings: (patch: Partial<PdfSettings>) => void;
1650
1917
  };
1651
1918
 
1652
- /** Switch the tooth-anatomy profile. No-op (does not notify) if unchanged.
1653
- * Invalidates the perio-chart template cache so that chart re-parses the new
1654
- * profile's templates on its next load (the odontogram grid is rebuilt by the
1655
- * caller via `rebuildGrid()`). */
1656
- export declare function setToothAnatomy(v: ToothAnatomy): void;
1919
+ /** Switch the tooth-anatomy profile, and rebuild the chart onto it.
1920
+ *
1921
+ * ASYNC since 2.7.0: the measured artwork is code-split, so selecting it first
1922
+ * awaits its chunk — the profile is always loaded before the flag flips, which
1923
+ * keeps `activeAnatomyProfile()` synchronous for every render path. The grid is
1924
+ * then rebuilt HERE (a no-op until `initOdontogram()`), so the pre-2.7.0
1925
+ * `setToothAnatomy(v); rebuildGrid();` idiom stays correct without awaiting:
1926
+ * the caller's own rebuild may run early on the old profile, and this one puts
1927
+ * the grid right once the profile is in place.
1928
+ *
1929
+ * No-op (does not notify) when the profile is already selected or already on
1930
+ * its way in. Never rejects: a chunk that fails to load is reported on the
1931
+ * console and leaves the current profile selected, so an un-awaited call can
1932
+ * never raise an unhandled rejection in a host app. Also invalidates the
1933
+ * perio-chart template cache so that chart re-parses the new profile's
1934
+ * templates on its next load.
1935
+ *
1936
+ * `notifyStateChange()` fires only AFTER the rebuild, so a subscriber (the
1937
+ * React context mirrors this flag into `data-anatomy`) can never style a grid
1938
+ * that is still drawn on the other profile. */
1939
+ export declare function setToothAnatomy(v: ToothAnatomy): Promise<void>;
1940
+
1941
+ /** Show or hide the tooth-information panel. No-op (does not notify) if unchanged. */
1942
+ export declare function setToothInfoVisible(value: boolean): void;
1657
1943
 
1658
1944
  /** Base tooth picker on the current selection — wraps the exact `#toothSelect`
1659
1945
  * closure `wireControls()` bound (the `defaultState()` reset with the milk-block