@plitzi/sdk-style 0.38.10 → 0.38.11

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 (149) hide show
  1. package/CHANGELOG.md +180 -0
  2. package/dist/components/InputEasing/InputEasingButton.mjs +1 -1
  3. package/dist/components/InputEasing/InputEasingList.mjs +5 -5
  4. package/dist/components/Selector/Selector.mjs +2 -1
  5. package/dist/components/Selector/SelectorItem/ItemOptions.mjs +45 -41
  6. package/dist/components/Selector/SelectorItem/SelectorItem.mjs +4 -4
  7. package/dist/components/Selector/SelectorItem/helpers.d.ts +2 -0
  8. package/dist/components/Selector/SelectorItem/helpers.mjs +4 -0
  9. package/dist/components/StyleInspector/Inspector.mjs +185 -171
  10. package/dist/components/StyleInspector/InspectorSearchContext.d.ts +3 -0
  11. package/dist/components/StyleInspector/InspectorSearchContext.mjs +6 -0
  12. package/dist/components/StyleInspector/StyleInspector.mjs +154 -128
  13. package/dist/components/StyleInspector/categories/Background/Background.mjs +82 -114
  14. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.d.ts +8 -0
  15. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.mjs +53 -0
  16. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.d.ts +3 -0
  17. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.mjs +5 -0
  18. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +159 -153
  19. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.d.ts +11 -0
  20. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.mjs +45 -0
  21. package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.mjs +26 -23
  22. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.mjs +65 -56
  23. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.d.ts +4 -0
  24. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.mjs +8 -0
  25. package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.mjs +28 -27
  26. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.d.ts +4 -2
  27. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.mjs +19 -18
  28. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.d.ts +4 -0
  29. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.mjs +48 -80
  30. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.d.ts +5 -3
  31. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.mjs +51 -41
  32. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.d.ts +5 -1
  33. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.mjs +54 -32
  34. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.d.ts +3 -1
  35. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.mjs +14 -13
  36. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.d.ts +8 -0
  37. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.mjs +8 -0
  38. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.d.ts +8 -0
  39. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.mjs +11 -0
  40. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.d.ts +3 -0
  41. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.mjs +5 -0
  42. package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.d.ts +21 -7
  43. package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.mjs +114 -113
  44. package/dist/components/StyleInspector/categories/Background/helpers/layerValues.d.ts +8 -0
  45. package/dist/components/StyleInspector/categories/Background/helpers/layerValues.mjs +11 -0
  46. package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.mjs +52 -87
  47. package/dist/components/StyleInspector/categories/Background/modes/ImageMode.mjs +16 -77
  48. package/dist/components/StyleInspector/categories/Background/modes/LinearGradientMode.mjs +19 -62
  49. package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.mjs +79 -97
  50. package/dist/components/StyleInspector/categories/Background/modes/RawMode.d.ts +8 -0
  51. package/dist/components/StyleInspector/categories/Background/modes/RawMode.mjs +22 -0
  52. package/dist/components/StyleInspector/categories/Background/modes/helpers.d.ts +19 -0
  53. package/dist/components/StyleInspector/categories/Background/modes/helpers.mjs +54 -0
  54. package/dist/components/StyleInspector/categories/Border/Border.mjs +26 -43
  55. package/dist/components/StyleInspector/categories/Border/BorderPlacements.mjs +60 -51
  56. package/dist/components/StyleInspector/categories/Display/Display.mjs +32 -49
  57. package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayFlexChild.mjs +33 -38
  58. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +21 -33
  59. package/dist/components/StyleInspector/categories/Effects/Effects.mjs +131 -154
  60. package/dist/components/StyleInspector/categories/Effects/Filters/Filter.mjs +23 -31
  61. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.d.ts +9 -5
  62. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +57 -124
  63. package/dist/components/StyleInspector/categories/Effects/Filters/helpers.d.ts +25 -0
  64. package/dist/components/StyleInspector/categories/Effects/Filters/helpers.mjs +87 -0
  65. package/dist/components/StyleInspector/categories/Effects/Transform/Transform.mjs +18 -28
  66. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.d.ts +1 -2
  67. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.mjs +52 -76
  68. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.d.ts +5 -0
  69. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.mjs +8 -2
  70. package/dist/components/StyleInspector/categories/Effects/Transition/Transition.mjs +21 -37
  71. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.d.ts +10 -0
  72. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.mjs +92 -0
  73. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.d.ts +4 -4
  74. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +78 -359
  75. package/dist/components/StyleInspector/categories/Effects/Transition/helpers.d.ts +39 -0
  76. package/dist/components/StyleInspector/categories/Effects/Transition/helpers.mjs +268 -0
  77. package/dist/components/StyleInspector/categories/List/List.mjs +39 -38
  78. package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +29 -29
  79. package/dist/components/StyleInspector/categories/Others/Others.mjs +66 -88
  80. package/dist/components/StyleInspector/categories/Position/Position.mjs +67 -75
  81. package/dist/components/StyleInspector/categories/RawStyle/RawStyle.mjs +19 -18
  82. package/dist/components/StyleInspector/categories/Size/Size.mjs +68 -88
  83. package/dist/components/StyleInspector/categories/Spacing/Spacing.mjs +18 -27
  84. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +2 -2
  85. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +4 -3
  86. package/dist/components/StyleInspector/categories/Typography/Typography.mjs +88 -98
  87. package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +1 -1
  88. package/dist/components/StyleInspector/categories/Typography/TypographyStyle.mjs +1 -1
  89. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.mjs +26 -39
  90. package/dist/components/StyleInspector/categories/Variables/Variables.mjs +38 -37
  91. package/dist/components/StyleInspector/categoryKeys.d.ts +45 -0
  92. package/dist/components/StyleInspector/categoryKeys.mjs +220 -0
  93. package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +43 -38
  94. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +2 -1
  95. package/dist/components/StyleInspector/components/CategorySection/CategorySection.mjs +30 -15
  96. package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.d.ts +8 -0
  97. package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.mjs +23 -0
  98. package/dist/components/StyleInspector/components/ColorSwatch/helpers.d.ts +3 -0
  99. package/dist/components/StyleInspector/components/ColorSwatch/helpers.mjs +9 -0
  100. package/dist/components/StyleInspector/components/ColorSwatch/index.d.ts +3 -0
  101. package/dist/components/StyleInspector/components/ColorSwatch/index.mjs +5 -0
  102. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.d.ts +1 -0
  103. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.mjs +11 -11
  104. package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.d.ts +11 -0
  105. package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.mjs +38 -0
  106. package/dist/components/StyleInspector/components/InspectorFooter/helpers.d.ts +2 -0
  107. package/dist/components/StyleInspector/components/InspectorFooter/helpers.mjs +11 -0
  108. package/dist/components/StyleInspector/components/InspectorFooter/index.d.ts +3 -0
  109. package/dist/components/StyleInspector/components/InspectorFooter/index.mjs +5 -0
  110. package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +34 -31
  111. package/dist/components/StyleInspector/components/InspectorLabel/helpers.d.ts +17 -0
  112. package/dist/components/StyleInspector/components/InspectorLabel/helpers.mjs +16 -0
  113. package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.d.ts +7 -0
  114. package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.mjs +24 -0
  115. package/dist/components/StyleInspector/components/InspectorSearch/index.d.ts +3 -0
  116. package/dist/components/StyleInspector/components/InspectorSearch/index.mjs +5 -0
  117. package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.d.ts +9 -0
  118. package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.mjs +110 -0
  119. package/dist/components/StyleInspector/components/ShadowItem/index.d.ts +3 -0
  120. package/dist/components/StyleInspector/components/ShadowItem/index.mjs +5 -0
  121. package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.d.ts +7 -0
  122. package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.mjs +24 -0
  123. package/dist/components/StyleInspector/components/TargetSummary/index.d.ts +3 -0
  124. package/dist/components/StyleInspector/components/TargetSummary/index.mjs +5 -0
  125. package/dist/components/StyleInspector/components/ValueList/ValueList.d.ts +12 -0
  126. package/dist/components/StyleInspector/components/ValueList/ValueList.mjs +25 -0
  127. package/dist/components/StyleInspector/components/ValueList/index.d.ts +3 -0
  128. package/dist/components/StyleInspector/components/ValueList/index.mjs +5 -0
  129. package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.d.ts +16 -0
  130. package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.mjs +71 -0
  131. package/dist/components/StyleInspector/components/ValueListItem/index.d.ts +3 -0
  132. package/dist/components/StyleInspector/components/ValueListItem/index.mjs +5 -0
  133. package/dist/components/StyleInspector/cssValues.d.ts +15 -0
  134. package/dist/components/StyleInspector/cssValues.mjs +27 -0
  135. package/dist/components/StyleInspector/helpers.d.ts +17 -1
  136. package/dist/components/StyleInspector/helpers.mjs +9 -2
  137. package/dist/components/StyleInspector/hooks/useInspectorValues.mjs +42 -45
  138. package/dist/components/StyleInspector/search.d.ts +11 -0
  139. package/dist/components/StyleInspector/search.mjs +14 -0
  140. package/dist/components/StyleInspector/shadowValue.d.ts +20 -0
  141. package/dist/components/StyleInspector/shadowValue.mjs +36 -0
  142. package/dist/components/StyleManager/StyleSelectorTag.mjs +1 -1
  143. package/package.json +185 -17
  144. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.d.ts +0 -8
  145. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +0 -132
  146. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.d.ts +0 -2
  147. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.mjs +0 -18
  148. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.d.ts +0 -8
  149. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.mjs +0 -83
@@ -1,58 +1,68 @@
1
- import { STYLE_STATE_OPTIONS as e, ancestorClasses as t, ancestorConditions as n, ancestorOptions as r, ancestorRemovals as i, conditionOptions as ee, pseudoOptions as a, unusedAncestors as te } from "./helpers.mjs";
2
- import ne from "../Selector/index.mjs";
3
- import re from "./components/AncestorRules/index.mjs";
4
- import ie from "./Inspector.mjs";
5
- import { use as ae, useCallback as o, useEffect as oe, useMemo as s, useState as c } from "react";
6
- import { useBuilderStore as se, useBuilderStoreSync as l } from "@plitzi/sdk-shared/store";
7
- import { get as u, pick as ce, set as le } from "@plitzi/plitzi-ui/helpers";
8
- import { produce as ue } from "immer";
9
- import { canonicalCondition as de } from "@plitzi/sdk-shared/style/styleConditions";
10
- import { isParentAncestor as fe } from "@plitzi/sdk-shared/style/styleStates";
11
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
- import { clsx as pe } from "clsx";
13
- import me from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
1
+ import { STYLE_STATE_OPTIONS as e, ancestorClasses as t, ancestorConditions as n, ancestorOptions as r, ancestorRemovals as i, conditionOptions as ee, moreTargetsHint as te, pseudoOptions as ne, targetParts as re, unusedAncestors as ie } from "./helpers.mjs";
2
+ import ae from "../Selector/index.mjs";
3
+ import oe from "./components/AncestorRules/index.mjs";
4
+ import se from "./components/TargetSummary/index.mjs";
5
+ import ce from "./Inspector.mjs";
6
+ import { use as le, useCallback as a, useEffect as ue, useMemo as o, useState as s } from "react";
7
+ import { useBuilderStore as de, useBuilderStoreSync as c } from "@plitzi/sdk-shared/store";
8
+ import { get as l, pick as fe, set as pe } from "@plitzi/plitzi-ui/helpers";
9
+ import { produce as me } from "immer";
10
+ import { canonicalCondition as he } from "@plitzi/sdk-shared/style/styleConditions";
11
+ import { isParentAncestor as ge } from "@plitzi/sdk-shared/style/styleStates";
12
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
13
+ import { clsx as f } from "clsx";
14
+ import _e from "@plitzi/plitzi-ui/Icon";
15
+ import ve from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
14
16
  import p from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
17
+ import ye from "@plitzi/plitzi-ui/hooks/useStorage";
15
18
  import m from "@plitzi/plitzi-ui/Select";
16
19
  import h from "@plitzi/plitzi-ui/Select2";
17
20
  //#region src/components/StyleInspector/StyleInspector.tsx
18
- var g = ({ displayMode: g, selectors: _, value: v, element: y, mode: b = "element", componentType: x, styleSelectors: S, styleSelectorsAvailables: C, componentSubTypesAvailables: w, allowStyleSelector: he = !0, allowStyleState: T = !0, allowStyleVariant: E = !0, onChange: D, onRemoveVariant: O }) => {
19
- let [ge, k] = c(void 0), [A, j] = c("base"), [M, N] = c(void 0), [P, F] = c(void 0);
20
- l("styleSelector", A, { enabled: b === "element" }), l("styleVariant", M, { enabled: b === "element" });
21
- let [I, L] = c(void 0), [R, z] = c(void 0), [B, V] = c(void 0);
22
- l("styleState", P, { enabled: b === "element" }), l("styleAncestor", I, { enabled: b === "element" }), l("stylePseudo", R, { enabled: b === "element" }), l("styleCondition", B, { enabled: b === "element" });
23
- let [[H, U]] = se(["schema.flat", "style.platform"]), { builderHandler: W } = ae(me), G = s(() => u(S, A, ""), [S, A]), _e = s(() => Object.values(ce(_ ?? {}, y ? [y.definition.type, ...G.split(" ")] : G.split(" "))), [
21
+ var g = ({ displayMode: g, selectors: _, value: v, element: y, mode: b = "element", componentType: x, styleSelectors: S, styleSelectorsAvailables: C, componentSubTypesAvailables: w, allowStyleSelector: be = !0, allowStyleState: T = !0, allowStyleVariant: E = !0, onChange: D, onRemoveVariant: O }) => {
22
+ let [xe, k] = s(void 0), [A, j] = s("base"), [M, N] = s(void 0), [P, F] = s(void 0);
23
+ c("styleSelector", A, { enabled: b === "element" }), c("styleVariant", M, { enabled: b === "element" });
24
+ let [I, L] = s(void 0), [R, z] = s(void 0), [B, V] = s(void 0);
25
+ c("styleState", P, { enabled: b === "element" }), c("styleAncestor", I, { enabled: b === "element" }), c("stylePseudo", R, { enabled: b === "element" }), c("styleCondition", B, { enabled: b === "element" });
26
+ let [[H, U]] = de(["schema.flat", "style.platform"]), [Se, W] = ye("builder-state.styleInspector.moreTargets", !1), { builderHandler: G } = le(ve), K = o(() => l(S, A, ""), [S, A]), Ce = o(() => Object.values(fe(_ ?? {}, y ? [y.definition.type, ...K.split(" ")] : K.split(" "))), [
24
27
  _,
25
28
  y,
26
- G
27
- ]), K = s(() => v ? u(_, v) : void 0, [_, v]), q = K?.attributes[A]?.ancestors, J = s(() => b === "element" ? t(H, y) : Object.values(_ ?? {}).filter((e) => e.type === "class" && e.name !== v).map((e) => e.name).sort((e, t) => e.localeCompare(t)), [
29
+ K
30
+ ]), q = o(() => v ? l(_, v) : void 0, [_, v]), J = q?.attributes[A]?.ancestors, Y = o(() => b === "element" ? t(H, y) : Object.values(_ ?? {}).filter((e) => e.type === "class" && e.name !== v).map((e) => e.name).sort((e, t) => e.localeCompare(t)), [
28
31
  y,
29
32
  H,
30
33
  b,
31
34
  _,
32
35
  v
33
- ]), Y = s(() => r(J, q), [J, q]), X = s(() => n(q), [q]), Z = s(() => K ? te(H, K) : /* @__PURE__ */ new Set(), [H, K]), ve = s(() => {
34
- let e = Object.keys(q ?? {}).length;
36
+ ]), we = o(() => r(Y, J), [Y, J]), Te = o(() => n(J), [J]), X = o(() => q ? ie(H, q) : /* @__PURE__ */ new Set(), [H, q]), Ee = o(() => {
37
+ let e = Object.keys(J ?? {}).length;
35
38
  return e ? `When an ancestor is… (${e} set)` : "When an ancestor is…";
36
- }, [q]), ye = s(() => {
37
- let e = K?.attributes[A], t = I ? [...Object.keys(_?.[I]?.attributes.base.variants ?? {}), ...Object.keys(e?.ancestors?.[I]?.variants ?? {})] : Object.keys(e?.variants ?? {});
39
+ }, [J]), De = o(() => {
40
+ let e = q?.attributes[A], t = I ? [...Object.keys(_?.[I]?.attributes.base.variants ?? {}), ...Object.keys(e?.ancestors?.[I]?.variants ?? {})] : Object.keys(e?.variants ?? {});
38
41
  return [...new Set(t)].map((e) => ({
39
42
  label: e,
40
43
  value: e
41
44
  }));
42
45
  }, [
43
- K?.attributes,
46
+ q?.attributes,
44
47
  _,
45
48
  I,
46
49
  A
47
- ]), Q = s(() => a(K?.attributes[A]), [K?.attributes, A]), be = s(() => ee(K?.attributes[A]), [K?.attributes, A]), xe = !!I && fe(I);
48
- oe(() => {
50
+ ]), Oe = o(() => ne(q?.attributes[A]), [q?.attributes, A]), ke = o(() => ee(q?.attributes[A]), [q?.attributes, A]), Ae = !!I && ge(I), Z = !!I || !!R || !!B, Q = Se || Z, je = re({
51
+ styleSelector: A,
52
+ styleVariant: M,
53
+ styleState: P,
54
+ styleAncestor: I,
55
+ stylePseudo: R,
56
+ styleCondition: B
57
+ });
58
+ ue(() => {
49
59
  if (j("base"), b !== "element") return;
50
- let e = u(S, "base", "").split(" "), t = e[e.length - 1];
60
+ let e = l(S, "base", "").split(" "), t = e[e.length - 1];
51
61
  D?.(t || ""), F(void 0), L(void 0), z(void 0), V(void 0), k(void 0);
52
62
  }, [D, S]), p(() => {
53
63
  if (b === "element") {
54
64
  if (v !== y?.definition.type) {
55
- let e = u(S, A, "").split(" ");
65
+ let e = l(S, A, "").split(" ");
56
66
  D?.(e[e.length - 1]);
57
67
  }
58
68
  F(void 0), N(void 0), L(void 0), z(void 0), V(void 0), k(void 0);
@@ -60,249 +70,265 @@ var g = ({ displayMode: g, selectors: _, value: v, element: y, mode: b = "elemen
60
70
  }, [A]), p(() => {
61
71
  F(void 0), N(void 0), L(void 0), z(void 0), V(void 0), k(void 0);
62
72
  }, [v]);
63
- let Se = o((e, t, n) => {
73
+ let Me = a((e, t, n) => {
64
74
  if (t && !n) return;
65
75
  let { name: r, type: i } = e;
66
- !t && r !== "" && !_?.[r] ? W("styleAddSelector", g, r, i, void 0, void 0, {
76
+ !t && r !== "" && !_?.[r] ? G("styleAddSelector", g, r, i, void 0, void 0, {
67
77
  styleSelector: A,
68
78
  componentType: i === "element" ? x : void 0
69
- }) : t && n && n.name !== r && _?.[n.name] && !_[r] && W("styleAddSelector", g, r, i, void 0, u(_, `${n.name}.attributes.${A}.default`, {}), {
79
+ }) : t && n && n.name !== r && _?.[n.name] && !_[r] && G("styleAddSelector", g, r, i, void 0, l(_, `${n.name}.attributes.${A}.default`, {}), {
70
80
  styleSelector: A,
71
81
  componentType: i === "element" ? x : void 0
72
82
  });
73
83
  }, [
74
- W,
84
+ G,
75
85
  x,
76
86
  g,
77
87
  _,
78
88
  A
79
- ]), Ce = o((e) => {
89
+ ]), Ne = a((e) => {
80
90
  if (!e || v && v === e.name) {
81
91
  D?.(void 0);
82
92
  return;
83
93
  }
84
94
  D?.(e.name);
85
- }, [D, v]), we = o((e) => {
86
- y && W("schemaUpdateElement", ue(y, (t) => {
87
- le(t, `definition.styleSelectors.${A}`, e);
95
+ }, [D, v]), Pe = a((e) => {
96
+ y && G("schemaUpdateElement", me(y, (t) => {
97
+ pe(t, `definition.styleSelectors.${A}`, e);
88
98
  }));
89
99
  }, [
90
100
  y,
91
- W,
101
+ G,
92
102
  A
93
- ]), Te = o((e) => {
94
- W("styleRemoveSelector", g, e.name);
95
- }, [W, g]), Ee = o((e) => k(e), []), De = o((e) => {
103
+ ]), Fe = a((e) => {
104
+ G("styleRemoveSelector", g, e.name);
105
+ }, [G, g]), Ie = a(() => W((e) => !e), [W]), Le = a(() => {
106
+ j("base"), F(void 0), N(void 0), L(void 0), z(void 0), V(void 0);
107
+ }, []), Re = a((e) => k(e), []), ze = a((e) => {
96
108
  j(e);
97
- }, []), Oe = o((e) => F(e?.value), []), ke = o((e) => {
109
+ }, []), Be = a((e) => F(e?.value), []), Ve = a((e) => {
98
110
  L(e?.value), F(void 0), N(void 0), z(void 0), V(void 0);
99
- }, []), Ae = o((e) => z(e?.value), []), je = o((e) => {
100
- let t = e ? de(e.value) : void 0;
111
+ }, []), He = a((e) => z(e?.value), []), Ue = a((e) => {
112
+ let t = e ? he(e.value) : void 0;
101
113
  (!e || t) && (V(t), t && (N(void 0), L(void 0)));
102
- }, []), Me = o((e) => {
103
- e.value === B && (V(void 0), F(void 0)), K?.attributes[A]?.conditions?.[e.value] && W("styleUpdateSelector", g, K.name, void 0, void 0, {
114
+ }, []), We = a((e) => {
115
+ e.value === B && (V(void 0), F(void 0)), q?.attributes[A]?.conditions?.[e.value] && G("styleUpdateSelector", g, q.name, void 0, void 0, {
104
116
  styleSelector: A,
105
117
  styleCondition: e.value,
106
- componentType: K.componentType
118
+ componentType: q.componentType
107
119
  });
108
120
  }, [
109
- W,
121
+ G,
110
122
  g,
111
- K,
123
+ q,
112
124
  B,
113
125
  A
114
- ]), Ne = o((e) => {
115
- e.value === I && (L(void 0), F(void 0), N(void 0)), K?.attributes[A]?.ancestors?.[e.value] && W("styleUpdateSelector", g, K.name, void 0, void 0, {
126
+ ]), Ge = a((e) => {
127
+ e.value === I && (L(void 0), F(void 0), N(void 0)), q?.attributes[A]?.ancestors?.[e.value] && G("styleUpdateSelector", g, q.name, void 0, void 0, {
116
128
  styleSelector: A,
117
129
  styleAncestor: e.value,
118
- componentType: K.componentType
130
+ componentType: q.componentType
119
131
  });
120
132
  }, [
121
- W,
133
+ G,
122
134
  g,
123
- K,
135
+ q,
124
136
  I,
125
137
  A
126
- ]), Pe = o((e) => {
138
+ ]), Ke = a((e) => {
127
139
  L(e.ancestor), N(e.variant), F(e.state), z(void 0), V(void 0);
128
- }, []), Fe = o((e) => {
129
- if (!K) return;
140
+ }, []), qe = a((e) => {
141
+ if (!q) return;
130
142
  let { ancestor: t, state: n, variant: r } = e;
131
- t === I && n === P && r === M && (F(void 0), N(void 0)), W("styleUpdateSelector", g, K.name, void 0, n || r ? void 0 : {}, {
143
+ t === I && n === P && r === M && (F(void 0), N(void 0)), G("styleUpdateSelector", g, q.name, void 0, n || r ? void 0 : {}, {
132
144
  styleSelector: A,
133
145
  styleAncestor: t,
134
146
  styleState: n,
135
147
  styleVariant: r,
136
- componentType: K.componentType
148
+ componentType: q.componentType
137
149
  });
138
150
  }, [
139
- W,
151
+ G,
140
152
  g,
141
- K,
153
+ q,
142
154
  I,
143
155
  A,
144
156
  P,
145
157
  M
146
- ]), Ie = o(() => {
147
- if (K) {
148
- I && Z.has(I) && (L(void 0), F(void 0), N(void 0));
149
- for (let e of i(U, K.name, Z)) W("styleUpdateSelector", e.displayMode, K.name, void 0, void 0, {
158
+ ]), Je = a(() => {
159
+ if (q) {
160
+ I && X.has(I) && (L(void 0), F(void 0), N(void 0));
161
+ for (let e of i(U, q.name, X)) G("styleUpdateSelector", e.displayMode, q.name, void 0, void 0, {
150
162
  styleSelector: e.styleSelector,
151
163
  styleAncestor: e.styleAncestor,
152
- componentType: K.componentType
164
+ componentType: q.componentType
153
165
  });
154
166
  }
155
167
  }, [
156
- W,
168
+ G,
157
169
  U,
158
- K,
170
+ q,
159
171
  I,
160
- Z
161
- ]), Le = o((e) => {
172
+ X
173
+ ]), Ye = a((e) => {
162
174
  N(e?.value), e && V(void 0);
163
- }, []), Re = o((e) => {
164
- O?.(e.value), P && F(void 0), e.value === M && N(void 0), W("styleUpdateSelector", g, K?.name, void 0, void 0, {
175
+ }, []), Xe = a((e) => {
176
+ O?.(e.value), P && F(void 0), e.value === M && N(void 0), G("styleUpdateSelector", g, q?.name, void 0, void 0, {
165
177
  styleSelector: A,
166
178
  styleVariant: e.value,
167
179
  styleAncestor: I,
168
- componentType: K?.componentType
180
+ componentType: q?.componentType
169
181
  });
170
182
  }, [
171
- W,
183
+ G,
172
184
  g,
173
185
  O,
174
- K?.componentType,
175
- K?.name,
186
+ q?.componentType,
187
+ q?.name,
176
188
  A,
177
189
  P,
178
190
  M,
179
191
  I
180
192
  ]), $ = E || T || !!C?.length || !!w?.length;
181
- return /* @__PURE__ */ f("div", {
193
+ return /* @__PURE__ */ d("div", {
182
194
  className: "flex w-full grow flex-col gap-2",
183
- children: [/* @__PURE__ */ f("div", {
195
+ children: [/* @__PURE__ */ d("div", {
184
196
  className: "flex w-full flex-col gap-2 px-1",
185
197
  children: [
186
- b === "element" && /* @__PURE__ */ d(ne, {
198
+ b === "element" && /* @__PURE__ */ u(ae, {
187
199
  className: "min-h-0 w-full",
188
- value: G,
200
+ value: K,
189
201
  selectors: _,
190
- selector: K,
202
+ selector: q,
191
203
  componentType: x,
192
- onAdd: Se,
193
- onChange: we,
194
- onRemove: Te,
195
- onSelectorSelected: Ce
204
+ onAdd: Me,
205
+ onChange: Pe,
206
+ onRemove: Fe,
207
+ onSelectorSelected: Ne
196
208
  }),
197
- $ && /* @__PURE__ */ f("div", {
198
- className: pe("flex w-full items-center gap-2", { "mt-2": b === "manager" }),
209
+ $ && /* @__PURE__ */ d("div", {
210
+ className: f("flex w-full items-center gap-2", { "mt-2": b === "manager" }),
199
211
  children: [
200
- !!w?.length && /* @__PURE__ */ d(m, {
212
+ !!w?.length && /* @__PURE__ */ u(m, {
201
213
  className: "grow basis-0",
202
214
  size: "xs",
203
- value: ge,
204
- onChange: Ee,
205
- children: w.map((e) => /* @__PURE__ */ d("option", {
215
+ value: xe,
216
+ onChange: Re,
217
+ children: w.map((e) => /* @__PURE__ */ u("option", {
206
218
  value: e,
207
219
  children: e
208
220
  }, e))
209
221
  }),
210
- he && C && C.length > 1 && /* @__PURE__ */ d(m, {
222
+ be && C && C.length > 1 && /* @__PURE__ */ u(m, {
211
223
  className: "grow basis-0",
212
224
  size: "xs",
213
- onChange: De,
225
+ onChange: ze,
214
226
  value: A,
215
- children: C.map((e) => /* @__PURE__ */ d("option", {
227
+ children: C.map((e) => /* @__PURE__ */ u("option", {
216
228
  value: e,
217
229
  children: e
218
230
  }, e))
219
231
  }),
220
- E && !xe && /* @__PURE__ */ d("div", {
232
+ E && !Ae && /* @__PURE__ */ u("div", {
221
233
  className: "grow basis-0",
222
- children: /* @__PURE__ */ d(h, {
234
+ children: /* @__PURE__ */ u(h, {
223
235
  className: "grow basis-0",
224
236
  value: M,
225
- options: ye,
237
+ options: De,
226
238
  placeholder: "Variant",
227
239
  size: "xs",
228
240
  allowCreateOptions: !0,
229
241
  allowRemoveOptions: !0,
230
242
  clearable: !0,
231
- onChange: Le,
232
- onRemove: Re
243
+ onChange: Ye,
244
+ onRemove: Xe
233
245
  })
234
246
  }),
235
- T && /* @__PURE__ */ d("div", {
247
+ T && /* @__PURE__ */ u("div", {
236
248
  className: "grow basis-0",
237
- children: /* @__PURE__ */ d(h, {
249
+ children: /* @__PURE__ */ u(h, {
238
250
  className: "grow basis-0",
239
251
  value: P,
240
252
  options: e,
241
253
  placeholder: "State",
242
254
  size: "xs",
243
255
  clearable: !0,
244
- onChange: Oe
256
+ onChange: Be
245
257
  })
258
+ }),
259
+ T && /* @__PURE__ */ u(_e, {
260
+ className: f("shrink-0 cursor-pointer rounded-sm p-1 text-xs", {
261
+ "bg-primary-500/15 text-primary-600 dark:text-primary-300": Q,
262
+ "text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100": !Q
263
+ }),
264
+ icon: "fa-solid fa-crosshairs",
265
+ title: te(Z, Q),
266
+ onClick: Z ? void 0 : Ie
246
267
  })
247
268
  ]
248
269
  }),
249
- $ && T && !!Y.length && /* @__PURE__ */ d(h, {
270
+ $ && T && Q && !!we.length && /* @__PURE__ */ u(h, {
250
271
  className: "w-full",
251
272
  value: I,
252
- options: Y,
253
- placeholder: ve,
273
+ options: we,
274
+ placeholder: Ee,
254
275
  size: "xs",
255
276
  clearable: !0,
256
277
  allowRemoveOptions: !0,
257
- onChange: ke,
258
- onRemove: Ne
278
+ onChange: Ve,
279
+ onRemove: Ge
259
280
  }),
260
- $ && T && !I && /* @__PURE__ */ f("div", {
281
+ $ && T && Q && !I && /* @__PURE__ */ d("div", {
261
282
  className: "flex w-full items-center gap-2",
262
- children: [/* @__PURE__ */ d("div", {
283
+ children: [/* @__PURE__ */ u("div", {
263
284
  className: "grow basis-0",
264
- children: /* @__PURE__ */ d(h, {
285
+ children: /* @__PURE__ */ u(h, {
265
286
  className: "grow basis-0",
266
287
  value: R,
267
- options: Q,
288
+ options: Oe,
268
289
  placeholder: "Pseudo-element",
269
290
  size: "xs",
270
291
  clearable: !0,
271
- onChange: Ae
292
+ onChange: He
272
293
  })
273
- }), /* @__PURE__ */ d("div", {
294
+ }), /* @__PURE__ */ u("div", {
274
295
  className: "grow basis-0",
275
- children: /* @__PURE__ */ d(h, {
296
+ children: /* @__PURE__ */ u(h, {
276
297
  className: "grow basis-0",
277
298
  value: B,
278
- options: be,
299
+ options: ke,
279
300
  placeholder: "Condition",
280
301
  size: "xs",
281
302
  clearable: !0,
282
303
  allowCreateOptions: !0,
283
304
  allowRemoveOptions: !0,
284
- onChange: je,
285
- onRemove: Me
305
+ onChange: Ue,
306
+ onRemove: We
286
307
  })
287
308
  })]
288
309
  }),
289
- T && X.length > 0 && /* @__PURE__ */ d(re, {
290
- conditions: X,
291
- unused: Z,
310
+ T && Te.length > 0 && /* @__PURE__ */ u(oe, {
311
+ conditions: Te,
312
+ unused: X,
292
313
  activeAncestor: I,
293
314
  activeState: P,
294
315
  activeVariant: M,
295
- onSelect: Pe,
296
- onRemove: Fe,
297
- onRemoveUnused: Ie
316
+ onSelect: Ke,
317
+ onRemove: qe,
318
+ onRemoveUnused: Je
319
+ }),
320
+ je.length > 0 && /* @__PURE__ */ u(se, {
321
+ selectorName: v,
322
+ parts: je,
323
+ onReset: Le
298
324
  })
299
325
  ]
300
- }), /* @__PURE__ */ d("div", {
326
+ }), /* @__PURE__ */ u("div", {
301
327
  className: "flex grow basis-0 flex-col overflow-auto border-t border-gray-300 dark:border-zinc-700",
302
- children: /* @__PURE__ */ d(ie, {
303
- selectors: _e,
328
+ children: /* @__PURE__ */ u(ce, {
329
+ selectors: Ce,
304
330
  componentType: x,
305
- selector: K,
331
+ selector: q,
306
332
  styleSelector: A,
307
333
  styleState: P,
308
334
  styleVariant: M,