@devup-ui/react 1.0.32 → 1.0.34

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={get:()=>null,set:()=>{},subscribe:()=>()=>{}};function r(){return e}exports.createServerThemeStore=r;
@@ -0,0 +1,3 @@
1
+ import { createThemeStore } from './theme-store';
2
+ export declare function createServerThemeStore(): ReturnType<typeof createThemeStore>;
3
+ //# sourceMappingURL=theme-store-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-store-server.d.ts","sourceRoot":"","sources":["../../src/stores/theme-store-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAQrD,wBAAgB,sBAAsB,IAAI,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAE5E"}
@@ -0,0 +1,13 @@
1
+ const e = {
2
+ get: () => null,
3
+ set: () => {
4
+ },
5
+ subscribe: () => () => {
6
+ }
7
+ };
8
+ function r() {
9
+ return e;
10
+ }
11
+ export {
12
+ r as createServerThemeStore
13
+ };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=null;function c(){if(typeof window>"u")return{get:()=>u,set:()=>{},subscribe:()=>()=>{}};const o=document.documentElement,r=new Set;let n=u;const i=()=>n,s=e=>{n=e,r.forEach(t=>t(n))},a=e=>(r.add(e),s(o.getAttribute("data-theme")),()=>r.delete(e));return new MutationObserver(e=>{e.filter(t=>t.type==="attributes"&&t.target instanceof HTMLElement).forEach(t=>{s(t.target.getAttribute("data-theme"))})}).observe(o,{attributes:!0,attributeFilter:["data-theme"],subtree:!1}),{get:i,set:s,subscribe:a}}exports.createThemeStore=c;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./theme-store-server.cjs");function i(){const s=document.documentElement,r=new Set;let o=null;const a=()=>o,n=e=>{o=e,r.forEach(t=>t(o))},c=e=>(r.add(e),n(s.getAttribute("data-theme")),()=>r.delete(e));return new MutationObserver(e=>{e.filter(t=>t.type==="attributes"&&t.target instanceof HTMLElement).forEach(t=>{n(t.target.getAttribute("data-theme"))})}).observe(s,{attributes:!0,attributeFilter:["data-theme"],subtree:!1}),{get:a,set:n,subscribe:c}}const m=typeof window>"u"?u.createServerThemeStore:i;exports.createThemeStore=m;
@@ -1,14 +1,11 @@
1
1
  import { DevupTheme } from '../types/theme';
2
2
  type Theme = keyof DevupTheme | null;
3
3
  type StoreChangeEvent = (newTheme: Theme) => void;
4
- export declare function createThemeStore(): {
5
- get: () => null;
6
- set: () => void;
7
- subscribe: () => () => void;
8
- } | {
4
+ declare function createClientThemeStore(): {
9
5
  get: () => null;
10
6
  set: (newTheme: Theme) => void;
11
7
  subscribe: (onStoreChange: StoreChangeEvent) => () => boolean;
12
8
  };
9
+ export declare const createThemeStore: typeof createClientThemeStore;
13
10
  export {};
14
11
  //# sourceMappingURL=theme-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme-store.d.ts","sourceRoot":"","sources":["../../src/stores/theme-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,KAAK,KAAK,GAAG,MAAM,UAAU,GAAG,IAAI,CAAA;AACpC,KAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAA;AAIjD,wBAAgB,gBAAgB;;;;;;oBAYP,KAAK;+BAKM,gBAAgB;EAuBnD"}
1
+ {"version":3,"file":"theme-store.d.ts","sourceRoot":"","sources":["../../src/stores/theme-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,KAAK,KAAK,GAAG,MAAM,UAAU,GAAG,IAAI,CAAA;AACpC,KAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAA;AAEjD,iBAAS,sBAAsB;;oBAKN,KAAK;+BAKM,gBAAgB;EAuBnD;AAED,eAAO,MAAM,gBAAgB,EAAE,OAAO,sBAGV,CAAA"}
@@ -1,32 +1,26 @@
1
1
  "use client";
2
- function c() {
3
- if (typeof window > "u")
4
- return {
5
- get: () => null,
6
- set: () => {
7
- },
8
- subscribe: () => () => {
9
- }
10
- };
11
- const i = document.documentElement, r = /* @__PURE__ */ new Set();
2
+ import { createServerThemeStore as u } from "./theme-store-server.js";
3
+ function i() {
4
+ const s = document.documentElement, r = /* @__PURE__ */ new Set();
12
5
  let n = null;
13
- const o = () => n, s = (e) => {
6
+ const a = () => n, o = (e) => {
14
7
  n = e, r.forEach((t) => t(n));
15
- }, u = (e) => (r.add(e), s(i.getAttribute("data-theme")), () => r.delete(e));
8
+ }, c = (e) => (r.add(e), o(s.getAttribute("data-theme")), () => r.delete(e));
16
9
  return new MutationObserver((e) => {
17
10
  e.filter((t) => t.type === "attributes" && t.target instanceof HTMLElement).forEach((t) => {
18
- s(t.target.getAttribute("data-theme"));
11
+ o(t.target.getAttribute("data-theme"));
19
12
  });
20
- }).observe(i, {
13
+ }).observe(s, {
21
14
  attributes: !0,
22
15
  attributeFilter: ["data-theme"],
23
16
  subtree: !1
24
17
  }), {
25
- get: o,
26
- set: s,
27
- subscribe: u
18
+ get: a,
19
+ set: o,
20
+ subscribe: c
28
21
  };
29
22
  }
23
+ const d = typeof window > "u" ? u : i;
30
24
  export {
31
- c as createThemeStore
25
+ d as createThemeStore
32
26
  };
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "css-in-js-framework",
17
17
  "react"
18
18
  ],
19
- "version": "1.0.32",
19
+ "version": "1.0.34",
20
20
  "type": "module",
21
21
  "scripts": {
22
22
  "lint": "eslint && tsc --noEmit",
@@ -49,7 +49,7 @@
49
49
  "vite-plugin-dts": "^4.5",
50
50
  "typescript": "^5.9",
51
51
  "@types/react": "^19.2",
52
- "@types/node": "^25.0"
52
+ "@types/node": "^25.2"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "react": "*",