@weavix/cli 0.4.0 → 0.5.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 (69) hide show
  1. package/README.md +2 -1
  2. package/build/index.js +3113 -1006
  3. package/build/templates/_external/npmrc.template +1 -0
  4. package/build/templates/{_shared/src/styles-360.scss → _external/src/styles.scss} +14 -16
  5. package/build/templates/_internal/npmrc.template +3 -0
  6. package/build/templates/{_shared/src/styles-gravity.scss → _internal/src/styles.scss} +32 -11
  7. package/build/templates/_internal/src/themes/yandex-cloud/_dark-hc.scss +328 -0
  8. package/build/templates/_internal/src/themes/yandex-cloud/_dark.scss +329 -0
  9. package/build/templates/_internal/src/themes/yandex-cloud/_light-hc.scss +321 -0
  10. package/build/templates/_internal/src/themes/yandex-cloud/_light.scss +323 -0
  11. package/build/templates/_internal/src/themes/yandex-cloud.scss +168 -0
  12. package/build/templates/_shared/AGENTS.md +53 -0
  13. package/build/templates/_shared/manifest.schema.json +255 -5
  14. package/build/templates/_shared/package.json +63 -65
  15. package/build/templates/_shared/proxy.ts +111 -0
  16. package/build/templates/_shared/src/main.tsx +2 -6
  17. package/build/templates/_shared/src/themes/yandex-360/_dark-hc.scss +296 -0
  18. package/build/templates/_shared/src/themes/yandex-360/_dark.scss +297 -0
  19. package/build/templates/_shared/src/themes/yandex-360/_light-hc.scss +289 -0
  20. package/build/templates/_shared/src/themes/yandex-360/_light.scss +291 -0
  21. package/build/templates/_shared/src/themes/yandex-360.scss +197 -0
  22. package/build/templates/_shared/src/themes/ys-text.scss +79 -0
  23. package/build/templates/_shared/vite.config.ts +5 -1
  24. package/build/templates/attachment.viewer.action/index.html +1 -1
  25. package/build/templates/attachment.viewer.action/src/App.tsx +14 -24
  26. package/build/templates/board.tab/index.html +14 -0
  27. package/build/templates/board.tab/src/App.tsx +27 -0
  28. package/build/templates/default/src/App.tsx +1 -1
  29. package/build/templates/goal.action/index.html +1 -1
  30. package/build/templates/goal.action/src/App.tsx +4 -16
  31. package/build/templates/goal.block/index.html +14 -0
  32. package/build/templates/goal.block/src/App.tsx +27 -0
  33. package/build/templates/goal.editor.action/index.html +14 -0
  34. package/build/templates/goal.editor.action/src/App.tsx +56 -0
  35. package/build/templates/goal.tab/index.html +14 -0
  36. package/build/templates/goal.tab/src/App.tsx +27 -0
  37. package/build/templates/issue.action/index.html +1 -1
  38. package/build/templates/issue.action/src/App.tsx +6 -13
  39. package/build/templates/issue.block/index.html +1 -1
  40. package/build/templates/issue.block/src/App.tsx +9 -18
  41. package/build/templates/issue.comment.action/src/App.tsx +5 -11
  42. package/build/templates/issue.editor.action/index.html +14 -0
  43. package/build/templates/issue.editor.action/src/App.tsx +56 -0
  44. package/build/templates/issue.tab/src/App.tsx +5 -12
  45. package/build/templates/navigation/src/App.tsx +2 -7
  46. package/build/templates/portfolio.action/index.html +1 -1
  47. package/build/templates/portfolio.action/src/App.tsx +4 -21
  48. package/build/templates/portfolio.block/index.html +14 -0
  49. package/build/templates/portfolio.block/src/App.tsx +27 -0
  50. package/build/templates/portfolio.editor.action/index.html +14 -0
  51. package/build/templates/portfolio.editor.action/src/App.tsx +56 -0
  52. package/build/templates/portfolio.tab/index.html +14 -0
  53. package/build/templates/portfolio.tab/src/App.tsx +27 -0
  54. package/build/templates/project.action/index.html +1 -1
  55. package/build/templates/project.action/src/App.tsx +4 -21
  56. package/build/templates/project.block/index.html +14 -0
  57. package/build/templates/project.block/src/App.tsx +27 -0
  58. package/build/templates/project.editor.action/index.html +14 -0
  59. package/build/templates/project.editor.action/src/App.tsx +56 -0
  60. package/build/templates/project.tab/index.html +14 -0
  61. package/build/templates/project.tab/src/App.tsx +27 -0
  62. package/build/templates/queue.action/index.html +14 -0
  63. package/build/templates/queue.action/src/App.tsx +29 -0
  64. package/build/templates/queue.tab/index.html +14 -0
  65. package/build/templates/queue.tab/src/App.tsx +29 -0
  66. package/build/templates/trigger.action/index.html +1 -1
  67. package/build/templates/trigger.action/src/App.tsx +15 -21
  68. package/package.json +3 -1
  69. package/build/templates/_shared/npmrc.template +0 -2
@@ -1,5 +1,5 @@
1
1
  import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
- import { getField, 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<'issue.action'>();
@@ -8,24 +8,17 @@ const App = () => {
8
8
  return null;
9
9
  }
10
10
 
11
- const summary = getField<string>(slotContext, 'summary', 'Без названия');
12
- const priority = getField<string>(slotContext, 'priority.display', 'Не указан');
13
- const assignee = getField<string>(slotContext, 'assignee.display', 'Не назначен');
14
- const status = getField<string>(slotContext, 'status.display', 'Не указан');
15
-
16
11
  return (
17
12
  <ThemeProvider theme={theme}>
18
- <div style={{ width: '800px', padding: '50px' }}>
13
+ <div>
19
14
  <Card style={{ padding: '20px' }}>
20
15
  <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
21
- Текущий контекст в проде
16
+ Базовый контекст (contextLevel: basic)
22
17
  </Typography>
23
18
  <DefinitionList>
24
- <DefinitionList.Item name="Ключ">{slotContext.key}</DefinitionList.Item>
25
- <DefinitionList.Item name="Приоритет">{priority}</DefinitionList.Item>
26
- <DefinitionList.Item name="Исполнитель">{assignee}</DefinitionList.Item>
27
- <DefinitionList.Item name="Статус">{status}</DefinitionList.Item>
28
- <DefinitionList.Item name="Название">{summary}</DefinitionList.Item>
19
+ <DefinitionList.Item name="Ключ">
20
+ {slotContext.entityId}
21
+ </DefinitionList.Item>
29
22
  </DefinitionList>
30
23
  </Card>
31
24
  </div>
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="description" content="Web site created using vite" />
7
- <title>Issue Under Description Plugin</title>
7
+ <title>Issue Block Plugin</title>
8
8
  </head>
9
9
  <body class="g-root g-root_theme_dark">
10
10
  <noscript>You need to enable JavaScript to run this app.</noscript>
@@ -1,5 +1,5 @@
1
1
  import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
- import { getField, 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<'issue.block'>();
@@ -8,25 +8,16 @@ const App = () => {
8
8
  return null;
9
9
  }
10
10
 
11
- const summary = getField<string>(slotContext, 'summary', 'Без названия');
12
- const priority = getField<string>(slotContext, 'priority.display', 'Не указан');
13
- const assignee = getField<string>(slotContext, 'assignee.display', 'Не назначен');
14
- const status = getField<string>(slotContext, 'status.display', 'Не указан');
15
-
16
11
  return (
17
12
  <ThemeProvider theme={theme}>
18
- <Card style={{ padding: '20px' }}>
19
- <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
20
- Текущий контекст в проде
21
- </Typography>
22
- <DefinitionList>
23
- <DefinitionList.Item name="Ключ">{slotContext.key}</DefinitionList.Item>
24
- <DefinitionList.Item name="Приоритет">{priority}</DefinitionList.Item>
25
- <DefinitionList.Item name="Исполнитель">{assignee}</DefinitionList.Item>
26
- <DefinitionList.Item name="Статус">{status}</DefinitionList.Item>
27
- <DefinitionList.Item name="Название">{summary}</DefinitionList.Item>
28
- </DefinitionList>
29
- </Card>
13
+ <Card style={{ padding: '20px' }}>
14
+ <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
15
+ Базовый контекст (contextLevel: basic)
16
+ </Typography>
17
+ <DefinitionList>
18
+ <DefinitionList.Item name="Ключ">{slotContext.entityId}</DefinitionList.Item>
19
+ </DefinitionList>
20
+ </Card>
30
21
  </ThemeProvider>
31
22
  );
32
23
  };
@@ -1,8 +1,8 @@
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
- const { theme, slotContext } = useTrackerPluginContext<'issue.comment.action'>();
5
+ const { theme, slotContext } = useTrackerPluginContext<'issue.comment.action'>('basic');
6
6
 
7
7
  if (!slotContext) {
8
8
  return null;
@@ -10,19 +10,13 @@ const App = () => {
10
10
 
11
11
  return (
12
12
  <ThemeProvider theme={theme}>
13
- <div style={{ width: '800px', padding: '50px' }}>
13
+ <div>
14
14
  <Card style={{ padding: '20px' }}>
15
15
  <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
16
- Текущий контекст в проде
16
+ Базовый контекст (contextLevel: basic)
17
17
  </Typography>
18
18
  <DefinitionList>
19
- <DefinitionList.Item name="ID">{slotContext.id}</DefinitionList.Item>
20
- <DefinitionList.Item name="Тип">{slotContext.type}</DefinitionList.Item>
21
- <DefinitionList.Item name="Канал">{slotContext.transport}</DefinitionList.Item>
22
- <DefinitionList.Item name="Создан">{slotContext.createdAt}</DefinitionList.Item>
23
- <DefinitionList.Item name="Обновлён">{slotContext.updatedAt ?? '—'}</DefinitionList.Item>
24
- <DefinitionList.Item name="Текст">{slotContext.text}</DefinitionList.Item>
25
- <DefinitionList.Item name="Текст">{slotContext.email}</DefinitionList.Item>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
26
20
  </DefinitionList>
27
21
  </Card>
28
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>Issue 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<'issue.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 { getField, 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<'issue.tab'>();
@@ -8,24 +8,17 @@ const App = () => {
8
8
  return null;
9
9
  }
10
10
 
11
- const summary = getField<string>(slotContext, 'summary', 'Без названия');
12
- const priority = getField<string>(slotContext, 'priority.display', 'Не указан');
13
- const assignee = getField<string>(slotContext, 'assignee.display', 'Не назначен');
14
- const status = getField<string>(slotContext, 'status.display', 'Не указан');
15
-
16
11
  return (
17
12
  <ThemeProvider theme={theme}>
18
13
  <div style={{ padding: '50px' }}>
19
14
  <Card style={{ padding: '20px' }}>
20
15
  <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
21
- Текущий контекст в проде
16
+ Базовый контекст (contextLevel: basic)
22
17
  </Typography>
23
18
  <DefinitionList>
24
- <DefinitionList.Item name="Ключ">{slotContext.key}</DefinitionList.Item>
25
- <DefinitionList.Item name="Приоритет">{priority}</DefinitionList.Item>
26
- <DefinitionList.Item name="Исполнитель">{assignee}</DefinitionList.Item>
27
- <DefinitionList.Item name="Статус">{status}</DefinitionList.Item>
28
- <DefinitionList.Item name="Название">{summary}</DefinitionList.Item>
19
+ <DefinitionList.Item name="Ключ">
20
+ {slotContext.entityId}
21
+ </DefinitionList.Item>
29
22
  </DefinitionList>
30
23
  </Card>
31
24
  </div>
@@ -1,15 +1,10 @@
1
1
  import { ThemeProvider } from '@gravity-ui/uikit';
2
- import { useTrackerPluginContext } from '@yandex-data-ui/tracker-plugin-sdk-react';
3
-
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
4
3
 
5
4
  const App = () => {
6
5
  const { theme } = useTrackerPluginContext<'navigation'>();
7
6
 
8
- return (
9
- <ThemeProvider theme={theme}>
10
- Yout plugin code here
11
- </ThemeProvider>
12
- );
7
+ return <ThemeProvider theme={theme}>Yout plugin code here</ThemeProvider>;
13
8
  };
14
9
 
15
10
  export default App;
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="description" content="Web site created using vite" />
7
- <title>Project Actions Plugin</title>
7
+ <title>Portfolio Action Plugin</title>
8
8
  </head>
9
9
  <body class="g-root g-root_theme_dark">
10
10
  <noscript>You need to enable JavaScript to run this app.</noscript>
@@ -1,5 +1,5 @@
1
1
  import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
- import { getField, 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<'portfolio.action'>();
@@ -8,32 +8,15 @@ const App = () => {
8
8
  return null;
9
9
  }
10
10
 
11
- const summary = getField<string>(slotContext, 'fields.summary.value', 'Без названия');
12
- const description = getField<string>(
13
- slotContext,
14
- 'fields.description.value',
15
- 'Пустое описание',
16
- );
17
- const status = getField<string>(slotContext, 'fields.entityStatus.value', 'Не указан');
18
- const progress = getField<{ total: number; closed: number }>(slotContext, 'progress', {
19
- total: 0,
20
- closed: 0,
21
- });
22
-
23
11
  return (
24
12
  <ThemeProvider theme={theme}>
25
- <div style={{ width: '800px', padding: '50px' }}>
13
+ <div>
26
14
  <Card style={{ padding: '20px' }}>
27
15
  <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
28
- Текущий контекст в проде
16
+ Базовый контекст (contextLevel: basic)
29
17
  </Typography>
30
18
  <DefinitionList>
31
- <DefinitionList.Item name="Название">{summary}</DefinitionList.Item>
32
- <DefinitionList.Item name="Описание">{description}</DefinitionList.Item>
33
- <DefinitionList.Item name="Статус">{status}</DefinitionList.Item>
34
- <DefinitionList.Item name="Прогресс">
35
- {progress?.closed}/{progress?.total}
36
- </DefinitionList.Item>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
37
20
  </DefinitionList>
38
21
  </Card>
39
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>Portfolio Block 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,27 @@
1
+ import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
3
+
4
+ const App = () => {
5
+ const { theme, slotContext } = useTrackerPluginContext<'portfolio.block'>();
6
+
7
+ if (!slotContext) {
8
+ return null;
9
+ }
10
+
11
+ return (
12
+ <ThemeProvider theme={theme}>
13
+ <div>
14
+ <Card style={{ padding: '20px' }}>
15
+ <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
16
+ Базовый контекст (contextLevel: basic)
17
+ </Typography>
18
+ <DefinitionList>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
20
+ </DefinitionList>
21
+ </Card>
22
+ </div>
23
+ </ThemeProvider>
24
+ );
25
+ };
26
+
27
+ export default App;
@@ -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>Portfolio 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<'portfolio.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;
@@ -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>Portfolio Tab 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,27 @@
1
+ import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
3
+
4
+ const App = () => {
5
+ const { theme, slotContext } = useTrackerPluginContext<'portfolio.tab'>();
6
+
7
+ if (!slotContext) {
8
+ return null;
9
+ }
10
+
11
+ return (
12
+ <ThemeProvider theme={theme}>
13
+ <div>
14
+ <Card style={{ padding: '20px' }}>
15
+ <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
16
+ Базовый контекст (contextLevel: basic)
17
+ </Typography>
18
+ <DefinitionList>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
20
+ </DefinitionList>
21
+ </Card>
22
+ </div>
23
+ </ThemeProvider>
24
+ );
25
+ };
26
+
27
+ export default App;
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="description" content="Web site created using vite" />
7
- <title>Project Actions Plugin</title>
7
+ <title>Project Action Plugin</title>
8
8
  </head>
9
9
  <body class="g-root g-root_theme_dark">
10
10
  <noscript>You need to enable JavaScript to run this app.</noscript>
@@ -1,5 +1,5 @@
1
1
  import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
- import { getField, 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<'project.action'>();
@@ -8,32 +8,15 @@ const App = () => {
8
8
  return null;
9
9
  }
10
10
 
11
- const summary = getField<string>(slotContext, 'fields.summary.value', 'Без названия');
12
- const description = getField<string>(
13
- slotContext,
14
- 'fields.description.value',
15
- 'Пустое описание',
16
- );
17
- const status = getField<string>(slotContext, 'fields.entityStatus.value', 'Не указан');
18
- const progress = getField<{ total: number; closed: number }>(slotContext, 'progress', {
19
- total: 0,
20
- closed: 0,
21
- });
22
-
23
11
  return (
24
12
  <ThemeProvider theme={theme}>
25
- <div style={{ width: '800px', padding: '50px' }}>
13
+ <div>
26
14
  <Card style={{ padding: '20px' }}>
27
15
  <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
28
- Текущий контекст в проде
16
+ Базовый контекст (contextLevel: basic)
29
17
  </Typography>
30
18
  <DefinitionList>
31
- <DefinitionList.Item name="Название">{summary}</DefinitionList.Item>
32
- <DefinitionList.Item name="Описание">{description}</DefinitionList.Item>
33
- <DefinitionList.Item name="Статус">{status}</DefinitionList.Item>
34
- <DefinitionList.Item name="Прогресс">
35
- {progress?.closed}/{progress?.total}
36
- </DefinitionList.Item>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
37
20
  </DefinitionList>
38
21
  </Card>
39
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>Project Block 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,27 @@
1
+ import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
2
+ import { useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
3
+
4
+ const App = () => {
5
+ const { theme, slotContext } = useTrackerPluginContext<'project.block'>();
6
+
7
+ if (!slotContext) {
8
+ return null;
9
+ }
10
+
11
+ return (
12
+ <ThemeProvider theme={theme}>
13
+ <div>
14
+ <Card style={{ padding: '20px' }}>
15
+ <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
16
+ Базовый контекст (contextLevel: basic)
17
+ </Typography>
18
+ <DefinitionList>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
20
+ </DefinitionList>
21
+ </Card>
22
+ </div>
23
+ </ThemeProvider>
24
+ );
25
+ };
26
+
27
+ export default App;
@@ -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>Project 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<'project.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;