@djangocfg/ui-tools 2.1.239 → 2.1.241

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 CHANGED
@@ -28,20 +28,21 @@ This package contains heavy components that are loaded lazily to keep your initi
28
28
  | `@djangocfg/ui-tools` | Heavy tools with lazy loading |
29
29
  | `@djangocfg/ui-nextjs` | Next.js apps (extends ui-core) |
30
30
 
31
- ## Tools (12)
31
+ ## Tools (13)
32
32
 
33
33
  | Tool | Bundle Size | Description |
34
34
  |------|-------------|-------------|
35
- | `Gallery` | ~50KB | Image/video gallery with carousel, grid, lightbox |
36
35
  | `Map` | ~800KB | MapLibre GL maps with markers, clusters, layers |
37
36
  | `Mermaid` | ~800KB | Diagram rendering with declarative builders |
38
- | `PrettyCode` | ~500KB | Code syntax highlighting |
37
+ | `CodeEditor` | ~550KB | Monaco-based code editor with diff view |
38
+ | `PrettyCode` | ~500KB | Code syntax highlighting (read-only) |
39
39
  | `OpenapiViewer` | ~400KB | OpenAPI schema viewer & playground |
40
40
  | `JsonForm` | ~300KB | JSON Schema form generator |
41
41
  | `LottiePlayer` | ~200KB | Lottie animation player |
42
42
  | `AudioPlayer` | ~200KB | Audio player with WaveSurfer.js |
43
43
  | `VideoPlayer` | ~150KB | Professional video player with Vidstack |
44
44
  | `JsonTree` | ~100KB | JSON visualization with modes (full/compact/inline) |
45
+ | `Gallery` | ~50KB | Image/video gallery with carousel, grid, lightbox |
45
46
  | `ImageViewer` | ~50KB | Image viewer with zoom/pan/rotate/flip and gallery navigation |
46
47
  | `CronScheduler` | ~15KB | Cron expression builder with intuitive UI |
47
48
 
@@ -65,6 +66,7 @@ import { FlowDiagram, SequenceDiagram, JourneyDiagram } from '@djangocfg/ui-tool
65
66
  | Path | Content |
66
67
  |------|---------|
67
68
  | `@djangocfg/ui-tools` | All tools with lazy loading |
69
+ | `@djangocfg/ui-tools/code-editor` | Monaco editor, diff editor, hooks |
68
70
  | `@djangocfg/ui-tools/gallery` | Gallery components & hooks |
69
71
  | `@djangocfg/ui-tools/map` | Map components & utilities |
70
72
  | `@djangocfg/ui-tools/mermaid` | Mermaid component & declarative builders |
@@ -469,8 +471,52 @@ journey.section('Sign Up')
469
471
  return journey.toString();
470
472
  ```
471
473
 
474
+ ## Code Editor
475
+
476
+ Monaco-based code editor with full IDE features: syntax highlighting, IntelliSense, diff view, multi-file support.
477
+
478
+ ```tsx
479
+ import { Editor, DiffEditor } from '@djangocfg/ui-tools';
480
+ // or tree-shakeable: import { Editor } from '@djangocfg/ui-tools/code-editor';
481
+
482
+ // Basic editor
483
+ <Editor
484
+ value="const x = 42;"
485
+ language="typescript"
486
+ onChange={(value) => console.log(value)}
487
+ options={{ fontSize: 14, minimap: false }}
488
+ />
489
+
490
+ // Diff view
491
+ <DiffEditor
492
+ original="const x = 1;"
493
+ modified="const x = 42;"
494
+ language="typescript"
495
+ />
496
+ ```
497
+
498
+ ### Context & Hooks
499
+
500
+ ```tsx
501
+ import {
502
+ EditorProvider,
503
+ useEditorContext,
504
+ useMonaco,
505
+ useEditor,
506
+ useLanguage,
507
+ } from '@djangocfg/ui-tools/code-editor';
508
+
509
+ // Multi-file editor with shared state
510
+ <EditorProvider onSave={async (path) => { /* save file */ }}>
511
+ <FileTree />
512
+ <Editor />
513
+ </EditorProvider>
514
+ ```
515
+
472
516
  ## Code Highlighting
473
517
 
518
+ Read-only syntax highlighting (lighter than Monaco — use when editing not needed):
519
+
474
520
  ```tsx
475
521
  import { PrettyCode } from '@djangocfg/ui-tools';
476
522