@betorigami/game-ui-wheel

中文文档
1.2.0发布于 2026/11/05UNLICENSEDTypeScriptES Module近 30 天下载 3385

The Wheel game's Lit components and its GameUiModule for the Origami game host

原始使用文档
文档目录3 节
  1. Standalone bundle
  2. Dependencies
  3. Theming

@betorigami/game-ui-wheel

The Wheel game's Lit components and its GameUiModule. It is a library: importing it defines the Wheel elements and exports wheelUiModule and WheelGame, and the host that loads it registers the module.

import { registerGameUiModule } from '@betorigami/game-ui-shared';
import { wheelUiModule } from '@betorigami/game-ui-wheel';

registerGameUiModule(wheelUiModule);

Today @betorigami/games is that host and bundles this package with every other game. A standalone Wheel bundle later is the same three lines with only this module.

Standalone bundle

dist/standalone.mjs is the same package built as a deployable: the kit, the host element, Lit and this module in one file, self-registering. A page loads it in place of the games bundle to serve Wheel on its own:

<script type="module" src="https://cdn.jsdelivr.net/npm/@betorigami/game-ui-wheel@<version>/dist/standalone.min.mjs"></script>
<origami-game-provider-wrapper origamiGame="WHEEL" ...></origami-game-provider-wrapper>

A page loads either this or the games bundle, never both. The verifier's base URL is read from VITE_PROVABLY_FAIR_VERIFIER_URL at build time, as games does.

Dependencies

lit, @lit/context and big.js are peer dependencies: exactly one copy of each may exist on a page, and the host supplies it. @betorigami/game-ui-shared is an ordinary dependency, linked through the workspace and published as the exact kit version this package was released with; every kit release also releases this package and games on that same version, so a page still holds one kit. @betorigami/game-wheel and @betorigami/game-engine are ordinary dependencies, pinned to the same versions the server runs so the multipliers and probabilities the UI discloses are the ones the engine pays; a host must pin the same engine versions.

Theming

The wheel's colours are read from CSS custom properties named --wheel-color-*, whose defaults live in the hosted theme stylesheet (themes/default.css on the assets domain), not in this package. Partners override them there. --wheel-color-zero, and one property per prize slot letter, are the contract; see src/wheel.constants.ts for the full list.

版本与发布记录

@betorigami/game-ui-wheel 共发布 27 个版本,首次发布于 2026/09/21;过去 12 个月发布了 27 个版本。

版本发布日期距今
1.2.0latest2026/11/053 天前
0.0.0-sha-d520cd7-202611030454102026/11/035 天前
1.1.122026/11/026 天前
0.0.0-sha-aedb5e8-202610300624332026/10/309 天前
1.1.112026/10/309 天前
0.0.0-sha-712536a-202610300429522026/10/309 天前

其他发布通道:sha-94964ff → 0.0.0-sha-94964ff-20260921002349,sha-a527bdc → 0.0.0-sha-a527bdc-20260923045742,sha-293743d → 0.0.0-sha-293743d-20261021084321,sha-ce575e1 → 0.0.0-sha-ce575e1-20261021122434,sha-e149b3b → 0.0.0-sha-e149b3b-20261022004901,sha-a83a869 → 0.0.0-sha-a83a869-20261030040253。

关于 @betorigami/game-ui-wheel 的常见问题

@betorigami/game-ui-wheel 是什么?

The Wheel game's Lit components and its GameUiModule for the Origami game host

如何安装 @betorigami/game-ui-wheel?

在项目目录运行 npm install @betorigami/game-ui-wheel,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:lit(^3.3.0)、big.js(^7.0.1)、@lit/context(^1.1.5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@betorigami/game-ui-wheel 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@betorigami/game-ui-wheel 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@betorigami/game-ui-wheel 可以商用吗?

@betorigami/game-ui-wheel 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@betorigami/game-ui-wheel 的下载量有多少?

根据 npm 官方下载统计,@betorigami/game-ui-wheel 在 2026/10/08 – 2026/11/06 这 30 天内被下载 3,385 次,日均约 113 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@betorigami/game-ui-wheel 还在维护吗?

最新版本 1.2.0 发布于 2026/11/05(3 天前);至今共发布 27 个版本,其中过去 12 个月发布了 27 个;首次发布于 2026/09/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。