@plitzi/sdk-shared 0.38.5 → 0.38.7

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 (53) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/dist/dataSource/globalSources.d.ts +34 -1
  3. package/dist/dataSource/globalSources.mjs +22 -2
  4. package/dist/dataSource/hooks/index.d.ts +2 -1
  5. package/dist/dataSource/hooks/index.mjs +2 -1
  6. package/dist/dataSource/hooks/useResolvedVariables.d.ts +12 -0
  7. package/dist/dataSource/hooks/useResolvedVariables.mjs +28 -0
  8. package/dist/dataSource/index.mjs +2 -1
  9. package/dist/dataSource/resolveVariables.d.ts +2 -2
  10. package/dist/flags/useFlagResolution.mjs +6 -6
  11. package/dist/index.mjs +62 -58
  12. package/dist/network/spaceEvents.d.ts +30 -0
  13. package/dist/network/spaceEvents.mjs +150 -147
  14. package/dist/project/layout.d.ts +197 -0
  15. package/dist/project/layout.mjs +394 -0
  16. package/dist/project/paths.d.ts +84 -0
  17. package/dist/project/paths.mjs +4 -0
  18. package/dist/project/root.d.ts +24 -0
  19. package/dist/project/root.mjs +26 -0
  20. package/dist/queries/index.d.ts +12 -2
  21. package/dist/queries/index.mjs +27 -17
  22. package/dist/queries/serverQueries.d.ts +22 -0
  23. package/dist/queries/serverQueries.mjs +9 -0
  24. package/dist/queries/useServerQuery.d.ts +19 -0
  25. package/dist/queries/useServerQuery.mjs +21 -0
  26. package/dist/server/rsc/refreshRsc.d.ts +22 -10
  27. package/dist/server/rsc/refreshRsc.mjs +65 -53
  28. package/dist/server/rsc/useRscRefresh.d.ts +2 -1
  29. package/dist/server/rsc/useRscRefresh.mjs +1 -1
  30. package/dist/store/index.d.ts +45 -45
  31. package/dist/style/index.d.ts +3 -0
  32. package/dist/style/index.mjs +5 -2
  33. package/dist/style/keyframes.d.ts +39 -0
  34. package/dist/style/keyframes.mjs +41 -0
  35. package/dist/style/notifications.d.ts +34 -12
  36. package/dist/style/notifications.mjs +69 -32
  37. package/dist/style/styleConditions.d.ts +43 -0
  38. package/dist/style/styleConditions.mjs +29 -0
  39. package/dist/style/styleConstants.d.ts +3 -2
  40. package/dist/style/styleConstants.mjs +2 -0
  41. package/dist/style/stylePseudos.d.ts +40 -0
  42. package/dist/style/stylePseudos.mjs +109 -0
  43. package/dist/style/styleStates.d.ts +35 -8
  44. package/dist/style/styleStates.mjs +38 -15
  45. package/dist/style/styleTarget.d.ts +23 -0
  46. package/dist/style/styleTarget.mjs +35 -0
  47. package/dist/types/AuthTypes.d.ts +5 -0
  48. package/dist/types/CommonTypes.d.ts +12 -0
  49. package/dist/types/SchemaTypes.d.ts +2 -0
  50. package/dist/types/ServerTypes.d.ts +11 -4
  51. package/dist/types/StoreTypes.d.ts +5 -1
  52. package/dist/types/StyleTypes.d.ts +20 -2
  53. package/package.json +42 -2
@@ -7,15 +7,22 @@
7
7
  * `focus-visible` is the focus ring a keyboard user needs and a mouse user does not; `focus-within` dresses a
8
8
  * container while anything inside it has focus — a field wrapper around its input.
9
9
  *
10
- * `current` is the link to the page being shown — the navigation item of where the visitor is. The link says so itself
11
- * (`aria-current="page"`, what a screen reader announces too), so a header written once in a layout marks the right item
12
- * on every page, which a class chosen per page could not.
10
+ * `current` is the chosen one of a set: the link to the page being shown (`aria-current`), the option pressed in a group
11
+ * of toggles (`aria-pressed`), the selected tab (`aria-selected`). The element says so itself — what a screen reader
12
+ * announces too — so a header written once in a layout marks the right item on every page, and a theme switch its
13
+ * chosen scheme, which a class chosen per page could not.
14
+ *
15
+ * `expanded` is the control that opens a panel while the panel is open — a dropdown's trigger, an accordion's header, a
16
+ * menu button (`aria-expanded`). The control says so itself, as the chosen one of a set does.
13
17
  *
14
18
  * `hidden` is not a pseudo-class: it is how an element looks while its `visible` says no — where it goes as it hides,
15
19
  * and where it comes from as it shows. With a transition on the class (`display` among what it transitions, and
16
20
  * `transition-behavior: allow-discrete`), a panel fades or slides in and out instead of blinking.
21
+ *
22
+ * `first`, `last`, `odd` and `even` are where the element sits among its siblings — the row of a list that has no
23
+ * divider above it, the alternate rows of a table. They count every sibling, as `:nth-child` does.
17
24
  */
18
- export declare const STYLE_STATES: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited", "current", "hidden"];
25
+ export declare const STYLE_STATES: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited", "current", "expanded", "hidden", "first", "last", "odd", "even"];
19
26
  /** What the SDK puts on an element whose `visible` says no: `display: none`, and what the `hidden` state selects. */
20
27
  export declare const HIDDEN_CLASS = "plitzi-component--hidden";
21
28
  export declare const STYLE_STATE_LABELS: Record<(typeof STYLE_STATES)[number], string>;
@@ -25,11 +32,20 @@ export declare const isKnownState: (state: string) => state is (typeof STYLE_STA
25
32
  * A state outside the list keeps its place after the known ones.
26
33
  */
27
34
  export declare const inCascadeOrder: <T>(states: Record<string, T>) => [string, T][];
28
- /** What a link to the page being shown carries, and what the `current` state selects. */
29
- export declare const CURRENT_PAGE_SELECTOR = "[aria-current=\"page\"]";
30
35
  /**
31
- * How a state is written after the selector it modifies: its pseudo-class — or, for `hidden`, the class that hides, and
32
- * for `current`, the attribute a link to this page carries.
36
+ * What the `current` state selects: whatever says it is the chosen one of its set — a link to the page being shown or
37
+ * any other `aria-current` but `false`, a pressed toggle, a selected tab, and the tab panel on show (the SDK hides the
38
+ * others with `hidden`). `aria-pressed="false"` on the options not chosen is what keeps them out.
39
+ *
40
+ * Its heaviest alternative weighs two attributes, so a class's `current` (0,3,0) wins over its `hover` (0,2,0) wherever
41
+ * they are written: a new alternative must weigh no more than that, or every `current` rule gets heavier with it.
42
+ */
43
+ export declare const CURRENT_SELECTOR = ":is([aria-current]:not([aria-current=\"false\"]),[aria-pressed=\"true\"],[aria-selected=\"true\"],[role=\"tabpanel\"]:not([hidden]))";
44
+ /** What the `expanded` state selects: the control whose panel is open. */
45
+ export declare const EXPANDED_SELECTOR = "[aria-expanded=\"true\"]";
46
+ /**
47
+ * How a state is written after the selector it modifies: its pseudo-class — or, for `hidden`, the class that hides; for
48
+ * `current` and `expanded`, the attributes the element carries; for where it sits, the structural pseudo-class.
33
49
  */
34
50
  export declare const stateSuffix: (state: string) => string;
35
51
  /**
@@ -37,3 +53,14 @@ export declare const stateSuffix: (state: string) => string;
37
53
  * fades out to nothing fades in from it — and every pseudo-class is not.
38
54
  */
39
55
  export declare const isStartingState: (state: string) => boolean;
56
+ /**
57
+ * The `ancestors` key of the element right around this one — its parent — whatever class it wears, or none.
58
+ *
59
+ * What a closed component's part reacts to: the icon inside a button turning while the button is `expanded`, a label
60
+ * lit while its link is `current`. Only the parent, never "any ancestor": every ancestor of a hovered element is
61
+ * hovered too, up to `<body>`, so a condition on "an ancestor in a state" without naming it would always hold. Written
62
+ * `:where(:state) > &` — one step up, no `:has()`. It takes states only: "inside a parent" with no state is always.
63
+ * Authored as `parent`; a class name can never be `>`, so the key cannot meet a class.
64
+ */
65
+ export declare const PARENT_ANCESTOR = ">";
66
+ export declare const isParentAncestor: (ancestor: string) => boolean;
@@ -9,7 +9,12 @@ var e = [
9
9
  "checked",
10
10
  "visited",
11
11
  "current",
12
- "hidden"
12
+ "expanded",
13
+ "hidden",
14
+ "first",
15
+ "last",
16
+ "odd",
17
+ "even"
13
18
  ], t = "plitzi-component--hidden", n = {
14
19
  hover: "Hover",
15
20
  focus: "Focus",
@@ -19,19 +24,37 @@ var e = [
19
24
  disabled: "Disabled",
20
25
  checked: "Checked",
21
26
  visited: "Visited",
22
- current: "Current page",
23
- hidden: "Hidden"
27
+ current: "Current",
28
+ expanded: "Expanded",
29
+ hidden: "Hidden",
30
+ first: "First child",
31
+ last: "Last child",
32
+ odd: "Odd child",
33
+ even: "Even child"
24
34
  }, r = {
25
- visited: 0,
26
- checked: 1,
27
- current: 2,
28
- "focus-within": 3,
29
- hover: 4,
30
- focus: 5,
31
- "focus-visible": 6,
32
- active: 7,
33
- disabled: 8,
34
- hidden: 9
35
- }, i = (e) => Object.hasOwn(r, e), a = (t) => i(t) ? r[t] : e.length, o = (e) => Object.entries(e).sort(([e], [t]) => a(e) - a(t)), s = "[aria-current=\"page\"]", c = (e) => e === "hidden" ? `.${t}` : e === "current" ? s : `:${e}`, l = (e) => e === "hidden";
35
+ odd: 0,
36
+ even: 1,
37
+ first: 2,
38
+ last: 3,
39
+ visited: 4,
40
+ checked: 5,
41
+ current: 6,
42
+ expanded: 7,
43
+ "focus-within": 8,
44
+ hover: 9,
45
+ focus: 10,
46
+ "focus-visible": 11,
47
+ active: 12,
48
+ disabled: 13,
49
+ hidden: 14
50
+ }, i = (e) => Object.hasOwn(r, e), a = (t) => i(t) ? r[t] : e.length, o = (e) => Object.entries(e).sort(([e], [t]) => a(e) - a(t)), s = ":is([aria-current]:not([aria-current=\"false\"]),[aria-pressed=\"true\"],[aria-selected=\"true\"],[role=\"tabpanel\"]:not([hidden]))", c = "[aria-expanded=\"true\"]", l = {
51
+ current: s,
52
+ expanded: c,
53
+ hidden: `.${t}`,
54
+ first: ":first-child",
55
+ last: ":last-child",
56
+ odd: ":nth-child(odd)",
57
+ even: ":nth-child(even)"
58
+ }, u = (e) => (i(e) ? l[e] : void 0) ?? `:${e}`, d = (e) => e === "hidden", f = ">", p = (e) => e === ">";
36
59
  //#endregion
37
- export { s as CURRENT_PAGE_SELECTOR, t as HIDDEN_CLASS, e as STYLE_STATES, n as STYLE_STATE_LABELS, o as inCascadeOrder, i as isKnownState, l as isStartingState, c as stateSuffix };
60
+ export { s as CURRENT_SELECTOR, c as EXPANDED_SELECTOR, t as HIDDEN_CLASS, f as PARENT_ANCESTOR, e as STYLE_STATES, n as STYLE_STATE_LABELS, o as inCascadeOrder, i as isKnownState, p as isParentAncestor, d as isStartingState, u as stateSuffix };
@@ -0,0 +1,23 @@
1
+ import { StyleBlock, StyleObject, StyleTarget } from '../types/StyleTypes';
2
+ /**
3
+ * Where in a selector's block an edit lands, read the same way by the store that writes it, the inspector that shows
4
+ * it and the inheritance that explains it — once, here, rather than once in each.
5
+ *
6
+ * The keys are walked by hand, not through a dotted path: an ancestor key (`>`) and a condition key
7
+ * (`container (max-width: 30.5rem)`) are not path segments any path parser accepts, and must not have to be.
8
+ */
9
+ /** The keys from a selector's block down to the rules a target addresses — `['variants', 'primary', 'states', 'hover']`. */
10
+ export declare const styleTargetKeys: (target: StyleTarget) => string[];
11
+ /**
12
+ * Why a target names no place a block has, or `undefined` when it names one: an ancestor's rules are not under a
13
+ * condition and draw no pseudo-element, a condition has no variants, and the parent (`>`) wears no variant.
14
+ */
15
+ export declare const styleTargetProblem: (target: StyleTarget) => string | undefined;
16
+ /** The value at `keys` under `root`, or `undefined` where any step is missing. */
17
+ export declare const valueAtKeys: (root: unknown, keys: readonly string[]) => unknown;
18
+ /** Writes `value` at `keys` under `root`, making every object on the way that is missing. */
19
+ export declare const setAtKeys: (root: Record<string, unknown>, keys: readonly string[], value: unknown) => void;
20
+ /** Whether a value is one set of rules: properties with a string or a number each. */
21
+ export declare const isStyleRules: (value: unknown) => value is StyleObject;
22
+ /** The rules a target addresses in a block, or `undefined` when the block has none there. */
23
+ export declare const styleTargetRules: (block: StyleBlock | undefined, target: StyleTarget) => StyleObject | undefined;
@@ -0,0 +1,35 @@
1
+ import { canonicalCondition as e } from "./styleConditions.mjs";
2
+ import { isStylePseudo as t } from "./stylePseudos.mjs";
3
+ import { isParentAncestor as n } from "./styleStates.mjs";
4
+ //#region src/style/styleTarget.ts
5
+ var r = (e) => {
6
+ let t = [];
7
+ return e.styleAncestor ? t.push("ancestors", e.styleAncestor) : e.styleCondition && t.push("conditions", e.styleCondition), e.styleVariant && t.push("variants", e.styleVariant), e.stylePseudo && t.push("pseudos", e.stylePseudo), t.push(...e.styleState ? ["states", e.styleState] : ["default"]), t;
8
+ }, i = (r) => {
9
+ if (r.styleAncestor && r.styleCondition) return "an ancestor condition cannot also be under a condition";
10
+ if (r.styleAncestor && r.stylePseudo) return "a pseudo-element has no ancestor conditions of its own";
11
+ if (r.styleCondition && r.styleVariant) return "a condition holds the class’s own rules, not its variants’";
12
+ if (r.styleCondition && e(r.styleCondition) !== r.styleCondition) return `"${r.styleCondition}" is not a condition`;
13
+ if (r.stylePseudo && !t(r.stylePseudo)) return `"${String(r.stylePseudo)}" is not a pseudo-element`;
14
+ if (r.styleAncestor && n(r.styleAncestor) && r.styleVariant) return "the element around it is named by its state, never by a variant";
15
+ }, a = (e) => typeof e == "object" && !!e && !Array.isArray(e), o = (e, t) => {
16
+ let n = e;
17
+ for (let e of t) {
18
+ if (!a(n) || !Object.hasOwn(n, e)) return;
19
+ n = n[e];
20
+ }
21
+ return n;
22
+ }, s = (e, t, n) => {
23
+ let r = e;
24
+ t.slice(0, -1).forEach((e) => {
25
+ let t = r[e], n = a(t) ? t : {};
26
+ r[e] = n, r = n;
27
+ });
28
+ let i = t.at(-1);
29
+ i !== void 0 && (r[i] = n);
30
+ }, c = (e) => a(e) && Object.values(e).every((e) => typeof e == "string" || typeof e == "number"), l = (e, t) => {
31
+ let n = o(e, r(t));
32
+ return c(n) ? n : void 0;
33
+ };
34
+ //#endregion
35
+ export { c as isStyleRules, s as setAtKeys, r as styleTargetKeys, i as styleTargetProblem, l as styleTargetRules, o as valueAtKeys };
@@ -77,6 +77,11 @@ export type AuthContextValue = {
77
77
  /** Report that the backend refused a credential — the `reason` from a 401. `expired` triggers a silent renewal,
78
78
  * anything terminal ends the session. This is how an app tells auth that reality moved on between checks. */
79
79
  invalidate: (reason?: AuthFailureReason) => void;
80
+ /**
81
+ * The provider this page signs in with: the space's `userProvider`, else the one the server that rendered it serves
82
+ * (`server.auth`). Empty when there is neither, and then a page offers no auth actions at all.
83
+ */
84
+ provider: string;
80
85
  state: AuthState;
81
86
  authenticated: boolean;
82
87
  user?: {
@@ -1,5 +1,6 @@
1
1
  import { User } from './AuthTypes';
2
2
  import { RealtimeTransport } from './RealtimeTypes';
3
+ import { Schema } from './SchemaTypes';
3
4
  import { SSRRenderResult, SSRRscData } from './ServerTypes';
4
5
  export type Environment = 'production' | 'staging' | 'development' | 'main';
5
6
  export type Server<T extends Record<string, unknown> = Record<string, unknown>> = {
@@ -30,8 +31,19 @@ export type Server<T extends Record<string, unknown> = Record<string, unknown>>
30
31
  /** Unix seconds the session token dies at, so a hydrated page schedules its renewal without decoding anything. */
31
32
  expiresAt?: number;
32
33
  };
34
+ /**
35
+ * How the server that rendered this page signs people in — see {@link ServerAuth}. Absent when it serves no
36
+ * sign-in of its own, and then only what the space declares counts.
37
+ */
38
+ auth?: ServerAuth;
33
39
  ssr?: ServerSSR;
34
40
  } & T;
41
+ /**
42
+ * The sign-in a page server serves, in the terms of the space settings it stands in for: a space that declares no
43
+ * `userProvider` signs in here, with nothing to declare. Whatever a space does declare wins, and a space that names
44
+ * another provider ignores this entirely — it describes a different backend.
45
+ */
46
+ export type ServerAuth = Required<Pick<Schema['settings'], 'userProvider' | 'loginUrl'>> & Pick<Schema['settings'], 'userUrl' | 'refreshUrl' | 'logoutUrl' | 'mfaUrl' | 'sessionHintCookie'>;
35
47
  /** What the rendering server hands over for THIS render, consumed once at the SDK root and not read from here again:
36
48
  * the RSC bootstrap is projected into the store (`rsc`), which is where the live payload lives from then on. The
37
49
  * rest of `Server` is long-lived configuration — endpoints, session — and stays readable anywhere. */
@@ -152,6 +152,8 @@ type SchemaVariableBase<TType extends string, TValue> = {
152
152
  }[];
153
153
  };
154
154
  export type SchemaVariable = SchemaVariableBase<'number', number> | SchemaVariableBase<'checkbox' | 'switch', boolean> | SchemaVariableBase<'text' | 'email' | 'password' | 'select' | 'select2' | 'textarea' | 'color', string>;
155
+ /** What a variable holds once resolved: a number, a switch's state or text. */
156
+ export type SchemaVariableValue = SchemaVariable['value'];
155
157
  /** A value a flag takes where its `when` matches. The first rule that matches decides. */
156
158
  export type SchemaFlagRule = {
157
159
  when: RuleGroup;
@@ -1,5 +1,5 @@
1
1
  import { ActionEmailConfig, ActionEntry, ActionJobQueue, ActionLimits, ActionRejectReason, ActionRunSummary, ActionRejectRecord, ActionRunRecord, ActionRunReport, ActionRunStatus, ActionTaskDescriptor, ActionTriggerType } from './ActionTypes';
2
- import { Environment } from './CommonTypes';
2
+ import { Environment, ServerAuth } from './CommonTypes';
3
3
  import { PluginDeclaration } from './ComponentTypes';
4
4
  import { ConnectorEntry } from './ConnectorTypes';
5
5
  import { DataDraft, DataSaveResult } from './DataTypes';
@@ -580,7 +580,7 @@ export type ActionLookupsConfig = {
580
580
  /**
581
581
  * The space's own data as of that revision — what a project keeps in `src/data/`, kept privately and frozen with each
582
582
  * publish — as its files' text by path (`products.json`). A provider resolved on the server whose `query` is
583
- * `/data/<file>` reads it, as `dataDir` reads a folder; no browser is answered it.
583
+ * `/data/<file>` reads it, and a function's `ctx.data`; no browser is answered it. Given none, `dataDir` is read.
584
584
  */
585
585
  getData?: (spaceId: number, at?: SpaceRevision) => Promise<unknown>;
586
586
  /** The feature flags the space declares as of that revision — what a flow reads as `{{ flags.<name> }}`. */
@@ -938,7 +938,8 @@ export type SSRServerConfig = {
938
938
  * The project's own data, never served as files: a provider resolved on the server (`runtime: 'server'`) whose
939
939
  * `query` is `/data/<file>` reads `<dataDir>/<file>`, and the page arrives with it. Nobody downloads the folder; what
940
940
  * a provider reads goes into the page it renders, though — data a page must not carry is a server action's to read,
941
- * answering only what is shown.
941
+ * answering only what is shown: a function reads it with `ctx.data('<file>')`. It is the space's data lookup
942
+ * (`action.lookups.getData`) when the deployment gives none.
942
943
  */
943
944
  dataDir?: string;
944
945
  static?: Record<string, string>;
@@ -978,6 +979,12 @@ export type SSRServerConfig = {
978
979
  * only with the `exchangeCredential` adapter, which is what turns what comes back into a session on this host.
979
980
  */
980
981
  signIn?: SSRSignInConfig;
982
+ /**
983
+ * The sign-in this server's pages are told about (`server.auth`), so a space that declares no `userProvider` signs
984
+ * in with nothing to declare. `createServer({ auth })` fills it from the kernel's `basePath`; name it yourself when
985
+ * the `/auth` flows are served by another host. The session hint cookie is added per request, named for the host.
986
+ */
987
+ pageAuth?: Omit<ServerAuth, 'sessionHintCookie'>;
981
988
  /** Naming and scope of the session cookies this server writes. See {@link SSRAuthCookie}. */
982
989
  authCookie?: SSRAuthCookie;
983
990
  templateFn?: SSRTemplateFn;
@@ -1183,7 +1190,7 @@ export type SSRServer = {
1183
1190
  readonly plugins: PluginRegistry;
1184
1191
  /**
1185
1192
  * With `devReload` on, every page open on this server loads again — what a project that authors its space in code
1186
- * calls once it wrote the new documents, instead of restarting the server. Nothing otherwise.
1193
+ * calls once it serves the new documents (`serveProject`), instead of restarting the server. Nothing otherwise.
1187
1194
  */
1188
1195
  reloadPages: () => void;
1189
1196
  /**
@@ -6,7 +6,7 @@ import { QueryParams, RouteParams } from './NavigationTypes';
6
6
  import { RealtimeTransport } from './RealtimeTypes';
7
7
  import { Schema, Element } from './SchemaTypes';
8
8
  import { SpaceConnector } from './SpaceTypes';
9
- import { DisplayMode, Style, StyleState } from './StyleTypes';
9
+ import { DisplayMode, Style, StylePseudo, StyleState } from './StyleTypes';
10
10
  import { ColorScheme, Theme } from './ThemeTypes';
11
11
  import { FlagOverrides, FlagResolution } from '../flags/resolveFlags';
12
12
  export type RuntimeSourceValues = {
@@ -259,6 +259,10 @@ export type BuilderState = CommonState & {
259
259
  styleState?: StyleState;
260
260
  /** The ancestor class being edited under: `styleState`/`styleVariant` are then its, and neither means always. */
261
261
  styleAncestor?: string;
262
+ /** The pseudo-element being edited (`before`, `placeholder`…) of whatever the other fields address. */
263
+ stylePseudo?: StylePseudo;
264
+ /** The condition being edited under (`motion-reduce`, a container query): the class's own rules, there. */
265
+ styleCondition?: string;
262
266
  elementHovered?: string;
263
267
  elementSelected?: string;
264
268
  /**
@@ -1,5 +1,6 @@
1
1
  import { ColorScheme, Theme } from './ThemeTypes';
2
2
  import { default as styleConstants } from '../style/styleConstants';
3
+ import { StylePseudo } from '../style/stylePseudos';
3
4
  import { STYLE_STATES } from '../style/styleStates';
4
5
  export type TagType = 'class' | 'element' | 'id';
5
6
  export type DisplayMode = 'desktop' | 'tablet' | 'mobile';
@@ -20,18 +21,33 @@ export type StyleVariableGroup = Record<string, StyleVariableValue>;
20
21
  export type StyleVariables = Record<StyleVariableCategory, StyleVariableGroup>;
21
22
  export type StyleObject = Partial<Record<StyleCategory, StyleValue>>;
22
23
  export type StyleStates = Partial<Record<StyleState, StyleObject>>;
23
- export type StyleVariants = Record<string, Omit<StyleBlock, 'variants' | 'ancestors'>>;
24
+ export type StyleStateBlock = {
25
+ default?: StyleObject;
26
+ states?: StyleStates;
27
+ };
28
+ export type { StylePseudo };
29
+ export type StylePseudos = Partial<Record<StylePseudo, StyleStateBlock>>;
30
+ export type StyleVariant = StyleStateBlock & {
31
+ pseudos?: StylePseudos;
32
+ };
33
+ export type StyleVariants = Record<string, StyleVariant>;
24
34
  export type StyleAncestor = {
25
35
  default?: StyleObject;
26
36
  states?: StyleStates;
27
- variants?: StyleVariants;
37
+ variants?: Record<string, StyleStateBlock>;
28
38
  };
29
39
  export type StyleAncestors = Record<string, StyleAncestor>;
40
+ export type StyleCondition = StyleStateBlock & {
41
+ pseudos?: StylePseudos;
42
+ };
43
+ export type StyleConditions = Record<string, StyleCondition>;
30
44
  export type StyleBlock = {
31
45
  default?: StyleObject;
32
46
  states?: StyleStates;
33
47
  variants?: StyleVariants;
34
48
  ancestors?: StyleAncestors;
49
+ pseudos?: StylePseudos;
50
+ conditions?: StyleConditions;
35
51
  };
36
52
  export type StyleTarget = {
37
53
  componentType?: string;
@@ -39,6 +55,8 @@ export type StyleTarget = {
39
55
  styleState?: StyleState;
40
56
  styleVariant?: string;
41
57
  styleAncestor?: string;
58
+ stylePseudo?: StylePseudo;
59
+ styleCondition?: string;
42
60
  };
43
61
  export type StyleAttributes = Record<string, StyleBlock>;
44
62
  export type StyleItem = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-shared",
3
- "version": "0.38.5",
3
+ "version": "0.38.7",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist",
@@ -186,6 +186,10 @@
186
186
  "types": "./dist/dataSource/hooks/useRegisterSource.d.ts",
187
187
  "import": "./dist/dataSource/hooks/useRegisterSource.mjs"
188
188
  },
189
+ "./dataSource/hooks/useResolvedVariables": {
190
+ "types": "./dist/dataSource/hooks/useResolvedVariables.d.ts",
191
+ "import": "./dist/dataSource/hooks/useResolvedVariables.mjs"
192
+ },
189
193
  "./dataSource/index": {
190
194
  "types": "./dist/dataSource/index.d.ts",
191
195
  "import": "./dist/dataSource/index.mjs"
@@ -1099,6 +1103,18 @@
1099
1103
  "types": "./dist/plugins/declaration.d.ts",
1100
1104
  "import": "./dist/plugins/declaration.mjs"
1101
1105
  },
1106
+ "./project/layout": {
1107
+ "types": "./dist/project/layout.d.ts",
1108
+ "import": "./dist/project/layout.mjs"
1109
+ },
1110
+ "./project/paths": {
1111
+ "types": "./dist/project/paths.d.ts",
1112
+ "import": "./dist/project/paths.mjs"
1113
+ },
1114
+ "./project/root": {
1115
+ "types": "./dist/project/root.d.ts",
1116
+ "import": "./dist/project/root.mjs"
1117
+ },
1102
1118
  "./queries": {
1103
1119
  "types": "./dist/queries/index.d.ts",
1104
1120
  "import": "./dist/queries/index.mjs"
@@ -1111,10 +1127,18 @@
1111
1127
  "types": "./dist/queries/queryCache.d.ts",
1112
1128
  "import": "./dist/queries/queryCache.mjs"
1113
1129
  },
1130
+ "./queries/serverQueries": {
1131
+ "types": "./dist/queries/serverQueries.d.ts",
1132
+ "import": "./dist/queries/serverQueries.mjs"
1133
+ },
1114
1134
  "./queries/useQuery": {
1115
1135
  "types": "./dist/queries/useQuery.d.ts",
1116
1136
  "import": "./dist/queries/useQuery.mjs"
1117
1137
  },
1138
+ "./queries/useServerQuery": {
1139
+ "types": "./dist/queries/useServerQuery.d.ts",
1140
+ "import": "./dist/queries/useServerQuery.mjs"
1141
+ },
1118
1142
  "./realtime": {
1119
1143
  "types": "./dist/realtime/index.d.ts",
1120
1144
  "import": "./dist/realtime/index.mjs"
@@ -1359,6 +1383,10 @@
1359
1383
  "types": "./dist/style/index.d.ts",
1360
1384
  "import": "./dist/style/index.mjs"
1361
1385
  },
1386
+ "./style/keyframes": {
1387
+ "types": "./dist/style/keyframes.d.ts",
1388
+ "import": "./dist/style/keyframes.mjs"
1389
+ },
1362
1390
  "./style/layoutGrid": {
1363
1391
  "types": "./dist/style/layoutGrid.d.ts",
1364
1392
  "import": "./dist/style/layoutGrid.mjs"
@@ -1375,14 +1403,26 @@
1375
1403
  "types": "./dist/style/snippetStyle.d.ts",
1376
1404
  "import": "./dist/style/snippetStyle.mjs"
1377
1405
  },
1406
+ "./style/styleConditions": {
1407
+ "types": "./dist/style/styleConditions.d.ts",
1408
+ "import": "./dist/style/styleConditions.mjs"
1409
+ },
1378
1410
  "./style/styleConstants": {
1379
1411
  "types": "./dist/style/styleConstants.d.ts",
1380
1412
  "import": "./dist/style/styleConstants.mjs"
1381
1413
  },
1414
+ "./style/stylePseudos": {
1415
+ "types": "./dist/style/stylePseudos.d.ts",
1416
+ "import": "./dist/style/stylePseudos.mjs"
1417
+ },
1382
1418
  "./style/styleStates": {
1383
1419
  "types": "./dist/style/styleStates.d.ts",
1384
1420
  "import": "./dist/style/styleStates.mjs"
1385
1421
  },
1422
+ "./style/styleTarget": {
1423
+ "types": "./dist/style/styleTarget.d.ts",
1424
+ "import": "./dist/style/styleTarget.mjs"
1425
+ },
1386
1426
  "./style/useDisplayMode": {
1387
1427
  "types": "./dist/style/useDisplayMode.d.ts",
1388
1428
  "import": "./dist/style/useDisplayMode.mjs"
@@ -1532,7 +1572,7 @@
1532
1572
  },
1533
1573
  "dependencies": {
1534
1574
  "@plitzi/nexus": "^1.4.0",
1535
- "@plitzi/plitzi-ui": "^1.6.31",
1575
+ "@plitzi/plitzi-ui": "^1.6.32",
1536
1576
  "date-fns": "^4.4.0",
1537
1577
  "immer": "^11.1.21",
1538
1578
  "zod": "^4.6.5"