Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
32 lines
828 B
Plaintext
32 lines
828 B
Plaintext
import { jsx as _jsx } from "react/jsx-runtime";
|
|
import React from 'react';
|
|
import { HtmlDiff } from './diff/index.js';
|
|
import './index.scss';
|
|
const baseClass = 'html-diff';
|
|
export const getHTMLDiffComponents = ({
|
|
fromHTML,
|
|
toHTML,
|
|
tokenizeByCharacter
|
|
}) => {
|
|
const diffHTML = new HtmlDiff(fromHTML, toHTML, {
|
|
tokenizeByCharacter
|
|
});
|
|
const [oldHTML, newHTML] = diffHTML.getSideBySideContents();
|
|
const From = oldHTML ? /*#__PURE__*/_jsx("div", {
|
|
className: `${baseClass}__diff-old html-diff`,
|
|
dangerouslySetInnerHTML: {
|
|
__html: oldHTML
|
|
}
|
|
}) : null;
|
|
const To = newHTML ? /*#__PURE__*/_jsx("div", {
|
|
className: `${baseClass}__diff-new html-diff`,
|
|
dangerouslySetInnerHTML: {
|
|
__html: newHTML
|
|
}
|
|
}) : null;
|
|
return {
|
|
From,
|
|
To
|
|
};
|
|
};
|
|
//# sourceMappingURL=index.js.map |