New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mainframe/bot-ui

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mainframe/bot-ui - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

35

package.json
{
"name": "@mainframe/bot-ui",
"version": "0.1.0",
"main": "lib/index.js",
"repository": "git@github.com:thusfresh/bot-ui-js.git",
"author": "Paul Le Cam <paul@mainframe.com>",
"license": "MIT",
"scripts": {
"build:clean": "del lib",
"build:compile": "babel src --out-dir lib --ignore test.js",
"build": "npm run build:clean && npm run build:compile",
"lint": "eslint ./src",
"test": "npm run lint",
"start": "npm test && npm run build",
"prepublishOnly": "npm run build"
},
"dependencies": {
"react": "^15.6.1",
"react-json-renderer": "^0.5.1"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^7.2.3",
"babel-plugin-syntax-export-extensions": "^6.13.0",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"del-cli": "^1.0.0",
"eslint": "^4.6.1",
"eslint-config-prettier": "^2.4.0",
"eslint-plugin-prettier": "^2.2.0",
"prettier": "^1.6.1"
}
"version": "0.2.0"
}

@@ -1,44 +0,1 @@

# Mainframe JavaScript UI framework for bots
This documentation only covers the JavaScript UI framework, see the [Mainframe bots documentation](http://developer.mainframe.com/) for more information about creating Mainframe bots, and the [bots SDK repository](https://github.com/thusfresh/bot-sdk-js) to get started implementing a bot in JavaScript.
## Installation
```sh
npm install @mainframe/bot-ui # npm
yarn add @mainframe/bot-ui # Yarn
```
## Example
```js
const React = require('react')
const { render, Text } = require('@mainframe/bot-ui')
const ui = render(<Text>Hello bot!</Text>)
```
## Usage
This UI framework is meant as a complement to the [JavaScript bot SDK](https://github.com/thusfresh/bot-sdk-js), exposing the [components supported by the client UI](http://developer.mainframe.com/#components) and a `render()` function converting a JSX tree to an [UIComponent](http://developer.mainframe.com/#ui-types) tree expected by the Mainframe server.
The `render()` function expects a `React.Element`, the provided JSX must therefore be transpiled, for example using [Babel's React JSX transform plugin](https://babeljs.io/docs/plugins/transform-react-jsx/).
## API
### React
Alias to [React](https://facebook.github.io/react/) library. It needs to be imported in scope when using [Babel's React JSX transform plugin](https://babeljs.io/docs/plugins/transform-react-jsx/) so that JSX can be converted to `React.createElement()` calls.
### render
Alias to [React JSON renderer convertToObject](https://github.com/thusfresh/react-json-renderer#converttoobject) function. Converts the JSX tree into a JS Object supported by the Mainframe platform.
## Components
All the [documented components](http://developer.mainframe.com/#components) are exposed by this UI framework so they can be used to create the JSX tree.
## License
MIT
See [LICENSE](LICENSE) file
This package has been deprecated

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc