codelabs-react
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -9,8 +9,4 @@ "use strict"; | ||
var _assert = _interopRequireDefault(require("assert")); | ||
var _document = require("../stories/document-1607876232180.json"); | ||
var _expected = _interopRequireDefault(require("./__test/expected.json")); | ||
var _extract = _interopRequireDefault(require("./extract")); | ||
@@ -30,3 +26,3 @@ | ||
_assert["default"].deepStrictEqual(JSON.parse(JSON.stringify(tree)), _expected["default"]); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
@@ -33,0 +29,0 @@ test("Page can be navigated using the side navigation", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { |
@@ -61,5 +61,5 @@ "use strict"; | ||
return _objectSpread(_objectSpread({ | ||
return _objectSpread(_objectSpread(_objectSpread({ | ||
content: element.textRun.content | ||
}, getElementProperties(element)), getBold(element)); | ||
}, getElementProperties(element)), getBold(element)), getItalic(element)); | ||
}) | ||
@@ -244,2 +244,8 @@ }; | ||
function getItalic(element) { | ||
return { | ||
italic: !!element.textRun.textStyle.italic | ||
}; | ||
} | ||
function getParagraphText(node) { | ||
@@ -246,0 +252,0 @@ return node.paragraph.elements[0].textRun.content; |
@@ -183,2 +183,6 @@ "use strict"; | ||
return /*#__PURE__*/_react["default"].createElement("span", { | ||
style: { | ||
fontWeight: element.bold ? "bold" : "normal", | ||
fontStyle: element.italic ? "italic" : "normal" | ||
}, | ||
key: key | ||
@@ -185,0 +189,0 @@ }, element.content); |
{ | ||
"name": "codelabs-react", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -11,6 +11,3 @@ import React from "react"; | ||
import assert from "assert"; | ||
import { content } from "../stories/document-1607876232180.json"; | ||
import expected from "./__test/expected.json"; | ||
import Extract from "./extract"; | ||
@@ -24,3 +21,3 @@ | ||
const tree = Extract.parse(content); | ||
assert.deepStrictEqual(JSON.parse(JSON.stringify(tree)), expected); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
@@ -27,0 +24,0 @@ |
@@ -47,2 +47,3 @@ const infoColor = { red: 0.8509804, green: 0.91764706, blue: 0.827451 }; | ||
...getBold(element), | ||
...getItalic(element), | ||
}; | ||
@@ -265,2 +266,8 @@ }), | ||
function getItalic(element) { | ||
return { | ||
italic: !!element.textRun.textStyle.italic, | ||
}; | ||
} | ||
function getParagraphText(node) { | ||
@@ -267,0 +274,0 @@ return node.paragraph.elements[0].textRun.content; |
@@ -160,3 +160,13 @@ import React, { useState } from "react"; | ||
return <span key={key}>{element.content}</span>; | ||
return ( | ||
<span | ||
style={{ | ||
fontWeight: element.bold ? "bold" : "normal", | ||
fontStyle: element.italic ? "italic" : "normal", | ||
}} | ||
key={key} | ||
> | ||
{element.content} | ||
</span> | ||
); | ||
})} | ||
@@ -163,0 +173,0 @@ </Tag> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
304095
14
1334
1