@csszyx/mcp-server 0.16.0 → 0.17.0

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 (2) hide show
  1. package/llms-full.txt +46 -9
  2. package/package.json +4 -4
package/llms-full.txt CHANGED
@@ -3905,6 +3905,27 @@ import { __szColorVar } from "csszyx/lite";
3905
3905
 
3906
3906
  ## Nested Element Routing — splitBox + class toolkit
3907
3907
 
3908
+ For className-only consumers, import `classify`, `has`, `pick`, `omit` and
3909
+ `splitBox` from `@csszyx/runtime/split`. The entry excludes sz-object adapters;
3910
+ ESM can tree-shake the main entry too, while CommonJS benefits from the narrower
3911
+ surface. The compiler dependency remains.
3912
+
3913
+ The supported vocabulary is atomic utilities. A multi-property custom
3914
+ `@utility card` is not classified: `pick` excludes it, `omit` retains it, and
3915
+ `splitBox` leaves it on the fallback node with a development warning unless
3916
+ explicitly placed. Use `splitBox('card p-4', { inner: ['card'] })` to place the
3917
+ whole class; no CSS declarations are split. Literal placement matches a whole
3918
+ base name, so `card` does not match `card-lg`. Use authored names when mangling.
3919
+ `{ outer: ['hidden'] }` matches every variant of `hidden`; naming `md:hidden`
3920
+ in a class placement list matches nothing and warns. Query helpers still
3921
+ require recognised selectors.
3922
+
3923
+ `scope` is the category for `group` and `peer`, including `group/item`. Both
3924
+ route outer: `group` supplies an ancestor and `peer` keeps its sibling position.
3925
+ The expanded vocabulary also recognises `placeholder-*` as inner and
3926
+ `start-*`/`end-*` as outer. These classes previously used the fallback, so
3927
+ review old routing assumptions and category-query expectations when upgrading.
3928
+
3908
3929
  When a caller passes one flat `className` to a component that renders nested elements, `splitBox` partitions it at the CSS box-model border line so each element gets the classes that act on it. Pure string functions, framework-agnostic. The class-token → box-role map is generated from the compiler's property tables (never drifts).
3909
3930
 
3910
3931
  ```tsx
@@ -3918,31 +3939,47 @@ import {
3918
3939
  stripSzProps,
3919
3940
  } from "@csszyx/runtime";
3920
3941
 
3921
- // Partition: outer = border-outward (margin/position/border/ring/sizing/bg/shadow/transform/visibility),
3922
- // inner = border-inward (padding/overflow/display/flex/grid/gap/text/interaction)
3942
+ // Partition: outer = border-outward (margin/position/border/ring/sizing/bg/shadow/transform/
3943
+ // visibility/overflow-hidden+clip/cursor/select/pointer-events/scroll-m/snap-start/align),
3944
+ // inner = border-inward (padding/overflow-auto+scroll/display/flex/grid/gap/text/divide/
3945
+ // perspective/transform-3d/resize/appearance)
3946
+ // Both: transition/duration/ease/delay are declared on BOTH nodes (a transition is inert until a
3947
+ // property changes, and the state that changes it can sit on either side).
3923
3948
  const { outer, inner } = splitBox("m-4 px-2 md:flex");
3924
3949
  // outer: "m-4" inner: "px-2 md:flex"
3925
3950
 
3951
+ // overflow routes by VALUE: hidden/clip clip the frame, auto/scroll scroll the content
3952
+ splitBox("overflow-hidden overflow-y-auto p-4");
3953
+ // outer: "overflow-hidden" inner: "overflow-y-auto p-4"
3954
+
3926
3955
  // Override any default per call (BoxSelector = box-role | category | class-prefix | { category: value })
3927
- splitBox("overflow-hidden p-4", { outer: ["overflow"] });
3928
- // outer: "overflow-hidden" inner: "p-4"
3956
+ splitBox("overflow-hidden p-4", { inner: ["overflow"] });
3957
+ // outer: "" inner: "overflow-hidden p-4"
3929
3958
 
3930
3959
  // Toolkit: csszyx owns the truth (box-role/category), your project owns the rule
3931
- classify("inset-ring-2"); // { role: 'inner', category: 'ring' }
3960
+ classify("inset-ring-2"); // { role: 'outer', category: 'ring' }
3932
3961
  has("p-2 overflow-y-auto", "overflow"); // true
3933
3962
  pick("m-4 text-sm", "text"); // "text-sm"
3934
3963
  omit("p-2 overflow-y-auto flex", "overflow"); // "p-2 flex"
3935
3964
 
3936
- // A scroller scrolls only when the outer frame clips (project-owned dependency rule)
3937
- const dep = has(outer, { overflow: "hidden" }) ? "overflow-y-auto h-full" : "";
3965
+ // A scroll frame: the clip and the height land outer on their own; the plumbing that lets a
3966
+ // child inherit the frame's height is the component's own (min-h-0 defeats flex's min-height:auto)
3967
+ // frame: `${outer} flex flex-col min-h-0 overflow-hidden`
3968
+ // content: `${inner} flex-1 min-h-0 overflow-y-auto`
3938
3969
 
3939
3970
  // sz-OBJECT routing: splitBoxSz partitions an sz OBJECT (not a className) into
3940
3971
  // { outer, inner } sz objects — keeps a szv-based component sz-native and routes
3941
3972
  // each key to the same side its class would (splitBoxSz(x) ≡ splitBox(compile(x))).
3942
3973
  splitBoxSz({ m: 4, px: 2 }); // { outer: { m: 4 }, inner: { px: 2 } }
3943
3974
  splitBoxSz({ gap: 2, hover: { px: 1 }, md: { m: 4 } }); // variants route by inner prop; split when they disagree
3944
- splitBoxSz({ grow: 2, self: "center" }, { outer: ["grow", "self"] }); // force flex-item utils to the frame
3945
- // classifySzKey(key) / hasSz / pickSz / omitSz the sz-object toolkit twins
3975
+ splitBoxSz({ grow: 2, self: "center" }, { inner: ["grow", "self"] }); // item utils (grow/order/self/col-span) are OUTER by default; this forces them back to the content
3976
+ // Placement lists can pin a whole literal variant key, preserving its contents.
3977
+ splitBoxSz({ hover: { p: 2, m: 4 } }, { outer: ["hover"] });
3978
+ // { outer: { hover: { p: 2, m: 4 } }, inner: {} }
3979
+ // Literal keys such as "[&:hover]" work too; inner wins if both lists name it.
3980
+ splitBoxSz({ overflow: "hidden", p: 4 }); // { outer: { overflow: 'hidden' }, inner: { p: 4 } }
3981
+ // classifySzKey(key, value?) / hasSz / pickSz / omitSz — the sz-object toolkit twins
3982
+ // (pass the value for a key whose side depends on it: classifySzKey('overflow', 'hidden') → outer)
3946
3983
 
3947
3984
  // stripSzProps: drop sz before forwarding ...rest to the DOM (guards uncompiled files
3948
3985
  // whose raw sz would leak as sz="[object Object]"; dev-warns once on a raw-object sz)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/mcp-server",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Model Context Protocol (MCP) server for csszyx — enables AI agents to understand and generate sz props",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,9 +28,9 @@
28
28
  "node": "^22.18.0 || >=24.11.0"
29
29
  },
30
30
  "dependencies": {
31
- "@csszyx/cli": "0.16.0",
32
- "@csszyx/compiler": "0.16.0",
33
- "@csszyx/unplugin": "0.16.0",
31
+ "@csszyx/cli": "0.17.0",
32
+ "@csszyx/compiler": "0.17.0",
33
+ "@csszyx/unplugin": "0.17.0",
34
34
  "@modelcontextprotocol/sdk": "^1.30.0",
35
35
  "zod": "^4.4.3"
36
36
  },