@readme/markdown 6.75.0-beta.33 → 6.75.0-beta.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.node.js CHANGED
@@ -6876,133 +6876,6 @@ AnchorWithContext.getHref = getHref;
6876
6876
 
6877
6877
  /***/ }),
6878
6878
 
6879
- /***/ 735:
6880
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6881
-
6882
- const _excluded = ["src", "alt"],
6883
- _excluded2 = ["lazy", "provider", "url", "title", "html", "iframe", "image", "favicon"];
6884
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6885
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6886
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6887
- /* eslint-disable react/jsx-props-no-spreading, jsx-a11y/iframe-has-title */
6888
- const propTypes = __webpack_require__(556);
6889
- const React = __webpack_require__(540);
6890
- const Favicon = _ref => {
6891
- let {
6892
- src,
6893
- alt = 'favicon'
6894
- } = _ref,
6895
- attr = _objectWithoutProperties(_ref, _excluded);
6896
- return /*#__PURE__*/React.createElement("img", _extends({}, attr, {
6897
- alt: alt,
6898
- height: "14",
6899
- src: src,
6900
- width: "14"
6901
- }));
6902
- };
6903
- Favicon.propTypes = {
6904
- alt: propTypes.string,
6905
- src: propTypes.string
6906
- };
6907
- class Embed extends React.Component {
6908
- render() {
6909
- const _this$props = this.props,
6910
- {
6911
- lazy = true,
6912
- provider,
6913
- url,
6914
- title,
6915
- html,
6916
- iframe,
6917
- image,
6918
- favicon
6919
- } = _this$props,
6920
- attrs = _objectWithoutProperties(_this$props, _excluded2);
6921
- if (!url) {
6922
- return /*#__PURE__*/React.createElement("div", null);
6923
- }
6924
- if ('iframe' in this.props) {
6925
- return /*#__PURE__*/React.createElement("iframe", _extends({}, attrs, {
6926
- border: "none",
6927
- src: url,
6928
- style: {
6929
- border: 'none',
6930
- display: 'flex',
6931
- margin: 'auto'
6932
- }
6933
- }));
6934
- }
6935
- const classes = ['embed', image && 'embed_hasImg'];
6936
- return /*#__PURE__*/React.createElement("div", {
6937
- className: classes.join(' ')
6938
- }, html ? /*#__PURE__*/React.createElement("div", {
6939
- className: "embed-media",
6940
- dangerouslySetInnerHTML: {
6941
- __html: html
6942
- }
6943
- }) : /*#__PURE__*/React.createElement("a", {
6944
- className: "embed-link",
6945
- href: url,
6946
- rel: "noopener noreferrer",
6947
- target: "_blank"
6948
- }, !image || /*#__PURE__*/React.createElement("img", {
6949
- alt: title,
6950
- className: "embed-img",
6951
- loading: lazy ? 'lazy' : '',
6952
- src: image
6953
- }), title ? /*#__PURE__*/React.createElement("div", {
6954
- className: "embed-body"
6955
- }, !favicon || /*#__PURE__*/React.createElement(Favicon, {
6956
- alt: provider,
6957
- className: "embed-favicon",
6958
- loading: lazy ? 'lazy' : '',
6959
- src: favicon,
6960
- style: {
6961
- float: 'left'
6962
- }
6963
- }), provider && /*#__PURE__*/React.createElement("small", {
6964
- className: "embed-provider"
6965
- }, provider.search(/^@{1}/) < 0 ? provider : /*#__PURE__*/React.createElement("code", {
6966
- style: {
6967
- fontFamily: 'var(--md-code-font, monospace)'
6968
- }
6969
- }, url)), /*#__PURE__*/React.createElement("div", {
6970
- className: "embed-title"
6971
- }, title)) : /*#__PURE__*/React.createElement("div", {
6972
- className: "embed-body"
6973
- }, /*#__PURE__*/React.createElement("b", null, "View"), ": ", /*#__PURE__*/React.createElement("span", {
6974
- className: "embed-body-url"
6975
- }, url))));
6976
- }
6977
- }
6978
- Embed.propTypes = {
6979
- children: propTypes.oneOfType([propTypes.string, propTypes.array, propTypes.shape({}), propTypes.element]),
6980
- favicon: propTypes.string,
6981
- height: propTypes.string,
6982
- html: propTypes.string,
6983
- iframe: propTypes.any,
6984
- image: propTypes.string,
6985
- lazy: propTypes.bool,
6986
- provider: propTypes.string,
6987
- title: propTypes.string,
6988
- url: propTypes.oneOfType([propTypes.string, propTypes.shape({})]),
6989
- width: propTypes.string
6990
- };
6991
- Embed.defaultProps = {
6992
- height: '300px',
6993
- width: '100%'
6994
- };
6995
- const CreateEmbed = ({
6996
- lazyImages
6997
- }) =>
6998
- // eslint-disable-next-line react/display-name
6999
- props => /*#__PURE__*/React.createElement(Embed, _extends({}, props, {
7000
- lazy: lazyImages
7001
- }));
7002
- module.exports = CreateEmbed;
7003
-
7004
- /***/ }),
7005
-
7006
6879
  /***/ 398:
7007
6880
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7008
6881
 
@@ -10053,7 +9926,7 @@ __webpack_require__.d(components_namespaceObject, {
10053
9926
  Callout: () => (components_Callout),
10054
9927
  Code: () => (components_Code),
10055
9928
  CodeTabs: () => (components_CodeTabs),
10056
- Embed: () => ((Embed_default())),
9929
+ Embed: () => (components_Embed),
10057
9930
  GlossaryItem: () => (GlossaryItemWithContext),
10058
9931
  HTMLBlock: () => (components_HTMLBlock),
10059
9932
  Heading: () => ((Heading_default())),
@@ -58470,9 +58343,46 @@ const CodeTabs = props => {
58470
58343
  };
58471
58344
  /* harmony default export */ const components_CodeTabs = (CodeTabs);
58472
58345
 
58473
- // EXTERNAL MODULE: ./components/Embed/index.jsx
58474
- var Embed = __webpack_require__(735);
58475
- var Embed_default = /*#__PURE__*/__webpack_require__.n(Embed);
58346
+ ;// CONCATENATED MODULE: ./components/Embed/index.tsx
58347
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
58348
+ var t = {};
58349
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
58350
+ t[p] = s[p];
58351
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
58352
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
58353
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
58354
+ t[p[i]] = s[p[i]];
58355
+ }
58356
+ return t;
58357
+ };
58358
+
58359
+ const Favicon = (_a) => {
58360
+ var { src, alt = 'favicon' } = _a, attr = __rest(_a, ["src", "alt"]);
58361
+ return (react.createElement("img", Object.assign({}, attr, { alt: alt, height: "14", src: src, width: "14" })));
58362
+ };
58363
+ const Embed = (_a) => {
58364
+ var { lazy = true, url, provider, title, html, iframe, image, favicon } = _a, attrs = __rest(_a, ["lazy", "url", "provider", "title", "html", "iframe", "image", "favicon"]);
58365
+ if (iframe) {
58366
+ return react.createElement("iframe", Object.assign({}, attrs, { src: url, style: { border: 'none', display: 'flex', margin: 'auto' } }));
58367
+ }
58368
+ if (!provider)
58369
+ provider = new URL(url).hostname
58370
+ .split(/(?:www)?\./)
58371
+ .filter(i => i)
58372
+ .join('.');
58373
+ const classes = ['embed', image ? 'embed_hasImg' : ''];
58374
+ return (react.createElement("div", { className: classes.join(' ') }, html ? (react.createElement("div", { className: "embed-media", dangerouslySetInnerHTML: { __html: html } })) : (react.createElement("a", { className: "embed-link", href: url, rel: "noopener noreferrer", target: "_blank" },
58375
+ !image || react.createElement("img", { alt: title, className: "embed-img", loading: lazy ? 'lazy' : undefined, src: image }),
58376
+ title ? (react.createElement("div", { className: "embed-body" },
58377
+ !favicon || react.createElement(Favicon, { alt: provider, src: favicon }),
58378
+ provider && (react.createElement("small", { className: "embed-provider" }, provider.search(/^@{1}/) < 0 ? (provider) : (react.createElement("code", { style: { fontFamily: 'var(--md-code-font, monospace)' } }, url)))),
58379
+ react.createElement("div", { className: "embed-title" }, title))) : (react.createElement("div", { className: "embed-body" },
58380
+ react.createElement("b", null, "View"),
58381
+ ": ",
58382
+ react.createElement("span", { className: "embed-body-url" }, url)))))));
58383
+ };
58384
+ /* harmony default export */ const components_Embed = (Embed);
58385
+
58476
58386
  ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js
58477
58387
  function getWindow(node) {
58478
58388
  if (node == null) {
@@ -63486,8 +63396,9 @@ var Heading = __webpack_require__(398);
63486
63396
  var Heading_default = /*#__PURE__*/__webpack_require__.n(Heading);
63487
63397
  ;// CONCATENATED MODULE: ./components/Image/index.tsx
63488
63398
 
63489
- const Image = ({ align = '', alt = '', border = false, caption, className = '', height = 'auto', src = '', title = '', width = 'auto', lazy = false, }) => {
63399
+ const Image = (Props) => {
63490
63400
  const [lightbox, setLightbox] = react.useState(false);
63401
+ const { align = '', alt = '', border = false, caption, className = '', height = 'auto', src, title = '', width = 'auto', lazy = false, } = Props;
63491
63402
  if (className === 'emoji') {
63492
63403
  return react.createElement("img", { src: src, width: width, height: height, title: title, alt: alt, loading: lazy ? 'lazy' : 'eager' });
63493
63404
  }
@@ -63660,9 +63571,22 @@ const parseOptions = (userOpts = {}) => {
63660
63571
  return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
63661
63572
  });
63662
63573
 
63574
+ ;// CONCATENATED MODULE: ./enums.ts
63575
+ var NodeTypes;
63576
+ (function (NodeTypes) {
63577
+ NodeTypes["callout"] = "rdme-callout";
63578
+ NodeTypes["codeTabs"] = "code-tabs";
63579
+ NodeTypes["emoji"] = "emoji";
63580
+ NodeTypes["i"] = "i";
63581
+ NodeTypes["image"] = "image";
63582
+ NodeTypes["htmlBlock"] = "html-block";
63583
+ NodeTypes["embed"] = "rdme-embed";
63584
+ })(NodeTypes || (NodeTypes = {}));
63585
+
63663
63586
  ;// CONCATENATED MODULE: ./processor/transform/callouts.ts
63664
63587
 
63665
63588
 
63589
+
63666
63590
  const callouts_regex = `^(${emoji_regex().source}|⚠)(\\s+|$)`;
63667
63591
  const calloutTransformer = () => {
63668
63592
  return (tree) => {
@@ -63675,7 +63599,7 @@ const calloutTransformer = () => {
63675
63599
  if (icon && match) {
63676
63600
  const heading = startText.slice(match.length);
63677
63601
  node.children.shift();
63678
- node.type = 'rdme-callout';
63602
+ node.type = NodeTypes.callout;
63679
63603
  node.data = {
63680
63604
  hName: 'Callout',
63681
63605
  hProperties: {
@@ -63693,21 +63617,10 @@ const calloutTransformer = () => {
63693
63617
  };
63694
63618
  /* harmony default export */ const callouts = (calloutTransformer);
63695
63619
 
63696
- ;// CONCATENATED MODULE: ./enums.ts
63697
- var NodeTypes;
63698
- (function (NodeTypes) {
63699
- NodeTypes["callout"] = "callout";
63700
- NodeTypes["codeTabs"] = "code-tabs";
63701
- NodeTypes["emoji"] = "emoji";
63702
- NodeTypes["i"] = "i";
63703
- NodeTypes["image"] = "image";
63704
- NodeTypes["htmlBlock"] = "html-block";
63705
- })(NodeTypes || (NodeTypes = {}));
63706
-
63707
63620
  ;// CONCATENATED MODULE: ./processor/transform/code-tabs.ts
63708
63621
 
63709
63622
 
63710
- const codeTabs = () => tree => {
63623
+ const codeTabsTransformer = () => tree => {
63711
63624
  visit(tree, 'code', (node) => {
63712
63625
  const { lang, meta, value } = node;
63713
63626
  node.data = {
@@ -63750,7 +63663,31 @@ const codeTabs = () => tree => {
63750
63663
  });
63751
63664
  return tree;
63752
63665
  };
63753
- /* harmony default export */ const code_tabs = (codeTabs);
63666
+ /* harmony default export */ const code_tabs = (codeTabsTransformer);
63667
+
63668
+ ;// CONCATENATED MODULE: ./processor/transform/embeds.ts
63669
+
63670
+
63671
+ const embedTransformer = () => {
63672
+ return (tree) => {
63673
+ visit(tree, 'link', (node, _, parent) => {
63674
+ var _a, _b;
63675
+ if (parent.type !== 'paragraph' || parent.children.length > 1 || node.title !== '@embed')
63676
+ return;
63677
+ const newNode = {
63678
+ type: NodeTypes.embed,
63679
+ data: {
63680
+ hProperties: { title: (_b = (_a = node.children[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : node.url, url: node.url, provider: node.url },
63681
+ hName: 'Embed',
63682
+ },
63683
+ position: node.position,
63684
+ children: [],
63685
+ };
63686
+ parent = newNode;
63687
+ });
63688
+ };
63689
+ };
63690
+ /* harmony default export */ const transform_embeds = (embedTransformer);
63754
63691
 
63755
63692
  ;// CONCATENATED MODULE: ./node_modules/gemoji/index.js
63756
63693
  /**
@@ -80829,7 +80766,8 @@ const readmeComponents = (opts) => () => tree => {
80829
80766
 
80830
80767
 
80831
80768
 
80832
- /* harmony default export */ const transform = ([callouts, code_tabs, gemoji_]);
80769
+
80770
+ /* harmony default export */ const transform = ([callouts, code_tabs, transform_embeds, gemoji_]);
80833
80771
 
80834
80772
  ;// CONCATENATED MODULE: ./processor/compile/gemoji.ts
80835
80773
  const gemoji_gemoji = (node) => `:${node.name}:`;
@@ -80837,7 +80775,7 @@ const gemoji_gemoji = (node) => `:${node.name}:`;
80837
80775
 
80838
80776
  ;// CONCATENATED MODULE: ./processor/compile/code-tabs.ts
80839
80777
 
80840
- const code_tabs_codeTabs = (node, _, state, info) => {
80778
+ const codeTabs = (node, _, state, info) => {
80841
80779
  const exit = state.enter(NodeTypes.codeTabs);
80842
80780
  const tracker = state.createTracker(info);
80843
80781
  state.join.push(() => 0);
@@ -80846,7 +80784,25 @@ const code_tabs_codeTabs = (node, _, state, info) => {
80846
80784
  exit();
80847
80785
  return value;
80848
80786
  };
80849
- /* harmony default export */ const compile_code_tabs = (code_tabs_codeTabs);
80787
+ /* harmony default export */ const compile_code_tabs = (codeTabs);
80788
+
80789
+ ;// CONCATENATED MODULE: ./processor/compile/embed.ts
80790
+ const embed_embed = (node) => {
80791
+ var _a, _b;
80792
+ const { image, favicon, iframe, title, url } = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
80793
+ const complexEmbed = Boolean(image) || Boolean(favicon) || iframe;
80794
+ if (complexEmbed)
80795
+ return `<Embed ${Object.assign({}, (_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties)} />`;
80796
+ return `[${title}](${url} "@embed")'`;
80797
+ };
80798
+ /* harmony default export */ const compile_embed = (embed_embed);
80799
+
80800
+ ;// CONCATENATED MODULE: ./processor/compile/html-block.ts
80801
+ const htmlBlock = (node) => {
80802
+ const html = node.data.hProperties.html;
80803
+ return `<HTMLBlock>${JSON.stringify({ html }, null, 2)}</HTMLBlock>`;
80804
+ };
80805
+ /* harmony default export */ const html_block = (htmlBlock);
80850
80806
 
80851
80807
  ;// CONCATENATED MODULE: ./processor/compile/image.ts
80852
80808
  const compile_image_image = (node) => {
@@ -80859,27 +80815,22 @@ const compile_image_image = (node) => {
80859
80815
  };
80860
80816
  /* harmony default export */ const compile_image = (compile_image_image);
80861
80817
 
80862
- ;// CONCATENATED MODULE: ./processor/compile/html-block.ts
80863
- const htmlBlock = (node) => {
80864
- const html = node.data.hProperties.html;
80865
- return `<HTMLBlock>${JSON.stringify({ html }, null, 2)}</HTMLBlock>`;
80866
- };
80867
- /* harmony default export */ const html_block = (htmlBlock);
80868
-
80869
80818
  ;// CONCATENATED MODULE: ./processor/compile/index.ts
80870
80819
 
80871
80820
 
80872
80821
 
80873
80822
 
80874
80823
 
80824
+
80875
80825
  function compilers() {
80876
80826
  const data = this.data();
80877
80827
  const toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
80878
80828
  const handlers = {
80879
80829
  [NodeTypes.emoji]: compile_gemoji,
80880
80830
  [NodeTypes.codeTabs]: compile_code_tabs,
80881
- [NodeTypes.image]: compile_image,
80831
+ [NodeTypes.embed]: compile_embed,
80882
80832
  [NodeTypes.htmlBlock]: html_block,
80833
+ [NodeTypes.image]: compile_image,
80883
80834
  };
80884
80835
  toMarkdownExtensions.push({ extensions: [{ handlers }] });
80885
80836
  }
@@ -80907,7 +80858,7 @@ class MdxSyntaxError extends SyntaxError {
80907
80858
  }
80908
80859
 
80909
80860
  ;// CONCATENATED MODULE: ./index.tsx
80910
- var __rest = (undefined && undefined.__rest) || function (s, e) {
80861
+ var index_rest = (undefined && undefined.__rest) || function (s, e) {
80911
80862
  var t = {};
80912
80863
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
80913
80864
  t[p] = s[p];
@@ -80967,7 +80918,7 @@ const index_compile = (text, opts = {}) => {
80967
80918
  };
80968
80919
  const index_run = async (code, _opts = {}) => {
80969
80920
  const { Fragment } = jsx_runtime_namespaceObject;
80970
- const { components } = _opts, opts = __rest(_opts, ["components"]);
80921
+ const { components } = _opts, opts = index_rest(_opts, ["components"]);
80971
80922
  const file = await run(code, Object.assign(Object.assign(Object.assign({}, jsx_runtime_namespaceObject), { Fragment, baseUrl: "file:///home/runner/work/markdown/markdown/index.tsx", imports: { React: react }, useMDXComponents: makeUseMDXComponents(components) }), opts));
80972
80923
  return (file === null || file === void 0 ? void 0 : file.default) || (() => null);
80973
80924
  };
@@ -0,0 +1,3 @@
1
+ import type { Embed } from "types";
2
+ declare const embed: (node: Embed) => string;
3
+ export default embed;
@@ -1,2 +1,2 @@
1
- declare const codeTabs: () => (tree: any) => any;
2
- export default codeTabs;
1
+ declare const codeTabsTransformer: () => (tree: any) => any;
2
+ export default codeTabsTransformer;
@@ -0,0 +1,2 @@
1
+ declare const embedTransformer: () => (tree: any) => void;
2
+ export default embedTransformer;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "6.75.0-beta.33",
5
+ "version": "6.75.0-beta.34",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",
@@ -1,89 +0,0 @@
1
- /* eslint-disable react/jsx-props-no-spreading, jsx-a11y/iframe-has-title */
2
- const propTypes = require('prop-types');
3
- const React = require('react');
4
-
5
- const Favicon = ({ src, alt = 'favicon', ...attr }) => <img {...attr} alt={alt} height="14" src={src} width="14" />;
6
- Favicon.propTypes = {
7
- alt: propTypes.string,
8
- src: propTypes.string,
9
- };
10
-
11
- class Embed extends React.Component {
12
- render() {
13
- const { lazy = true, provider, url, title, html, iframe, image, favicon, ...attrs } = this.props;
14
-
15
- if (!url) {
16
- return <div />;
17
- }
18
-
19
- if ('iframe' in this.props) {
20
- return <iframe {...attrs} border="none" src={url} style={{ border: 'none', display: 'flex', margin: 'auto' }} />;
21
- }
22
-
23
- const classes = ['embed', image && 'embed_hasImg'];
24
- return (
25
- <div className={classes.join(' ')}>
26
- {html ? (
27
- <div className="embed-media" dangerouslySetInnerHTML={{ __html: html }}></div>
28
- ) : (
29
- <a className="embed-link" href={url} rel="noopener noreferrer" target="_blank">
30
- {!image || <img alt={title} className="embed-img" loading={lazy ? 'lazy' : ''} src={image} />}
31
- {title ? (
32
- <div className="embed-body">
33
- {!favicon || (
34
- <Favicon
35
- alt={provider}
36
- className="embed-favicon"
37
- loading={lazy ? 'lazy' : ''}
38
- src={favicon}
39
- style={{ float: 'left' }}
40
- />
41
- )}
42
- {provider && (
43
- <small className="embed-provider">
44
- {provider.search(/^@{1}/) < 0 ? (
45
- provider
46
- ) : (
47
- <code style={{ fontFamily: 'var(--md-code-font, monospace)' }}>{url}</code>
48
- )}
49
- </small>
50
- )}
51
- <div className="embed-title">{title}</div>
52
- </div>
53
- ) : (
54
- <div className="embed-body">
55
- <b>View</b>: <span className="embed-body-url">{url}</span>
56
- </div>
57
- )}
58
- </a>
59
- )}
60
- </div>
61
- );
62
- }
63
- }
64
-
65
- Embed.propTypes = {
66
- children: propTypes.oneOfType([propTypes.string, propTypes.array, propTypes.shape({}), propTypes.element]),
67
- favicon: propTypes.string,
68
- height: propTypes.string,
69
- html: propTypes.string,
70
- iframe: propTypes.any,
71
- image: propTypes.string,
72
- lazy: propTypes.bool,
73
- provider: propTypes.string,
74
- title: propTypes.string,
75
- url: propTypes.oneOfType([propTypes.string, propTypes.shape({})]),
76
- width: propTypes.string,
77
- };
78
- Embed.defaultProps = {
79
- height: '300px',
80
- width: '100%',
81
- };
82
-
83
- const CreateEmbed =
84
- ({ lazyImages }) =>
85
- // eslint-disable-next-line react/display-name
86
- props =>
87
- <Embed {...props} lazy={lazyImages} />;
88
-
89
- module.exports = CreateEmbed;