0.0.43 • Published 5 years ago

clever-widget v0.0.43

Weekly downloads
3
License
MIT
Repository
-
Last release
5 years ago

Welcome

Install dependencies

npm i

Use

React Component

You can use the React Component by installing it from npm

npm i --save clever-widget

and importing it where you need it

import Widget from 'clever-widget'

...

	render() {
        return (
            <Widget 
                text={...}
                renderRules={...}
                theme={...}
                events={...}
                ...
            />
        )
    }

The expected props are:

	renderRules,
	events,
	theme,
	text,
	isChatOpen,
	botIsTyping,
	messages,
	sendMessage,
	onOpenChat,
	onCloseChat,
	giveRating

Develop

TODOs

  • Use preact and preact-compat to minimize the Widget buid. This is currently not possible as we rely on React.createContext() and React.forwardRef(), which have not been implemented in preact yet. Once these features are available, do the following:
    • npm i --save preact preact-compat
    • Uncomment the resolve part in webpack.production.js

Build Flow

There are 2 module bundlers used.

React Component

Rollup is used to build the Bright Component for use in other Clever projects like clever-web.

To build, run npm run build:component

This will output 3 files to the /build folder:

- cleverwidget.js
- cleverwidget.module.js
- cleverwidget.umd.js

Widget

Webpack is used to build the executable bundle for use as Widget on external websites.

To build, run npm run build:widget

This will output 3 files to the /build folder:

- bundle.js
- index.html
- frame.html
- custom.html

Building both

You can build both by running npm run build

Examples

https://github.com/jaebradley/example-rollup-react-component-npm-package

0.0.43

5 years ago

0.0.43-beta.0

5 years ago

0.0.42

5 years ago

0.0.41

5 years ago

0.0.40

5 years ago

0.0.39

5 years ago

0.0.38

5 years ago

0.0.37

5 years ago

0.0.36

5 years ago

0.0.35

5 years ago

0.0.34

5 years ago

0.0.33

5 years ago

0.0.32

5 years ago

0.0.31

5 years ago

0.0.30

5 years ago

0.0.29

6 years ago

0.0.28

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago