poe-svelte-ui-lib 1.28.2 → 1.28.4
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/dist/Map/Map.svelte
CHANGED
|
@@ -17,12 +17,27 @@
|
|
|
17
17
|
}: IMapProps = $props()
|
|
18
18
|
|
|
19
19
|
/* Мастер-цвет (тот же bg-* из optionsStore.COLOR_OPTIONS, что и у остальных примитивов) —
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
красить саму карту цветом смысла нет (это базовая карта MapLibre), поэтому проявляется на
|
|
21
|
+
ФОНЕ наших собственных оверлеев поверх неё: панели управления (CustomControl) и карточки
|
|
22
|
+
устройства (Popup) — см. roleBgClass ниже, применяется прямо в разметке. */
|
|
23
|
+
const roleBgClass = $derived.by(() => {
|
|
22
24
|
const role = wrapperClass.match(/bg-(\w+)/)?.[1]
|
|
23
|
-
/*
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
/* bg-(--bg-color) — реальная utility, красящая заливку; bg-{role} лишь задаёт переменную
|
|
26
|
+
--bg-color (см. app.css), тот же приём, что и в Button.svelte (roleBg/roleClass).
|
|
27
|
+
text-(--on-accent) — иначе тёмный текст (задуман под белую подложку control'ов MapLibre
|
|
28
|
+
по умолчанию) нечитаем на цветной заливке. */
|
|
29
|
+
return role && role !== "max" ? `bg-(--bg-color) bg-${role} text-(--on-accent)` : ""
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
/* Акцентное кольцо вокруг самой карты. Намеренно ring, а не border: border меняет content-box
|
|
33
|
+
контейнера MapLibre уже ПОСЛЕ монтажа, а сама MapLibre не переотрисовывает canvas при таком
|
|
34
|
+
ресайзе без явного вызова map.resize() — итог был обрезанный/съехавший рендер при смене
|
|
35
|
+
цвета. ring — box-shadow, размеры контейнера не меняет, поэтому безопасен. */
|
|
36
|
+
const roleRingClass = $derived.by(() => {
|
|
37
|
+
const role = wrapperClass.match(/bg-(\w+)/)?.[1]
|
|
38
|
+
/* ring-(--border-color) — реальная utility, красящая кольцо; border-{role} лишь задаёт
|
|
39
|
+
переменную --border-color (см. app.css). */
|
|
40
|
+
return role && role !== "max" ? `ring-2 ring-inset ring-(--border-color) border-${role}` : ""
|
|
26
41
|
})
|
|
27
42
|
|
|
28
43
|
interface MapDevice extends IDeviceGNSS {
|
|
@@ -146,7 +161,7 @@
|
|
|
146
161
|
<h5 class={twMerge(` w-full px-4 text-center`, label.class)}>{label.name}</h5>
|
|
147
162
|
{/if}
|
|
148
163
|
<MapLibre
|
|
149
|
-
class={twMerge("h-[calc(100%-2rem)] min-h-50 overflow-hidden rounded-xl shadow-sm transition duration-200 hover:shadow-md",
|
|
164
|
+
class={twMerge("h-[calc(100%-2rem)] min-h-50 overflow-hidden rounded-xl shadow-sm transition duration-200 hover:shadow-md", roleRingClass)}
|
|
150
165
|
style={isDarkMode ? "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json" : "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"}
|
|
151
166
|
zoom={1.5}
|
|
152
167
|
center={{ lat: 30, lng: 0 }}
|
|
@@ -157,7 +172,7 @@
|
|
|
157
172
|
<FullScreenControl />
|
|
158
173
|
|
|
159
174
|
<CustomControl position="top-left">
|
|
160
|
-
<div class="flex flex-wrap items-center gap-3 px-2 py-1 text-black">
|
|
175
|
+
<div class={twMerge("flex flex-wrap items-center gap-3 rounded-lg px-2 py-1 text-black", roleBgClass)}>
|
|
161
176
|
<label class="flex items-center gap-1.5 text-sm font-medium">
|
|
162
177
|
<input type="checkbox" bind:checked={trackEnabled} />
|
|
163
178
|
{$T("constructor.props.map.track")}
|
|
@@ -240,7 +255,7 @@
|
|
|
240
255
|
<h6 class="text-sm leading-none font-bold">{device.DevName}</h6>
|
|
241
256
|
</div>
|
|
242
257
|
|
|
243
|
-
<div class="grid grid-cols-2 gap-x-3 gap-y-1 rounded-lg bg-(--container-color) p-2 text-xs">
|
|
258
|
+
<div class={twMerge("grid grid-cols-2 gap-x-3 gap-y-1 rounded-lg bg-(--container-color) p-2 text-xs", roleBgClass)}>
|
|
244
259
|
<div>
|
|
245
260
|
<p class="text-[0.6rem] font-semibold tracking-wide uppercase opacity-60">Lat / Lon</p>
|
|
246
261
|
<p class="font-medium">{device.NavLat.toFixed(5)}, {device.NavLon.toFixed(5)}</p>
|
|
@@ -20,10 +20,13 @@
|
|
|
20
20
|
const isRemote = $derived(source === "remote")
|
|
21
21
|
|
|
22
22
|
/* Мастер-цвет (тот же bg-* из optionsStore.COLOR_OPTIONS, что и у остальных примитивов) —
|
|
23
|
-
проявляется как
|
|
23
|
+
проявляется как акцентное кольцо вокруг кадра. Namеренно ring, а не border — border меняет
|
|
24
|
+
content-box контейнера (см. Map.svelte, где это ломало рендер MapLibre при смене цвета);
|
|
25
|
+
ring (box-shadow) размеры не меняет, тот же приём здесь для единообразия и на случай
|
|
26
|
+
будущей смены video/img на что-то более чувствительное к ресайзу контейнера. */
|
|
24
27
|
const roleBorderClass = $derived.by(() => {
|
|
25
28
|
const role = wrapperClass?.match(/bg-(\w+)/)?.[1]
|
|
26
|
-
return role && role !== "max" ? `
|
|
29
|
+
return role && role !== "max" ? `ring-2 ring-inset ring-(--border-color) border-${role}` : ""
|
|
27
30
|
})
|
|
28
31
|
|
|
29
32
|
let videoElement = $state<HTMLVideoElement | null>(null)
|
|
@@ -31,9 +31,9 @@ const translations = {
|
|
|
31
31
|
"constructor.props.height.medium": ["Средняя", "Medium", "中等"],
|
|
32
32
|
"constructor.props.height.large": ["Большая", "Large", "大"],
|
|
33
33
|
"constructor.props.align.left": ["Слева", "Left", "左"],
|
|
34
|
-
"constructor.props.align.center": ["
|
|
34
|
+
"constructor.props.align.center": ["Центр", "Center", "居中"],
|
|
35
35
|
"constructor.props.align.right": ["Справа", "Right", "右"],
|
|
36
|
-
"constructor.props.align.justify": ["
|
|
36
|
+
"constructor.props.align.justify": ["Ширина", "Justify", "两端对齐"],
|
|
37
37
|
"constructor.props.type.main": ["Основной", "Main", "主要"],
|
|
38
38
|
"constructor.props.type.sub": ["Вложенный", "Nested", "嵌套"],
|
|
39
39
|
"constructor.props.type.text": ["Текст", "Text", "文本"],
|
|
@@ -49,7 +49,7 @@ const translations = {
|
|
|
49
49
|
"constructor.props.type.huge": ["L", "L", "L"],
|
|
50
50
|
"constructor.props.type.massive": ["XL", "XL", "XL"],
|
|
51
51
|
"constructor.props.type.select": ["Список", "List", "列表"],
|
|
52
|
-
"constructor.props.type.buttons": ["
|
|
52
|
+
"constructor.props.type.buttons": ["Кнопки", "Buttons", "按钮组"],
|
|
53
53
|
"constructor.props.type.selectput": ["Список+ввод", "List+input", "列表+输入"],
|
|
54
54
|
"constructor.props.valuetype.text": ["Строка", "String", "字符串"],
|
|
55
55
|
"constructor.props.valuetype.number": ["Число", "Number", "数字"],
|
|
@@ -189,9 +189,9 @@ const translations = {
|
|
|
189
189
|
"constructor.props.divider.type.line": ["Полоса", "Line", "线条"],
|
|
190
190
|
"constructor.props.divider.type.empty": ["Пустота", "Empty", "空白"],
|
|
191
191
|
"constructor.props.divider.anchor": ["Привязка", "Anchor", "对齐位置"],
|
|
192
|
-
"constructor.props.divider.anchor.top": ["
|
|
193
|
-
"constructor.props.divider.anchor.center": ["
|
|
194
|
-
"constructor.props.divider.anchor.bottom": ["
|
|
192
|
+
"constructor.props.divider.anchor.top": ["Верх", "Top", "顶部"],
|
|
193
|
+
"constructor.props.divider.anchor.center": ["Центр", "Center", "居中"],
|
|
194
|
+
"constructor.props.divider.anchor.bottom": ["Низ", "Bottom", "底部"],
|
|
195
195
|
"constructor.props.divider.width": ["Толщина полосы", "Line width", "线条粗细"],
|
|
196
196
|
"constructor.props.disabled": ["Отключить", "Disable", "禁用"],
|
|
197
197
|
"constructor.props.readonly": ["Только чтение", "Read only", "只读"],
|
|
@@ -253,8 +253,8 @@ const translations = {
|
|
|
253
253
|
"constructor.props.showSelect": ["Выбор источника", "Source selection", "来源选择"],
|
|
254
254
|
"constructor.props.widget.mode": ["Зацикленный", "Looped", "循环"],
|
|
255
255
|
"constructor.props.table.type": ["Тип таблицы", "Table type", "表格类型"],
|
|
256
|
-
"constructor.props.table.type.table": ["Статическая
|
|
257
|
-
"constructor.props.table.type.logger": ["
|
|
256
|
+
"constructor.props.table.type.table": ["Статическая", "Static", "静态表格"],
|
|
257
|
+
"constructor.props.table.type.logger": ["Логи", "Logs", "日志表格"],
|
|
258
258
|
"constructor.props.table.columns": ["Колонки таблицы", "Table columns", "表格列"],
|
|
259
259
|
"constructor.props.table.text.key": ["Ключ текста", "Text key", "文本键"],
|
|
260
260
|
"constructor.props.table.select.key": ["Ключ селектора", "Selector key", "选择器键"],
|