@astral/ui 3.248.0-rc.1 → 3.248.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -28
- package/components/PdfViewer.d.ts +1 -0
- package/components/PdfViewer.js +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/node/components/PdfViewer.d.ts +1 -0
- package/node/components/PdfViewer.js +7 -0
- package/node/index.d.ts +1 -1
- package/node/index.js +1 -1
- package/package.json +20 -19
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
- [Migration guide](#migration-guide)
|
|
18
18
|
- [Troubleshooting](#troubleshooting)
|
|
19
19
|
- [Медленно выполняются vitest тесты при импорте пакета](#медленно-выполняются-vitest-тесты-при-импорте-пакета)
|
|
20
|
+
- [utils](#utils)
|
|
20
21
|
|
|
21
22
|
# [Storybook](https://main--61baeff6f06230003a88ef8a.chromatic.com/)
|
|
22
23
|
[Storybook](https://main--61baeff6f06230003a88ef8a.chromatic.com/) содержит документацию компонентов ```@astral/ui```.
|
|
@@ -102,37 +103,10 @@ import {
|
|
|
102
103
|
createTheme,
|
|
103
104
|
} from '@astral/ui';
|
|
104
105
|
import { createStylesCache as createStylesServerCache } from '@astral/ui/server';
|
|
105
|
-
import UbuntuBoldWoff from '@astral/ui/fonts/UbuntuBold.woff';
|
|
106
|
-
import UbuntuBoldWoff2 from '@astral/ui/fonts/UbuntuBold.woff2';
|
|
107
|
-
import UbuntuLightWoff from '@astral/ui/fonts/UbuntuLight.woff';
|
|
108
|
-
import UbuntuLightWoff2 from '@astral/ui/fonts/UbuntuLight.woff2';
|
|
109
|
-
import UbuntuRegularWoff from '@astral/ui/fonts/UbuntuRegular.woff';
|
|
110
|
-
import UbuntuRegularWoff2 from '@astral/ui/fonts/UbuntuRegular.woff2';
|
|
111
|
-
import UbuntuMediumWoff from '@astral/ui/fonts/UbuntuMedium.woff';
|
|
112
|
-
import UbuntuMediumWoff2 from '@astral/ui/fonts/UbuntuMedium.woff2';
|
|
113
106
|
|
|
114
107
|
import { MainLayout } from '@example/modules/LayoutModule';
|
|
115
108
|
|
|
116
|
-
const
|
|
117
|
-
bold: {
|
|
118
|
-
woff: UbuntuBoldWoff,
|
|
119
|
-
woff2: UbuntuBoldWoff2,
|
|
120
|
-
},
|
|
121
|
-
light: {
|
|
122
|
-
woff: UbuntuLightWoff,
|
|
123
|
-
woff2: UbuntuLightWoff2,
|
|
124
|
-
},
|
|
125
|
-
regular: {
|
|
126
|
-
woff: UbuntuRegularWoff,
|
|
127
|
-
woff2: UbuntuRegularWoff2,
|
|
128
|
-
},
|
|
129
|
-
medium: {
|
|
130
|
-
woff: UbuntuMediumWoff,
|
|
131
|
-
woff2: UbuntuMediumWoff2,
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export const theme = createTheme({ brand: Brand.DEFAULT, fontsUrls });
|
|
109
|
+
export const theme = createTheme({ brand: Brand.DEFAULT });
|
|
136
110
|
|
|
137
111
|
const stylesCache = createStylesServerCache({ key: 'next' });
|
|
138
112
|
|
|
@@ -167,6 +141,18 @@ export default App;
|
|
|
167
141
|
|
|
168
142
|
# Migration guide
|
|
169
143
|
|
|
144
|
+
## 3.0.0 -> 4.0.0
|
|
145
|
+
|
|
146
|
+
### Fonts
|
|
147
|
+
|
|
148
|
+
Подключение шрифтов через объект `theme` больше не поддерживается.
|
|
149
|
+
|
|
150
|
+
Шрифты необходимо подключать через [сервис для хранения статичных файлов](https://frontend-static.astral.ru/)
|
|
151
|
+
|
|
152
|
+
[Инструкция для подключения шрифтов](https://main--61baeff6f06230003a88ef8a.chromatic.com/?path=/docs/getting-started-fonts--docs)
|
|
153
|
+
|
|
154
|
+
⚠️ Для подключения шрифтов необходимо настроить **Content Security Policy**.
|
|
155
|
+
|
|
170
156
|
## 2.0.0 -> 3.0.0
|
|
171
157
|
|
|
172
158
|
### ConfigProvider
|
|
@@ -362,3 +348,26 @@ export default defineConfig({
|
|
|
362
348
|
|
|
363
349
|
В пакете есть специальное свойство `exports.vitest`, оптимизирующее парсинг пакета для vitest.
|
|
364
350
|
Исходна проблема: vitest плохо работает с barrel files.
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
# utils
|
|
354
|
+
|
|
355
|
+
Table of contents
|
|
356
|
+
|
|
357
|
+
- [redirectToLink](#redirectToLink)
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
## redirectToLink
|
|
361
|
+
|
|
362
|
+
Утилита для перехода по ссылке
|
|
363
|
+
|
|
364
|
+
```ts
|
|
365
|
+
import { redirectToLink } from '@astral/ui';
|
|
366
|
+
|
|
367
|
+
// Открытие ссылки в текущей вкладке или фрейме
|
|
368
|
+
redirectToLink('/');
|
|
369
|
+
|
|
370
|
+
// Открытие ссылки в новой вкладке
|
|
371
|
+
redirectToLink('/', '_blank')
|
|
372
|
+
|
|
373
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PdfViewer, type PdfViewerOnLoadSuccessProps, PdfViewerPagination, type PdfViewerPaginationProps, type PdfViewerProps, pdfViewerClassnames, } from '@astral/components/PdfViewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PdfViewer, PdfViewerPagination, pdfViewerClassnames, } from '@astral/components/PdfViewer';
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PdfViewer, type PdfViewerOnLoadSuccessProps, PdfViewerPagination, type PdfViewerPaginationProps, type PdfViewerProps, pdfViewerClassnames, } from '@astral/components/PdfViewer';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pdfViewerClassnames = exports.PdfViewerPagination = exports.PdfViewer = void 0;
|
|
4
|
+
var PdfViewer_1 = require("@astral/components/PdfViewer");
|
|
5
|
+
Object.defineProperty(exports, "PdfViewer", { enumerable: true, get: function () { return PdfViewer_1.PdfViewer; } });
|
|
6
|
+
Object.defineProperty(exports, "PdfViewerPagination", { enumerable: true, get: function () { return PdfViewer_1.PdfViewerPagination; } });
|
|
7
|
+
Object.defineProperty(exports, "pdfViewerClassnames", { enumerable: true, get: function () { return PdfViewer_1.pdfViewerClassnames; } });
|
package/node/index.d.ts
CHANGED
package/node/index.js
CHANGED
|
@@ -15,5 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("@astral/components"), exports);
|
|
18
|
-
__exportStar(require("@astral/icons"), exports);
|
|
19
18
|
__exportStar(require("@astral/form"), exports);
|
|
19
|
+
__exportStar(require("@astral/icons"), exports);
|
package/package.json
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/ui",
|
|
3
|
-
"version": "3.248.0-rc.
|
|
3
|
+
"version": "3.248.0-rc.2",
|
|
4
4
|
"browser": "./index.js",
|
|
5
5
|
"main": "./node/index.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@astral/icons": "3.248.0-rc.2",
|
|
8
|
+
"@astral/components": "3.248.0-rc.2",
|
|
9
|
+
"@astral/form": "3.248.0-rc.2"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
13
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
14
|
+
"@types/react": "^17.0.0 || ^18.0.0"
|
|
15
|
+
},
|
|
6
16
|
"exports": {
|
|
7
17
|
".": {
|
|
8
18
|
"module": "./index.js",
|
|
@@ -20,29 +30,20 @@
|
|
|
20
30
|
"types": "./next.d.ts"
|
|
21
31
|
},
|
|
22
32
|
"./fonts/*": "./fonts/*",
|
|
23
|
-
"./illustrations/*": "./illustrations/*"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
"peerDependencies": {
|
|
31
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
32
|
-
"react-dom": "^17.0.0 || ^18.0.0",
|
|
33
|
-
"@types/react": "^17.0.0 || ^18.0.0"
|
|
33
|
+
"./illustrations/*": "./illustrations/*",
|
|
34
|
+
"./components/PdfViewer": {
|
|
35
|
+
"module": "./components/PdfViewer.js",
|
|
36
|
+
"require": "./node/components/PdfViewer.js",
|
|
37
|
+
"types": "./components/PdfViewer.d.ts"
|
|
38
|
+
}
|
|
34
39
|
},
|
|
35
40
|
"author": "Astral.Soft",
|
|
36
41
|
"license": "MIT",
|
|
37
42
|
"repository": {
|
|
38
43
|
"type": "git",
|
|
39
|
-
"url": "
|
|
40
|
-
},
|
|
41
|
-
"bugs": {
|
|
42
|
-
"url": "https://github.com/kaluga-astral/frontend/issues"
|
|
44
|
+
"url": "https://git.astralnalog.ru/frontend.shared/ui"
|
|
43
45
|
},
|
|
44
|
-
"keywords": [],
|
|
45
|
-
"sideEffects": false,
|
|
46
46
|
"types": "./index.d.ts",
|
|
47
|
-
"module": "./index.js"
|
|
47
|
+
"module": "./index.js",
|
|
48
|
+
"sideEffects": false
|
|
48
49
|
}
|