koishi-plugin-chatluna-affinity 0.2.5 → 0.3.0-alpha.1
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/client/constants.ts +44 -54
- package/client/types.ts +57 -52
- package/dist/index.js +39 -51
- package/lib/index.d.ts +1765 -13
- package/lib/index.js +2669 -7090
- package/package.json +6 -15
- package/readme.md +418 -101
- package/lib/commands/adjust.d.ts +0 -6
- package/lib/commands/blacklist.d.ts +0 -12
- package/lib/commands/block.d.ts +0 -10
- package/lib/commands/clear-all.d.ts +0 -6
- package/lib/commands/enabled.d.ts +0 -6
- package/lib/commands/group-list.d.ts +0 -6
- package/lib/commands/index.d.ts +0 -15
- package/lib/commands/inspect.d.ts +0 -6
- package/lib/commands/rank.d.ts +0 -6
- package/lib/commands/schedule.d.ts +0 -15
- package/lib/commands/temp-block.d.ts +0 -10
- package/lib/commands/types.d.ts +0 -55
- package/lib/constants/defaults.d.ts +0 -70
- package/lib/constants/index.d.ts +0 -7
- package/lib/constants/mappings.d.ts +0 -9
- package/lib/constants/prompts.d.ts +0 -7
- package/lib/helpers/index.d.ts +0 -8
- package/lib/helpers/logger.d.ts +0 -11
- package/lib/helpers/member.d.ts +0 -49
- package/lib/helpers/role-mapper.d.ts +0 -44
- package/lib/helpers/session.d.ts +0 -36
- package/lib/integrations/chatluna/index.d.ts +0 -6
- package/lib/integrations/chatluna/tools/affinity.d.ts +0 -35
- package/lib/integrations/chatluna/tools/blacklist.d.ts +0 -47
- package/lib/integrations/chatluna/tools/index.d.ts +0 -10
- package/lib/integrations/chatluna/tools/relationship.d.ts +0 -35
- package/lib/integrations/chatluna/tools/schedule.d.ts +0 -31
- package/lib/integrations/chatluna/tools/types.d.ts +0 -29
- package/lib/integrations/chatluna/tools/weather.d.ts +0 -34
- package/lib/integrations/chatluna/variables/affinity.d.ts +0 -20
- package/lib/integrations/chatluna/variables/bot-info.d.ts +0 -17
- package/lib/integrations/chatluna/variables/context-affinity.d.ts +0 -19
- package/lib/integrations/chatluna/variables/group-info.d.ts +0 -17
- package/lib/integrations/chatluna/variables/index.d.ts +0 -15
- package/lib/integrations/chatluna/variables/outfit.d.ts +0 -18
- package/lib/integrations/chatluna/variables/random.d.ts +0 -10
- package/lib/integrations/chatluna/variables/relationship-level.d.ts +0 -20
- package/lib/integrations/chatluna/variables/relationship.d.ts +0 -18
- package/lib/integrations/chatluna/variables/schedule.d.ts +0 -18
- package/lib/integrations/chatluna/variables/user-info.d.ts +0 -19
- package/lib/integrations/chatluna/variables/weather.d.ts +0 -15
- package/lib/integrations/index.d.ts +0 -6
- package/lib/integrations/onebot/api.d.ts +0 -16
- package/lib/integrations/onebot/index.d.ts +0 -5
- package/lib/integrations/onebot/tools/delete-msg.d.ts +0 -18
- package/lib/integrations/onebot/tools/index.d.ts +0 -9
- package/lib/integrations/onebot/tools/poke.d.ts +0 -47
- package/lib/integrations/onebot/tools/profile.d.ts +0 -43
- package/lib/integrations/onebot/tools/send-fake-msg.d.ts +0 -147
- package/lib/integrations/onebot/tools/send-forward-msg.d.ts +0 -39
- package/lib/integrations/onebot/tools/set-group-card.d.ts +0 -41
- package/lib/integrations/onebot/tools/set-msg-emoji.d.ts +0 -22
- package/lib/models/affinity.d.ts +0 -13
- package/lib/models/index.d.ts +0 -9
- package/lib/plugin.d.ts +0 -7
- package/lib/renders/base.d.ts +0 -35
- package/lib/renders/blacklist.d.ts +0 -19
- package/lib/renders/group-list.d.ts +0 -14
- package/lib/renders/index.d.ts +0 -27
- package/lib/renders/inspect.d.ts +0 -23
- package/lib/renders/rank-list.d.ts +0 -15
- package/lib/renders/schedule.d.ts +0 -15
- package/lib/renders/styles/common.d.ts +0 -5
- package/lib/renders/styles/index.d.ts +0 -4
- package/lib/renders/table.d.ts +0 -12
- package/lib/schema/affinity.d.ts +0 -220
- package/lib/schema/blacklist.d.ts +0 -122
- package/lib/schema/index.d.ts +0 -397
- package/lib/schema/relationship.d.ts +0 -56
- package/lib/schema/schedule.d.ts +0 -74
- package/lib/schema/tools.d.ts +0 -115
- package/lib/schema/variables.d.ts +0 -76
- package/lib/schema/weather.d.ts +0 -38
- package/lib/services/affinity/apply-delta.d.ts +0 -54
- package/lib/services/affinity/cache.d.ts +0 -6
- package/lib/services/affinity/calculator.d.ts +0 -18
- package/lib/services/affinity/index.d.ts +0 -8
- package/lib/services/affinity/store.d.ts +0 -25
- package/lib/services/blacklist/guard.d.ts +0 -19
- package/lib/services/blacklist/index.d.ts +0 -7
- package/lib/services/blacklist/permanent.d.ts +0 -17
- package/lib/services/blacklist/temporary.d.ts +0 -24
- package/lib/services/index.d.ts +0 -9
- package/lib/services/message/history.d.ts +0 -24
- package/lib/services/message/index.d.ts +0 -6
- package/lib/services/message/store.d.ts +0 -27
- package/lib/services/relationship/index.d.ts +0 -6
- package/lib/services/relationship/level-resolver.d.ts +0 -10
- package/lib/services/relationship/manual-config.d.ts +0 -19
- package/lib/services/schedule/cache.d.ts +0 -13
- package/lib/services/schedule/generator.d.ts +0 -22
- package/lib/services/schedule/index.d.ts +0 -8
- package/lib/services/schedule/manager.d.ts +0 -25
- package/lib/services/schedule/time-utils.d.ts +0 -15
- package/lib/services/weather/api.d.ts +0 -33
- package/lib/services/weather/index.d.ts +0 -5
- package/lib/types/affinity.d.ts +0 -110
- package/lib/types/blacklist.d.ts +0 -60
- package/lib/types/common.d.ts +0 -16
- package/lib/types/config.d.ts +0 -165
- package/lib/types/index.d.ts +0 -12
- package/lib/types/member.d.ts +0 -85
- package/lib/types/schedule-config.d.ts +0 -22
- package/lib/types/schedule.d.ts +0 -53
- package/lib/types/weather.d.ts +0 -27
- package/lib/utils/index.d.ts +0 -8
- package/lib/utils/math.d.ts +0 -8
- package/lib/utils/string.d.ts +0 -9
- package/lib/utils/template.d.ts +0 -5
- package/lib/utils/time.d.ts +0 -13
package/client/constants.ts
CHANGED
|
@@ -4,72 +4,62 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export interface NavSection {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
title: string;
|
|
8
|
+
key: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface ToolItem {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
name: string;
|
|
13
|
+
enableKey: string;
|
|
14
|
+
enabled: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface VariableItem {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
name: string;
|
|
19
|
+
key: string;
|
|
20
|
+
enabled: boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const NAV_SECTIONS: NavSection[] = [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{ title: '其他变量', key: 'otherVariables' },
|
|
32
|
-
{ title: '其他指令', key: 'otherCommands' },
|
|
33
|
-
{ title: '其他设置', key: 'otherSettings' }
|
|
34
|
-
]
|
|
24
|
+
{ title: "好感度设置", key: "affinity" },
|
|
25
|
+
{ title: "黑名单设置", key: "blacklist" },
|
|
26
|
+
{ title: "关系设置", key: "relationship" },
|
|
27
|
+
{ title: "变量设置", key: "variables" },
|
|
28
|
+
{ title: "XML 工具设置", key: "xmlTools" },
|
|
29
|
+
{ title: "其他设置", key: "otherSettings" },
|
|
30
|
+
];
|
|
35
31
|
|
|
36
32
|
export const TITLE_TO_KEY: Record<string, string> = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'其他变量': 'otherVariables',
|
|
45
|
-
'其他指令': 'otherCommands',
|
|
46
|
-
'其他设置': 'otherSettings'
|
|
47
|
-
}
|
|
33
|
+
好感度设置: "affinity",
|
|
34
|
+
黑名单设置: "blacklist",
|
|
35
|
+
关系设置: "relationship",
|
|
36
|
+
变量设置: "variables",
|
|
37
|
+
"XML 工具设置": "xmlTools",
|
|
38
|
+
其他设置: "otherSettings",
|
|
39
|
+
};
|
|
48
40
|
|
|
49
41
|
export const KEY_TO_TITLE: Record<string, string> = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
otherVariables: '其他变量',
|
|
58
|
-
otherCommands: '其他指令',
|
|
59
|
-
otherSettings: '其他设置'
|
|
60
|
-
}
|
|
42
|
+
affinity: "好感度设置",
|
|
43
|
+
blacklist: "黑名单设置",
|
|
44
|
+
relationship: "关系设置",
|
|
45
|
+
variables: "变量设置",
|
|
46
|
+
xmlTools: "XML 工具设置",
|
|
47
|
+
otherSettings: "其他设置",
|
|
48
|
+
};
|
|
61
49
|
|
|
62
|
-
export const VARIABLE_CONFIG: Record<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
50
|
+
export const VARIABLE_CONFIG: Record<
|
|
51
|
+
string,
|
|
52
|
+
{ section: string; searchKey: string | string[] }
|
|
53
|
+
> = {
|
|
54
|
+
affinity: { section: "变量设置", searchKey: "affinityVariableName" },
|
|
55
|
+
relationshipLevel: {
|
|
56
|
+
section: "变量设置",
|
|
57
|
+
searchKey: "relationshipLevelVariableName",
|
|
58
|
+
},
|
|
59
|
+
blacklistList: {
|
|
60
|
+
section: "变量设置",
|
|
61
|
+
searchKey: "blacklistListVariableName",
|
|
62
|
+
},
|
|
63
|
+
};
|
|
74
64
|
|
|
75
|
-
export const PLUGIN_NAME =
|
|
65
|
+
export const PLUGIN_NAME = "koishi-plugin-chatluna-affinity";
|
package/client/types.ts
CHANGED
|
@@ -3,56 +3,61 @@
|
|
|
3
3
|
* 包含配置接口和组件 Props 类型
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
6
|
+
export interface BlacklistEntry {
|
|
7
|
+
userId: string;
|
|
8
|
+
nickname: string;
|
|
9
|
+
blockedAt: string;
|
|
10
|
+
note: string;
|
|
11
|
+
platform: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TemporaryBlacklistEntry {
|
|
15
|
+
userId: string;
|
|
16
|
+
nickname: string;
|
|
17
|
+
blockedAt: string;
|
|
18
|
+
expiresAt: string;
|
|
19
|
+
durationHours: string;
|
|
20
|
+
penalty: string;
|
|
21
|
+
note: string;
|
|
22
|
+
platform: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface VariableSettings {
|
|
26
|
+
affinityVariableName?: string;
|
|
27
|
+
relationshipLevelVariableName?: string;
|
|
28
|
+
blacklistListVariableName?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface XmlToolSettings {
|
|
32
|
+
enableAffinityXmlToolCall?: boolean;
|
|
33
|
+
enableBlacklistXmlToolCall?: boolean;
|
|
34
|
+
enableRelationshipXmlToolCall?: boolean;
|
|
35
|
+
enableUserAliasXmlToolCall?: boolean;
|
|
36
|
+
characterPromptTemplate?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface FrontendConfigSubset {
|
|
40
|
+
scopeId?: string;
|
|
41
|
+
botSelfIds?: string[];
|
|
42
|
+
affinityEnabled?: boolean;
|
|
43
|
+
affinityDisplayRange?: number;
|
|
44
|
+
rankRenderAsImage?: boolean;
|
|
45
|
+
rankDefaultLimit?: number;
|
|
46
|
+
|
|
47
|
+
blacklistLogInterception?: boolean;
|
|
48
|
+
unblockPermanentInitialAffinity?: number;
|
|
49
|
+
blacklistDefaultLimit?: number;
|
|
50
|
+
blacklistRenderAsImage?: boolean;
|
|
51
|
+
shortTermBlacklistRenderAsImage?: boolean;
|
|
52
|
+
|
|
53
|
+
inspectRenderAsImage?: boolean;
|
|
54
|
+
inspectShowImpression?: boolean;
|
|
55
|
+
debugLogging?: boolean;
|
|
56
|
+
|
|
57
|
+
variableSettings?: VariableSettings;
|
|
58
|
+
xmlToolSettings?: XmlToolSettings;
|
|
59
|
+
|
|
60
|
+
affinityVariableName?: string;
|
|
61
|
+
relationshipLevelVariableName?: string;
|
|
62
|
+
blacklistListVariableName?: string;
|
|
58
63
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { createElementBlock as f, openBlock as p, createElementVNode as _, defineComponent as k, Fragment as
|
|
2
|
-
const
|
|
1
|
+
import { createElementBlock as f, openBlock as p, createElementVNode as _, defineComponent as k, Fragment as C, renderList as D, normalizeClass as m, toDisplayString as X, reactive as N, computed as $, onUnmounted as x, ref as L, onMounted as Y, normalizeStyle as z, unref as y, createVNode as w, withModifiers as S, inject as I, createBlock as R, createCommentVNode as A } from "vue";
|
|
2
|
+
const v = (c, e) => {
|
|
3
3
|
const t = c.__vccOpts || c;
|
|
4
4
|
for (const [n, l] of e)
|
|
5
5
|
t[n] = l;
|
|
6
6
|
return t;
|
|
7
|
-
},
|
|
7
|
+
}, B = {}, O = {
|
|
8
8
|
viewBox: "0 0 1024 1024",
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
10
|
width: "20",
|
|
11
11
|
height: "20"
|
|
12
12
|
};
|
|
13
|
-
function
|
|
14
|
-
return p(), f("svg",
|
|
13
|
+
function K(c, e) {
|
|
14
|
+
return p(), f("svg", O, [...e[0] || (e[0] = [
|
|
15
15
|
_("path", {
|
|
16
16
|
d: "M288 224c0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64-64-28.7-64-64zm320 0c0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64-64-28.7-64-64zM288 512c0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64-64-28.7-64-64zm320 0c0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64-64-28.7-64-64zM352 864c-35.3 0-64-28.7-64-64s28.7-64 64-64 64 28.7 64 64-28.7 64-64 64zm320 0c-35.3 0-64-28.7-64-64s28.7-64 64-64 64 28.7 64 64-28.7 64-64 64z",
|
|
17
17
|
fill: "currentColor"
|
|
18
18
|
}, null, -1)
|
|
19
19
|
])]);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const V = /* @__PURE__ */ v(B, [["render", K]]), q = {}, W = {
|
|
22
22
|
viewBox: "0 0 1024 1024",
|
|
23
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24
24
|
width: "20",
|
|
@@ -32,7 +32,7 @@ function j(c, e) {
|
|
|
32
32
|
}, null, -1)
|
|
33
33
|
])]);
|
|
34
34
|
}
|
|
35
|
-
const P = /* @__PURE__ */
|
|
35
|
+
const P = /* @__PURE__ */ v(q, [["render", j]]), U = ["onClick"], F = /* @__PURE__ */ k({
|
|
36
36
|
__name: "NavSection",
|
|
37
37
|
props: {
|
|
38
38
|
sections: {},
|
|
@@ -40,7 +40,7 @@ const P = /* @__PURE__ */ y(q, [["render", j]]), U = ["onClick"], F = /* @__PURE
|
|
|
40
40
|
},
|
|
41
41
|
emits: ["select"],
|
|
42
42
|
setup(c) {
|
|
43
|
-
return (e, t) => (p(!0), f(
|
|
43
|
+
return (e, t) => (p(!0), f(C, null, D(c.sections, (n) => (p(), f("div", {
|
|
44
44
|
key: n.key,
|
|
45
45
|
class: m([e.$style.item, c.activeKey === n.key ? e.$style.active : ""]),
|
|
46
46
|
onClick: (l) => e.$emit("select", n)
|
|
@@ -51,7 +51,7 @@ const P = /* @__PURE__ */ y(q, [["render", j]]), U = ["onClick"], F = /* @__PURE
|
|
|
51
51
|
active: H
|
|
52
52
|
}, Q = {
|
|
53
53
|
$style: J
|
|
54
|
-
}, Z = /* @__PURE__ */
|
|
54
|
+
}, Z = /* @__PURE__ */ v(F, [["__cssModules", Q]]);
|
|
55
55
|
function tt(c = 100, e = 20) {
|
|
56
56
|
const t = N({
|
|
57
57
|
isDragging: !1,
|
|
@@ -70,13 +70,13 @@ function tt(c = 100, e = 20) {
|
|
|
70
70
|
var E;
|
|
71
71
|
if (!t.isDragging) return;
|
|
72
72
|
const a = s instanceof TouchEvent ? s.touches[0].clientX : s.clientX, o = s instanceof TouchEvent ? s.touches[0].clientY : s.clientY;
|
|
73
|
-
let i = t.startTop + (o - t.startY),
|
|
73
|
+
let i = t.startTop + (o - t.startY), u = t.startRight - (a - t.startX);
|
|
74
74
|
const r = (E = document.querySelector(".plugin-view")) == null ? void 0 : E.getBoundingClientRect();
|
|
75
|
-
let
|
|
76
|
-
r && (
|
|
75
|
+
let h = 0, M = window.innerHeight - t.height, T = 0, b = window.innerWidth - t.width;
|
|
76
|
+
r && (h = r.top, M = r.bottom - t.height, T = window.innerWidth - r.right, b = window.innerWidth - r.left - t.width), t.top = Math.max(h, Math.min(M, i)), t.right = Math.max(T, Math.min(b, u));
|
|
77
77
|
}, g = (s, a) => {
|
|
78
|
-
const o = s instanceof TouchEvent ? s.touches[0].clientX : s.clientX, i = s instanceof TouchEvent ? s.touches[0].clientY : s.clientY, r = s.target.closest(`.${a}`),
|
|
79
|
-
|
|
78
|
+
const o = s instanceof TouchEvent ? s.touches[0].clientX : s.clientX, i = s instanceof TouchEvent ? s.touches[0].clientY : s.clientY, r = s.target.closest(`.${a}`), h = r == null ? void 0 : r.getBoundingClientRect();
|
|
79
|
+
h && (t.width = h.width, t.height = h.height), t.startTop = t.top, t.startRight = t.right, t.startX = o, t.startY = i, t.isDragging = !0;
|
|
80
80
|
}, d = () => {
|
|
81
81
|
t.isDragging = !1;
|
|
82
82
|
};
|
|
@@ -90,7 +90,7 @@ function tt(c = 100, e = 20) {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
function et(c, e = {}) {
|
|
93
|
-
const t =
|
|
93
|
+
const t = L("");
|
|
94
94
|
let n = null;
|
|
95
95
|
const l = /* @__PURE__ */ new Map(), g = () => {
|
|
96
96
|
n && (n.disconnect(), l.clear()), n = new IntersectionObserver(
|
|
@@ -108,9 +108,9 @@ function et(c, e = {}) {
|
|
|
108
108
|
}
|
|
109
109
|
), document.querySelectorAll(".k-schema-header").forEach((a) => {
|
|
110
110
|
const o = a.textContent || "";
|
|
111
|
-
for (const [i,
|
|
111
|
+
for (const [i, u] of Object.entries(c))
|
|
112
112
|
if (o.includes(i)) {
|
|
113
|
-
n == null || n.observe(a), l.set(a,
|
|
113
|
+
n == null || n.observe(a), l.set(a, u);
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
});
|
|
@@ -130,47 +130,35 @@ const ot = [
|
|
|
130
130
|
{ title: "好感度设置", key: "affinity" },
|
|
131
131
|
{ title: "黑名单设置", key: "blacklist" },
|
|
132
132
|
{ title: "关系设置", key: "relationship" },
|
|
133
|
-
{ title: "
|
|
134
|
-
{ title: "
|
|
135
|
-
{ title: "原生工具", key: "nativeTools" },
|
|
136
|
-
{ title: "XML 工具", key: "xmlTools" },
|
|
137
|
-
{ title: "其他变量", key: "otherVariables" },
|
|
138
|
-
{ title: "其他指令", key: "otherCommands" },
|
|
133
|
+
{ title: "变量设置", key: "variables" },
|
|
134
|
+
{ title: "XML 工具设置", key: "xmlTools" },
|
|
139
135
|
{ title: "其他设置", key: "otherSettings" }
|
|
140
136
|
], nt = {
|
|
141
137
|
好感度设置: "affinity",
|
|
142
138
|
黑名单设置: "blacklist",
|
|
143
139
|
关系设置: "relationship",
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
原生工具: "nativeTools",
|
|
147
|
-
"XML 工具": "xmlTools",
|
|
148
|
-
其他变量: "otherVariables",
|
|
149
|
-
其他指令: "otherCommands",
|
|
140
|
+
变量设置: "variables",
|
|
141
|
+
"XML 工具设置": "xmlTools",
|
|
150
142
|
其他设置: "otherSettings"
|
|
151
143
|
}, st = {
|
|
152
144
|
affinity: "好感度设置",
|
|
153
145
|
blacklist: "黑名单设置",
|
|
154
146
|
relationship: "关系设置",
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
nativeTools: "原生工具",
|
|
158
|
-
xmlTools: "XML 工具",
|
|
159
|
-
otherVariables: "其他变量",
|
|
160
|
-
otherCommands: "其他指令",
|
|
147
|
+
variables: "变量设置",
|
|
148
|
+
xmlTools: "XML 工具设置",
|
|
161
149
|
otherSettings: "其他设置"
|
|
162
150
|
}, it = "koishi-plugin-chatluna-affinity", ct = /* @__PURE__ */ k({
|
|
163
151
|
__name: "AffinityNav",
|
|
164
152
|
setup(c) {
|
|
165
|
-
const e =
|
|
153
|
+
const e = L(!1), t = (o) => {
|
|
166
154
|
o.stopPropagation(), e.value = !e.value;
|
|
167
155
|
}, { position: n, startDrag: l } = tt(100, 20), g = (o) => {
|
|
168
156
|
l(o, "container");
|
|
169
157
|
}, d = ot, { activeSection: s } = et(nt), a = (o) => {
|
|
170
158
|
s.value = o.key;
|
|
171
159
|
const i = document.querySelectorAll(".k-schema-header");
|
|
172
|
-
for (let
|
|
173
|
-
const r = i[
|
|
160
|
+
for (let u = 0; u < i.length; u++) {
|
|
161
|
+
const r = i[u];
|
|
174
162
|
if ((r.textContent || "").includes(st[o.key])) {
|
|
175
163
|
r.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
176
164
|
return;
|
|
@@ -179,14 +167,14 @@ const ot = [
|
|
|
179
167
|
};
|
|
180
168
|
return (o, i) => (p(), f("div", {
|
|
181
169
|
class: m([o.$style.container, e.value ? o.$style.collapsed : ""]),
|
|
182
|
-
style: z(
|
|
170
|
+
style: z(y(n))
|
|
183
171
|
}, [
|
|
184
172
|
_("div", {
|
|
185
173
|
class: m(o.$style.header),
|
|
186
174
|
onMousedown: g,
|
|
187
175
|
onTouchstart: g
|
|
188
176
|
}, [
|
|
189
|
-
|
|
177
|
+
w(V, {
|
|
190
178
|
class: m(o.$style.move)
|
|
191
179
|
}, null, 8, ["class"]),
|
|
192
180
|
_("div", {
|
|
@@ -197,36 +185,36 @@ const ot = [
|
|
|
197
185
|
onTouchstart: i[1] || (i[1] = S(() => {
|
|
198
186
|
}, ["stop"]))
|
|
199
187
|
}, [
|
|
200
|
-
|
|
188
|
+
w(P)
|
|
201
189
|
], 34)
|
|
202
190
|
], 34),
|
|
203
191
|
_("div", {
|
|
204
192
|
class: m(o.$style.body)
|
|
205
193
|
}, [
|
|
206
|
-
|
|
207
|
-
sections:
|
|
208
|
-
"active-key":
|
|
194
|
+
w(Z, {
|
|
195
|
+
sections: y(d),
|
|
196
|
+
"active-key": y(s),
|
|
209
197
|
onSelect: a
|
|
210
198
|
}, null, 8, ["sections", "active-key"])
|
|
211
199
|
], 2)
|
|
212
200
|
], 6));
|
|
213
201
|
}
|
|
214
|
-
}), lt = "_container_pbgsl_2", rt = "_header_pbgsl_21", at = "_move_pbgsl_36", dt = "_toggle_pbgsl_45",
|
|
202
|
+
}), lt = "_container_pbgsl_2", rt = "_header_pbgsl_21", at = "_move_pbgsl_36", dt = "_toggle_pbgsl_45", ut = "_body_pbgsl_56", ht = "_collapsed_pbgsl_67", gt = {
|
|
215
203
|
container: lt,
|
|
216
204
|
header: rt,
|
|
217
205
|
move: at,
|
|
218
206
|
toggle: dt,
|
|
219
|
-
body:
|
|
220
|
-
collapsed:
|
|
207
|
+
body: ut,
|
|
208
|
+
collapsed: ht
|
|
221
209
|
}, mt = {
|
|
222
210
|
$style: gt
|
|
223
|
-
}, pt = /* @__PURE__ */
|
|
211
|
+
}, pt = /* @__PURE__ */ v(ct, [["__cssModules", mt]]), _t = /* @__PURE__ */ k({
|
|
224
212
|
__name: "AffinityDetailsLoader",
|
|
225
213
|
setup(c) {
|
|
226
214
|
const e = I("plugin:name"), t = $(() => (e == null ? void 0 : e.value) === it);
|
|
227
|
-
return (n, l) => t.value ? (p(), R(pt, { key: 0 })) :
|
|
215
|
+
return (n, l) => t.value ? (p(), R(pt, { key: 0 })) : A("", !0);
|
|
228
216
|
}
|
|
229
|
-
}),
|
|
217
|
+
}), vt = (c) => {
|
|
230
218
|
c.slot({
|
|
231
219
|
type: "plugin-details",
|
|
232
220
|
component: _t,
|
|
@@ -234,5 +222,5 @@ const ot = [
|
|
|
234
222
|
});
|
|
235
223
|
};
|
|
236
224
|
export {
|
|
237
|
-
|
|
225
|
+
vt as default
|
|
238
226
|
};
|