@plitzi/sdk-style 0.30.19 → 0.31.0
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
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @plitzi/sdk-style
|
|
2
2
|
|
|
3
|
+
## 0.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- v0.31.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @plitzi/sdk-plugins@0.31.0
|
|
13
|
+
- @plitzi/sdk-shared@0.31.0
|
|
14
|
+
- @plitzi/sdk-variables@0.31.0
|
|
15
|
+
|
|
3
16
|
## 0.30.19
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import e from "./StyleInspectorContext.mjs";
|
|
2
2
|
import t from "./hooks/useStyleBinding.mjs";
|
|
3
3
|
import { get as n, omit as r } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
-
import {
|
|
5
|
-
import { jsx as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
4
|
+
import { useCallback as i, useMemo as a } from "react";
|
|
5
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
+
import { emptyObject as s } from "@plitzi/sdk-shared/helpers/utils";
|
|
7
|
+
import { createStoreHook as c } from "@plitzi/sdk-store/createStore";
|
|
8
|
+
import { baseDefaultValue as l } from "@plitzi/sdk-shared";
|
|
8
9
|
//#region src/components/StyleInspector/StyleInspectorProvider.tsx
|
|
9
10
|
var u = ({ children: u, componentType: d, selector: f, styleSelector: p = "base", styleState: m, styleVariant: h, element: g, inheritData: _, displayMode: v, onChange: y }) => {
|
|
10
|
-
let b = t({ element: g }), {
|
|
11
|
-
id: "",
|
|
12
|
-
mode: "read"
|
|
13
|
-
}), C = a(() => {
|
|
11
|
+
let b = t({ element: g }), { useStore: x } = c(), [S] = x("runtime.sources.variables", { defaultValue: s }), C = i(() => {
|
|
14
12
|
let e;
|
|
15
13
|
if (f && p && f.attributes[p]) {
|
|
16
14
|
let t = f.attributes[p];
|
|
@@ -22,7 +20,7 @@ var u = ({ children: u, componentType: d, selector: f, styleSelector: p = "base"
|
|
|
22
20
|
p,
|
|
23
21
|
m,
|
|
24
22
|
h
|
|
25
|
-
]), w =
|
|
23
|
+
]), w = i((e, t) => {
|
|
26
24
|
if (!(e && typeof t != "string" && typeof t != "number" && t !== void 0 || !e && typeof t != "object" && t !== void 0 || e && n(b, e))) {
|
|
27
25
|
if (!e && t && typeof t == "object" && (t = r(t, Object.keys(b))), !e && f && typeof t == "object") {
|
|
28
26
|
let e = {
|
|
@@ -40,17 +38,17 @@ var u = ({ children: u, componentType: d, selector: f, styleSelector: p = "base"
|
|
|
40
38
|
C,
|
|
41
39
|
y,
|
|
42
40
|
f
|
|
43
|
-
]), T =
|
|
41
|
+
]), T = i((e) => Array.isArray(e) ? e.reduce((e, t) => ({
|
|
44
42
|
...e,
|
|
45
|
-
[t]: n(
|
|
46
|
-
}), {}) : e ? n(
|
|
43
|
+
[t]: n(l, t)
|
|
44
|
+
}), {}) : e ? n(l, e) : l, []), E = i((e) => {
|
|
47
45
|
Array.isArray(e) ? w(void 0, e.reduce((e, t) => ({
|
|
48
46
|
...e,
|
|
49
47
|
[t]: void 0
|
|
50
48
|
}), {})) : w(e);
|
|
51
49
|
}, [w]);
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
value:
|
|
50
|
+
return /* @__PURE__ */ o(e, {
|
|
51
|
+
value: a(() => ({
|
|
54
52
|
componentType: d,
|
|
55
53
|
selector: f,
|
|
56
54
|
styleSelector: p,
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { get as e, set as t } from "@plitzi/plitzi-ui/helpers";
|
|
2
2
|
import { useMemo as n } from "react";
|
|
3
|
-
import r from "@plitzi/sdk-shared/
|
|
3
|
+
import { emptyObject as r } from "@plitzi/sdk-shared/helpers/utils";
|
|
4
|
+
import { createStoreHook as i } from "@plitzi/sdk-store/createStore";
|
|
4
5
|
//#region src/components/StyleInspector/hooks/useStyleBinding.ts
|
|
5
|
-
var
|
|
6
|
-
let
|
|
7
|
-
id: "",
|
|
8
|
-
mode: "read"
|
|
9
|
-
});
|
|
6
|
+
var a = ({ element: a }) => {
|
|
7
|
+
let { useStore: o } = i(), [s] = o("runtime.sources", { defaultValue: r });
|
|
10
8
|
return n(() => {
|
|
11
9
|
let n = {};
|
|
12
|
-
if (!
|
|
13
|
-
let { definition: { bindings: r } } =
|
|
10
|
+
if (!a) return n;
|
|
11
|
+
let { definition: { bindings: r } } = a;
|
|
14
12
|
return r?.style && r.style.forEach((r) => {
|
|
15
|
-
e(
|
|
13
|
+
e(s, `${r.source}.${r.fromPath}`) === void 0 || !r.enabled || t(n, r.toPath, e(s, `${r.source}.${r.fromPath}`));
|
|
16
14
|
}), n;
|
|
17
|
-
}, [
|
|
15
|
+
}, [s, a]);
|
|
18
16
|
};
|
|
19
17
|
//#endregion
|
|
20
|
-
export {
|
|
18
|
+
export { a as default };
|
|
@@ -2,7 +2,7 @@ type TokenMapValue = string | number | boolean;
|
|
|
2
2
|
interface TokenMap {
|
|
3
3
|
[key: string]: TokenMapValue | TokenMap;
|
|
4
4
|
}
|
|
5
|
-
declare const processCssTokens: <T extends TokenMap>(cache
|
|
5
|
+
declare const processCssTokens: <T extends TokenMap>(cache?: string, variables?: T, opts?: {
|
|
6
6
|
missing?: string;
|
|
7
7
|
}) => string;
|
|
8
8
|
export default processCssTokens;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-style",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -831,19 +831,19 @@
|
|
|
831
831
|
"build:prod": "vite build && node ../sdk-shared/scripts/generate-exports.mjs"
|
|
832
832
|
},
|
|
833
833
|
"dependencies": {
|
|
834
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
835
|
-
"@plitzi/sdk-plugins": "0.
|
|
836
|
-
"@plitzi/sdk-shared": "0.
|
|
837
|
-
"@plitzi/sdk-variables": "0.
|
|
834
|
+
"@plitzi/plitzi-ui": "^1.6.9",
|
|
835
|
+
"@plitzi/sdk-plugins": "0.31.0",
|
|
836
|
+
"@plitzi/sdk-shared": "0.31.0",
|
|
837
|
+
"@plitzi/sdk-variables": "0.31.0",
|
|
838
838
|
"clsx": "^2.1.1",
|
|
839
|
-
"immer": "^11.1.
|
|
839
|
+
"immer": "^11.1.8",
|
|
840
840
|
"prop-types": "^15.8.1",
|
|
841
|
-
"zod": "^4.4.
|
|
841
|
+
"zod": "^4.4.3"
|
|
842
842
|
},
|
|
843
843
|
"devDependencies": {
|
|
844
844
|
"eslint": "^9.39.4",
|
|
845
845
|
"typescript": "^6.0.3",
|
|
846
|
-
"vite": "^8.0.
|
|
847
|
-
"vitest": "^4.1.
|
|
846
|
+
"vite": "^8.0.14",
|
|
847
|
+
"vitest": "^4.1.7"
|
|
848
848
|
}
|
|
849
849
|
}
|