book-index-ui 0.2.19 → 0.2.21

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
@@ -250,9 +250,10 @@ export declare function buildId(status: IndexStatus, type: IndexType, timestamp:
250
250
  *
251
251
  * @param work - WorkDetailData(须有 version_graph.enabled === true 才有效)
252
252
  * @param books - 与该 Work 关联的 Book 详情数组(应已加载 lineage 字段)
253
+ * @param collection - 'core' | 'all',缺省按 vg.default_collection 或 'all'
253
254
  * @returns LineageGraph,未启用或无数据时返回空图
254
255
  */
255
- export declare function buildLineageGraph(work: WorkDetailData, books: BookDetailData[]): LineageGraph;
256
+ export declare function buildLineageGraph(work: WorkDetailData, books: BookDetailData[], collection?: 'core' | 'all'): LineageGraph;
256
257
 
257
258
  /**
258
259
  * Bundle 只读 Storage 实现
@@ -1399,6 +1400,9 @@ export declare interface LineageGraphNode {
1399
1400
  /** 分组 id(来自 work.version_graph.node_groups 或 hypothetical.group) */
1400
1401
  group?: string;
1401
1402
  note?: string;
1403
+ /** 桥接节点:本身不在核心集,但为了保持核心节点间派生链不断而引入。
1404
+ * 视觉上应淡化(半透明、虚边框)。仅在 collection==='core' 模式下出现。 */
1405
+ bridge?: boolean;
1402
1406
  }
1403
1407
 
1404
1408
  /** ref_type:派生来源是其他 Book 还是假想节点 */
@@ -2199,6 +2203,17 @@ export declare interface VersionGraph {
2199
2203
  /** Work.books 里但不进图的条目(如待 dedupe 的占位) */
2200
2204
  excluded_books?: string[];
2201
2205
  excluded_reason?: string;
2206
+ /** 集合化展示(核心 vs 完整):版本繁多的复杂作品(如水浒)适用 */
2207
+ default_collection?: 'core' | 'all';
2208
+ /** 各集合的标签和说明 */
2209
+ collections?: Record<string, {
2210
+ label: string;
2211
+ description?: string;
2212
+ }>;
2213
+ /** 核心集合包含的 book id 列表(缺省时即等同 all) */
2214
+ core_books?: string[];
2215
+ /** 核心集合包含的假想节点 id 列表(缺省时全部假想节点都在核心集) */
2216
+ core_hypotheticals?: string[];
2202
2217
  }
2203
2218
 
2204
2219
  /** Work.version_graph.groups[i] —— 分组/泳道 */
@@ -2281,6 +2296,26 @@ export declare interface VersionLineageViewProps {
2281
2296
  selectedNodeId?: string;
2282
2297
  /** 模式切换回调(用于更新URL) */
2283
2298
  onModeChange?: (mode: 'list' | 'graph') => void;
2299
+ /** 集合切换:'core'(核心)/ 'all'(完整)。仅当 collectionsAvailable 为真时才显示 toggle */
2300
+ collection?: 'core' | 'all';
2301
+ /** 切换集合回调 */
2302
+ onCollectionChange?: (collection: 'core' | 'all') => void;
2303
+ /** 集合元数据(来自 work.version_graph.collections) */
2304
+ collectionsAvailable?: {
2305
+ core?: {
2306
+ label: string;
2307
+ description?: string;
2308
+ };
2309
+ all?: {
2310
+ label: string;
2311
+ description?: string;
2312
+ };
2313
+ };
2314
+ /** 各集合 Book 总数(用于显示徽标,如 "核心 12" "完整 29") */
2315
+ collectionCounts?: {
2316
+ core?: number;
2317
+ all?: number;
2318
+ };
2284
2319
  className?: string;
2285
2320
  style?: default_2.CSSProperties;
2286
2321
  }