react-advanced-odontogram 2.0.2 → 2.1.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 +35 -1336
- package/dist/index.d.ts +581 -4
- package/dist/odontogram.js +932 -931
- 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,581 @@
|
|
|
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
|
+
/**
|
|
154
|
+
* Clear the current tooth selection and reset the active tooth. Useful when
|
|
155
|
+
* switching to view or quote-builder mode from the host application.
|
|
156
|
+
*/
|
|
157
|
+
export declare function clearSelection(): void;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Export the current odontogram as an HL7 FHIR R4 collection Bundle (JSON).
|
|
161
|
+
* @param options - Optional subject reference (e.g. "Patient/123"); when
|
|
162
|
+
* omitted a placeholder Patient is embedded.
|
|
163
|
+
*/
|
|
164
|
+
export declare function exportFhir(options?: FhirExportOptions): void;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Export the odontogram as PNG or JPG. Renders the serialized SVG via the
|
|
168
|
+
* browser's native rasterizer (Image → canvas) — much faster than the previous
|
|
169
|
+
* html2canvas DOM rasterization, and sharper.
|
|
170
|
+
*/
|
|
171
|
+
export declare function exportImage(format?: "png" | "jpg"): Promise<void>;
|
|
172
|
+
|
|
173
|
+
/** Export the odontogram as a downloadable, scalable SVG file. */
|
|
174
|
+
export declare function exportSvg(): Promise<void>;
|
|
175
|
+
|
|
176
|
+
/** Options for buildFhirBundle / exportFhir. */
|
|
177
|
+
export declare interface FhirExportOptions {
|
|
178
|
+
/**
|
|
179
|
+
* FHIR reference string for the subject, e.g. "Patient/123".
|
|
180
|
+
* When omitted, a placeholder Patient resource is added to the Bundle and
|
|
181
|
+
* referenced by every Observation.
|
|
182
|
+
*/
|
|
183
|
+
subject?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Formats a tooth number for display using the active numbering system AND
|
|
187
|
+
* the milktooth display-remap ({@link getDisplayedToothNumber}) — the exact
|
|
188
|
+
* same formatting {@link getOdontogramSummary} uses for every tooth number
|
|
189
|
+
* it prints (permanent/missing lists, per-section entries, implants). Exported
|
|
190
|
+
* so the "What changes" box in App.tsx can label a {@link PlanChange.toothNo}
|
|
191
|
+
* identically, without duplicating the numbering/milktooth logic. */
|
|
192
|
+
export declare function formatToothLabel(toothNo: number): string;
|
|
193
|
+
|
|
194
|
+
export declare function getCariesDepthEnabled(): boolean;
|
|
195
|
+
|
|
196
|
+
export declare function getDiscolorationDetailLevel(): ToothDetailLevel;
|
|
197
|
+
|
|
198
|
+
export declare function getIcdasEnabled(): boolean;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Get the current notes-enabled state.
|
|
202
|
+
*/
|
|
203
|
+
export declare function getNotesEnabled(): boolean;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Build a human-readable, localized summary of the current odontogram state:
|
|
207
|
+
* tooth counts, present/missing lists, and caries / fillings / endo /
|
|
208
|
+
* prosthetics / periodontal sections. Numbers respect the active numbering
|
|
209
|
+
* system. Intended for the optional "tooth information" panel; call
|
|
210
|
+
* {@link onStateChange} to refresh it on edits.
|
|
211
|
+
*/
|
|
212
|
+
export declare function getOdontogramSummary(): OdontogramSummary;
|
|
213
|
+
|
|
214
|
+
/** Current perio index-name display mode. Defaults to `"translated"`. */
|
|
215
|
+
export declare function getPerioIndexNameMode(): PerioIndexNameMode;
|
|
216
|
+
|
|
217
|
+
/** Current per-index perio-chart row visibility. Defaults to all-visible. */
|
|
218
|
+
export declare function getPerioRowVisibility(): Record<PerioRowId, boolean>;
|
|
219
|
+
|
|
220
|
+
/** Current perio-chart housing mode. Defaults to `"toggle"`. */
|
|
221
|
+
export declare function getPerioViewMode(): PerioViewMode;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Get a plugin's custom state for a specific tooth.
|
|
225
|
+
*
|
|
226
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
227
|
+
* @param pluginId - The plugin's unique identifier.
|
|
228
|
+
* @returns The custom state value, or `undefined` if not set.
|
|
229
|
+
*/
|
|
230
|
+
export declare function getPluginState(toothNo: number, pluginId: string): unknown;
|
|
231
|
+
|
|
232
|
+
export declare function getPulpDetailLevel(): PulpDetailLevel;
|
|
233
|
+
|
|
234
|
+
export declare function getRadiographicDepthMode(): RadiographicDepthMode;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Get the current read-only mode state.
|
|
238
|
+
*/
|
|
239
|
+
export declare function getReadOnly(): boolean;
|
|
240
|
+
|
|
241
|
+
export declare function getRootCariesMode(): RootCariesMode;
|
|
242
|
+
|
|
243
|
+
export declare function getSecondaryCariesMode(): SecondaryCariesMode;
|
|
244
|
+
|
|
245
|
+
export declare function getSurfaceNotation(): SurfaceNotation;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Get a human-readable summary of all active states for a tooth.
|
|
249
|
+
* Useful for building custom tooltip or info-panel UIs.
|
|
250
|
+
*
|
|
251
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
252
|
+
* @returns Array of localized state description strings.
|
|
253
|
+
*/
|
|
254
|
+
export declare function getToothStateSummary(toothNo: number): string[];
|
|
255
|
+
|
|
256
|
+
export declare function getWearDetailLevel(): ToothDetailLevel;
|
|
257
|
+
|
|
258
|
+
/** Whether a status-vs-plan divergence confirm is awaiting the user's choice. */
|
|
259
|
+
export declare function isDualStateConfirmPending(): boolean;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Supported UI languages.
|
|
263
|
+
*
|
|
264
|
+
* | Code | Language |
|
|
265
|
+
* |-------|-----------------------|
|
|
266
|
+
* | hu | Hungarian |
|
|
267
|
+
* | en | English |
|
|
268
|
+
* | de | German |
|
|
269
|
+
* | es | Spanish |
|
|
270
|
+
* | it | Italian |
|
|
271
|
+
* | sk | Slovak |
|
|
272
|
+
* | pl | Polish |
|
|
273
|
+
* | ru | Russian |
|
|
274
|
+
* | pt-br | Portuguese (Brazil) |
|
|
275
|
+
* | zh | Chinese (Simplified) |
|
|
276
|
+
* | ar | Arabic (RTL — UI mirrors, dental/perio charts pinned LTR) |
|
|
277
|
+
*/
|
|
278
|
+
declare type Language = "hu" | "en" | "de" | "es" | "it" | "sk" | "pl" | "ru" | "pt-br" | "zh" | "ar";
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Supported tooth numbering systems.
|
|
282
|
+
* - **FDI** – ISO 3950 two-digit notation (default in most countries).
|
|
283
|
+
* - **UNIVERSAL** – ADA numbering (1-32 adult, A-T primary).
|
|
284
|
+
* - **PALMER** – Quadrant-based notation (UR/UL/LL/LR + position).
|
|
285
|
+
*/
|
|
286
|
+
declare type NumberingSystem = "FDI" | "UNIVERSAL" | "PALMER";
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Custom SVG plugin definition for the Odontogram engine.
|
|
290
|
+
*
|
|
291
|
+
* Plugins can inject custom SVG content into each tooth's rendering and
|
|
292
|
+
* maintain per-tooth custom state that is automatically included in
|
|
293
|
+
* JSON export/import.
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* ```typescript
|
|
297
|
+
* const implantBrandPlugin: OdontogramPlugin = {
|
|
298
|
+
* id: "implant-brand",
|
|
299
|
+
* label: { hu: "Implantátum márka", en: "Implant brand", de: "Implantat-Marke", ... },
|
|
300
|
+
* layer: "overlay",
|
|
301
|
+
* renderSvg: (toothNo, _quadrant, customState) => {
|
|
302
|
+
* if (!customState?.brand) return null;
|
|
303
|
+
* return `<text x="16" y="60" font-size="6" fill="#3b7bff">${customState.brand}</text>`;
|
|
304
|
+
* },
|
|
305
|
+
* };
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
export declare type OdontogramPlugin = {
|
|
309
|
+
/** Unique plugin identifier (used as key in customStates). */
|
|
310
|
+
id: string;
|
|
311
|
+
/** Localized display label for the plugin (shown in the state tooltip). */
|
|
312
|
+
label: Partial<Record<Language, string>>;
|
|
313
|
+
/**
|
|
314
|
+
* SVG layer where this plugin's output will be rendered.
|
|
315
|
+
* @see {@link PluginLayer}
|
|
316
|
+
*/
|
|
317
|
+
layer: PluginLayer;
|
|
318
|
+
/**
|
|
319
|
+
* Render SVG markup for a specific tooth. Return an SVG fragment string
|
|
320
|
+
* (will be wrapped in a `<g>` element) or `null`/`undefined` to render nothing.
|
|
321
|
+
*
|
|
322
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
323
|
+
* @param quadrant - The quadrant (1–4) derived from the tooth number.
|
|
324
|
+
* @param customState - The plugin's custom state for this tooth, or `undefined`.
|
|
325
|
+
*/
|
|
326
|
+
renderSvg: (toothNo: number, quadrant: 1 | 2 | 3 | 4, customState: unknown) => string | null | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* Optional: which panel section this plugin adds controls to.
|
|
329
|
+
* When set to `"custom"`, the engine will render a dedicated panel
|
|
330
|
+
* section for the plugin (future expansion).
|
|
331
|
+
*/
|
|
332
|
+
panelSection?: "custom";
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
/** Structured, already-localized textual summary of the whole odontogram. */
|
|
336
|
+
export declare type OdontogramSummary = {
|
|
337
|
+
overview: string;
|
|
338
|
+
permanentList: string | null;
|
|
339
|
+
missingList: string | null;
|
|
340
|
+
sections: OdontogramSummarySection[];
|
|
341
|
+
/** Implants heading + list — only present when at least one implant exists. */
|
|
342
|
+
implants: {
|
|
343
|
+
heading: string;
|
|
344
|
+
text: string;
|
|
345
|
+
} | null;
|
|
346
|
+
periodontalTitle: string;
|
|
347
|
+
periodontalText: string;
|
|
348
|
+
/** R2-B Task 2: the status->plan diff (see {@link getPlanChanges}), verbatim.
|
|
349
|
+
* `[]` whenever the plan chart hasn't been initialized or plan === status —
|
|
350
|
+
* a distinct field, not a section, since it's a diff rather than a status
|
|
351
|
+
* list. The "What changes" box in App.tsx renders from this field only
|
|
352
|
+
* when it's non-empty. */
|
|
353
|
+
plannedChanges: PlanChange[];
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
/** One heading + its per-tooth entries in the tooth-information summary. */
|
|
357
|
+
export declare type OdontogramSummarySection = {
|
|
358
|
+
key: "caries" | "fillings" | "endo" | "diagnoses" | "wear" | "discoloration" | "orthodontics" | "prosthetics";
|
|
359
|
+
heading: string;
|
|
360
|
+
items: string[];
|
|
361
|
+
/** Localized "no such tooth" sentence, shown when `items` is empty. */
|
|
362
|
+
emptyText: string;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Theme configuration for the Odontogram component.
|
|
367
|
+
*
|
|
368
|
+
* Allows host applications to override the default color palette without
|
|
369
|
+
* modifying CSS files. All properties are optional — only the provided
|
|
370
|
+
* values are overridden; the rest fall back to the built-in defaults.
|
|
371
|
+
*
|
|
372
|
+
* Colors are applied as CSS custom properties (`--odon-*`) on the
|
|
373
|
+
* component root element, so they work regardless of whether the host
|
|
374
|
+
* uses Tailwind CSS or plain CSS.
|
|
375
|
+
*
|
|
376
|
+
* @example
|
|
377
|
+
* ```tsx
|
|
378
|
+
* const myTheme: OdontogramThemeConfig = {
|
|
379
|
+
* colors: {
|
|
380
|
+
* accent: '#e74c3c',
|
|
381
|
+
* background: '#fafafa',
|
|
382
|
+
* },
|
|
383
|
+
* };
|
|
384
|
+
* <App themeConfig={myTheme} />
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
export declare type OdontogramThemeConfig = {
|
|
388
|
+
colors?: {
|
|
389
|
+
/** Primary background. Default: `#f3f6fb` (light) / `#0f172a` (dark). */
|
|
390
|
+
background?: string;
|
|
391
|
+
/** Panel & card background. Default: `#ffffff` (light) / `#1e293b` (dark). */
|
|
392
|
+
panel?: string;
|
|
393
|
+
/** Card background. Default: same as panel. */
|
|
394
|
+
card?: string;
|
|
395
|
+
/** Primary text color. Default: `#1e2a3a` (light) / `#f1f5f9` (dark). */
|
|
396
|
+
text?: string;
|
|
397
|
+
/** Muted / secondary text color. Default: `#5b6b7d` (light) / `#94a3b8` (dark). */
|
|
398
|
+
muted?: string;
|
|
399
|
+
/** Border / divider color. Default: `#d7e0ec` (light) / `#334155` (dark). */
|
|
400
|
+
line?: string;
|
|
401
|
+
/** Primary accent (buttons, active states). Default: `#3b7bff`. */
|
|
402
|
+
accent?: string;
|
|
403
|
+
/** Secondary accent (success, selected states). Default: `#12b981`. */
|
|
404
|
+
accent2?: string;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Subscribe to odontogram state changes. The callback runs after any tooth
|
|
410
|
+
* state edit, the edentulous toggle, or an import.
|
|
411
|
+
*
|
|
412
|
+
* @param cb - Callback invoked on each change.
|
|
413
|
+
* @returns An unsubscribe function.
|
|
414
|
+
*/
|
|
415
|
+
export declare function onStateChange(cb: () => void): () => void;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Full-screen perio-chart overlay (periodontal-arc sub-project P2). Task 1
|
|
419
|
+
* shipped the shell (dialog contract, open/close API) with an empty
|
|
420
|
+
* `#perioOverlayGrid` placeholder; THIS task (Task 2) fills it with the full-mouth
|
|
421
|
+
* grid + a summary bar, bound to the P1 data core
|
|
422
|
+
* (`setPerioSite`/`getToothPerio`/`getToothCal`/`getPerioSummary`/
|
|
423
|
+
* `getPerioChart`). Keyboard auto-advance between cells is Task 3 — plain
|
|
424
|
+
* `change` listeners are enough here.
|
|
425
|
+
*
|
|
426
|
+
* The 32-tooth x 6-site grid (~450+ interactive cells) is built with plain
|
|
427
|
+
* DOM (`buildArch`), NOT JSX/React state, and updated via targeted
|
|
428
|
+
* `syncToothCells` calls rather than a full React re-render (R3 perf) — see
|
|
429
|
+
* `syncOneTooth`/`fullResync` below. Only the compact summary bar is
|
|
430
|
+
* React-controlled (`useState`), since re-rendering ~4 numbers on every edit
|
|
431
|
+
* is cheap. `suppressResyncRef` prevents the grid's own edits from ALSO
|
|
432
|
+
* triggering a redundant full resync via the `onStateChange` subscription
|
|
433
|
+
* (setPerioSite/setToothMobility both fire it synchronously) — external
|
|
434
|
+
* edits (dual-state chart-mode switch, or another consumer editing perio
|
|
435
|
+
* data while the overlay is open) still trigger the full resync normally.
|
|
436
|
+
*
|
|
437
|
+
* Layers OVER the odontogram, which it never unmounts: `position: fixed`,
|
|
438
|
+
* full-screen, high z-index (`.perio-overlay` in `index.css`). Mirrors
|
|
439
|
+
* `SettingsModal`'s dialog contract — `role="dialog"` + `aria-modal`, Esc
|
|
440
|
+
* closes, backdrop click closes, focus trap + focus-restore on close — on a
|
|
441
|
+
* single element (`#perioOverlay` itself is the dialog; there is no separate
|
|
442
|
+
* backdrop element, unlike `SettingsModal`).
|
|
443
|
+
*
|
|
444
|
+
* **"Dental Chart" graphical redesign, Task 1 (presentation only):** the
|
|
445
|
+
* optional `inline` prop selects a second chrome for the SAME body (grid +
|
|
446
|
+
* summary bar) — a plain panel (`#perioInlinePanel`) meant to fill the chart
|
|
447
|
+
* area in place of the hidden-but-mounted odontogram, instead of the
|
|
448
|
+
* fixed-position modal dialog. `open`/`onClose` are the MODAL chrome's
|
|
449
|
+
* contract and are ignored when `inline` is true (the caller controls
|
|
450
|
+
* mount/unmount of an inline instance directly via conditional rendering,
|
|
451
|
+
* the same way any other React content area would be swapped) — there is
|
|
452
|
+
* nothing to "close" in an embedded panel. Dialog-only concerns (focus
|
|
453
|
+
* trap/restore, Esc-to-close, backdrop click, `role="dialog"`) do not apply
|
|
454
|
+
* to the inline chrome at all.
|
|
455
|
+
*/
|
|
456
|
+
export declare function PerioChart({ open, onClose, inline, }: {
|
|
457
|
+
open?: boolean;
|
|
458
|
+
onClose?: () => void;
|
|
459
|
+
inline?: boolean;
|
|
460
|
+
}): JSX_2.Element;
|
|
461
|
+
|
|
462
|
+
/** How perio-chart index row labels are rendered. */
|
|
463
|
+
export declare type PerioIndexNameMode = "translated" | "canonical";
|
|
464
|
+
|
|
465
|
+
/** The 16 toggleable periodontal index rows the Dental Chart can show/hide. */
|
|
466
|
+
export declare type PerioRowId = "plaque" | "bop" | "cal" | "gm" | "pd" | "furcation" | "mobility" | "cej" | "rootConcavity" | "pi" | "gi" | "mpi" | "mbi" | "kg" | "gt" | "miller";
|
|
467
|
+
|
|
468
|
+
export declare type PerioViewMode = "toggle" | "popup";
|
|
469
|
+
|
|
470
|
+
declare type PlanChange = {
|
|
471
|
+
toothNo: number;
|
|
472
|
+
axis: string;
|
|
473
|
+
from: string;
|
|
474
|
+
to: string;
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Defines the SVG layer where a plugin's visual output will be inserted.
|
|
479
|
+
*
|
|
480
|
+
* | Layer | Z-order | Description |
|
|
481
|
+
* |---------------|---------|----------------------------------------|
|
|
482
|
+
* | `base` | 0 | Below the tooth — background indicators |
|
|
483
|
+
* | `restoration` | 3 | Between endo and crown layers |
|
|
484
|
+
* | `overlay` | 6 | Top-most — badges, markers, highlights |
|
|
485
|
+
*/
|
|
486
|
+
export declare type PluginLayer = "base" | "restoration" | "overlay";
|
|
487
|
+
|
|
488
|
+
export declare type PulpDetailLevel = "simple" | "aae" | "latin";
|
|
489
|
+
|
|
490
|
+
export declare type RadiographicDepthMode = "off" | "threeLevel" | "detailed";
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Register one or more custom SVG plugins. Plugins can inject visual overlays
|
|
494
|
+
* into the tooth SVG and maintain per-tooth custom state included in export/import.
|
|
495
|
+
*
|
|
496
|
+
* @param plugins - Array of {@link OdontogramPlugin} definitions.
|
|
497
|
+
*/
|
|
498
|
+
export declare function registerPlugins(plugins: OdontogramPlugin[]): void;
|
|
499
|
+
|
|
500
|
+
export declare type RootCariesMode = "simple" | "severity";
|
|
501
|
+
|
|
502
|
+
export declare type SecondaryCariesMode = "simple" | "standard" | "full";
|
|
503
|
+
|
|
504
|
+
export declare function setCariesDepthEnabled(value: boolean): void;
|
|
505
|
+
|
|
506
|
+
export declare function setDiscolorationDetailLevel(value: ToothDetailLevel): void;
|
|
507
|
+
|
|
508
|
+
/** Toggle visibility of the healthy-pulp layer on all teeth. */
|
|
509
|
+
export declare function setHealthyPulpVisible(on: Any): void;
|
|
510
|
+
|
|
511
|
+
export declare function setIcdasEnabled(value: boolean): void;
|
|
512
|
+
|
|
513
|
+
/** Set which parser the next file import uses. Defaults back to "status" after each import. */
|
|
514
|
+
export declare function setImportFormat(format: "status" | "fhir"): void;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Enable or disable per-tooth notes. When enabled, double-clicking a tooth
|
|
518
|
+
* opens a note editor popover, and notes are shown in hover tooltips with
|
|
519
|
+
* a badge indicator.
|
|
520
|
+
*
|
|
521
|
+
* @param value - `true` to enable notes, `false` to disable.
|
|
522
|
+
*/
|
|
523
|
+
export declare function setNotesEnabled(value: boolean): void;
|
|
524
|
+
|
|
525
|
+
/** Toggle visibility of occlusal-view tiles (premolars and molars). */
|
|
526
|
+
export declare function setOcclusalVisible(on: Any): void;
|
|
527
|
+
|
|
528
|
+
/** Switch the perio index-name display mode. No-op (still notifies) if unchanged. */
|
|
529
|
+
export declare function setPerioIndexNameMode(mode: PerioIndexNameMode): void;
|
|
530
|
+
|
|
531
|
+
/** Show/hide one perio-chart index row. No-op (still notifies) if unchanged. */
|
|
532
|
+
export declare function setPerioRowVisibility(id: PerioRowId, visible: boolean): void;
|
|
533
|
+
|
|
534
|
+
/** Switch the perio-chart housing mode. No-op (still notifies) if unchanged. */
|
|
535
|
+
export declare function setPerioViewMode(mode: PerioViewMode): void;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Set a plugin's custom state for a specific tooth. Triggers SVG re-render
|
|
539
|
+
* for that tooth and updates the tooltip.
|
|
540
|
+
*
|
|
541
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
542
|
+
* @param pluginId - The plugin's unique identifier.
|
|
543
|
+
* @param value - The custom state value (any JSON-serializable value, or `undefined` to clear).
|
|
544
|
+
*/
|
|
545
|
+
export declare function setPluginState(toothNo: number, pluginId: string, value: unknown): void;
|
|
546
|
+
|
|
547
|
+
export declare function setPulpDetailLevel(value: PulpDetailLevel): void;
|
|
548
|
+
|
|
549
|
+
export declare function setRadiographicDepthMode(value: RadiographicDepthMode): void;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Enable or disable read-only mode. When read-only, all click, touch, and
|
|
553
|
+
* keyboard interactions are disabled. The control panel is dimmed and
|
|
554
|
+
* non-interactive. Useful for print/report views.
|
|
555
|
+
*
|
|
556
|
+
* @param value - `true` to enable read-only mode, `false` to disable.
|
|
557
|
+
*/
|
|
558
|
+
export declare function setReadOnly(value: boolean): void;
|
|
559
|
+
|
|
560
|
+
export declare function setRootCariesMode(value: RootCariesMode): void;
|
|
561
|
+
|
|
562
|
+
export declare function setSecondaryCariesMode(value: SecondaryCariesMode): void;
|
|
563
|
+
|
|
564
|
+
/** Toggle visibility of the bone/gum base layer on all teeth. */
|
|
565
|
+
export declare function setShowBase(on: Any): void;
|
|
566
|
+
|
|
567
|
+
export declare function setSurfaceNotation(value: SurfaceNotation): void;
|
|
568
|
+
|
|
569
|
+
export declare function setWearDetailLevel(value: ToothDetailLevel): void;
|
|
570
|
+
|
|
571
|
+
/** Toggle visibility of wisdom teeth (18, 28, 38, 48). */
|
|
572
|
+
export declare function setWisdomVisible(on: Any): void;
|
|
573
|
+
|
|
574
|
+
/** Start the 12-step interactive intro tour. */
|
|
575
|
+
export declare function startIntroTour(): void;
|
|
576
|
+
|
|
577
|
+
export declare type SurfaceNotation = "simple" | "full";
|
|
578
|
+
|
|
579
|
+
export declare type ToothDetailLevel = "simple" | "complex";
|
|
580
|
+
|
|
581
|
+
export { }
|