From 759a92eeb8750886403234914d62daaa66951f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A2=96=E9=80=B8?= <49649786+Zuoqiu-Yingyi@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:04:51 +0800 Subject: [PATCH] =?UTF-8?q?chore(keepass):=20=E9=87=8D=E6=96=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=99=84=E5=B1=9E=E4=BB=93=E5=BA=93=20`keepass`=20|?= =?UTF-8?q?=20Re-add=20sub-repository=20`keepass`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-please.yml | 2 +- package.json | 12 ++++++------ public/plugin.json | 2 +- src/index.ts | 21 ++++++++++++++------- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6fd2b73..e7dcb25 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -14,7 +14,7 @@ permissions: env: PACKAGE_NAME: keepass - PACKAGE_VERSION: 0.2.0 + PACKAGE_VERSION: 0.2.1 jobs: release-please: diff --git a/package.json b/package.json index 21fdc03..25ebefb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "keepass", "private": true, - "version": "0.2.0", + "version": "0.2.1", "type": "module", "scripts": { "dev": "vite", @@ -16,17 +16,17 @@ "check": "svelte-check --tsconfig ./tsconfig.json" }, "devDependencies": { - "@sveltejs/vite-plugin-svelte": "^2.4.6", + "@sveltejs/vite-plugin-svelte": "^2.5.3", "@tsconfig/svelte": "^5.0.2", - "@types/lodash": "^4.14.200", + "@types/lodash": "^4.14.202", "idb": "^7.1.1", "keeweb-plugin": "^0.1.12", "less": "^4.2.0", - "svelte": "^4.2.2", - "svelte-check": "^3.5.2", + "svelte": "^4.2.7", + "svelte-check": "^3.6.2", "svelte-preprocess-less": "^0.4.0", "tslib": "^2.6.2", - "typescript": "^5.2.2", + "typescript": "^5.3.2", "vite": "^4.5.0" }, "dependencies": { diff --git a/public/plugin.json b/public/plugin.json index 3b02d1b..83f2324 100644 --- a/public/plugin.json +++ b/public/plugin.json @@ -2,7 +2,7 @@ "name": "keepass", "author": "Zuoqiu Yingyi", "url": "https://github.com/Zuoqiu-Yingyi/siyuan-plugin-keepass", - "version": "0.2.0", + "version": "0.2.1", "minAppVersion": "2.10.3", "backends": [ "all" diff --git a/src/index.ts b/src/index.ts index c7cc652..9cfafcf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,6 +56,7 @@ import type { TDBStoreName, } from "./types/idb-schema"; import { src2url } from "@workspace/utils/misc/url"; +import { trimPrefix } from "@workspace/utils/misc/string"; declare var globalThis: ISiyuanGlobal; @@ -288,11 +289,16 @@ export default class KeepassPlugin extends siyuan.Plugin { label: this.i18n.menu.command.openKeeWebWindow.text, click: () => this.openKeeWebWindow(false), }); - menu.open({ - x: globalThis.siyuan.coordinates.pageX, - y: globalThis.siyuan.coordinates.pageY, - isLeft: true, - }); + if (FLAG_MOBILE) { + menu.fullscreen(); + } + else { + menu.open({ + x: globalThis.siyuan?.coordinates?.pageX ?? 0, + y: globalThis.siyuan?.coordinates?.pageY ?? 0, + isLeft: true, + }); + } }, }); } @@ -419,7 +425,8 @@ export default class KeepassPlugin extends siyuan.Plugin { const local_storage_keys = Object.keys(local_storage); const entries = sync1(local_siyuan_keys, local_storage_keys); - this.logger.debug(entries); + // this.logger.debug(entries); + entries.delete.forEach(entry => globalThis.localStorage.removeItem(entry)); this.setLocalStorageItems(this.local); return local_siyuan; @@ -856,7 +863,7 @@ export default class KeepassPlugin extends siyuan.Plugin { title: "KeeWeb", id: this.CUSTOM_TAB_ID_KEEWEB, data: { - src: this.KEEWEB_INDEX_URL.href, + src: trimPrefix(this.KEEWEB_INDEX_URL.href, globalThis.document.baseURI), title: "KeeWeb", }, },