@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.
- package/dist/stores/theme-store-server.cjs +1 -0
- package/dist/stores/theme-store-server.d.ts +3 -0
- package/dist/stores/theme-store-server.d.ts.map +1 -0
- package/dist/stores/theme-store-server.js +13 -0
- package/dist/stores/theme-store.cjs +1 -1
- package/dist/stores/theme-store.d.ts +2 -5
- package/dist/stores/theme-store.d.ts.map +1 -1
- package/dist/stores/theme-store.js +12 -18
- package/package.json +2 -2
|
@@ -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 @@
|
|
|
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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=
|
|
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
|
-
|
|
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;
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
6
|
+
const a = () => n, o = (e) => {
|
|
14
7
|
n = e, r.forEach((t) => t(n));
|
|
15
|
-
},
|
|
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
|
-
|
|
11
|
+
o(t.target.getAttribute("data-theme"));
|
|
19
12
|
});
|
|
20
|
-
}).observe(
|
|
13
|
+
}).observe(s, {
|
|
21
14
|
attributes: !0,
|
|
22
15
|
attributeFilter: ["data-theme"],
|
|
23
16
|
subtree: !1
|
|
24
17
|
}), {
|
|
25
|
-
get:
|
|
26
|
-
set:
|
|
27
|
-
subscribe:
|
|
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
|
-
|
|
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.
|
|
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.
|
|
52
|
+
"@types/node": "^25.2"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "*",
|