book-index-ui 0.46.1 → 0.47.0

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
@@ -210,3 +210,19 @@ npm run build:lib # 输出 dist/ 给 npm 发布
210
210
  ## 许可
211
211
 
212
212
  Apache 2.0
213
+
214
+ ## schema-v2 派生字段兼容(overview#458)
215
+
216
+ 读者端在数据入口把 build 产物的派生字段归一成旧形状(`ui/src/core/derived-compat.ts`),**新字段优先、缺了回退旧字段,旧格式数据行为不变**:
217
+
218
+ | 记录 | 新字段 | 补到 | 旧字段已有值时 |
219
+ |---|---|---|---|
220
+ | Work | `_books` | `books`(Book id) | 不动 |
221
+ | Work | `_classifications`(优先 zongmu) | `classification` | 不动 |
222
+ | Work | `_related` | `related_works`(含 title,反向词) | `_related` 存在即取(源档 related_works 已无 title) |
223
+ | Work | `_catalogs` | `indexed_by` | 不动 |
224
+ | Work/Book | `_collections` | `contained_in` | 不动 |
225
+ | Collection | `_members`(前 20 项)+`_member_count` | `books`(Book 成员)/`contained_works`(Work 成员) | 不动;`_members` 被截断时子目表计数按 `_member_count` |
226
+ | Entity | `_works` | `works` | 不动 |
227
+
228
+ 卡片里 `{id, h:1}` 的枢纽引用没有 title,名称取自 `_hubs.json`:`IndexStorage.getHubs?()` 提供(`BundleStorage` 默认读 `${basePath}/_hubs.json`,可用 `hubsPath` 改相对路径);不提供时枢纽引用无名,页面回退显示 ID。`BookDetailLayout` 会自动给传入的 `transport` 和 `initialDetail` 套这层归一(`withDerivedCompat`)。夹具取自 book-index `schema-v2` 的 `build/contract-sample/`(`tests/unit/fixtures/contract-sample/`)。