@weavix/cli 0.5.0 → 0.6.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 (44) hide show
  1. package/README.md +2 -1
  2. package/build/index.js +2404 -1050
  3. package/build/templates/_external/npmrc.template +1 -0
  4. package/build/templates/_external/src/styles.scss +14 -15
  5. package/build/templates/_internal/npmrc.template +3 -0
  6. package/build/templates/_internal/src/styles.scss +32 -12
  7. package/build/templates/_shared/AGENTS.md +53 -0
  8. package/build/templates/_shared/manifest.schema.json +72 -2
  9. package/build/templates/_shared/package.json +4 -5
  10. package/build/templates/_shared/proxy.ts +111 -0
  11. package/build/templates/_shared/src/main.tsx +1 -1
  12. package/build/templates/_shared/vite.config.ts +3 -1
  13. package/build/templates/attachment.viewer.action/src/App.tsx +1 -5
  14. package/build/templates/board.tab/src/App.tsx +1 -1
  15. package/build/templates/default/src/App.tsx +1 -1
  16. package/build/templates/goal.action/src/App.tsx +2 -2
  17. package/build/templates/goal.block/src/App.tsx +2 -2
  18. package/build/templates/goal.editor.action/index.html +14 -0
  19. package/build/templates/goal.editor.action/src/App.tsx +56 -0
  20. package/build/templates/goal.tab/src/App.tsx +2 -2
  21. package/build/templates/issue.action/src/App.tsx +4 -2
  22. package/build/templates/issue.block/src/App.tsx +2 -2
  23. package/build/templates/issue.comment.action/src/App.tsx +3 -3
  24. package/build/templates/issue.editor.action/index.html +14 -0
  25. package/build/templates/issue.editor.action/src/App.tsx +56 -0
  26. package/build/templates/issue.tab/src/App.tsx +4 -2
  27. package/build/templates/navigation/src/App.tsx +2 -7
  28. package/build/templates/portfolio.action/src/App.tsx +2 -2
  29. package/build/templates/portfolio.block/src/App.tsx +2 -2
  30. package/build/templates/portfolio.editor.action/index.html +14 -0
  31. package/build/templates/portfolio.editor.action/src/App.tsx +56 -0
  32. package/build/templates/portfolio.tab/src/App.tsx +2 -2
  33. package/build/templates/project.action/src/App.tsx +2 -2
  34. package/build/templates/project.block/src/App.tsx +2 -2
  35. package/build/templates/project.editor.action/index.html +14 -0
  36. package/build/templates/project.editor.action/src/App.tsx +56 -0
  37. package/build/templates/project.tab/src/App.tsx +2 -2
  38. package/build/templates/queue.action/index.html +14 -0
  39. package/build/templates/queue.action/src/App.tsx +29 -0
  40. package/build/templates/queue.tab/index.html +14 -0
  41. package/build/templates/queue.tab/src/App.tsx +29 -0
  42. package/build/templates/trigger.action/src/App.tsx +15 -21
  43. package/package.json +2 -1
  44. package/build/templates/_shared/npmrc.template +0 -2
@@ -0,0 +1 @@
1
+ registry=https://registry.npmjs.org
@@ -1,14 +1,15 @@
1
- @import './reset.css';
1
+ @use './reset.css';
2
2
 
3
- @import '@gravity-ui/uikit/styles/fonts.css';
4
- @import '@gravity-ui/uikit/styles/styles.css';
5
- @import './themes/ys-text.scss';
6
- @import './themes/yandex-360.scss';
3
+ @use '@gravity-ui/uikit/styles/fonts.css';
4
+ @use '@gravity-ui/uikit/styles/styles.css';
5
+ @use './themes/ys-text.scss';
6
+ @use './themes/yandex-360.scss';
7
7
 
8
8
  @font-face {
9
9
  font-family: 'YS Text Wide 110';
10
- src: url('../public/fonts/ys-text-display-wide-110.woff2') format('woff2'),
11
- url('../public/fonts/ys-text-display-wide-110.woff') format('woff');
10
+ src:
11
+ url('../public/fonts/ys-text-display-wide-110.woff2') format('woff2'),
12
+ url('../public/fonts/ys-text-display-wide-110.woff') format('woff');
12
13
  font-weight: 500;
13
14
  font-style: normal;
14
15
  }
@@ -19,8 +20,10 @@
19
20
  'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Ubuntu Mono', 'DejaVu Sans Mono',
20
21
  'Courier New', 'Courier', monospace;
21
22
 
22
- --g-text-header-font-family: 'YS Text Wide 110', 'Helvetica Neue', 'Arial', 'Helvetica', sans-serif;
23
- --g-text-subheader-font-family: 'YS Text Wide 110', 'Helvetica Neue', 'Arial', 'Helvetica', sans-serif;
23
+ --g-text-header-font-family:
24
+ 'YS Text Wide 110', 'Helvetica Neue', 'Arial', 'Helvetica', sans-serif;
25
+ --g-text-subheader-font-family:
26
+ 'YS Text Wide 110', 'Helvetica Neue', 'Arial', 'Helvetica', sans-serif;
24
27
 
25
28
  --g-text-header-font-weight: 500;
26
29
  --g-text-subheader-font-weight: 500;
@@ -54,9 +57,8 @@
54
57
  --g-text-subheader-3-font-size: 16px;
55
58
  --g-text-subheader-3-line-height: 24px;
56
59
 
57
- --g-text-subheader-3-font: 700
58
- var(--g-text-subheader-3-font-size) / var(--g-text-subheader-3-font-size)
59
- var(--g-text-subheader-font-family);
60
+ --g-text-subheader-3-font: 700 var(--g-text-subheader-3-font-size) /
61
+ var(--g-text-subheader-3-font-size) var(--g-text-subheader-font-family);
60
62
 
61
63
  --g-border-radius-xs: 1000px;
62
64
  --g-border-radius-s: 8px;
@@ -64,14 +66,11 @@
64
66
  --g-border-radius-l: 12px;
65
67
  --g-border-radius-xl: 16px;
66
68
  --g-border-radius-2xl: 24px;
67
-
68
-
69
69
  }
70
70
 
71
71
  .g-root_theme_light,
72
72
  .g-root_theme_light-hc {
73
73
  --orb-elevation-sunken: rgb(237, 239, 240);
74
-
75
74
  }
76
75
 
77
76
  .g-root_theme_dark,
@@ -0,0 +1,3 @@
1
+ registry=https://registry.npmjs.com
2
+ @yandex-weavix:registry=https://npm.yandex-team.ru
3
+ @yandex-data-ui:registry=https://npm.yandex-team.ru
@@ -1,10 +1,10 @@
1
- @import './reset.css';
1
+ @use './reset.css';
2
2
 
3
- @import '@gravity-ui/uikit/styles/fonts.css';
4
- @import '@gravity-ui/uikit/styles/styles.css';
5
- @import './themes/ys-text.scss';
6
- @import './themes/yandex-cloud.scss';
7
- // @import './themes/yandex-360.scss';
3
+ @use '@gravity-ui/uikit/styles/fonts.css';
4
+ @use '@gravity-ui/uikit/styles/styles.css';
5
+ @use './themes/ys-text.scss';
6
+ @use './themes/yandex-cloud.scss';
7
+ // @use './themes/yandex-360.scss';
8
8
 
9
9
  :root {
10
10
  /* Высота шапки */
@@ -147,7 +147,7 @@ body {
147
147
  }
148
148
 
149
149
  body.g-root {
150
- background-color: var(--g-color-base-generic-ultralight);
150
+ background-color: var(--g-color-base-background);
151
151
  }
152
152
 
153
153
  .g-button_view_flat-secondary.g-button_disabled:not(.g-button_loading)::before,
@@ -223,18 +223,38 @@ body.g-root {
223
223
  --g-color-text-light-primary: rgba(255, 255, 255, 0.9); // --g-color-private-white-900
224
224
 
225
225
  --g-color-text-complementary: var(--g-color-private-white-700);
226
- --g-color-text-light-complementary: rgba(255, 255, 255, 0.9); // var(--g-color-private-white-750);
226
+ --g-color-text-light-complementary: rgba(
227
+ 255,
228
+ 255,
229
+ 255,
230
+ 0.9
231
+ ); // var(--g-color-private-white-750);
227
232
 
228
233
  --g-color-text-secondary: var(--g-color-text-light-secondary);
229
234
  --g-color-text-light-secondary: rgba(255, 255, 255, 0.55); // var(--g-color-private-white-550);
230
235
 
231
236
  // Семантический цвет текста в лейблах:
232
237
  --g-color-text-info-heavy: rgba(145, 179, 255, 1); // var(--g-color-private-blue-700-solid);
233
- --g-color-text-positive-heavy: rgba(124, 196, 121, 1); // var(--g-color-private-green-650-solid);
238
+ --g-color-text-positive-heavy: rgba(
239
+ 124,
240
+ 196,
241
+ 121,
242
+ 1
243
+ ); // var(--g-color-private-green-650-solid);
234
244
  --g-color-text-warning-heavy: rgba(255, 203, 0, 1); // var(--g-color-private-yellow-550-solid);
235
245
  --g-color-text-danger-heavy: rgba(239, 127, 125, 1); // var(--g-color-private-red-700-solid);
236
- --g-color-text-utility-heavy: rgba(236, 129, 248, 1); // var(--g-color-private-purple-750-solid);
237
- --g-color-text-misc-heavy: rgba(160, 179, 195, 1); // var(--g-color-private-cool-grey-750-solid);
246
+ --g-color-text-utility-heavy: rgba(
247
+ 236,
248
+ 129,
249
+ 248,
250
+ 1
251
+ ); // var(--g-color-private-purple-750-solid);
252
+ --g-color-text-misc-heavy: rgba(
253
+ 160,
254
+ 179,
255
+ 195,
256
+ 1
257
+ ); // var(--g-color-private-cool-grey-750-solid);
238
258
 
239
259
  // lines
240
260
  --g-color-line-generic: rgba(255, 255, 255, 0.25); // var(--g-color-private-white-250);
@@ -247,4 +267,4 @@ body.g-root {
247
267
  --g-color-text-secondary: var(--g-color-text-dark-secondary);
248
268
  --g-color-text-dark-secondary: rgba(0, 0, 0, 0.55); // var(--g-color-private-black-550);
249
269
  --g-color-line-generic: rgba(0, 0, 0, 0.15); // var(--g-color-private-black-150);
250
- }
270
+ }
@@ -0,0 +1,53 @@
1
+ # AGENTS.md
2
+
3
+ ## SDK
4
+
5
+ Этот плагин использует `@weavix/tracker-plugin-sdk-react` для взаимодействия с Tracker API.
6
+
7
+ Внутри пакета есть подробная документация для ИИ-агентов:
8
+
9
+ - `node_modules/@weavix/tracker-plugin-sdk-react/AGENTS.md` — точка входа: импорты, правила, ссылки на рецепты
10
+ - `node_modules/@weavix/tracker-plugin-sdk-react/API_REFERENCE.md` — Provider, хуки, типы
11
+ - `node_modules/@weavix/tracker-plugin-sdk-react/README.md` — быстрый старт
12
+
13
+ **Перед написанием кода, работающего с Tracker API, прочитай AGENTS.md пакета.**
14
+
15
+ **Категорически запрещено изменять следующие файлы:**
16
+
17
+ - [`vite.config.ts`](vite.config.ts) — конфигурация Vite
18
+ - [`proxy.ts`](proxy.ts) — настройки прокси
19
+
20
+ Эти файлы эмулируют рабочую среду. Любые изменения в них приведут к некорректной работе тестовой среды и могут сломать интеграцию.
21
+
22
+ ### Используй компоненты Tracker
23
+
24
+ Для разработки плагина используй библиотеку компонентов Tracker: `@weavix/tracker-components`
25
+
26
+ В этой библиотеке содержатся нативные компоненты Tracker, которые обеспечат единый стиль и поведение с основным интерфейсом.
27
+
28
+ При запросе данных для компонентов библиотеки необходимы соответствующие уровни доступа. Прочитай необходимые разрешения в README.md компонента и при необходимости обнови permissions в manifest.json.
29
+
30
+ ## Декомпозиция на компоненты
31
+
32
+ **Не создавай большие монолитные файлы.** Каждый компонент, хук или утилита должны находиться в отдельном файле.
33
+
34
+ ### Правила декомпозиции
35
+
36
+ - **Один файл — одна ответственность.** Если файл превышает ~150 строк, это сигнал к декомпозиции.
37
+ - **Выноси компоненты в отдельные файлы.** Каждый React-компонент — отдельный файл в папке `src/components/`.
38
+ - **Выноси хуки в отдельные файлы.** Каждый кастомный хук — отдельный файл в папке `src/hooks/`.
39
+ - **Выноси утилиты в отдельные файлы.** Вспомогательные функции — в папку `src/utils/`.
40
+ - **Выноси типы в отдельные файлы.** Общие типы и интерфейсы — в `src/types/` или рядом с компонентом в `ComponentName.types.ts`.
41
+
42
+ ## Безопасность данных
43
+
44
+ **Категорически запрещено сохранять чувствительную информацию в `storageApi` и `localStorage`.**
45
+
46
+ К чувствительной информации относятся:
47
+
48
+ - токены авторизации и API-ключи
49
+ - пароли и секреты
50
+ - персональные данные пользователей (email, телефон, паспортные данные и т.п.)
51
+ - любые данные, утечка которых может нанести вред пользователю или системе
52
+
53
+ Для хранения чувствительных данных используй безопасные механизмы (например, серверную сторону или защищённое хранилище), но не браузерные хранилища (`localStorage`, `sessionStorage`, `storageApi`).
@@ -33,7 +33,8 @@
33
33
  "items": {
34
34
  "type": "string",
35
35
  "enum": [
36
- "tracker"
36
+ "tracker",
37
+ "messenger"
37
38
  ]
38
39
  },
39
40
  "minItems": 1,
@@ -261,7 +262,12 @@
261
262
  "items": {
262
263
  "type": "string",
263
264
  "enum": [
264
- "clipboard-write"
265
+ "clipboard-write",
266
+ "microphone",
267
+ "camera",
268
+ "geolocation",
269
+ "web-share",
270
+ "allow-downloads"
265
271
  ]
266
272
  },
267
273
  "uniqueItems": true
@@ -319,6 +325,30 @@
319
325
  "$ref": "#/definitions/SlotConfig"
320
326
  }
321
327
  },
328
+ "issue.editor.action": {
329
+ "type": "array",
330
+ "description": "Issue Editor Action slot configurations",
331
+ "minItems": 1,
332
+ "items": {
333
+ "$ref": "#/definitions/SlotConfig"
334
+ }
335
+ },
336
+ "queue.action": {
337
+ "type": "array",
338
+ "description": "Queue Action slot configurations",
339
+ "minItems": 1,
340
+ "items": {
341
+ "$ref": "#/definitions/SlotConfig"
342
+ }
343
+ },
344
+ "queue.tab": {
345
+ "type": "array",
346
+ "description": "Queue Tab slot configurations",
347
+ "minItems": 1,
348
+ "items": {
349
+ "$ref": "#/definitions/SlotConfig"
350
+ }
351
+ },
322
352
  "navigation": {
323
353
  "type": "array",
324
354
  "description": "Navigation slot configurations",
@@ -367,6 +397,14 @@
367
397
  "$ref": "#/definitions/SlotConfig"
368
398
  }
369
399
  },
400
+ "project.editor.action": {
401
+ "type": "array",
402
+ "description": "Project Editor Action slot configurations",
403
+ "minItems": 1,
404
+ "items": {
405
+ "$ref": "#/definitions/SlotConfig"
406
+ }
407
+ },
370
408
  "portfolio.action": {
371
409
  "type": "array",
372
410
  "description": "Portfolio Action slot configurations",
@@ -391,6 +429,14 @@
391
429
  "$ref": "#/definitions/SlotConfig"
392
430
  }
393
431
  },
432
+ "portfolio.editor.action": {
433
+ "type": "array",
434
+ "description": "Portfolio Editor Action slot configurations",
435
+ "minItems": 1,
436
+ "items": {
437
+ "$ref": "#/definitions/SlotConfig"
438
+ }
439
+ },
394
440
  "goal.action": {
395
441
  "type": "array",
396
442
  "description": "Goal Action slot configurations",
@@ -415,6 +461,14 @@
415
461
  "$ref": "#/definitions/SlotConfig"
416
462
  }
417
463
  },
464
+ "goal.editor.action": {
465
+ "type": "array",
466
+ "description": "Goal Editor Action slot configurations",
467
+ "minItems": 1,
468
+ "items": {
469
+ "$ref": "#/definitions/SlotConfig"
470
+ }
471
+ },
418
472
  "attachment.viewer.action": {
419
473
  "type": "array",
420
474
  "description": "Attachment Viewer Action slot configurations",
@@ -441,6 +495,22 @@
441
495
  }
442
496
  },
443
497
  "additionalProperties": false
498
+ },
499
+ "messenger": {
500
+ "type": "object",
501
+ "description": "Messenger service slots",
502
+ "minProperties": 1,
503
+ "properties": {
504
+ "user.card.info": {
505
+ "type": "array",
506
+ "description": "User Card Info slot configurations",
507
+ "minItems": 1,
508
+ "items": {
509
+ "$ref": "#/definitions/SlotConfig"
510
+ }
511
+ }
512
+ },
513
+ "additionalProperties": false
444
514
  }
445
515
  },
446
516
  "additionalProperties": false
@@ -16,7 +16,7 @@
16
16
  "node": ">=18"
17
17
  },
18
18
  "scripts": {
19
- "dev": "node node_modules/vite/bin/vite.js",
19
+ "dev": "node node_modules/vite/bin/vite.js --logLevel silent",
20
20
  "build": "tsc && node node_modules/vite/bin/vite.js build",
21
21
  "lint:js": "eslint --ext .js,.jsx,.ts,.tsx .",
22
22
  "lint:styles": "stylelint '{styles,src}/**/*.{css,scss}' --allow-empty-input",
@@ -26,9 +26,9 @@
26
26
  "dependencies": {
27
27
  "@gravity-ui/icons": "2.18.0",
28
28
  "@gravity-ui/uikit": "7.37.0",
29
- "@weavix/tracker-plugin-sdk-react": "0.0.1",
30
- "@weavix/tracker-api-types": "0.0.2",
31
- "bem-cn-lite": "4.1.0",
29
+ "@weavix/tracker-plugin-sdk-react": "latest",
30
+ "@weavix/tracker-components": "latest",
31
+ "@weavix/tracker-api-types": "latest",
32
32
  "react": "18.3.1",
33
33
  "react-dom": "18.3.1"
34
34
  },
@@ -42,7 +42,6 @@
42
42
  "@types/react": "18.2.37",
43
43
  "@types/react-dom": "18.2.15",
44
44
  "@vitejs/plugin-react": "6.0.1",
45
- "axios": "1.15.0",
46
45
  "eslint": "9.24.0",
47
46
  "husky": "9.1.7",
48
47
  "sass": "1.99.0",
@@ -0,0 +1,111 @@
1
+ import type { IncomingMessage, ServerResponse } from 'http';
2
+ import http from 'http';
3
+ import https from 'https';
4
+
5
+ import type { Plugin } from 'vite';
6
+
7
+ const CORS_HEADERS = {
8
+ 'Access-Control-Allow-Origin': '*',
9
+ 'Access-Control-Allow-Methods': 'POST, OPTIONS',
10
+ 'Access-Control-Allow-Headers': 'Content-Type',
11
+ };
12
+
13
+ export function proxyPlugin(): Plugin {
14
+ return {
15
+ name: 'dev-proxy',
16
+ apply: 'serve',
17
+ configureServer(server) {
18
+ server.middlewares.use(
19
+ (req: IncomingMessage, res: ServerResponse, next: () => void) => {
20
+ if (req.url === '/proxy' && req.method === 'OPTIONS') {
21
+ res.writeHead(204, CORS_HEADERS);
22
+ res.end();
23
+ return;
24
+ }
25
+
26
+ if (req.url === '/proxy' && req.method === 'POST') {
27
+ let rawBody = '';
28
+ req.on('data', (chunk: Buffer) => {
29
+ rawBody += chunk.toString();
30
+ });
31
+ req.on('end', () => {
32
+ let parsed: {
33
+ url: string;
34
+ method?: string;
35
+ headers?: Record<string, string>;
36
+ body?: string;
37
+ };
38
+ try {
39
+ parsed = JSON.parse(rawBody);
40
+ } catch {
41
+ res.writeHead(400, CORS_HEADERS);
42
+ res.end(JSON.stringify({ error: 'Invalid JSON body' }));
43
+ return;
44
+ }
45
+
46
+ const { url, method = 'GET', headers = {}, body } = parsed;
47
+
48
+ if (!url) {
49
+ res.writeHead(400, CORS_HEADERS);
50
+ res.end(JSON.stringify({ error: 'Missing "url" field' }));
51
+ return;
52
+ }
53
+
54
+ let targetUrl: URL;
55
+ try {
56
+ targetUrl = new URL(url);
57
+ } catch {
58
+ res.writeHead(400, CORS_HEADERS);
59
+ res.end(JSON.stringify({ error: 'Invalid URL' }));
60
+ return;
61
+ }
62
+
63
+ const isHttps = targetUrl.protocol === 'https:';
64
+ const transport = isHttps ? https : http;
65
+ const bodyBuffer = body ? Buffer.from(body) : undefined;
66
+
67
+ const options: http.RequestOptions = {
68
+ hostname: targetUrl.hostname,
69
+ port: targetUrl.port || (isHttps ? 443 : 80),
70
+ path: targetUrl.pathname + targetUrl.search,
71
+ method: method.toUpperCase(),
72
+ headers: {
73
+ ...headers,
74
+ ...(bodyBuffer
75
+ ? { 'Content-Length': String(bodyBuffer.length) }
76
+ : {}),
77
+ },
78
+ };
79
+
80
+ const proxyReq = transport.request(options, (proxyRes) => {
81
+ const responseHeaders: Record<string, string | string[]> = {
82
+ ...CORS_HEADERS,
83
+ };
84
+ for (const [key, value] of Object.entries(proxyRes.headers)) {
85
+ if (value !== undefined) {
86
+ responseHeaders[key] = value;
87
+ }
88
+ }
89
+ res.writeHead(proxyRes.statusCode ?? 200, responseHeaders);
90
+ proxyRes.pipe(res);
91
+ });
92
+
93
+ proxyReq.on('error', (err: Error) => {
94
+ res.writeHead(502, CORS_HEADERS);
95
+ res.end(JSON.stringify({ error: err.message }));
96
+ });
97
+
98
+ if (bodyBuffer) {
99
+ proxyReq.write(bodyBuffer);
100
+ }
101
+ proxyReq.end();
102
+ });
103
+ return;
104
+ }
105
+
106
+ next();
107
+ },
108
+ );
109
+ },
110
+ };
111
+ }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { TrackerPluginProvider } from '@yandex-data-ui/tracker-plugin-sdk-react';
3
+ import { TrackerPluginProvider } from '@weavix/tracker-plugin-sdk-react';
4
4
  import ReactDOM from 'react-dom/client';
5
5
 
6
6
  import App from './App';
@@ -7,6 +7,7 @@ import react from '@vitejs/plugin-react';
7
7
  import type { ViteDevServer } from 'vite';
8
8
  import { defineConfig } from 'vite';
9
9
  import svgr from 'vite-plugin-svgr';
10
+ import { proxyPlugin } from './proxy';
10
11
 
11
12
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
13
 
@@ -22,7 +23,7 @@ export default defineConfig(() => {
22
23
  'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
23
24
  'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
24
25
  'Content-Security-Policy':
25
- "default-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self';style-src 'self' 'unsafe-inline';",
26
+ "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src data: blob: *; font-src 'self' data:; media-src 'self' blob:; connect-src 'self'; form-action 'self'; frame-src 'none'; base-uri 'none'; object-src 'none'; worker-src 'self' blob:; manifest-src 'none'",
26
27
  },
27
28
  },
28
29
  plugins: [
@@ -50,6 +51,7 @@ export default defineConfig(() => {
50
51
  );
51
52
  },
52
53
  },
54
+ proxyPlugin(),
53
55
  ],
54
56
  build: {
55
57
  sourcemap: true,
@@ -1,11 +1,7 @@
1
1
  import { useCallback } from 'react';
2
2
 
3
3
  import { Button, Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
4
- import {
5
- hostApi,
6
- trackerApi,
7
- useTrackerPluginContext,
8
- } from '@yandex-data-ui/tracker-plugin-sdk-react';
4
+ import { hostApi, trackerApi, useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
9
5
 
10
6
  const App = () => {
11
7
  const { theme, slotContext } = useTrackerPluginContext<'attachment.viewer.action'>();
@@ -1,5 +1,5 @@
1
1
  import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
- import { useTrackerPluginContext } from '@yandex-data-ui/tracker-plugin-sdk-react';
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
3
3
 
4
4
  const App = () => {
5
5
  const { theme, slotContext } = useTrackerPluginContext<'board.tab'>();
@@ -1,5 +1,5 @@
1
1
  import { ThemeProvider } from '@gravity-ui/uikit';
2
- import { useTrackerPluginContext } from '@yandex-data-ui/tracker-plugin-sdk-react';
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
3
3
 
4
4
  const App = () => {
5
5
  const { theme } = useTrackerPluginContext();
@@ -1,5 +1,5 @@
1
1
  import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
- import { useTrackerPluginContext } from '@yandex-data-ui/tracker-plugin-sdk-react';
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
3
3
 
4
4
  const App = () => {
5
5
  const { theme, slotContext } = useTrackerPluginContext<'goal.action'>();
@@ -16,7 +16,7 @@ const App = () => {
16
16
  Базовый контекст (contextLevel: basic)
17
17
  </Typography>
18
18
  <DefinitionList>
19
- <DefinitionList.Item name="ID">{slotContext.id}</DefinitionList.Item>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
20
20
  </DefinitionList>
21
21
  </Card>
22
22
  </div>
@@ -1,5 +1,5 @@
1
1
  import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
- import { useTrackerPluginContext } from '@yandex-data-ui/tracker-plugin-sdk-react';
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
3
3
 
4
4
  const App = () => {
5
5
  const { theme, slotContext } = useTrackerPluginContext<'goal.block'>();
@@ -16,7 +16,7 @@ const App = () => {
16
16
  Базовый контекст (contextLevel: basic)
17
17
  </Typography>
18
18
  <DefinitionList>
19
- <DefinitionList.Item name="ID">{slotContext.id}</DefinitionList.Item>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
20
20
  </DefinitionList>
21
21
  </Card>
22
22
  </div>
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="description" content="Web site created using vite" />
7
+ <title>Goal Editor Action Plugin</title>
8
+ </head>
9
+ <body class="g-root g-root_theme_dark">
10
+ <noscript>You need to enable JavaScript to run this app.</noscript>
11
+ <div id="root"></div>
12
+ <script type="module" src="/src/main.tsx"></script>
13
+ </body>
14
+ </html>
@@ -0,0 +1,56 @@
1
+ import { useCallback, useState } from 'react';
2
+
3
+ import {
4
+ Button,
5
+ Card,
6
+ DefinitionList,
7
+ TextArea,
8
+ ThemeProvider,
9
+ Text as Typography,
10
+ } from '@gravity-ui/uikit';
11
+ import { hostApi, useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
12
+
13
+ const App = () => {
14
+ const { theme, slotContext } = useTrackerPluginContext<'goal.editor.action'>('basic');
15
+ const [text, setText] = useState('');
16
+
17
+ const handleInsert = useCallback(() => {
18
+ hostApi.close({ text });
19
+ }, [text]);
20
+
21
+ if (!slotContext) {
22
+ return null;
23
+ }
24
+
25
+ return (
26
+ <ThemeProvider theme={theme}>
27
+ <div style={{ padding: '16px', display: 'flex', flexDirection: 'column', gap: '16px' }}>
28
+ <Card style={{ padding: '16px' }}>
29
+ <Typography variant="header-1" as="div" style={{ marginBottom: '12px' }}>
30
+ Контекст цели
31
+ </Typography>
32
+ <DefinitionList>
33
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
34
+ </DefinitionList>
35
+ </Card>
36
+ <Card style={{ padding: '16px' }}>
37
+ <Typography variant="header-1" as="div" style={{ marginBottom: '12px' }}>
38
+ Вставить текст в редактор
39
+ </Typography>
40
+ <TextArea
41
+ value={text}
42
+ onUpdate={setText}
43
+ placeholder="Введите текст для вставки в редактор..."
44
+ minRows={4}
45
+ style={{ marginBottom: '12px' }}
46
+ />
47
+ <Button view="action" onClick={handleInsert} disabled={!text}>
48
+ Вставить
49
+ </Button>
50
+ </Card>
51
+ </div>
52
+ </ThemeProvider>
53
+ );
54
+ };
55
+
56
+ export default App;
@@ -1,5 +1,5 @@
1
1
  import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
- import { useTrackerPluginContext } from '@yandex-data-ui/tracker-plugin-sdk-react';
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
3
3
 
4
4
  const App = () => {
5
5
  const { theme, slotContext } = useTrackerPluginContext<'goal.tab'>();
@@ -16,7 +16,7 @@ const App = () => {
16
16
  Базовый контекст (contextLevel: basic)
17
17
  </Typography>
18
18
  <DefinitionList>
19
- <DefinitionList.Item name="ID">{slotContext.id}</DefinitionList.Item>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
20
20
  </DefinitionList>
21
21
  </Card>
22
22
  </div>