book-index-ui 0.43.0 → 0.44.1

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/README.md CHANGED
@@ -87,6 +87,20 @@ import 'book-index-ui/styles' // CSS(用到组件时引入)
87
87
 
88
88
  **`resolveImages` 要用 `useCallback`(或模块级函数)包一层**:组件按 `[resolveImages, 当前卷]` 重新取书影,每次渲染都传一个新函数会反复请求。
89
89
 
90
+ ### 正文实体标注(`EntityText`,overview#389)
91
+
92
+ 给一段正文和实体区间:人名、地名、官职等画直线专名线,书名画波浪线(书名号样式);已收录的实体是 `/item/<id>` 链接,悬停或聚焦弹出摘要卡(取法同详情页 `transport.getItem`),Esc 收起。
93
+
94
+ ```tsx
95
+ import { EntityText, adaptEntityJson } from 'book-index-ui';
96
+
97
+ const spans = adaptEntityJson(entityJson); // entity.json → EntitySpan[];格式定稿后只改这一层
98
+ <EntityText text={paragraph} entities={spans} offsets="plain" plainBase={0}
99
+ transport={storage} onNavigate={(id, e) => { e.preventDefault(); router.push(`/item/${id}`); }} />
100
+ ```
101
+
102
+ entity.json 的 `span` 是**纯字**偏移(不计标点空白),配 `offsets="plain"`;正文只是整卷一段时用 `plainBase` 给出本段起点。`book-index://Work/<id>` 等 URI 由 `bookIndexUriToId` 转站内 id。一页铺很多段时设 `injectStyles={false}`,在页面上放一次 `<style>{ENTITY_TEXT_CSS}</style>`。
103
+
90
104
  ### 数据层(`book-index-ui/storage`)
91
105
 
92
106
  | 类 | 用途 |
@@ -264,6 +264,30 @@
264
264
  /* ==== 阅读器(整理本 / 全文) ==== */
265
265
  /* 宿主吸顶导航的高度:阅读器工具条、目录与书影侧栏在它下面吸顶(如 60px) */
266
266
  --bim-reader-top: 0px;
267
+ /* 古籍矫正底本书影画布底色 */
268
+ --bim-warp-bg: #faf8f5;
269
+ /* 古籍底本书影浮雕阴影 */
270
+ --bim-warp-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
271
+ /* 古籍对读字框选中高亮底色 */
272
+ --bim-warp-sel-bg: rgba(196, 148, 76, 0.45);
273
+ /* 古籍对读字框选中描边 */
274
+ --bim-warp-sel-stroke: #a06e1c;
275
+ /* 古籍对读字框悬停高亮底色 */
276
+ --bim-warp-hover-bg: rgba(217, 185, 106, 0.25);
277
+ /* 古籍对读字框悬停描边 */
278
+ --bim-warp-hover-stroke: #c4944c;
279
+ /* 图文对读徽章背景 */
280
+ --bim-warp-badge-bg: rgba(184, 134, 54, 0.12);
281
+ /* 图文对读徽章文字颜色 */
282
+ --bim-warp-badge-fg: #8c6820;
283
+ /* 图文对读徽章边框 */
284
+ --bim-warp-badge-bd: rgba(184, 134, 54, 0.3);
285
+ /* 版心分界线 */
286
+ --bim-warp-banxin-border: #8a8070;
287
+ /* 版心中缝对折线 */
288
+ --bim-warp-banxin-fold: rgba(160, 110, 28, 0.65);
289
+ /* 版心外边线 */
290
+ --bim-warp-banxin-outer: #c9c3b4;
267
291
 
268
292
  /* ==== 反馈浮钮(2026-09-28 Q5) ==== */
269
293
  /* 层级:低于页面抽屉、弹层(本包对话框为 1000) */