@surdeddd/wmkit 0.9.1 → 0.9.2

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 CHANGED
@@ -14,6 +14,7 @@
14
14
 
15
15
  - 🪟 **Full window lifecycle** — open, close, focus, minimize, maximize, restore, drag, 8-direction resize
16
16
  - 🧠 **Headless core** — a serializable state machine plus a DOM controller; bring your own markup or use the glass theme
17
+ - 🧱 **Your window, your markup** — build the whole frame from a template string, wire its buttons by attribute, and swap the skin on a live window without losing what it was showing
17
18
  - ⚛️ **Official adapters** — `@surdeddd/wmkit/react`, `/vue`, `/svelte`, `/solid`, `/angular`, all thin sugar over one core
18
19
  - 🗃️ **Tab groups** — drop one titlebar onto another and the windows share a frame, dockview style; the tab order is yours to reorder
19
20
  - ⊞ **Snap zones** — halves, quarters, thirds and drag-to-top maximize with a live preview
@@ -26,7 +27,7 @@
26
27
  - 💾 **Persistence** — one call to serialize the desktop, one call to restore it, with versioned migrations
27
28
  - 🎨 **Sixteen themes** — glass, light, retro, terminal, paper, neon, aqua, frost, candy, carbon, brutalist, blueprint, amber, noir, forest, synth — or bring your own CSS
28
29
  - 🖼️ **Popout** *(experimental)* — send a window into Document Picture-in-Picture
29
- - 📦 **Zero dependencies**, strict TypeScript, ESM + CJS, ~10.7 kB brotli core
30
+ - 📦 **Zero dependencies**, strict TypeScript, ESM + CJS, under 15 kB brotli core
30
31
 
31
32
  ## Install
32
33
 
@@ -394,9 +395,17 @@ Rows are patched in place rather than re-rendered, so keyboard focus inside the
394
395
  }
395
396
  ```
396
397
 
397
- Fifteen more ready-made themes ship alongside — `light`, `retro`, `terminal`, `paper`, `neon`, `aqua`, `frost`, `candy`, `carbon`, `brutalist`, `blueprint`, `amber`, `noir`, `forest` and `synth`. They all style the same `data-wm-*` attributes, so switching is a one-line import swap, and every one of them ships 24px pointer targets plus `prefers-reduced-motion` and `forced-colors` blocks.
398
+ Fifteen more ready-made themes ship alongside — `light`, `retro`, `terminal`, `paper`, `neon`, `aqua`, `frost`, `candy`, `carbon`, `brutalist`, `blueprint`, `amber`, `noir`, `forest` and `synth`. They all style the same `data-wm-*` attributes, so switching is a one-line import swap, and every one of them ships 24px pointer targets plus `prefers-reduced-motion` and `forced-colors` blocks. Every one is also held to WCAG AA contrast by a browser test that measures the rendered pixels of the demo under all sixteen.
398
399
 
399
- A theme dresses every window; a variant dresses one. Set `meta.variant` on a window and the desktop mirrors it to `data-wm-variant` for your CSS to pick up — see [docs/theming.md](docs/theming.md).
400
+ Three layers, from the widest to the narrowest:
401
+
402
+ | layer | reaches | changes |
403
+ | --- | --- | --- |
404
+ | theme | every window | the tokens |
405
+ | variant | one window | the tokens, through `data-wm-variant` |
406
+ | skin | one window | the markup itself |
407
+
408
+ A theme and a variant repaint what is there; a skin replaces it. Set `meta.variant` for the first two and `meta.skin` for the third — see [docs/theming.md](docs/theming.md).
400
409
 
401
410
  Skip the import entirely and the library stays headless: state attributes (`data-wm-stage`, `data-wm-focused`, `data-wm-dragging`, `data-wm-flash`, `[hidden]`) are yours to style.
402
411
 
@@ -413,7 +422,7 @@ This README is the tour. The reference lives in [`docs/`](./docs/README.md):
413
422
  | [API reference](./docs/api.md) | every export, option, method, event and type |
414
423
  | [Adapters](./docs/adapters.md) | complete React, Vue, Svelte, Solid and Angular integrations |
415
424
  | [Theming](./docs/theming.md) | `data-wm-*` contract, CSS variables, writing a theme from scratch |
416
- | [Recipes](./docs/recipes.md) | taskbar, modals, persistence, workspaces, SSR, testing, performance |
425
+ | [Recipes](./docs/recipes.md) | building a window from scratch, taskbar, modals, persistence, workspaces, SSR, testing, performance |
417
426
  | [Browser support](./docs/browser-support.md) | baselines per entry point and what degrades where |
418
427
 
419
428
  ## Comparison
package/README.ru.md CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  - 🪟 **Полный жизненный цикл окна** — открытие, закрытие, фокус, сворачивание, разворачивание, восстановление, drag, ресайз в 8 направлениях
12
12
  - 🧠 **Headless-ядро** — сериализуемая стейт-машина плюс DOM-контроллер; своя разметка или готовая стеклянная тема
13
+ - 🧱 **Своё окно, своя разметка** — соберите весь корпус из строки-шаблона, повесьте кнопки атрибутами и меняйте скин на живом окне, не теряя того, что оно показывало
13
14
  - ⚛️ **Родные адаптеры** — `@surdeddd/wmkit/react`, `/vue`, `/svelte`, `/solid`, `/angular`, тонкий сахар над одним ядром
14
15
  - 🗃️ **Вкладочные группы** — бросьте заголовок на заголовок, и окна начнут делить одну рамку; порядок вкладок можно менять
15
16
  - ⊞ **Snap-зоны** — половины, четверти, трети и максимизация от верхнего края с живым превью
@@ -22,7 +23,7 @@
22
23
  - 💾 **Персист** — один вызов сериализует рабочий стол, один — восстанавливает, с версионированием и миграциями
23
24
  - 🎨 **Шестнадцать тем** — glass, light, retro, terminal, paper, neon, aqua, frost, candy, carbon, brutalist, blueprint, amber, noir, forest, synth — либо полностью свой CSS
24
25
  - 🖼️ **Popout** *(experimental)* — вынос окна в Document Picture-in-Picture
25
- - 📦 **Ноль зависимостей**, строгий TypeScript, ESM + CJS, ~10.7 kB brotli
26
+ - 📦 **Ноль зависимостей**, строгий TypeScript, ESM + CJS, ядро меньше 15 кБ в brotli
26
27
 
27
28
  ## Установка
28
29
 
@@ -323,7 +324,17 @@ panel.destroy()
323
324
 
324
325
  Ещё пятнадцать готовых тем: `light`, `retro`, `terminal`, `paper`, `neon`, `aqua`, `frost`, `candy`, `carbon`, `brutalist`, `blueprint`, `amber`, `noir`, `forest`, `synth`. Все стилизуют одни и те же `data-wm-*` атрибуты — переключение = замена одного импорта, и у каждой есть 24px тач-цели плюс блоки `prefers-reduced-motion` и `forced-colors`.
325
326
 
326
- Тема одевает все окна, вариант одно. Задайте `meta.variant` у окна, и десктоп отзеркалит его в `data-wm-variant` для вашего CSS подробности в [docs/theming.md](docs/theming.md).
327
+ Каждая тема к тому же держит контраст WCAG AA: браузерный тест меряет отрендеренные пиксели демо под всеми шестнадцатью и падает ниже 4.5:1.
328
+
329
+ Три слоя, от самого широкого к самому узкому:
330
+
331
+ | слой | достаёт до | меняет |
332
+ | --- | --- | --- |
333
+ | тема | всех окон | токены |
334
+ | вариант | одного окна | токены, через `data-wm-variant` |
335
+ | скин | одного окна | саму разметку |
336
+
337
+ Тема и вариант перекрашивают то, что есть; скин это заменяет. Для первых двух — `meta.variant`, для третьего — `meta.skin`, подробности в [docs/theming.md](docs/theming.md).
327
338
 
328
339
  ## SSR
329
340
 
@@ -8,8 +8,9 @@
8
8
  --wm-shadow-focused: 0 0 26px rgba(255, 176, 46, 0.22);
9
9
  --wm-titlebar-bg: rgba(255, 176, 46, 0.09);
10
10
  --wm-text: #ffc356;
11
- --wm-text-dim: rgba(255, 195, 86, 0.55);
11
+ --wm-text-dim: rgba(255, 195, 86, 0.72);
12
12
  --wm-accent: #ffb02e;
13
+ --wm-accent-ink: #ffb02e;
13
14
  --wm-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
14
15
  --wm-title-font: var(--wm-mono);
15
16
  --wm-title-size: 12px;
@@ -1,6 +1,6 @@
1
1
  [data-wm-desktop] {
2
2
  --wm-radius: 10px;
3
- --wm-bg: rgba(238, 241, 246, 0.86);
3
+ --wm-bg: rgba(238, 241, 246, 0.94);
4
4
  --wm-bg-focused: rgba(246, 248, 252, 0.96);
5
5
  --wm-border: rgba(60, 80, 110, 0.28);
6
6
  --wm-border-focused: rgba(40, 70, 120, 0.45);
@@ -8,8 +8,9 @@
8
8
  --wm-shadow-focused: 0 16px 40px rgba(20, 40, 80, 0.32);
9
9
  --wm-titlebar-bg: linear-gradient(180deg, #fdfdfe 0%, #e4eaf3 48%, #d4dced 52%, #e8edf5 100%);
10
10
  --wm-text: #1d2733;
11
- --wm-text-dim: rgba(29, 39, 51, 0.62);
11
+ --wm-text-dim: rgba(29, 39, 51, 0.7);
12
12
  --wm-accent: #2f6fd0;
13
+ --wm-accent-ink: #2962b7;
13
14
  --wm-blur: 14px;
14
15
  --wm-title-size: 13px;
15
16
  --wm-title-weight: 600;
@@ -8,8 +8,9 @@
8
8
  --wm-shadow-focused: 0 0 0 1px rgba(215, 235, 255, 0.45);
9
9
  --wm-titlebar-bg: rgba(190, 220, 255, 0.1);
10
10
  --wm-text: #e8f2ff;
11
- --wm-text-dim: rgba(232, 242, 255, 0.6);
11
+ --wm-text-dim: rgba(232, 242, 255, 0.74);
12
12
  --wm-accent: #9ecbff;
13
+ --wm-accent-ink: #9ecbff;
13
14
  --wm-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
14
15
  --wm-title-font: var(--wm-mono);
15
16
  --wm-title-size: 12px;
@@ -11,6 +11,7 @@
11
11
  --wm-text: #111111;
12
12
  --wm-text-dim: rgba(17, 17, 17, 0.6);
13
13
  --wm-accent: #ff3b00;
14
+ --wm-accent-ink: #cf3000;
14
15
  --wm-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
15
16
  --wm-title-font: var(--wm-mono);
16
17
  --wm-title-size: 12px;
@@ -8,8 +8,9 @@
8
8
  --wm-shadow-focused: 0 18px 44px rgba(236, 130, 175, 0.3);
9
9
  --wm-titlebar-bg: linear-gradient(90deg, rgba(255, 214, 233, 0.9), rgba(214, 233, 255, 0.9));
10
10
  --wm-text: #5b3a52;
11
- --wm-text-dim: rgba(91, 58, 82, 0.6);
11
+ --wm-text-dim: rgba(91, 58, 82, 0.82);
12
12
  --wm-accent: #ec82af;
13
+ --wm-accent-ink: #c81e66;
13
14
  --wm-title-size: 13px;
14
15
  --wm-title-weight: 700;
15
16
  --wm-titlebar-padding: 11px 16px;
@@ -10,6 +10,7 @@
10
10
  --wm-text: #f4f4f4;
11
11
  --wm-text-dim: #a8a8a8;
12
12
  --wm-accent: #4589ff;
13
+ --wm-accent-ink: #4589ff;
13
14
  --wm-title-size: 13px;
14
15
  --wm-title-weight: 500;
15
16
  --wm-title-tracking: 0;
@@ -10,6 +10,7 @@
10
10
  --wm-text: #e6f0e2;
11
11
  --wm-text-dim: rgba(230, 240, 226, 0.58);
12
12
  --wm-accent: #9abe8c;
13
+ --wm-accent-ink: #9abe8c;
13
14
  --wm-serif: "Iowan Old Style", Palatino, Georgia, serif;
14
15
  --wm-title-font: var(--wm-serif);
15
16
  --wm-title-size: 14px;
@@ -1,15 +1,16 @@
1
1
  [data-wm-desktop] {
2
2
  --wm-radius: 18px;
3
- --wm-bg: rgba(255, 255, 255, 0.48);
4
- --wm-bg-focused: rgba(255, 255, 255, 0.66);
3
+ --wm-bg: rgba(255, 255, 255, 0.82);
4
+ --wm-bg-focused: rgba(255, 255, 255, 0.96);
5
5
  --wm-border: rgba(255, 255, 255, 0.6);
6
6
  --wm-border-focused: rgba(255, 255, 255, 0.92);
7
7
  --wm-shadow: 0 8px 30px rgba(80, 110, 150, 0.18);
8
8
  --wm-shadow-focused: 0 20px 60px rgba(80, 110, 150, 0.3);
9
9
  --wm-titlebar-bg: rgba(255, 255, 255, 0.3);
10
10
  --wm-text: #20303f;
11
- --wm-text-dim: rgba(32, 48, 63, 0.55);
11
+ --wm-text-dim: rgba(32, 48, 63, 0.75);
12
12
  --wm-accent: #0ea5e9;
13
+ --wm-accent-ink: #086087;
13
14
  --wm-blur: 28px;
14
15
  --wm-title-size: 13px;
15
16
  --wm-title-weight: 600;
@@ -10,6 +10,7 @@
10
10
  --wm-text: rgba(240, 242, 250, 0.92);
11
11
  --wm-text-dim: rgba(240, 242, 250, 0.55);
12
12
  --wm-accent: #7c6cff;
13
+ --wm-accent-ink: #7c6cff;
13
14
  --wm-blur: 22px;
14
15
  --wm-transition: 240ms cubic-bezier(0.32, 0.72, 0, 1);
15
16
  position: relative;
@@ -1,15 +1,16 @@
1
1
  [data-wm-desktop] {
2
2
  --wm-radius: 12px;
3
- --wm-bg: rgba(255, 255, 255, 0.78);
4
- --wm-bg-focused: rgba(255, 255, 255, 0.94);
3
+ --wm-bg: rgba(255, 255, 255, 0.9);
4
+ --wm-bg-focused: rgba(255, 255, 255, 0.96);
5
5
  --wm-border: rgba(15, 23, 42, 0.1);
6
6
  --wm-border-focused: rgba(15, 23, 42, 0.22);
7
7
  --wm-shadow: 0 6px 22px rgba(15, 23, 42, 0.12);
8
8
  --wm-shadow-focused: 0 16px 44px rgba(15, 23, 42, 0.2);
9
9
  --wm-titlebar-bg: rgba(15, 23, 42, 0.03);
10
10
  --wm-text: rgba(15, 23, 42, 0.92);
11
- --wm-text-dim: rgba(15, 23, 42, 0.55);
11
+ --wm-text-dim: rgba(15, 23, 42, 0.64);
12
12
  --wm-accent: #4f46e5;
13
+ --wm-accent-ink: #4f46e5;
13
14
  --wm-blur: 18px;
14
15
  --wm-transition: 240ms cubic-bezier(0.32, 0.72, 0, 1);
15
16
  position: relative;
@@ -10,6 +10,7 @@
10
10
  --wm-text: #f3e9ff;
11
11
  --wm-text-dim: rgba(243, 233, 255, 0.55);
12
12
  --wm-accent: #ec4899;
13
+ --wm-accent-ink: #ec4899;
13
14
  --wm-accent-alt: #38bdf8;
14
15
  --wm-blur: 20px;
15
16
  --wm-transition: 260ms cubic-bezier(0.32, 0.72, 0, 1);
@@ -10,6 +10,7 @@
10
10
  --wm-text: #ffffff;
11
11
  --wm-text-dim: rgba(255, 255, 255, 0.55);
12
12
  --wm-accent: #ffffff;
13
+ --wm-accent-ink: #ffffff;
13
14
  --wm-title-size: 11px;
14
15
  --wm-title-weight: 600;
15
16
  --wm-title-tracking: 0.24em;
@@ -8,8 +8,9 @@
8
8
  --wm-shadow-focused: 4px 6px 0 rgba(84, 71, 51, 0.16);
9
9
  --wm-titlebar-bg: rgba(84, 71, 51, 0.05);
10
10
  --wm-text: #3f382c;
11
- --wm-text-dim: rgba(63, 56, 44, 0.6);
11
+ --wm-text-dim: rgba(63, 56, 44, 0.73);
12
12
  --wm-accent: #a8571b;
13
+ --wm-accent-ink: #a8571b;
13
14
  --wm-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
14
15
  --wm-transition: 220ms cubic-bezier(0.32, 0.72, 0, 1);
15
16
  position: relative;
@@ -4,12 +4,14 @@
4
4
  --wm-face-dark: #808080;
5
5
  --wm-face-darker: #404040;
6
6
  --wm-title-active-a: #000080;
7
- --wm-title-active-b: #1084d0;
8
- --wm-title-inactive: #808080;
7
+ --wm-title-active-b: #0f6fb0;
8
+ --wm-title-inactive: #8c8c8c;
9
9
  --wm-text: #000000;
10
10
  --wm-text-dim: #404040;
11
11
  --wm-accent: #000080;
12
+ --wm-accent-ink: #000080;
12
13
  --wm-title-text: #ffffff;
14
+ --wm-title-text-inactive: #1a1a1a;
13
15
  position: relative;
14
16
  overflow: hidden;
15
17
  background: #008080;
@@ -67,13 +69,17 @@
67
69
  flex: 1;
68
70
  font-size: 12px;
69
71
  font-weight: 700;
70
- color: var(--wm-title-text);
72
+ color: var(--wm-title-text-inactive);
71
73
  white-space: nowrap;
72
74
  overflow: hidden;
73
75
  text-overflow: ellipsis;
74
76
  letter-spacing: 0;
75
77
  }
76
78
 
79
+ [data-wm-window][data-wm-focused] [data-wm-title] {
80
+ color: var(--wm-title-text);
81
+ }
82
+
77
83
  [data-wm-window] [data-wm-controls] {
78
84
  display: flex;
79
85
  gap: 8px;
@@ -10,6 +10,7 @@
10
10
  --wm-text: #ffeaf7;
11
11
  --wm-text-dim: rgba(255, 234, 247, 0.62);
12
12
  --wm-accent: #ff7ac6;
13
+ --wm-accent-ink: #ff7ac6;
13
14
  --wm-blur: 16px;
14
15
  --wm-title-size: 12px;
15
16
  --wm-title-weight: 700;
@@ -10,6 +10,7 @@
10
10
  --wm-text: #b8f5cd;
11
11
  --wm-text-dim: rgba(184, 245, 205, 0.55);
12
12
  --wm-accent: #4ade80;
13
+ --wm-accent-ink: #4ade80;
13
14
  --wm-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
14
15
  --wm-transition: 120ms linear;
15
16
  position: relative;