zois-core 2.2.1 → 3.0.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/dist/assets/icons/toast-themes/abdl/bottle.svg +10 -0
- package/dist/assets/icons/toast-themes/abdl/diaper.svg +11 -0
- package/dist/assets/icons/toast-themes/abdl/heart.svg +7 -0
- package/dist/assets/icons/toast-themes/abdl/sparkle.svg +5 -0
- package/dist/assets/icons/toast-themes/abdl/star.svg +5 -0
- package/dist/assets/icons/toast-themes/abdl/teddy.svg +18 -0
- package/dist/assets/icons/toast-themes/anime/error.svg +20 -0
- package/dist/assets/icons/toast-themes/anime/info.svg +20 -0
- package/dist/assets/icons/toast-themes/anime/success.svg +16 -0
- package/dist/assets/icons/toast-themes/anime/warning.svg +19 -0
- package/dist/changelogs.js +628 -295
- package/dist/cssVars.js +46 -0
- package/dist/dialogs.js +523 -83
- package/dist/events.js +28 -6
- package/dist/index.js +27 -70
- package/dist/localization.js +250 -40
- package/dist/messaging.js +6 -6
- package/dist/migration.js +37 -0
- package/dist/modules/baseModule.js +110 -0
- package/dist/modules/index.js +4 -0
- package/dist/modules/loadingStrategy.js +20 -0
- package/dist/modules/moduleContext.js +67 -0
- package/dist/modules/modulesManager.js +175 -0
- package/dist/{modSdk.js → patching.js} +33 -9
- package/dist/rpc.js +139 -0
- package/dist/scripts/zois-core.js +14 -14
- package/dist/settings.js +90 -0
- package/dist/settingsDialog.js +1361 -0
- package/dist/shard-modules/{attributesModule.js → attributes.js} +2 -2
- package/dist/shard-modules/{shardModule.js → base.js} +2 -2
- package/dist/shard-modules/{centerModule.js → center.js} +4 -2
- package/dist/shard-modules/{clickModule.js → click.js} +2 -2
- package/dist/shard-modules/{counterUpModule.js → counterUp.js} +2 -2
- package/dist/shard-modules/{dynamicClassModule.js → dynamicClass.js} +2 -2
- package/dist/shard-modules/index.js +9 -9
- package/dist/shard-modules/{multiClickModule.js → multiClick.js} +2 -2
- package/dist/shard-modules/{styleModule.js → style.js} +2 -2
- package/dist/shard-modules/{typeModule.js → type.js} +2 -2
- package/dist/shards/backNextButton.js +173 -0
- package/dist/shards/{shard.js → base.js} +15 -15
- package/dist/shards/{buttonShard.js → button.js} +30 -52
- package/dist/shards/{cardShard.js → card.js} +4 -4
- package/dist/shards/{checkboxShard.js → checkbox.js} +8 -15
- package/dist/shards/{containerShard.js → container.js} +2 -2
- package/dist/shards/extensionsStorageBar.js +377 -0
- package/dist/shards/fileInput.js +180 -0
- package/dist/shards/flexContainer.js +30 -0
- package/dist/shards/gridContainer.js +34 -0
- package/dist/shards/{imageShard.js → image.js} +8 -6
- package/dist/shards/index.js +17 -13
- package/dist/shards/{inputShard.js → input.js} +8 -8
- package/dist/shards/{inputListShard.js → inputList.js} +22 -4
- package/dist/shards/select.js +201 -0
- package/dist/shards/svg.js +28 -0
- package/dist/shards/{tabsShard.js → tabs.js} +18 -19
- package/dist/shards/{textShard.js → text.js} +10 -6
- package/dist/shared.js +215 -0
- package/dist/styles.css +0 -51
- package/dist/subscreens/customTranslations.js +239 -0
- package/dist/subscreens/languageDetails.js +194 -0
- package/dist/subscreens/localization.js +115 -0
- package/dist/toast-themes/abdl.js +419 -0
- package/dist/toast-themes/anime.js +483 -0
- package/dist/toast-themes/base.js +40 -0
- package/dist/toast-themes/cyber.js +538 -0
- package/dist/toast-themes/default.js +282 -0
- package/dist/toastThemesDialog.js +274 -0
- package/dist/toasts.js +195 -174
- package/dist/types/cssVars.d.ts +1 -0
- package/dist/types/dialogs.d.ts +46 -18
- package/dist/types/events.d.ts +11 -2
- package/dist/types/global.d.ts +4 -3
- package/dist/types/index.d.ts +12 -19
- package/dist/types/localization.d.ts +25 -3
- package/dist/types/migration.d.ts +6 -0
- package/dist/types/modules/baseModule.d.ts +108 -0
- package/dist/types/modules/index.d.ts +4 -0
- package/dist/types/modules/loadingStrategy.d.ts +7 -0
- package/dist/types/modules/moduleContext.d.ts +10 -0
- package/dist/types/modules/modulesManager.d.ts +23 -0
- package/dist/types/{modSdk.d.ts → patching.d.ts} +2 -3
- package/dist/types/rpc.d.ts +72 -0
- package/dist/types/settings.d.ts +19 -0
- package/dist/types/settingsDialog.d.ts +4 -0
- package/dist/types/shard-modules/{attributesModule.d.ts → attributes.d.ts} +2 -2
- package/dist/types/shard-modules/{shardModule.d.ts → base.d.ts} +2 -2
- package/dist/types/shard-modules/{centerModule.d.ts → center.d.ts} +2 -1
- package/dist/types/shard-modules/{clickModule.d.ts → click.d.ts} +2 -2
- package/dist/types/shard-modules/{counterUpModule.d.ts → counterUp.d.ts} +2 -2
- package/dist/types/shard-modules/{dynamicClassModule.d.ts → dynamicClass.d.ts} +2 -2
- package/dist/types/shard-modules/index.d.ts +9 -9
- package/dist/types/shard-modules/{multiClickModule.d.ts → multiClick.d.ts} +2 -2
- package/dist/types/shard-modules/{styleModule.d.ts → style.d.ts} +2 -2
- package/dist/types/shard-modules/{typeModule.d.ts → type.d.ts} +2 -2
- package/dist/types/shards/{backNextButtonShard.d.ts → backNextButton.d.ts} +4 -3
- package/dist/types/shards/{shard.d.ts → base.d.ts} +3 -2
- package/dist/types/shards/{buttonShard.d.ts → button.d.ts} +6 -6
- package/dist/types/shards/{cardShard.d.ts → card.d.ts} +3 -3
- package/dist/types/shards/{checkboxShard.d.ts → checkbox.d.ts} +6 -6
- package/dist/types/shards/{containerShard.d.ts → container.d.ts} +2 -2
- package/dist/types/shards/extensionsStorageBar.d.ts +28 -0
- package/dist/types/shards/fileInput.d.ts +10 -0
- package/dist/types/shards/flexContainer.d.ts +14 -0
- package/dist/types/shards/gridContainer.d.ts +18 -0
- package/dist/types/shards/{imageShard.d.ts → image.d.ts} +2 -2
- package/dist/types/shards/index.d.ts +17 -13
- package/dist/types/shards/input.d.ts +14 -0
- package/dist/types/shards/{inputListShard.d.ts → inputList.d.ts} +3 -2
- package/dist/types/shards/{selectShard.d.ts → select.d.ts} +6 -4
- package/dist/types/shards/svg.d.ts +11 -0
- package/dist/types/shards/{tabsShard.d.ts → tabs.d.ts} +3 -6
- package/dist/types/shards/{textShard.d.ts → text.d.ts} +3 -3
- package/dist/types/shared.d.ts +7 -0
- package/dist/types/subscreens/customTranslations.d.ts +10 -0
- package/dist/types/subscreens/languageDetails.d.ts +14 -0
- package/dist/types/subscreens/localization.d.ts +5 -0
- package/dist/types/toast-themes/abdl.d.ts +9 -0
- package/dist/types/toast-themes/anime.d.ts +9 -0
- package/dist/types/toast-themes/base.d.ts +39 -0
- package/dist/types/toast-themes/cyber.d.ts +10 -0
- package/dist/types/toast-themes/default.d.ts +9 -0
- package/dist/types/toastThemesDialog.d.ts +1 -0
- package/dist/types/toasts.d.ts +48 -36
- package/dist/types/ui.d.ts +128 -49
- package/dist/types/validation.d.ts +5 -0
- package/dist/types/wardrobe.d.ts +1 -1
- package/dist/ui.js +414 -79
- package/dist/validation.js +79 -1
- package/dist/wardrobe.js +4 -4
- package/package.json +36 -14
- package/dist/core-subscreen/coreSubscreen.js +0 -81
- package/dist/core-subscreen/developmentSubscreen.js +0 -22
- package/dist/core-subscreen/generalSubscreen.js +0 -23
- package/dist/core-subscreen/mainSubscreen.js +0 -58
- package/dist/core-subscreen/shards/coreButtonShard.js +0 -30
- package/dist/core-subscreen/shards/coreCheckboxShard.js +0 -33
- package/dist/core-subscreen/shards/coreInputListShard.js +0 -38
- package/dist/core-subscreen/shards/coreSelectShard.js +0 -17
- package/dist/core-subscreen/shards/coreTextShard.js +0 -9
- package/dist/core-subscreen/shards/index.js +0 -5
- package/dist/core-subscreen/toastsSubscreen.js +0 -111
- package/dist/core.js +0 -192
- package/dist/shards/backNextButtonShard.js +0 -99
- package/dist/shards/selectShard.js +0 -131
- package/dist/shards/svgShard.js +0 -29
- package/dist/types/core-subscreen/coreSubscreen.d.ts +0 -15
- package/dist/types/core-subscreen/developmentSubscreen.d.ts +0 -5
- package/dist/types/core-subscreen/generalSubscreen.d.ts +0 -5
- package/dist/types/core-subscreen/mainSubscreen.d.ts +0 -6
- package/dist/types/core-subscreen/shards/coreButtonShard.d.ts +0 -5
- package/dist/types/core-subscreen/shards/coreCheckboxShard.d.ts +0 -6
- package/dist/types/core-subscreen/shards/coreInputListShard.d.ts +0 -6
- package/dist/types/core-subscreen/shards/coreSelectShard.d.ts +0 -5
- package/dist/types/core-subscreen/shards/coreTextShard.d.ts +0 -4
- package/dist/types/core-subscreen/shards/index.d.ts +0 -5
- package/dist/types/core-subscreen/toastsSubscreen.d.ts +0 -5
- package/dist/types/core.d.ts +0 -18
- package/dist/types/shards/inputShard.d.ts +0 -14
- package/dist/types/shards/svgShard.d.ts +0 -12
package/dist/changelogs.js
CHANGED
|
@@ -1,332 +1,665 @@
|
|
|
1
1
|
import { createElement, Crown, Heart } from "lucide";
|
|
2
2
|
import { MOD_DATA } from ".";
|
|
3
3
|
import { logger } from "./logging";
|
|
4
|
-
import {
|
|
4
|
+
import { getDynamicClass, getDynamicKeyframes, keydownManager } from "./ui";
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogCloseButton
|
|
8
|
+
} from "./dialogs";
|
|
5
9
|
import handIcon from "./assets/icons/hand.svg";
|
|
10
|
+
import { jsx, jsxs } from "tsx-dom/jsx-runtime";
|
|
6
11
|
const TAGS = {
|
|
7
12
|
fix: {
|
|
8
13
|
name: "Fix",
|
|
9
14
|
coloring: {
|
|
10
|
-
text: "#771515",
|
|
11
|
-
background: "#f9b4b4",
|
|
12
|
-
border: "#ca6565"
|
|
15
|
+
text: "var(--tmd-text, #771515)",
|
|
16
|
+
background: "var(--tmd-invalid, #f9b4b4)",
|
|
17
|
+
border: "var(--tmd-invalid-hover, #ca6565)"
|
|
13
18
|
}
|
|
14
19
|
},
|
|
15
20
|
chore: {
|
|
16
21
|
name: "Chore",
|
|
17
22
|
coloring: {
|
|
18
|
-
text: "#464646",
|
|
19
|
-
background: "#f2f2f2",
|
|
20
|
-
border: "#e2e2e2"
|
|
23
|
+
text: "var(--tmd-text, #464646)",
|
|
24
|
+
background: "var(--tmd-element-hint, #f2f2f2)",
|
|
25
|
+
border: "var(--tmd-element-hover, #e2e2e2)"
|
|
21
26
|
}
|
|
22
27
|
},
|
|
23
28
|
feature: {
|
|
24
29
|
name: "Feature",
|
|
25
30
|
coloring: {
|
|
26
|
-
text: "#147914",
|
|
27
|
-
background: "#
|
|
28
|
-
border: "#4eea4e"
|
|
31
|
+
text: "var(--tmd-text, #147914)",
|
|
32
|
+
background: "var(--tmd-allowed, #cbffcb)",
|
|
33
|
+
border: "var(--tmd-allowed-hover, #4eea4e)"
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
localization: {
|
|
32
37
|
name: "Localization",
|
|
33
38
|
coloring: {
|
|
34
|
-
text: "#09093e",
|
|
35
|
-
background: "#a1e0f4",
|
|
36
|
-
border: "#66adec"
|
|
39
|
+
text: "var(--tmd-text, #09093e)",
|
|
40
|
+
background: "var(--tmd-equipped, #a1e0f4)",
|
|
41
|
+
border: "var(--tmd-equipped-hover, #66adec)"
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
overflow: hidden;
|
|
64
|
-
display: flex;
|
|
65
|
-
flex-direction: column;
|
|
66
|
-
`;
|
|
67
|
-
const header = document.createElement("div");
|
|
68
|
-
header.style.cssText = `
|
|
69
|
-
padding: 0.65em;
|
|
70
|
-
border-bottom: 1px solid #e5e7eb;
|
|
71
|
-
display: flex;
|
|
72
|
-
justify-content: space-between;
|
|
73
|
-
align-items: center;
|
|
74
|
-
`;
|
|
75
|
-
const title = document.createElement("h2");
|
|
76
|
-
title.textContent = `Changelog \xB7 ${MOD_DATA.name} v${MOD_DATA.version}`;
|
|
77
|
-
title.style.cssText = "margin: 0; font-size: 1.5rem; font-weight: 600;";
|
|
78
|
-
const closeBtn = document.createElement("button");
|
|
79
|
-
closeBtn.textContent = "\u2715";
|
|
80
|
-
closeBtn.style.cssText = `
|
|
81
|
-
background: none;
|
|
82
|
-
border: none;
|
|
83
|
-
font-size: 1.5rem;
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
color: #6b7280;
|
|
86
|
-
padding: 4px 8px;
|
|
87
|
-
border-radius: 6px;
|
|
88
|
-
`;
|
|
89
|
-
closeBtn.onmouseover = () => closeBtn.style.color = "#1f2937";
|
|
90
|
-
closeBtn.onmouseout = () => closeBtn.style.color = "#6b7280";
|
|
91
|
-
header.appendChild(title);
|
|
92
|
-
header.appendChild(closeBtn);
|
|
93
|
-
const content = document.createElement("div");
|
|
94
|
-
content.style.cssText = `
|
|
95
|
-
padding: 16px 24px;
|
|
96
|
-
overflow-y: auto;
|
|
97
|
-
flex: 1;
|
|
98
|
-
`;
|
|
99
|
-
const contributorsTitle = document.createElement("p");
|
|
100
|
-
contributorsTitle.style.cssText = `
|
|
101
|
-
font-size: 22px;
|
|
102
|
-
margin: 0;
|
|
103
|
-
`;
|
|
104
|
-
contributorsTitle.textContent = "Contributors";
|
|
105
|
-
const contributorsList = document.createElement("div");
|
|
106
|
-
contributorsList.style.display = "flex";
|
|
107
|
-
contributorsList.style.justifyContent = "center";
|
|
108
|
-
contributorsList.style.flexWrap = "wrap";
|
|
109
|
-
contributorsList.style.gap = "16px";
|
|
110
|
-
contributorsList.style.padding = "16px";
|
|
111
|
-
for (const contributor of data.contributors) {
|
|
112
|
-
const container = document.createElement("div");
|
|
113
|
-
container.style.cssText = `
|
|
114
|
-
display: flex;
|
|
115
|
-
flex-direction: column;
|
|
116
|
-
align-items: center;
|
|
117
|
-
gap: 8px;
|
|
118
|
-
`;
|
|
119
|
-
const imageContainer = document.createElement("div");
|
|
120
|
-
imageContainer.style.cssText = `
|
|
121
|
-
position: relative;
|
|
122
|
-
width: 100px;
|
|
123
|
-
height: 100px;
|
|
124
|
-
border: 1px solid black;
|
|
125
|
-
border-radius: 50%;
|
|
126
|
-
overflow: hidden;
|
|
127
|
-
`;
|
|
128
|
-
const handGrabIcon = document.createElement("img");
|
|
129
|
-
handGrabIcon.src = handIcon;
|
|
130
|
-
handGrabIcon.style.cssText = `
|
|
131
|
-
position: absolute;
|
|
132
|
-
top: 0;
|
|
133
|
-
left: 35%;
|
|
134
|
-
width: 40px;
|
|
135
|
-
height: 40px;
|
|
136
|
-
line-height: 1;
|
|
137
|
-
pointer-events: none;
|
|
138
|
-
filter: drop-shadow(0 3px 4px rgba(0,0,0,0.45));
|
|
139
|
-
z-index: 10;
|
|
140
|
-
transform-origin: center bottom;
|
|
141
|
-
animation: zcStrokeUD 1.3s ease-in-out infinite;
|
|
142
|
-
`;
|
|
143
|
-
const hearts = [
|
|
144
|
-
{ left: "18%", top: "35%", duration: "2.5s", size: "16px" },
|
|
145
|
-
{ left: "25%", top: "10%", duration: "2s", size: "10px" },
|
|
146
|
-
{ left: "40%", top: "40%", duration: "1.0s", size: "12px" },
|
|
147
|
-
{ left: "55%", top: "28%", duration: "4.5s", size: "14px" },
|
|
148
|
-
{ left: "35%", top: "48%", duration: "1.0s", size: "15px" },
|
|
149
|
-
{ left: "65%", top: "42%", duration: "1.5s", size: "13px" }
|
|
150
|
-
];
|
|
151
|
-
hearts.forEach((h) => {
|
|
152
|
-
const heart = createElement(Heart, { fill: "#ff4d6d", stroke: "#ff4d6d" });
|
|
153
|
-
heart.style.cssText = `
|
|
154
|
-
position: absolute;
|
|
155
|
-
pointer-events: none;
|
|
156
|
-
z-index: 5;
|
|
157
|
-
animation: zcFloatHeart ${h.duration} ease-out infinite;
|
|
158
|
-
left: ${h.left};
|
|
159
|
-
top: ${h.top};
|
|
160
|
-
width: ${h.size};
|
|
161
|
-
height: ${h.size};
|
|
162
|
-
`;
|
|
163
|
-
imageContainer.append(heart);
|
|
164
|
-
});
|
|
165
|
-
const image = document.createElement("img");
|
|
166
|
-
image.src = contributor.avatar_url;
|
|
167
|
-
image.style.cssText = `
|
|
168
|
-
width: 100%;
|
|
169
|
-
height: 100%;
|
|
170
|
-
border-radius: 50%;
|
|
171
|
-
`;
|
|
172
|
-
imageContainer.append(image, handGrabIcon);
|
|
173
|
-
const name = document.createElement("span");
|
|
174
|
-
name.textContent = contributor.name;
|
|
175
|
-
name.style.textAlign = "center";
|
|
176
|
-
container.append(imageContainer, name);
|
|
177
|
-
if (contributor.is_owner) {
|
|
178
|
-
const ownerLabelContainer = document.createElement("div");
|
|
179
|
-
ownerLabelContainer.style.cssText = `
|
|
180
|
-
display: flex;
|
|
181
|
-
align-items: center;
|
|
182
|
-
gap: 6px;
|
|
183
|
-
border-radius: 6px;
|
|
184
|
-
padding: 2px 4px;
|
|
185
|
-
font-size: 10px;
|
|
186
|
-
background: #fbfb142e;
|
|
187
|
-
border: 1px solid #60600a;
|
|
188
|
-
`;
|
|
189
|
-
const crown = createElement(Crown, { width: "10px", height: "10px", fill: "#ffe300" });
|
|
190
|
-
const label = document.createElement("span");
|
|
191
|
-
label.textContent = "Project owner";
|
|
192
|
-
ownerLabelContainer.append(crown, label);
|
|
193
|
-
container.append(ownerLabelContainer);
|
|
194
|
-
}
|
|
195
|
-
contributorsList.append(container);
|
|
45
|
+
const HEARTS = [
|
|
46
|
+
{ left: "8%", top: "25%", duration: "2.5s", size: "15px", delay: "0s" },
|
|
47
|
+
{ left: "24%", top: "8%", duration: "2s", size: "11px", delay: "0.4s" },
|
|
48
|
+
{ left: "43%", top: "38%", duration: "3s", size: "13px", delay: "0.8s" },
|
|
49
|
+
{ left: "62%", top: "12%", duration: "2.2s", size: "16px", delay: "0.2s" },
|
|
50
|
+
{ left: "82%", top: "35%", duration: "2.8s", size: "12px", delay: "0.6s" }
|
|
51
|
+
];
|
|
52
|
+
const HEART_ANIMATION = getDynamicKeyframes("zcChangelogHeart", {
|
|
53
|
+
"0%": {
|
|
54
|
+
opacity: "0",
|
|
55
|
+
transform: "translateY(8px) scale(0.4) rotate(-15deg)"
|
|
56
|
+
},
|
|
57
|
+
"20%": {
|
|
58
|
+
opacity: "1",
|
|
59
|
+
transform: "translateY(0) scale(1) rotate(0deg)"
|
|
60
|
+
},
|
|
61
|
+
"75%": {
|
|
62
|
+
opacity: "0.9",
|
|
63
|
+
transform: "translateY(-20px) scale(1.1) rotate(15deg)"
|
|
64
|
+
},
|
|
65
|
+
"100%": {
|
|
66
|
+
opacity: "0",
|
|
67
|
+
transform: "translateY(-36px) scale(0.5) rotate(25deg)"
|
|
196
68
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
commitsList.style.gap = "16px";
|
|
207
|
-
commitsList.style.marginTop = "16px";
|
|
208
|
-
for (const commitData of data.changes) {
|
|
209
|
-
const commitElement = createCommitElement(data, commitData.sha);
|
|
210
|
-
if (commitElement) commitsList.append(commitElement);
|
|
69
|
+
});
|
|
70
|
+
const VERSION_ANIMATION = getDynamicKeyframes("zcChangelogVersion", {
|
|
71
|
+
"0%": {
|
|
72
|
+
opacity: "0",
|
|
73
|
+
transform: "translateY(12px)"
|
|
74
|
+
},
|
|
75
|
+
"100%": {
|
|
76
|
+
opacity: "1",
|
|
77
|
+
transform: "translateY(0)"
|
|
211
78
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
overlay.onclick = (e) => {
|
|
229
|
-
if (e.target === overlay) exitHandler();
|
|
230
|
-
};
|
|
231
|
-
closeBtn.onclick = exitHandler;
|
|
232
|
-
document.addEventListener("keydown", keyDownHandler, { capture: true });
|
|
79
|
+
});
|
|
80
|
+
function createHeart(h) {
|
|
81
|
+
const heart = createElement(Heart);
|
|
82
|
+
heart.setAttribute("fill", "#ff4d6d");
|
|
83
|
+
heart.setAttribute("stroke", "#ff4d6d");
|
|
84
|
+
heart.style.position = "absolute";
|
|
85
|
+
heart.style.pointerEvents = "none";
|
|
86
|
+
heart.style.zIndex = "5";
|
|
87
|
+
heart.style.animation = `${HEART_ANIMATION} ${h.duration} ease-in-out ${h.delay} infinite`;
|
|
88
|
+
heart.style.left = h.left;
|
|
89
|
+
heart.style.top = h.top;
|
|
90
|
+
heart.style.width = h.size;
|
|
91
|
+
heart.style.height = h.size;
|
|
92
|
+
return heart;
|
|
233
93
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
94
|
+
function createCrown() {
|
|
95
|
+
const crown = createElement(Crown);
|
|
96
|
+
crown.setAttribute("width", "12");
|
|
97
|
+
crown.setAttribute("height", "12");
|
|
98
|
+
crown.setAttribute("fill", "#ffe300");
|
|
99
|
+
return crown;
|
|
100
|
+
}
|
|
101
|
+
function formatDate(date) {
|
|
102
|
+
const parsedDate = new Date(date);
|
|
103
|
+
if (Number.isNaN(parsedDate.getTime())) {
|
|
104
|
+
return date;
|
|
105
|
+
}
|
|
106
|
+
return parsedDate.toLocaleDateString(void 0, {
|
|
107
|
+
year: "numeric",
|
|
108
|
+
month: "long",
|
|
109
|
+
day: "numeric"
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function createSectionIcon(icon) {
|
|
113
|
+
const sectionIconClassName = getDynamicClass({
|
|
114
|
+
base: {
|
|
115
|
+
display: "inline-flex",
|
|
116
|
+
alignItems: "center",
|
|
117
|
+
justifyContent: "center",
|
|
118
|
+
width: "27px",
|
|
119
|
+
height: "27px",
|
|
120
|
+
borderRadius: "8px",
|
|
121
|
+
color: "var(--tmd-text, #555555)"
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
const element = document.createElement("span");
|
|
125
|
+
element.className = sectionIconClassName;
|
|
126
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
127
|
+
svg.setAttribute("width", "16");
|
|
128
|
+
svg.setAttribute("height", "16");
|
|
129
|
+
svg.setAttribute("viewBox", "0 0 24 24");
|
|
130
|
+
svg.setAttribute("fill", "none");
|
|
131
|
+
svg.setAttribute("stroke", "currentColor");
|
|
132
|
+
svg.setAttribute("stroke-width", "2");
|
|
133
|
+
svg.setAttribute("stroke-linecap", "round");
|
|
134
|
+
svg.setAttribute("stroke-linejoin", "round");
|
|
135
|
+
if (icon === "users") {
|
|
136
|
+
svg.innerHTML = `
|
|
137
|
+
<path d="M16 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
|
|
138
|
+
<circle cx="10" cy="7" r="4"/>
|
|
139
|
+
<path d="M20 21v-2a4 4 0 0 0-3-3.87"/>
|
|
140
|
+
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
|
|
270
141
|
`;
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
width: 48px;
|
|
276
|
-
height: 48px;
|
|
277
|
-
border-radius: 50%;
|
|
278
|
-
flex-shrink: 0;
|
|
142
|
+
} else {
|
|
143
|
+
svg.innerHTML = `
|
|
144
|
+
<path d="M12 20h9"/>
|
|
145
|
+
<path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L8 18l-4 1 1-4Z"/>
|
|
279
146
|
`;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
147
|
+
}
|
|
148
|
+
element.append(svg);
|
|
149
|
+
return element;
|
|
150
|
+
}
|
|
151
|
+
function showChangelogModal() {
|
|
152
|
+
const changelog = MOD_DATA.changelog;
|
|
153
|
+
if (!changelog) return;
|
|
154
|
+
const versions = [...changelog.data].reverse();
|
|
155
|
+
const headerClassName = getDynamicClass({
|
|
156
|
+
base: {
|
|
157
|
+
display: "flex",
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
justifyContent: "space-between",
|
|
160
|
+
gap: "1em",
|
|
161
|
+
paddingBottom: "1em",
|
|
162
|
+
borderBottom: "1px solid var(--tmd-element-hover, #e5e7eb)",
|
|
163
|
+
flexShrink: "0"
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const titleClassName = getDynamicClass({
|
|
167
|
+
base: {
|
|
168
|
+
margin: "0",
|
|
169
|
+
color: "var(--tmd-text, #1f2937)",
|
|
170
|
+
fontSize: "1.5em",
|
|
171
|
+
fontWeight: "800",
|
|
172
|
+
letterSpacing: "-0.03em"
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
const subtitleClassName = getDynamicClass({
|
|
176
|
+
base: {
|
|
177
|
+
display: "block",
|
|
178
|
+
marginTop: "0.25em",
|
|
179
|
+
color: "var(--tmd-text-disabled, #888888)",
|
|
180
|
+
fontSize: "0.85em"
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
const scrollClassName = getDynamicClass({
|
|
184
|
+
base: {
|
|
185
|
+
display: "flex",
|
|
186
|
+
flexDirection: "column",
|
|
187
|
+
gap: "1.8em",
|
|
188
|
+
flex: "1 1 auto",
|
|
189
|
+
minHeight: "0",
|
|
190
|
+
overflowY: "auto",
|
|
191
|
+
overflowX: "hidden",
|
|
192
|
+
padding: "0.7em 0.3em 1em"
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
const emptyClassName = getDynamicClass({
|
|
196
|
+
base: {
|
|
197
|
+
display: "flex",
|
|
198
|
+
flexDirection: "column",
|
|
199
|
+
alignItems: "center",
|
|
200
|
+
justifyContent: "center",
|
|
201
|
+
gap: "0.7em",
|
|
202
|
+
padding: "3em 1em",
|
|
203
|
+
color: "var(--tmd-text-disabled, #888888)",
|
|
204
|
+
textAlign: "center"
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
let dialog;
|
|
208
|
+
const unregisterEscape = keydownManager.register("Escape", () => {
|
|
209
|
+
if (dialog.open) {
|
|
210
|
+
dialog.close();
|
|
211
|
+
}
|
|
212
|
+
dialog.remove();
|
|
213
|
+
});
|
|
214
|
+
const dialogContent = /* @__PURE__ */ jsxs(Dialog, { wide: true, children: [
|
|
215
|
+
/* @__PURE__ */ jsxs("div", { class: headerClassName, children: [
|
|
216
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
217
|
+
/* @__PURE__ */ jsx("h2", { class: titleClassName, children: "Changelog" }),
|
|
218
|
+
/* @__PURE__ */ jsxs("span", { class: subtitleClassName, children: [
|
|
219
|
+
MOD_DATA.name,
|
|
220
|
+
" \xB7 ",
|
|
221
|
+
versions.length,
|
|
222
|
+
" releases"
|
|
223
|
+
] })
|
|
224
|
+
] }),
|
|
225
|
+
/* @__PURE__ */ jsx(DialogCloseButton, { onClick: () => dialog.close() })
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ jsxs("div", { class: scrollClassName, children: [
|
|
228
|
+
versions.length === 0 && /* @__PURE__ */ jsxs("div", { class: emptyClassName, children: [
|
|
229
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "2.5em" }, children: "\u2661" }),
|
|
230
|
+
/* @__PURE__ */ jsx("strong", { children: "No changelog entries yet" }),
|
|
231
|
+
/* @__PURE__ */ jsx("span", { children: "There are no published changes for this mod." })
|
|
232
|
+
] }),
|
|
233
|
+
versions.map((versionData, versionIndex) => /* @__PURE__ */ jsx(
|
|
234
|
+
VersionSection,
|
|
235
|
+
{
|
|
236
|
+
versionData,
|
|
237
|
+
isLatest: versionIndex === 0
|
|
238
|
+
}
|
|
239
|
+
))
|
|
240
|
+
] })
|
|
241
|
+
] });
|
|
242
|
+
dialog = dialogContent;
|
|
243
|
+
dialog.setAttribute("data-zc-dialog-type", "changelog");
|
|
244
|
+
dialog.addEventListener("cancel", (e) => {
|
|
245
|
+
e.preventDefault();
|
|
246
|
+
});
|
|
247
|
+
dialog.addEventListener("close", () => {
|
|
248
|
+
unregisterEscape();
|
|
249
|
+
});
|
|
250
|
+
dialog.addEventListener("click", (e) => {
|
|
251
|
+
if (e.target === dialog) {
|
|
252
|
+
dialog.close();
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
document.body.append(dialog);
|
|
256
|
+
dialog.showModal();
|
|
257
|
+
}
|
|
258
|
+
function VersionSection({ versionData, isLatest }) {
|
|
259
|
+
const versionClassName = getDynamicClass({
|
|
260
|
+
base: {
|
|
261
|
+
display: "flex",
|
|
262
|
+
flexDirection: "column",
|
|
263
|
+
gap: "1.1em",
|
|
264
|
+
padding: "0 0 1.5em",
|
|
265
|
+
animation: `${VERSION_ANIMATION} 0.45s ease both`
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
const versionHeaderClassName = getDynamicClass({
|
|
269
|
+
base: {
|
|
270
|
+
display: "flex",
|
|
271
|
+
alignItems: "center",
|
|
272
|
+
gap: "0.7em",
|
|
273
|
+
flexWrap: "wrap"
|
|
274
|
+
},
|
|
275
|
+
"::after": {
|
|
276
|
+
content: '""',
|
|
277
|
+
flex: "1 1 auto",
|
|
278
|
+
minWidth: "30px",
|
|
279
|
+
height: "4px",
|
|
280
|
+
backgroundImage: "radial-gradient(circle, var(--tmd-text-disabled, black) 1px, transparent 1.5px)",
|
|
281
|
+
backgroundSize: "8px 4px",
|
|
282
|
+
backgroundRepeat: "repeat-x",
|
|
283
|
+
opacity: "0.65"
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
const versionTitleClassName = getDynamicClass({
|
|
287
|
+
base: {
|
|
288
|
+
color: "var(--tmd-accent, #1f2937)",
|
|
289
|
+
fontSize: "1em",
|
|
290
|
+
fontWeight: "800"
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
const versionDateClassName = getDynamicClass({
|
|
294
|
+
base: {
|
|
295
|
+
color: "var(--tmd-text, #888888)",
|
|
296
|
+
fontSize: "1em",
|
|
297
|
+
whiteSpace: "nowrap"
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
const latestClassName = getDynamicClass({
|
|
301
|
+
base: {
|
|
302
|
+
fontSize: "0.65em",
|
|
303
|
+
fontWeight: "700",
|
|
304
|
+
color: "var(--tmd-allowed, #fff)",
|
|
305
|
+
background: "var(--tmd-element-hint, #45be62)",
|
|
306
|
+
padding: "0.3em 0.55em",
|
|
307
|
+
borderRadius: "5px"
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
const sectionClassName = getDynamicClass({
|
|
311
|
+
base: {
|
|
312
|
+
display: "flex",
|
|
313
|
+
flexDirection: "column",
|
|
314
|
+
gap: "0.8em"
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
const sectionHeaderClassName = getDynamicClass({
|
|
318
|
+
base: {
|
|
319
|
+
display: "flex",
|
|
320
|
+
alignItems: "center",
|
|
321
|
+
gap: "0.55em",
|
|
322
|
+
color: "var(--tmd-text, #303030)",
|
|
323
|
+
fontSize: "1em",
|
|
324
|
+
fontWeight: "750"
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
const contributorsClassName = getDynamicClass({
|
|
328
|
+
base: {
|
|
329
|
+
display: "flex",
|
|
330
|
+
alignItems: "flex-start",
|
|
331
|
+
flexWrap: "wrap",
|
|
332
|
+
gap: "1.2em",
|
|
333
|
+
padding: "0.3em 0.1em"
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
const contributorClassName = getDynamicClass({
|
|
337
|
+
base: {
|
|
338
|
+
display: "flex",
|
|
339
|
+
flexDirection: "column",
|
|
340
|
+
alignItems: "center",
|
|
341
|
+
gap: "0.5em",
|
|
342
|
+
width: "150px",
|
|
343
|
+
color: "var(--tmd-text, #1f2937)"
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
const avatarContainerClassName = getDynamicClass({
|
|
347
|
+
base: {
|
|
348
|
+
position: "relative",
|
|
349
|
+
width: "114px",
|
|
350
|
+
height: "114px",
|
|
351
|
+
border: "2px solid var(--tmd-accent, #d1d5db)",
|
|
352
|
+
borderRadius: "50%",
|
|
353
|
+
overflow: "hidden",
|
|
354
|
+
background: "var(--tmd-element-hint, #f3f4f6)",
|
|
355
|
+
boxShadow: "0 3px 12px rgba(0, 0, 0, 0.12)"
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
const avatarClassName = getDynamicClass({
|
|
359
|
+
base: {
|
|
360
|
+
display: "block",
|
|
361
|
+
width: "100%",
|
|
362
|
+
height: "100%",
|
|
363
|
+
objectFit: "cover",
|
|
364
|
+
borderRadius: "50%"
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
const handClassName = getDynamicClass({
|
|
368
|
+
base: {
|
|
369
|
+
position: "absolute",
|
|
370
|
+
top: "0",
|
|
371
|
+
left: "35%",
|
|
372
|
+
width: "40px",
|
|
373
|
+
height: "40px",
|
|
374
|
+
lineHeight: "1",
|
|
375
|
+
pointerEvents: "none",
|
|
376
|
+
filter: "drop-shadow(0 3px 4px rgba(0,0,0,0.45))",
|
|
377
|
+
zIndex: "10",
|
|
378
|
+
transformOrigin: "center bottom",
|
|
379
|
+
animation: "zcStrokeUD 1.3s ease-in-out infinite"
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
const contributorNameClassName = getDynamicClass({
|
|
383
|
+
base: {
|
|
384
|
+
color: "var(--tmd-text, #1f2937)",
|
|
385
|
+
fontWeight: "650",
|
|
386
|
+
fontSize: "0.9em",
|
|
387
|
+
textAlign: "center",
|
|
388
|
+
overflowWrap: "anywhere"
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
const ownerClassName = getDynamicClass({
|
|
392
|
+
base: {
|
|
393
|
+
display: "flex",
|
|
394
|
+
alignItems: "center",
|
|
395
|
+
gap: "0.35em",
|
|
396
|
+
borderRadius: "6px",
|
|
397
|
+
padding: "0.25em 0.5em",
|
|
398
|
+
fontSize: "0.68em",
|
|
399
|
+
fontWeight: "700",
|
|
400
|
+
background: "var(--tmd-crafted, rgba(255, 255, 14, 0.34))",
|
|
401
|
+
border: "1px solid var(--tmd-crafted-hover, rgba(216, 216, 48, 1))",
|
|
402
|
+
color: "var(--tmd-text, #60600a)"
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
const changesClassName = getDynamicClass({
|
|
406
|
+
base: {
|
|
407
|
+
display: "flex",
|
|
408
|
+
flexDirection: "column",
|
|
409
|
+
gap: "0.65em"
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
return /* @__PURE__ */ jsxs("section", { class: versionClassName, children: [
|
|
413
|
+
/* @__PURE__ */ jsxs("div", { class: versionHeaderClassName, children: [
|
|
414
|
+
/* @__PURE__ */ jsxs("span", { class: versionTitleClassName, children: [
|
|
415
|
+
"v",
|
|
416
|
+
versionData.version
|
|
417
|
+
] }),
|
|
418
|
+
/* @__PURE__ */ jsx("span", { class: versionDateClassName, children: formatDate(versionData.date) }),
|
|
419
|
+
isLatest && /* @__PURE__ */ jsx("span", { class: latestClassName, children: "Latest" })
|
|
420
|
+
] }),
|
|
421
|
+
/* @__PURE__ */ jsxs("section", { class: sectionClassName, children: [
|
|
422
|
+
/* @__PURE__ */ jsxs("div", { class: sectionHeaderClassName, children: [
|
|
423
|
+
createSectionIcon("users"),
|
|
424
|
+
/* @__PURE__ */ jsx("span", { children: "Contributors" }),
|
|
425
|
+
/* @__PURE__ */ jsxs(
|
|
426
|
+
"span",
|
|
427
|
+
{
|
|
428
|
+
style: {
|
|
429
|
+
color: "var(--tmd-text-disabled, #888888)",
|
|
430
|
+
fontSize: "0.8em",
|
|
431
|
+
fontWeight: "500"
|
|
432
|
+
},
|
|
433
|
+
children: [
|
|
434
|
+
"(",
|
|
435
|
+
versionData.contributors.length,
|
|
436
|
+
")"
|
|
437
|
+
]
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
] }),
|
|
441
|
+
/* @__PURE__ */ jsx("div", { class: contributorsClassName, children: versionData.contributors.map((contributor) => /* @__PURE__ */ jsxs("div", { class: contributorClassName, children: [
|
|
442
|
+
/* @__PURE__ */ jsxs("div", { class: avatarContainerClassName, children: [
|
|
443
|
+
HEARTS.map((heart) => createHeart(heart)),
|
|
444
|
+
/* @__PURE__ */ jsx(
|
|
445
|
+
"img",
|
|
446
|
+
{
|
|
447
|
+
src: contributor.avatar_url,
|
|
448
|
+
class: avatarClassName,
|
|
449
|
+
alt: contributor.name
|
|
450
|
+
}
|
|
451
|
+
),
|
|
452
|
+
/* @__PURE__ */ jsx(
|
|
453
|
+
"img",
|
|
454
|
+
{
|
|
455
|
+
src: handIcon,
|
|
456
|
+
class: handClassName,
|
|
457
|
+
alt: ""
|
|
458
|
+
}
|
|
459
|
+
)
|
|
460
|
+
] }),
|
|
461
|
+
/* @__PURE__ */ jsx("span", { class: contributorNameClassName, children: contributor.name }),
|
|
462
|
+
contributor.is_owner && /* @__PURE__ */ jsxs("div", { class: ownerClassName, children: [
|
|
463
|
+
createCrown(),
|
|
464
|
+
/* @__PURE__ */ jsx("span", { children: "Project owner" })
|
|
465
|
+
] })
|
|
466
|
+
] })) })
|
|
467
|
+
] }),
|
|
468
|
+
/* @__PURE__ */ jsxs("section", { class: sectionClassName, children: [
|
|
469
|
+
/* @__PURE__ */ jsxs("div", { class: sectionHeaderClassName, children: [
|
|
470
|
+
createSectionIcon("changes"),
|
|
471
|
+
/* @__PURE__ */ jsx("span", { children: "Changes" }),
|
|
472
|
+
/* @__PURE__ */ jsxs(
|
|
473
|
+
"span",
|
|
474
|
+
{
|
|
475
|
+
style: {
|
|
476
|
+
color: "var(--tmd-text-disabled, #888888)",
|
|
477
|
+
fontSize: "0.8em",
|
|
478
|
+
fontWeight: "500"
|
|
479
|
+
},
|
|
480
|
+
children: [
|
|
481
|
+
"(",
|
|
482
|
+
versionData.changes.length,
|
|
483
|
+
")"
|
|
484
|
+
]
|
|
485
|
+
}
|
|
486
|
+
)
|
|
487
|
+
] }),
|
|
488
|
+
/* @__PURE__ */ jsx("div", { class: changesClassName, children: versionData.changes.map((commit) => /* @__PURE__ */ jsx(
|
|
489
|
+
CommitCard,
|
|
490
|
+
{
|
|
491
|
+
versionData,
|
|
492
|
+
commitSha: commit.sha
|
|
317
493
|
}
|
|
318
|
-
})
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
494
|
+
)) })
|
|
495
|
+
] })
|
|
496
|
+
] });
|
|
497
|
+
}
|
|
498
|
+
function CommitCard({ versionData, commitSha }) {
|
|
499
|
+
const commitClassName = getDynamicClass({
|
|
500
|
+
base: {
|
|
501
|
+
position: "relative",
|
|
502
|
+
display: "flex",
|
|
503
|
+
alignItems: "center",
|
|
504
|
+
gap: "12px",
|
|
505
|
+
padding: "12px",
|
|
506
|
+
border: "2px solid var(--tmd-element-hover, #e5e7eb)",
|
|
507
|
+
borderRadius: "8px",
|
|
508
|
+
background: "var(--tmd-element, #f7f7f7)",
|
|
509
|
+
color: "var(--tmd-text, #1f2937)",
|
|
510
|
+
cursor: "pointer"
|
|
511
|
+
},
|
|
512
|
+
hover: {
|
|
513
|
+
borderColor: "var(--tmd-accent, #3b82f6)"
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
const commitAvatarClassName = getDynamicClass({
|
|
517
|
+
base: {
|
|
518
|
+
display: "block",
|
|
519
|
+
flex: "0 0 64px",
|
|
520
|
+
width: "64px",
|
|
521
|
+
height: "64px",
|
|
522
|
+
borderRadius: "50%",
|
|
523
|
+
objectFit: "cover",
|
|
524
|
+
background: "var(--tmd-element-hint, #f3f4f6)"
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
const commitBodyClassName = getDynamicClass({
|
|
528
|
+
base: {
|
|
529
|
+
display: "flex",
|
|
530
|
+
flexDirection: "column",
|
|
531
|
+
justifyContent: "center",
|
|
532
|
+
flex: "1 1 auto",
|
|
533
|
+
alignSelf: "stretch",
|
|
534
|
+
minWidth: "0",
|
|
535
|
+
gap: "0.65em",
|
|
536
|
+
padding: "0.15em 0 0.8em"
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
const commitInfoClassName = getDynamicClass({
|
|
540
|
+
base: {
|
|
541
|
+
display: "flex",
|
|
542
|
+
flexDirection: "column",
|
|
543
|
+
gap: "0.25em",
|
|
544
|
+
minWidth: "0"
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
const commitAuthorClassName = getDynamicClass({
|
|
548
|
+
base: {
|
|
549
|
+
color: "var(--tmd-text, #1f2937)",
|
|
550
|
+
fontWeight: "750",
|
|
551
|
+
fontSize: "1em"
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
const commitMessageClassName = getDynamicClass({
|
|
555
|
+
base: {
|
|
556
|
+
color: "var(--tmd-text, #374151)",
|
|
557
|
+
lineHeight: "1.45",
|
|
558
|
+
overflowWrap: "anywhere",
|
|
559
|
+
fontSize: "0.95em"
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
const tagsClassName = getDynamicClass({
|
|
563
|
+
base: {
|
|
564
|
+
display: "flex",
|
|
565
|
+
flexWrap: "wrap",
|
|
566
|
+
gap: "0.35em",
|
|
567
|
+
position: "absolute",
|
|
568
|
+
right: "0.85em",
|
|
569
|
+
top: "0.65em"
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
const tagClassName = getDynamicClass({
|
|
573
|
+
base: {
|
|
574
|
+
display: "inline-flex",
|
|
575
|
+
alignItems: "center",
|
|
576
|
+
padding: "0.2em 0.55em",
|
|
577
|
+
borderRadius: "5px",
|
|
578
|
+
fontSize: "0.72em",
|
|
579
|
+
fontWeight: "750",
|
|
580
|
+
borderWidth: "1px",
|
|
581
|
+
borderStyle: "solid",
|
|
582
|
+
whiteSpace: "nowrap"
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
const commitShaClassName = getDynamicClass({
|
|
586
|
+
base: {
|
|
587
|
+
position: "absolute",
|
|
588
|
+
right: "0.85em",
|
|
589
|
+
bottom: "0.65em",
|
|
590
|
+
color: "var(--tmd-text-disabled, #888888)",
|
|
591
|
+
fontSize: "0.7em",
|
|
592
|
+
whiteSpace: "nowrap"
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
const commitNoteClassName = getDynamicClass({
|
|
596
|
+
base: {
|
|
597
|
+
padding: "0.55em 0.7em",
|
|
598
|
+
borderLeft: "3px solid var(--tmd-accent, #a1a1aa)",
|
|
599
|
+
background: "var(--tmd-element-hover, #ffffff)",
|
|
600
|
+
color: "var(--tmd-text-disabled, #555555)",
|
|
601
|
+
fontSize: "0.85em",
|
|
602
|
+
lineHeight: "1.45",
|
|
603
|
+
overflowWrap: "anywhere"
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
const commit = versionData.changes.find((item) => item.sha === commitSha);
|
|
607
|
+
if (!commit) {
|
|
608
|
+
logger.warn(`Commit ${commitSha} is not exists in changelog bundle`);
|
|
328
609
|
return null;
|
|
329
610
|
}
|
|
611
|
+
const author = versionData.contributors.find((contributor) => contributor.name === commit.author);
|
|
612
|
+
if (!author) {
|
|
613
|
+
logger.warn(`Author ${commit.author} is not exists in changelog bundle`);
|
|
614
|
+
return null;
|
|
615
|
+
}
|
|
616
|
+
return /* @__PURE__ */ jsxs(
|
|
617
|
+
"div",
|
|
618
|
+
{
|
|
619
|
+
class: commitClassName,
|
|
620
|
+
onClick: () => {
|
|
621
|
+
window.open(commit.commit_url, "_blank", "noopener,noreferrer");
|
|
622
|
+
},
|
|
623
|
+
title: "Open commit on GitHub",
|
|
624
|
+
children: [
|
|
625
|
+
/* @__PURE__ */ jsx(
|
|
626
|
+
"img",
|
|
627
|
+
{
|
|
628
|
+
src: author.avatar_url,
|
|
629
|
+
class: commitAvatarClassName,
|
|
630
|
+
alt: author.name
|
|
631
|
+
}
|
|
632
|
+
),
|
|
633
|
+
/* @__PURE__ */ jsxs("div", { class: commitBodyClassName, children: [
|
|
634
|
+
/* @__PURE__ */ jsxs("div", { class: commitInfoClassName, children: [
|
|
635
|
+
/* @__PURE__ */ jsx("span", { class: commitAuthorClassName, children: author.name }),
|
|
636
|
+
/* @__PURE__ */ jsx("span", { class: commitMessageClassName, children: commit.message })
|
|
637
|
+
] }),
|
|
638
|
+
commit.note && /* @__PURE__ */ jsx("div", { class: commitNoteClassName, children: commit.note })
|
|
639
|
+
] }),
|
|
640
|
+
/* @__PURE__ */ jsx("div", { class: tagsClassName, children: commit.tags.map((tag) => {
|
|
641
|
+
const tagData = TAGS[tag];
|
|
642
|
+
if (!tagData) return null;
|
|
643
|
+
return /* @__PURE__ */ jsx(
|
|
644
|
+
"span",
|
|
645
|
+
{
|
|
646
|
+
class: tagClassName,
|
|
647
|
+
style: {
|
|
648
|
+
background: tagData.coloring.background,
|
|
649
|
+
color: tagData.coloring.text,
|
|
650
|
+
borderColor: tagData.coloring.border
|
|
651
|
+
},
|
|
652
|
+
children: tagData.name
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
}) }),
|
|
656
|
+
/* @__PURE__ */ jsxs("span", { class: commitShaClassName, children: [
|
|
657
|
+
commit.sha.slice(0, 7),
|
|
658
|
+
" \u2197"
|
|
659
|
+
] })
|
|
660
|
+
]
|
|
661
|
+
}
|
|
662
|
+
);
|
|
330
663
|
}
|
|
331
664
|
export {
|
|
332
665
|
showChangelogModal
|