poe-svelte-ui-lib 2.34.0 → 2.35.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.
Files changed (37) hide show
  1. package/README.md +12 -10
  2. package/dist/GUIRenderer/GUIRenderer.svelte +45 -4
  3. package/dist/GUIRenderer/GUIRenderer.svelte.d.ts +2 -0
  4. package/dist/WidgetFirmware/FirmwareIcon.svelte +12 -0
  5. package/dist/WidgetFirmware/FirmwareIcon.svelte.d.ts +18 -0
  6. package/dist/WidgetFirmware/README.md +140 -0
  7. package/dist/WidgetFirmware/WidgetFirmware.svelte +163 -0
  8. package/dist/WidgetFirmware/WidgetFirmware.svelte.d.ts +4 -0
  9. package/dist/WidgetFirmware/WidgetFirmwareProps.svelte +36 -0
  10. package/dist/WidgetFirmware/WidgetFirmwareProps.svelte.d.ts +9 -0
  11. package/dist/WidgetFirmware/firmware.d.ts +12 -0
  12. package/dist/WidgetFirmware/firmware.js +48 -0
  13. package/dist/busBridge.d.ts +2 -1
  14. package/dist/busBridge.js +2 -1
  15. package/dist/constructor.d.ts +2 -1
  16. package/dist/constructor.js +3 -1
  17. package/dist/defaults.js +2 -0
  18. package/dist/dictionaries/generated/poe_gui.d.ts +2 -1
  19. package/dist/dictionaries/generated/poe_gui.js +2 -1
  20. package/dist/dictionaries/poe_gui.yaml +1 -0
  21. package/dist/firmwareUpdate.d.ts +18 -0
  22. package/dist/firmwareUpdate.js +129 -0
  23. package/dist/fsTransfer.d.ts +3 -1
  24. package/dist/gui.d.ts +3 -0
  25. package/dist/gui.js +3 -0
  26. package/dist/guiViews.d.ts +2 -0
  27. package/dist/guiViews.js +2 -0
  28. package/dist/index.d.ts +5 -2
  29. package/dist/index.js +3 -0
  30. package/dist/locales/constructor.d.ts +20 -0
  31. package/dist/locales/constructor.js +12 -0
  32. package/dist/locales/i18n.js +1 -0
  33. package/dist/locales/translations.d.ts +125 -0
  34. package/dist/locales/translations.js +53 -0
  35. package/dist/registry.js +2 -0
  36. package/dist/types.d.ts +27 -0
  37. package/package.json +1 -1
@@ -23,6 +23,7 @@ import WidgetDeviceInfoProps from "./WidgetDeviceInfo/WidgetDeviceInfoProps.svel
23
23
  import WidgetLoRaProps from "./WidgetLoRa/WidgetLoRaProps.svelte";
24
24
  import WidgetFileSystemProps from "./WidgetFileSystem/WidgetFileSystemProps.svelte";
25
25
  import WidgetStackInfoProps from "./WidgetStackInfo/WidgetStackInfoProps.svelte";
26
+ import WidgetFirmwareProps from "./WidgetFirmware/WidgetFirmwareProps.svelte";
26
27
  import WidgetRGBStripProps from "./WidgetRGBStrip/WidgetRGBStripProps.svelte";
27
28
  import WidgetPFDProps from "./WidgetPFD/WidgetPFDProps.svelte";
28
29
  import WidgetMapProps from "./WidgetMap/WidgetMapProps.svelte";
@@ -31,6 +32,6 @@ export { optionsStore } from "./options";
31
32
  export { createPropsEditor, applyPropertyChange, type PropertyChange } from "./propsEditor";
32
33
  export { default as CommonSnippets } from "./CommonSnippets.svelte";
33
34
  export { COMPONENT_DEFAULTS, COMPONENT_SIZES, minComponentWidth, createComponent } from "./defaults";
34
- export { AccordionProps, ButtonProps, DividerProps, FileAttachProps, GraphProps, InputProps, JoystickProps, PeriodChartProps, ProgressBarProps, SelectProps, SliderProps, SwitchProps, TableProps, TabsProps, TextFieldProps, VideoViewerProps, WidgetProps, WidgetWiFiProps, WidgetDeviceInfoProps, WidgetLoRaProps, WidgetFileSystemProps, WidgetStackInfoProps, WidgetRGBStripProps, WidgetPFDProps, WidgetMapProps, };
35
+ export { AccordionProps, ButtonProps, DividerProps, FileAttachProps, GraphProps, InputProps, JoystickProps, PeriodChartProps, ProgressBarProps, SelectProps, SliderProps, SwitchProps, TableProps, TabsProps, TextFieldProps, VideoViewerProps, WidgetProps, WidgetWiFiProps, WidgetDeviceInfoProps, WidgetLoRaProps, WidgetFileSystemProps, WidgetStackInfoProps, WidgetFirmwareProps, WidgetRGBStripProps, WidgetPFDProps, WidgetMapProps, };
35
36
  export declare const PANELS: Record<UIType, Component<any>>;
36
37
  export { default as TextsEditor } from "./TextsEditor.svelte";
@@ -23,6 +23,7 @@ import WidgetDeviceInfoProps from "./WidgetDeviceInfo/WidgetDeviceInfoProps.svel
23
23
  import WidgetLoRaProps from "./WidgetLoRa/WidgetLoRaProps.svelte";
24
24
  import WidgetFileSystemProps from "./WidgetFileSystem/WidgetFileSystemProps.svelte";
25
25
  import WidgetStackInfoProps from "./WidgetStackInfo/WidgetStackInfoProps.svelte";
26
+ import WidgetFirmwareProps from "./WidgetFirmware/WidgetFirmwareProps.svelte";
26
27
  import WidgetRGBStripProps from "./WidgetRGBStrip/WidgetRGBStripProps.svelte";
27
28
  import WidgetPFDProps from "./WidgetPFD/WidgetPFDProps.svelte";
28
29
  import WidgetMapProps from "./WidgetMap/WidgetMapProps.svelte";
@@ -32,7 +33,7 @@ export { optionsStore } from "./options";
32
33
  export { createPropsEditor, applyPropertyChange } from "./propsEditor";
33
34
  export { default as CommonSnippets } from "./CommonSnippets.svelte";
34
35
  export { COMPONENT_DEFAULTS, COMPONENT_SIZES, minComponentWidth, createComponent } from "./defaults";
35
- export { AccordionProps, ButtonProps, DividerProps, FileAttachProps, GraphProps, InputProps, JoystickProps, PeriodChartProps, ProgressBarProps, SelectProps, SliderProps, SwitchProps, TableProps, TabsProps, TextFieldProps, VideoViewerProps, WidgetProps, WidgetWiFiProps, WidgetDeviceInfoProps, WidgetLoRaProps, WidgetFileSystemProps, WidgetStackInfoProps, WidgetRGBStripProps, WidgetPFDProps, WidgetMapProps, };
36
+ export { AccordionProps, ButtonProps, DividerProps, FileAttachProps, GraphProps, InputProps, JoystickProps, PeriodChartProps, ProgressBarProps, SelectProps, SliderProps, SwitchProps, TableProps, TabsProps, TextFieldProps, VideoViewerProps, WidgetProps, WidgetWiFiProps, WidgetDeviceInfoProps, WidgetLoRaProps, WidgetFileSystemProps, WidgetStackInfoProps, WidgetFirmwareProps, WidgetRGBStripProps, WidgetPFDProps, WidgetMapProps, };
36
37
  /* Панель свойств по типу: <Panel component={c} onPropertyChange={...} /> вместо ветвления по типам */
37
38
  export const PANELS = {
38
39
  Accordion: AccordionProps,
@@ -57,6 +58,7 @@ export const PANELS = {
57
58
  WidgetLoRa: WidgetLoRaProps,
58
59
  WidgetFileSystem: WidgetFileSystemProps,
59
60
  WidgetStackInfo: WidgetStackInfoProps,
61
+ WidgetFirmware: WidgetFirmwareProps,
60
62
  WidgetRGBStrip: WidgetRGBStripProps,
61
63
  WidgetPFD: WidgetPFDProps,
62
64
  WidgetMap: WidgetMapProps,
package/dist/defaults.js CHANGED
@@ -12,6 +12,7 @@ export const COMPONENT_DEFAULTS = {
12
12
  WidgetLoRa: { ...widget("WidgetLoRa"), id: "LORA", preset: "HT_CT62", params: structuredClone(LORA_PRESETS.HT_CT62.params) },
13
13
  WidgetFileSystem: { ...widget("WidgetFileSystem"), id: "CFG", accept: "*/*", maxNameLength: 31 },
14
14
  WidgetStackInfo: { ...widget("WidgetStackInfo"), warnBytes: 512, period: 0 },
15
+ WidgetFirmware: { ...widget("WidgetFirmware"), accept: ".bin" },
15
16
  WidgetRGBStrip: { ...widget("WidgetRGBStrip"), id: "LST" },
16
17
  WidgetPFD: { ...widget("WidgetPFD"), id: "MAV", limits: { staleMs: 2000 } },
17
18
  WidgetMap: { ...widget("WidgetMap"), groups: ["MAV"], height: 400, trackEnabled: false, trackLength: 1000 },
@@ -76,6 +77,7 @@ export const COMPONENT_SIZES = {
76
77
  WidgetLoRa: { width: 7, height: 1 },
77
78
  WidgetFileSystem: { width: 7, height: 1 },
78
79
  WidgetStackInfo: { width: 7, height: 1 },
80
+ WidgetFirmware: { width: 7, height: 1 },
79
81
  WidgetRGBStrip: { width: 7, height: 1 },
80
82
  WidgetPFD: { width: 7, height: 1 },
81
83
  WidgetMap: { width: 7, height: 1 },
@@ -1,4 +1,4 @@
1
- export declare const COMPONENT_TYPES: readonly ["Accordion", "Tabs", "TextField", "Divider", "Button", "FileAttach", "Input", "Select", "Switch", "Slider", "Joystick", "Widget", "ProgressBar", "Graph", "PeriodChart", "Table", "VideoViewer", "WidgetWiFi", "WidgetDeviceInfo", "WidgetLoRa", "WidgetFileSystem", "WidgetStackInfo", "WidgetRGBStrip", "WidgetPFD", "WidgetMap"];
1
+ export declare const COMPONENT_TYPES: readonly ["Accordion", "Tabs", "TextField", "Divider", "Button", "FileAttach", "Input", "Select", "Switch", "Slider", "Joystick", "Widget", "ProgressBar", "Graph", "PeriodChart", "Table", "VideoViewer", "WidgetWiFi", "WidgetDeviceInfo", "WidgetLoRa", "WidgetFileSystem", "WidgetStackInfo", "WidgetFirmware", "WidgetRGBStrip", "WidgetPFD", "WidgetMap"];
2
2
  export declare const COMPONENT_IO: {
3
3
  readonly Accordion: "none";
4
4
  readonly Tabs: "none";
@@ -22,6 +22,7 @@ export declare const COMPONENT_IO: {
22
22
  readonly WidgetLoRa: "widget";
23
23
  readonly WidgetFileSystem: "widget";
24
24
  readonly WidgetStackInfo: "widget";
25
+ readonly WidgetFirmware: "widget";
25
26
  readonly WidgetRGBStrip: "widget";
26
27
  readonly WidgetPFD: "widget";
27
28
  readonly WidgetMap: "widget";
@@ -1,5 +1,5 @@
1
1
  /* $lib/dictionaries/generated/poe_gui.ts - СГЕНЕРИРОВАНО из poe_gui.yaml (npm run Generate), руками не править */
2
- export const COMPONENT_TYPES = ["Accordion", "Tabs", "TextField", "Divider", "Button", "FileAttach", "Input", "Select", "Switch", "Slider", "Joystick", "Widget", "ProgressBar", "Graph", "PeriodChart", "Table", "VideoViewer", "WidgetWiFi", "WidgetDeviceInfo", "WidgetLoRa", "WidgetFileSystem", "WidgetStackInfo", "WidgetRGBStrip", "WidgetPFD", "WidgetMap"];
2
+ export const COMPONENT_TYPES = ["Accordion", "Tabs", "TextField", "Divider", "Button", "FileAttach", "Input", "Select", "Switch", "Slider", "Joystick", "Widget", "ProgressBar", "Graph", "PeriodChart", "Table", "VideoViewer", "WidgetWiFi", "WidgetDeviceInfo", "WidgetLoRa", "WidgetFileSystem", "WidgetStackInfo", "WidgetFirmware", "WidgetRGBStrip", "WidgetPFD", "WidgetMap"];
3
3
  export const COMPONENT_IO = {
4
4
  Accordion: "none",
5
5
  Tabs: "none",
@@ -23,6 +23,7 @@ export const COMPONENT_IO = {
23
23
  WidgetLoRa: "widget",
24
24
  WidgetFileSystem: "widget",
25
25
  WidgetStackInfo: "widget",
26
+ WidgetFirmware: "widget",
26
27
  WidgetRGBStrip: "widget",
27
28
  WidgetPFD: "widget",
28
29
  WidgetMap: "widget",
@@ -31,6 +31,7 @@ components:
31
31
  - [WidgetLoRa, widget] # настройки радио LoRa
32
32
  - [WidgetFileSystem, widget] # файлы устройства
33
33
  - [WidgetStackInfo, widget] # задачи и память
34
+ - [WidgetFirmware, widget] # обновление прошивки модуля
34
35
  - [WidgetRGBStrip, widget] # светодиодная лента
35
36
  - [WidgetPFD, widget] # пилотажный прибор
36
37
  - [WidgetMap, widget] # карта
@@ -0,0 +1,18 @@
1
+ import { type DeviceTransport } from "./fsTransfer.js";
2
+ export type FirmwareErrorCode = "noBootloader" | "timeout" | "device" | "badStart" | "resync" | "image" | "hub";
3
+ export declare class FirmwareUpdateError extends Error {
4
+ readonly code: FirmwareErrorCode;
5
+ readonly params: Record<string, string | number>;
6
+ constructor(code: FirmwareErrorCode, params?: Record<string, string | number>, message?: string);
7
+ get key(): string;
8
+ }
9
+ export type FirmwareStage = "bootloader" | "erase" | "write" | "verify";
10
+ export type FirmwareProgress = (stage: FirmwareStage, done: number, total: number) => void;
11
+ export interface FirmwareUpdateOptions {
12
+ bootTimeoutMs?: number;
13
+ chunkTimeoutMs?: number;
14
+ retries?: number;
15
+ onProgress?: FirmwareProgress;
16
+ }
17
+ /** Обновление прошивки модуля образом .bin (без адреса, с начала региона приложения): модуль уходит в загрузчик, образ передаётся частями, загрузчик проверяет CRC32 и запускает приложение */
18
+ export declare const updateModuleFirmware: (transport: DeviceTransport, image: Uint8Array, options?: FirmwareUpdateOptions) => Promise<void>;
@@ -0,0 +1,129 @@
1
+ /* $lib/firmwareUpdate.ts - обновление прошивки модуля STM через его загрузчик (00.00.491-01, 25.00.000-01) по связи DeviceLink: консоль xPOE-Debug, CAN, RS485. Тот же порядок, что у хаба ProdFactory-ESP (upgrade_service): FirmwareUpgradeStart, части FirmwareUpgradeChunk, FirmwareUpgradeDone; протокол - PROTOCOL.md, «Обновление модуля по шине» */
2
+ import { argumentCode } from "./fsTransfer.js";
3
+ import { crc16Kermit, crc32 } from "./protocols/crc.js";
4
+ import { encodeHar } from "./protocols/dictionary.js";
5
+ /* Ошибка обновления: текст для пользователя - $T(error.key, error.params) из словаря библиотеки, message - тот же смысл по-английски для журнала */
6
+ export class FirmwareUpdateError extends Error {
7
+ code;
8
+ params;
9
+ constructor(code, params = {}, message = code) {
10
+ super(message);
11
+ this.code = code;
12
+ this.params = params;
13
+ this.name = "FirmwareUpdateError";
14
+ }
15
+ get key() {
16
+ return `firmware.error.${this.code}`;
17
+ }
18
+ }
19
+ /* Сообщения устройства: RESYNC с номером части в Args[0] */
20
+ const MSG_FW_RESYNC = 307;
21
+ /* Предел образа: регион приложения STM32G491 за загрузчиком, 492 КБ */
22
+ const MAX_IMAGE = 492 * 1024;
23
+ /* Ответ загрузчика на ModuleFind: серийный номер[43] и версия u32 = 0 */
24
+ const BOOT_FIND_SIZE = 47;
25
+ /* Повтор FirmwareUpgradeStart приложению, пока оно отвечает на ModuleFind, мс */
26
+ const ENTER_REPEAT_MS = 1000;
27
+ const u32 = (value) => {
28
+ const bytes = new Uint8Array(4);
29
+ new DataView(bytes.buffer).setUint32(0, value >>> 0, true);
30
+ return bytes;
31
+ };
32
+ const join = (...parts) => {
33
+ const out = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));
34
+ let at = 0;
35
+ for (const part of parts) {
36
+ out.set(part, at);
37
+ at += part.length;
38
+ }
39
+ return out;
40
+ };
41
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
42
+ /* Номер части, с которой загрузчик просит продолжить: ER! {Message: 307, Args: [n]} */
43
+ const resyncIndex = (reply) => {
44
+ const args = reply.payload.Args;
45
+ const index = Array.isArray(args) ? Number(args[0]) : NaN;
46
+ return Number(reply.payload.Message) === MSG_FW_RESYNC && Number.isInteger(index) ? index : null;
47
+ };
48
+ /** Обновление прошивки модуля образом .bin (без адреса, с начала региона приложения): модуль уходит в загрузчик, образ передаётся частями, загрузчик проверяет CRC32 и запускает приложение */
49
+ export const updateModuleFirmware = async (transport, image, options = {}) => {
50
+ const { bootTimeoutMs = 15000, chunkTimeoutMs = 1000, retries = 3, onProgress } = options;
51
+ if (!image.length || image.length > MAX_IMAGE)
52
+ throw new FirmwareUpdateError("image", { size: image.length }, `Image size ${image.length} out of 1-${MAX_IMAGE}`);
53
+ const [START, CHUNK, DONE, FIND] = ["FirmwareUpgradeStart", "FirmwareUpgradeChunk", "FirmwareUpgradeDone", "ModuleFind"].map((a) => argumentCode(transport, a));
54
+ /* Команда с сырыми полями (байтовая строка) или без тела и ответ на неё; null - таймаут */
55
+ const request = (header, code, payload, timeoutMs) => {
56
+ const pending = transport.waitFor(code, () => true, timeoutMs);
57
+ transport.send(encodeHar(header, code, true, transport.dictionary), payload);
58
+ return pending;
59
+ };
60
+ const failOn = (reply, step) => {
61
+ if (!reply)
62
+ throw new FirmwareUpdateError("timeout", { step }, `${step}: timeout`);
63
+ if (!reply.ok)
64
+ throw new FirmwareUpdateError("device", { step, message: reply.message || String(reply.payload.Message ?? "ER!") }, `${step}: ER!`);
65
+ return reply;
66
+ };
67
+ /* 1. Приложение по FirmwareUpgradeStart перезагружается в загрузчик без ответа; загрузчик в окне 5 с отвечает на ModuleFind версией 0 */
68
+ onProgress?.("bootloader", 0, image.length);
69
+ const header = join(u32(image.length), u32(crc32(image)));
70
+ const enter = () => transport.send(encodeHar("SET", START, false, transport.dictionary), header);
71
+ enter();
72
+ let entered = Date.now();
73
+ const deadline = entered + bootTimeoutMs;
74
+ let found = false;
75
+ while (!found && Date.now() < deadline) {
76
+ const reply = await request("GET", FIND, null, 300);
77
+ const raw = reply?.ok ? reply.raw : undefined;
78
+ /* Загрузчик: 47 байт - серийный номер[43] и версия u32 = 0; приложение отвечает своей версией */
79
+ found = raw?.length === BOOT_FIND_SIZE && new DataView(raw.buffer, raw.byteOffset + 43, 4).getUint32(0, true) === 0;
80
+ if (found || !reply)
81
+ continue;
82
+ /* Отвечает приложение: команда могла потеряться (модуль как раз перезапускался) - повтор раз в секунду */
83
+ if (Date.now() - entered >= ENTER_REPEAT_MS) {
84
+ enter();
85
+ entered = Date.now();
86
+ }
87
+ await sleep(300);
88
+ }
89
+ if (!found)
90
+ throw new FirmwareUpdateError("noBootloader", {}, "Bootloader did not answer ModuleFind");
91
+ /* 2. Начало: размер и CRC32, загрузчик стирает место и отвечает размером части */
92
+ onProgress?.("erase", 0, image.length);
93
+ const start = failOn(await request("SET", START, header, 10000), "FirmwareUpgradeStart");
94
+ const block = start.raw?.length === 1 ? start.raw[0] : 0;
95
+ if (!block)
96
+ throw new FirmwareUpdateError("badStart", {}, "No chunk size in FirmwareUpgradeStart reply");
97
+ /* 3. Части по порядку: номер, CRC16 части, данные; RESYNC - продолжить с указанной части */
98
+ const frames = Math.ceil(image.length / block);
99
+ let frame = 0;
100
+ let misses = 0;
101
+ let resyncs = 0;
102
+ while (frame < frames) {
103
+ const data = image.subarray(frame * block, Math.min(image.length, (frame + 1) * block));
104
+ const crc = new Uint8Array(2);
105
+ new DataView(crc.buffer).setUint16(0, crc16Kermit(0, data), true);
106
+ const reply = await request("SET", CHUNK, join(u32(frame), crc, data), chunkTimeoutMs);
107
+ if (!reply) {
108
+ if (++misses > retries)
109
+ throw new FirmwareUpdateError("timeout", { step: `FirmwareUpgradeChunk ${frame}` }, `Chunk ${frame}: timeout`);
110
+ continue;
111
+ }
112
+ misses = 0;
113
+ if (!reply.ok) {
114
+ const index = resyncIndex(reply);
115
+ if (index === null)
116
+ failOn(reply, `FirmwareUpgradeChunk ${frame}`);
117
+ if (index === null || index > frames || ++resyncs > retries)
118
+ throw new FirmwareUpdateError("resync", { frame }, `Chunk ${frame}: resync failed`);
119
+ frame = index;
120
+ continue;
121
+ }
122
+ resyncs = 0;
123
+ frame++;
124
+ onProgress?.("write", Math.min(image.length, frame * block), image.length);
125
+ }
126
+ /* 4. Конец: загрузчик проверяет CRC32 образа и запускает приложение */
127
+ onProgress?.("verify", image.length, image.length);
128
+ failOn(await request("SET", DONE, null, 3000), "FirmwareUpgradeDone");
129
+ };
@@ -3,11 +3,13 @@ import type { IWidgetFileSystemInfo } from "./types";
3
3
  export interface DeviceReply {
4
4
  ok: boolean;
5
5
  payload: Record<string, unknown>;
6
+ raw?: Uint8Array;
6
7
  message?: string;
7
8
  }
9
+ export type DevicePayload = Record<string, unknown> | Uint8Array | null;
8
10
  export interface DeviceTransport {
9
11
  dictionary?: Dictionary;
10
- send(har: number, payload: Record<string, unknown>): unknown;
12
+ send(har: number, payload: DevicePayload): unknown;
11
13
  waitFor(code: number, match: (reply: DeviceReply) => boolean, timeoutMs: number): Promise<DeviceReply | null>;
12
14
  }
13
15
  export declare const argumentCode: (transport: DeviceTransport, argument: string | number) => number;
package/dist/gui.d.ts CHANGED
@@ -47,6 +47,9 @@ export declare const WIDGET_FIELDS: {
47
47
  WidgetStackInfo: {
48
48
  StackInfo: IWidgetStackInfo;
49
49
  };
50
+ WidgetFirmware: {
51
+ DevFW: number;
52
+ };
50
53
  WidgetRGBStrip: {
51
54
  Color: number[];
52
55
  Effect: number;
package/dist/gui.js CHANGED
@@ -45,6 +45,8 @@ export const WIDGET_FIELDS = {
45
45
  WidgetFileSystem: { FS: {} },
46
46
  /* Объект StackInfo лежит в Payload без префикса группы (API_GetStackInfo) */
47
47
  WidgetStackInfo: { StackInfo: {} },
48
+ /* Текущая версия модуля; список версий VerFW-S подставляет приложение */
49
+ WidgetFirmware: { DevFW: num },
48
50
  /* Группа LST драйвера RGB_Strip */
49
51
  WidgetRGBStrip: {
50
52
  Color: [] /* [R, G, B, W] 0..255; W - только SK6812 */,
@@ -133,6 +135,7 @@ export const WIDGET_PREFIX = {
133
135
  WidgetDeviceInfo: "CFG",
134
136
  WidgetFileSystem: "CFG",
135
137
  WidgetStackInfo: "",
138
+ WidgetFirmware: "CFG",
136
139
  WidgetRGBStrip: "LST",
137
140
  WidgetPFD: "MAV",
138
141
  WidgetMap: "MAV",
@@ -20,6 +20,7 @@ import WidgetDeviceInfo from "./WidgetDeviceInfo/WidgetDeviceInfo.svelte";
20
20
  import WidgetLoRa from "./WidgetLoRa/WidgetLoRa.svelte";
21
21
  import WidgetFileSystem from "./WidgetFileSystem/WidgetFileSystem.svelte";
22
22
  import WidgetStackInfo from "./WidgetStackInfo/WidgetStackInfo.svelte";
23
+ import WidgetFirmware from "./WidgetFirmware/WidgetFirmware.svelte";
23
24
  import WidgetRGBStrip from "./WidgetRGBStrip/WidgetRGBStrip.svelte";
24
25
  import WidgetPFD from "./WidgetPFD/WidgetPFD.svelte";
25
26
  import WidgetMap from "./WidgetMap/WidgetMap.svelte";
@@ -46,6 +47,7 @@ export interface GuiViewsAll {
46
47
  WidgetLoRa: typeof WidgetLoRa;
47
48
  WidgetFileSystem: typeof WidgetFileSystem;
48
49
  WidgetStackInfo: typeof WidgetStackInfo;
50
+ WidgetFirmware: typeof WidgetFirmware;
49
51
  WidgetRGBStrip: typeof WidgetRGBStrip;
50
52
  WidgetPFD: typeof WidgetPFD;
51
53
  WidgetMap: typeof WidgetMap;
package/dist/guiViews.js CHANGED
@@ -20,6 +20,7 @@ import WidgetDeviceInfo from "./WidgetDeviceInfo/WidgetDeviceInfo.svelte";
20
20
  import WidgetLoRa from "./WidgetLoRa/WidgetLoRa.svelte";
21
21
  import WidgetFileSystem from "./WidgetFileSystem/WidgetFileSystem.svelte";
22
22
  import WidgetStackInfo from "./WidgetStackInfo/WidgetStackInfo.svelte";
23
+ import WidgetFirmware from "./WidgetFirmware/WidgetFirmware.svelte";
23
24
  import WidgetRGBStrip from "./WidgetRGBStrip/WidgetRGBStrip.svelte";
24
25
  import WidgetPFD from "./WidgetPFD/WidgetPFD.svelte";
25
26
  import WidgetMap from "./WidgetMap/WidgetMap.svelte";
@@ -47,6 +48,7 @@ export const GUI_VIEWS = {
47
48
  WidgetLoRa,
48
49
  WidgetFileSystem,
49
50
  WidgetStackInfo,
51
+ WidgetFirmware,
50
52
  WidgetRGBStrip,
51
53
  WidgetPFD,
52
54
  WidgetMap,
package/dist/index.d.ts CHANGED
@@ -37,6 +37,8 @@ export { default as WidgetLoRa } from "./WidgetLoRa/WidgetLoRa.svelte";
37
37
  export { LORA_PARAMS, LORA_PRESETS, loraDecode, loraEncode, loraKeys } from "./WidgetLoRa/lora";
38
38
  export { default as WidgetFileSystem } from "./WidgetFileSystem/WidgetFileSystem.svelte";
39
39
  export { default as WidgetStackInfo } from "./WidgetStackInfo/WidgetStackInfo.svelte";
40
+ export { default as WidgetFirmware } from "./WidgetFirmware/WidgetFirmware.svelte";
41
+ export { updateViaHub, type FirmwareTarget, type HubUpdateOptions } from "./WidgetFirmware/firmware";
40
42
  export { default as WidgetRGBStrip } from "./WidgetRGBStrip/WidgetRGBStrip.svelte";
41
43
  export { default as WidgetPFD } from "./WidgetPFD/WidgetPFD.svelte";
42
44
  export { default as WidgetMap } from "./WidgetMap/WidgetMap.svelte";
@@ -56,7 +58,8 @@ export { GUI_VIEWS, type GuiViews } from "./guiViews";
56
58
  export { COMPONENTS, type ComponentEntry } from "./registry";
57
59
  export { COMPONENT_META, componentVariables, type ComponentMeta, type ComponentIO } from "./componentMeta";
58
60
  export { GUI_GRID, isWidgetType, spanRows, WIDGET_FIELDS, WIDGET_SAVE_FIELDS, widgetKey, widgetPrefixes, readWidgetFields, widgetPacket, bitRange, readBits, writeBits, commandPacket, tablePacket, mergeDevicePayload, toGuiFile, guiMetadataError, DEVICE_INFO_COMMON_FIELDS, type GuiFile, type WidgetFieldsType, type DeviceLink, type DevicePacket, } from "./gui";
59
- export { createFsTransfer, sendCommand, argumentCode, FsTransferError, FsNameError, type FsErrorCode, type DeviceReply, type DeviceTransport, type FsTransfer, type FsTransferOptions, type FsProgress, } from "./fsTransfer";
61
+ export { createFsTransfer, sendCommand, argumentCode, FsTransferError, FsNameError, type FsErrorCode, type DeviceReply, type DeviceTransport, type DevicePayload, type FsTransfer, type FsTransferOptions, type FsProgress, } from "./fsTransfer";
62
+ export { updateModuleFirmware, FirmwareUpdateError, type FirmwareErrorCode, type FirmwareStage, type FirmwareProgress, type FirmwareUpdateOptions, } from "./firmwareUpdate";
60
63
  export { copyText } from "./clipboard";
61
64
  export { default as Icon } from "./Icon.svelte";
62
65
  export { default as IconArrow } from "./libIcons/ArrowIcon.svelte";
@@ -87,5 +90,5 @@ export { default as IconGripVerticalRight } from "./libIcons/IconGripVerticalRig
87
90
  export { escapeHtml, htmlToText, sanitizeHtml } from "./html";
88
91
  export { hintsSetting, hint, type HintParams } from "./hints";
89
92
  export { applyDragGhost, clearDragGhost, createDropPlaceholder } from "./dragStyle";
90
- export { type UIComponent, type UIComponentPropsMap, type UIType, type Position, type IUIComponentHandler, type IButtonProps, type IAccordionProps, type IInputProps, type ISelectProps, type IOption, type SelectValue, type IconSource, type ISwitchProps, type IDividerProps, type ISliderProps, type ITextFieldProps, type IProgressBarProps, type IWidgetProps, type IWidgetWiFiProps, type IWidgetWiFiConfig, type IWidgetDeviceInfoProps, type IWidgetDeviceInfoConfig, type IWidgetLoRaProps, type LoRaParams, type ILoRaParamConfig, type IWidgetFileSystemProps, type IWidgetFileSystemInfo, type IWidgetFileSystemFile, type IWidgetFileSystemUpload, type IWidgetStackInfoProps, type IWidgetStackInfo, type IWidgetStackInfoHeap, type IWidgetStackInfoTask, type IWidgetRGBStripProps, type IWidgetRGBStripConfig, type IWidgetPFDProps, type IWidgetPFDData, type IWidgetPFDLimits, type IWidgetMapProps, type IWidgetMapData, type IGraphProps, type IGraphDataObject, type IGraphHistoryPoint, type IGraphHistorySeries, type IGraphSettings, type IChartScale, type ITableHeader, type ITableText, type ITableSelect, type ITableButton, type ITableMenu, type ITableProgressBar, type ITableImage, type ITableContent, type ITableProps, type ITableGroupBy, type ITabsProps, type IJoystickProps, type IFileAttachProps, type FileAttachValue, type IDropdownProps, type IDropdownItem, type IDropdownTriggerProps, type ICarouselProps, type IReceivingDataObject, type IVideoViewerProps, type IPeriodChartProps, type IPeriodChartLevel, } from "./types";
93
+ export { type UIComponent, type UIComponentPropsMap, type UIType, type Position, type IUIComponentHandler, type IButtonProps, type IAccordionProps, type IInputProps, type ISelectProps, type IOption, type SelectValue, type IconSource, type ISwitchProps, type IDividerProps, type ISliderProps, type ITextFieldProps, type IProgressBarProps, type IWidgetProps, type IWidgetWiFiProps, type IWidgetWiFiConfig, type IWidgetDeviceInfoProps, type IWidgetDeviceInfoConfig, type IWidgetLoRaProps, type LoRaParams, type ILoRaParamConfig, type IWidgetFileSystemProps, type IWidgetFileSystemInfo, type IWidgetFileSystemFile, type IWidgetFileSystemUpload, type IWidgetStackInfoProps, type IWidgetFirmwareProps, type WidgetFirmwareStage, type WidgetFirmwareSource, type IWidgetStackInfo, type IWidgetStackInfoHeap, type IWidgetStackInfoTask, type IWidgetRGBStripProps, type IWidgetRGBStripConfig, type IWidgetPFDProps, type IWidgetPFDData, type IWidgetPFDLimits, type IWidgetMapProps, type IWidgetMapData, type IGraphProps, type IGraphDataObject, type IGraphHistoryPoint, type IGraphHistorySeries, type IGraphSettings, type IChartScale, type ITableHeader, type ITableText, type ITableSelect, type ITableButton, type ITableMenu, type ITableProgressBar, type ITableImage, type ITableContent, type ITableProps, type ITableGroupBy, type ITabsProps, type IJoystickProps, type IFileAttachProps, type FileAttachValue, type IDropdownProps, type IDropdownItem, type IDropdownTriggerProps, type ICarouselProps, type IReceivingDataObject, type IVideoViewerProps, type IPeriodChartProps, type IPeriodChartLevel, } from "./types";
91
94
  export { ICONS, ICON_NAMES, ICONS_ARRAY } from "./icons";
package/dist/index.js CHANGED
@@ -38,6 +38,8 @@ export { default as WidgetLoRa } from "./WidgetLoRa/WidgetLoRa.svelte";
38
38
  export { LORA_PARAMS, LORA_PRESETS, loraDecode, loraEncode, loraKeys } from "./WidgetLoRa/lora";
39
39
  export { default as WidgetFileSystem } from "./WidgetFileSystem/WidgetFileSystem.svelte";
40
40
  export { default as WidgetStackInfo } from "./WidgetStackInfo/WidgetStackInfo.svelte";
41
+ export { default as WidgetFirmware } from "./WidgetFirmware/WidgetFirmware.svelte";
42
+ export { updateViaHub } from "./WidgetFirmware/firmware";
41
43
  export { default as WidgetRGBStrip } from "./WidgetRGBStrip/WidgetRGBStrip.svelte";
42
44
  export { default as WidgetPFD } from "./WidgetPFD/WidgetPFD.svelte";
43
45
  export { default as WidgetMap } from "./WidgetMap/WidgetMap.svelte";
@@ -58,6 +60,7 @@ export { COMPONENTS } from "./registry";
58
60
  export { COMPONENT_META, componentVariables } from "./componentMeta";
59
61
  export { GUI_GRID, isWidgetType, spanRows, WIDGET_FIELDS, WIDGET_SAVE_FIELDS, widgetKey, widgetPrefixes, readWidgetFields, widgetPacket, bitRange, readBits, writeBits, commandPacket, tablePacket, mergeDevicePayload, toGuiFile, guiMetadataError, DEVICE_INFO_COMMON_FIELDS, } from "./gui";
60
62
  export { createFsTransfer, sendCommand, argumentCode, FsTransferError, FsNameError, } from "./fsTransfer";
63
+ export { updateModuleFirmware, FirmwareUpdateError, } from "./firmwareUpdate";
61
64
  export { copyText } from "./clipboard";
62
65
  export { default as Icon } from "./Icon.svelte";
63
66
  /* Значки библиотеки: контур currentColor, размер задаёт родитель ([&_svg]:size-*) */
@@ -534,6 +534,11 @@ declare const constructorTranslations: {
534
534
  en: string;
535
535
  zh: string;
536
536
  };
537
+ "component.info.WidgetFirmware": {
538
+ ru: string;
539
+ en: string;
540
+ zh: string;
541
+ };
537
542
  "constructor.props.action.save": {
538
543
  ru: string;
539
544
  en: string;
@@ -1879,6 +1884,21 @@ declare const constructorTranslations: {
1879
1884
  en: string;
1880
1885
  zh: string;
1881
1886
  };
1887
+ "widget.firmware.file_group": {
1888
+ ru: string;
1889
+ en: string;
1890
+ zh: string;
1891
+ };
1892
+ "widget.firmware.accept": {
1893
+ ru: string;
1894
+ en: string;
1895
+ zh: string;
1896
+ };
1897
+ "widget.firmware.accept.info": {
1898
+ ru: string;
1899
+ en: string;
1900
+ zh: string;
1901
+ };
1882
1902
  "widget.fs.upload_group": {
1883
1903
  ru: string;
1884
1904
  en: string;
@@ -254,6 +254,11 @@ const constructorTranslations = {
254
254
  en: '🎯 **Purpose**\nFirmware debugging: free memory and task stack headroom.\n\n📦 **Data packet**\n- One `SystemStackInfo` object from the `GET SystemStackInfo` response, no variable binding needed\n- Requested with the "Refresh" button or by auto polling\n\n🔑 **Keys**\n- `Heap` - array `[{ "Name", "Total", "Free", "MinFree" }]`, bytes: memory heaps - `Internal` on-chip and `PSRAM` external RAM on ESP, `Heap` on STM, shown with readable names; `MinFree` - minimum free since boot\n- `Tasks` - array `[{ "Name", "State", "Prio", "Core", "CPU", "FreeMin" }]`: tasks; `State` - `0` running, `1` ready, `2` blocked, `3` suspended, `4` deleted; `Core` - core (ESP32 only, `-1` unpinned); `CPU` - task load, % of one core since the previous response; `FreeMin` - minimum stack headroom, bytes\n\n✨ **Features**\n- The light part of the heap bar is peak usage\n- Tasks are sorted by stack headroom - the riskiest on top\n- Load from 50 % - orange, from 80 % - red (except `IDLE` - that is free core time); the column appears if the firmware sends it\n- A collapsed widget does not poll the device\n\n⚙️ **Settings**\n- Stack threshold: below it - red, below double - orange\n- Auto polling: off / 1 / 5 / 10 s; master color',
255
255
  zh: '🎯 **用途**\n固件调试:空闲内存和任务栈余量。\n\n📦 **数据包**\n- 来自 `GET SystemStackInfo` 响应的一个 `SystemStackInfo` 对象,无需绑定变量\n- 通过「刷新」按钮或自动轮询请求\n\n🔑 **键**\n- `Heap` - 数组 `[{ "Name", "Total", "Free", "MinFree" }]`,字节:内存堆 - ESP 上为 `Internal` 内部和 `PSRAM` 外部 RAM,STM 上为 `Heap`,组件中显示易读名称;`MinFree` - 启动以来的最小空闲\n- `Tasks` - 数组 `[{ "Name", "State", "Prio", "Core", "CPU", "FreeMin" }]`:任务;`State` - `0` 运行、`1` 就绪、`2` 阻塞、`3` 挂起、`4` 已删除;`Core` - 内核(仅 ESP32,`-1` 未绑定);`CPU` - 任务负载,自上次响应以来占单个内核的百分比;`FreeMin` - 最小栈余量,字节\n\n✨ **特点**\n- 堆条的浅色部分为峰值占用\n- 任务按栈余量排序 - 风险最高的在上方\n- 负载 50 % 起为橙色,80 % 起为红色(`IDLE` 除外 - 那是内核空闲时间);固件发送该字段时才显示此列\n- 折叠的组件不轮询设备\n\n⚙️ **设置**\n- 栈余量阈值:低于阈值 - 红色,低于两倍 - 橙色\n- 自动轮询:关 / 1 / 5 / 10 秒;主色',
256
256
  },
257
+ "component.info.WidgetFirmware": {
258
+ ru: '🎯 **Назначение**\nОбновление прошивки модуля, чей GUI открыт: в облаке и в терминале.\n\n📦 **Пакет данных**\n- Привязывать переменные не нужно\n- `CFG.DevFW` - текущая версия модуля\n- `VerFW-S` - список версий из каталога `[{ "name", "value" }]`, его подставляет приложение\n\n✨ **Особенности**\n- Как обновлять, решает приложение (свойство `firmware` у `GUIRenderer`): облако - через хаб ESP (`SET FirmwareUpgradeStart` с `ModSN` и `VerFW`, ход - `Progress` в `CFG.ModList`), терминал - напрямую через загрузчик модуля (версия из каталога или файл .bin)\n- Ход - полоса 0-100 % и строка этапа: перезагрузка в загрузчик, стирание, запись, проверка\n- Одно обновление за раз; ошибка - в строке состояния и в уведомлении\n- Без `firmware` (просмотр в конструкторе) виджет неактивен\n\n⚙️ **Настройки**\n- Заголовок и мастер-цвет\n- Допустимые файлы (`accept`), по умолчанию `.bin`',
259
+ en: '🎯 **Purpose**\nUpdates the firmware of the module whose GUI is open: in the cloud and in the terminal.\n\n📦 **Data packet**\n- No variable binding needed\n- `CFG.DevFW` - current module version\n- `VerFW-S` - catalog versions `[{ "name", "value" }]`, injected by the app\n\n✨ **Features**\n- The app decides how to update (the `firmware` prop of `GUIRenderer`): the cloud goes through the ESP hub (`SET FirmwareUpgradeStart` with `ModSN` and `VerFW`, progress - `Progress` in `CFG.ModList`), the terminal goes straight through the module bootloader (a catalog version or a .bin file)\n- Progress - a 0-100 % bar and a stage line: restart into bootloader, erase, write, verify\n- One update at a time; an error goes to the status line and a notification\n- Without `firmware` (constructor preview) the widget is disabled\n\n⚙️ **Settings**\n- Title and master color\n- Allowed files (`accept`), `.bin` by default',
260
+ zh: '🎯 **用途**\n更新当前打开 GUI 的模块固件:适用于云端和终端。\n\n📦 **数据包**\n- 无需绑定变量\n- `CFG.DevFW` - 模块当前版本\n- `VerFW-S` - 目录中的版本列表 `[{ "name", "value" }]`,由应用提供\n\n✨ **特点**\n- 更新方式由应用决定(`GUIRenderer` 的 `firmware` 属性):云端通过 ESP 集线器(`SET FirmwareUpgradeStart`,带 `ModSN` 和 `VerFW`,进度为 `CFG.ModList` 中的 `Progress`),终端直接通过模块引导程序(目录版本或 .bin 文件)\n- 进度 - 0-100 % 进度条和阶段说明:重启进入引导程序、擦除、写入、校验\n- 一次只能进行一个更新;错误显示在状态行和通知中\n- 没有 `firmware`(构造器预览)时组件不可用\n\n⚙️ **设置**\n- 标题和主色\n- 允许的文件(`accept`),默认 `.bin`',
261
+ },
257
262
  /* Опции редактора свойств */
258
263
  "constructor.props.action.save": { ru: "Сохранить", en: "Save", zh: "保存" },
259
264
  "constructor.props.action.nosend": { ru: "Без отправки", en: "No send", zh: "不发送" },
@@ -593,6 +598,13 @@ const constructorTranslations = {
593
598
  "widget.stack.period": { ru: "Автоопрос по умолчанию, мс (0 - выкл)", en: "Default auto-poll, ms (0 - off)", zh: "默认自动轮询, 毫秒 (0 - 关)" },
594
599
  "widget.stack.response": { ru: "Объект ответа", en: "Response object", zh: "响应对象" },
595
600
  "widget.stack.request": { ru: "Аргумент запроса", en: "Request argument", zh: "请求参数" },
601
+ "widget.firmware.file_group": { ru: "Обновление файлом", en: "Update from file", zh: "通过文件更新" },
602
+ "widget.firmware.accept": { ru: "Допустимые файлы (accept)", en: "Allowed files (accept)", zh: "允许的文件 (accept)" },
603
+ "widget.firmware.accept.info": {
604
+ ru: "Какие файлы можно выбрать для обновления: расширения через запятую.\n**По умолчанию**: .bin\nПоле выбора файла видно, только если приложение разрешает обновление файлом (терминал).",
605
+ en: "Which files can be picked for the update: extensions separated by commas.\n**Default**: .bin\nThe file picker is shown only when the app allows updating from a file (terminal).",
606
+ zh: "可选择用于更新的文件:用逗号分隔的扩展名。\n**默认**:.bin\n仅当应用允许通过文件更新(终端)时才显示文件选择。",
607
+ },
596
608
  "widget.fs.upload_group": { ru: "Закачка файлов", en: "File upload", zh: "文件上传" },
597
609
  "widget.fs.accept": { ru: "Допустимые файлы (accept)", en: "Allowed files (accept)", zh: "允许的文件 (accept)" },
598
610
  "widget.fs.max_name": { ru: "Максимальная длина имени", en: "Maximum name length", zh: "最大名称长度" },
@@ -61,6 +61,7 @@ const WIDGET_TITLE_KEYS = {
61
61
  WidgetLoRa: "widget.lora.title",
62
62
  WidgetFileSystem: "widget.fs.title",
63
63
  WidgetStackInfo: "widget.stack.title",
64
+ WidgetFirmware: "widget.firmware.title",
64
65
  WidgetRGBStrip: "widget.rgb.title",
65
66
  WidgetPFD: "pfd.title",
66
67
  WidgetMap: "widget.map.title",
@@ -724,6 +724,131 @@ declare const translations: {
724
724
  en: string;
725
725
  zh: string;
726
726
  };
727
+ "firmware.error.noBootloader": {
728
+ ru: string;
729
+ en: string;
730
+ zh: string;
731
+ };
732
+ "firmware.error.timeout": {
733
+ ru: string;
734
+ en: string;
735
+ zh: string;
736
+ };
737
+ "firmware.error.device": {
738
+ ru: string;
739
+ en: string;
740
+ zh: string;
741
+ };
742
+ "firmware.error.badStart": {
743
+ ru: string;
744
+ en: string;
745
+ zh: string;
746
+ };
747
+ "firmware.error.resync": {
748
+ ru: string;
749
+ en: string;
750
+ zh: string;
751
+ };
752
+ "firmware.error.image": {
753
+ ru: string;
754
+ en: string;
755
+ zh: string;
756
+ };
757
+ "firmware.error.hub": {
758
+ ru: string;
759
+ en: string;
760
+ zh: string;
761
+ };
762
+ "widget.firmware.title": {
763
+ ru: string;
764
+ en: string;
765
+ zh: string;
766
+ };
767
+ "widget.firmware.current": {
768
+ ru: string;
769
+ en: string;
770
+ zh: string;
771
+ };
772
+ "widget.firmware.version": {
773
+ ru: string;
774
+ en: string;
775
+ zh: string;
776
+ };
777
+ "widget.firmware.update": {
778
+ ru: string;
779
+ en: string;
780
+ zh: string;
781
+ };
782
+ "widget.firmware.file": {
783
+ ru: string;
784
+ en: string;
785
+ zh: string;
786
+ };
787
+ "widget.firmware.no_versions": {
788
+ ru: string;
789
+ en: string;
790
+ zh: string;
791
+ };
792
+ "widget.firmware.unavailable": {
793
+ ru: string;
794
+ en: string;
795
+ zh: string;
796
+ };
797
+ "widget.firmware.stage.start": {
798
+ ru: string;
799
+ en: string;
800
+ zh: string;
801
+ };
802
+ "widget.firmware.stage.bootloader": {
803
+ ru: string;
804
+ en: string;
805
+ zh: string;
806
+ };
807
+ "widget.firmware.stage.erase": {
808
+ ru: string;
809
+ en: string;
810
+ zh: string;
811
+ };
812
+ "widget.firmware.stage.write": {
813
+ ru: string;
814
+ en: string;
815
+ zh: string;
816
+ };
817
+ "widget.firmware.stage.verify": {
818
+ ru: string;
819
+ en: string;
820
+ zh: string;
821
+ };
822
+ "widget.firmware.stage.hub": {
823
+ ru: string;
824
+ en: string;
825
+ zh: string;
826
+ };
827
+ "widget.firmware.done": {
828
+ ru: string;
829
+ en: string;
830
+ zh: string;
831
+ };
832
+ "widget.firmware.failed": {
833
+ ru: string;
834
+ en: string;
835
+ zh: string;
836
+ };
837
+ "widget.firmware.busy": {
838
+ ru: string;
839
+ en: string;
840
+ zh: string;
841
+ };
842
+ "widget.firmware.hint.version": {
843
+ ru: string;
844
+ en: string;
845
+ zh: string;
846
+ };
847
+ "widget.firmware.hint.file": {
848
+ ru: string;
849
+ en: string;
850
+ zh: string;
851
+ };
727
852
  "widget.fs.error.timeout": {
728
853
  ru: string;
729
854
  en: string;