@readme/markdown 10.1.1 → 10.2.0

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
@@ -12221,118 +12221,6 @@ module.exports = Warning
12221
12221
  Warning.default = Warning
12222
12222
 
12223
12223
 
12224
- /***/ }),
12225
-
12226
- /***/ 2694:
12227
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12228
-
12229
- "use strict";
12230
- /**
12231
- * Copyright (c) 2013-present, Facebook, Inc.
12232
- *
12233
- * This source code is licensed under the MIT license found in the
12234
- * LICENSE file in the root directory of this source tree.
12235
- */
12236
-
12237
-
12238
-
12239
- var ReactPropTypesSecret = __webpack_require__(6925);
12240
-
12241
- function emptyFunction() {}
12242
- function emptyFunctionWithReset() {}
12243
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
12244
-
12245
- module.exports = function() {
12246
- function shim(props, propName, componentName, location, propFullName, secret) {
12247
- if (secret === ReactPropTypesSecret) {
12248
- // It is still safe when called from React.
12249
- return;
12250
- }
12251
- var err = new Error(
12252
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
12253
- 'Use PropTypes.checkPropTypes() to call them. ' +
12254
- 'Read more at http://fb.me/use-check-prop-types'
12255
- );
12256
- err.name = 'Invariant Violation';
12257
- throw err;
12258
- };
12259
- shim.isRequired = shim;
12260
- function getShim() {
12261
- return shim;
12262
- };
12263
- // Important!
12264
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
12265
- var ReactPropTypes = {
12266
- array: shim,
12267
- bigint: shim,
12268
- bool: shim,
12269
- func: shim,
12270
- number: shim,
12271
- object: shim,
12272
- string: shim,
12273
- symbol: shim,
12274
-
12275
- any: shim,
12276
- arrayOf: getShim,
12277
- element: shim,
12278
- elementType: shim,
12279
- instanceOf: getShim,
12280
- node: shim,
12281
- objectOf: getShim,
12282
- oneOf: getShim,
12283
- oneOfType: getShim,
12284
- shape: getShim,
12285
- exact: getShim,
12286
-
12287
- checkPropTypes: emptyFunctionWithReset,
12288
- resetWarningCache: emptyFunction
12289
- };
12290
-
12291
- ReactPropTypes.PropTypes = ReactPropTypes;
12292
-
12293
- return ReactPropTypes;
12294
- };
12295
-
12296
-
12297
- /***/ }),
12298
-
12299
- /***/ 5556:
12300
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12301
-
12302
- /**
12303
- * Copyright (c) 2013-present, Facebook, Inc.
12304
- *
12305
- * This source code is licensed under the MIT license found in the
12306
- * LICENSE file in the root directory of this source tree.
12307
- */
12308
-
12309
- if (false) { var throwOnDirectAccess, ReactIs; } else {
12310
- // By explicitly using `prop-types` you are opting into new production behavior.
12311
- // http://fb.me/prop-types-in-prod
12312
- module.exports = __webpack_require__(2694)();
12313
- }
12314
-
12315
-
12316
- /***/ }),
12317
-
12318
- /***/ 6925:
12319
- /***/ ((module) => {
12320
-
12321
- "use strict";
12322
- /**
12323
- * Copyright (c) 2013-present, Facebook, Inc.
12324
- *
12325
- * This source code is licensed under the MIT license found in the
12326
- * LICENSE file in the root directory of this source tree.
12327
- */
12328
-
12329
-
12330
-
12331
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
12332
-
12333
- module.exports = ReactPropTypesSecret;
12334
-
12335
-
12336
12224
  /***/ }),
12337
12225
 
12338
12226
  /***/ 1020:
@@ -16220,92 +16108,59 @@ const Accordion = ({ children, icon, iconColor, title }) => {
16220
16108
  };
16221
16109
  /* harmony default export */ const components_Accordion = (Accordion);
16222
16110
 
16223
- // EXTERNAL MODULE: ./node_modules/prop-types/index.js
16224
- var prop_types = __webpack_require__(5556);
16225
16111
  ;// ./contexts/BaseUrl.js
16226
16112
 
16227
16113
  const BaseUrlContext = /*#__PURE__*/external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createContext('/');
16228
16114
  /* harmony default export */ const BaseUrl = (BaseUrlContext);
16229
- ;// ./components/Anchor.jsx
16230
- const _excluded = ["children", "href", "target", "title"];
16231
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
16232
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
16233
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
16234
-
16235
-
16115
+ ;// ./components/Anchor.tsx
16236
16116
 
16237
16117
 
16238
16118
  // Nabbed from here:
16239
16119
  // https://github.com/readmeio/api-explorer/blob/0dedafcf71102feedaa4145040d3f57d79d95752/packages/api-explorer/src/lib/markdown/renderer.js#L52
16240
16120
  function getHref(href, baseUrl) {
16241
- const [path, hash] = href.split('#');
16242
- const hashStr = hash ? `#${hash}` : '';
16243
- const base = baseUrl === '/' ? '' : baseUrl;
16244
- const doc = path.match(/^doc:([-_a-zA-Z0-9#]*)$/);
16245
- if (doc) {
16246
- return `${base}/docs/${doc[1]}${hashStr}`;
16247
- }
16248
- const ref = path.match(/^ref:([-_a-zA-Z0-9#]*)$/);
16249
- if (ref) {
16250
- return `${base}/reference-link/${ref[1]}${hashStr}`;
16251
- }
16252
-
16253
- // we need to perform two matches for changelogs in case
16254
- // of legacy links that use 'blog' instead of 'changelog'
16255
- const blog = path.match(/^blog:([-_a-zA-Z0-9#]*)$/);
16256
- const changelog = path.match(/^changelog:([-_a-zA-Z0-9#]*)$/);
16257
- const changelogMatch = blog || changelog;
16258
- if (changelogMatch) {
16259
- return `${base}/changelog/${changelogMatch[1]}${hashStr}`;
16260
- }
16261
- const custompage = path.match(/^page:([-_a-zA-Z0-9#]*)$/);
16262
- if (custompage) {
16263
- return `${base}/page/${custompage[1]}${hashStr}`;
16264
- }
16265
- return href;
16121
+ const [path, hash] = href.split('#');
16122
+ const hashStr = hash ? `#${hash}` : '';
16123
+ const base = baseUrl === '/' ? '' : baseUrl;
16124
+ const doc = path.match(/^doc:([-_a-zA-Z0-9#]*)$/);
16125
+ if (doc) {
16126
+ return `${base}/docs/${doc[1]}${hashStr}`;
16127
+ }
16128
+ const ref = path.match(/^ref:([-_a-zA-Z0-9#]*)$/);
16129
+ if (ref) {
16130
+ return `${base}/reference-link/${ref[1]}${hashStr}`;
16131
+ }
16132
+ // we need to perform two matches for changelogs in case
16133
+ // of legacy links that use 'blog' instead of 'changelog'
16134
+ const blog = path.match(/^blog:([-_a-zA-Z0-9#]*)$/);
16135
+ const changelog = path.match(/^changelog:([-_a-zA-Z0-9#]*)$/);
16136
+ const changelogMatch = blog || changelog;
16137
+ if (changelogMatch) {
16138
+ return `${base}/changelog/${changelogMatch[1]}${hashStr}`;
16139
+ }
16140
+ const custompage = path.match(/^page:([-_a-zA-Z0-9#]*)$/);
16141
+ if (custompage) {
16142
+ return `${base}/page/${custompage[1]}${hashStr}`;
16143
+ }
16144
+ return href;
16266
16145
  }
16267
16146
  function docLink(href) {
16268
- const doc = href.match(/^doc:([-_a-zA-Z0-9#]*)$/);
16269
- if (!doc) return false;
16270
- return {
16271
- className: 'doc-link',
16272
- 'data-sidebar': doc[1]
16273
- };
16147
+ const doc = href.match(/^doc:([-_a-zA-Z0-9#]*)$/);
16148
+ if (!doc)
16149
+ return false;
16150
+ return {
16151
+ className: 'doc-link',
16152
+ 'data-sidebar': doc[1],
16153
+ };
16274
16154
  }
16275
16155
  function Anchor(props) {
16276
- const {
16277
- children,
16278
- href,
16279
- target,
16280
- title
16281
- } = props,
16282
- attrs = _objectWithoutProperties(props, _excluded);
16283
- const baseUrl = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useContext)(BaseUrl);
16284
- return (
16285
- /*#__PURE__*/
16156
+ const { children, href = '', target = '', title = '', ...attrs } = props;
16157
+ const baseUrl = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useContext)(BaseUrl);
16158
+ return (
16286
16159
  // eslint-disable-next-line react/jsx-props-no-spreading
16287
- external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("a", _extends({}, attrs, {
16288
- href: getHref(href, baseUrl),
16289
- target: target,
16290
- title: title
16291
- }, docLink(href)), children)
16292
- );
16160
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("a", { ...attrs, href: getHref(href, baseUrl), target: target, title: title, ...docLink(href) }, children));
16293
16161
  }
16294
- Anchor.propTypes = {
16295
- baseUrl: prop_types.string,
16296
- children: prop_types.node.isRequired,
16297
- download: prop_types.string,
16298
- href: prop_types.string,
16299
- target: prop_types.string,
16300
- title: prop_types.string
16301
- };
16302
- Anchor.defaultProps = {
16303
- baseUrl: '/',
16304
- href: '',
16305
- target: '',
16306
- title: ''
16307
- };
16308
16162
  /* harmony default export */ const components_Anchor = (Anchor);
16163
+
16309
16164
  ;// ./node_modules/emoji-regex/index.mjs
16310
16165
  /* harmony default export */ const emoji_regex = (() => {
16311
16166
  // https://mths.be/emoji
@@ -16343,14 +16198,14 @@ const defaultIcons = {
16343
16198
  const Callout = (props) => {
16344
16199
  const { attributes, theme = 'default', empty } = props;
16345
16200
  const children = external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.Children.toArray(props.children);
16346
- const icon = props.icon || defaultIcons[theme] || '❗';
16347
- const isEmoji = emoji_regex().test(icon);
16201
+ const icon = props.icon;
16202
+ const isEmoji = icon && emoji_regex().test(icon);
16348
16203
  const heading = empty ? external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("p", { className: 'callout-heading empty' }) : children[0];
16349
16204
  return (
16350
16205
  // @ts-expect-error -- theme is not a valid attribute
16351
16206
  // eslint-disable-next-line react/jsx-props-no-spreading, react/no-unknown-property
16352
- external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("blockquote", { ...attributes, className: `callout callout_${theme}`, theme: icon },
16353
- isEmoji ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { className: "callout-icon" }, icon)) : (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { className: `callout-icon callout-icon_fa ${icon}` })),
16207
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("blockquote", { ...attributes, className: `callout callout_${theme}`, theme: icon || theme },
16208
+ icon ? (isEmoji ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { className: "callout-icon" }, icon)) : (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.createElement("span", { className: `callout-icon callout-icon_fa ${icon}` }))) : null,
16354
16209
  heading,
16355
16210
  children.slice(1)));
16356
16211
  };
@@ -20979,7 +20834,7 @@ const external_amd_react_dom_commonjs2_react_dom_commonjs_react_dom_root_ReactDO
20979
20834
 
20980
20835
 
20981
20836
 
20982
- function tippy_react_esm_objectWithoutPropertiesLoose(source, excluded) {
20837
+ function _objectWithoutPropertiesLoose(source, excluded) {
20983
20838
  if (source == null) return {};
20984
20839
  var target = {};
20985
20840
  var sourceKeys = Object.keys(source);
@@ -21141,7 +20996,7 @@ function TippyGenerator(tippy) {
21141
20996
  ignoreAttributes = _ref$ignoreAttributes === void 0 ? true : _ref$ignoreAttributes,
21142
20997
  __source = _ref.__source,
21143
20998
  __self = _ref.__self,
21144
- restOfNativeProps = tippy_react_esm_objectWithoutPropertiesLoose(_ref, ["children", "content", "visible", "singleton", "render", "reference", "disabled", "ignoreAttributes", "__source", "__self"]);
20999
+ restOfNativeProps = _objectWithoutPropertiesLoose(_ref, ["children", "content", "visible", "singleton", "render", "reference", "disabled", "ignoreAttributes", "__source", "__self"]);
21145
21000
 
21146
21001
  var isControlledMode = visible !== undefined;
21147
21002
  var isSingletonMode = singleton !== undefined;
@@ -21405,7 +21260,7 @@ function useSingletonGenerator(createSingleton) {
21405
21260
 
21406
21261
  var _sourceData$props = sourceData.props,
21407
21262
  content = _sourceData$props.content,
21408
- props = tippy_react_esm_objectWithoutPropertiesLoose(_sourceData$props, ["content"]);
21263
+ props = _objectWithoutPropertiesLoose(_sourceData$props, ["content"]);
21409
21264
 
21410
21265
  instance.setProps(deepPreserveProps(instance.props, Object.assign({}, props, {
21411
21266
  overrides: overrides
@@ -21471,7 +21326,7 @@ function useSingletonGenerator(createSingleton) {
21471
21326
  var forwardRef = (function (Tippy, defaultProps) {
21472
21327
  return /*#__PURE__*/(0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.forwardRef)(function TippyWrapper(_ref, _ref2) {
21473
21328
  var children = _ref.children,
21474
- props = tippy_react_esm_objectWithoutPropertiesLoose(_ref, ["children"]);
21329
+ props = _objectWithoutPropertiesLoose(_ref, ["children"]);
21475
21330
 
21476
21331
  return (
21477
21332
  /*#__PURE__*/
@@ -87509,7 +87364,7 @@ const coerceJsxToMd = ({ components = {}, html = false } = {}) => (node, index,
87509
87364
  else if (node.name === 'Callout') {
87510
87365
  const attrs = getAttrs(node);
87511
87366
  const { empty } = attrs;
87512
- const icon = attrs.icon || defaultIcons[attrs.theme];
87367
+ const icon = attrs.icon;
87513
87368
  const theme = attrs.theme || themes[icon] || 'default';
87514
87369
  const mdNode = {
87515
87370
  children: node.children,