@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
@@ -0,0 +1,197 @@
1
+ @use './yandex-360/light' as *;
2
+ @use './yandex-360/light-hc' as *;
3
+ @use './yandex-360/dark' as *;
4
+ @use './yandex-360/dark-hc' as *;
5
+
6
+ @mixin ya-360-colors-light {
7
+ @include ya-360-colors-private-light;
8
+
9
+ --g-color-base-background: rgb(255, 255, 255);
10
+ --g-color-base-brand: var(--g-color-private-blue-550-solid);
11
+ --g-color-base-brand-hover: var(--g-color-private-blue-600-solid);
12
+ --g-color-base-selection: var(--g-color-private-blue-100);
13
+ --g-color-base-selection-hover: var(--g-color-private-blue-200);
14
+ --g-color-line-brand: var(--g-color-private-blue-550-solid);
15
+ --g-color-text-brand: var(--g-color-private-blue-600-solid);
16
+ --g-color-text-brand-heavy: var(--g-color-private-blue-700-solid);
17
+ --g-color-text-brand-contrast: var(--g-color-text-light-primary);
18
+ --g-color-text-link: var(--g-color-private-blue-600-solid);
19
+ --g-color-text-link-hover: var(--g-color-private-blue-800-solid);
20
+
21
+ --gn-aside-header-decoration-collapsed-background-color: var(--g-color-private-blue-100);
22
+ --gn-aside-header-decoration-expanded-background-color: var(--g-color-private-blue-100);
23
+ --gn-aside-header-item-background-color-hover: var(--g-color-private-black-50);
24
+ --gn-aside-header-item-current-background-color: var(--g-color-private-blue-100);
25
+
26
+ --gil-color-object-base: var(--g-color-private-blue-550-solid);
27
+ --gil-color-object-accent-heavy: var(--g-color-private-blue-750-solid);
28
+ --gil-color-object-hightlight: var(--g-color-private-blue-350-solid);
29
+ --gil-color-shadow-over-object: var(--g-color-private-blue-700-solid);
30
+ --gil-color-background-lines: var(--g-color-private-black-450-solid);
31
+ --gil-color-background-shapes: var(--g-color-private-black-50-solid);
32
+ --gil-color-object-accent-light: var(--g-color-private-white-1000-solid);
33
+ --gil-color-object-danger: var(--g-color-private-red-550-solid);
34
+ }
35
+
36
+ @mixin ya-360-colors-light-hc {
37
+ @include ya-360-colors-private-light-hc;
38
+
39
+ --g-color-base-background: rgb(255, 255, 255);
40
+ --g-color-base-brand: var(--g-color-private-blue-600-solid);
41
+ --g-color-base-brand-hover: var(--g-color-private-blue-800-solid);
42
+ --g-color-base-selection: var(--g-color-private-blue-250);
43
+ --g-color-base-selection-hover: var(--g-color-private-blue-350);
44
+ --g-color-line-brand: var(--g-color-private-blue-600-solid);
45
+ --g-color-text-brand: var(--g-color-private-blue-650-solid);
46
+ --g-color-text-brand-heavy: var(--g-color-private-blue-900-solid);
47
+ --g-color-text-brand-contrast: var(--g-color-text-light-primary);
48
+ --g-color-text-link: var(--g-color-private-blue-650-solid);
49
+ --g-color-text-link-hover: var(--g-color-private-blue-850-solid);
50
+
51
+ --gn-aside-header-decoration-collapsed-background-color: var(--g-color-private-blue-250);
52
+ --gn-aside-header-decoration-expanded-background-color: var(--g-color-private-blue-250);
53
+ --gn-aside-header-item-current-background-color: var(--g-color-private-blue-250);
54
+ --gn-aside-header-item-background-color-hover: var(--g-color-private-black-150);
55
+
56
+ --gil-color-object-base: var(--g-color-private-blue-550-solid);
57
+ --gil-color-object-accent-heavy: var(--g-color-private-blue-750-solid);
58
+ --gil-color-object-hightlight: var(--g-color-private-blue-350-solid);
59
+ --gil-color-shadow-over-object: var(--g-color-private-blue-700-solid);
60
+ --gil-color-background-lines: var(--g-color-private-black-450-solid);
61
+ --gil-color-background-shapes: var(--g-color-private-black-50-solid);
62
+ --gil-color-object-accent-light: var(--g-color-private-white-1000-solid);
63
+ --gil-color-object-danger: var(--g-color-private-red-550-solid);
64
+ }
65
+
66
+ @mixin ya-360-colors-dark {
67
+ @include ya-360-colors-private-dark;
68
+
69
+ --g-color-base-background: rgb(45, 44, 51);
70
+ --g-color-base-brand: var(--g-color-private-blue-450-solid);
71
+ --g-color-base-brand-hover: var(--g-color-private-blue-600-solid);
72
+ --g-color-base-selection: var(--g-color-private-blue-150);
73
+ --g-color-base-selection-hover: var(--g-color-private-blue-200);
74
+ --g-color-line-brand: var(--g-color-private-blue-550-solid);
75
+ --g-color-text-brand: var(--g-color-private-blue-550-solid);
76
+ --g-color-text-brand-heavy: var(--g-color-private-blue-600-solid);
77
+ --g-color-text-brand-contrast: var(--g-color-text-light-primary);
78
+ --g-color-text-link: var(--g-color-private-blue-550-solid);
79
+ --g-color-text-link-hover: var(--g-color-private-blue-700-solid);
80
+
81
+ --gn-aside-header-decoration-collapsed-background-color: var(--g-color-private-blue-150);
82
+ --gn-aside-header-decoration-expanded-background-color: var(--g-color-private-blue-150);
83
+ --gn-aside-header-item-current-background-color: var(--g-color-private-blue-150);
84
+ --gn-aside-header-item-background-color-hover: var(--g-color-private-white-100);
85
+
86
+ --gil-color-object-base: var(--g-color-private-blue-550-solid);
87
+ --gil-color-object-accent-heavy: var(--g-color-private-blue-350-solid);
88
+ --gil-color-object-hightlight: var(--g-color-private-blue-650-solid);
89
+ --gil-color-shadow-over-object: var(--g-color-private-blue-300-solid);
90
+ --gil-color-background-lines: var(--g-color-private-white-550-solid);
91
+ --gil-color-background-shapes: var(--g-color-private-white-200-solid);
92
+ --gil-color-object-accent-light: var(--g-color-private-white-1000-solid);
93
+ --gil-color-object-danger: var(--g-color-private-red-550-solid);
94
+ }
95
+
96
+ @mixin ya-360-colors-dark-hc {
97
+ @include ya-360-colors-private-dark-hc;
98
+
99
+ --g-color-base-background: rgb(34, 35, 38);
100
+ --g-color-base-brand: var(--g-color-private-blue-450-solid);
101
+ --g-color-base-brand-hover: var(--g-color-private-blue-650-solid);
102
+ --g-color-base-selection: var(--g-color-private-blue-250);
103
+ --g-color-base-selection-hover: var(--g-color-private-blue-400);
104
+ --g-color-line-brand: var(--g-color-private-blue-550-solid);
105
+ --g-color-text-brand: var(--g-color-private-blue-650-solid);
106
+ --g-color-text-brand-heavy: var(--g-color-private-blue-850-solid);
107
+ --g-color-text-brand-contrast: var(--g-color-text-light-primary);
108
+ --g-color-text-link: var(--g-color-private-blue-650-solid);
109
+ --g-color-text-link-hover: var(--g-color-private-blue-800-solid);
110
+
111
+ --gn-aside-header-decoration-collapsed-background-color: var(--g-color-private-blue-250);
112
+ --gn-aside-header-decoration-expanded-background-color: var(--g-color-private-blue-250);
113
+ --gn-aside-header-item-current-background-color: var(--g-color-private-blue-250);
114
+ --gn-aside-header-item-background-color-hover: var(--g-color-private-white-250);
115
+
116
+ --gil-color-object-base: var(--g-color-private-blue-550-solid);
117
+ --gil-color-object-accent-heavy: var(--g-color-private-blue-750-solid);
118
+ --gil-color-object-hightlight: var(--g-color-private-blue-350-solid);
119
+ --gil-color-shadow-over-object: var(--g-color-private-blue-300-solid);
120
+ --gil-color-background-lines: var(--g-color-private-white-550-solid);
121
+ --gil-color-background-shapes: var(--g-color-private-white-200-solid);
122
+ --gil-color-object-accent-light: var(--g-color-private-white-1000-solid);
123
+ --gil-color-object-danger: var(--g-color-private-red-550-solid);
124
+ }
125
+
126
+ .g-root {
127
+ --g-font-family-sans: 'YS Text', 'Helvetica Neue', 'Arial', 'Helvetica', sans-serif;
128
+ --g-font-family-monospace:
129
+ 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Ubuntu Mono', 'DejaVu Sans Mono',
130
+ 'Courier New', 'Courier', monospace;
131
+
132
+ --g-text-header-font-family:
133
+ 'YS Display Wide', 'Helvetica Neue', 'Arial', 'Helvetica', sans-serif;
134
+ --g-text-subheader-font-family:
135
+ 'YS Display Wide', 'Helvetica Neue', 'Arial', 'Helvetica', sans-serif;
136
+
137
+ --g-text-header-font-weight: 500;
138
+ --g-text-subheader-font-weight: 500;
139
+ --g-text-display-font-weight: 500;
140
+ --g-text-accent-font-weight: 500;
141
+
142
+ --g-text-body-1-font-size: 14px;
143
+ --g-text-body-1-line-height: 18px;
144
+
145
+ --g-text-body-2-font-size: 14px;
146
+ --g-text-body-2-line-height: 20px;
147
+
148
+ --g-text-body-3-font-size: 16px;
149
+ --g-text-body-3-line-height: 24px;
150
+
151
+ --g-text-body-short-font-size: 14px;
152
+ --g-text-body-short-line-height: 18px;
153
+
154
+ --g-text-caption-1-font-size: 11px;
155
+ --g-text-caption-1-line-height: 12px;
156
+
157
+ --g-text-caption-2-font-size: 12px;
158
+ --g-text-caption-2-line-height: 16px;
159
+
160
+ --g-text-subheader-1-font-size: 14px;
161
+ --g-text-subheader-1-line-height: 18px;
162
+
163
+ --g-text-subheader-2-font-size: 16px;
164
+ --g-text-subheader-2-line-height: 20px;
165
+
166
+ --g-text-subheader-3-font-size: 16px;
167
+ --g-text-subheader-3-line-height: 24px;
168
+
169
+ --g-text-subheader-3-font: 700 var(--g-text-subheader-3-font-size) /
170
+ var(--g-text-subheader-3-font-size) var(--g-text-subheader-font-family);
171
+
172
+ --g-border-radius-xs: 1000px;
173
+ --g-border-radius-s: 8px;
174
+ --g-border-radius-m: 10px;
175
+ --g-border-radius-l: 12px;
176
+ --g-border-radius-xl: 16px;
177
+ --g-border-radius-2xl: 24px;
178
+
179
+ --gn-aside-header-background-color: var(--g-color-base-background);
180
+ --gn-aside-header-item-icon-color: var(--g-color-text-misc);
181
+
182
+ &_theme_light {
183
+ @include ya-360-colors-light;
184
+ }
185
+
186
+ &_theme_light-hc {
187
+ @include ya-360-colors-light-hc;
188
+ }
189
+
190
+ &_theme_dark {
191
+ @include ya-360-colors-dark;
192
+ }
193
+
194
+ &_theme_dark-hc {
195
+ @include ya-360-colors-dark-hc;
196
+ }
197
+ }
@@ -0,0 +1,79 @@
1
+ @font-face {
2
+ font-family: 'YS Text';
3
+ src:
4
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-light.woff2') format('woff2'),
5
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-light.woff') format('woff');
6
+ font-weight: 300;
7
+ font-style: normal;
8
+ font-display: swap;
9
+ }
10
+
11
+ @font-face {
12
+ font-family: 'YS Text';
13
+ src:
14
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-light-italic.woff2') format('woff2'),
15
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-light-italic.woff') format('woff');
16
+ font-weight: 300;
17
+ font-style: italic;
18
+ font-display: swap;
19
+ }
20
+
21
+ @font-face {
22
+ font-family: 'YS Text';
23
+ src:
24
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-regular.woff2') format('woff2'),
25
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-regular.woff') format('woff');
26
+ font-weight: 400;
27
+ font-style: normal;
28
+ font-display: swap;
29
+ }
30
+
31
+ @font-face {
32
+ font-family: 'YS Text';
33
+ src:
34
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-regular-italic.woff2') format('woff2'),
35
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-regular-italic.woff') format('woff');
36
+ font-weight: 400;
37
+ font-style: italic;
38
+ font-display: swap;
39
+ }
40
+
41
+ @font-face {
42
+ font-family: 'YS Text';
43
+ src:
44
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-medium.woff2') format('woff2'),
45
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-medium.woff') format('woff');
46
+ font-weight: 500;
47
+ font-style: normal;
48
+ font-display: swap;
49
+ }
50
+
51
+ @font-face {
52
+ font-family: 'YS Text';
53
+ src:
54
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-medium-italic.woff2') format('woff2'),
55
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-medium-italic.woff') format('woff');
56
+ font-weight: 500;
57
+ font-style: italic;
58
+ font-display: swap;
59
+ }
60
+
61
+ @font-face {
62
+ font-family: 'YS Text';
63
+ src:
64
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-bold.woff2') format('woff2'),
65
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-bold.woff') format('woff');
66
+ font-weight: 700;
67
+ font-style: normal;
68
+ font-display: swap;
69
+ }
70
+
71
+ @font-face {
72
+ font-family: 'YS Text';
73
+ src:
74
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-bold-italic.woff2') format('woff2'),
75
+ url('https://yastatic.net/s3/home/fonts/ys/4/text-bold-italic.woff') format('woff');
76
+ font-weight: 700;
77
+ font-style: italic;
78
+ font-display: swap;
79
+ }
@@ -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
 
@@ -14,13 +15,15 @@ export default defineConfig(() => {
14
15
  return {
15
16
  base: './',
16
17
  server: {
18
+ port: 5173,
19
+ strictPort: true,
17
20
  cors: true,
18
21
  headers: {
19
22
  'Access-Control-Allow-Origin': '*',
20
23
  'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
21
24
  'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
22
25
  'Content-Security-Policy':
23
- "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'",
24
27
  },
25
28
  },
26
29
  plugins: [
@@ -48,6 +51,7 @@ export default defineConfig(() => {
48
51
  );
49
52
  },
50
53
  },
54
+ proxyPlugin(),
51
55
  ],
52
56
  build: {
53
57
  sourcemap: true,
@@ -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>Default Plugin</title>
7
+ <title>Attachment Viewer 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,12 +1,7 @@
1
1
  import { useCallback } from 'react';
2
2
 
3
- import { Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
4
- import {
5
- getField,
6
- hostApi,
7
- trackerApi,
8
- useTrackerPluginContext,
9
- } from '@yandex-data-ui/tracker-plugin-sdk-react';
3
+ import { Button, Card, DefinitionList, ThemeProvider, Text as Typography } from '@gravity-ui/uikit';
4
+ import { hostApi, trackerApi, useTrackerPluginContext } from '@weavix/tracker-plugin-sdk-react';
10
5
 
11
6
  const App = () => {
12
7
  const { theme, slotContext } = useTrackerPluginContext<'attachment.viewer.action'>();
@@ -26,30 +21,25 @@ const App = () => {
26
21
  return null;
27
22
  }
28
23
 
29
- const attachmentBlob = getField<string>(slotContext, 'attachmentBlob');
30
-
31
- const id = getField<string>(slotContext, 'meta.id', 'Без идентификатора');
32
- const mimetype = getField<string>(slotContext, 'meta.mimetype', 'Без типа');
33
- const url = getField<string>(slotContext, 'meta.url', 'Без ссылки');
34
- const name = getField<string>(slotContext, 'meta.name', 'Без названия');
35
- const size = getField<number>(slotContext, 'meta.size', 0);
36
- const date = getField<string>(slotContext, 'meta.date', 'Без даты');
37
-
38
24
  return (
39
25
  <ThemeProvider theme={theme}>
40
- <div style={{ width: '800px', padding: '50px' }}>
26
+ <div>
41
27
  <Card style={{ padding: '20px' }}>
42
28
  <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
43
- Текущий контекст в проде
29
+ Базовый контекст (contextLevel: basic)
44
30
  </Typography>
45
31
  <DefinitionList>
46
- <DefinitionList.Item name="Идентификатор">{id}</DefinitionList.Item>
47
- <DefinitionList.Item name="Название">{name}</DefinitionList.Item>
48
- <DefinitionList.Item name="Тип">{mimetype}</DefinitionList.Item>
49
- <DefinitionList.Item name="Адрес">{url}</DefinitionList.Item>
50
- <DefinitionList.Item name="Размер">{size}</DefinitionList.Item>
51
- <DefinitionList.Item name="Дата">{date}</DefinitionList.Item>
32
+ <DefinitionList.Item name="ID вложения">
33
+ {slotContext.id}
34
+ </DefinitionList.Item>
52
35
  </DefinitionList>
36
+ <Button
37
+ view="action"
38
+ style={{ marginTop: '16px' }}
39
+ onClick={() => save(new Blob(['Hello from plugin']), 'hello.txt')}
40
+ >
41
+ Добавить пример файла
42
+ </Button>
53
43
  </Card>
54
44
  </div>
55
45
  </ThemeProvider>
@@ -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>Board 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<'board.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.id}</DefinitionList.Item>
20
+ </DefinitionList>
21
+ </Card>
22
+ </div>
23
+ </ThemeProvider>
24
+ );
25
+ };
26
+
27
+ export default App;
@@ -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();
@@ -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>Goal 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<'goal.action'>();
@@ -8,27 +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<number>(slotContext, 'fields.progressPercentage.value', 0);
19
-
20
11
  return (
21
12
  <ThemeProvider theme={theme}>
22
- <div style={{ width: '800px', padding: '50px' }}>
13
+ <div>
23
14
  <Card style={{ padding: '20px' }}>
24
15
  <Typography variant="header-1" as="div" style={{ marginBottom: '16px' }}>
25
- Текущий контекст в проде
16
+ Базовый контекст (contextLevel: basic)
26
17
  </Typography>
27
18
  <DefinitionList>
28
- <DefinitionList.Item name="Название">{summary}</DefinitionList.Item>
29
- <DefinitionList.Item name="Описание">{description}</DefinitionList.Item>
30
- <DefinitionList.Item name="Статус">{status}</DefinitionList.Item>
31
- <DefinitionList.Item name="Прогресс">{progress}</DefinitionList.Item>
19
+ <DefinitionList.Item name="ID">{slotContext.entityId}</DefinitionList.Item>
32
20
  </DefinitionList>
33
21
  </Card>
34
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 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<'goal.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>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;
@@ -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 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<'goal.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>Issue Actions Plugin</title>
7
+ <title>Issue 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>