@plitzi/sdk-style 0.32.4 → 0.32.6

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.
Files changed (22) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/BuilderStyleContextProvider.mjs +41 -28
  3. package/dist/StyleReducer.d.ts +5 -0
  4. package/dist/StyleReducer.mjs +7 -0
  5. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +1 -1
  6. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +1 -0
  7. package/dist/components/StyleInspector/categories/Effects/Filters/Filter.mjs +1 -1
  8. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +1 -0
  9. package/dist/components/StyleInspector/categories/Effects/Transform/Transform.mjs +24 -25
  10. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.d.ts +3 -2
  11. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.mjs +76 -135
  12. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.d.ts +27 -0
  13. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.mjs +191 -0
  14. package/dist/components/StyleInspector/categories/Effects/Transition/Transition.mjs +1 -1
  15. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +1 -0
  16. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +1 -0
  17. package/dist/components/StyleInspector/hooks/useStyleBinding.mjs +1 -1
  18. package/dist/components/StyleManager/ManagerSelector.mjs +66 -40
  19. package/dist/components/StyleManager/StyleSelectorTag.d.ts +3 -1
  20. package/dist/components/StyleManager/StyleSelectorTag.mjs +32 -19
  21. package/dist/helpers/calculateInheriting.mjs +5 -8
  22. package/package.json +13 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @plitzi/sdk-style
2
2
 
3
+ ## 0.32.6
4
+
5
+ ### Patch Changes
6
+
7
+ - v0.32.6
8
+ - Updated dependencies
9
+ - @plitzi/sdk-plugins@0.32.6
10
+ - @plitzi/sdk-shared@0.32.6
11
+ - @plitzi/sdk-variables@0.32.6
12
+
13
+ ## 0.32.5
14
+
15
+ ### Patch Changes
16
+
17
+ - v0.32.4
18
+ - Updated dependencies
19
+ - @plitzi/sdk-plugins@0.32.5
20
+ - @plitzi/sdk-shared@0.32.5
21
+ - @plitzi/sdk-variables@0.32.5
22
+
3
23
  ## 0.32.4
4
24
 
5
25
  ### Patch Changes
@@ -44,7 +44,12 @@ var h = ({ children: h, style: g, includeSubscriptions: _ = !0, middlewares: v =
44
44
  displayMode: e,
45
45
  selector: t,
46
46
  fromSubscriptions: n
47
- }), [S]), D = o((e, t, n, i, a, o = !1) => {
47
+ }), [S]), D = o((e, t, n = !1) => S({
48
+ type: r.STYLE_REMOVE_SELECTORS,
49
+ displayMode: e,
50
+ selectors: t,
51
+ fromSubscriptions: n
52
+ }), [S]), O = o((e, t, n, i, a, o = !1) => {
48
53
  S({
49
54
  type: r.STYLE_ADD_SELECTOR_VARIABLE,
50
55
  displayMode: e,
@@ -54,7 +59,7 @@ var h = ({ children: h, style: g, includeSubscriptions: _ = !0, middlewares: v =
54
59
  value: a,
55
60
  fromSubscriptions: o
56
61
  });
57
- }, [S]), O = o((e, t, n, i, a, o = !1) => {
62
+ }, [S]), k = o((e, t, n, i, a, o = !1) => {
58
63
  S({
59
64
  type: r.STYLE_UPDATE_SELECTOR_VARIABLE,
60
65
  displayMode: e,
@@ -64,7 +69,7 @@ var h = ({ children: h, style: g, includeSubscriptions: _ = !0, middlewares: v =
64
69
  value: a,
65
70
  fromSubscriptions: o
66
71
  });
67
- }, [S]), k = o((e, t, n, i, a = !1) => {
72
+ }, [S]), A = o((e, t, n, i, a = !1) => {
68
73
  S({
69
74
  type: r.STYLE_REMOVE_SELECTOR_VARIABLE,
70
75
  displayMode: e,
@@ -73,28 +78,28 @@ var h = ({ children: h, style: g, includeSubscriptions: _ = !0, middlewares: v =
73
78
  name: i,
74
79
  fromSubscriptions: a
75
80
  });
76
- }, [S]), A = o((e, t, n, i = !1) => S({
81
+ }, [S]), j = o((e, t, n, i = !1) => S({
77
82
  type: r.STYLE_ADD_VARIABLE,
78
83
  category: e,
79
84
  name: t,
80
85
  value: n,
81
86
  fromSubscriptions: i
82
- }), [S]), j = o((e, t, n, i = !1) => S({
87
+ }), [S]), M = o((e, t, n, i = !1) => S({
83
88
  type: r.STYLE_UPDATE_VARIABLE,
84
89
  category: e,
85
90
  name: t,
86
91
  value: n,
87
92
  fromSubscriptions: i
88
- }), [S]), M = o((e, t, n = !1) => S({
93
+ }), [S]), N = o((e, t, n = !1) => S({
89
94
  type: r.STYLE_REMOVE_VARIABLE,
90
95
  category: e,
91
96
  name: t,
92
97
  fromSubscriptions: n
93
- }), [S]), N = o((e, t = !1) => S({
98
+ }), [S]), P = o((e, t = !1) => S({
94
99
  type: r.STYLE_ADD_TEMPLATE,
95
100
  platform: e,
96
101
  fromSubscriptions: t
97
- }), [S]), P = o((e, t, n = !1) => {
102
+ }), [S]), F = o((e, t, n = !1) => {
98
103
  S({
99
104
  type: r.STYLE_UPDATE_SETTINGS,
100
105
  path: e,
@@ -118,40 +123,45 @@ var h = ({ children: h, style: g, includeSubscriptions: _ = !0, middlewares: v =
118
123
  if (!e.data || e.error) return;
119
124
  let { displayMode: t, selector: n } = i(e, "data.StyleRemoveSelector", {});
120
125
  E(t, n, !0);
126
+ }), y.subscribe("StyleRemoveSelectors", {}, (e) => {
127
+ if (!e.data || e.error) return;
128
+ let { displayMode: t, selectors: n } = i(e, "data.StyleRemoveSelectors", {});
129
+ D(t, n, !0);
121
130
  }), y.subscribe("StyleAddSelectorVariable", {}, (e) => {
122
131
  if (!e.data || e.error) return;
123
132
  let { displayMode: t, selector: n, category: r, name: a, value: o } = i(e, "data.StyleAddSelectorVariable", {});
124
- D(t, n, r, a, o, !0);
133
+ O(t, n, r, a, o, !0);
125
134
  }), y.subscribe("StyleUpdateSelectorVariable", {}, (e) => {
126
135
  if (!e.data || e.error) return;
127
136
  let { displayMode: t, selector: n, category: r, name: a, value: o } = i(e, "data.StyleUpdateSelectorVariable", {});
128
- O(t, n, r, a, o, !0);
137
+ k(t, n, r, a, o, !0);
129
138
  }), y.subscribe("StyleRemoveSelectorVariable", {}, (e) => {
130
139
  if (!e.data || e.error) return;
131
140
  let { displayMode: t, selector: n, category: r, name: a } = i(e, "data.StyleRemoveSelectorVariable", {});
132
- k(t, n, r, a, !0);
141
+ A(t, n, r, a, !0);
133
142
  }), y.subscribe("StyleAddVariable", {}, (e) => {
134
143
  if (!e.data || e.error) return;
135
144
  let { category: t, name: n, value: r } = i(e, "data.StyleAddVariable", {});
136
- A(t, n, r, !0);
145
+ j(t, n, r, !0);
137
146
  }), y.subscribe("StyleUpdateVariable", {}, (e) => {
138
147
  if (!e.data || e.error) return;
139
148
  let { category: t, name: n, value: r } = i(e, "data.StyleUpdateVariable", {});
140
- j(t, n, r, !0);
149
+ M(t, n, r, !0);
141
150
  }), y.subscribe("StyleRemoveVariable", {}, (e) => {
142
151
  if (!e.data || e.error) return;
143
152
  let { category: t, name: n } = i(e, "data.StyleRemoveVariable", {});
144
- M(t, n, !0);
153
+ N(t, n, !0);
145
154
  }), y.subscribe("StyleUpdateSettings", {}, (e) => {
146
155
  if (!e.data || e.error) return;
147
156
  let { path: t, value: n } = i(e, "data.StyleUpdateSettings", {});
148
- P(t, n, !0);
157
+ F(t, n, !0);
149
158
  })), () => {
150
159
  _ && y.unsubscribe([
151
160
  "StyleUpdated",
152
161
  "StyleAddSelector",
153
162
  "StyleUpdateSelector",
154
163
  "StyleRemoveSelector",
164
+ "StyleRemoveSelectors",
155
165
  "StyleAddSelectorVariable",
156
166
  "StyleUpdateSelectorVariable",
157
167
  "StyleRemoveSelectorVariable",
@@ -173,21 +183,23 @@ var h = ({ children: h, style: g, includeSubscriptions: _ = !0, middlewares: v =
173
183
  A,
174
184
  j,
175
185
  M,
176
- P
186
+ N,
187
+ F
177
188
  ]);
178
- let F = c(() => ({
189
+ let I = c(() => ({
179
190
  styleUpdate: C,
180
191
  styleAddSelector: w,
181
192
  styleUpdateSelector: T,
182
193
  styleRemoveSelector: E,
183
- styleAddSelectorVariable: D,
184
- styleUpdateSelectorVariable: O,
185
- styleRemoveSelectorVariable: k,
186
- styleAddVariable: A,
187
- styleUpdateVariable: j,
188
- styleRemoveVariable: M,
189
- styleAddTemplate: N,
190
- styleUpdateSettings: P
194
+ styleRemoveSelectors: D,
195
+ styleAddSelectorVariable: O,
196
+ styleUpdateSelectorVariable: k,
197
+ styleRemoveSelectorVariable: A,
198
+ styleAddVariable: j,
199
+ styleUpdateVariable: M,
200
+ styleRemoveVariable: N,
201
+ styleAddTemplate: P,
202
+ styleUpdateSettings: F
191
203
  }), [
192
204
  C,
193
205
  w,
@@ -200,10 +212,11 @@ var h = ({ children: h, style: g, includeSubscriptions: _ = !0, middlewares: v =
200
212
  j,
201
213
  M,
202
214
  N,
203
- P
215
+ P,
216
+ F
204
217
  ]);
205
- return f("main", F), /* @__PURE__ */ l(t, {
206
- value: F,
218
+ return f("main", I), /* @__PURE__ */ l(t, {
219
+ value: I,
207
220
  children: h
208
221
  });
209
222
  };
@@ -4,6 +4,7 @@ export declare const StyleActions: {
4
4
  readonly STYLE_ADD_SELECTOR: "STYLE_ADD_SELECTOR";
5
5
  readonly STYLE_UPDATE_SELECTOR: "STYLE_UPDATE_SELECTOR";
6
6
  readonly STYLE_REMOVE_SELECTOR: "STYLE_REMOVE_SELECTOR";
7
+ readonly STYLE_REMOVE_SELECTORS: "STYLE_REMOVE_SELECTORS";
7
8
  readonly STYLE_ADD_SELECTOR_VARIABLE: "STYLE_ADD_SELECTOR_VARIABLE";
8
9
  readonly STYLE_UPDATE_SELECTOR_VARIABLE: "STYLE_UPDATE_SELECTOR_VARIABLE";
9
10
  readonly STYLE_REMOVE_SELECTOR_VARIABLE: "STYLE_REMOVE_SELECTOR_VARIABLE";
@@ -48,6 +49,10 @@ export type StyleReducerActions = StyleReducerActionsBase & ({
48
49
  type: 'STYLE_REMOVE_SELECTOR';
49
50
  displayMode?: DisplayMode;
50
51
  selector: string;
52
+ } | {
53
+ type: 'STYLE_REMOVE_SELECTORS';
54
+ displayMode?: DisplayMode;
55
+ selectors: string[];
51
56
  } | {
52
57
  type: 'STYLE_ADD_SELECTOR_VARIABLE' | 'STYLE_UPDATE_SELECTOR_VARIABLE';
53
58
  displayMode: DisplayMode;
@@ -8,6 +8,7 @@ var a = {
8
8
  STYLE_ADD_SELECTOR: "STYLE_ADD_SELECTOR",
9
9
  STYLE_UPDATE_SELECTOR: "STYLE_UPDATE_SELECTOR",
10
10
  STYLE_REMOVE_SELECTOR: "STYLE_REMOVE_SELECTOR",
11
+ STYLE_REMOVE_SELECTORS: "STYLE_REMOVE_SELECTORS",
11
12
  STYLE_ADD_SELECTOR_VARIABLE: "STYLE_ADD_SELECTOR_VARIABLE",
12
13
  STYLE_UPDATE_SELECTOR_VARIABLE: "STYLE_UPDATE_SELECTOR_VARIABLE",
13
14
  STYLE_REMOVE_SELECTOR_VARIABLE: "STYLE_REMOVE_SELECTOR_VARIABLE",
@@ -40,6 +41,12 @@ var a = {
40
41
  e.removeSelector(i, n, a) && r(i, "cache", t(i));
41
42
  });
42
43
  }
44
+ case a.STYLE_REMOVE_SELECTORS: {
45
+ let { displayMode: n, selectors: a } = s;
46
+ return i(o, (i) => {
47
+ a.reduce((t, r) => e.removeSelector(i, n, r) || t, !1) && r(i, "cache", t(i));
48
+ });
49
+ }
43
50
  case a.STYLE_ADD_SELECTOR_VARIABLE: {
44
51
  let { displayMode: n, selector: a, category: c, name: l, value: u } = s;
45
52
  return i(o, (i) => {
@@ -25,7 +25,7 @@ var s = ({ value: s = "", onChange: c }) => {
25
25
  onClick: p
26
26
  })]
27
27
  }), u.length > 0 && /* @__PURE__ */ i("div", {
28
- className: "flex flex-col",
28
+ className: "flex flex-col gap-2",
29
29
  children: u.map((e, n) => /* @__PURE__ */ i(t, {
30
30
  value: e.trim(),
31
31
  onChange: f(n),
@@ -51,6 +51,7 @@ var l = ({ value: l = "1px 1px 3px 1px black", onChange: u, onRemove: d }) => {
51
51
  return /* @__PURE__ */ o(s, {
52
52
  className: "w-full",
53
53
  closeOnClick: !1,
54
+ containerTopOffset: 5,
54
55
  children: [/* @__PURE__ */ o(s.Trigger, {
55
56
  className: "flex w-full cursor-pointer items-center justify-between rounded-sm border border-gray-300 bg-white px-2 py-0.5 select-none hover:bg-gray-100 dark:border-zinc-600 dark:bg-zinc-800 dark:hover:bg-zinc-700/60",
56
57
  children: [/* @__PURE__ */ o("div", {
@@ -25,7 +25,7 @@ var s = ({ value: s, onChange: c }) => {
25
25
  onClick: f
26
26
  })]
27
27
  }), l.length > 0 && /* @__PURE__ */ i("div", {
28
- className: "flex flex-col",
28
+ className: "flex flex-col gap-2",
29
29
  children: l.map((e, n) => /* @__PURE__ */ i(t, {
30
30
  value: e,
31
31
  onChange: d(n),
@@ -35,6 +35,7 @@ var l = ({ value: l = "blur(5px)", onRemove: u, onChange: d }) => {
35
35
  return /* @__PURE__ */ o(s, {
36
36
  className: "w-full",
37
37
  closeOnClick: !1,
38
+ containerTopOffset: 5,
38
39
  children: [/* @__PURE__ */ o(s.Trigger, {
39
40
  className: "flex w-full cursor-pointer items-center justify-between rounded-sm border border-gray-300 bg-white px-2 py-0.5 select-none hover:bg-gray-100 dark:border-zinc-600 dark:bg-zinc-800 dark:hover:bg-zinc-700/60",
40
41
  children: [/* @__PURE__ */ a("div", {
@@ -1,37 +1,36 @@
1
1
  import e from "../../../components/InspectorLabel/index.mjs";
2
- import t from "./TransformItem.mjs";
3
- import { useCallback as n } from "react";
4
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import o from "@plitzi/plitzi-ui/Icon";
2
+ import { DEFAULT_FUNCTION as t, createFunctionValue as n, parseTransforms as r, serializeTransforms as i } from "./transformFunctions.mjs";
3
+ import a from "./TransformItem.mjs";
4
+ import { useCallback as o } from "react";
5
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import u from "@plitzi/plitzi-ui/Icon";
6
7
  //#region src/components/StyleInspector/categories/Effects/Transform/Transform.tsx
7
- var s = ({ value: s, onChange: c }) => {
8
- let l = [];
9
- s && s !== "" && (l = s.match(/((translate3d|scale3d|skew)\([0-9a-z-, .%]+\))|(rotateX.*rotateZ\([0-9a-z%]+\))/gim) ?? []);
10
- let u = (e) => (t) => {
11
- t.stopPropagation(), t.preventDefault(), l.splice(e, 1), l.length > 0 ? c?.(l.join(" ")) : c?.("");
12
- }, d = (e) => (t) => {
13
- t !== l[e] && (l[e] = t, c?.(l.join(" ")));
14
- }, f = n(() => {
15
- s ? c?.(`${s} translate3d(0px, 0px, 0px)`) : c?.("translate3d(0px, 0px, 0px)");
16
- }, [c, s]);
17
- return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("div", {
8
+ var d = ({ value: d, onChange: f }) => {
9
+ let p = r(typeof d == "string" ? d : ""), m = o((e) => f?.(e.length > 0 ? i(e) : ""), [f]), h = (e) => (t) => {
10
+ t.stopPropagation(), t.preventDefault(), m(p.filter((t, n) => n !== e));
11
+ }, g = (e) => (t) => {
12
+ m(p.map((n, r) => r === e ? t : n));
13
+ }, _ = o(() => {
14
+ m([...p, n(t)]);
15
+ }, [m, p]);
16
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("div", {
18
17
  className: "flex justify-between",
19
- children: [/* @__PURE__ */ i(e, {
18
+ children: [/* @__PURE__ */ c(e, {
20
19
  keyValue: ["transform"],
21
20
  children: "2D & 3D Transforms"
22
- }), /* @__PURE__ */ i(o, {
21
+ }), /* @__PURE__ */ c(u, {
23
22
  className: "cursor-pointer",
24
23
  icon: "fas fa-plus",
25
- onClick: f
24
+ onClick: _
26
25
  })]
27
- }), l.length > 0 && /* @__PURE__ */ i("div", {
28
- className: "flex flex-col",
29
- children: l.map((e, n) => /* @__PURE__ */ i(t, {
26
+ }), p.length > 0 && /* @__PURE__ */ c("div", {
27
+ className: "flex flex-col gap-2",
28
+ children: p.map((e, t) => /* @__PURE__ */ c(a, {
30
29
  value: e,
31
- onChange: d(n),
32
- onRemove: u(n)
33
- }, n))
30
+ onChange: g(t),
31
+ onRemove: h(t)
32
+ }, t))
34
33
  })] });
35
34
  };
36
35
  //#endregion
37
- export { s as default };
36
+ export { d as default };
@@ -1,7 +1,8 @@
1
+ import { TransformFunctionValue } from './transformFunctions';
1
2
  import { MouseEvent } from 'react';
2
3
  export type TransformItemProps = {
3
- value?: string;
4
- onChange?: (value: string) => void;
4
+ value: TransformFunctionValue;
5
+ onChange?: (value: TransformFunctionValue) => void;
5
6
  onRemove?: (e: MouseEvent) => void;
6
7
  };
7
8
  declare const TransformItem: ({ value, onRemove, onChange }: TransformItemProps) => import("react").JSX.Element;
@@ -1,148 +1,89 @@
1
1
  import e from "../../../components/CategoryOption/index.mjs";
2
- import t from "../../../components/CategorySection/index.mjs";
3
- import { useCallback as n, useMemo as r, useRef as i } from "react";
4
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
- import s from "@plitzi/plitzi-ui/ContainerFloating";
6
- import c from "@plitzi/plitzi-ui/Icon";
2
+ import { TRANSFORM_FUNCTIONS as t, createFunctionValue as n, getFunctionSpec as r, serializeTransform as i, unitsForKind as a } from "./transformFunctions.mjs";
3
+ import { useCallback as o, useMemo as s } from "react";
4
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
+ import u from "@plitzi/plitzi-ui/ContainerFloating";
6
+ import d from "@plitzi/plitzi-ui/Icon";
7
7
  //#region src/components/StyleInspector/categories/Effects/Transform/TransformItem.tsx
8
- var l = ({ value: l = "translate3d(0px, 0px, 0px)", onRemove: u, onChange: d }) => {
9
- let f = l.match(/[a-x0-9-.%]+/gim), { type: p = "translate3d", posX: m = "0px", posY: h = "0px", posZ: g = "0px" } = {};
10
- f?.length === 6 ? [, m, p, h, , g] = f : f?.length === 4 ? [p, m, h, g] = f : f?.length === 3 && ([p, m, h] = f);
11
- let _ = i({
12
- type: p,
13
- posX: m,
14
- posY: h,
15
- posZ: g
8
+ var f = t.reduce((e, t) => {
9
+ let n = e.find((e) => e.category === t.category);
10
+ return n ? n.specs.push(t) : e.push({
11
+ category: t.category,
12
+ specs: [t]
13
+ }), e;
14
+ }, []), p = ({ value: t, onRemove: p, onChange: m }) => {
15
+ let h = r(t.name), g = s(() => h ? h.args : t.args.map((e, t) => ({
16
+ label: `#${t + 1}`,
17
+ kind: "length",
18
+ default: "0px"
19
+ })), [h, t.args]), _ = s(() => g.map((e, n) => t.args[n] ?? e.default), [g, t.args]), v = o((e) => m?.(n(e)), [m]), y = o((e) => (n) => {
20
+ let r = g.map((r, i) => i === e ? n : t.args[i] ?? r.default);
21
+ m?.({
22
+ name: t.name,
23
+ args: r
24
+ });
25
+ }, [
26
+ g,
27
+ m,
28
+ t.args,
29
+ t.name
30
+ ]), b = i({
31
+ name: t.name,
32
+ args: _
16
33
  });
17
- _.current = {
18
- type: p,
19
- posX: m,
20
- posY: h,
21
- posZ: g
22
- };
23
- let v = n((e) => (t) => {
24
- let n = { ..._.current };
25
- n[e] = t;
26
- let { type: r } = n, { posX: i, posY: a, posZ: o } = n;
27
- e === "type" && _.current.type !== t && (t === "rotate" || t === "skew" ? {posX: i, posY: a, posZ: o} = {
28
- posX: "0deg",
29
- posY: "0deg",
30
- posZ: "0deg"
31
- } : t === "scale3d" ? {posX: i, posY: a, posZ: o} = {
32
- posX: "1",
33
- posY: "1",
34
- posZ: "1"
35
- } : {posX: i, posY: a, posZ: o} = {
36
- posX: "0px",
37
- posY: "0px",
38
- posZ: "0px"
39
- }), r === "rotate" ? d?.(`${r}X(${i}) ${r}Y(${a}) ${r}Z(${o})`) : r === "skew" ? d?.(`${r}(${i}, ${a})`) : d?.(`${r}(${i}, ${a}, ${o})`);
40
- }, [d]), y = r(() => [
41
- {
42
- value: "translate3d",
43
- icon: /* @__PURE__ */ a("div", {
44
- className: "px-1 text-xs select-none",
45
- children: "Move"
46
- }),
47
- description: "",
48
- active: p === "translate3d",
49
- size: "custom"
50
- },
51
- {
52
- value: "scale3d",
53
- icon: /* @__PURE__ */ a("div", {
54
- className: "px-1 text-xs select-none",
55
- children: "Scale"
56
- }),
57
- description: "",
58
- active: p === "scale3d",
59
- size: "custom"
60
- },
61
- {
62
- value: "rotate",
63
- icon: /* @__PURE__ */ a("div", {
64
- className: "px-1 text-xs select-none",
65
- children: "Rotate"
66
- }),
67
- description: "",
68
- active: p === "rotate",
69
- size: "custom"
70
- },
71
- {
72
- value: "skew",
73
- icon: /* @__PURE__ */ a("div", {
74
- className: "px-1 text-xs select-none",
75
- children: "Skew"
76
- }),
77
- description: "",
78
- active: p === "skew",
79
- size: "custom"
80
- }
81
- ], [p]), b = r(() => p === "rotate" || p === "skew" ? { units: [{
82
- label: "DEG",
83
- value: "deg"
84
- }] } : p === "scale3d" ? { units: void 0 } : { units: [{
85
- label: "PX",
86
- value: "px"
87
- }] }, [p]);
88
- return /* @__PURE__ */ o(s, {
89
- className: "w-full",
34
+ return /* @__PURE__ */ l(u, {
35
+ className: "w-full min-w-0",
90
36
  closeOnClick: !1,
91
- children: [/* @__PURE__ */ o(s.Trigger, {
92
- className: "flex w-full cursor-pointer items-center justify-between rounded-sm border border-gray-300 bg-white px-2 py-0.5 select-none hover:bg-gray-100 dark:border-zinc-600 dark:bg-zinc-800 dark:hover:bg-zinc-700/60",
93
- children: [/* @__PURE__ */ a("div", {
94
- className: "flex items-center",
95
- children: l
96
- }), /* @__PURE__ */ a("div", {
97
- className: "flex",
98
- children: /* @__PURE__ */ a(c, {
99
- size: "xs",
100
- icon: "fas fa-trash-alt",
101
- onClick: u,
102
- intent: "danger",
103
- title: "Remove"
104
- })
37
+ containerTopOffset: 5,
38
+ children: [/* @__PURE__ */ l(u.Trigger, {
39
+ className: "flex w-full min-w-0 cursor-pointer items-center justify-between gap-1 rounded-sm border border-gray-300 bg-white px-2 py-0.5 select-none hover:bg-gray-100 dark:border-zinc-600 dark:bg-zinc-800 dark:hover:bg-zinc-700/60",
40
+ children: [/* @__PURE__ */ c("div", {
41
+ className: "min-w-0 truncate text-xs",
42
+ children: b
43
+ }), /* @__PURE__ */ c(d, {
44
+ size: "xs",
45
+ icon: "fas fa-trash-alt",
46
+ onClick: p,
47
+ intent: "danger",
48
+ title: "Remove"
105
49
  })]
106
- }), /* @__PURE__ */ a(s.Content, {
107
- className: "w-[260px]",
108
- children: /* @__PURE__ */ o("div", {
50
+ }), /* @__PURE__ */ c(u.Content, {
51
+ className: "w-[240px]",
52
+ children: /* @__PURE__ */ l("div", {
109
53
  className: "flex w-full flex-col gap-2 p-2",
110
- children: [/* @__PURE__ */ a(t, {
111
- label: "Type",
112
- children: /* @__PURE__ */ a(e, {
113
- onChange: v("type"),
114
- type: "iconGroup",
115
- items: y
116
- })
117
- }), /* @__PURE__ */ o(t, {
118
- label: "Position",
119
- children: [
120
- /* @__PURE__ */ a(e, {
121
- label: "X",
122
- value: m,
123
- onChange: v("posX"),
124
- type: "metric",
125
- ...b
126
- }),
127
- /* @__PURE__ */ a(e, {
128
- label: "Y",
129
- value: m,
130
- onChange: v("posY"),
131
- type: "metric",
132
- ...b
133
- }),
134
- p !== "skew" && /* @__PURE__ */ a(e, {
135
- label: "Z",
136
- value: m,
137
- onChange: v("posZ"),
138
- type: "metric",
139
- ...b
54
+ children: [/* @__PURE__ */ l(e, {
55
+ value: t.name,
56
+ onChange: v,
57
+ type: "select",
58
+ children: [f.map((e) => /* @__PURE__ */ c("optgroup", {
59
+ label: e.category,
60
+ children: e.specs.map((e) => /* @__PURE__ */ c("option", {
61
+ value: e.name,
62
+ children: e.label
63
+ }, e.name))
64
+ }, e.category)), !h && /* @__PURE__ */ c("optgroup", {
65
+ label: "Other",
66
+ children: /* @__PURE__ */ c("option", {
67
+ value: t.name,
68
+ children: t.name
140
69
  })
141
- ]
70
+ })]
71
+ }), /* @__PURE__ */ c("div", {
72
+ className: "flex flex-col gap-1.5",
73
+ children: g.map((t, n) => /* @__PURE__ */ c(e, {
74
+ label: t.label,
75
+ value: _[n],
76
+ onChange: y(n),
77
+ type: "metric",
78
+ direction: "row",
79
+ units: a(t.kind),
80
+ step: t.kind === "number" ? .1 : 1,
81
+ min: -Infinity
82
+ }, `${t.label}-${n}`))
142
83
  })]
143
84
  })
144
85
  })]
145
86
  });
146
87
  };
147
88
  //#endregion
148
- export { l as default };
89
+ export { p as default };
@@ -0,0 +1,27 @@
1
+ export type TransformArgKind = 'length' | 'number' | 'angle';
2
+ export type TransformArgSpec = {
3
+ label: string;
4
+ kind: TransformArgKind;
5
+ default: string;
6
+ };
7
+ export type TransformFunctionSpec = {
8
+ name: string;
9
+ label: string;
10
+ category: string;
11
+ args: TransformArgSpec[];
12
+ };
13
+ export type TransformFunctionValue = {
14
+ name: string;
15
+ args: string[];
16
+ };
17
+ export declare const TRANSFORM_FUNCTIONS: TransformFunctionSpec[];
18
+ export declare const DEFAULT_FUNCTION = "translate3d";
19
+ export declare const unitsForKind: (kind: TransformArgKind) => {
20
+ label: string;
21
+ value: string;
22
+ }[];
23
+ export declare const getFunctionSpec: (name: string) => TransformFunctionSpec | undefined;
24
+ export declare const parseTransforms: (value: string) => TransformFunctionValue[];
25
+ export declare const serializeTransform: ({ name, args }: TransformFunctionValue) => string;
26
+ export declare const serializeTransforms: (transforms: TransformFunctionValue[]) => string;
27
+ export declare const createFunctionValue: (name: string) => TransformFunctionValue;
@@ -0,0 +1,191 @@
1
+ //#region src/components/StyleInspector/categories/Effects/Transform/transformFunctions.ts
2
+ var e = (e) => ({
3
+ label: e,
4
+ kind: "length",
5
+ default: "0px"
6
+ }), t = (e) => ({
7
+ label: e,
8
+ kind: "number",
9
+ default: "1"
10
+ }), n = (e) => ({
11
+ label: e,
12
+ kind: "angle",
13
+ default: "0deg"
14
+ }), r = [
15
+ {
16
+ name: "translate",
17
+ label: "Translate 2D",
18
+ category: "Translate",
19
+ args: [e("X"), e("Y")]
20
+ },
21
+ {
22
+ name: "translate3d",
23
+ label: "Translate 3D",
24
+ category: "Translate",
25
+ args: [
26
+ e("X"),
27
+ e("Y"),
28
+ e("Z")
29
+ ]
30
+ },
31
+ {
32
+ name: "translateX",
33
+ label: "Translate X",
34
+ category: "Translate",
35
+ args: [e("X")]
36
+ },
37
+ {
38
+ name: "translateY",
39
+ label: "Translate Y",
40
+ category: "Translate",
41
+ args: [e("Y")]
42
+ },
43
+ {
44
+ name: "translateZ",
45
+ label: "Translate Z",
46
+ category: "Translate",
47
+ args: [e("Z")]
48
+ },
49
+ {
50
+ name: "scale",
51
+ label: "Scale 2D",
52
+ category: "Scale",
53
+ args: [t("X"), t("Y")]
54
+ },
55
+ {
56
+ name: "scale3d",
57
+ label: "Scale 3D",
58
+ category: "Scale",
59
+ args: [
60
+ t("X"),
61
+ t("Y"),
62
+ t("Z")
63
+ ]
64
+ },
65
+ {
66
+ name: "scaleX",
67
+ label: "Scale X",
68
+ category: "Scale",
69
+ args: [t("X")]
70
+ },
71
+ {
72
+ name: "scaleY",
73
+ label: "Scale Y",
74
+ category: "Scale",
75
+ args: [t("Y")]
76
+ },
77
+ {
78
+ name: "scaleZ",
79
+ label: "Scale Z",
80
+ category: "Scale",
81
+ args: [t("Z")]
82
+ },
83
+ {
84
+ name: "rotate",
85
+ label: "Rotate",
86
+ category: "Rotate",
87
+ args: [n("Angle")]
88
+ },
89
+ {
90
+ name: "rotateX",
91
+ label: "Rotate X",
92
+ category: "Rotate",
93
+ args: [n("X")]
94
+ },
95
+ {
96
+ name: "rotateY",
97
+ label: "Rotate Y",
98
+ category: "Rotate",
99
+ args: [n("Y")]
100
+ },
101
+ {
102
+ name: "rotateZ",
103
+ label: "Rotate Z",
104
+ category: "Rotate",
105
+ args: [n("Z")]
106
+ },
107
+ {
108
+ name: "skew",
109
+ label: "Skew 2D",
110
+ category: "Skew",
111
+ args: [n("X"), n("Y")]
112
+ },
113
+ {
114
+ name: "skewX",
115
+ label: "Skew X",
116
+ category: "Skew",
117
+ args: [n("X")]
118
+ },
119
+ {
120
+ name: "skewY",
121
+ label: "Skew Y",
122
+ category: "Skew",
123
+ args: [n("Y")]
124
+ },
125
+ {
126
+ name: "perspective",
127
+ label: "Perspective",
128
+ category: "Perspective",
129
+ args: [e("Distance")]
130
+ }
131
+ ], i = "translate3d", a = {
132
+ length: [
133
+ {
134
+ label: "PX",
135
+ value: "px"
136
+ },
137
+ {
138
+ label: "%",
139
+ value: "%"
140
+ },
141
+ {
142
+ label: "EM",
143
+ value: "em"
144
+ },
145
+ {
146
+ label: "REM",
147
+ value: "rem"
148
+ },
149
+ {
150
+ label: "VW",
151
+ value: "vw"
152
+ },
153
+ {
154
+ label: "VH",
155
+ value: "vh"
156
+ }
157
+ ],
158
+ angle: [
159
+ {
160
+ label: "DEG",
161
+ value: "deg"
162
+ },
163
+ {
164
+ label: "RAD",
165
+ value: "rad"
166
+ },
167
+ {
168
+ label: "TURN",
169
+ value: "turn"
170
+ }
171
+ ],
172
+ number: []
173
+ }, o = (e) => a[e], s = new Map(r.map((e) => [e.name.toLowerCase(), e])), c = (e) => s.get(e.toLowerCase()), l = /([a-zA-Z][a-zA-Z0-9]*)\s*\(([^)]*)\)/g, u = (e) => {
174
+ let t = [];
175
+ for (let n of e.matchAll(l)) {
176
+ let [, e, r] = n, i = r.split(",").map((e) => e.trim()).filter((e) => e !== "");
177
+ t.push({
178
+ name: e,
179
+ args: i
180
+ });
181
+ }
182
+ return t;
183
+ }, d = ({ name: e, args: t }) => `${e}(${t.join(", ")})`, f = (e) => e.map(d).join(" "), p = (e) => {
184
+ let t = c(e);
185
+ return {
186
+ name: e,
187
+ args: t ? t.args.map((e) => e.default) : ["0px"]
188
+ };
189
+ };
190
+ //#endregion
191
+ export { i as DEFAULT_FUNCTION, r as TRANSFORM_FUNCTIONS, p as createFunctionValue, c as getFunctionSpec, u as parseTransforms, d as serializeTransform, f as serializeTransforms, o as unitsForKind };
@@ -29,7 +29,7 @@ var s = ({ value: s, onChange: c }) => {
29
29
  onClick: f
30
30
  })]
31
31
  }), l.length > 0 && /* @__PURE__ */ i("div", {
32
- className: "flex flex-col",
32
+ className: "flex flex-col gap-2",
33
33
  children: l.map((e, n) => /* @__PURE__ */ i(t, {
34
34
  value: e,
35
35
  onChange: d(n),
@@ -46,6 +46,7 @@ var h = ({ value: h = "", onRemove: g, onChange: _ }) => {
46
46
  return j = E in i ? i[E] : E.match(/[0-9.]+/gim), /* @__PURE__ */ u(d, {
47
47
  className: "w-full",
48
48
  closeOnClick: !1,
49
+ containerTopOffset: 5,
49
50
  children: [/* @__PURE__ */ u(d.Trigger, {
50
51
  className: "flex w-full cursor-pointer items-center justify-between rounded-sm border border-gray-300 bg-white px-2 py-0.5 select-none hover:bg-gray-100 dark:border-zinc-600 dark:bg-zinc-800 dark:hover:bg-zinc-700/60",
51
52
  children: [/* @__PURE__ */ l("div", {
@@ -19,6 +19,7 @@ var a = ({ items: a = [], onChange: o }) => {
19
19
  active: t.active,
20
20
  onClick: c(t.value),
21
21
  icon: typeof t.icon == "string" ? t.icon : void 0,
22
+ title: t.description,
22
23
  children: typeof t.icon != "string" && t.icon
23
24
  }, n))
24
25
  });
@@ -10,7 +10,7 @@ var a = ({ element: a }) => {
10
10
  if (!a) return n;
11
11
  let { definition: { bindings: r } } = a;
12
12
  return r?.style && r.style.forEach((r) => {
13
- e(o, `${r.source}.${r.fromPath}`) === void 0 || !r.enabled || t(n, r.toPath, e(o, `${r.source}.${r.fromPath}`));
13
+ e(o, r.source) === void 0 || !r.enabled || t(n, r.to, e(o, r.source));
14
14
  }), n;
15
15
  }, [o, a]);
16
16
  };
@@ -11,56 +11,56 @@ import g from "@plitzi/plitzi-ui/Input";
11
11
  import { produce as _ } from "immer";
12
12
  import v from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
13
13
  var y = n(({ displayMode: n, flatList: y, selectors: b, selected: x, onSelect: S }) => {
14
- let C = a(() => Object.values(b ?? {}), [b]), [w, T] = o(""), { builderHandler: E } = r(v), { components: D } = r(d), O = a(() => C.filter((e) => !!e.componentType).map((e) => e.componentType), [C]), k = a(() => {
14
+ let C = a(() => Object.values(b ?? {}), [b]), [w, T] = o(""), [E, D] = o([]), { builderHandler: O } = r(v), { components: k } = r(d), A = a(() => C.filter((e) => !!e.componentType).map((e) => e.componentType), [C]), j = a(() => {
15
15
  let e = C;
16
16
  return p(w) || (e = C.filter((e) => e.name.toLowerCase().includes(w.toLowerCase()))), e.sort((e, t) => {
17
17
  let n = Number(e.type === "element"), r = Number(t.type === "element");
18
18
  return n === r ? e.name.localeCompare(t.name) : r - n;
19
19
  });
20
- }, [C, w]), A = i((e) => T(e), [T]), [j, M, N, P] = h({
20
+ }, [C, w]), M = i((e) => T(e), [T]), [N, P, F, I] = h({
21
21
  id: "add-selector",
22
22
  onClose: i((e, t) => {
23
23
  if (t) if (t.mode === "default") {
24
24
  let { name: e } = t;
25
- E("styleAddSelector", n, e, "class", void 0, void 0, {
25
+ O("styleAddSelector", n, e, "class", void 0, void 0, {
26
26
  styleSelector: void 0,
27
27
  componentType: void 0
28
28
  });
29
29
  } else {
30
30
  let { componentType: e } = t;
31
- E("styleAddSelector", n, e, "element", void 0, void 0, {
31
+ O("styleAddSelector", n, e, "element", void 0, void 0, {
32
32
  styleSelector: void 0,
33
33
  componentType: e
34
34
  });
35
35
  }
36
- }, [E, n])
37
- }), F = i((e) => {
36
+ }, [O, n])
37
+ }), L = i((e) => {
38
38
  S?.((t) => t?.name === e ? void 0 : C.find((t) => t.name === e));
39
- }, [S, C]), I = i((e, t) => t ? Object.values(f(e, "definition.styleSelectors", {})).find((e) => (t.includes(":") && (t = f(t.split(":"), "0", t)), e && t && e.split(" ").includes(t))) : [], []), [L, R, z, B] = h({
39
+ }, [S, C]), R = i((e, t) => t ? Object.values(f(e, "definition.styleSelectors", {})).find((e) => (t.includes(":") && (t = f(t.split(":"), "0", t)), e && t && e.split(" ").includes(t))) : [], []), [z, B, V, H, , U] = h({
40
40
  id: "delete-selector",
41
41
  onClose: i((e, t, r) => {
42
- !t || !r || (y.filter((e) => I(e, r)).forEach((e) => {
43
- E("schemaUpdateElement", _(e, (t) => {
44
- Object.keys(e.definition.styleSelectors).forEach((e) => {
45
- f(t, `definition.styleSelectors.${e}`, "") === r && m(t, `definition.styleSelectors.${e}`, "");
46
- });
47
- }));
48
- }), E("styleRemoveSelector", n, r), S?.(void 0));
42
+ if (!t || !r || r.length === 0) return;
43
+ let i = new Set(r), a = y.filter((e) => r.some((t) => R(e, t))).map((e) => _(e, (t) => {
44
+ Object.keys(e.definition.styleSelectors).forEach((e) => {
45
+ i.has(f(t, `definition.styleSelectors.${e}`, "")) && m(t, `definition.styleSelectors.${e}`, "");
46
+ });
47
+ }));
48
+ a.length > 0 && O("schemaUpdateElements", a), O("styleRemoveSelectors", n, r), D((e) => e.filter((e) => !i.has(e))), S?.((e) => e && i.has(e.name) ? void 0 : e);
49
49
  }, [
50
- E,
50
+ O,
51
51
  n,
52
- I,
52
+ R,
53
53
  y,
54
54
  S
55
55
  ])
56
- }), V = i((e) => z(void 0, e), [z]), H = a(() => k.reduce((e, t) => ({
56
+ }), W = i((e) => V(void 0, [e]), [V]), G = i((e) => D((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), []), K = i(() => D([]), []), q = i(() => V(void 0, E), [V, E]), J = Array.isArray(U) ? U.length : 0, Y = a(() => j.reduce((e, t) => ({
57
57
  ...e,
58
- [t.name]: y.filter((e) => I(e, t.name)).length
58
+ [t.name]: y.filter((e) => R(e, t.name)).length
59
59
  }), {}), [
60
- k,
60
+ j,
61
61
  y,
62
- I
63
- ]), U = i(() => void B(void 0, !1), [B]), W = i(() => void B(void 0, !0), [B]);
62
+ R
63
+ ]), X = i(() => void H(void 0, !1), [H]), Z = i(() => void H(void 0, !0), [H]);
64
64
  return /* @__PURE__ */ c("div", {
65
65
  className: "flex max-w-[350px] grow basis-0 flex-col gap-2 overflow-auto border-r border-gray-300 pt-2 pr-2 dark:border-zinc-700",
66
66
  children: [
@@ -69,7 +69,7 @@ var y = n(({ displayMode: n, flatList: y, selectors: b, selected: x, onSelect: S
69
69
  size: "sm",
70
70
  className: "w-full",
71
71
  iconPlacement: "before",
72
- onClick: N,
72
+ onClick: F,
73
73
  children: [/* @__PURE__ */ s(u.Icon, {
74
74
  icon: "fas fa-tint",
75
75
  size: "md",
@@ -79,51 +79,77 @@ var y = n(({ displayMode: n, flatList: y, selectors: b, selected: x, onSelect: S
79
79
  /* @__PURE__ */ s(g, {
80
80
  placeholder: "Search Selector",
81
81
  value: w,
82
- onChange: A,
82
+ onChange: M,
83
83
  size: "xs"
84
84
  }),
85
+ E.length > 0 && /* @__PURE__ */ c("div", {
86
+ className: "bg-secondary-50 dark:bg-secondary-900/30 flex items-center justify-between gap-2 rounded-sm px-2 py-1",
87
+ children: [/* @__PURE__ */ c("span", {
88
+ className: "text-xs text-zinc-600 dark:text-zinc-300",
89
+ children: [E.length, " selected"]
90
+ }), /* @__PURE__ */ c("div", {
91
+ className: "flex gap-1",
92
+ children: [/* @__PURE__ */ s(u, {
93
+ size: "xs",
94
+ onClick: K,
95
+ children: "Clear"
96
+ }), /* @__PURE__ */ c(u, {
97
+ intent: "danger",
98
+ size: "xs",
99
+ iconPlacement: "before",
100
+ onClick: q,
101
+ children: [/* @__PURE__ */ s(u.Icon, { icon: "fas fa-trash" }), "Delete"]
102
+ })]
103
+ })]
104
+ }),
85
105
  /* @__PURE__ */ s("div", {
86
106
  className: "flex grow basis-0 flex-col overflow-y-auto",
87
- children: k.map((t) => {
107
+ children: j.map((t) => {
88
108
  let { name: n, type: r } = t;
89
109
  return /* @__PURE__ */ s(e, {
90
110
  id: n,
91
111
  active: n === x,
112
+ checked: E.includes(n),
92
113
  label: n,
93
114
  type: r,
94
- elementsCount: H[n],
95
- onSelect: F,
96
- onDelete: V
115
+ elementsCount: Y[n],
116
+ onSelect: L,
117
+ onDelete: W,
118
+ onToggleCheck: G
97
119
  }, n);
98
120
  })
99
121
  }),
100
122
  /* @__PURE__ */ c(l, {
101
- id: j,
102
- open: M,
103
- onClose: P,
123
+ id: N,
124
+ open: P,
125
+ onClose: I,
104
126
  size: "sm",
105
127
  children: [/* @__PURE__ */ s(l.Header, { children: /* @__PURE__ */ s("h4", { children: "Add Selector" }) }), /* @__PURE__ */ s(l.Body, { children: /* @__PURE__ */ s(t, {
106
- componentsNotAvailables: O,
107
- components: D.current,
108
- onSubmit: P,
109
- onClose: P
128
+ componentsNotAvailables: A,
129
+ components: k.current,
130
+ onSubmit: I,
131
+ onClose: I
110
132
  }) })]
111
133
  }),
112
134
  /* @__PURE__ */ c(l, {
113
- id: L,
114
- open: R,
115
- onClose: B,
135
+ id: z,
136
+ open: B,
137
+ onClose: H,
116
138
  children: [
117
139
  /* @__PURE__ */ s(l.Header, { children: /* @__PURE__ */ s("h4", { children: "Remove Selector" }) }),
118
- /* @__PURE__ */ s(l.Body, { children: /* @__PURE__ */ s("h4", { children: "Do you want to remove this item ?" }) }),
140
+ /* @__PURE__ */ c(l.Body, { children: [J > 1 && /* @__PURE__ */ c("h4", { children: [
141
+ "Do you want to remove these ",
142
+ J,
143
+ " items ?"
144
+ ] }), J <= 1 && /* @__PURE__ */ s("h4", { children: "Do you want to remove this item ?" })] }),
119
145
  /* @__PURE__ */ c(l.Footer, {
120
146
  justify: "end",
121
147
  children: [/* @__PURE__ */ s(u, {
122
- onClick: U,
148
+ onClick: X,
123
149
  size: "sm",
124
150
  children: "Cancel"
125
151
  }), /* @__PURE__ */ s(u, {
126
- onClick: W,
152
+ onClick: Z,
127
153
  size: "sm",
128
154
  children: "Submit"
129
155
  })]
@@ -3,10 +3,12 @@ export type StyleSelectorTagProps = {
3
3
  id: string;
4
4
  label?: string;
5
5
  active?: boolean;
6
+ checked?: boolean;
6
7
  elementsCount?: number;
7
8
  type?: TagType;
8
9
  onSelect?: (id: string) => void;
9
10
  onDelete?: (id: string) => void;
11
+ onToggleCheck?: (id: string) => void;
10
12
  };
11
- declare const _default: import('react').MemoExoticComponent<({ id, label, active, elementsCount, type, onSelect, onDelete }: StyleSelectorTagProps) => import("react").JSX.Element>;
13
+ declare const _default: import('react').MemoExoticComponent<({ id, label, active, checked, elementsCount, type, onSelect, onDelete, onToggleCheck }: StyleSelectorTagProps) => import("react").JSX.Element>;
12
14
  export default _default;
@@ -3,41 +3,54 @@ import t from "clsx";
3
3
  import { memo as n, useCallback as r } from "react";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  import o from "@plitzi/plitzi-ui/Button";
6
- var s = n(({ id: n, label: s = "Selector", active: c = !1, elementsCount: l = 0, type: u = "class", onSelect: d, onDelete: f }) => {
7
- let p = r(() => d?.(n), [n, d]), m = r((e) => {
8
- e.stopPropagation(), n && f?.(n);
9
- }, [n, f]);
6
+ import s from "@plitzi/plitzi-ui/Checkbox";
7
+ var c = n(({ id: n, label: c = "Selector", active: l = !1, checked: u = !1, elementsCount: d = 0, type: f = "class", onSelect: p, onDelete: m, onToggleCheck: h }) => {
8
+ let g = r(() => p?.(n), [n, p]), _ = r((e) => {
9
+ e.stopPropagation(), n && m?.(n);
10
+ }, [n, m]), v = r(() => h?.(n), [n, h]), y = r((e) => e.stopPropagation(), []);
10
11
  return /* @__PURE__ */ a("div", {
11
12
  className: t("group flex cursor-pointer items-center justify-between gap-2 border-t border-gray-300 p-1 dark:border-zinc-700", {
12
- "hover:bg-gray-100 dark:hover:bg-zinc-700/60": !c,
13
- "bg-gray-200 dark:bg-zinc-700": c
13
+ "hover:bg-gray-100 dark:hover:bg-zinc-700/60": !l && !u,
14
+ "bg-gray-200 dark:bg-zinc-700": l,
15
+ "bg-secondary-50 dark:bg-secondary-900/30": u && !l
14
16
  }),
15
- onClick: p,
16
- children: [/* @__PURE__ */ i(e, {
17
- editable: !1,
18
- selector: s,
19
- type: u,
20
- active: !0,
21
- readOnly: !0
17
+ onClick: g,
18
+ children: [/* @__PURE__ */ a("div", {
19
+ className: "flex min-w-0 items-center gap-2",
20
+ children: [/* @__PURE__ */ i("div", {
21
+ className: "flex items-center",
22
+ children: /* @__PURE__ */ i(s, {
23
+ size: "xs",
24
+ checked: u,
25
+ onChange: v,
26
+ onClick: y
27
+ })
28
+ }), /* @__PURE__ */ i(e, {
29
+ editable: !1,
30
+ selector: c,
31
+ type: f,
32
+ active: !0,
33
+ readOnly: !0
34
+ })]
22
35
  }), /* @__PURE__ */ a("div", {
23
36
  className: "flex",
24
37
  children: [/* @__PURE__ */ i("div", {
25
38
  className: t("mr-1", {
26
- flex: c,
27
- "hidden group-hover:flex": !c
39
+ flex: l,
40
+ "hidden group-hover:flex": !l
28
41
  }),
29
42
  children: /* @__PURE__ */ i(o, {
30
43
  intent: "danger",
31
44
  size: "xs",
32
- onClick: m,
45
+ onClick: _,
33
46
  children: /* @__PURE__ */ i(o.Icon, { icon: "fas fa-trash" })
34
47
  })
35
- }), l > 0 && /* @__PURE__ */ i("div", {
48
+ }), d > 0 && /* @__PURE__ */ i("div", {
36
49
  className: "bg-secondary-400 flex items-center justify-center rounded-sm px-1.5 py-1 text-xs text-white",
37
- children: l
50
+ children: d
38
51
  })]
39
52
  })]
40
53
  });
41
54
  });
42
55
  //#endregion
43
- export { s as default };
56
+ export { c as default };
@@ -118,14 +118,11 @@ var r = (e, t) => {
118
118
  let S = {};
119
119
  for (let e of y.tree) {
120
120
  let r = s(e, p, m, h);
121
- if (r) {
122
- e.isAncestor && (r = t(r, n));
123
- for (let t of Object.keys(r)) e.isAncestor && !n.includes(t) || (S[t] || (S[t] = []), S[t].push({
124
- key: e.name,
125
- value: r[t],
126
- displayMode: e.displayMode
127
- }));
128
- }
121
+ if (!(!r || !Object.keys(r).length) && ((e.isAncestor || e.isDefault && e.componentType !== o) && (r = t(r, n)), Object.keys(r).length)) for (let t of Object.keys(r)) S[t] || (S[t] = []), S[t].push({
122
+ key: e.name,
123
+ value: r[t],
124
+ displayMode: e.displayMode
125
+ });
129
126
  }
130
127
  let C = y.tree.filter((e) => e.isParent).reduce((e, t) => ({
131
128
  ...e,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-style",
3
- "version": "0.32.4",
3
+ "version": "0.32.6",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -454,6 +454,10 @@
454
454
  "types": "./dist/components/StyleInspector/categories/Effects/Transform/index.d.ts",
455
455
  "import": "./dist/components/StyleInspector/categories/Effects/Transform/index.mjs"
456
456
  },
457
+ "./components/StyleInspector/categories/Effects/Transform/transformFunctions": {
458
+ "types": "./dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.d.ts",
459
+ "import": "./dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.mjs"
460
+ },
457
461
  "./components/StyleInspector/categories/Effects/Transition": {
458
462
  "types": "./dist/components/StyleInspector/categories/Effects/Transition/index.d.ts",
459
463
  "import": "./dist/components/StyleInspector/categories/Effects/Transition/index.mjs"
@@ -831,19 +835,19 @@
831
835
  "build:prod": "vite build && node ../sdk-shared/scripts/generate-exports.mjs"
832
836
  },
833
837
  "dependencies": {
834
- "@plitzi/plitzi-ui": "^1.6.13",
835
- "@plitzi/sdk-plugins": "0.32.4",
836
- "@plitzi/sdk-shared": "0.32.4",
837
- "@plitzi/sdk-variables": "0.32.4",
838
+ "@plitzi/plitzi-ui": "^1.6.17",
839
+ "@plitzi/sdk-plugins": "0.32.6",
840
+ "@plitzi/sdk-shared": "0.32.6",
841
+ "@plitzi/sdk-variables": "0.32.6",
838
842
  "clsx": "^2.1.1",
839
- "immer": "^11.1.8",
843
+ "immer": "^11.1.15",
840
844
  "prop-types": "^15.8.1",
841
845
  "zod": "^4.4.3"
842
846
  },
843
847
  "devDependencies": {
844
- "eslint": "^9.39.4",
848
+ "eslint": "^9.39.5",
845
849
  "typescript": "^6.0.3",
846
- "vite": "^8.0.16",
847
- "vitest": "^4.1.9"
850
+ "vite": "^8.1.5",
851
+ "vitest": "^4.1.10"
848
852
  }
849
853
  }