@plitzi/sdk-style 0.37.0 → 0.37.2

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 (113) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/dist/SdkStyleContextProvider.d.ts +1 -1
  3. package/dist/StyleAdvanceEditor.d.ts +1 -1
  4. package/dist/components/InputEasing/Curve.d.ts +1 -1
  5. package/dist/components/InputEasing/Grid.d.ts +1 -1
  6. package/dist/components/InputEasing/InputEasing.d.ts +1 -1
  7. package/dist/components/InputEasing/InputEasingButton.d.ts +1 -1
  8. package/dist/components/InputEasing/InputEasingList.d.ts +1 -1
  9. package/dist/components/InputEasing/Progress.d.ts +1 -1
  10. package/dist/components/Selector/Selector.d.ts +1 -1
  11. package/dist/components/Selector/SelectorItem/ItemOptions.d.ts +1 -1
  12. package/dist/components/Selector/SelectorItem/SelectorItem.d.ts +1 -1
  13. package/dist/components/Selector/SelectorSuggestions/SelectorSuggestions.d.ts +1 -1
  14. package/dist/components/Selector/SelectorSuggestions/SuggestionsCreator.d.ts +1 -1
  15. package/dist/components/Selector/SelectorSuggestions/SuggestionsList.d.ts +1 -1
  16. package/dist/components/StyleInspector/Inspector.d.ts +1 -1
  17. package/dist/components/StyleInspector/StyleInspector.d.ts +1 -1
  18. package/dist/components/StyleInspector/StyleInspectorProvider.d.ts +1 -1
  19. package/dist/components/StyleInspector/categories/Background/Background.d.ts +1 -1
  20. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.d.ts +1 -1
  21. package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.d.ts +1 -1
  22. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.d.ts +1 -1
  23. package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.d.ts +1 -1
  24. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.d.ts +1 -1
  25. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.d.ts +1 -1
  26. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.d.ts +1 -1
  27. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.d.ts +1 -1
  28. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.d.ts +1 -1
  29. package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.d.ts +1 -1
  30. package/dist/components/StyleInspector/categories/Background/modes/ImageMode.d.ts +1 -1
  31. package/dist/components/StyleInspector/categories/Background/modes/LinearGradientMode.d.ts +1 -1
  32. package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.d.ts +1 -1
  33. package/dist/components/StyleInspector/categories/Border/Border.d.ts +1 -1
  34. package/dist/components/StyleInspector/categories/Border/BorderColor.d.ts +1 -1
  35. package/dist/components/StyleInspector/categories/Border/BorderPlacements.d.ts +1 -1
  36. package/dist/components/StyleInspector/categories/Border/BorderRadius.d.ts +1 -1
  37. package/dist/components/StyleInspector/categories/Border/BorderStyle.d.ts +1 -1
  38. package/dist/components/StyleInspector/categories/Border/BorderWidth.d.ts +1 -1
  39. package/dist/components/StyleInspector/categories/Display/Display.d.ts +1 -1
  40. package/dist/components/StyleInspector/categories/Display/DisplayElements.d.ts +1 -1
  41. package/dist/components/StyleInspector/categories/Display/DisplayFlex.d.ts +1 -1
  42. package/dist/components/StyleInspector/categories/Display/DisplayFlexAlignContent.d.ts +1 -1
  43. package/dist/components/StyleInspector/categories/Display/DisplayFlexAlignItems.d.ts +1 -1
  44. package/dist/components/StyleInspector/categories/Display/DisplayFlexDirection.d.ts +1 -1
  45. package/dist/components/StyleInspector/categories/Display/DisplayFlexJustify.d.ts +1 -1
  46. package/dist/components/StyleInspector/categories/Display/DisplayGap.d.ts +1 -1
  47. package/dist/components/StyleInspector/categories/Display/DisplayGridGap.d.ts +1 -1
  48. package/dist/components/StyleInspector/categories/Display/DisplayGridTemplate.d.ts +1 -1
  49. package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayAlignSelf.d.ts +1 -1
  50. package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayFlexChild.d.ts +1 -1
  51. package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayOrder.d.ts +1 -1
  52. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.d.ts +1 -1
  53. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.d.ts +1 -1
  54. package/dist/components/StyleInspector/categories/Effects/Effects.d.ts +1 -1
  55. package/dist/components/StyleInspector/categories/Effects/Filters/Filter.d.ts +1 -1
  56. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.d.ts +1 -1
  57. package/dist/components/StyleInspector/categories/Effects/Transform/Transform.d.ts +1 -1
  58. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.d.ts +1 -1
  59. package/dist/components/StyleInspector/categories/Effects/Transition/Transition.d.ts +1 -1
  60. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.d.ts +1 -1
  61. package/dist/components/StyleInspector/categories/List/List.d.ts +1 -1
  62. package/dist/components/StyleInspector/categories/ListItem/ListItem.d.ts +1 -1
  63. package/dist/components/StyleInspector/categories/Others/Others.d.ts +1 -1
  64. package/dist/components/StyleInspector/categories/Others/OthersForm.d.ts +1 -1
  65. package/dist/components/StyleInspector/categories/Others/OthersInteraction.d.ts +1 -1
  66. package/dist/components/StyleInspector/categories/Others/OthersOutline.d.ts +1 -1
  67. package/dist/components/StyleInspector/categories/Others/OthersScrollbar.d.ts +1 -1
  68. package/dist/components/StyleInspector/categories/Others/OthersSvg.d.ts +1 -1
  69. package/dist/components/StyleInspector/categories/Others/OthersTable.d.ts +1 -1
  70. package/dist/components/StyleInspector/categories/Position/Position.d.ts +1 -1
  71. package/dist/components/StyleInspector/categories/Position/PositionAdvanced.d.ts +1 -1
  72. package/dist/components/StyleInspector/categories/Position/PositionAdvancedButtons.d.ts +1 -1
  73. package/dist/components/StyleInspector/categories/Position/PositionClear.d.ts +1 -1
  74. package/dist/components/StyleInspector/categories/Position/PositionFloat.d.ts +1 -1
  75. package/dist/components/StyleInspector/categories/RawStyle/RawStyle.d.ts +1 -1
  76. package/dist/components/StyleInspector/categories/Size/Size.d.ts +1 -1
  77. package/dist/components/StyleInspector/categories/Size/SizeFit.d.ts +1 -1
  78. package/dist/components/StyleInspector/categories/Size/SizeOverflow.d.ts +1 -1
  79. package/dist/components/StyleInspector/categories/Size/SizePosition.d.ts +1 -1
  80. package/dist/components/StyleInspector/categories/Spacing/Spacing.d.ts +1 -1
  81. package/dist/components/StyleInspector/categories/Spacing/SpacingEditor.d.ts +1 -1
  82. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.d.ts +1 -1
  83. package/dist/components/StyleInspector/categories/Spacing/SpacingNumber.d.ts +1 -1
  84. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.d.ts +1 -1
  85. package/dist/components/StyleInspector/categories/Typography/Typography.d.ts +1 -1
  86. package/dist/components/StyleInspector/categories/Typography/TypographyAlign.d.ts +1 -1
  87. package/dist/components/StyleInspector/categories/Typography/TypographyBreaking.d.ts +1 -1
  88. package/dist/components/StyleInspector/categories/Typography/TypographyClamp.d.ts +1 -1
  89. package/dist/components/StyleInspector/categories/Typography/TypographyFigures.d.ts +1 -1
  90. package/dist/components/StyleInspector/categories/Typography/TypographyFont.d.ts +1 -1
  91. package/dist/components/StyleInspector/categories/Typography/TypographyStyle.d.ts +1 -1
  92. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.d.ts +1 -1
  93. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.d.ts +1 -1
  94. package/dist/components/StyleInspector/categories/Typography/TypographyTransform.d.ts +1 -1
  95. package/dist/components/StyleInspector/categories/Variables/Variables.d.ts +1 -1
  96. package/dist/components/StyleInspector/components/AncestorRules/AncestorRuleChip.d.ts +1 -1
  97. package/dist/components/StyleInspector/components/AncestorRules/AncestorRules.d.ts +1 -1
  98. package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.d.ts +1 -1
  99. package/dist/components/StyleInspector/components/CategoryOption/CategoryOption.d.ts +1 -1
  100. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionColor.d.ts +1 -1
  101. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.d.ts +1 -1
  102. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionInput.d.ts +1 -1
  103. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionMetricInput.d.ts +1 -1
  104. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionSelect.d.ts +1 -1
  105. package/dist/components/StyleInspector/components/CategorySection/CategorySection.d.ts +1 -1
  106. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.d.ts +1 -1
  107. package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.d.ts +1 -1
  108. package/dist/components/StyleManager/ManagerSelector.d.ts +1 -1
  109. package/dist/components/StyleManager/StyleManager.d.ts +1 -1
  110. package/dist/components/StyleManager/StyleSelectorTag.d.ts +1 -1
  111. package/dist/helpers/processSelectorAttributes.mjs +86 -66
  112. package/dist/models/SelectorForm/SelectorForm.d.ts +1 -1
  113. package/package.json +21 -5
@@ -1,110 +1,130 @@
1
1
  //#region src/helpers/processSelectorAttributes.ts
2
- var e = (e, t, n = !1) => n ? t : `${e}:${t};`, t = (e) => {
2
+ var e = (e, t, { keepEmpty: n = !1, closeEndsPart: r = !1 } = {}) => {
3
+ let i = [], a = 0, o = "", s = "", c = () => {
4
+ (n || s) && i.push(s), s = "";
5
+ };
6
+ for (let n of e) {
7
+ if (o) o = n === o ? "" : o;
8
+ else if (/["']/.test(n)) o = n;
9
+ else if (n === "(") a += 1;
10
+ else if (n === ")") {
11
+ if (a = Math.max(0, a - 1), r && a === 0) {
12
+ s += n, c();
13
+ continue;
14
+ }
15
+ } else if (a === 0 && t(n)) {
16
+ c();
17
+ continue;
18
+ }
19
+ s += n;
20
+ }
21
+ return c(), i;
22
+ }, t = (e) => /\s/.test(e), n = (e, t, n = !1) => n ? t : `${e}:${t};`, r = (e) => {
3
23
  if (!e) return [];
4
24
  let t = [];
5
25
  for (let [n, r] of Object.entries(e)) {
6
- let e = a(n, String(r));
26
+ let e = s(n, String(r));
7
27
  t.push(...e.variables, e.value);
8
28
  }
9
29
  return t;
10
- }, n = (t, n, r, i = !1) => {
30
+ }, i = (e, t, r, i = !1) => {
11
31
  let a = {
12
32
  variables: {},
13
33
  value: ""
14
34
  }, o = r.replaceAll("\"", "").match(/var\((?<variableName>--[\w-]+)\)(?<extraContent>\S.+)/);
15
- if (!o || !o.groups) return a.value = e(n, r, i), a;
35
+ if (!o || !o.groups) return a.value = n(t, r, i), a;
16
36
  let { variableName: s, extraContent: c } = o.groups, l = `${s}-parsed`, u = `var(${s})+"${c}"`;
17
- return t.variables[l] && t.variables[l] !== u && (l = `${l}-${Object.keys(t.variables).length}`), a.variables[l] = u, a.value = e(n, `var(${l})`, i), a;
18
- }, r = (t, r, i, a, o = !1) => {
37
+ return e.variables[l] && e.variables[l] !== u && (l = `${l}-${Object.keys(e.variables).length}`), a.variables[l] = u, a.value = n(t, `var(${l})`, i), a;
38
+ }, a = (e, t, r, a, o = !1) => {
19
39
  let s = {
20
40
  variables: {},
21
41
  value: ""
22
42
  };
23
- if (i === "url") {
24
- let c = n(t, r, a, !0);
43
+ if (r === "url") {
44
+ let c = i(e, t, a, !0);
25
45
  s.variables = {
26
46
  ...s.variables,
27
47
  ...c.variables
28
- }, s.value = e(r, `${i}(${c.value})`, o);
29
- } else s.value = e(r, `${i}(${a})`, o);
48
+ }, s.value = n(t, `${r}(${c.value})`, o);
49
+ } else s.value = n(t, `${r}(${a})`, o);
30
50
  return s;
31
- }, i = (e, t, a, o = !1, s = !1) => {
32
- let c = {
51
+ }, o = (n, r, s, c = !1, l = !1) => {
52
+ let u = {
33
53
  variables: {},
34
54
  value: ""
35
- }, l = a.replace(/\s*;\s*$/, "").match(/[a-z-]+\((?:[^()]+|\([^()]*\))*\)|[^\s]+/gi);
36
- if (!o && l && l.length > 1) return l.forEach((n) => {
37
- let r = i(e, t, n, !0, s);
38
- c.variables = {
39
- ...c.variables,
40
- ...r.variables
41
- }, c.value ? c.value = `${c.value} ${r.value}` : c.value = r.value;
42
- }), c;
43
- a = l?.[0] ?? a;
44
- let u = a.match(/^(?!var\()\s*(?<functionName>[a-z-]+)\s*\(\s*(?<functionContent>[\s\S]*)\s*\)\s*$/i);
45
- if (!u || !u.groups) return n(c, t, a, o || s);
46
- let { functionName: d, functionContent: f } = u.groups;
47
- return r(e, t, d, f, o || s);
48
- }, a = (e, t) => {
49
- let n = {
55
+ }, d = e(s.replace(/\s*;\s*$/, ""), t, { closeEndsPart: !0 });
56
+ if (!c && d.length > 1) return d.forEach((e) => {
57
+ let t = o(n, r, e, !0, l);
58
+ u.variables = {
59
+ ...u.variables,
60
+ ...t.variables
61
+ }, u.value ? u.value = `${u.value} ${t.value}` : u.value = t.value;
62
+ }), u;
63
+ s = d[0] ?? s;
64
+ let f = s.match(/^(?!var\()\s*(?<functionName>[a-z-]+)\s*\(\s*(?<functionContent>[\s\S]*)\s*\)\s*$/i);
65
+ if (!f || !f.groups) return i(u, r, s, c || l);
66
+ let { functionName: p, functionContent: m } = f.groups;
67
+ return a(n, r, p, m, c || l);
68
+ }, s = (t, n) => {
69
+ let r = {
50
70
  variables: {},
51
71
  value: ""
52
72
  };
53
- return (t?.split(/,(?![^(]*\))/).map((e) => e.trim()) ?? []).forEach((t) => {
54
- let r = i(n, e, t, !1, !0);
55
- n.variables = {
56
- ...n.variables,
57
- ...r.variables
58
- }, n.value ? n.value = `${n.value},${r.value}` : n.value = r.value;
59
- }), n.value &&= `${e}:${n.value};`, {
60
- variables: Object.keys(n.variables).map((e) => `${e}:${n.variables[e]};`),
61
- value: n.value
73
+ return (n === void 0 ? [] : e(n, (e) => e === ",", { keepEmpty: !0 }).map((e) => e.trim())).forEach((e) => {
74
+ let n = o(r, t, e, !1, !0);
75
+ r.variables = {
76
+ ...r.variables,
77
+ ...n.variables
78
+ }, r.value ? r.value = `${r.value},${n.value}` : r.value = n.value;
79
+ }), r.value &&= `${t}:${r.value};`, {
80
+ variables: Object.keys(r.variables).map((e) => `${e}:${r.variables[e]};`),
81
+ value: r.value
62
82
  };
63
- }, o = (e) => {
83
+ }, c = (e) => {
64
84
  if (!e) return;
65
- let n = {};
66
- for (let [r, i] of Object.entries(e)) {
67
- let e = t(i);
68
- e.length && (n[r] = e);
85
+ let t = {};
86
+ for (let [n, i] of Object.entries(e)) {
87
+ let e = r(i);
88
+ e.length && (t[n] = e);
69
89
  }
70
- return Object.keys(n).length ? n : void 0;
71
- }, s = (e) => {
90
+ return Object.keys(t).length ? t : void 0;
91
+ }, l = (e) => {
72
92
  if (!e) return;
73
- let n = {};
74
- for (let [r, i] of Object.entries(e)) {
75
- let e = o(i.states);
76
- n[r] = {
77
- default: t(i.default),
93
+ let t = {};
94
+ for (let [n, i] of Object.entries(e)) {
95
+ let e = c(i.states);
96
+ t[n] = {
97
+ default: r(i.default),
78
98
  ...e && { states: e }
79
99
  };
80
100
  }
81
- return Object.keys(n).length ? n : void 0;
82
- }, c = (e) => {
101
+ return Object.keys(t).length ? t : void 0;
102
+ }, u = (e) => {
83
103
  if (!e) return;
84
- let n = {};
85
- for (let [r, i] of Object.entries(e)) {
86
- let e = t(i.default), a = o(i.states), c = s(i.variants);
87
- (e.length || a || c) && (n[r] = {
104
+ let t = {};
105
+ for (let [n, i] of Object.entries(e)) {
106
+ let e = r(i.default), a = c(i.states), o = l(i.variants);
107
+ (e.length || a || o) && (t[n] = {
88
108
  ...e.length && { default: e },
89
109
  ...a && { states: a },
90
- ...c && { variants: c }
110
+ ...o && { variants: o }
91
111
  });
92
112
  }
93
- return Object.keys(n).length ? n : void 0;
113
+ return Object.keys(t).length ? t : void 0;
94
114
  };
95
- function l(e) {
115
+ function d(e) {
96
116
  if (!e?.attributes || !Object.keys(e.attributes).length) return { attributes: { base: { default: [] } } };
97
- let n = {};
98
- for (let r in e.attributes) {
99
- let i = e.attributes[r], a = o(i.states), l = s(i.variants), u = c(i.ancestors);
100
- n[r] = {
101
- default: t(i.default),
117
+ let t = {};
118
+ for (let n in e.attributes) {
119
+ let i = e.attributes[n], a = c(i.states), o = l(i.variants), s = u(i.ancestors);
120
+ t[n] = {
121
+ default: r(i.default),
102
122
  ...a && { states: a },
103
- ...l && { variants: l },
104
- ...u && { ancestors: u }
123
+ ...o && { variants: o },
124
+ ...s && { ancestors: s }
105
125
  };
106
126
  }
107
- return { attributes: n };
127
+ return { attributes: t };
108
128
  }
109
129
  //#endregion
110
- export { l as default, a as processCssString };
130
+ export { d as default, s as processCssString };
@@ -17,5 +17,5 @@ export type SelectorFormProps = {
17
17
  onClose?: () => void | Promise<void>;
18
18
  onSubmit?: (e: MouseEvent | undefined, values: SelectorFormValues) => void | Promise<void>;
19
19
  };
20
- declare const SelectorForm: ({ name, mode, componentType, components, componentsNotAvailables, onClose, onSubmit }: SelectorFormProps) => import("react").JSX.Element;
20
+ declare const SelectorForm: ({ name, mode, componentType, components, componentsNotAvailables, onClose, onSubmit }: SelectorFormProps) => import('react').JSX.Element;
21
21
  export default SelectorForm;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-style",
3
- "version": "0.37.0",
3
+ "version": "0.37.2",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -698,6 +698,22 @@
698
698
  "types": "./dist/components/StyleInspector/categories/Variables/index.d.ts",
699
699
  "import": "./dist/components/StyleInspector/categories/Variables/index.mjs"
700
700
  },
701
+ "./components/StyleInspector/components/AncestorRules": {
702
+ "types": "./dist/components/StyleInspector/components/AncestorRules/index.d.ts",
703
+ "import": "./dist/components/StyleInspector/components/AncestorRules/index.mjs"
704
+ },
705
+ "./components/StyleInspector/components/AncestorRules/AncestorRuleChip": {
706
+ "types": "./dist/components/StyleInspector/components/AncestorRules/AncestorRuleChip.d.ts",
707
+ "import": "./dist/components/StyleInspector/components/AncestorRules/AncestorRuleChip.mjs"
708
+ },
709
+ "./components/StyleInspector/components/AncestorRules/AncestorRules": {
710
+ "types": "./dist/components/StyleInspector/components/AncestorRules/AncestorRules.d.ts",
711
+ "import": "./dist/components/StyleInspector/components/AncestorRules/AncestorRules.mjs"
712
+ },
713
+ "./components/StyleInspector/components/AncestorRules/index": {
714
+ "types": "./dist/components/StyleInspector/components/AncestorRules/index.d.ts",
715
+ "import": "./dist/components/StyleInspector/components/AncestorRules/index.mjs"
716
+ },
701
717
  "./components/StyleInspector/components/CategoryAdvanced": {
702
718
  "types": "./dist/components/StyleInspector/components/CategoryAdvanced/index.d.ts",
703
719
  "import": "./dist/components/StyleInspector/components/CategoryAdvanced/index.mjs"
@@ -920,10 +936,10 @@
920
936
  "build:prod": "vite build && node ../sdk-shared/scripts/generate-exports.mjs"
921
937
  },
922
938
  "dependencies": {
923
- "@plitzi/plitzi-ui": "^1.6.21",
924
- "@plitzi/sdk-plugins": "0.37.0",
925
- "@plitzi/sdk-shared": "0.37.0",
926
- "@plitzi/sdk-variables": "0.37.0",
939
+ "@plitzi/plitzi-ui": "^1.6.22",
940
+ "@plitzi/sdk-plugins": "0.37.2",
941
+ "@plitzi/sdk-shared": "0.37.2",
942
+ "@plitzi/sdk-variables": "0.37.2",
927
943
  "clsx": "^2.1.1",
928
944
  "immer": "^11.1.18",
929
945
  "prop-types": "^15.8.1",