mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: lazyload graphiql
This commit is contained in:
1 parent
32694f5a1d
commit
24f001f666
5 files changed
+6
-6
No files matched your search
@@ -4,7 +4,7 @@ import Notification from 'vj/components/notification/index';
|
||||
import tpl from 'vj/utils/tpl';
|
||||
import i18n from 'vj/utils/i18n';
|
||||
|
||||
const highlighterPage = new AutoloadPage('highlighterPage', async () => {
|
||||
const highlighterPage = new AutoloadPage('highlighterPage', () => {
|
||||
Promise.all([
|
||||
import('./prismjs'),
|
||||
UserContext.formatCode ? load() : [true, null],
|
||||
|
||||
@@ -122,7 +122,7 @@ monaco.languages.registerCompletionItemProvider('markdown', {
|
||||
startLineNumber: position.lineNumber,
|
||||
endLineNumber: position.lineNumber,
|
||||
startColumn: word.startColumn - 1,
|
||||
endColumn: position.column - 1,
|
||||
endColumn: word.startColumn - 1,
|
||||
});
|
||||
if (![':', '/'].includes(prefix)) return { suggestions: [] };
|
||||
const range = {
|
||||
|
||||
@@ -61,7 +61,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
|
||||
this.editor.onDidChangeConfiguration(() => {
|
||||
const current = this.editor.getOptions()._values[40].fontSize;
|
||||
localStorage.setItem('scratchpad.editor.fontSize', current);
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
|
||||
range: model.getFullModelRange(),
|
||||
text: value,
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
editor.pushUndoStop();
|
||||
this.__prevent_trigger_change_event = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.20.3",
|
||||
"version": "4.20.4",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -2,7 +2,6 @@ import { NamedPage } from 'vj/misc/Page';
|
||||
import request from 'vj/utils/request';
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import 'graphiql/graphiql.css';
|
||||
|
||||
const Logo = () => <span>Hydro API Console </span>;
|
||||
const defaultQuery = `\
|
||||
@@ -17,6 +16,7 @@ const page = new NamedPage('api', async () => {
|
||||
import('graphiql'),
|
||||
import('graphql'),
|
||||
request.get('/api?schema'),
|
||||
import('graphiql/graphiql.css'),
|
||||
]);
|
||||
// @ts-ignore
|
||||
GraphiQL.Logo = Logo;
|
||||
|
||||
Reference in new issue
Block a user