@@ -610,7 +610,7 @@ export function ThemeEditorPanel({
610610 [ activeAppearance , editingTheme , selectedRole ] ,
611611 ) ;
612612
613- const handleSubmit = useCallback ( ( ) => {
613+ const handleSubmit = ( ) => {
614614 if ( ! name . trim ( ) ) {
615615 setError ( "Name your theme first." ) ;
616616 return ;
@@ -645,8 +645,8 @@ export function ThemeEditorPanel({
645645 return ;
646646 }
647647 mergedAppearance = editedModes [ 0 ] ?? null ;
648- savedTheme = updateCustomTheme (
649- parseThemeFile ( {
648+ savedTheme = updateCustomTheme ( {
649+ ... parseThemeFile ( {
650650 version : THEME_FILE_VERSION ,
651651 id : mergeTarget . id ,
652652 name : mergeTarget . label ,
@@ -658,7 +658,8 @@ export function ThemeEditorPanel({
658658 } ,
659659 ...( mergeTarget . managed === true && ! isAdvanced ? { managed : true } : { } ) ,
660660 } ) ,
661- ) ;
661+ ...( mergeTarget . collection ? { collection : mergeTarget . collection } : { } ) ,
662+ } ) ;
662663 retiredTheme = editingTheme ;
663664 try {
664665 removeCustomTheme ( editingTheme . id ) ;
@@ -676,8 +677,8 @@ export function ThemeEditorPanel({
676677 } else if ( editingTheme ) {
677678 const baseAppearance = editingTheme . appearance ;
678679 const variantAppearance = baseAppearance === "light" ? "dark" : "light" ;
679- savedTheme = updateCustomTheme (
680- parseThemeFile ( {
680+ savedTheme = updateCustomTheme ( {
681+ ... parseThemeFile ( {
681682 version : THEME_FILE_VERSION ,
682683 id : editingTheme . id ,
683684 name,
@@ -688,7 +689,8 @@ export function ThemeEditorPanel({
688689 : { } ) ,
689690 ...( isAdvanced ? { } : { managed : true } ) ,
690691 } ) ,
691- ) ;
692+ ...( editingTheme . collection ? { collection : editingTheme . collection } : { } ) ,
693+ } ) ;
692694 } else if ( mergeTarget ) {
693695 if ( takenAppearances . includes ( activeAppearance ) ) {
694696 setError (
@@ -701,8 +703,8 @@ export function ThemeEditorPanel({
701703 // survives when every palette in the theme came from the guided
702704 // editor.
703705 mergedAppearance = activeAppearance ;
704- savedTheme = updateCustomTheme (
705- parseThemeFile ( {
706+ savedTheme = updateCustomTheme ( {
707+ ... parseThemeFile ( {
706708 version : THEME_FILE_VERSION ,
707709 id : mergeTarget . id ,
708710 name : mergeTarget . label ,
@@ -714,7 +716,8 @@ export function ThemeEditorPanel({
714716 } ,
715717 ...( mergeTarget . managed === true && ! isAdvanced ? { managed : true } : { } ) ,
716718 } ) ,
717- ) ;
719+ ...( mergeTarget . collection ? { collection : mergeTarget . collection } : { } ) ,
720+ } ) ;
718721 } else {
719722 savedTheme = installCustomTheme (
720723 parseThemeFile ( {
@@ -762,19 +765,7 @@ export function ThemeEditorPanel({
762765 : "Could not create the theme." ,
763766 ) ;
764767 }
765- } , [
766- activeAppearance ,
767- colorsByAppearance ,
768- editingTheme ,
769- isAdvanced ,
770- isEditing ,
771- mergeTarget ,
772- name ,
773- onOpenChange ,
774- onSaved ,
775- simpleColorsDirtyByAppearance ,
776- takenAppearances ,
777- ] ) ;
768+ } ;
778769
779770 const renderNameField = ( ) => (
780771 < label className = "grid grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-center gap-3" >
0 commit comments