book-index-ui 0.2.21 → 0.2.23

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/dist/index.d.ts CHANGED
@@ -382,6 +382,24 @@ declare interface CatalogDivision {
382
382
  categories: CatalogCategory[];
383
383
  }
384
384
 
385
+ /**
386
+ * 文件名清洗:保留 ASCII 字母数字 + CJK 全范围。
387
+ *
388
+ * **必须与 Python 端 storage.py 的 _clean_name 保持一致**,否则同一个
389
+ * Work/Book 在两侧算路径会差字符 → find_file_by_id 静默 miss。
390
+ *
391
+ * 范围(与 Python 一致):
392
+ * - U+3400-U+4DBF CJK 扩展 A
393
+ * - U+4E00-U+9FFF CJK 基本(注意:旧版只到 U+9FA5)
394
+ * - U+F900-U+FAFF CJK 兼容汉字(U+F98C 歷 等历史字形)
395
+ * - U+20000-U+3134F SMP CJK 扩展 B-G
396
+ *
397
+ * 历史扫描 book-index-draft 发现 557 个文件名含 CJK 兼容字(U+F900+),
398
+ * 旧版正则只覆盖到 U+9FA5,会漏掉这些字 — 造成 TS 端算路径与 Python
399
+ * 写出的路径不一致。
400
+ */
401
+ export declare function cleanName(name: string): string;
402
+
385
403
  export declare const CollatedEdition: default_2.FC<CollatedEditionProps>;
386
404
 
387
405
  /** 整理本索引(卷列表) */
@@ -1400,6 +1418,9 @@ export declare interface LineageGraphNode {
1400
1418
  /** 分组 id(来自 work.version_graph.node_groups 或 hypothetical.group) */
1401
1419
  group?: string;
1402
1420
  note?: string;
1421
+ /** 节点上展示的描述(label 之外的副标题,如「繁本,早於嘉靖殘本,已佚」)。
1422
+ * 当前仅 hypothetical 节点透传 hypothetical.description;book 节点暂未使用。 */
1423
+ description?: string;
1403
1424
  /** 桥接节点:本身不在核心集,但为了保持核心节点间派生链不断而引入。
1404
1425
  * 视觉上应淡化(半透明、虚边框)。仅在 collection==='core' 模式下出现。 */
1405
1426
  bridge?: boolean;
@@ -2103,6 +2124,9 @@ declare interface SectionProps {
2103
2124
  children: default_2.ReactNode;
2104
2125
  }
2105
2126
 
2127
+ /** Deterministic hash — identical results in Python (h*31+ord(c)) & 0xFFFFFFFF */
2128
+ export declare function shardOf(id: string, n?: number): number;
2129
+
2106
2130
  export declare const SmartBidInput: default_2.FC<SmartBidInputProps>;
2107
2131
 
2108
2132
  declare interface SmartBidInputProps {
@@ -2228,6 +2252,9 @@ export declare interface VersionGraphGroup {
2228
2252
  export declare interface VersionGraphHypotheticalNode {
2229
2253
  id: string;
2230
2254
  label: string;
2255
+ /** 节点上展示的副标题/描述(如「繁本,早於嘉靖殘本,已佚」)。
2256
+ * 与 note(学术依据/长说明)区分:description 紧跟在 label 下方显示。 */
2257
+ description?: string;
2231
2258
  year?: number;
2232
2259
  /** 当 year 不明而只有区间时使用 */
2233
2260
  year_range?: [number, number];