@pieai/swimmer-ui-kit 3.1.0 → 3.2.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/CHANGELOG.md +15 -1
- package/README.md +1 -1
- package/dist/{GameAvatar-CRJ1r8l5.js → GameAvatar-Cs5KVYFf.js} +4 -1
- package/dist/{GameStageTile-F41PxXDG.js → GameStageTile-BtBb8NEw.js} +1 -1
- package/dist/index.d.ts +56 -0
- package/dist/index.js +419 -212
- package/dist/liquid-presence.js +1 -1
- package/dist/preview.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,20 @@ Format: [Keep a Changelog](https://keepachangelog.com); versioning: semver.
|
|
|
5
5
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
|
-
## 3.
|
|
8
|
+
## 3.2.0 — 本地候选(2026-10-10,待发布到 latest)
|
|
9
|
+
|
|
10
|
+
- 新增 `GameHelpCard`:帮助的第二级。悬停(经过 `openDelay`,默认 200 毫秒)、键盘聚焦或点按后打开一张小卡片,含一个标题、一到三行正文(`\n` 换行)、可选的循环短演示和“完整指南”链接;一到四个主题时用页签切换。卡片的可访问名称由 `label` 提供,触发器获得 `aria-expanded` 与 `aria-controls`。
|
|
11
|
+
- 行为:鼠标指针可移入卡片切换页签或点击链接,离开约 150 毫秒后关闭;键盘 Tab 进入卡片,Escape 关闭并回到触发器,焦点不被抢走;触摸的第一次点按只打开卡片、阻止触发器动作,第二次点按才执行,点击卡片外关闭。
|
|
12
|
+
- 媒体只在卡片第一次打开、并且所在主题被选中时才请求;视频静音、循环,只在可见时播放;系统要求减少动态时不自动播放,显示 `poster`。`width` / `height` 预留位置,打开时不跳动;`alt` 作为媒体的可访问文字。
|
|
13
|
+
- 卡片经门户离开触发器的主题子树后,会复制触发器所在的 `data-game-ui-theme` / `data-game-ui-style` 与主题级 `--game-ui-*` 令牌,并在它们变化时同步;深色与风格因此与触发器一致。卡片自己的圆角不被继承。
|
|
14
|
+
- 与 `GameTooltip` 一样使用静止水滴,不使用液体引擎或 LiquidPopover,因此不进入液体预算。公开名字新增 `GameHelpCard`、`GameHelpCardProps`、`GameHelpCardTopic`、`GameHelpMedia`;没有删除或改名。
|
|
15
|
+
- 根入口体积:153,482 字节(gzip 44,908)增至 158,197 字节(gzip 46,152),增加 4,715 字节(约 4.6 KB,minified)。
|
|
16
|
+
- 组件选择指南新增“帮助提示怎么选”,列出四级帮助及不适合放进帮助卡的内容;接口清单与迁移表由生成器更新,根入口为 133 个名字(56 个值、77 个类型)。
|
|
17
|
+
- `GameAccountMenu` 的页签在 360 像素面板内保持一行:三个页签等宽(`flex: 1 1 0`),标签单行并以省略号截断,未选中的页签不再为隐藏的对勾预留宽度。页签文字包在 `GameTabs` 的 `game-ui-tab-label` 内,公开接口不变。新增 360 像素布局测试。
|
|
18
|
+
- `GameAccountMenu` 的选中页签文字:在六种风格与两种明暗下,选中页签文字与其填充的对比度均不低于 6.8:1,并由新增的对比度测试守护。本仓库的故事与浏览器检查没有复现文字不可见;若产品仍遇到,请提供风格、明暗与页面结构,不需要产品覆写。
|
|
19
|
+
- 版本号改为 3.2.0。发布前 npm `latest` 为 3.1.0,`next` 为 3.0.0-rc.3。
|
|
20
|
+
|
|
21
|
+
## 3.1.0 — 已发布到 npm latest(2026-10-10)
|
|
9
22
|
|
|
10
23
|
- 新增 `GameAccountMenu`:登录后的共享账号入口,从 `@pieai/swimmer-ui-kit/liquid-presence` 导入。头像与名字是 sm 次要按钮;点击打开一个液体面板,含产品提供的站内内容、全部产品列表(当前产品为纯文字,其余为真实链接)和账号页签(管理账号与安全、退出登录)。只有账号页签时不显示页签条。
|
|
11
24
|
- 产品拥有用户、产品列表、目的地址和所有登录、退出动作;组件不联网、不存储、不做认证。退出按钮处理中显示 `pending` 但不禁用,组件忽略处理中的重复点击。头像只渲染 https 图片,否则显示首字母。
|
|
@@ -13,6 +26,7 @@ Format: [Keep a Changelog](https://keepachangelog.com); versioning: semver.
|
|
|
13
26
|
- `GameTooltip` 新增可选 `align`(center / start / end)与 `placement`(top / bottom),向后兼容:默认仍居中于上方。长标签在 280px 内换行,标签中的换行保留。
|
|
14
27
|
- 根入口公开名字不变(129 个);迁移表与接口清单由生成器更新。`GameAccountMenu` 与其三个类型只从 liquid-presence 入口公开。没有删除或改名。
|
|
15
28
|
- 版本号改为 3.1.0;发布前 npm `latest` 为 3.0.0,`next` 为 3.0.0-rc.3。
|
|
29
|
+
- 发布记录:2026-10-10 16:19(+08)由 Claude 发布到 npm `latest`,发布的 tarball 为本地候选 `.scratch/release-3.1.0/swimmer-ui-kit-3.1.0.tgz`,SHA-256 `1954dd118ce94caba0d07aeed656dd48e668a5036894b0133e726af5cb9bdd28`。只读核对:registry 的 sha512 完整性与该候选一致;`latest` 为 3.1.0,`next` 为 3.0.0-rc.3。
|
|
16
30
|
|
|
17
31
|
## 3.0.0 — 已发布到 npm latest(2026-10-10)
|
|
18
32
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Swimmer 的共享 React UI:普通控件是平面水滴,主线 CTA 是潮汐液体。支持六套风格与独立明暗,表单、焦点、键盘和编辑内容仍由原生 DOM 承接。它不拥有产品数据、模型调用、账号验证或支付。
|
|
4
4
|
|
|
5
|
-
**3.0.0 已发布到 npm latest(2026-10-10
|
|
5
|
+
**3.0.0 与 3.1.0 已发布到 npm latest(3.1.0 于 2026-10-10 发布,新增账号菜单与 GameTooltip 位置选项)。3.2.0 为本地候选(新增 GameHelpCard),待发布到 npm latest;发布前 latest 仍为 3.1.0。** 3.0.0-rc.1 与 rc.3 已发布到 npm next。现有产品继续锁定精确版本;主动升级先读[迁移表](docs/reference/migration-3.0.md),发布证据见[当前工作](docs/reference/execution/current-work.md)。本仓库不自动升级任何产品。
|
|
6
6
|
|
|
7
7
|
## 安装与最小使用
|
|
8
8
|
|
|
@@ -866,7 +866,10 @@ function le({ activeId: e, id: t, onSelect: n, tabs: r, hue: i, orientation: a =
|
|
|
866
866
|
"data-game-ui-paint": "",
|
|
867
867
|
children: [
|
|
868
868
|
/* @__PURE__ */ h(Y, {}),
|
|
869
|
-
|
|
869
|
+
/* @__PURE__ */ h("span", {
|
|
870
|
+
className: "game-ui-tab-label",
|
|
871
|
+
children: t.label
|
|
872
|
+
}),
|
|
870
873
|
/* @__PURE__ */ h(X, {})
|
|
871
874
|
]
|
|
872
875
|
}, t.id))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { A as e, D as t, E as n, F as r, M as i, N as a, O as o, P as s, T as c, a as l, j as u, w as d } from "./LiquidGroup-RTK_Uvgw.js";
|
|
3
|
-
import { a as f, c as p, d as m, i as h, l as g, n as _, o as v, s as y, u as b } from "./GameAvatar-
|
|
3
|
+
import { a as f, c as p, d as m, i as h, l as g, n as _, o as v, s as y, u as b } from "./GameAvatar-Cs5KVYFf.js";
|
|
4
4
|
import { A as x, B as S, C, D as w, E as ee, F as te, G as ne, H as re, I as ie, J as ae, K as oe, L as se, M as ce, N as le, O as ue, P as de, R as T, S as E, T as D, U as O, V as k, W as A, _ as j, a as M, b as N, c as P, d as F, f as I, g as L, h as R, i as z, j as B, k as V, l as H, m as fe, n as pe, o as me, p as he, q as ge, r as _e, s as ve, t as ye, u as be, v as xe, w as Se, x as Ce, y as we, z as Te } from "./paths-B7D0h7Mh.js";
|
|
5
5
|
import { cloneElement as Ee, forwardRef as U, isValidElement as De, useId as W, useLayoutEffect as G, useRef as K, useState as q } from "react";
|
|
6
6
|
import { jsx as J, jsxs as Y } from "react/jsx-runtime";
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { ForwardRefExoticComponent } from 'react';
|
|
|
6
6
|
import { HTMLAttributes } from 'react';
|
|
7
7
|
import { InputHTMLAttributes } from 'react';
|
|
8
8
|
import { JSX } from 'react';
|
|
9
|
+
import { ReactElement } from 'react';
|
|
9
10
|
import { ReactNode } from 'react';
|
|
10
11
|
import { Ref } from 'react';
|
|
11
12
|
import { RefAttributes } from 'react';
|
|
@@ -691,6 +692,61 @@ export declare interface GameFieldProps {
|
|
|
691
692
|
className?: string;
|
|
692
693
|
}
|
|
693
694
|
|
|
695
|
+
/**
|
|
696
|
+
* A non-modal hover/focus/tap card that teaches one short idea. Floating UI owns
|
|
697
|
+
* collision, hover intent, focus order and dismissal, as in GameHelpTip. The
|
|
698
|
+
* card is portalled into the closest native dialog and built on the static
|
|
699
|
+
* droplet surface, so it adds no liquid engine and no LiquidPopover.
|
|
700
|
+
*/
|
|
701
|
+
export declare function GameHelpCard({ children, label, topics, link, placement, align, openDelay, }: GameHelpCardProps): ReactNode;
|
|
702
|
+
|
|
703
|
+
export declare interface GameHelpCardProps {
|
|
704
|
+
/** One focusable trigger element (e.g. a GameIconButton link or button). */
|
|
705
|
+
children: ReactElement;
|
|
706
|
+
/** Accessible name of the card, e.g. "怎么用". */
|
|
707
|
+
label: string;
|
|
708
|
+
/** 1 to 4 topics; more than one shows tabs. */
|
|
709
|
+
topics: readonly GameHelpCardTopic[];
|
|
710
|
+
/** Optional link at the bottom, e.g. the full guide. */
|
|
711
|
+
link?: {
|
|
712
|
+
href: string;
|
|
713
|
+
label: string;
|
|
714
|
+
};
|
|
715
|
+
placement?: 'top' | 'bottom';
|
|
716
|
+
align?: 'start' | 'center' | 'end';
|
|
717
|
+
/** Hover intent delay in ms; default 200. */
|
|
718
|
+
openDelay?: number;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export declare interface GameHelpCardTopic {
|
|
722
|
+
id: string;
|
|
723
|
+
/** Tab label when there are several topics. */
|
|
724
|
+
label: string;
|
|
725
|
+
title: string;
|
|
726
|
+
/** 1–3 short lines; "\n" breaks a line. */
|
|
727
|
+
body: string;
|
|
728
|
+
media?: GameHelpMedia;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
export declare type GameHelpMedia = {
|
|
732
|
+
kind: 'video';
|
|
733
|
+
/** Ordered sources, e.g. webm then mp4. */
|
|
734
|
+
sources: readonly {
|
|
735
|
+
src: string;
|
|
736
|
+
type: 'video/webm' | 'video/mp4';
|
|
737
|
+
}[];
|
|
738
|
+
poster: string;
|
|
739
|
+
alt: string;
|
|
740
|
+
width: number;
|
|
741
|
+
height: number;
|
|
742
|
+
} | {
|
|
743
|
+
kind: 'image';
|
|
744
|
+
src: string;
|
|
745
|
+
alt: string;
|
|
746
|
+
width: number;
|
|
747
|
+
height: number;
|
|
748
|
+
};
|
|
749
|
+
|
|
694
750
|
/** Optional help, not an action menu or a place to hide required information.
|
|
695
751
|
* Floating UI owns collision avoidance, hover/focus/click and dismissal. The
|
|
696
752
|
* native help button never submits its surrounding form. Inside a native modal
|