@@ -78,15 +78,72 @@ <h1>JSONLab</h1>
7878
7979 <!-- Compare Panel -->
8080 < div id ="compare-panel " class ="editor-panel compare-panel ">
81- < div class ="compare-header ">
82- < span > Original (Left)</ span >
83- < span > Modified (Right)</ span >
81+ < div class ="compare-header "
82+ style ="justify-content: flex-start; border-bottom: none; padding-bottom: 0; ">
83+ < span id ="label-original " style ="text-align: left; "> Original (Left)</ span >
84+ < span id ="label-modified " style ="text-align: left; "> Modified (Right)</ span >
85+ </ div >
86+ < div class ="compare-toolbars "
87+ style ="display: flex; justify-content: flex-start; background: var(--color-bg-secondary); ">
88+ < div id ="diff-original-toolbar " style ="flex: none; "> </ div >
89+ < div id ="diff-modified-toolbar " style ="flex: 1; "> </ div >
8490 </ div >
8591 <!-- Diff Editor -->
8692 < div id ="monaco-diff-container " class ="monaco-container "> </ div >
8793 <!-- Diff Summary (Restored) -->
8894 < div id ="diff-resize-handle " class ="diff-resize-handle "> </ div >
89- < div id ="diff-summary " class ="diff-output "> </ div >
95+ < div id ="diff-summary-wrapper " class ="diff-output "
96+ style ="display: flex; flex-direction: column; padding: 0; ">
97+ < div class ="diff-summary-header "
98+ style ="display: flex; justify-content: space-between; align-items: center; padding: 4px 12px; border-bottom: 1px solid var(--color-border); font-size: 12px; font-weight: 500; color: var(--color-text-muted); flex-shrink: 0; ">
99+ < div class ="engine-radios diff-view-toggle ">
100+ < label class ="radio-label " style ="padding: 2px 4px; ">
101+ < input type ="radio " name ="diff-view " value ="summary " checked >
102+ < span > Summary</ span >
103+ </ label >
104+ < label class ="radio-label " style ="padding: 2px 4px; ">
105+ < input type ="radio " name ="diff-view " value ="patch ">
106+ < span > JSON Patch</ span >
107+ </ label >
108+ </ div >
109+ </ div >
110+ < div id ="diff-summary " style ="flex: 1; overflow: auto; padding: var(--space-md); "> </ div >
111+
112+ <!-- Patch Editor Toolbar (Standardized) -->
113+ < div id ="diff-patch-toolbar " class ="toolbar hidden "
114+ style ="padding: 0 var(--space-lg); border-top: none; border-bottom: 1px solid var(--color-border); height: var(--toolbar-height); min-height: var(--toolbar-height); ">
115+ < div class ="toolbar-group ">
116+ < button id ="btn-patch-format " class ="btn btn-secondary btn-icon " title ="Format JSON Patch ">
117+ < i data-lucide ="align-left " class ="icon "> </ i >
118+ </ button >
119+ </ div >
120+
121+ < div class ="toolbar-divider "> </ div >
122+
123+ < div class ="toolbar-group ">
124+ < button id ="btn-patch-undo " class ="btn btn-secondary btn-icon " title ="Undo (Ctrl+Z) "
125+ disabled >
126+ < i data-lucide ="undo " class ="icon "> </ i >
127+ </ button >
128+ < button id ="btn-patch-redo " class ="btn btn-secondary btn-icon " title ="Redo (Ctrl+Y) "
129+ disabled >
130+ < i data-lucide ="redo " class ="icon "> </ i >
131+ </ button >
132+ </ div >
133+
134+ < div class ="toolbar-group ">
135+ < button id ="btn-patch-copy " class ="btn btn-secondary btn-icon " title ="Copy JSON Patch ">
136+ < i data-lucide ="copy " class ="icon "> </ i >
137+ </ button >
138+ < button id ="btn-patch-clear " class ="btn btn-secondary btn-icon "
139+ title ="Clear Patch (Reset Right Side) ">
140+ < i data-lucide ="trash-2 " class ="icon "> </ i >
141+ </ button >
142+ </ div >
143+ </ div >
144+
145+ < div id ="diff-patch-editor " class ="monaco-container hidden " style ="flex: 1; min-height: 0; "> </ div >
146+ </ div >
90147 </ div >
91148
92149 <!-- Query Panel -->
@@ -275,6 +332,7 @@ <h2>CSV Options</h2>
275332
276333 <!-- Query Libraries -->
277334 < script src ="https://cdn.jsdelivr.net/npm/jmespath@0.16.0/jmespath.min.js "> </ script >
335+ < script src ="https://cdn.jsdelivr.net/npm/fast-json-patch@3.1.1/dist/fast-json-patch.min.js "> </ script >
278336 < script type ="module ">
279337 import { jsonquery } from 'https://cdn.jsdelivr.net/npm/@jsonquerylang/jsonquery@5.1.1/lib/jsonquery.min.js' ;
280338 import { JSONPath } from 'https://cdn.jsdelivr.net/npm/jsonpath-plus@10.4.0/dist/index-browser-esm.min.js' ;
0 commit comments