openlaw-elements
Advanced tools
Comparing version 1.0.0-beta.28 to 1.0.0
{ | ||
"name": "openlaw-elements", | ||
"version": "1.0.0-beta.28", | ||
"version": "1.0.0", | ||
"description": "Dynamically render React form components from an OpenLaw template.", | ||
@@ -34,4 +34,8 @@ "author": "OpenLaw Team <opensource@openlaw.io>", | ||
}, | ||
"setupFilesAfterEnv": [ | ||
"@testing-library/react/cleanup-after-each" | ||
"setupFiles": [ | ||
"jest-canvas-mock" | ||
], | ||
"transformIgnorePatterns": [ | ||
"/node_modules/", | ||
"/openlaw-client/" | ||
] | ||
@@ -43,3 +47,3 @@ }, | ||
"build:css": "npm run sass & npm run copy:css && npm run clean:css", | ||
"build:esm": "npm run clean:esm && npm run build:types && cross-env NODE_ENV=esm rollup -c", | ||
"build:esm": "npm run clean:esm && npm run build:types && cross-env NODE_ENV=esm rollup -c && rimraf dist/esm/__*", | ||
"build:example": "npm run build:esm && npm run build:css", | ||
@@ -77,3 +81,4 @@ "build:types": "flow-copy-source src dist/esm", | ||
"@babel/preset-react": "^7.0.0", | ||
"@testing-library/react": "^8.0.4", | ||
"@testing-library/jest-dom": "^4.0.1", | ||
"@testing-library/react": "^9.1.3", | ||
"babel-eslint": "^10.0.1", | ||
@@ -85,28 +90,28 @@ "babel-loader": "^8.0.5", | ||
"cross-env": "^5.2.0", | ||
"css-loader": "^2.1.0", | ||
"eslint": "^5.13.0", | ||
"eslint-plugin-flowtype": "^3.4.1", | ||
"eslint-plugin-react": "^7.12.4", | ||
"flow-bin": "^0.102.0", | ||
"css-loader": "^3.2.0", | ||
"eslint": "^6.2.0", | ||
"eslint-plugin-flowtype": "^4.2.0", | ||
"eslint-plugin-react": "^7.14.3", | ||
"flow-bin": "^0.105.2", | ||
"flow-copy-source": "^2.0.3", | ||
"html-webpack-plugin": "^3.2.0", | ||
"jest": "^24.8.0", | ||
"jest-dom": "^3.5.0", | ||
"jest": "^24.9.0", | ||
"jest-canvas-mock": "^2.1.1", | ||
"node-sass": "^4.12.0", | ||
"np": "^4.0.2", | ||
"openlaw": "^0.2.15", | ||
"np": "^5.0.3", | ||
"openlaw": "^0.2.16", | ||
"react": "^16.8.1", | ||
"react-dom": "^16.8.1", | ||
"rimraf": "^2.6.3", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.1.2", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
"rollup-plugin-node-resolve": "^4.0.0", | ||
"rollup-plugin-commonjs": "^10.0.2", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-postcss": "^2.0.3", | ||
"rollup-plugin-replace": "^2.1.0", | ||
"rollup-plugin-terser": "^4.0.4", | ||
"rollup-plugin-terser": "^5.1.1", | ||
"sass-loader": "^7.1.0", | ||
"style-loader": "^0.23.1", | ||
"style-loader": "^1.0.0", | ||
"webpack": "^4.29.3", | ||
"webpack-cli": "^3.2.3", | ||
"webpack-cli": "^3.3.7", | ||
"webpack-dev-server": "^3.1.14" | ||
@@ -121,3 +126,3 @@ }, | ||
"deep-equal": "^1.0.1", | ||
"flatpickr": "^4.5.2", | ||
"flatpickr": "^4.6.2", | ||
"prop-types": "^15.7.2", | ||
@@ -124,0 +129,0 @@ "react-autosuggest": "^9.4.3", |
# OpenLaw Elements | ||
![Jest Coverage Badge](./src/__tests__/coverge-badge.svg) | ||
![Jest Coverage Badge](https://github.com/openlawteam/openlaw-elements/raw/master/src/__tests__/coverge-badge.svg?sanitize=true) | ||
Dynamically render React form components from an OpenLaw template. | ||
Dynamically render React form components and sections from an OpenLaw template. | ||
## ⚠️ Production-ready status | ||
Currently, OpenLaw is making use of this library in our internal projects, but our aim is to make it as easy to use as possible for others. While the library can be used today (and will likely work as-is), we kindly ask that you help us by reporting any bugs - and do ask us any questions - if you decide to use it. | ||
We appreciate your patience as we make improvements in our forthcoming releases. | ||
## Install | ||
``` | ||
npm install --save openlaw-elements@beta | ||
npm install openlaw-elements | ||
``` | ||
## Docs | ||
https://docs.openlaw.io/openlaw-elements/ | ||
## Usage | ||
@@ -35,3 +32,4 @@ | ||
const apiClient = new APIClient('https://app.openlaw.io'); | ||
// we strongly recommend using environment variables, not hard-coded strings | ||
// You can login from a Node server (e.g. Express), and be sure to pass the `OPENLAW_JWT` on to the client. | ||
// If you require your users to have an account on your instance, create a login page on the client. | ||
apiClient.login('[YOUR_OPENLAW_EMAIL]', '[YOUR_OPENLAW_PASSWORD]'); | ||
@@ -42,3 +40,3 @@ | ||
// https://docs.openlaw.io/openlaw-object/#execute | ||
const { executionResult, errorMessage } = Openlaw.execute(compiledTemplate, {}, {}); | ||
const { executionResult, errorMessage } = Openlaw.execute(compiledTemplate, {}, {}, {}); | ||
// https://docs.openlaw.io/openlaw-object/#getexecutedvariables | ||
@@ -60,2 +58,3 @@ const variables = Openlaw.getExecutedVariables(executionResult, {}); | ||
<OpenLawForm | ||
// https://docs.openlaw.io/openlaw-elements/#required-parameters | ||
apiClient={apiClient} | ||
@@ -65,3 +64,2 @@ executionResult={executionResult} | ||
onChangeFunction={onChange} | ||
// https://docs.openlaw.io/openlaw-object/ | ||
openLaw={Openlaw} | ||
@@ -129,3 +127,3 @@ variables={variables} | ||
We use Webpack to bundle a small app that changes the app's state tree every time an edit is made to the rendered `<OpenLawForm />`. Additionally, each time you click the `Preview` button, it will generate a preview of what the final document will look like at the top of the webpage. | ||
We use Webpack to bundle a small app that changes the app's state tree every time an edit is made to the rendered `<OpenLawForm />`. Additionally, each time you click the "Run preview" or "Auto run" button, it will generate a preview of what the final document will look like at the top of the webpage. | ||
@@ -143,9 +141,5 @@ ### Run | ||
## Roadmap (subject to change) | ||
## Current Roadmap (subject to change) | ||
- [ ] User can override individual input components | ||
- [ ] Style classNames can be namespaced to your provided namespace key (e.g. `my-app`) | ||
- [ ] Style configuration prop to override certain element classes (e.g. `{ error: 'my-error-class' }`) | ||
- [ ] Address input type will be able to be used without the `APIClient` | ||
- [ ] Ability to choose text and toggle visibility of input labels. A current workaround is to hide them with your own CSS. | ||
@@ -152,0 +146,0 @@ ## Contributing |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1265841
22047
1
43
29
159
94
Updatedflatpickr@^4.6.2