1+ import i18n from "shared/i18n" ;
2+
13import { LocalCachePersister } from 'shared/types/persister' ;
24import { IUIManager } from 'shared/types/uiManager' ;
35import { SpaceManagerInterface } from 'shared/types/spaceManager' ;
@@ -550,7 +552,7 @@ export class ObsidianAssetManager implements IAssetManager {
550552 type : 'iconset' ,
551553 icons : lucideIconMetadata ,
552554 theme : 'auto' ,
553- description : 'Lucide icon library for Obsidian' ,
555+ description : i18n . labels . lucideIconLibraryForObsidian ,
554556 tags : [ 'default' , 'builtin' , 'lucide' ] ,
555557 format : 'svg' ,
556558 created : Date . now ( ) ,
@@ -584,7 +586,7 @@ export class ObsidianAssetManager implements IAssetManager {
584586 type : 'iconset' ,
585587 icons : emojiIconMetadata ,
586588 theme : 'auto' ,
587- description : 'Emoji icon library' ,
589+ description : i18n . labels . emojiIconLibrary ,
588590 tags : [ 'default' , 'builtin' , 'emoji' ] ,
589591 format : 'emoji' ,
590592 created : Date . now ( ) ,
@@ -610,18 +612,18 @@ export class ObsidianAssetManager implements IAssetManager {
610612 path : `${ this . ASSETS_SPACE_PATH } /color-palettes/default-palette` ,
611613 type : 'colorpalette' ,
612614 colors : [
613- { name : "Red" , value : "var(--mk-color-red)" , category : 'brand' } ,
614- { name : "Pink" , value : "var(--mk-color-pink)" , category : 'brand' } ,
615- { name : "Orange" , value : "var(--mk-color-orange)" , category : 'brand' } ,
616- { name : "Yellow" , value : "var(--mk-color-yellow)" , category : 'brand' } ,
617- { name : "Green" , value : "var(--mk-color-green)" , category : 'brand' } ,
618- { name : "Turquoise" , value : "var(--mk-color-turquoise)" , category : 'brand' } ,
619- { name : "Teal" , value : "var(--mk-color-teal)" , category : 'brand' } ,
620- { name : "Blue" , value : "var(--mk-color-blue)" , category : 'brand' } ,
621- { name : "Purple" , value : "var(--mk-color-purple)" , category : 'brand' } ,
622- { name : "Brown" , value : "var(--mk-color-brown)" , category : 'brand' } ,
623- { name : "Charcoal" , value : "var(--mk-color-charcoal)" , category : 'brand' } ,
624- { name : "Gray" , value : "var(--mk-color-gray)" , category : 'brand' } ,
615+ { name : i18n . colors . red , value : "var(--mk-color-red)" , category : 'brand' } ,
616+ { name : i18n . colors . pink , value : "var(--mk-color-pink)" , category : 'brand' } ,
617+ { name : i18n . colors . orange , value : "var(--mk-color-orange)" , category : 'brand' } ,
618+ { name : i18n . colors . yellow , value : "var(--mk-color-yellow)" , category : 'brand' } ,
619+ { name : i18n . colors . green , value : "var(--mk-color-green)" , category : 'brand' } ,
620+ { name : i18n . colors . turquoise , value : "var(--mk-color-turquoise)" , category : 'brand' } ,
621+ { name : i18n . colors . teal , value : "var(--mk-color-teal)" , category : 'brand' } ,
622+ { name : i18n . colors . blue , value : "var(--mk-color-blue)" , category : 'brand' } ,
623+ { name : i18n . colors . purple , value : "var(--mk-color-purple)" , category : 'brand' } ,
624+ { name : i18n . colors . brown , value : "var(--mk-color-brown)" , category : 'brand' } ,
625+ { name : i18n . colors . charcoal , value : "var(--mk-color-charcoal)" , category : 'brand' } ,
626+ { name : i18n . colors . gray , value : "var(--mk-color-gray)" , category : 'brand' } ,
625627 ] ,
626628 gradients : [ ] ,
627629 designSystemMapping : {
@@ -643,7 +645,7 @@ export class ObsidianAssetManager implements IAssetManager {
643645 } ,
644646 tags : [ 'default' , 'theme' ] ,
645647 category : 'theme' ,
646- description : 'Default MakeML color palette with theme colors' ,
648+ description : i18n . descriptions . defaultMakemlColorPaletteWithThemeColors ,
647649 created : Date . now ( ) ,
648650 modified : Date . now ( ) ,
649651 } ;
@@ -660,17 +662,17 @@ export class ObsidianAssetManager implements IAssetManager {
660662 path : `${ this . ASSETS_SPACE_PATH } /color-palettes/monochrome-palette` ,
661663 type : 'colorpalette' ,
662664 colors : [
663- { name : "Base 0" , value : "var(--mk-color-base-0)" , category : 'base' } ,
664- { name : "Base 10" , value : "var(--mk-color-base-10)" , category : 'base' } ,
665- { name : "Base 20" , value : "var(--mk-color-base-20)" , category : 'base' } ,
666- { name : "Base 30" , value : "var(--mk-color-base-30)" , category : 'base' } ,
667- { name : "Base 40" , value : "var(--mk-color-base-40)" , category : 'base' } ,
668- { name : "Base 50" , value : "var(--mk-color-base-50)" , category : 'base' } ,
669- { name : "Base 60" , value : "var(--mk-color-base-60)" , category : 'base' } ,
670- { name : "Base 70" , value : "var(--mk-color-base-70)" , category : 'base' } ,
671- { name : "Base 80" , value : "var(--mk-color-base-80)" , category : 'base' } ,
672- { name : "Base 90" , value : "var(--mk-color-base-90)" , category : 'base' } ,
673- { name : "Base 100" , value : "var(--mk-color-base-100)" , category : 'base' } ,
665+ { name : i18n . labels . base0 , value : "var(--mk-color-base-0)" , category : 'base' } ,
666+ { name : i18n . labels . base10 , value : "var(--mk-color-base-10)" , category : 'base' } ,
667+ { name : i18n . labels . base20 , value : "var(--mk-color-base-20)" , category : 'base' } ,
668+ { name : i18n . labels . base30 , value : "var(--mk-color-base-30)" , category : 'base' } ,
669+ { name : i18n . labels . base40 , value : "var(--mk-color-base-40)" , category : 'base' } ,
670+ { name : i18n . labels . base50 , value : "var(--mk-color-base-50)" , category : 'base' } ,
671+ { name : i18n . labels . base60 , value : "var(--mk-color-base-60)" , category : 'base' } ,
672+ { name : i18n . labels . base70 , value : "var(--mk-color-base-70)" , category : 'base' } ,
673+ { name : i18n . labels . base80 , value : "var(--mk-color-base-80)" , category : 'base' } ,
674+ { name : i18n . labels . base90 , value : "var(--mk-color-base-90)" , category : 'base' } ,
675+ { name : i18n . labels . base100 , value : "var(--mk-color-base-100)" , category : 'base' } ,
674676 ] ,
675677 gradients : [ ] ,
676678 designSystemMapping : {
@@ -691,7 +693,7 @@ export class ObsidianAssetManager implements IAssetManager {
691693 } ,
692694 tags : [ 'default' , 'monochrome' , 'base' ] ,
693695 category : 'theme' ,
694- description : 'Monochrome color palette with base colors' ,
696+ description : i18n . descriptions . monochromeColorPaletteWithBaseColors ,
695697 created : Date . now ( ) ,
696698 modified : Date . now ( ) ,
697699 } ;
@@ -708,7 +710,7 @@ export class ObsidianAssetManager implements IAssetManager {
708710 if ( needsGradientPalette ) {
709711 const defaultGradientPalette : ColorPaletteAsset = {
710712 id : 'default-gradient-palette' ,
711- name : 'Gradients' ,
713+ name : i18n . labels . gradients ,
712714 path : `${ this . ASSETS_SPACE_PATH } /color-palettes/default-gradient-palette` ,
713715 type : 'colorpalette' ,
714716 colors : [
@@ -725,7 +727,7 @@ export class ObsidianAssetManager implements IAssetManager {
725727 } ,
726728 tags : [ 'default' , 'gradients' ] ,
727729 category : 'material' ,
728- description : 'Default gradient palette with beautiful gradients' ,
730+ description : i18n . descriptions . defaultGradientPaletteWithBeautifulGradients ,
729731 created : Date . now ( ) ,
730732 modified : Date . now ( ) ,
731733 } ;
@@ -743,23 +745,23 @@ export class ObsidianAssetManager implements IAssetManager {
743745 type : 'colorpalette' ,
744746 colors : [
745747 { name : "Light Pink" , value : "#FFB6C1" , category : 'custom' } ,
746- { name : "Gold" , value : "#FFD700" , category : 'custom' } ,
748+ { name : i18n . colors . gold , value : "#FFD700" , category : 'custom' } ,
747749 { name : "Pale Green" , value : "#98FB98" , category : 'custom' } ,
748750 { name : "Sky Blue" , value : "#87CEEB" , category : 'custom' } ,
749- { name : "Plum" , value : "#DDA0DD" , category : 'custom' } ,
750- { name : "Khaki" , value : "#F0E68C" , category : 'custom' } ,
751+ { name : i18n . colors . plum , value : "#DDA0DD" , category : 'custom' } ,
752+ { name : i18n . colors . khaki , value : "#F0E68C" , category : 'custom' } ,
751753 { name : "Light Salmon" , value : "#FFA07A" , category : 'custom' } ,
752754 { name : "Powder Blue" , value : "#B0E0E6" , category : 'custom' } ,
753- { name : "Moccasin" , value : "#FFE4B5" , category : 'custom' } ,
754- { name : "Lavender" , value : "#E6E6FA" , category : 'custom' }
755+ { name : i18n . colors . moccasin , value : "#FFE4B5" , category : 'custom' } ,
756+ { name : i18n . colors . lavender , value : "#E6E6FA" , category : 'custom' }
755757 ] ,
756758 designSystemMapping : {
757759 baseTokens : { } ,
758760 semanticTokens : { }
759761 } ,
760762 tags : [ 'default' , 'pastel' , 'light' ] ,
761763 category : 'theme' ,
762- description : 'Soft pastel colors for gentle visualizations' ,
764+ description : i18n . descriptions . softPastelColorsForGentleVisualizations ,
763765 created : Date . now ( ) ,
764766 modified : Date . now ( ) ,
765767 } ;
@@ -1178,8 +1180,23 @@ export class ObsidianAssetManager implements IAssetManager {
11781180 } catch ( error ) {
11791181 console . error ( `[ObsidianAssetManager] Failed to remove iconset ${ id } from mapping:` , error ) ;
11801182 }
1183+
1184+ // Delete the iconset folder and all its assets
1185+ const iconsetFolderPath = `.space/iconsets/${ id } ` ;
1186+ try {
1187+ const folderExists = await this . pathExists ( iconsetFolderPath ) ;
1188+ if ( folderExists ) {
1189+ await this . deletePath ( iconsetFolderPath ) ;
1190+ console . log ( `[ObsidianAssetManager] Deleted iconset folder: ${ iconsetFolderPath } ` ) ;
1191+ }
1192+ } catch ( error ) {
1193+ console . error ( `[ObsidianAssetManager] Failed to delete iconset folder ${ iconsetFolderPath } :` , error ) ;
1194+ }
11811195 }
11821196
1197+ // Clear iconset cache
1198+ this . iconsetCaches . delete ( id ) ;
1199+
11831200 return deleted ;
11841201 } catch ( error ) {
11851202 console . error ( `[ObsidianAssetManager] Failed to delete iconset ${ id } :` , error ) ;
0 commit comments