@@ -10,8 +10,10 @@ import { loadMonaco } from './monaco-editor';
1010import { setupCodeEditor } from './components/code-editor' ;
1111import { setupConfigEditor } from './components/config-editor' ;
1212import { setupConsoleOutput } from './components/console' ;
13+ import { setupCopyLink } from './components/copy-link' ;
1314import { setupDepsEditor } from './components/deps-editor' ;
1415import { setupLintServer } from './linter-service' ;
16+ import { setupReport } from './components/report' ;
1517import { setupTabs } from './components/output-tabs' ;
1618import { setupWarningsPanel } from './components/warnings' ;
1719import type stylelint from 'stylelint' ;
@@ -104,7 +106,7 @@ export async function mount({ element, init, listeners }: MountOptions) {
104106 config : value ,
105107 } ) ;
106108 } ) ,
107- onChangeFormat : debounce ( ( format ) => {
109+ onChangeFormat : debounce ( async ( format ) => {
108110 onChangeValues ( {
109111 configFormat : format ,
110112 } ) ;
@@ -120,11 +122,7 @@ export async function mount({ element, init, listeners }: MountOptions) {
120122 return ;
121123 }
122124
123- listeners ?. onChange ?.( {
124- code : codeEditor . getLeftValue ( ) ,
125- fileName : codeEditor . getFileName ( ) ,
126- config : configEditor . getValue ( ) ,
127- configFormat : configEditor . getFormat ( ) ,
125+ onChangeValues ( {
128126 deps : value ,
129127 } ) ;
130128
@@ -146,6 +144,21 @@ export async function mount({ element, init, listeners }: MountOptions) {
146144 loadMonaco ( ) ,
147145 ] ) ;
148146
147+ setupReport ( {
148+ element : element . querySelector < HTMLElement > ( 'sd-report' ) ! ,
149+ getData : ( ) => ( {
150+ config : configEditor . getValue ( ) ,
151+ configFormat : configEditor . getFormat ( ) ,
152+ code : codeEditor . getLeftValue ( ) ,
153+ fileName : codeEditor . getFileName ( ) ,
154+ packages : depsEditor . getPackages ( ) ,
155+ } ) ,
156+ } ) ;
157+
158+ setupCopyLink ( {
159+ element : element . querySelector < HTMLElement > ( 'sd-copy-link' ) ! ,
160+ } ) ;
161+
149162 const mediaQuery = window . matchMedia ( '(prefers-color-scheme: dark)' ) ;
150163 const updateTheme = ( ) => {
151164 monaco . editor . setTheme ( mediaQuery . matches ? 'vs-dark' : 'vs' ) ;
@@ -226,19 +239,22 @@ export async function mount({ element, init, listeners }: MountOptions) {
226239 fileName = codeEditor . getFileName ( ) ,
227240 config = configEditor . getValue ( ) ,
228241 configFormat = configEditor . getFormat ( ) ,
242+ deps = depsEditor . getValue ( ) ,
229243 } : {
230244 code ?: string ;
231245 fileName ?: string ;
232246 config ?: string ;
233247 configFormat ?: ConfigFormat ;
248+ deps ?: string ;
234249 } ) {
235250 listeners ?. onChange ?.( {
236251 code,
237252 fileName,
238253 config,
239254 configFormat,
240- deps : depsEditor . getValue ( ) ,
255+ deps,
241256 } ) ;
257+
242258 lint ( {
243259 code,
244260 fileName,
0 commit comments