From d021d8e1087f9cc444e49c3ec74f474b8a5aad2a Mon Sep 17 00:00:00 2001 From: Diana Lease Date: Tue, 18 Feb 2020 14:57:44 -0500 Subject: [PATCH] chore(deps): update markdown-editor, markdown-slate, and cicero deps Signed-off-by: Diana Lease --- demo/src/index.js | 6 +- package-lock.json | 144 +++++++++++++++---------------- package.json | 8 +- src/ContractEditor/index.test.js | 3 +- 4 files changed, 82 insertions(+), 79 deletions(-) diff --git a/demo/src/index.js b/demo/src/index.js index 035969e0..b4c4671a 100644 --- a/demo/src/index.js +++ b/demo/src/index.js @@ -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'; @@ -52,7 +53,7 @@ ${clauseText} Fin. `; - return slateTransformer.fromMarkdown(defaultContractMarkdown); + return Value.fromJSON(slateTransformer.fromMarkdown(defaultContractMarkdown)); }; /** @@ -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 }); diff --git a/package-lock.json b/package-lock.json index ef5e0b71..3de49d42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,19 @@ { "name": "@accordproject/cicero-ui", - "version": "0.5.7", + "version": "0.5.8", "lockfileVersion": 1, "requires": true, "dependencies": { "@accordproject/cicero-core": { - "version": "0.20.6", - "resolved": "https://registry.npmjs.org/@accordproject/cicero-core/-/cicero-core-0.20.6.tgz", - "integrity": "sha512-0HLuFqGU/lhhxq9mpe2zFXXf9Xo/+swXnghttPDD/UbTuqiSA/Zhb2Jni+P2WGlDi2NXiCohiqgzONo96spluw==", + "version": "0.20.9", + "resolved": "https://registry.npmjs.org/@accordproject/cicero-core/-/cicero-core-0.20.9.tgz", + "integrity": "sha512-gU0Sk+aCNBJ/eOHK6zVGWCK+ZJolAEugzbu2C3CeNuEp+X4tAw95MDAHly4YELOa7ZMfAyBxG+B3XoY1yJAD+w==", "dev": true, "requires": { "@accordproject/concerto-core": "0.82.6", - "@accordproject/ergo-compiler": "0.20.5", - "@accordproject/ergo-engine": "0.20.5", - "@accordproject/markdown-common": "0.9.2", + "@accordproject/ergo-compiler": "0.20.9", + "@accordproject/ergo-engine": "0.20.9", + "@accordproject/markdown-common": "0.10.0", "axios": "0.19.0", "debug": "4.1.0", "ietf-language-tag-regex": "0.0.5", @@ -74,14 +74,14 @@ } }, "@accordproject/ergo-compiler": { - "version": "0.20.5", - "resolved": "https://registry.npmjs.org/@accordproject/ergo-compiler/-/ergo-compiler-0.20.5.tgz", - "integrity": "sha512-nn7nSbxUSFHb41bgdvn+pCDiepwzTMIV4btzCrvqb+wU2SHYrsocMWjoKbJnV61mzYM5OQ89znaMg9cG2IUi8w==", + "version": "0.20.9", + "resolved": "https://registry.npmjs.org/@accordproject/ergo-compiler/-/ergo-compiler-0.20.9.tgz", + "integrity": "sha512-f3N3amyM2x6maHBRcnDqcAB5Co5zMbMzIuz2VHkAj41jk3yeU0KZvDpbGgjBNNDjJSzYvZK48Gv+sLM+IlmKKA==", "dev": true, "requires": { "@accordproject/concerto-core": "0.82.6", - "@accordproject/markdown-cicero": "0.9.2", - "@accordproject/markdown-common": "0.9.2", + "@accordproject/markdown-cicero": "0.10.0", + "@accordproject/markdown-common": "0.10.0", "acorn": "5.1.2", "debug": "4.1.0", "doctrine": "3.0.0", @@ -117,24 +117,24 @@ } }, "@accordproject/ergo-engine": { - "version": "0.20.5", - "resolved": "https://registry.npmjs.org/@accordproject/ergo-engine/-/ergo-engine-0.20.5.tgz", - "integrity": "sha512-3Q8TnW2UI+Q25m6BYK0kaANvKnL0yujd8Nrrq0918wOXJlgDkhh4Tt0nZnDrt4UkoCCh+evGEEvHqESbRbepCw==", + "version": "0.20.9", + "resolved": "https://registry.npmjs.org/@accordproject/ergo-engine/-/ergo-engine-0.20.9.tgz", + "integrity": "sha512-Rycc61fXHO9U/V8DmuL8Z1eR0uwECAwCQMxY72v2W5bkHzSwo0UystTtBXzowBfESfVf89yO2zPt0E+GmTpLdw==", "dev": true, "requires": { - "@accordproject/ergo-compiler": "0.20.5", + "@accordproject/ergo-compiler": "0.20.9", "moment-mini": "2.22.1", "vm2": "3.5.0" } }, "@accordproject/markdown-cicero": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-cicero/-/markdown-cicero-0.9.2.tgz", - "integrity": "sha512-/GSWyRoLO9rMZ6En0JUgPkeUT0AS9+GL4bm18Qs6ne+W/zJbSZK9EuAKADNhXEQf7dhKZ/i6j4RGQ3HqagzhSQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-cicero/-/markdown-cicero-0.10.0.tgz", + "integrity": "sha512-O4pUyOgtDFfxVgGtY0ZrJ4i/ZgCqkf+h+hX7gPFfkpY2T3qsXjwptej9ysonjCFt9+xM7Yp/imC0WKECfjz4gw==", "dev": true, "requires": { "@accordproject/concerto-core": "^0.82.6", - "@accordproject/markdown-common": "0.9.2", + "@accordproject/markdown-common": "0.10.0", "commonmark": "^0.29.0", "jsome": "2.5.0", "sax": "^1.2.4", @@ -143,9 +143,9 @@ } }, "@accordproject/markdown-common": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-common/-/markdown-common-0.9.2.tgz", - "integrity": "sha512-soAOT8eZgFePDjv4a/mpJYDiqlD/qpq611qRCkQLByTSUfdA8jpypzoHiV+1arO/2P5Nt0EGqtsv/aowNTZ2HA==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-common/-/markdown-common-0.10.0.tgz", + "integrity": "sha512-zIZyX6ZbHi/xUWCTIGnwFmRK4UdaQ7oF15IGUPz64+/c1ZkMN2n4Py2blsSrFnW3xn5FtfN8stMa/7iPQU0VuA==", "dev": true, "requires": { "@accordproject/concerto-core": "^0.82.6", @@ -157,12 +157,12 @@ } }, "@accordproject/markdown-editor": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-editor/-/markdown-editor-0.9.6.tgz", - "integrity": "sha512-2NV2B9DXP6qIas4sVgbwWcyyZky+qbBYwGSRC9tCyUTNzmmFXs+db1qVYxsoz+14t/rrpVlce/v31V4QYRYbMQ==", + "version": "0.9.7", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-editor/-/markdown-editor-0.9.7.tgz", + "integrity": "sha512-FzuoKWPNskvYv4wDC3l218KuUpc5ACRmuf+BRwf+Y2jd9t9sFeViNJYK58Cj+uISGLzW0BOcpGw7xF+OfCfNFw==", "requires": { - "@accordproject/markdown-html": "^0.9.9", - "@accordproject/markdown-slate": "^0.9.9", + "@accordproject/markdown-html": "^0.10.0", + "@accordproject/markdown-slate": "^0.10.0", "@babel/runtime": "^7.8.4", "css-loader": "^3.2.0", "immutable": "^3.8.2", @@ -197,23 +197,23 @@ } }, "@accordproject/markdown-html": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-html/-/markdown-html-0.9.9.tgz", - "integrity": "sha512-A8lvHyQAlqnYAWB0SdjPm9LcWq0f572zpQsWG+NQn18c1g7Kx/Q7QBfGzv50te2O2UrW6eou7WrTU/wwoehFXw==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-html/-/markdown-html-0.10.0.tgz", + "integrity": "sha512-BiBfRG3V4iNZszKBdLceHAZkb9T+W2cSOC5lSeJgmW0ThrKxwMTLkW0W03epE3EJwGjxLLp+LXuOzLPgRyQrjQ==", "requires": { - "@accordproject/markdown-cicero": "0.9.9", - "@accordproject/markdown-common": "0.9.9", + "@accordproject/markdown-cicero": "0.10.0", + "@accordproject/markdown-common": "0.10.0", "jsdom": "^15.2.1", "type-of": "^2.0.1" }, "dependencies": { "@accordproject/markdown-cicero": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-cicero/-/markdown-cicero-0.9.9.tgz", - "integrity": "sha512-5QH9+MRtRWkvA6qWK8tGlpmj7Xma/S+qNGLcnlFdOY331ADN8etXM6CrreI4PGuC1R6ScYvLZP1V9Jr8/ZOvCw==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-cicero/-/markdown-cicero-0.10.0.tgz", + "integrity": "sha512-O4pUyOgtDFfxVgGtY0ZrJ4i/ZgCqkf+h+hX7gPFfkpY2T3qsXjwptej9ysonjCFt9+xM7Yp/imC0WKECfjz4gw==", "requires": { "@accordproject/concerto-core": "^0.82.6", - "@accordproject/markdown-common": "0.9.9", + "@accordproject/markdown-common": "0.10.0", "commonmark": "^0.29.0", "jsome": "2.5.0", "sax": "^1.2.4", @@ -222,9 +222,9 @@ } }, "@accordproject/markdown-common": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-common/-/markdown-common-0.9.9.tgz", - "integrity": "sha512-xHDdWay84TNMTY2yy0b/2X1cPrQl62A5tuIL0Lehfv2d3g6QHDNLDNW38yFGAiFjUIgaDXrqhMeXDJuX1XN3Rw==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-common/-/markdown-common-0.10.0.tgz", + "integrity": "sha512-zIZyX6ZbHi/xUWCTIGnwFmRK4UdaQ7oF15IGUPz64+/c1ZkMN2n4Py2blsSrFnW3xn5FtfN8stMa/7iPQU0VuA==", "requires": { "@accordproject/concerto-core": "^0.82.6", "commonmark": "^0.29.0", @@ -325,20 +325,20 @@ } }, "@accordproject/markdown-slate": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-slate/-/markdown-slate-0.9.9.tgz", - "integrity": "sha512-8x4+R316ZJC3sFSHDlI6lcIjrsFUClD8LWxt6fXRdF8t0dVzr19h0hQbC2AdOSs27WMNoTpjYbAA3xqpNfhNFg==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-slate/-/markdown-slate-0.10.0.tgz", + "integrity": "sha512-I9+q3QI1XeyCzZ5uNvoj7GT8azFqcXKOObpagSvnfL6FnrorlMhpFEpjkQhB63n51U9U5abXYGp+eBpUEYrF/w==", "requires": { - "@accordproject/markdown-cicero": "0.9.9" + "@accordproject/markdown-cicero": "0.10.0" }, "dependencies": { "@accordproject/markdown-cicero": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-cicero/-/markdown-cicero-0.9.9.tgz", - "integrity": "sha512-5QH9+MRtRWkvA6qWK8tGlpmj7Xma/S+qNGLcnlFdOY331ADN8etXM6CrreI4PGuC1R6ScYvLZP1V9Jr8/ZOvCw==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-cicero/-/markdown-cicero-0.10.0.tgz", + "integrity": "sha512-O4pUyOgtDFfxVgGtY0ZrJ4i/ZgCqkf+h+hX7gPFfkpY2T3qsXjwptej9ysonjCFt9+xM7Yp/imC0WKECfjz4gw==", "requires": { "@accordproject/concerto-core": "^0.82.6", - "@accordproject/markdown-common": "0.9.9", + "@accordproject/markdown-common": "0.10.0", "commonmark": "^0.29.0", "jsome": "2.5.0", "sax": "^1.2.4", @@ -347,9 +347,9 @@ } }, "@accordproject/markdown-common": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/@accordproject/markdown-common/-/markdown-common-0.9.9.tgz", - "integrity": "sha512-xHDdWay84TNMTY2yy0b/2X1cPrQl62A5tuIL0Lehfv2d3g6QHDNLDNW38yFGAiFjUIgaDXrqhMeXDJuX1XN3Rw==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@accordproject/markdown-common/-/markdown-common-0.10.0.tgz", + "integrity": "sha512-zIZyX6ZbHi/xUWCTIGnwFmRK4UdaQ7oF15IGUPz64+/c1ZkMN2n4Py2blsSrFnW3xn5FtfN8stMa/7iPQU0VuA==", "requires": { "@accordproject/concerto-core": "^0.82.6", "commonmark": "^0.29.0", @@ -1315,9 +1315,9 @@ } }, "@babel/runtime-corejs2": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.7.7.tgz", - "integrity": "sha512-P91T3dFYQL7aj44PxOMIAbo66Ag3NbmXG9fseSYaXxapp3K9XTct5HU9IpTOm2D0AoktKusgqzN5YcSxZXEKBQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.8.4.tgz", + "integrity": "sha512-7jU2FgNqNHX6yTuU/Dr/vH5/O8eVL9U85MG5aDw1LzGfCvvhXC1shdXfVzCQDsoY967yrAKeLujRv7l8BU+dZA==", "dev": true, "requires": { "core-js": "^2.6.5", @@ -3569,13 +3569,13 @@ "dev": true }, "commonmark": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/commonmark/-/commonmark-0.29.0.tgz", - "integrity": "sha512-Wc3kvAIm0EK85pHsM95Fev31wEN6/zQpwd2qcLDL8psjHRoUFvUeGHevIJAdToWUuFoX8WI/gmeDauqy32xgJQ==", + "version": "0.29.1", + "resolved": "https://registry.npmjs.org/commonmark/-/commonmark-0.29.1.tgz", + "integrity": "sha512-DafPdNYFXoEhsSiR4O+dJ45UJBfDL4cBTks4B+agKiaWt7qjG0bIhg5xuCE0RqU71ikJcBIf4/sRHh9vYQVF8Q==", "requires": { - "entities": "~ 1.1.1", - "mdurl": "~ 1.0.1", - "minimist": "~ 1.2.0", + "entities": "~1.1.1", + "mdurl": "~1.0.1", + "minimist": "~1.2.0", "string.prototype.repeat": "^0.2.0" } }, @@ -4568,9 +4568,9 @@ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" }, "env-variable": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.5.tgz", - "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==" + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.6.tgz", + "integrity": "sha512-bHz59NlBbtS0NhftmR8+ExBEekE7br0e01jw+kk0NDro7TtZzBYZ5ScGPs3OmwnpyfHTHOtr1Y6uedCdrIldtg==" }, "enzyme": { "version": "3.10.0", @@ -9319,9 +9319,9 @@ }, "dependencies": { "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -15415,9 +15415,9 @@ }, "dependencies": { "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -15550,9 +15550,9 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, "xmldom": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", - "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + "version": "0.1.31", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", + "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==" }, "xregexp": { "version": "4.2.4", diff --git a/package.json b/package.json index dbe8f8d1..34965658 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -110,4 +110,4 @@ "/src/**/?(*.)(spec|test).{js,jsx,mjs}" ] } -} \ No newline at end of file +} diff --git a/src/ContractEditor/index.test.js b/src/ContractEditor/index.test.js index f5e2e144..68e60d5a 100644 --- a/src/ContractEditor/index.test.js +++ b/src/ContractEditor/index.test.js @@ -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(); @@ -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(); };