kiosko 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -1
- package/assets/store-index.json +1 -0
- package/assets/store-index.schema.json +167 -0
- package/cli.js +2923 -569
- package/kit.js +64 -7
- package/package.json +2 -1
- package/screen-thread.js +3937 -0
- package/sdk.js +208 -37
- package/web/assets/app.js +3 -3
- package/web/assets/styles.css +1 -1
package/sdk.js
CHANGED
|
@@ -2,17 +2,19 @@ import { createRequire as __kioskoRequire } from 'node:module'; const require =
|
|
|
2
2
|
|
|
3
3
|
// packages/sdk/src/plugin.ts
|
|
4
4
|
var CATEGORIES = [
|
|
5
|
-
{ id: "agents", label: { en: "AI agents", es: "Agentes IA" } },
|
|
6
|
-
{ id: "system", label: { en: "System", es: "Sistema" } },
|
|
7
|
-
{ id: "time", label: { en: "Time & calendar", es: "Tiempo y agenda" } },
|
|
8
|
-
{ id: "productivity", label: { en: "Productivity", es: "Productividad" } },
|
|
9
|
-
{ id: "dev", label: { en: "Development", es: "Desarrollo" } },
|
|
10
|
-
{ id: "info", label: { en: "News & world", es: "Noticias y mundo" } },
|
|
11
|
-
{ id: "media", label: { en: "Media", es: "Multimedia" } },
|
|
12
|
-
{ id: "scene", label: { en: "Scenes", es: "Escenas" } },
|
|
13
|
-
{ id: "fun", label: { en: "Fun", es: "Diversi\xF3n" } }
|
|
5
|
+
{ id: "agents", label: { en: "AI agents", es: "Agentes IA", de: "KI-Agenten", "zh-Hant": "AI \u4EE3\u7406", "zh-Hans": "AI \u667A\u80FD\u4F53" } },
|
|
6
|
+
{ id: "system", label: { en: "System", es: "Sistema", de: "System", "zh-Hant": "\u7CFB\u7D71", "zh-Hans": "\u7CFB\u7EDF" } },
|
|
7
|
+
{ id: "time", label: { en: "Time & calendar", es: "Tiempo y agenda", de: "Zeit & Kalender", "zh-Hant": "\u6642\u9593\u8207\u884C\u4E8B\u66C6", "zh-Hans": "\u65F6\u95F4\u4E0E\u65E5\u5386" } },
|
|
8
|
+
{ id: "productivity", label: { en: "Productivity", es: "Productividad", de: "Produktivit\xE4t", "zh-Hant": "\u751F\u7522\u529B", "zh-Hans": "\u6548\u7387" } },
|
|
9
|
+
{ id: "dev", label: { en: "Development", es: "Desarrollo", de: "Entwicklung", "zh-Hant": "\u958B\u767C", "zh-Hans": "\u5F00\u53D1" } },
|
|
10
|
+
{ id: "info", label: { en: "News & world", es: "Noticias y mundo", de: "Nachrichten & Welt", "zh-Hant": "\u65B0\u805E\u8207\u4E16\u754C", "zh-Hans": "\u65B0\u95FB\u4E0E\u4E16\u754C" } },
|
|
11
|
+
{ id: "media", label: { en: "Media", es: "Multimedia", de: "Medien", "zh-Hant": "\u591A\u5A92\u9AD4", "zh-Hans": "\u591A\u5A92\u4F53" } },
|
|
12
|
+
{ id: "scene", label: { en: "Scenes", es: "Escenas", de: "Szenen", "zh-Hant": "\u5834\u666F", "zh-Hans": "\u573A\u666F" } },
|
|
13
|
+
{ id: "fun", label: { en: "Fun", es: "Diversi\xF3n", de: "Spa\xDF", "zh-Hant": "\u8DA3\u5473", "zh-Hans": "\u8DA3\u5473" } }
|
|
14
14
|
];
|
|
15
|
-
var
|
|
15
|
+
var ALERT_LEVELS = ["info", "warn", "critical"];
|
|
16
|
+
var PAD_KEYS = ["up", "down", "left", "right", "a", "b", "x", "y", "l", "r", "start", "select"];
|
|
17
|
+
var SDK_VERSION = "0.2.7";
|
|
16
18
|
function defineWidget(w) {
|
|
17
19
|
return w;
|
|
18
20
|
}
|
|
@@ -27,11 +29,98 @@ function definePlugin(p) {
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
// packages/sdk/src/i18n.ts
|
|
32
|
+
var ALIASES = { iw: "he", in: "id", ji: "yi", tl: "fil", no: "nb", cmn: "zh" };
|
|
33
|
+
var READS = { yue: "zh", nn: "nb" };
|
|
34
|
+
function parseLocale(tag) {
|
|
35
|
+
if (!tag) return null;
|
|
36
|
+
let t2 = tag.trim();
|
|
37
|
+
const latin2 = /@latin\b/i.test(t2);
|
|
38
|
+
t2 = t2.replace(/[.@].*$/, "").replace(/_/g, "-");
|
|
39
|
+
if (!t2 || t2 === "C" || t2 === "POSIX") return null;
|
|
40
|
+
try {
|
|
41
|
+
let l = new Intl.Locale(Intl.getCanonicalLocales(t2)[0]);
|
|
42
|
+
const alias = ALIASES[l.language];
|
|
43
|
+
if (alias) l = new Intl.Locale(alias, { ...l.script ? { script: l.script } : {}, ...l.region ? { region: l.region } : {} });
|
|
44
|
+
if (latin2 && !l.script) l = new Intl.Locale(l.language, { script: "Latn", ...l.region ? { region: l.region } : {} });
|
|
45
|
+
return l;
|
|
46
|
+
} catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
var LATAM = /* @__PURE__ */ new Set(["419", "AR", "BO", "CL", "CO", "CR", "CU", "DO", "EC", "GT", "HN", "MX", "NI", "PA", "PE", "PR", "PY", "SV", "US", "UY", "VE"]);
|
|
51
|
+
var PT_PT = /* @__PURE__ */ new Set(["PT", "AO", "MZ", "CV", "GW", "ST", "TL", "MO", "GQ", "LU", "CH"]);
|
|
52
|
+
function pickLocale(available, locale) {
|
|
53
|
+
if (!locale || !available.length) return void 0;
|
|
54
|
+
const exact = available.find((k) => k.toLowerCase() === locale.replace(/_/g, "-").toLowerCase());
|
|
55
|
+
if (exact) return exact;
|
|
56
|
+
const want = parseLocale(locale);
|
|
57
|
+
if (!want) return void 0;
|
|
58
|
+
const w = want.maximize();
|
|
59
|
+
const lang = READS[w.language] ?? w.language;
|
|
60
|
+
const fits = available.map((k) => ({ k, l: parseLocale(k) })).filter((c) => !!c.l).map((c) => ({ ...c, m: c.l.maximize() })).filter((c) => (READS[c.m.language] ?? c.m.language) === lang && c.m.script === w.script);
|
|
61
|
+
if (!fits.length) return void 0;
|
|
62
|
+
const same = (a, b) => a.baseName === b.baseName;
|
|
63
|
+
const byTag = fits.find((c) => same(c.l, want));
|
|
64
|
+
if (byTag) return byTag.k;
|
|
65
|
+
if (w.region) {
|
|
66
|
+
const byRegion = fits.find((c) => c.m.region === w.region && c.l.region);
|
|
67
|
+
if (byRegion) return byRegion.k;
|
|
68
|
+
const usual = (r) => lang === "es" && LATAM.has(w.region) ? ["419", "MX"].includes(r) : lang === "pt" && PT_PT.has(w.region) ? r === "PT" : false;
|
|
69
|
+
const variant = fits.find((c) => c.l.region && usual(c.l.region));
|
|
70
|
+
if (variant) return variant.k;
|
|
71
|
+
}
|
|
72
|
+
const plain = [...fits].sort((a, b) => a.l.baseName.split("-").length - b.l.baseName.split("-").length);
|
|
73
|
+
return plain[0].k;
|
|
74
|
+
}
|
|
75
|
+
function plural(n, forms, locale = "en") {
|
|
76
|
+
const key = pickLocale(Object.keys(forms), locale) ?? (forms.en ? "en" : Object.keys(forms)[0]);
|
|
77
|
+
const f = forms[key];
|
|
78
|
+
let rule = "other";
|
|
79
|
+
try {
|
|
80
|
+
rule = new Intl.PluralRules(key).select(n);
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
const text = f[rule] ?? f.other;
|
|
84
|
+
let num = String(n);
|
|
85
|
+
try {
|
|
86
|
+
num = new Intl.NumberFormat(key).format(n);
|
|
87
|
+
} catch {
|
|
88
|
+
}
|
|
89
|
+
return text.replaceAll("{n}", num);
|
|
90
|
+
}
|
|
30
91
|
function localize(text, locale = "en") {
|
|
31
92
|
if (text === void 0) return "";
|
|
32
93
|
if (typeof text === "string") return text;
|
|
33
|
-
const
|
|
34
|
-
return
|
|
94
|
+
const key = pickLocale(Object.keys(text), locale);
|
|
95
|
+
return (key ? text[key] : void 0) ?? text.en ?? Object.values(text).find((v) => typeof v === "string") ?? "";
|
|
96
|
+
}
|
|
97
|
+
function hanScript(locale) {
|
|
98
|
+
const l = parseLocale(locale || "en");
|
|
99
|
+
if (!l) return null;
|
|
100
|
+
const full = l.maximize();
|
|
101
|
+
switch (READS[full.language] ?? full.language) {
|
|
102
|
+
case "zh":
|
|
103
|
+
if (full.script === "Hant") return full.region === "HK" || full.region === "MO" ? "Hant-HK" : "Hant";
|
|
104
|
+
return "Hans";
|
|
105
|
+
case "ja":
|
|
106
|
+
return "Jpan";
|
|
107
|
+
case "ko":
|
|
108
|
+
return "Kore";
|
|
109
|
+
default:
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
var PluginError = class extends Error {
|
|
114
|
+
text;
|
|
115
|
+
constructor(text, options) {
|
|
116
|
+
super(localize(text, "en"), options);
|
|
117
|
+
this.name = "PluginError";
|
|
118
|
+
this.text = text;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
function errorMessage(err, locale = "en") {
|
|
122
|
+
if (err instanceof Error && "text" in err && err.text !== void 0) return localize(err.text, locale);
|
|
123
|
+
return err instanceof Error ? err.message : String(err);
|
|
35
124
|
}
|
|
36
125
|
|
|
37
126
|
// packages/sdk/src/schema.ts
|
|
@@ -64,7 +153,10 @@ var t = {
|
|
|
64
153
|
};
|
|
65
154
|
var FILTER_HELP = {
|
|
66
155
|
en: "Empty: all. Names or patterns, comma-separated: * matches anything, a leading ! leaves out (web, acme/*, !*-old).",
|
|
67
|
-
es: "Vac\xEDo: todos. Nombres o patrones separados por comas: * vale por cualquier cosa y un ! delante excluye (web, acme/*, !*-old)."
|
|
156
|
+
es: "Vac\xEDo: todos. Nombres o patrones separados por comas: * vale por cualquier cosa y un ! delante excluye (web, acme/*, !*-old).",
|
|
157
|
+
de: "Leer: alle. Namen oder Muster, durch Kommas getrennt: * steht f\xFCr alles, ein ! davor schlie\xDFt aus (web, acme/*, !*-old).",
|
|
158
|
+
"zh-Hant": "\u7559\u7A7A\uFF1A\u5168\u90E8\u3002\u586B\u5165\u540D\u7A31\u6216\u6A21\u5F0F\uFF0C\u4EE5\u9017\u865F\u5206\u9694\uFF1A* \u4EE3\u8868\u4EFB\u610F\u5B57\u5143\uFF0C\u958B\u982D\u52A0 ! \u5247\u6392\u9664\uFF08web, acme/*, !*-old\uFF09\u3002",
|
|
159
|
+
"zh-Hans": "\u7559\u7A7A\uFF1A\u5168\u90E8\u3002\u586B\u5199\u540D\u79F0\u6216\u6A21\u5F0F\uFF0C\u7528\u9017\u53F7\u5206\u9694\uFF1A* \u5339\u914D\u4EFB\u610F\u5185\u5BB9\uFF0C\u5F00\u5934\u52A0 ! \u8868\u793A\u6392\u9664\uFF08web, acme/*, !*-old\uFF09\u3002"
|
|
68
160
|
};
|
|
69
161
|
function clone(v) {
|
|
70
162
|
return v === void 0 ? v : JSON.parse(JSON.stringify(v));
|
|
@@ -213,14 +305,67 @@ function themeById(id) {
|
|
|
213
305
|
return THEMES.find((t2) => t2.id === id) ?? DEFAULT_THEME;
|
|
214
306
|
}
|
|
215
307
|
|
|
308
|
+
// packages/sdk/src/languages.ts
|
|
309
|
+
var MAINLAND_CHINA = {
|
|
310
|
+
without: ["agents", "cats", "usage"],
|
|
311
|
+
first: ["llm", "gpu"],
|
|
312
|
+
instead: { "agents/summary": "llm/status", "agents/sessions": "llm/models", "usage/rail": "gpu/cards", "cats/room": "gpu/history" }
|
|
313
|
+
};
|
|
314
|
+
var LANGUAGES = [
|
|
315
|
+
{ id: "en", name: "English", panel: "en", ogLocale: "en_US", hreflang: ["en", "x-default"], dir: "ltr" },
|
|
316
|
+
{ id: "es", name: "Espa\xF1ol", panel: "es", ogLocale: "es_ES", hreflang: ["es"], dir: "ltr" },
|
|
317
|
+
{ id: "de", name: "Deutsch", panel: "de", ogLocale: "de_DE", hreflang: ["de"], dir: "ltr" },
|
|
318
|
+
{ id: "zh-Hant", name: "\u7E41\u9AD4\u4E2D\u6587", panel: "zh-TW", ogLocale: "zh_TW", hreflang: ["zh-Hant", "zh-TW", "zh-HK"], dir: "ltr" },
|
|
319
|
+
{ id: "zh-Hans", name: "\u7B80\u4F53\u4E2D\u6587", panel: "zh-CN", ogLocale: "zh_CN", hreflang: ["zh-Hans", "zh-CN"], dir: "ltr", plugins: MAINLAND_CHINA }
|
|
320
|
+
];
|
|
321
|
+
var LANGUAGE_IDS = LANGUAGES.map((l) => l.id);
|
|
322
|
+
function languageById(id) {
|
|
323
|
+
return LANGUAGES.find((l) => l.id === id);
|
|
324
|
+
}
|
|
325
|
+
|
|
216
326
|
// packages/sdk/src/format.ts
|
|
217
327
|
var TIME_FORMATS = ["auto", "24h", "12h"];
|
|
328
|
+
var latin = (wk, yr) => ({
|
|
329
|
+
s: (n) => `${n} s`,
|
|
330
|
+
min: (n) => `${n} min`,
|
|
331
|
+
h: (n) => `${n} h`,
|
|
332
|
+
d: (n) => `${n} d`,
|
|
333
|
+
wk: (n) => `${n} ${wk}`,
|
|
334
|
+
yr: (n) => `${n} ${yr(n)}`,
|
|
335
|
+
hm: (h, m) => `${h} h ${pad2(m)}`,
|
|
336
|
+
dh: (d, h) => `${d} d ${h} h`
|
|
337
|
+
});
|
|
338
|
+
var german = {
|
|
339
|
+
s: (n) => `${n} s`,
|
|
340
|
+
min: (n) => `${n} Min.`,
|
|
341
|
+
h: (n) => `${n} Std.`,
|
|
342
|
+
d: (n) => `${n} T.`,
|
|
343
|
+
wk: (n) => `${n} Wo.`,
|
|
344
|
+
yr: (n) => `${n} J.`,
|
|
345
|
+
hm: (h, m) => `${h}:${pad2(m)} h`,
|
|
346
|
+
dh: (d, h) => `${d} T. ${h} Std.`
|
|
347
|
+
};
|
|
348
|
+
var chinese = (u) => ({
|
|
349
|
+
s: (n) => `${n} \u79D2`,
|
|
350
|
+
min: (n) => `${n} ${u.min}`,
|
|
351
|
+
h: (n) => `${n} ${u.h}`,
|
|
352
|
+
d: (n) => `${n} \u5929`,
|
|
353
|
+
wk: (n) => `${n} ${u.wk}`,
|
|
354
|
+
yr: (n) => `${n} \u5E74`,
|
|
355
|
+
// No leading zero in Chinese: 1 小時 5 分.
|
|
356
|
+
hm: (h, m) => `${h} ${u.h} ${m} \u5206`,
|
|
357
|
+
dh: (d, h) => `${d} \u5929 ${h} ${u.h}`
|
|
358
|
+
});
|
|
218
359
|
var WORDS = {
|
|
219
|
-
en: { now: "now", justNow: "just now", ago: (v) => `${v} ago`,
|
|
220
|
-
es: { now: "ahora", justNow: "ahora mismo", ago: (v) => `hace ${v}`,
|
|
360
|
+
en: { now: "now", justNow: "just now", ago: (v) => `${v} ago`, am: "AM", pm: "PM", ...latin("wk", () => "yr") },
|
|
361
|
+
es: { now: "ahora", justNow: "ahora mismo", ago: (v) => `hace ${v}`, am: "a. m.", pm: "p. m.", ...latin("sem", (n) => n === 1 ? "a\xF1o" : "a\xF1os") },
|
|
362
|
+
de: { now: "jetzt", justNow: "gerade eben", ago: (v) => `vor ${v}`, am: "AM", pm: "PM", ...german },
|
|
363
|
+
"zh-Hant": { now: "\u73FE\u5728", justNow: "\u525B\u525B", ago: (v) => `${v}\u524D`, am: "\u4E0A\u5348", pm: "\u4E0B\u5348", ampmFirst: true, ...chinese({ min: "\u5206\u9418", h: "\u5C0F\u6642", wk: "\u9031" }) },
|
|
364
|
+
"zh-Hans": { now: "\u73B0\u5728", justNow: "\u521A\u521A", ago: (v) => `${v}\u524D`, am: "\u4E0A\u5348", pm: "\u4E0B\u5348", ampmFirst: true, ...chinese({ min: "\u5206\u949F", h: "\u5C0F\u65F6", wk: "\u5468" }) }
|
|
221
365
|
};
|
|
222
|
-
var
|
|
223
|
-
var
|
|
366
|
+
var FORMAT_LANGUAGES = Object.keys(WORDS);
|
|
367
|
+
var LANGS = Object.keys(WORDS);
|
|
368
|
+
var wordsFor = (locale) => WORDS[pickLocale(LANGS, locale) ?? "en"] ?? WORDS.en;
|
|
224
369
|
var pad2 = (n) => String(n).padStart(2, "0");
|
|
225
370
|
var cycles = /* @__PURE__ */ new Map();
|
|
226
371
|
function usesHour12(locale, timeFormat = "auto") {
|
|
@@ -245,7 +390,7 @@ function toMs(at) {
|
|
|
245
390
|
function createFormatters(o) {
|
|
246
391
|
const w = wordsFor(o.locale);
|
|
247
392
|
const hour12 = usesHour12(o.locale, o.timeFormat);
|
|
248
|
-
|
|
393
|
+
const fmt = {
|
|
249
394
|
hour12,
|
|
250
395
|
time(at, opts = {}) {
|
|
251
396
|
const d = new Date(toMs(at));
|
|
@@ -253,7 +398,15 @@ function createFormatters(o) {
|
|
|
253
398
|
const rest = `:${pad2(d.getMinutes())}${opts.seconds ? `:${pad2(d.getSeconds())}` : ""}`;
|
|
254
399
|
if (!hour12) return `${pad2(h)}${rest}`;
|
|
255
400
|
const base2 = `${h % 12 || 12}${rest}`;
|
|
256
|
-
|
|
401
|
+
if (opts.ampm === false) return base2;
|
|
402
|
+
const mark = h < 12 ? w.am : w.pm;
|
|
403
|
+
return w.ampmFirst ? `${mark} ${base2}` : `${base2} ${mark}`;
|
|
404
|
+
},
|
|
405
|
+
range(from, to, opts = {}) {
|
|
406
|
+
const a = new Date(toMs(from));
|
|
407
|
+
const b = new Date(toMs(to));
|
|
408
|
+
if (!hour12 || a.getHours() < 12 !== b.getHours() < 12) return `${fmt.time(a, opts)}\u2013${fmt.time(b, opts)}`;
|
|
409
|
+
return w.ampmFirst ? `${fmt.time(a, opts)}\u2013${fmt.time(b, { ...opts, ampm: false })}` : `${fmt.time(a, { ...opts, ampm: false })}\u2013${fmt.time(b, opts)}`;
|
|
257
410
|
},
|
|
258
411
|
ago(at, opts = {}) {
|
|
259
412
|
const suffix = opts.suffix !== false;
|
|
@@ -262,20 +415,21 @@ function createFormatters(o) {
|
|
|
262
415
|
if (!Number.isFinite(min) || min < 1) return suffix ? w.justNow : w.now;
|
|
263
416
|
const h = Math.floor(min / 60);
|
|
264
417
|
const d = Math.floor(h / 24);
|
|
265
|
-
const v = min < 60 ?
|
|
266
|
-
return suffix ? w.ago(v) : v;
|
|
418
|
+
const [v, n] = min < 60 ? [w.min(min), min] : h < 24 ? [w.h(h), h] : d < 14 ? [w.d(d), d] : d < 365 ? [w.wk(Math.floor(d / 7)), Math.floor(d / 7)] : [w.yr(Math.floor(d / 365)), Math.floor(d / 365)];
|
|
419
|
+
return suffix ? w.ago(v, n) : v;
|
|
267
420
|
},
|
|
268
421
|
duration(ms, opts = {}) {
|
|
269
422
|
const round = opts.round === "up" ? Math.ceil : opts.round === "nearest" ? Math.round : Math.floor;
|
|
270
423
|
const safe = Number.isFinite(ms) ? Math.max(0, ms) : 0;
|
|
271
|
-
if (opts.seconds && safe < 6e4) return
|
|
424
|
+
if (opts.seconds && safe < 6e4) return w.s(round(safe / 1e3));
|
|
272
425
|
const min = round(safe / 6e4);
|
|
273
|
-
if (min < 60) return
|
|
426
|
+
if (min < 60) return w.min(min);
|
|
274
427
|
const h = Math.floor(min / 60);
|
|
275
|
-
if (h < 24) return opts.compact && min % 60 === 0 ?
|
|
276
|
-
return opts.compact && h % 24 === 0 ?
|
|
428
|
+
if (h < 24) return opts.compact && min % 60 === 0 ? w.h(h) : w.hm(h, min % 60);
|
|
429
|
+
return opts.compact && h % 24 === 0 ? w.d(h / 24) : w.dh(Math.floor(h / 24), h % 24);
|
|
277
430
|
}
|
|
278
431
|
};
|
|
432
|
+
return fmt;
|
|
279
433
|
}
|
|
280
434
|
|
|
281
435
|
// packages/sdk/src/workday.ts
|
|
@@ -310,18 +464,21 @@ function weeklyHours(w) {
|
|
|
310
464
|
|
|
311
465
|
// packages/sdk/src/list.ts
|
|
312
466
|
var LAYOUT_LABELS = {
|
|
313
|
-
auto: { en: "Automatic", es: "Autom\xE1tico" },
|
|
314
|
-
"one-line": { en: "One line", es: "Una l\xEDnea" },
|
|
315
|
-
detailed: { en: "Detailed", es: "Detallado" }
|
|
467
|
+
auto: { en: "Automatic", es: "Autom\xE1tico", de: "Automatisch", "zh-Hant": "\u81EA\u52D5", "zh-Hans": "\u81EA\u52A8" },
|
|
468
|
+
"one-line": { en: "One line", es: "Una l\xEDnea", de: "Eine Zeile", "zh-Hant": "\u55AE\u884C", "zh-Hans": "\u5355\u884C" },
|
|
469
|
+
detailed: { en: "Detailed", es: "Detallado", de: "Ausf\xFChrlich", "zh-Hant": "\u8A73\u7D30", "zh-Hans": "\u8BE6\u7EC6" }
|
|
316
470
|
};
|
|
317
471
|
var rowsField = (def) => t.integer({
|
|
318
472
|
default: def,
|
|
319
473
|
min: 0,
|
|
320
474
|
max: 30,
|
|
321
|
-
label: { en: "Rows", es: "Filas" },
|
|
475
|
+
label: { en: "Rows", es: "Filas", de: "Zeilen", "zh-Hant": "\u5217\u6578", "zh-Hans": "\u884C\u6570" },
|
|
322
476
|
help: {
|
|
323
477
|
en: '0 = as many as fit. A number shows that many, in rows of a readable size (fewer when the tile is too small for them); the rest are counted in "+N more".',
|
|
324
|
-
es: "0 = las que quepan. Con un n\xFAmero se ven esas, en filas de un tama\xF1o legible (menos si la tesela no da para ellas); el resto se cuenta en \xAB+N m\xE1s\xBB."
|
|
478
|
+
es: "0 = las que quepan. Con un n\xFAmero se ven esas, en filas de un tama\xF1o legible (menos si la tesela no da para ellas); el resto se cuenta en \xAB+N m\xE1s\xBB.",
|
|
479
|
+
de: "0 = so viele, wie passen. Eine Zahl zeigt so viele, in Zeilen lesbarer Gr\xF6\xDFe (weniger, wenn die Kachel daf\xFCr zu klein ist); der Rest wird als \u201E+N weitere\u201C gez\xE4hlt.",
|
|
480
|
+
"zh-Hant": "0 = \u76E1\u91CF\u653E\u6EFF\u3002\u586B\u6578\u5B57\u5247\u986F\u793A\u8A72\u6578\u91CF\uFF0C\u4E26\u4EE5\u6613\u8B80\u7684\u5927\u5C0F\u6392\u5217\uFF08\u65B9\u683C\u592A\u5C0F\u6642\u6703\u6E1B\u5C11\uFF09\uFF1B\u5176\u9918\u7684\u8A08\u5165\u300C\u9084\u6709 N \u500B\u300D\u3002",
|
|
481
|
+
"zh-Hans": "0 = \u5C3D\u91CF\u653E\u6EE1\u3002\u586B\u6570\u5B57\u5219\u663E\u793A\u8BE5\u6570\u91CF\uFF0C\u5E76\u4EE5\u6613\u8BFB\u7684\u5927\u5C0F\u6392\u5217\uFF08\u683C\u5B50\u592A\u5C0F\u65F6\u4F1A\u51CF\u5C11\uFF09\uFF1B\u5176\u4F59\u7684\u8BA1\u5165\u201C\u8FD8\u6709 N \u4E2A\u201D\u3002"
|
|
325
482
|
}
|
|
326
483
|
});
|
|
327
484
|
function listOptions(o = {}) {
|
|
@@ -332,9 +489,9 @@ function listOptions(o = {}) {
|
|
|
332
489
|
rows,
|
|
333
490
|
layout: t.enum(values, {
|
|
334
491
|
default: o.layout ?? "auto",
|
|
335
|
-
label: { en: "Row layout", es: "Formato de fila" },
|
|
492
|
+
label: { en: "Row layout", es: "Formato de fila", de: "Zeilenlayout", "zh-Hant": "\u5217\u7248\u9762", "zh-Hans": "\u884C\u5E03\u5C40" },
|
|
336
493
|
labels: Object.fromEntries(values.map((v) => [v, LAYOUT_LABELS[v]])),
|
|
337
|
-
help: { en: "Automatic: the widget picks by the tile's shape.", es: "Autom\xE1tico: el widget elige seg\xFAn la forma de la tesela." }
|
|
494
|
+
help: { en: "Automatic: the widget picks by the tile's shape.", es: "Autom\xE1tico: el widget elige seg\xFAn la forma de la tesela.", de: "Automatisch: Das Widget w\xE4hlt nach der Form der Kachel.", "zh-Hant": "\u81EA\u52D5\uFF1A\u5C0F\u5DE5\u5177\u4F9D\u65B9\u683C\u5F62\u72C0\u9078\u64C7\u3002", "zh-Hans": "\u81EA\u52A8\uFF1A\u5C0F\u7EC4\u4EF6\u6839\u636E\u683C\u5B50\u5F62\u72B6\u9009\u62E9\u3002" }
|
|
338
495
|
})
|
|
339
496
|
};
|
|
340
497
|
}
|
|
@@ -380,7 +537,7 @@ function listLayout(box, count, options, spec) {
|
|
|
380
537
|
return { layout, rowH, rows, shown, hidden: n - shown, more, ...text(rowH) };
|
|
381
538
|
}
|
|
382
539
|
function moreLabel(n, tr) {
|
|
383
|
-
return tr({ en: `+${n} more`, es: `+${n} m\xE1s` });
|
|
540
|
+
return tr({ en: `+${n} more`, es: `+${n} m\xE1s`, de: `+${n} weitere`, "zh-Hant": `\u9084\u6709 ${n} \u500B`, "zh-Hans": `\u8FD8\u6709 ${n} \u4E2A` });
|
|
384
541
|
}
|
|
385
542
|
function drawMore(g, ctx, plan, o = {}) {
|
|
386
543
|
const m = plan.more;
|
|
@@ -437,6 +594,8 @@ function createBaseContext(o) {
|
|
|
437
594
|
now: o.now,
|
|
438
595
|
locale,
|
|
439
596
|
t: (text) => localize(text, locale),
|
|
597
|
+
plural: (n, forms) => plural(n, forms, locale),
|
|
598
|
+
pickLanguage: (available) => pickLocale(available, locale) ?? (available.includes("en") ? "en" : available[0] ?? "en"),
|
|
440
599
|
fmt: createFormatters({ locale, timeFormat: o.timeFormat ?? "auto", now: o.now }),
|
|
441
600
|
log: o.log ?? (() => void 0),
|
|
442
601
|
dataDir: o.dataDir ?? "",
|
|
@@ -456,11 +615,11 @@ function locationOptions() {
|
|
|
456
615
|
step: 1e-4,
|
|
457
616
|
unit: "\xB0",
|
|
458
617
|
advanced: true,
|
|
459
|
-
label: { en: "Latitude", es: "Latitud" },
|
|
460
|
-
help: { en: "Leave latitude and longitude at 0 to use the place in Settings.", es: "Con latitud y longitud a 0 se usa el lugar de los ajustes." }
|
|
618
|
+
label: { en: "Latitude", es: "Latitud", de: "Breitengrad", "zh-Hant": "\u7DEF\u5EA6", "zh-Hans": "\u7EAC\u5EA6" },
|
|
619
|
+
help: { en: "Leave latitude and longitude at 0 to use the place in Settings.", es: "Con latitud y longitud a 0 se usa el lugar de los ajustes.", de: "Breiten- und L\xE4ngengrad auf 0 lassen, um den Ort aus den Einstellungen zu verwenden.", "zh-Hant": "\u7DEF\u5EA6\u548C\u7D93\u5EA6\u4FDD\u6301 0 \u5373\u4F7F\u7528\u8A2D\u5B9A\u4E2D\u7684\u5730\u9EDE\u3002", "zh-Hans": "\u7EAC\u5EA6\u548C\u7ECF\u5EA6\u4FDD\u6301\u4E3A 0 \u65F6\u4F7F\u7528\u8BBE\u7F6E\u4E2D\u7684\u5730\u70B9\u3002" }
|
|
461
620
|
}),
|
|
462
|
-
longitude: t.number({ default: 0, min: -180, max: 180, step: 1e-4, unit: "\xB0", advanced: true, label: { en: "Longitude", es: "Longitud" } }),
|
|
463
|
-
placeName: t.string({ advanced: true, placeholder: "Madrid", label: { en: "Place name", es: "Nombre del lugar" }, help: { en: "Empty: the one in Settings.", es: "Vac\xEDo: el de los ajustes." } })
|
|
621
|
+
longitude: t.number({ default: 0, min: -180, max: 180, step: 1e-4, unit: "\xB0", advanced: true, label: { en: "Longitude", es: "Longitud", de: "L\xE4ngengrad", "zh-Hant": "\u7D93\u5EA6", "zh-Hans": "\u7ECF\u5EA6" } }),
|
|
622
|
+
placeName: t.string({ advanced: true, placeholder: "Madrid", label: { en: "Place name", es: "Nombre del lugar", de: "Ortsname", "zh-Hant": "\u5730\u9EDE\u540D\u7A31", "zh-Hans": "\u5730\u70B9\u540D\u79F0" }, help: { en: "Empty: the one in Settings.", es: "Vac\xEDo: el de los ajustes.", de: "Leer: der aus den Einstellungen.", "zh-Hant": "\u7559\u7A7A\uFF1A\u4F7F\u7528\u8A2D\u5B9A\u4E2D\u7684\u5730\u9EDE\u3002", "zh-Hans": "\u7559\u7A7A\uFF1A\u4F7F\u7528\u8BBE\u7F6E\u4E2D\u7684\u5730\u70B9\u3002" } })
|
|
464
623
|
};
|
|
465
624
|
}
|
|
466
625
|
function placeOf(own, user) {
|
|
@@ -683,12 +842,18 @@ function createHttp(o = {}) {
|
|
|
683
842
|
};
|
|
684
843
|
}
|
|
685
844
|
export {
|
|
845
|
+
ALERT_LEVELS,
|
|
686
846
|
CATEGORIES,
|
|
687
847
|
DEFAULT_THEME,
|
|
688
848
|
DEFAULT_WORKDAY,
|
|
689
849
|
FILTER_HELP,
|
|
690
850
|
FONT_FAMILIES,
|
|
851
|
+
FORMAT_LANGUAGES,
|
|
691
852
|
HttpError,
|
|
853
|
+
LANGUAGES,
|
|
854
|
+
LANGUAGE_IDS,
|
|
855
|
+
PAD_KEYS,
|
|
856
|
+
PluginError,
|
|
692
857
|
SDK_VERSION,
|
|
693
858
|
SECRET_NOTE,
|
|
694
859
|
THEMES,
|
|
@@ -706,9 +871,12 @@ export {
|
|
|
706
871
|
defineWidget,
|
|
707
872
|
drawEmpty,
|
|
708
873
|
drawMore,
|
|
874
|
+
errorMessage,
|
|
709
875
|
expandPath,
|
|
710
876
|
filterPatterns,
|
|
877
|
+
hanScript,
|
|
711
878
|
isWorkingAt,
|
|
879
|
+
languageById,
|
|
712
880
|
listLayout,
|
|
713
881
|
listOptions,
|
|
714
882
|
localize,
|
|
@@ -717,8 +885,11 @@ export {
|
|
|
717
885
|
minutesOf,
|
|
718
886
|
moreHeight,
|
|
719
887
|
moreLabel,
|
|
888
|
+
parseLocale,
|
|
720
889
|
parseVersion,
|
|
890
|
+
pickLocale,
|
|
721
891
|
placeOf,
|
|
892
|
+
plural,
|
|
722
893
|
retryAtOf,
|
|
723
894
|
risksOf,
|
|
724
895
|
satisfies,
|