@starcried/starlite-inochi2d 0.1.0-alpha.2 → 0.1.0
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.en.md +41 -0
- package/README.md +5 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -1
- package/dist/controller.d.ts.map +1 -1
- package/dist/controller.js +110 -11
- package/dist/controller.js.map +1 -1
- package/dist/dialogue.d.ts +1 -1
- package/dist/dialogue.d.ts.map +1 -1
- package/dist/dialogue.js +110 -9
- package/dist/dialogue.js.map +1 -1
- package/dist/hit-mask.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/locale.d.ts +2 -0
- package/dist/locale.d.ts.map +1 -0
- package/dist/locale.js +16 -0
- package/dist/locale.js.map +1 -0
- package/dist/performance.d.ts +2 -0
- package/dist/performance.d.ts.map +1 -0
- package/dist/performance.js +114 -0
- package/dist/performance.js.map +1 -0
- package/dist/quick-settings.d.ts +2 -0
- package/dist/quick-settings.d.ts.map +1 -0
- package/dist/quick-settings.js +541 -0
- package/dist/quick-settings.js.map +1 -0
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
// ../core/dist/locale.js
|
|
2
|
+
function resolveLocale(language) {
|
|
3
|
+
const value = Array.isArray(language) ? language[0] : language;
|
|
4
|
+
if (typeof value !== "string" || !value.trim())
|
|
5
|
+
return "zh-CN";
|
|
6
|
+
return /^zh(?:[-_]|$)/i.test(value.trim()) ? "zh-CN" : "en";
|
|
7
|
+
}
|
|
8
|
+
function validateLocale(value) {
|
|
9
|
+
if (value !== void 0 && value !== "zh-CN" && value !== "en") {
|
|
10
|
+
throw new Error("locale must be zh-CN or en");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ../core/dist/quick-settings.js
|
|
15
|
+
var STYLE = `
|
|
16
|
+
[data-starlite-menu]{position:fixed;box-sizing:border-box;width:300px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:auto;padding:14px;border:1px solid #9ba9c740;border-radius:16px;background:#1c2130f5;color:#f0f3ff;box-shadow:0 14px 48px #0005;font:14px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;z-index:2147483647;pointer-events:auto;user-select:none;backdrop-filter:blur(16px);color-scheme:dark;overscroll-behavior:contain}
|
|
17
|
+
[data-starlite-menu][hidden]{display:none!important}
|
|
18
|
+
[data-starlite-menu] *{box-sizing:border-box}
|
|
19
|
+
[data-starlite-menu] button,[data-starlite-menu] input{font:inherit;accent-color:#9faeff}
|
|
20
|
+
[data-starlite-menu] button{color:inherit;background:#ffffff09;border:1px solid #b4bfd528;border-radius:8px;padding:7px 9px}
|
|
21
|
+
[data-starlite-menu] button{cursor:pointer}
|
|
22
|
+
[data-starlite-menu] button:hover{background:#a7b3ff24}
|
|
23
|
+
[data-starlite-menu] :focus-visible{outline:2px solid #b3bfff;outline-offset:2px}
|
|
24
|
+
[data-starlite-menu] :disabled{opacity:.45;cursor:default}
|
|
25
|
+
[data-starlite-menu] .starlite-menu__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-weight:650;letter-spacing:.02em}
|
|
26
|
+
[data-starlite-menu] .starlite-menu__close{border:0;background:transparent;padding:2px 7px;font-size:20px;line-height:1.25}
|
|
27
|
+
[data-starlite-menu] [role=tablist]{display:flex;gap:4px;background:#0002;border-radius:9px;padding:3px;margin-bottom:8px}
|
|
28
|
+
[data-starlite-menu] [role=tab]{flex:1;border:0;background:transparent;padding:5px}
|
|
29
|
+
[data-starlite-menu] [role=tab][aria-selected=true]{background:#a7b3ff25;color:#dbe1ff}
|
|
30
|
+
[data-starlite-menu] .starlite-menu__row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 2px;border-bottom:1px solid #b4bfd514;min-height:44px}
|
|
31
|
+
[data-starlite-menu] .starlite-menu__row:last-child{border-bottom:0}
|
|
32
|
+
[data-starlite-menu] .starlite-menu__text{flex:1;min-width:0}
|
|
33
|
+
[data-starlite-menu] .starlite-menu__description{display:block;font-size:12px;color:#b1bbd2;margin-top:2px;font-weight:400}
|
|
34
|
+
[data-starlite-menu] .starlite-menu__toggle{appearance:none;flex:none;width:34px;height:20px;border-radius:12px;background:#69738a;cursor:pointer;position:relative;margin:0}
|
|
35
|
+
[data-starlite-menu] .starlite-menu__toggle:before{content:"";position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .12s}
|
|
36
|
+
[data-starlite-menu] .starlite-menu__toggle:checked{background:#899cf6}
|
|
37
|
+
[data-starlite-menu] .starlite-menu__toggle:checked:before{transform:translateX(14px)}
|
|
38
|
+
[data-starlite-menu] .starlite-menu__range-row{display:block}
|
|
39
|
+
[data-starlite-menu] .starlite-menu__range-label{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px}
|
|
40
|
+
[data-starlite-menu] input[type=range]{display:block;width:100%;margin:0;cursor:pointer}
|
|
41
|
+
[data-starlite-menu] output{font-variant-numeric:tabular-nums;color:#c8d2ff}
|
|
42
|
+
[data-starlite-menu] .starlite-menu__select-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(90px,150px)}
|
|
43
|
+
[data-starlite-menu] .starlite-menu__select{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;text-align:left;background:#30384f;color:#f0f3ff;border-color:#7d8baa70}
|
|
44
|
+
[data-starlite-menu] .starlite-menu__select:after{content:"\u2304";flex:none;color:#c8d2ff;font-size:15px;line-height:1}
|
|
45
|
+
[data-starlite-menu] .starlite-menu__select[aria-expanded=true]{background:#39445f;border-color:#a7b3ff}
|
|
46
|
+
[data-starlite-menu] .starlite-menu__select-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
47
|
+
[data-starlite-menu] .starlite-menu__options{grid-column:1/-1;display:flex;flex-direction:column;gap:3px;margin-top:-4px;padding:5px;border:1px solid #7d8baa70;border-radius:10px;background:#20283b;box-shadow:0 5px 15px #0003}
|
|
48
|
+
[data-starlite-menu] .starlite-menu__options[hidden]{display:none!important}
|
|
49
|
+
[data-starlite-menu] .starlite-menu__option{display:flex;justify-content:space-between;gap:12px;width:100%;border:0;border-radius:6px;background:#20283b;color:#f0f3ff;text-align:left;padding:8px 10px}
|
|
50
|
+
[data-starlite-menu] .starlite-menu__option:after{content:"";width:12px;flex:none}
|
|
51
|
+
[data-starlite-menu] .starlite-menu__option[aria-selected=true]{background:#3a476a;color:#fff}
|
|
52
|
+
[data-starlite-menu] .starlite-menu__option[aria-selected=true]:after{content:"\u2713";color:#c8d2ff}
|
|
53
|
+
[data-starlite-menu] .starlite-menu__option:hover,[data-starlite-menu] .starlite-menu__option[data-active=true]{background:#4a587e;color:#fff}
|
|
54
|
+
[data-starlite-menu] .starlite-menu__action{display:block;width:100%;text-align:left;border:0;background:transparent;padding:8px 2px}
|
|
55
|
+
[data-starlite-menu] .starlite-menu__status{margin:8px 0 0;color:#ffc7c7;font-size:12px}
|
|
56
|
+
@media(prefers-reduced-motion:reduce){[data-starlite-menu] *{transition:none!important}}
|
|
57
|
+
`;
|
|
58
|
+
var instanceId = 0;
|
|
59
|
+
var QuickSettingsMenu = class {
|
|
60
|
+
element = document.createElement("section");
|
|
61
|
+
#options;
|
|
62
|
+
#activeTab;
|
|
63
|
+
#structure = "";
|
|
64
|
+
#controls = /* @__PURE__ */ new Map();
|
|
65
|
+
#selects = /* @__PURE__ */ new Map();
|
|
66
|
+
#openSelect;
|
|
67
|
+
#draggingRanges = /* @__PURE__ */ new Map();
|
|
68
|
+
#outputs = /* @__PURE__ */ new Map();
|
|
69
|
+
#pending = /* @__PURE__ */ new Map();
|
|
70
|
+
#generation = 0;
|
|
71
|
+
#destroyed = false;
|
|
72
|
+
#x = 0;
|
|
73
|
+
#y = 0;
|
|
74
|
+
#previousFocus;
|
|
75
|
+
#id = `starlite-menu-${++instanceId}`;
|
|
76
|
+
#outside = (event) => {
|
|
77
|
+
if (!this.isOpen)
|
|
78
|
+
return;
|
|
79
|
+
const path = event.composedPath();
|
|
80
|
+
if (!path.includes(this.element))
|
|
81
|
+
this.close();
|
|
82
|
+
else if (this.#openSelect) {
|
|
83
|
+
const select = this.#selects.get(this.#openSelect);
|
|
84
|
+
if (!path.includes(select.trigger) && !path.includes(select.listbox))
|
|
85
|
+
this.#closeSelect();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
#key = (event) => {
|
|
89
|
+
if (this.isOpen && event.key === "Escape") {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
this.close();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
#rangeEnd = (event) => {
|
|
95
|
+
for (const [id, pointerId] of this.#draggingRanges) {
|
|
96
|
+
if (pointerId !== event.pointerId)
|
|
97
|
+
continue;
|
|
98
|
+
this.#draggingRanges.delete(id);
|
|
99
|
+
if (!this.#pending.has(id))
|
|
100
|
+
this.#sync();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
constructor(options) {
|
|
104
|
+
this.#validate(options);
|
|
105
|
+
this.#options = options;
|
|
106
|
+
this.#activeTab = options.tabs[0].id;
|
|
107
|
+
if (!document.querySelector("style[data-starlite-menu-style]")) {
|
|
108
|
+
const style = document.createElement("style");
|
|
109
|
+
style.dataset.starliteMenuStyle = "";
|
|
110
|
+
style.textContent = STYLE;
|
|
111
|
+
document.head.append(style);
|
|
112
|
+
}
|
|
113
|
+
this.element.dataset.starliteMenu = "";
|
|
114
|
+
this.element.dataset.starliteQuickSettings = "";
|
|
115
|
+
this.element.hidden = true;
|
|
116
|
+
this.element.setAttribute("role", "dialog");
|
|
117
|
+
this.element.setAttribute("aria-label", options.title ?? "StarLite");
|
|
118
|
+
this.element.addEventListener("contextmenu", (event) => event.preventDefault());
|
|
119
|
+
document.body.append(this.element);
|
|
120
|
+
document.addEventListener("pointerdown", this.#outside, true);
|
|
121
|
+
document.addEventListener("keydown", this.#key);
|
|
122
|
+
document.addEventListener("pointerup", this.#rangeEnd, true);
|
|
123
|
+
document.addEventListener("pointercancel", this.#rangeEnd, true);
|
|
124
|
+
this.#render();
|
|
125
|
+
}
|
|
126
|
+
get isOpen() {
|
|
127
|
+
return !this.#destroyed && !this.element.hidden;
|
|
128
|
+
}
|
|
129
|
+
open(clientX, clientY) {
|
|
130
|
+
if (this.#destroyed || !Number.isFinite(clientX) || !Number.isFinite(clientY))
|
|
131
|
+
return;
|
|
132
|
+
if (!this.isOpen)
|
|
133
|
+
this.#previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : void 0;
|
|
134
|
+
this.#closeSelect();
|
|
135
|
+
this.#x = clientX;
|
|
136
|
+
this.#y = clientY;
|
|
137
|
+
this.element.hidden = false;
|
|
138
|
+
this.#position();
|
|
139
|
+
this.element.querySelector("[role=tab][aria-selected=true]")?.focus({ preventScroll: true });
|
|
140
|
+
this.element.dispatchEvent(new Event("starlite-menu-change"));
|
|
141
|
+
}
|
|
142
|
+
close() {
|
|
143
|
+
if (!this.isOpen)
|
|
144
|
+
return;
|
|
145
|
+
const containedFocus = this.element.contains(document.activeElement);
|
|
146
|
+
this.#closeSelect();
|
|
147
|
+
this.#draggingRanges.clear();
|
|
148
|
+
this.element.hidden = true;
|
|
149
|
+
if (containedFocus && this.#previousFocus?.isConnected)
|
|
150
|
+
this.#previousFocus.focus({ preventScroll: true });
|
|
151
|
+
this.element.dispatchEvent(new Event("starlite-menu-change"));
|
|
152
|
+
}
|
|
153
|
+
update(options) {
|
|
154
|
+
if (this.#destroyed)
|
|
155
|
+
return;
|
|
156
|
+
this.#validate(options);
|
|
157
|
+
this.#options = options;
|
|
158
|
+
if (!options.tabs.some((tab) => tab.id === this.#activeTab))
|
|
159
|
+
this.#activeTab = options.tabs[0].id;
|
|
160
|
+
this.#render();
|
|
161
|
+
}
|
|
162
|
+
destroy() {
|
|
163
|
+
if (this.#destroyed)
|
|
164
|
+
return;
|
|
165
|
+
this.close();
|
|
166
|
+
this.#destroyed = true;
|
|
167
|
+
this.#generation++;
|
|
168
|
+
document.removeEventListener("pointerdown", this.#outside, true);
|
|
169
|
+
document.removeEventListener("keydown", this.#key);
|
|
170
|
+
document.removeEventListener("pointerup", this.#rangeEnd, true);
|
|
171
|
+
document.removeEventListener("pointercancel", this.#rangeEnd, true);
|
|
172
|
+
this.element.remove();
|
|
173
|
+
this.#controls.clear();
|
|
174
|
+
this.#outputs.clear();
|
|
175
|
+
this.#selects.clear();
|
|
176
|
+
}
|
|
177
|
+
#validate(options) {
|
|
178
|
+
validateLocale(options.locale);
|
|
179
|
+
const ids = /* @__PURE__ */ new Set();
|
|
180
|
+
if (!options.tabs.length)
|
|
181
|
+
throw new Error("quick settings requires a tab");
|
|
182
|
+
for (const tab of options.tabs) {
|
|
183
|
+
if (!tab.id || ids.has(`tab:${tab.id}`))
|
|
184
|
+
throw new Error("quick settings tab IDs must be unique");
|
|
185
|
+
ids.add(`tab:${tab.id}`);
|
|
186
|
+
for (const item of tab.items) {
|
|
187
|
+
if (!item.id || ids.has(item.id))
|
|
188
|
+
throw new Error("quick settings item IDs must be unique");
|
|
189
|
+
ids.add(item.id);
|
|
190
|
+
if (item.kind === "range" && (![item.value, item.min, item.max, item.step ?? 1].every(Number.isFinite) || item.max <= item.min || (item.step ?? 1) <= 0))
|
|
191
|
+
throw new Error("invalid quick settings range");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
#item(id) {
|
|
196
|
+
return this.#options.tabs.flatMap((tab) => tab.items).find((item) => item.id === id);
|
|
197
|
+
}
|
|
198
|
+
#render() {
|
|
199
|
+
const structure = JSON.stringify([this.#activeTab, this.#options.title, this.#options.locale, this.#options.tabs.map((tab) => [tab.id, tab.label, tab.items.map((item) => [item.id, item.kind, item.label, item.description, item.kind === "select" ? item.options : item.kind === "range" ? [item.min, item.max, item.step] : null])])]);
|
|
200
|
+
if (structure === this.#structure) {
|
|
201
|
+
this.#sync();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
this.#closeSelect();
|
|
205
|
+
this.#structure = structure;
|
|
206
|
+
this.#controls.clear();
|
|
207
|
+
this.#outputs.clear();
|
|
208
|
+
this.#selects.clear();
|
|
209
|
+
this.#draggingRanges.clear();
|
|
210
|
+
this.element.replaceChildren();
|
|
211
|
+
const header = document.createElement("div");
|
|
212
|
+
header.className = "starlite-menu__header";
|
|
213
|
+
const title = document.createElement("span");
|
|
214
|
+
title.textContent = this.#options.title ?? "StarLite";
|
|
215
|
+
const close = document.createElement("button");
|
|
216
|
+
close.type = "button";
|
|
217
|
+
close.className = "starlite-menu__close";
|
|
218
|
+
close.textContent = "\xD7";
|
|
219
|
+
close.setAttribute("aria-label", resolveLocale(this.#options.locale) === "en" ? "Close menu" : "\u5173\u95ED\u83DC\u5355");
|
|
220
|
+
close.onclick = () => this.close();
|
|
221
|
+
header.append(title, close);
|
|
222
|
+
const tabs = document.createElement("div");
|
|
223
|
+
tabs.setAttribute("role", "tablist");
|
|
224
|
+
tabs.setAttribute("aria-label", resolveLocale(this.#options.locale) === "en" ? "Settings categories" : "\u8BBE\u7F6E\u5206\u7C7B");
|
|
225
|
+
for (const [index, tab] of this.#options.tabs.entries()) {
|
|
226
|
+
const button = document.createElement("button");
|
|
227
|
+
button.type = "button";
|
|
228
|
+
button.textContent = tab.label;
|
|
229
|
+
button.id = `${this.#id}-tab-${index}`;
|
|
230
|
+
button.setAttribute("role", "tab");
|
|
231
|
+
button.setAttribute("aria-selected", String(tab.id === this.#activeTab));
|
|
232
|
+
button.tabIndex = tab.id === this.#activeTab ? 0 : -1;
|
|
233
|
+
button.setAttribute("aria-controls", `${this.#id}-panel`);
|
|
234
|
+
button.onclick = () => {
|
|
235
|
+
this.#activeTab = tab.id;
|
|
236
|
+
this.#render();
|
|
237
|
+
this.element.querySelector("[role=tab][aria-selected=true]")?.focus({ preventScroll: true });
|
|
238
|
+
};
|
|
239
|
+
button.onkeydown = (event) => {
|
|
240
|
+
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key))
|
|
241
|
+
return;
|
|
242
|
+
event.preventDefault();
|
|
243
|
+
const count = this.#options.tabs.length;
|
|
244
|
+
const next = event.key === "Home" ? 0 : event.key === "End" ? count - 1 : (index + (event.key === "ArrowRight" ? 1 : -1) + count) % count;
|
|
245
|
+
this.#activeTab = this.#options.tabs[next].id;
|
|
246
|
+
this.#render();
|
|
247
|
+
this.element.querySelector("[role=tab][aria-selected=true]")?.focus({ preventScroll: true });
|
|
248
|
+
};
|
|
249
|
+
tabs.append(button);
|
|
250
|
+
}
|
|
251
|
+
const panel = document.createElement("div");
|
|
252
|
+
panel.id = `${this.#id}-panel`;
|
|
253
|
+
panel.setAttribute("role", "tabpanel");
|
|
254
|
+
panel.setAttribute("aria-labelledby", `${this.#id}-tab-${this.#options.tabs.findIndex((tab) => tab.id === this.#activeTab)}`);
|
|
255
|
+
for (const item of this.#options.tabs.find((tab) => tab.id === this.#activeTab).items)
|
|
256
|
+
panel.append(this.#row(item));
|
|
257
|
+
const status = document.createElement("p");
|
|
258
|
+
status.className = "starlite-menu__status";
|
|
259
|
+
status.setAttribute("role", "status");
|
|
260
|
+
status.hidden = true;
|
|
261
|
+
this.element.append(header, tabs, panel, status);
|
|
262
|
+
this.element.setAttribute("aria-label", this.#options.title ?? "StarLite");
|
|
263
|
+
this.#sync();
|
|
264
|
+
}
|
|
265
|
+
#text(item) {
|
|
266
|
+
const text = document.createElement("span");
|
|
267
|
+
text.className = "starlite-menu__text";
|
|
268
|
+
text.textContent = item.label;
|
|
269
|
+
if (item.description) {
|
|
270
|
+
const description = document.createElement("span");
|
|
271
|
+
description.className = "starlite-menu__description";
|
|
272
|
+
description.textContent = item.description;
|
|
273
|
+
text.append(description);
|
|
274
|
+
}
|
|
275
|
+
return text;
|
|
276
|
+
}
|
|
277
|
+
#row(item) {
|
|
278
|
+
if (item.kind === "action") {
|
|
279
|
+
const row2 = document.createElement("div");
|
|
280
|
+
row2.className = "starlite-menu__row";
|
|
281
|
+
const button = document.createElement("button");
|
|
282
|
+
button.type = "button";
|
|
283
|
+
button.className = "starlite-menu__action";
|
|
284
|
+
button.append(this.#text(item));
|
|
285
|
+
button.dataset.settingId = item.id;
|
|
286
|
+
button.onclick = () => {
|
|
287
|
+
const current = this.#item(item.id);
|
|
288
|
+
if (current?.kind === "action")
|
|
289
|
+
this.#invoke(current.id, current.onAction);
|
|
290
|
+
};
|
|
291
|
+
this.#controls.set(item.id, button);
|
|
292
|
+
row2.append(button);
|
|
293
|
+
return row2;
|
|
294
|
+
}
|
|
295
|
+
const row = document.createElement(item.kind === "select" ? "div" : "label");
|
|
296
|
+
row.className = "starlite-menu__row";
|
|
297
|
+
const text = this.#text(item);
|
|
298
|
+
if (item.kind === "select") {
|
|
299
|
+
row.classList.add("starlite-menu__select-row");
|
|
300
|
+
const trigger = document.createElement("button");
|
|
301
|
+
trigger.type = "button";
|
|
302
|
+
trigger.dataset.settingId = item.id;
|
|
303
|
+
trigger.className = "starlite-menu__select";
|
|
304
|
+
const index = this.#selects.size;
|
|
305
|
+
text.id = `${this.#id}-select-label-${index}`;
|
|
306
|
+
trigger.setAttribute("role", "combobox");
|
|
307
|
+
trigger.setAttribute("aria-haspopup", "listbox");
|
|
308
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
309
|
+
trigger.setAttribute("aria-labelledby", text.id);
|
|
310
|
+
const label = document.createElement("span");
|
|
311
|
+
label.className = "starlite-menu__select-value";
|
|
312
|
+
trigger.append(label);
|
|
313
|
+
const listbox = document.createElement("div");
|
|
314
|
+
listbox.id = `${this.#id}-select-options-${index}`;
|
|
315
|
+
listbox.className = "starlite-menu__options";
|
|
316
|
+
listbox.hidden = true;
|
|
317
|
+
listbox.setAttribute("role", "listbox");
|
|
318
|
+
listbox.setAttribute("aria-labelledby", text.id);
|
|
319
|
+
trigger.setAttribute("aria-controls", listbox.id);
|
|
320
|
+
const options = item.options.map((option, optionIndex) => {
|
|
321
|
+
const node = document.createElement("button");
|
|
322
|
+
node.type = "button";
|
|
323
|
+
node.tabIndex = -1;
|
|
324
|
+
node.className = "starlite-menu__option";
|
|
325
|
+
node.dataset.value = option.value;
|
|
326
|
+
node.id = `${listbox.id}-${optionIndex}`;
|
|
327
|
+
node.textContent = option.label;
|
|
328
|
+
node.setAttribute("role", "option");
|
|
329
|
+
node.onpointerdown = (event) => event.preventDefault();
|
|
330
|
+
node.onclick = () => this.#chooseSelect(item.id, optionIndex);
|
|
331
|
+
listbox.append(node);
|
|
332
|
+
return node;
|
|
333
|
+
});
|
|
334
|
+
trigger.onclick = () => this.#openSelect === item.id ? this.#closeSelect() : this.#showSelect(item.id);
|
|
335
|
+
trigger.onkeydown = (event) => this.#selectKey(item.id, event);
|
|
336
|
+
trigger.onblur = () => {
|
|
337
|
+
if (this.#openSelect === item.id)
|
|
338
|
+
this.#closeSelect();
|
|
339
|
+
};
|
|
340
|
+
this.#selects.set(item.id, { trigger, label, listbox, options, activeIndex: -1 });
|
|
341
|
+
this.#controls.set(item.id, trigger);
|
|
342
|
+
row.append(text, trigger, listbox);
|
|
343
|
+
return row;
|
|
344
|
+
}
|
|
345
|
+
const input = document.createElement("input");
|
|
346
|
+
input.dataset.settingId = item.id;
|
|
347
|
+
if (item.kind === "toggle") {
|
|
348
|
+
input.type = "checkbox";
|
|
349
|
+
input.className = "starlite-menu__toggle";
|
|
350
|
+
input.onchange = () => {
|
|
351
|
+
const current = this.#item(item.id);
|
|
352
|
+
if (current?.kind === "toggle")
|
|
353
|
+
this.#invoke(current.id, () => current.onChange(input.checked));
|
|
354
|
+
};
|
|
355
|
+
row.append(text, input);
|
|
356
|
+
} else {
|
|
357
|
+
input.type = "range";
|
|
358
|
+
input.min = String(item.min);
|
|
359
|
+
input.max = String(item.max);
|
|
360
|
+
input.step = String(item.step ?? 1);
|
|
361
|
+
input.onpointerdown = (event) => {
|
|
362
|
+
if (event.button === 0 && !input.disabled)
|
|
363
|
+
this.#draggingRanges.set(item.id, event.pointerId);
|
|
364
|
+
};
|
|
365
|
+
row.classList.add("starlite-menu__range-row");
|
|
366
|
+
const label = document.createElement("span");
|
|
367
|
+
label.className = "starlite-menu__range-label";
|
|
368
|
+
const output = document.createElement("output");
|
|
369
|
+
this.#outputs.set(item.id, output);
|
|
370
|
+
label.append(text, output);
|
|
371
|
+
input.oninput = () => {
|
|
372
|
+
const current = this.#item(item.id);
|
|
373
|
+
if (current?.kind === "range") {
|
|
374
|
+
const value = Number(input.value);
|
|
375
|
+
output.textContent = current.formatValue?.(value) ?? String(value);
|
|
376
|
+
this.#invoke(current.id, () => current.onChange(value));
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
row.append(label, input);
|
|
380
|
+
}
|
|
381
|
+
this.#controls.set(item.id, input);
|
|
382
|
+
return row;
|
|
383
|
+
}
|
|
384
|
+
#sync() {
|
|
385
|
+
for (const [id, control] of this.#controls) {
|
|
386
|
+
const item = this.#item(id);
|
|
387
|
+
if (!item)
|
|
388
|
+
continue;
|
|
389
|
+
control.disabled = item.disabled === true || item.kind !== "range" && this.#pending.has(id);
|
|
390
|
+
if (item.kind === "toggle")
|
|
391
|
+
control.checked = item.value;
|
|
392
|
+
else if (item.kind !== "action") {
|
|
393
|
+
if (item.kind === "range" && this.#draggingRanges.has(id))
|
|
394
|
+
continue;
|
|
395
|
+
control.value = String(item.value);
|
|
396
|
+
if (item.kind === "range")
|
|
397
|
+
this.#outputs.get(id).textContent = item.formatValue?.(item.value) ?? String(item.value);
|
|
398
|
+
else
|
|
399
|
+
this.#syncSelect(id, item.value);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
#syncSelect(id, value) {
|
|
404
|
+
const select = this.#selects.get(id);
|
|
405
|
+
if (!select)
|
|
406
|
+
return;
|
|
407
|
+
const option = select.options.find((node) => node.dataset.value === value);
|
|
408
|
+
select.label.textContent = option?.textContent ?? "\u2014";
|
|
409
|
+
for (const node of select.options)
|
|
410
|
+
node.setAttribute("aria-selected", String(node === option));
|
|
411
|
+
if (select.trigger.disabled && this.#openSelect === id)
|
|
412
|
+
this.#closeSelect();
|
|
413
|
+
}
|
|
414
|
+
#showSelect(id, index) {
|
|
415
|
+
const select = this.#selects.get(id);
|
|
416
|
+
if (!select || select.trigger.disabled || !select.options.length)
|
|
417
|
+
return;
|
|
418
|
+
this.#closeSelect();
|
|
419
|
+
this.#openSelect = id;
|
|
420
|
+
select.listbox.hidden = false;
|
|
421
|
+
select.trigger.setAttribute("aria-expanded", "true");
|
|
422
|
+
this.#activateOption(id, index ?? Math.max(0, select.options.findIndex((node) => node.dataset.value === select.trigger.value)));
|
|
423
|
+
this.element.dispatchEvent(new Event("starlite-menu-change"));
|
|
424
|
+
}
|
|
425
|
+
#activateOption(id, index) {
|
|
426
|
+
const select = this.#selects.get(id);
|
|
427
|
+
if (!select)
|
|
428
|
+
return;
|
|
429
|
+
select.activeIndex = Math.max(0, Math.min(index, select.options.length - 1));
|
|
430
|
+
for (const [optionIndex, node] of select.options.entries())
|
|
431
|
+
node.dataset.active = String(optionIndex === select.activeIndex);
|
|
432
|
+
const active = select.options[select.activeIndex];
|
|
433
|
+
if (active) {
|
|
434
|
+
select.trigger.setAttribute("aria-activedescendant", active.id);
|
|
435
|
+
active.scrollIntoView({ block: "nearest" });
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
#closeSelect() {
|
|
439
|
+
if (!this.#openSelect)
|
|
440
|
+
return;
|
|
441
|
+
const select = this.#selects.get(this.#openSelect);
|
|
442
|
+
this.#openSelect = void 0;
|
|
443
|
+
if (select) {
|
|
444
|
+
select.listbox.hidden = true;
|
|
445
|
+
select.trigger.setAttribute("aria-expanded", "false");
|
|
446
|
+
select.trigger.removeAttribute("aria-activedescendant");
|
|
447
|
+
for (const node of select.options)
|
|
448
|
+
delete node.dataset.active;
|
|
449
|
+
}
|
|
450
|
+
this.element.dispatchEvent(new Event("starlite-menu-change"));
|
|
451
|
+
}
|
|
452
|
+
#chooseSelect(id, index) {
|
|
453
|
+
const select = this.#selects.get(id), current = this.#item(id), option = select?.options[index];
|
|
454
|
+
if (!select || !option || select.trigger.disabled || current?.kind !== "select")
|
|
455
|
+
return;
|
|
456
|
+
const value = option.dataset.value;
|
|
457
|
+
select.trigger.value = value;
|
|
458
|
+
this.#syncSelect(id, value);
|
|
459
|
+
this.#closeSelect();
|
|
460
|
+
select.trigger.focus({ preventScroll: true });
|
|
461
|
+
this.#invoke(id, () => current.onChange(value));
|
|
462
|
+
}
|
|
463
|
+
#selectKey(id, event) {
|
|
464
|
+
const select = this.#selects.get(id);
|
|
465
|
+
if (!select)
|
|
466
|
+
return;
|
|
467
|
+
if (event.key === "Escape" && this.#openSelect === id) {
|
|
468
|
+
event.preventDefault();
|
|
469
|
+
event.stopPropagation();
|
|
470
|
+
this.#closeSelect();
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
if (event.key === "Tab") {
|
|
474
|
+
this.#closeSelect();
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End", "Enter", " "].includes(event.key))
|
|
478
|
+
return;
|
|
479
|
+
event.preventDefault();
|
|
480
|
+
if (event.key === "Home" || event.key === "End") {
|
|
481
|
+
const index = event.key === "Home" ? 0 : select.options.length - 1;
|
|
482
|
+
if (this.#openSelect !== id)
|
|
483
|
+
this.#showSelect(id, index);
|
|
484
|
+
else
|
|
485
|
+
this.#activateOption(id, index);
|
|
486
|
+
} else if (this.#openSelect !== id)
|
|
487
|
+
this.#showSelect(id);
|
|
488
|
+
else if (event.key === "Enter" || event.key === " ")
|
|
489
|
+
this.#chooseSelect(id, select.activeIndex);
|
|
490
|
+
else
|
|
491
|
+
this.#activateOption(id, (select.activeIndex + (event.key === "ArrowDown" ? 1 : -1) + select.options.length) % select.options.length);
|
|
492
|
+
}
|
|
493
|
+
#invoke(id, callback) {
|
|
494
|
+
const token = ++this.#generation;
|
|
495
|
+
this.#pending.set(id, token);
|
|
496
|
+
const status = this.element.querySelector("[role=status]");
|
|
497
|
+
status.hidden = true;
|
|
498
|
+
try {
|
|
499
|
+
const result = callback();
|
|
500
|
+
if (result && typeof result.then === "function") {
|
|
501
|
+
result.catch(() => {
|
|
502
|
+
this.#reportError();
|
|
503
|
+
this.#sync();
|
|
504
|
+
}).finally(() => this.#finish(id, token));
|
|
505
|
+
} else
|
|
506
|
+
this.#finish(id, token);
|
|
507
|
+
} catch {
|
|
508
|
+
this.#pending.delete(id);
|
|
509
|
+
this.#reportError();
|
|
510
|
+
this.#sync();
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
#finish(id, token) {
|
|
514
|
+
if (this.#pending.get(id) !== token)
|
|
515
|
+
return;
|
|
516
|
+
this.#pending.delete(id);
|
|
517
|
+
const control = this.#controls.get(id);
|
|
518
|
+
if (control)
|
|
519
|
+
control.disabled = this.#item(id)?.disabled === true;
|
|
520
|
+
}
|
|
521
|
+
#reportError() {
|
|
522
|
+
if (this.#destroyed)
|
|
523
|
+
return;
|
|
524
|
+
const status = this.element.querySelector("[role=status]");
|
|
525
|
+
status.textContent = resolveLocale(this.#options.locale) === "en" ? "Could not apply this setting. Please try again." : "\u672A\u80FD\u5E94\u7528\u8BBE\u7F6E\uFF0C\u8BF7\u91CD\u8BD5\u3002";
|
|
526
|
+
status.hidden = false;
|
|
527
|
+
}
|
|
528
|
+
#position() {
|
|
529
|
+
this.element.style.maxWidth = "";
|
|
530
|
+
this.element.style.maxHeight = "";
|
|
531
|
+
const rect = this.element.getBoundingClientRect();
|
|
532
|
+
const width = rect.width || Math.min(300, innerWidth - 16), height = rect.height || this.element.offsetHeight;
|
|
533
|
+
this.element.style.left = `${Math.max(8, Math.min(this.#x, innerWidth - width - 8))}px`;
|
|
534
|
+
const top = Math.max(8, Math.min(this.#y, innerHeight - height - 8));
|
|
535
|
+
this.element.style.top = `${top}px`;
|
|
536
|
+
this.element.style.maxHeight = `calc(100vh - ${top + 8}px)`;
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
export {
|
|
540
|
+
QuickSettingsMenu
|
|
541
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-settings.js","sourceRoot":"","sources":["../src/quick-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAoD,MAAM,0BAA0B,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModelController } from "@starcried/starlite-core";
|
|
1
|
+
import type { StarLiteLocale, ModelController, PerformanceConfig } from "@starcried/starlite-core";
|
|
2
2
|
export type WidgetStatus = "disabled" | "loading" | "running" | "paused" | "fallback" | "destroyed";
|
|
3
3
|
export interface ModelBounds {
|
|
4
4
|
minX: number;
|
|
@@ -162,7 +162,9 @@ export type ResolvedParameterBindings = {
|
|
|
162
162
|
[Channel in keyof ParameterIds]: readonly ResolvedParameterTarget[];
|
|
163
163
|
};
|
|
164
164
|
export interface WidgetConfig {
|
|
165
|
+
locale?: StarLiteLocale;
|
|
165
166
|
backend?: "inochi2d";
|
|
167
|
+
performance?: PerformanceConfig;
|
|
166
168
|
model: string;
|
|
167
169
|
fallback: string;
|
|
168
170
|
network?: {
|
|
@@ -208,6 +210,9 @@ export interface WidgetConfig {
|
|
|
208
210
|
export interface ResolvedWidgetConfig {
|
|
209
211
|
model: string;
|
|
210
212
|
fallback: string;
|
|
213
|
+
performance: {
|
|
214
|
+
show: boolean;
|
|
215
|
+
};
|
|
211
216
|
network: {
|
|
212
217
|
requestTimeoutMs: number;
|
|
213
218
|
modelMaxBytes: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.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ework-free Inochi2D WebGL2 widget runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
|
+
"README.en.md",
|
|
19
20
|
"THIRD_PARTY_NOTICES.md",
|
|
20
21
|
"THIRD_PARTY_LICENSES.txt"
|
|
21
22
|
],
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"node": ">=22.12"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
|
-
"@starcried/starlite-core": "0.1.0
|
|
47
|
+
"@starcried/starlite-core": "0.1.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"esbuild": "0.28.2"
|