Compare commits
20 Commits
e97baaad8a
...
v1.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
47d9aa22d8
|
|||
|
e601a96288
|
|||
|
d63473b3e3
|
|||
|
e2cedef75c
|
|||
|
361e225244
|
|||
|
aad0b9eb3b
|
|||
|
96a9714cdd
|
|||
|
3812ffd18f
|
|||
|
6f0ebfe358
|
|||
|
0d3dd30591
|
|||
|
ac8d21c063
|
|||
|
ebaa4d8851
|
|||
|
86cee4eaa5
|
|||
|
768f9bce0f
|
|||
|
eb4107a7fd
|
|||
|
264534f479
|
|||
|
c2f6b5d49e
|
|||
|
4570a59455
|
|||
|
|
d0121b126b | ||
|
|
5eaae8eef7 |
@@ -24,7 +24,7 @@ This project is a front-end web UI of Oxygen Toolbox and needs to be used with t
|
|||||||
# Requires
|
# Requires
|
||||||
|
|
||||||
- Web Server (e.g. Nginx, Apache httpd)
|
- Web Server (e.g. Nginx, Apache httpd)
|
||||||
- [API of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-api) (v1.0.0 and later versions)
|
- [API of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-api) (v1.0.0 or later versions)
|
||||||
|
|
||||||
# Related projects
|
# Related projects
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
# 环境要求
|
# 环境要求
|
||||||
|
|
||||||
- Web 服务器(如 Nginx, Apache httpd)
|
- Web 服务器(如 Nginx, Apache httpd)
|
||||||
- [API of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-api) (v1.0.0 及更高版本)
|
- [API of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-api) (v1.0.0 或更高版本)
|
||||||
|
|
||||||
# 关联项目
|
# 关联项目
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "oxygen-ui",
|
"name": "oxygen-ui",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.0.1-SNAPSHOT",
|
"version": "1.0.2",
|
||||||
"description": "Oxygen Toolbox browser version",
|
"description": "Oxygen Toolbox browser version",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "FatttSnake",
|
"name": "FatttSnake",
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
.author {
|
.author {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
|
padding-top: 8px;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.root-content {
|
.root-content {
|
||||||
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
> .card-box, > div {
|
> .card-box, > div {
|
||||||
width: 180px;
|
width: 180px;
|
||||||
height: 290px;
|
min-height: 290px;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
|
|
||||||
> .card-box, > div {
|
> .card-box, > div {
|
||||||
width: 180px;
|
width: 180px;
|
||||||
height: 290px;
|
min-height: 290px;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
> div {
|
> div {
|
||||||
width: 180px;
|
width: 180px;
|
||||||
height: 290px;
|
min-height: 290px;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
> div {
|
> div {
|
||||||
width: 180px;
|
width: 180px;
|
||||||
height: 290px;
|
min-height: 290px;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,31 @@ export const createATA = async (): Promise<TypeHelper> => {
|
|||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
const ts = await import('https://esm.sh/typescript@5.3.3')
|
const ts = await import('https://esm.sh/typescript@5.3.3')
|
||||||
|
|
||||||
|
const maxConcurrentRequests = 50
|
||||||
|
let activeRequests = 0
|
||||||
|
const requestQueue: Array<() => void> = []
|
||||||
|
const fetchWithQueue = (input: RequestInfo | URL, init?: RequestInit | undefined) =>
|
||||||
|
new Promise<Response>((resolve, reject) => {
|
||||||
|
const attemptRequest = () => {
|
||||||
|
if (activeRequests < maxConcurrentRequests) {
|
||||||
|
activeRequests++
|
||||||
|
fetch(input, init)
|
||||||
|
.then((response) => resolve(response))
|
||||||
|
.catch((error) => reject(error))
|
||||||
|
.finally(() => {
|
||||||
|
activeRequests--
|
||||||
|
if (requestQueue.length > 0) {
|
||||||
|
requestQueue.shift()?.()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
requestQueue.push(attemptRequest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
attemptRequest()
|
||||||
|
})
|
||||||
|
|
||||||
const ata = setupTypeAcquisition({
|
const ata = setupTypeAcquisition({
|
||||||
projectName: 'monaco-ts',
|
projectName: 'monaco-ts',
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
@@ -43,7 +68,7 @@ export const createATA = async (): Promise<TypeHelper> => {
|
|||||||
logger: console,
|
logger: console,
|
||||||
fetcher: (input, init) => {
|
fetcher: (input, init) => {
|
||||||
try {
|
try {
|
||||||
return fetch(input, init)
|
return fetchWithQueue(input, init)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching data:', error)
|
console.error('Error fetching data:', error)
|
||||||
}
|
}
|
||||||
@@ -92,6 +117,7 @@ export const createATA = async (): Promise<TypeHelper> => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
acquireType,
|
acquireType,
|
||||||
addListener,
|
addListener,
|
||||||
removeListener,
|
removeListener,
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ export const useEditor = () => {
|
|||||||
const selection = input.options ? input.options.selection : null
|
const selection = input.options ? input.options.selection : null
|
||||||
if (selection) {
|
if (selection) {
|
||||||
if (
|
if (
|
||||||
typeof selection.endLineNumber === 'number' &&
|
typeof selection?.endLineNumber === 'number' &&
|
||||||
typeof selection.endColumn === 'number'
|
typeof selection?.endColumn === 'number'
|
||||||
) {
|
) {
|
||||||
editor.setSelection(selection)
|
editor.setSelection(selection)
|
||||||
editor.revealRangeInCenter(selection, ScrollType.Immediate)
|
editor.revealRangeInCenter(selection, ScrollType.Immediate)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class Compiler {
|
|||||||
|
|
||||||
transform = async (code: string, loader: Loader) => {
|
transform = async (code: string, loader: Loader) => {
|
||||||
await this.waitInit()
|
await this.waitInit()
|
||||||
return esbuild.transform(code, { loader })
|
return esbuild.transform(code, { loader, target: 'es2015' })
|
||||||
}
|
}
|
||||||
|
|
||||||
compile = async (files: IFiles, importMap: IImportMap, entryPoint: string) => {
|
compile = async (files: IFiles, importMap: IImportMap, entryPoint: string) => {
|
||||||
@@ -66,6 +66,7 @@ class Compiler {
|
|||||||
bundle: true,
|
bundle: true,
|
||||||
entryPoints: [entryPoint],
|
entryPoints: [entryPoint],
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
|
target: 'es2015',
|
||||||
metafile: true,
|
metafile: true,
|
||||||
write: false,
|
write: false,
|
||||||
plugins: [this.fileResolverPlugin(files, importMap)]
|
plugins: [this.fileResolverPlugin(files, importMap)]
|
||||||
|
|||||||
@@ -1100,7 +1100,7 @@ const Base = () => {
|
|||||||
<Playground.CodeEditor
|
<Playground.CodeEditor
|
||||||
files={editingFiles[editingBaseId]}
|
files={editingFiles[editingBaseId]}
|
||||||
selectedFileName={editingFileName}
|
selectedFileName={editingFileName}
|
||||||
onSelectedFileChange={() => {}}
|
onSelectedFileChange={setEditingFileName}
|
||||||
onChangeFileContent={handleOnChangeFileContent}
|
onChangeFileContent={handleOnChangeFileContent}
|
||||||
showFileSelector={false}
|
showFileSelector={false}
|
||||||
tsconfig={tsconfig}
|
tsconfig={tsconfig}
|
||||||
|
|||||||
@@ -1044,7 +1044,7 @@ const Template = () => {
|
|||||||
<Playground.CodeEditor
|
<Playground.CodeEditor
|
||||||
files={editingFiles[editingTemplateId]}
|
files={editingFiles[editingTemplateId]}
|
||||||
selectedFileName={editingFileName}
|
selectedFileName={editingFileName}
|
||||||
onSelectedFileChange={() => {}}
|
onSelectedFileChange={setEditingFileName}
|
||||||
onChangeFileContent={handleOnChangeFileContent}
|
onChangeFileContent={handleOnChangeFileContent}
|
||||||
showFileSelector={false}
|
showFileSelector={false}
|
||||||
tsconfig={tsconfig}
|
tsconfig={tsconfig}
|
||||||
|
|||||||
Reference in New Issue
Block a user