Skip to content

Commit e468447

Browse files
committed
update
1 parent a15e1e4 commit e468447

File tree

5 files changed

+43
-13
lines changed

5 files changed

+43
-13
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
```
1313
3. Импортировать и запустить бота:
1414
```javascript
15-
import app from 'chatbot-v2';
15+
import App from '@hexlet/chatbot-v2';
16+
import steps from '@hexlet/chatbot-v2/example-steps';
17+
import '@hexlet/chatbot-v2/styles';
1618
1719
const container = document.getElementById('root');
18-
const steps = [];
19-
app(container, steps);
20+
ReactDOM.createRoot(container)
21+
.render(App(steps));
2022
```
2123

2224
Функция принимает первым параметром контейнер, в котором нужно отрисовать бота и вторым параметром шаги для работы чат-бота.

package-lock.json

Lines changed: 27 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hexlet/chatbot-v2",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"type": "module",
55
"homepage": "https://hexlet.github.io/react-flowbot-ui-kit/",
66
"files": [
@@ -15,7 +15,10 @@
1515
"require": "./dist/hexlet-flowbot.umd.cjs"
1616
},
1717
"./styles": {
18-
"import": "./dist/style.css"
18+
"import": "./dist/init.css"
19+
},
20+
"./example-steps": {
21+
"import": "./src/steps.ts"
1922
}
2023
},
2124
"scripts": {
@@ -32,7 +35,8 @@
3235
"react": "^18.2.0",
3336
"react-bootstrap": "^2.10.0",
3437
"react-dom": "^18.2.0",
35-
"vite-plugin-dts": "^3.7.3"
38+
"vite-plugin-dts": "^3.7.3",
39+
"vite-plugin-lib-inject-css": "^2.0.0"
3640
},
3741
"devDependencies": {
3842
"@types/node": "^20.11.4",

src/Components/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { AppProps } from '../interfaces/Step';
22
import WidgetModal from './WidgetModal';
3+
import '../scss/styles.scss';
34

45

56
const App = ({ steps }: AppProps): JSX.Element => {

vite.config.lib.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react';
33
import { resolve } from 'path';
44
import dts from 'vite-plugin-dts';
5+
import { libInjectCss } from 'vite-plugin-lib-inject-css';
56

67
// for publishing as npm package
78

89
// https://vitejs.dev/config/
910
export default defineConfig({
10-
plugins: [react(), dts()],
11+
plugins: [react(), dts(), libInjectCss()],
1112
build: {
1213
lib: {
1314
// Could also be a dictionary or array of multiple entry points
@@ -25,6 +26,6 @@ export default defineConfig({
2526
},
2627
},
2728
},
28-
sourcemap: 'inline',
29+
// sourcemap: 'inline',
2930
},
3031
});

0 commit comments

Comments
 (0)