@antv/dumi-theme-antv 0.2.2 → 0.3.0-beta.1

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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -33
  3. package/dist/builtins/Playground/index.d.ts +24 -0
  4. package/{es/builtins/Example.js → dist/builtins/Playground/index.js} +40 -33
  5. package/dist/builtins/Playground/index.module.less +15 -0
  6. package/dist/context.d.ts +5 -0
  7. package/dist/context.js +2 -0
  8. package/dist/layouts/DocLayout.d.ts +7 -0
  9. package/dist/layouts/DocLayout.js +38 -0
  10. package/dist/layouts/entry/API.d.ts +10 -0
  11. package/dist/layouts/entry/API.js +12 -0
  12. package/dist/layouts/entry/Index.d.ts +7 -0
  13. package/dist/layouts/entry/Index.js +71 -0
  14. package/dist/layouts/entry/Manual.d.ts +8 -0
  15. package/dist/layouts/entry/Manual.js +14 -0
  16. package/dist/locales/en.json +98 -0
  17. package/dist/locales/zh.json +98 -0
  18. package/dist/pages/404.d.ts +6 -0
  19. package/dist/pages/404.js +14 -0
  20. package/dist/pages/Example/index.d.ts +6 -0
  21. package/dist/pages/Example/index.js +139 -0
  22. package/dist/pages/Example/index.module.less +40 -0
  23. package/dist/pages/Examples/components/Accouncement/index.d.ts +6 -0
  24. package/dist/pages/Examples/components/Accouncement/index.js +60 -0
  25. package/dist/pages/Examples/components/Accouncement/index.module.less +9 -0
  26. package/dist/pages/Examples/components/Article/index.d.ts +2 -0
  27. package/dist/pages/Examples/components/Article/index.js +8 -0
  28. package/dist/pages/Examples/components/Article/index.module.less +2 -0
  29. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +10 -0
  30. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +74 -0
  31. package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +9 -0
  32. package/{es/builtins/Table.js → dist/pages/Examples/components/ExampleTopicMenu/index.js} +47 -41
  33. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +10 -0
  34. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +33 -0
  35. package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +10 -0
  36. package/dist/pages/Examples/components/GalleryPageContent/index.js +81 -0
  37. package/dist/pages/Examples/index.d.ts +8 -0
  38. package/dist/pages/Examples/index.js +75 -0
  39. package/dist/pages/Examples/index.module.less +605 -0
  40. package/dist/pages/Examples/types.d.ts +33 -0
  41. package/dist/pages/Examples/types.js +1 -0
  42. package/dist/plugin/examples.d.ts +7 -0
  43. package/dist/plugin/examples.js +83 -0
  44. package/dist/plugin/index.d.ts +3 -0
  45. package/dist/plugin/index.js +103 -0
  46. package/dist/slots/404.d.ts +2 -0
  47. package/{es/antv/404/index.js → dist/slots/404.js} +4 -9
  48. package/{es/antv/Cases/Cases.d.ts → dist/slots/Cases/index.d.ts} +4 -4
  49. package/{es/antv/Cases/Cases.js → dist/slots/Cases/index.js} +25 -25
  50. package/{src/antv/Cases/Cases.module.less → dist/slots/Cases/index.module.less} +36 -5
  51. package/dist/slots/CodeEditor/Toolbar.d.ts +67 -0
  52. package/dist/slots/CodeEditor/Toolbar.js +152 -0
  53. package/dist/slots/CodeEditor/Toolbar.module.less +81 -0
  54. package/dist/slots/CodeEditor/index.d.ts +58 -0
  55. package/dist/slots/CodeEditor/index.js +200 -0
  56. package/dist/slots/CodeEditor/index.module.less +11 -0
  57. package/dist/slots/CodeEditor/utils.d.ts +42 -0
  58. package/dist/slots/CodeEditor/utils.js +157 -0
  59. package/dist/slots/CodePreview/CodeHeader.d.ts +19 -0
  60. package/dist/slots/CodePreview/CodeHeader.js +32 -0
  61. package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
  62. package/dist/slots/CodePreview/index.d.ts +17 -0
  63. package/dist/slots/CodePreview/index.js +29 -0
  64. package/dist/slots/CodePreview/index.module.less +42 -0
  65. package/dist/slots/CodeRunner/index.d.ts +14 -0
  66. package/dist/slots/CodeRunner/index.js +76 -0
  67. package/dist/slots/CodeRunner/index.module.less +0 -0
  68. package/dist/slots/CodeRunner/utils.d.ts +10 -0
  69. package/dist/slots/CodeRunner/utils.js +36 -0
  70. package/dist/slots/Companies/index.d.ts +13 -0
  71. package/dist/slots/Companies/index.js +49 -0
  72. package/dist/slots/Companies/index.module.less +82 -0
  73. package/dist/slots/Detail/News.d.ts +9 -0
  74. package/{es/antv/Banner/Notification.js → dist/slots/Detail/News.js} +8 -11
  75. package/{src/antv/Banner/Notification.module.less → dist/slots/Detail/News.module.less} +15 -3
  76. package/dist/slots/Detail/index.d.ts +26 -0
  77. package/dist/slots/Detail/index.js +124 -0
  78. package/{src/antv/Banner/Banner.module.less → dist/slots/Detail/index.module.less} +42 -74
  79. package/dist/slots/ExampleSider/index.d.ts +55 -0
  80. package/dist/slots/ExampleSider/index.js +218 -0
  81. package/dist/slots/ExampleSider/index.module.less +141 -0
  82. package/{es/antv → dist/slots}/Features/FeatureCard.d.ts +1 -1
  83. package/{es/antv → dist/slots}/Features/FeatureCard.js +6 -6
  84. package/{src/antv → dist/slots}/Features/FeatureCard.module.less +8 -1
  85. package/{es/antv → dist/slots}/Features/index.d.ts +2 -2
  86. package/{es/antv → dist/slots}/Features/index.js +17 -25
  87. package/{src/antv/Features/Features.module.less → dist/slots/Features/index.module.less} +34 -3
  88. package/dist/slots/Footer/index.d.ts +18 -0
  89. package/dist/slots/Footer/index.js +187 -0
  90. package/dist/slots/Footer/index.module.less +85 -0
  91. package/dist/slots/Header/Logo.d.ts +7 -0
  92. package/{es/antv → dist/slots}/Header/Logo.js +6 -2
  93. package/dist/slots/Header/LogoWhite.d.ts +7 -0
  94. package/dist/slots/Header/LogoWhite.js +19 -0
  95. package/dist/slots/Header/Navs.d.ts +17 -0
  96. package/dist/slots/Header/Navs.js +46 -0
  97. package/dist/slots/Header/Products/NavigatorBanner.d.ts +10 -0
  98. package/dist/slots/Header/Products/NavigatorBanner.js +34 -0
  99. package/dist/slots/Header/Products/NavigatorBanner.module.less +39 -0
  100. package/{es/antv → dist/slots/Header}/Products/Product.d.ts +3 -3
  101. package/{es/antv → dist/slots/Header}/Products/Product.js +11 -16
  102. package/{src/antv → dist/slots/Header}/Products/Product.module.less +10 -8
  103. package/{es/antv → dist/slots/Header}/Products/getProducts.d.ts +2 -7
  104. package/dist/slots/Header/Products/getProducts.js +67 -0
  105. package/dist/slots/Header/Products/index.d.ts +9 -0
  106. package/{es/antv → dist/slots/Header}/Products/index.js +15 -22
  107. package/dist/slots/Header/Search.d.ts +12 -0
  108. package/dist/slots/Header/Search.js +90 -0
  109. package/dist/slots/Header/Search.module.less +39 -0
  110. package/dist/slots/Header/index.d.ts +66 -0
  111. package/dist/slots/Header/index.js +379 -0
  112. package/dist/slots/Header/index.module.less +382 -0
  113. package/dist/slots/Header/utils.d.ts +1 -0
  114. package/dist/slots/Header/utils.js +26 -0
  115. package/dist/slots/Loading/index.d.ts +2 -0
  116. package/dist/slots/Loading/index.js +65 -0
  117. package/dist/slots/Loading/index.module.less +12 -0
  118. package/dist/slots/Loading.d.ts +5 -0
  119. package/dist/slots/Loading.js +8 -0
  120. package/dist/slots/ManualContent/NavigatorBanner.d.ts +9 -0
  121. package/dist/slots/ManualContent/NavigatorBanner.js +36 -0
  122. package/dist/slots/ManualContent/NavigatorBanner.module.less +39 -0
  123. package/dist/slots/ManualContent/ReadingTime.d.ts +3 -0
  124. package/dist/slots/ManualContent/ReadingTime.js +10 -0
  125. package/dist/slots/ManualContent/index.d.ts +9 -0
  126. package/dist/slots/ManualContent/index.js +321 -0
  127. package/dist/slots/ManualContent/index.module.less +656 -0
  128. package/dist/slots/TOC.d.ts +5 -0
  129. package/dist/slots/TOC.js +6 -0
  130. package/dist/slots/_.less +83 -0
  131. package/dist/slots/global.d.ts +1 -0
  132. package/dist/slots/global.js +7 -0
  133. package/dist/slots/hooks.d.ts +16 -0
  134. package/{es/antv → dist/slots}/hooks.js +60 -37
  135. package/dist/slots/utils.d.ts +20 -0
  136. package/dist/slots/utils.js +154 -0
  137. package/dist/types.d.ts +3 -0
  138. package/dist/types.js +1 -0
  139. package/dist/typings.d.ts +137 -0
  140. package/package.json +108 -47
  141. package/es/antv/404/index.d.ts +0 -2
  142. package/es/antv/Banner/Banner.module.less +0 -412
  143. package/es/antv/Banner/Notification.d.ts +0 -10
  144. package/es/antv/Banner/Notification.module.less +0 -108
  145. package/es/antv/Banner/index.d.ts +0 -25
  146. package/es/antv/Banner/index.js +0 -104
  147. package/es/antv/Cases/Cases.module.less +0 -203
  148. package/es/antv/Features/FeatureCard.module.less +0 -51
  149. package/es/antv/Features/Features.module.less +0 -169
  150. package/es/antv/Footer/Footer.module.less +0 -36
  151. package/es/antv/Footer/index.d.ts +0 -12
  152. package/es/antv/Footer/index.js +0 -237
  153. package/es/antv/Header/Logo.d.ts +0 -4
  154. package/es/antv/Products/Product.module.less +0 -146
  155. package/es/antv/Products/getNewProducts.d.ts +0 -24
  156. package/es/antv/Products/getNewProducts.js +0 -35
  157. package/es/antv/Products/getProducts.js +0 -460
  158. package/es/antv/Products/index.d.ts +0 -9
  159. package/es/antv/hooks.d.ts +0 -14
  160. package/es/antv/mixins.less +0 -21
  161. package/es/antv/utils.d.ts +0 -5
  162. package/es/antv/utils.js +0 -49
  163. package/es/builtins/API.d.ts +0 -3
  164. package/es/builtins/API.js +0 -37
  165. package/es/builtins/Alert.d.ts +0 -3
  166. package/es/builtins/Alert.js +0 -7
  167. package/es/builtins/Alert.less +0 -62
  168. package/es/builtins/Badge.d.ts +0 -3
  169. package/es/builtins/Badge.js +0 -7
  170. package/es/builtins/Badge.less +0 -31
  171. package/es/builtins/Example.d.ts +0 -5
  172. package/es/builtins/Example.less +0 -47
  173. package/es/builtins/Previewer.d.ts +0 -39
  174. package/es/builtins/Previewer.js +0 -225
  175. package/es/builtins/Previewer.less +0 -406
  176. package/es/builtins/SourceCode.d.ts +0 -10
  177. package/es/builtins/SourceCode.js +0 -70
  178. package/es/builtins/SourceCode.less +0 -103
  179. package/es/builtins/Table.d.ts +0 -4
  180. package/es/builtins/Table.less +0 -43
  181. package/es/builtins/Tree.d.ts +0 -4
  182. package/es/builtins/Tree.js +0 -213
  183. package/es/builtins/Tree.less +0 -159
  184. package/es/components/Dark.d.ts +0 -9
  185. package/es/components/Dark.js +0 -125
  186. package/es/components/Dark.less +0 -121
  187. package/es/components/LocaleSelect.d.ts +0 -6
  188. package/es/components/LocaleSelect.js +0 -53
  189. package/es/components/LocaleSelect.less +0 -59
  190. package/es/components/Navbar.d.ts +0 -10
  191. package/es/components/Navbar.js +0 -155
  192. package/es/components/Navbar.less +0 -180
  193. package/es/components/SearchBar.d.ts +0 -4
  194. package/es/components/SearchBar.js +0 -81
  195. package/es/components/SearchBar.less +0 -165
  196. package/es/components/SideMenu.d.ts +0 -10
  197. package/es/components/SideMenu.js +0 -99
  198. package/es/components/SideMenu.less +0 -379
  199. package/es/components/SlugList.d.ts +0 -7
  200. package/es/components/SlugList.js +0 -38
  201. package/es/components/SlugList.less +0 -18
  202. package/es/declaration.d.ts +0 -1
  203. package/es/layout.d.ts +0 -5
  204. package/es/layout.js +0 -276
  205. package/es/style/layout.less +0 -402
  206. package/es/style/markdown.less +0 -240
  207. package/es/style/variables.less +0 -37
  208. package/src/antv/404/index.tsx +0 -25
  209. package/src/antv/Banner/Notification.tsx +0 -45
  210. package/src/antv/Banner/index.tsx +0 -139
  211. package/src/antv/Cases/Cases.tsx +0 -116
  212. package/src/antv/Features/FeatureCard.tsx +0 -24
  213. package/src/antv/Features/index.tsx +0 -86
  214. package/src/antv/Footer/Footer.module.less +0 -36
  215. package/src/antv/Footer/index.tsx +0 -272
  216. package/src/antv/Header/Logo.tsx +0 -85
  217. package/src/antv/Products/Product.tsx +0 -80
  218. package/src/antv/Products/getNewProducts.tsx +0 -53
  219. package/src/antv/Products/getProducts.tsx +0 -626
  220. package/src/antv/Products/index.tsx +0 -70
  221. package/src/antv/hooks.ts +0 -87
  222. package/src/antv/mixins.less +0 -21
  223. package/src/antv/utils.ts +0 -44
  224. package/src/builtins/API.tsx +0 -57
  225. package/src/builtins/Alert.less +0 -62
  226. package/src/builtins/Alert.tsx +0 -4
  227. package/src/builtins/Badge.less +0 -31
  228. package/src/builtins/Badge.tsx +0 -4
  229. package/src/builtins/Example.less +0 -47
  230. package/src/builtins/Example.tsx +0 -34
  231. package/src/builtins/Previewer.less +0 -406
  232. package/src/builtins/Previewer.tsx +0 -264
  233. package/src/builtins/SourceCode.less +0 -103
  234. package/src/builtins/SourceCode.tsx +0 -55
  235. package/src/builtins/Table.less +0 -43
  236. package/src/builtins/Table.tsx +0 -42
  237. package/src/builtins/Tree.less +0 -159
  238. package/src/builtins/Tree.tsx +0 -130
  239. package/src/components/Dark.less +0 -121
  240. package/src/components/Dark.tsx +0 -78
  241. package/src/components/LocaleSelect.less +0 -59
  242. package/src/components/LocaleSelect.tsx +0 -53
  243. package/src/components/Navbar.less +0 -180
  244. package/src/components/Navbar.tsx +0 -152
  245. package/src/components/SearchBar.less +0 -165
  246. package/src/components/SearchBar.tsx +0 -68
  247. package/src/components/SideMenu.less +0 -379
  248. package/src/components/SideMenu.tsx +0 -148
  249. package/src/components/SlugList.less +0 -18
  250. package/src/components/SlugList.tsx +0 -20
  251. package/src/declaration.d.ts +0 -1
  252. package/src/layout.tsx +0 -225
  253. package/src/style/layout.less +0 -402
  254. package/src/style/markdown.less +0 -240
  255. package/src/style/variables.less +0 -37
  256. package/src/test/SearchBar.test.ts +0 -32
  257. package/src/test/Table.test.tsx +0 -41
  258. package/src/test/index.test.tsx +0 -377
@@ -0,0 +1,83 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/plugin/examples.ts
23
+ var examples_exports = {};
24
+ __export(examples_exports, {
25
+ getExamplesPageTopics: () => getExamplesPageTopics
26
+ });
27
+ module.exports = __toCommonJS(examples_exports);
28
+ var glob = __toESM(require("glob"));
29
+ var path = __toESM(require("path"));
30
+ var fs = __toESM(require("fs-extra"));
31
+ var import_front_matter = __toESM(require("front-matter"));
32
+ var examplesBaseDir = path.resolve(process.cwd(), "examples");
33
+ var getExampleDemos = (exampleDir) => {
34
+ const demoMetaJSON = fs.readFileSync(path.resolve(exampleDir, "demo", "meta.json")).toString();
35
+ const demoMeta = JSON.parse(demoMetaJSON).demos;
36
+ const demos = demoMeta.map((item) => {
37
+ const { title, screenshot, filename, new: isNew } = item;
38
+ const id = filename.replace(/\.tsx?$/, "");
39
+ return {
40
+ id,
41
+ screenshot,
42
+ source: fs.readFileSync(path.resolve(exampleDir, "demo", filename)).toString(),
43
+ title,
44
+ filename,
45
+ isNew: !!isNew
46
+ };
47
+ });
48
+ return demos;
49
+ };
50
+ var getTopicExamples = (topicPath) => {
51
+ const examplePaths = glob.sync(`${topicPath}/*`).filter((item) => {
52
+ return !item.endsWith(".js");
53
+ });
54
+ return examplePaths.map((item) => {
55
+ const exampleMetaZh = fs.readFileSync(path.resolve(item, "index.zh.md")).toString();
56
+ const exampleMetaEn = fs.readFileSync(path.resolve(item, "index.en.md")).toString();
57
+ const exampleMetaZhContent = (0, import_front_matter.default)(exampleMetaZh);
58
+ const exampleMetaEnContent = (0, import_front_matter.default)(exampleMetaEn);
59
+ const example = {
60
+ demos: getExampleDemos(item),
61
+ icon: "",
62
+ id: item.split("/").pop(),
63
+ title: {
64
+ en: exampleMetaEnContent.attributes.title,
65
+ zh: exampleMetaZhContent.attributes.title
66
+ }
67
+ };
68
+ return example;
69
+ });
70
+ };
71
+ var getExamplesPageTopics = () => {
72
+ const exampleTopicPaths = glob.sync(`${examplesBaseDir}/*`);
73
+ return exampleTopicPaths.map((topicPath) => {
74
+ const topicMetaPath = path.resolve(topicPath, "meta.js");
75
+ const topicMeta = require(topicMetaPath);
76
+ topicMeta.examples = getTopicExamples(topicPath);
77
+ return topicMeta;
78
+ });
79
+ };
80
+ // Annotate the CommonJS export names for ESM import in node:
81
+ 0 && (module.exports = {
82
+ getExamplesPageTopics
83
+ });
@@ -0,0 +1,3 @@
1
+ import type { IApi } from 'dumi';
2
+ declare const _default: (api: IApi) => void;
3
+ export default _default;
@@ -0,0 +1,103 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/plugin/index.ts
23
+ var plugin_exports = {};
24
+ __export(plugin_exports, {
25
+ default: () => plugin_default
26
+ });
27
+ module.exports = __toCommonJS(plugin_exports);
28
+ var import_examples = require("./examples");
29
+ function generateMetaJSON() {
30
+ const res = (0, import_examples.getExamplesPageTopics)();
31
+ return {
32
+ exampleTopics: res
33
+ };
34
+ }
35
+ var plugin_default = (api) => {
36
+ api.describe({ key: `dumi-theme:${require("../../package.json").name}` });
37
+ const pages = [
38
+ {
39
+ id: "dumi-theme-antv-example-list-zh",
40
+ path: "/examples/",
41
+ file: require.resolve("../pages/Examples/index.tsx")
42
+ },
43
+ {
44
+ id: "dumi-theme-antv-example-list-lang",
45
+ path: "/:language/examples/",
46
+ file: require.resolve("../pages/Examples/index.tsx")
47
+ },
48
+ {
49
+ id: "dumi-theme-antv-single-example-zh",
50
+ path: "/examples/:topic/:example",
51
+ file: require.resolve("../pages/Example/index.tsx")
52
+ },
53
+ {
54
+ id: "dumi-theme-antv-single-example-lang",
55
+ path: "/:language/examples/:topic/:example",
56
+ file: require.resolve("../pages/Example/index.tsx")
57
+ }
58
+ ];
59
+ const contextFilePath = require.resolve("../context.ts");
60
+ api.onGenerateFiles(() => {
61
+ api.writeTmpFile({
62
+ noPluginDir: true,
63
+ path: "theme-antv/ContextWrapper.tsx",
64
+ content: `
65
+ import { useOutlet } from 'dumi';
66
+ import { ThemeAntVContext } from '${contextFilePath}';
67
+
68
+ export default function ThemeAntVContextWrapper() {
69
+ const outlet = useOutlet();
70
+
71
+ return (
72
+ <ThemeAntVContext.Provider
73
+ value={{
74
+ meta: ${JSON.stringify(generateMetaJSON())}
75
+ }}
76
+ >
77
+ {outlet}
78
+ </ThemeAntVContext.Provider>
79
+ );
80
+ }
81
+ `
82
+ });
83
+ });
84
+ api.addLayouts(() => ({
85
+ id: "theme-antv-context",
86
+ file: `${api.paths.absTmpPath}/theme-antv/ContextWrapper.tsx`
87
+ }));
88
+ api.modifyRoutes((routes) => {
89
+ pages.forEach((page) => {
90
+ routes[page.id] = {
91
+ id: page.id,
92
+ path: page.path,
93
+ absPath: page.path,
94
+ file: page.file,
95
+ parentId: "DocLayout"
96
+ };
97
+ });
98
+ routes["404"].file = require.resolve("../pages/404.tsx");
99
+ return routes;
100
+ });
101
+ };
102
+ // Annotate the CommonJS export names for ESM import in node:
103
+ 0 && (module.exports = {});
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const NotFound: () => JSX.Element;
@@ -1,12 +1,9 @@
1
1
  import React from 'react';
2
2
  import { HomeOutlined } from '@ant-design/icons';
3
3
  import { Result, Button } from 'antd';
4
- import { Link } from 'dumi/theme';
5
-
6
- var NotFoundPage = function NotFoundPage() {
7
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Result // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
- , {
9
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ import { Link } from 'dumi';
5
+ export var NotFound = function NotFound() {
6
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Result, {
10
7
  status: '404',
11
8
  title: "404",
12
9
  subTitle: "Sorry, the page you visited does not exist.",
@@ -16,6 +13,4 @@ var NotFoundPage = function NotFoundPage() {
16
13
  type: "primary"
17
14
  }, /*#__PURE__*/React.createElement(HomeOutlined, null), "Back Home"))
18
15
  }));
19
- };
20
-
21
- export default NotFoundPage;
16
+ };
@@ -4,8 +4,8 @@ import 'slick-carousel/slick/slick-theme.css';
4
4
  interface Case {
5
5
  logo?: string;
6
6
  isAppLogo?: boolean;
7
- title: string;
8
- description: string;
7
+ title: IC;
8
+ description: IC;
9
9
  link?: string;
10
10
  image: string;
11
11
  }
@@ -14,5 +14,5 @@ interface CasesProps {
14
14
  style?: React.CSSProperties;
15
15
  className?: string;
16
16
  }
17
- declare const Cases: React.FC<CasesProps>;
18
- export default Cases;
17
+ export declare const Cases: React.FC<CasesProps>;
18
+ export {};
@@ -1,28 +1,32 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
1
+ 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); }
2
+
2
3
  import React from 'react';
3
4
  import { ArrowLeftOutlined, ArrowRightOutlined } from '@ant-design/icons';
4
- import { Link } from 'react-router-dom';
5
+ import { Link } from 'dumi';
5
6
  import Slider from 'react-slick';
6
- import classNames from 'classnames';
7
+ import cx from 'classnames';
7
8
  import 'slick-carousel/slick/slick.css';
8
- import 'slick-carousel/slick/slick-theme.css'; // @ts-ignore
9
-
10
- import styles from './Cases.module.less';
11
-
12
- var Cases = function Cases(_ref) {
9
+ import 'slick-carousel/slick/slick-theme.css';
10
+ import { useT, ic } from "../hooks";
11
+ import styles from "./index.module.less";
12
+ export var Cases = function Cases(_ref) {
13
13
  var _ref$cases = _ref.cases,
14
14
  cases = _ref$cases === void 0 ? [] : _ref$cases,
15
15
  _ref$style = _ref.style,
16
16
  style = _ref$style === void 0 ? {} : _ref$style,
17
17
  className = _ref.className;
18
- var slider;
18
+ var slider = React.useRef(null);
19
19
 
20
20
  var clickPrevious = function clickPrevious() {
21
- slider.slickPrev();
21
+ var _slider$current;
22
+
23
+ (_slider$current = slider.current) === null || _slider$current === void 0 ? void 0 : _slider$current.slickPrev();
22
24
  };
23
25
 
24
26
  var clickNext = function clickNext() {
25
- slider.slickNext();
27
+ var _slider$current2;
28
+
29
+ (_slider$current2 = slider.current) === null || _slider$current2 === void 0 ? void 0 : _slider$current2.slickNext();
26
30
  };
27
31
 
28
32
  var getCases = function getCases() {
@@ -64,17 +68,17 @@ var Cases = function Cases(_ref) {
64
68
  href: app.link,
65
69
  target: "_blank",
66
70
  rel: "noopener noreferrer"
67
- }, "\u67E5\u770B\u8BE6\u60C5") : /*#__PURE__*/React.createElement(Link, {
71
+ }, useT('查看详情')) : /*#__PURE__*/React.createElement(Link, {
68
72
  className: styles.detail,
69
73
  to: app.link ? app.link : ''
70
- }, "\u67E5\u770B\u8BE6\u60C5"));
74
+ }, useT('查看详情')));
71
75
  return /*#__PURE__*/React.createElement("div", {
72
76
  className: styles.appWrapper,
73
- key: app.title
77
+ key: ic(app.title)
74
78
  }, /*#__PURE__*/React.createElement("img", {
75
79
  className: styles.appTeaser,
76
80
  src: app.image,
77
- alt: app.title
81
+ alt: ic(app.title)
78
82
  }), /*#__PURE__*/React.createElement("div", {
79
83
  className: styles.appLeft
80
84
  }, /*#__PURE__*/React.createElement("div", {
@@ -89,9 +93,9 @@ var Cases = function Cases(_ref) {
89
93
  }
90
94
  }), /*#__PURE__*/React.createElement("p", {
91
95
  className: styles.appTitle
92
- }, app.title), /*#__PURE__*/React.createElement("p", {
96
+ }, ic(app.title)), /*#__PURE__*/React.createElement("p", {
93
97
  className: styles.appDescription
94
- }, app.description), linkDiv), buttons));
98
+ }, ic(app.description)), linkDiv), buttons));
95
99
  });
96
100
  return children;
97
101
  };
@@ -109,14 +113,10 @@ var Cases = function Cases(_ref) {
109
113
  fade: true
110
114
  };
111
115
  return /*#__PURE__*/React.createElement("div", {
112
- className: classNames(styles.wrapper, className),
116
+ className: cx(styles.wrapper, className),
113
117
  style: style
114
- }, /*#__PURE__*/React.createElement(Slider, Object.assign({}, sliderSettings, {
118
+ }, /*#__PURE__*/React.createElement(Slider, _extends({}, sliderSettings, {
115
119
  className: styles.slider,
116
- ref: function ref(c) {
117
- slider = c;
118
- }
120
+ ref: slider
119
121
  }), getCases()));
120
- };
121
-
122
- export default Cases;
122
+ };
@@ -1,4 +1,5 @@
1
- @import '../mixins';
1
+ @import '../_.less';
2
+
2
3
  .wrapper {
3
4
  height: 667px;
4
5
  margin: auto;
@@ -6,9 +7,11 @@
6
7
  padding: 0;
7
8
  overflow: hidden;
8
9
  background: rgba(250, 251, 252, 1);
10
+
9
11
  .slider {
10
12
  .container1440;
11
13
  }
14
+
12
15
  .appWrapper {
13
16
  margin-left: 5%;
14
17
  margin-bottom: 5%;
@@ -16,17 +19,21 @@
16
19
  height: 100%;
17
20
  overflow-y: hidden;
18
21
  display: flex;
22
+
19
23
  .appLeft {
20
24
  margin-left: 3.06%;
21
- width: 35%;
25
+ width: 27%;
22
26
  margin-top: 8%;
23
27
  height: 613px;
28
+
24
29
  .appContent {
25
30
  height: fit-content;
26
31
  position: relative;
32
+
27
33
  .appLogo {
28
- height: 80px;
34
+ width: 80px;
29
35
  }
36
+
30
37
  .appTitle {
31
38
  font-size: 1.2857em;
32
39
  font-weight: 500;
@@ -36,50 +43,60 @@
36
43
  color: rgba(0, 0, 0, 1);
37
44
  user-select: text;
38
45
  }
46
+
39
47
  .appDescription {
40
48
  color: rgba(105, 123, 140, 0.6);
41
49
  font-size: 1em;
42
50
  margin: 16px 0 0 0;
43
51
  user-select: text;
44
52
  }
53
+
45
54
  .detailWrapper {
46
55
  margin: 20px 0 0 0;
56
+
47
57
  .detail {
48
58
  color: @primary-color;
49
59
  font-size: 1em;
50
60
  }
51
61
  }
52
62
  }
63
+
53
64
  .buttons {
54
65
  cursor: pointer;
55
66
  position: absolute;
56
67
  display: flex;
57
68
  bottom: 30%;
58
69
  height: 100px;
70
+
59
71
  .controlButton {
60
72
  width: 47px;
61
73
  height: 47px;
62
74
  line-height: 47px;
63
75
  border: 1px solid #a3b1bf;
64
76
  transition: all 0.3s;
77
+
65
78
  &:hover {
66
79
  border: 1px solid #ced4d9;
67
80
  fill: #000000;
68
81
  }
82
+
69
83
  &:hover :only-child {
70
84
  color: #ced4d9;
71
85
  }
86
+
72
87
  .controlButtonIcon {
73
88
  width: 100%;
74
89
  color: #a3b1bf;
75
90
  transition: all 0.3s;
76
91
  }
77
92
  }
93
+
78
94
  .nextButton {
79
95
  width: 47px;
80
96
  margin-left: -1px;
81
97
  background-image: url('https://gw.alipayobjects.com/zos/basement_prod/27ce6e21-bbb6-4490-8326-43483ac39e0b.svg');
82
98
  background-size: 100% 100%;
99
+
83
100
  &:hover {
84
101
  background-image: url('https://gw.alipayobjects.com/zos/basement_prod/4d1f0d0a-4e56-4f21-a9aa-06b2f8c3e18e.svg');
85
102
  }
@@ -88,15 +105,16 @@
88
105
  }
89
106
  }
90
107
  }
108
+
91
109
  .appTeaser {
92
110
  position: absolute;
93
111
  height: 667px;
94
- left: 50%;
95
112
  right: 0;
96
113
  }
97
114
 
98
115
  .slider {
99
116
  height: 100%;
117
+
100
118
  :global {
101
119
  .slick-dots {
102
120
  display: none;
@@ -118,6 +136,7 @@
118
136
  }
119
137
  }
120
138
  }
139
+
121
140
  .appTeaser {
122
141
  position: absolute;
123
142
  width: 857px;
@@ -129,42 +148,51 @@
129
148
  .wrapper {
130
149
  width: 100%;
131
150
  height: fit-content;
151
+
132
152
  .slider {
133
153
  width: 100%;
134
154
  max-width: 100%;
135
155
  margin-left: 0;
136
156
  margin-right: 0;
137
157
  }
158
+
138
159
  .appWrapper {
139
160
  width: 100%;
140
161
  padding-bottom: 150px;
141
162
  margin-left: 0;
142
163
  flex-direction: column;
143
164
  text-align: center;
165
+
144
166
  .appLeft {
145
167
  height: 286px;
146
168
  margin-left: 4.27%;
147
169
  width: 91.47%;
148
170
  margin-top: 64px;
171
+
149
172
  .appContent {
150
173
  width: 90%;
151
174
  margin-left: 5%;
175
+
152
176
  .appLogo {
153
177
  position: absolute;
154
178
  top: -36px;
155
179
  left: 50%;
156
180
  transform: translateX(-40px);
157
181
  }
182
+
158
183
  .appTitle {
159
184
  padding-top: 76px;
160
185
  }
186
+
161
187
  .detailWrapper {
162
188
  margin-top: 40px;
189
+
163
190
  .detail {
164
191
  font-size: 1em;
165
192
  }
166
193
  }
167
194
  }
195
+
168
196
  .buttons {
169
197
  display: none;
170
198
  position: absolute;
@@ -175,6 +203,7 @@
175
203
  width: 92%;
176
204
  }
177
205
  }
206
+
178
207
  .appTeaser {
179
208
  left: 0;
180
209
  margin-top: 60px;
@@ -189,15 +218,17 @@
189
218
 
190
219
  .slider {
191
220
  height: 100%;
221
+
192
222
  :global {
193
223
  .slick-dots {
194
224
  display: block;
195
225
  bottom: 100px;
196
226
  }
227
+
197
228
  .slick-dots li.slick-active button:before {
198
229
  opacity: 1;
199
230
  color: #1890ff;
200
231
  }
201
232
  }
202
233
  }
203
- }
234
+ }
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ export declare enum EDITOR_TABS {
3
+ JAVASCRIPT = "JavaScript",
4
+ DATA = "Data"
5
+ }
6
+ declare type ToolbarProps = {
7
+ /**
8
+ * 源码文件,用于传入到三方代码平台
9
+ */
10
+ sourceCode: string;
11
+ /**
12
+ * 生成代码文件名后缀,用于传入到三方代码平台
13
+ */
14
+ fileExtension: string;
15
+ /**
16
+ * 项目标题,用于传入到三方代码平台
17
+ */
18
+ title: {
19
+ zh?: string;
20
+ en?: string;
21
+ } | string;
22
+ location?: Location;
23
+ /**
24
+ * playground 的一些配置项
25
+ */
26
+ playground: {
27
+ container?: string;
28
+ playgroundDidMount?: string;
29
+ playgroundWillUnmount?: string;
30
+ dependencies?: {
31
+ [key: string]: string;
32
+ };
33
+ devDependencies?: {
34
+ [key: string]: string;
35
+ };
36
+ htmlCodeTemplate?: string;
37
+ json?: {
38
+ [key: string]: any;
39
+ };
40
+ };
41
+ /**
42
+ * 全屏状态,用于显示不同的 icon
43
+ */
44
+ isFullScreen?: boolean;
45
+ /**
46
+ * Tabs 数据
47
+ */
48
+ editorTabs: EDITOR_TABS[];
49
+ /**
50
+ * 当前编辑哪个 tab
51
+ */
52
+ currentEditorTab: EDITOR_TABS;
53
+ /**
54
+ * 切换 tab
55
+ */
56
+ onEditorTabChange: (tab: EDITOR_TABS) => void;
57
+ /**
58
+ * 进入/退出全屏
59
+ */
60
+ onToggleFullscreen?: null | (() => void);
61
+ /**
62
+ * 执行代码
63
+ */
64
+ onExecuteCode: () => void;
65
+ };
66
+ export declare const Toolbar: React.FC<ToolbarProps>;
67
+ export {};