nav: 全量 world-catalog + status active/planned 分层
- world-catalog.js: 6洲48国127城市全量 NavNode catalog - 统一 schema(isEnabled → status: active|planned) - 64 个 NavNode 覆盖所有洲/国家/地区 - runtime-nav.js: 从 catalog 自动过滤 active 节点 - MVP_OVERRIDES 机制跳过国家层直连城市 - V1.1+ 删除覆写即恢复完整层级 - 删除 future-catalog.js,旧 shim 指向 world-catalog - game-design 2.3 更新 schema + Framework Ready 说明 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,15 +15,16 @@
|
||||
* @property {'country'|'region'|'city'|null} childType - 子节点类型
|
||||
* @property {string[]} childIds - 当前可消费的子节点 id(仅已启用的)
|
||||
* @property {number} pageSize - 每页格子数,默认 9
|
||||
* @property {boolean} isEnabled - 当前版本是否启用
|
||||
* @property {'active'|'planned'} status - 'active'(当前可运行)/ 'planned'(未来规划)
|
||||
* @property {boolean} isUnlockedByDefault - 是否默认解锁
|
||||
*/
|
||||
|
||||
// schema 验证函数
|
||||
export function validateNavNode(node) {
|
||||
const required = ['type', 'id', 'name', 'nameEn', 'sortOrder', 'themeColor', 'childType', 'childIds', 'pageSize', 'isEnabled', 'isUnlockedByDefault']
|
||||
const required = ['type', 'id', 'name', 'nameEn', 'sortOrder', 'themeColor', 'childType', 'childIds', 'pageSize', 'status', 'isUnlockedByDefault']
|
||||
const validTypes = ['continent', 'country', 'region', 'city-group']
|
||||
const validChildTypes = ['country', 'region', 'city', null]
|
||||
const validStatuses = ['active', 'planned']
|
||||
|
||||
const errors = []
|
||||
for (const key of required) {
|
||||
@@ -33,5 +34,6 @@ export function validateNavNode(node) {
|
||||
if (!validChildTypes.includes(node.childType)) errors.push(`invalid childType: ${node.childType}`)
|
||||
if (!Array.isArray(node.childIds)) errors.push('childIds must be array')
|
||||
if (node.parentId !== null && typeof node.parentId !== 'string') errors.push('parentId must be string or null')
|
||||
if (!validStatuses.includes(node.status)) errors.push(`invalid status: ${node.status}, must be 'active' or 'planned'`)
|
||||
return errors
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user