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

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())),
@@ -58384,15 +58257,17 @@ const themes = {
58384
58257
  '\u26A0': 'warn',
58385
58258
  };
58386
58259
  const Callout = (props) => {
58387
- const { attributes, children, icon, heading } = props;
58260
+ const { attributes, children, icon } = props;
58388
58261
  let theme = props.theme || themes[icon] || 'default';
58262
+ const [heading, ...body] = Array.isArray(children) ? children : [children];
58263
+ const empty = !heading.props.children;
58389
58264
  return (
58390
58265
  // @ts-ignore
58391
58266
  react.createElement("blockquote", Object.assign({}, attributes, { className: `callout callout_${theme}`, theme: icon }),
58392
- heading && (react.createElement("h3", { className: `callout-heading${heading ? '' : ' empty'}` },
58267
+ react.createElement("h3", { className: `callout-heading${empty ? ' empty' : ''}` },
58393
58268
  react.createElement("span", { className: "callout-icon" }, icon),
58394
- heading)),
58395
- children));
58269
+ !empty && heading),
58270
+ body));
58396
58271
  };
58397
58272
  /* harmony default export */ const components_Callout = (Callout);
58398
58273
 
@@ -58470,9 +58345,46 @@ const CodeTabs = props => {
58470
58345
  };
58471
58346
  /* harmony default export */ const components_CodeTabs = (CodeTabs);
58472
58347
 
58473
- // EXTERNAL MODULE: ./components/Embed/index.jsx
58474
- var Embed = __webpack_require__(735);
58475
- var Embed_default = /*#__PURE__*/__webpack_require__.n(Embed);
58348
+ ;// CONCATENATED MODULE: ./components/Embed/index.tsx
58349
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
58350
+ var t = {};
58351
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
58352
+ t[p] = s[p];
58353
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
58354
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
58355
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
58356
+ t[p[i]] = s[p[i]];
58357
+ }
58358
+ return t;
58359
+ };
58360
+
58361
+ const Favicon = (_a) => {
58362
+ var { src, alt = 'favicon' } = _a, attr = __rest(_a, ["src", "alt"]);
58363
+ return (react.createElement("img", Object.assign({}, attr, { alt: alt, height: "14", src: src, width: "14" })));
58364
+ };
58365
+ const Embed = (_a) => {
58366
+ var { lazy = true, url, provider, title, html, iframe, image, favicon } = _a, attrs = __rest(_a, ["lazy", "url", "provider", "title", "html", "iframe", "image", "favicon"]);
58367
+ if (iframe) {
58368
+ return react.createElement("iframe", Object.assign({}, attrs, { src: url, style: { border: 'none', display: 'flex', margin: 'auto' } }));
58369
+ }
58370
+ if (!provider)
58371
+ provider = new URL(url).hostname
58372
+ .split(/(?:www)?\./)
58373
+ .filter(i => i)
58374
+ .join('.');
58375
+ const classes = ['embed', image ? 'embed_hasImg' : ''];
58376
+ 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" },
58377
+ !image || react.createElement("img", { alt: title, className: "embed-img", loading: lazy ? 'lazy' : undefined, src: image }),
58378
+ title ? (react.createElement("div", { className: "embed-body" },
58379
+ !favicon || react.createElement(Favicon, { alt: provider, src: favicon }),
58380
+ provider && (react.createElement("small", { className: "embed-provider" }, provider.search(/^@{1}/) < 0 ? (provider) : (react.createElement("code", { style: { fontFamily: 'var(--md-code-font, monospace)' } }, url)))),
58381
+ react.createElement("div", { className: "embed-title" }, title))) : (react.createElement("div", { className: "embed-body" },
58382
+ react.createElement("b", null, "View"),
58383
+ ": ",
58384
+ react.createElement("span", { className: "embed-body-url" }, url)))))));
58385
+ };
58386
+ /* harmony default export */ const components_Embed = (Embed);
58387
+
58476
58388
  ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js
58477
58389
  function getWindow(node) {
58478
58390
  if (node == null) {
@@ -63486,8 +63398,9 @@ var Heading = __webpack_require__(398);
63486
63398
  var Heading_default = /*#__PURE__*/__webpack_require__.n(Heading);
63487
63399
  ;// CONCATENATED MODULE: ./components/Image/index.tsx
63488
63400
 
63489
- const Image = ({ align = '', alt = '', border = false, caption, className = '', height = 'auto', src = '', title = '', width = 'auto', lazy = false, }) => {
63401
+ const Image = (Props) => {
63490
63402
  const [lightbox, setLightbox] = react.useState(false);
63403
+ const { align = '', alt = '', border = false, caption, className = '', height = 'auto', src, title = '', width = 'auto', lazy = false, } = Props;
63491
63404
  if (className === 'emoji') {
63492
63405
  return react.createElement("img", { src: src, width: width, height: height, title: title, alt: alt, loading: lazy ? 'lazy' : 'eager' });
63493
63406
  }
@@ -63660,54 +63573,50 @@ const parseOptions = (userOpts = {}) => {
63660
63573
  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
63574
  });
63662
63575
 
63576
+ ;// CONCATENATED MODULE: ./enums.ts
63577
+ var NodeTypes;
63578
+ (function (NodeTypes) {
63579
+ NodeTypes["callout"] = "rdme-callout";
63580
+ NodeTypes["codeTabs"] = "code-tabs";
63581
+ NodeTypes["emoji"] = "emoji";
63582
+ NodeTypes["i"] = "i";
63583
+ NodeTypes["image"] = "image";
63584
+ NodeTypes["htmlBlock"] = "html-block";
63585
+ NodeTypes["embed"] = "rdme-embed";
63586
+ })(NodeTypes || (NodeTypes = {}));
63587
+
63663
63588
  ;// CONCATENATED MODULE: ./processor/transform/callouts.ts
63664
63589
 
63665
63590
 
63591
+
63666
63592
  const callouts_regex = `^(${emoji_regex().source}|⚠)(\\s+|$)`;
63667
63593
  const calloutTransformer = () => {
63668
63594
  return (tree) => {
63669
63595
  visit(tree, 'blockquote', (node) => {
63670
- try {
63671
- if (!(node.children[0].type === 'paragraph' && node.children[0].children[0].type === 'text'))
63672
- return;
63673
- const startText = node.children[0].children[0].value;
63674
- const [match, icon] = startText.match(callouts_regex) || [];
63675
- if (icon && match) {
63676
- const heading = startText.slice(match.length);
63677
- node.children.shift();
63678
- node.type = 'rdme-callout';
63679
- node.data = {
63680
- hName: 'Callout',
63681
- hProperties: {
63682
- heading,
63683
- icon,
63684
- },
63685
- };
63686
- }
63687
- }
63688
- catch (e) {
63689
- console.log(e);
63596
+ if (!(node.children[0].type === 'paragraph' && node.children[0].children[0].type === 'text'))
63597
+ return;
63598
+ const startText = node.children[0].children[0].value;
63599
+ const [match, icon] = startText.match(callouts_regex) || [];
63600
+ if (icon && match) {
63601
+ const heading = startText.slice(match.length);
63602
+ node.children[0].children[0].value = heading;
63603
+ node.type = NodeTypes.callout;
63604
+ node.data = {
63605
+ hName: 'Callout',
63606
+ hProperties: {
63607
+ icon,
63608
+ },
63609
+ };
63690
63610
  }
63691
63611
  });
63692
63612
  };
63693
63613
  };
63694
63614
  /* harmony default export */ const callouts = (calloutTransformer);
63695
63615
 
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
63616
  ;// CONCATENATED MODULE: ./processor/transform/code-tabs.ts
63708
63617
 
63709
63618
 
63710
- const codeTabs = () => tree => {
63619
+ const codeTabsTransformer = () => tree => {
63711
63620
  visit(tree, 'code', (node) => {
63712
63621
  const { lang, meta, value } = node;
63713
63622
  node.data = {
@@ -63750,7 +63659,31 @@ const codeTabs = () => tree => {
63750
63659
  });
63751
63660
  return tree;
63752
63661
  };
63753
- /* harmony default export */ const code_tabs = (codeTabs);
63662
+ /* harmony default export */ const code_tabs = (codeTabsTransformer);
63663
+
63664
+ ;// CONCATENATED MODULE: ./processor/transform/embeds.ts
63665
+
63666
+
63667
+ const embedTransformer = () => {
63668
+ return (tree) => {
63669
+ visit(tree, 'link', (node, _, parent) => {
63670
+ var _a, _b;
63671
+ if (parent.type !== 'paragraph' || parent.children.length > 1 || node.title !== '@embed')
63672
+ return;
63673
+ const newNode = {
63674
+ type: NodeTypes.embed,
63675
+ data: {
63676
+ 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 },
63677
+ hName: 'Embed',
63678
+ },
63679
+ position: node.position,
63680
+ children: [],
63681
+ };
63682
+ parent = newNode;
63683
+ });
63684
+ };
63685
+ };
63686
+ /* harmony default export */ const transform_embeds = (embedTransformer);
63754
63687
 
63755
63688
  ;// CONCATENATED MODULE: ./node_modules/gemoji/index.js
63756
63689
  /**
@@ -80738,10 +80671,12 @@ const gemojiTransformer = () => (tree) => {
80738
80671
 
80739
80672
  ;// CONCATENATED MODULE: ./processor/transform/readme-components.ts
80740
80673
 
80674
+
80675
+
80741
80676
  const readme_components_types = {
80742
- Callout: 'rdme-callout',
80677
+ Callout: NodeTypes['callout'],
80743
80678
  Code: 'code',
80744
- CodeTabs: 'code-tabs',
80679
+ CodeTabs: NodeTypes['codeTabs'],
80745
80680
  Image: 'image',
80746
80681
  Table: 'table',
80747
80682
  tr: 'tableRow',
@@ -80754,6 +80689,7 @@ const attributes = (jsx) => jsx.attributes.reduce((memo, attr) => {
80754
80689
  return memo;
80755
80690
  }, {});
80756
80691
  const coerceJsxToMd = ({ components = {} } = {}) => (node, index, parent) => {
80692
+ var _a;
80757
80693
  if (node.name in components)
80758
80694
  return;
80759
80695
  if (node.name === 'Code') {
@@ -80795,6 +80731,21 @@ const coerceJsxToMd = ({ components = {} } = {}) => (node, index, parent) => {
80795
80731
  };
80796
80732
  parent.children[index] = mdNode;
80797
80733
  }
80734
+ else if (node.name === 'Callout') {
80735
+ const { heading, icon } = attributes(node);
80736
+ const child = mdast(heading);
80737
+ // @ts-ignore
80738
+ const mdNode = {
80739
+ children: [(_a = child === null || child === void 0 ? void 0 : child.children) === null || _a === void 0 ? void 0 : _a[0], ...node.children].filter(Boolean),
80740
+ type: NodeTypes.callout,
80741
+ data: {
80742
+ hName: node.name,
80743
+ hProperties: { icon },
80744
+ },
80745
+ position: node.position,
80746
+ };
80747
+ parent.children[index] = mdNode;
80748
+ }
80798
80749
  else if (node.name in readme_components_types) {
80799
80750
  const hProperties = attributes(node);
80800
80751
  // @ts-ignore
@@ -80829,15 +80780,36 @@ const readmeComponents = (opts) => () => tree => {
80829
80780
 
80830
80781
 
80831
80782
 
80832
- /* harmony default export */ const transform = ([callouts, code_tabs, gemoji_]);
80833
80783
 
80834
- ;// CONCATENATED MODULE: ./processor/compile/gemoji.ts
80835
- const gemoji_gemoji = (node) => `:${node.name}:`;
80836
- /* harmony default export */ const compile_gemoji = (gemoji_gemoji);
80784
+ /* harmony default export */ const transform = ([callouts, code_tabs, transform_embeds, gemoji_]);
80785
+
80786
+ ;// CONCATENATED MODULE: ./processor/compile/callout.ts
80787
+
80788
+ const callout = (node, _, state, info) => {
80789
+ const tracker = state.createTracker(info);
80790
+ const exit = state.enter(NodeTypes.callout);
80791
+ state.join.push(() => 0);
80792
+ const value = state.containerFlow(node, tracker.current());
80793
+ state.join.pop();
80794
+ exit();
80795
+ let lines = value.split('\n');
80796
+ if (lines.length > 1) {
80797
+ const [first, ...rest] = lines;
80798
+ lines = [first, '', ...rest];
80799
+ }
80800
+ let content = lines
80801
+ .map((line, index) => (index > 0 ? `>${line.length > 0 ? ' ' : ''}${line}` : line))
80802
+ .join('\n');
80803
+ if (content.match(/^[^\n]/))
80804
+ content = ' ' + content;
80805
+ const block = `> ${node.data.hProperties.icon}${content}`;
80806
+ return block;
80807
+ };
80808
+ /* harmony default export */ const compile_callout = (callout);
80837
80809
 
80838
80810
  ;// CONCATENATED MODULE: ./processor/compile/code-tabs.ts
80839
80811
 
80840
- const code_tabs_codeTabs = (node, _, state, info) => {
80812
+ const codeTabs = (node, _, state, info) => {
80841
80813
  const exit = state.enter(NodeTypes.codeTabs);
80842
80814
  const tracker = state.createTracker(info);
80843
80815
  state.join.push(() => 0);
@@ -80846,7 +80818,29 @@ const code_tabs_codeTabs = (node, _, state, info) => {
80846
80818
  exit();
80847
80819
  return value;
80848
80820
  };
80849
- /* harmony default export */ const compile_code_tabs = (code_tabs_codeTabs);
80821
+ /* harmony default export */ const compile_code_tabs = (codeTabs);
80822
+
80823
+ ;// CONCATENATED MODULE: ./processor/compile/embed.ts
80824
+ const embed_embed = (node) => {
80825
+ var _a, _b;
80826
+ const { image, favicon, iframe, title, url } = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
80827
+ const complexEmbed = Boolean(image) || Boolean(favicon) || iframe;
80828
+ if (complexEmbed)
80829
+ return `<Embed ${Object.assign({}, (_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties)} />`;
80830
+ return `[${title}](${url} "@embed")'`;
80831
+ };
80832
+ /* harmony default export */ const compile_embed = (embed_embed);
80833
+
80834
+ ;// CONCATENATED MODULE: ./processor/compile/gemoji.ts
80835
+ const gemoji_gemoji = (node) => `:${node.name}:`;
80836
+ /* harmony default export */ const compile_gemoji = (gemoji_gemoji);
80837
+
80838
+ ;// CONCATENATED MODULE: ./processor/compile/html-block.ts
80839
+ const htmlBlock = (node) => {
80840
+ const html = node.data.hProperties.html;
80841
+ return `<HTMLBlock>${JSON.stringify({ html }, null, 2)}</HTMLBlock>`;
80842
+ };
80843
+ /* harmony default export */ const html_block = (htmlBlock);
80850
80844
 
80851
80845
  ;// CONCATENATED MODULE: ./processor/compile/image.ts
80852
80846
  const compile_image_image = (node) => {
@@ -80859,31 +80853,27 @@ const compile_image_image = (node) => {
80859
80853
  };
80860
80854
  /* harmony default export */ const compile_image = (compile_image_image);
80861
80855
 
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
80856
  ;// CONCATENATED MODULE: ./processor/compile/index.ts
80870
80857
 
80871
80858
 
80872
80859
 
80873
80860
 
80874
80861
 
80862
+
80863
+
80875
80864
  function compilers() {
80876
80865
  const data = this.data();
80877
80866
  const toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
80878
80867
  const handlers = {
80868
+ [NodeTypes.callout]: compile_callout,
80879
80869
  [NodeTypes.emoji]: compile_gemoji,
80880
80870
  [NodeTypes.codeTabs]: compile_code_tabs,
80881
- [NodeTypes.image]: compile_image,
80871
+ [NodeTypes.embed]: compile_embed,
80882
80872
  [NodeTypes.htmlBlock]: html_block,
80873
+ [NodeTypes.image]: compile_image,
80883
80874
  };
80884
80875
  toMarkdownExtensions.push({ extensions: [{ handlers }] });
80885
80876
  }
80886
- ;
80887
80877
  /* harmony default export */ const processor_compile = (compilers);
80888
80878
 
80889
80879
  ;// CONCATENATED MODULE: ./errors/mdx-syntax-error.ts
@@ -80907,7 +80897,7 @@ class MdxSyntaxError extends SyntaxError {
80907
80897
  }
80908
80898
 
80909
80899
  ;// CONCATENATED MODULE: ./index.tsx
80910
- var __rest = (undefined && undefined.__rest) || function (s, e) {
80900
+ var index_rest = (undefined && undefined.__rest) || function (s, e) {
80911
80901
  var t = {};
80912
80902
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
80913
80903
  t[p] = s[p];
@@ -80958,7 +80948,7 @@ const reactProcessor = (opts = {}) => {
80958
80948
  };
80959
80949
  const index_compile = (text, opts = {}) => {
80960
80950
  try {
80961
- return String(compileSync(text, Object.assign({ outputFormat: 'function-body', providerImportSource: '#', remarkPlugins }, opts))).replace(/await import\(_resolveDynamicMdxSpecifier\('react'\)\)/, 'arguments[0].imports.React');
80951
+ return String(compileSync(text, Object.assign({ outputFormat: 'function-body', providerImportSource: '#', remarkPlugins }, opts))).replace(/await import\(_resolveDynamicMdxSpecifier\(('react'|"react")\)\)/, 'arguments[0].imports.React');
80962
80952
  }
80963
80953
  catch (error) {
80964
80954
  console.error(error);
@@ -80967,7 +80957,7 @@ const index_compile = (text, opts = {}) => {
80967
80957
  };
80968
80958
  const index_run = async (code, _opts = {}) => {
80969
80959
  const { Fragment } = jsx_runtime_namespaceObject;
80970
- const { components } = _opts, opts = __rest(_opts, ["components"]);
80960
+ const { components } = _opts, opts = index_rest(_opts, ["components"]);
80971
80961
  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
80962
  return (file === null || file === void 0 ? void 0 : file.default) || (() => null);
80973
80963
  };
@@ -0,0 +1,3 @@
1
+ import { Callout } from '../../types';
2
+ declare const callout: (node: Callout, _: any, state: any, info: any) => string;
3
+ export default callout;
@@ -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.35",
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;