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

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.js CHANGED
@@ -6783,131 +6783,6 @@ module.exports = {
6783
6783
  }));
6784
6784
 
6785
6785
 
6786
- /***/ }),
6787
-
6788
- /***/ 9294:
6789
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6790
-
6791
- __webpack_require__(3534);
6792
- __webpack_require__(590);
6793
- __webpack_require__(4216);
6794
- __webpack_require__(5195);
6795
- __webpack_require__(9693);
6796
- __webpack_require__(8665);
6797
- __webpack_require__(4913);
6798
- __webpack_require__(9389);
6799
- __webpack_require__(4189);
6800
- __webpack_require__(8741);
6801
- __webpack_require__(9218);
6802
- __webpack_require__(7899);
6803
- __webpack_require__(5086);
6804
- __webpack_require__(6048);
6805
- __webpack_require__(9979);
6806
- __webpack_require__(4602);
6807
- var _excluded = ["baseUrl", "children", "href", "target", "title"];
6808
- 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); }
6809
- 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; }
6810
- 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; }
6811
- __webpack_require__(115);
6812
- __webpack_require__(4895);
6813
- __webpack_require__(7136);
6814
- __webpack_require__(8636);
6815
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6816
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6817
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6818
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6819
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6820
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
6821
- var PropTypes = __webpack_require__(5556);
6822
- var React = __webpack_require__(1307);
6823
- var BaseUrlContext = __webpack_require__(9357);
6824
-
6825
- // Nabbed from here:
6826
- // https://github.com/readmeio/api-explorer/blob/0dedafcf71102feedaa4145040d3f57d79d95752/packages/api-explorer/src/lib/markdown/renderer.js#L52
6827
- function getHref(href, baseUrl) {
6828
- var _href$split = href.split('#'),
6829
- _href$split2 = _slicedToArray(_href$split, 2),
6830
- path = _href$split2[0],
6831
- hash = _href$split2[1];
6832
- var hashStr = hash ? "#".concat(hash) : '';
6833
- var base = baseUrl === '/' ? '' : baseUrl;
6834
- var doc = path.match(/^doc:([-_a-zA-Z0-9#]*)$/);
6835
- if (doc) {
6836
- return "".concat(base, "/docs/").concat(doc[1]).concat(hashStr);
6837
- }
6838
- var ref = path.match(/^ref:([-_a-zA-Z0-9#]*)$/);
6839
- if (ref) {
6840
- return "".concat(base, "/reference-link/").concat(ref[1]).concat(hashStr);
6841
- }
6842
-
6843
- // we need to perform two matches for changelogs in case
6844
- // of legacy links that use 'blog' instead of 'changelog'
6845
- var blog = path.match(/^blog:([-_a-zA-Z0-9#]*)$/);
6846
- var changelog = path.match(/^changelog:([-_a-zA-Z0-9#]*)$/);
6847
- var changelogMatch = blog || changelog;
6848
- if (changelogMatch) {
6849
- return "".concat(base, "/changelog/").concat(changelogMatch[1]).concat(hashStr);
6850
- }
6851
- var custompage = path.match(/^page:([-_a-zA-Z0-9#]*)$/);
6852
- if (custompage) {
6853
- return "".concat(base, "/page/").concat(custompage[1]).concat(hashStr);
6854
- }
6855
- return href;
6856
- }
6857
- function docLink(href) {
6858
- var doc = href.match(/^doc:([-_a-zA-Z0-9#]*)$/);
6859
- if (!doc) return false;
6860
- return {
6861
- className: 'doc-link',
6862
- 'data-sidebar': doc[1]
6863
- };
6864
- }
6865
- function Anchor(props) {
6866
- var baseUrl = props.baseUrl,
6867
- children = props.children,
6868
- href = props.href,
6869
- target = props.target,
6870
- title = props.title,
6871
- attrs = _objectWithoutProperties(props, _excluded);
6872
- return (
6873
- /*#__PURE__*/
6874
- // eslint-disable-next-line react/jsx-props-no-spreading
6875
- React.createElement("a", _extends({}, attrs, {
6876
- href: getHref(href, baseUrl),
6877
- target: target,
6878
- title: title
6879
- }, docLink(href)), children)
6880
- );
6881
- }
6882
- Anchor.propTypes = {
6883
- baseUrl: PropTypes.string,
6884
- children: PropTypes.node.isRequired,
6885
- download: PropTypes.string,
6886
- href: PropTypes.string,
6887
- target: PropTypes.string,
6888
- title: PropTypes.string
6889
- };
6890
- Anchor.defaultProps = {
6891
- baseUrl: '/',
6892
- href: '',
6893
- target: '',
6894
- title: ''
6895
- };
6896
- var AnchorWithContext = function AnchorWithContext(props) {
6897
- return /*#__PURE__*/React.createElement(BaseUrlContext.Consumer, null, function (baseUrl) {
6898
- return /*#__PURE__*/React.createElement(Anchor, _extends({
6899
- baseUrl: baseUrl
6900
- }, props));
6901
- });
6902
- };
6903
- AnchorWithContext.sanitize = function (sanitizeSchema) {
6904
- // This is for our custom link formats
6905
- sanitizeSchema.protocols.href.push('doc', 'target', 'ref', 'blog', 'changelog', 'page');
6906
- return sanitizeSchema;
6907
- };
6908
- module.exports = AnchorWithContext;
6909
- AnchorWithContext.getHref = getHref;
6910
-
6911
6786
  /***/ }),
6912
6787
 
6913
6788
  /***/ 398:
@@ -7020,14 +6895,6 @@ module.exports = CreateStyle;
7020
6895
 
7021
6896
  /***/ }),
7022
6897
 
7023
- /***/ 9357:
7024
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7025
-
7026
- var React = __webpack_require__(1307);
7027
- module.exports = React.createContext('/');
7028
-
7029
- /***/ }),
7030
-
7031
6898
  /***/ 7965:
7032
6899
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7033
6900
 
@@ -14253,12 +14120,12 @@ __webpack_require__.d(util_types_namespaceObject, {
14253
14120
  var components_namespaceObject = {};
14254
14121
  __webpack_require__.r(components_namespaceObject);
14255
14122
  __webpack_require__.d(components_namespaceObject, {
14256
- Anchor: () => ((Anchor_default())),
14123
+ Anchor: () => (components_Anchor),
14257
14124
  Callout: () => (components_Callout),
14258
14125
  Code: () => (components_Code),
14259
14126
  CodeTabs: () => (components_CodeTabs),
14260
14127
  Embed: () => (components_Embed),
14261
- GlossaryItem: () => (GlossaryItemWithContext),
14128
+ Glossary: () => (GlossaryWithContext),
14262
14129
  HTMLBlock: () => (components_HTMLBlock),
14263
14130
  Heading: () => ((Heading_default())),
14264
14131
  Image: () => (components_Image),
@@ -60954,9 +60821,159 @@ var jsx_runtime_namespaceObject = /*#__PURE__*/__webpack_require__.t(jsx_runtime
60954
60821
  // EXTERNAL MODULE: external "@readme/variable"
60955
60822
  var variable_ = __webpack_require__(8167);
60956
60823
  var variable_default = /*#__PURE__*/__webpack_require__.n(variable_);
60957
- // EXTERNAL MODULE: ./components/Anchor.jsx
60958
- var Anchor = __webpack_require__(9294);
60959
- var Anchor_default = /*#__PURE__*/__webpack_require__.n(Anchor);
60824
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
60825
+ var es_symbol = __webpack_require__(3534);
60826
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
60827
+ var es_symbol_description = __webpack_require__(590);
60828
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
60829
+ var es_symbol_iterator = __webpack_require__(4216);
60830
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
60831
+ var es_array_from = __webpack_require__(5195);
60832
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
60833
+ var es_array_index_of = __webpack_require__(9693);
60834
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
60835
+ var es_array_iterator = __webpack_require__(8665);
60836
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
60837
+ var es_array_slice = __webpack_require__(4913);
60838
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.date.to-string.js
60839
+ var es_date_to_string = __webpack_require__(9389);
60840
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.bind.js
60841
+ var es_function_bind = __webpack_require__(4189);
60842
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
60843
+ var es_function_name = __webpack_require__(8741);
60844
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.assign.js
60845
+ var es_object_assign = __webpack_require__(9218);
60846
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
60847
+ var es_object_keys = __webpack_require__(7899);
60848
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
60849
+ var es_object_to_string = __webpack_require__(5086);
60850
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
60851
+ var es_regexp_to_string = __webpack_require__(6048);
60852
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
60853
+ var es_string_iterator = __webpack_require__(9979);
60854
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
60855
+ var web_dom_collections_iterator = __webpack_require__(4602);
60856
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
60857
+ var es_array_concat = __webpack_require__(115);
60858
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.is-array.js
60859
+ var es_array_is_array = __webpack_require__(4895);
60860
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
60861
+ var es_regexp_exec = __webpack_require__(7136);
60862
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
60863
+ var es_string_match = __webpack_require__(8636);
60864
+ // EXTERNAL MODULE: ./node_modules/prop-types/index.js
60865
+ var prop_types = __webpack_require__(5556);
60866
+ ;// CONCATENATED MODULE: ./contexts/BaseUrl.js
60867
+
60868
+ var BaseUrlContext = /*#__PURE__*/external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createContext('/');
60869
+ /* harmony default export */ const BaseUrl = (BaseUrlContext);
60870
+ ;// CONCATENATED MODULE: ./components/Anchor.jsx
60871
+
60872
+
60873
+
60874
+
60875
+
60876
+
60877
+
60878
+
60879
+
60880
+
60881
+
60882
+
60883
+
60884
+
60885
+
60886
+
60887
+ var _excluded = ["children", "href", "target", "title"];
60888
+ 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); }
60889
+ 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; }
60890
+ 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; }
60891
+
60892
+
60893
+
60894
+
60895
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
60896
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
60897
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
60898
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
60899
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
60900
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
60901
+
60902
+
60903
+
60904
+
60905
+ // Nabbed from here:
60906
+ // https://github.com/readmeio/api-explorer/blob/0dedafcf71102feedaa4145040d3f57d79d95752/packages/api-explorer/src/lib/markdown/renderer.js#L52
60907
+ function getHref(href, baseUrl) {
60908
+ var _href$split = href.split('#'),
60909
+ _href$split2 = _slicedToArray(_href$split, 2),
60910
+ path = _href$split2[0],
60911
+ hash = _href$split2[1];
60912
+ var hashStr = hash ? "#".concat(hash) : '';
60913
+ var base = baseUrl === '/' ? '' : baseUrl;
60914
+ var doc = path.match(/^doc:([-_a-zA-Z0-9#]*)$/);
60915
+ if (doc) {
60916
+ return "".concat(base, "/docs/").concat(doc[1]).concat(hashStr);
60917
+ }
60918
+ var ref = path.match(/^ref:([-_a-zA-Z0-9#]*)$/);
60919
+ if (ref) {
60920
+ return "".concat(base, "/reference-link/").concat(ref[1]).concat(hashStr);
60921
+ }
60922
+
60923
+ // we need to perform two matches for changelogs in case
60924
+ // of legacy links that use 'blog' instead of 'changelog'
60925
+ var blog = path.match(/^blog:([-_a-zA-Z0-9#]*)$/);
60926
+ var changelog = path.match(/^changelog:([-_a-zA-Z0-9#]*)$/);
60927
+ var changelogMatch = blog || changelog;
60928
+ if (changelogMatch) {
60929
+ return "".concat(base, "/changelog/").concat(changelogMatch[1]).concat(hashStr);
60930
+ }
60931
+ var custompage = path.match(/^page:([-_a-zA-Z0-9#]*)$/);
60932
+ if (custompage) {
60933
+ return "".concat(base, "/page/").concat(custompage[1]).concat(hashStr);
60934
+ }
60935
+ return href;
60936
+ }
60937
+ function docLink(href) {
60938
+ var doc = href.match(/^doc:([-_a-zA-Z0-9#]*)$/);
60939
+ if (!doc) return false;
60940
+ return {
60941
+ className: 'doc-link',
60942
+ 'data-sidebar': doc[1]
60943
+ };
60944
+ }
60945
+ function Anchor(props) {
60946
+ var children = props.children,
60947
+ href = props.href,
60948
+ target = props.target,
60949
+ title = props.title,
60950
+ attrs = _objectWithoutProperties(props, _excluded);
60951
+ var baseUrl = useContext(BaseUrl);
60952
+ return (
60953
+ /*#__PURE__*/
60954
+ // eslint-disable-next-line react/jsx-props-no-spreading
60955
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("a", _extends({}, attrs, {
60956
+ href: getHref(href, baseUrl),
60957
+ target: target,
60958
+ title: title
60959
+ }, docLink(href)), children)
60960
+ );
60961
+ }
60962
+ Anchor.propTypes = {
60963
+ baseUrl: prop_types.string,
60964
+ children: prop_types.node.isRequired,
60965
+ download: prop_types.string,
60966
+ href: prop_types.string,
60967
+ target: prop_types.string,
60968
+ title: prop_types.string
60969
+ };
60970
+ Anchor.defaultProps = {
60971
+ baseUrl: '/',
60972
+ href: '',
60973
+ target: '',
60974
+ title: ''
60975
+ };
60976
+ /* harmony default export */ const components_Anchor = (Anchor);
60960
60977
  ;// CONCATENATED MODULE: ./components/Callout/index.tsx
60961
60978
 
60962
60979
  const themes = {
@@ -60974,15 +60991,17 @@ const themes = {
60974
60991
  '\u26A0': 'warn',
60975
60992
  };
60976
60993
  const Callout = (props) => {
60977
- const { attributes, children, icon, heading } = props;
60994
+ const { attributes, children, icon } = props;
60978
60995
  let theme = props.theme || themes[icon] || 'default';
60996
+ const [heading, ...body] = Array.isArray(children) ? children : [children];
60997
+ const empty = !heading.props.children;
60979
60998
  return (
60980
60999
  // @ts-ignore
60981
61000
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("blockquote", Object.assign({}, attributes, { className: `callout callout_${theme}`, theme: icon }),
60982
- heading && (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("h3", { className: `callout-heading${heading ? '' : ' empty'}` },
61001
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("h3", { className: `callout-heading${empty ? ' empty' : ''}` },
60983
61002
  external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { className: "callout-icon" }, icon),
60984
- heading)),
60985
- children));
61003
+ !empty && heading),
61004
+ body));
60986
61005
  };
60987
61006
  /* harmony default export */ const components_Callout = (Callout);
60988
61007
 
@@ -61107,28 +61126,25 @@ var react_default = /*#__PURE__*/__webpack_require__.n(react_);
61107
61126
 
61108
61127
  const GlossaryContext = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createContext)([]);
61109
61128
  /* harmony default export */ const GlossaryTerms = (GlossaryContext);
61110
- // haxx
61111
- function Provider(Provider, arg1) {
61112
- throw new Error('Function not implemented.');
61113
- }
61114
61129
 
61115
- ;// CONCATENATED MODULE: ./components/GlossaryItem/index.tsx
61130
+ ;// CONCATENATED MODULE: ./components/Glossary/index.tsx
61116
61131
 
61117
61132
 
61118
61133
 
61119
- const GlossaryItem = ({ term, terms }) => {
61120
- const foundTerm = terms.find(i => term.toLowerCase() === i.term.toLowerCase());
61134
+ const Glossary = ({ children, term: termProp, terms }) => {
61135
+ const term = (Array.isArray(children) ? children[0] : children) || termProp;
61136
+ const foundTerm = terms.find(i => { var _a; return term.toLowerCase() === ((_a = i === null || i === void 0 ? void 0 : i.term) === null || _a === void 0 ? void 0 : _a.toLowerCase()); });
61121
61137
  if (!foundTerm)
61122
61138
  return external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("span", null, term);
61123
- return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement((react_default()), { content: external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "GlossaryItem-tooltip-content" },
61124
- external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("strong", { className: "GlossaryItem-term" }, foundTerm.term),
61139
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement((react_default()), { content: external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Glossary-tooltip-content" },
61140
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("strong", { className: "Glossary-term" }, foundTerm.term),
61125
61141
  " - ",
61126
61142
  foundTerm.definition), offset: [-5, 5], placement: "bottom-start" },
61127
- external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("span", { className: "GlossaryItem-trigger" }, term)));
61143
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("span", { className: "Glossary-trigger" }, term)));
61128
61144
  };
61129
- const GlossaryItemWithContext = props => {
61145
+ const GlossaryWithContext = props => {
61130
61146
  const terms = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useContext)(GlossaryTerms);
61131
- return terms ? external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(GlossaryItem, Object.assign({}, props, { terms: terms })) : null;
61147
+ return terms ? external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Glossary, Object.assign({}, props, { terms: terms })) : external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("span", null, props.term);
61132
61148
  };
61133
61149
 
61134
61150
 
@@ -61223,8 +61239,6 @@ const Table = (props) => {
61223
61239
  };
61224
61240
  /* harmony default export */ const components_Table = (Table);
61225
61241
 
61226
- // EXTERNAL MODULE: ./node_modules/prop-types/index.js
61227
- var prop_types = __webpack_require__(5556);
61228
61242
  ;// CONCATENATED MODULE: ./components/TableOfContents/index.jsx
61229
61243
 
61230
61244
 
@@ -61259,15 +61273,6 @@ TableOfContents.propTypes = {
61259
61273
 
61260
61274
 
61261
61275
 
61262
- // EXTERNAL MODULE: ./contexts/BaseUrl.js
61263
- var BaseUrl = __webpack_require__(9357);
61264
- var BaseUrl_default = /*#__PURE__*/__webpack_require__.n(BaseUrl);
61265
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
61266
- var es_symbol = __webpack_require__(3534);
61267
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
61268
- var es_symbol_description = __webpack_require__(590);
61269
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
61270
- var es_symbol_iterator = __webpack_require__(4216);
61271
61276
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.to-primitive.js
61272
61277
  var es_symbol_to_primitive = __webpack_require__(6611);
61273
61278
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
@@ -61276,8 +61281,6 @@ var es_array_filter = __webpack_require__(17);
61276
61281
  var es_array_for_each = __webpack_require__(8476);
61277
61282
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
61278
61283
  var es_array_includes = __webpack_require__(7746);
61279
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
61280
- var es_array_iterator = __webpack_require__(8665);
61281
61284
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.date.to-primitive.js
61282
61285
  var es_date_to_primitive = __webpack_require__(7787);
61283
61286
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
@@ -61290,18 +61293,10 @@ var es_object_define_property = __webpack_require__(5852);
61290
61293
  var es_object_get_own_property_descriptor = __webpack_require__(678);
61291
61294
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptors.js
61292
61295
  var es_object_get_own_property_descriptors = __webpack_require__(3101);
61293
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
61294
- var es_object_keys = __webpack_require__(7899);
61295
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
61296
- var es_object_to_string = __webpack_require__(5086);
61297
61296
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.includes.js
61298
61297
  var es_string_includes = __webpack_require__(3148);
61299
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
61300
- var es_string_iterator = __webpack_require__(9979);
61301
61298
  // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
61302
61299
  var web_dom_collections_for_each = __webpack_require__(8379);
61303
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
61304
- var web_dom_collections_iterator = __webpack_require__(4602);
61305
61300
  ;// CONCATENATED MODULE: ./options.js
61306
61301
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
61307
61302
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -61431,26 +61426,20 @@ const callouts_regex = `^(${emoji_regex().source}|⚠)(\\s+|$)`;
61431
61426
  const calloutTransformer = () => {
61432
61427
  return (tree) => {
61433
61428
  visit(tree, 'blockquote', (node) => {
61434
- try {
61435
- if (!(node.children[0].type === 'paragraph' && node.children[0].children[0].type === 'text'))
61436
- return;
61437
- const startText = node.children[0].children[0].value;
61438
- const [match, icon] = startText.match(callouts_regex) || [];
61439
- if (icon && match) {
61440
- const heading = startText.slice(match.length);
61441
- node.children.shift();
61442
- node.type = NodeTypes.callout;
61443
- node.data = {
61444
- hName: 'Callout',
61445
- hProperties: {
61446
- heading,
61447
- icon,
61448
- },
61449
- };
61450
- }
61451
- }
61452
- catch (e) {
61453
- console.log(e);
61429
+ if (!(node.children[0].type === 'paragraph' && node.children[0].children[0].type === 'text'))
61430
+ return;
61431
+ const startText = node.children[0].children[0].value;
61432
+ const [match, icon] = startText.match(callouts_regex) || [];
61433
+ if (icon && match) {
61434
+ const heading = startText.slice(match.length);
61435
+ node.children[0].children[0].value = heading;
61436
+ node.type = NodeTypes.callout;
61437
+ node.data = {
61438
+ hName: 'Callout',
61439
+ hProperties: {
61440
+ icon,
61441
+ },
61442
+ };
61454
61443
  }
61455
61444
  });
61456
61445
  };
@@ -78515,10 +78504,12 @@ const gemojiTransformer = () => (tree) => {
78515
78504
 
78516
78505
  ;// CONCATENATED MODULE: ./processor/transform/readme-components.ts
78517
78506
 
78507
+
78508
+
78518
78509
  const readme_components_types = {
78519
- Callout: 'rdme-callout',
78510
+ Callout: NodeTypes['callout'],
78520
78511
  Code: 'code',
78521
- CodeTabs: 'code-tabs',
78512
+ CodeTabs: NodeTypes['codeTabs'],
78522
78513
  Image: 'image',
78523
78514
  Table: 'table',
78524
78515
  tr: 'tableRow',
@@ -78531,6 +78522,7 @@ const attributes = (jsx) => jsx.attributes.reduce((memo, attr) => {
78531
78522
  return memo;
78532
78523
  }, {});
78533
78524
  const coerceJsxToMd = ({ components = {} } = {}) => (node, index, parent) => {
78525
+ var _a;
78534
78526
  if (node.name in components)
78535
78527
  return;
78536
78528
  if (node.name === 'Code') {
@@ -78572,6 +78564,21 @@ const coerceJsxToMd = ({ components = {} } = {}) => (node, index, parent) => {
78572
78564
  };
78573
78565
  parent.children[index] = mdNode;
78574
78566
  }
78567
+ else if (node.name === 'Callout') {
78568
+ const { heading, icon } = attributes(node);
78569
+ const child = mdast(heading);
78570
+ // @ts-ignore
78571
+ const mdNode = {
78572
+ children: [(_a = child === null || child === void 0 ? void 0 : child.children) === null || _a === void 0 ? void 0 : _a[0], ...node.children].filter(Boolean),
78573
+ type: NodeTypes.callout,
78574
+ data: {
78575
+ hName: node.name,
78576
+ hProperties: { icon },
78577
+ },
78578
+ position: node.position,
78579
+ };
78580
+ parent.children[index] = mdNode;
78581
+ }
78575
78582
  else if (node.name in readme_components_types) {
78576
78583
  const hProperties = attributes(node);
78577
78584
  // @ts-ignore
@@ -78609,9 +78616,29 @@ const readmeComponents = (opts) => () => tree => {
78609
78616
 
78610
78617
  /* harmony default export */ const transform = ([callouts, code_tabs, transform_embeds, gemoji_]);
78611
78618
 
78612
- ;// CONCATENATED MODULE: ./processor/compile/gemoji.ts
78613
- const gemoji_gemoji = (node) => `:${node.name}:`;
78614
- /* harmony default export */ const compile_gemoji = (gemoji_gemoji);
78619
+ ;// CONCATENATED MODULE: ./processor/compile/callout.ts
78620
+
78621
+ const callout = (node, _, state, info) => {
78622
+ const tracker = state.createTracker(info);
78623
+ const exit = state.enter(NodeTypes.callout);
78624
+ state.join.push(() => 0);
78625
+ const value = state.containerFlow(node, tracker.current());
78626
+ state.join.pop();
78627
+ exit();
78628
+ let lines = value.split('\n');
78629
+ if (lines.length > 1) {
78630
+ const [first, ...rest] = lines;
78631
+ lines = [first, '', ...rest];
78632
+ }
78633
+ let content = lines
78634
+ .map((line, index) => (index > 0 ? `>${line.length > 0 ? ' ' : ''}${line}` : line))
78635
+ .join('\n');
78636
+ if (content.match(/^[^\n]/))
78637
+ content = ' ' + content;
78638
+ const block = `> ${node.data.hProperties.icon}${content}`;
78639
+ return block;
78640
+ };
78641
+ /* harmony default export */ const compile_callout = (callout);
78615
78642
 
78616
78643
  ;// CONCATENATED MODULE: ./processor/compile/code-tabs.ts
78617
78644
 
@@ -78637,6 +78664,10 @@ const embed_embed = (node) => {
78637
78664
  };
78638
78665
  /* harmony default export */ const compile_embed = (embed_embed);
78639
78666
 
78667
+ ;// CONCATENATED MODULE: ./processor/compile/gemoji.ts
78668
+ const gemoji_gemoji = (node) => `:${node.name}:`;
78669
+ /* harmony default export */ const compile_gemoji = (gemoji_gemoji);
78670
+
78640
78671
  ;// CONCATENATED MODULE: ./processor/compile/html-block.ts
78641
78672
  const htmlBlock = (node) => {
78642
78673
  const html = node.data.hProperties.html;
@@ -78662,10 +78693,12 @@ const compile_image_image = (node) => {
78662
78693
 
78663
78694
 
78664
78695
 
78696
+
78665
78697
  function compilers() {
78666
78698
  const data = this.data();
78667
78699
  const toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
78668
78700
  const handlers = {
78701
+ [NodeTypes.callout]: compile_callout,
78669
78702
  [NodeTypes.emoji]: compile_gemoji,
78670
78703
  [NodeTypes.codeTabs]: compile_code_tabs,
78671
78704
  [NodeTypes.embed]: compile_embed,
@@ -78674,7 +78707,6 @@ function compilers() {
78674
78707
  };
78675
78708
  toMarkdownExtensions.push({ extensions: [{ handlers }] });
78676
78709
  }
78677
- ;
78678
78710
  /* harmony default export */ const processor_compile = (compilers);
78679
78711
 
78680
78712
  ;// CONCATENATED MODULE: ./errors/mdx-syntax-error.ts
@@ -78697,6 +78729,21 @@ class MdxSyntaxError extends SyntaxError {
78697
78729
  }
78698
78730
  }
78699
78731
 
78732
+ ;// CONCATENATED MODULE: ./contexts/index.tsx
78733
+
78734
+
78735
+
78736
+
78737
+ const compose = (children, ...contexts) => {
78738
+ return contexts.reduce((content, [Context, value]) => {
78739
+ return external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Context.Provider, { value: value }, content);
78740
+ }, children);
78741
+ };
78742
+ const Contexts = ({ children, terms = [], variables = { user: { keys: [] }, defaults: [] }, baseUrl = '/' }) => {
78743
+ return compose(children, [GlossaryTerms, terms], [variable_.VariablesContext, variables], [BaseUrl, baseUrl]);
78744
+ };
78745
+ /* harmony default export */ const contexts = (Contexts);
78746
+
78700
78747
  ;// CONCATENATED MODULE: ./index.tsx
78701
78748
  var index_rest = (undefined && undefined.__rest) || function (s, e) {
78702
78749
  var t = {};
@@ -78726,17 +78773,13 @@ var index_rest = (undefined && undefined.__rest) || function (s, e) {
78726
78773
 
78727
78774
 
78728
78775
 
78729
-
78730
78776
  const unimplemented = browser_default()('mdx:unimplemented');
78731
78777
 
78732
78778
  const utils = {
78733
78779
  get options() {
78734
78780
  return Object.assign({}, options);
78735
78781
  },
78736
- BaseUrlContext: (BaseUrl_default()),
78737
- getHref: Anchor.getHref,
78738
- GlossaryContext: GlossaryTerms,
78739
- VariablesContext: (variable_default()).VariablesContext,
78782
+ getHref: getHref,
78740
78783
  calloutIcons: {},
78741
78784
  };
78742
78785
  const makeUseMDXComponents = (more) => {
@@ -78749,7 +78792,7 @@ const reactProcessor = (opts = {}) => {
78749
78792
  };
78750
78793
  const index_compile = (text, opts = {}) => {
78751
78794
  try {
78752
- return String(compileSync(text, Object.assign({ outputFormat: 'function-body', providerImportSource: '#', remarkPlugins }, opts))).replace(/await import\(_resolveDynamicMdxSpecifier\('react'\)\)/, 'arguments[0].imports.React');
78795
+ return String(compileSync(text, Object.assign({ outputFormat: 'function-body', providerImportSource: '#', remarkPlugins }, opts))).replace(/await import\(_resolveDynamicMdxSpecifier\(('react'|"react")\)\)/, 'arguments[0].imports.React');
78753
78796
  }
78754
78797
  catch (error) {
78755
78798
  console.error(error);
@@ -78758,9 +78801,11 @@ const index_compile = (text, opts = {}) => {
78758
78801
  };
78759
78802
  const index_run = async (code, _opts = {}) => {
78760
78803
  const { Fragment } = jsx_runtime_namespaceObject;
78761
- const { components } = _opts, opts = index_rest(_opts, ["components"]);
78804
+ const { components, terms, variables, baseUrl } = _opts, opts = index_rest(_opts, ["components", "terms", "variables", "baseUrl"]);
78762
78805
  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: (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default()) }, useMDXComponents: makeUseMDXComponents(components) }), opts));
78763
- return (file === null || file === void 0 ? void 0 : file.default) || (() => null);
78806
+ const Content = (file === null || file === void 0 ? void 0 : file.default) || (() => null);
78807
+ return () => (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(contexts, { terms: terms, variables: variables, baseUrl: baseUrl },
78808
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Content, null)));
78764
78809
  };
78765
78810
  const reactTOC = (text, opts = {}) => {
78766
78811
  unimplemented('reactTOC');