@plitzi/sdk-style 0.36.2 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/dist/StyleMap/StyleMap.d.ts +5 -21
  3. package/dist/StyleMap/helpers/isValueValid.d.ts +1 -0
  4. package/dist/StyleMap/helpers/isValueValid.mjs +3 -3
  5. package/dist/StyleMap/helpers/utils.d.ts +2 -2
  6. package/dist/StyleMap/helpers/utils.mjs +43 -28
  7. package/dist/StyleMap/methods/addSelector.d.ts +2 -7
  8. package/dist/StyleMap/methods/addSelector.mjs +4 -4
  9. package/dist/StyleMap/methods/updateSelector.d.ts +2 -5
  10. package/dist/StyleMap/methods/updateSelector.mjs +2 -2
  11. package/dist/StyleReducer.d.ts +3 -11
  12. package/dist/components/Selector/Selector.mjs +149 -125
  13. package/dist/components/Selector/SelectorHelper.d.ts +25 -0
  14. package/dist/components/Selector/SelectorHelper.mjs +43 -2
  15. package/dist/components/StyleInspector/Inspector.d.ts +2 -1
  16. package/dist/components/StyleInspector/Inspector.mjs +92 -87
  17. package/dist/components/StyleInspector/StyleInspector.mjs +240 -169
  18. package/dist/components/StyleInspector/StyleInspectorContext.d.ts +1 -0
  19. package/dist/components/StyleInspector/StyleInspectorProvider.d.ts +2 -1
  20. package/dist/components/StyleInspector/StyleInspectorProvider.mjs +37 -31
  21. package/dist/components/StyleInspector/categories/Others/Others.mjs +58 -48
  22. package/dist/components/StyleInspector/categories/Others/OthersScrollbar.d.ts +9 -0
  23. package/dist/components/StyleInspector/categories/Others/OthersScrollbar.mjs +36 -0
  24. package/dist/components/StyleInspector/categories/Typography/Typography.mjs +29 -45
  25. package/dist/components/StyleInspector/categories/Typography/TypographyFigures.d.ts +13 -0
  26. package/dist/components/StyleInspector/categories/Typography/TypographyFigures.mjs +61 -0
  27. package/dist/components/StyleInspector/components/AncestorRules/AncestorRuleChip.d.ts +10 -0
  28. package/dist/components/StyleInspector/components/AncestorRules/AncestorRuleChip.mjs +39 -0
  29. package/dist/components/StyleInspector/components/AncestorRules/AncestorRules.d.ts +14 -0
  30. package/dist/components/StyleInspector/components/AncestorRules/AncestorRules.mjs +36 -0
  31. package/dist/components/StyleInspector/components/AncestorRules/index.d.ts +3 -0
  32. package/dist/components/StyleInspector/components/AncestorRules/index.mjs +5 -0
  33. package/dist/components/StyleInspector/helpers.d.ts +36 -0
  34. package/dist/components/StyleInspector/helpers.mjs +54 -0
  35. package/dist/components/StyleInspector/hooks/useStyleInherit.d.ts +2 -1
  36. package/dist/components/StyleInspector/hooks/useStyleInherit.mjs +7 -5
  37. package/dist/components/StyleManager/ManagerSelector.d.ts +3 -2
  38. package/dist/components/StyleManager/ManagerSelector.mjs +114 -86
  39. package/dist/components/StyleManager/StyleManager.mjs +1 -0
  40. package/dist/components/StyleManager/StyleSelectorTag.d.ts +4 -1
  41. package/dist/components/StyleManager/StyleSelectorTag.mjs +36 -22
  42. package/dist/helpers/calculateInheriting.d.ts +1 -0
  43. package/dist/helpers/calculateInheriting.mjs +38 -28
  44. package/dist/helpers/processSelector.mjs +44 -21
  45. package/dist/helpers/processSelectorAttributes.d.ts +14 -6
  46. package/dist/helpers/processSelectorAttributes.mjs +38 -22
  47. package/package.json +16 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # @plitzi/sdk-style
2
2
 
3
+ ## 0.37.1
4
+
5
+ ### Patch Changes
6
+
7
+ - v0.37.1
8
+ - Updated dependencies
9
+ - @plitzi/sdk-plugins@0.37.1
10
+ - @plitzi/sdk-shared@0.37.1
11
+ - @plitzi/sdk-variables@0.37.1
12
+
13
+ ## 0.37.0
14
+
15
+ ### Minor Changes
16
+
17
+ - - A `button` takes a `title`: shown as a tooltip, and its accessible name when it has no text of its own — an
18
+ icon-only button without one was announced as nothing. The builder's settings offer it as "Tooltip". The JSON export
19
+ is two files, `schema.json` and `style.json`, shown as tabs; each group of changes in the export folds away.
20
+
21
+ - `BindingTransformer.params` is `Record<string, string | number | boolean>`: a param the builder draws as a checkbox
22
+ (`styleVariant`'s `append`) is stored as the boolean it is and read as one, so the type now says so. The MCP compares
23
+ such a param with its catalog options as text. A `container` may be an `li`, for the rows of a list. The export
24
+ keeps every element id with `keepIds`, and the header's Publish dialog opens wider.
25
+
26
+ - **The builder exports the space on screen — on paid plans.** **Export** in the header opens a wide dialog: the
27
+ format as tabs (TypeScript in one file, TypeScript with a file per page as a `.zip`, or JSON), generated as soon as
28
+ it is picked, shown read-only in CodeMirror — beside a file list when there are several — with one row of actions,
29
+ **Copy** and **Download**. What the export tidied is a one-line note that unfolds into readable groups. On the free
30
+ plan the dialog explains what export is instead; the server refuses the code with a 402 (`limit: 'spaceExport'`)
31
+ whatever the builder shows. `useSpaceExport` is the one way into it, for anything else that needs the space as files.
32
+
33
+ - **A space document can be read back into code.** `specFromSpace(documents)` turns a `{ schema, style }` pair — a
34
+ builder export, a seed checked in as JSON — into the `SpaceSpec` that authors it, and `specToSource(spec, { exportName })`
35
+ writes that spec out as the TypeScript a person would write: one factory call per element, the attributes a type
36
+ already defaults to left out, the longhands the document stores written back as `padding: 10px 20px`, and every class
37
+ something names as a `styles()` declaration held in a variable. `split: true` writes one file per page and per layout.
38
+ `compareSpaces(expected, actual)` proves the round trip: it lists every way two pairs render differently — the tree,
39
+ the attributes, the rules that apply to each element whatever its selector is called, bindings, flows, pages, layouts
40
+ and settings — and nothing else. A selector used by one element becomes that element's own `css`; one shared, or
41
+ spelled out anywhere in the document (a `customCss` rule, a template), stays a class under its own name; an element id
42
+ nothing refers to is left out and derived again.
43
+
44
+ What an older builder left behind is repaired on the way, and every repair is reported in `corrections` rather than
45
+ made silently: element types that no longer exist (`navbar` → a `list` laid out in a row, `navbarItem` → `listItem`),
46
+ a hover stored as a class of its own (`card:hover`) folded into the class, fields and attributes no component reads,
47
+ a setting nothing reads, a link `target` of `_blank` (the component adds the underscore, so it rendered as `__blank`),
48
+ `null` or an empty list where an attribute is unset, a binding to a source nothing publishes, a flow with a step that
49
+ runs nothing, and a global callback registered on the wrong module. A CSS property the style editor cannot hold is
50
+ kept in `customCss` under the same selector, so the page still renders it.
51
+
52
+ - **What a spec can say grew to what a document holds.** A selector carries its states and variants beside its rules —
53
+ `styles('card', { css, states: { hover }, variants: { active } })`, and `states` on an element's own `css` — and the
54
+ selector cache is now written by `processSelector`, the function the style editor writes it with. An element type's
55
+ defaults (`elements`) take states, variants, per-breakpoint rules and `slots` for its other selectors (a modal's
56
+ `rootContainer`). A space declares `layouts` — shells that pages render inside, named by `layout: { id, slot }` on a
57
+ page or on another layout, with the slot checked to be inside the shell — and a page takes `keepState` and
58
+ `stateStorage`. `visible: false` starts an element hidden for a flow to reveal, and `loadStrategy` is carried through.
59
+ An element's own selector never takes the name of a declared class any more, however that class happens to be called.
60
+
61
+ - `elementAttributeNames` lists, as data, the attributes each built-in element can be authored with — `null` for one
62
+ that takes any. It is generated from the elements' attribute types (`yarn generate:attribute-names`) and a type test
63
+ fails when the two disagree. `defaultAttributes(type)` and `defaultLabel(type)` expose what a factory fills in.
64
+
65
+ - `CustomAttributes` accepts any attribute, because the component a custom element's `renderType` names reads its own
66
+ attributes off it; and `FormControlAttributes` declares `previewError`, which `withFieldValue` reads.
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies
71
+ - @plitzi/sdk-plugins@0.37.0
72
+ - @plitzi/sdk-shared@0.37.0
73
+ - @plitzi/sdk-variables@0.37.0
74
+
3
75
  ## 0.36.2
4
76
 
5
77
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { DisplayMode, SpaceFont, Style, StyleCategory, StyleItem, StyleObject, StyleState, StyleValue, StyleVariableCategory, StyleVariableValue, TagType } from '@plitzi/sdk-shared';
1
+ import { DisplayMode, SpaceFont, Style, StyleCategory, StyleItem, StyleObject, StyleTarget, StyleValue, StyleVariableCategory, StyleVariableValue, TagType } from '@plitzi/sdk-shared';
2
2
  export type StyleMapProps = {
3
3
  platform: Style['platform'];
4
4
  variables?: Style['variables'];
@@ -10,31 +10,15 @@ declare class StyleMap {
10
10
  fonts: SpaceFont[];
11
11
  constructor(props: StyleMapProps);
12
12
  static getInstance: (props: StyleMapProps) => StyleMap;
13
- addSelector(displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: {
14
- componentType?: string;
15
- styleSelector?: string;
16
- styleState?: StyleState;
17
- styleVariant?: string;
18
- }): boolean;
19
- static addSelector(style: Pick<Style, 'platform' | 'variables'>, displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: {
20
- componentType?: string;
21
- styleSelector?: string;
22
- styleState?: StyleState;
23
- styleVariant?: string;
24
- }): boolean;
13
+ addSelector(displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: StyleTarget): boolean;
14
+ static addSelector(style: Pick<Style, 'platform' | 'variables'>, displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: StyleTarget): boolean;
25
15
  getSelector: (displayMode: DisplayMode, selector: string) => StyleItem | undefined;
26
16
  static getSelector: (style: Pick<Style, "platform" | "variables">, displayMode: DisplayMode, selector: string) => StyleItem | undefined;
27
- updateSelector(displayMode: DisplayMode, selector: string, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: {
28
- componentType?: string;
17
+ updateSelector(displayMode: DisplayMode, selector: string, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: StyleTarget & {
29
18
  styleSelector: string;
30
- styleState?: StyleState;
31
- styleVariant?: string;
32
19
  }): boolean;
33
- static updateSelector(style: Pick<Style, 'platform' | 'variables'>, displayMode: DisplayMode, selector: string, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: {
34
- componentType?: string;
20
+ static updateSelector(style: Pick<Style, 'platform' | 'variables'>, displayMode: DisplayMode, selector: string, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: StyleTarget & {
35
21
  styleSelector: string;
36
- styleState?: StyleState;
37
- styleVariant?: string;
38
22
  }): boolean;
39
23
  removeSelector: (displayMode: DisplayMode | undefined, selector: string) => boolean;
40
24
  static removeSelector: (style: Pick<Style, "platform" | "variables">, displayMode: DisplayMode | undefined, selector: string) => boolean;
@@ -2,6 +2,7 @@ import { StyleAttributes, StyleBlock, StyleCategory, StyleObject, StyleState, St
2
2
  export declare const isStyleObject: (obj: Partial<StyleObject>) => boolean;
3
3
  export declare const isStyleStates: (obj: NonNullable<StyleBlock["states"]>) => boolean;
4
4
  export declare const isStyleVariants: (obj: NonNullable<StyleBlock["variants"]>) => boolean;
5
+ export declare const isStyleAncestors: (obj: NonNullable<StyleBlock["ancestors"]>) => boolean;
5
6
  export declare const isStyleBlock: (obj: StyleBlock) => boolean;
6
7
  export declare const isStyleAttributes: (obj?: StyleAttributes) => boolean;
7
8
  declare const isValidValue: (path?: StyleCategory, value?: StyleAttributes | StyleValue | Partial<StyleObject> | StyleBlock | StyleVariants | StyleStates, params?: {
@@ -1,7 +1,7 @@
1
1
  //#region src/StyleMap/helpers/isValueValid.ts
2
- var e = (e) => typeof e == "string" || typeof e == "number" || e === void 0, t = (e) => typeof e == "object" && !!e && !Array.isArray(e), n = (n) => t(n) && Object.values(n).every(e), r = (e) => t(e) && Object.values(e).every(n), i = (e) => t(e) && Object.values(e).every((e) => !(!t(e) || "variants" in e || "default" in e && e.default && !n(e.default) || "states" in e && e.states && !r(e.states))), a = (e) => !(!t(e) || !e.default || !n(e.default) || e.states && !r(e.states) || e.variants && !i(e.variants)), o = (e) => e === void 0 || t(e) && !Object.keys(e).length || t(e) && "base" in e && Object.values(e).every(a), s = (s, c, l) => {
2
+ var e = (e) => typeof e == "string" || typeof e == "number" || e === void 0, t = (e) => typeof e == "object" && !!e && !Array.isArray(e), n = (n) => t(n) && Object.values(n).every(e), r = (e) => t(e) && Object.values(e).every(n), i = (e) => t(e) && Object.values(e).every((e) => !(!t(e) || "variants" in e || "ancestors" in e || "default" in e && e.default && !n(e.default) || "states" in e && e.states && !r(e.states))), a = (e) => t(e) && Object.values(e).every((e) => t(e) && (!e.default || n(e.default)) && (!e.states || r(e.states)) && (!e.variants || i(e.variants))), o = (e) => !(!t(e) || !e.default || !n(e.default) || e.states && !r(e.states) || e.variants && !i(e.variants) || e.ancestors && !a(e.ancestors)), s = (e) => e === void 0 || t(e) && !Object.keys(e).length || t(e) && "base" in e && Object.values(e).every(o), c = (a, c, l) => {
3
3
  let { styleSelector: u, styleVariant: d, styleState: f } = l ?? {};
4
- return !s && !u && !d && !f ? o(c) : !s && !u && d && f ? !1 : !s && !u && d ? i(c) : !s && !u && f ? r(c) : s ? e(c) : u ? c === void 0 ? !0 : e(c) || !t(c) ? !1 : n(c) || a(c) || a(c[u]) : !1;
4
+ return !a && !u && !d && !f ? s(c) : !a && !u && d && f ? !1 : !a && !u && d ? i(c) : !a && !u && f ? r(c) : a ? e(c) : u ? c === void 0 ? !0 : e(c) || !t(c) ? !1 : n(c) || o(c) || o(c[u]) : !1;
5
5
  };
6
6
  //#endregion
7
- export { s as default, o as isStyleAttributes, a as isStyleBlock, n as isStyleObject, r as isStyleStates, i as isStyleVariants };
7
+ export { c as default, a as isStyleAncestors, s as isStyleAttributes, o as isStyleBlock, n as isStyleObject, r as isStyleStates, i as isStyleVariants };
@@ -1,6 +1,6 @@
1
1
  import { StyleBlock, StyleCategory, StyleItem, StyleObject, StyleState, StyleStates, StyleValue, StyleVariants } from '@plitzi/sdk-shared';
2
2
  declare const parseValue: (path: StyleCategory | undefined, value: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock | undefined, prevValue: StyleObject) => StyleObject;
3
- declare const getTargetPath: (styleSelector: string, styleVariant?: string, styleState?: string) => string;
3
+ declare const getTargetPath: (styleSelector: string, styleVariant?: string, styleState?: string, styleAncestor?: string) => string;
4
4
  declare const isEmptyObject: (v: unknown) => v is Record<string, unknown>;
5
- declare const writeStyle: (mode: "add" | "update" | undefined, styleItem: StyleItem, styleSelector: string, path?: StyleCategory, value?: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock, styleState?: StyleState, styleVariant?: string) => void;
5
+ declare const writeStyle: (mode: "add" | "update" | undefined, styleItem: StyleItem, styleSelector: string, path?: StyleCategory, value?: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock, styleState?: StyleState, styleVariant?: string, styleAncestor?: string) => void;
6
6
  export { getTargetPath, isEmptyObject, parseValue, writeStyle };
@@ -12,46 +12,61 @@ var i = (t, n, r) => {
12
12
  return e;
13
13
  }
14
14
  return r;
15
- }, a = (e, t, n) => t && n ? `attributes.${e}.variants.${t}.states.${n}` : t ? `attributes.${e}.variants.${t}.default` : n ? `attributes.${e}.states.${n}` : `attributes.${e}.default`, o = (e) => !!e && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0, s = (s = "add", c, l, u, d, f, p) => {
16
- let m = a(l, p, f), h = !!f || !!p;
17
- if (d !== void 0) {
18
- if (e(d) && o(d)) {
19
- if (s === "update" && h) {
20
- let e = p ? `attributes.${l}.variants` : `attributes.${l}.states`;
21
- if (!t(c, e)) return;
15
+ }, a = (e, t) => t ? `attributes.${e}.ancestors.${t}` : `attributes.${e}`, o = (e, t, n, r) => {
16
+ let i = a(e, r);
17
+ return t && n ? `${i}.variants.${t}.states.${n}` : t ? `${i}.variants.${t}.default` : n ? `${i}.states.${n}` : `${i}.default`;
18
+ }, s = (e) => !!e && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0, c = (e, i, a, o) => {
19
+ let l = t(e, i);
20
+ if (!l) return;
21
+ let u = n(l, [a]), d = i.includes(".ancestors.") && Object.values(u).every((e) => s(e));
22
+ if (Object.keys(u).length && !d || i === o) {
23
+ r(e, i, u);
24
+ return;
25
+ }
26
+ let f = i.lastIndexOf(".");
27
+ c(e, i.slice(0, f), i.slice(f + 1), o);
28
+ }, l = (l = "add", u, d, f, p, m, h, g) => {
29
+ let _ = a(d, g), v = o(d, h, m, g), y = !!m || !!h, b = h ? `${_}.variants` : `${_}.states`;
30
+ if (p !== void 0) {
31
+ if (e(p) && s(p)) {
32
+ if (g && !y) {
33
+ c(u, _, "default", `attributes.${d}`);
34
+ return;
22
35
  }
23
- r(c, m, {});
36
+ if (l === "update" && y && !t(u, b)) return;
37
+ r(u, v, {});
24
38
  return;
25
39
  }
26
- let n = t(c, m, {});
27
- r(c, m, i(u, d, n));
40
+ let n = t(u, v, {});
41
+ r(u, v, i(f, p, n));
28
42
  return;
29
43
  }
30
- if (s === "add" && !u && h) {
31
- let e = p ? `attributes.${l}.variants` : `attributes.${l}.states`;
32
- t(c, e) || r(c, m, {});
44
+ if (l === "add" && !f && y) {
45
+ t(u, b) || r(u, v, {});
33
46
  return;
34
47
  }
35
- if (u) {
36
- let e = t(c, m, {});
37
- r(c, m, n(e, [u]));
48
+ if (f) {
49
+ let e = t(u, v, {});
50
+ r(u, v, n(e, [f]));
38
51
  return;
39
52
  }
40
- if (p) {
41
- let e = `attributes.${l}.variants`, i = t(c, e);
42
- if (!i) return;
43
- let a = n(i, [p]);
44
- Object.keys(a).length ? r(c, e, a) : r(c, `attributes.${l}`, n(t(c, `attributes.${l}`), ["variants"]));
53
+ if (h && m) {
54
+ c(u, `${_}.variants.${h}.states`, m, `attributes.${d}`);
45
55
  return;
46
56
  }
47
- if (f) {
48
- let e = `attributes.${l}.states`, i = t(c, e);
49
- if (!i) return;
50
- let a = n(i, [f]);
51
- Object.keys(a).length ? r(c, e, a) : r(c, `attributes.${l}`, n(t(c, `attributes.${l}`), ["states"]));
57
+ if (h) {
58
+ c(u, `${_}.variants`, h, `attributes.${d}`);
59
+ return;
60
+ }
61
+ if (m) {
62
+ c(u, `${_}.states`, m, `attributes.${d}`);
63
+ return;
64
+ }
65
+ if (g) {
66
+ c(u, `attributes.${d}.ancestors`, g, `attributes.${d}`);
52
67
  return;
53
68
  }
54
- r(c, m, {});
69
+ r(u, v, {});
55
70
  };
56
71
  //#endregion
57
- export { a as getTargetPath, o as isEmptyObject, i as parseValue, s as writeStyle };
72
+ export { o as getTargetPath, s as isEmptyObject, i as parseValue, l as writeStyle };
@@ -1,8 +1,3 @@
1
- import { DisplayMode, Style, StyleBlock, StyleCategory, StyleItem, StyleObject, StyleState, StyleStates, StyleValue, StyleVariants, TagType } from '@plitzi/sdk-shared';
2
- declare const addSelector: (platform: Style["platform"], displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock | undefined, params: {
3
- componentType?: string;
4
- styleSelector?: string;
5
- styleState?: StyleState;
6
- styleVariant?: string;
7
- }) => boolean;
1
+ import { DisplayMode, Style, StyleBlock, StyleCategory, StyleItem, StyleObject, StyleStates, StyleTarget, StyleValue, StyleVariants, TagType } from '@plitzi/sdk-shared';
2
+ declare const addSelector: (platform: Style["platform"], displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock | undefined, params: StyleTarget) => boolean;
8
3
  export default addSelector;
@@ -6,9 +6,9 @@ import { set as a } from "@plitzi/plitzi-ui/helpers";
6
6
  //#region src/StyleMap/methods/addSelector.ts
7
7
  var o = (o, s, c, l, u, d, f) => {
8
8
  if (!f) return !1;
9
- let { componentType: p, styleSelector: m, styleState: h, styleVariant: g } = f;
10
- if (t(o, s, c) || !p && l === "element" || p && l !== "element" || m && typeof m != "string" || !m && (h || g) || u && u.includes(".") || !n(u, d, f)) return !1;
11
- let _ = {
9
+ let { componentType: p, styleSelector: m, styleState: h, styleVariant: g, styleAncestor: _ } = f;
10
+ if (t(o, s, c) || !p && l === "element" || p && l !== "element" || m && typeof m != "string" || !m && (h || g || _) || u && u.includes(".") || !n(u, d, f)) return !1;
11
+ let v = {
12
12
  name: c,
13
13
  type: l,
14
14
  attributes: m ? {
@@ -18,7 +18,7 @@ var o = (o, s, c, l, u, d, f) => {
18
18
  componentType: p,
19
19
  cache: ""
20
20
  };
21
- return !m && r(d) ? ((!d || !Object.keys(d).length) && (d = { base: { default: {} } }), _.attributes = d, _.cache = e(_), a(o, `${s}.${c}`, _), !0) : (i("add", _, m ?? "base", u, d, h, g), _.cache = e(_), a(o, `${s}.${c}`, _), !0);
21
+ return !m && r(d) ? ((!d || !Object.keys(d).length) && (d = { base: { default: {} } }), v.attributes = d, v.cache = e(v), a(o, `${s}.${c}`, v), !0) : (i("add", v, m ?? "base", u, d, h, g, _), v.cache = e(v), a(o, `${s}.${c}`, v), !0);
22
22
  };
23
23
  //#endregion
24
24
  export { o as default };
@@ -1,8 +1,5 @@
1
- import { DisplayMode, Style, StyleBlock, StyleCategory, StyleItem, StyleObject, StyleState, StyleStates, StyleValue, StyleVariants } from '@plitzi/sdk-shared';
2
- declare const updateSelector: (platform: Style["platform"], displayMode: DisplayMode, selector: string, path: StyleCategory | undefined, value: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock | undefined, params: {
3
- componentType?: string;
1
+ import { DisplayMode, Style, StyleBlock, StyleCategory, StyleItem, StyleObject, StyleStates, StyleTarget, StyleValue, StyleVariants } from '@plitzi/sdk-shared';
2
+ declare const updateSelector: (platform: Style["platform"], displayMode: DisplayMode, selector: string, path: StyleCategory | undefined, value: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock | undefined, params: StyleTarget & {
4
3
  styleSelector: string;
5
- styleState?: StyleState;
6
- styleVariant?: string;
7
4
  }) => boolean;
8
5
  export default updateSelector;
@@ -6,8 +6,8 @@ import { set as i } from "@plitzi/plitzi-ui/helpers";
6
6
  //#region src/StyleMap/methods/updateSelector.ts
7
7
  var a = (a, o, s, c, l, u) => {
8
8
  if (!u) return !1;
9
- let { componentType: d, styleSelector: f, styleState: p, styleVariant: m } = u, h = t(a, o, s);
10
- return !h || !f || !d && h.type === "element" || d && h.type !== "element" || f && typeof f != "string" || c && c.includes(".") || !n(c, l, u) ? !1 : (r("update", h, f, c, l, p, m), i(h, "cache", e(h)), i(a, `${o}.${s}`, h), !0);
9
+ let { componentType: d, styleSelector: f, styleState: p, styleVariant: m, styleAncestor: h } = u, g = t(a, o, s);
10
+ return !g || !f || !d && g.type === "element" || d && g.type !== "element" || f && typeof f != "string" || c && c.includes(".") || !n(c, l, u) ? !1 : (r("update", g, f, c, l, p, m, h), i(g, "cache", e(g)), i(a, `${o}.${s}`, g), !0);
11
11
  };
12
12
  //#endregion
13
13
  export { a as default };
@@ -1,4 +1,4 @@
1
- import { DisplayMode, ReducerActionOrigin, Style, StyleCategory, StyleItem, StyleState, SpaceFont, StyleVariableCategory, StyleVariableValue, TagType } from '@plitzi/sdk-shared';
1
+ import { DisplayMode, ReducerActionOrigin, SpaceFont, Style, StyleCategory, StyleItem, StyleTarget, StyleVariableCategory, StyleVariableValue, TagType } from '@plitzi/sdk-shared';
2
2
  export declare const StyleActions: {
3
3
  readonly STYLE_UPDATE: "STYLE_UPDATE";
4
4
  readonly STYLE_ADD_SELECTOR: "STYLE_ADD_SELECTOR";
@@ -28,23 +28,15 @@ export type StyleReducerActions = StyleReducerActionsBase & ({
28
28
  path?: StyleCategory;
29
29
  selectorType: TagType;
30
30
  value?: StyleItem['attributes'];
31
- params: {
32
- componentType?: string;
33
- styleSelector?: string;
34
- styleState?: StyleState;
35
- styleVariant?: string;
36
- };
31
+ params: StyleTarget;
37
32
  } | {
38
33
  type: 'STYLE_UPDATE_SELECTOR';
39
34
  displayMode: DisplayMode;
40
35
  selector: string;
41
36
  path?: StyleCategory;
42
37
  value?: StyleItem['attributes'];
43
- params: {
44
- componentType?: string;
38
+ params: StyleTarget & {
45
39
  styleSelector: string;
46
- styleState?: StyleState;
47
- styleVariant?: string;
48
40
  };
49
41
  } | {
50
42
  type: 'STYLE_REMOVE_SELECTOR';