@anmiles/theme-switcher 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.3](../../tags/v2.0.3) - 2025-11-29
9
+ ### Changed
10
+ - Fix vulnerable dependencies
11
+
8
12
  ## [2.0.2](../../tags/v2.0.2) - 2025-09-19
9
13
  ### Changed
10
14
  - Fix npm vulnerabilities
@@ -5,15 +5,6 @@ var ThemeSwitcher = function(exports, require$$0, require$$0$1) {
5
5
  document.head.appendChild(__vite_style__);
6
6
  var jsxRuntime = { exports: {} };
7
7
  var reactJsxRuntime_production_min = {};
8
- /**
9
- * @license React
10
- * react-jsx-runtime.production.min.js
11
- *
12
- * Copyright (c) Facebook, Inc. and its affiliates.
13
- *
14
- * This source code is licensed under the MIT license found in the
15
- * LICENSE file in the root directory of this source tree.
16
- */
17
8
  var hasRequiredReactJsxRuntime_production_min;
18
9
  function requireReactJsxRuntime_production_min() {
19
10
  if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
@@ -1,13 +1,5 @@
1
1
  var ThemeSwitcher=function(m,a,T){"use strict";var y=document.createElement("style");y.textContent=`.themeSwitcher{cursor:pointer;position:relative}.themeSwitcher>svg:hover,.themeSwitcher li:hover{filter:brightness(1.5)}.themeSwitcher svg{width:2em;height:2em;stroke:currentColor;display:block}.themeSwitcher ul{list-style-type:none;position:absolute;left:0;margin:.5em 0;padding:0;gap:0;overflow-y:visible;z-index:1}.themeSwitcher li{padding:.5em 1em}.themeSwitcher[data-float=right] ul{left:auto;right:0}.themeSwitcher li{display:flex;align-items:center;gap:.5em}.themeSwitcher li svg{width:1.5em;height:1.5em}.themeSwitcher svg.checked{width:16px;height:13.5px}
2
- /*$vite$:1*/`,document.head.appendChild(y);var x={exports:{}},l={};/**
3
- * @license React
4
- * react-jsx-runtime.production.min.js
5
- *
6
- * Copyright (c) Facebook, Inc. and its affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var j;function C(){if(j)return l;j=1;var s=a,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,v=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function f(c,o,h){var i,p={},g=null,E=null;h!==void 0&&(g=""+h),o.key!==void 0&&(g=""+o.key),o.ref!==void 0&&(E=o.ref);for(i in o)n.call(o,i)&&!w.hasOwnProperty(i)&&(p[i]=o[i]);if(c&&c.defaultProps)for(i in o=c.defaultProps,o)p[i]===void 0&&(p[i]=o[i]);return{$$typeof:t,type:c,key:g,ref:E,props:p,_owner:v.current}}return l.Fragment=r,l.jsx=f,l.jsxs=f,l}var S;function b(){return S||(S=1,x.exports=C()),x.exports}var e=b(),d={},k;function O(){if(k)return d;k=1;var s=T;return d.createRoot=s.createRoot,d.hydrateRoot=s.hydrateRoot,d}var N=O();class _{constructor(){this.listeners={}}on(t,r){(this.listeners[t]??=[]).push(r)}off(t,r){const n=this.listeners[t]??=[];n.splice(n.indexOf(r),1)}emit(t,...r){this.listeners[t]?.forEach(n=>{n(...r)})}}const u=["light","dark"],R="light";function P(s){return typeof s=="string"&&u.map(String).includes(s)}function I(s){switch(s){case"light":return"Light";case"dark":return"Dark";case void 0:default:return"System"}}class D extends _{get(){if(!("matchMedia"in window))return R;for(const t of u)if(window.matchMedia(`(prefers-color-scheme: ${t})`).matches)return t;return R}watch(){if("matchMedia"in window)for(const t of u)window.matchMedia(`(prefers-color-scheme: ${t})`).addEventListener("change",n=>{n.matches&&this.emit("change",t)})}}class B extends _{constructor(){super(...arguments),this.storageKey="theme"}get(){const t=localStorage.getItem(this.storageKey);return P(t)?t:void 0}set(t){t?localStorage.setItem(this.storageKey,t):localStorage.removeItem(this.storageKey),this.emit("change",t)}}function J(){return e.jsxs("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",className:"dark",strokeWidth:"8",strokeLinecap:"round",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"46",strokeDasharray:"180",transform:"rotate(22.5 50 50)"}),e.jsx("circle",{cx:"75",cy:"25",r:"46",strokeDasharray:"108 200",transform:"rotate(67.5 75 25)"})]})}function U(){return e.jsxs("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",className:"light",strokeWidth:"8",strokeLinecap:"round",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"20"}),e.jsx("path",{d:"M 50 86 v 10",transform:"rotate(0 50 50)"}),e.jsx("path",{d:"M 50 86 v 10",transform:"rotate(90 50 50)"}),e.jsx("path",{d:"M 50 86 v 10",transform:"rotate(180 50 50)"}),e.jsx("path",{d:"M 50 86 v 10",transform:"rotate(270 50 50)"}),e.jsx("path",{d:"M 50 86 v 15",transform:"rotate(45 50 50)"}),e.jsx("path",{d:"M 50 86 v 15",transform:"rotate(135 50 50)"}),e.jsx("path",{d:"M 50 86 v 15",transform:"rotate(225 50 50)"}),e.jsx("path",{d:"M 50 86 v 15",transform:"rotate(315 50 50)"})]})}function W(){return e.jsxs("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",className:"system",strokeWidth:"8",strokeLinecap:"round",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"46"}),e.jsx("path",{strokeWidth:"0",fill:"currentColor",d:`
2
+ /*$vite$:1*/`,document.head.appendChild(y);var x={exports:{}},l={};var j;function C(){if(j)return l;j=1;var s=a,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,v=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function f(c,o,h){var i,p={},g=null,E=null;h!==void 0&&(g=""+h),o.key!==void 0&&(g=""+o.key),o.ref!==void 0&&(E=o.ref);for(i in o)n.call(o,i)&&!w.hasOwnProperty(i)&&(p[i]=o[i]);if(c&&c.defaultProps)for(i in o=c.defaultProps,o)p[i]===void 0&&(p[i]=o[i]);return{$$typeof:t,type:c,key:g,ref:E,props:p,_owner:v.current}}return l.Fragment=r,l.jsx=f,l.jsxs=f,l}var S;function b(){return S||(S=1,x.exports=C()),x.exports}var e=b(),d={},k;function O(){if(k)return d;k=1;var s=T;return d.createRoot=s.createRoot,d.hydrateRoot=s.hydrateRoot,d}var N=O();class _{constructor(){this.listeners={}}on(t,r){(this.listeners[t]??=[]).push(r)}off(t,r){const n=this.listeners[t]??=[];n.splice(n.indexOf(r),1)}emit(t,...r){this.listeners[t]?.forEach(n=>{n(...r)})}}const u=["light","dark"],R="light";function P(s){return typeof s=="string"&&u.map(String).includes(s)}function I(s){switch(s){case"light":return"Light";case"dark":return"Dark";case void 0:default:return"System"}}class D extends _{get(){if(!("matchMedia"in window))return R;for(const t of u)if(window.matchMedia(`(prefers-color-scheme: ${t})`).matches)return t;return R}watch(){if("matchMedia"in window)for(const t of u)window.matchMedia(`(prefers-color-scheme: ${t})`).addEventListener("change",n=>{n.matches&&this.emit("change",t)})}}class B extends _{constructor(){super(...arguments),this.storageKey="theme"}get(){const t=localStorage.getItem(this.storageKey);return P(t)?t:void 0}set(t){t?localStorage.setItem(this.storageKey,t):localStorage.removeItem(this.storageKey),this.emit("change",t)}}function J(){return e.jsxs("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",className:"dark",strokeWidth:"8",strokeLinecap:"round",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"46",strokeDasharray:"180",transform:"rotate(22.5 50 50)"}),e.jsx("circle",{cx:"75",cy:"25",r:"46",strokeDasharray:"108 200",transform:"rotate(67.5 75 25)"})]})}function U(){return e.jsxs("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",className:"light",strokeWidth:"8",strokeLinecap:"round",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"20"}),e.jsx("path",{d:"M 50 86 v 10",transform:"rotate(0 50 50)"}),e.jsx("path",{d:"M 50 86 v 10",transform:"rotate(90 50 50)"}),e.jsx("path",{d:"M 50 86 v 10",transform:"rotate(180 50 50)"}),e.jsx("path",{d:"M 50 86 v 10",transform:"rotate(270 50 50)"}),e.jsx("path",{d:"M 50 86 v 15",transform:"rotate(45 50 50)"}),e.jsx("path",{d:"M 50 86 v 15",transform:"rotate(135 50 50)"}),e.jsx("path",{d:"M 50 86 v 15",transform:"rotate(225 50 50)"}),e.jsx("path",{d:"M 50 86 v 15",transform:"rotate(315 50 50)"})]})}function W(){return e.jsxs("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",className:"system",strokeWidth:"8",strokeLinecap:"round",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"46"}),e.jsx("path",{strokeWidth:"0",fill:"currentColor",d:`
11
3
  M 50,0
12
4
  a 50,50,0,1,1,0,100
13
5
  Z`})]})}function M({theme:s}){switch(s){case"light":return e.jsx(U,{});case"dark":return e.jsx(J,{});case void 0:default:return e.jsx(W,{})}}function K(){return e.jsx("svg",{viewBox:"0 0 640 540",xmlns:"http://www.w3.org/2000/svg",className:"checked",children:e.jsx("path",{fill:"currentColor",d:`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anmiles/theme-switcher",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Theme switcher for websites",
5
5
  "keywords": [
6
6
  "theme",
@@ -35,15 +35,15 @@
35
35
  "start:prod": "npm start production"
36
36
  },
37
37
  "dependencies": {
38
- "@anmiles/express-tools": "^2.0.3",
39
- "@anmiles/logger": "^8.0.1",
38
+ "@anmiles/express-tools": "^2.0.4",
39
+ "@anmiles/logger": "^8.0.2",
40
40
  "express": "^5.1.0",
41
41
  "npm-run-all": "^4.1.5",
42
42
  "react": "^18.3.1",
43
43
  "react-dom": "^18.3.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@anmiles/eslint-config": "^9.0.3",
46
+ "@anmiles/eslint-config": "^9.0.4",
47
47
  "@anmiles/tsconfig": "^4.0.0",
48
48
  "@eslint/compat": "^1.3.1",
49
49
  "@eslint/css": "^0.10.0",