Skip to content

Commit

Permalink
Merge pull request #16 from anvilco/bo/update
Browse files Browse the repository at this point in the history
[Breaking] Update dependencies
  • Loading branch information
benogle committed Sep 20, 2023
2 parents f7f34cc + c4a6fee commit 26fb2eb
Show file tree
Hide file tree
Showing 15 changed files with 5,463 additions and 6,881 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ module.exports = {
},
ecmaVersion: 12,
sourceType: 'module',
"babelOptions": {
"presets": ["@babel/preset-react"]
},
},
plugins: [
'react',
],
rules: {
},
}
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 18
- uses: actions/cache@v2
id: yarn-cache
with:
Expand All @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 18
- uses: actions/cache@v2
id: yarn-cache
with:
Expand All @@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 18
- uses: actions/cache@v2
id: yarn-cache
with:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ import '@anvilco/react-signature-modal/dist/styles.css'
isOpen={isModalOpen}
onClose={() => setIsModalOpen(false)}
onLoad={() => setLoading(false)}
onFinishSigning={(payload) => console.log(payload)}
onError={(errorPayload) => console.log(errorPayload)}
onEvent={(eventObject) => console.log(eventObject)}
/>
```

Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
},
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
}
64 changes: 34 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,51 @@
"lint": "yarn eslint 'packages/*/src/**.js'",
"test": "yarn lerna run test",
"prebuild": "git clean -fdx packages -e packages/*/node_modules",
"build": "yarn lerna bootstrap && yarn lerna run build",
"build": "yarn && yarn lerna run build",
"build:changelog": "yarn lerna run build:changelog",
"release:local": "yarn build && yarn lerna run pack",
"release:npm": "yarn build && yarn lerna publish"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/register": "^7.17.7",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
"@babel/core": "^7.22.20",
"@babel/eslint-parser": "^7.22.15",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.22.20",
"@babel/preset-react": "^7.22.15",
"@babel/register": "^7.22.15",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"auto-changelog": "^2.4.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.4",
"babel-loader": "^9.1.3",
"bdd-lazy-var": "^2.6.1",
"chai": "^4.3.6",
"chai": "^4.3.8",
"chai-as-promised": "^7.1.1",
"chai-enzyme": "^1.0.0-beta.1",
"css-loader": "^5.2.7",
"css-loader": "^6.8.1",
"enzyme": "^3.11.0",
"eslint": "^7.32.0",
"eslint-config-nicenice": "^2.0.0",
"eslint-config-standard": "^16.0.3",
"eslint-config-standard-jsx": "^10.0.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"jsdom": "^18.0.0",
"lerna": "^3.22.1",
"mini-css-extract-plugin": "^1.6.2",
"mocha": "^9.2.2",
"sinon": "^11.1.2",
"eslint": "^8.49.0",
"eslint-config-nicenice": "^4.1.1",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard": "^17.1.0",
"eslint-config-standard-jsx": "^11.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-svg-jsx": "^1.2.2",
"jsdom": "^22.1.0",
"lerna": "^7.3.0",
"mini-css-extract-plugin": "^2.7.6",
"mocha": "^10.2.0",
"sinon": "^16.0.0",
"sinon-chai": "^3.7.0",
"style-loader": "^2.0.0",
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2"
"style-loader": "^3.3.3",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
}
}
20 changes: 20 additions & 0 deletions packages/anvil-embed-frame/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# Changelog

All notable changes to this project will be documented in this file.

## @anvilco/anvil-embed-frame@1.1.0 - 2022-10-05

### Merged

- Add Typescript support to `AnvilEmbedFrame` [`#13`](https://github.com/anvilco/react-ui/pull/13)
- New `@anvilco/anvil-embed-frame` package [`#12`](https://github.com/anvilco/react-ui/pull/12)
- Update Readme [`#11`](https://github.com/anvilco/react-ui/pull/11)
- [1-min] Fix output path for type defs [`#10`](https://github.com/anvilco/react-ui/pull/10)
- Add Typescript typings [`#9`](https://github.com/anvilco/react-ui/pull/9)
- Update dependencies and peer dependencies [`#7`](https://github.com/anvilco/react-ui/pull/7)
- Add onError handler [`#6`](https://github.com/anvilco/react-ui/pull/6)
- Add onFinishSigning prop & upgrade all minor version deps [`#5`](https://github.com/anvilco/react-ui/pull/5)
- Refactor the Docs [`#3`](https://github.com/anvilco/react-ui/pull/3)
- Review Follow Ups and Refactoring [`#2`](https://github.com/anvilco/react-ui/pull/2)
- Setup Linting [`#1`](https://github.com/anvilco/react-ui/pull/1)

### Commits

- AnvilSignatureFrame and AnvilSignatureModal [`7ab8fc2`](https://github.com/anvilco/react-ui/commit/7ab8fc2026411cbcc0186d9650290ba3d1afcfa5)
27 changes: 11 additions & 16 deletions packages/anvil-embed-frame/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# AnvilEmbedFrame

A very minimal component that allows you to embed Anvil [Etch e-signatures](https://www.useanvil.com/docs/api/e-signatures#embedding-the-signing-ui-in-an-iframe), [Workflows](https://www.useanvil.com/docs/api/workflows#embedding-workflows-in-your-app), and editors into your app with an `iframe`. It will give you information via callback `onEvent`.
`AnvilEmbedFrame` is a very minimal React component that allows you to embed Anvil [Etch e-signatures](https://www.useanvil.com/docs/api/e-signatures#embedding-the-signing-ui-in-an-iframe), [Workflows](https://www.useanvil.com/docs/api/workflows#embedding-workflows-in-your-app), and [embedded builders](https://www.useanvil.com/blog/engineering/embedded-edit-pdf-experience/) into your app with an `iframe`. It will give you information via callback `onEvent`.

See the Etch e-sign [live demo](https://esign-demo.useanvil.com/) and open-source [demo repository](https://github.com/anvilco/anvil-e-signature-api-node-example) for an embedded Etch e-sign usage example.
See the Etch e-sign [live demo](https://esign-demo.useanvil.com/) and open-source [demo repository](https://github.com/anvilco/anvil-e-signature-api-node-example) for an embedded Etch e-sign usage example using this component.

## What is Anvil?

Expand Down Expand Up @@ -30,11 +30,16 @@ import AnvilEmbedFrame from '@anvilco/anvil-embed-frame'

<AnvilEmbedFrame
iframeURL={etchSignURL || workflowURL || editorURL}
onEvent={(event) => console.log('Event object:', event)}
onEvent={(eventObject) => console.log('Event object:', eventObject)}
className="anvil-embed-frame"
style={{ border: 'none' }}
/>
```

## Upgrading from v1 to v2

Beginning in v2.0, the `enableDefaultStyles` prop has been removed. There are now _no_ default styles embedded in the `AnvilEmbedFrame`, the frame will use default browser `iframe` styling. You can style the iframe with CSS and add `className` and `style` props to the component

## Props

### iframeURL
Expand All @@ -59,17 +64,11 @@ Example
### onEvent

*Function* - This function is called when an event is triggered.
Possible event types for Etch e-sign include: `signerComplete`, `signerError`
Possible event types for Workflwos include: `forgeSubmitPage`, `forgeComplete`
Possible event types for [Etch e-sign include](https://www.useanvil.com/docs/api/e-signatures/#iframe-event-details): `signerComplete`, `signerError`.
Possible event types for [Workflows include](https://www.useanvil.com/docs/api/workflows/#iframe-event-details): `forgeSubmitPage`, `forgeComplete`, `weldComplete`.

Defaults to `(eventObject) => {}`

### enableDefaultStyles

*Boolean* - Set to false to disable the default inline styles of the component.

Defaults to `true`.

### scroll

*String* - Set scroll to the iframe
Expand All @@ -78,10 +77,6 @@ Defaults to `true`.
* `smooth` smoothly scrolls the window to the iframe when mounted
* `null` - disables scrolling

## Styling

Customize the component by setting the `enableDefaultStyles` prop to false, then import CSS or pass in inline styles. Override IDs or classNames by passing them in as props.

## Anvil Documentation

* [Get started with Anvil API](https://www.useanvil.com/docs/api/getting-started)
Expand All @@ -91,7 +86,7 @@ Customize the component by setting the `enableDefaultStyles` prop to false, then
## Notes

* To enable iframe embedding, go to your organization's settings in Anvil, and enable "Iframe Embedding" in the API section.
* Please contact us at [[email protected]](mailto:[email protected]) to enable iframe embedding for editors.
* Please contact us at [[email protected]](mailto:[email protected]) to enable iframe embedding for our [embedded builders UIs](https://www.useanvil.com/blog/engineering/embedded-edit-pdf-experience/): the PDF template builder, e-sign packet builder, or Workflow builder.
* React >= v16.0 required.

## Bugs
Expand Down
10 changes: 5 additions & 5 deletions packages/anvil-embed-frame/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anvilco/anvil-embed-frame",
"version": "1.1.0",
"version": "2.0.0-alpha.0",
"description": "The AnvilEmbedFrame React component for embedded Etch signatures and Workflows.",
"author": "Anvil Foundry Inc.",
"license": "MIT",
Expand Down Expand Up @@ -35,11 +35,11 @@
"workflow"
],
"devDependencies": {
"@types/react": "^18.0.21",
"@types/react": "^18.2.22",
"prop-types": "^15.8.1",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"typescript": "^4.8.4"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.2.2"
},
"peerDependencies": {
"prop-types": "^15.6.0",
Expand Down
17 changes: 3 additions & 14 deletions packages/anvil-embed-frame/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import PropTypes from 'prop-types'
* @prop {String} iframeURL
* @prop {Function} onEvent
* @prop {String} anvilURL
* @prop {boolean} enableDefaultStyles
* @prop {String} scroll
*/

Expand Down Expand Up @@ -43,20 +42,11 @@ class AnvilEmbedFrame extends React.Component {
}

render () {
const { iframeURL, onEvent, anvilURL, enableDefaultStyles, scroll, ...others } = this.props
const { iframeURL, onEvent, anvilURL, scroll, ...others } = this.props
return (
<iframe
id="anvil-embed-frame"
name="Anvil Embed Frame"
title="Anvil Embed Frame"
style={enableDefaultStyles
? {
width: '80vw',
height: '85vh',
maxWidth: '1200px',
borderStyle: 'groove',
}
: undefined}
name="AnvilEmbedFrame"
{...others} // props above may be overriden
src={iframeURL}
ref={this.iframeRef}
Expand All @@ -70,14 +60,13 @@ class AnvilEmbedFrame extends React.Component {
AnvilEmbedFrame.defaultProps = {
onEvent: () => {},
anvilURL: 'https://app.useanvil.com',
enableDefaultStyles: true,
}

AnvilEmbedFrame.propTypes = {
iframeURL: PropTypes.string.isRequired,
onLoad: PropTypes.func,
onEvent: PropTypes.func,
anvilURL: PropTypes.string,
enableDefaultStyles: PropTypes.bool,
scroll: PropTypes.oneOf(['auto', 'smooth']),
}

Expand Down
2 changes: 0 additions & 2 deletions packages/anvil-embed-frame/test/src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import AnvilEmbedFrame from '../../src/index'
describe('AnvilEmbedFrame', function () {
def('handleEvent', () => sinon.spy())
def('anvilURL', 'https://app.useanvil.com')
def('enableDefaultStyles', true)

def('render', () => shallow(
<AnvilEmbedFrame
iframeURL="http://localhost"
onEvent={$.handleEvent}
anvilURL={$.anvilURL}
enableDefaultStyles={$.enableDefaultStyles}
/>,
))

Expand Down
18 changes: 18 additions & 0 deletions packages/react-signature-modal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All notable changes to this project will be documented in this file.

## [@anvilco/react-signature-modal@2.0.0-alpha.0](https://github.com/anvilco/react-ui/compare/@anvilco/[email protected]...@anvilco/[email protected]) - 2023-09-18

### Commits

- Update deps [`52a73bd`](https://github.com/anvilco/react-ui/commit/52a73bd5f16d5435f80cd8ae76f20b2834807c40)
- Upgrade all deps [`2a89f80`](https://github.com/anvilco/react-ui/commit/2a89f80996fdf9bac6b4dfc2cd343641955dc20c)
- Publish [`4024144`](https://github.com/anvilco/react-ui/commit/4024144e3122e2e2feae8b0a119a413348e47651)

## [@anvilco/react-signature-modal@1.8.4](https://github.com/anvilco/react-ui/compare/@anvilco/[email protected]...@anvilco/[email protected]) - 2023-08-04

### Merged

- Update readme to fix import error [`#15`](https://github.com/anvilco/react-ui/pull/15)

### Commits

- Remove AnvilSignatureFrame from main readme + fix import [`f93ef25`](https://github.com/anvilco/react-ui/commit/f93ef251be022bae5521fa57cd3fac818e896954)

## [@anvilco/react-signature-modal@1.8.3](https://github.com/anvilco/react-ui/compare/@anvilco/[email protected]...@anvilco/[email protected]) - 2022-10-05

### Merged
Expand Down
Loading

0 comments on commit 26fb2eb

Please sign in to comment.