@fayz-ai/plugin-tables

中文文档
0.15.8发布于 2026/11/11MITTypeScriptES Module近 30 天下载 9579

Fayz SDK — plugin-tables plugin

原始使用文档
文档目录5 节
  1. What's inside
  2. Install
  3. Usage
  4. Part of the Fayz SDK
  5. Roadmap & contributing

@fayz-ai/plugin-tables

A live floor plan for restaurants — seat, track, and turn tables in real time.

npm license

Status: beta — pre-1.0. Core surface is stable; some backend facets (see PLUGIN_PATTERNS.md) are still landing. APIs may change before 1.0.

Restaurants don't run on records — they run on the room. plugin-tables gives the food vertical a real floor plan: zones, tables, and live status (available, occupied, reserved, cleaning), with seat and close flows wired to your own backend. It's the difference between a generic CRM and software a host can actually work a Friday night on.

It snaps into a defineSaas app as the vertical surface for food. Configure zones, toggle reservations and session history, and hand the AI assistant the ability to answer "which tables are free?" or seat guests by table number — all permission-gated, all in the same app as bookings and payments.

What's inside

  • /tables route + nav entry (icon MapPin) with a live floor plan view
  • Zones — configurable defaults (Indoor, Outdoor, Bar) via defaultZones
  • Optional modules — reservations (off by default) and sessionHistory (on by default)
  • Lifecycle hooks — onTableSeated and onTableClosed to bridge sessions into your orders/payments
  • AI tools — getTableAvailability (read) and seatGuests (persist, tables:edit)
  • Settings tab — zone and floor-plan configuration via PluginSettingsPanel
  • Pluggable data layer — dataProvider option, with createFayzTablesProvider exported, or a built-in mock provider for local dev
  • Vertical scope — defaults to scope: 'vertical', with i18n locales included

Install

npm install @fayz-ai/plugin-tables

Peer deps: react, react-dom. Runtime deps: @fayz-ai/core, @fayz-ai/ui, @fayz-ai/admin, @fayz-ai/sdk.

Usage

import { defineSaas } from '@fayz-ai/admin'
import { createTablesPlugin } from '@fayz-ai/plugin-tables'

export const app = defineSaas({
  // ...
  plugins: [
    createTablesPlugin({
      modules: { reservations: true, sessionHistory: true },
      defaultZones: [
        { name: 'Indoor', color: '#3b82f6' },
        { name: 'Patio', color: '#22c55e' },
      ],
      onTableSeated: async (session) => createOrderFor(session),
      onTableClosed: async (session) => closeOrderFor(session),
    }),
  ],
})

Part of the Fayz SDK

One of the composable plugins for @fayz-ai/admin — this is the food vertical's room-management surface.

Roadmap & contributing

Built and evolving in the open. See the Fayz SDK roadmap for current gaps, missing features, and good first issues.

版本与发布记录

@fayz-ai/plugin-tables 共发布 96 个版本,首次发布于 2026/06/20;过去 12 个月发布了 96 个版本。

版本发布日期距今
0.15.8latest2026/11/112 天前
0.15.72026/11/113 天前
0.15.62026/11/113 天前
0.15.52026/11/067 天前
0.15.42026/11/068 天前
0.15.32026/11/068 天前

其他发布通道:next → 0.9.0-next.1,canary → 0.15.0-canary.20261028153856。

关于 @fayz-ai/plugin-tables 的常见问题

@fayz-ai/plugin-tables 是什么?

Fayz SDK — plugin-tables plugin

如何安装 @fayz-ai/plugin-tables?

在项目目录运行 npm install @fayz-ai/plugin-tables,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.0.0 || ^19.0.0)、sonner(^2.0.7)、zustand(^4.5.0 || ^5.0.0)、react-dom(^18.0.0 || ^19.0.0)、lucide-react(>=0.400.0 <1.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fayz-ai/plugin-tables 支持 TypeScript 吗?

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

@fayz-ai/plugin-tables 支持 ESM 还是 CommonJS?

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

@fayz-ai/plugin-tables 可以商用吗?

@fayz-ai/plugin-tables 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fayz-ai/plugin-tables 的下载量有多少?

根据 npm 官方下载统计,@fayz-ai/plugin-tables 在 2026/10/15 – 2026/11/13 这 30 天内被下载 9,579 次,日均约 319 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fayz-ai/plugin-tables 还在维护吗?

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