@cssints/css-grammar 0.3.1 → 0.5.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.
package/README.md CHANGED
@@ -148,7 +148,7 @@ export const Row = ({ wide, on }: { wide?: boolean; on?: boolean }) => (
148
148
 
149
149
  ### In a terminal
150
150
 
151
- `import * as css from "cssints/tui" with { type: "cssints" }` gives the members a terminal has (cells, colours, borders, flex, states, `cursor`), and the plugin compiles them to prop objects for [OpenTUI](https://opentui.com) renderables instead of classes; `@cssints/tui` applies their states and themes: [packages/tui](packages/tui/README.md), docs/API.md "TUI".
151
+ `import * as css from "cssints/tui" with { type: "cssints" }` gives the members a terminal has (cells, colours, borders, flex, states, `cursor`), and the plugin compiles them to prop objects for [OpenTUI](https://opentui.com) renderables instead of classes; `@cssints/tui` applies their states and themes: [packages/tui](packages/tui/README.md), docs/API.md "TUI". The package to apply them, `@cssints/tui`, is **deprecated** in favour of [cssints-native](https://github.com/alexeiaccio/cssints-native)'s `terminal/` target (Clay in cells, termbox2); its README says what carries over and how to run the replacement.
152
152
 
153
153
  More in [docs/API.md](docs/API.md): property names and short names, `flex()` and `grid()` chains, conditions and layers, tokens and themes, `cn` and `cv`, and the errors you can get.
154
154
 
@@ -181,6 +181,7 @@ and Cursor. The skills use it when it is configured and work without it.
181
181
  | `packages/css-grammar` | Type-level recognizer and its runtime twin over mdn-data grammars, Typed OM values, browser support and prose rules |
182
182
  | `packages/icons` | `@cssints/icons`: icons from iconify JSON collections or SVG folders, a mask style with no runtime |
183
183
  | `packages/mise-en-mode` | `@cssints/mise-en-mode`: looks as themes in the layers app < author < viewer, on `data-mode` scopes, checked against the tokens and by `check.contrast` |
184
+ | `packages/tui` | `@cssints/tui` (**deprecated**): the runtime of `cssints/tui` styles on OpenTUI and @bomb.sh/tty; cssints-native's `terminal/` replaces it |
184
185
  | `apps/demo` | React demo of every 0.1 feature |
185
186
  | `apps/docs` | The documentation site: this file and `docs/API.md` as pages, with search and type hovers (`cd apps/docs && bun run dev`) |
186
187
  | `docs/research`, `docs/archive` | Comparisons with other libraries; outdated plans |
@@ -191,7 +192,7 @@ and Cursor. The skills use it when it is configured and work without it.
191
192
  bun install
192
193
  bun run test # all packages (vp run -r test, cached where possible); includes the type-check of the code in docs/API.md and this file
193
194
  bun run bench # type instantiation budgets (tsc and tsgo)
194
- bun run check # format, lint, type-check (vp check), then the Effect diagnostics (bun run typecheck)
195
+ bun run check # format, lint, type-check (vp check), then tsc 7 with the Effect diagnostics (bun run typecheck)
195
196
  bun run diff:check # the added lines against master: anti-slop rules, key-file changes (tools/ai-automation)
196
197
  cd apps/demo && bun run dev
197
198
  cd apps/docs && bun run dev # the documentation site, on the pages of README.md and docs/API.md
package/dist/support.mjs CHANGED
@@ -58,7 +58,25 @@ function reach(syntax, seen = /* @__PURE__ */ new Set()) {
58
58
  }
59
59
  return seen;
60
60
  }
61
- const get = (key) => key.split(".").reduce((n, k) => n?.[k] ?? n?.[k.toLowerCase()], bcd);
61
+ const bcdGet = (key) => key.split(".").reduce((n, k) => n?.[k] ?? n?.[k.toLowerCase()], bcd);
62
+ const absent = (description) => ({ __compat: {
63
+ description,
64
+ support: Object.fromEntries([
65
+ "chrome",
66
+ "chrome_android",
67
+ "edge",
68
+ "firefox",
69
+ "firefox_android",
70
+ "safari",
71
+ "safari_ios",
72
+ "opera",
73
+ "opera_android",
74
+ "samsunginternet_android",
75
+ "webview_android"
76
+ ].map((b) => [b, { version_added: false }]))
77
+ } });
78
+ const OWN = /* @__PURE__ */ new Map([["css.types.gradient.mesh-gradient", absent("mesh-gradient()")], ["css.types.gradient.freeform-gradient", absent("freeform-gradient()")]]);
79
+ const get = (key) => bcdGet(key) ?? OWN.get(key);
62
80
  const lacks = (c, on, exact = false) => on.filter(([a, ver]) => !supports(c.support[BCD_NAME[a]], ver, exact));
63
81
  const lackingOf = (key, ts = current(), exact = false) => {
64
82
  const c = get(key)?.__compat;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cssints/css-grammar",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "description": "Type-level and runtime recognizer of CSS values over mdn-data grammars (the engine of cssints)",
5
5
  "license": "MIT",
6
6
  "repository": {