Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ voidraft is a modern developer-focused text editor that allows you to record, or
- Block editing mode - Split content into independent code blocks, each with different language settings
- Multi-window support - edit multiple documents at the same time
- Support for custom themes - Custom editor themes
- . . .

### Modern Interface

Expand All @@ -36,6 +37,7 @@ voidraft is a modern developer-focused text editor that allows you to record, or
- Hyperlink support
- Checkbox support
- Minimap
- . . .

## Quick Start

Expand Down Expand Up @@ -113,17 +115,11 @@ voidraft/

### Platform Extension Plans

| Platform | Status | Expected Time |
|----------|--------|---------------|
| macOS | Planned | Future versions |
| Linux | Planned | Future versions |

### Planned Features
- ✅ Custom themes - Customize editor themes
- ✅ Multi-window support - Support editing multiple documents simultaneously
- ✅ Data synchronization - Cloud backup for documents
- [ ] Enhanced clipboard - Monitor and manage clipboard history
- [ ] Extension system - Support for custom plugins
| Platform | Status | Expected Time |
|----------|--------|-----------------|
| Windows | In progress | LTS |
| macOS | Planned | Future versions |
| Linux | Planned | Future versions |

## Acknowledgments

Expand Down
19 changes: 7 additions & 12 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ voidraft 是一个现代化的开发者专用文本编辑器,让你能够随
- 块状编辑模式 - 将内容分割为独立的代码块,每个块可设置不同语言
- 支持多窗口 - 同时编辑多个文档
- 支持自定义主题 - 自定义编辑器主题
- . . .

### 现代化界面

Expand All @@ -36,6 +37,7 @@ voidraft 是一个现代化的开发者专用文本编辑器,让你能够随
- 超链接支持
- 复选框支持
- 小地图
- . . .


## 快速开始
Expand Down Expand Up @@ -114,18 +116,11 @@ voidraft/

### 平台扩展计划

| 平台 | 状态 | 预期时间 |
|------|------|----------|
| macOS | 计划中 | 后续版本 |
| Linux | 计划中 | 后续版本 |

### 计划添加的功能
- ✅ 自定义主题 - 自定义编辑器主题
- ✅ 多窗口支持 - 支持同时编辑多个文档
- ✅ 数据同步 - 文档云端备份
- [ ] 剪切板增强 - 监听和管理剪切板历史
- [ ] 扩展系统 - 支持自定义插件

| 平台 | 状态 | 预期时间 |
|---------|-----|------|
| Windows | 进行中 | 长久支持 |
| macOS | 计划中 | 后续版本 |
| Linux | 计划中 | 后续版本 |

## 致谢

Expand Down
43 changes: 43 additions & 0 deletions frontend/bindings/voidraft/internal/models/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ export class AppearanceConfig {
*/
"currentTheme": string;

/**
* 光标闪烁周期(毫秒)
*/
"cursorBlinkRate": number;

/** Creates a new AppearanceConfig instance. */
constructor($$source: Partial<AppearanceConfig> = {}) {
if (!("language" in $$source)) {
Expand All @@ -126,6 +131,9 @@ export class AppearanceConfig {
if (!("currentTheme" in $$source)) {
this["currentTheme"] = "";
}
if (!("cursorBlinkRate" in $$source)) {
this["cursorBlinkRate"] = 0;
}

Object.assign(this, $$source);
}
Expand Down Expand Up @@ -246,6 +254,22 @@ export class EditingConfig {
*/
"autoSaveDelay": number;

/**
* 默认块设置
* 默认新块语言
*/
"defaultBlockLanguage": string;

/**
* 默认新块自动识别
*/
"defaultBlockAutoDetect": boolean;

/**
* 块分隔符高度(像素)
*/
"blockSeparatorHeight": number;

/** Creates a new EditingConfig instance. */
constructor($$source: Partial<EditingConfig> = {}) {
if (!("fontSize" in $$source)) {
Expand Down Expand Up @@ -275,6 +299,15 @@ export class EditingConfig {
if (!("autoSaveDelay" in $$source)) {
this["autoSaveDelay"] = 0;
}
if (!("defaultBlockLanguage" in $$source)) {
this["defaultBlockLanguage"] = "";
}
if (!("defaultBlockAutoDetect" in $$source)) {
this["defaultBlockAutoDetect"] = false;
}
if (!("blockSeparatorHeight" in $$source)) {
this["blockSeparatorHeight"] = 0;
}

Object.assign(this, $$source);
}
Expand Down Expand Up @@ -759,6 +792,11 @@ export enum KeyBindingName {
*/
HideSearch = "hideSearch",

/**
* 打开命令面板
*/
OpenCommandPalette = "openCommandPalette",

/**
* 块内选择全部
*/
Expand All @@ -774,6 +812,11 @@ export enum KeyBindingName {
*/
BlockAddAfterLast = "blockAddAfterLast",

/**
* 在最后添加新块并滚动到底部
*/
BlockAddAfterLastAndScrollDown = "blockAddAfterLastAndScrollDown",

/**
* 在当前块前添加新块
*/
Expand Down
23 changes: 23 additions & 0 deletions frontend/bindings/voidraft/internal/services/currencyservice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";

export function GetCurrencyData(): Promise<$models.CurrencyData | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(3852526484) as any;

Check warning on line 13 in frontend/bindings/voidraft/internal/services/currencyservice.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/currencyservice.ts#L13

'$resultPromise' is never reassigned. Use 'const' instead. (prefer-const)

Check warning on line 13 in frontend/bindings/voidraft/internal/services/currencyservice.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/currencyservice.ts#L13

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)
Comment thread
landaiqing marked this conversation as resolved.
let $typingPromise = $resultPromise.then(($result: any) => {

Check warning on line 14 in frontend/bindings/voidraft/internal/services/currencyservice.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/currencyservice.ts#L14

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)

Check warning on line 14 in frontend/bindings/voidraft/internal/services/currencyservice.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/currencyservice.ts#L14

'$typingPromise' is never reassigned. Use 'const' instead. (prefer-const)
Comment thread
landaiqing marked this conversation as resolved.
return $$createType1($result);
}) as any;

Check warning on line 16 in frontend/bindings/voidraft/internal/services/currencyservice.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/currencyservice.ts#L16

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)

Check warning on line 16 in frontend/bindings/voidraft/internal/services/currencyservice.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This assertion is unnecessary since it does not change the type of the expression.

See more on https://sonarcloud.io/project/issues?id=landaiqing_voidraft&issues=AZ2CKIdVB1HMB1XNsW6d&open=AZ2CKIdVB1HMB1XNsW6d&pullRequest=48
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}

// Private type creation functions
const $$createType0 = $models.CurrencyData.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
2 changes: 2 additions & 0 deletions frontend/bindings/voidraft/internal/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// This file is automatically generated. DO NOT EDIT

import * as ConfigService from "./configservice.js";
import * as CurrencyService from "./currencyservice.js";
import * as DatabaseService from "./databaseservice.js";
import * as DialogService from "./dialogservice.js";
import * as DocumentService from "./documentservice.js";
Expand All @@ -22,6 +23,7 @@
import * as WindowService from "./windowservice.js";
export {
ConfigService,
CurrencyService,

Check warning on line 26 in frontend/bindings/voidraft/internal/services/index.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use `export…from` to re-export `CurrencyService`.

See more on https://sonarcloud.io/project/issues?id=landaiqing_voidraft&issues=AZ2CKIdqB1HMB1XNsW6e&open=AZ2CKIdqB1HMB1XNsW6e&pullRequest=48
DatabaseService,
DialogService,
DocumentService,
Expand Down
57 changes: 44 additions & 13 deletions frontend/bindings/voidraft/internal/services/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,36 @@
// @ts-ignore: Unused imports
import * as time$0 from "../../../time/models.js";

export class CurrencyData {
"base": string;
"rates": { [_: string]: number };
"timestamp"?: number;

/** Creates a new CurrencyData instance. */
constructor($$source: Partial<CurrencyData> = {}) {
if (!("base" in $$source)) {
this["base"] = "";
}
if (!("rates" in $$source)) {
this["rates"] = {};
}

Object.assign(this, $$source);
}

/**
* Creates a new CurrencyData instance from a string or object.
*/
static createFrom($$source: any = {}): CurrencyData {

Check warning on line 35 in frontend/bindings/voidraft/internal/services/models.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/models.ts#L35

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)
const $$createField1_0 = $$createType0;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("rates" in $$parsedSource) {
$$parsedSource["rates"] = $$createField1_0($$parsedSource["rates"]);
}
return new CurrencyData($$parsedSource as Partial<CurrencyData>);
}
}

/**
* DocumentSaveResult describes the outcome of a document save request.
*/
Expand Down Expand Up @@ -89,7 +119,7 @@
* Creates a new HttpRequest instance from a string or object.
*/
static createFrom($$source: any = {}): HttpRequest {
const $$createField2_0 = $$createType0;
const $$createField2_0 = $$createType1;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("headers" in $$parsedSource) {
$$parsedSource["headers"] = $$createField2_0($$parsedSource["headers"]);
Expand Down Expand Up @@ -149,7 +179,7 @@
* Creates a new HttpResponse instance from a string or object.
*/
static createFrom($$source: any = {}): HttpResponse {
const $$createField4_0 = $$createType1;
const $$createField4_0 = $$createType2;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("headers" in $$parsedSource) {
$$parsedSource["headers"] = $$createField4_0($$parsedSource["headers"]);
Expand Down Expand Up @@ -524,9 +554,9 @@
* Creates a new SystemInfo instance from a string or object.
*/
static createFrom($$source: any = {}): SystemInfo {
const $$createField3_0 = $$createType5;
const $$createField4_0 = $$createType6;
const $$createField3_0 = $$createType6;
const $$createField4_0 = $$createType7;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;

Check warning on line 559 in frontend/bindings/voidraft/internal/services/models.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/models.ts#L559

'$$parsedSource' is never reassigned. Use 'const' instead. (prefer-const)
Comment thread
landaiqing marked this conversation as resolved.
if ("osInfo" in $$parsedSource) {
$$parsedSource["osInfo"] = $$createField3_0($$parsedSource["osInfo"]);
}
Expand All @@ -539,14 +569,15 @@

// Private type creation functions
const $$createType0 = $Create.Map($Create.Any, $Create.Any);
var $$createType1 = (function $$initCreateType1(...args): any {
if ($$createType1 === $$initCreateType1) {
$$createType1 = $$createType3;
const $$createType1 = $Create.Map($Create.Any, $Create.Any);
var $$createType2 = (function $$initCreateType2(...args): any {

Check warning on line 573 in frontend/bindings/voidraft/internal/services/models.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/models.ts#L573

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)

Check warning on line 573 in frontend/bindings/voidraft/internal/services/models.ts

View check run for this annotation

codefactor.io / CodeFactor

frontend/bindings/voidraft/internal/services/models.ts#L573

Unexpected var, use let or const instead. (no-var)

Check failure on line 573 in frontend/bindings/voidraft/internal/services/models.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Unexpected var, use let or const instead.

See more on https://sonarcloud.io/project/issues?id=landaiqing_voidraft&issues=AZ2CKIdNB1HMB1XNsW6c&open=AZ2CKIdNB1HMB1XNsW6c&pullRequest=48
if ($$createType2 === $$initCreateType2) {
$$createType2 = $$createType4;
}
return $$createType1(...args);
return $$createType2(...args);
});
const $$createType2 = $Create.Array($Create.Any);
const $$createType3 = $Create.Map($Create.Any, $$createType2);
const $$createType4 = OSInfo.createFrom;
const $$createType5 = $Create.Nullable($$createType4);
const $$createType6 = $Create.Map($Create.Any, $Create.Any);
const $$createType3 = $Create.Array($Create.Any);
const $$createType4 = $Create.Map($Create.Any, $$createType3);
const $$createType5 = OSInfo.createFrom;
const $$createType6 = $Create.Nullable($$createType5);
const $$createType7 = $Create.Map($Create.Any, $Create.Any);
1 change: 1 addition & 0 deletions frontend/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ declare module 'vue' {
AccordionContainer: typeof import('./src/components/accordion/AccordionContainer.vue')['default']
AccordionItem: typeof import('./src/components/accordion/AccordionItem.vue')['default']
BlockLanguageSelector: typeof import('./src/components/toolbar/BlockLanguageSelector.vue')['default']
BlockMetaTools: typeof import('./src/components/toolbar/BlockMetaTools.vue')['default']
DocumentSelector: typeof import('./src/components/toolbar/DocumentSelector.vue')['default']
DrawImageDialog: typeof import('./src/components/inlineImage/DrawImageDialog.vue')['default']
DrawImageFooter: typeof import('./src/components/inlineImage/draw/DrawImageFooter.vue')['default']
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"app:dev": "cd .. &&wails3 dev",
"app:build": "cd .. && wails3 task build",
"app:package": "cd .. && wails3 package",
"app:generate": "cd .. && wails3 generate bindings -ts"
"app:generate": "cd .. && wails3 generate bindings -ts",
"build:mathjs-parser": "node src/views/editor/language/mathjs/build-parser.js"
},
"dependencies": {
"@codemirror/autocomplete": "^6.20.1",
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {useSystemStore} from '@/stores/systemStore';
import {useKeybindingStore} from '@/stores/keybindingStore';
import {useThemeStore} from '@/stores/themeStore';
import {useUpdateStore} from '@/stores/updateStore';
import {useCurrencyStore} from '@/stores/currencyStore';
import WindowTitleBar from '@/components/titlebar/WindowTitleBar.vue';
import ToastContainer from '@/components/toast/ToastContainer.vue';
import {useTranslationStore} from "@/stores/translationStore";
Expand All @@ -17,6 +18,7 @@ const keybindingStore = useKeybindingStore();
const themeStore = useThemeStore();
const updateStore = useUpdateStore();
const translationStore = useTranslationStore();
const currencyStore = useCurrencyStore();
const {locale} = useI18n();

onBeforeMount(async () => {
Expand All @@ -33,6 +35,8 @@ onBeforeMount(async () => {

// 启动时检查更新
await updateStore.checkOnStartup();

await currencyStore.initCurrencySync();
});
</script>

Expand Down
4 changes: 0 additions & 4 deletions frontend/src/assets/icons/trash-white.svg

This file was deleted.

16 changes: 13 additions & 3 deletions frontend/src/common/constant/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ export const CONFIG_KEY_MAP = {
tabType: 'editing.tabType',
keymapMode: 'editing.keymapMode',
autoSaveDelay: 'editing.autoSaveDelay',
defaultBlockLanguage: 'editing.defaultBlockLanguage',
defaultBlockAutoDetect: 'editing.defaultBlockAutoDetect',
blockSeparatorHeight: 'editing.blockSeparatorHeight',

language: 'appearance.language',
systemTheme: 'appearance.systemTheme',
currentTheme: 'appearance.currentTheme',
cursorBlinkRate: 'appearance.cursorBlinkRate',

autoUpdate: 'updates.autoUpdate',
backupBeforeUpdate: 'updates.backupBeforeUpdate',
Expand All @@ -57,13 +61,15 @@ export const CONFIG_KEY_MAP = {
} as const;

export type ConfigKey = keyof typeof CONFIG_KEY_MAP;
export type NumberConfigKey = 'fontSize' | 'tabSize' | 'lineHeight';
export type NumberConfigKey = 'fontSize' | 'tabSize' | 'lineHeight' | 'cursorBlinkRate' | 'blockSeparatorHeight';

// 配置限制
export const CONFIG_LIMITS = {
fontSize: {min: 12, max: 28, default: 13},
tabSize: {min: 2, max: 8, default: 4},
lineHeight: {min: 1.0, max: 3.0, default: 1.5},
cursorBlinkRate: {min: 0, max: 2000, default: 1000},
blockSeparatorHeight: {min: 4, max: 24, default: 12},
tabType: {values: [TabType.TabTypeSpaces, TabType.TabTypeTab], default: TabType.TabTypeSpaces}
} as const;

Expand Down Expand Up @@ -96,12 +102,16 @@ export const DEFAULT_CONFIG: AppConfig = {
tabSize: CONFIG_LIMITS.tabSize.default,
tabType: CONFIG_LIMITS.tabType.default,
keymapMode: KeyBindingType.Standard,
autoSaveDelay: 5000
autoSaveDelay: 5000,
defaultBlockLanguage: 'text',
defaultBlockAutoDetect: true,
blockSeparatorHeight: CONFIG_LIMITS.blockSeparatorHeight.default,
},
appearance: {
language: LanguageType.LangZhCN,
systemTheme: SystemThemeType.SystemThemeDark,
currentTheme: 'default-dark'
currentTheme: 'default-dark',
cursorBlinkRate: CONFIG_LIMITS.cursorBlinkRate.default,
},
updates: {
version: "1.0.0",
Expand Down
Loading
Loading