@kne/modules-dev 2.1.15 → 2.1.16
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/create-entry.js +224 -176
- package/dist/create-entry.js.map +1 -1
- package/dist/create-entry.modern.js +214 -166
- package/dist/create-entry.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/create-entry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var react = require('react');
|
|
2
2
|
var reactRouterDom = require('react-router-dom');
|
|
3
3
|
var remoteLoader = require('@kne/remote-loader');
|
|
4
4
|
var ensureSlash = require('@kne/ensure-slash');
|
|
@@ -9,6 +9,7 @@ var classnames = require('classnames');
|
|
|
9
9
|
var ExampleDriver = require('@kne/example-driver');
|
|
10
10
|
var hljs = require('highlight.js');
|
|
11
11
|
require('highlight.js/styles/github.css');
|
|
12
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
13
|
var Fetch = require('@kne/react-fetch');
|
|
13
14
|
var Icon = require('@kne/react-icon');
|
|
14
15
|
|
|
@@ -32,7 +33,6 @@ function _interopNamespace(e) {
|
|
|
32
33
|
return n;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
|
|
36
36
|
var ensureSlash__default = /*#__PURE__*/_interopDefaultLegacy(ensureSlash);
|
|
37
37
|
var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
|
|
38
38
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
@@ -69,18 +69,19 @@ const Highlight = ({
|
|
|
69
69
|
html,
|
|
70
70
|
...props
|
|
71
71
|
}) => {
|
|
72
|
-
const ref =
|
|
73
|
-
|
|
72
|
+
const ref = react.useRef(null);
|
|
73
|
+
react.useEffect(() => {
|
|
74
74
|
ref.current.querySelectorAll('pre code').forEach(el => {
|
|
75
75
|
hljs__default["default"].highlightElement(el);
|
|
76
76
|
});
|
|
77
77
|
}, [html]);
|
|
78
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
79
|
+
...props,
|
|
79
80
|
ref: ref,
|
|
80
81
|
dangerouslySetInnerHTML: {
|
|
81
82
|
__html: html
|
|
82
83
|
}
|
|
83
|
-
})
|
|
84
|
+
});
|
|
84
85
|
};
|
|
85
86
|
|
|
86
87
|
const _excluded$1 = ["remoteModules", "children"];
|
|
@@ -93,7 +94,11 @@ const ExampleDriverContext = remoteLoader.createWithRemoteLoader({
|
|
|
93
94
|
} = _ref,
|
|
94
95
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
95
96
|
const [GlobalProvider] = remoteModules;
|
|
96
|
-
return /*#__PURE__*/
|
|
97
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.HashRouter, {
|
|
98
|
+
children: /*#__PURE__*/jsxRuntime.jsx(GlobalProvider, _extends({}, props, {
|
|
99
|
+
children: children
|
|
100
|
+
}))
|
|
101
|
+
});
|
|
97
102
|
});
|
|
98
103
|
const ExampleContent = remoteLoader.createWithRemoteLoader({
|
|
99
104
|
modules: ["components-core:Global@useGlobalContext", "components-core:Global@usePreset"]
|
|
@@ -108,17 +113,18 @@ const ExampleContent = remoteLoader.createWithRemoteLoader({
|
|
|
108
113
|
} = useGlobalContext();
|
|
109
114
|
const preset = usePreset();
|
|
110
115
|
const exampleStyle = get__default["default"](data, 'example.style');
|
|
111
|
-
const DriverContext =
|
|
116
|
+
const DriverContext = react.useMemo(() => {
|
|
112
117
|
return _ref3 => {
|
|
113
118
|
let {
|
|
114
119
|
children
|
|
115
120
|
} = _ref3;
|
|
116
|
-
return /*#__PURE__*/
|
|
117
|
-
preset: preset
|
|
118
|
-
|
|
121
|
+
return /*#__PURE__*/jsxRuntime.jsx(ExampleDriverContext, _extends({}, global, {
|
|
122
|
+
preset: preset,
|
|
123
|
+
children: children
|
|
124
|
+
}));
|
|
119
125
|
};
|
|
120
126
|
}, [global]);
|
|
121
|
-
|
|
127
|
+
react.useEffect(() => {
|
|
122
128
|
if (!exampleStyle) {
|
|
123
129
|
return;
|
|
124
130
|
}
|
|
@@ -129,38 +135,53 @@ const ExampleContent = remoteLoader.createWithRemoteLoader({
|
|
|
129
135
|
document.head.removeChild(dom);
|
|
130
136
|
};
|
|
131
137
|
}, [exampleStyle]);
|
|
132
|
-
return /*#__PURE__*/
|
|
138
|
+
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
133
139
|
className: classnames__default["default"]('container', style['main']),
|
|
134
|
-
direction: "vertical"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
140
|
+
direction: "vertical",
|
|
141
|
+
children: [data.packageName && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
142
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
143
|
+
className: style['part-title'],
|
|
144
|
+
children: "\u5B89\u88C5"
|
|
145
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Highlight, {
|
|
146
|
+
className: "mark-down-html",
|
|
147
|
+
html: "<pre><code class=\"language-shell hljs\">npm install --save " + data.packageName + "</code></pre>"
|
|
148
|
+
})]
|
|
149
|
+
}), data.description && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
150
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
151
|
+
className: style['part-title'],
|
|
152
|
+
children: "\u63CF\u8FF0"
|
|
153
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Highlight, {
|
|
154
|
+
className: "mark-down-html",
|
|
155
|
+
html: data.description
|
|
156
|
+
})]
|
|
157
|
+
}), data.summary && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
158
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
159
|
+
className: style['part-title'],
|
|
160
|
+
children: "\u6982\u8FF0"
|
|
161
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Highlight, {
|
|
162
|
+
className: "mark-down-html",
|
|
163
|
+
html: data.summary
|
|
164
|
+
})]
|
|
165
|
+
}), data.example.list && data.example.list.length > 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
166
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
167
|
+
className: style['part-title'],
|
|
168
|
+
children: "\u4EE3\u7801\u793A\u4F8B"
|
|
169
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
170
|
+
className: classnames__default["default"](style['example'], data.example.className),
|
|
171
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ExampleDriver__default["default"], {
|
|
172
|
+
contextComponent: DriverContext,
|
|
173
|
+
isFull: data.example.isFull,
|
|
174
|
+
list: data.example.list
|
|
175
|
+
})
|
|
176
|
+
})]
|
|
177
|
+
}), /*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
178
|
+
className: style['part-title'],
|
|
179
|
+
children: "API"
|
|
180
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Highlight, {
|
|
181
|
+
className: "mark-down-html",
|
|
182
|
+
html: data.api
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
164
185
|
});
|
|
165
186
|
const ExamplePage = remoteLoader.createWithRemoteLoader({
|
|
166
187
|
modules: ["components-core:Layout@Page", "components-core:Layout@Menu", "components-core:Global@useGlobalContext"]
|
|
@@ -173,15 +194,17 @@ const ExamplePage = remoteLoader.createWithRemoteLoader({
|
|
|
173
194
|
pageProps = {}
|
|
174
195
|
} = _ref4;
|
|
175
196
|
const [Page, Menu] = remoteModules;
|
|
176
|
-
return /*#__PURE__*/
|
|
197
|
+
return /*#__PURE__*/jsxRuntime.jsx(Page, _extends({
|
|
177
198
|
title: data.name,
|
|
178
199
|
className: style['example-page'],
|
|
179
|
-
menu: items && items.length > 0 && /*#__PURE__*/
|
|
200
|
+
menu: items && items.length > 0 && /*#__PURE__*/jsxRuntime.jsx(Menu, {
|
|
180
201
|
currentKey: current,
|
|
181
202
|
items: items
|
|
182
203
|
})
|
|
183
|
-
}, pageProps
|
|
184
|
-
|
|
204
|
+
}, pageProps, {
|
|
205
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ExampleContent, {
|
|
206
|
+
data: data
|
|
207
|
+
})
|
|
185
208
|
}));
|
|
186
209
|
});
|
|
187
210
|
|
|
@@ -198,7 +221,7 @@ const Example = _ref => {
|
|
|
198
221
|
const searchString = searchParams.size > 0 ? '?' + searchParams.toString() : '';
|
|
199
222
|
const data = readme[current];
|
|
200
223
|
if (!(current && readme[current])) {
|
|
201
|
-
return /*#__PURE__*/
|
|
224
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Navigate, {
|
|
202
225
|
to: "" + ensureSlash__default["default"](baseUrl, true) + Object.keys(readme)[0] + searchString,
|
|
203
226
|
replace: true
|
|
204
227
|
});
|
|
@@ -207,7 +230,7 @@ const Example = _ref => {
|
|
|
207
230
|
let {
|
|
208
231
|
data
|
|
209
232
|
} = _ref2;
|
|
210
|
-
return /*#__PURE__*/
|
|
233
|
+
return /*#__PURE__*/jsxRuntime.jsx(ExamplePage, {
|
|
211
234
|
pageProps: pageProps,
|
|
212
235
|
data: data,
|
|
213
236
|
current: current,
|
|
@@ -221,7 +244,7 @@ const Example = _ref => {
|
|
|
221
244
|
});
|
|
222
245
|
};
|
|
223
246
|
if (data && data.hasOwnProperty('loader') || data.hasOwnProperty('url')) {
|
|
224
|
-
return /*#__PURE__*/
|
|
247
|
+
return /*#__PURE__*/jsxRuntime.jsx(Fetch__default["default"], _extends({}, Object.assign({}, data), {
|
|
225
248
|
render: renderExamplePage
|
|
226
249
|
}));
|
|
227
250
|
}
|
|
@@ -240,14 +263,14 @@ const ModulesIsEmpty = _ref => {
|
|
|
240
263
|
} = _ref;
|
|
241
264
|
const location = reactRouterDom.useLocation();
|
|
242
265
|
if (readme && Object.keys(readme).length > 0 && ensureSlash__default["default"](location.pathname, true) === baseUrl) {
|
|
243
|
-
return /*#__PURE__*/
|
|
266
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Navigate, {
|
|
244
267
|
to: "" + baseUrl + Object.keys(readme)[0]
|
|
245
268
|
});
|
|
246
269
|
}
|
|
247
270
|
if (readme && Object.keys(readme).length > 0) {
|
|
248
|
-
return /*#__PURE__*/
|
|
271
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Outlet, {});
|
|
249
272
|
}
|
|
250
|
-
return /*#__PURE__*/
|
|
273
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Result, {
|
|
251
274
|
status: "404",
|
|
252
275
|
title: "\u6CA1\u6709\u68C0\u6D4B\u5230\u4E1A\u52A1\u7EC4\u4EF6",
|
|
253
276
|
subTitle: "\u60A8\u53EF\u4EE5\u901A\u8FC7 modules-dev create \u547D\u4EE4\u521B\u5EFA\u7EC4\u4EF6\uFF0C\u5982\u679C\u5DF2\u7ECF\u6709\u7EC4\u4EF6\u8BF7\u68C0\u67E5\u73AF\u5883\u53D8\u91CF MODULES_DEV_BASE_DIR\u548CMODULES_DEV_ALIAS_NAME \u662F\u5426\u8BBE\u7F6E\u6B63\u786E"
|
|
@@ -261,8 +284,8 @@ const EntryButton = remoteLoader.createWithRemoteLoader({
|
|
|
261
284
|
} = _ref2;
|
|
262
285
|
const [Icon] = remoteModules;
|
|
263
286
|
const navigate = reactRouterDom.useNavigate();
|
|
264
|
-
return /*#__PURE__*/
|
|
265
|
-
icon: /*#__PURE__*/
|
|
287
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.FloatButton, {
|
|
288
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
266
289
|
className: "icon",
|
|
267
290
|
type: "icon-liangdian"
|
|
268
291
|
}),
|
|
@@ -281,14 +304,16 @@ const MainLayout = remoteLoader.createWithRemoteLoader({
|
|
|
281
304
|
} = _ref3,
|
|
282
305
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
283
306
|
const [Global, Layout] = remoteModules;
|
|
284
|
-
return /*#__PURE__*/
|
|
285
|
-
preset: preset
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
307
|
+
return /*#__PURE__*/jsxRuntime.jsx(Global, _extends({}, props, {
|
|
308
|
+
preset: preset,
|
|
309
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Layout, {
|
|
310
|
+
navigation: {
|
|
311
|
+
showIndex: false,
|
|
312
|
+
list: paths
|
|
313
|
+
},
|
|
314
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Outlet, {})
|
|
315
|
+
})
|
|
316
|
+
}));
|
|
292
317
|
});
|
|
293
318
|
const ExampleRoutes = _ref4 => {
|
|
294
319
|
let {
|
|
@@ -313,36 +338,40 @@ const ExampleRoutes = _ref4 => {
|
|
|
313
338
|
const componentsBaseUrl = ensureSlash__default["default"](get__default["default"](componentsPath, 'path', '/'), true);
|
|
314
339
|
const baseUrlPrefix = new RegExp("^" + ensureSlash__default["default"](baseUrl, true));
|
|
315
340
|
const componentsRoutePath = ensureSlash__default["default"](componentsBaseUrl.replace(baseUrlPrefix, ''));
|
|
316
|
-
return /*#__PURE__*/
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
341
|
+
return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Routes, {
|
|
342
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
343
|
+
element: /*#__PURE__*/jsxRuntime.jsx(MainLayout, _extends({
|
|
344
|
+
paths: paths,
|
|
345
|
+
preset: preset,
|
|
346
|
+
themeToken: themeToken
|
|
347
|
+
}, props)),
|
|
348
|
+
children: componentsPath && /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Route, {
|
|
349
|
+
path: componentsRoutePath,
|
|
350
|
+
element: /*#__PURE__*/jsxRuntime.jsx(ModulesIsEmpty, {
|
|
351
|
+
baseUrl: componentsBaseUrl,
|
|
352
|
+
readme: readme
|
|
353
|
+
}),
|
|
354
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
355
|
+
path: ":id",
|
|
356
|
+
element: /*#__PURE__*/jsxRuntime.jsx(Example, {
|
|
357
|
+
baseUrl: componentsBaseUrl,
|
|
358
|
+
readme: readme,
|
|
359
|
+
pageProps: pageProps
|
|
360
|
+
})
|
|
361
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
362
|
+
path: ":id/*",
|
|
363
|
+
element: /*#__PURE__*/jsxRuntime.jsx(Example, {
|
|
364
|
+
baseUrl: componentsBaseUrl,
|
|
365
|
+
readme: readme,
|
|
366
|
+
pageProps: pageProps
|
|
367
|
+
})
|
|
368
|
+
})]
|
|
369
|
+
})
|
|
370
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
371
|
+
path: "*",
|
|
372
|
+
element: children
|
|
373
|
+
})]
|
|
374
|
+
});
|
|
346
375
|
};
|
|
347
376
|
const createEntry = WrappedComponents => _ref5 => {
|
|
348
377
|
let {
|
|
@@ -353,29 +382,32 @@ const createEntry = WrappedComponents => _ref5 => {
|
|
|
353
382
|
baseUrl = ''
|
|
354
383
|
} = _ref5,
|
|
355
384
|
props = _objectWithoutPropertiesLoose(_ref5, _excluded3);
|
|
356
|
-
const [readme, setReadme] =
|
|
357
|
-
|
|
385
|
+
const [readme, setReadme] = react.useState({});
|
|
386
|
+
react.useEffect(() => {
|
|
358
387
|
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('readme')); }).then(module => {
|
|
359
388
|
setReadme(module.__esModule === true ? module.default : module);
|
|
360
389
|
});
|
|
361
390
|
}, []);
|
|
362
|
-
return /*#__PURE__*/
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
391
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
392
|
+
children: Object.keys(readme).length > 0 ? /*#__PURE__*/jsxRuntime.jsxs(ExampleRoutes, {
|
|
393
|
+
preset: preset,
|
|
394
|
+
baseUrl: baseUrl,
|
|
395
|
+
projectName: projectName,
|
|
396
|
+
readme: readme,
|
|
397
|
+
pageProps: pageProps,
|
|
398
|
+
paths: [{
|
|
399
|
+
key: 'index',
|
|
400
|
+
path: '/',
|
|
401
|
+
title: '首页'
|
|
402
|
+
}, {
|
|
403
|
+
key: 'components',
|
|
404
|
+
path: baseUrl + "/modules-dev-components",
|
|
405
|
+
title: '组件'
|
|
406
|
+
}],
|
|
407
|
+
themeToken: themeToken,
|
|
408
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(WrappedComponents, _extends({}, props)), /*#__PURE__*/jsxRuntime.jsx(EntryButton, {})]
|
|
409
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(WrappedComponents, _extends({}, props))
|
|
410
|
+
});
|
|
379
411
|
};
|
|
380
412
|
createEntry.Example = Example;
|
|
381
413
|
createEntry.ExampleRoutes = ExampleRoutes;
|
|
@@ -386,74 +418,90 @@ const FontList = _ref => {
|
|
|
386
418
|
let {
|
|
387
419
|
fonts
|
|
388
420
|
} = _ref;
|
|
389
|
-
const [value, setValue] =
|
|
390
|
-
return /*#__PURE__*/
|
|
421
|
+
const [value, setValue] = react.useState(30);
|
|
422
|
+
return /*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
391
423
|
vertical: true,
|
|
392
|
-
gap: 20
|
|
393
|
-
|
|
394
|
-
gap: 8
|
|
395
|
-
}, /*#__PURE__*/React.createElement("div", null, "\u8C03\u6574\u5927\u5C0F:"), /*#__PURE__*/React.createElement(antd.Slider, {
|
|
396
|
-
style: {
|
|
397
|
-
width: 100
|
|
398
|
-
},
|
|
399
|
-
max: 60,
|
|
400
|
-
min: 12,
|
|
401
|
-
value: value,
|
|
402
|
-
onChange: setValue
|
|
403
|
-
}), /*#__PURE__*/React.createElement("div", null, value, "px")), Object.keys(fonts).map(fontClassName => {
|
|
404
|
-
const {
|
|
405
|
-
glyphs: list
|
|
406
|
-
} = fonts[fontClassName];
|
|
407
|
-
const isColorful = /-colorful$/.test(fontClassName);
|
|
408
|
-
return /*#__PURE__*/React.createElement(antd.Flex, {
|
|
409
|
-
vertical: true,
|
|
424
|
+
gap: 20,
|
|
425
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
410
426
|
gap: 8,
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}, fontClassName), /*#__PURE__*/React.createElement(antd.Flex, {
|
|
415
|
-
gap: 12,
|
|
416
|
-
wrap: true
|
|
417
|
-
}, list.map(_ref2 => {
|
|
418
|
-
let {
|
|
419
|
-
font_class
|
|
420
|
-
} = _ref2;
|
|
421
|
-
return /*#__PURE__*/React.createElement(antd.Card, {
|
|
422
|
-
size: "small",
|
|
423
|
-
key: font_class
|
|
424
|
-
}, isColorful ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(antd.Flex, {
|
|
425
|
-
justify: "center"
|
|
426
|
-
}, /*#__PURE__*/React.createElement(Icon__default["default"], {
|
|
427
|
-
colorful: true,
|
|
428
|
-
type: font_class,
|
|
429
|
-
size: value
|
|
430
|
-
})), /*#__PURE__*/React.createElement(antd.Typography.Text, {
|
|
427
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
428
|
+
children: "\u8C03\u6574\u5927\u5C0F:"
|
|
429
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Slider, {
|
|
431
430
|
style: {
|
|
432
|
-
|
|
433
|
-
width: '120px',
|
|
434
|
-
wordBreak: 'break-all'
|
|
431
|
+
width: 100
|
|
435
432
|
},
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
433
|
+
max: 60,
|
|
434
|
+
min: 12,
|
|
435
|
+
value: value,
|
|
436
|
+
onChange: setValue
|
|
437
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
438
|
+
children: [value, "px"]
|
|
439
|
+
})]
|
|
440
|
+
}), Object.keys(fonts).map(fontClassName => {
|
|
441
|
+
const {
|
|
442
|
+
glyphs: list
|
|
443
|
+
} = fonts[fontClassName];
|
|
444
|
+
const isColorful = /-colorful$/.test(fontClassName);
|
|
445
|
+
return /*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
446
|
+
vertical: true,
|
|
447
|
+
gap: 8,
|
|
448
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Typography.Title, {
|
|
449
|
+
level: 4,
|
|
450
|
+
children: fontClassName
|
|
451
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Flex, {
|
|
452
|
+
gap: 12,
|
|
453
|
+
wrap: true,
|
|
454
|
+
children: list.map(_ref2 => {
|
|
455
|
+
let {
|
|
456
|
+
font_class
|
|
457
|
+
} = _ref2;
|
|
458
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Card, {
|
|
459
|
+
size: "small",
|
|
460
|
+
children: isColorful ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
461
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Flex, {
|
|
462
|
+
justify: "center",
|
|
463
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Icon__default["default"], {
|
|
464
|
+
colorful: true,
|
|
465
|
+
type: font_class,
|
|
466
|
+
size: value
|
|
467
|
+
})
|
|
468
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Typography.Text, {
|
|
469
|
+
style: {
|
|
470
|
+
display: 'block',
|
|
471
|
+
width: '120px',
|
|
472
|
+
wordBreak: 'break-all'
|
|
473
|
+
},
|
|
474
|
+
copyable: {
|
|
475
|
+
text: '<Icon colorful type="' + font_class + '" size={' + value + '}/>'
|
|
476
|
+
},
|
|
477
|
+
children: font_class
|
|
478
|
+
})]
|
|
479
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
480
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Flex, {
|
|
481
|
+
justify: "center",
|
|
482
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Icon__default["default"], {
|
|
483
|
+
type: font_class,
|
|
484
|
+
size: value,
|
|
485
|
+
fontClassName: fontClassName
|
|
486
|
+
})
|
|
487
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Typography.Text, {
|
|
488
|
+
style: {
|
|
489
|
+
display: 'block',
|
|
490
|
+
width: '120px',
|
|
491
|
+
wordBreak: 'break-all'
|
|
492
|
+
},
|
|
493
|
+
copyable: {
|
|
494
|
+
text: '<Icon type="' + font_class + '" size={' + value + '} fontClassName={' + fontClassName + '}/>'
|
|
495
|
+
},
|
|
496
|
+
children: font_class
|
|
497
|
+
})]
|
|
498
|
+
})
|
|
499
|
+
}, font_class);
|
|
500
|
+
})
|
|
501
|
+
})]
|
|
502
|
+
}, fontClassName);
|
|
503
|
+
})]
|
|
504
|
+
});
|
|
457
505
|
};
|
|
458
506
|
|
|
459
507
|
exports.Example = Example;
|