Compare commits
123 Commits
v1.0.0
...
afda3d5301
| Author | SHA1 | Date | |
|---|---|---|---|
| afda3d5301 | |||
| 5d4ba757aa | |||
| d12d58b15a | |||
| 627c3dc71f | |||
| 26c7a3241c | |||
| 46c5e3dd1a | |||
|
|
92a6c6bfdb | ||
| 031aa49f9f | |||
| 1d7aee4cea | |||
| dec3ef5ef4 | |||
| d42f913250 | |||
| bae4e663fb | |||
| a17e060d16 | |||
| 71946965eb | |||
| d4cd22d234 | |||
| 05f2f7d46d | |||
| 9deb2744a9 | |||
| 6fac7c42d6 | |||
| 3393bc84e3 | |||
| 286b0159d7 | |||
| cc98e556c6 | |||
| 5902f482d9 | |||
| 551e7e2cfd | |||
| e0179b5838 | |||
| df79267e16 | |||
| 1f0254822f | |||
| e9b6fef3cd | |||
| 689b0d5d14 | |||
| a058e62595 | |||
| 8571fc0f5c | |||
| 4dad0a86b3 | |||
| 3168b7ff43 | |||
| d002a5be5a | |||
| 24a550463c | |||
| 14ae3e80c4 | |||
| e4d3969e95 | |||
| 0b16d1d4ac | |||
| 300514531d | |||
| 6a4780b002 | |||
| 5688304817 | |||
| 4380ad010c | |||
| 4fa6bb42e3 | |||
| 7aa3a7e37f | |||
| 94306497a9 | |||
| 93c85b800b | |||
| 8ac78e39f1 | |||
| 61a23fe7f2 | |||
| 87fea58102 | |||
|
|
edeac01bee | ||
| 852424356a | |||
| b704dd2438 | |||
| aa8139884b | |||
| 9a15df01ee | |||
| 03780b5bc7 | |||
| b5d90cc59a | |||
| d49ffc20df | |||
| c22e349181 | |||
| 45968cd353 | |||
| 2d02bf7f1f | |||
| 1216b0b67c | |||
| cf8bf688bf | |||
| 4d6a4ff79f | |||
| 3077d5a7c5 | |||
| bc0569af93 | |||
| 0188b618f2 | |||
| 08860e9a5c | |||
| a56d4ef379 | |||
| f5bfff80b7 | |||
| 1462d8a753 | |||
| 39ee2d14f3 | |||
| e536cdd9ba | |||
| dc4b73406d | |||
| 0012a5dc19 | |||
| 3cda88371e | |||
| 0338351680 | |||
| e372a0dd7c | |||
| d597f379ff | |||
| 9222a52d91 | |||
| c3670bb8cd | |||
| 2ea3456ff7 | |||
| c9379f0edb | |||
| f72010bd69 | |||
| cd027097f8 | |||
| 9cbbf729c0 | |||
|
|
c26c11e253 | ||
| 338ac358db | |||
| a83c7139c9 | |||
| 42c7d11c09 | |||
| 5ca5aa64c7 | |||
| eda7ef771e | |||
| 593c4d7783 | |||
| d24a522b32 | |||
| 41afb834ae | |||
| b745329e26 | |||
| 1fb4f64cb3 | |||
| 1f8e8981ce | |||
| a257d30dba | |||
| 97ee3b0667 | |||
| 8e2bafba5f | |||
| 6149bc133d | |||
| 5f22ee3b1f | |||
| fa72ff8061 | |||
| 65f24860e6 | |||
|
|
4881233211 | ||
| bc01fdf362 | |||
| 709998ff9c | |||
| 6adeadeed4 | |||
| 7b70a39b23 | |||
| 873a3c0e60 | |||
| 5b88efcfbe | |||
| f37c659c89 | |||
| 9fff7bcfca | |||
| b4b0ad9bba | |||
| 6d8fdf62f1 | |||
| 9f53d7421d | |||
| 80c8ecb4cf | |||
| d10059a82d | |||
| 737f83cd5f | |||
| a720a4cfb8 | |||
| b5510d605c | |||
| 4d62da912a | |||
| b52e067d50 | |||
| 8dce06c30e |
325
.github/workflows/build-release.yml
vendored
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
name: Build and Release Voidraft
|
||||||
|
|
||||||
|
on:
|
||||||
|
# 推送标签时触发(用于正式发布)
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*' # 触发条件:推送 v 开头的标签,如 v1.0.0
|
||||||
|
branches:
|
||||||
|
- main # 仅当标签在 main 分支时触发
|
||||||
|
|
||||||
|
# 手动触发(用于测试)
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
release:
|
||||||
|
description: '是否创建 Release(测试时选 false)'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
platforms:
|
||||||
|
description: '要构建的平台(用逗号分隔:windows,linux,macos-intel,macos-arm)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: 'windows,linux'
|
||||||
|
|
||||||
|
env:
|
||||||
|
NODE_OPTIONS: "--max-old-space-size=4096" # 防止 Node.js 内存溢出
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# 准备构建配置
|
||||||
|
prepare:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
should_release: ${{ steps.check-release.outputs.should_release }}
|
||||||
|
steps:
|
||||||
|
- name: 确定构建平台
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
# 如果是手动触发,根据输入决定平台
|
||||||
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
PLATFORMS="${{ github.event.inputs.platforms }}"
|
||||||
|
else
|
||||||
|
# 标签触发,构建所有平台
|
||||||
|
PLATFORMS="windows,linux,macos-intel,macos-arm"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "构建平台: $PLATFORMS"
|
||||||
|
|
||||||
|
# 构建矩阵 JSON
|
||||||
|
MATRIX='{"include":[]}'
|
||||||
|
|
||||||
|
if [[ "$PLATFORMS" == *"windows"* ]]; then
|
||||||
|
MATRIX=$(echo "$MATRIX" | jq -c '.include += [{"platform":"windows-latest","os":"windows","arch":"amd64","platform_dir":"windows","id":"windows"}]')
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$PLATFORMS" == *"linux"* ]]; then
|
||||||
|
MATRIX=$(echo "$MATRIX" | jq -c '.include += [{"platform":"ubuntu-22.04","os":"linux","arch":"amd64","platform_dir":"linux","id":"linux"}]')
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$PLATFORMS" == *"macos-intel"* ]]; then
|
||||||
|
MATRIX=$(echo "$MATRIX" | jq -c '.include += [{"platform":"macos-latest","os":"darwin","arch":"amd64","platform_dir":"darwin","id":"macos-intel"}]')
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$PLATFORMS" == *"macos-arm"* ]]; then
|
||||||
|
MATRIX=$(echo "$MATRIX" | jq -c '.include += [{"platform":"macos-latest","os":"darwin","arch":"arm64","platform_dir":"darwin","id":"macos-arm"}]')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 使用 -c 确保输出紧凑的单行 JSON,符合 GitHub Actions 输出格式
|
||||||
|
echo "matrix=$(echo "$MATRIX" | jq -c .)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# 输出美化的 JSON 用于日志查看
|
||||||
|
echo "生成的矩阵:"
|
||||||
|
echo "$MATRIX" | jq .
|
||||||
|
|
||||||
|
- name: 检查是否创建 Release
|
||||||
|
id: check-release
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
# 手动触发,根据输入决定
|
||||||
|
echo "should_release=${{ github.event.inputs.release }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
# 标签触发,自动创建 Release
|
||||||
|
echo "should_release=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: prepare
|
||||||
|
if: ${{ fromJson(needs.prepare.outputs.matrix).include[0] != null }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 检出代码
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: 设置 Go 环境
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.21'
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: 设置 Node.js 环境
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
cache: 'npm'
|
||||||
|
cache-dependency-path: frontend/package-lock.json
|
||||||
|
|
||||||
|
# Linux 平台依赖
|
||||||
|
- name: 安装 Linux 依赖
|
||||||
|
if: matrix.os == 'linux'
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
# Wails 3 + 项目特定依赖
|
||||||
|
sudo apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
pkg-config \
|
||||||
|
libgtk-3-dev \
|
||||||
|
libwebkit2gtk-4.1-dev \
|
||||||
|
libayatana-appindicator3-dev \
|
||||||
|
librsvg2-dev \
|
||||||
|
patchelf \
|
||||||
|
libx11-dev \
|
||||||
|
rpm \
|
||||||
|
fuse \
|
||||||
|
file
|
||||||
|
|
||||||
|
# 依赖说明:
|
||||||
|
# - build-essential: C/C++ 编译工具链
|
||||||
|
# - pkg-config: 包配置工具
|
||||||
|
# - libgtk-3-dev: GTK3 GUI 框架
|
||||||
|
# - libwebkit2gtk-4.1-dev: WebKit2GTK 4.1 (Wails 3 要求)
|
||||||
|
# - libayatana-appindicator3-dev: 系统托盘支持
|
||||||
|
# - librsvg2-dev: SVG 图标支持
|
||||||
|
# - patchelf: 修改 ELF 二进制文件
|
||||||
|
# - libx11-dev: X11 库 (热键服务依赖)
|
||||||
|
# - rpm: RPM 打包工具
|
||||||
|
# - fuse: AppImage 运行依赖
|
||||||
|
# - file: 文件类型检测工具
|
||||||
|
|
||||||
|
# Windows 平台依赖
|
||||||
|
- name: 设置 Windows 构建环境
|
||||||
|
if: matrix.os == 'windows'
|
||||||
|
run: |
|
||||||
|
# 安装 NSIS (用于创建安装程序)
|
||||||
|
choco install nsis -y
|
||||||
|
# 将 NSIS 添加到 PATH
|
||||||
|
echo "C:\Program Files (x86)\NSIS" >> $GITHUB_PATH
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
# macOS 平台依赖
|
||||||
|
- name: 设置 macOS 构建环境
|
||||||
|
if: matrix.os == 'darwin'
|
||||||
|
run: |
|
||||||
|
# Xcode 命令行工具通常已安装
|
||||||
|
xcode-select --install 2>/dev/null || true
|
||||||
|
|
||||||
|
# 安装 Wails CLI
|
||||||
|
- name: 安装 Wails CLI
|
||||||
|
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
||||||
|
|
||||||
|
# 安装前端依赖
|
||||||
|
- name: 安装前端依赖
|
||||||
|
working-directory: frontend
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
# 构建前端
|
||||||
|
- name: 构建前端
|
||||||
|
working-directory: frontend
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
# 使用 Wails Task 构建和打包应用
|
||||||
|
- name: 构建和打包 Wails 应用
|
||||||
|
run: wails3 task ${{ matrix.id }}:package PRODUCTION=true ARCH=${{ matrix.arch }}
|
||||||
|
env:
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
APP_NAME: voidraft
|
||||||
|
BIN_DIR: bin
|
||||||
|
ROOT_DIR: .
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
# 整理构建产物
|
||||||
|
- name: 整理构建产物
|
||||||
|
id: organize_artifacts
|
||||||
|
run: |
|
||||||
|
echo "=== 构建产物列表 ==="
|
||||||
|
ls -lhR bin/ || echo "bin 目录不存在"
|
||||||
|
|
||||||
|
# 创建输出目录
|
||||||
|
mkdir -p artifacts
|
||||||
|
|
||||||
|
# 根据平台复制产物
|
||||||
|
if [ "${{ matrix.os }}" = "windows" ]; then
|
||||||
|
echo "Windows 平台:查找 NSIS 安装程序"
|
||||||
|
find . -name "*.exe" -type f
|
||||||
|
cp bin/*.exe artifacts/ 2>/dev/null || echo "未找到 .exe 文件"
|
||||||
|
|
||||||
|
elif [ "${{ matrix.os }}" = "linux" ]; then
|
||||||
|
echo "Linux 平台:查找 AppImage, deb, rpm, archlinux 包"
|
||||||
|
find bin -type f
|
||||||
|
cp bin/*.AppImage artifacts/ 2>/dev/null || echo "未找到 AppImage"
|
||||||
|
cp bin/*.deb artifacts/ 2>/dev/null || echo "未找到 deb"
|
||||||
|
cp bin/*.rpm artifacts/ 2>/dev/null || echo "未找到 rpm"
|
||||||
|
cp bin/*.pkg.tar.zst artifacts/ 2>/dev/null || echo "未找到 archlinux 包"
|
||||||
|
|
||||||
|
elif [ "${{ matrix.os }}" = "darwin" ]; then
|
||||||
|
echo "macOS 平台:查找 .app bundle"
|
||||||
|
find bin -name "*.app" -type d
|
||||||
|
# macOS: .app bundle,打包成 zip
|
||||||
|
if [ -d "bin/voidraft.app" ]; then
|
||||||
|
cd bin
|
||||||
|
zip -r ../artifacts/voidraft-darwin-${{ matrix.arch }}.app.zip voidraft.app
|
||||||
|
cd ..
|
||||||
|
else
|
||||||
|
echo "未找到 .app bundle"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== 最终产物 ==="
|
||||||
|
ls -lh artifacts/ || echo "artifacts 目录为空"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
# 上传构建产物到 Artifacts
|
||||||
|
- name: 上传构建产物
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: voidraft-${{ matrix.id }}
|
||||||
|
path: artifacts/*
|
||||||
|
if-no-files-found: warn
|
||||||
|
|
||||||
|
# 创建 GitHub Release 并上传所有构建产物
|
||||||
|
release:
|
||||||
|
needs: [prepare, build]
|
||||||
|
if: ${{ needs.prepare.outputs.should_release == 'true' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 检出代码
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: 下载所有构建产物
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: artifacts
|
||||||
|
|
||||||
|
- name: 显示下载的文件
|
||||||
|
run: |
|
||||||
|
echo "下载的构建产物:"
|
||||||
|
ls -R artifacts/
|
||||||
|
|
||||||
|
- name: 准备 Release 文件
|
||||||
|
run: |
|
||||||
|
mkdir -p release
|
||||||
|
find artifacts -type f -exec cp {} release/ \;
|
||||||
|
ls -lh release/
|
||||||
|
|
||||||
|
- name: 生成 Release 说明
|
||||||
|
id: release_notes
|
||||||
|
run: |
|
||||||
|
# 获取版本号
|
||||||
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
VERSION="${{ github.sha }}"
|
||||||
|
VERSION_NAME="测试构建 ${VERSION:0:7}"
|
||||||
|
else
|
||||||
|
VERSION="${{ github.ref_name }}"
|
||||||
|
VERSION_NAME="${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > release_notes.md << EOF
|
||||||
|
## Voidraft ${VERSION_NAME}
|
||||||
|
|
||||||
|
### 📦 下载
|
||||||
|
|
||||||
|
根据你的操作系统选择对应的版本:
|
||||||
|
|
||||||
|
- **Windows (64位)**: \`voidraft-windows-amd64.exe\`
|
||||||
|
- **Linux (64位)**: \`voidraft-linux-amd64\`
|
||||||
|
- **macOS (Intel)**: \`voidraft-darwin-amd64.zip\`
|
||||||
|
- **macOS (Apple Silicon)**: \`voidraft-darwin-arm64.zip\`
|
||||||
|
|
||||||
|
### 📝 更新内容
|
||||||
|
|
||||||
|
请查看 [提交历史](../../commits/${{ github.ref_name }}) 了解本次更新的详细内容。
|
||||||
|
|
||||||
|
### 💡 使用说明
|
||||||
|
|
||||||
|
#### Windows
|
||||||
|
1. 下载 `voidraft-windows-amd64.exe`
|
||||||
|
2. 直接运行即可
|
||||||
|
|
||||||
|
#### Linux
|
||||||
|
1. 下载 `voidraft-linux-amd64`
|
||||||
|
2. 添加执行权限:`chmod +x voidraft-linux-amd64`
|
||||||
|
3. 运行:`./voidraft-linux-amd64`
|
||||||
|
|
||||||
|
#### macOS
|
||||||
|
1. 下载对应架构的 zip 文件
|
||||||
|
2. 解压后运行
|
||||||
|
3. 如果提示无法打开,请在 系统偏好设置 > 安全性与隐私 中允许运行
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
构建时间: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: 创建 GitHub Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: release/*
|
||||||
|
body_path: release_notes.md
|
||||||
|
draft: false
|
||||||
|
prerelease: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
tag_name: ${{ github.event_name == 'workflow_dispatch' && format('test-{0}', github.sha) || github.ref_name }}
|
||||||
|
name: ${{ github.event_name == 'workflow_dispatch' && format('测试构建 {0}', github.sha) || github.ref_name }}
|
||||||
|
generate_release_notes: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
67
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
|
||||||
|
#
|
||||||
|
name: Deploy VitePress site to Pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
# 在针对 `main` 分支的推送上运行。如果你
|
||||||
|
# 使用 `master` 分支作为默认分支,请将其更改为 `master`
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
# 允许你从 Actions 选项卡手动运行此工作流程
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
|
||||||
|
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
|
||||||
|
concurrency:
|
||||||
|
group: pages
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# 构建工作
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
|
||||||
|
# - uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消此区域注释
|
||||||
|
# with:
|
||||||
|
# version: 9
|
||||||
|
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: frontend/package-lock.json
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v4
|
||||||
|
- name: Install dependencies
|
||||||
|
run: cd frontend && npm ci
|
||||||
|
- name: Build with VitePress
|
||||||
|
run: cd frontend && npm run docs:build
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
path: frontend/docs/.vitepress/dist
|
||||||
|
|
||||||
|
# 部署工作
|
||||||
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Deploy
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
4
.gitignore
vendored
@@ -4,4 +4,6 @@ frontend/dist
|
|||||||
frontend/node_modules
|
frontend/node_modules
|
||||||
build/linux/appimage/build
|
build/linux/appimage/build
|
||||||
build/windows/nsis/MicrosoftEdgeWebview2Setup.exe
|
build/windows/nsis/MicrosoftEdgeWebview2Setup.exe
|
||||||
.idea
|
.idea
|
||||||
|
frontend/docs/.vitepress/cache/
|
||||||
|
frontend/docs/.vitepress/dist/
|
||||||
26
README.md
@@ -1,10 +1,10 @@
|
|||||||
# <img src="./frontend/public/appicon.png" alt="VoidRaft Logo" width="32" height="32" style="vertical-align: middle;"> VoidRaft
|
# <img src="./frontend/public/appicon.png" alt="voidraft Logo" width="32" height="32" style="vertical-align: middle;"> voidraft
|
||||||
|
|
||||||
[中文](README_ZH.md) | **English**
|
[中文](README_ZH.md) | **English**
|
||||||
|
|
||||||
> *An elegant text snippet recording tool designed for developers.*
|
> *An elegant text snippet recording tool designed for developers.*
|
||||||
|
|
||||||
VoidRaft is a modern developer-focused text editor that allows you to record, organize, and manage various text snippets anytime, anywhere. Whether it's temporary code snippets, API responses, meeting notes, or daily to-do lists, VoidRaft provides a smooth and elegant editing experience.
|
voidraft is a modern developer-focused text editor that allows you to record, organize, and manage various text snippets anytime, anywhere. Whether it's temporary code snippets, API responses, meeting notes, or daily to-do lists, voidraft provides a smooth and elegant editing experience.
|
||||||
|
|
||||||
## Core Features
|
## Core Features
|
||||||
|
|
||||||
@@ -14,6 +14,8 @@ VoidRaft is a modern developer-focused text editor that allows you to record, or
|
|||||||
- Smart language detection - Automatically recognizes code block language types
|
- Smart language detection - Automatically recognizes code block language types
|
||||||
- Code formatting - Built-in Prettier support for one-click code beautification
|
- Code formatting - Built-in Prettier support for one-click code beautification
|
||||||
- Block editing mode - Split content into independent code blocks, each with different language settings
|
- 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
|
### Modern Interface
|
||||||
|
|
||||||
@@ -53,6 +55,7 @@ cd voidraft
|
|||||||
# Install frontend dependencies
|
# Install frontend dependencies
|
||||||
cd frontend
|
cd frontend
|
||||||
npm install
|
npm install
|
||||||
|
npm run build
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Start development server
|
# Start development server
|
||||||
@@ -84,7 +87,7 @@ After building, the executable will be generated in the `bin` directory.
|
|||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
Voidraft/
|
voidraft/
|
||||||
├── frontend/ # Vue 3 frontend application
|
├── frontend/ # Vue 3 frontend application
|
||||||
│ ├── src/
|
│ ├── src/
|
||||||
│ │ ├── views/editor/ # Editor core views
|
│ │ ├── views/editor/ # Editor core views
|
||||||
@@ -116,24 +119,21 @@ Voidraft/
|
|||||||
| Linux | Planned | Future versions |
|
| Linux | Planned | Future versions |
|
||||||
|
|
||||||
### Planned Features
|
### Planned Features
|
||||||
- [ ] Custom themes - Customize editor themes
|
- ✅ Custom themes - Customize editor themes
|
||||||
- [ ] Multi-window support - Support editing multiple documents simultaneously
|
- ✅ Multi-window support - Support editing multiple documents simultaneously
|
||||||
|
- ✅ Data synchronization - Cloud backup for documents
|
||||||
- [ ] Enhanced clipboard - Monitor and manage clipboard history
|
- [ ] Enhanced clipboard - Monitor and manage clipboard history
|
||||||
- Automatic text content saving
|
|
||||||
- Image content support
|
|
||||||
- History management
|
|
||||||
- [ ] Data synchronization - Cloud backup for configurations and documents
|
|
||||||
- [ ] Extension system - Support for custom plugins
|
- [ ] Extension system - Support for custom plugins
|
||||||
|
|
||||||
## Acknowledgments
|
## Acknowledgments
|
||||||
|
|
||||||
> Standing on the shoulders of giants, paying tribute to the open source spirit
|
> Standing on the shoulders of giants, paying tribute to the open source spirit
|
||||||
|
|
||||||
The birth of VoidRaft is inseparable from the following excellent open source projects:
|
The birth of voidraft is inseparable from the following excellent open source projects:
|
||||||
|
|
||||||
### Special Thanks
|
### Special Thanks
|
||||||
|
|
||||||
- **[Heynote](https://github.com/heyman/heynote/)** - VoidRaft is a feature-enhanced version based on Heynote's concept
|
- **[Heynote](https://github.com/heyman/heynote/)** - voidraft is a feature-enhanced version based on Heynote's concept
|
||||||
- Inherits Heynote's elegant block editing philosophy
|
- Inherits Heynote's elegant block editing philosophy
|
||||||
- Adds more practical features on the original foundation
|
- Adds more practical features on the original foundation
|
||||||
- Rebuilt with modern technology stack
|
- Rebuilt with modern technology stack
|
||||||
@@ -157,7 +157,7 @@ This project is open source under the [MIT License](LICENSE).
|
|||||||
Welcome to Fork, Star, and contribute code.
|
Welcome to Fork, Star, and contribute code.
|
||||||
|
|
||||||
[](https://opensource.org/licenses/MIT)
|
[](https://opensource.org/licenses/MIT)
|
||||||
[](https://github.com/yourusername/Voidraft)
|
[](https://github.com/yourusername/voidraft)
|
||||||
[](https://github.com/yourusername/Voidraft)
|
[](https://github.com/yourusername/voidraft)
|
||||||
|
|
||||||
*Made with ❤️ by landaiqing*
|
*Made with ❤️ by landaiqing*
|
||||||
26
README_ZH.md
@@ -1,10 +1,10 @@
|
|||||||
# <img src="./frontend/public/appicon.png" alt="Voidraft Logo" width="32" height="32" style="vertical-align: middle;"> Voidraft
|
# <img src="./frontend/public/appicon.png" alt="voidraft Logo" width="32" height="32" style="vertical-align: middle;"> voidraft
|
||||||
|
|
||||||
**中文** | [English](README.md)
|
**中文** | [English](README.md)
|
||||||
|
|
||||||
> *一个专为开发者打造的优雅文本片段记录工具。*
|
> *一个专为开发者打造的优雅文本片段记录工具。*
|
||||||
|
|
||||||
Voidraft 是一个现代化的开发者专用文本编辑器,让你能够随时随地记录、整理和管理各种文本片段。无论是临时的代码片段、API 响应、会议笔记,还是日常的待办事项,Voidraft 都能为你提供流畅而优雅的编辑体验。
|
voidraft 是一个现代化的开发者专用文本编辑器,让你能够随时随地记录、整理和管理各种文本片段。无论是临时的代码片段、API 响应、会议笔记,还是日常的待办事项,voidraft 都能为你提供流畅而优雅的编辑体验。
|
||||||
|
|
||||||
## 核心特性
|
## 核心特性
|
||||||
|
|
||||||
@@ -14,6 +14,8 @@ Voidraft 是一个现代化的开发者专用文本编辑器,让你能够随
|
|||||||
- 智能语言检测 - 自动识别代码块语言类型
|
- 智能语言检测 - 自动识别代码块语言类型
|
||||||
- 代码格式化 - 内置 Prettier 支持,一键美化代码
|
- 代码格式化 - 内置 Prettier 支持,一键美化代码
|
||||||
- 块状编辑模式 - 将内容分割为独立的代码块,每个块可设置不同语言
|
- 块状编辑模式 - 将内容分割为独立的代码块,每个块可设置不同语言
|
||||||
|
- 支持多窗口 - 同时编辑多个文档
|
||||||
|
- 支持自定义主题 - 自定义编辑器主题
|
||||||
|
|
||||||
### 现代化界面
|
### 现代化界面
|
||||||
|
|
||||||
@@ -54,6 +56,7 @@ cd voidraft
|
|||||||
# 安装前端依赖
|
# 安装前端依赖
|
||||||
cd frontend
|
cd frontend
|
||||||
npm install
|
npm install
|
||||||
|
npm run build
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# 启动开发服务器
|
# 启动开发服务器
|
||||||
@@ -85,7 +88,7 @@ wails3 package
|
|||||||
## 项目结构
|
## 项目结构
|
||||||
|
|
||||||
```
|
```
|
||||||
Voidraft/
|
voidraft/
|
||||||
├── frontend/ # Vue 3 前端应用
|
├── frontend/ # Vue 3 前端应用
|
||||||
│ ├── src/
|
│ ├── src/
|
||||||
│ │ ├── views/editor/ # 编辑器核心视图
|
│ │ ├── views/editor/ # 编辑器核心视图
|
||||||
@@ -117,13 +120,10 @@ Voidraft/
|
|||||||
| Linux | 计划中 | 后续版本 |
|
| Linux | 计划中 | 后续版本 |
|
||||||
|
|
||||||
### 计划添加的功能
|
### 计划添加的功能
|
||||||
- [ ] 自定义主题 - 自定义编辑器主题
|
- ✅ 自定义主题 - 自定义编辑器主题
|
||||||
- [ ] 多窗口支持 - 支持同时编辑多个文档
|
- ✅ 多窗口支持 - 支持同时编辑多个文档
|
||||||
|
- ✅ 数据同步 - 文档云端备份
|
||||||
- [ ] 剪切板增强 - 监听和管理剪切板历史
|
- [ ] 剪切板增强 - 监听和管理剪切板历史
|
||||||
- 文本内容自动保存
|
|
||||||
- 图片内容支持
|
|
||||||
- 历史记录管理
|
|
||||||
- [ ] 数据同步 - 配置和文档云端备份
|
|
||||||
- [ ] 扩展系统 - 支持自定义插件
|
- [ ] 扩展系统 - 支持自定义插件
|
||||||
|
|
||||||
|
|
||||||
@@ -131,11 +131,11 @@ Voidraft/
|
|||||||
|
|
||||||
> 站在巨人的肩膀上,致敬开源精神
|
> 站在巨人的肩膀上,致敬开源精神
|
||||||
|
|
||||||
Voidraft 的诞生离不开以下优秀的开源项目:
|
voidraft 的诞生离不开以下优秀的开源项目:
|
||||||
|
|
||||||
### 特别感谢
|
### 特别感谢
|
||||||
|
|
||||||
- **[Heynote](https://github.com/heyman/heynote/)** - Voidraft 是基于 Heynote 概念的功能增强版本
|
- **[Heynote](https://github.com/heyman/heynote/)** - voidraft 是基于 Heynote 概念的功能增强版本
|
||||||
- 继承了 Heynote 优雅的块状编辑理念
|
- 继承了 Heynote 优雅的块状编辑理念
|
||||||
- 在原有基础上增加了更多实用功能
|
- 在原有基础上增加了更多实用功能
|
||||||
- 采用现代化技术栈重新构建
|
- 采用现代化技术栈重新构建
|
||||||
@@ -159,7 +159,7 @@ Voidraft 的诞生离不开以下优秀的开源项目:
|
|||||||
欢迎 Fork、Star 和贡献代码。
|
欢迎 Fork、Star 和贡献代码。
|
||||||
|
|
||||||
[](https://opensource.org/licenses/MIT)
|
[](https://opensource.org/licenses/MIT)
|
||||||
[](https://github.com/yourusername/Voidraft)
|
[](https://github.com/yourusername/voidraft)
|
||||||
[](https://github.com/yourusername/Voidraft)
|
[](https://github.com/yourusername/voidraft)
|
||||||
|
|
||||||
*Made with ❤️ by landaiqing*
|
*Made with ❤️ by landaiqing*
|
||||||
|
|||||||
293
build/COMMANDS.md
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
# Wails 3 命令参考表
|
||||||
|
|
||||||
|
本文档列出了 Voidraft 项目中使用的所有 Wails 3 命令和参数。
|
||||||
|
|
||||||
|
## 📋 命令总览
|
||||||
|
|
||||||
|
| 类别 | 命令 | 用途 |
|
||||||
|
|------|------|------|
|
||||||
|
| 生成工具 | `wails3 generate` | 生成项目所需的各种资源文件 |
|
||||||
|
| 打包工具 | `wails3 tool package` | 使用 nfpm 打包应用程序 |
|
||||||
|
| 任务执行 | `wails3 task` | 执行 Taskfile.yml 中定义的任务 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 详细命令参数
|
||||||
|
|
||||||
|
### 1. `wails3 generate bindings`
|
||||||
|
**生成 TypeScript 绑定文件**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-f` | 构建标志 | `''` (空字符串) |
|
||||||
|
| `-clean` | 清理旧绑定 | `true` |
|
||||||
|
| `-ts` | 生成 TypeScript | 无需值 |
|
||||||
|
|
||||||
|
**使用位置:** `build/Taskfile.yml:53`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 generate bindings -f '' -clean=true -ts
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2. `wails3 generate icons`
|
||||||
|
**从单个图片生成多平台图标**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-input` | 输入图片路径 | `appicon.png` |
|
||||||
|
| `-macfilename` | macOS 图标输出路径 | `darwin/icons.icns` |
|
||||||
|
| `-windowsfilename` | Windows 图标输出路径 | `windows/icons.ico` |
|
||||||
|
|
||||||
|
**使用位置:** `build/Taskfile.yml:64`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 generate icons \
|
||||||
|
-input appicon.png \
|
||||||
|
-macfilename darwin/icons.icns \
|
||||||
|
-windowsfilename windows/icons.ico
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 3. `wails3 generate syso`
|
||||||
|
**生成 Windows .syso 资源文件**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-arch` | 目标架构 | `amd64` / `arm64` |
|
||||||
|
| `-icon` | 图标文件 | `windows/icon.ico` |
|
||||||
|
| `-manifest` | 清单文件 | `windows/wails.exe.manifest` |
|
||||||
|
| `-info` | 应用信息 JSON | `windows/info.json` |
|
||||||
|
| `-out` | 输出文件路径 | `../wails_windows_amd64.syso` |
|
||||||
|
|
||||||
|
**使用位置:** `build/windows/Taskfile.yml:42`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 generate syso \
|
||||||
|
-arch amd64 \
|
||||||
|
-icon windows/icon.ico \
|
||||||
|
-manifest windows/wails.exe.manifest \
|
||||||
|
-info windows/info.json \
|
||||||
|
-out ../wails_windows_amd64.syso
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4. `wails3 generate webview2bootstrapper`
|
||||||
|
**生成 Windows WebView2 引导程序**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-dir` | 输出目录 | `build/windows/nsis` |
|
||||||
|
|
||||||
|
**使用位置:** `build/windows/Taskfile.yml:55`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 generate webview2bootstrapper -dir "build/windows/nsis"
|
||||||
|
```
|
||||||
|
|
||||||
|
**说明:** 下载 Microsoft Edge WebView2 运行时安装程序,用于 NSIS 打包。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 5. `wails3 generate .desktop`
|
||||||
|
**生成 Linux .desktop 桌面文件**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-name` | 应用名称 | `voidraft` |
|
||||||
|
| `-exec` | 可执行文件名 | `voidraft` |
|
||||||
|
| `-icon` | 图标名称 | `appicon` |
|
||||||
|
| `-outputfile` | 输出文件路径 | `build/linux/voidraft.desktop` |
|
||||||
|
| `-categories` | 应用分类 | `Development;` |
|
||||||
|
|
||||||
|
**使用位置:** `build/linux/Taskfile.yml:107`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 generate .desktop \
|
||||||
|
-name "voidraft" \
|
||||||
|
-exec "voidraft" \
|
||||||
|
-icon "appicon" \
|
||||||
|
-outputfile build/linux/voidraft.desktop \
|
||||||
|
-categories "Development;"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 6. `wails3 generate appimage`
|
||||||
|
**生成 Linux AppImage 包**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-binary` | 二进制文件名 | `voidraft` |
|
||||||
|
| `-icon` | 图标文件路径 | `../../appicon.png` |
|
||||||
|
| `-desktopfile` | .desktop 文件路径 | `../voidraft.desktop` |
|
||||||
|
| `-outputdir` | 输出目录 | `../../../bin` |
|
||||||
|
| `-builddir` | 构建临时目录 | `build/linux/appimage/build` |
|
||||||
|
|
||||||
|
**使用位置:** `build/linux/Taskfile.yml:49`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 generate appimage \
|
||||||
|
-binary voidraft \
|
||||||
|
-icon ../../appicon.png \
|
||||||
|
-desktopfile ../voidraft.desktop \
|
||||||
|
-outputdir ../../../bin \
|
||||||
|
-builddir build/linux/appimage/build
|
||||||
|
```
|
||||||
|
|
||||||
|
**说明:** 自动下载 linuxdeploy 工具并创建 AppImage。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 7. `wails3 tool package` (deb)
|
||||||
|
**创建 Debian/Ubuntu .deb 包**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-name` | 包名称 | `voidraft` |
|
||||||
|
| `-format` | 包格式 | `deb` |
|
||||||
|
| `-config` | nfpm 配置文件 | `./build/linux/nfpm/nfpm.yaml` |
|
||||||
|
| `-out` | 输出目录 | `./bin` |
|
||||||
|
|
||||||
|
**使用位置:** `build/linux/Taskfile.yml:90`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 tool package \
|
||||||
|
-name voidraft \
|
||||||
|
-format deb \
|
||||||
|
-config ./build/linux/nfpm/nfpm.yaml \
|
||||||
|
-out ./bin
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 8. `wails3 tool package` (rpm)
|
||||||
|
**创建 RedHat/CentOS/Fedora .rpm 包**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-name` | 包名称 | `voidraft` |
|
||||||
|
| `-format` | 包格式 | `rpm` |
|
||||||
|
| `-config` | nfpm 配置文件 | `./build/linux/nfpm/nfpm.yaml` |
|
||||||
|
| `-out` | 输出目录 | `./bin` |
|
||||||
|
|
||||||
|
**使用位置:** `build/linux/Taskfile.yml:95`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 tool package \
|
||||||
|
-name voidraft \
|
||||||
|
-format rpm \
|
||||||
|
-config ./build/linux/nfpm/nfpm.yaml \
|
||||||
|
-out ./bin
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 9. `wails3 tool package` (archlinux)
|
||||||
|
**创建 Arch Linux .pkg.tar.zst 包**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `-name` | 包名称 | `voidraft` |
|
||||||
|
| `-format` | 包格式 | `archlinux` |
|
||||||
|
| `-config` | nfpm 配置文件 | `./build/linux/nfpm/nfpm.yaml` |
|
||||||
|
| `-out` | 输出目录 | `./bin` |
|
||||||
|
|
||||||
|
**使用位置:** `build/linux/Taskfile.yml:100`
|
||||||
|
|
||||||
|
**完整命令:**
|
||||||
|
```bash
|
||||||
|
wails3 tool package \
|
||||||
|
-name voidraft \
|
||||||
|
-format archlinux \
|
||||||
|
-config ./build/linux/nfpm/nfpm.yaml \
|
||||||
|
-out ./bin
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 10. `wails3 task`
|
||||||
|
**执行 Taskfile.yml 中定义的任务**
|
||||||
|
|
||||||
|
| 参数 | 说明 | 示例值 |
|
||||||
|
|------|------|--------|
|
||||||
|
| `[taskname]` | 任务名称 | `build`, `package`, `run` |
|
||||||
|
| `[VAR=value]` | 变量赋值 | `PRODUCTION=true`, `ARCH=amd64` |
|
||||||
|
|
||||||
|
**常用任务:**
|
||||||
|
|
||||||
|
| 任务 | 说明 | 命令 |
|
||||||
|
|------|------|------|
|
||||||
|
| `build` | 构建应用 | `wails3 task build PRODUCTION=true` |
|
||||||
|
| `package` | 打包应用 | `wails3 task package` |
|
||||||
|
| `run` | 运行应用 | `wails3 task run` |
|
||||||
|
|
||||||
|
**使用位置:** `build/config.yml`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 平台对应命令表
|
||||||
|
|
||||||
|
| 平台 | 主要命令 | 产物 |
|
||||||
|
|------|----------|------|
|
||||||
|
| **Windows** | `generate syso`<br>`generate webview2bootstrapper` | `.syso` 资源文件<br>NSIS 安装程序 |
|
||||||
|
| **Linux** | `generate .desktop`<br>`generate appimage`<br>`tool package -format deb/rpm/archlinux` | `.desktop` 文件<br>`.AppImage`<br>`.deb` / `.rpm` / `.pkg.tar.zst` |
|
||||||
|
| **macOS** | `generate icons` | `.icns` 图标<br>`.app` 应用包 |
|
||||||
|
| **通用** | `generate bindings`<br>`generate icons` | TypeScript 绑定<br>多平台图标 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 快速参考
|
||||||
|
|
||||||
|
### 完整构建流程
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. 生成绑定和图标
|
||||||
|
wails3 task common:generate:bindings
|
||||||
|
wails3 task common:generate:icons
|
||||||
|
|
||||||
|
# 2. 构建前端
|
||||||
|
cd frontend
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# 3. 构建应用(各平台)
|
||||||
|
cd build/windows && wails3 task build PRODUCTION=true # Windows
|
||||||
|
cd build/linux && wails3 task build PRODUCTION=true # Linux
|
||||||
|
cd build/darwin && wails3 task build PRODUCTION=true # macOS
|
||||||
|
|
||||||
|
# 4. 打包应用(各平台)
|
||||||
|
cd build/windows && wails3 task package # NSIS 安装程序
|
||||||
|
cd build/linux && wails3 task package # AppImage + deb + rpm + archlinux
|
||||||
|
cd build/darwin && wails3 task package # .app bundle
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📝 注意事项
|
||||||
|
|
||||||
|
1. **变量传递:** Task 命令支持通过 `VAR=value` 格式传递变量
|
||||||
|
2. **路径问题:** 相对路径基于 Taskfile.yml 所在目录
|
||||||
|
3. **依赖顺序:** 某些任务有依赖关系(通过 `deps:` 定义)
|
||||||
|
4. **环境变量:** 使用 `env:` 定义的环境变量会自动设置
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔗 相关文档
|
||||||
|
|
||||||
|
- [Wails 3 官方文档](https://v3alpha.wails.io/)
|
||||||
|
- [Taskfile 语法](https://taskfile.dev/)
|
||||||
|
- [nfpm 打包工具](https://nfpm.goreleaser.com/)
|
||||||
|
|
||||||
@@ -5,12 +5,12 @@ version: '3'
|
|||||||
|
|
||||||
# This information is used to generate the build assets.
|
# This information is used to generate the build assets.
|
||||||
info:
|
info:
|
||||||
companyName: "Voidraft" # The name of the company
|
companyName: "voidraft" # The name of the company
|
||||||
productName: "Voidraft" # The name of the application
|
productName: "voidraft" # The name of the application
|
||||||
productIdentifier: "landaiqing" # The unique product identifier
|
productIdentifier: "landaiqing" # The unique product identifier
|
||||||
description: "Voidraft" # The application description
|
description: "voidraft" # The application description
|
||||||
copyright: "© 2025 Voidraft. All rights reserved." # Copyright text
|
copyright: "© 2025 voidraft. All rights reserved." # Copyright text
|
||||||
comments: "Voidraft" # Comments
|
comments: "voidraft" # Comments
|
||||||
version: "0.0.1.0" # The application version
|
version: "0.0.1.0" # The application version
|
||||||
|
|
||||||
# Dev mode configuration
|
# Dev mode configuration
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>Voidraft</string>
|
<string>voidraft</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>Voidraft</string>
|
<string>voidraft</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>landaiqing</string>
|
<string>landaiqing</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0.0.1.0</string>
|
<string>0.0.1.0</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>Voidraft</string>
|
<string>voidraft</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.0.1.0</string>
|
<string>0.0.1.0</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
<string>true</string>
|
<string>true</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>© 2025 Voidraft. All rights reserved.</string>
|
<string>© 2025 voidraft. All rights reserved.</string>
|
||||||
<key>NSAppTransportSecurity</key>
|
<key>NSAppTransportSecurity</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSAllowsLocalNetworking</key>
|
<key>NSAllowsLocalNetworking</key>
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>Voidraft</string>
|
<string>voidraft</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>Voidraft</string>
|
<string>voidraft</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>landaiqing</string>
|
<string>landaiqing</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0.0.1.0</string>
|
<string>0.0.1.0</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>Voidraft</string>
|
<string>voidraft</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.0.1.0</string>
|
<string>0.0.1.0</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
@@ -22,6 +22,6 @@
|
|||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
<string>true</string>
|
<string>true</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>© 2025 Voidraft. All rights reserved.</string>
|
<string>© 2025 voidraft. All rights reserved.</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -11,9 +11,12 @@ tasks:
|
|||||||
- task: common:build:frontend
|
- task: common:build:frontend
|
||||||
- task: common:generate:icons
|
- task: common:generate:icons
|
||||||
cmds:
|
cmds:
|
||||||
- go build {{.BUILD_FLAGS}} -o {{.OUTPUT}}
|
- go build {{.BUILD_FLAGS}} -ldflags="{{.LDFLAGS}} {{.VERSION_FLAGS}}" -o {{.OUTPUT}}
|
||||||
vars:
|
vars:
|
||||||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false -ldflags="-w -s"{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
||||||
|
LDFLAGS: '{{if eq .PRODUCTION "true"}}-w -s{{else}}{{end}}'
|
||||||
|
VERSION_FLAGS:
|
||||||
|
sh: 'grep "VERSION=" version.txt | cut -d"=" -f2 | xargs -I {} echo "-X voidraft/internal/version.Version={}"'
|
||||||
DEFAULT_OUTPUT: '{{.BIN_DIR}}/{{.APP_NAME}}'
|
DEFAULT_OUTPUT: '{{.BIN_DIR}}/{{.APP_NAME}}'
|
||||||
OUTPUT: '{{ .OUTPUT | default .DEFAULT_OUTPUT }}'
|
OUTPUT: '{{ .OUTPUT | default .DEFAULT_OUTPUT }}'
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -11,9 +11,12 @@ tasks:
|
|||||||
- task: common:build:frontend
|
- task: common:build:frontend
|
||||||
- task: common:generate:icons
|
- task: common:generate:icons
|
||||||
cmds:
|
cmds:
|
||||||
- go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}
|
- go build {{.BUILD_FLAGS}} -ldflags="{{.LDFLAGS}} {{.VERSION_FLAGS}}" -o {{.BIN_DIR}}/{{.APP_NAME}}
|
||||||
vars:
|
vars:
|
||||||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false -ldflags="-w -s"{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
||||||
|
LDFLAGS: '{{if eq .PRODUCTION "true"}}-w -s{{else}}{{end}}'
|
||||||
|
VERSION_FLAGS:
|
||||||
|
sh: 'grep "VERSION=" version.txt | cut -d"=" -f2 | xargs -I {} echo "-X voidraft/internal/version.Version={}"'
|
||||||
env:
|
env:
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
CGO_ENABLED: 1
|
CGO_ENABLED: 1
|
||||||
|
|||||||
@@ -3,26 +3,26 @@
|
|||||||
#
|
#
|
||||||
# The lines below are called `modelines`. See `:help modeline`
|
# The lines below are called `modelines`. See `:help modeline`
|
||||||
|
|
||||||
name: "Voidraft"
|
name: "voidraft"
|
||||||
arch: ${GOARCH}
|
arch: ${GOARCH}
|
||||||
platform: "linux"
|
platform: "linux"
|
||||||
version: "0.0.1.0"
|
version: "0.0.1.0"
|
||||||
section: "default"
|
section: "default"
|
||||||
priority: "extra"
|
priority: "extra"
|
||||||
maintainer: ${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}>
|
maintainer: ${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}>
|
||||||
description: "Voidraft"
|
description: "voidraft"
|
||||||
vendor: "Voidraft"
|
vendor: "voidraft"
|
||||||
homepage: "https://wails.io"
|
homepage: "https://voidraft.landaiqing.cn"
|
||||||
license: "MIT"
|
license: "MIT"
|
||||||
release: "1"
|
release: "1"
|
||||||
|
|
||||||
contents:
|
contents:
|
||||||
- src: "./bin/Voidraft"
|
- src: "./bin/voidraft"
|
||||||
dst: "/usr/local/bin/Voidraft"
|
dst: "/usr/local/bin/voidraft"
|
||||||
- src: "./build/appicon.png"
|
- src: "./build/appicon.png"
|
||||||
dst: "/usr/share/icons/hicolor/128x128/apps/Voidraft.png"
|
dst: "/usr/share/icons/hicolor/128x128/apps/voidraft.png"
|
||||||
- src: "./build/linux/Voidraft.desktop"
|
- src: "./build/linux/voidraft.desktop"
|
||||||
dst: "/usr/share/applications/Voidraft.desktop"
|
dst: "/usr/share/applications/voidraft.desktop"
|
||||||
|
|
||||||
depends:
|
depends:
|
||||||
- gtk3
|
- gtk3
|
||||||
|
|||||||
@@ -14,13 +14,16 @@ tasks:
|
|||||||
- task: common:generate:icons
|
- task: common:generate:icons
|
||||||
cmds:
|
cmds:
|
||||||
- task: generate:syso
|
- task: generate:syso
|
||||||
- go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}.exe
|
- go build {{.BUILD_FLAGS}} -ldflags="{{.LDFLAGS}} {{.VERSION_FLAGS}}" -o {{.BIN_DIR}}/{{.APP_NAME}}.exe
|
||||||
- cmd: powershell Remove-item *.syso
|
- cmd: powershell Remove-item *.syso
|
||||||
platforms: [windows]
|
platforms: [windows]
|
||||||
- cmd: rm -f *.syso
|
- cmd: rm -f *.syso
|
||||||
platforms: [linux, darwin]
|
platforms: [linux, darwin]
|
||||||
vars:
|
vars:
|
||||||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false -ldflags="-w -s -H windowsgui"{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
||||||
|
LDFLAGS: '{{if eq .PRODUCTION "true"}}-w -s -H windowsgui{{else}}{{end}}'
|
||||||
|
VERSION_FLAGS:
|
||||||
|
sh: 'powershell -Command "(Get-Content version.txt) -replace ''VERSION='', ''-X voidraft/internal/version.Version=''"'
|
||||||
env:
|
env:
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
CGO_ENABLED: 1
|
CGO_ENABLED: 1
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
"info": {
|
"info": {
|
||||||
"0000": {
|
"0000": {
|
||||||
"ProductVersion": "0.0.1.0",
|
"ProductVersion": "0.0.1.0",
|
||||||
"CompanyName": "Voidraft",
|
"CompanyName": "voidraft",
|
||||||
"FileDescription": "Voidraft",
|
"FileDescription": "voidraft",
|
||||||
"LegalCopyright": "© 2025 Voidraft. All rights reserved.",
|
"LegalCopyright": "© 2025 voidraft. All rights reserved.",
|
||||||
"ProductName": "Voidraft",
|
"ProductName": "voidraft",
|
||||||
"Comments": "Voidraft"
|
"Comments": "voidraft"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,19 +5,19 @@
|
|||||||
!include "FileFunc.nsh"
|
!include "FileFunc.nsh"
|
||||||
|
|
||||||
!ifndef INFO_PROJECTNAME
|
!ifndef INFO_PROJECTNAME
|
||||||
!define INFO_PROJECTNAME "Voidraft"
|
!define INFO_PROJECTNAME "voidraft"
|
||||||
!endif
|
!endif
|
||||||
!ifndef INFO_COMPANYNAME
|
!ifndef INFO_COMPANYNAME
|
||||||
!define INFO_COMPANYNAME "Voidraft"
|
!define INFO_COMPANYNAME "voidraft"
|
||||||
!endif
|
!endif
|
||||||
!ifndef INFO_PRODUCTNAME
|
!ifndef INFO_PRODUCTNAME
|
||||||
!define INFO_PRODUCTNAME "Voidraft"
|
!define INFO_PRODUCTNAME "voidraft"
|
||||||
!endif
|
!endif
|
||||||
!ifndef INFO_PRODUCTVERSION
|
!ifndef INFO_PRODUCTVERSION
|
||||||
!define INFO_PRODUCTVERSION "0.0.1.0"
|
!define INFO_PRODUCTVERSION "0.0.1.0"
|
||||||
!endif
|
!endif
|
||||||
!ifndef INFO_COPYRIGHT
|
!ifndef INFO_COPYRIGHT
|
||||||
!define INFO_COPYRIGHT "© 2025 Voidraft. All rights reserved."
|
!define INFO_COPYRIGHT "© 2025 voidraft. All rights reserved."
|
||||||
!endif
|
!endif
|
||||||
!ifndef PRODUCT_EXECUTABLE
|
!ifndef PRODUCT_EXECUTABLE
|
||||||
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
|
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
// 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 {Create as $Create} from "@wailsio/runtime";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DB is a database handle representing a pool of zero or more
|
|
||||||
* underlying connections. It's safe for concurrent use by multiple
|
|
||||||
* goroutines.
|
|
||||||
*
|
|
||||||
* The sql package creates and frees connections automatically; it
|
|
||||||
* also maintains a free pool of idle connections. If the database has
|
|
||||||
* a concept of per-connection state, such state can be reliably observed
|
|
||||||
* within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the
|
|
||||||
* returned [Tx] is bound to a single connection. Once [Tx.Commit] or
|
|
||||||
* [Tx.Rollback] is called on the transaction, that transaction's
|
|
||||||
* connection is returned to [DB]'s idle connection pool. The pool size
|
|
||||||
* can be controlled with [DB.SetMaxIdleConns].
|
|
||||||
*/
|
|
||||||
export class DB {
|
|
||||||
|
|
||||||
/** Creates a new DB instance. */
|
|
||||||
constructor($$source: Partial<DB> = {}) {
|
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new DB instance from a string or object.
|
|
||||||
*/
|
|
||||||
static createFrom($$source: any = {}): DB {
|
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
|
||||||
return new DB($$parsedSource as Partial<DB>);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,82 +5,61 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Create as $Create} from "@wailsio/runtime";
|
import {Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
/**
|
||||||
// @ts-ignore: Unused imports
|
* ServiceOptions provides optional parameters for calls to [NewService].
|
||||||
import * as slog$0 from "../../../../../../log/slog/models.js";
|
*/
|
||||||
|
export class ServiceOptions {
|
||||||
export class App {
|
|
||||||
/**
|
/**
|
||||||
* The main application menu
|
* Name can be set to override the name of the service
|
||||||
|
* for logging and debugging purposes.
|
||||||
|
*
|
||||||
|
* If empty, it will default
|
||||||
|
* either to the value obtained through the [ServiceName] interface,
|
||||||
|
* or to the type name.
|
||||||
*/
|
*/
|
||||||
"ApplicationMenu": Menu | null;
|
"Name": string;
|
||||||
"Logger": slog$0.Logger | null;
|
|
||||||
|
|
||||||
/** Creates a new App instance. */
|
/**
|
||||||
constructor($$source: Partial<App> = {}) {
|
* If the service instance implements [http.Handler],
|
||||||
if (!("ApplicationMenu" in $$source)) {
|
* it will be mounted on the internal asset server
|
||||||
this["ApplicationMenu"] = null;
|
* at the prefix specified by Route.
|
||||||
|
*/
|
||||||
|
"Route": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MarshalError will be called if non-nil
|
||||||
|
* to marshal to JSON the error values returned by this service's methods.
|
||||||
|
*
|
||||||
|
* MarshalError is not allowed to fail,
|
||||||
|
* but it may return a nil slice to fall back
|
||||||
|
* to the globally configured error handler.
|
||||||
|
*
|
||||||
|
* If the returned slice is not nil, it must contain valid JSON.
|
||||||
|
*/
|
||||||
|
"MarshalError": any;
|
||||||
|
|
||||||
|
/** Creates a new ServiceOptions instance. */
|
||||||
|
constructor($$source: Partial<ServiceOptions> = {}) {
|
||||||
|
if (!("Name" in $$source)) {
|
||||||
|
this["Name"] = "";
|
||||||
}
|
}
|
||||||
if (!("Logger" in $$source)) {
|
if (!("Route" in $$source)) {
|
||||||
this["Logger"] = null;
|
this["Route"] = "";
|
||||||
|
}
|
||||||
|
if (!("MarshalError" in $$source)) {
|
||||||
|
this["MarshalError"] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
Object.assign(this, $$source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new App instance from a string or object.
|
* Creates a new ServiceOptions instance from a string or object.
|
||||||
*/
|
*/
|
||||||
static createFrom($$source: any = {}): App {
|
static createFrom($$source: any = {}): ServiceOptions {
|
||||||
const $$createField0_0 = $$createType1;
|
|
||||||
const $$createField1_0 = $$createType3;
|
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
if ("ApplicationMenu" in $$parsedSource) {
|
return new ServiceOptions($$parsedSource as Partial<ServiceOptions>);
|
||||||
$$parsedSource["ApplicationMenu"] = $$createField0_0($$parsedSource["ApplicationMenu"]);
|
|
||||||
}
|
|
||||||
if ("Logger" in $$parsedSource) {
|
|
||||||
$$parsedSource["Logger"] = $$createField1_0($$parsedSource["Logger"]);
|
|
||||||
}
|
|
||||||
return new App($$parsedSource as Partial<App>);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Menu {
|
export type Window = any;
|
||||||
|
|
||||||
/** Creates a new Menu instance. */
|
|
||||||
constructor($$source: Partial<Menu> = {}) {
|
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new Menu instance from a string or object.
|
|
||||||
*/
|
|
||||||
static createFrom($$source: any = {}): Menu {
|
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
|
||||||
return new Menu($$parsedSource as Partial<Menu>);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class WebviewWindow {
|
|
||||||
|
|
||||||
/** Creates a new WebviewWindow instance. */
|
|
||||||
constructor($$source: Partial<WebviewWindow> = {}) {
|
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new WebviewWindow instance from a string or object.
|
|
||||||
*/
|
|
||||||
static createFrom($$source: any = {}): WebviewWindow {
|
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
|
||||||
return new WebviewWindow($$parsedSource as Partial<WebviewWindow>);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Private type creation functions
|
|
||||||
const $$createType0 = Menu.createFrom;
|
|
||||||
const $$createType1 = $Create.Nullable($$createType0);
|
|
||||||
const $$createType2 = slog$0.Logger.createFrom;
|
|
||||||
const $$createType3 = $Create.Nullable($$createType2);
|
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service represents the dock service
|
||||||
|
* @module
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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 application$0 from "../../application/models.js";
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore: Unused imports
|
||||||
|
import * as $models from "./models.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HideAppIcon hides the app icon in the dock/taskbar.
|
||||||
|
*/
|
||||||
|
export function HideAppIcon(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3413658144) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RemoveBadge removes the badge label from the application icon.
|
||||||
|
*/
|
||||||
|
export function RemoveBadge(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2752757297) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceName returns the name of the service.
|
||||||
|
*/
|
||||||
|
export function ServiceName(): Promise<string> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2949906614) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceShutdown is called when the service is unloaded.
|
||||||
|
*/
|
||||||
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(307064411) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup is called when the service is loaded.
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1350118426, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SetBadge sets the badge label on the application icon.
|
||||||
|
*/
|
||||||
|
export function SetBadge(label: string): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1717705661, label) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SetCustomBadge sets the badge label on the application icon with custom options.
|
||||||
|
*/
|
||||||
|
export function SetCustomBadge(label: string, options: $models.BadgeOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2730169760, label, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ShowAppIcon shows the app icon in the dock/taskbar.
|
||||||
|
*/
|
||||||
|
export function ShowAppIcon(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3409697379) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
import * as DockService from "./dockservice.js";
|
||||||
|
export {
|
||||||
|
DockService
|
||||||
|
};
|
||||||
|
|
||||||
|
export * from "./models.js";
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
// 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 {Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore: Unused imports
|
||||||
|
import * as color$0 from "../../../../../../../image/color/models.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BadgeOptions represents options for customizing badge appearance
|
||||||
|
*/
|
||||||
|
export class BadgeOptions {
|
||||||
|
"TextColour": color$0.RGBA;
|
||||||
|
"BackgroundColour": color$0.RGBA;
|
||||||
|
"FontName": string;
|
||||||
|
"FontSize": number;
|
||||||
|
"SmallFontSize": number;
|
||||||
|
|
||||||
|
/** Creates a new BadgeOptions instance. */
|
||||||
|
constructor($$source: Partial<BadgeOptions> = {}) {
|
||||||
|
if (!("TextColour" in $$source)) {
|
||||||
|
this["TextColour"] = (new color$0.RGBA());
|
||||||
|
}
|
||||||
|
if (!("BackgroundColour" in $$source)) {
|
||||||
|
this["BackgroundColour"] = (new color$0.RGBA());
|
||||||
|
}
|
||||||
|
if (!("FontName" in $$source)) {
|
||||||
|
this["FontName"] = "";
|
||||||
|
}
|
||||||
|
if (!("FontSize" in $$source)) {
|
||||||
|
this["FontSize"] = 0;
|
||||||
|
}
|
||||||
|
if (!("SmallFontSize" in $$source)) {
|
||||||
|
this["SmallFontSize"] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new BadgeOptions instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): BadgeOptions {
|
||||||
|
const $$createField0_0 = $$createType0;
|
||||||
|
const $$createField1_0 = $$createType0;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("TextColour" in $$parsedSource) {
|
||||||
|
$$parsedSource["TextColour"] = $$createField0_0($$parsedSource["TextColour"]);
|
||||||
|
}
|
||||||
|
if ("BackgroundColour" in $$parsedSource) {
|
||||||
|
$$parsedSource["BackgroundColour"] = $$createField1_0($$parsedSource["BackgroundColour"]);
|
||||||
|
}
|
||||||
|
return new BadgeOptions($$parsedSource as Partial<BadgeOptions>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private type creation functions
|
||||||
|
const $$createType0 = color$0.RGBA.createFrom;
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
import * as NotificationService from "./notificationservice.js";
|
||||||
|
export {
|
||||||
|
NotificationService
|
||||||
|
};
|
||||||
|
|
||||||
|
export * from "./models.js";
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
// 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 {Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NotificationAction represents an action button for a notification.
|
||||||
|
*/
|
||||||
|
export class NotificationAction {
|
||||||
|
"id"?: string;
|
||||||
|
"title"?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (macOS-specific)
|
||||||
|
*/
|
||||||
|
"destructive"?: boolean;
|
||||||
|
|
||||||
|
/** Creates a new NotificationAction instance. */
|
||||||
|
constructor($$source: Partial<NotificationAction> = {}) {
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new NotificationAction instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): NotificationAction {
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
return new NotificationAction($$parsedSource as Partial<NotificationAction>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NotificationCategory groups actions for notifications.
|
||||||
|
*/
|
||||||
|
export class NotificationCategory {
|
||||||
|
"id"?: string;
|
||||||
|
"actions"?: NotificationAction[];
|
||||||
|
"hasReplyField"?: boolean;
|
||||||
|
"replyPlaceholder"?: string;
|
||||||
|
"replyButtonTitle"?: string;
|
||||||
|
|
||||||
|
/** Creates a new NotificationCategory instance. */
|
||||||
|
constructor($$source: Partial<NotificationCategory> = {}) {
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new NotificationCategory instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): NotificationCategory {
|
||||||
|
const $$createField1_0 = $$createType1;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("actions" in $$parsedSource) {
|
||||||
|
$$parsedSource["actions"] = $$createField1_0($$parsedSource["actions"]);
|
||||||
|
}
|
||||||
|
return new NotificationCategory($$parsedSource as Partial<NotificationCategory>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NotificationOptions contains configuration for a notification
|
||||||
|
*/
|
||||||
|
export class NotificationOptions {
|
||||||
|
"id": string;
|
||||||
|
"title": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (macOS and Linux only)
|
||||||
|
*/
|
||||||
|
"subtitle"?: string;
|
||||||
|
"body"?: string;
|
||||||
|
"categoryId"?: string;
|
||||||
|
"data"?: { [_: string]: any };
|
||||||
|
|
||||||
|
/** Creates a new NotificationOptions instance. */
|
||||||
|
constructor($$source: Partial<NotificationOptions> = {}) {
|
||||||
|
if (!("id" in $$source)) {
|
||||||
|
this["id"] = "";
|
||||||
|
}
|
||||||
|
if (!("title" in $$source)) {
|
||||||
|
this["title"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new NotificationOptions instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): NotificationOptions {
|
||||||
|
const $$createField5_0 = $$createType2;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("data" in $$parsedSource) {
|
||||||
|
$$parsedSource["data"] = $$createField5_0($$parsedSource["data"]);
|
||||||
|
}
|
||||||
|
return new NotificationOptions($$parsedSource as Partial<NotificationOptions>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private type creation functions
|
||||||
|
const $$createType0 = NotificationAction.createFrom;
|
||||||
|
const $$createType1 = $Create.Array($$createType0);
|
||||||
|
const $$createType2 = $Create.Map($Create.Any, $Create.Any);
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service represents the notifications service
|
||||||
|
* @module
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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 application$0 from "../../application/models.js";
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore: Unused imports
|
||||||
|
import * as $models from "./models.js";
|
||||||
|
|
||||||
|
export function CheckNotificationAuthorization(): Promise<boolean> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2216952893) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OnNotificationResponse registers a callback function that will be called when
|
||||||
|
* a notification response is received from the user.
|
||||||
|
*/
|
||||||
|
export function OnNotificationResponse(callback: any): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1642697808, callback) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RegisterNotificationCategory(category: $models.NotificationCategory): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2917562919, category) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RemoveAllDeliveredNotifications(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3956282340) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RemoveAllPendingNotifications(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(108821341) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RemoveDeliveredNotification(identifier: string): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(975691940, identifier) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RemoveNotification(identifier: string): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3966653866, identifier) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RemoveNotificationCategory(categoryID: string): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2032615554, categoryID) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function RemovePendingNotification(identifier: string): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3729049703, identifier) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Public methods that delegate to the implementation.
|
||||||
|
*/
|
||||||
|
export function RequestNotificationAuthorization(): Promise<boolean> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3933442950) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SendNotification(options: $models.NotificationOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3968228732, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SendNotificationWithActions(options: $models.NotificationOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1886542847, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceName returns the name of the service.
|
||||||
|
*/
|
||||||
|
export function ServiceName(): Promise<string> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2704532675) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceShutdown is called when the service is unloaded.
|
||||||
|
*/
|
||||||
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2550195434) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup is called when the service is loaded.
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(4047820929, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
46
frontend/bindings/image/color/models.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
// 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 {Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RGBA represents a traditional 32-bit alpha-premultiplied color, having 8
|
||||||
|
* bits for each of red, green, blue and alpha.
|
||||||
|
*
|
||||||
|
* An alpha-premultiplied color component C has been scaled by alpha (A), so
|
||||||
|
* has valid values 0 <= C <= A.
|
||||||
|
*/
|
||||||
|
export class RGBA {
|
||||||
|
"R": number;
|
||||||
|
"G": number;
|
||||||
|
"B": number;
|
||||||
|
"A": number;
|
||||||
|
|
||||||
|
/** Creates a new RGBA instance. */
|
||||||
|
constructor($$source: Partial<RGBA> = {}) {
|
||||||
|
if (!("R" in $$source)) {
|
||||||
|
this["R"] = 0;
|
||||||
|
}
|
||||||
|
if (!("G" in $$source)) {
|
||||||
|
this["G"] = 0;
|
||||||
|
}
|
||||||
|
if (!("B" in $$source)) {
|
||||||
|
this["B"] = 0;
|
||||||
|
}
|
||||||
|
if (!("A" in $$source)) {
|
||||||
|
this["A"] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new RGBA instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): RGBA {
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
return new RGBA($$parsedSource as Partial<RGBA>);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
// 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 {Create as $Create} from "@wailsio/runtime";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Logger records structured information about each call to its
|
|
||||||
* Log, Debug, Info, Warn, and Error methods.
|
|
||||||
* For each call, it creates a [Record] and passes it to a [Handler].
|
|
||||||
*
|
|
||||||
* To create a new Logger, call [New] or a Logger method
|
|
||||||
* that begins "With".
|
|
||||||
*/
|
|
||||||
export class Logger {
|
|
||||||
|
|
||||||
/** Creates a new Logger instance. */
|
|
||||||
constructor($$source: Partial<Logger> = {}) {
|
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new Logger instance from a string or object.
|
|
||||||
*/
|
|
||||||
static createFrom($$source: any = {}): Logger {
|
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
|
||||||
return new Logger($$parsedSource as Partial<Logger>);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
14
frontend/bindings/net/http/models.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
// 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 {Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Header represents the key-value pairs in an HTTP header.
|
||||||
|
*
|
||||||
|
* The keys should be in canonical form, as returned by
|
||||||
|
* [CanonicalHeaderKey].
|
||||||
|
*/
|
||||||
|
export type Header = { [_: string]: string[] };
|
||||||
@@ -68,4 +68,9 @@ export enum TranslatorType {
|
|||||||
* DeeplTranslatorType DeepL翻译器
|
* DeeplTranslatorType DeepL翻译器
|
||||||
*/
|
*/
|
||||||
DeeplTranslatorType = "deepl",
|
DeeplTranslatorType = "deepl",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TartuNLPTranslatorType TartuNLP翻译器
|
||||||
|
*/
|
||||||
|
TartuNLPTranslatorType = "tartunlp",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,10 +5,6 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Create as $Create} from "@wailsio/runtime";
|
import {Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore: Unused imports
|
|
||||||
import * as time$0 from "../../../time/models.js";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AppConfig 应用配置 - 按照前端设置页面分类组织
|
* AppConfig 应用配置 - 按照前端设置页面分类组织
|
||||||
*/
|
*/
|
||||||
@@ -33,6 +29,11 @@ export class AppConfig {
|
|||||||
*/
|
*/
|
||||||
"updates": UpdatesConfig;
|
"updates": UpdatesConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Git备份设置
|
||||||
|
*/
|
||||||
|
"backup": GitBackupConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置元数据
|
* 配置元数据
|
||||||
*/
|
*/
|
||||||
@@ -52,6 +53,9 @@ export class AppConfig {
|
|||||||
if (!("updates" in $$source)) {
|
if (!("updates" in $$source)) {
|
||||||
this["updates"] = (new UpdatesConfig());
|
this["updates"] = (new UpdatesConfig());
|
||||||
}
|
}
|
||||||
|
if (!("backup" in $$source)) {
|
||||||
|
this["backup"] = (new GitBackupConfig());
|
||||||
|
}
|
||||||
if (!("metadata" in $$source)) {
|
if (!("metadata" in $$source)) {
|
||||||
this["metadata"] = (new ConfigMetadata());
|
this["metadata"] = (new ConfigMetadata());
|
||||||
}
|
}
|
||||||
@@ -68,6 +72,7 @@ export class AppConfig {
|
|||||||
const $$createField2_0 = $$createType2;
|
const $$createField2_0 = $$createType2;
|
||||||
const $$createField3_0 = $$createType3;
|
const $$createField3_0 = $$createType3;
|
||||||
const $$createField4_0 = $$createType4;
|
const $$createField4_0 = $$createType4;
|
||||||
|
const $$createField5_0 = $$createType5;
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
if ("general" in $$parsedSource) {
|
if ("general" in $$parsedSource) {
|
||||||
$$parsedSource["general"] = $$createField0_0($$parsedSource["general"]);
|
$$parsedSource["general"] = $$createField0_0($$parsedSource["general"]);
|
||||||
@@ -81,8 +86,11 @@ export class AppConfig {
|
|||||||
if ("updates" in $$parsedSource) {
|
if ("updates" in $$parsedSource) {
|
||||||
$$parsedSource["updates"] = $$createField3_0($$parsedSource["updates"]);
|
$$parsedSource["updates"] = $$createField3_0($$parsedSource["updates"]);
|
||||||
}
|
}
|
||||||
|
if ("backup" in $$parsedSource) {
|
||||||
|
$$parsedSource["backup"] = $$createField4_0($$parsedSource["backup"]);
|
||||||
|
}
|
||||||
if ("metadata" in $$parsedSource) {
|
if ("metadata" in $$parsedSource) {
|
||||||
$$parsedSource["metadata"] = $$createField4_0($$parsedSource["metadata"]);
|
$$parsedSource["metadata"] = $$createField5_0($$parsedSource["metadata"]);
|
||||||
}
|
}
|
||||||
return new AppConfig($$parsedSource as Partial<AppConfig>);
|
return new AppConfig($$parsedSource as Partial<AppConfig>);
|
||||||
}
|
}
|
||||||
@@ -102,6 +110,11 @@ export class AppearanceConfig {
|
|||||||
*/
|
*/
|
||||||
"systemTheme": SystemThemeType;
|
"systemTheme": SystemThemeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前选择的预设主题名称
|
||||||
|
*/
|
||||||
|
"currentTheme": string;
|
||||||
|
|
||||||
/** Creates a new AppearanceConfig instance. */
|
/** Creates a new AppearanceConfig instance. */
|
||||||
constructor($$source: Partial<AppearanceConfig> = {}) {
|
constructor($$source: Partial<AppearanceConfig> = {}) {
|
||||||
if (!("language" in $$source)) {
|
if (!("language" in $$source)) {
|
||||||
@@ -110,6 +123,9 @@ export class AppearanceConfig {
|
|||||||
if (!("systemTheme" in $$source)) {
|
if (!("systemTheme" in $$source)) {
|
||||||
this["systemTheme"] = ("" as SystemThemeType);
|
this["systemTheme"] = ("" as SystemThemeType);
|
||||||
}
|
}
|
||||||
|
if (!("currentTheme" in $$source)) {
|
||||||
|
this["currentTheme"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
Object.assign(this, $$source);
|
||||||
}
|
}
|
||||||
@@ -123,6 +139,25 @@ export class AppearanceConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Git备份相关类型定义
|
||||||
|
*
|
||||||
|
* AuthMethod 定义Git认证方式
|
||||||
|
*/
|
||||||
|
export enum AuthMethod {
|
||||||
|
/**
|
||||||
|
* The Go zero value for the underlying type of the enum.
|
||||||
|
*/
|
||||||
|
$zero = "",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证方式
|
||||||
|
*/
|
||||||
|
Token = "token",
|
||||||
|
SSHKey = "ssh_key",
|
||||||
|
UserPass = "user_pass",
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ConfigMetadata 配置元数据
|
* ConfigMetadata 配置元数据
|
||||||
*/
|
*/
|
||||||
@@ -165,10 +200,15 @@ export class Document {
|
|||||||
"id": number;
|
"id": number;
|
||||||
"title": string;
|
"title": string;
|
||||||
"content": string;
|
"content": string;
|
||||||
"createdAt": time$0.Time;
|
"createdAt": string;
|
||||||
"updatedAt": time$0.Time;
|
"updatedAt": string;
|
||||||
"is_deleted": boolean;
|
"is_deleted": boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 锁定标志,锁定的文档无法被删除
|
||||||
|
*/
|
||||||
|
"is_locked": boolean;
|
||||||
|
|
||||||
/** Creates a new Document instance. */
|
/** Creates a new Document instance. */
|
||||||
constructor($$source: Partial<Document> = {}) {
|
constructor($$source: Partial<Document> = {}) {
|
||||||
if (!("id" in $$source)) {
|
if (!("id" in $$source)) {
|
||||||
@@ -181,14 +221,17 @@ export class Document {
|
|||||||
this["content"] = "";
|
this["content"] = "";
|
||||||
}
|
}
|
||||||
if (!("createdAt" in $$source)) {
|
if (!("createdAt" in $$source)) {
|
||||||
this["createdAt"] = null;
|
this["createdAt"] = "";
|
||||||
}
|
}
|
||||||
if (!("updatedAt" in $$source)) {
|
if (!("updatedAt" in $$source)) {
|
||||||
this["updatedAt"] = null;
|
this["updatedAt"] = "";
|
||||||
}
|
}
|
||||||
if (!("is_deleted" in $$source)) {
|
if (!("is_deleted" in $$source)) {
|
||||||
this["is_deleted"] = false;
|
this["is_deleted"] = false;
|
||||||
}
|
}
|
||||||
|
if (!("is_locked" in $$source)) {
|
||||||
|
this["is_locked"] = false;
|
||||||
|
}
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
Object.assign(this, $$source);
|
||||||
}
|
}
|
||||||
@@ -334,7 +377,7 @@ export class Extension {
|
|||||||
* Creates a new Extension instance from a string or object.
|
* Creates a new Extension instance from a string or object.
|
||||||
*/
|
*/
|
||||||
static createFrom($$source: any = {}): Extension {
|
static createFrom($$source: any = {}): Extension {
|
||||||
const $$createField3_0 = $$createType5;
|
const $$createField3_0 = $$createType6;
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
if ("config" in $$parsedSource) {
|
if ("config" in $$parsedSource) {
|
||||||
$$parsedSource["config"] = $$createField3_0($$parsedSource["config"]);
|
$$parsedSource["config"] = $$createField3_0($$parsedSource["config"]);
|
||||||
@@ -428,6 +471,12 @@ export class GeneralConfig {
|
|||||||
*/
|
*/
|
||||||
"startAtLogin": boolean;
|
"startAtLogin": boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 窗口吸附设置
|
||||||
|
* 是否启用窗口吸附功能(阈值现在是自适应的)
|
||||||
|
*/
|
||||||
|
"enableWindowSnap": boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局热键设置
|
* 全局热键设置
|
||||||
* 是否启用全局热键
|
* 是否启用全局热键
|
||||||
@@ -439,6 +488,17 @@ export class GeneralConfig {
|
|||||||
*/
|
*/
|
||||||
"globalHotkey": HotkeyCombo;
|
"globalHotkey": HotkeyCombo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 界面设置
|
||||||
|
* 是否启用加载动画
|
||||||
|
*/
|
||||||
|
"enableLoadingAnimation": boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用标签页模式
|
||||||
|
*/
|
||||||
|
"enableTabs": boolean;
|
||||||
|
|
||||||
/** Creates a new GeneralConfig instance. */
|
/** Creates a new GeneralConfig instance. */
|
||||||
constructor($$source: Partial<GeneralConfig> = {}) {
|
constructor($$source: Partial<GeneralConfig> = {}) {
|
||||||
if (!("alwaysOnTop" in $$source)) {
|
if (!("alwaysOnTop" in $$source)) {
|
||||||
@@ -453,12 +513,21 @@ export class GeneralConfig {
|
|||||||
if (!("startAtLogin" in $$source)) {
|
if (!("startAtLogin" in $$source)) {
|
||||||
this["startAtLogin"] = false;
|
this["startAtLogin"] = false;
|
||||||
}
|
}
|
||||||
|
if (!("enableWindowSnap" in $$source)) {
|
||||||
|
this["enableWindowSnap"] = false;
|
||||||
|
}
|
||||||
if (!("enableGlobalHotkey" in $$source)) {
|
if (!("enableGlobalHotkey" in $$source)) {
|
||||||
this["enableGlobalHotkey"] = false;
|
this["enableGlobalHotkey"] = false;
|
||||||
}
|
}
|
||||||
if (!("globalHotkey" in $$source)) {
|
if (!("globalHotkey" in $$source)) {
|
||||||
this["globalHotkey"] = (new HotkeyCombo());
|
this["globalHotkey"] = (new HotkeyCombo());
|
||||||
}
|
}
|
||||||
|
if (!("enableLoadingAnimation" in $$source)) {
|
||||||
|
this["enableLoadingAnimation"] = false;
|
||||||
|
}
|
||||||
|
if (!("enableTabs" in $$source)) {
|
||||||
|
this["enableTabs"] = false;
|
||||||
|
}
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
Object.assign(this, $$source);
|
||||||
}
|
}
|
||||||
@@ -467,15 +536,64 @@ export class GeneralConfig {
|
|||||||
* Creates a new GeneralConfig instance from a string or object.
|
* Creates a new GeneralConfig instance from a string or object.
|
||||||
*/
|
*/
|
||||||
static createFrom($$source: any = {}): GeneralConfig {
|
static createFrom($$source: any = {}): GeneralConfig {
|
||||||
const $$createField5_0 = $$createType7;
|
const $$createField6_0 = $$createType8;
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
if ("globalHotkey" in $$parsedSource) {
|
if ("globalHotkey" in $$parsedSource) {
|
||||||
$$parsedSource["globalHotkey"] = $$createField5_0($$parsedSource["globalHotkey"]);
|
$$parsedSource["globalHotkey"] = $$createField6_0($$parsedSource["globalHotkey"]);
|
||||||
}
|
}
|
||||||
return new GeneralConfig($$parsedSource as Partial<GeneralConfig>);
|
return new GeneralConfig($$parsedSource as Partial<GeneralConfig>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GitBackupConfig Git备份配置
|
||||||
|
*/
|
||||||
|
export class GitBackupConfig {
|
||||||
|
"enabled": boolean;
|
||||||
|
"repo_url": string;
|
||||||
|
"auth_method": AuthMethod;
|
||||||
|
"username"?: string;
|
||||||
|
"password"?: string;
|
||||||
|
"token"?: string;
|
||||||
|
"ssh_key_path"?: string;
|
||||||
|
"ssh_key_passphrase"?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分钟
|
||||||
|
*/
|
||||||
|
"backup_interval": number;
|
||||||
|
"auto_backup": boolean;
|
||||||
|
|
||||||
|
/** Creates a new GitBackupConfig instance. */
|
||||||
|
constructor($$source: Partial<GitBackupConfig> = {}) {
|
||||||
|
if (!("enabled" in $$source)) {
|
||||||
|
this["enabled"] = false;
|
||||||
|
}
|
||||||
|
if (!("repo_url" in $$source)) {
|
||||||
|
this["repo_url"] = "";
|
||||||
|
}
|
||||||
|
if (!("auth_method" in $$source)) {
|
||||||
|
this["auth_method"] = ("" as AuthMethod);
|
||||||
|
}
|
||||||
|
if (!("backup_interval" in $$source)) {
|
||||||
|
this["backup_interval"] = 0;
|
||||||
|
}
|
||||||
|
if (!("auto_backup" in $$source)) {
|
||||||
|
this["auto_backup"] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new GitBackupConfig instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): GitBackupConfig {
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
return new GitBackupConfig($$parsedSource as Partial<GitBackupConfig>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GiteaConfig Gitea配置
|
* GiteaConfig Gitea配置
|
||||||
*/
|
*/
|
||||||
@@ -963,84 +1081,6 @@ export enum KeyBindingCommand {
|
|||||||
TextHighlightToggleCommand = "textHighlightToggle",
|
TextHighlightToggleCommand = "textHighlightToggle",
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* KeyBindingConfig 快捷键配置
|
|
||||||
*/
|
|
||||||
export class KeyBindingConfig {
|
|
||||||
/**
|
|
||||||
* 快捷键列表
|
|
||||||
*/
|
|
||||||
"keyBindings": KeyBinding[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 配置元数据
|
|
||||||
*/
|
|
||||||
"metadata": KeyBindingMetadata;
|
|
||||||
|
|
||||||
/** Creates a new KeyBindingConfig instance. */
|
|
||||||
constructor($$source: Partial<KeyBindingConfig> = {}) {
|
|
||||||
if (!("keyBindings" in $$source)) {
|
|
||||||
this["keyBindings"] = [];
|
|
||||||
}
|
|
||||||
if (!("metadata" in $$source)) {
|
|
||||||
this["metadata"] = (new KeyBindingMetadata());
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new KeyBindingConfig instance from a string or object.
|
|
||||||
*/
|
|
||||||
static createFrom($$source: any = {}): KeyBindingConfig {
|
|
||||||
const $$createField0_0 = $$createType9;
|
|
||||||
const $$createField1_0 = $$createType10;
|
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
|
||||||
if ("keyBindings" in $$parsedSource) {
|
|
||||||
$$parsedSource["keyBindings"] = $$createField0_0($$parsedSource["keyBindings"]);
|
|
||||||
}
|
|
||||||
if ("metadata" in $$parsedSource) {
|
|
||||||
$$parsedSource["metadata"] = $$createField1_0($$parsedSource["metadata"]);
|
|
||||||
}
|
|
||||||
return new KeyBindingConfig($$parsedSource as Partial<KeyBindingConfig>);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* KeyBindingMetadata 快捷键配置元数据
|
|
||||||
*/
|
|
||||||
export class KeyBindingMetadata {
|
|
||||||
/**
|
|
||||||
* 配置版本
|
|
||||||
*/
|
|
||||||
"version": string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最后更新时间
|
|
||||||
*/
|
|
||||||
"lastUpdated": string;
|
|
||||||
|
|
||||||
/** Creates a new KeyBindingMetadata instance. */
|
|
||||||
constructor($$source: Partial<KeyBindingMetadata> = {}) {
|
|
||||||
if (!("version" in $$source)) {
|
|
||||||
this["version"] = "";
|
|
||||||
}
|
|
||||||
if (!("lastUpdated" in $$source)) {
|
|
||||||
this["lastUpdated"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.assign(this, $$source);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new KeyBindingMetadata instance from a string or object.
|
|
||||||
*/
|
|
||||||
static createFrom($$source: any = {}): KeyBindingMetadata {
|
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
|
||||||
return new KeyBindingMetadata($$parsedSource as Partial<KeyBindingMetadata>);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LanguageType 语言类型定义
|
* LanguageType 语言类型定义
|
||||||
*/
|
*/
|
||||||
@@ -1106,6 +1146,370 @@ export enum TabType {
|
|||||||
TabTypeTab = "tab",
|
TabTypeTab = "tab",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Theme 主题数据库模型
|
||||||
|
*/
|
||||||
|
export class Theme {
|
||||||
|
"id": number;
|
||||||
|
"name": string;
|
||||||
|
"type": ThemeType;
|
||||||
|
"colors": ThemeColorConfig;
|
||||||
|
"isDefault": boolean;
|
||||||
|
"createdAt": string;
|
||||||
|
"updatedAt": string;
|
||||||
|
|
||||||
|
/** Creates a new Theme instance. */
|
||||||
|
constructor($$source: Partial<Theme> = {}) {
|
||||||
|
if (!("id" in $$source)) {
|
||||||
|
this["id"] = 0;
|
||||||
|
}
|
||||||
|
if (!("name" in $$source)) {
|
||||||
|
this["name"] = "";
|
||||||
|
}
|
||||||
|
if (!("type" in $$source)) {
|
||||||
|
this["type"] = ("" as ThemeType);
|
||||||
|
}
|
||||||
|
if (!("colors" in $$source)) {
|
||||||
|
this["colors"] = (new ThemeColorConfig());
|
||||||
|
}
|
||||||
|
if (!("isDefault" in $$source)) {
|
||||||
|
this["isDefault"] = false;
|
||||||
|
}
|
||||||
|
if (!("createdAt" in $$source)) {
|
||||||
|
this["createdAt"] = "";
|
||||||
|
}
|
||||||
|
if (!("updatedAt" in $$source)) {
|
||||||
|
this["updatedAt"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new Theme instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): Theme {
|
||||||
|
const $$createField3_0 = $$createType9;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("colors" in $$parsedSource) {
|
||||||
|
$$parsedSource["colors"] = $$createField3_0($$parsedSource["colors"]);
|
||||||
|
}
|
||||||
|
return new Theme($$parsedSource as Partial<Theme>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ThemeColorConfig 主题颜色配置(与前端 ThemeColors 接口保持一致)
|
||||||
|
*/
|
||||||
|
export class ThemeColorConfig {
|
||||||
|
/**
|
||||||
|
* 主题基本信息
|
||||||
|
* 主题名称
|
||||||
|
*/
|
||||||
|
"name": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为深色主题
|
||||||
|
*/
|
||||||
|
"dark": boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础色调
|
||||||
|
* 主背景色
|
||||||
|
*/
|
||||||
|
"background": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次要背景色(用于代码块交替背景)
|
||||||
|
*/
|
||||||
|
"backgroundSecondary": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面板背景
|
||||||
|
*/
|
||||||
|
"surface": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉菜单背景
|
||||||
|
*/
|
||||||
|
"dropdownBackground": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉菜单边框
|
||||||
|
*/
|
||||||
|
"dropdownBorder": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文本颜色
|
||||||
|
* 主文本色
|
||||||
|
*/
|
||||||
|
"foreground": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次要文本色
|
||||||
|
*/
|
||||||
|
"foregroundSecondary": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注释色
|
||||||
|
*/
|
||||||
|
"comment": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语法高亮色 - 核心
|
||||||
|
* 关键字
|
||||||
|
*/
|
||||||
|
"keyword": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串
|
||||||
|
*/
|
||||||
|
"string": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 函数名
|
||||||
|
*/
|
||||||
|
"function": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字
|
||||||
|
*/
|
||||||
|
"number": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作符
|
||||||
|
*/
|
||||||
|
"operator": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变量
|
||||||
|
*/
|
||||||
|
"variable": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
"type": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语法高亮色 - 扩展
|
||||||
|
* 常量
|
||||||
|
*/
|
||||||
|
"constant": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储类型(如 static, const)
|
||||||
|
*/
|
||||||
|
"storage": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数
|
||||||
|
*/
|
||||||
|
"parameter": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类名
|
||||||
|
*/
|
||||||
|
"class": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标题(Markdown等)
|
||||||
|
*/
|
||||||
|
"heading": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无效内容/错误
|
||||||
|
*/
|
||||||
|
"invalid": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正则表达式
|
||||||
|
*/
|
||||||
|
"regexp": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 界面元素
|
||||||
|
* 光标
|
||||||
|
*/
|
||||||
|
"cursor": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选中背景
|
||||||
|
*/
|
||||||
|
"selection": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失焦选中背景
|
||||||
|
*/
|
||||||
|
"selectionBlur": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前行高亮
|
||||||
|
*/
|
||||||
|
"activeLine": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行号
|
||||||
|
*/
|
||||||
|
"lineNumber": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动行号颜色
|
||||||
|
*/
|
||||||
|
"activeLineNumber": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边框和分割线
|
||||||
|
* 边框色
|
||||||
|
*/
|
||||||
|
"borderColor": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浅色边框
|
||||||
|
*/
|
||||||
|
"borderLight": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索和匹配
|
||||||
|
* 搜索匹配
|
||||||
|
*/
|
||||||
|
"searchMatch": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配括号
|
||||||
|
*/
|
||||||
|
"matchingBracket": string;
|
||||||
|
|
||||||
|
/** Creates a new ThemeColorConfig instance. */
|
||||||
|
constructor($$source: Partial<ThemeColorConfig> = {}) {
|
||||||
|
if (!("name" in $$source)) {
|
||||||
|
this["name"] = "";
|
||||||
|
}
|
||||||
|
if (!("dark" in $$source)) {
|
||||||
|
this["dark"] = false;
|
||||||
|
}
|
||||||
|
if (!("background" in $$source)) {
|
||||||
|
this["background"] = "";
|
||||||
|
}
|
||||||
|
if (!("backgroundSecondary" in $$source)) {
|
||||||
|
this["backgroundSecondary"] = "";
|
||||||
|
}
|
||||||
|
if (!("surface" in $$source)) {
|
||||||
|
this["surface"] = "";
|
||||||
|
}
|
||||||
|
if (!("dropdownBackground" in $$source)) {
|
||||||
|
this["dropdownBackground"] = "";
|
||||||
|
}
|
||||||
|
if (!("dropdownBorder" in $$source)) {
|
||||||
|
this["dropdownBorder"] = "";
|
||||||
|
}
|
||||||
|
if (!("foreground" in $$source)) {
|
||||||
|
this["foreground"] = "";
|
||||||
|
}
|
||||||
|
if (!("foregroundSecondary" in $$source)) {
|
||||||
|
this["foregroundSecondary"] = "";
|
||||||
|
}
|
||||||
|
if (!("comment" in $$source)) {
|
||||||
|
this["comment"] = "";
|
||||||
|
}
|
||||||
|
if (!("keyword" in $$source)) {
|
||||||
|
this["keyword"] = "";
|
||||||
|
}
|
||||||
|
if (!("string" in $$source)) {
|
||||||
|
this["string"] = "";
|
||||||
|
}
|
||||||
|
if (!("function" in $$source)) {
|
||||||
|
this["function"] = "";
|
||||||
|
}
|
||||||
|
if (!("number" in $$source)) {
|
||||||
|
this["number"] = "";
|
||||||
|
}
|
||||||
|
if (!("operator" in $$source)) {
|
||||||
|
this["operator"] = "";
|
||||||
|
}
|
||||||
|
if (!("variable" in $$source)) {
|
||||||
|
this["variable"] = "";
|
||||||
|
}
|
||||||
|
if (!("type" in $$source)) {
|
||||||
|
this["type"] = "";
|
||||||
|
}
|
||||||
|
if (!("constant" in $$source)) {
|
||||||
|
this["constant"] = "";
|
||||||
|
}
|
||||||
|
if (!("storage" in $$source)) {
|
||||||
|
this["storage"] = "";
|
||||||
|
}
|
||||||
|
if (!("parameter" in $$source)) {
|
||||||
|
this["parameter"] = "";
|
||||||
|
}
|
||||||
|
if (!("class" in $$source)) {
|
||||||
|
this["class"] = "";
|
||||||
|
}
|
||||||
|
if (!("heading" in $$source)) {
|
||||||
|
this["heading"] = "";
|
||||||
|
}
|
||||||
|
if (!("invalid" in $$source)) {
|
||||||
|
this["invalid"] = "";
|
||||||
|
}
|
||||||
|
if (!("regexp" in $$source)) {
|
||||||
|
this["regexp"] = "";
|
||||||
|
}
|
||||||
|
if (!("cursor" in $$source)) {
|
||||||
|
this["cursor"] = "";
|
||||||
|
}
|
||||||
|
if (!("selection" in $$source)) {
|
||||||
|
this["selection"] = "";
|
||||||
|
}
|
||||||
|
if (!("selectionBlur" in $$source)) {
|
||||||
|
this["selectionBlur"] = "";
|
||||||
|
}
|
||||||
|
if (!("activeLine" in $$source)) {
|
||||||
|
this["activeLine"] = "";
|
||||||
|
}
|
||||||
|
if (!("lineNumber" in $$source)) {
|
||||||
|
this["lineNumber"] = "";
|
||||||
|
}
|
||||||
|
if (!("activeLineNumber" in $$source)) {
|
||||||
|
this["activeLineNumber"] = "";
|
||||||
|
}
|
||||||
|
if (!("borderColor" in $$source)) {
|
||||||
|
this["borderColor"] = "";
|
||||||
|
}
|
||||||
|
if (!("borderLight" in $$source)) {
|
||||||
|
this["borderLight"] = "";
|
||||||
|
}
|
||||||
|
if (!("searchMatch" in $$source)) {
|
||||||
|
this["searchMatch"] = "";
|
||||||
|
}
|
||||||
|
if (!("matchingBracket" in $$source)) {
|
||||||
|
this["matchingBracket"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ThemeColorConfig instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): ThemeColorConfig {
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
return new ThemeColorConfig($$parsedSource as Partial<ThemeColorConfig>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ThemeType 主题类型枚举
|
||||||
|
*/
|
||||||
|
export enum ThemeType {
|
||||||
|
/**
|
||||||
|
* The Go zero value for the underlying type of the enum.
|
||||||
|
*/
|
||||||
|
$zero = "",
|
||||||
|
|
||||||
|
ThemeTypeDark = "dark",
|
||||||
|
ThemeTypeLight = "light",
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateSourceType 更新源类型
|
* UpdateSourceType 更新源类型
|
||||||
*/
|
*/
|
||||||
@@ -1204,8 +1608,8 @@ export class UpdatesConfig {
|
|||||||
* Creates a new UpdatesConfig instance from a string or object.
|
* Creates a new UpdatesConfig instance from a string or object.
|
||||||
*/
|
*/
|
||||||
static createFrom($$source: any = {}): UpdatesConfig {
|
static createFrom($$source: any = {}): UpdatesConfig {
|
||||||
const $$createField6_0 = $$createType11;
|
const $$createField6_0 = $$createType10;
|
||||||
const $$createField7_0 = $$createType12;
|
const $$createField7_0 = $$createType11;
|
||||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
if ("github" in $$parsedSource) {
|
if ("github" in $$parsedSource) {
|
||||||
$$parsedSource["github"] = $$createField6_0($$parsedSource["github"]);
|
$$parsedSource["github"] = $$createField6_0($$parsedSource["github"]);
|
||||||
@@ -1222,17 +1626,16 @@ const $$createType0 = GeneralConfig.createFrom;
|
|||||||
const $$createType1 = EditingConfig.createFrom;
|
const $$createType1 = EditingConfig.createFrom;
|
||||||
const $$createType2 = AppearanceConfig.createFrom;
|
const $$createType2 = AppearanceConfig.createFrom;
|
||||||
const $$createType3 = UpdatesConfig.createFrom;
|
const $$createType3 = UpdatesConfig.createFrom;
|
||||||
const $$createType4 = ConfigMetadata.createFrom;
|
const $$createType4 = GitBackupConfig.createFrom;
|
||||||
var $$createType5 = (function $$initCreateType5(...args): any {
|
const $$createType5 = ConfigMetadata.createFrom;
|
||||||
if ($$createType5 === $$initCreateType5) {
|
var $$createType6 = (function $$initCreateType6(...args): any {
|
||||||
$$createType5 = $$createType6;
|
if ($$createType6 === $$initCreateType6) {
|
||||||
|
$$createType6 = $$createType7;
|
||||||
}
|
}
|
||||||
return $$createType5(...args);
|
return $$createType6(...args);
|
||||||
});
|
});
|
||||||
const $$createType6 = $Create.Map($Create.Any, $Create.Any);
|
const $$createType7 = $Create.Map($Create.Any, $Create.Any);
|
||||||
const $$createType7 = HotkeyCombo.createFrom;
|
const $$createType8 = HotkeyCombo.createFrom;
|
||||||
const $$createType8 = KeyBinding.createFrom;
|
const $$createType9 = ThemeColorConfig.createFrom;
|
||||||
const $$createType9 = $Create.Array($$createType8);
|
const $$createType10 = GithubConfig.createFrom;
|
||||||
const $$createType10 = KeyBindingMetadata.createFrom;
|
const $$createType11 = GiteaConfig.createFrom;
|
||||||
const $$createType11 = GithubConfig.createFrom;
|
|
||||||
const $$createType12 = GiteaConfig.createFrom;
|
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BackupService 提供基于Git的备份功能
|
||||||
|
* @module
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore: Unused imports
|
||||||
|
import * as models$0 from "../models/models.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HandleConfigChange 处理备份配置变更
|
||||||
|
*/
|
||||||
|
export function HandleConfigChange(config: models$0.GitBackupConfig | null): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(395287784, config) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize 初始化备份服务
|
||||||
|
*/
|
||||||
|
export function Initialize(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1052437974) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PushToRemote 推送本地更改到远程仓库
|
||||||
|
*/
|
||||||
|
export function PushToRemote(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(262644139) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reinitialize 重新初始化备份服务,用于响应配置变更
|
||||||
|
*/
|
||||||
|
export function Reinitialize(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(301562543) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceShutdown 服务关闭时的清理工作
|
||||||
|
*/
|
||||||
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(422131801) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2900331732, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* StartAutoBackup 启动自动备份定时器
|
||||||
|
*/
|
||||||
|
export function StartAutoBackup(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3035755449) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* StopAutoBackup 停止自动备份
|
||||||
|
*/
|
||||||
|
export function StopAutoBackup(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2641894021) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
@@ -10,10 +10,17 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import * as models$0 from "../models/models.js";
|
import * as models$0 from "../models/models.js";
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore: Unused imports
|
||||||
|
import * as $models from "./models.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get 获取配置项
|
* Get 获取配置项
|
||||||
*/
|
*/
|
||||||
@@ -34,6 +41,14 @@ export function GetConfig(): Promise<models$0.AppConfig | null> & { cancel(): vo
|
|||||||
return $typingPromise;
|
return $typingPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MigrateConfig 执行配置迁移
|
||||||
|
*/
|
||||||
|
export function MigrateConfig(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(434292783) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResetConfig 强制重置所有配置为默认值
|
* ResetConfig 强制重置所有配置为默认值
|
||||||
*/
|
*/
|
||||||
@@ -42,6 +57,22 @@ export function ResetConfig(): Promise<void> & { cancel(): void } {
|
|||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceShutdown 关闭服务
|
||||||
|
*/
|
||||||
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3963562361) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup initializes the service when the application starts
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3311949428, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set 设置配置项
|
* Set 设置配置项
|
||||||
*/
|
*/
|
||||||
@@ -51,18 +82,18 @@ export function Set(key: string, value: any): Promise<void> & { cancel(): void }
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SetDataPathChangeCallback 设置数据路径配置变更回调
|
* Watch 注册配置变更监听器
|
||||||
*/
|
*/
|
||||||
export function SetDataPathChangeCallback(callback: any): Promise<void> & { cancel(): void } {
|
export function Watch(path: string, callback: $models.ObserverCallback): Promise<$models.CancelFunc> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(393017412, callback) as any;
|
let $resultPromise = $Call.ByID(1143583035, path, callback) as any;
|
||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SetHotkeyChangeCallback 设置热键配置变更回调
|
* WatchWithContext 使用 Context 注册监听器
|
||||||
*/
|
*/
|
||||||
export function SetHotkeyChangeCallback(callback: any): Promise<void> & { cancel(): void } {
|
export function WatchWithContext(path: string, callback: $models.ObserverCallback): Promise<void> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(283872321, callback) as any;
|
let $resultPromise = $Call.ByID(1454973098, path, callback) as any;
|
||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,28 +12,28 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import * as sql$0 from "../../../database/sql/models.js";
|
import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GetDB returns the database connection
|
* RegisterModel 注册模型与表的映射关系
|
||||||
*/
|
*/
|
||||||
export function GetDB(): Promise<sql$0.DB | null> & { cancel(): void } {
|
export function RegisterModel(tableName: string, model: any): Promise<void> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(228760371) as any;
|
let $resultPromise = $Call.ByID(175397515, tableName, model) as any;
|
||||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
|
||||||
return $$createType1($result);
|
|
||||||
}) as any;
|
|
||||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
|
||||||
return $typingPromise;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OnDataPathChanged handles data path changes
|
|
||||||
*/
|
|
||||||
export function OnDataPathChanged(): Promise<void> & { cancel(): void } {
|
|
||||||
let $resultPromise = $Call.ByID(3652863491) as any;
|
|
||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private type creation functions
|
/**
|
||||||
const $$createType0 = sql$0.DB.createFrom;
|
* ServiceShutdown shuts down the service when the application closes
|
||||||
const $$createType1 = $Create.Nullable($$createType0);
|
*/
|
||||||
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3907893632) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup initializes the service when the application starts
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2067840771, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,10 +10,6 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SelectDirectory 打开目录选择对话框
|
* SelectDirectory 打开目录选择对话框
|
||||||
*/
|
*/
|
||||||
@@ -23,9 +19,9 @@ export function SelectDirectory(): Promise<string> & { cancel(): void } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SetWindow 设置绑定的窗口
|
* SelectFile 打开文件选择对话框
|
||||||
*/
|
*/
|
||||||
export function SetWindow(window: application$0.WebviewWindow | null): Promise<void> & { cancel(): void } {
|
export function SelectFile(): Promise<string> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(968177170, window) as any;
|
let $resultPromise = $Call.ByID(37302920) as any;
|
||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import * as models$0 from "../models/models.js";
|
import * as models$0 from "../models/models.js";
|
||||||
@@ -46,14 +49,6 @@ export function GetDocumentByID(id: number): Promise<models$0.Document | null> &
|
|||||||
return $typingPromise;
|
return $typingPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* GetFirstDocumentID gets the first active document's ID for frontend initialization
|
|
||||||
*/
|
|
||||||
export function GetFirstDocumentID(): Promise<number> & { cancel(): void } {
|
|
||||||
let $resultPromise = $Call.ByID(2970773833) as any;
|
|
||||||
return $resultPromise;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ListAllDocumentsMeta lists all active (non-deleted) document metadata
|
* ListAllDocumentsMeta lists all active (non-deleted) document metadata
|
||||||
*/
|
*/
|
||||||
@@ -78,6 +73,14 @@ export function ListDeletedDocumentsMeta(): Promise<(models$0.Document | null)[]
|
|||||||
return $typingPromise;
|
return $typingPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LockDocument 锁定文档,防止删除
|
||||||
|
*/
|
||||||
|
export function LockDocument(id: number): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1889494473, id) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RestoreDocument restores a deleted document
|
* RestoreDocument restores a deleted document
|
||||||
*/
|
*/
|
||||||
@@ -86,6 +89,22 @@ export function RestoreDocument(id: number): Promise<void> & { cancel(): void }
|
|||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup initializes the service when the application starts
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1474135487, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UnlockDocument 解锁文档
|
||||||
|
*/
|
||||||
|
export function UnlockDocument(id: number): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(222307930, id) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateDocumentContent updates the content of a document
|
* UpdateDocumentContent updates the content of a document
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import * as models$0 from "../models/models.js";
|
import * as models$0 from "../models/models.js";
|
||||||
@@ -42,6 +45,14 @@ export function ResetExtensionToDefault(id: models$0.ExtensionID): Promise<void>
|
|||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup 启动时调用
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(40324057, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateExtensionEnabled 更新扩展启用状态
|
* UpdateExtensionEnabled 更新扩展启用状态
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// This file is automatically generated. DO NOT EDIT
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HotkeyService Windows全局热键服务
|
* HotkeyService 全局热键服务
|
||||||
* @module
|
* @module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -32,8 +32,8 @@ export function GetCurrentHotkey(): Promise<models$0.HotkeyCombo | null> & { can
|
|||||||
/**
|
/**
|
||||||
* Initialize 初始化热键服务
|
* Initialize 初始化热键服务
|
||||||
*/
|
*/
|
||||||
export function Initialize(app: application$0.App | null): Promise<void> & { cancel(): void } {
|
export function Initialize(): Promise<void> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(3671360458, app) as any;
|
let $resultPromise = $Call.ByID(3671360458) as any;
|
||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,19 +48,27 @@ export function IsRegistered(): Promise<boolean> & { cancel(): void } {
|
|||||||
/**
|
/**
|
||||||
* RegisterHotkey 注册全局热键
|
* RegisterHotkey 注册全局热键
|
||||||
*/
|
*/
|
||||||
export function RegisterHotkey(hotkey: models$0.HotkeyCombo | null): Promise<void> & { cancel(): void } {
|
export function RegisterHotkey(combo: models$0.HotkeyCombo | null): Promise<void> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(1103945691, hotkey) as any;
|
let $resultPromise = $Call.ByID(1103945691, combo) as any;
|
||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OnShutdown 关闭服务
|
* ServiceShutdown 关闭服务
|
||||||
*/
|
*/
|
||||||
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(157291181) as any;
|
let $resultPromise = $Call.ByID(157291181) as any;
|
||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup 服务启动时初始化
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3079990808, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UnregisterHotkey 取消注册全局热键
|
* UnregisterHotkey 取消注册全局热键
|
||||||
*/
|
*/
|
||||||
@@ -72,8 +80,8 @@ export function UnregisterHotkey(): Promise<void> & { cancel(): void } {
|
|||||||
/**
|
/**
|
||||||
* UpdateHotkey 更新热键配置
|
* UpdateHotkey 更新热键配置
|
||||||
*/
|
*/
|
||||||
export function UpdateHotkey(enable: boolean, hotkey: models$0.HotkeyCombo | null): Promise<void> & { cancel(): void } {
|
export function UpdateHotkey(enable: boolean, combo: models$0.HotkeyCombo | null): Promise<void> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(823285555, enable, hotkey) as any;
|
let $resultPromise = $Call.ByID(823285555, enable, combo) as any;
|
||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HttpClientService HTTP客户端服务
|
||||||
|
* @module
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ExecuteRequest 执行HTTP请求
|
||||||
|
*/
|
||||||
|
export function ExecuteRequest(request: $models.HttpRequest | null): Promise<$models.HttpResponse | null> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3143343977, request) as any;
|
||||||
|
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||||
|
return $$createType1($result);
|
||||||
|
}) as any;
|
||||||
|
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||||
|
return $typingPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private type creation functions
|
||||||
|
const $$createType0 = $models.HttpResponse.createFrom;
|
||||||
|
const $$createType1 = $Create.Nullable($$createType0);
|
||||||
@@ -1,33 +1,43 @@
|
|||||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
// This file is automatically generated. DO NOT EDIT
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
import * as BackupService from "./backupservice.js";
|
||||||
import * as ConfigService from "./configservice.js";
|
import * as ConfigService from "./configservice.js";
|
||||||
import * as DatabaseService from "./databaseservice.js";
|
import * as DatabaseService from "./databaseservice.js";
|
||||||
import * as DialogService from "./dialogservice.js";
|
import * as DialogService from "./dialogservice.js";
|
||||||
import * as DocumentService from "./documentservice.js";
|
import * as DocumentService from "./documentservice.js";
|
||||||
import * as ExtensionService from "./extensionservice.js";
|
import * as ExtensionService from "./extensionservice.js";
|
||||||
import * as HotkeyService from "./hotkeyservice.js";
|
import * as HotkeyService from "./hotkeyservice.js";
|
||||||
|
import * as HttpClientService from "./httpclientservice.js";
|
||||||
import * as KeyBindingService from "./keybindingservice.js";
|
import * as KeyBindingService from "./keybindingservice.js";
|
||||||
import * as MigrationService from "./migrationservice.js";
|
import * as MigrationService from "./migrationservice.js";
|
||||||
import * as SelfUpdateService from "./selfupdateservice.js";
|
import * as SelfUpdateService from "./selfupdateservice.js";
|
||||||
import * as StartupService from "./startupservice.js";
|
import * as StartupService from "./startupservice.js";
|
||||||
import * as SystemService from "./systemservice.js";
|
import * as SystemService from "./systemservice.js";
|
||||||
|
import * as TestService from "./testservice.js";
|
||||||
|
import * as ThemeService from "./themeservice.js";
|
||||||
import * as TranslationService from "./translationservice.js";
|
import * as TranslationService from "./translationservice.js";
|
||||||
import * as TrayService from "./trayservice.js";
|
import * as TrayService from "./trayservice.js";
|
||||||
|
import * as WindowService from "./windowservice.js";
|
||||||
export {
|
export {
|
||||||
|
BackupService,
|
||||||
ConfigService,
|
ConfigService,
|
||||||
DatabaseService,
|
DatabaseService,
|
||||||
DialogService,
|
DialogService,
|
||||||
DocumentService,
|
DocumentService,
|
||||||
ExtensionService,
|
ExtensionService,
|
||||||
HotkeyService,
|
HotkeyService,
|
||||||
|
HttpClientService,
|
||||||
KeyBindingService,
|
KeyBindingService,
|
||||||
MigrationService,
|
MigrationService,
|
||||||
SelfUpdateService,
|
SelfUpdateService,
|
||||||
StartupService,
|
StartupService,
|
||||||
SystemService,
|
SystemService,
|
||||||
|
TestService,
|
||||||
|
ThemeService,
|
||||||
TranslationService,
|
TranslationService,
|
||||||
TrayService
|
TrayService,
|
||||||
|
WindowService
|
||||||
};
|
};
|
||||||
|
|
||||||
export * from "./models.js";
|
export * from "./models.js";
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import * as models$0 from "../models/models.js";
|
import * as models$0 from "../models/models.js";
|
||||||
@@ -27,19 +30,13 @@ export function GetAllKeyBindings(): Promise<models$0.KeyBinding[]> & { cancel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GetKeyBindingConfig 获取完整快捷键配置
|
* ServiceStartup 启动时调用
|
||||||
*/
|
*/
|
||||||
export function GetKeyBindingConfig(): Promise<models$0.KeyBindingConfig | null> & { cancel(): void } {
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(3804318356) as any;
|
let $resultPromise = $Call.ByID(2057121990, options) as any;
|
||||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
return $resultPromise;
|
||||||
return $$createType3($result);
|
|
||||||
}) as any;
|
|
||||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
|
||||||
return $typingPromise;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private type creation functions
|
// Private type creation functions
|
||||||
const $$createType0 = models$0.KeyBinding.createFrom;
|
const $$createType0 = models$0.KeyBinding.createFrom;
|
||||||
const $$createType1 = $Create.Array($$createType0);
|
const $$createType1 = $Create.Array($$createType0);
|
||||||
const $$createType2 = models$0.KeyBindingConfig.createFrom;
|
|
||||||
const $$createType3 = $Create.Nullable($$createType2);
|
|
||||||
|
|||||||
@@ -42,5 +42,13 @@ export function MigrateDirectory(srcPath: string, dstPath: string): Promise<void
|
|||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceShutdown 服务关闭
|
||||||
|
*/
|
||||||
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3472042605) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
// Private type creation functions
|
// Private type creation functions
|
||||||
const $$createType0 = $models.MigrationProgress.createFrom;
|
const $$createType0 = $models.MigrationProgress.createFrom;
|
||||||
|
|||||||
@@ -5,6 +5,121 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Create as $Create} from "@wailsio/runtime";
|
import {Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore: Unused imports
|
||||||
|
import * as http$0 from "../../../net/http/models.js";
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore: Unused imports
|
||||||
|
import * as time$0 from "../../../time/models.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CancelFunc 取消订阅函数
|
||||||
|
* 调用此函数可以取消对配置的监听
|
||||||
|
*/
|
||||||
|
export type CancelFunc = any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HttpRequest HTTP请求结构
|
||||||
|
*/
|
||||||
|
export class HttpRequest {
|
||||||
|
"method": string;
|
||||||
|
"url": string;
|
||||||
|
"headers": { [_: string]: string };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json, formdata, urlencoded, text, params, xml, html, javascript, binary
|
||||||
|
*/
|
||||||
|
"bodyType"?: string;
|
||||||
|
"body"?: any;
|
||||||
|
|
||||||
|
/** Creates a new HttpRequest instance. */
|
||||||
|
constructor($$source: Partial<HttpRequest> = {}) {
|
||||||
|
if (!("method" in $$source)) {
|
||||||
|
this["method"] = "";
|
||||||
|
}
|
||||||
|
if (!("url" in $$source)) {
|
||||||
|
this["url"] = "";
|
||||||
|
}
|
||||||
|
if (!("headers" in $$source)) {
|
||||||
|
this["headers"] = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new HttpRequest instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): HttpRequest {
|
||||||
|
const $$createField2_0 = $$createType0;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("headers" in $$parsedSource) {
|
||||||
|
$$parsedSource["headers"] = $$createField2_0($$parsedSource["headers"]);
|
||||||
|
}
|
||||||
|
return new HttpRequest($$parsedSource as Partial<HttpRequest>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HttpResponse HTTP响应结构
|
||||||
|
*/
|
||||||
|
export class HttpResponse {
|
||||||
|
/**
|
||||||
|
* 使用resp.Status()返回完整状态如"200 OK"
|
||||||
|
*/
|
||||||
|
"status": string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 响应时间(毫秒)
|
||||||
|
*/
|
||||||
|
"time": number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求大小
|
||||||
|
*/
|
||||||
|
"requestSize": string;
|
||||||
|
"body": any;
|
||||||
|
"headers": http$0.Header;
|
||||||
|
"timestamp": time$0.Time;
|
||||||
|
"error"?: any;
|
||||||
|
|
||||||
|
/** Creates a new HttpResponse instance. */
|
||||||
|
constructor($$source: Partial<HttpResponse> = {}) {
|
||||||
|
if (!("status" in $$source)) {
|
||||||
|
this["status"] = "";
|
||||||
|
}
|
||||||
|
if (!("time" in $$source)) {
|
||||||
|
this["time"] = 0;
|
||||||
|
}
|
||||||
|
if (!("requestSize" in $$source)) {
|
||||||
|
this["requestSize"] = "";
|
||||||
|
}
|
||||||
|
if (!("body" in $$source)) {
|
||||||
|
this["body"] = null;
|
||||||
|
}
|
||||||
|
if (!("headers" in $$source)) {
|
||||||
|
this["headers"] = ({} as http$0.Header);
|
||||||
|
}
|
||||||
|
if (!("timestamp" in $$source)) {
|
||||||
|
this["timestamp"] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new HttpResponse instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): HttpResponse {
|
||||||
|
const $$createField4_0 = $$createType1;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("headers" in $$parsedSource) {
|
||||||
|
$$parsedSource["headers"] = $$createField4_0($$parsedSource["headers"]);
|
||||||
|
}
|
||||||
|
return new HttpResponse($$parsedSource as Partial<HttpResponse>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MemoryStats 内存统计信息
|
* MemoryStats 内存统计信息
|
||||||
*/
|
*/
|
||||||
@@ -115,6 +230,47 @@ export enum MigrationStatus {
|
|||||||
MigrationStatusFailed = "failed",
|
MigrationStatusFailed = "failed",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OSInfo 操作系统信息
|
||||||
|
*/
|
||||||
|
export class OSInfo {
|
||||||
|
"id": string;
|
||||||
|
"name": string;
|
||||||
|
"version": string;
|
||||||
|
"branding": string;
|
||||||
|
|
||||||
|
/** Creates a new OSInfo instance. */
|
||||||
|
constructor($$source: Partial<OSInfo> = {}) {
|
||||||
|
if (!("id" in $$source)) {
|
||||||
|
this["id"] = "";
|
||||||
|
}
|
||||||
|
if (!("name" in $$source)) {
|
||||||
|
this["name"] = "";
|
||||||
|
}
|
||||||
|
if (!("version" in $$source)) {
|
||||||
|
this["version"] = "";
|
||||||
|
}
|
||||||
|
if (!("branding" in $$source)) {
|
||||||
|
this["branding"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new OSInfo instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): OSInfo {
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
return new OSInfo($$parsedSource as Partial<OSInfo>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ObserverCallback 观察者回调函数
|
||||||
|
*/
|
||||||
|
export type ObserverCallback = any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SelfUpdateResult 自我更新结果
|
* SelfUpdateResult 自我更新结果
|
||||||
*/
|
*/
|
||||||
@@ -197,3 +353,65 @@ export class SelfUpdateResult {
|
|||||||
return new SelfUpdateResult($$parsedSource as Partial<SelfUpdateResult>);
|
return new SelfUpdateResult($$parsedSource as Partial<SelfUpdateResult>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SystemInfo 系统信息
|
||||||
|
*/
|
||||||
|
export class SystemInfo {
|
||||||
|
"os": string;
|
||||||
|
"arch": string;
|
||||||
|
"debug": boolean;
|
||||||
|
"osInfo": OSInfo | null;
|
||||||
|
"platformInfo": { [_: string]: any };
|
||||||
|
|
||||||
|
/** Creates a new SystemInfo instance. */
|
||||||
|
constructor($$source: Partial<SystemInfo> = {}) {
|
||||||
|
if (!("os" in $$source)) {
|
||||||
|
this["os"] = "";
|
||||||
|
}
|
||||||
|
if (!("arch" in $$source)) {
|
||||||
|
this["arch"] = "";
|
||||||
|
}
|
||||||
|
if (!("debug" in $$source)) {
|
||||||
|
this["debug"] = false;
|
||||||
|
}
|
||||||
|
if (!("osInfo" in $$source)) {
|
||||||
|
this["osInfo"] = null;
|
||||||
|
}
|
||||||
|
if (!("platformInfo" in $$source)) {
|
||||||
|
this["platformInfo"] = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new SystemInfo instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): SystemInfo {
|
||||||
|
const $$createField3_0 = $$createType5;
|
||||||
|
const $$createField4_0 = $$createType6;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("osInfo" in $$parsedSource) {
|
||||||
|
$$parsedSource["osInfo"] = $$createField3_0($$parsedSource["osInfo"]);
|
||||||
|
}
|
||||||
|
if ("platformInfo" in $$parsedSource) {
|
||||||
|
$$parsedSource["platformInfo"] = $$createField4_0($$parsedSource["platformInfo"]);
|
||||||
|
}
|
||||||
|
return new SystemInfo($$parsedSource as Partial<SystemInfo>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private type creation functions
|
||||||
|
const $$createType0 = $Create.Map($Create.Any, $Create.Any);
|
||||||
|
var $$createType1 = (function $$initCreateType1(...args): any {
|
||||||
|
if ($$createType1 === $$initCreateType1) {
|
||||||
|
$$createType1 = $$createType3;
|
||||||
|
}
|
||||||
|
return $$createType1(...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);
|
||||||
|
|||||||
@@ -34,6 +34,18 @@ export function GetMemoryStats(): Promise<$models.MemoryStats> & { cancel(): voi
|
|||||||
return $typingPromise;
|
return $typingPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetSystemInfo 获取系统环境信息
|
||||||
|
*/
|
||||||
|
export function GetSystemInfo(): Promise<$models.SystemInfo | null> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2629436820) as any;
|
||||||
|
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||||
|
return $$createType2($result);
|
||||||
|
}) as any;
|
||||||
|
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||||
|
return $typingPromise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerGC 手动触发垃圾回收
|
* TriggerGC 手动触发垃圾回收
|
||||||
*/
|
*/
|
||||||
@@ -44,3 +56,5 @@ export function TriggerGC(): Promise<void> & { cancel(): void } {
|
|||||||
|
|
||||||
// Private type creation functions
|
// Private type creation functions
|
||||||
const $$createType0 = $models.MemoryStats.createFrom;
|
const $$createType0 = $models.MemoryStats.createFrom;
|
||||||
|
const $$createType1 = $models.SystemInfo.createFrom;
|
||||||
|
const $$createType2 = $Create.Nullable($$createType1);
|
||||||
|
|||||||
55
frontend/bindings/voidraft/internal/services/testservice.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TestService 测试服务 - 仅在开发环境使用
|
||||||
|
* @module
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClearAll 清除所有测试状态
|
||||||
|
*/
|
||||||
|
export function ClearAll(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2179720854) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup 服务启动时调用
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(617408198, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TestBadge 测试Badge功能
|
||||||
|
*/
|
||||||
|
export function TestBadge(text: string): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(4242952145, text) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TestNotification 测试通知功能
|
||||||
|
*/
|
||||||
|
export function TestNotification(title: string, subtitle: string, body: string): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1697553289, title, subtitle, body) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TestUpdateNotification 测试更新通知
|
||||||
|
*/
|
||||||
|
export function TestUpdateNotification(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3091730060) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
80
frontend/bindings/voidraft/internal/services/themeservice.ts
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ThemeService 主题服务
|
||||||
|
* @module
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore: Unused imports
|
||||||
|
import * as models$0 from "../models/models.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetAllThemes 获取所有主题
|
||||||
|
*/
|
||||||
|
export function GetAllThemes(): Promise<(models$0.Theme | null)[]> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2425053076) as any;
|
||||||
|
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||||
|
return $$createType2($result);
|
||||||
|
}) as any;
|
||||||
|
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||||
|
return $typingPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetThemeByID 根据ID或名称获取主题
|
||||||
|
* 如果 id > 0,按ID查询;如果 id = 0,按名称查询
|
||||||
|
*/
|
||||||
|
export function GetThemeByIdOrName(id: number, ...name: string[]): Promise<models$0.Theme | null> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(127385338, id, name) as any;
|
||||||
|
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||||
|
return $$createType1($result);
|
||||||
|
}) as any;
|
||||||
|
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||||
|
return $typingPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ResetTheme 重置主题为预设配置
|
||||||
|
*/
|
||||||
|
export function ResetTheme(id: number, ...name: string[]): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1806334457, id, name) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceShutdown 服务关闭
|
||||||
|
*/
|
||||||
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1676749034) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup 服务启动时初始化
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2915959937, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UpdateTheme 更新主题
|
||||||
|
*/
|
||||||
|
export function UpdateTheme(id: number, colors: models$0.ThemeColorConfig): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(70189749, id, colors) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private type creation functions
|
||||||
|
const $$createType0 = models$0.Theme.createFrom;
|
||||||
|
const $$createType1 = $Create.Nullable($$createType0);
|
||||||
|
const $$createType2 = $Create.Array($$createType1);
|
||||||
@@ -14,27 +14,6 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import * as translator$0 from "../common/translator/models.js";
|
import * as translator$0 from "../common/translator/models.js";
|
||||||
|
|
||||||
/**
|
|
||||||
* GetAvailableTranslators 获取所有可用翻译器类型
|
|
||||||
* @returns {[]string} 翻译器类型列表
|
|
||||||
*/
|
|
||||||
export function GetAvailableTranslators(): Promise<string[]> & { cancel(): void } {
|
|
||||||
let $resultPromise = $Call.ByID(1186597995) as any;
|
|
||||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
|
||||||
return $$createType0($result);
|
|
||||||
}) as any;
|
|
||||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
|
||||||
return $typingPromise;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GetStandardLanguageCode 获取标准化的语言代码
|
|
||||||
*/
|
|
||||||
export function GetStandardLanguageCode(translatorType: translator$0.TranslatorType, languageCode: string): Promise<string> & { cancel(): void } {
|
|
||||||
let $resultPromise = $Call.ByID(1158131995, translatorType, languageCode) as any;
|
|
||||||
return $resultPromise;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GetTranslatorLanguages 获取翻译器的语言列表
|
* GetTranslatorLanguages 获取翻译器的语言列表
|
||||||
* @param {string} translatorType - 翻译器类型 ("google", "bing", "youdao", "deepl")
|
* @param {string} translatorType - 翻译器类型 ("google", "bing", "youdao", "deepl")
|
||||||
@@ -43,6 +22,19 @@ export function GetStandardLanguageCode(translatorType: translator$0.TranslatorT
|
|||||||
*/
|
*/
|
||||||
export function GetTranslatorLanguages(translatorType: translator$0.TranslatorType): Promise<{ [_: string]: translator$0.LanguageInfo }> & { cancel(): void } {
|
export function GetTranslatorLanguages(translatorType: translator$0.TranslatorType): Promise<{ [_: string]: translator$0.LanguageInfo }> & { cancel(): void } {
|
||||||
let $resultPromise = $Call.ByID(3976114458, translatorType) as any;
|
let $resultPromise = $Call.ByID(3976114458, translatorType) as any;
|
||||||
|
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||||
|
return $$createType1($result);
|
||||||
|
}) as any;
|
||||||
|
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||||
|
return $typingPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetTranslators 获取所有可用翻译器类型
|
||||||
|
* @returns {[]string} 翻译器类型列表
|
||||||
|
*/
|
||||||
|
export function GetTranslators(): Promise<string[]> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(3720069432) as any;
|
||||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||||
return $$createType2($result);
|
return $$createType2($result);
|
||||||
}) as any;
|
}) as any;
|
||||||
@@ -73,6 +65,6 @@ export function TranslateWith(text: string, $from: string, to: string, translato
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Private type creation functions
|
// Private type creation functions
|
||||||
const $$createType0 = $Create.Array($Create.Any);
|
const $$createType0 = translator$0.LanguageInfo.createFrom;
|
||||||
const $$createType1 = translator$0.LanguageInfo.createFrom;
|
const $$createType1 = $Create.Map($Create.Any, $$createType0);
|
||||||
const $$createType2 = $Create.Map($Create.Any, $$createType1);
|
const $$createType2 = $Create.Array($Create.Any);
|
||||||
|
|||||||
@@ -10,9 +10,13 @@
|
|||||||
// @ts-ignore: Unused imports
|
// @ts-ignore: Unused imports
|
||||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
/**
|
||||||
// @ts-ignore: Unused imports
|
* AutoShowHide 自动显示/隐藏主窗口
|
||||||
import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
*/
|
||||||
|
export function AutoShowHide(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(4044219428) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HandleWindowClose 处理窗口关闭事件
|
* HandleWindowClose 处理窗口关闭事件
|
||||||
@@ -38,14 +42,6 @@ export function MinimizeButtonClicked(): Promise<void> & { cancel(): void } {
|
|||||||
return $resultPromise;
|
return $resultPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* SetAppReferences 设置应用引用
|
|
||||||
*/
|
|
||||||
export function SetAppReferences(app: application$0.App | null, mainWindow: application$0.WebviewWindow | null): Promise<void> & { cancel(): void } {
|
|
||||||
let $resultPromise = $Call.ByID(3544515719, app, mainWindow) as any;
|
|
||||||
return $resultPromise;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ShouldMinimizeToTray 检查是否应该最小化到托盘
|
* ShouldMinimizeToTray 检查是否应该最小化到托盘
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WindowService 窗口管理服务
|
||||||
|
* @module
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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 application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetOpenWindows 获取所有打开的文档窗口
|
||||||
|
*/
|
||||||
|
export function GetOpenWindows(): Promise<application$0.Window[]> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1464997251) as any;
|
||||||
|
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||||
|
return $$createType0($result);
|
||||||
|
}) as any;
|
||||||
|
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||||
|
return $typingPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IsDocumentWindowOpen 检查指定文档的窗口是否已打开
|
||||||
|
*/
|
||||||
|
export function IsDocumentWindowOpen(documentID: number): Promise<boolean> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1735611839, documentID) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OpenDocumentWindow 为指定文档ID打开新窗口
|
||||||
|
*/
|
||||||
|
export function OpenDocumentWindow(documentID: number): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(494716471, documentID) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceShutdown 实现服务关闭接口
|
||||||
|
*/
|
||||||
|
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(202192783) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServiceStartup 服务启动时初始化
|
||||||
|
*/
|
||||||
|
export function ServiceStartup(options: application$0.ServiceOptions): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(2432987694, options) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private type creation functions
|
||||||
|
const $$createType0 = $Create.Array($Create.Any);
|
||||||
9
frontend/components.d.ts
vendored
@@ -1,8 +1,11 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
// biome-ignore lint: disable
|
||||||
|
// oxlint-disable
|
||||||
|
// ------
|
||||||
// Generated by unplugin-vue-components
|
// Generated by unplugin-vue-components
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
// biome-ignore lint: disable
|
|
||||||
export {}
|
export {}
|
||||||
|
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
@@ -11,10 +14,14 @@ declare module 'vue' {
|
|||||||
BlockLanguageSelector: typeof import('./src/components/toolbar/BlockLanguageSelector.vue')['default']
|
BlockLanguageSelector: typeof import('./src/components/toolbar/BlockLanguageSelector.vue')['default']
|
||||||
DocumentSelector: typeof import('./src/components/toolbar/DocumentSelector.vue')['default']
|
DocumentSelector: typeof import('./src/components/toolbar/DocumentSelector.vue')['default']
|
||||||
LinuxTitleBar: typeof import('./src/components/titlebar/LinuxTitleBar.vue')['default']
|
LinuxTitleBar: typeof import('./src/components/titlebar/LinuxTitleBar.vue')['default']
|
||||||
|
LoadingScreen: typeof import('./src/components/loading/LoadingScreen.vue')['default']
|
||||||
MacOSTitleBar: typeof import('./src/components/titlebar/MacOSTitleBar.vue')['default']
|
MacOSTitleBar: typeof import('./src/components/titlebar/MacOSTitleBar.vue')['default']
|
||||||
MemoryMonitor: typeof import('./src/components/monitor/MemoryMonitor.vue')['default']
|
MemoryMonitor: typeof import('./src/components/monitor/MemoryMonitor.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
|
TabContainer: typeof import('./src/components/tabs/TabContainer.vue')['default']
|
||||||
|
TabContextMenu: typeof import('./src/components/tabs/TabContextMenu.vue')['default']
|
||||||
|
TabItem: typeof import('./src/components/tabs/TabItem.vue')['default']
|
||||||
Toolbar: typeof import('./src/components/toolbar/Toolbar.vue')['default']
|
Toolbar: typeof import('./src/components/toolbar/Toolbar.vue')['default']
|
||||||
WindowsTitleBar: typeof import('./src/components/titlebar/WindowsTitleBar.vue')['default']
|
WindowsTitleBar: typeof import('./src/components/titlebar/WindowsTitleBar.vue')['default']
|
||||||
WindowTitleBar: typeof import('./src/components/titlebar/WindowTitleBar.vue')['default']
|
WindowTitleBar: typeof import('./src/components/titlebar/WindowTitleBar.vue')['default']
|
||||||
|
|||||||
130
frontend/docs/.vitepress/config.ts
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
import {defineConfig} from 'vitepress'
|
||||||
|
const base = '/'
|
||||||
|
// https://vitepress.dev/reference/site-config
|
||||||
|
export default defineConfig({
|
||||||
|
base: base,
|
||||||
|
title: "voidraft",
|
||||||
|
description: "An elegant text snippet recording tool designed for developers.",
|
||||||
|
srcDir: 'src',
|
||||||
|
assetsDir: 'assets',
|
||||||
|
cacheDir: './.vitepress/cache',
|
||||||
|
outDir: './.vitepress/dist',
|
||||||
|
srcExclude: [],
|
||||||
|
ignoreDeadLinks: false,
|
||||||
|
head: [
|
||||||
|
["link", {rel: "icon", type: "image/png", href: "/icon/favicon-96x96.png", sizes: "96x96"}],
|
||||||
|
["link", {rel: "icon", type: "image/svg+xml", href: "/icon/favicon.svg"}],
|
||||||
|
["link", {rel: "shortcut icon", href: "/icon/favicon.ico"}],
|
||||||
|
["link", {rel: "apple-touch-icon", sizes: "180x180", href: "/icon/apple-touch-icon.png"}],
|
||||||
|
["meta", {name: "apple-mobile-web-app-title", content: "voidraft"}],
|
||||||
|
["link", {rel: "manifest", href: "/icon/site.webmanifest"}],
|
||||||
|
['meta', {name: 'viewport', content: 'width=device-width,initial-scale=1'}]
|
||||||
|
],
|
||||||
|
|
||||||
|
// 国际化配置
|
||||||
|
locales: {
|
||||||
|
root: {
|
||||||
|
label: 'English',
|
||||||
|
lang: 'en-US',
|
||||||
|
description: 'An elegant text snippet recording tool designed for developers.',
|
||||||
|
themeConfig: {
|
||||||
|
logo: '/icon/logo.png',
|
||||||
|
siteTitle: 'voidraft',
|
||||||
|
nav: [
|
||||||
|
{text: 'Home', link: '/'},
|
||||||
|
{text: 'Guide', link: '/guide/introduction'}
|
||||||
|
],
|
||||||
|
sidebar: {
|
||||||
|
'/guide/': [
|
||||||
|
{
|
||||||
|
text: 'Getting Started',
|
||||||
|
items: [
|
||||||
|
{text: 'Introduction', link: '/guide/introduction'},
|
||||||
|
{text: 'Installation', link: '/guide/installation'},
|
||||||
|
{text: 'Quick Start', link: '/guide/getting-started'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Features',
|
||||||
|
items: [
|
||||||
|
{text: 'Overview', link: '/guide/features'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
socialLinks: [
|
||||||
|
{icon: 'github', link: 'https://github.com/landaiqing/voidraft'}
|
||||||
|
],
|
||||||
|
outline: {
|
||||||
|
label: 'On this page'
|
||||||
|
},
|
||||||
|
lastUpdated: {
|
||||||
|
text: 'Last updated'
|
||||||
|
},
|
||||||
|
docFooter: {
|
||||||
|
prev: 'Previous',
|
||||||
|
next: 'Next'
|
||||||
|
},
|
||||||
|
darkModeSwitchLabel: 'Appearance',
|
||||||
|
sidebarMenuLabel: 'Menu',
|
||||||
|
returnToTopLabel: 'Return to top',
|
||||||
|
footer: {
|
||||||
|
message: 'Released under the MIT License.',
|
||||||
|
copyright: 'Copyright © 2025-present landaiqing'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
zh: {
|
||||||
|
label: '简体中文',
|
||||||
|
lang: 'zh-CN',
|
||||||
|
link: '/zh/',
|
||||||
|
description: '一个为开发者设计的优雅文本片段记录工具',
|
||||||
|
themeConfig: {
|
||||||
|
logo: '/icon/logo.png',
|
||||||
|
siteTitle: 'voidraft',
|
||||||
|
nav: [
|
||||||
|
{text: '首页', link: '/zh/'},
|
||||||
|
{text: '指南', link: '/zh/guide/introduction'}
|
||||||
|
],
|
||||||
|
sidebar: {
|
||||||
|
'/zh/guide/': [
|
||||||
|
{
|
||||||
|
text: '开始使用',
|
||||||
|
items: [
|
||||||
|
{text: '简介', link: '/zh/guide/introduction'},
|
||||||
|
{text: '安装', link: '/zh/guide/installation'},
|
||||||
|
{text: '快速开始', link: '/zh/guide/getting-started'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '功能特性',
|
||||||
|
items: [
|
||||||
|
{text: '功能概览', link: '/zh/guide/features'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
socialLinks: [
|
||||||
|
{icon: 'github', link: 'https://github.com/landaiqing/voidraft'}
|
||||||
|
],
|
||||||
|
outline: {
|
||||||
|
label: '本页目录'
|
||||||
|
},
|
||||||
|
lastUpdated: {
|
||||||
|
text: '最后更新'
|
||||||
|
},
|
||||||
|
docFooter: {
|
||||||
|
prev: '上一页',
|
||||||
|
next: '下一页'
|
||||||
|
},
|
||||||
|
darkModeSwitchLabel: '外观',
|
||||||
|
sidebarMenuLabel: '菜单',
|
||||||
|
returnToTopLabel: '返回顶部',
|
||||||
|
footer: {
|
||||||
|
message: 'Released under the MIT License.',
|
||||||
|
copyright: 'Copyright © 2025-present landaiqing'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
6
frontend/docs/.vitepress/theme/index.css
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
@import "style/var.css";
|
||||||
|
@import "style/blur.css";
|
||||||
|
@import "style/badge.css";
|
||||||
|
@import "style/grid.css";
|
||||||
|
|
||||||
|
|
||||||
17
frontend/docs/.vitepress/theme/index.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
// https://vitepress.dev/guide/custom-theme
|
||||||
|
import { h } from 'vue'
|
||||||
|
import type { Theme } from 'vitepress'
|
||||||
|
import DefaultTheme from 'vitepress/theme'
|
||||||
|
import './index.css'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
extends: DefaultTheme,
|
||||||
|
Layout: () => {
|
||||||
|
return h(DefaultTheme.Layout, null, {
|
||||||
|
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
||||||
|
})
|
||||||
|
},
|
||||||
|
enhanceApp({ app, router, siteData }) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
} satisfies Theme
|
||||||
21
frontend/docs/.vitepress/theme/style/badge.css
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/* 提示框背景颜色 */
|
||||||
|
:root {
|
||||||
|
--vp-custom-block-tip-bg: var(--vp-c-green-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 提示框 */
|
||||||
|
.custom-block.tip {
|
||||||
|
border-color: var(--vp-c-green-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 警告框 */
|
||||||
|
.custom-block.warning {
|
||||||
|
/* border-color: #d97706; */
|
||||||
|
border-color: var(--vp-c-yellow-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 危险框 */
|
||||||
|
.custom-block.danger {
|
||||||
|
/* border-color: #f43f5e; */
|
||||||
|
border-color: var(--vp-c-red-2);
|
||||||
|
}
|
||||||
73
frontend/docs/.vitepress/theme/style/blur.css
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/* .vitepress/theme/style/blur.css */
|
||||||
|
:root {
|
||||||
|
/* 首页导航 */
|
||||||
|
.VPNavBar {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 文档页导航两侧 */
|
||||||
|
.VPNavBar:not(.home) {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
/* 文档页导航两侧 */
|
||||||
|
.VPNavBar:not(.home) {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 首页下滑后导航两侧 */
|
||||||
|
.VPNavBar:not(.has-sidebar):not(.home.top) {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
/* 文档页导航中间 */
|
||||||
|
.VPNavBar:not(.home.top) .content-body {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 首页下滑后导航中间 */
|
||||||
|
.VPNavBar:not(.has-sidebar):not(.home.top) .content-body {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 分割线 */
|
||||||
|
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
/* 文档页分割线 */
|
||||||
|
.VPNavBar:not(.home.top) .divider-line {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 首页分割线 */
|
||||||
|
.VPNavBar:not(.has-sidebar):not(.home.top) .divider {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 搜索框 VPNavBarSearchButton.vue */
|
||||||
|
.DocSearch-Button {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 移动端大纲栏 */
|
||||||
|
.VPLocalNav {
|
||||||
|
background-color: rgba(255, 255, 255, 0);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
/* 隐藏分割线 */
|
||||||
|
/* border-bottom: 5px solid var(--vp-c-gutter); */
|
||||||
|
border-bottom: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
40
frontend/docs/.vitepress/theme/style/grid.css
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* Grid Background
|
||||||
|
* 网格背景样式 - 为文档页面添加简约的网格背景
|
||||||
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
.VPDoc,
|
||||||
|
.VPHome {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPDoc::before,
|
||||||
|
.VPHome::before {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -1;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 亮色模式网格 */
|
||||||
|
:root:not(.dark) .VPDoc::before,
|
||||||
|
:root:not(.dark) .VPHome::before {
|
||||||
|
background-image:
|
||||||
|
linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
|
||||||
|
linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
|
||||||
|
background-size: 60px 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 暗色模式网格 */
|
||||||
|
.dark .VPDoc::before,
|
||||||
|
.dark .VPHome::before {
|
||||||
|
background-image:
|
||||||
|
linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
|
||||||
|
linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
|
||||||
|
background-size: 60px 60px;
|
||||||
|
}
|
||||||
|
|
||||||
137
frontend/docs/.vitepress/theme/style/var.css
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/**
|
||||||
|
* Customize default theme styling by overriding CSS variables:
|
||||||
|
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Colors
|
||||||
|
*
|
||||||
|
* Each colors have exact same color scale system with 3 levels of solid
|
||||||
|
* colors with different brightness, and 1 soft color.
|
||||||
|
*
|
||||||
|
* - `XXX-1`: The most solid color used mainly for colored text. It must
|
||||||
|
* satisfy the contrast ratio against when used on top of `XXX-soft`.
|
||||||
|
*
|
||||||
|
* - `XXX-2`: The color used mainly for hover state of the button.
|
||||||
|
*
|
||||||
|
* - `XXX-3`: The color for solid background, such as bg color of the button.
|
||||||
|
* It must satisfy the contrast ratio with pure white (#ffffff) text on
|
||||||
|
* top of it.
|
||||||
|
*
|
||||||
|
* - `XXX-soft`: The color used for subtle background such as custom container
|
||||||
|
* or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
|
||||||
|
* on top of it.
|
||||||
|
*
|
||||||
|
* The soft color must be semi transparent alpha channel. This is crucial
|
||||||
|
* because it allows adding multiple "soft" colors on top of each other
|
||||||
|
* to create an accent, such as when having inline code block inside
|
||||||
|
* custom containers.
|
||||||
|
*
|
||||||
|
* - `default`: The color used purely for subtle indication without any
|
||||||
|
* special meanings attached to it such as bg color for menu hover state.
|
||||||
|
*
|
||||||
|
* - `brand`: Used for primary brand colors, such as link text, button with
|
||||||
|
* brand theme, etc.
|
||||||
|
*
|
||||||
|
* - `tip`: Used to indicate useful information. The default theme uses the
|
||||||
|
* brand color for this by default.
|
||||||
|
*
|
||||||
|
* - `warning`: Used to indicate warning to the users. Used in custom
|
||||||
|
* container, badges, etc.
|
||||||
|
*
|
||||||
|
* - `danger`: Used to show error, or dangerous message to the users. Used
|
||||||
|
* in custom container, badges, etc.
|
||||||
|
* -------------------------------------------------------------------------- */
|
||||||
|
:root {
|
||||||
|
--vp-c-default-1: var(--vp-c-gray-1);
|
||||||
|
--vp-c-default-2: var(--vp-c-gray-2);
|
||||||
|
--vp-c-default-3: var(--vp-c-gray-3);
|
||||||
|
--vp-c-default-soft: var(--vp-c-gray-soft);
|
||||||
|
|
||||||
|
--vp-c-brand-1: var(--vp-c-indigo-1);
|
||||||
|
--vp-c-brand-2: var(--vp-c-indigo-2);
|
||||||
|
--vp-c-brand-3: var(--vp-c-indigo-3);
|
||||||
|
--vp-c-brand-soft: var(--vp-c-indigo-soft);
|
||||||
|
|
||||||
|
--vp-c-tip-1: var(--vp-c-brand-1);
|
||||||
|
--vp-c-tip-2: var(--vp-c-brand-2);
|
||||||
|
--vp-c-tip-3: var(--vp-c-brand-3);
|
||||||
|
--vp-c-tip-soft: var(--vp-c-brand-soft);
|
||||||
|
|
||||||
|
--vp-c-warning-1: var(--vp-c-yellow-1);
|
||||||
|
--vp-c-warning-2: var(--vp-c-yellow-2);
|
||||||
|
--vp-c-warning-3: var(--vp-c-yellow-3);
|
||||||
|
--vp-c-warning-soft: var(--vp-c-yellow-soft);
|
||||||
|
|
||||||
|
--vp-c-danger-1: var(--vp-c-red-1);
|
||||||
|
--vp-c-danger-2: var(--vp-c-red-2);
|
||||||
|
--vp-c-danger-3: var(--vp-c-red-3);
|
||||||
|
--vp-c-danger-soft: var(--vp-c-red-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component: Button
|
||||||
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--vp-button-brand-border: transparent;
|
||||||
|
--vp-button-brand-text: var(--vp-c-white);
|
||||||
|
--vp-button-brand-bg: var(--vp-c-brand-3);
|
||||||
|
--vp-button-brand-hover-border: transparent;
|
||||||
|
--vp-button-brand-hover-text: var(--vp-c-white);
|
||||||
|
--vp-button-brand-hover-bg: var(--vp-c-brand-2);
|
||||||
|
--vp-button-brand-active-border: transparent;
|
||||||
|
--vp-button-brand-active-text: var(--vp-c-white);
|
||||||
|
--vp-button-brand-active-bg: var(--vp-c-brand-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component: Home
|
||||||
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--vp-home-hero-name-color: transparent;
|
||||||
|
--vp-home-hero-name-background: -webkit-linear-gradient(
|
||||||
|
120deg,
|
||||||
|
#bd34fe 30%,
|
||||||
|
#41d1ff
|
||||||
|
);
|
||||||
|
|
||||||
|
--vp-home-hero-image-background-image: linear-gradient(
|
||||||
|
-45deg,
|
||||||
|
#bd34fe 50%,
|
||||||
|
#47caff 50%
|
||||||
|
);
|
||||||
|
--vp-home-hero-image-filter: blur(44px);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 640px) {
|
||||||
|
:root {
|
||||||
|
--vp-home-hero-image-filter: blur(56px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
:root {
|
||||||
|
--vp-home-hero-image-filter: blur(68px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component: Custom Block
|
||||||
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--vp-custom-block-tip-border: transparent;
|
||||||
|
--vp-custom-block-tip-text: var(--vp-c-text-1);
|
||||||
|
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
|
||||||
|
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component: Algolia
|
||||||
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
.DocSearch {
|
||||||
|
--docsearch-primary-color: var(--vp-c-brand-1) !important;
|
||||||
|
}
|
||||||
163
frontend/docs/src/guide/features.md
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
# Features
|
||||||
|
|
||||||
|
Explore the powerful features that make voidraft a great tool for developers.
|
||||||
|
|
||||||
|
## Block-Based Editing
|
||||||
|
|
||||||
|
voidraft's core feature is its block-based editing system:
|
||||||
|
|
||||||
|
- Each block can have a different programming language
|
||||||
|
- Blocks are separated by delimiters (`∞∞∞language`)
|
||||||
|
- Navigate quickly between blocks
|
||||||
|
- Format each block independently
|
||||||
|
|
||||||
|
## Syntax Highlighting
|
||||||
|
|
||||||
|
Professional syntax highlighting for 30+ languages:
|
||||||
|
|
||||||
|
- Automatic language detection
|
||||||
|
- Customizable color schemes
|
||||||
|
- Support for nested languages
|
||||||
|
- Code folding support
|
||||||
|
|
||||||
|
## HTTP Client
|
||||||
|
|
||||||
|
Built-in HTTP client for API testing:
|
||||||
|
|
||||||
|
### Request Types
|
||||||
|
- GET, POST, PUT, DELETE, PATCH
|
||||||
|
- Custom headers
|
||||||
|
- Multiple body formats: JSON, FormData, URL-encoded, XML, Text
|
||||||
|
|
||||||
|
### Request Variables
|
||||||
|
Define and reuse variables:
|
||||||
|
|
||||||
|
```http
|
||||||
|
@var {
|
||||||
|
baseUrl: "https://api.example.com",
|
||||||
|
token: "your-api-token"
|
||||||
|
}
|
||||||
|
|
||||||
|
GET "{{baseUrl}}/users" {
|
||||||
|
authorization: "Bearer {{token}}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response Handling
|
||||||
|
- View formatted JSON responses
|
||||||
|
- See response time and size
|
||||||
|
- Inspect headers
|
||||||
|
- Save responses for later
|
||||||
|
|
||||||
|
## Code Formatting
|
||||||
|
|
||||||
|
Integrated Prettier support:
|
||||||
|
|
||||||
|
- Format on save (optional)
|
||||||
|
- Format selection or entire block
|
||||||
|
- Supports JavaScript, TypeScript, CSS, HTML, JSON, and more
|
||||||
|
- Customizable formatting rules
|
||||||
|
|
||||||
|
## Editor Extensions
|
||||||
|
|
||||||
|
### VSCode-Style Search
|
||||||
|
- Find and replace with regex support
|
||||||
|
- Case-sensitive and whole word options
|
||||||
|
- Search across all blocks
|
||||||
|
|
||||||
|
### Minimap
|
||||||
|
- Bird's-eye view of your document
|
||||||
|
- Quick navigation
|
||||||
|
- Customizable size and position
|
||||||
|
|
||||||
|
### Rainbow Brackets
|
||||||
|
- Color-coded bracket pairs
|
||||||
|
- Easier to match brackets
|
||||||
|
- Customizable colors
|
||||||
|
|
||||||
|
### Color Picker
|
||||||
|
- Visual color selection
|
||||||
|
- Supports hex, RGB, HSL
|
||||||
|
- Live preview
|
||||||
|
|
||||||
|
### Translation Tool
|
||||||
|
- Translate selected text
|
||||||
|
- Multiple language support
|
||||||
|
- Quick keyboard access
|
||||||
|
|
||||||
|
### Text Highlighting
|
||||||
|
- Highlight important text
|
||||||
|
- Multiple highlight colors
|
||||||
|
- Persistent highlights
|
||||||
|
|
||||||
|
## Multi-Window Support
|
||||||
|
|
||||||
|
Work efficiently with multiple windows:
|
||||||
|
|
||||||
|
- Each window is independent
|
||||||
|
- Separate documents
|
||||||
|
- Synchronized settings
|
||||||
|
- Window state persistence
|
||||||
|
|
||||||
|
## Theme Customization
|
||||||
|
|
||||||
|
Full control over editor appearance:
|
||||||
|
|
||||||
|
### Built-in Themes
|
||||||
|
- Dark mode
|
||||||
|
- Light mode
|
||||||
|
- Auto-switch based on system
|
||||||
|
|
||||||
|
### Custom Themes
|
||||||
|
- Create your own themes
|
||||||
|
- Customize every color
|
||||||
|
- Save and share themes
|
||||||
|
- Import community themes
|
||||||
|
|
||||||
|
## Auto-Update System
|
||||||
|
|
||||||
|
Stay current with automatic updates:
|
||||||
|
|
||||||
|
- Background update checks
|
||||||
|
- Notification of new versions
|
||||||
|
- One-click update
|
||||||
|
- Update history
|
||||||
|
- Support for multiple update sources (GitHub, Gitea)
|
||||||
|
|
||||||
|
## Data Backup
|
||||||
|
|
||||||
|
Secure your data with Git-based backup:
|
||||||
|
|
||||||
|
- Automatic backups
|
||||||
|
- Manual backup triggers
|
||||||
|
- Support for GitHub and Gitea
|
||||||
|
- Multiple authentication methods (SSH, Token, Password)
|
||||||
|
- Configurable backup intervals
|
||||||
|
|
||||||
|
## Keyboard Shortcuts
|
||||||
|
|
||||||
|
Extensive keyboard support:
|
||||||
|
|
||||||
|
- Customizable shortcuts
|
||||||
|
- Vim/Emacs keybindings (planned)
|
||||||
|
- Quick command palette
|
||||||
|
- Context-aware shortcuts
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
|
||||||
|
Built for speed:
|
||||||
|
|
||||||
|
- Fast startup time
|
||||||
|
- Smooth scrolling
|
||||||
|
- Efficient memory usage
|
||||||
|
- Large file support
|
||||||
|
|
||||||
|
## Privacy & Security
|
||||||
|
|
||||||
|
Your data is safe:
|
||||||
|
|
||||||
|
- Local-first storage
|
||||||
|
- Optional cloud backup
|
||||||
|
- No telemetry or tracking
|
||||||
|
- Open source codebase
|
||||||
|
|
||||||
107
frontend/docs/src/guide/getting-started.md
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
# Getting Started
|
||||||
|
|
||||||
|
Learn the basics of using voidraft and create your first document.
|
||||||
|
|
||||||
|
## The Editor Interface
|
||||||
|
|
||||||
|
When you open voidraft, you'll see:
|
||||||
|
|
||||||
|
- **Main Editor**: The central area where you write and edit
|
||||||
|
- **Toolbar**: Quick access to common actions
|
||||||
|
- **Status Bar**: Shows current block language and other info
|
||||||
|
|
||||||
|
## Creating Code Blocks
|
||||||
|
|
||||||
|
voidraft uses a block-based editing system. Each block can have a different language:
|
||||||
|
|
||||||
|
1. Press `Ctrl+Enter` to create a new block
|
||||||
|
2. Type `∞∞∞` followed by a language name (e.g., `∞∞∞javascript`)
|
||||||
|
3. Start coding in that block
|
||||||
|
|
||||||
|
### Supported Languages
|
||||||
|
|
||||||
|
voidraft supports 30+ programming languages including:
|
||||||
|
- JavaScript, TypeScript
|
||||||
|
- Python, Go, Rust
|
||||||
|
- HTML, CSS, Sass
|
||||||
|
- SQL, YAML, JSON
|
||||||
|
- And many more...
|
||||||
|
|
||||||
|
## Basic Operations
|
||||||
|
|
||||||
|
### Navigation
|
||||||
|
|
||||||
|
- `Ctrl+Up/Down`: Move between blocks
|
||||||
|
- `Ctrl+Home/End`: Jump to first/last block
|
||||||
|
- `Ctrl+F`: Search within document
|
||||||
|
|
||||||
|
### Editing
|
||||||
|
|
||||||
|
- `Ctrl+D`: Duplicate current line
|
||||||
|
- `Ctrl+/`: Toggle comment
|
||||||
|
- `Alt+Up/Down`: Move line up/down
|
||||||
|
- `Ctrl+Shift+F`: Format code (if language supports Prettier)
|
||||||
|
|
||||||
|
### Block Management
|
||||||
|
|
||||||
|
- `Ctrl+Enter`: Create new block
|
||||||
|
- `Ctrl+Shift+Enter`: Create block above
|
||||||
|
- `Alt+Delete`: Delete current block
|
||||||
|
|
||||||
|
## Using the HTTP Client
|
||||||
|
|
||||||
|
voidraft includes a built-in HTTP client for testing APIs:
|
||||||
|
|
||||||
|
1. Create a block with HTTP language
|
||||||
|
2. Write your HTTP request:
|
||||||
|
|
||||||
|
```http
|
||||||
|
POST "https://api.example.com/users" {
|
||||||
|
content-type: "application/json"
|
||||||
|
|
||||||
|
@json {
|
||||||
|
name: "John Doe",
|
||||||
|
email: "john@example.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Click the run button to execute the request
|
||||||
|
4. View the response inline
|
||||||
|
|
||||||
|
## Multi-Window Support
|
||||||
|
|
||||||
|
Work on multiple documents simultaneously:
|
||||||
|
|
||||||
|
1. Go to `File > New Window` (or `Ctrl+Shift+N`)
|
||||||
|
2. Each window is independent
|
||||||
|
3. Changes are saved automatically
|
||||||
|
|
||||||
|
## Customizing Themes
|
||||||
|
|
||||||
|
Personalize your editor:
|
||||||
|
|
||||||
|
1. Open Settings (`Ctrl+,`)
|
||||||
|
2. Go to Appearance
|
||||||
|
3. Choose a theme or create your own
|
||||||
|
4. Customize colors to your preference
|
||||||
|
|
||||||
|
## Keyboard Shortcuts
|
||||||
|
|
||||||
|
Learn essential shortcuts:
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
|--------|----------|
|
||||||
|
| New Window | `Ctrl+Shift+N` |
|
||||||
|
| Search | `Ctrl+F` |
|
||||||
|
| Replace | `Ctrl+H` |
|
||||||
|
| Format Code | `Ctrl+Shift+F` |
|
||||||
|
| Toggle Theme | `Ctrl+Shift+T` |
|
||||||
|
| Command Palette | `Ctrl+Shift+P` |
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
Now that you know the basics:
|
||||||
|
|
||||||
|
- Explore [Features](/guide/features) in detail
|
||||||
|
|
||||||
63
frontend/docs/src/guide/installation.md
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# Installation
|
||||||
|
|
||||||
|
This guide will help you install voidraft on your system.
|
||||||
|
|
||||||
|
## System Requirements
|
||||||
|
|
||||||
|
- **Operating System**: Windows 10 or later (macOS and Linux support planned)
|
||||||
|
- **RAM**: 4GB minimum, 8GB recommended
|
||||||
|
- **Disk Space**: 200MB free space
|
||||||
|
|
||||||
|
## Download
|
||||||
|
|
||||||
|
Visit the [releases page](https://github.com/landaiqing/voidraft/releases) and download the latest version for your platform:
|
||||||
|
|
||||||
|
- **Windows**: `voidraft-windows-amd64-installer.exe`
|
||||||
|
|
||||||
|
## Installation Steps
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
1. Download the installer from the releases page
|
||||||
|
2. Run the `voidraft-windows-amd64-installer.exe` file
|
||||||
|
3. Follow the installation wizard
|
||||||
|
4. Launch voidraft from the Start menu or desktop shortcut
|
||||||
|
|
||||||
|
## First Launch
|
||||||
|
|
||||||
|
When you first launch voidraft:
|
||||||
|
|
||||||
|
1. The application will create a data directory to store your documents
|
||||||
|
2. You'll see the main editor interface with a welcome block
|
||||||
|
3. Start typing or create your first code block!
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
voidraft stores its configuration and data in:
|
||||||
|
|
||||||
|
- **Windows**: `%APPDATA%/voidraft/`
|
||||||
|
|
||||||
|
You can customize various settings including:
|
||||||
|
- Editor theme (dark/light mode)
|
||||||
|
- Code formatting preferences
|
||||||
|
- Backup settings
|
||||||
|
- Keyboard shortcuts
|
||||||
|
|
||||||
|
## Updating
|
||||||
|
|
||||||
|
voidraft includes an auto-update feature that will notify you when new versions are available. You can:
|
||||||
|
|
||||||
|
- Check for updates manually from the settings
|
||||||
|
- Enable automatic updates
|
||||||
|
- Choose your preferred update source
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
If you encounter any issues during installation:
|
||||||
|
|
||||||
|
1. Make sure you have administrator privileges
|
||||||
|
2. Check that your antivirus isn't blocking the installation
|
||||||
|
3. Visit our [GitHub issues](https://github.com/landaiqing/voidraft/issues) page for help
|
||||||
|
|
||||||
|
Next: [Getting Started →](/guide/getting-started)
|
||||||
|
|
||||||
50
frontend/docs/src/guide/introduction.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Introduction
|
||||||
|
|
||||||
|
Welcome to voidraft - an elegant text snippet recording tool designed specifically for developers.
|
||||||
|
|
||||||
|
## What is voidraft?
|
||||||
|
|
||||||
|
voidraft is a modern desktop application that helps developers manage text snippets, code blocks, API responses, meeting notes, and daily to-do lists. It provides a smooth and elegant editing experience with powerful features tailored for development workflows.
|
||||||
|
|
||||||
|
## Key Features
|
||||||
|
|
||||||
|
### Block-Based Editing
|
||||||
|
|
||||||
|
voidraft uses a unique block-based editing system inspired by Heynote. You can split your content into independent code blocks, each with:
|
||||||
|
- Different programming language settings
|
||||||
|
- Syntax highlighting
|
||||||
|
- Independent formatting
|
||||||
|
- Easy navigation between blocks
|
||||||
|
|
||||||
|
### Developer Tools
|
||||||
|
|
||||||
|
- **HTTP Client**: Test APIs directly within the editor
|
||||||
|
- **Code Formatting**: Built-in Prettier support for multiple languages
|
||||||
|
- **Syntax Highlighting**: Support for 30+ programming languages
|
||||||
|
- **Auto Language Detection**: Automatically recognizes code block language types
|
||||||
|
|
||||||
|
### Customization
|
||||||
|
|
||||||
|
- **Custom Themes**: Create and save your own editor themes
|
||||||
|
- **Extensions**: Rich set of editor extensions including minimap, rainbow brackets, color picker, and more
|
||||||
|
- **Multi-Window**: Work on multiple documents simultaneously
|
||||||
|
|
||||||
|
### Data Management
|
||||||
|
|
||||||
|
- **Git-Based Backup**: Automatic backup using Git repositories
|
||||||
|
- **Cloud Sync**: Sync your data across devices
|
||||||
|
- **Auto-Update**: Stay up-to-date with the latest features
|
||||||
|
|
||||||
|
## Why voidraft?
|
||||||
|
|
||||||
|
- **Developer-Focused**: Built with developers' needs in mind
|
||||||
|
- **Modern Stack**: Uses cutting-edge technologies (Wails3, Vue 3, CodeMirror 6)
|
||||||
|
- **Cross-Platform**: Works on Windows (macOS and Linux support planned)
|
||||||
|
- **Open Source**: MIT licensed, community-driven development
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Ready to start? Download the latest version from our [releases page](https://github.com/landaiqing/voidraft/releases) or continue reading the documentation to learn more.
|
||||||
|
|
||||||
|
Next: [Installation →](/guide/installation)
|
||||||
|
|
||||||
56
frontend/docs/src/index.md
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
layout: home
|
||||||
|
|
||||||
|
hero:
|
||||||
|
name: "voidraft"
|
||||||
|
text: "An elegant text snippet recording tool"
|
||||||
|
tagline: Designed for developers, built with modern technology
|
||||||
|
image:
|
||||||
|
src: /img/hero.png
|
||||||
|
alt: "voidraft"
|
||||||
|
actions:
|
||||||
|
- theme: brand
|
||||||
|
text: Get Started
|
||||||
|
link: https://github.com/landaiqing/voidraft/releases
|
||||||
|
- theme: alt
|
||||||
|
text: Documentation
|
||||||
|
link: /guide/introduction
|
||||||
|
|
||||||
|
features:
|
||||||
|
- icon: 📝
|
||||||
|
title: Block-Based Editing
|
||||||
|
details: Split your content into independent code blocks, each with different language settings. Inspired by Heynote's innovative design philosophy.
|
||||||
|
|
||||||
|
- icon: 🎨
|
||||||
|
title: Syntax Highlighting
|
||||||
|
details: Built-in support for 30+ programming languages with automatic language detection and Prettier integration for code formatting.
|
||||||
|
|
||||||
|
- icon: 🌐
|
||||||
|
title: HTTP Client
|
||||||
|
details: Integrated HTTP client with support for multiple request formats including JSON, FormData, XML, and more. Test APIs directly within the editor.
|
||||||
|
|
||||||
|
- icon: 🎯
|
||||||
|
title: Multi-Window Support
|
||||||
|
details: Work on multiple documents simultaneously with independent windows. Each window maintains its own state and configuration.
|
||||||
|
|
||||||
|
- icon: 🎭
|
||||||
|
title: Customizable Themes
|
||||||
|
details: Full theme customization support with dark/light modes. Create and save your own editor themes to match your preferences.
|
||||||
|
|
||||||
|
- icon: 🔧
|
||||||
|
title: Rich Extensions
|
||||||
|
details: VSCode-style search and replace, rainbow brackets, minimap, color picker, translation tool, text highlighting, and more.
|
||||||
|
|
||||||
|
- icon: 🔄
|
||||||
|
title: Auto-Update System
|
||||||
|
details: Built-in self-update mechanism with support for multiple update sources. Stay up-to-date with the latest features and improvements.
|
||||||
|
|
||||||
|
- icon: ☁️
|
||||||
|
title: Git-Based Backup
|
||||||
|
details: Automatic data backup using Git repositories. Supports GitHub, Gitea, with multiple authentication methods including SSH and tokens.
|
||||||
|
|
||||||
|
- icon: ⚡
|
||||||
|
title: Modern Architecture
|
||||||
|
details: Built with Wails3, Vue 3, and CodeMirror 6. Cross-platform desktop application with native performance and modern UI.
|
||||||
|
|
||||||
|
---
|
||||||
BIN
frontend/docs/src/public/icon/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
frontend/docs/src/public/icon/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
frontend/docs/src/public/icon/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
3
frontend/docs/src/public/icon/favicon.svg
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
frontend/docs/src/public/icon/logo.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
21
frontend/docs/src/public/icon/site.webmanifest
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "voidraft",
|
||||||
|
"short_name": "voidraft",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/img/web-app-manifest-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/img/web-app-manifest-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"theme_color": "#ffffff",
|
||||||
|
"background_color": "#ffffff",
|
||||||
|
"display": "standalone"
|
||||||
|
}
|
||||||
BIN
frontend/docs/src/public/icon/web-app-manifest-192x192.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
frontend/docs/src/public/icon/web-app-manifest-512x512.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
frontend/docs/src/public/img/hero.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
163
frontend/docs/src/zh/guide/features.md
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
# 功能特性
|
||||||
|
|
||||||
|
探索 voidraft 的强大功能,让它成为开发者的优秀工具。
|
||||||
|
|
||||||
|
## 块状编辑
|
||||||
|
|
||||||
|
voidraft 的核心功能是其块状编辑系统:
|
||||||
|
|
||||||
|
- 每个块可以有不同的编程语言
|
||||||
|
- 块之间由分隔符分隔(`∞∞∞语言`)
|
||||||
|
- 快速在块之间导航
|
||||||
|
- 独立格式化每个块
|
||||||
|
|
||||||
|
## 语法高亮
|
||||||
|
|
||||||
|
支持 30+ 种语言的专业语法高亮:
|
||||||
|
|
||||||
|
- 自动语言检测
|
||||||
|
- 可自定义配色方案
|
||||||
|
- 支持嵌套语言
|
||||||
|
- 代码折叠支持
|
||||||
|
|
||||||
|
## HTTP 客户端
|
||||||
|
|
||||||
|
用于 API 测试的内置 HTTP 客户端:
|
||||||
|
|
||||||
|
### 请求类型
|
||||||
|
- GET、POST、PUT、DELETE、PATCH
|
||||||
|
- 自定义请求头
|
||||||
|
- 多种请求体格式:JSON、FormData、URL 编码、XML、文本
|
||||||
|
|
||||||
|
### 请求变量
|
||||||
|
定义和重用变量:
|
||||||
|
|
||||||
|
```http
|
||||||
|
@var {
|
||||||
|
baseUrl: "https://api.example.com",
|
||||||
|
token: "your-api-token"
|
||||||
|
}
|
||||||
|
|
||||||
|
GET "{{baseUrl}}/users" {
|
||||||
|
authorization: "Bearer {{token}}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 响应处理
|
||||||
|
- 查看格式化的 JSON 响应
|
||||||
|
- 查看响应时间和大小
|
||||||
|
- 检查响应头
|
||||||
|
- 保存响应以供日后使用
|
||||||
|
|
||||||
|
## 代码格式化
|
||||||
|
|
||||||
|
集成 Prettier 支持:
|
||||||
|
|
||||||
|
- 保存时格式化(可选)
|
||||||
|
- 格式化选区或整个块
|
||||||
|
- 支持 JavaScript、TypeScript、CSS、HTML、JSON 等
|
||||||
|
- 可自定义格式化规则
|
||||||
|
|
||||||
|
## 编辑器扩展
|
||||||
|
|
||||||
|
### VSCode 风格搜索
|
||||||
|
- 查找和替换,支持正则表达式
|
||||||
|
- 区分大小写和全字匹配选项
|
||||||
|
- 跨所有块搜索
|
||||||
|
|
||||||
|
### 小地图
|
||||||
|
- 文档的鸟瞰图
|
||||||
|
- 快速导航
|
||||||
|
- 可自定义大小和位置
|
||||||
|
|
||||||
|
### 彩虹括号
|
||||||
|
- 彩色括号配对
|
||||||
|
- 更容易匹配括号
|
||||||
|
- 可自定义颜色
|
||||||
|
|
||||||
|
### 颜色选择器
|
||||||
|
- 可视化颜色选择
|
||||||
|
- 支持 hex、RGB、HSL
|
||||||
|
- 实时预览
|
||||||
|
|
||||||
|
### 翻译工具
|
||||||
|
- 翻译选定的文本
|
||||||
|
- 支持多种语言
|
||||||
|
- 快速键盘访问
|
||||||
|
|
||||||
|
### 文本高亮
|
||||||
|
- 高亮重要文本
|
||||||
|
- 多种高亮颜色
|
||||||
|
- 持久化高亮
|
||||||
|
|
||||||
|
## 多窗口支持
|
||||||
|
|
||||||
|
高效使用多个窗口:
|
||||||
|
|
||||||
|
- 每个窗口都是独立的
|
||||||
|
- 独立的文档
|
||||||
|
- 同步的设置
|
||||||
|
- 窗口状态持久化
|
||||||
|
|
||||||
|
## 主题自定义
|
||||||
|
|
||||||
|
完全控制编辑器外观:
|
||||||
|
|
||||||
|
### 内置主题
|
||||||
|
- 深色模式
|
||||||
|
- 浅色模式
|
||||||
|
- 根据系统自动切换
|
||||||
|
|
||||||
|
### 自定义主题
|
||||||
|
- 创建你自己的主题
|
||||||
|
- 自定义每种颜色
|
||||||
|
- 保存和分享主题
|
||||||
|
- 导入社区主题
|
||||||
|
|
||||||
|
## 自动更新系统
|
||||||
|
|
||||||
|
通过自动更新保持最新:
|
||||||
|
|
||||||
|
- 后台更新检查
|
||||||
|
- 新版本通知
|
||||||
|
- 一键更新
|
||||||
|
- 更新历史
|
||||||
|
- 支持多个更新源(GitHub、Gitea)
|
||||||
|
|
||||||
|
## 数据备份
|
||||||
|
|
||||||
|
使用基于 Git 的备份保护你的数据:
|
||||||
|
|
||||||
|
- 自动备份
|
||||||
|
- 手动触发备份
|
||||||
|
- 支持 GitHub 和 Gitea
|
||||||
|
- 多种认证方式(SSH、Token、密码)
|
||||||
|
- 可配置备份间隔
|
||||||
|
|
||||||
|
## 键盘快捷键
|
||||||
|
|
||||||
|
广泛的键盘支持:
|
||||||
|
|
||||||
|
- 可自定义快捷键
|
||||||
|
- Vim/Emacs 按键绑定(计划中)
|
||||||
|
- 快速命令面板
|
||||||
|
- 上下文感知快捷键
|
||||||
|
|
||||||
|
## 性能
|
||||||
|
|
||||||
|
专为速度而构建:
|
||||||
|
|
||||||
|
- 快速启动时间
|
||||||
|
- 流畅滚动
|
||||||
|
- 高效内存使用
|
||||||
|
- 支持大文件
|
||||||
|
|
||||||
|
## 隐私与安全
|
||||||
|
|
||||||
|
你的数据是安全的:
|
||||||
|
|
||||||
|
- 本地优先存储
|
||||||
|
- 可选云备份
|
||||||
|
- 无遥测或跟踪
|
||||||
|
- 开源代码库
|
||||||
|
|
||||||
107
frontend/docs/src/zh/guide/getting-started.md
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
# 快速开始
|
||||||
|
|
||||||
|
学习使用 voidraft 的基础知识并创建你的第一个文档。
|
||||||
|
|
||||||
|
## 编辑器界面
|
||||||
|
|
||||||
|
当你打开 voidraft 时,你将看到:
|
||||||
|
|
||||||
|
- **主编辑器**:编写和编辑的中心区域
|
||||||
|
- **工具栏**:快速访问常用操作
|
||||||
|
- **状态栏**:显示当前块的语言和其他信息
|
||||||
|
|
||||||
|
## 创建代码块
|
||||||
|
|
||||||
|
voidraft 使用基于块的编辑系统。每个块可以有不同的语言:
|
||||||
|
|
||||||
|
1. 按 `Ctrl+Enter` 创建新块
|
||||||
|
2. 输入 `∞∞∞` 后跟语言名称(例如 `∞∞∞javascript`)
|
||||||
|
3. 在该块中开始编码
|
||||||
|
|
||||||
|
### 支持的语言
|
||||||
|
|
||||||
|
voidraft 支持 30+ 种编程语言,包括:
|
||||||
|
- JavaScript、TypeScript
|
||||||
|
- Python、Go、Rust
|
||||||
|
- HTML、CSS、Sass
|
||||||
|
- SQL、YAML、JSON
|
||||||
|
- 以及更多...
|
||||||
|
|
||||||
|
## 基本操作
|
||||||
|
|
||||||
|
### 导航
|
||||||
|
|
||||||
|
- `Ctrl+Up/Down`:在块之间移动
|
||||||
|
- `Ctrl+Home/End`:跳转到第一个/最后一个块
|
||||||
|
- `Ctrl+F`:在文档中搜索
|
||||||
|
|
||||||
|
### 编辑
|
||||||
|
|
||||||
|
- `Ctrl+D`:复制当前行
|
||||||
|
- `Ctrl+/`:切换注释
|
||||||
|
- `Alt+Up/Down`:向上/向下移动行
|
||||||
|
- `Ctrl+Shift+F`:格式化代码(如果语言支持 Prettier)
|
||||||
|
|
||||||
|
### 块管理
|
||||||
|
|
||||||
|
- `Ctrl+Enter`:创建新块
|
||||||
|
- `Ctrl+Shift+Enter`:在上方创建块
|
||||||
|
- `Alt+Delete`:删除当前块
|
||||||
|
|
||||||
|
## 使用 HTTP 客户端
|
||||||
|
|
||||||
|
voidraft 包含用于测试 API 的内置 HTTP 客户端:
|
||||||
|
|
||||||
|
1. 创建一个 HTTP 语言的块
|
||||||
|
2. 编写你的 HTTP 请求:
|
||||||
|
|
||||||
|
```http
|
||||||
|
POST "https://api.example.com/users" {
|
||||||
|
content-type: "application/json"
|
||||||
|
|
||||||
|
@json {
|
||||||
|
name: "张三",
|
||||||
|
email: "zhangsan@example.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 点击运行按钮执行请求
|
||||||
|
4. 内联查看响应
|
||||||
|
|
||||||
|
## 多窗口支持
|
||||||
|
|
||||||
|
同时处理多个文档:
|
||||||
|
|
||||||
|
1. 转到 `文件 > 新建窗口`(或 `Ctrl+Shift+N`)
|
||||||
|
2. 每个窗口都是独立的
|
||||||
|
3. 更改会自动保存
|
||||||
|
|
||||||
|
## 自定义主题
|
||||||
|
|
||||||
|
个性化你的编辑器:
|
||||||
|
|
||||||
|
1. 打开设置(`Ctrl+,`)
|
||||||
|
2. 转到外观
|
||||||
|
3. 选择主题或创建自己的主题
|
||||||
|
4. 根据你的偏好自定义颜色
|
||||||
|
|
||||||
|
## 键盘快捷键
|
||||||
|
|
||||||
|
学习基本快捷键:
|
||||||
|
|
||||||
|
| 操作 | 快捷键 |
|
||||||
|
|-----|--------|
|
||||||
|
| 新建窗口 | `Ctrl+Shift+N` |
|
||||||
|
| 搜索 | `Ctrl+F` |
|
||||||
|
| 替换 | `Ctrl+H` |
|
||||||
|
| 格式化代码 | `Ctrl+Shift+F` |
|
||||||
|
| 切换主题 | `Ctrl+Shift+T` |
|
||||||
|
| 命令面板 | `Ctrl+Shift+P` |
|
||||||
|
|
||||||
|
## 下一步
|
||||||
|
|
||||||
|
现在你已经了解了基础知识:
|
||||||
|
|
||||||
|
- 详细探索[功能特性](/zh/guide/features)
|
||||||
|
|
||||||
63
frontend/docs/src/zh/guide/installation.md
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# 安装
|
||||||
|
|
||||||
|
本指南将帮助你在系统上安装 voidraft。
|
||||||
|
|
||||||
|
## 系统要求
|
||||||
|
|
||||||
|
- **操作系统**:Windows 10 或更高版本(macOS 和 Linux 支持计划中)
|
||||||
|
- **内存**:最低 4GB,推荐 8GB
|
||||||
|
- **磁盘空间**:200MB 可用空间
|
||||||
|
|
||||||
|
## 下载
|
||||||
|
|
||||||
|
访问[发布页面](https://github.com/landaiqing/voidraft/releases)并下载适合你平台的最新版本:
|
||||||
|
|
||||||
|
- **Windows**:`voidraft-windows-amd64-installer.exe`
|
||||||
|
|
||||||
|
## 安装步骤
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
1. 从发布页面下载安装程序
|
||||||
|
2. 运行 `voidraft-windows-amd64-installer.exe` 文件
|
||||||
|
3. 按照安装向导操作
|
||||||
|
4. 从开始菜单或桌面快捷方式启动 voidraft
|
||||||
|
|
||||||
|
## 首次启动
|
||||||
|
|
||||||
|
首次启动 voidraft 时:
|
||||||
|
|
||||||
|
1. 应用程序将创建一个数据目录来存储你的文档
|
||||||
|
2. 你将看到带有欢迎块的主编辑器界面
|
||||||
|
3. 开始输入或创建你的第一个代码块!
|
||||||
|
|
||||||
|
## 配置
|
||||||
|
|
||||||
|
voidraft 将其配置和数据存储在:
|
||||||
|
|
||||||
|
- **Windows**:`%APPDATA%/voidraft/`
|
||||||
|
|
||||||
|
你可以自定义各种设置,包括:
|
||||||
|
- 编辑器主题(深色/浅色模式)
|
||||||
|
- 代码格式化偏好
|
||||||
|
- 备份设置
|
||||||
|
- 键盘快捷键
|
||||||
|
|
||||||
|
## 更新
|
||||||
|
|
||||||
|
voidraft 包含自动更新功能,会在有新版本时通知你。你可以:
|
||||||
|
|
||||||
|
- 从设置中手动检查更新
|
||||||
|
- 启用自动更新
|
||||||
|
- 选择首选的更新源
|
||||||
|
|
||||||
|
## 故障排除
|
||||||
|
|
||||||
|
如果在安装过程中遇到任何问题:
|
||||||
|
|
||||||
|
1. 确保你有管理员权限
|
||||||
|
2. 检查杀毒软件是否阻止了安装
|
||||||
|
3. 访问我们的 [GitHub issues](https://github.com/landaiqing/voidraft/issues) 页面寻求帮助
|
||||||
|
|
||||||
|
下一步:[快速开始 →](/zh/guide/getting-started)
|
||||||
|
|
||||||
50
frontend/docs/src/zh/guide/introduction.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# 简介
|
||||||
|
|
||||||
|
欢迎使用 voidraft —— 一个专为开发者设计的优雅文本片段记录工具。
|
||||||
|
|
||||||
|
## 什么是 voidraft?
|
||||||
|
|
||||||
|
voidraft 是一个现代化的桌面应用程序,帮助开发者管理文本片段、代码块、API 响应、会议笔记和日常待办事项。它为开发工作流程提供了流畅而优雅的编辑体验和强大的功能。
|
||||||
|
|
||||||
|
## 核心特性
|
||||||
|
|
||||||
|
### 块状编辑模式
|
||||||
|
|
||||||
|
voidraft 使用受 Heynote 启发的独特块状编辑系统。你可以将内容分割为独立的代码块,每个块具有:
|
||||||
|
- 不同的编程语言设置
|
||||||
|
- 语法高亮
|
||||||
|
- 独立格式化
|
||||||
|
- 轻松在块之间导航
|
||||||
|
|
||||||
|
### 开发者工具
|
||||||
|
|
||||||
|
- **HTTP 客户端**:直接在编辑器中测试 API
|
||||||
|
- **代码格式化**:内置 Prettier 支持多种语言
|
||||||
|
- **语法高亮**:支持 30+ 种编程语言
|
||||||
|
- **自动语言检测**:自动识别代码块语言类型
|
||||||
|
|
||||||
|
### 自定义
|
||||||
|
|
||||||
|
- **自定义主题**:创建并保存你自己的编辑器主题
|
||||||
|
- **扩展功能**:丰富的编辑器扩展,包括小地图、彩虹括号、颜色选择器等
|
||||||
|
- **多窗口**:同时处理多个文档
|
||||||
|
|
||||||
|
### 数据管理
|
||||||
|
|
||||||
|
- **Git 备份**:使用 Git 仓库自动备份
|
||||||
|
- **云同步**:跨设备同步你的数据
|
||||||
|
- **自动更新**:及时获取最新功能
|
||||||
|
|
||||||
|
## 为什么选择 voidraft?
|
||||||
|
|
||||||
|
- **专注开发者**:考虑开发者需求而构建
|
||||||
|
- **现代技术栈**:使用前沿技术(Wails3、Vue 3、CodeMirror 6)
|
||||||
|
- **跨平台**:支持 Windows(macOS 和 Linux 支持计划中)
|
||||||
|
- **开源**:MIT 许可证,社区驱动开发
|
||||||
|
|
||||||
|
## 开始使用
|
||||||
|
|
||||||
|
准备好开始了吗?从我们的[发布页面](https://github.com/landaiqing/voidraft/releases)下载最新版本,或继续阅读文档了解更多。
|
||||||
|
|
||||||
|
下一步:[安装 →](/zh/guide/installation)
|
||||||
|
|
||||||
56
frontend/docs/src/zh/index.md
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
layout: home
|
||||||
|
|
||||||
|
hero:
|
||||||
|
name: "voidraft"
|
||||||
|
text: "优雅的文本片段记录工具"
|
||||||
|
tagline: 为开发者设计,用现代技术打造
|
||||||
|
image:
|
||||||
|
src: /img/hero.png
|
||||||
|
alt: "voidraft"
|
||||||
|
actions:
|
||||||
|
- theme: brand
|
||||||
|
text: 开始使用
|
||||||
|
link: https://github.com/landaiqing/voidraft/releases
|
||||||
|
- theme: alt
|
||||||
|
text: 使用文档
|
||||||
|
link: /zh/guide/introduction
|
||||||
|
|
||||||
|
features:
|
||||||
|
- icon: 📝
|
||||||
|
title: 块状编辑模式
|
||||||
|
details: 将内容分割为独立的代码块,每个块可设置不同语言。继承了 Heynote 优雅的块状编辑理念。
|
||||||
|
|
||||||
|
- icon: 🎨
|
||||||
|
title: 语法高亮
|
||||||
|
details: 内置支持 30+ 种编程语言的语法高亮,自动语言检测,集成 Prettier 代码格式化工具。
|
||||||
|
|
||||||
|
- icon: 🌐
|
||||||
|
title: HTTP 客户端
|
||||||
|
details: 集成 HTTP 客户端,支持 JSON、FormData、XML 等多种请求格式。直接在编辑器中测试 API。
|
||||||
|
|
||||||
|
- icon: 🎯
|
||||||
|
title: 多窗口支持
|
||||||
|
details: 同时编辑多个文档,每个窗口独立维护自己的状态和配置。
|
||||||
|
|
||||||
|
- icon: 🎭
|
||||||
|
title: 主题自定义
|
||||||
|
details: 完整的主题自定义支持,支持深色/浅色模式。创建并保存你自己的编辑器主题。
|
||||||
|
|
||||||
|
- icon: 🔧
|
||||||
|
title: 丰富的扩展
|
||||||
|
details: VSCode 风格搜索替换、彩虹括号、小地图、颜色选择器、翻译工具、文本高亮等实用扩展。
|
||||||
|
|
||||||
|
- icon: 🔄
|
||||||
|
title: 自动更新系统
|
||||||
|
details: 内置自我更新机制,支持多个更新源。及时获取最新功能和改进。
|
||||||
|
|
||||||
|
- icon: ☁️
|
||||||
|
title: Git 备份
|
||||||
|
details: 基于 Git 的自动数据备份。支持 GitHub、Gitea,提供 SSH、Token 等多种认证方式。
|
||||||
|
|
||||||
|
- icon: ⚡
|
||||||
|
title: 现代化架构
|
||||||
|
details: 采用 Wails3、Vue 3 和 CodeMirror 6 构建。跨平台桌面应用,原生性能,现代化界面。
|
||||||
|
|
||||||
|
---
|
||||||
@@ -50,7 +50,11 @@ export default defineConfig([
|
|||||||
'.local',
|
'.local',
|
||||||
'/bin',
|
'/bin',
|
||||||
'Dockerfile',
|
'Dockerfile',
|
||||||
'**/bindings/'
|
'**/bindings/',
|
||||||
|
'*.js',
|
||||||
|
'**/*.js',
|
||||||
|
'**/*.cjs',
|
||||||
|
'**/*.mjs',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
@@ -9,5 +9,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
|
<script src="/math.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
8379
frontend/package-lock.json
generated
@@ -5,77 +5,106 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host --mode development",
|
"dev": "vite --host --mode development",
|
||||||
"build:dev": "vue-tsc && vite build --minify false --mode development",
|
"build:dev": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" vue-tsc && cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" vite build --minify false --mode development",
|
||||||
"build": "vue-tsc && vite build --mode production",
|
"build": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" vue-tsc && cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" vite build --mode production",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"lint:fix": "eslint --fix"
|
"lint:fix": "eslint --fix",
|
||||||
|
"build:lang-parser": "node src/views/editor/extensions/codeblock/lang-parser/build-parser.js",
|
||||||
|
"build:mermaid-parser": "node src/views/editor/language/mermaid/build-parsers.js",
|
||||||
|
"test": "vitest",
|
||||||
|
"docs:dev": "vitepress dev docs",
|
||||||
|
"docs:build": "vitepress build docs",
|
||||||
|
"docs:preview": "vitepress preview docs",
|
||||||
|
"app:dev": "cd .. &&wails3 dev",
|
||||||
|
"app:build": "cd .. && wails3 task build",
|
||||||
|
"app:package": "cd .. && wails3 package",
|
||||||
|
"app:generate": "cd .. && wails3 generate bindings -ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "^6.18.6",
|
"@codemirror/autocomplete": "^6.19.1",
|
||||||
"@codemirror/commands": "^6.8.1",
|
"@codemirror/commands": "^6.10.0",
|
||||||
"@codemirror/lang-angular": "^0.1.4",
|
"@codemirror/lang-angular": "^0.1.4",
|
||||||
"@codemirror/lang-cpp": "^6.0.3",
|
"@codemirror/lang-cpp": "^6.0.3",
|
||||||
"@codemirror/lang-css": "^6.3.1",
|
"@codemirror/lang-css": "^6.3.1",
|
||||||
"@codemirror/lang-go": "^6.0.1",
|
"@codemirror/lang-go": "^6.0.1",
|
||||||
"@codemirror/lang-html": "^6.4.9",
|
"@codemirror/lang-html": "^6.4.11",
|
||||||
"@codemirror/lang-java": "^6.0.2",
|
"@codemirror/lang-java": "^6.0.2",
|
||||||
"@codemirror/lang-javascript": "^6.2.4",
|
"@codemirror/lang-javascript": "^6.2.4",
|
||||||
"@codemirror/lang-json": "^6.0.2",
|
"@codemirror/lang-json": "^6.0.2",
|
||||||
"@codemirror/lang-less": "^6.0.2",
|
"@codemirror/lang-less": "^6.0.2",
|
||||||
"@codemirror/lang-lezer": "^6.0.2",
|
"@codemirror/lang-lezer": "^6.0.2",
|
||||||
"@codemirror/lang-liquid": "^6.2.3",
|
"@codemirror/lang-liquid": "^6.3.0",
|
||||||
"@codemirror/lang-markdown": "^6.3.3",
|
"@codemirror/lang-markdown": "^6.5.0",
|
||||||
"@codemirror/lang-php": "^6.0.2",
|
"@codemirror/lang-php": "^6.0.2",
|
||||||
"@codemirror/lang-python": "^6.2.1",
|
"@codemirror/lang-python": "^6.2.1",
|
||||||
"@codemirror/lang-rust": "^6.0.2",
|
"@codemirror/lang-rust": "^6.0.2",
|
||||||
"@codemirror/lang-sass": "^6.0.2",
|
"@codemirror/lang-sass": "^6.0.2",
|
||||||
"@codemirror/lang-sql": "^6.9.0",
|
"@codemirror/lang-sql": "^6.10.0",
|
||||||
"@codemirror/lang-vue": "^0.1.3",
|
"@codemirror/lang-vue": "^0.1.3",
|
||||||
"@codemirror/lang-wast": "^6.0.2",
|
"@codemirror/lang-wast": "^6.0.2",
|
||||||
"@codemirror/lang-xml": "^6.1.0",
|
|
||||||
"@codemirror/lang-yaml": "^6.1.2",
|
"@codemirror/lang-yaml": "^6.1.2",
|
||||||
"@codemirror/language": "^6.11.2",
|
"@codemirror/language": "^6.11.3",
|
||||||
"@codemirror/language-data": "^6.5.1",
|
"@codemirror/language-data": "^6.5.2",
|
||||||
"@codemirror/legacy-modes": "^6.5.1",
|
"@codemirror/legacy-modes": "^6.5.2",
|
||||||
"@codemirror/lint": "^6.8.5",
|
"@codemirror/lint": "^6.9.2",
|
||||||
"@codemirror/search": "^6.5.11",
|
"@codemirror/search": "^6.5.11",
|
||||||
"@codemirror/state": "^6.5.2",
|
"@codemirror/state": "^6.5.2",
|
||||||
"@codemirror/view": "^6.38.0",
|
"@codemirror/view": "^6.38.6",
|
||||||
"@lezer/highlight": "^1.2.1",
|
"@cospaia/prettier-plugin-clojure": "^0.0.2",
|
||||||
"@lezer/lr": "^1.4.2",
|
"@lezer/highlight": "^1.2.3",
|
||||||
|
"@lezer/lr": "^1.4.3",
|
||||||
|
"@mdit/plugin-katex": "^0.23.2",
|
||||||
|
"@mdit/plugin-tasklist": "^0.22.2",
|
||||||
|
"@prettier/plugin-xml": "^3.4.2",
|
||||||
|
"@replit/codemirror-lang-svelte": "^6.0.0",
|
||||||
|
"@toml-tools/lexer": "^1.0.0",
|
||||||
|
"@toml-tools/parser": "^1.0.0",
|
||||||
|
"@types/markdown-it": "^14.1.2",
|
||||||
"codemirror": "^6.0.2",
|
"codemirror": "^6.0.2",
|
||||||
"codemirror-lang-elixir": "^4.0.0",
|
"codemirror-lang-elixir": "^4.0.0",
|
||||||
"colors-named": "^1.0.2",
|
"colors-named": "^1.0.2",
|
||||||
"colors-named-hex": "^1.0.2",
|
"colors-named-hex": "^1.0.2",
|
||||||
"franc-min": "^6.2.0",
|
"groovy-beautify": "^0.0.17",
|
||||||
|
"highlight.js": "^11.11.1",
|
||||||
"hsl-matcher": "^1.2.4",
|
"hsl-matcher": "^1.2.4",
|
||||||
"lezer": "^0.13.5",
|
"java-parser": "^3.0.1",
|
||||||
"pinia": "^3.0.3",
|
"linguist-languages": "^9.1.0",
|
||||||
"pinia-plugin-persistedstate": "^4.4.1",
|
"markdown-it": "^14.1.0",
|
||||||
|
"mermaid": "^11.12.1",
|
||||||
|
"npm": "^11.6.2",
|
||||||
|
"php-parser": "^3.2.5",
|
||||||
|
"pinia": "^3.0.4",
|
||||||
|
"pinia-plugin-persistedstate": "^4.7.1",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.6.2",
|
||||||
"remarkable": "^2.0.1",
|
"sass": "^1.94.0",
|
||||||
"sass": "^1.89.2",
|
"vue": "^3.5.24",
|
||||||
"vue": "^3.5.17",
|
"vue-i18n": "^11.1.12",
|
||||||
"vue-i18n": "^11.1.9",
|
"vue-pick-colors": "^1.8.0",
|
||||||
"vue-router": "^4.5.1"
|
"vue-router": "^4.6.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.30.1",
|
"@eslint/js": "^9.39.1",
|
||||||
"@lezer/generator": "^1.8.0",
|
"@lezer/generator": "^1.8.0",
|
||||||
"@types/lodash": "^4.17.20",
|
"@types/node": "^24.9.2",
|
||||||
"@types/node": "^24.0.10",
|
"@vitejs/plugin-vue": "^6.0.1",
|
||||||
"@types/remarkable": "^2.0.8",
|
|
||||||
"@vitejs/plugin-vue": "^6.0.0",
|
|
||||||
"@wailsio/runtime": "latest",
|
"@wailsio/runtime": "latest",
|
||||||
"eslint": "^9.30.1",
|
"cross-env": "^10.1.0",
|
||||||
"eslint-plugin-vue": "^10.3.0",
|
"eslint": "^9.39.1",
|
||||||
"globals": "^16.3.0",
|
"eslint-plugin-vue": "^10.5.1",
|
||||||
"typescript": "^5.8.3",
|
"globals": "^16.5.0",
|
||||||
"typescript-eslint": "^8.35.1",
|
"happy-dom": "^20.0.10",
|
||||||
"unplugin-vue-components": "^28.8.0",
|
"typescript": "^5.9.3",
|
||||||
"vite": "^7.0.2",
|
"typescript-eslint": "^8.46.4",
|
||||||
|
"unplugin-vue-components": "^30.0.0",
|
||||||
|
"vite": "npm:rolldown-vite@latest",
|
||||||
|
"vite-plugin-node-polyfills": "^0.24.0",
|
||||||
|
"vitepress": "^2.0.0-alpha.12",
|
||||||
|
"vitest": "^4.0.8",
|
||||||
"vue-eslint-parser": "^10.2.0",
|
"vue-eslint-parser": "^10.2.0",
|
||||||
"vue-tsc": "^3.0.1"
|
"vue-tsc": "^3.1.3"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"vite": "npm:rolldown-vite@latest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
importScripts("guesslang.min.js")
|
importScripts("guesslang.min.js")
|
||||||
|
|
||||||
const LANGUAGES = ["json", "py", "html", "sql", "md", "java", "php", "css", "xml", "cpp", "rs", "cs", "rb", "sh", "yaml", "toml", "go", "clj", "ex", "erl", "js", "ts", "swift", "kt", "groovy", "ps1", "dart", "scala"]
|
|
||||||
|
|
||||||
const guessLang = new self.GuessLang()
|
const guessLang = new self.GuessLang()
|
||||||
|
|
||||||
function sendResult(language, confidence, idx) {
|
function sendResult(language, confidence, idx) {
|
||||||
@@ -27,20 +25,13 @@ onmessage = (event) => {
|
|||||||
|
|
||||||
guessLang.runModel(content).then((result) => {
|
guessLang.runModel(content).then((result) => {
|
||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
const lang = result[0]
|
// 返回置信度最高的结果
|
||||||
if (LANGUAGES.includes(lang.languageId) && lang.confidence > 0.15) {
|
const bestResult = result[0]
|
||||||
sendResult(lang.languageId, lang.confidence, idx)
|
if (bestResult.confidence > 0.15) {
|
||||||
|
sendResult(bestResult.languageId, bestResult.confidence, idx)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let lang of result) {
|
|
||||||
if (LANGUAGES.includes(lang.languageId) && lang.confidence > 0.5) {
|
|
||||||
sendResult(lang.languageId, lang.confidence, idx)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sendResult("text", 0.0, idx)
|
sendResult("text", 0.0, idx)
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
sendResult("text", 0.0, idx)
|
sendResult("text", 0.0, idx)
|
||||||
|
|||||||
3
frontend/public/math.js
Normal file
@@ -1,20 +1,21 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted } from 'vue';
|
import {onBeforeMount} from 'vue';
|
||||||
import { useConfigStore } from '@/stores/configStore';
|
import {useConfigStore} from '@/stores/configStore';
|
||||||
import { useSystemStore } from '@/stores/systemStore';
|
import {useSystemStore} from '@/stores/systemStore';
|
||||||
import { useKeybindingStore } from '@/stores/keybindingStore';
|
import {useKeybindingStore} from '@/stores/keybindingStore';
|
||||||
import { useThemeStore } from '@/stores/themeStore';
|
import {useThemeStore} from '@/stores/themeStore';
|
||||||
import { useUpdateStore } from '@/stores/updateStore';
|
import {useUpdateStore} from '@/stores/updateStore';
|
||||||
import WindowTitleBar from '@/components/titlebar/WindowTitleBar.vue';
|
import WindowTitleBar from '@/components/titlebar/WindowTitleBar.vue';
|
||||||
|
import {useTranslationStore} from "@/stores/translationStore";
|
||||||
|
|
||||||
const configStore = useConfigStore();
|
const configStore = useConfigStore();
|
||||||
const systemStore = useSystemStore();
|
const systemStore = useSystemStore();
|
||||||
const keybindingStore = useKeybindingStore();
|
const keybindingStore = useKeybindingStore();
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
const updateStore = useUpdateStore();
|
const updateStore = useUpdateStore();
|
||||||
|
const translationStore = useTranslationStore();
|
||||||
|
|
||||||
// 应用启动时加载配置和初始化系统信息
|
onBeforeMount(async () => {
|
||||||
onMounted(async () => {
|
|
||||||
// 并行初始化配置、系统信息和快捷键配置
|
// 并行初始化配置、系统信息和快捷键配置
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
configStore.initConfig(),
|
configStore.initConfig(),
|
||||||
@@ -24,8 +25,9 @@ onMounted(async () => {
|
|||||||
|
|
||||||
// 初始化语言和主题
|
// 初始化语言和主题
|
||||||
await configStore.initializeLanguage();
|
await configStore.initializeLanguage();
|
||||||
themeStore.initializeTheme();
|
await themeStore.initializeTheme();
|
||||||
|
await translationStore.loadTranslators();
|
||||||
|
|
||||||
// 启动时检查更新
|
// 启动时检查更新
|
||||||
await updateStore.checkOnStartup();
|
await updateStore.checkOnStartup();
|
||||||
});
|
});
|
||||||
@@ -33,7 +35,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<WindowTitleBar />
|
<WindowTitleBar/>
|
||||||
<div class="app-content">
|
<div class="app-content">
|
||||||
<router-view/>
|
<router-view/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||