kiosko 0.2.7 → 0.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiosko",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "A widget mosaic for small always-on USB LCD panels (Thermalright Trofeo Vision and friends), with a visual editor and plugins.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,6 +36,12 @@
36
36
  "type": "git",
37
37
  "url": "git+https://github.com/kiosko-lcd/kiosko.git"
38
38
  },
39
+ "homepage": "https://kioskolcd.dev",
40
+ "bugs": {
41
+ "url": "https://github.com/kiosko-lcd/kiosko/issues",
42
+ "email": "info@kioskolcd.dev"
43
+ },
44
+ "author": "Loksly <info@kioskolcd.dev> (https://kioskolcd.dev)",
39
45
  "dependencies": {
40
46
  "@napi-rs/canvas": "^1.1.0",
41
47
  "dejavu-fonts-ttf": "^2.37.3"
package/screen-thread.js CHANGED
@@ -106,7 +106,7 @@ import { homedir as homedir2, platform } from "node:os";
106
106
 
107
107
  // packages/sdk/src/plugin.ts
108
108
  var PAD_KEYS = ["up", "down", "left", "right", "a", "b", "x", "y", "l", "r", "start", "select"];
109
- var SDK_VERSION = "0.2.7";
109
+ var SDK_VERSION = "0.2.8";
110
110
  function defineWidget(w) {
111
111
  return w;
112
112
  }
@@ -377,9 +377,9 @@ function themeById(id) {
377
377
 
378
378
  // packages/sdk/src/languages.ts
379
379
  var MAINLAND_CHINA = {
380
- without: ["agents", "cats", "usage"],
381
- first: ["llm", "gpu"],
382
- instead: { "agents/summary": "llm/status", "agents/sessions": "llm/models", "usage/rail": "gpu/cards", "cats/room": "gpu/history" }
380
+ without: [],
381
+ first: ["llm", "gpu", "usage"],
382
+ instead: { "usage/rail": "usage/balance", "usage/blocks": "usage/agents" }
383
383
  };
384
384
  var LANGUAGES = [
385
385
  { id: "en", name: "English", panel: "en", ogLocale: "en_US", hreflang: ["en", "x-default"], dir: "ltr" },
@@ -3530,17 +3530,34 @@ var clock = defineWidget({
3530
3530
  const at = wallClock(now, options.timeZone);
3531
3531
  const clock2 = options.timeFormat === "inherit" ? fmt : createFormatters({ locale, timeFormat: options.timeFormat, now });
3532
3532
  const text2 = clock2.time(at, { seconds: options.showSeconds, ampm: false });
3533
+ const full = clock2.hour12 ? clock2.time(at, { seconds: options.showSeconds }) : text2;
3534
+ const mark = full === text2 ? "" : full.replace(text2, "").trim();
3535
+ const markFirst = !!mark && full.startsWith(mark);
3533
3536
  const dateText = options.showDate ? new Date(at).toLocaleDateString(locale, DATE_FORMATS[options.dateFormat]) : "";
3534
3537
  const dateH = options.showDate ? Math.min(box.h * 0.2, 40) : 0;
3535
- const size = fit(g, text2, theme.fonts.monoBold, box.w * 0.96, (box.h - dateH * 1.3) * 0.95);
3538
+ const size = fit(g, text2, theme.fonts.monoBold, box.w * (mark ? 0.76 : 0.96), (box.h - dateH * 1.3) * 0.95);
3536
3539
  const color = options.color === "accent" ? theme.colors.accent : options.color === "dim" ? theme.colors.inkDim : theme.colors.ink;
3537
- const x = options.align === "left" ? box.x : options.align === "right" ? box.x + box.w : box.x + box.w / 2;
3538
3540
  const block = size * 0.78 + (dateH ? dateH * 1.4 : 0);
3539
3541
  const base2 = box.y + (box.h - block) / 2 + size * 0.78;
3540
- g.textAlign = options.align;
3542
+ g.font = `${size}px "${theme.fonts.monoBold}"`;
3543
+ const digitsW = g.measureText(text2).width;
3544
+ const markSize = Math.max(8, Math.round(size * 0.26));
3545
+ g.font = `${markSize}px "${theme.fonts.sansBold}"`;
3546
+ const markW = mark ? g.measureText(mark).width + size * 0.08 : 0;
3547
+ const total = digitsW + markW;
3548
+ const left = options.align === "left" ? box.x : options.align === "right" ? box.x + box.w - total : box.x + (box.w - total) / 2;
3549
+ const digitsX = markFirst ? left + markW : left;
3550
+ g.textAlign = "left";
3541
3551
  g.fillStyle = color;
3542
3552
  g.font = `${size}px "${theme.fonts.monoBold}"`;
3543
- g.fillText(text2, x, base2);
3553
+ g.fillText(text2, digitsX, base2);
3554
+ if (mark) {
3555
+ g.fillStyle = theme.colors.inkDim;
3556
+ g.font = `${markSize}px "${theme.fonts.sansBold}"`;
3557
+ g.fillText(mark, markFirst ? left : left + digitsW + size * 0.08, base2 - size * 0.78 + markSize * 0.92);
3558
+ }
3559
+ const x = options.align === "left" ? box.x : options.align === "right" ? box.x + box.w : box.x + box.w / 2;
3560
+ g.textAlign = options.align;
3544
3561
  if (dateH) {
3545
3562
  const ds = Math.min(dateH, fit(g, dateText, theme.fonts.sans, box.w * 0.96, dateH));
3546
3563
  g.font = `${ds}px "${theme.fonts.sans}"`;
@@ -3813,7 +3830,7 @@ var image = defineWidget({
3813
3830
  var src_default = definePlugin({
3814
3831
  id: "core",
3815
3832
  name: { en: "Essentials", es: "B\xE1sicos", de: "Grundlagen", "zh-Hant": "\u57FA\u672C\u5DE5\u5177", "zh-Hans": "\u57FA\u7840\u7EC4\u4EF6" },
3816
- version: "0.2.7",
3833
+ version: "0.2.8",
3817
3834
  languages: ["en", "es", "de", "zh-Hant", "zh-Hans"],
3818
3835
  sdk: "^0.2.0",
3819
3836
  // The picture widget reads the image (or folder, or URL) you give it.
@@ -3909,7 +3926,7 @@ var module2 = defineWidget({
3909
3926
  var src_default2 = definePlugin({
3910
3927
  id: "legacy",
3911
3928
  name: { en: "aimonitor compatibility", es: "Compatibilidad aimonitor", de: "aimonitor-Kompatibilit\xE4t", "zh-Hant": "aimonitor \u76F8\u5BB9\u6027", "zh-Hans": "aimonitor \u517C\u5BB9" },
3912
- version: "0.2.7",
3929
+ version: "0.2.8",
3913
3930
  languages: ["en", "es", "de", "zh-Hant", "zh-Hans"],
3914
3931
  sdk: "^0.2.0",
3915
3932
  // Runs the aimonitor modules you point it at, and reads their folder.
package/sdk.js CHANGED
@@ -7,14 +7,14 @@ var CATEGORIES = [
7
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
8
  { id: "productivity", label: { en: "Productivity", es: "Productividad", de: "Produktivit\xE4t", "zh-Hant": "\u751F\u7522\u529B", "zh-Hans": "\u6548\u7387" } },
9
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" } },
10
+ { id: "info", label: { en: "News & world", es: "Noticias y mundo", de: "Nachrichten & Welt", "zh-Hant": "\u8CC7\u8A0A\u8207\u751F\u6D3B", "zh-Hans": "\u8D44\u8BAF\u4E0E\u751F\u6D3B" } },
11
11
  { id: "media", label: { en: "Media", es: "Multimedia", de: "Medien", "zh-Hant": "\u591A\u5A92\u9AD4", "zh-Hans": "\u591A\u5A92\u4F53" } },
12
12
  { id: "scene", label: { en: "Scenes", es: "Escenas", de: "Szenen", "zh-Hant": "\u5834\u666F", "zh-Hans": "\u573A\u666F" } },
13
13
  { id: "fun", label: { en: "Fun", es: "Diversi\xF3n", de: "Spa\xDF", "zh-Hant": "\u8DA3\u5473", "zh-Hans": "\u8DA3\u5473" } }
14
14
  ];
15
15
  var ALERT_LEVELS = ["info", "warn", "critical"];
16
16
  var PAD_KEYS = ["up", "down", "left", "right", "a", "b", "x", "y", "l", "r", "start", "select"];
17
- var SDK_VERSION = "0.2.7";
17
+ var SDK_VERSION = "0.2.8";
18
18
  function defineWidget(w) {
19
19
  return w;
20
20
  }
@@ -307,9 +307,9 @@ function themeById(id) {
307
307
 
308
308
  // packages/sdk/src/languages.ts
309
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" }
310
+ without: [],
311
+ first: ["llm", "gpu", "usage"],
312
+ instead: { "usage/rail": "usage/balance", "usage/blocks": "usage/agents" }
313
313
  };
314
314
  var LANGUAGES = [
315
315
  { id: "en", name: "English", panel: "en", ogLocale: "en_US", hreflang: ["en", "x-default"], dir: "ltr" },
@@ -322,6 +322,27 @@ var LANGUAGE_IDS = LANGUAGES.map((l) => l.id);
322
322
  function languageById(id) {
323
323
  return LANGUAGES.find((l) => l.id === id);
324
324
  }
325
+ var REGION_NAMES = {
326
+ "zh-Hans": { TW: "\u4E2D\u56FD\u53F0\u6E7E", HK: "\u4E2D\u56FD\u9999\u6E2F", MO: "\u4E2D\u56FD\u6FB3\u95E8" },
327
+ "zh-Hant": { HK: "\u9999\u6E2F", MO: "\u6FB3\u9580" }
328
+ };
329
+ function regionName(code, lang) {
330
+ const own = REGION_NAMES[lang]?.[code.toUpperCase()];
331
+ if (own) return own;
332
+ try {
333
+ return new Intl.DisplayNames([lang], { type: "region" }).of(code) ?? code;
334
+ } catch {
335
+ return code;
336
+ }
337
+ }
338
+ function listIn(items, lang) {
339
+ if (/^zh\b/.test(lang)) return items.join("\u3001");
340
+ try {
341
+ return new Intl.ListFormat(lang, { type: "conjunction" }).format(items);
342
+ } catch {
343
+ return items.join(", ");
344
+ }
345
+ }
325
346
 
326
347
  // packages/sdk/src/format.ts
327
348
  var TIME_FORMATS = ["auto", "24h", "12h"];
@@ -877,6 +898,7 @@ export {
877
898
  hanScript,
878
899
  isWorkingAt,
879
900
  languageById,
901
+ listIn,
880
902
  listLayout,
881
903
  listOptions,
882
904
  localize,
@@ -890,6 +912,7 @@ export {
890
912
  pickLocale,
891
913
  placeOf,
892
914
  plural,
915
+ regionName,
893
916
  retryAtOf,
894
917
  risksOf,
895
918
  satisfies,