elcrm 1.1.25 → 1.1.27

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/index.js CHANGED
@@ -1149,6 +1149,11 @@ function isColorToken(name, value) {
1149
1149
  return true;
1150
1150
  return false;
1151
1151
  }
1152
+ function isButtonShadowNoise(name, value) {
1153
+ if (!/^--button-.+-shadow(-(hover|active))?$/.test(name))
1154
+ return false;
1155
+ return /^none$/i.test(value.trim());
1156
+ }
1152
1157
  function listCssFiles(dir, acc = []) {
1153
1158
  if (!existsSync5(dir))
1154
1159
  return acc;
@@ -1440,7 +1445,7 @@ function syncElcrmCss(options) {
1440
1445
  continue;
1441
1446
  let css = readFileSync7(file, "utf8");
1442
1447
  const have = existingTokenNames(css);
1443
- const missing = allDefs.filter((d) => d.bucket === bucket && !have.has(d.name) && !d.name.startsWith("--search-") && !TOKEN_DEPRECATED.has(d.name));
1448
+ const missing = allDefs.filter((d) => d.bucket === bucket && !have.has(d.name) && !d.name.startsWith("--search-") && !TOKEN_DEPRECATED.has(d.name) && !isButtonShadowNoise(d.name, d.value));
1444
1449
  const uniq = [];
1445
1450
  const seen = new Set;
1446
1451
  for (const d of missing) {
@@ -1488,6 +1493,32 @@ function syncElcrmCss(options) {
1488
1493
  }
1489
1494
  return { styleDir, added, imports, removedImports, skippedPkgs };
1490
1495
  }
1496
+ function stripButtonShadowNoiseFromTheme(styleDir, dry = false) {
1497
+ const file = join5(styleDir, "theme.css");
1498
+ if (!existsSync5(file))
1499
+ return [];
1500
+ const css = readFileSync7(file, "utf8");
1501
+ const lines = css.split(/\r?\n/);
1502
+ const removed = [];
1503
+ const kept = lines.filter((line) => {
1504
+ const m = line.match(/^\s*(--button-[a-z0-9-]+shadow[a-z0-9-]*)\s*:\s*(.+);/i);
1505
+ if (!m)
1506
+ return true;
1507
+ if (!isButtonShadowNoise(m[1], m[2]))
1508
+ return true;
1509
+ removed.push(m[1]);
1510
+ return false;
1511
+ });
1512
+ if (!removed.length)
1513
+ return [];
1514
+ const next = kept.join(`
1515
+ `).replace(/\n{3,}/g, `
1516
+
1517
+ `);
1518
+ if (!dry)
1519
+ writeFileSync3(file, next, "utf8");
1520
+ return removed;
1521
+ }
1491
1522
 
1492
1523
  // src/lib/migrate/socket-server.ts
1493
1524
  import {
@@ -4589,6 +4620,12 @@ async function cmdCss(parsed) {
4589
4620
  try {
4590
4621
  const result = syncElcrmCss({ cwd, pkgNames: names, dry });
4591
4622
  console.log(`\u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u0441\u0442\u0438\u043B\u0435\u0439: ${result.styleDir}`);
4623
+ const stripped = stripButtonShadowNoiseFromTheme(result.styleDir, dry);
4624
+ if (stripped.length) {
4625
+ console.log(` ${dry ? "[dry] " : ""}${c.yellow("\u2212")} theme.css: \u0443\u0431\u0440\u0430\u043D\u043E ${stripped.length} button-shadow (none)`);
4626
+ for (const t of stripped)
4627
+ console.log(` ${c.dim(t)}`);
4628
+ }
4592
4629
  let total = 0;
4593
4630
  for (const [file, tokens] of Object.entries(result.added)) {
4594
4631
  if (!tokens.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elcrm",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "description": "CLI @elcrm/*: doctor --fix (порядок проекта), update, css, docs, cursor, kit, migrate",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,7 +26,8 @@ import { Button } from "@elcrm/button";
26
26
  - `onSend(setDisabled, event)`: синхронный `false` — без pending; промис/`async` — pending до settle; иначе снять через `setDisabled(false)`
27
27
  - Если задан `onClick` — `onSend` **не** вызывается
28
28
  - `buttonType`: `button` \| `submit` \| `reset`
29
- - Точечно: `@elcrm/button/Button`
29
+ - **`IconButton`** — только иконка: `icon` + обязательный `label` → `aria-label`. Имя иконки + tooltip — `@elcrm/components` `IconButton`.
30
+ - Точечно: `@elcrm/button/Button`, `@elcrm/button/IconButton`
30
31
 
31
32
  ## Нельзя
32
33
 
@@ -18,7 +18,7 @@ elcrm cursor
18
18
  | # | Команда | Что делает |
19
19
  | --- | --- | --- |
20
20
  | 1 | `elcrm update --fix --test` | Обновляет глобальный `elcrm` + все `@elcrm/*` в `package.json` → install → **migrate front** (API/токены/css-sanitize) → внутри `--fix` ещё раз **sync CSS** → `elcrm test` |
21
- | 2 | `elcrm css` | Недостающие CSS-токены → `theme.css` / `theme-light` / `theme-dark`. В `elcrm.css`: **добавляет** рабочие `@import`, **удаляет битые** (нет export/файла в установленном пакете). Затем css-sanitize |
21
+ | 2 | `elcrm css` | Недостающие CSS-токены → `theme.css` / `theme-light` / `theme-dark`. **Не дописывает** `--button-*-shadow: none` и снимает такие строки из `theme.css`. В `elcrm.css`: **добавляет** рабочие `@import`, **удаляет битые** (нет export/файла в установленном пакете). Затем css-sanitize |
22
22
  | 3 | `elcrm docs` | Перезаписывает `docs/*.elCRM.md` (шпаргалки пакетов) |
23
23
  | 4 | `elcrm cursor` | `.cursor/rules` + `.cursor/docs` + `AGENTS.md` для агента |
24
24
 
@@ -17,6 +17,7 @@ import {
17
17
  Card, Stat, ActionGroup, Toolbar, TextGroup, ItemColumn, List, Item, PageHead, PageShell, ChatList, ChatMessages, ChatSplit, Sidebar, Popover,
18
18
  Healthmap, PanelInfo,
19
19
  Loading, EmptyState, RadioGroup, PricingGroup, PricingTable,
20
+ Table, CodeBlock, SplitPane, Banner, IconButton,
20
21
  createLazyResolver,
21
22
  } from "@elcrm/components";
22
23
  import type { PricingPlan, HealthmapData } from "@elcrm/components";
@@ -43,6 +44,11 @@ import type { PricingPlan, HealthmapData } from "@elcrm/components";
43
44
  - **TextGroup** — две строки: `title` + `description` (без аватара; с аватаром — AvatarName).
44
45
  - **Item** — строка списка. `as` button/a/li, `active`. `variant="card"` — рамка и muted-фон (идеи / тикеты / inbox). Не дублировать `.desk-row` в приложении.
45
46
  - **ItemColumn** — внутри Item: `icon` слева, столбик `title` / `description` / `footer` или `meta`, `extra` — бейджи справа сверху, `aside` — колонка справа. `unread` — жирный title. Title: `--item-column-title-size` / `--item-column-title-line` (в console = `--button-size-s` / `--button-line-height`).
47
+ - **Table** — `<table>` в обёртке со скроллом. `layout="fixed"` для фиксированной сетки. Токены `--table-*`.
48
+ - **CodeBlock** — bar + `<pre>`, `onCopy`, `children` для подсветки. Токены `--code-block-*`.
49
+ - **SplitPane** — две панели + drag handle. `direction`, `ratio`, `onRatioChange`, `minFirst` / `minSecond`. Не `ChatSplit` (только чат). Токены `--split-handle-*`.
50
+ - **Banner** — статусная полоса (`tone`: info / warning / danger / success). Не toast — не `Notice`.
51
+ - **IconButton** — `name` (`Icons.Line`) + обязательный `label` + `Tooltip` по умолчанию. `tooltip={false}` без подсказки. Низкий уровень — `@elcrm/button/IconButton` (`icon` + `label`).
46
52
 
47
53
  ## Меню
48
54
 
@@ -20,24 +20,6 @@
20
20
  --button-size-s: 14px;
21
21
  --button-size-m: 16px;
22
22
  --button-size-l: 18px;
23
- --button-shadow: none;
24
- --button-shadow-hover: none;
25
- --button-shadow-active: none;
26
- --button-primary-shadow: none;
27
- --button-primary-hover-shadow: none;
28
- --button-primary-active-shadow: none;
29
- --button-secondary-shadow: none;
30
- --button-secondary-hover-shadow: none;
31
- --button-secondary-active-shadow: none;
32
- --button-positive-shadow: none;
33
- --button-positive-hover-shadow: none;
34
- --button-positive-active-shadow: none;
35
- --button-negative-shadow: none;
36
- --button-negative-hover-shadow: none;
37
- --button-negative-active-shadow: none;
38
- --button-ghost-shadow: none;
39
- --button-ghost-hover-shadow: none;
40
- --button-ghost-active-shadow: none;
41
23
 
42
24
  /* —— form / control —— */
43
25
  --control-height: 44px;
@@ -166,6 +148,26 @@
166
148
  --healthmap-l2: color-mix(in srgb, var(--shell-color-success) 45%, transparent);
167
149
  --healthmap-l3: color-mix(in srgb, var(--shell-color-success) 70%, transparent);
168
150
  --healthmap-l4: var(--shell-color-success);
151
+ --table-font-size: 0.9rem;
152
+ --table-cell-padding: 0.55rem 0.7rem;
153
+ --table-head-font-size: 0.75rem;
154
+ --table-code-font-size: 0.8rem;
155
+ --code-block-bg: var(--shell-background);
156
+ --code-block-bar-padding: 0.4rem 0.75rem;
157
+ --code-block-padding: 0.85rem 1rem;
158
+ --code-block-font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
159
+ --code-block-font-size: 0.8rem;
160
+ --code-block-line-height: 1.55;
161
+ --split-handle-size: 6px;
162
+ --split-handle-bg: var(--shell-border);
163
+ --split-handle-bg-hover: color-mix(
164
+ in srgb,
165
+ var(--shell-color-accent) 25%,
166
+ var(--shell-border)
167
+ );
168
+ --banner-padding: 0.55rem 0.85rem;
169
+ --banner-bg: color-mix(in srgb, var(--shell-color-accent) 8%, var(--shell-bg));
170
+ --banner-border: color-mix(in srgb, var(--shell-color-accent) 35%, var(--shell-border));
169
171
  }
170
172
 
171
173
  /* —— база приложения (без захардкоженных цветов) —— */
@@ -104,12 +104,13 @@ body[data-theme="dark"] {
104
104
  --modal-box-shadow: rgba(0, 0, 0, 0.5);
105
105
  --modal-shadow: rgba(0, 0, 0, 0.35);
106
106
  --modal-color: var(--text);
107
- --modal-text: var(--text);
107
+ --modal-text: var(--modal-color);
108
108
  --modal-exit: var(--muted);
109
109
  --modal-disabled: #5c6575;
110
110
  --modal-shade: var(--panel);
111
111
  --modal-tinge: rgba(255, 255, 255, 0.04);
112
112
  --modal-border: var(--line);
113
+ --tinge: var(--modal-tinge);
113
114
 
114
115
  --alert-color: var(--text);
115
116
  --alert-overlay: rgba(0, 0, 0, 0.55);
@@ -124,10 +125,9 @@ body[data-theme="dark"] {
124
125
  --tooltip-fg: #eaeaea;
125
126
  --tooltip-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
126
127
 
127
- --color-text: var(--text);
128
128
  --color-field-focus: var(--field-background);
129
129
 
130
- /* —— @elcrm/components: shell (общие) + узкие avatar —— */
130
+ /* —— @elcrm/components: shell (контракт пакета палитра panel) —— */
131
131
  --shell-color: var(--text);
132
132
  --shell-color-muted: var(--muted);
133
133
  --shell-color-accent: var(--accent);
@@ -104,12 +104,13 @@ body[data-theme="light"] {
104
104
  --modal-box-shadow: rgba(26, 31, 41, 0.18);
105
105
  --modal-shadow: rgba(26, 31, 41, 0.12);
106
106
  --modal-color: var(--text);
107
- --modal-text: var(--text);
107
+ --modal-text: var(--modal-color);
108
108
  --modal-exit: var(--muted);
109
109
  --modal-disabled: #9aa3af;
110
110
  --modal-shade: #f4f6f9;
111
111
  --modal-tinge: rgba(26, 31, 41, 0.04);
112
112
  --modal-border: var(--line);
113
+ --tinge: var(--modal-tinge);
113
114
 
114
115
  --alert-color: var(--text);
115
116
  --alert-overlay: rgba(26, 31, 41, 0.4);
@@ -124,10 +125,9 @@ body[data-theme="light"] {
124
125
  --tooltip-fg: #eaeaea;
125
126
  --tooltip-shadow: 0 8px 24px rgba(26, 31, 41, 0.28);
126
127
 
127
- --color-text: var(--text);
128
128
  --color-field-focus: var(--field-background);
129
129
 
130
- /* —— @elcrm/components: shell (общие) + узкие avatar —— */
130
+ /* —— @elcrm/components: shell (контракт пакета палитра panel) —— */
131
131
  --shell-color: var(--text);
132
132
  --shell-color-muted: var(--muted);
133
133
  --shell-color-accent: var(--accent);
@@ -20,24 +20,6 @@
20
20
  --button-size-s: 14px;
21
21
  --button-size-m: 16px;
22
22
  --button-size-l: 18px;
23
- --button-shadow: none;
24
- --button-shadow-hover: none;
25
- --button-shadow-active: none;
26
- --button-primary-shadow: none;
27
- --button-primary-hover-shadow: none;
28
- --button-primary-active-shadow: none;
29
- --button-secondary-shadow: none;
30
- --button-secondary-hover-shadow: none;
31
- --button-secondary-active-shadow: none;
32
- --button-positive-shadow: none;
33
- --button-positive-hover-shadow: none;
34
- --button-positive-active-shadow: none;
35
- --button-negative-shadow: none;
36
- --button-negative-hover-shadow: none;
37
- --button-negative-active-shadow: none;
38
- --button-ghost-shadow: none;
39
- --button-ghost-hover-shadow: none;
40
- --button-ghost-active-shadow: none;
41
23
 
42
24
  /* —— form / control —— */
43
25
  --control-height: 44px;
@@ -177,6 +159,26 @@
177
159
  --healthmap-l2: color-mix(in srgb, var(--shell-color-success) 45%, transparent);
178
160
  --healthmap-l3: color-mix(in srgb, var(--shell-color-success) 70%, transparent);
179
161
  --healthmap-l4: var(--shell-color-success);
162
+ --table-font-size: 0.9rem;
163
+ --table-cell-padding: 0.55rem 0.7rem;
164
+ --table-head-font-size: 0.75rem;
165
+ --table-code-font-size: 0.8rem;
166
+ --code-block-bg: var(--shell-background);
167
+ --code-block-bar-padding: 0.4rem 0.75rem;
168
+ --code-block-padding: 0.85rem 1rem;
169
+ --code-block-font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
170
+ --code-block-font-size: 0.8rem;
171
+ --code-block-line-height: 1.55;
172
+ --split-handle-size: 6px;
173
+ --split-handle-bg: var(--shell-border);
174
+ --split-handle-bg-hover: color-mix(
175
+ in srgb,
176
+ var(--shell-color-accent) 25%,
177
+ var(--shell-border)
178
+ );
179
+ --banner-padding: 0.55rem 0.85rem;
180
+ --banner-bg: color-mix(in srgb, var(--shell-color-accent) 8%, var(--shell-bg));
181
+ --banner-border: color-mix(in srgb, var(--shell-color-accent) 35%, var(--shell-border));
180
182
  }
181
183
 
182
184
  /* —— база приложения (без захардкоженных цветов) —— */