@@ -57,6 +57,7 @@ export type CatalogPreviewRow = ThemePair & {
5757 contrast : SableThemeContrast ;
5858 tags : string [ ] ;
5959 fullInstallUrl : string ;
60+ defaults ?: SableThemeMetadata [ 'defaults' ] ;
6061} ;
6162
6263export type LocalPreviewRow = ThemeRemoteFavorite & {
@@ -68,6 +69,7 @@ export type LocalPreviewRow = ThemeRemoteFavorite & {
6869 contrast : SableThemeContrast ;
6970 tags : string [ ] ;
7071 importedLocal ?: boolean ;
72+ defaults ?: SableThemeMetadata [ 'defaults' ] ;
7173} ;
7274
7375export type CatalogTweakRow = TweakCatalogEntry & {
@@ -355,6 +357,7 @@ export function ThemeCatalogSettings({
355357 contrast,
356358 tags : meta . tags ?? [ ] ,
357359 fullInstallUrl,
360+ defaults : meta . defaults ,
358361 } ;
359362 } )
360363 ) ;
@@ -484,6 +487,7 @@ export function ThemeCatalogSettings({
484487 contrast,
485488 tags : meta . tags ?? [ ] ,
486489 importedLocal : fav . importedLocal ,
490+ defaults : meta . defaults ,
487491 ...( authorTrim ? { author : authorTrim } : { } ) ,
488492 } ;
489493 return row ;
@@ -559,30 +563,81 @@ export function ThemeCatalogSettings({
559563
560564 const applyFavoriteToLight = useCallback (
561565 ( row : LocalPreviewRow ) => {
562- patchSettings ( {
566+ const patch : Partial < Settings > = {
563567 themeRemoteLightFullUrl : row . fullUrl ,
564568 themeRemoteLightKind : row . kind ,
565- } ) ;
569+ } ;
570+ if ( row . defaults ?. neonGlass ) {
571+ const ng = row . defaults . neonGlass ;
572+ if ( ng . primaryColor ) patch . neonGlassPrimaryColor = ng . primaryColor ;
573+ if ( ng . blurRadius !== undefined ) patch . neonGlassBlur = ng . blurRadius ;
574+ if ( ng . bgOpacity !== undefined ) patch . neonGlassBgOpacity = ng . bgOpacity ;
575+ if ( ng . chatOpacity !== undefined ) patch . neonGlassChatOpacity = ng . chatOpacity ;
576+ if ( ng . glowRadius !== undefined ) patch . neonGlassGlow = ng . glowRadius ;
577+ if ( ng . bubbleGlow !== undefined ) patch . neonGlassBubbleGlow = ng . bubbleGlow ;
578+ if ( ng . applySidebar !== undefined ) patch . neonGlassApplySidebar = ng . applySidebar ;
579+ if ( ng . applyChat !== undefined ) patch . neonGlassApplyChat = ng . applyChat ;
580+ if ( ng . applyModals !== undefined ) patch . neonGlassApplyModals = ng . applyModals ;
581+ if ( ng . applyReply !== undefined ) patch . neonGlassApplyReply = ng . applyReply ;
582+ patch . neonGlassEnabled = true ;
583+ } else {
584+ patch . neonGlassEnabled = false ;
585+ }
586+ patchSettings ( patch ) ;
566587 } ,
567588 [ patchSettings ]
568589 ) ;
569590
570591 const applyFavoriteToDark = useCallback (
571592 ( row : LocalPreviewRow ) => {
572- patchSettings ( {
593+ const patch : Partial < Settings > = {
573594 themeRemoteDarkFullUrl : row . fullUrl ,
574595 themeRemoteDarkKind : row . kind ,
575- } ) ;
596+ } ;
597+ if ( row . defaults ?. neonGlass ) {
598+ const ng = row . defaults . neonGlass ;
599+ if ( ng . primaryColor ) patch . neonGlassPrimaryColor = ng . primaryColor ;
600+ if ( ng . blurRadius !== undefined ) patch . neonGlassBlur = ng . blurRadius ;
601+ if ( ng . bgOpacity !== undefined ) patch . neonGlassBgOpacity = ng . bgOpacity ;
602+ if ( ng . chatOpacity !== undefined ) patch . neonGlassChatOpacity = ng . chatOpacity ;
603+ if ( ng . glowRadius !== undefined ) patch . neonGlassGlow = ng . glowRadius ;
604+ if ( ng . bubbleGlow !== undefined ) patch . neonGlassBubbleGlow = ng . bubbleGlow ;
605+ if ( ng . applySidebar !== undefined ) patch . neonGlassApplySidebar = ng . applySidebar ;
606+ if ( ng . applyChat !== undefined ) patch . neonGlassApplyChat = ng . applyChat ;
607+ if ( ng . applyModals !== undefined ) patch . neonGlassApplyModals = ng . applyModals ;
608+ if ( ng . applyReply !== undefined ) patch . neonGlassApplyReply = ng . applyReply ;
609+ patch . neonGlassEnabled = true ;
610+ } else {
611+ patch . neonGlassEnabled = false ;
612+ }
613+ patchSettings ( patch ) ;
576614 } ,
577615 [ patchSettings ]
578616 ) ;
579617
580618 const applyFavoriteToManual = useCallback (
581619 ( row : LocalPreviewRow ) => {
582- patchSettings ( {
620+ const patch : Partial < Settings > = {
583621 themeRemoteManualFullUrl : row . fullUrl ,
584622 themeRemoteManualKind : row . kind ,
585- } ) ;
623+ } ;
624+ if ( row . defaults ?. neonGlass ) {
625+ const ng = row . defaults . neonGlass ;
626+ if ( ng . primaryColor ) patch . neonGlassPrimaryColor = ng . primaryColor ;
627+ if ( ng . blurRadius !== undefined ) patch . neonGlassBlur = ng . blurRadius ;
628+ if ( ng . bgOpacity !== undefined ) patch . neonGlassBgOpacity = ng . bgOpacity ;
629+ if ( ng . chatOpacity !== undefined ) patch . neonGlassChatOpacity = ng . chatOpacity ;
630+ if ( ng . glowRadius !== undefined ) patch . neonGlassGlow = ng . glowRadius ;
631+ if ( ng . bubbleGlow !== undefined ) patch . neonGlassBubbleGlow = ng . bubbleGlow ;
632+ if ( ng . applySidebar !== undefined ) patch . neonGlassApplySidebar = ng . applySidebar ;
633+ if ( ng . applyChat !== undefined ) patch . neonGlassApplyChat = ng . applyChat ;
634+ if ( ng . applyModals !== undefined ) patch . neonGlassApplyModals = ng . applyModals ;
635+ if ( ng . applyReply !== undefined ) patch . neonGlassApplyReply = ng . applyReply ;
636+ patch . neonGlassEnabled = true ;
637+ } else {
638+ patch . neonGlassEnabled = false ;
639+ }
640+ patchSettings ( patch ) ;
586641 } ,
587642 [ patchSettings ]
588643 ) ;
@@ -697,11 +752,28 @@ export function ThemeCatalogSettings({
697752 ] ;
698753 }
699754
700- patchSettings ( {
755+ const patch : Partial < Settings > = {
701756 themeRemoteLightFullUrl : row . fullInstallUrl ,
702757 themeRemoteLightKind : kind ,
703758 themeRemoteFavorites : pruneFavorites ( nextFavorites , nextActive ) ,
704- } ) ;
759+ } ;
760+ if ( row . defaults ?. neonGlass ) {
761+ const ng = row . defaults . neonGlass ;
762+ if ( ng . primaryColor ) patch . neonGlassPrimaryColor = ng . primaryColor ;
763+ if ( ng . blurRadius !== undefined ) patch . neonGlassBlur = ng . blurRadius ;
764+ if ( ng . bgOpacity !== undefined ) patch . neonGlassBgOpacity = ng . bgOpacity ;
765+ if ( ng . chatOpacity !== undefined ) patch . neonGlassChatOpacity = ng . chatOpacity ;
766+ if ( ng . glowRadius !== undefined ) patch . neonGlassGlow = ng . glowRadius ;
767+ if ( ng . bubbleGlow !== undefined ) patch . neonGlassBubbleGlow = ng . bubbleGlow ;
768+ if ( ng . applySidebar !== undefined ) patch . neonGlassApplySidebar = ng . applySidebar ;
769+ if ( ng . applyChat !== undefined ) patch . neonGlassApplyChat = ng . applyChat ;
770+ if ( ng . applyModals !== undefined ) patch . neonGlassApplyModals = ng . applyModals ;
771+ if ( ng . applyReply !== undefined ) patch . neonGlassApplyReply = ng . applyReply ;
772+ patch . neonGlassEnabled = true ;
773+ } else {
774+ patch . neonGlassEnabled = false ;
775+ }
776+ patchSettings ( patch ) ;
705777 } ,
706778 [ darkRemoteFullUrl , favorites , manualRemoteFullUrl , patchSettings , prefetchFull , pruneFavorites ]
707779 ) ;
@@ -732,11 +804,28 @@ export function ThemeCatalogSettings({
732804 ] ;
733805 }
734806
735- patchSettings ( {
807+ const patch : Partial < Settings > = {
736808 themeRemoteDarkFullUrl : row . fullInstallUrl ,
737809 themeRemoteDarkKind : kind ,
738810 themeRemoteFavorites : pruneFavorites ( nextFavorites , nextActive ) ,
739- } ) ;
811+ } ;
812+ if ( row . defaults ?. neonGlass ) {
813+ const ng = row . defaults . neonGlass ;
814+ if ( ng . primaryColor ) patch . neonGlassPrimaryColor = ng . primaryColor ;
815+ if ( ng . blurRadius !== undefined ) patch . neonGlassBlur = ng . blurRadius ;
816+ if ( ng . bgOpacity !== undefined ) patch . neonGlassBgOpacity = ng . bgOpacity ;
817+ if ( ng . chatOpacity !== undefined ) patch . neonGlassChatOpacity = ng . chatOpacity ;
818+ if ( ng . glowRadius !== undefined ) patch . neonGlassGlow = ng . glowRadius ;
819+ if ( ng . bubbleGlow !== undefined ) patch . neonGlassBubbleGlow = ng . bubbleGlow ;
820+ if ( ng . applySidebar !== undefined ) patch . neonGlassApplySidebar = ng . applySidebar ;
821+ if ( ng . applyChat !== undefined ) patch . neonGlassApplyChat = ng . applyChat ;
822+ if ( ng . applyModals !== undefined ) patch . neonGlassApplyModals = ng . applyModals ;
823+ if ( ng . applyReply !== undefined ) patch . neonGlassApplyReply = ng . applyReply ;
824+ patch . neonGlassEnabled = true ;
825+ } else {
826+ patch . neonGlassEnabled = false ;
827+ }
828+ patchSettings ( patch ) ;
740829 } ,
741830 [
742831 favorites ,
@@ -774,11 +863,28 @@ export function ThemeCatalogSettings({
774863 ] ;
775864 }
776865
777- patchSettings ( {
866+ const patch : Partial < Settings > = {
778867 themeRemoteManualFullUrl : row . fullInstallUrl ,
779868 themeRemoteManualKind : kind ,
780869 themeRemoteFavorites : pruneFavorites ( nextFavorites , nextActive ) ,
781- } ) ;
870+ } ;
871+ if ( row . defaults ?. neonGlass ) {
872+ const ng = row . defaults . neonGlass ;
873+ if ( ng . primaryColor ) patch . neonGlassPrimaryColor = ng . primaryColor ;
874+ if ( ng . blurRadius !== undefined ) patch . neonGlassBlur = ng . blurRadius ;
875+ if ( ng . bgOpacity !== undefined ) patch . neonGlassBgOpacity = ng . bgOpacity ;
876+ if ( ng . chatOpacity !== undefined ) patch . neonGlassChatOpacity = ng . chatOpacity ;
877+ if ( ng . glowRadius !== undefined ) patch . neonGlassGlow = ng . glowRadius ;
878+ if ( ng . bubbleGlow !== undefined ) patch . neonGlassBubbleGlow = ng . bubbleGlow ;
879+ if ( ng . applySidebar !== undefined ) patch . neonGlassApplySidebar = ng . applySidebar ;
880+ if ( ng . applyChat !== undefined ) patch . neonGlassApplyChat = ng . applyChat ;
881+ if ( ng . applyModals !== undefined ) patch . neonGlassApplyModals = ng . applyModals ;
882+ if ( ng . applyReply !== undefined ) patch . neonGlassApplyReply = ng . applyReply ;
883+ patch . neonGlassEnabled = true ;
884+ } else {
885+ patch . neonGlassEnabled = false ;
886+ }
887+ patchSettings ( patch ) ;
782888 } ,
783889 [ darkRemoteFullUrl , favorites , lightRemoteFullUrl , patchSettings , prefetchFull , pruneFavorites ]
784890 ) ;
0 commit comments