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

chore(deps): update markdown-editor, markdown-slate, and cicero deps #287

Merged
merged 1 commit into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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