@plitzi/sdk-style 0.38.9 → 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 +189 -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
@@ -2,189 +2,179 @@ import e from "../../StyleInspectorContext.mjs";
2
2
  import t from "../../hooks/useInspectorValues.mjs";
3
3
  import n from "../../components/CategoryOption/index.mjs";
4
4
  import r from "../../components/CategorySection/index.mjs";
5
- import i from "../../components/CategoryAdvanced/index.mjs";
6
- import a from "../../components/CategoryContainer/index.mjs";
7
- import ee from "./TypographyAlign.mjs";
8
- import o from "./TypographyBreaking.mjs";
9
- import s from "./TypographyClamp.mjs";
10
- import { weights as c } from "./TypographyConstants.mjs";
11
- import l from "./TypographyFigures.mjs";
12
- import u from "../../../../hooks/useSpaceFonts.mjs";
13
- import d from "./TypographyFont.mjs";
14
- import f from "./TypographyStyle.mjs";
15
- import p from "./TypographyTextShadow.mjs";
16
- import m from "./TypographyTransform.mjs";
17
- import { memo as h, use as g, useCallback as _ } from "react";
18
- import { primaryFamily as v } from "@plitzi/sdk-shared/style";
19
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
5
+ import { TYPOGRAPHY_KEYS as i } from "../../categoryKeys.mjs";
6
+ import a from "../../components/CategoryAdvanced/index.mjs";
7
+ import o from "../../components/CategoryContainer/index.mjs";
8
+ import s from "./TypographyAlign.mjs";
9
+ import c from "./TypographyBreaking.mjs";
10
+ import ee from "./TypographyClamp.mjs";
11
+ import { weights as l } from "./TypographyConstants.mjs";
12
+ import u from "./TypographyFigures.mjs";
13
+ import d from "../../../../hooks/useSpaceFonts.mjs";
14
+ import f from "./TypographyFont.mjs";
15
+ import p from "./TypographyStyle.mjs";
16
+ import m from "./TypographyTextShadow.mjs";
17
+ import h from "./TypographyTransform.mjs";
18
+ import { memo as g, use as _, useCallback as v } from "react";
19
+ import { primaryFamily as y } from "@plitzi/sdk-shared/style";
20
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
20
21
  //#region src/components/StyleInspector/categories/Typography/Typography.tsx
21
- var x = /* @__PURE__ */ "font-family.font-weight.font-size.line-height.color.text-align.font-style.text-decoration.text-decoration-thickness.text-underline-offset.letter-spacing.word-spacing.text-indent.text-transform.direction.text-shadow.white-space.text-wrap.word-break.overflow-wrap.hyphens.vertical-align.text-overflow.line-clamp.font-variant-numeric.font-feature-settings.-webkit-text-fill-color".split("."), S = [
22
- "text-decoration-thickness",
23
- "text-underline-offset",
24
- "word-break",
25
- "overflow-wrap",
26
- "hyphens",
27
- "vertical-align",
28
- "text-shadow",
29
- "font-variant-numeric",
30
- "font-feature-settings",
31
- "-webkit-text-fill-color"
32
- ], C = [
22
+ var S = [
33
23
  "letter-spacing",
34
24
  "word-spacing",
35
25
  "text-indent"
36
- ], w = h(({ replaceTokens: h = !1, isCollapsed: w = !0, onCollapse: T }) => {
37
- let E = u(), { setValue: D } = g(e), { "font-family": O, "font-weight": k, "font-size": A, "font-style": j, "text-align": M, "text-decoration": N, "text-decoration-thickness": P, "text-underline-offset": te, "text-indent": F, "text-transform": I, "text-shadow": L, "white-space": R, "text-wrap": z, "word-break": B, "overflow-wrap": V, hyphens: H, "vertical-align": U, "text-overflow": W, "line-clamp": G, "line-height": K, color: q, "letter-spacing": J, "word-spacing": Y, direction: X, "font-variant-numeric": Z, "font-feature-settings": Q, "-webkit-text-fill-color": ne } = t({
38
- keys: x,
26
+ ], C = g(({ replaceTokens: g = !1, isCollapsed: C = !0, onCollapse: w }) => {
27
+ let T = d(), { setValue: E } = _(e), { "font-family": D, "font-weight": O, "font-size": k, "font-style": A, "text-align": j, "text-decoration": M, "text-decoration-thickness": N, "text-underline-offset": P, "text-indent": te, "text-transform": F, "text-shadow": I, "white-space": L, "text-wrap": R, "word-break": z, "overflow-wrap": B, hyphens: V, "vertical-align": H, "text-overflow": U, "line-clamp": W, "line-height": G, color: K, "letter-spacing": q, "word-spacing": J, direction: Y, "font-variant-numeric": X, "font-feature-settings": Z, "-webkit-text-fill-color": Q } = t({
28
+ keys: i.dot,
39
29
  asValue: !0,
40
- replaceTokens: h
41
- }), re = _((e) => T?.("typography", e), [T]), ie = E.find((e) => e.family === v(typeof O == "string" ? O : "")), $ = _((e) => (t) => D(e, t), [D]), ae = _((e) => D(void 0, e), [D]);
42
- return /* @__PURE__ */ b(a, {
43
- title: "Typography",
44
- dotKeys: x,
45
- advancedKeys: S,
46
- isCollapsed: w,
47
- onCollapse: re,
30
+ replaceTokens: g
31
+ }), ne = v((e) => w?.("typography", e), [w]), re = T.find((e) => e.family === y(typeof D == "string" ? D : "")), $ = v((e) => (t) => E(e, t), [E]), ie = v((e) => E(void 0, e), [E]);
32
+ return /* @__PURE__ */ x(o, {
33
+ title: i.title,
34
+ dotKeys: i.dot,
35
+ advancedKeys: i.advanced,
36
+ isCollapsed: C,
37
+ onCollapse: ne,
48
38
  children: [
49
- /* @__PURE__ */ y(ee, {
50
- partialValue: M,
39
+ /* @__PURE__ */ b(s, {
40
+ partialValue: j,
51
41
  onChange: $("text-align")
52
42
  }),
53
- /* @__PURE__ */ y(d, {
54
- partialValue: O,
43
+ /* @__PURE__ */ b(f, {
44
+ partialValue: D,
55
45
  onChange: $("font-family")
56
46
  }),
57
- /* @__PURE__ */ b(r, {
47
+ /* @__PURE__ */ x(r, {
58
48
  label: "",
59
- children: [/* @__PURE__ */ y(n, {
49
+ children: [/* @__PURE__ */ b(n, {
60
50
  keys: ["font-weight"],
61
51
  label: "Weight",
62
- value: k,
52
+ value: O,
63
53
  onChange: $("font-weight"),
64
54
  type: "select",
65
- children: Object.keys(c).map((e) => /* @__PURE__ */ y("option", {
55
+ children: Object.keys(l).map((e) => /* @__PURE__ */ b("option", {
66
56
  value: e,
67
- disabled: !ie?.weights.includes(Number(e)),
68
- children: c[Number(e)]
57
+ disabled: !re?.weights.includes(Number(e)),
58
+ children: l[Number(e)]
69
59
  }, e))
70
- }), /* @__PURE__ */ y(n, {
60
+ }), /* @__PURE__ */ b(n, {
71
61
  keys: ["color"],
72
62
  label: "Color",
73
63
  type: "color",
74
- value: q,
64
+ value: K,
75
65
  onChange: $("color")
76
66
  })]
77
67
  }),
78
- /* @__PURE__ */ b(r, {
68
+ /* @__PURE__ */ x(r, {
79
69
  label: "",
80
- children: [/* @__PURE__ */ y(n, {
70
+ children: [/* @__PURE__ */ b(n, {
81
71
  keys: ["font-size"],
82
72
  label: "Size",
83
- value: A,
73
+ value: k,
84
74
  onChange: $("font-size"),
85
75
  type: "metric"
86
- }), /* @__PURE__ */ y(n, {
76
+ }), /* @__PURE__ */ b(n, {
87
77
  keys: ["line-height"],
88
78
  label: "Line Height",
89
- value: K,
79
+ value: G,
90
80
  onChange: $("line-height"),
91
81
  type: "metric"
92
82
  })]
93
83
  }),
94
- /* @__PURE__ */ y(f, {
95
- fontStyle: j,
96
- textDecoration: N,
97
- textDecorationThickness: P,
98
- textUnderlineOffset: te,
84
+ /* @__PURE__ */ b(p, {
85
+ fontStyle: A,
86
+ textDecoration: M,
87
+ textDecorationThickness: N,
88
+ textUnderlineOffset: P,
99
89
  onChange: $
100
90
  }),
101
- /* @__PURE__ */ b(r, {
102
- label: "Letter",
103
- keys: C,
91
+ /* @__PURE__ */ x(r, {
92
+ label: "Spacing",
93
+ keys: S,
104
94
  children: [
105
- /* @__PURE__ */ y(n, {
95
+ /* @__PURE__ */ b(n, {
106
96
  keys: ["letter-spacing"],
107
- label: "Spacing",
108
- value: J,
97
+ label: "Letter",
98
+ value: q,
109
99
  onChange: $("letter-spacing"),
110
100
  type: "metric"
111
101
  }),
112
- /* @__PURE__ */ y(n, {
102
+ /* @__PURE__ */ b(n, {
113
103
  keys: ["word-spacing"],
114
104
  label: "Word",
115
- value: Y,
105
+ value: J,
116
106
  onChange: $("word-spacing"),
117
107
  type: "metric"
118
108
  }),
119
- /* @__PURE__ */ y(n, {
109
+ /* @__PURE__ */ b(n, {
120
110
  keys: ["text-indent"],
121
111
  label: "Indent",
122
- value: F,
112
+ value: te,
123
113
  onChange: $("text-indent"),
124
114
  type: "metric"
125
115
  })
126
116
  ]
127
117
  }),
128
- /* @__PURE__ */ y(m, {
129
- textTransform: I,
130
- direction: X,
118
+ /* @__PURE__ */ b(h, {
119
+ textTransform: F,
120
+ direction: Y,
131
121
  onChange: $
132
122
  }),
133
- /* @__PURE__ */ y(o, {
134
- whiteSpace: R,
135
- textWrap: z,
136
- wordBreak: B,
137
- overflowWrap: V,
138
- hyphens: H,
139
- verticalAlign: U,
123
+ /* @__PURE__ */ b(c, {
124
+ whiteSpace: L,
125
+ textWrap: R,
126
+ wordBreak: z,
127
+ overflowWrap: B,
128
+ hyphens: V,
129
+ verticalAlign: H,
140
130
  onChange: $
141
131
  }),
142
- /* @__PURE__ */ b(r, {
132
+ /* @__PURE__ */ x(r, {
143
133
  label: "",
144
- children: [/* @__PURE__ */ b(n, {
134
+ children: [/* @__PURE__ */ x(n, {
145
135
  keys: ["text-overflow"],
146
136
  label: "Overflow",
147
- value: W,
137
+ value: U,
148
138
  onChange: $("text-overflow"),
149
139
  type: "select",
150
140
  children: [
151
- /* @__PURE__ */ y("option", {
141
+ /* @__PURE__ */ b("option", {
152
142
  value: "clip",
153
143
  children: "Clip"
154
144
  }),
155
- /* @__PURE__ */ y("option", {
145
+ /* @__PURE__ */ b("option", {
156
146
  value: "ellipsis",
157
147
  children: "Ellipsis"
158
148
  }),
159
- /* @__PURE__ */ y("option", {
149
+ /* @__PURE__ */ b("option", {
160
150
  value: "string",
161
151
  children: "String"
162
152
  }),
163
- /* @__PURE__ */ y("option", {
153
+ /* @__PURE__ */ b("option", {
164
154
  value: "initial",
165
155
  children: "Initial"
166
156
  }),
167
- /* @__PURE__ */ y("option", {
157
+ /* @__PURE__ */ b("option", {
168
158
  value: "inherit",
169
159
  children: "Inherit"
170
160
  })
171
161
  ]
172
- }), /* @__PURE__ */ y(s, {
173
- value: G,
174
- onChange: ae
162
+ }), /* @__PURE__ */ b(ee, {
163
+ value: W,
164
+ onChange: ie
175
165
  })]
176
166
  }),
177
- /* @__PURE__ */ b(i, { children: [/* @__PURE__ */ y(p, {
178
- value: L,
167
+ /* @__PURE__ */ x(a, { children: [/* @__PURE__ */ b(m, {
168
+ value: I,
179
169
  onChange: $("text-shadow")
180
- }), /* @__PURE__ */ y(l, {
181
- fontVariantNumeric: Z,
182
- fontFeatureSettings: Q,
183
- textFillColor: ne,
170
+ }), /* @__PURE__ */ b(u, {
171
+ fontVariantNumeric: X,
172
+ fontFeatureSettings: Z,
173
+ textFillColor: Q,
184
174
  onChange: $
185
175
  })] })
186
176
  ]
187
177
  });
188
178
  });
189
179
  //#endregion
190
- export { w as default };
180
+ export { C as default };
@@ -11,7 +11,7 @@ var s = ({ partialValue: s, onChange: c }) => {
11
11
  c?.(t ? i(t) : e);
12
12
  }, [l, c]);
13
13
  return /* @__PURE__ */ o(t, {
14
- label: "F. Family",
14
+ label: "Font",
15
15
  keys: ["font-family"],
16
16
  children: /* @__PURE__ */ o(e, {
17
17
  value: u,
@@ -47,7 +47,7 @@ var l = ({ fontStyle: l, textDecoration: u, textDecorationThickness: d, textUnde
47
47
  label: "",
48
48
  children: [/* @__PURE__ */ a(e, {
49
49
  keys: ["font-style"],
50
- label: "Italicize",
50
+ label: "Style",
51
51
  onChange: p?.("font-style"),
52
52
  type: "iconGroup",
53
53
  items: m
@@ -1,43 +1,30 @@
1
- import e from "../../components/InspectorLabel/index.mjs";
2
- import t from "../../components/CategorySection/index.mjs";
3
- import n from "./TypographyTextShadowItem.mjs";
4
- import { useCallback as r } from "react";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { splitByCommaOutsideParens as e } from "../../cssValues.mjs";
2
+ import t from "../../components/ValueList/index.mjs";
3
+ import { DEFAULT_SHADOW as n, serializeShadow as r } from "../../shadowValue.mjs";
4
+ import i from "../../components/ShadowItem/index.mjs";
5
+ import { useCallback as a } from "react";
6
+ import { jsx as o } from "react/jsx-runtime";
6
7
  //#region src/components/StyleInspector/categories/Typography/TypographyTextShadow.tsx
7
- var o = ({ value: o, onChange: s }) => {
8
- let c = r((e) => (t) => {
9
- t.stopPropagation(), t.preventDefault();
10
- let n = o.split(",").toSpliced(e, 1);
11
- s?.(n.length > 0 ? n.join(",") : "");
12
- }, [s, o]), l = r((e) => (t) => {
13
- let n = o.split(",");
14
- n[e] = t, s?.(n.join(","));
15
- }, [s, o]), u = r(() => {
16
- let e = o === "" ? [] : o.split(",");
17
- e.push("2px 2px 5px black"), s?.(e.join(","));
18
- }, [s, o]), d = [];
19
- return o !== "" && (d = o.split(",")), /* @__PURE__ */ a(t, {
20
- direction: "column",
21
- children: [/* @__PURE__ */ a("div", {
22
- className: "flex w-full justify-between",
23
- children: [/* @__PURE__ */ i(e, {
24
- keyValue: ["text-shadow"],
25
- children: "Text Shadow"
26
- }), /* @__PURE__ */ i("button", {
27
- className: "cursor-pointer",
28
- type: "button",
29
- onClick: u,
30
- children: /* @__PURE__ */ i("i", { className: "fas fa-plus" })
31
- })]
32
- }), d.length > 0 && /* @__PURE__ */ i("div", {
33
- className: "mt-1",
34
- children: d.map((e, t) => /* @__PURE__ */ i(n, {
35
- value: e,
36
- onChange: l(t),
37
- onRemove: c(t)
38
- }, t))
39
- })]
8
+ var s = ["text-shadow"], c = ({ value: c, onChange: l }) => {
9
+ let u = typeof c == "string" && c !== "" ? e(c).map((e) => e.trim()) : [], d = a((e) => l?.(e.length > 0 ? e.join(", ") : ""), [l]), f = (e) => () => d(u.filter((t, n) => n !== e)), p = (e) => (t) => {
10
+ t !== u[e] && d(u.map((n, r) => r === e ? t : n));
11
+ };
12
+ return /* @__PURE__ */ o(t, {
13
+ label: "Text Shadow",
14
+ keys: s,
15
+ addLabel: "Add text shadow",
16
+ onAdd: () => d([...u, r({
17
+ ...n,
18
+ y: "1px",
19
+ blur: "2px"
20
+ }, { withSpread: !1 })]),
21
+ children: u.length > 0 && u.map((e, t) => /* @__PURE__ */ o(i, {
22
+ value: e,
23
+ withSpread: !1,
24
+ onChange: p(t),
25
+ onRemove: f(t)
26
+ }, t))
40
27
  });
41
28
  };
42
29
  //#endregion
43
- export { o as default };
30
+ export { c as default };
@@ -1,55 +1,56 @@
1
1
  import e from "../../StyleInspectorContext.mjs";
2
- import t from "../../components/CategoryContainer/index.mjs";
3
- import { use as n, useCallback as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import o, { useModal as s } from "@plitzi/plitzi-ui/Modal";
6
- import c from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
7
- import { useToast as l } from "@plitzi/plitzi-ui/Toast";
8
- import u from "@plitzi/sdk-variables/components/StyleVariables";
2
+ import { VARIABLES_KEYS as t } from "../../categoryKeys.mjs";
3
+ import n from "../../components/CategoryContainer/index.mjs";
4
+ import { use as r, useCallback as i } from "react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import s, { useModal as c } from "@plitzi/plitzi-ui/Modal";
7
+ import l from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
8
+ import { useToast as u } from "@plitzi/plitzi-ui/Toast";
9
+ import d from "@plitzi/sdk-variables/components/StyleVariables";
9
10
  //#region src/components/StyleInspector/categories/Variables/Variables.tsx
10
- var d = ({ isCollapsed: d, onCollapse: f }) => {
11
- let { displayMode: p, selector: m } = n(e), { builderHandler: h } = n(c), { showDialog: g } = s(), { addToast: _ } = l(), v = r((e) => f?.("variables", e), [f]), y = r((e) => {
12
- if (!m) return;
11
+ var f = ({ isCollapsed: f, onCollapse: p }) => {
12
+ let { displayMode: m, selector: h } = r(e), { builderHandler: g } = r(l), { showDialog: _ } = c(), { addToast: v } = u(), y = i((e) => p?.("variables", e), [p]), b = i((e) => {
13
+ if (!h) return;
13
14
  let { name: t, category: n, value: r } = e;
14
- m.variables?.[n]?.[t] ? _(/* @__PURE__ */ a("span", { children: [
15
+ h.variables?.[n]?.[t] ? v(/* @__PURE__ */ o("span", { children: [
15
16
  "Variable with the name ",
16
- /* @__PURE__ */ i("b", { children: t }),
17
+ /* @__PURE__ */ a("b", { children: t }),
17
18
  " already exists"
18
19
  ] }), {
19
20
  appeareance: "warning",
20
21
  autoDismiss: !0,
21
22
  placement: "top-right"
22
- }) : h("styleAddSelectorVariable", p, m.name, n, t, r);
23
+ }) : g("styleAddSelectorVariable", m, h.name, n, t, r);
23
24
  }, [
24
- _,
25
- h,
26
- p,
27
- m
28
- ]), b = r((e) => {
29
- m && h("styleUpdateSelectorVariable", p, m.name, e.category, e.name, e.value);
25
+ v,
26
+ g,
27
+ m,
28
+ h
29
+ ]), x = i((e) => {
30
+ h && g("styleUpdateSelectorVariable", m, h.name, e.category, e.name, e.value);
30
31
  }, [
31
- h,
32
- p,
33
- m
34
- ]), x = r(async (e, t) => {
35
- m && await g(/* @__PURE__ */ i(o.Header, { children: /* @__PURE__ */ i("h4", { children: "Remove Style Variable" }) }), /* @__PURE__ */ i(o.Body, { children: /* @__PURE__ */ i("h4", { children: "Do you want to remove this item ?" }) }), void 0, { size: "sm" }, t) && h("styleRemoveSelectorVariable", p, m.name, e, t);
32
+ g,
33
+ m,
34
+ h
35
+ ]), S = i(async (e, t) => {
36
+ h && await _(/* @__PURE__ */ a(s.Header, { children: /* @__PURE__ */ a("h4", { children: "Remove Style Variable" }) }), /* @__PURE__ */ a(s.Body, { children: /* @__PURE__ */ a("h4", { children: "Do you want to remove this item ?" }) }), void 0, { size: "sm" }, t) && g("styleRemoveSelectorVariable", m, h.name, e, t);
36
37
  }, [
37
- h,
38
- p,
38
+ g,
39
39
  m,
40
- g
40
+ h,
41
+ _
41
42
  ]);
42
- if (m) return /* @__PURE__ */ i(t, {
43
- title: "Variables",
44
- isCollapsed: d,
45
- onCollapse: v,
46
- children: /* @__PURE__ */ i(u, {
47
- variables: m.variables,
48
- onAdd: y,
49
- onUpdate: b,
50
- onRemove: x
43
+ if (h) return /* @__PURE__ */ a(n, {
44
+ title: t.title,
45
+ isCollapsed: f,
46
+ onCollapse: y,
47
+ children: /* @__PURE__ */ a(d, {
48
+ variables: h.variables,
49
+ onAdd: b,
50
+ onUpdate: x,
51
+ onRemove: S
51
52
  })
52
53
  });
53
54
  };
54
55
  //#endregion
55
- export { d as default };
56
+ export { f as default };
@@ -0,0 +1,45 @@
1
+ import { StyleCategory } from '@plitzi/sdk-shared';
2
+ /**
3
+ * The properties each category of the inspector edits, in one place: the category reads them to tell what is set (the
4
+ * dots in its header, the hint on its advanced toggle), and the inspector's search reads them to find which category
5
+ * holds the property a person typed. `advanced` are the ones behind the category's sliders toggle.
6
+ */
7
+ export type CategoryKeys = {
8
+ title: string;
9
+ dot: StyleCategory[];
10
+ advanced: StyleCategory[];
11
+ };
12
+ export declare const LIST_KEYS: CategoryKeys;
13
+ export declare const LIST_ITEM_KEYS: CategoryKeys;
14
+ export declare const DISPLAY_KEYS: CategoryKeys;
15
+ export declare const FLEX_CHILD_KEYS: CategoryKeys;
16
+ export declare const SPACING_KEYS: CategoryKeys;
17
+ export declare const SIZE_KEYS: CategoryKeys;
18
+ export declare const POSITION_KEYS: CategoryKeys;
19
+ export declare const TYPOGRAPHY_KEYS: CategoryKeys;
20
+ export declare const BACKGROUND_KEYS: CategoryKeys;
21
+ export declare const BORDER_KEYS: CategoryKeys;
22
+ export declare const EFFECTS_KEYS: CategoryKeys;
23
+ export declare const OTHERS_KEYS: CategoryKeys;
24
+ /** The categories with no properties of their own to search by — found by their title alone. */
25
+ export declare const VARIABLES_KEYS: CategoryKeys;
26
+ export declare const RAW_STYLE_KEYS: CategoryKeys;
27
+ /** Every category, by the id its collapsed state is stored under, in the order the inspector draws them. */
28
+ export declare const CATEGORY_KEYS: {
29
+ readonly list: CategoryKeys;
30
+ readonly listItem: CategoryKeys;
31
+ readonly display: CategoryKeys;
32
+ readonly displayFlexChild: CategoryKeys;
33
+ readonly spacing: CategoryKeys;
34
+ readonly size: CategoryKeys;
35
+ readonly position: CategoryKeys;
36
+ readonly typography: CategoryKeys;
37
+ readonly background: CategoryKeys;
38
+ readonly border: CategoryKeys;
39
+ readonly effects: CategoryKeys;
40
+ readonly others: CategoryKeys;
41
+ readonly variables: CategoryKeys;
42
+ readonly rawStyle: CategoryKeys;
43
+ };
44
+ export type CategoryId = keyof typeof CATEGORY_KEYS;
45
+ export declare const CATEGORY_IDS: CategoryId[];