poi-plugin-kai-planner 1.0.9 → 1.0.11

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
@@ -34,10 +34,17 @@
34
34
  - 远端静态数据更新流程:[docs/REMOTE_DATA_UPDATE.md](docs/REMOTE_DATA_UPDATE.md)
35
35
 
36
36
  ## 2026-03 UI 更新
37
+
37
38
  - Daily 页面支持按装备类型筛选;类型名来自 POI 的 `$equipTypes[api_type[3]].api_name`
38
39
  - Daily 与 Wishlist 表格中的装备名称前都会显示装备类型 icon
39
40
  - Wishlist 主表中的优先级改为标签样式展示(P0-P5 固定颜色)
40
41
  - Wishlist 展开明细中的“当前持有”计数会去除改修星数大于 0 的装备以及计划起点装备
41
42
  - 页面顶部 tab、上一次数据源更新、检查更新与更新提示统一使用 `14px` 字号
42
- - Daily 与 Wishlist 主表中的装备类型 icon 统一缩小到 `16x16`
43
43
  - Daily 与 Wishlist 主表的折叠箭头统一为:未展开 `▶`、已展开 `▼`
44
+
45
+ ## 装备类型 icon 兼容性说明
46
+
47
+ - 当前所有装备类型 icon 均直接使用 POI 宿主的 `SlotitemIcon` 默认渲染尺寸
48
+ - 插件侧不再对 `SlotitemIcon` 做 `zoom`、`transform: scale(...)` 或其它自定义缩放处理
49
+ - 原因是不同用户的 POI / Electron / 系统缩放环境下,非宿主默认缩放可能导致 icon 错位、放大或整页异常
50
+ - 若后续仍需优化观感,优先通过 icon 外层容器的间距、行高、按钮 padding 等布局参数处理,不再恢复 icon 本体缩放
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poi-plugin-kai-planner",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "index.js",
5
5
  "author": "aulu",
6
6
  "contributors": ["aulu"],
@@ -1,62 +1,84 @@
1
1
  /* src/app/components/EquipTypeIconFilter.js */
2
2
 
3
3
  const React = require("react");
4
- const { SlotitemTypeIcon } = require("./SlotitemTypeIcon");
5
4
 
6
- function EquipTypeIconFilter({ options, selectedKeys, onToggle, onClear, iconSize }) {
5
+ let SlotitemIcon = null;
6
+ try {
7
+ ({ SlotitemIcon } = require("views/components/etc/icon"));
8
+ } catch {}
9
+
10
+ function EquipTypeIconFilter({ options, selectedKeys, onToggle, onClear }) {
7
11
  if (!Array.isArray(options) || options.length === 0) return null;
8
12
 
9
13
  const selectedSet = new Set((selectedKeys || []).map(String));
10
- const size = Number.isFinite(iconSize) ? iconSize : 12;
11
- const baseButtonStyle = {
14
+ const areaStyle = {
15
+ display: "flex",
16
+ flexWrap: "wrap",
17
+ alignItems: "center",
18
+ };
19
+ const entryStyle = {
12
20
  display: "inline-flex",
13
21
  alignItems: "center",
14
- justifyContent: "center",
15
- minWidth: 28,
16
- height: 28,
17
- padding: 0,
18
- borderRadius: 8,
22
+ marginRight: "1em",
23
+ marginBottom: 8,
24
+ cursor: "pointer",
25
+ };
26
+ const checkboxStyle = {
27
+ verticalAlign: "middle",
28
+ display: "inline-block",
29
+ margin: 0,
30
+ marginRight: 4,
31
+ };
32
+ const actionButtonStyle = {
33
+ marginTop: 10,
34
+ marginBottom: 10,
35
+ minWidth: 120,
36
+ height: 24,
19
37
  border: "1px solid rgba(255,255,255,0.12)",
20
- background: "rgba(255,255,255,0.04)",
38
+ background: "rgba(255,255,255,0.08)",
21
39
  color: "#e5e7eb",
22
40
  cursor: "pointer",
23
- flexShrink: 0,
24
41
  };
25
42
 
26
43
  return React.createElement(
27
44
  "div",
28
- { style: { display: "flex", gap: 8, flexWrap: "wrap", alignItems: "center" } },
45
+ null,
29
46
  React.createElement(
30
- "button",
31
- {
32
- type: "button",
33
- onClick: onClear,
34
- style: {
35
- ...baseButtonStyle,
36
- padding: "0 10px",
37
- background: selectedSet.size === 0 ? "rgba(255,255,255,0.14)" : "rgba(255,255,255,0.04)",
38
- },
39
- },
40
- "全部"
47
+ "div",
48
+ { style: areaStyle },
49
+ ...options.map((option) => {
50
+ const key = String(option.key);
51
+ const active = selectedSet.has(key);
52
+ return React.createElement(
53
+ "label",
54
+ {
55
+ key,
56
+ style: entryStyle,
57
+ title: option.name || key,
58
+ },
59
+ React.createElement("input", {
60
+ type: "checkbox",
61
+ checked: active,
62
+ onChange: () => onToggle(key),
63
+ style: checkboxStyle,
64
+ }),
65
+ SlotitemIcon ? React.createElement(SlotitemIcon, { slotitemId: option.iconType }) : null
66
+ );
67
+ })
41
68
  ),
42
- ...options.map((option) => {
43
- const key = String(option.key);
44
- const active = selectedSet.has(key);
45
- return React.createElement(
69
+ React.createElement(
70
+ "div",
71
+ { style: { display: "flex", gap: 12, flexWrap: "wrap" } },
72
+ React.createElement(
46
73
  "button",
47
74
  {
48
- key,
49
75
  type: "button",
50
- onClick: () => onToggle(key),
51
- 'aria-label': option.name || key,
52
- style: {
53
- ...baseButtonStyle,
54
- background: active ? "rgba(255,255,255,0.14)" : "rgba(255,255,255,0.04)",
55
- },
76
+ onClick: onClear,
77
+ style: actionButtonStyle,
56
78
  },
57
- React.createElement(SlotitemTypeIcon, { iconType: option.iconType, style: { width: size, height: size } })
58
- );
59
- })
79
+ "重置选项"
80
+ )
81
+ )
60
82
  );
61
83
  }
62
84
 
@@ -9,10 +9,6 @@ try {
9
9
 
10
10
  function SlotitemTypeIcon({ iconType, title, style }) {
11
11
  if (!iconType || !SlotitemIcon) return null;
12
- const baseSize = 20;
13
- const width = style && Number.isFinite(style.width) ? style.width : baseSize;
14
- const height = style && Number.isFinite(style.height) ? style.height : baseSize;
15
- const scale = Math.min(width / baseSize, height / baseSize);
16
12
 
17
13
  return React.createElement(
18
14
  "span",
@@ -22,27 +18,12 @@ function SlotitemTypeIcon({ iconType, title, style }) {
22
18
  display: "inline-flex",
23
19
  alignItems: "center",
24
20
  justifyContent: "center",
25
- width,
26
- height,
27
21
  flexShrink: 0,
28
22
  lineHeight: 0,
29
23
  ...(style || {}),
30
24
  },
31
25
  },
32
- React.createElement(
33
- "span",
34
- {
35
- style: {
36
- display: "inline-flex",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- width: baseSize,
40
- height: baseSize,
41
- zoom: scale,
42
- },
43
- },
44
- React.createElement(SlotitemIcon, { slotitemId: iconType })
45
- )
26
+ React.createElement(SlotitemIcon, { slotitemId: iconType })
46
27
  );
47
28
  }
48
29