poe-svelte-ui-lib 2.35.0 → 2.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +1 -0
  2. package/dist/FieldLabel.svelte +6 -6
  3. package/dist/GUIRenderer/GUIRenderer.svelte +7 -1
  4. package/dist/Graph/Graph.svelte +3 -1
  5. package/dist/InfoHint.svelte +2 -1
  6. package/dist/Input/Input.svelte +7 -5
  7. package/dist/Joystick/Joystick.svelte +20 -19
  8. package/dist/Loader/Loader.svelte +4 -4
  9. package/dist/Select/Select.svelte +6 -4
  10. package/dist/Slider/Slider.svelte +3 -1
  11. package/dist/Switch/Switch.svelte +6 -2
  12. package/dist/Table/Table.svelte +3 -1
  13. package/dist/Widget/Widget.svelte +6 -2
  14. package/dist/WidgetDeviceInfo/CpuIcon.svelte +6 -6
  15. package/dist/WidgetDeviceInfo/RestartIcon.svelte +3 -3
  16. package/dist/WidgetFileSystem/RefreshIcon.svelte +4 -4
  17. package/dist/WidgetFileSystem/StorageIcon.svelte +4 -4
  18. package/dist/WidgetFileSystem/WidgetFileSystem.svelte +3 -3
  19. package/dist/WidgetFirmware/FirmwareIcon.svelte +4 -4
  20. package/dist/WidgetFirmware/README.md +2 -2
  21. package/dist/WidgetFirmware/WidgetFirmware.svelte +3 -3
  22. package/dist/WidgetHeader.svelte +3 -1
  23. package/dist/WidgetLoRa/RadioIcon.svelte +4 -4
  24. package/dist/WidgetMap/FitIcon.svelte +4 -4
  25. package/dist/WidgetMap/MapIcon.svelte +3 -10
  26. package/dist/WidgetMap/WidgetMap.svelte +6 -6
  27. package/dist/WidgetMap/mapWrapper/utils.js +1 -1
  28. package/dist/WidgetMap/mission/MapAgro.svelte +57 -47
  29. package/dist/WidgetMap/mission/MapRoute.svelte +16 -12
  30. package/dist/WidgetMap/mission/MissionIcon.svelte +3 -3
  31. package/dist/WidgetMap/mission/MissionSim.svelte +9 -9
  32. package/dist/WidgetPFD/PlaneIcon.svelte +4 -4
  33. package/dist/WidgetPFD/WidgetPFD.svelte +25 -23
  34. package/dist/WidgetRGBStrip/LightIcon.svelte +4 -4
  35. package/dist/WidgetStackInfo/MemoryIcon.svelte +4 -4
  36. package/dist/WidgetStackInfo/RefreshIcon.svelte +4 -4
  37. package/dist/WidgetStackInfo/WidgetStackInfo.svelte +6 -6
  38. package/dist/WidgetWiFi/SearchIcon.svelte +4 -4
  39. package/dist/WidgetWiFi/WarningIcon.svelte +4 -4
  40. package/dist/WidgetWiFi/WifiIcon.svelte +4 -4
  41. package/dist/busBridge.d.ts +9 -5
  42. package/dist/busBridge.js +35 -6
  43. package/dist/libIcons/ArrowIcon.svelte +4 -4
  44. package/dist/libIcons/ButtonAdd.svelte +4 -4
  45. package/dist/libIcons/ButtonClear.svelte +6 -6
  46. package/dist/libIcons/ButtonDelete.svelte +4 -4
  47. package/dist/libIcons/ButtonDownload.svelte +4 -4
  48. package/dist/libIcons/ColumnsIcon.svelte +5 -5
  49. package/dist/libIcons/CommandListIcon.svelte +4 -4
  50. package/dist/libIcons/CrossIcon.svelte +6 -6
  51. package/dist/libIcons/Error.svelte +4 -4
  52. package/dist/libIcons/EyeIcon.svelte +5 -5
  53. package/dist/libIcons/EyeSlashIcon.svelte +6 -6
  54. package/dist/libIcons/GraphIcon.svelte +4 -4
  55. package/dist/libIcons/InfoIcon.svelte +5 -5
  56. package/dist/libIcons/Library.svelte +4 -4
  57. package/dist/libIcons/MoreIcon.svelte +3 -3
  58. package/dist/libIcons/MoveVerticalIcon.svelte +6 -6
  59. package/dist/libIcons/PlugIcon.svelte +3 -1
  60. package/dist/libIcons/RestartIcon.svelte +4 -4
  61. package/dist/libIcons/SendIcon.svelte +4 -4
  62. package/dist/libIcons/ThemeIcon.svelte +6 -6
  63. package/dist/libIcons/UnplugIcon.svelte +4 -3
  64. package/dist/locales/translations.js +3 -3
  65. package/package.json +8 -7
package/README.md CHANGED
@@ -250,6 +250,7 @@ const bridge = UI.createBusBridge(channel, {
250
250
  - `channel` - `{ send(trgId, har, payload), listen(handler) }`: отправка пакета адресату по BusID и подписка на принятые пакеты `{ trgId, srcId, header, argument, code, payload }`.
251
251
  - Модули - из `CFG.ModList` модуля порта, как в вебе. Списка нет (датчик) - модуль один, его серийный номер мост берёт из `CFG.DevSN`. Список модулей принимается только от модуля порта: у модулей за ним свой ModList из одного себя. Соседи по SSDP (`ModIFace` = `MOD_IFACE_NEIGHBOR`, `isNeighborModule` из `poe-svelte-ui-lib/protocols`) - независимые устройства рядом в сети, их команды головной модуль не пересылает, в модули изделия они не попадают. Облако и WebApp показывают их отдельно, «Устройства рядом».
252
252
  - Адрес команды: модулю порта - `selfTarget`, остальным - их BusID (`busIdFromSN`: HEX после `:` в ModSN), головной модуль пересылает сам.
253
+ - Режим шины `discover: true` (CAN, RS485, где терминал сам ведущий): модуля порта и `CFG.ModList` нет, модули - все, кто ответил `OK! ModuleInfo`, у каждого `BusID`, `ModBindKey` и `seen` (время последнего пакета от него). Команды - каждому напрямую по его BusID. Опрос `GET ModuleInfo` всем (`link("")` шлёт на `selfTarget`) ведёт приложение, `seen` обновляется без `onModules`: пропавший модуль приложение находит по времени.
253
254
  - Значения: Payload ответов и рассылок `SystemDataUpdate`, `SystemDataStream`, `ModuleConfig`, `SystemFileSystem`, `ModuleInfo`, `NetworkAccessPoints`, `SystemStackInfo` - в `values` под ModSN отправителя.
254
255
  - Сообщения: консоль шлёт `Message` отдельным `DebugLog` («HAR 0x....», «MSG код аргументы») прямо перед ответом. Мост склеивает их обратно: `waitFor` получает `reply.message`, как в вебе, а `onMessage` - текст на языке пользователя и уровень.
255
256
  - `bridge.link(ModSN)` - одна связь на модуль (на неё завязана очередь передачи файлов), `bridge.modules()`, `bridge.self()`, `bridge.dispose()`.
@@ -19,13 +19,13 @@
19
19
 
20
20
  {#if label?.name}
21
21
  {#if htmlFor}
22
- <label for={htmlFor} {id} class={base}
23
- >{label.name}{#if info}<InfoHint text={info} />{/if}</label
24
- >
22
+ <label for={htmlFor} {id} class={base}>
23
+ {label.name}{#if info}<InfoHint text={info} />{/if}
24
+ </label>
25
25
  {:else}
26
- <span {id} class={base}
27
- >{label.name}{#if info}<InfoHint text={info} />{/if}</span
28
- >
26
+ <span {id} class={base}>
27
+ {label.name}{#if info}<InfoHint text={info} />{/if}
28
+ </span>
29
29
  {/if}
30
30
  {:else if info}
31
31
  <span class={twMerge(base, "min-h-4")}><InfoHint text={info} /></span>
@@ -246,6 +246,9 @@
246
246
  /* Уже NARROW_MAX_PX (телефон, узкая панель) - раскладка по группам автора (layoutFlow в gui.ts), иначе его сетка */
247
247
  const NARROW_MAX_PX = 640
248
248
  let width = $state(0)
249
+
250
+ /* Раскрытие аккордеонов по id: смена раскладки (ширина около NARROW_MAX_PX, полоса прокрутки появилась от раскрытия) пересоздаёт их, без этой памяти раздел закрывался сразу после открытия */
251
+ const opened = $state<Record<string, boolean>>({})
249
252
  const narrow = $derived(width > 0 && width < NARROW_MAX_PX)
250
253
 
251
254
  /* Группа из мелких блоков (канал, мотор) - в рамке; виджеты и графики - уже карточки */
@@ -333,7 +336,10 @@
333
336
  {@render render[component.type]?.(component)}
334
337
  {:else if component.type === "Accordion" && views.Accordion}
335
338
  {@const Accordion = views.Accordion}
336
- <Accordion {...component.properties}>
339
+ <Accordion
340
+ {...component.properties}
341
+ bind:isOpen={() => opened[component.id] ?? !!component.properties.isOpen, (open: boolean) => (opened[component.id] = open)}
342
+ >
337
343
  <!-- Своя сетка содержимого во всю ширину аккордеона: колонок не меньше, чем у самого дальнего блока -->
338
344
  <div class="min-w-0" style="grid-column: 1 / -1; grid-row: 1 / -1">
339
345
  {@render Layout(childrenOf(component).filter(visible), component.properties.size?.width ?? 1, !!component.properties.image)}
@@ -511,8 +511,10 @@
511
511
  <span class="truncate font-semibold" title={item.name}>{item.name}</span>
512
512
  <span
513
513
  class="min-w-[10ch] text-right whitespace-nowrap tabular-nums {outOfScale[i] ? 'text-(--red-text)' : ''}"
514
- title={outOfScale[i] ? $T("ui.scale.out") : undefined}>{item.value?.toFixed(2)}</span
514
+ title={outOfScale[i] ? $T("ui.scale.out") : undefined}
515
515
  >
516
+ {item.value?.toFixed(2)}
517
+ </span>
516
518
  {/each}
517
519
  </div>
518
520
  </div>
@@ -70,7 +70,8 @@
70
70
  >
71
71
  <span
72
72
  class="w-max max-w-full rounded-lg border border-(--hairline-color) bg-(--back-color) px-2.5 py-1.5 text-left text-[12px] font-medium whitespace-pre-line text-(--font-color) normal-case shadow-(--elevation-2)"
73
- >{#each hintParts(text) as part}{#if part.bold}<b class="font-bold">{part.text}</b>{:else}{part.text}{/if}{/each}</span
74
73
  >
74
+ {#each hintParts(text) as part}{#if part.bold}<b class="font-bold">{part.text}</b>{:else}{part.text}{/if}{/each}
75
+ </span>
75
76
  </div>
76
77
  {/if}
@@ -159,8 +159,8 @@
159
159
  onclick={() => (showPassword = !showPassword)}
160
160
  aria-label={showPassword ? $T("ui.password.hide") : $T("ui.password.show")}
161
161
  >
162
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"
163
- ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">
162
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24">
163
+ <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">
164
164
  {#if showPassword}
165
165
  <path d="M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0" /><path d="M2 12c1.6-4.097 5.336-7 10-7s8.4 2.903 10 7c-1.6 4.097-5.336 7-10 7s-8.4-2.903-10-7" />
166
166
  {:else}
@@ -168,8 +168,8 @@
168
168
  d="M10.73 5.073A11 11 0 0 1 12 5c4.664 0 8.4 2.903 10 7a11.6 11.6 0 0 1-1.555 2.788M6.52 6.519C4.48 7.764 2.9 9.693 2 12c1.6 4.097 5.336 7 10 7a10.44 10.44 0 0 0 5.48-1.52m-7.6-7.6a3 3 0 1 0 4.243 4.243"
169
169
  /><path d="m4 4l16 16" />
170
170
  {/if}
171
- </g></svg
172
- >
171
+ </g>
172
+ </svg>
173
173
  </button>
174
174
  {/if}
175
175
 
@@ -201,8 +201,10 @@
201
201
  ? 'border-b border-(--hairline-color)'
202
202
  : ''}"
203
203
  onclick={() => stepBy(direction)}
204
- aria-label={direction === 1 ? $T("ui.increase") : $T("ui.decrease")}>{direction === 1 ? "▲" : "▼"}</button
204
+ aria-label={direction === 1 ? $T("ui.increase") : $T("ui.decrease")}
205
205
  >
206
+ {direction === 1 ? "▲" : "▼"}
207
+ </button>
206
208
  {/each}
207
209
  </div>
208
210
  {/if}
@@ -97,11 +97,12 @@
97
97
  width={direction.main ? 32 : 16}
98
98
  height={direction.main ? 32 : 16}
99
99
  viewBox="0 0 24 24"
100
- ><path
100
+ >
101
+ <path
101
102
  fill="currentColor"
102
103
  d="M12.6 12L8.7 8.1q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.6 4.6q.15.15.213.325t.062.375t-.062.375t-.213.325l-4.6 4.6q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7z"
103
- /></svg
104
- >
104
+ />
105
+ </svg>
105
106
  </span>
106
107
  </button>
107
108
  {/each}
@@ -134,12 +135,12 @@
134
135
  {#if buttonIcon}
135
136
  <Icon icon={buttonIcon} class="contents" />
136
137
  {:else}
137
- <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"
138
- ><path
138
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
139
+ <path
139
140
  fill="currentColor"
140
141
  d="M6 19h3v-5q0-.425.288-.712T10 13h4q.425 0 .713.288T15 14v5h3v-9l-6-4.5L6 10zm-2 0v-9q0-.475.213-.9t.587-.7l6-4.5q.525-.4 1.2-.4t1.2.4l6 4.5q.375.275.588.7T20 10v9q0 .825-.588 1.413T18 21h-4q-.425 0-.712-.288T13 20v-5h-2v5q0 .425-.288.713T10 21H6q-.825 0-1.412-.587T4 19m8-6.75"
141
- /></svg
142
- >
142
+ />
143
+ </svg>
143
144
  {/if}
144
145
  </button>
145
146
  </div>
@@ -174,14 +175,14 @@
174
175
  onmouseenter={(e) => (e.currentTarget.style.backgroundColor = "color-mix(in srgb, var(--bg-color), var(--shadow-color) 30%)")}
175
176
  onmouseleave={(e) => (e.currentTarget.style.backgroundColor = "")}
176
177
  >
177
- <svg xmlns="http://www.w3.org/2000/svg" class="segment-icon rotate-270" width="24" height="24" viewBox="0 0 24 24"
178
- ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"
179
- ><path
178
+ <svg xmlns="http://www.w3.org/2000/svg" class="segment-icon rotate-270" width="24" height="24" viewBox="0 0 24 24">
179
+ <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5">
180
+ <path
180
181
  stroke-miterlimit="10"
181
182
  d="M6.395 7.705A7.9 7.9 0 0 1 12 5.382a7.93 7.93 0 0 1 7.929 7.929A7.94 7.94 0 0 1 12 21.25a7.94 7.94 0 0 1-7.929-7.94"
182
- /><path stroke-linejoin="round" d="m7.12 2.75l-.95 3.858a1.33 1.33 0 0 0 .97 1.609l3.869.948" /></g
183
- ></svg
184
- >
183
+ /><path stroke-linejoin="round" d="m7.12 2.75l-.95 3.858a1.33 1.33 0 0 0 .97 1.609l3.869.948" />
184
+ </g>
185
+ </svg>
185
186
  </button>
186
187
  <button
187
188
  class="btn-segment h-full cursor-pointer rounded-r-full px-3.5"
@@ -190,14 +191,14 @@
190
191
  onmouseenter={(e) => (e.currentTarget.style.backgroundColor = "color-mix(in srgb, var(--bg-color), var(--shadow-color) 30%)")}
191
192
  onmouseleave={(e) => (e.currentTarget.style.backgroundColor = "")}
192
193
  >
193
- <svg xmlns="http://www.w3.org/2000/svg" class="segment-icon rotate-90" width="24" height="24" viewBox="0 0 24 24"
194
- ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"
195
- ><path
194
+ <svg xmlns="http://www.w3.org/2000/svg" class="segment-icon rotate-90" width="24" height="24" viewBox="0 0 24 24">
195
+ <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5">
196
+ <path
196
197
  stroke-miterlimit="10"
197
198
  d="M17.605 7.705A7.9 7.9 0 0 0 12 5.382a7.93 7.93 0 0 0-7.929 7.929A7.94 7.94 0 0 0 12 21.25a7.94 7.94 0 0 0 7.929-7.94"
198
- /><path stroke-linejoin="round" d="m16.88 2.75l.95 3.858a1.33 1.33 0 0 1-.97 1.609l-3.869.948" /></g
199
- ></svg
200
- >
199
+ /><path stroke-linejoin="round" d="m16.88 2.75l.95 3.858a1.33 1.33 0 0 1-.97 1.609l-3.869.948" />
200
+ </g>
201
+ </svg>
201
202
  </button>
202
203
  </div>
203
204
  {/if}
@@ -12,10 +12,10 @@
12
12
  aria-label={label || undefined}
13
13
  aria-hidden={label ? undefined : "true"}
14
14
  >
15
- <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" class="animate-spin [animation-duration:0.8s]"
16
- ><path fill="currentColor" d="M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z" opacity=".35" /><path
15
+ <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" class="animate-spin [animation-duration:0.8s]">
16
+ <path fill="currentColor" d="M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z" opacity=".35" /><path
17
17
  fill="currentColor"
18
18
  d="M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"
19
- /></svg
20
- >
19
+ />
20
+ </svg>
21
21
  </span>
@@ -233,9 +233,9 @@
233
233
  <!-- Невидимые подписи вариантов: по их ширине решается, помещается ли группа кнопок -->
234
234
  <div bind:this={measureElement} class="pointer-events-none invisible absolute top-0 left-0 flex h-0 w-max overflow-hidden" aria-hidden="true">
235
235
  {#each options as option, index (option.id ?? index)}
236
- <span class="flex gap-1.5 text-[13px] font-semibold whitespace-nowrap"
237
- >{#if option.icon}<span class="w-(--icon-size)"></span>{/if}{option.icon && !showNames ? "" : option.name}</span
238
- >
236
+ <span class="flex gap-1.5 text-[13px] font-semibold whitespace-nowrap">
237
+ {#if option.icon}<span class="w-(--icon-size)"></span>{/if}{option.icon && !showNames ? "" : option.name}
238
+ </span>
239
239
  {/each}
240
240
  </div>
241
241
  {/if}
@@ -265,8 +265,10 @@
265
265
  stroke="currentColor"
266
266
  stroke-width="2"
267
267
  stroke-linecap="round"
268
- stroke-linejoin="round"><path d="M6 9l6 6 6-6" /></svg
268
+ stroke-linejoin="round"
269
269
  >
270
+ <path d="M6 9l6 6 6-6" />
271
+ </svg>
270
272
  </button>
271
273
  {:else if shownType === "input"}
272
274
  <input
@@ -91,8 +91,10 @@
91
91
  : target === "upper" || !isRange
92
92
  ? v >= number.maxNum
93
93
  : v >= upper - number.step)}
94
- aria-label={direction === 1 ? $T("ui.increase") : $T("ui.decrease")}>{direction === 1 ? "+" : "−"}</button
94
+ aria-label={direction === 1 ? $T("ui.increase") : $T("ui.decrease")}
95
95
  >
96
+ {direction === 1 ? "+" : "−"}
97
+ </button>
96
98
  {/each}
97
99
  <span class="inline-block text-center text-[13px] font-semibold tabular-nums" style="width: {valueWidth}">{v}</span>
98
100
  </div>
@@ -79,8 +79,10 @@
79
79
  ? 'cursor-pointer text-(--muted-color)'
80
80
  : 'cursor-pointer text-(--font-color)'}"
81
81
  style="width: {maxCaptionWidth}; text-align: end;"
82
- onclick={() => handleCaptionClick(0)}>{label.captionLeft}</button
82
+ onclick={() => handleCaptionClick(0)}
83
83
  >
84
+ {label.captionLeft}
85
+ </button>
84
86
  {/if}
85
87
 
86
88
  <label class="relative flex items-center justify-between {option.disabled ? 'cursor-not-allowed' : ''}">
@@ -120,8 +122,10 @@
120
122
  ? 'cursor-pointer text-(--font-color)'
121
123
  : 'cursor-pointer text-(--muted-color)'}"
122
124
  style="width: {maxCaptionWidth}; text-align: start;"
123
- onclick={() => handleCaptionClick(1)}>{label.captionRight}</button
125
+ onclick={() => handleCaptionClick(1)}
124
126
  >
127
+ {label.captionRight}
128
+ </button>
125
129
  {#if infoAfterCaption && help?.info}<span class="ml-1 flex"><InfoHint text={help.info} /></span>{/if}
126
130
  {/if}
127
131
  </div>
@@ -682,8 +682,10 @@
682
682
  onclick={(e) => {
683
683
  e.stopPropagation()
684
684
  text.onClick?.(row)
685
- }}>{value}</button
685
+ }}
686
686
  >
687
+ {value}
688
+ </button>
687
689
  {:else if text.href}
688
690
  <a class="underline" href={text.href(row)}>{value}</a>
689
691
  {:else if text.html}
@@ -87,8 +87,10 @@
87
87
  : 'text-(--muted-color)'}"
88
88
  style="width: {maxCaptionWidth}; text-align: {align};"
89
89
  disabled={readonly}
90
- onclick={() => handleCaptionClick(next)}>{text}</button
90
+ onclick={() => handleCaptionClick(next)}
91
91
  >
92
+ {text}
93
+ </button>
92
94
  {/if}
93
95
  {/snippet}
94
96
 
@@ -97,8 +99,10 @@
97
99
  class={stepBtn}
98
100
  onclick={() => commit(clamp(current + direction * step))}
99
101
  disabled={readonly || (direction === 1 ? current >= maxNumber : current <= minNumber)}
100
- aria-label={direction === 1 ? $T("ui.increase") : $T("ui.decrease")}>{direction === 1 ? "+" : "−"}</button
102
+ aria-label={direction === 1 ? $T("ui.increase") : $T("ui.decrease")}
101
103
  >
104
+ {direction === 1 ? "+" : "−"}
105
+ </button>
102
106
  {/snippet}
103
107
 
104
108
  <div class={twMerge("h-full w-full", wrapperClass)} style={accentStyle(accent)}>
@@ -1,9 +1,9 @@
1
1
  <script lang="ts"></script>
2
2
 
3
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"
4
- ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
5
- ><rect x="4" y="4" width="16" height="16" rx="2" /><rect x="9" y="9" width="6" height="6" /><path
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
5
+ <rect x="4" y="4" width="16" height="16" rx="2" /><rect x="9" y="9" width="6" height="6" /><path
6
6
  d="M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3"
7
- /></g
8
- ></svg
9
- >
7
+ />
8
+ </g>
9
+ </svg>
@@ -1,5 +1,5 @@
1
1
  <script lang="ts"></script>
2
2
 
3
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"
4
- ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6" /></svg
5
- >
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6" />
5
+ </svg>
@@ -1,12 +1,12 @@
1
1
  <script lang="ts"></script>
2
2
 
3
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"
4
- ><path
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path
5
5
  fill="none"
6
6
  stroke="currentColor"
7
7
  stroke-linecap="round"
8
8
  stroke-linejoin="round"
9
9
  stroke-width="2"
10
10
  d="M21 12a9 9 0 0 0-9-9a9.75 9.75 0 0 0-6.74 2.74L3 8m0-5v5h5m-5 4a9 9 0 0 0 9 9a9.75 9.75 0 0 0 6.74-2.74L21 16m-5 0h5v5"
11
- /></svg
12
- >
11
+ />
12
+ </svg>
@@ -1,12 +1,12 @@
1
1
  <script lang="ts"></script>
2
2
 
3
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"
4
- ><path
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path
5
5
  fill="none"
6
6
  stroke="currentColor"
7
7
  stroke-linecap="round"
8
8
  stroke-linejoin="round"
9
9
  stroke-width="2"
10
10
  d="M22 12H2m20 0v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-6m20 0-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11L2 12m4 4h.01M10 16h.01"
11
- /></svg
12
- >
11
+ />
12
+ </svg>
@@ -182,9 +182,9 @@
182
182
  </div>
183
183
  {/if}
184
184
  {#if downloading}
185
- <span class="mt-2 truncate text-[12px] text-(--muted-color)" transition:slide={{ duration: 100 }}
186
- >{$T("widget.fs.downloading", { name: downloading })}</span
187
- >
185
+ <span class="mt-2 truncate text-[12px] text-(--muted-color)" transition:slide={{ duration: 100 }}>
186
+ {$T("widget.fs.downloading", { name: downloading })}
187
+ </span>
188
188
  {/if}
189
189
  {#if downloadError}
190
190
  <span class="mt-2 text-[12px] text-(--red-text)" transition:slide={{ duration: 100 }}>{downloadError}</span>
@@ -1,12 +1,12 @@
1
1
  <script lang="ts"></script>
2
2
 
3
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"
4
- ><path
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path
5
5
  fill="none"
6
6
  stroke="currentColor"
7
7
  stroke-linecap="round"
8
8
  stroke-linejoin="round"
9
9
  stroke-width="2"
10
10
  d="M9 2v2m6-2v2M9 20v2m6-2v2M2 9h2m-2 6h2m16-6h2m-2 6h2M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m6 4v8m-3-3l3 3l3-3"
11
- /></svg
12
- >
11
+ />
12
+ </svg>
@@ -7,7 +7,7 @@
7
7
  - 🏷️ Показывает текущую версию модуля в шапке.
8
8
  - 📋 Даёт выбрать версию из каталога облака и запустить обновление кнопкой «Обновить».
9
9
  - 📁 В терминале ещё и обновляет выбранным файлом `.bin`.
10
- - 📊 Показывает ход полосой от 0 до 100% и строкой этапа: перезагрузка в загрузчик, стирание, запись, проверка, готово.
10
+ - 📊 Показывает ход полосой от 0 до 100% целыми процентами и строкой этапа без процентов: перезагрузка в загрузчик, стирание, запись, проверка, готово.
11
11
  - ⚠️ Ошибку пишет в строке состояния и отправляет уведомлением.
12
12
  - 🔒 Обновление идёт одно за раз, пока оно идёт, кнопки неактивны.
13
13
  - 🔽 Сворачивается по клику на заголовок.
@@ -87,7 +87,7 @@ interface FirmwareTarget {
87
87
  | --------------------------- | -------------------- | ------------------------ |
88
88
  | `bootloader` | 0 | Перезагрузка в загрузчик |
89
89
  | `erase` | 0 | Стирание |
90
- | `write` | `done / total * 100` | Запись N% |
90
+ | `write` | `done / total * 100` | Запись |
91
91
  | `verify` | 100 | Проверка |
92
92
 
93
93
  </details>
@@ -58,11 +58,10 @@
58
58
 
59
59
  const canUpdate = $derived(enabled && !!sources.version && selected !== null && !running)
60
60
 
61
- /* Строка состояния по этапу */
61
+ /* Строка состояния по этапу: проценты только в полосе хода */
62
62
  const statusText = $derived.by(() => {
63
63
  if (stage === "done") return $T("widget.firmware.done")
64
64
  if (stage === "error") return $T("widget.firmware.failed", { error: errorText })
65
- if (stage === "write" || stage === "hub") return $T(`widget.firmware.stage.${stage}`, { n: Math.round(percent) })
66
65
  return stage ? $T(`widget.firmware.stage.${stage}`) : ""
67
66
  })
68
67
 
@@ -80,7 +79,8 @@
80
79
  try {
81
80
  await onUpdate(source, (next, value) => {
82
81
  stage = next
83
- percent = Math.min(100, Math.max(0, Number.isFinite(value) ? value : 0))
82
+ /* Целые проценты: полоса показывает 1, 2, 3 без дробей */
83
+ percent = Math.floor(Math.min(100, Math.max(0, Number.isFinite(value) ? value : 0)))
84
84
  })
85
85
  percent = 100
86
86
  stage = "done"
@@ -66,8 +66,10 @@
66
66
  : 'border-(--hairline-color) bg-transparent text-(--faint-color) hover:text-(--muted-color)'}"
67
67
  title={$hints ? $T("widget.hints.on") : $T("widget.hints.off")}
68
68
  aria-pressed={$hints}
69
- onclick={() => hints.update((on) => !on)}>?</button
69
+ onclick={() => hints.update((on) => !on)}
70
70
  >
71
+ ?
72
+ </button>
71
73
  {/if}
72
74
  </div>
73
75
  {#if right && wrapped}
@@ -1,12 +1,12 @@
1
1
  <script lang="ts"></script>
2
2
 
3
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"
4
- ><path
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path
5
5
  fill="none"
6
6
  stroke="currentColor"
7
7
  stroke-linecap="round"
8
8
  stroke-linejoin="round"
9
9
  stroke-width="2"
10
10
  d="M4.9 16.1a10 10 0 0 1 0-14.1M7.8 13.2a6 6 0 0 1 0-8.4M16.2 4.8a6 6 0 0 1 0 8.4M19.1 2a10 10 0 0 1 0 14.1M12 9v13M10 9a2 2 0 1 0 4 0 2 2 0 1 0-4 0"
11
- /></svg
12
- >
11
+ />
12
+ </svg>
@@ -1,12 +1,12 @@
1
1
  <script lang="ts"></script>
2
2
 
3
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"
4
- ><path
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path
5
5
  fill="none"
6
6
  stroke="currentColor"
7
7
  stroke-linecap="round"
8
8
  stroke-linejoin="round"
9
9
  stroke-width="2"
10
10
  d="M4 9V5a1 1 0 0 1 1-1h4m6 0h4a1 1 0 0 1 1 1v4m0 6v4a1 1 0 0 1-1 1h-4m-6 0H5a1 1 0 0 1-1-1v-4m5-3a3 3 0 1 0 6 0a3 3 0 1 0-6 0"
11
- /></svg
12
- >
11
+ />
12
+ </svg>
@@ -1,12 +1,5 @@
1
1
  <script lang="ts"></script>
2
2
 
3
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"
4
- ><path
5
- fill="none"
6
- stroke="currentColor"
7
- stroke-linecap="round"
8
- stroke-linejoin="round"
9
- stroke-width="2"
10
- d="M9 4 3 6v14l6-2 6 2 6-2V4l-6 2zm0 0v14m6-12v14"
11
- /></svg
12
- >
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 4 3 6v14l6-2 6 2 6-2V4l-6 2zm0 0v14m6-12v14" />
5
+ </svg>
@@ -300,8 +300,8 @@
300
300
  stroke-linejoin="round"
301
301
  stroke-width="1.5"
302
302
  d="M14.76 12H6.832m0 0c0-.275-.057-.55-.17-.808L4.285 5.814c-.76-1.72 1.058-3.442 2.734-2.591L20.8 10.217c1.46.74 1.46 2.826 0 3.566L7.02 20.777c-1.677.851-3.495-.872-2.735-2.591l2.375-5.378A2 2 0 0 0 6.83 12"
303
- /></svg
304
- >
303
+ />
304
+ </svg>
305
305
  </div>
306
306
  {/if}
307
307
  </div>
@@ -388,16 +388,16 @@
388
388
  title={$T("widget.map.hide")}
389
389
  onclick={() => hideBoard(board.group)}
390
390
  >
391
- <svg xmlns="http://www.w3.org/2000/svg" width="1.25rem" height="1.25rem" viewBox="0 0 24 24"
392
- ><path
391
+ <svg xmlns="http://www.w3.org/2000/svg" width="1.25rem" height="1.25rem" viewBox="0 0 24 24">
392
+ <path
393
393
  fill="none"
394
394
  stroke="currentColor"
395
395
  stroke-linecap="round"
396
396
  stroke-linejoin="round"
397
397
  stroke-width="1.5"
398
398
  d="m19.5 5.5l-.62 10.025c-.158 2.561-.237 3.842-.88 4.763a4 4 0 0 1-1.2 1.128c-.957.584-2.24.584-4.806.584c-2.57 0-3.855 0-4.814-.585a4 4 0 0 1-1.2-1.13c-.642-.922-.72-2.205-.874-4.77L4.5 5.5M3 5.5h18m-4.944 0l-.683-1.408c-.453-.936-.68-1.403-1.071-1.695a2 2 0 0 0-.275-.172C13.594 2 13.074 2 12.035 2c-1.066 0-1.599 0-2.04.234a2 2 0 0 0-.278.18c-.395.303-.616.788-1.058 1.757L8.053 5.5m1.447 11v-6m5 6v-6"
399
- /></svg
400
- >
399
+ />
400
+ </svg>
401
401
  </button>
402
402
  </div>
403
403
  </div>
@@ -1,5 +1,5 @@
1
1
  /* Версия должна совпадать с установленной devDependency maplibre-gl (по ней проверяются типы): после обновления зависимостей поднять и здесь, сверку делает tests/maplibre.test.mjs; пакет 6.x - только ES-модуль, без UMD-скрипта и глобала */
2
- const MAPLIBRE_VERSION = "6.18.0";
2
+ const MAPLIBRE_VERSION = "6.19.0";
3
3
  const CDN = `https://cdn.jsdelivr.net/npm/maplibre-gl@${MAPLIBRE_VERSION}/dist`;
4
4
  let source = {
5
5
  module: `${CDN}/maplibre-gl.mjs`,