diff --git a/package-lock.json b/package-lock.json index 8b301c6..97c60d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "shadcn-theme-editor", - "version": "1.3.3", + "version": "1.4.0-alpha.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shadcn-theme-editor", - "version": "1.3.3", + "version": "1.4.0-alpha.3", "license": "MIT", "dependencies": { "@radix-ui/react-slot": "^1.1.0", @@ -22,6 +22,10 @@ "@rollup/plugin-typescript": "^11.1.6", "@types/lodash.debounce": "^4.0.9", "@types/react": "^18.3.3", + "class-variance-authority": "^0.7.0", + "clsx": "^2.1.1", + "next-themes": "^0.3.0", + "react": "^18.3.1", "release-it": "^17.6.0", "rollup": "^4.18.1", "rollup-plugin-banner2": "^1.3.0", @@ -1508,8 +1512,8 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.0.tgz", "integrity": "sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==", + "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "clsx": "2.0.0" }, @@ -1521,7 +1525,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", - "peer": true, + "dev": true, "engines": { "node": ">=6" } @@ -1587,8 +1591,8 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -3756,7 +3760,6 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "license": "MIT", - "peer": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -4005,8 +4008,8 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.3.0.tgz", "integrity": "sha512-/QHIrsYpd6Kfk7xakK4svpDI5mmXP0gfvCoJdGpZQ2TOrQZmsW0QxjaiLn8wbIKjtm4BTSqLoix4lxYYOnLJ/w==", + "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "react": "^16.8 || ^17 || ^18", "react-dom": "^16.8 || ^17 || ^18" @@ -5306,7 +5309,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, diff --git a/package.json b/package.json index f8b5254..1edfc02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shadcn-theme-editor", - "version": "1.4.0-alpha.2", + "version": "1.4.0-alpha.4", "description": "Shadcn Theme Editor", "module": "dist/index.mjs", "main": "dist/index.js", diff --git a/src/components/SideBarColors.tsx b/src/components/SideBarColors.tsx index b4e4d6c..c6877f6 100644 --- a/src/components/SideBarColors.tsx +++ b/src/components/SideBarColors.tsx @@ -25,20 +25,16 @@ function SideBarColors() { }, 2000); useEffect(() => { - let isSavedThemeApplied = false; if (typeof colors == "undefined" || isMount) { // If colors are not defined (i.e., they haven't been set by other functions yet, meaning it's the first time), // or if this is due to a re-render caused by dependency changes (e.g., when currentTheme is updated). - try { - isSavedThemeApplied = setSavedTheme(currentTheme); - return; - } catch (error) {} + if (setSavedTheme(currentTheme)) return; // isSavedThemeApplied } if (typeof colors == "undefined") { themeEmittor.setDefaultTheme(); } - }, [currentTheme]); + }, [currentTheme, isMount]); return ( <>