react-advanced-odontogram 2.0.2 → 2.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.
- package/README.md +38 -1335
- package/dist/index.d.ts +716 -4
- package/dist/odontogram.js +3209 -2398
- package/dist/odontogram.js.map +1 -1
- package/package.json +7 -8
- package/dist/App.d.ts +0 -148
- package/dist/DualStateConfirm.d.ts +0 -25
- package/dist/ExportOptionsModal.d.ts +0 -26
- package/dist/PerioChart.d.ts +0 -67
- package/dist/PerioSidebar.d.ts +0 -1
- package/dist/SettingsModal.d.ts +0 -84
- package/dist/bridgeOverlay.d.ts +0 -116
- package/dist/fhir/codesystems.d.ts +0 -51
- package/dist/fhir/fieldMappings.d.ts +0 -35
- package/dist/fhir/fromFhir.d.ts +0 -7
- package/dist/fhir/primitives.d.ts +0 -16
- package/dist/fhir/toFhir.d.ts +0 -20
- package/dist/fhir/toFhirPerio.d.ts +0 -70
- package/dist/fhir/types.d.ts +0 -108
- package/dist/i18n/translations.d.ts +0 -27
- package/dist/i18n/useI18n.d.ts +0 -39
- package/dist/odontogram.d.ts +0 -1214
- package/dist/perioClassification.d.ts +0 -90
- package/dist/perioExport.d.ts +0 -13
- package/dist/perioGraphic.d.ts +0 -496
- package/dist/perioIndexNames.d.ts +0 -29
- package/dist/perioPdf.d.ts +0 -77
- package/dist/plugin.d.ts +0 -63
- package/dist/registry/axes.d.ts +0 -9
- package/dist/registry/fhir.d.ts +0 -3
- package/dist/registry/fromFhir.d.ts +0 -3
- package/dist/registry/restorations.d.ts +0 -26
- package/dist/registry/svgActivate.d.ts +0 -15
- package/dist/registry/svgLayers.d.ts +0 -14
- package/dist/registry/types.d.ts +0 -70
- package/dist/registry/uiOptions.d.ts +0 -17
- package/dist/registry/validate.d.ts +0 -4
- package/dist/status_extras.d.ts +0 -58
- package/dist/theme.d.ts +0 -51
- package/dist/tour.d.ts +0 -9
- package/dist/utils/numbering.d.ts +0 -23
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,716 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** User accepted the divergence: run the deferred edit (status only — the plan
|
|
4
|
+
* stays as planned), then notify (post-edit refresh + close the modal). No-op
|
|
5
|
+
* when nothing is pending. */
|
|
6
|
+
export declare function acceptDualStateConfirm(): void;
|
|
7
|
+
|
|
8
|
+
declare type Any = any;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Root React component for the Odontogram Editor.
|
|
12
|
+
*
|
|
13
|
+
* Renders the full dental chart UI: top bar with language/numbering/dark-mode
|
|
14
|
+
* controls, the SVG tooth grid, and the right-hand control panel for setting
|
|
15
|
+
* tooth states (caries, fillings, crowns, endo, inflammation, etc.).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // Standalone usage
|
|
20
|
+
* <App />
|
|
21
|
+
*
|
|
22
|
+
* // Controlled by a host application
|
|
23
|
+
* <App
|
|
24
|
+
* language="en"
|
|
25
|
+
* onLanguageChange={setLang}
|
|
26
|
+
* numberingSystem="FDI"
|
|
27
|
+
* onNumberingChange={setNumbering}
|
|
28
|
+
* darkMode={isDark}
|
|
29
|
+
* onDarkModeChange={setDark}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare function App({ language, onLanguageChange, numberingSystem, onNumberingChange, darkMode, onDarkModeChange, themeConfig, plugins, readOnly: readOnlyProp, enableNotes, enableIcdas, pulpDetailLevel, secondaryCariesMode, rootCariesMode, radiographicDepthMode, cariesDepthEnabled, wearDetailLevel, discolorationDetailLevel, surfaceNotation, showStatusCard: showStatusCardProp, showOrthoCard: showOrthoCardProp, }: AppProps): JSX_2.Element;
|
|
34
|
+
export { App as OdontogramShell }
|
|
35
|
+
export default App;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Props for the main Odontogram application component.
|
|
39
|
+
*
|
|
40
|
+
* All props are optional — when omitted, the component operates in
|
|
41
|
+
* **standalone** mode with internal state. When provided, the component
|
|
42
|
+
* operates in **controlled** mode and delegates state to the parent.
|
|
43
|
+
*/
|
|
44
|
+
declare type AppProps = {
|
|
45
|
+
/** Override the UI language (controlled mode). */
|
|
46
|
+
language?: Language;
|
|
47
|
+
/** Callback when the user changes the language. */
|
|
48
|
+
onLanguageChange?: (lang: Language) => void;
|
|
49
|
+
/** Override the tooth numbering system (controlled mode). */
|
|
50
|
+
numberingSystem?: NumberingSystem;
|
|
51
|
+
/** Callback when the user changes the numbering system. */
|
|
52
|
+
onNumberingChange?: (system: NumberingSystem) => void;
|
|
53
|
+
/** Override dark mode state (controlled mode). */
|
|
54
|
+
darkMode?: boolean;
|
|
55
|
+
/** Callback when the user toggles dark mode. */
|
|
56
|
+
onDarkModeChange?: (dark: boolean) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Custom theme configuration. Overrides the default color palette via
|
|
59
|
+
* CSS custom properties (`--odon-*`). See {@link OdontogramThemeConfig}.
|
|
60
|
+
*/
|
|
61
|
+
themeConfig?: OdontogramThemeConfig;
|
|
62
|
+
/**
|
|
63
|
+
* Custom SVG plugins for extending the odontogram with additional visual
|
|
64
|
+
* overlays and per-tooth custom state. See {@link OdontogramPlugin}.
|
|
65
|
+
*/
|
|
66
|
+
plugins?: OdontogramPlugin[];
|
|
67
|
+
/**
|
|
68
|
+
* When true, disables all interactions (click, touch, keyboard).
|
|
69
|
+
* Useful for print/report/view modes.
|
|
70
|
+
*/
|
|
71
|
+
readOnly?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* When true, enables per-tooth notes. Double-click a tooth to add/edit a note.
|
|
74
|
+
* Notes are shown in hover tooltips and included in JSON export/import.
|
|
75
|
+
*/
|
|
76
|
+
enableNotes?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Enable ICDAS II per-surface caries scoring (0–6). When enabled, the depth
|
|
79
|
+
* selector/popup expose ICDAS codes 1–6 and the surface indicator shows a
|
|
80
|
+
* numeric badge; otherwise the 3-level scale is used.
|
|
81
|
+
*/
|
|
82
|
+
enableIcdas?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Pulp-diagnosis detail level for the pulp control:
|
|
85
|
+
* `"simple"` (healthy / pulpitis), `"aae"` (4 AAE pulp diagnoses, default) or
|
|
86
|
+
* `"latin"` (9 practical-Latin subtypes). A stored value round-trips at every
|
|
87
|
+
* level; the level only governs how the pulp control presents it.
|
|
88
|
+
*/
|
|
89
|
+
pulpDetailLevel?: PulpDetailLevel;
|
|
90
|
+
/**
|
|
91
|
+
* Secondary-caries (CARS) granularity for the per-surface score picker:
|
|
92
|
+
* `"simple"` ([0,3]), `"standard"` ([0,1,3,6], default) or `"full"` ([0..6]).
|
|
93
|
+
* A stored score round-trips at every mode; the mode only governs the offered
|
|
94
|
+
* option list. (The mode UI lives in the Settings modal; this prop is the
|
|
95
|
+
* controlled entry point.)
|
|
96
|
+
*/
|
|
97
|
+
secondaryCariesMode?: SecondaryCariesMode;
|
|
98
|
+
/**
|
|
99
|
+
* Root-caries granularity for the per-tooth picker: `"simple"` (none /
|
|
100
|
+
* present, default) or `"severity"` (the full none/active/arrested/
|
|
101
|
+
* active-cavitated enum). Non-collapsing across modes.
|
|
102
|
+
*/
|
|
103
|
+
rootCariesMode?: RootCariesMode;
|
|
104
|
+
/**
|
|
105
|
+
* Radiographic-depth granularity for the per-surface picker: `"off"`
|
|
106
|
+
* (hidden, default), `"threeLevel"` (superficial/middle/deep) or `"detailed"`
|
|
107
|
+
* (E1..D3). When off, the per-surface radiographic badge is not shown.
|
|
108
|
+
*/
|
|
109
|
+
radiographicDepthMode?: RadiographicDepthMode;
|
|
110
|
+
/**
|
|
111
|
+
* Whether the visual caries-depth encoding (per-surface depth picker + the
|
|
112
|
+
* opacity/contour depth tier in the render) is active. Default `true`; set
|
|
113
|
+
* `false` to render caried surfaces at the SVG default with no depth tier.
|
|
114
|
+
*/
|
|
115
|
+
cariesDepthEnabled?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Detail level for the per-tooth wear control: `"simple"` (yes/no toggle for
|
|
118
|
+
* attrition) or `"complex"` (wear type per edge and cervix, default).
|
|
119
|
+
*/
|
|
120
|
+
wearDetailLevel?: ToothDetailLevel;
|
|
121
|
+
/**
|
|
122
|
+
* Detail level for the per-tooth discoloration control: `"simple"` (yes/no
|
|
123
|
+
* toggle) or `"complex"` (choose the discoloration cause, default).
|
|
124
|
+
*/
|
|
125
|
+
discolorationDetailLevel?: ToothDetailLevel;
|
|
126
|
+
/**
|
|
127
|
+
* Surface-notation mode for caries/filling surface letters + captions:
|
|
128
|
+
* `"full"` (default) makes them position-aware (incisal on an anterior
|
|
129
|
+
* tooth, labial on an anterior buccal surface, palatal on an upper lingual
|
|
130
|
+
* surface) or `"simple"` (always the tooth-independent B/O/L set).
|
|
131
|
+
*/
|
|
132
|
+
surfaceNotation?: SurfaceNotation;
|
|
133
|
+
/**
|
|
134
|
+
* Whether the Statuses panel (`#statusCard`) is shown. Default `true`. The
|
|
135
|
+
* panel visibility is a settings-driven wrapper around the section — the
|
|
136
|
+
* section's own imperative collapse/expand behavior is unaffected.
|
|
137
|
+
*/
|
|
138
|
+
showStatusCard?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Whether the Orthodontics panel (`#orthoCard`) is shown. Default `true`.
|
|
141
|
+
* Composes with the panel's own imperative ortho-eligibility gate (hidden
|
|
142
|
+
* when no selected tooth is ortho-eligible) — both must be satisfied for
|
|
143
|
+
* the panel to render.
|
|
144
|
+
*/
|
|
145
|
+
showOrthoCard?: boolean;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/** User cancelled: do NOT apply the edit; re-sync the active tooth's controls
|
|
149
|
+
* from stored state so the control the user just changed snaps back (no stale
|
|
150
|
+
* UI), then notify (refresh + close the modal). No-op when nothing is pending. */
|
|
151
|
+
export declare function cancelDualStateConfirm(): void;
|
|
152
|
+
|
|
153
|
+
declare type ChartMode = "status" | "plan";
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Clear the current tooth selection and reset the active tooth. Useful when
|
|
157
|
+
* switching to view or quote-builder mode from the host application.
|
|
158
|
+
*/
|
|
159
|
+
export declare function clearSelection(): void;
|
|
160
|
+
|
|
161
|
+
/** Close the perio-chart overlay. No-op (still notifies) if already closed. */
|
|
162
|
+
export declare function closePerioOverlay(): void;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Tear down the odontogram engine: clear all DOM elements built by the engine,
|
|
166
|
+
* unsubscribe from i18n changes, and reset internal state. After this call,
|
|
167
|
+
* {@link initOdontogram} may be called again to re-initialise.
|
|
168
|
+
*/
|
|
169
|
+
export declare function destroyOdontogram(): void;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Export the current odontogram as an HL7 FHIR R4 collection Bundle (JSON).
|
|
173
|
+
* @param options - Optional subject reference (e.g. "Patient/123"); when
|
|
174
|
+
* omitted a placeholder Patient is embedded.
|
|
175
|
+
*/
|
|
176
|
+
export declare function exportFhir(options?: FhirExportOptions): void;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Export the odontogram as PNG or JPG. Renders the serialized SVG via the
|
|
180
|
+
* browser's native rasterizer (Image → canvas) — much faster than the previous
|
|
181
|
+
* html2canvas DOM rasterization, and sharper.
|
|
182
|
+
*/
|
|
183
|
+
export declare function exportImage(format?: "png" | "jpg"): Promise<void>;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* UI-3b Task 6: assemble a printable PDF report (jsPDF-native — vector text
|
|
187
|
+
* + raster chart PNGs, no svg2pdf.js). Gathers all `data` (SVG→PNG
|
|
188
|
+
* rasterization via {@link rasterizeSvgToPng}, summary/classification text,
|
|
189
|
+
* `hasAnyPerioData()`), drives the export-progress overlay, then hands off
|
|
190
|
+
* to the PURE `assemblePdf()` (`src/perioPdf.ts`), which decides section
|
|
191
|
+
* layout from `opts`/`data` alone.
|
|
192
|
+
*
|
|
193
|
+
* jsPDF-in-jsdom note: constructing a real `jsPDF` instance depends on
|
|
194
|
+
* browser canvas/font internals jsdom doesn't fully provide, so this
|
|
195
|
+
* wrapper is NOT unit-tested directly — `assemblePdf`'s section-gating IS
|
|
196
|
+
* thoroughly unit-tested with an injectable fake doc (see
|
|
197
|
+
* `ui3b-export-pdf.test.ts`). This wrapper's own raster→layout→save path is
|
|
198
|
+
* a browser-verify item (see the task report).
|
|
199
|
+
*/
|
|
200
|
+
export declare function exportPdf(opts: PdfExportOptions): Promise<void>;
|
|
201
|
+
|
|
202
|
+
/** UI-3b: export the full perio chart as PNG/JPG (SVG → canvas @2×, via the
|
|
203
|
+
* shared {@link rasterizeSvgToCanvas} raster core). */
|
|
204
|
+
export declare function exportPerioImage(format?: "png" | "jpg"): Promise<void>;
|
|
205
|
+
|
|
206
|
+
/** UI-3b: export the full perio chart as a standalone vector SVG file. */
|
|
207
|
+
export declare function exportPerioSvg(): Promise<void>;
|
|
208
|
+
|
|
209
|
+
export declare function exportStatus(): void;
|
|
210
|
+
|
|
211
|
+
/** Export the odontogram as a downloadable, scalable SVG file. */
|
|
212
|
+
export declare function exportSvg(): Promise<void>;
|
|
213
|
+
|
|
214
|
+
/** Options for buildFhirBundle / exportFhir. */
|
|
215
|
+
export declare interface FhirExportOptions {
|
|
216
|
+
/**
|
|
217
|
+
* FHIR reference string for the subject, e.g. "Patient/123".
|
|
218
|
+
* When omitted, a placeholder Patient resource is added to the Bundle and
|
|
219
|
+
* referenced by every Observation.
|
|
220
|
+
*/
|
|
221
|
+
subject?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Formats a tooth number for display using the active numbering system AND
|
|
225
|
+
* the milktooth display-remap ({@link getDisplayedToothNumber}) — the exact
|
|
226
|
+
* same formatting {@link getOdontogramSummary} uses for every tooth number
|
|
227
|
+
* it prints (permanent/missing lists, per-section entries, implants). Exported
|
|
228
|
+
* so the "What changes" box in App.tsx can label a {@link PlanChange.toothNo}
|
|
229
|
+
* identically, without duplicating the numbering/milktooth logic. */
|
|
230
|
+
export declare function formatToothLabel(toothNo: number): string;
|
|
231
|
+
|
|
232
|
+
export declare function getCariesDepthEnabled(): boolean;
|
|
233
|
+
|
|
234
|
+
/** Current active chart mode ("status" | "plan"). */
|
|
235
|
+
export declare function getChartMode(): ChartMode;
|
|
236
|
+
|
|
237
|
+
export declare function getDiscolorationDetailLevel(): ToothDetailLevel;
|
|
238
|
+
|
|
239
|
+
export declare function getIcdasEnabled(): boolean;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Get the current notes-enabled state.
|
|
243
|
+
*/
|
|
244
|
+
export declare function getNotesEnabled(): boolean;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Build a human-readable, localized summary of the current odontogram state:
|
|
248
|
+
* tooth counts, present/missing lists, and caries / fillings / endo /
|
|
249
|
+
* prosthetics / periodontal sections. Numbers respect the active numbering
|
|
250
|
+
* system. Intended for the optional "tooth information" panel; call
|
|
251
|
+
* {@link onStateChange} to refresh it on edits.
|
|
252
|
+
*/
|
|
253
|
+
export declare function getOdontogramSummary(): OdontogramSummary;
|
|
254
|
+
|
|
255
|
+
/** Current perio index-name display mode. Defaults to `"translated"`. */
|
|
256
|
+
export declare function getPerioIndexNameMode(): PerioIndexNameMode;
|
|
257
|
+
|
|
258
|
+
/** Current per-index perio-chart row visibility. Defaults to all-visible. */
|
|
259
|
+
export declare function getPerioRowVisibility(): Record<PerioRowId, boolean>;
|
|
260
|
+
|
|
261
|
+
/** Current perio-chart housing mode. Defaults to `"toggle"`. */
|
|
262
|
+
export declare function getPerioViewMode(): PerioViewMode;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Compare the "status" chart against the "plan" chart, tooth by tooth and
|
|
266
|
+
* axis by axis (see {@link DIFF_AXES}), and report every axis whose label
|
|
267
|
+
* differs. Pure and read-only: never mutates either chart, never touches the
|
|
268
|
+
* DOM, never renders — a `parity.test.ts`-safe addition.
|
|
269
|
+
*
|
|
270
|
+
* Returns `[]` whenever the plan chart hasn't been initialized yet (no plan
|
|
271
|
+
* exists to diff against). A tooth absent from either chart resolves via
|
|
272
|
+
* `defaultState()`, so a status-only or plan-only tooth still diffs correctly
|
|
273
|
+
* against the clinical default rather than throwing.
|
|
274
|
+
*
|
|
275
|
+
* Iterates the fixed `ALL_TEETH` list (not chart key insertion order), so
|
|
276
|
+
* results are always grouped by tooth in the same stable clinical order the
|
|
277
|
+
* rest of the app already uses (quadrant-by-quadrant); within a tooth,
|
|
278
|
+
* entries follow `DIFF_AXES` order.
|
|
279
|
+
*/
|
|
280
|
+
export declare function getPlanChanges(): PlanChange[];
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Export the PLAN chart's payload alone: same shape as the status export
|
|
284
|
+
* (`{version, globals, teeth}`), but `teeth` is collected from `charts.plan`.
|
|
285
|
+
* `globals` are shared app-level settings, not owned by either chart.
|
|
286
|
+
*/
|
|
287
|
+
export declare function getPlanChart(): Any;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Get a plugin's custom state for a specific tooth.
|
|
291
|
+
*
|
|
292
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
293
|
+
* @param pluginId - The plugin's unique identifier.
|
|
294
|
+
* @returns The custom state value, or `undefined` if not set.
|
|
295
|
+
*/
|
|
296
|
+
export declare function getPluginState(toothNo: number, pluginId: string): unknown;
|
|
297
|
+
|
|
298
|
+
export declare function getPulpDetailLevel(): PulpDetailLevel;
|
|
299
|
+
|
|
300
|
+
export declare function getRadiographicDepthMode(): RadiographicDepthMode;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Get the current read-only mode state.
|
|
304
|
+
*/
|
|
305
|
+
export declare function getReadOnly(): boolean;
|
|
306
|
+
|
|
307
|
+
export declare function getRootCariesMode(): RootCariesMode;
|
|
308
|
+
|
|
309
|
+
export declare function getSecondaryCariesMode(): SecondaryCariesMode;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Export the STATUS chart's payload — identical to exportStatus()'s JSON
|
|
313
|
+
* (status-primary; unaffected by the current chart mode).
|
|
314
|
+
*/
|
|
315
|
+
export declare function getStatusChart(): Any;
|
|
316
|
+
|
|
317
|
+
export declare function getSurfaceNotation(): SurfaceNotation;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Get a human-readable summary of all active states for a tooth.
|
|
321
|
+
* Useful for building custom tooltip or info-panel UIs.
|
|
322
|
+
*
|
|
323
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
324
|
+
* @returns Array of localized state description strings.
|
|
325
|
+
*/
|
|
326
|
+
export declare function getToothStateSummary(toothNo: number): string[];
|
|
327
|
+
|
|
328
|
+
export declare function getWearDetailLevel(): ToothDetailLevel;
|
|
329
|
+
|
|
330
|
+
/** UI-3b: true iff ANY periodontal axis has been charted anywhere in the
|
|
331
|
+
* mouth. Used to auto-skip the perio section of an export and to disable the
|
|
332
|
+
* perio image-export menu items on a blank chart. Derived entirely from
|
|
333
|
+
* `getPerioSummary()` — no new traversal. */
|
|
334
|
+
export declare function hasAnyPerioData(): boolean;
|
|
335
|
+
|
|
336
|
+
export declare function importStatus(data: Any): void;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Initialise the odontogram engine: wire up DOM controls, build the SVG tooth
|
|
340
|
+
* grid, and start listening for i18n changes. Safe to call multiple times
|
|
341
|
+
* (subsequent calls are no-ops).
|
|
342
|
+
*/
|
|
343
|
+
export declare function initOdontogram(): Promise<void>;
|
|
344
|
+
|
|
345
|
+
/** Whether a status-vs-plan divergence confirm is awaiting the user's choice. */
|
|
346
|
+
export declare function isDualStateConfirmPending(): boolean;
|
|
347
|
+
|
|
348
|
+
/** Whether the perio-chart overlay is currently open. */
|
|
349
|
+
export declare function isPerioOverlayOpen(): boolean;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Supported UI languages.
|
|
353
|
+
*
|
|
354
|
+
* | Code | Language |
|
|
355
|
+
* |-------|-----------------------|
|
|
356
|
+
* | hu | Hungarian |
|
|
357
|
+
* | en | English |
|
|
358
|
+
* | de | German |
|
|
359
|
+
* | es | Spanish |
|
|
360
|
+
* | it | Italian |
|
|
361
|
+
* | sk | Slovak |
|
|
362
|
+
* | pl | Polish |
|
|
363
|
+
* | ru | Russian |
|
|
364
|
+
* | pt-br | Portuguese (Brazil) |
|
|
365
|
+
* | zh | Chinese (Simplified) |
|
|
366
|
+
* | ar | Arabic (RTL — UI mirrors, dental/perio charts pinned LTR) |
|
|
367
|
+
* | fr | French |
|
|
368
|
+
*/
|
|
369
|
+
declare type Language = "hu" | "en" | "de" | "es" | "it" | "sk" | "pl" | "ru" | "pt-br" | "zh" | "ar" | "fr";
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Supported tooth numbering systems.
|
|
373
|
+
* - **FDI** – ISO 3950 two-digit notation (default in most countries).
|
|
374
|
+
* - **UNIVERSAL** – ADA numbering (1-32 adult, A-T primary).
|
|
375
|
+
* - **PALMER** – Quadrant-based notation (UR/UL/LL/LR + position).
|
|
376
|
+
*/
|
|
377
|
+
declare type NumberingSystem = "FDI" | "UNIVERSAL" | "PALMER";
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Custom SVG plugin definition for the Odontogram engine.
|
|
381
|
+
*
|
|
382
|
+
* Plugins can inject custom SVG content into each tooth's rendering and
|
|
383
|
+
* maintain per-tooth custom state that is automatically included in
|
|
384
|
+
* JSON export/import.
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* ```typescript
|
|
388
|
+
* const implantBrandPlugin: OdontogramPlugin = {
|
|
389
|
+
* id: "implant-brand",
|
|
390
|
+
* label: { hu: "Implantátum márka", en: "Implant brand", de: "Implantat-Marke", ... },
|
|
391
|
+
* layer: "overlay",
|
|
392
|
+
* renderSvg: (toothNo, _quadrant, customState) => {
|
|
393
|
+
* if (!customState?.brand) return null;
|
|
394
|
+
* return `<text x="16" y="60" font-size="6" fill="#3b7bff">${customState.brand}</text>`;
|
|
395
|
+
* },
|
|
396
|
+
* };
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
export declare type OdontogramPlugin = {
|
|
400
|
+
/** Unique plugin identifier (used as key in customStates). */
|
|
401
|
+
id: string;
|
|
402
|
+
/** Localized display label for the plugin (shown in the state tooltip). */
|
|
403
|
+
label: Partial<Record<Language, string>>;
|
|
404
|
+
/**
|
|
405
|
+
* SVG layer where this plugin's output will be rendered.
|
|
406
|
+
* @see {@link PluginLayer}
|
|
407
|
+
*/
|
|
408
|
+
layer: PluginLayer;
|
|
409
|
+
/**
|
|
410
|
+
* Render SVG markup for a specific tooth. Return an SVG fragment string
|
|
411
|
+
* (will be wrapped in a `<g>` element) or `null`/`undefined` to render nothing.
|
|
412
|
+
*
|
|
413
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
414
|
+
* @param quadrant - The quadrant (1–4) derived from the tooth number.
|
|
415
|
+
* @param customState - The plugin's custom state for this tooth, or `undefined`.
|
|
416
|
+
*/
|
|
417
|
+
renderSvg: (toothNo: number, quadrant: 1 | 2 | 3 | 4, customState: unknown) => string | null | undefined;
|
|
418
|
+
/**
|
|
419
|
+
* Optional: which panel section this plugin adds controls to.
|
|
420
|
+
* When set to `"custom"`, the engine will render a dedicated panel
|
|
421
|
+
* section for the plugin (future expansion).
|
|
422
|
+
*/
|
|
423
|
+
panelSection?: "custom";
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
/** Structured, already-localized textual summary of the whole odontogram. */
|
|
427
|
+
export declare type OdontogramSummary = {
|
|
428
|
+
overview: string;
|
|
429
|
+
permanentList: string | null;
|
|
430
|
+
missingList: string | null;
|
|
431
|
+
sections: OdontogramSummarySection[];
|
|
432
|
+
/** Implants heading + list — only present when at least one implant exists. */
|
|
433
|
+
implants: {
|
|
434
|
+
heading: string;
|
|
435
|
+
text: string;
|
|
436
|
+
} | null;
|
|
437
|
+
periodontalTitle: string;
|
|
438
|
+
periodontalText: string;
|
|
439
|
+
/** R2-B Task 2: the status->plan diff (see {@link getPlanChanges}), verbatim.
|
|
440
|
+
* `[]` whenever the plan chart hasn't been initialized or plan === status —
|
|
441
|
+
* a distinct field, not a section, since it's a diff rather than a status
|
|
442
|
+
* list. The "What changes" box in App.tsx renders from this field only
|
|
443
|
+
* when it's non-empty. */
|
|
444
|
+
plannedChanges: PlanChange[];
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
/** One heading + its per-tooth entries in the tooth-information summary. */
|
|
448
|
+
export declare type OdontogramSummarySection = {
|
|
449
|
+
key: "caries" | "fillings" | "endo" | "diagnoses" | "wear" | "discoloration" | "orthodontics" | "prosthetics";
|
|
450
|
+
heading: string;
|
|
451
|
+
items: string[];
|
|
452
|
+
/** Localized "no such tooth" sentence, shown when `items` is empty. */
|
|
453
|
+
emptyText: string;
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Theme configuration for the Odontogram component.
|
|
458
|
+
*
|
|
459
|
+
* Allows host applications to override the default color palette without
|
|
460
|
+
* modifying CSS files. All properties are optional — only the provided
|
|
461
|
+
* values are overridden; the rest fall back to the built-in defaults.
|
|
462
|
+
*
|
|
463
|
+
* Colors are applied as CSS custom properties (`--odon-*`) on the
|
|
464
|
+
* component root element, so they work regardless of whether the host
|
|
465
|
+
* uses Tailwind CSS or plain CSS.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```tsx
|
|
469
|
+
* const myTheme: OdontogramThemeConfig = {
|
|
470
|
+
* colors: {
|
|
471
|
+
* accent: '#e74c3c',
|
|
472
|
+
* background: '#fafafa',
|
|
473
|
+
* },
|
|
474
|
+
* };
|
|
475
|
+
* <App themeConfig={myTheme} />
|
|
476
|
+
* ```
|
|
477
|
+
*/
|
|
478
|
+
export declare type OdontogramThemeConfig = {
|
|
479
|
+
colors?: {
|
|
480
|
+
/** Primary background. Default: `#f3f6fb` (light) / `#0f172a` (dark). */
|
|
481
|
+
background?: string;
|
|
482
|
+
/** Panel & card background. Default: `#ffffff` (light) / `#1e293b` (dark). */
|
|
483
|
+
panel?: string;
|
|
484
|
+
/** Card background. Default: same as panel. */
|
|
485
|
+
card?: string;
|
|
486
|
+
/** Primary text color. Default: `#1e2a3a` (light) / `#f1f5f9` (dark). */
|
|
487
|
+
text?: string;
|
|
488
|
+
/** Muted / secondary text color. Default: `#5b6b7d` (light) / `#94a3b8` (dark). */
|
|
489
|
+
muted?: string;
|
|
490
|
+
/** Border / divider color. Default: `#d7e0ec` (light) / `#334155` (dark). */
|
|
491
|
+
line?: string;
|
|
492
|
+
/** Primary accent (buttons, active states). Default: `#3b7bff`. */
|
|
493
|
+
accent?: string;
|
|
494
|
+
/** Secondary accent (success, selected states). Default: `#12b981`. */
|
|
495
|
+
accent2?: string;
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Subscribe to odontogram state changes. The callback runs after any tooth
|
|
501
|
+
* state edit, the edentulous toggle, or an import.
|
|
502
|
+
*
|
|
503
|
+
* @param cb - Callback invoked on each change.
|
|
504
|
+
* @returns An unsubscribe function.
|
|
505
|
+
*/
|
|
506
|
+
export declare function onStateChange(cb: () => void): () => void;
|
|
507
|
+
|
|
508
|
+
/** Open the perio-chart overlay. No-op (still notifies) if already open. */
|
|
509
|
+
export declare function openPerioOverlay(): void;
|
|
510
|
+
|
|
511
|
+
/** UI-3b Task 6/7: which PDF sections the user opted into. The perio
|
|
512
|
+
* sections are additionally auto-skipped whenever `data.hasPerio` is false
|
|
513
|
+
* (see {@link assemblePdf}), regardless of these flags — a blank perio
|
|
514
|
+
* chart never gets an empty "Periodontal status" page. */
|
|
515
|
+
declare interface PdfExportOptions {
|
|
516
|
+
patientData: boolean;
|
|
517
|
+
odontogram: boolean;
|
|
518
|
+
perioStatus: boolean;
|
|
519
|
+
perioDescription: boolean;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Full-screen perio-chart overlay (periodontal-arc sub-project P2). Task 1
|
|
524
|
+
* shipped the shell (dialog contract, open/close API) with an empty
|
|
525
|
+
* `#perioOverlayGrid` placeholder; THIS task (Task 2) fills it with the full-mouth
|
|
526
|
+
* grid + a summary bar, bound to the P1 data core
|
|
527
|
+
* (`setPerioSite`/`getToothPerio`/`getToothCal`/`getPerioSummary`/
|
|
528
|
+
* `getPerioChart`). Keyboard auto-advance between cells is Task 3 — plain
|
|
529
|
+
* `change` listeners are enough here.
|
|
530
|
+
*
|
|
531
|
+
* The 32-tooth x 6-site grid (~450+ interactive cells) is built with plain
|
|
532
|
+
* DOM (`buildArch`), NOT JSX/React state, and updated via targeted
|
|
533
|
+
* `syncToothCells` calls rather than a full React re-render (R3 perf) — see
|
|
534
|
+
* `syncOneTooth`/`fullResync` below. Only the compact summary bar is
|
|
535
|
+
* React-controlled (`useState`), since re-rendering ~4 numbers on every edit
|
|
536
|
+
* is cheap. `suppressResyncRef` prevents the grid's own edits from ALSO
|
|
537
|
+
* triggering a redundant full resync via the `onStateChange` subscription
|
|
538
|
+
* (setPerioSite/setToothMobility both fire it synchronously) — external
|
|
539
|
+
* edits (dual-state chart-mode switch, or another consumer editing perio
|
|
540
|
+
* data while the overlay is open) still trigger the full resync normally.
|
|
541
|
+
*
|
|
542
|
+
* Layers OVER the odontogram, which it never unmounts: `position: fixed`,
|
|
543
|
+
* full-screen, high z-index (`.perio-overlay` in `index.css`). Mirrors
|
|
544
|
+
* `SettingsModal`'s dialog contract — `role="dialog"` + `aria-modal`, Esc
|
|
545
|
+
* closes, backdrop click closes, focus trap + focus-restore on close — on a
|
|
546
|
+
* single element (`#perioOverlay` itself is the dialog; there is no separate
|
|
547
|
+
* backdrop element, unlike `SettingsModal`).
|
|
548
|
+
*
|
|
549
|
+
* **"Dental Chart" graphical redesign, Task 1 (presentation only):** the
|
|
550
|
+
* optional `inline` prop selects a second chrome for the SAME body (grid +
|
|
551
|
+
* summary bar) — a plain panel (`#perioInlinePanel`) meant to fill the chart
|
|
552
|
+
* area in place of the hidden-but-mounted odontogram, instead of the
|
|
553
|
+
* fixed-position modal dialog. `open`/`onClose` are the MODAL chrome's
|
|
554
|
+
* contract and are ignored when `inline` is true (the caller controls
|
|
555
|
+
* mount/unmount of an inline instance directly via conditional rendering,
|
|
556
|
+
* the same way any other React content area would be swapped) — there is
|
|
557
|
+
* nothing to "close" in an embedded panel. Dialog-only concerns (focus
|
|
558
|
+
* trap/restore, Esc-to-close, backdrop click, `role="dialog"`) do not apply
|
|
559
|
+
* to the inline chrome at all.
|
|
560
|
+
*/
|
|
561
|
+
export declare function PerioChart({ open, onClose, inline, }: {
|
|
562
|
+
open?: boolean;
|
|
563
|
+
onClose?: () => void;
|
|
564
|
+
inline?: boolean;
|
|
565
|
+
}): JSX_2.Element;
|
|
566
|
+
|
|
567
|
+
/** How perio-chart index row labels are rendered. */
|
|
568
|
+
export declare type PerioIndexNameMode = "translated" | "canonical";
|
|
569
|
+
|
|
570
|
+
/** The 16 toggleable periodontal index rows the Dental Chart can show/hide. */
|
|
571
|
+
export declare type PerioRowId = "plaque" | "bop" | "cal" | "gm" | "pd" | "furcation" | "mobility" | "cej" | "rootConcavity" | "pi" | "gi" | "mpi" | "mbi" | "kg" | "gt" | "miller";
|
|
572
|
+
|
|
573
|
+
export declare type PerioViewMode = "toggle" | "popup";
|
|
574
|
+
|
|
575
|
+
declare type PlanChange = {
|
|
576
|
+
toothNo: number;
|
|
577
|
+
axis: string;
|
|
578
|
+
from: string;
|
|
579
|
+
to: string;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Defines the SVG layer where a plugin's visual output will be inserted.
|
|
584
|
+
*
|
|
585
|
+
* | Layer | Z-order | Description |
|
|
586
|
+
* |---------------|---------|----------------------------------------|
|
|
587
|
+
* | `base` | 0 | Below the tooth — background indicators |
|
|
588
|
+
* | `restoration` | 3 | Between endo and crown layers |
|
|
589
|
+
* | `overlay` | 6 | Top-most — badges, markers, highlights |
|
|
590
|
+
*/
|
|
591
|
+
export declare type PluginLayer = "base" | "restoration" | "overlay";
|
|
592
|
+
|
|
593
|
+
export declare type PulpDetailLevel = "simple" | "aae" | "latin";
|
|
594
|
+
|
|
595
|
+
export declare type RadiographicDepthMode = "off" | "threeLevel" | "detailed";
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Register one or more custom SVG plugins. Plugins can inject visual overlays
|
|
599
|
+
* into the tooth SVG and maintain per-tooth custom state included in export/import.
|
|
600
|
+
*
|
|
601
|
+
* @param plugins - Array of {@link OdontogramPlugin} definitions.
|
|
602
|
+
*/
|
|
603
|
+
export declare function registerPlugins(plugins: OdontogramPlugin[]): void;
|
|
604
|
+
|
|
605
|
+
export declare type RootCariesMode = "simple" | "severity";
|
|
606
|
+
|
|
607
|
+
export declare type SecondaryCariesMode = "simple" | "standard" | "full";
|
|
608
|
+
|
|
609
|
+
export declare function setCariesDepthEnabled(value: boolean): void;
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Switch the active chart between "status" (current findings) and "plan"
|
|
613
|
+
* (proposed treatment). The first time "plan" is entered, it is deep-cloned
|
|
614
|
+
* from "status" (see {@link cloneChart}); later switches reuse the existing
|
|
615
|
+
* plan chart untouched. Re-renders every tooth from the newly active chart
|
|
616
|
+
* via the SAME full-repaint mechanism `importStatus()` uses, so no new
|
|
617
|
+
* render path is introduced and SVG output stays byte-identical to the
|
|
618
|
+
* single-chart render (parity is unaffected — only WHICH chart is active
|
|
619
|
+
* changes, never how a chart renders).
|
|
620
|
+
*
|
|
621
|
+
* @param mode - "status" or "plan"; any other value is ignored.
|
|
622
|
+
*/
|
|
623
|
+
export declare function setChartMode(mode: ChartMode): void;
|
|
624
|
+
|
|
625
|
+
export declare function setDiscolorationDetailLevel(value: ToothDetailLevel): void;
|
|
626
|
+
|
|
627
|
+
/** Toggle visibility of the healthy-pulp layer on all teeth. */
|
|
628
|
+
export declare function setHealthyPulpVisible(on: Any): void;
|
|
629
|
+
|
|
630
|
+
export declare function setIcdasEnabled(value: boolean): void;
|
|
631
|
+
|
|
632
|
+
/** Set which parser the next file import uses. Defaults back to "status" after each import. */
|
|
633
|
+
export declare function setImportFormat(format: "status" | "fhir"): void;
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Enable or disable per-tooth notes. When enabled, double-clicking a tooth
|
|
637
|
+
* opens a note editor popover, and notes are shown in hover tooltips with
|
|
638
|
+
* a badge indicator.
|
|
639
|
+
*
|
|
640
|
+
* @param value - `true` to enable notes, `false` to disable.
|
|
641
|
+
*/
|
|
642
|
+
export declare function setNotesEnabled(value: boolean): void;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Switch the displayed tooth numbering system and re-render all tooth labels.
|
|
646
|
+
* @param system - The target {@link NumberingSystem}.
|
|
647
|
+
*/
|
|
648
|
+
export declare function setNumberingSystem(system: NumberingSystem): void;
|
|
649
|
+
|
|
650
|
+
/** Toggle visibility of occlusal-view tiles (premolars and molars). */
|
|
651
|
+
export declare function setOcclusalVisible(on: Any): void;
|
|
652
|
+
|
|
653
|
+
/** Switch the perio index-name display mode. No-op (still notifies) if unchanged. */
|
|
654
|
+
export declare function setPerioIndexNameMode(mode: PerioIndexNameMode): void;
|
|
655
|
+
|
|
656
|
+
/** Show/hide one perio-chart index row. No-op (still notifies) if unchanged. */
|
|
657
|
+
export declare function setPerioRowVisibility(id: PerioRowId, visible: boolean): void;
|
|
658
|
+
|
|
659
|
+
/** Switch the perio-chart housing mode. No-op (still notifies) if unchanged. */
|
|
660
|
+
export declare function setPerioViewMode(mode: PerioViewMode): void;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Hydrate `payload.teeth` into the PLAN chart ONLY (status is left
|
|
664
|
+
* untouched), mirroring the per-tooth hydrate importStatus() performs for
|
|
665
|
+
* the status chart. Marks the plan chart initialized. Repaints the DOM only
|
|
666
|
+
* when PLAN is the currently active chart mode — hydrating a chart that
|
|
667
|
+
* isn't on screen must not visibly disturb whatever IS on screen (mirrors
|
|
668
|
+
* setChartMode()'s own full-repaint-on-activation behavior).
|
|
669
|
+
*/
|
|
670
|
+
export declare function setPlanChart(payload: Any): void;
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Set a plugin's custom state for a specific tooth. Triggers SVG re-render
|
|
674
|
+
* for that tooth and updates the tooltip.
|
|
675
|
+
*
|
|
676
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
677
|
+
* @param pluginId - The plugin's unique identifier.
|
|
678
|
+
* @param value - The custom state value (any JSON-serializable value, or `undefined` to clear).
|
|
679
|
+
*/
|
|
680
|
+
export declare function setPluginState(toothNo: number, pluginId: string, value: unknown): void;
|
|
681
|
+
|
|
682
|
+
export declare function setPulpDetailLevel(value: PulpDetailLevel): void;
|
|
683
|
+
|
|
684
|
+
export declare function setRadiographicDepthMode(value: RadiographicDepthMode): void;
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Enable or disable read-only mode. When read-only, all click, touch, and
|
|
688
|
+
* keyboard interactions are disabled. The control panel is dimmed and
|
|
689
|
+
* non-interactive. Useful for print/report views.
|
|
690
|
+
*
|
|
691
|
+
* @param value - `true` to enable read-only mode, `false` to disable.
|
|
692
|
+
*/
|
|
693
|
+
export declare function setReadOnly(value: boolean): void;
|
|
694
|
+
|
|
695
|
+
export declare function setRootCariesMode(value: RootCariesMode): void;
|
|
696
|
+
|
|
697
|
+
export declare function setSecondaryCariesMode(value: SecondaryCariesMode): void;
|
|
698
|
+
|
|
699
|
+
/** Toggle visibility of the bone/gum base layer on all teeth. */
|
|
700
|
+
export declare function setShowBase(on: Any): void;
|
|
701
|
+
|
|
702
|
+
export declare function setSurfaceNotation(value: SurfaceNotation): void;
|
|
703
|
+
|
|
704
|
+
export declare function setWearDetailLevel(value: ToothDetailLevel): void;
|
|
705
|
+
|
|
706
|
+
/** Toggle visibility of wisdom teeth (18, 28, 38, 48). */
|
|
707
|
+
export declare function setWisdomVisible(on: Any): void;
|
|
708
|
+
|
|
709
|
+
/** Start the 12-step interactive intro tour. */
|
|
710
|
+
export declare function startIntroTour(): void;
|
|
711
|
+
|
|
712
|
+
export declare type SurfaceNotation = "simple" | "full";
|
|
713
|
+
|
|
714
|
+
export declare type ToothDetailLevel = "simple" | "complex";
|
|
715
|
+
|
|
716
|
+
export { }
|