poi-plugin-kai-planner 1.0.16 → 1.0.18

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.
Files changed (41) hide show
  1. package/README.md +16 -14
  2. package/index.js +14 -2
  3. package/package.json +28 -28
  4. package/src/app/KaiPlannerApp.js +291 -269
  5. package/src/app/tabs/debug/DebugTab.js +29 -13
  6. package/src/app/tabs/debug/debugDiagnostics.js +94 -0
  7. package/src/app/tabs/wishlist/CreatePlanFormV2.js +16 -13
  8. package/src/app/tabs/wishlist/WishlistTabV2.js +98 -152
  9. package/src/app/tabs/wishlist/components/WishlistBatchEditPanelV2.js +65 -0
  10. package/src/app/tabs/wishlist/components/WishlistExpandedDetailV2.js +28 -20
  11. package/src/app/tabs/wishlist/components/WishlistHeaderControlsV2.js +78 -0
  12. package/src/data/static/data_manifest.json +39 -15
  13. package/src/data/static/equip_base_cost.json +58 -2
  14. package/src/data/static/equipment_upgrade_path.json +58 -7
  15. package/src/data/static/improvement_arrangement.json +430 -78
  16. package/src/data/static/improvement_consume_item.json +248 -5
  17. package/src/data/static/improvement_consume_step.json +164 -20
  18. package/src/data/static/improvement_upgrade_cost.json +93 -5
  19. package/src/data/static/improvement_upgrade_target.json +58 -18
  20. package/src/data/static/material.json +54 -46
  21. package/src/services/planner/summarizeShortage.js +95 -84
  22. package/src/services/player/countPlayerEquipByMasterId.js +43 -41
  23. package/src/services/player/getEquipOwnerShip.js +68 -66
  24. package/src/services/player/getPlayerData.js +16 -14
  25. package/src/services/player/getPlayerItemCountByUseitemId.js +29 -27
  26. package/src/services/player/materialResourceCounts.js +221 -0
  27. package/src/services/player/playerSelectors.js +81 -0
  28. package/src/services/static/version/dataUpdateManager.js +239 -176
  29. package/src/services/static/version/versionStore.js +305 -205
  30. package/src/services/wishlist/buildEquipmentShortageDisplayRows.js +88 -30
  31. package/src/services/wishlist/buildNextStepConsumableStatus.js +135 -107
  32. package/src/services/wishlist/buildPlanningSnapshot.js +29 -4
  33. package/src/services/wishlist/wishlistActions.js +778 -776
  34. package/src/services/wishlist/wishlistHydration.js +89 -0
  35. package/src/storage/acquisitionPlans/fileStore.js +191 -209
  36. package/src/storage/acquisitionPlans/storeAdapter.js +89 -82
  37. package/src/storage/common/jsonFileStore.js +77 -0
  38. package/src/storage/dailyFavorites/fileStore.js +191 -209
  39. package/src/storage/dailyFavorites/storeAdapter.js +89 -82
  40. package/src/storage/userPlans/fileStore.js +192 -209
  41. package/src/storage/userPlans/storeAdapter.js +89 -82
package/README.md CHANGED
@@ -1,15 +1,17 @@
1
- # poi-plugin-kai-planner
2
-
3
- 用于在 POI 浏览器里管理改修相关信息与个人规划。
4
-
5
- ## 你可以用这个插件做什么
6
-
7
- - 在`每日改修`页面查看当天可改修装备、基础消耗、秘书舰要求与可进化状态。
8
- - 在`每日改修`页面把常看的装备标记为收藏,收藏项会优先排序并长期保存在本地。
9
- - 在`改修心愿清单`页面创建、编辑、刷新和追踪个人改修计划,查看实时完成进度与资源缺口。
10
- - 在`装备获取规划`页面管理想提前准备的装备,查看它们与未完成改修计划之间的待消耗关联。
11
- - 在`Debug`页面查看插件运行时数据与调试信息。
12
-
13
- ## 技术文档
14
-
1
+ # poi-plugin-kai-planner
2
+
3
+ 用于在 POI 浏览器里管理改修相关信息与个人规划。
4
+
5
+ ## 你可以用这个插件做什么
6
+
7
+ - 在`每日改修`页面查看当天可改修装备、基础消耗、秘书舰要求与可进化状态。
8
+ - 在`每日改修`页面把常看的装备标记为收藏,收藏项会优先排序并长期保存在本地。
9
+ - 在`改修心愿清单`页面创建、编辑、刷新和追踪个人改修计划,查看实时完成进度与资源缺口。
10
+ - 在`装备获取规划`页面管理想提前准备的装备,查看它们与未完成改修计划之间的待消耗关联。
11
+ - 在`Debug`页面查看插件运行时数据与调试信息。
12
+ - 静态数据支持远端版本更新;插件默认每 2 天自动检查一次,也可以手动点击“检查更新”。
13
+ - 改修规划的待消耗道具会区分 useitem 与 `api_material` 资源类材料,例如高速建造材、高速修复材、开发资材、改修资材。
14
+
15
+ ## 技术文档
16
+
15
17
  技术设计、存储策略、页面行为和实现约束请看 [docs/README.md](docs/README.md)。
package/index.js CHANGED
@@ -4,7 +4,10 @@
4
4
  const React = require("react");
5
5
  const { WindowEnv } = require("views/components/etc/window-env");
6
6
 
7
- const { KaiPlannerApp } = require("./src/app/KaiPlannerApp");
7
+ const { KaiPlannerApp } = require("./src/app/KaiPlannerApp");
8
+ const { subscribeMaterialResourceUpdates } = require("./src/services/player/materialResourceCounts");
9
+
10
+ let unsubscribeMaterialResourceUpdates = null;
8
11
 
9
12
  function KaiPlannerAppWithEnv() {
10
13
  return React.createElement(WindowEnv.Consumer, null, (ctx) => {
@@ -23,13 +26,22 @@ module.exports = {
23
26
  windowMode: true,
24
27
 
25
28
  pluginDidLoad() {
29
+ if (!unsubscribeMaterialResourceUpdates) {
30
+ unsubscribeMaterialResourceUpdates = subscribeMaterialResourceUpdates(
31
+ typeof window !== "undefined" ? window : null
32
+ );
33
+ }
26
34
  if (typeof window !== "undefined" && window.log) {
27
35
  window.log("[kai-planner] loaded");
28
36
  }
29
37
  },
30
38
  pluginWillUnload() {
39
+ if (unsubscribeMaterialResourceUpdates) {
40
+ unsubscribeMaterialResourceUpdates();
41
+ unsubscribeMaterialResourceUpdates = null;
42
+ }
31
43
  if (typeof window !== "undefined" && window.log) {
32
44
  window.log("[kai-planner] unloaded");
33
45
  }
34
46
  },
35
- };
47
+ };
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
- {
2
- "name": "poi-plugin-kai-planner",
3
- "version": "1.0.16",
4
- "main": "index.js",
5
- "author": "aulu",
6
- "contributors": ["aulu"],
7
- "license": "MIT",
8
- "private": false,
9
- "files": [
10
- "index.js",
11
- "src/**"
12
- ],
13
- "scripts": {
14
- "test": "node --test tests",
15
- "release:check": "npm test && npm pack --dry-run",
16
- "release:pack": "npm pack"
17
- },
18
- "poiPlugin": {
19
- "title": "改修规划",
20
- "description": "管理个人装备与改修计划。改修计划数据源来自 [明石工厂](https://akashi-list.me/) ",
21
- "icon": "tasks",
22
- "enableDebug": false,
23
- "dataSource": {
24
- "manifestRawUrl": "https://raw.githubusercontent.com/auluu/PlannerRemoteRawData/refs/heads/main/data_manifest.json",
25
- "rawBaseUrl": "https://raw.githubusercontent.com/auluu/PlannerRemoteRawData/refs/heads/main"
26
- }
27
- }
28
- }
1
+ {
2
+ "name": "poi-plugin-kai-planner",
3
+ "version": "1.0.18",
4
+ "main": "index.js",
5
+ "author": "aulu",
6
+ "contributors": ["aulu"],
7
+ "license": "MIT",
8
+ "private": false,
9
+ "files": [
10
+ "index.js",
11
+ "src/**"
12
+ ],
13
+ "scripts": {
14
+ "test": "node --test tests/**/*.test.js",
15
+ "release:check": "npm test && npm pack --dry-run",
16
+ "release:pack": "npm pack"
17
+ },
18
+ "poiPlugin": {
19
+ "title": "改修规划",
20
+ "description": "管理个人装备与改修计划。改修计划数据源来自[明石工厂](https://akashi-list.me/)",
21
+ "icon": "tasks",
22
+ "enableDebug": false,
23
+ "dataSource": {
24
+ "manifestRawUrl": "https://raw.githubusercontent.com/auluu/PlannerRemoteRawData/refs/heads/main/data_manifest.json",
25
+ "rawBaseUrl": "https://raw.githubusercontent.com/auluu/PlannerRemoteRawData/refs/heads/main"
26
+ }
27
+ }
28
+ }