@blocklet/pages-kit 0.2.357 → 0.2.359
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/lib/cjs/builtin/async/ai-runtime/components/ThemeProvider.js +14 -13
- package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentAgent.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-appearances.js +16 -9
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-header-menu.js +4 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime/Runtime/index.js +2 -46
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +5 -3
- package/lib/cjs/builtin/async/ai-runtime/utils/fonts.js +35 -0
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/ThemeProvider.js +14 -13
- package/lib/esm/builtin/async/ai-runtime/contexts/CurrentAgent.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/hooks/use-appearances.js +16 -9
- package/lib/esm/builtin/async/ai-runtime/hooks/use-header-menu.js +4 -1
- package/lib/esm/builtin/async/ai-runtime/runtime/Runtime/index.js +3 -47
- package/lib/esm/builtin/async/ai-runtime/state/session.js +5 -3
- package/lib/esm/builtin/async/ai-runtime/utils/fonts.js +32 -0
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/builtin/async/ai-runtime/hooks/use-appearances.d.ts +26 -2
- package/lib/types/builtin/async/ai-runtime/utils/fonts.d.ts +5 -0
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -21,23 +21,14 @@ const material_1 = require("@mui/material");
|
|
|
21
21
|
const react_1 = require("react");
|
|
22
22
|
const react_helmet_1 = require("react-helmet");
|
|
23
23
|
const runtime_1 = require("../state/runtime");
|
|
24
|
+
const fonts_1 = require("../utils/fonts");
|
|
24
25
|
const GlobalLoading_1 = __importDefault(require("./GlobalLoading"));
|
|
25
|
-
const getFontUrl = (fontList) => {
|
|
26
|
-
var _a;
|
|
27
|
-
if (!fontList.length)
|
|
28
|
-
return;
|
|
29
|
-
const BASE_URL = 'https://fonts.googleapis.com/css?family=';
|
|
30
|
-
const newFontList = (_a = fontList
|
|
31
|
-
.filter((font) => typeof font === 'string')) === null || _a === void 0 ? void 0 : _a.map((font) => font.replace(/ /g, '+')).join('|');
|
|
32
|
-
// eslint-disable-next-line consistent-return
|
|
33
|
-
return `${BASE_URL}${newFontList}`;
|
|
34
|
-
};
|
|
35
26
|
function ThemeProvider({ children }) {
|
|
36
27
|
var _a, _b, _c;
|
|
37
28
|
const { appearance } = (0, runtime_1.useRuntimeState)().agent.project;
|
|
38
29
|
const theme = (0, material_1.useTheme)();
|
|
39
|
-
const
|
|
40
|
-
const
|
|
30
|
+
const bodyFontFamily = (_a = appearance === null || appearance === void 0 ? void 0 : appearance.typography) === null || _a === void 0 ? void 0 : _a.fontFamily;
|
|
31
|
+
const headingFontFamily = (_c = (_b = appearance === null || appearance === void 0 ? void 0 : appearance.typography) === null || _b === void 0 ? void 0 : _b.heading) === null || _c === void 0 ? void 0 : _c.fontFamily;
|
|
41
32
|
const newTheme = (0, react_1.useMemo)(() => {
|
|
42
33
|
var _a, _b, _c, _d, _e, _f;
|
|
43
34
|
let { primary } = theme.palette;
|
|
@@ -164,7 +155,17 @@ function ThemeProvider({ children }) {
|
|
|
164
155
|
],
|
|
165
156
|
});
|
|
166
157
|
}, [theme]);
|
|
167
|
-
|
|
158
|
+
const fontUrls = (0, react_1.useMemo)(() => {
|
|
159
|
+
const urls = [bodyFontFamily, headingFontFamily]
|
|
160
|
+
.filter((i) => !!i)
|
|
161
|
+
.map((font) => {
|
|
162
|
+
var _a;
|
|
163
|
+
return ((_a = fonts_1.chineseFonts.find((i) => i.value === font)) === null || _a === void 0 ? void 0 : _a.link) ||
|
|
164
|
+
`https://fonts.googleapis.com/css?family=${font.replace(/ /g, '+')}`;
|
|
165
|
+
});
|
|
166
|
+
return [...new Set(urls)];
|
|
167
|
+
}, [bodyFontFamily, headingFontFamily]);
|
|
168
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.ThemeProvider, { theme: newTheme, children: [(0, jsx_runtime_1.jsx)(react_helmet_1.Helmet, { children: fontUrls.map((url) => ((0, jsx_runtime_1.jsx)("link", { rel: "stylesheet", href: url }, url))) }), (0, jsx_runtime_1.jsxs)(material_1.CssBaseline, { children: [(0, jsx_runtime_1.jsx)(material_1.GlobalStyles, { styles: (theme) => theme.unstable_sx({
|
|
168
169
|
'h1,h2,h3,h4,h5': {
|
|
169
170
|
fontFamily: `${theme.typography.h1.fontFamily} !important`,
|
|
170
171
|
},
|
|
@@ -10,7 +10,7 @@ const runtime_1 = require("../state/runtime");
|
|
|
10
10
|
function useCurrentAid({ agentId }) {
|
|
11
11
|
const { aid } = (0, runtime_1.useRuntimeState)();
|
|
12
12
|
return (0, react_1.useMemo)(() => ({
|
|
13
|
-
aid: (0, aid_1.stringifyIdentity)(Object.assign(Object.assign({}, (0, aid_1.parseIdentity)(aid, { rejectWhenError: true })), {
|
|
13
|
+
aid: (0, aid_1.stringifyIdentity)(Object.assign(Object.assign({}, (0, aid_1.parseIdentity)(aid, { rejectWhenError: true })), { agentId })),
|
|
14
14
|
}), [aid, agentId]);
|
|
15
15
|
}
|
|
16
16
|
const context = (0, react_1.createContext)(undefined);
|
|
@@ -22,7 +22,7 @@ function useCurrentAgent(args = {}) {
|
|
|
22
22
|
const { blockletDid, aid: runtimeAid, working } = (0, runtime_1.useRuntimeState)();
|
|
23
23
|
const aidFromParam = (0, react_1.useMemo)(() => args.aid ||
|
|
24
24
|
(args.agentId
|
|
25
|
-
? (0, aid_1.stringifyIdentity)(Object.assign(Object.assign({}, (0, aid_1.parseIdentity)(runtimeAid, { rejectWhenError: true })), {
|
|
25
|
+
? (0, aid_1.stringifyIdentity)(Object.assign(Object.assign({}, (0, aid_1.parseIdentity)(runtimeAid, { rejectWhenError: true })), { agentId: args.agentId }))
|
|
26
26
|
: undefined), [args.agentId, args.aid, runtimeAid]);
|
|
27
27
|
const current = (0, react_1.useContext)(context);
|
|
28
28
|
const aid = aidFromParam !== null && aidFromParam !== void 0 ? aidFromParam : current === null || current === void 0 ? void 0 : current.aid;
|
|
@@ -16,18 +16,25 @@ function useAppearances(args) {
|
|
|
16
16
|
const { agent: runtimeAgent } = (0, runtime_1.useRuntimeState)();
|
|
17
17
|
const { agent } = (0, CurrentAgent_1.useCurrentAgent)(args);
|
|
18
18
|
const appearancePage = (0, react_1.useMemo)(() => {
|
|
19
|
-
var _a, _b;
|
|
19
|
+
var _a, _b, _c, _d;
|
|
20
20
|
const appearance = (_b = (_a = agent.outputVariables) === null || _a === void 0 ? void 0 : _a.find((i) => i.name === types_1.RuntimeOutputVariable.appearancePage)) === null || _b === void 0 ? void 0 : _b.appearance;
|
|
21
|
-
|
|
21
|
+
if (appearance === null || appearance === void 0 ? void 0 : appearance.componentId)
|
|
22
|
+
return Object.assign(Object.assign({}, appearance), { componentId: appearance.componentId });
|
|
23
|
+
const runtimeAppearance = (_d = (_c = runtimeAgent.outputVariables) === null || _c === void 0 ? void 0 : _c.find((i) => i.name === types_1.RuntimeOutputVariable.appearancePage)) === null || _d === void 0 ? void 0 : _d.appearance;
|
|
24
|
+
if (runtimeAppearance === null || runtimeAppearance === void 0 ? void 0 : runtimeAppearance.componentId)
|
|
25
|
+
return Object.assign(Object.assign({}, runtimeAppearance), { componentId: runtimeAppearance.componentId });
|
|
26
|
+
return {
|
|
27
|
+
componentId: constants_1.DEFAULT_PAGE_COMPONENT_ID,
|
|
28
|
+
};
|
|
22
29
|
}, [agent]);
|
|
23
30
|
const appearanceInput = (0, react_1.useMemo)(() => {
|
|
24
31
|
var _a, _b, _c, _d;
|
|
25
32
|
const appearance = (_b = (_a = agent.outputVariables) === null || _a === void 0 ? void 0 : _a.find((i) => i.name === types_1.RuntimeOutputVariable.appearanceInput)) === null || _b === void 0 ? void 0 : _b.appearance;
|
|
26
|
-
if (appearance)
|
|
27
|
-
return appearance;
|
|
33
|
+
if (appearance === null || appearance === void 0 ? void 0 : appearance.componentId)
|
|
34
|
+
return Object.assign(Object.assign({}, appearance), { componentId: appearance.componentId });
|
|
28
35
|
const runtimeAppearance = (_d = (_c = runtimeAgent.outputVariables) === null || _c === void 0 ? void 0 : _c.find((i) => i.name === types_1.RuntimeOutputVariable.appearanceInput)) === null || _d === void 0 ? void 0 : _d.appearance;
|
|
29
|
-
if (runtimeAppearance)
|
|
30
|
-
return runtimeAppearance;
|
|
36
|
+
if (runtimeAppearance === null || runtimeAppearance === void 0 ? void 0 : runtimeAppearance.componentId)
|
|
37
|
+
return Object.assign(Object.assign({}, runtimeAppearance), { componentId: runtimeAppearance.componentId });
|
|
31
38
|
return {
|
|
32
39
|
componentId: constants_1.DEFAULT_INPUT_COMPONENT_ID,
|
|
33
40
|
};
|
|
@@ -36,10 +43,10 @@ function useAppearances(args) {
|
|
|
36
43
|
var _a, _b, _c, _d;
|
|
37
44
|
const appearance = (_b = (_a = agent.outputVariables) === null || _a === void 0 ? void 0 : _a.find((i) => i.name === types_1.RuntimeOutputVariable.appearanceOutput)) === null || _b === void 0 ? void 0 : _b.appearance;
|
|
38
45
|
if (appearance === null || appearance === void 0 ? void 0 : appearance.componentId)
|
|
39
|
-
return appearance;
|
|
46
|
+
return Object.assign(Object.assign({}, appearance), { componentId: appearance.componentId });
|
|
40
47
|
const runtimeAppearance = (_d = (_c = runtimeAgent.outputVariables) === null || _c === void 0 ? void 0 : _c.find((i) => i.name === types_1.RuntimeOutputVariable.appearanceOutput)) === null || _d === void 0 ? void 0 : _d.appearance;
|
|
41
|
-
if (runtimeAppearance)
|
|
42
|
-
return runtimeAppearance;
|
|
48
|
+
if (runtimeAppearance === null || runtimeAppearance === void 0 ? void 0 : runtimeAppearance.componentId)
|
|
49
|
+
return Object.assign(Object.assign({}, runtimeAppearance), { componentId: runtimeAppearance.componentId });
|
|
43
50
|
return {
|
|
44
51
|
componentId: constants_1.DEFAULT_OUTPUT_COMPONENT_ID,
|
|
45
52
|
};
|
|
@@ -21,18 +21,20 @@ const header_1 = require("../../../page/header");
|
|
|
21
21
|
const AgentSettingsDialog_1 = require("../components/AgentSettings/AgentSettingsDialog");
|
|
22
22
|
const PopperMenuButton_1 = __importDefault(require("../components/PopperMenuButton"));
|
|
23
23
|
const LoadingMenuItem_1 = __importDefault(require("../components/PopperMenuButton/LoadingMenuItem"));
|
|
24
|
+
const SocialShare_1 = __importDefault(require("../components/SocialShare"));
|
|
24
25
|
const ComponentPreferences_1 = require("../contexts/ComponentPreferences");
|
|
25
26
|
const runtime_1 = require("../state/runtime");
|
|
26
27
|
const session_1 = require("../state/session");
|
|
27
28
|
const use_agent_admin_1 = require("./use-agent-admin");
|
|
28
29
|
function useHeaderMenu() {
|
|
29
|
-
var _a;
|
|
30
|
+
var _a, _b, _c;
|
|
30
31
|
const { t, locale } = (0, locale_1.useLocaleContext)();
|
|
31
32
|
const { hideHeaderMenuButton } = (_a = (0, ComponentPreferences_1.useComponentPreferences)()) !== null && _a !== void 0 ? _a : {};
|
|
32
33
|
const clearSession = (0, session_1.useSessionState)((s) => s.clearSession);
|
|
33
34
|
const { agent } = (0, runtime_1.useRuntimeState)();
|
|
34
35
|
const isAdmin = (0, use_agent_admin_1.useIsAgentAdmin)(agent);
|
|
35
36
|
const hasSettings = agent.config.secrets.length > 0;
|
|
37
|
+
const shareContent = ((_b = agent.project) === null || _b === void 0 ? void 0 : _b.name) ? `${agent.project.name}\n\n${(_c = agent.project) === null || _c === void 0 ? void 0 : _c.description}` : '';
|
|
36
38
|
(0, header_1.useHeader)(() => hideHeaderMenuButton
|
|
37
39
|
? {}
|
|
38
40
|
: {
|
|
@@ -41,6 +43,7 @@ function useHeaderMenu() {
|
|
|
41
43
|
hasSettings && isAdmin && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: () => AgentSettingsDialog_1.settingsDialogState.getState().open(), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:settings" }) }), t('settings')] }, "settings")),
|
|
42
44
|
(0, jsx_runtime_1.jsxs)(LoadingMenuItem_1.default, { onClick: () => __awaiter(this, void 0, void 0, function* () { return clearSession(); }), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "mingcute:broom-line" }) }), t('clearSession')] }, "clearSession"),
|
|
43
45
|
], children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:dots" }) }),
|
|
46
|
+
(0, jsx_runtime_1.jsx)(SocialShare_1.default, { content: shareContent }),
|
|
44
47
|
...exists,
|
|
45
48
|
],
|
|
46
49
|
}, [locale, hideHeaderMenuButton]);
|
|
@@ -28,67 +28,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.default = Runtime;
|
|
30
30
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
-
const material_1 = require("@mui/material");
|
|
32
31
|
const react_helmet_1 = require("react-helmet");
|
|
33
|
-
const ufo_1 = require("ufo");
|
|
34
32
|
const CustomComponentRenderer_1 = __importDefault(require("../../../../../components/CustomComponentRenderer"));
|
|
35
|
-
const ux_1 = require("../../../../arcblock/ux");
|
|
36
|
-
const locale_1 = require("../../../../locale");
|
|
37
|
-
const header_1 = require("../../../../page/header");
|
|
38
|
-
const utils_1 = require("../../../../utils");
|
|
39
33
|
const AgentSettingsDialog_1 = __importDefault(require("../../components/AgentSettings/AgentSettingsDialog"));
|
|
40
|
-
const RuntimeCommonProvider_1 =
|
|
41
|
-
const SocialShare_1 = __importDefault(require("../../components/SocialShare"));
|
|
34
|
+
const RuntimeCommonProvider_1 = __importDefault(require("../../components/RuntimeCommonProvider"));
|
|
42
35
|
const ThemeProvider_1 = __importDefault(require("../../components/ThemeProvider"));
|
|
43
|
-
const constants_1 = require("../../constants");
|
|
44
36
|
const ActiveAgent_1 = __importDefault(require("../../contexts/ActiveAgent"));
|
|
45
37
|
const Runtime_1 = __importStar(require("../../contexts/Runtime"));
|
|
46
38
|
const use_appearances_1 = __importDefault(require("../../hooks/use-appearances"));
|
|
47
39
|
const use_header_menu_1 = require("../../hooks/use-header-menu");
|
|
48
40
|
const runtime_1 = require("../../state/runtime");
|
|
49
|
-
const logoSize = 44;
|
|
50
|
-
function AgentCreatedBy({ did }) {
|
|
51
|
-
const { t } = (0, locale_1.useLocaleContext)();
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [t('by'), " ", (0, jsx_runtime_1.jsx)(material_1.Box, { component: ux_1.DID, did: did, copyable: false, responsive: true })] }));
|
|
53
|
-
}
|
|
54
41
|
function Runtime({ blockletDid, aid, working, }) {
|
|
55
42
|
const children = ((0, jsx_runtime_1.jsx)(ThemeProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ActiveAgent_1.default, { children: (0, jsx_runtime_1.jsx)(RuntimeView, {}) }) }));
|
|
56
43
|
return ((0, jsx_runtime_1.jsx)(RuntimeCommonProvider_1.default, { children: aid ? ((0, jsx_runtime_1.jsx)(Runtime_1.default, { blockletDid: blockletDid, aid: aid, working: working, children: children })) : ((0, jsx_runtime_1.jsx)(Runtime_1.RuntimeProviderFromUrl, { children: children })) }));
|
|
57
44
|
}
|
|
58
45
|
function RuntimeView() {
|
|
59
|
-
var _a;
|
|
60
46
|
const { aid, agent } = (0, runtime_1.useRuntimeState)();
|
|
61
47
|
const { appearancePage } = (0, use_appearances_1.default)({ aid });
|
|
62
|
-
const theme = (0, material_1.useTheme)();
|
|
63
|
-
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('sm'));
|
|
64
|
-
const { locale } = (0, locale_1.useLocaleContext)();
|
|
65
|
-
(0, header_1.useHeader)(() => {
|
|
66
|
-
const logo = (0, ufo_1.joinURL)(window.location.origin, (0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/projects', agent.project.id, '/logo.png');
|
|
67
|
-
const shareContent = `${agent.name}
|
|
68
|
-
|
|
69
|
-
${agent === null || agent === void 0 ? void 0 : agent.description}
|
|
70
|
-
`;
|
|
71
|
-
return {
|
|
72
|
-
logo: logo && ((0, jsx_runtime_1.jsx)(material_1.Box, { component: ux_1.Avatar, src: logo, did: blocklet === null || blocklet === void 0 ? void 0 : blocklet.appId, borderRadius: 1, size: logoSize, sx: {
|
|
73
|
-
width: logoSize,
|
|
74
|
-
height: logoSize,
|
|
75
|
-
} })),
|
|
76
|
-
brand: !isMobile ? ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
77
|
-
height: 18,
|
|
78
|
-
fontSize: 18,
|
|
79
|
-
}, children: agent.project.name })) : undefined,
|
|
80
|
-
description: !isMobile && agent.createdBy ? ((0, jsx_runtime_1.jsx)(RuntimeCommonProvider_1.RuntimeLocaleProvider, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
81
|
-
display: 'inline-flex',
|
|
82
|
-
alignItems: 'center',
|
|
83
|
-
gap: 0.5,
|
|
84
|
-
mt: 0.5,
|
|
85
|
-
height: 12,
|
|
86
|
-
fontSize: 12,
|
|
87
|
-
}, children: (0, jsx_runtime_1.jsx)(AgentCreatedBy, { did: agent.project.createdBy }) }) })) : undefined,
|
|
88
|
-
addons: (exists) => [(0, jsx_runtime_1.jsx)(SocialShare_1.default, { content: shareContent }), ...exists].filter(Boolean),
|
|
89
|
-
};
|
|
90
|
-
}, [locale, isMobile, agent]);
|
|
91
48
|
(0, use_header_menu_1.useHeaderMenu)();
|
|
92
|
-
|
|
93
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_1.Helmet, { children: [agent.project.name && (0, jsx_runtime_1.jsx)("title", { children: agent.project.name }), agent.project.description && (0, jsx_runtime_1.jsx)("meta", { name: "description", content: agent.project.description })] }), (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { componentId: componentId, properties: appearancePage === null || appearancePage === void 0 ? void 0 : appearancePage.componentProperties }), (0, jsx_runtime_1.jsx)(AgentSettingsDialog_1.default, {})] }));
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_1.Helmet, { children: [agent.project.name && (0, jsx_runtime_1.jsx)("title", { children: agent.project.name }), agent.project.description && (0, jsx_runtime_1.jsx)("meta", { name: "description", content: agent.project.description })] }), (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { componentId: appearancePage.componentId, properties: appearancePage.componentProperties }), (0, jsx_runtime_1.jsx)(AgentSettingsDialog_1.default, {})] }));
|
|
94
50
|
}
|
|
@@ -274,6 +274,7 @@ const createSessionState = ({ aid }) => {
|
|
|
274
274
|
parameters: Object.assign(Object.assign({}, parameters), { $clientTime: new Date().toISOString() }),
|
|
275
275
|
});
|
|
276
276
|
let responseStarted = false;
|
|
277
|
+
let mainTaskId;
|
|
277
278
|
try {
|
|
278
279
|
for (var _e = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield stream_1.next(), _b = stream_1_1.done, !_b; _e = true) {
|
|
279
280
|
_d = stream_1_1.value;
|
|
@@ -285,9 +286,10 @@ const createSessionState = ({ aid }) => {
|
|
|
285
286
|
}
|
|
286
287
|
if ((value === null || value === void 0 ? void 0 : value.type) === 'CHUNK') {
|
|
287
288
|
if (!message) {
|
|
289
|
+
mainTaskId = value.taskId;
|
|
288
290
|
message = {
|
|
289
|
-
id: value.
|
|
290
|
-
agentId: identity.
|
|
291
|
+
id: value.messageId,
|
|
292
|
+
agentId: identity.agentId,
|
|
291
293
|
sessionId,
|
|
292
294
|
inputs: parameters,
|
|
293
295
|
createdAt: new Date().toISOString(),
|
|
@@ -303,7 +305,7 @@ const createSessionState = ({ aid }) => {
|
|
|
303
305
|
s.messages.push(message);
|
|
304
306
|
});
|
|
305
307
|
}
|
|
306
|
-
if (
|
|
308
|
+
if (mainTaskId === value.taskId) {
|
|
307
309
|
requestAnimationFrame(() => {
|
|
308
310
|
set((state) => {
|
|
309
311
|
var _a, _b, _c, _d;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chineseFonts = void 0;
|
|
4
|
+
exports.chineseFonts = [
|
|
5
|
+
{
|
|
6
|
+
key: '东方大楷',
|
|
7
|
+
value: 'Alimama DongFangDaKai',
|
|
8
|
+
link: 'https://cdn.jsdelivr.net/npm/cn-fontsource-alimama-dong-fang-da-kai-regular/font.css',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
key: '鸿雷行书',
|
|
12
|
+
value: 'hongleixingshu',
|
|
13
|
+
link: 'https://cdn.jsdelivr.net/npm/cn-fontsource-hongleixingshu-regular/font.css',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: '方正楷体',
|
|
17
|
+
value: 'FZKai-Z03',
|
|
18
|
+
link: 'https://cdn.jsdelivr.net/npm/cn-fontsource-fz-kai-z-03-regular/font.css',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: '方正宋体',
|
|
22
|
+
value: 'FZShuSong-Z01',
|
|
23
|
+
link: 'https://cdn.jsdelivr.net/npm/cn-fontsource-fz-shu-song-z-01-regular/font.css',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: '方正黑体',
|
|
27
|
+
value: 'FZHei-B01',
|
|
28
|
+
link: 'https://cdn.jsdelivr.net/npm/cn-fontsource-fz-hei-b-01-regular/font.css',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: '方正仿宋',
|
|
32
|
+
value: 'FZFangSong-Z02S',
|
|
33
|
+
link: 'https://cdn.jsdelivr.net/npm/cn-fontsource-fz-fang-song-z-02-s-regular/font.css',
|
|
34
|
+
},
|
|
35
|
+
];
|