diff --git a/app/src/ai/actions.ts b/app/src/ai/actions.ts index 4729cafde..592453ea5 100644 --- a/app/src/ai/actions.ts +++ b/app/src/ai/actions.ts @@ -41,7 +41,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = dialog.element.querySelector("input") as HTMLInputElement; const btnsElement = dialog.element.querySelectorAll(".b3-button"); @@ -77,7 +77,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = dialog.element.querySelector("input"); const btnsElement = dialog.element.querySelectorAll(".b3-button"); diff --git a/app/src/ai/chat.ts b/app/src/ai/chat.ts index d304c90ba..425302031 100644 --- a/app/src/ai/chat.ts +++ b/app/src/ai/chat.ts @@ -11,7 +11,7 @@ export const AIChat = (protyle: IProtyle, element: Element) => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = dialog.element.querySelector("input") as HTMLInputElement; const btnsElement = dialog.element.querySelectorAll(".b3-button"); diff --git a/app/src/assets/scss/component/_button.scss b/app/src/assets/scss/component/_button.scss index 2340dd227..217b78fa8 100644 --- a/app/src/assets/scss/component/_button.scss +++ b/app/src/assets/scss/component/_button.scss @@ -18,6 +18,7 @@ height: 16px; width: 16px; margin-right: 4px; + flex-shrink: 0; } &:hover, diff --git a/app/src/assets/scss/component/_dialog.scss b/app/src/assets/scss/component/_dialog.scss index c3b24451a..f82c6e47d 100644 --- a/app/src/assets/scss/component/_dialog.scss +++ b/app/src/assets/scss/component/_dialog.scss @@ -77,12 +77,13 @@ &__close { position: absolute; cursor: pointer; - top: 10px; - right: -32px; + top: -2px; + right: -36px; height: 18px; width: 18px; opacity: .68; color: var(--b3-theme-on-surface); + padding: 8px; &:hover { opacity: 1; diff --git a/app/src/boot/openChangelog.ts b/app/src/boot/openChangelog.ts index 3fa4362d2..b1b8e0400 100644 --- a/app/src/boot/openChangelog.ts +++ b/app/src/boot/openChangelog.ts @@ -10,7 +10,7 @@ export const openChangelog = () => { } const dialog = new Dialog({ title: `✨ ${window.siyuan.languages.whatsNewInSiYuan}`, - width: isMobile() ? "90vw" : "768px", + width: isMobile() ? "92vw" : "768px", content: `
${response.data.html}
` }); highlightRender(dialog.element); diff --git a/app/src/card/makeCard.ts b/app/src/card/makeCard.ts index 8728f25c8..20e07546e 100644 --- a/app/src/card/makeCard.ts +++ b/app/src/card/makeCard.ts @@ -47,23 +47,20 @@ export const makeCard = (ids: string[]) => { html += genCardItem(item); }); const dialog = new Dialog({ - width: isMobile() ? "90vw" : "50vw", + width: isMobile() ? "92vw" : "50vw", height: "70vh", - title: `
-
${window.siyuan.languages.riffCard}
- - - ${window.siyuan.languages.all} - -
`, + title: window.siyuan.languages.riffCard, content: `
- + + + + +
@@ -144,7 +141,7 @@ export const makeCard = (ids: string[]) => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = renameDialog.element.querySelector("input") as HTMLInputElement; const btnsElement = renameDialog.element.querySelectorAll(".b3-button"); diff --git a/app/src/config/util/setAccessAuthCode.ts b/app/src/config/util/setAccessAuthCode.ts index 2521556b5..770ffde11 100644 --- a/app/src/config/util/setAccessAuthCode.ts +++ b/app/src/config/util/setAccessAuthCode.ts @@ -13,7 +13,7 @@ export const setAccessAuthCode = () => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = dialog.element.querySelector("input") as HTMLInputElement; const btnsElement = dialog.element.querySelectorAll(".b3-button"); diff --git a/app/src/dialog/confirmDialog.ts b/app/src/dialog/confirmDialog.ts index 761947d6d..9b71d4811 100644 --- a/app/src/dialog/confirmDialog.ts +++ b/app/src/dialog/confirmDialog.ts @@ -11,7 +11,7 @@ export const confirmDialog = (title: string, text: string, confirm?: () => void,
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const btnsElement = dialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { diff --git a/app/src/dialog/index.ts b/app/src/dialog/index.ts index c8566ef67..b740ca75e 100644 --- a/app/src/dialog/index.ts +++ b/app/src/dialog/index.ts @@ -1,4 +1,5 @@ import {genUUID} from "../util/genID"; +import {isMobile} from "../util/functions"; export class Dialog { private destroyCallback: () => void; @@ -25,7 +26,7 @@ export class Dialog { this.element.innerHTML = `
- +
${options.title || ""}
${options.content}
`; diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index 128dadefc..fa4326396 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -133,7 +133,7 @@ export const transactionError = () => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const btnsElement = dialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { @@ -224,7 +224,7 @@ export const bootSync = () => { fetchPost("/api/sync/getBootSync", {}, response => { if (response.code === 1) { const dialog = new Dialog({ - width: isMobile() ? "80vw" : "50vw", + width: isMobile() ? "92vw" : "50vw", title: "🌩️ " + window.siyuan.languages.bootSyncFailed, content: `
${response.msg}
diff --git a/app/src/editor/rename.ts b/app/src/editor/rename.ts index d1e63e966..0072f8e37 100644 --- a/app/src/editor/rename.ts +++ b/app/src/editor/rename.ts @@ -54,7 +54,7 @@ export const rename = (options: {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", destroyCallback() { if (options.range) { focusByRange(options.range); @@ -111,7 +111,7 @@ export const renameAsset = (assetPath: string) => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = dialog.element.querySelector("input") as HTMLInputElement; const btnsElement = dialog.element.querySelectorAll(".b3-button"); diff --git a/app/src/history/diff.ts b/app/src/history/diff.ts index 3f5e7dc2a..251b3b20b 100644 --- a/app/src/history/diff.ts +++ b/app/src/history/diff.ts @@ -6,6 +6,7 @@ import {disabledProtyle, onGet} from "../protyle/util/onGet"; import {hasClosestByClassName} from "../protyle/util/hasClosest"; import {escapeHtml} from "../util/escape"; import * as dayjs from "dayjs"; +import {isMobile} from "../util/functions"; const genItem = (data: [], data2?: { title: string, fileID: string }[]) => { if (!data || data.length === 0) { @@ -154,7 +155,7 @@ export const showDiff = (data: { id: string, time: string }[]) => { `, - width: "80vw", + width: isMobile() ? "92vw" : "80vw", height: "80vh", destroyCallback() { leftEditor = undefined; diff --git a/app/src/history/history.ts b/app/src/history/history.ts index 2f2c76c5d..3b40107a1 100644 --- a/app/src/history/history.ts +++ b/app/src/history/history.ts @@ -520,7 +520,7 @@ export const openHistory = () => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const textareaElement = genRepoDialog.element.querySelector("textarea"); textareaElement.focus(); @@ -569,7 +569,7 @@ export const openHistory = () => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = genTagDialog.element.querySelector(".b3-text-field") as HTMLInputElement; inputElement.select(); diff --git a/app/src/menus/block.ts b/app/src/menus/block.ts index 9c38a69a2..23ecf2e28 100644 --- a/app/src/menus/block.ts +++ b/app/src/menus/block.ts @@ -17,7 +17,7 @@ export const transferBlockRef = (id:string) => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = renameDialog.element.querySelector("input") as HTMLInputElement; const btnsElement = renameDialog.element.querySelectorAll(".b3-button"); diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.ts index 44382df38..7d29d93a0 100644 --- a/app/src/menus/commonMenuItem.ts +++ b/app/src/menus/commonMenuItem.ts @@ -47,7 +47,7 @@ export const openWechatNotify = (nodeElement: Element) => { reminderFormat = dayjs(reminder).format("YYYY-MM-DDTHH:mm"); } const dialog = new Dialog({ - width: isMobile() ? "80vw" : "50vw", + width: isMobile() ? "92vw" : "50vw", title: window.siyuan.languages.wechatReminder, content: `
@@ -112,7 +112,7 @@ export const openFileWechatNotify = (protyle: IProtyle) => { reminderFormat = dayjs(reminder).format("YYYY-MM-DDTHH:mm"); } const dialog = new Dialog({ - width: isMobile() ? "80vw" : "50vw", + width: isMobile() ? "92vw" : "50vw", title: window.siyuan.languages.wechatReminder, content: `
@@ -183,7 +183,7 @@ const genAttr = (attrs: IObject, focusName = "bookmark", cb: (dialog: Dialog, rm } }); const dialog = new Dialog({ - width: isMobile() ? "94vw" : "50vw", + width: isMobile() ? "92vw" : "50vw", title: window.siyuan.languages.attr, content: `
`, - width: "80vw", + width: "92vw", }); const textAreaElement = passwordDialog.element.querySelector("textarea"); textAreaElement.focus(); @@ -196,7 +196,7 @@ export const initAbout = () => {
`, - width: "80vw", + width: "92vw", }); const inputElement = initDialog.element.querySelector(".b3-text-field") as HTMLInputElement; inputElement.focus(); @@ -278,7 +278,7 @@ export const initAbout = () => {
`, - width: "80vw", + width: "92vw", }); const btnsElement = openWorkspaceDialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { @@ -312,7 +312,7 @@ export const initAbout = () => {
`, - width: "80vw", + width: "92vw", }); const inputElement = createWorkspaceDialog.element.querySelector("input"); inputElement.focus(); diff --git a/app/src/mobile/util/MobileBookmarks.ts b/app/src/mobile/util/MobileBookmarks.ts index ffd3876f7..8c4e5557f 100644 --- a/app/src/mobile/util/MobileBookmarks.ts +++ b/app/src/mobile/util/MobileBookmarks.ts @@ -60,7 +60,7 @@ export class MobileBookmarks {
`, - width: "80vw", + width: "92vw", }); const btnsElement = dialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { diff --git a/app/src/mobile/util/MobileTags.ts b/app/src/mobile/util/MobileTags.ts index 5397c7d48..47dea03f1 100644 --- a/app/src/mobile/util/MobileTags.ts +++ b/app/src/mobile/util/MobileTags.ts @@ -45,7 +45,7 @@ export class MobileTags {
`, - width: "80vw", + width: "92vw", }); const btnsElement = dialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { diff --git a/app/src/protyle/export/util.ts b/app/src/protyle/export/util.ts index 4f2820062..56dc28daa 100644 --- a/app/src/protyle/export/util.ts +++ b/app/src/protyle/export/util.ts @@ -27,27 +27,24 @@ export const afterExport = (exportPath: string, msgId: string) => { export const exportImage = (id: string) => { const exportDialog = new Dialog({ - title: `
- ${window.siyuan.languages.exportAsImage} -
- -
-`, + title: window.siyuan.languages.exportAsImage, content: `
+ +
`, - width: isMobile() ? "90vw" : "990px", + width: isMobile() ? "92vw" : "990px", }); const btnsElement = exportDialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts index 74337f02a..698bb0bb2 100644 --- a/app/src/protyle/header/Background.ts +++ b/app/src/protyle/header/Background.ts @@ -305,7 +305,7 @@ export class Background { } else if (type === "link") { const dialog = new Dialog({ title: window.siyuan.languages.link, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", content: `
diff --git a/app/src/search/menu.ts b/app/src/search/menu.ts index b0689eaa9..3b4c344f1 100644 --- a/app/src/search/menu.ts +++ b/app/src/search/menu.ts @@ -123,7 +123,7 @@ export const filterMenu = (config: ISearchOption, cb: () => void) => {
`, - width: isMobile() ? "90vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const btnsElement = filterDialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { @@ -313,7 +313,7 @@ export const moreMenu = async (config: ISearchOption,
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const btnsElement = saveDialog.element.querySelectorAll(".b3-button"); saveDialog.bindInput(saveDialog.element.querySelector("input"), () => { diff --git a/app/src/sync/syncGuide.ts b/app/src/sync/syncGuide.ts index cb1110830..a00bf6cea 100644 --- a/app/src/sync/syncGuide.ts +++ b/app/src/sync/syncGuide.ts @@ -18,7 +18,7 @@ export const addCloudName = (cloudPanelElement: Element) => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const inputElement = dialog.element.querySelector("input") as HTMLInputElement; const btnsElement = dialog.element.querySelectorAll(".b3-button"); @@ -191,7 +191,7 @@ const syncNow = () => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); const btnsElement = manualDialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { @@ -229,7 +229,7 @@ const setSync = (key?: string, dialog?: Dialog) => { dialog = new Dialog({ title: window.siyuan.languages.cloudSyncDir, content: listHTML, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); } const contentElement = dialog.element.querySelector(".b3-dialog__content").lastElementChild; @@ -279,7 +279,7 @@ const setKey = () => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); dialog.element.querySelector(".b3-button--cancel").addEventListener("click", () => { dialog.destroy(); diff --git a/app/src/util/mount.ts b/app/src/util/mount.ts index 865636c97..bb3a94f7d 100644 --- a/app/src/util/mount.ts +++ b/app/src/util/mount.ts @@ -49,6 +49,7 @@ export const newDailyNote = () => { } }); const dialog = new Dialog({ + title: window.siyuan.languages.plsChoose, content: `
@@ -56,7 +57,7 @@ export const newDailyNote = () => {
`, - width: isMobile() ? "80vw" : "520px", + width: isMobile() ? "92vw" : "520px", }); dialog.element.setAttribute("data-key", window.siyuan.config.keymap.general.dailyNote.custom); const btnsElement = dialog.element.querySelectorAll(".b3-button"); @@ -97,7 +98,7 @@ export const newNotebook = () => {
`, - width: isMobile() ? "80vw" : "520px" + width: isMobile() ? "92vw" : "520px" }); const btnsElement = dialog.element.querySelectorAll(".b3-button"); dialog.bindInput(dialog.element.querySelector("input"), () => { diff --git a/app/src/util/noRelyPCFunction.ts b/app/src/util/noRelyPCFunction.ts index 277f26c4b..9ef8b2ace 100644 --- a/app/src/util/noRelyPCFunction.ts +++ b/app/src/util/noRelyPCFunction.ts @@ -11,7 +11,7 @@ export const renameTag = (labelName: string) => {
`, - width: isMobile() ? "80vw": "520px", + width: isMobile() ? "92vw": "520px", }); const btnsElement = dialog.element.querySelectorAll(".b3-button"); btnsElement[0].addEventListener("click", () => { diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index 8ad44070a..434b39b62 100644 --- a/app/src/util/pathName.ts +++ b/app/src/util/pathName.ts @@ -154,7 +154,7 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void,
`, - width: isMobile() ? "90vw" : "50vw", + width: isMobile() ? "92vw" : "50vw", destroyCallback() { if (range) { focusByRange(range);