/// #if !BROWSER import {shell} from "electron"; /// #endif import {getDockByType} from "../layout/util"; import {confirmDialog} from "../dialog/confirmDialog"; import {getSearch, isMobile} from "../util/functions"; import {isLocalPath, movePathTo, moveToPath, pathPosix} from "../util/pathName"; import {MenuItem} from "./Menu"; import {hasClosestByClassName} from "../protyle/util/hasClosest"; import {saveExport} from "../protyle/export"; import {openByMobile, writeText} from "../protyle/util/compatibility"; import {fetchPost} from "../util/fetch"; import {hideMessage, showMessage} from "../dialog/message"; import {Dialog} from "../dialog"; import {focusBlock, focusByRange, getEditorRange} from "../protyle/util/selection"; import {updateTransaction} from "../protyle/wysiwyg/transaction"; /// #if !MOBILE import {getAllModels} from "../layout/getAll"; import {Bookmark} from "../layout/dock/Bookmark"; import {openAsset, openBy} from "../editor/util"; /// #endif import {rename} from "../editor/rename"; import {matchHotKey} from "../protyle/util/hotKey"; import * as dayjs from "dayjs"; import {Constants} from "../constants"; import {exportImage} from "../protyle/export/util"; const bindAttrInput = (inputElement: HTMLInputElement, confirmElement: Element) => { inputElement.addEventListener("keydown", (event) => { if (event.isComposing) { return; } if (matchHotKey("⌘↩", event)) { confirmElement.dispatchEvent(new CustomEvent("click")); event.stopPropagation(); event.preventDefault(); } }); }; export const openWechatNotify = (nodeElement: Element) => { const id = nodeElement.getAttribute("data-node-id"); const range = getEditorRange(nodeElement); const reminder = nodeElement.getAttribute("custom-reminder-wechat"); let reminderFormat = ""; if (reminder) { reminderFormat = dayjs(reminder).format("YYYY-MM-DDTHH:mm"); } const dialog = new Dialog({ width: isMobile() ? "92vw" : "50vw", title: window.siyuan.languages.wechatReminder, content: `