dumi 2.4.27 → 2.4.29

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.
Files changed (174) hide show
  1. package/compiled/@umijs/plugins/index.js +1 -1
  2. package/compiled/@umijs/plugins/package.json +1 -1
  3. package/compiled/crates/swc_plugin_react_demo.wasm +0 -0
  4. package/dist/client/misc/reactDemoCompiler.js +2 -2
  5. package/dist/client/theme-api/AtomRenderer.js +6 -6
  6. package/dist/client/theme-api/DumiDemo/index.js +1 -1
  7. package/dist/client/theme-api/DumiDemoGrid.js +1 -1
  8. package/dist/client/theme-api/DumiPage.js +1 -1
  9. package/dist/client/theme-api/openCodeSandbox.js +1 -1
  10. package/dist/client/theme-api/openStackBlitz.js +1 -1
  11. package/dist/client/theme-api/useLiveDemo.js +4 -4
  12. package/dist/client/theme-api/useLocale.js +1 -1
  13. package/dist/client/theme-api/useNavData.js +6 -6
  14. package/dist/client/theme-api/usePrefersColor.js +4 -4
  15. package/dist/client/theme-api/useRenderer.js +6 -6
  16. package/dist/client/theme-api/useRouteMeta.js +2 -2
  17. package/dist/client/theme-api/useSidebarData.js +7 -7
  18. package/dist/client/theme-api/useSiteSearch/index.js +1 -1
  19. package/dist/client/theme-api/useSiteSearch/useSearchData.js +7 -7
  20. package/dist/client/theme-api/useTabMeta.js +2 -2
  21. package/dist/client/theme-api/utils.js +4 -4
  22. package/dist/features/compile/index.js +1 -1
  23. package/dist/features/compile/utoopackLoaders.js +4 -4
  24. package/dist/loaders/markdown/index.js +19 -11
  25. package/dist/templates/meta/index.ts.tpl +4 -2
  26. package/package.json +8 -8
  27. package/theme-default/builtins/API/index.js +8 -8
  28. package/theme-default/builtins/CodeGroup/index.js +1 -1
  29. package/theme-default/builtins/Container/index.js +1 -1
  30. package/theme-default/builtins/Previewer/index.js +1 -1
  31. package/theme-default/builtins/SourceCode/index.js +1 -1
  32. package/theme-default/builtins/Table/index.js +1 -1
  33. package/theme-default/builtins/Tree/index.js +7 -7
  34. package/theme-default/layouts/DocLayout/index.js +1 -1
  35. package/theme-default/slots/ColorSwitch/index.js +1 -1
  36. package/theme-default/slots/ContentFooter/index.js +1 -1
  37. package/theme-default/slots/Header/index.js +1 -1
  38. package/theme-default/slots/LangSwitch/index.js +1 -1
  39. package/theme-default/slots/Navbar/index.js +1 -1
  40. package/theme-default/slots/PreviewerActions/index.js +6 -6
  41. package/theme-default/slots/RtlSwitch/index.js +1 -1
  42. package/theme-default/slots/SearchBar/Mask.js +1 -1
  43. package/theme-default/slots/SearchBar/index.js +2 -2
  44. package/theme-default/slots/SearchResult/index.js +3 -3
  45. package/theme-default/slots/SourceCodeEditor/index.js +3 -3
  46. package/theme-default/slots/Toc/index.js +1 -1
  47. package/dist/assetParsers/BaseParser.d.ts +0 -55
  48. package/dist/assetParsers/atom.d.ts +0 -21
  49. package/dist/assetParsers/block.d.ts +0 -25
  50. package/dist/assetParsers/utils.d.ts +0 -79
  51. package/dist/cli.d.ts +0 -1
  52. package/dist/client/misc/reactDemoCompiler.d.ts +0 -3
  53. package/dist/client/pages/404.d.ts +0 -1
  54. package/dist/client/pages/Demo/index.d.ts +0 -4
  55. package/dist/client/pages/Loading.d.ts +0 -1
  56. package/dist/client/theme-api/AtomRenderer.d.ts +0 -13
  57. package/dist/client/theme-api/DumiDemo/DemoErrorBoundary.d.ts +0 -5
  58. package/dist/client/theme-api/DumiDemo/index.d.ts +0 -10
  59. package/dist/client/theme-api/DumiDemoGrid.d.ts +0 -7
  60. package/dist/client/theme-api/DumiPage.d.ts +0 -4
  61. package/dist/client/theme-api/context.d.ts +0 -22
  62. package/dist/client/theme-api/index.d.ts +0 -18
  63. package/dist/client/theme-api/openCodeSandbox.d.ts +0 -9
  64. package/dist/client/theme-api/openStackBlitz.d.ts +0 -1
  65. package/dist/client/theme-api/types.d.ts +0 -258
  66. package/dist/client/theme-api/useAtomAssets.d.ts +0 -4
  67. package/dist/client/theme-api/useLiveDemo.d.ts +0 -10
  68. package/dist/client/theme-api/useLocale.d.ts +0 -2
  69. package/dist/client/theme-api/useNavData.d.ts +0 -5
  70. package/dist/client/theme-api/usePrefersColor.d.ts +0 -7
  71. package/dist/client/theme-api/useRenderer.d.ts +0 -12
  72. package/dist/client/theme-api/useRouteMeta.d.ts +0 -17
  73. package/dist/client/theme-api/useSidebarData.d.ts +0 -29
  74. package/dist/client/theme-api/useSiteSearch/index.d.ts +0 -24
  75. package/dist/client/theme-api/useSiteSearch/useSearchData.d.ts +0 -12
  76. package/dist/client/theme-api/useTabMeta.d.ts +0 -4
  77. package/dist/client/theme-api/utils.d.ts +0 -31
  78. package/dist/constants.d.ts +0 -23
  79. package/dist/features/assets.d.ts +0 -20
  80. package/dist/features/autoAlias.d.ts +0 -3
  81. package/dist/features/compile/babelLoaderCustomize.d.ts +0 -4
  82. package/dist/features/compile/index.d.ts +0 -4
  83. package/dist/features/compile/makoHooks.d.ts +0 -8
  84. package/dist/features/compile/utils.d.ts +0 -2
  85. package/dist/features/compile/utoopackLoaders.d.ts +0 -8
  86. package/dist/features/configPlugins/index.d.ts +0 -3
  87. package/dist/features/configPlugins/schema.d.ts +0 -4
  88. package/dist/features/derivative.d.ts +0 -11
  89. package/dist/features/exportStatic.d.ts +0 -3
  90. package/dist/features/exports.d.ts +0 -3
  91. package/dist/features/html2sketch.d.ts +0 -3
  92. package/dist/features/locales.d.ts +0 -3
  93. package/dist/features/meta.d.ts +0 -5
  94. package/dist/features/parser.d.ts +0 -3
  95. package/dist/features/routes.d.ts +0 -3
  96. package/dist/features/sideEffects/docSideEffectsWebpackPlugin.d.ts +0 -14
  97. package/dist/features/sideEffects/index.d.ts +0 -7
  98. package/dist/features/sitemap.d.ts +0 -3
  99. package/dist/features/tabs.d.ts +0 -17
  100. package/dist/features/theme/index.d.ts +0 -3
  101. package/dist/features/theme/loader.d.ts +0 -55
  102. package/dist/index.d.ts +0 -6
  103. package/dist/loaders/demo/index.d.ts +0 -6
  104. package/dist/loaders/markdown/index.d.ts +0 -27
  105. package/dist/loaders/markdown/transformer/index.d.ts +0 -69
  106. package/dist/loaders/markdown/transformer/rehypeDemo.d.ts +0 -15
  107. package/dist/loaders/markdown/transformer/rehypeDesc.d.ts +0 -6
  108. package/dist/loaders/markdown/transformer/rehypeEnhancedTag.d.ts +0 -3
  109. package/dist/loaders/markdown/transformer/rehypeHighlightLine.d.ts +0 -4
  110. package/dist/loaders/markdown/transformer/rehypeImg.d.ts +0 -6
  111. package/dist/loaders/markdown/transformer/rehypeIsolation.d.ts +0 -7
  112. package/dist/loaders/markdown/transformer/rehypeJsxify.d.ts +0 -2
  113. package/dist/loaders/markdown/transformer/rehypeLink.d.ts +0 -6
  114. package/dist/loaders/markdown/transformer/rehypeRaw.d.ts +0 -6
  115. package/dist/loaders/markdown/transformer/rehypeSlug.d.ts +0 -4
  116. package/dist/loaders/markdown/transformer/rehypeStrip.d.ts +0 -3
  117. package/dist/loaders/markdown/transformer/rehypeText.d.ts +0 -4
  118. package/dist/loaders/markdown/transformer/remarkBreaks.d.ts +0 -3
  119. package/dist/loaders/markdown/transformer/remarkContainer.d.ts +0 -3
  120. package/dist/loaders/markdown/transformer/remarkEmbed.d.ts +0 -4
  121. package/dist/loaders/markdown/transformer/remarkMeta.d.ts +0 -8
  122. package/dist/loaders/null/index.d.ts +0 -2
  123. package/dist/loaders/page/index.d.ts +0 -1
  124. package/dist/loaders/post-raw/index.d.ts +0 -4
  125. package/dist/loaders/pre-raw/index.d.ts +0 -4
  126. package/dist/preset.d.ts +0 -5
  127. package/dist/registerMethods.d.ts +0 -3
  128. package/dist/service/cli.d.ts +0 -5
  129. package/dist/service/constants.d.ts +0 -4
  130. package/dist/service/dev.d.ts +0 -1
  131. package/dist/service/forkedDev.d.ts +0 -1
  132. package/dist/service/printHelp.d.ts +0 -1
  133. package/dist/service/service.d.ts +0 -13
  134. package/dist/techStacks/react.d.ts +0 -7
  135. package/dist/techStacks/utils.d.ts +0 -40
  136. package/dist/types.d.ts +0 -159
  137. package/dist/utils.d.ts +0 -67
  138. package/theme-default/builtins/API/index.d.ts +0 -7
  139. package/theme-default/builtins/Badge/index.d.ts +0 -7
  140. package/theme-default/builtins/CodeGroup/index.d.ts +0 -3
  141. package/theme-default/builtins/Container/index.d.ts +0 -8
  142. package/theme-default/builtins/Previewer/index.d.ts +0 -5
  143. package/theme-default/builtins/SourceCode/index.d.ts +0 -14
  144. package/theme-default/builtins/Table/index.d.ts +0 -6
  145. package/theme-default/builtins/Tree/index.d.ts +0 -5
  146. package/theme-default/layouts/DocLayout/index.d.ts +0 -4
  147. package/theme-default/slots/ColorSwitch/index.d.ts +0 -4
  148. package/theme-default/slots/Content/index.d.ts +0 -7
  149. package/theme-default/slots/ContentFooter/index.d.ts +0 -4
  150. package/theme-default/slots/ContentTabs/index.d.ts +0 -11
  151. package/theme-default/slots/Features/index.d.ts +0 -4
  152. package/theme-default/slots/Footer/index.d.ts +0 -4
  153. package/theme-default/slots/Header/index.d.ts +0 -4
  154. package/theme-default/slots/HeaderExtra/index.d.ts +0 -3
  155. package/theme-default/slots/Hero/index.d.ts +0 -4
  156. package/theme-default/slots/HeroTitle/index.d.ts +0 -6
  157. package/theme-default/slots/LangSwitch/index.d.ts +0 -4
  158. package/theme-default/slots/Loading/index.d.ts +0 -5
  159. package/theme-default/slots/Logo/index.d.ts +0 -4
  160. package/theme-default/slots/Navbar/index.d.ts +0 -4
  161. package/theme-default/slots/NavbarExtra/index.d.ts +0 -3
  162. package/theme-default/slots/NotFound/index.d.ts +0 -4
  163. package/theme-default/slots/PreviewerActions/index.d.ts +0 -27
  164. package/theme-default/slots/PreviewerActionsExtra/index.d.ts +0 -4
  165. package/theme-default/slots/RtlSwitch/index.d.ts +0 -4
  166. package/theme-default/slots/SearchBar/Input.d.ts +0 -6
  167. package/theme-default/slots/SearchBar/Mask.d.ts +0 -9
  168. package/theme-default/slots/SearchBar/index.d.ts +0 -6
  169. package/theme-default/slots/SearchResult/index.d.ts +0 -10
  170. package/theme-default/slots/Sidebar/index.d.ts +0 -4
  171. package/theme-default/slots/SocialIcon/index.d.ts +0 -13
  172. package/theme-default/slots/SourceCodeEditor/index.d.ts +0 -19
  173. package/theme-default/slots/Tabs/index.d.ts +0 -6
  174. package/theme-default/slots/Toc/index.d.ts +0 -4
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  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."); }
3
3
  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); }
4
4
  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; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5
+ 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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { ReactComponent as IconClose } from '@ant-design/icons-svg/inline-svg/outlined/close.svg';
8
8
  import { ReactComponent as IconMenu } from '@ant-design/icons-svg/inline-svg/outlined/menu.svg';
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  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."); }
3
3
  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); }
4
4
  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; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5
+ 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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { ReactComponent as IconDown } from '@ant-design/icons-svg/inline-svg/outlined/down.svg';
8
8
  import { history, Link, useIntl, useLocale, useLocation, useSiteData } from 'dumi';
@@ -3,7 +3,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
3
3
  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."); }
4
4
  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); }
5
5
  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; }
6
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ 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; } }
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
8
  /* eslint-disable @typescript-eslint/no-use-before-define */
9
9
  import { ReactComponent as IconDown } from '@ant-design/icons-svg/inline-svg/outlined/down.svg';
@@ -1,13 +1,13 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
+ 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); }
2
2
  var _excluded = ["title", "placement"];
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
7
  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."); }
8
8
  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); }
9
9
  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; }
10
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
10
+ 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; } }
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
  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); }
13
13
  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; }
@@ -197,9 +197,9 @@ var PreviewerActions = function PreviewerActions(props) {
197
197
  initialValue: files[i][1].value.trim(),
198
198
  onChange: function onChange(code) {
199
199
  var _props$onSourceChange, _props$onSourceTransp;
200
- (_props$onSourceChange = props.onSourceChange) === null || _props$onSourceChange === void 0 ? void 0 : _props$onSourceChange.call(props, _defineProperty({}, files[i][0], code));
200
+ (_props$onSourceChange = props.onSourceChange) === null || _props$onSourceChange === void 0 || _props$onSourceChange.call(props, _defineProperty({}, files[i][0], code));
201
201
  // FIXME: remove before publish
202
- (_props$onSourceTransp = props.onSourceTranspile) === null || _props$onSourceTransp === void 0 ? void 0 : _props$onSourceTransp.call(props, {
202
+ (_props$onSourceTransp = props.onSourceTranspile) === null || _props$onSourceTransp === void 0 || _props$onSourceTransp.call(props, {
203
203
  source: _defineProperty({}, files[i][0], code)
204
204
  });
205
205
  },
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  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."); }
3
3
  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); }
4
4
  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; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5
+ 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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { useSiteData } from 'dumi';
8
8
  import React, { useEffect, useState } from 'react';
@@ -6,7 +6,7 @@ export var Mask = function Mask(props) {
6
6
  } else if (document.body.style.overflow) {
7
7
  var _props$onClose;
8
8
  document.body.style.overflow = '';
9
- (_props$onClose = props.onClose) === null || _props$onClose === void 0 ? void 0 : _props$onClose.call(props);
9
+ (_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
10
10
  }
11
11
  }, [props.visible]);
12
12
  return props.visible ? /*#__PURE__*/React.createElement("div", {
@@ -3,7 +3,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
3
3
  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."); }
4
4
  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); }
5
5
  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; }
6
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ 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; } }
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
8
  import { ReactComponent as IconArrowDown } from '@ant-design/icons-svg/inline-svg/outlined/arrow-down.svg';
9
9
  import { ReactComponent as IconArrowUp } from '@ant-design/icons-svg/inline-svg/outlined/arrow-up.svg';
@@ -66,7 +66,7 @@ var SearchBar = function SearchBar() {
66
66
  setModalVisible(true);
67
67
  setTimeout(function () {
68
68
  var _modalInputRef$curren;
69
- (_modalInputRef$curren = modalInputRef.current) === null || _modalInputRef$curren === void 0 ? void 0 : _modalInputRef$curren.focus();
69
+ (_modalInputRef$curren = modalInputRef.current) === null || _modalInputRef$curren === void 0 || _modalInputRef$curren.focus();
70
70
  });
71
71
  }
72
72
  }
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  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."); }
3
3
  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); }
4
4
  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; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5
+ 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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { ReactComponent as IconInbox } from '@ant-design/icons-svg/inline-svg/outlined/inbox.svg';
8
8
  import animateScrollTo from 'animated-scroll-to';
@@ -103,7 +103,7 @@ var SearchResult = function SearchResult(props) {
103
103
  pathname = _useLocation.pathname;
104
104
  var onItemSelect = function onItemSelect(item) {
105
105
  var _props$onItemSelect;
106
- (_props$onItemSelect = props.onItemSelect) === null || _props$onItemSelect === void 0 ? void 0 : _props$onItemSelect.call(props, item);
106
+ (_props$onItemSelect = props.onItemSelect) === null || _props$onItemSelect === void 0 || _props$onItemSelect.call(props, item);
107
107
  var url = new URL(item === null || item === void 0 ? void 0 : item.link, location.origin);
108
108
  if ((url === null || url === void 0 ? void 0 : url.pathname) === pathname && !url.hash) {
109
109
  setTimeout(function () {
@@ -125,7 +125,7 @@ var SearchResult = function SearchResult(props) {
125
125
  return item.type === 'hint' && item.activeIndex === activeIndex;
126
126
  }).value;
127
127
  history.push(_item.link);
128
- onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(_item);
128
+ onItemSelect === null || onItemSelect === void 0 || onItemSelect(_item);
129
129
  document.activeElement.blur();
130
130
  }
131
131
  if (['Escape', 'Enter'].includes(ev.key)) {
@@ -3,7 +3,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
3
3
  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."); }
4
4
  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); }
5
5
  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; }
6
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ 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; } }
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
8
  import SourceCode from 'dumi/theme/builtins/SourceCode';
9
9
  import React, { useEffect, useRef, useState } from 'react';
@@ -55,9 +55,9 @@ var SourceCodeEditor = function SourceCodeEditor(props) {
55
55
  onChange: function onChange(ev) {
56
56
  var _props$onChange, _props$onTranspile;
57
57
  setCode(ev.target.value);
58
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, ev.target.value);
58
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, ev.target.value);
59
59
  // FIXME: remove before publish
60
- (_props$onTranspile = props.onTranspile) === null || _props$onTranspile === void 0 ? void 0 : _props$onTranspile.call(props, {
60
+ (_props$onTranspile = props.onTranspile) === null || _props$onTranspile === void 0 || _props$onTranspile.call(props, {
61
61
  err: null,
62
62
  code: ev.target.value
63
63
  });
@@ -3,7 +3,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
3
3
  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."); }
4
4
  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); }
5
5
  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; }
6
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ 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; } }
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
8
  import { Scrollspy as ScrollSpy } from '@makotot/ghostui';
9
9
  import { history, Link, useLocation, useRouteMeta, useSiteData, useTabMeta } from 'dumi';
@@ -1,55 +0,0 @@
1
- import type { AtomComponentAsset, AtomFunctionAsset } from 'dumi-assets-types';
2
- import { chokidar } from 'umi/plugin-utils';
3
- export interface IPatchFile {
4
- event: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
5
- fileName: string;
6
- }
7
- export interface IAtomAssetsParserResult {
8
- components: Record<string, AtomComponentAsset>;
9
- functions: Record<string, AtomFunctionAsset>;
10
- }
11
- /**
12
- * The parsing and extraction of language metadata should be implemented separately
13
- */
14
- export interface ILanguageMetaParser {
15
- patch(file: IPatchFile): void;
16
- parse(): Promise<IAtomAssetsParserResult>;
17
- destroy(): Promise<void>;
18
- }
19
- export interface IHandleWatcherArgs {
20
- patch: ILanguageMetaParser['patch'];
21
- parse: () => void;
22
- watchArgs: {
23
- paths: string | string[];
24
- options: chokidar.WatchOptions;
25
- };
26
- }
27
- export interface IBaseAtomAssetsParserParams<T> {
28
- entryFile: string;
29
- resolveDir: string;
30
- parser: T;
31
- handleWatcher?: (watcher: chokidar.FSWatcher, params: IHandleWatcherArgs) => chokidar.FSWatcher;
32
- watchOptions?: chokidar.WatchOptions;
33
- }
34
- export declare class BaseAtomAssetsParser<T extends ILanguageMetaParser = ILanguageMetaParser> {
35
- private watchArgs;
36
- private watcher;
37
- private handleWatcher?;
38
- private entryDir;
39
- private resolveDir;
40
- private readonly parser;
41
- private isParsing;
42
- private parseDeferrer;
43
- private cbs;
44
- constructor(opts: IBaseAtomAssetsParserParams<T>);
45
- parse(): Promise<IAtomAssetsParserResult>;
46
- watch(cb: (data: IAtomAssetsParserResult) => void): void;
47
- unwatch(cb: (data: IAtomAssetsParserResult) => void): void;
48
- patchWatchArgs(handler: (args: BaseAtomAssetsParser<T>['watchArgs']) => BaseAtomAssetsParser<T>['watchArgs']): void;
49
- getWatchArgs(): {
50
- paths: string | string[];
51
- options: chokidar.WatchOptions;
52
- };
53
- destroyWorker(): Promise<void>;
54
- }
55
- export type IAtomAssetsParser = InstanceType<typeof BaseAtomAssetsParser>;
@@ -1,21 +0,0 @@
1
- import { BaseAtomAssetsParser, IAtomAssetsParserResult, ILanguageMetaParser, IPatchFile } from './BaseParser';
2
- interface ParserParams {
3
- entryFile: string;
4
- resolveDir: string;
5
- resolveFilter?: ReactMetaParser['resolveFilter'];
6
- unpkgHost?: string;
7
- parseOptions?: object;
8
- }
9
- declare class ReactMetaParser implements ILanguageMetaParser {
10
- private parser;
11
- private resolveFilter;
12
- private unresolvedFiles;
13
- constructor(opts: ParserParams);
14
- parse(): Promise<IAtomAssetsParserResult>;
15
- destroy(): Promise<void>;
16
- patch(file: IPatchFile): void;
17
- }
18
- declare class ReactAtomAssetsParser extends BaseAtomAssetsParser<ReactMetaParser> {
19
- constructor(opts: ParserParams);
20
- }
21
- export default ReactAtomAssetsParser;
@@ -1,25 +0,0 @@
1
- import { parseCodeFrontmatter } from "../utils";
2
- import type { ExampleBlockAsset } from 'dumi-assets-types';
3
- import type { sync } from 'enhanced-resolve';
4
- import { IDumiTechStack } from '../types';
5
- export interface IParsedBlockAsset {
6
- asset: ExampleBlockAsset;
7
- /**
8
- * resolveMap: {
9
- * '@/constants': '/path/to/constants.ts',
10
- * 'antd/es/button': '/path/to/antd/es/button/index.jsx',
11
- * }
12
- */
13
- resolveMap: Record<string, string>;
14
- frontmatter: ReturnType<typeof parseCodeFrontmatter>['frontmatter'];
15
- }
16
- declare function parseBlockAsset(opts: {
17
- fileAbsPath: string;
18
- fileLocale?: string;
19
- id: string;
20
- refAtomIds: string[];
21
- entryPointCode?: string;
22
- resolver: typeof sync;
23
- techStack: IDumiTechStack;
24
- }): Promise<IParsedBlockAsset>;
25
- export default parseBlockAsset;
@@ -1,79 +0,0 @@
1
- import { BaseAtomAssetsParser, IBaseAtomAssetsParserParams, ILanguageMetaParser } from './BaseParser';
2
- /**
3
- * Only expose these methods to avoid all properties being proxied
4
- * @param ClassConstructor The Class to be processed
5
- * @param publicMethods accessible Class methods
6
- * @returns processed Class
7
- */
8
- export declare function createExposedClass<T extends {
9
- new (...args: ConstructorParameters<T>): InstanceType<T>;
10
- }>(ClassConstructor: T, publicMethods?: string[]): {
11
- new (...params: ConstructorParameters<T>): {};
12
- };
13
- /**
14
- * Create Class that can execute across threads
15
- * @param filename Child thread running script path
16
- * @param ClassConstructor Class that require remote execution
17
- * @param opts
18
- * @returns Remote Class, all its methods are asynchronous
19
- */
20
- export declare function createRemoteClass<T extends {
21
- new (...args: ConstructorParameters<T>): InstanceType<T>;
22
- }>(filename: string, ClassConstructor: T, opts?: {
23
- destroyMethod: string;
24
- publicMethods?: string[];
25
- }): T;
26
- interface ICreateApiParserOptions<S, C> {
27
- /**
28
- * The full file name (absolute path) of the file where `parseWorker` is located
29
- */
30
- filename: string;
31
- /**
32
- * Parsing class working in worker_thead
33
- */
34
- worker: S;
35
- /**
36
- * Main thread side work, mainly to detect file changes
37
- */
38
- parseOptions?: C;
39
- }
40
- export interface IBaseApiParserOptions {
41
- entryFile: string;
42
- resolveDir: string;
43
- }
44
- /**
45
- * Can be used to override apiParser
46
- * @param options
47
- * @returns A function that returns a Parser instance
48
- * @example
49
- * ```ts
50
- * interface ParserOptions extends BaseApiParserOptions {
51
- * // other props...
52
- * }
53
- * const Parser = createApiParser({
54
- * filename: __filename,
55
- * worker: (class {
56
- * constructor(opts: ParserOptions) {}
57
- * patch () {}
58
- * async parse () {
59
- * return {
60
- * components: {},
61
- * functions: {}
62
- * };
63
- * }
64
- * async destroy () {}
65
- * }),
66
- * parserOptions: {
67
- * handleWatcher(watcher, { parse, patch }) {
68
- * return watcher.on('all', (ev, file) => {
69
- * // You can perform patch and parse operations based on file changes.
70
- * // patch will transfer the corresponding file to the parseWorker,
71
- * // and parse will instruct the parseWorker to parse according to updated files.
72
- * });
73
- * },
74
- * },
75
- * });
76
- * ```
77
- */
78
- export declare function createApiParser<P extends new (...args: ConstructorParameters<P>) => InstanceType<P> & ILanguageMetaParser>(options: ICreateApiParserOptions<P, Partial<IBaseAtomAssetsParserParams<P>>>): (...args: ConstructorParameters<P>) => BaseAtomAssetsParser<ILanguageMetaParser>;
79
- export {};
package/dist/cli.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import type { IDemoCompileFn } from '../theme-api/types';
2
- declare const compile: IDemoCompileFn;
3
- export default compile;
@@ -1 +0,0 @@
1
- export { default } from 'dumi/theme/slots/NotFound';
@@ -1,4 +0,0 @@
1
- import { type FC } from 'react';
2
- import './index.less';
3
- declare const DemoRenderPage: FC;
4
- export default DemoRenderPage;
@@ -1 +0,0 @@
1
- export { default } from 'dumi/theme/slots/Loading';
@@ -1,13 +0,0 @@
1
- import { AtomAsset, ExamplePresetAsset } from 'dumi-assets-types';
2
- import type { TypeMap } from 'dumi-assets-types/typings/atom/props/types';
3
- import { type FC } from 'react';
4
- interface IAtomRendererProps {
5
- type: AtomAsset['type'];
6
- value: ExamplePresetAsset['value'];
7
- processor?: typeof builtInProcessor;
8
- }
9
- type Entity = TypeMap['element'] | TypeMap['function'] | TypeMap['dom'];
10
- type Exports = Record<string, any>;
11
- declare function builtInProcessor(entity: Entity, entryExports: Exports): any;
12
- export declare const AtomRenderer: FC<IAtomRendererProps>;
13
- export {};
@@ -1,5 +0,0 @@
1
- import { type FC, type ReactNode } from 'react';
2
- declare const DemoErrorBoundary: FC<{
3
- children: ReactNode;
4
- }>;
5
- export default DemoErrorBoundary;
@@ -1,10 +0,0 @@
1
- import { type FC } from 'react';
2
- import type { IPreviewerProps } from '../types';
3
- export interface IDumiDemoProps {
4
- demo: {
5
- id: string;
6
- inline?: boolean;
7
- };
8
- previewerProps: Omit<IPreviewerProps, 'asset' | 'children'>;
9
- }
10
- export declare const DumiDemo: FC<IDumiDemoProps>;
@@ -1,7 +0,0 @@
1
- import { ReactNode, type FC } from 'react';
2
- import type { IDumiDemoProps } from './DumiDemo';
3
- export interface IDumiDemoGridProps {
4
- items: IDumiDemoProps[];
5
- demoRender?: (item: IDumiDemoProps) => ReactNode;
6
- }
7
- export declare const DumiDemoGrid: FC<IDumiDemoGridProps>;
@@ -1,4 +0,0 @@
1
- import { type FC, type ReactNode } from 'react';
2
- export declare const DumiPage: FC<{
3
- children: ReactNode;
4
- }>;
@@ -1,22 +0,0 @@
1
- /// <reference types="react" />
2
- import type { PICKED_PKG_FIELDS } from "../../constants";
3
- import type { AtomComponentAsset } from 'dumi-assets-types';
4
- import type { IDemoData, ILocalesConfig, IThemeConfig } from './types';
5
- export interface ISiteContext {
6
- pkg: Partial<Record<keyof typeof PICKED_PKG_FIELDS, any>>;
7
- historyType: 'browser' | 'hash' | 'memory';
8
- entryExports: Record<string, any>;
9
- demos: Record<string, IDemoData>;
10
- components: Record<string, AtomComponentAsset>;
11
- locales: ILocalesConfig;
12
- themeConfig: IThemeConfig;
13
- hostname?: string;
14
- loading: boolean;
15
- setLoading: (status: boolean) => void;
16
- /**
17
- * private field, do not use it in your code
18
- */
19
- _2_level_nav_available: boolean;
20
- }
21
- export declare const SiteContext: import("react").Context<ISiteContext>;
22
- export declare const useSiteData: () => ISiteContext;
@@ -1,18 +0,0 @@
1
- export { FormattedDate, FormattedDateParts, FormattedDisplayName, FormattedList, FormattedMessage, FormattedNumber, FormattedNumberParts, FormattedPlural, FormattedRelativeTime, FormattedTime, FormattedTimeParts, IntlContext, IntlProvider, RawIntlProvider, createIntlCache, defineMessages, injectIntl, useIntl, } from 'react-intl';
2
- export { AtomRenderer } from './AtomRenderer';
3
- export { DumiDemo } from './DumiDemo';
4
- export { DumiDemoGrid } from './DumiDemoGrid';
5
- export { DumiPage } from './DumiPage';
6
- export { useSiteData } from './context';
7
- export { openCodeSandbox } from './openCodeSandbox';
8
- export { openStackBlitz } from './openStackBlitz';
9
- export type { IDemoCancelableFn, IPreviewerProps } from './types';
10
- export { useAtomAssets } from './useAtomAssets';
11
- export { useLiveDemo } from './useLiveDemo';
12
- export { useLocale } from './useLocale';
13
- export { useNavData } from './useNavData';
14
- export { usePrefersColor } from './usePrefersColor';
15
- export { useMatchedRoute, useRouteMeta } from './useRouteMeta';
16
- export { useFullSidebarData, useSidebarData } from './useSidebarData';
17
- export { useSiteSearch } from './useSiteSearch';
18
- export { useTabMeta } from './useTabMeta';
@@ -1,9 +0,0 @@
1
- /**
2
- * use CodeSandbox.io
3
- * @param data previewer opts
4
- * @param opts the api that CodeSandbox calls when creating the demo
5
- * @note return a open function for open demo on codesandbox.io
6
- */
7
- export declare const openCodeSandbox: (data: IPreviewerProps, opts?: {
8
- api?: string;
9
- }) => void;
@@ -1 +0,0 @@
1
- export declare const openStackBlitz: (data: IPreviewerProps) => void;