@thebuoyant-tsdev/mui-ts-library 3.6.1 → 3.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/README.de.md CHANGED
@@ -12,19 +12,35 @@ Eine typsichere React-Komponentenbibliothek auf Basis von **TypeScript** und **M
12
12
 
13
13
  ## Komponenten
14
14
 
15
- | Komponente | Beschreibung | Docs |
15
+ 11 produktionsreife Komponenten in drei Kategorien. Jede verlinkt zu einer interaktiven Live-Demo und einem vollständigen Manual mit allen Props, Typen und Mustern.
16
+
17
+ ### Interaktive UI
18
+
19
+ | Komponente | Wofür | Ausprobieren |
20
+ |---|---|---|
21
+ | [`GanttChart`](#ganttchart) | Drag-and-Drop-Projekt-Timelines mit Meilensteinen, Abhängigkeiten und CSV-Export | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-ganttchart--default) · [Docs](user-manuals/GanttChart.de.md) |
22
+ | [`TagSelection`](#tagselection) | Multi-Tag-Autocomplete mit freier Tag-Erstellung und Suchergebnis-Highlighting | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-tagselection--default) · [Docs](user-manuals/TagSelection.de.md) |
23
+ | [`PasswordStrengthMeter`](#passwordstrengthmeter) | Echtzeit-Stärke-Feedback mit eingebautem sicheren Passwort-Generator | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-passwordstrengthmeter--default) · [Docs](user-manuals/PasswordStrengthMeter.de.md) |
24
+
25
+ ### Code-Editoren
26
+
27
+ | Komponente | Wofür | Ausprobieren |
16
28
  |---|---|---|
17
- | [`GanttChart`](#ganttchart) | Projekt-Timeline mit hierarchischen Aufgaben, Meilensteinen, Drag & Drop, Ctrl / Cmd ⌘+Scroll-Zoom, Heute-Chip, Assignee-Spalte, CSV-Export und integrierten CRUD-Dialogen | [Vollständiges Manual →](user-manuals/GanttChart.de.md) |
18
- | [`TagSelection`](#tagselection) | Multi-Tag-Auswahlfeld mit Autocomplete, freier Tag-Erstellung, Overflow-Chips und MUI-Theme-Farben | [Vollständiges Manual ](user-manuals/TagSelection.de.md) |
19
- | [`PasswordStrengthMeter`](#passwordstrengthmeter) | Passwort-Eingabe mit animiertem Stärke-Meter, Confirm-Feld mit Match-Validierung, eigenen Anforderungen und eingebautem sicheren Passwort-Generator | [Vollständiges Manual ](user-manuals/PasswordStrengthMeter.de.md) |
20
- | [`RichTextEditor`](#richtexteditor) | WYSIWYG-Editor (TipTap v3) mit Toolbar, Link-Dialog, Textfarbe, Hervorhebung, Wörter-Zähler, Vollbild-Modus, Markdown-Einfügen, Tabellen-Bearbeitung, Bild-Embed und Emoji-Picker | [Vollständiges Manual →](user-manuals/RichTextEditor.de.md) |
21
- | [`SqlEditor`](#sqleditor) | SQL-Code-Editor (CodeMirror 6) mit Syntax-Highlighting, Multi-Dialekt, Autocomplete, Linting und `Cmd+Enter`-Ausführen-Shortcut | [Vollständiges Manual →](user-manuals/SqlEditor.de.md) |
22
- | [`JsonEditor`](#jsoneditor) | JSON-Code-Editor (CodeMirror 6) mit Echtzeit-Validierung, Format- und Komprimieren-Schaltfläche sowie optionaler Minimap | [Vollständiges Manual →](user-manuals/JsonEditor.de.md) |
23
- | [`SunburstChart`](#sunburstchart) | D3 v7 hierarchisches Chart — konzentrische Ringe, Ctrl / Cmd ⌘+Click Drill-Down, Ctrl / Cmd ⌘+Scroll Zoom, Donut-Modus, eigene Farben, MUI-Theme-Integration. Erste der D3-Chart-Familie. | [Vollständiges Manual →](user-manuals/SunburstChart.de.md) |
24
- | [`ChordChart`](#chordchart) | D3 v7 Fluss-Chart — Arc-Gruppen, Bänder, Hover-Highlight, Ctrl / Cmd ⌘+Scroll-Zoom, gerichtet/ungerichtet, MUI-Theme-Integration | [Vollständiges Manual →](user-manuals/ChordChart.de.md) |
25
- | [`RadialTreeChart`](#radialtreechart) | D3 v7 radialer BaumKnoten auf konzentrischen Ringen, MUI-Icons, Ctrl / Cmd ⌘+Click Drill-Down, Ctrl / Cmd ⌘+Scroll Zoom, MUI-Theme-Integration | [Vollständiges Manual →](user-manuals/RadialTreeChart.de.md) |
26
- | [`CirclePackingChart`](#circlepackingchart) | D3 v7 Circle Packing verschachtelte Kreise, animierter D3-Zoom, Ctrl / Cmd ⌘+Scroll-Zoom, Tiefen-Gradient oder Palette, MUI-Theme-Integration | [Vollständiges Manual →](user-manuals/CirclePackingChart.de.md) |
27
- | [`HorizontalTreeChart`](#horizontaltreechart) | D3 v7 Baum-Chart 4 Orientierungen (LR/RL/TB/BT), geschwungene Links, Drill-Down, Ctrl / Cmd ⌘+Scroll-Zoom, MUI-Icons und Theme-Integration | [Vollständiges Manual →](user-manuals/HorizontalTreeChart.de.md) |
29
+ | [`RichTextEditor`](#richtexteditor) | WYSIWYG-Editing (TipTap v3) mit Tabellen, Bildern und Emoji-Picker | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-richtexteditor--default) · [Docs](user-manuals/RichTextEditor.de.md) |
30
+ | [`SqlEditor`](#sqleditor) | SQL-Editing (CodeMirror 6) mit dialekt-bewusstem Autocomplete und Query-Verlauf | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-sqleditor--default) · [Docs](user-manuals/SqlEditor.de.md) |
31
+ | [`JsonEditor`](#jsoneditor) | JSON-Editing (CodeMirror 6) mit Schema-Validierung, Folding und Path Finder | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-jsoneditor--default) · [Docs](user-manuals/JsonEditor.de.md) |
32
+
33
+ ### D3-Datenvisualisierung
34
+
35
+ | Komponente | Wofür | Ausprobieren |
36
+ |---|---|---|
37
+ | [`SunburstChart`](#sunburstchart) | Hierarchische Daten als konzentrische Ringe Drill-Down mit `Ctrl+Click` | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-sunburstchart--default) · [Docs](user-manuals/SunburstChart.de.md) |
38
+ | [`ChordChart`](#chordchart) | Fluss und Beziehungen zwischen benannten Gruppen als kreisförmiges Diagramm | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-chordchart--default) · [Docs](user-manuals/ChordChart.de.md) |
39
+ | [`RadialTreeChart`](#radialtreechart) | Org-Charts und Taxonomien als radialer Baum, mit Drill-Down | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-radialtreechart--default) · [Docs](user-manuals/RadialTreeChart.de.md) |
40
+ | [`CirclePackingChart`](#circlepackingchart) | Verschachtelte Kreise mit animiertem Zoom — Speicher und Hierarchie auf einen Blick | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-circlepackingchart--default) · [Docs](user-manuals/CirclePackingChart.de.md) |
41
+ | [`HorizontalTreeChart`](#horizontaltreechart) | Entscheidungsbäume und Hierarchien in 4 Orientierungen (LR/RL/TB/BT) | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-horizontaltreechart--default) · [Docs](user-manuals/HorizontalTreeChart.de.md) |
42
+
43
+ Alle Charts teilen sich Ctrl / Cmd ⌘+Scroll-Zoom und vollständige MUI-Theme-Integration (Dark Mode inklusive).
28
44
 
29
45
  ---
30
46
 
@@ -311,8 +327,29 @@ import type {
311
327
 
312
328
  ---
313
329
 
330
+ ## Versionierung & Abwärtskompatibilität
331
+
332
+ Dieses Projekt folgt [Semantic Versioning](https://semver.org/). In der Praxis bedeutet das:
333
+
334
+ - **Patch** (`3.7.0` → `3.7.1`) — nur Bugfixes, jederzeit gefahrlos aktualisierbar.
335
+ - **Minor** (`3.6.0` → `3.7.0`) — neue Features, vollständig abwärtskompatibel.
336
+ - **Major** (`2.x` → `3.0.0`) — Breaking Changes, explizit im [Changelog](#changelog) gekennzeichnet.
337
+
338
+ **Bisher nur ein Breaking Release:** [`3.0.0`](#300--2026-06-15--breaking-changes) hat `ConfirmDialog` / `ConfirmDialogProvider` / `useConfirm` entfernt und die Signatur von `TagSelection`s `onTagCreate` geändert. Jedes Release seitdem war additiv.
339
+
340
+ **TypeScript-Hinweis:** Translation-Typen (z.B. `TagSelectionTranslation`, `SqlEditorTranslation`) bekommen mit der Zeit neue optionale Felder, wenn Features hinzukommen — ein `Partial<...>`-Objekt direkt an die `translation`-Prop zu übergeben (das in dieser README durchgängig verwendete Muster) ist immer vorwärtskompatibel. Eine eigenständige Variable, die gegen den vollen benannten Typ deklariert wird, bleibt nur kompatibel, solange neue Felder optional sind — was seit `3.6.1` der Fall ist (siehe [Changelog](#361--2026-06-22)).
341
+
342
+ ---
343
+
314
344
  ## Changelog
315
345
 
346
+ ### [3.7.0] — 2026-06-23
347
+
348
+ **JsonEditor — Folding, Path Finder und Schema-Validierung**
349
+ - Neu: `showFolding` (Fold-Gutter für Objects/Arrays), `enablePathFinder` (`Ctrl+Click` auf einen Wert kopiert den JSON-Path), und `schema`-Prop (strukturelle Validierung mit Inline-Fehler-Diagnostics — Typ, Required, Enum, verschachtelte Strukturen).
350
+
351
+ ---
352
+
316
353
  ### [3.6.1] — 2026-06-22
317
354
 
318
355
  **⚠️ TypeScript-Kompatibilitäts-Fix**
package/README.md CHANGED
@@ -12,19 +12,35 @@ A type-safe React component library built on **TypeScript** and **MUI (Material
12
12
 
13
13
  ## Components
14
14
 
15
- | Component | Description | Docs |
15
+ 11 production-ready components across three categories. Each links to a live, interactive demo and a full manual covering every prop, type, and pattern.
16
+
17
+ ### Interactive UI
18
+
19
+ | Component | What it's for | Try it |
20
+ |---|---|---|
21
+ | [`GanttChart`](#ganttchart) | Drag-and-drop project timelines with milestones, dependencies, and CSV export | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-ganttchart--default) · [Docs](user-manuals/GanttChart.md) |
22
+ | [`TagSelection`](#tagselection) | Multi-tag autocomplete with free-form tag creation and search highlighting | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-tagselection--default) · [Docs](user-manuals/TagSelection.md) |
23
+ | [`PasswordStrengthMeter`](#passwordstrengthmeter) | Real-time strength feedback with a built-in secure password generator | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-passwordstrengthmeter--default) · [Docs](user-manuals/PasswordStrengthMeter.md) |
24
+
25
+ ### Code Editors
26
+
27
+ | Component | What it's for | Try it |
16
28
  |---|---|---|
17
- | [`GanttChart`](#ganttchart) | Project timeline with hierarchical tasks, milestones, drag & drop, Ctrl / Cmd ⌘+Scroll zoom, today chip, assignee column, CSV export, and built-in CRUD dialogs | [Full Manual →](user-manuals/GanttChart.md) |
18
- | [`TagSelection`](#tagselection) | Multi-tag selector with autocomplete, free tag creation, overflow chips, and MUI theme colors | [Full Manual ](user-manuals/TagSelection.md) |
19
- | [`PasswordStrengthMeter`](#passwordstrengthmeter) | Password input with animated strength meter, segmented bar, custom requirements, confirm field with match validation, and built-in secure password generator | [Full Manual →](user-manuals/PasswordStrengthMeter.md) |
20
- | [`RichTextEditor`](#richtexteditor) | WYSIWYG editor (TipTap v3) with toolbar, link dialog, text color, highlight, word count, fullscreen mode, Markdown paste, table editing, image embed, and emoji picker | [Full Manual →](user-manuals/RichTextEditor.md) |
21
- | [`SqlEditor`](#sqleditor) | SQL code editor (CodeMirror 6) with syntax highlighting, multi-dialect, autocomplete, linting, and `Cmd+Enter` execute shortcut | [Full Manual →](user-manuals/SqlEditor.md) |
22
- | [`JsonEditor`](#jsoneditor) | JSON code editor (CodeMirror 6) with real-time validation, Format, Compact buttons, and optional minimap | [Full Manual →](user-manuals/JsonEditor.md) |
23
- | [`SunburstChart`](#sunburstchart) | D3 v7 hierarchical chart — concentric rings, Ctrl / Cmd ⌘+Click drill-down, Ctrl / Cmd ⌘+Scroll zoom, donut mode, MUI theme integration | [Full Manual →](user-manuals/SunburstChart.md) |
24
- | [`ChordChart`](#chordchart) | D3 v7 flow chart — arc groups, ribbons, hover highlight, Ctrl / Cmd ⌘+Scroll zoom, directed/undirected, MUI theme integration | [Full Manual →](user-manuals/ChordChart.md) |
25
- | [`RadialTreeChart`](#radialtreechart) | D3 v7 radial tree — hierarchical nodes on concentric rings, MUI icons, Ctrl / Cmd ⌘+Click drill-down, Ctrl / Cmd ⌘+Scroll zoom, MUI theme integration | [Full Manual →](user-manuals/RadialTreeChart.md) |
26
- | [`CirclePackingChart`](#circlepackingchart) | D3 v7 circle packing nested circles, animated D3 zoom, Ctrl / Cmd ⌘+Scroll zoom, depth gradient or palette, MUI theme integration | [Full Manual →](user-manuals/CirclePackingChart.md) |
27
- | [`HorizontalTreeChart`](#horizontaltreechart) | D3 v7 tree chart 4 orientations (LR/RL/TB/BT), curved links, drill-down, Ctrl / Cmd ⌘+Scroll zoom, MUI icons and theme integration | [Full Manual →](user-manuals/HorizontalTreeChart.md) |
29
+ | [`RichTextEditor`](#richtexteditor) | WYSIWYG editing (TipTap v3) with tables, images, and an emoji picker | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-richtexteditor--default) · [Docs](user-manuals/RichTextEditor.md) |
30
+ | [`SqlEditor`](#sqleditor) | SQL editing (CodeMirror 6) with dialect-aware autocomplete and query history | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-sqleditor--default) · [Docs](user-manuals/SqlEditor.md) |
31
+ | [`JsonEditor`](#jsoneditor) | JSON editing (CodeMirror 6) with schema validation, folding, and a path finder | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-jsoneditor--default) · [Docs](user-manuals/JsonEditor.md) |
32
+
33
+ ### D3 Data Visualization
34
+
35
+ | Component | What it's for | Try it |
36
+ |---|---|---|
37
+ | [`SunburstChart`](#sunburstchart) | Hierarchical data as concentric rings drill down with `Ctrl+Click` | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-sunburstchart--default) · [Docs](user-manuals/SunburstChart.md) |
38
+ | [`ChordChart`](#chordchart) | Flow and relationships between named groups as a circular diagram | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-chordchart--default) · [Docs](user-manuals/ChordChart.md) |
39
+ | [`RadialTreeChart`](#radialtreechart) | Org charts and taxonomies as a radial tree, with drill-down | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-radialtreechart--default) · [Docs](user-manuals/RadialTreeChart.md) |
40
+ | [`CirclePackingChart`](#circlepackingchart) | Nested circles with animated zoom — storage and hierarchy at a glance | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-circlepackingchart--default) · [Docs](user-manuals/CirclePackingChart.md) |
41
+ | [`HorizontalTreeChart`](#horizontaltreechart) | Decision trees and hierarchies in 4 orientations (LR/RL/TB/BT) | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-horizontaltreechart--default) · [Docs](user-manuals/HorizontalTreeChart.md) |
42
+
43
+ All charts share Ctrl / Cmd ⌘+Scroll zoom and full MUI theme integration (dark mode included).
28
44
 
29
45
  ---
30
46
 
@@ -311,8 +327,29 @@ import type {
311
327
 
312
328
  ---
313
329
 
330
+ ## Versioning & Compatibility
331
+
332
+ This project follows [Semantic Versioning](https://semver.org/). In practice:
333
+
334
+ - **Patch** (`3.7.0` → `3.7.1`) — bug fixes only, always safe to upgrade.
335
+ - **Minor** (`3.6.0` → `3.7.0`) — new features, fully backwards compatible.
336
+ - **Major** (`2.x` → `3.0.0`) — breaking changes, called out explicitly in the [Changelog](#changelog).
337
+
338
+ **Only one breaking release to date:** [`3.0.0`](#300--2026-06-15--breaking-changes) removed `ConfirmDialog` / `ConfirmDialogProvider` / `useConfirm` and changed `TagSelection`'s `onTagCreate` signature. Every other release since has been additive.
339
+
340
+ **TypeScript note:** translation types (e.g. `TagSelectionTranslation`, `SqlEditorTranslation`) gain new optional fields over time as features are added — passing a `Partial<...>` object straight to the `translation` prop (the pattern used throughout this README) is always forward-compatible. Declaring a standalone variable typed against the full named type only stays compatible if new fields are optional, which they are as of `3.6.1` (see [Changelog](#361--2026-06-22)).
341
+
342
+ ---
343
+
314
344
  ## Changelog
315
345
 
346
+ ### [3.7.0] — 2026-06-23
347
+
348
+ **JsonEditor — Folding, Path Finder, and Schema Validation**
349
+ - New `showFolding` (fold gutter for objects/arrays), `enablePathFinder` (`Ctrl+Click` a value to copy its JSON path), and `schema` prop (structural validation with inline error diagnostics — type, required, enum, nested shapes).
350
+
351
+ ---
352
+
316
353
  ### [3.6.1] — 2026-06-22
317
354
 
318
355
  **⚠️ TypeScript Compatibility Fix**
@@ -1,2 +1,2 @@
1
1
  import { type JsonEditorProps } from "./JsonEditor.types";
2
- export declare function JsonEditor({ value, onChange, onValidChange, placeholder, height, width, disabled, readonly, error, helperText, name, indent, showLineNumbers, showLineColumn, showMinimap, showValidation, toolbarConfig, translation, highlightColors, onBlur, onFocus, }: JsonEditorProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function JsonEditor({ value, onChange, onValidChange, placeholder, height, width, disabled, readonly, error, helperText, name, indent, schema, showLineNumbers, showLineColumn, showMinimap, showFolding, showValidation, enablePathFinder, toolbarConfig, translation, highlightColors, onBlur, onFocus, onPathCopy, }: JsonEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -15,31 +15,31 @@ function h(e) {
15
15
  return !1;
16
16
  }
17
17
  }
18
- function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b, width: x, disabled: S = !1, readonly: C = !1, error: w = !1, helperText: T, name: E, indent: D = 2, showLineNumbers: O = !0, showLineColumn: k = !0, showMinimap: A = !1, showValidation: j = !1, toolbarConfig: M, translation: N, highlightColors: P, onBlur: F, onFocus: I }) {
19
- let L = {
18
+ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b, width: x, disabled: S = !1, readonly: C = !1, error: w = !1, helperText: T, name: E, indent: D = 2, schema: O, showLineNumbers: k = !0, showLineColumn: A = !0, showMinimap: j = !1, showFolding: M = !0, showValidation: N = !1, enablePathFinder: P = !0, toolbarConfig: F, translation: I, highlightColors: L, onBlur: R, onFocus: ee, onPathCopy: z }) {
19
+ let B = {
20
20
  ...t,
21
- ...N
22
- }, R = {
21
+ ...I
22
+ }, V = {
23
23
  ...e,
24
- ...M
25
- }, z = a(b), B = a(x), V = z === "auto", H = V ? void 0 : z ?? 300, U = s(null), [W, G] = c(null), [K, q] = c({
24
+ ...F
25
+ }, H = a(b), U = a(x), W = H === "auto", G = W ? void 0 : H ?? 300, K = s(null), [q, J] = c(null), [Y, X] = c({
26
26
  line: 1,
27
27
  col: 1
28
- }), [J, Y] = c(() => h(g ?? "")), X = o((e) => {
29
- U.current = e, G(e);
30
- }, []), Z = o((e, t) => {
31
- q({
28
+ }), [Z, Q] = c(() => h(g ?? "")), $ = o((e) => {
29
+ K.current = e, J(e);
30
+ }, []), te = o((e, t) => {
31
+ X({
32
32
  line: e,
33
33
  col: t
34
34
  });
35
- }, []), Q = o((e) => {
35
+ }, []), ne = o((e) => {
36
36
  let t = h(e);
37
- Y(t), v?.(t), _?.(e);
38
- }, [_, v]), $ = k || j || !!T;
37
+ Q(t), v?.(t), _?.(e);
38
+ }, [_, v]), re = A || N || !!T;
39
39
  return /* @__PURE__ */ m(l, {
40
40
  sx: {
41
- width: B ?? "100%",
42
- ...V ? {
41
+ width: U ?? "100%",
42
+ ...W ? {
43
43
  display: "flex",
44
44
  flexDirection: "column",
45
45
  flex: 1
@@ -52,7 +52,7 @@ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b,
52
52
  display: "flex",
53
53
  flexDirection: "column",
54
54
  overflow: "hidden",
55
- ...V ? { flex: 1 } : { height: H },
55
+ ...W ? { flex: 1 } : { height: G },
56
56
  borderColor: w ? "error.main" : void 0,
57
57
  "&:focus-within": {
58
58
  borderColor: w ? "error.main" : "primary.main",
@@ -60,35 +60,39 @@ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b,
60
60
  }
61
61
  },
62
62
  children: [!C && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(r, {
63
- editorView: W,
64
- toolbarConfig: R,
65
- translation: L,
63
+ editorView: q,
64
+ toolbarConfig: V,
65
+ translation: B,
66
66
  indent: D,
67
67
  disabled: S
68
68
  }), /* @__PURE__ */ p(u, {})] }), /* @__PURE__ */ p(n, {
69
69
  value: g,
70
- onChange: Q,
70
+ onChange: ne,
71
71
  placeholder: y,
72
72
  disabled: S,
73
73
  readonly: C,
74
- showLineNumbers: O,
75
- showMinimap: A,
76
- highlightColors: P,
77
- onViewReady: X,
78
- onCursorChange: Z,
79
- onBlur: F,
80
- onFocus: I
74
+ schema: O,
75
+ showLineNumbers: k,
76
+ showMinimap: j,
77
+ showFolding: M,
78
+ enablePathFinder: P,
79
+ highlightColors: L,
80
+ onViewReady: $,
81
+ onCursorChange: te,
82
+ onBlur: R,
83
+ onFocus: ee,
84
+ onPathCopy: z
81
85
  })]
82
86
  }),
83
- $ && /* @__PURE__ */ p(i, {
87
+ re && /* @__PURE__ */ p(i, {
84
88
  helperText: T,
85
89
  error: w,
86
- showLineColumn: k,
87
- showValidation: j,
88
- isValid: J,
89
- cursorLine: K.line,
90
- cursorCol: K.col,
91
- translation: L
90
+ showLineColumn: A,
91
+ showValidation: N,
92
+ isValid: Z,
93
+ cursorLine: Y.line,
94
+ cursorCol: Y.col,
95
+ translation: B
92
96
  }),
93
97
  E && /* @__PURE__ */ p("input", {
94
98
  type: "hidden",
@@ -31,6 +31,19 @@ export type JsonEditorHighlightColors = {
31
31
  /** Null values. Default: theme text.secondary. */
32
32
  null?: string;
33
33
  };
34
+ export type JsonSchemaType = "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
35
+ /**
36
+ * A focused subset of JSON Schema — type checking, required fields, enum, and
37
+ * nested object/array shapes. Not a full JSON Schema implementation (no $ref,
38
+ * oneOf/anyOf, pattern, min/max, etc.).
39
+ */
40
+ export type JsonEditorSchema = {
41
+ type?: JsonSchemaType | JsonSchemaType[];
42
+ properties?: Record<string, JsonEditorSchema>;
43
+ required?: string[];
44
+ items?: JsonEditorSchema;
45
+ enum?: unknown[];
46
+ };
34
47
  export type JsonEditorProps = {
35
48
  disabled?: boolean;
36
49
  error?: boolean;
@@ -44,10 +57,19 @@ export type JsonEditorProps = {
44
57
  name?: string;
45
58
  placeholder?: string;
46
59
  readonly?: boolean;
60
+ /**
61
+ * Structurally validates the document against a focused JSON Schema subset
62
+ * (type, required, enum, nested properties/items). Errors are shown as
63
+ * inline diagnostics, same as parse errors. Skipped while the document
64
+ * doesn't parse as valid JSON.
65
+ */
66
+ schema?: JsonEditorSchema;
47
67
  showLineColumn?: boolean;
48
68
  showLineNumbers?: boolean;
49
69
  /** Shows a scaled-down document overview (minimap) on the right side of the editor. */
50
70
  showMinimap?: boolean;
71
+ /** Shows a fold gutter — click the arrows to collapse/expand objects and arrays (default: true). */
72
+ showFolding?: boolean;
51
73
  /** Shows a Valid / Invalid JSON indicator in the footer. */
52
74
  showValidation?: boolean;
53
75
  toolbarConfig?: JsonEditorToolbarConfig;
@@ -55,8 +77,15 @@ export type JsonEditorProps = {
55
77
  value?: string;
56
78
  /** Width. Numbers → px. Default → 100%. */
57
79
  width?: number | string;
80
+ /**
81
+ * Enables Ctrl / Cmd ⌘+Click on a value or property name to copy its full
82
+ * JSON path (e.g. `$.users[0].name`) to the clipboard (default: true).
83
+ */
84
+ enablePathFinder?: boolean;
58
85
  onBlur?: () => void;
59
86
  onChange?: (json: string) => void;
60
87
  onFocus?: () => void;
88
+ /** Fired after Ctrl / Cmd ⌘+Click successfully copies a path via the path finder. */
89
+ onPathCopy?: (path: string) => void;
61
90
  onValidChange?: (isValid: boolean) => void;
62
91
  };
@@ -1,18 +1,22 @@
1
1
  import { EditorView } from "@codemirror/view";
2
- import type { JsonEditorHighlightColors } from "./JsonEditor.types";
2
+ import type { JsonEditorHighlightColors, JsonEditorSchema } from "./JsonEditor.types";
3
3
  type JsonEditorContentProps = {
4
4
  value?: string;
5
5
  onChange?: (json: string) => void;
6
6
  placeholder?: string;
7
7
  disabled?: boolean;
8
8
  readonly?: boolean;
9
+ schema?: JsonEditorSchema;
9
10
  showLineNumbers?: boolean;
10
11
  showMinimap?: boolean;
12
+ showFolding?: boolean;
13
+ enablePathFinder?: boolean;
11
14
  highlightColors?: JsonEditorHighlightColors;
12
15
  onViewReady: (view: EditorView | null) => void;
13
16
  onCursorChange: (line: number, col: number) => void;
14
17
  onBlur?: () => void;
15
18
  onFocus?: () => void;
19
+ onPathCopy?: (path: string) => void;
16
20
  };
17
- export declare function JsonEditorContent({ value, onChange, placeholder, disabled, readonly, showLineNumbers, showMinimap, highlightColors, onViewReady, onCursorChange, onBlur, onFocus, }: JsonEditorContentProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function JsonEditorContent({ value, onChange, placeholder, disabled, readonly, schema, showLineNumbers, showMinimap, showFolding, enablePathFinder, highlightColors, onViewReady, onCursorChange, onBlur, onFocus, onPathCopy, }: JsonEditorContentProps): import("react/jsx-runtime").JSX.Element;
18
22
  export {};