From 70b59dd3783baf0da208e6f172f83a31da352c0d Mon Sep 17 00:00:00 2001 From: DoodleBear Date: Thu, 1 Oct 2026 17:55:58 +0900 Subject: [PATCH] =?UTF-8?q?chore(release):=200.2.0=20=E2=80=94=20direction?= =?UTF-8?q?,=20and=20three=20defects=20it=20exposed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A MINOR bump, not a major: nothing a working consumer does today breaks. `OrderFn` gained an optional fifth parameter, so an existing four-argument order function still assigns cleanly and keeps meaning what it meant. `applyCssVars` now returns a boolean, which only matters to a caller that reads it. Two BEHAVIOURS changed in ways worth stating rather than burying: - The CSS renderer falls back to SVG for a motion it cannot express, instead of leaving the element empty. `columns` moves a highlight down a column and a per-dot `animation-delay` cannot do that; asking for CSS anyway used to yield a blank field. `handle.options.renderer` now reports `svg` — which is what is actually on screen — and `cssGap()` still says why. - A direction change re-ranks an already-mounted CSS field. It used to update the state and change nothing you could see. The changelog is split for this release: what is IN THE PACKAGE, what BEHAVIOUR CHANGED, and a short SITE section, because an npm reader should not have to wade through "the site is now Astro + React islands" to find out whether their code breaks. The per-PR entries stay as they are — they are the reasoning, and the summary is the contract. 249 tests, oxlint 0, registry ok. --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++ CHANGELOG.zh.md | 20 +++++++++++++++ apps/site/test/playground.test.tsx | 1 - packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/react/package.json | 2 +- 6 files changed, 63 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3040683..4333ceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,46 @@ ## [Unreleased] +## [0.2.0] — 2026-10-01 + +This release adds `direction` and fixes three defects the new option exposed. It is a minor +bump: nothing a working consumer does today breaks, and two behaviours changed in ways +worth stating. + +## What is in the package + +- **`direction` — every motion can be told which way to go.** `direction={["counterClockwise", +"insideOut"]}`. A list, because a row-major snake has two independent axes (which end of the + first row leads, and whether rows run top to bottom), and its four corners are four distinct + drawings — a single `reverse` flag could reach two of them. Read + `ORDER_DIRECTION_AXES[order]` to build a control: it is the table that says which axes an + order can honour, so a UI cannot offer a direction the engine would ignore. +- **`OrderFn` gained a fifth parameter, `dir?`.** Optional, so an existing four-argument order + function still assigns cleanly and keeps meaning what it meant. +- **`applyCssVars` now returns `boolean`** — whether the host still holds the cells these + options call for. Ignoring the return value is unaffected. + +## Behaviour changes + +- **The CSS renderer now falls back to SVG for a motion it cannot express**, instead of + leaving the element empty. `columns` moves a highlight down a column, which a per-dot + `animation-delay` cannot do. Asking for CSS anyway used to produce a blank field; you now + get the motion, painted as SVG, and `handle.options.renderer` reports `svg` — which is + what is actually on screen. `handle.cssGap()` still says why CSS was refused. +- **A direction change re-ranks an already-mounted CSS field.** It used to update the state + and change nothing you could see. Changing `--botui-o` in place shifts the wave without + restarting the animations; the host is rebuilt only when the cell set itself changes. +- **The stylesheet no longer emits `@keyframes` for a motion CSS cannot render.** The rule it + emitted for `columns` animated nothing at all — `spike` is a gaussian centred on the cycle + seam, so sampling it at 0 and 1 yields full brightness at both ends, a static fully-lit + field. Every consumer shipped a rule describing a motion the renderer had refused to draw. + +## Site + +The playground, the bilingual docs and the registry moved to Astro + React islands on +Cloudflare Pages. Site-only work — the copy-with-your-settings button, the colour picker, the +showcase defaults, and the layout fixes — does not appear in any package. + ### Changed - **Every motion can now be told which way to go.** `direction` is a list of axis tokens — `leftToRight`, `topToBottom`, `clockwise`, `outsideIn` and their opposites — and a spiral winds _and_ chooses an end, so `direction={["counterClockwise", "insideOut"]}` is one motion rather than two presets. It is a **list** because a row-major snake has two independent axes: which end of the first row leads, and whether the rows run top to bottom. Its four corners are four distinct drawings, and a single `reverse` flag could only ever reach two of them. The token names are relative to the motion rather than the screen, which is why `bottomToTop` flips a column-snake's travel but reverses a row-snake's rows. diff --git a/CHANGELOG.zh.md b/CHANGELOG.zh.md index f4c920a..36323c8 100644 --- a/CHANGELOG.zh.md +++ b/CHANGELOG.zh.md @@ -2,6 +2,26 @@ ## [Unreleased] +## [0.2.0] — 2026-10-01 + +本次发布加入 `direction`,并修复了新选项暴露出的三个缺陷。这是 minor 号:**现有使用者的任何用法都不会坏**,但有两处行为变化值得说明。 + +## 包内有什么 + +- **`direction` —— 每个动效都能指定行进方向。** `direction={["counterClockwise", "insideOut"]}`。之所以是列表,因为行优先蛇形有两个互相独立的轴(第一行从哪端开始、各行自上而下还是自下而上),它的四个角是四种不同图形 —— 单一的 `reverse` 开关只能到达两个。构建控件请读 `ORDER_DIRECTION_AXES[order]`:这张表说明每个 order 能兑现哪些轴,所以 UI 不会提供一个引擎会忽略的方向。 +- **`OrderFn` 新增第五个参数 `dir?`。** 可选,因此既有的四参数 order 函数仍能干净赋值,含义也不变。 +- **`applyCssVars` 现在返回 `boolean`** —— 表示 host 是否仍持有这些选项所要求的格子。忽略返回值不受影响。 + +## 行为变化 + +- **CSS 渲染器现在对无法表达的动效回退到 SVG**,而不是留一个空元素。`columns` 是把高亮沿着一列**移动**,每格 `animation-delay` 做不到这件事。此前无论如何要求 CSS 都会得到一个空白场;现在你拿到该动效、以 SVG 绘制,且 `handle.options.renderer` 报告 `svg` —— 也就是屏幕上真正在跑的东西。`handle.cssGap()` 仍会说明 CSS 为何被拒绝。 +- **改方向会就地重新排名已挂载的 CSS 场。** 此前它会更新状态而视觉毫无变化。就地改写 `--botui-o` 会平移波前而不重启动画;只有格子集本身变化时才重建 host。 +- **样式表不再为 CSS 无法渲染的动效输出 `@keyframes`。** 它此前为 `columns` 输出的那条规则**什么都不动** —— `spike` 是以周期接缝为中心的 gaussian,按 0 和 1 采样两端都是全亮度,也就是一块静止的全亮场。每个使用者都在携带一条描述"渲染器已拒绝绘制的动效"的规则。 + +## 站点 + +Playground、双语文档与 registry 迁到 Cloudflare Pages 上的 Astro + React islands。纯站点改动 —— 带设置复制的按钮、颜色拾取器、showcase 默认值、布局修复 —— 不出现在任何包里。 + ### 变更 - **每个动效现在都能指定行进方向。** `direction` 是一组轴 token —— `leftToRight`、`topToBottom`、`clockwise`、`outsideIn` 及各自反向 —— 而螺旋既能选缠绕方向也能选哪一端领先,所以 `direction={["counterClockwise", "insideOut"]}` 是一个动效,而不是两个 preset。它是**列表**,因为行优先的蛇形有两个互相独立的轴:第一行从哪端开始,以及各行是自上而下还是自下而上。它的四个角是四种不同的图形,而单一的 `reverse` 开关最多只能到达其中两个。token 名相对于动效而非屏幕 —— 这正是 `bottomToTop` 对列蛇形意味着翻转行进方向、而对行蛇形意味着翻转行序的原因。 diff --git a/apps/site/test/playground.test.tsx b/apps/site/test/playground.test.tsx index c209e57..75cf961 100644 --- a/apps/site/test/playground.test.tsx +++ b/apps/site/test/playground.test.tsx @@ -1135,7 +1135,6 @@ describe("the dot colour", () => { // A colour input fires `input` on every pointer move — far more often than the screen // refreshes. This is what makes dragging feel like the thing under your finger is the // thing on screen, and it is measurable: N events, one write. - const commits: string[] = []; act(() => { swatch().dispatchEvent(new window.Event("input", { bubbles: true })); setNativeValue(swatch(), "#111111"); diff --git a/packages/cli/package.json b/packages/cli/package.json index 71e625e..6fd2889 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@botharness/botui", - "version": "0.1.2", + "version": "0.2.0", "description": "Install BotUI components into your project — copy-and-own, like shadcn", "keywords": [ "agent-ui", diff --git a/packages/core/package.json b/packages/core/package.json index 5177784..d20118d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@botharness/botui-core", - "version": "0.1.2", + "version": "0.2.0", "description": "The framework-agnostic engine behind BotUI components", "keywords": [ "agent-ui", diff --git a/packages/react/package.json b/packages/react/package.json index 8120790..9a16696 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@botharness/botui-react", - "version": "0.1.2", + "version": "0.2.0", "description": "React bindings for BotUI components", "keywords": [ "agent-ui",