@plitzi/sdk-style 0.30.19 → 0.31.1

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,28 @@
1
1
  # @plitzi/sdk-style
2
2
 
3
+ ## 0.31.1
4
+
5
+ ### Patch Changes
6
+
7
+ - v0.31.1
8
+ - Updated dependencies
9
+ - @plitzi/sdk-plugins@0.31.1
10
+ - @plitzi/sdk-shared@0.31.1
11
+ - @plitzi/sdk-variables@0.31.1
12
+
13
+ ## 0.31.0
14
+
15
+ ### Minor Changes
16
+
17
+ - v0.31.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+ - @plitzi/sdk-plugins@0.31.0
23
+ - @plitzi/sdk-shared@0.31.0
24
+ - @plitzi/sdk-variables@0.31.0
25
+
3
26
  ## 0.30.19
4
27
 
5
28
  ### Patch Changes
@@ -4,7 +4,7 @@ import n, { StyleActions as r } from "./StyleReducer.mjs";
4
4
  import { get as i } from "@plitzi/plitzi-ui/helpers";
5
5
  import { use as a, useCallback as o, useEffect as s, useMemo as c } from "react";
6
6
  import { jsx as l } from "react/jsx-runtime";
7
- import { createStoreHook as u } from "@plitzi/sdk-store/createStore";
7
+ import { createStoreHook as u } from "@plitzi/nexus/createStore";
8
8
  import d from "@plitzi/plitzi-ui/hooks/useReducerWithMiddleware";
9
9
  import f from "@plitzi/sdk-event-bridge/hooks/useEventBridge";
10
10
  import p from "@plitzi/sdk-shared/network/NetworkContext";
@@ -1,7 +1,7 @@
1
1
  import e from "./StyleContext.mjs";
2
2
  import { use as t, useMemo as n } from "react";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
- import { createStoreHook as i } from "@plitzi/sdk-store/createStore";
4
+ import { createStoreHook as i } from "@plitzi/nexus/createStore";
5
5
  import { EMPTY_STYLE_SCHEMA as a } from "@plitzi/sdk-shared/style/styleConstants";
6
6
  import o from "@plitzi/sdk-shared/network/NetworkInternalContext";
7
7
  //#region src/SdkStyleContextProvider.tsx
@@ -3,7 +3,7 @@ import { use as n, useCallback as r, useMemo as i, useState as a } from "react";
3
3
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
4
4
  import c from "@plitzi/plitzi-ui/ContainerFloating";
5
5
  import l from "@plitzi/plitzi-ui/Button";
6
- import { createStoreHook as u } from "@plitzi/sdk-store/createStore";
6
+ import { createStoreHook as u } from "@plitzi/nexus/createStore";
7
7
  import d from "@plitzi/plitzi-ui/CodeMirror";
8
8
  import { ThemeContext as f } from "@plitzi/sdk-shared/theme/ThemeProvider";
9
9
  import p from "@plitzi/sdk-shared/network/NetworkContext";
@@ -4,7 +4,7 @@ import { get as n, pick as r, set as i } from "@plitzi/plitzi-ui/helpers";
4
4
  import { clsx as a } from "clsx";
5
5
  import { use as o, useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
6
6
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
- import { createStoreHook as p } from "@plitzi/sdk-store/createStore";
7
+ import { createStoreHook as p } from "@plitzi/nexus/createStore";
8
8
  import { produce as m } from "immer";
9
9
  import h from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
10
10
  import g from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
@@ -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 { use as i, useCallback as a, useMemo as o } from "react";
5
- import { jsx as s } from "react/jsx-runtime";
6
- import { baseDefaultValue as c } from "@plitzi/sdk-shared";
7
- import l from "@plitzi/sdk-shared/dataSource/DataSourceContext";
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/nexus/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 }), { useDataSource: x } = i(l), { variables: S } = x({
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 = a((e, t) => {
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 = a((e) => Array.isArray(e) ? e.reduce((e, t) => ({
41
+ ]), T = i((e) => Array.isArray(e) ? e.reduce((e, t) => ({
44
42
  ...e,
45
- [t]: n(c, t)
46
- }), {}) : e ? n(c, e) : c, []), E = a((e) => {
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__ */ s(e, {
53
- value: o(() => ({
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/dataSource/hooks/useDataSource";
3
+ import { emptyObject as r } from "@plitzi/sdk-shared/helpers/utils";
4
+ import { createStoreHook as i } from "@plitzi/nexus/createStore";
4
5
  //#region src/components/StyleInspector/hooks/useStyleBinding.ts
5
- var i = ({ element: i }) => {
6
- let a = r({
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 (!i) return n;
13
- let { definition: { bindings: r } } = i;
10
+ if (!a) return n;
11
+ let { definition: { bindings: r } } = a;
14
12
  return r?.style && r.style.forEach((r) => {
15
- e(a, `${r.source}.${r.fromPath}`) === void 0 || !r.enabled || t(n, r.toPath, e(a, `${r.source}.${r.fromPath}`));
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
- }, [a, i]);
15
+ }, [s, a]);
18
16
  };
19
17
  //#endregion
20
- export { i as default };
18
+ export { a as default };
@@ -1,10 +1,10 @@
1
1
  import e from "../../../helpers/calculateInheriting.mjs";
2
2
  import { use as t, useMemo as n } from "react";
3
- import r from "@plitzi/sdk-shared/elements/ComponentContext";
4
- import { createStoreHook as i } from "@plitzi/sdk-store/createStore";
3
+ import { createStoreHook as r } from "@plitzi/nexus/createStore";
4
+ import i from "@plitzi/sdk-shared/elements/ComponentContext";
5
5
  //#region src/components/StyleInspector/hooks/useStyleInherit.ts
6
6
  var a = ({ element: a, componentType: o, componentSubType: s, selector: c, styleSelector: l = "base", styleState: u, styleVariant: d }) => {
7
- let { useStore: f } = i(), [[p, m]] = f(["schema.flat", "style.platform"]), { componentDefinitions: h } = t(r);
7
+ let { useStore: f } = r(), [[p, m]] = f(["schema.flat", "style.platform"]), { componentDefinitions: h } = t(i);
8
8
  return n(() => {
9
9
  let t = [], n = [], r = (a?.definition.styleSelectors[l] ?? "").split(" ");
10
10
  return c && r.length > 1 && t.push(c), e(a, o, p, m, h.current, {
@@ -3,11 +3,11 @@ import t from "../StyleInspector/index.mjs";
3
3
  import { get as n } from "@plitzi/plitzi-ui/helpers";
4
4
  import { use as r, useMemo as i, useState as a } from "react";
5
5
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import c from "@plitzi/sdk-shared/elements/ComponentContext";
7
- import { createStoreHook as l } from "@plitzi/sdk-store/createStore";
6
+ import { createStoreHook as c } from "@plitzi/nexus/createStore";
7
+ import l from "@plitzi/sdk-shared/elements/ComponentContext";
8
8
  //#region src/components/StyleManager/StyleManager.tsx
9
9
  var u = () => {
10
- let { componentDefinitions: u } = r(c), [d, f] = a(void 0), { useStore: p } = l(), [[m, h]] = p(["schema.flat", "displayMode"]), [g] = p(`style.platform.${h}`), _ = i(() => Object.values(m), [m]), v = i(() => d?.type === "element" ? Object.keys(n(u.current, `${d.componentType}.definition.styleSelectors`, {})) : ["base"], [u, d]), y = i(() => d?.type === "element" ? Object.keys(n(u.current, `${d.componentType}.defaultStyle.subTypes`, {})) : [], [u, d]), b = i(() => {
10
+ let { componentDefinitions: u } = r(l), [d, f] = a(void 0), { useStore: p } = c(), [[m, h]] = p(["schema.flat", "displayMode"]), [g] = p(`style.platform.${h}`), _ = i(() => Object.values(m), [m]), v = i(() => d?.type === "element" ? Object.keys(n(u.current, `${d.componentType}.definition.styleSelectors`, {})) : ["base"], [u, d]), y = i(() => d?.type === "element" ? Object.keys(n(u.current, `${d.componentType}.defaultStyle.subTypes`, {})) : [], [u, d]), b = i(() => {
11
11
  if (d) return d.type === "element" && v.length > 1 ? v.reduce((e, t) => ({
12
12
  ...e,
13
13
  [t]: d.componentType
@@ -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: string, variables?: T, opts?: {
5
+ declare const processCssTokens: <T extends TokenMap>(cache?: string, variables?: T, opts?: {
6
6
  missing?: string;
7
7
  }) => string;
8
8
  export default processCssTokens;
@@ -1,5 +1,5 @@
1
1
  //#region src/helpers/processCssTokens.ts
2
- var e = (e, t = {}, n = { missing: "" }) => {
2
+ var e = (e = "", t = {}, n = { missing: "" }) => {
3
3
  let r = n.missing ?? "";
4
4
  return e.replace(/\{\{\s*([a-z0-9_\-.$]+)\s*\}\}/gi, (e, n) => {
5
5
  let i = n.split("."), a = t;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-style",
3
- "version": "0.30.19",
3
+ "version": "0.31.1",
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.2",
835
- "@plitzi/sdk-plugins": "0.30.19",
836
- "@plitzi/sdk-shared": "0.30.19",
837
- "@plitzi/sdk-variables": "0.30.19",
834
+ "@plitzi/plitzi-ui": "^1.6.9",
835
+ "@plitzi/sdk-plugins": "0.31.1",
836
+ "@plitzi/sdk-shared": "0.31.1",
837
+ "@plitzi/sdk-variables": "0.31.1",
838
838
  "clsx": "^2.1.1",
839
- "immer": "^11.1.4",
839
+ "immer": "^11.1.8",
840
840
  "prop-types": "^15.8.1",
841
- "zod": "^4.4.1"
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.10",
847
- "vitest": "^4.1.5"
846
+ "vite": "^8.0.14",
847
+ "vitest": "^4.1.7"
848
848
  }
849
849
  }