@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 +49 -12
- package/README.md +49 -12
- package/dist/components/json-editor/JsonEditor.d.ts +1 -1
- package/dist/components/json-editor/JsonEditor.js +38 -34
- package/dist/components/json-editor/JsonEditor.types.d.ts +29 -0
- package/dist/components/json-editor/JsonEditorContent.d.ts +6 -2
- package/dist/components/json-editor/JsonEditorContent.js +206 -104
- package/dist/components/json-editor/util/jsonPathFinder.d.ts +9 -0
- package/dist/components/json-editor/util/jsonPathFinder.js +45 -0
- package/dist/components/json-editor/util/jsonSchemaValidator.d.ts +22 -0
- package/dist/components/json-editor/util/jsonSchemaValidator.js +116 -0
- package/dist/index.cjs +2 -2
- package/package.json +2 -1
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
|
-
|
|
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
|
-
| [`
|
|
18
|
-
| [`
|
|
19
|
-
| [`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
| [`
|
|
26
|
-
| [`
|
|
27
|
-
| [`
|
|
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
|
-
|
|
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
|
-
| [`
|
|
18
|
-
| [`
|
|
19
|
-
| [`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
| [`
|
|
26
|
-
| [`
|
|
27
|
-
| [`
|
|
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,
|
|
19
|
-
let
|
|
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
|
-
...
|
|
22
|
-
},
|
|
21
|
+
...I
|
|
22
|
+
}, V = {
|
|
23
23
|
...e,
|
|
24
|
-
...
|
|
25
|
-
},
|
|
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
|
-
}), [
|
|
29
|
-
|
|
30
|
-
}, []),
|
|
31
|
-
|
|
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
|
-
}, []),
|
|
35
|
+
}, []), ne = o((e) => {
|
|
36
36
|
let t = h(e);
|
|
37
|
-
|
|
38
|
-
}, [_, v]),
|
|
37
|
+
Q(t), v?.(t), _?.(e);
|
|
38
|
+
}, [_, v]), re = A || N || !!T;
|
|
39
39
|
return /* @__PURE__ */ m(l, {
|
|
40
40
|
sx: {
|
|
41
|
-
width:
|
|
42
|
-
...
|
|
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
|
-
...
|
|
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:
|
|
64
|
-
toolbarConfig:
|
|
65
|
-
translation:
|
|
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:
|
|
70
|
+
onChange: ne,
|
|
71
71
|
placeholder: y,
|
|
72
72
|
disabled: S,
|
|
73
73
|
readonly: C,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
87
|
+
re && /* @__PURE__ */ p(i, {
|
|
84
88
|
helperText: T,
|
|
85
89
|
error: w,
|
|
86
|
-
showLineColumn:
|
|
87
|
-
showValidation:
|
|
88
|
-
isValid:
|
|
89
|
-
cursorLine:
|
|
90
|
-
cursorCol:
|
|
91
|
-
translation:
|
|
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 {};
|