diff --git a/package.json b/package.json index 24eefbc..54bb692 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,10 @@ "preview": "vite preview" }, "dependencies": { - "@logseq/libs": "^0.0.15", - "antd": "^5.7.3", - "react": "^18.2.0", - "react-dom": "^18.2.0" + "@logseq/libs": "^0.0.16", + "antd": "^4.18.9", + "react": "^17.0.2", + "react-dom": "^17.0.2" }, "devDependencies": { "@semantic-release/changelog": "^6.0.1", diff --git a/src/helper/constants.ts b/src/helper/constants.ts index f2a4ac3..0c1fbac 100644 --- a/src/helper/constants.ts +++ b/src/helper/constants.ts @@ -1,6 +1,9 @@ import { SettingSchemaDesc } from "@logseq/libs/dist/LSPlugin.user"; export const COMMON_STYLE = ` +.ui-items-container[data-type=toolbar] > .list-wrap { + overflow: visible; +} #injected-ui-item-git-logseq-git { position: relative; } diff --git a/src/helper/util.ts b/src/helper/util.ts index 5269f15..d6c0ac3 100644 --- a/src/helper/util.ts +++ b/src/helper/util.ts @@ -28,7 +28,7 @@ export const getPluginStyle = () => pluginStyle; export const showPopup = () => { const _style = getPluginStyle(); - logseq.App.queryElementRect("#logseq-git--git").then((triggerIconRect) => { + logseq.UI.queryElementRect("#logseq-git--git").then((triggerIconRect) => { console.log("[faiz:] === triggerIconRect", triggerIconRect); if (!triggerIconRect) return; const popupWidth = 120 + 10 * 2; diff --git a/src/main.tsx b/src/main.tsx index 08576df..0d2b9f9 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -24,7 +24,20 @@ import { } from "./helper/util"; import "./index.css"; -const isDevelopment = import.meta.env.DEV; +// TODO: patch logseq Git command for the temporary fix solution +// https://github.com/haydenull/logseq-plugin-git/issues/48 +try { + // @ts-ignore + top.logseq.sdk.git.exec_command(['status']) +} catch (e) { + // @ts-ignore + logseq.Git['execCommand'] = async function (args: string[]) { + const ret = await logseq.App.execGitCommand(args) + return {exitCode: ret == undefined ? 1 : 0, stdout: ret} + } +} + +const isDevelopment = import.meta.env.DEV if (isDevelopment) { renderApp("browser"); diff --git a/yarn.lock b/yarn.lock index 14f0306..fd35e51 100644 --- a/yarn.lock +++ b/yarn.lock @@ -392,13 +392,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@logseq/libs@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@logseq/libs/-/libs-0.0.15.tgz#03b8b81a0a1557e3f022d68c978ddcb501cd4421" - integrity sha512-Z4YrYGfu8Y3s9LTqVnPGkxlO+KZtP1YalH/A63zYgxP61cV5QtKlnHWNcjsKxsD5CkaSL4MlSN4mf7wNx/Fm0A== +"@logseq/libs@^0.0.16": + version "0.0.16" + resolved "https://registry.yarnpkg.com/@logseq/libs/-/libs-0.0.16.tgz#52d542fa2ab4f2c6c6961209108962fecf925aba" + integrity sha512-lsiwpBtZd/j6n02hp2ytP+LZZOoZxmqBj0MpULT4CajrH51pnI65Bzcb4+Ne/lJW6IzMbIinYmMm0Zoi3nL65g== dependencies: csstype "3.1.0" debug "4.3.4" + deepmerge "4.3.1" dompurify "2.3.8" eventemitter3 "4.0.7" fast-deep-equal "3.1.3" @@ -652,10 +653,10 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== -"@types/node@^18.15.12": - version "18.17.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.0.tgz#35d44267a33dd46b49ee0f73d31b05fd7407e290" - integrity sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg== +"@types/node@^17.0.9": + version "17.0.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.9.tgz#0b7f161afb5b1cc12518d29b2cdc7175d5490628" + integrity sha512-5dNBXu/FOER+EXnyah7rn8xlNrfMOQb/qXnw4NQgLkCygKBKhdmF/CA5oXVOKZLBEahw8s2WP9LxIcN/oDDRgQ== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -1334,6 +1335,11 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== +deepmerge@4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d"