diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16b6b96..067dd55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - browser: [chromium, firefox, webkit] + browser: [chromium, firefox] # webkit include: - os: macos-latest browser: webkit @@ -84,6 +84,7 @@ jobs: run: | npm i -g pnpm pnpm i + npx playwright install npx playwright install-deps ${{ matrix.browser }} - name: Download artifact uses: actions/download-artifact@v3 diff --git a/README.md b/README.md index 6efbc73..d525506 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,10 @@ It's not recommended to clone recursively, as many boost libs are not needed. pnpm run submodule ``` ### Get font -Uncommon characters are rendered using [花园明朝](https://github.com/max32002/max-hana). +Uncommon characters are rendered using +[遍黑体](https://github.com/Fitzgerald-Porthmouth-Koenigsegg/Plangothic-Project) +and +[花园明朝](https://github.com/max32002/max-hana). ```sh pnpm run font ``` diff --git a/doc/deploy.md b/doc/deploy.md index 930b3fe..4f21834 100644 --- a/doc/deploy.md +++ b/doc/deploy.md @@ -1,4 +1,21 @@ # Deploy +## Use [Micro Plum](https://github.com/LibreService/micro_plum) +Click `Micro Plum`. + +Either provide +* a single schema URL +(e.g. https://github.com/rime/rime-luna-pinyin/blob/master/luna_pinyin.schema.yaml), + +or +* a plum target +(e.g. rime/rime-luna-pinyin) +and a list of schema Ids +(e.g. luna_pinyin). + +Click `Install`. + +Select the schemas and click `Deploy`. +## Manual upload Turn on `Advanced` switch or append `debug=on` URL parameter, so that you can interact with emscripten's file system. diff --git a/package.json b/package.json index 63012cb..d89fa69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@libreservice/my-rime", - "version": "0.7.0", + "version": "0.7.1", "files": [ "dist" ], @@ -31,41 +31,42 @@ "devDependencies": { "@codemirror/legacy-modes": "^6.3.2", "@libreservice/lazy-cache": "^0.1.0", + "@libreservice/micro-plum": "^0.1.0", "@libreservice/my-widget": "^0.1.2", "@libreservice/my-worker": "^0.4.0", "@libreservice/wasm-code": "^0.1.1", "@playwright/test": "1.32.3", "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.0.2", + "@rollup/plugin-node-resolve": "^15.1.0", "@rollup/plugin-replace": "^5.0.2", - "@typescript-eslint/eslint-plugin": "^5.59.6", - "@typescript-eslint/parser": "^5.59.6", + "@types/js-yaml": "^4.0.5", + "@typescript-eslint/eslint-plugin": "^5.59.9", + "@typescript-eslint/parser": "^5.59.9", "@vicons/fa": "^0.12.0", "@vicons/fluent": "^0.12.0", "@vitejs/plugin-vue": "^4.2.3", "emoji-regex": "^10.2.1", "esbuild": "^0.17.19", - "eslint": "^8.40.0", - "eslint-config-standard": "^17.0.0", + "eslint": "^8.42.0", + "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-n": "^16.0.0", "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-vue": "^9.13.0", + "eslint-plugin-vue": "^9.14.1", "idb": "^7.1.1", "js-yaml": "^4.1.0", - "naive-ui": "^2.34.3", - "playwright": "1.32.3", - "rollup": "^3.22.0", + "naive-ui": "^2.34.4", + "rollup": "^3.24.0", "rollup-plugin-esbuild": "^5.0.0", "textarea-caret": "^3.1.0", - "tslib": "^2.5.1", - "typescript": "^5.0.4", - "vite": "^4.3.8", - "vite-plugin-pwa": "^0.14.7", + "tslib": "^2.5.3", + "typescript": "^5.1.3", + "vite": "^4.3.9", + "vite-plugin-pwa": "^0.16.3", "vite-plugin-run": "^0.4.1", "vooks": "^0.2.12", "vue": "^3.3.4", - "vue-router": "^4.2.1", + "vue-router": "^4.2.2", "vue-tsc": "^1.6.5" } } diff --git a/src/App.vue b/src/App.vue index e2380d0..b34a55a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,13 @@ diff --git a/src/components/MyEditor.vue b/src/components/MyEditor.vue index c4b3f73..f9c2d3b 100644 --- a/src/components/MyEditor.vue +++ b/src/components/MyEditor.vue @@ -1,17 +1,11 @@ + + diff --git a/src/components/micro-plum/InstallPane.vue b/src/components/micro-plum/InstallPane.vue new file mode 100644 index 0000000..19d2afb --- /dev/null +++ b/src/components/micro-plum/InstallPane.vue @@ -0,0 +1,234 @@ + + + diff --git a/src/components/micro-plum/MicroPlum.vue b/src/components/micro-plum/MicroPlum.vue new file mode 100644 index 0000000..b22c686 --- /dev/null +++ b/src/components/micro-plum/MicroPlum.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/src/control.ts b/src/control.ts index 0d76006..af9b80f 100644 --- a/src/control.ts +++ b/src/control.ts @@ -247,7 +247,7 @@ function syncOptions (updatedOptions: string[]) { return } } - if (variants.value.length === 2) { + if (!deployed.value && variants.value.length === 2) { for (const [i, v] of variants.value.entries()) { if ((v.id === updatedOption && v.value) || (`!${v.id}` === updatedOption && !v.value)) { variantIndex.value = i diff --git a/src/views/MainView.vue b/src/views/MainView.vue index 328e81e..0ba29ad 100644 --- a/src/views/MainView.vue +++ b/src/views/MainView.vue @@ -5,8 +5,10 @@ import { Cut20Regular, Copy20Regular, ClipboardLink20Regular } from '@vicons/flu import MyMenu from '../components/MyMenu.vue' import MyPanel from '../components/MyPanel.vue' import MyFont from '../components/MyFont.vue' +import MyDeployer from '../components/MyDeployer.vue' import type MySimulator from '../components/MySimulator.vue' import type MyEditor from '../components/MyEditor.vue' +import MicroPlum from '../components/micro-plum/MicroPlum.vue' import { getTextarea, getQueryString, isMobile } from '../util' import { schemaId, variant } from '../control' @@ -126,6 +128,8 @@ const AsyncEditor = defineAsyncComponent(() => import('../components/MyEditor.vu :on-update-schema="menu?.selectIME" /> + + Advanced import('../components/MyEditor.vu v-if="editorLoaded" v-show="showEditor" ref="editor" - :menu="menu" /> diff --git a/wasm/api.cpp b/wasm/api.cpp index 3a12664..7416be8 100644 --- a/wasm/api.cpp +++ b/wasm/api.cpp @@ -57,6 +57,11 @@ std::string get_schema_name(std::string schema) { return schema_name[schema]; } +void startRime () { + RimeInitialize(NULL); + RimeSetNotificationHandler(handler, NULL); +} + extern "C" { void set_option(const char *option, int value) { RimeSetOption(session_id, option, value); @@ -64,8 +69,7 @@ extern "C" { void init() { RimeSetup(NULL); - RimeInitialize(NULL); - RimeSetNotificationHandler(handler, NULL); + startRime(); session_id = RimeCreateSession(); RIME_STRUCT_INIT(RimeCommit, commit); RIME_STRUCT_INIT(RimeContext, context); @@ -149,6 +153,8 @@ extern "C" { void deploy () { RimeDestroySession(session_id); + RimeFinalize(); + startRime(); RimeStartMaintenance(true); session_id = RimeCreateSession(); }