@fest-lib/lure

中文文档
0.1.92发布于 2026/11/10MITES Module近 30 天下载 2968

fest-lib LUR.E: reactive DOM (E/H/M/Q), form bind, overlays, drag

原始使用文档
文档目录5 节
  1. Install
  2. Factory map
  3. Triggers & overlays
  4. Also in the package
  5. Workspace

🌀 LUR.E

LUR.E

npm MIT stars

@fest-lib/lure — level 2 reactive DOM. Binds @fest-lib/object refs to real nodes (E, H, M, Q, T, C, S), forms, overlays, and drag. Web components and CSS-in-JS (S) are first-class.

core · dom · object · uniform
 └── fest/lure        ← you are here
      └── icon · image · veela · fl-ui

Install

npm install @fest-lib/core @fest-lib/dom @fest-lib/object @fest-lib/uniform @fest-lib/lure

Peers: core, dom, object, uniform (>=0.1.0). ESM, sideEffects: true.

import { E, H, M, Q, T } from "@fest-lib/lure";
import { observe, iterated } from "@fest-lib/object";

const el = E("div", {
    attributes: { id: "app" },
    classList: new Set(["box"]),
    style: { padding: "8px" },
    on: { click: () => console.log("hi") }
}, ["Hello"]);
document.body.append(el as Node);

Factory map

APIRole
E(tag | node, props, children)create / wrap + bind
H\html`/H("
")`
parse HTML or tagged template
M(list, mapFn)reactive list → nodes
Q(selector, root?)live query wrapper
T(string | ref)text node
C(ref, factory)swap node when ref changes
S\css``controllable stylesheet

H prefixes: attr:* attribute · prop:* property · on:* / @* event · ref / ref:* assign.

const items = iterated(["A", "B"]);
const list = H`<ul>${M(items, (x) => H`<li>${x}</li>`)}</ul>`;
items.push("C"); // DOM updates

Triggers & overlays

Use these instead of ad-hoc listeners:

import {
    withTriggerModifiers,
    bindOutsideDismiss,
    resolvePlacement,
    registerTransientOverlay
} from "@fest-lib/lure";
  • TriggerCore — once / debounce / prevent / stop / capture / passive via withTriggerModifiers and E({ on }) tuples.
  • bindOutsideDismiss — composed path, panel roots, Escape, idempotent cleanup.
  • resolvePlacement / placeOverlay — CSS-anchor with JS fallback.
  • registerTransientOverlay — same-kind overlays close LIFO.

Forms: formLink / bindForms / FormBinding (bindFormControl, formRef). Mount lifecycle is opt-in (bindWhileConnected).

import { bindDraggable } from "@fest-lib/lure";
bindDraggable(target, () => console.log("drag end"));

Also in the package

OPFS / file helpers (pickFile, saveFile, markdown asset bind), clipboard, history, scrollbar, voice input, theme / color engines. Subpath: @fest-lib/lure/markdown-assets. JSX: jsxFactory → createElement (@fest-lib/lure/src/lure/node/jsx-runtime).

Workspace

cd modules/projects/lur.e
npm test                 # linker, interaction, placement, overlay-host, trigger-core, form-binding
npm run demo
npm run build
npm run publish

Typedoc: npm run docs:md. License: MIT.

版本与发布记录

@fest-lib/lure 共发布 85 个版本,首次发布于 2026/08/07;过去 12 个月发布了 85 个版本。

版本发布日期距今
0.1.92latest2026/11/104 天前
0.1.912026/11/086 天前
0.1.902026/11/0311 天前
0.1.892026/11/0212 天前
0.1.882026/11/0113 天前
0.1.872026/10/3015 天前

关于 @fest-lib/lure 的常见问题

@fest-lib/lure 是什么?

fest-lib LUR.E: reactive DOM (E/H/M/Q), form bind, overlays, drag

如何安装 @fest-lib/lure?

在项目目录运行 npm install @fest-lib/lure,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@fest-lib/dom(>=0.1.0)、@fest-lib/core(>=0.1.0)、@fest-lib/object(>=0.1.0)、@fest-lib/uniform(>=0.1.0)、@fest-lib/style-lib(>=0.1.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fest-lib/lure 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fest-lib__lure 是否存在。

@fest-lib/lure 支持 ESM 还是 CommonJS?

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

@fest-lib/lure 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fest-lib/lure 可以商用吗?

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

@fest-lib/lure 的下载量有多少?

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

@fest-lib/lure 还在维护吗?

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