Skip to content

Commit

Permalink
Merge branch 'dev' into feat/wheel-dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
A-kirami committed Nov 13, 2024
2 parents e39212e + d2c3348 commit ef135ac
Show file tree
Hide file tree
Showing 17 changed files with 275 additions and 186 deletions.
2 changes: 2 additions & 0 deletions packages/origine2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"monaco-editor-wrapper": "~4.2.1",
"monaco-languageclient": "~8.3.1",
"monaco-textmate": "^3.0.1",
"natural-compare-lite": "^1.4.0",
"onigasm": "^2.2.5",
"primereact": "^9.5.0",
"react": "^18.0.0",
Expand All @@ -58,6 +59,7 @@
"@lingui/cli": "^4.8.0",
"@lingui/vite-plugin": "^4.8.0",
"@types/lodash": "^4.14.182",
"@types/natural-compare-lite": "^1.4.2",
"@types/react": "^18.0.0",
"@types/react-beautiful-dnd": "^13.1.2",
"@types/react-dom": "^18.0.0",
Expand Down
45 changes: 20 additions & 25 deletions packages/origine2/src/api/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
* ---------------------------------------------------------------
*/

export interface CompletionDto {
/** Editor input value for which the completion is required */
editorValue: string;
/** Parameters required for completion */
params: object;
}

export interface CreateNewFileDto {
/** The source path where the directory will be created */
source: string;
Expand Down Expand Up @@ -54,6 +47,24 @@ export interface EditTextFileDto {
textFile: string;
}

export interface TemplateConfigDto {
/** The name of the template */
name: string;
/** The webgal version of the template */
'webgal-version': string;
}

export interface GameInfoDto {
/** The name of the game */
name: string;
/** The dir of the game */
dir: string;
/** The cover of the game */
cover: string;
/** The template config of the game */
template: TemplateConfigDto;
}

export interface CreateGameDto {
/** The name of the game to be created */
gameName: string;
Expand Down Expand Up @@ -293,23 +304,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
...params,
}),

/**
* No description
*
* @tags LSP
* @name LspControllerCompile
* @summary Get code completions based on given input
* @request POST:/api/lsp/compile
*/
lspControllerCompile: (data: CompletionDto, params: RequestParams = {}) =>
this.request<void, void>({
path: `/api/lsp/compile`,
method: 'POST',
body: data,
type: ContentType.Json,
...params,
}),

/**
* No description
*
Expand Down Expand Up @@ -451,9 +445,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
* @request GET:/api/manageGame/gameList
*/
manageGameControllerGetGameList: (params: RequestParams = {}) =>
this.request<void, any>({
this.request<GameInfoDto[], any>({
path: `/api/manageGame/gameList`,
method: 'GET',
format: 'json',
...params,
}),

Expand Down
5 changes: 3 additions & 2 deletions packages/origine2/src/components/Assets/Assets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { dirNameToExtNameMap } from "@/pages/editor/ChooseFile/chooseFileConfig"
import useSWR, { useSWRConfig } from "swr";
import { t } from '@lingui/macro';
import Upload from "./Upload";
import naturalCompare from 'natural-compare-lite';

export interface IFile {
extName: string;
Expand Down Expand Up @@ -64,8 +65,8 @@ export default function Assets({ basePath, isProtected = false, fileConfig, file
const dirInfo = (data.dirInfo as IFile[]).map((item) => ({ ...item, path: currentPathString + '/' + item.name }));
const dirs = dirInfo.filter((item) => item.isDir);
const files = dirInfo.filter((item) => !item.isDir).filter(e => e.name !== '.gitkeep');
dirs.sort((a, b) => a.name.localeCompare(b.name));
files.sort((a, b) => a.name.localeCompare(b.name));
dirs.sort((a, b) => naturalCompare(a.name, b.name));
files.sort((a, b) => naturalCompare(a.name, b.name));
return [...dirs, ...files];
} else return [];
};
Expand Down
105 changes: 59 additions & 46 deletions packages/origine2/src/config/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,6 @@
]
}
},
"/api/lsp/compile": {
"post": {
"operationId": "LspController_compile",
"summary": "Get code completions based on given input",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CompletionDto"
}
}
}
},
"responses": {
"200": {
"description": "Successfully fetched the completion list."
},
"400": {
"description": "Failed to fetch the completion list."
}
},
"tags": [
"LSP"
]
}
},
"/api/assets/readAssets/{readDirPath}": {
"get": {
"operationId": "AssetsController_readAssets",
Expand Down Expand Up @@ -268,7 +240,17 @@
"parameters": [],
"responses": {
"200": {
"description": "Returned game list."
"description": "Returned game list.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GameInfoDto"
}
}
}
}
}
},
"tags": [
Expand Down Expand Up @@ -975,23 +957,6 @@
"servers": [],
"components": {
"schemas": {
"CompletionDto": {
"type": "object",
"properties": {
"editorValue": {
"type": "string",
"description": "Editor input value for which the completion is required"
},
"params": {
"type": "object",
"description": "Parameters required for completion"
}
},
"required": [
"editorValue",
"params"
]
},
"CreateNewFileDto": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1084,6 +1049,54 @@
"textFile"
]
},
"TemplateConfigDto": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the template"
},
"webgal-version": {
"type": "string",
"description": "The webgal version of the template"
}
},
"required": [
"name",
"webgal-version"
]
},
"GameInfoDto": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the game"
},
"dir": {
"type": "string",
"description": "The dir of the game"
},
"cover": {
"type": "string",
"description": "The cover of the game"
},
"template": {
"description": "The template config of the game",
"allOf": [
{
"$ref": "#/components/schemas/TemplateConfigDto"
}
]
}
},
"required": [
"name",
"dir",
"cover",
"template"
]
},
"CreateGameDto": {
"type": "object",
"properties": {
Expand Down
38 changes: 23 additions & 15 deletions packages/origine2/src/locales/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ msgstr "Intro texts"
msgid "intro:;"
msgstr "intro:;"

#: src/pages/editor/GraphicalEditor/SentenceEditor/ChangeFigure.tsx:185
msgid "Live2D 动作"
msgstr "Live2D Motion"

#: src/pages/editor/GraphicalEditor/SentenceEditor/ChangeFigure.tsx:199
msgid "Live2D 表情"
msgstr "Live2D Expression"

#: src/pages/editor/GraphicalEditor/SentenceEditor/index.tsx:173
msgid "miniAvatar:选择小头像;"
msgstr "miniAvatar: Choose a file of avatar;"
Expand Down Expand Up @@ -177,12 +185,12 @@ msgstr "z-index"
msgid "一直显示功能区"
msgstr "Always Show Toolbar"

#: src/components/Assets/Assets.tsx:368
#: src/components/Assets/Assets.tsx:369
#: src/components/Assets/Assets.tsx:370
msgid "上传"
msgstr "Upload"

#: src/components/Assets/Assets.tsx:262
#: src/components/Assets/Assets.tsx:263
msgid "上传资源"
msgstr "Upload asset"

Expand Down Expand Up @@ -435,8 +443,8 @@ msgstr "Change background"
msgid "切换背景图片"
msgstr "Change background image"

#: src/components/Assets/Assets.tsx:208
#: src/components/Assets/Assets.tsx:248
#: src/components/Assets/Assets.tsx:209
#: src/components/Assets/Assets.tsx:249
#: src/pages/dashboard/Sidebar.tsx:106
#: src/pages/dashboard/TemplateSidebar.tsx:56
msgid "创建"
Expand Down Expand Up @@ -481,7 +489,7 @@ msgstr "Delete template"
msgid "删除游戏"
msgstr "Delete game"

#: src/components/Assets/Assets.tsx:275
#: src/components/Assets/Assets.tsx:276
#: src/pages/editor/EditorSidebar/EditorSidebar.tsx:151
msgid "刷新"
msgstr "Refresh"
Expand Down Expand Up @@ -749,8 +757,8 @@ msgstr "Left align"
msgid "已创建"
msgstr "Created"

#: src/components/Assets/Assets.tsx:179
#: src/components/Assets/Assets.tsx:227
#: src/components/Assets/Assets.tsx:180
#: src/components/Assets/Assets.tsx:228
#: src/components/Assets/FileElement.tsx:70
msgid "已存在文件或文件夹 {0},请输入其他名称"
msgstr "File or folder already exists {0}, please enter another name"
Expand Down Expand Up @@ -819,15 +827,15 @@ msgstr "Manually enter ID"
msgid "打开效果编辑器"
msgstr "Open effect editor"

#: src/components/Assets/Assets.tsx:276
#: src/components/Assets/Assets.tsx:277
msgid "打开文件夹"
msgstr "Open folder"

#: src/pages/editor/GraphicalEditor/GraphicalEditor.tsx:213
msgid "执行到此句"
msgstr "Execute to this sentence"

#: src/components/Assets/Assets.tsx:193
#: src/components/Assets/Assets.tsx:194
msgid "扩展名"
msgstr "Extension name"

Expand Down Expand Up @@ -1009,11 +1017,11 @@ msgstr "Text Shadow"
msgid "文档"
msgstr "Document"

#: src/components/Assets/Assets.tsx:177
#: src/components/Assets/Assets.tsx:178
msgid "新建文件"
msgstr "Create new file"

#: src/components/Assets/Assets.tsx:225
#: src/components/Assets/Assets.tsx:226
msgid "新建文件夹"
msgstr "Create new folder"

Expand All @@ -1026,11 +1034,11 @@ msgstr "Create new template"
msgid "新建游戏"
msgstr "Create new game"

#: src/components/Assets/Assets.tsx:187
#: src/components/Assets/Assets.tsx:188
msgid "新文件名"
msgstr "New file name"

#: src/components/Assets/Assets.tsx:234
#: src/components/Assets/Assets.tsx:235
msgid "新文件夹名"
msgstr "New folder name"

Expand Down Expand Up @@ -1069,7 +1077,7 @@ msgstr "Voiceover mode, no role name"
msgid "旋转角度:"
msgstr "Rotation angle:"

#: src/components/Assets/Assets.tsx:195
#: src/components/Assets/Assets.tsx:196
#: src/pages/templateEditor/TemplateGraphicalEditor/WebgalClassEditor/propertyEditor/WGCursor.tsx:16
msgid "无"
msgstr "None"
Expand Down Expand Up @@ -1665,7 +1673,7 @@ msgstr "Assets"
msgid "输入目标 ID"
msgstr "Enter Target ID"

#: src/components/Assets/Assets.tsx:284
#: src/components/Assets/Assets.tsx:285
msgid "过滤文件"
msgstr "Filter files"

Expand Down
Loading

0 comments on commit ef135ac

Please sign in to comment.