Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
chore(deps): update markdown-editor, markdown-slate, and cicero deps
Browse files Browse the repository at this point in the history
Signed-off-by: Diana Lease <[email protected]>
  • Loading branch information
DianaLease committed Feb 18, 2020
1 parent e902c9f commit d021d8e
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 79 deletions.
6 changes: 4 additions & 2 deletions demo/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {

import { Clause, Template } from '@accordproject/cicero-core';
import { SlateTransformer } from '@accordproject/markdown-slate';
import { Value } from 'slate';

import { render } from 'react-dom';
import 'semantic-ui-css/semantic.min.css';
Expand Down Expand Up @@ -52,7 +53,7 @@ ${clauseText}
Fin.
`;
return slateTransformer.fromMarkdown(defaultContractMarkdown);
return Value.fromJSON(slateTransformer.fromMarkdown(defaultContractMarkdown));
};

/**
Expand All @@ -62,11 +63,12 @@ ${clauseText}
*/
const parseClause = (template, clauseNode) => {
try {
const clauseNodeJson = clauseNode.toJSON();
const ciceroClause = new Clause(template);
const slateTransformer = new SlateTransformer();
const value = {
document: {
nodes: clauseNode.nodes
nodes: clauseNodeJson.nodes
}
};
const text = slateTransformer.toMarkdown(value, { wrapVariables: false });
Expand Down
144 changes: 72 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"depcheck": "node ./scripts/depcheck.js"
},
"dependencies": {
"@accordproject/markdown-editor": "^0.9.6",
"@accordproject/markdown-slate": "^0.9.9",
"@accordproject/markdown-editor": "^0.9.7",
"@accordproject/markdown-slate": "^0.10.0",
"lodash": "^4.17.15",
"mini-css-extract-plugin": "^0.7.0",
"node-sass": "^4.13.1",
Expand All @@ -39,7 +39,7 @@
"styled-components": ">= 4"
},
"devDependencies": {
"@accordproject/cicero-core": "0.20.6",
"@accordproject/cicero-core": "^0.20.9",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.0",
"@babel/plugin-proposal-class-properties": "^7.7.0",
Expand Down Expand Up @@ -110,4 +110,4 @@
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
]
}
}
}
3 changes: 2 additions & 1 deletion src/ContractEditor/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { render } from '@testing-library/react';
import { SlateTransformer } from '@accordproject/markdown-slate';
import { Chance } from 'chance';
import { Value } from 'slate';
import ContractEditor from './index';

const slateTransformer = new SlateTransformer();
Expand Down Expand Up @@ -30,7 +31,7 @@ const props = {

const setup = (content = null) => {
const ref = React.createRef();
const value = content ? slateTransformer.fromMarkdown(content) : null;
const value = content ? Value.fromJSON(slateTransformer.fromMarkdown(content)) : null;
return render(<ContractEditor {...props} value={value} ref={ref} />);
};

Expand Down

0 comments on commit d021d8e

Please sign in to comment.