mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2026-11-27 06:32:42 +00:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bfedba45d | ||
|
|
8f899277fd | ||
|
|
512ef8c1e7 | ||
|
|
0aaf1fb9d8 | ||
|
|
bb3065058e | ||
|
|
13b80db77c | ||
|
|
b6a204da4e | ||
|
|
e87a936887 | ||
|
|
b3d0a5a571 | ||
|
|
f212db7223 | ||
|
|
48143ead47 | ||
|
|
d053d51672 | ||
|
|
2cd9119ad1 | ||
|
|
75a0af8ee4 | ||
|
|
b32de61199 | ||
|
|
ece9a9d064 |
No files matched your search
@@ -610,7 +610,241 @@ addLocale("zh", {
|
||||
"😍 如果你觉得这个脚本有用,欢迎 [请我喝杯咖啡 ☕](https://ko-fi.com/zsolt)。",
|
||||
});
|
||||
|
||||
addLocale("zh-tw", STRINGS["zh"]);
|
||||
addLocale("zh-tw", {
|
||||
// Notices
|
||||
NOTICE_SELECT_NODE_TO_COPY: "請選擇要複製的節點。",
|
||||
NOTICE_MAP_CUT: "導圖已剪下到剪貼簿。",
|
||||
NOTICE_BRANCH_CUT: "分支已剪下到剪貼簿。",
|
||||
NOTICE_MAP_COPIED: "導圖已複製為 Markdown 格式。",
|
||||
NOTICE_BRANCH_COPIED: "分支已複製為列表格式。",
|
||||
NOTICE_CLIPBOARD_EMPTY: "剪貼簿為空。",
|
||||
NOTICE_PASTE_ABORTED: "貼上中止。剪貼簿內容非 Markdown 列表或標題。",
|
||||
NOTICE_NO_LIST: "剪貼簿中未發現有效的 Markdown 列表。",
|
||||
NOTICE_PASTE_START: "正在貼上,請稍候,可能需要一些時間…",
|
||||
NOTICE_PASTE_COMPLETE: "貼上完成。",
|
||||
NOTICE_ACTION_REQUIRES_ARROWS: "此操作需要方向鍵。僅可修改修飾鍵。",
|
||||
NOTICE_CONFLICT_WITH_ACTION: "與“{action}”操作衝突",
|
||||
NOTICE_OBSIDIAN_HOTKEY_CONFLICT: "⚠️ Obsidian 熱鍵衝突!\n\n此按鍵將覆蓋:\n“{command}”",
|
||||
NOTICE_GLOBAL_HOTKEY_CONFLICT: "⚠️ 全域性熱鍵衝突!\n\n此按鍵將覆蓋:\n“{command}”",
|
||||
NOTICE_NO_HEADINGS: "連結檔案中未發現小標題。",
|
||||
NOTICE_CANNOT_EDIT_MULTILINE: "無法直接編輯多行節點。\n請在 Excalidraw 中雙擊元素進行編輯,然後執行“自動重排導圖”來更新佈局。",
|
||||
NOTICE_CANNOT_MOVE_PINNED: "無法移動已鎖定的節點。請先解鎖。",
|
||||
NOTICE_CANNOT_MOVE_ROOT: "無法移動根節點。",
|
||||
NOTICE_CANNOT_PRMOTE_L1: "無法提升 1 級節點。",
|
||||
NOTICE_CANNOT_DEMOTE: "無法降級節點。沒有可依附的前置同級節點。",
|
||||
NOTICE_SELECT_NODE_CONTAINING_LINK: "請選擇包含連結的節點。",
|
||||
NOTICE_CANNOT_DEMOTE_NO_SIBLING_TO_ACCEPT: "無法降級:未找到可接收此節點的同級節點。",
|
||||
NOTICE_CANNOT_DEMOTE_NO_VALID_SIBLING: "無法降級:沒有可附加的有效同級節點。",
|
||||
NOTICE_CANNOT_DEMOTE_CROSS_SIDE_NOT_ALLOWED: "無法降級:不允許跨側降級。",
|
||||
NOTICE_CANNOT_MOVE_AUTO_LAYOUT_DISABLED: "停用自動佈局時無法移動節點。請先啟用自動佈局。",
|
||||
NOTICE_BRANCH_WIDTH_MANUAL_OVERRIDE: "分支粗細未更新,因為部分分支粗細已被手動修改。",
|
||||
NOTICE_CANNOT_CHANGE_MASTER_ROOT: "主根節點不能被轉換。",
|
||||
NOTICE_SUBMAP_ROOT_ADDED: "已啟用子圖根節點。",
|
||||
NOTICE_SUBMAP_ROOT_REMOVED: "已移除子圖根節點。其子節點將按親代根節點佈局重排。",
|
||||
CONFIRM_REMOVE_SUBMAP_ROOT: "恢復為普通節點嗎?\n\n它將失去本地佈局元資料,其子節點將按親代根節點佈局重排。",
|
||||
|
||||
// Action labels (display only)
|
||||
ACTION_LABEL_ADD: "新增子節點",
|
||||
ACTION_LABEL_ADD_SIBLING_AFTER: "新增後置同級節點",
|
||||
ACTION_LABEL_ADD_SIBLING_BEFORE: "新增前置同級節點",
|
||||
ACTION_LABEL_ADD_FOLLOW: "新增 + 跟隨",
|
||||
ACTION_LABEL_ADD_FOLLOW_FOCUS: "新增 + 跟隨 + 聚焦",
|
||||
ACTION_LABEL_ADD_FOLLOW_ZOOM: "新增 + 跟隨 + 縮放",
|
||||
ACTION_LABEL_SORT_ORDER: "更改順序/提升節點",
|
||||
ACTION_LABEL_EDIT: "編輯節點",
|
||||
ACTION_LABEL_PIN: "鎖定/解鎖",
|
||||
ACTION_LABEL_BOX: "新增/移除邊框",
|
||||
ACTION_LABEL_TOGGLE_GROUP: "編組/解除編組單分支",
|
||||
ACTION_LABEL_COPY: "複製",
|
||||
ACTION_LABEL_CUT: "剪下",
|
||||
ACTION_LABEL_PASTE: "貼上",
|
||||
ACTION_LABEL_IMPORT_OUTLINE: "匯入大綱",
|
||||
ACTION_LABEL_ZOOM: "迴圈縮放",
|
||||
ACTION_LABEL_FOCUS: "聚焦(並居中)節點",
|
||||
ACTION_LABEL_NAVIGATE: "導航",
|
||||
ACTION_LABEL_NAVIGATE_ZOOM: "導航 & 縮放",
|
||||
ACTION_LABEL_NAVIGATE_FOCUS: "導航 & 聚焦",
|
||||
ACTION_LABEL_FOLD: "摺疊/展開分支",
|
||||
ACTION_LABEL_FOLD_L1: "摺疊/展開 L1 子節點",
|
||||
ACTION_LABEL_FOLD_ALL: "遞迴摺疊/展開分支",
|
||||
ACTION_LABEL_DOCK_UNDOCK: "停靠/取消停靠",
|
||||
ACTION_LABEL_HIDE: "停靠 & 隱藏",
|
||||
ACTION_LABEL_REARRANGE: "重排導圖",
|
||||
ACTION_LABEL_TOGGLE_SUBMAP_ROOT: "開始/結束子圖根節點",
|
||||
ACTION_LABEL_TOGGLE_CHECKBOX: "切換複選框狀態",
|
||||
|
||||
// Tooltips (shared)
|
||||
PIN_TOOLTIP_PINNED: "此元素已鎖定。點選解鎖所選元素的位置。",
|
||||
PIN_TOOLTIP_UNPINNED: "此元素未鎖定。點選鎖定所選元素的位置。",
|
||||
TOGGLE_GROUP_TOOLTIP_GROUP: "編組此分支。僅在“分支編組”停用時可用。",
|
||||
TOGGLE_GROUP_TOOLTIP_UNGROUP: "解除編組此分支。僅在“分支編組”停用時可用。",
|
||||
TOOLTIP_EDIT_NODE: "編輯所選節點的文字",
|
||||
TOOLTIP_PIN_INIT: "鎖定/解鎖節點位置。鎖定的節點不會被自動重排。",
|
||||
TOOLTIP_REFRESH: "自動重排導圖",
|
||||
TOOLTIP_DOCK: "停靠到側邊面板",
|
||||
TOOLTIP_UNDOCK: "轉為浮動視窗",
|
||||
TOOLTIP_ZOOM_CYCLE: "迴圈切換元素縮放級別",
|
||||
TOOLTIP_TOGGLE_GROUP_BTN: "切換分支的編組狀態。僅在“分支編組”停用時可用。",
|
||||
TOOLTIP_TOGGLE_BOX: "切換節點邊框",
|
||||
TOOLTIP_TOGGLE_BOUNDARY: "切換子樹邊界",
|
||||
TOOLTIP_TOGGLE_FLOATING_EXTRAS: "切換額外控制元件",
|
||||
TOOLTIP_CONFIGURE_PALETTE: "為分支配置自定義調色盤",
|
||||
TOOLTIP_CONFIGURE_LAYOUT: "配置佈局設定",
|
||||
TOOLTIP_MOVE_UP: "上移",
|
||||
TOOLTIP_MOVE_DOWN: "下移",
|
||||
TOOLTIP_EDIT_COLOR: "編輯",
|
||||
TOOLTIP_DELETE_COLOR: "刪除",
|
||||
TOOLTIP_OPEN_PALETTE_PICKER: "開啟顏色選擇器",
|
||||
TOOLTIP_FOLD_BRANCH: "摺疊/展開所選分支",
|
||||
TOOLTIP_FOLD_L1_BRANCH: "摺疊/展開 L1 子節點",
|
||||
TOOLTIP_FOLD_ALL: "遞迴摺疊/展開分支",
|
||||
TOOLTIP_IMPORT_OUTLINE: "從連結檔案中匯入小標題作為子節點資料",
|
||||
TOOLTIP_RESET_TO_DEFAULT: "恢復預設",
|
||||
TOOLTIP_SUBMAP_ROOT_ADD: "從所選節點開始子圖",
|
||||
TOOLTIP_SUBMAP_ROOT_REMOVE: "將子圖根節點恢復為普通節點",
|
||||
TOOLTIP_TOGGLE_CHECKBOX: "切換任務複選框狀態",
|
||||
|
||||
// Buttons and labels
|
||||
DOCK_TITLE: "MindMap Builder",
|
||||
HELP_SUMMARY: "幫助",
|
||||
INPUT_PLACEHOLDER: "輸入概念… 輸入 [[ 插入連結",
|
||||
ONTOLOGY_PLACEHOLDER: "本體(箭頭標籤)",
|
||||
BUTTON_COPY: "複製",
|
||||
BUTTON_CUT: "剪下",
|
||||
BUTTON_PASTE: "貼上",
|
||||
TITLE_ADD_SIBLING: `使用 ${ea.DEVICE.isMacOS || ea.DEVICE.isIOS ? "OPT" : "ALT"}+Enter 新增同級節點`,
|
||||
TITLE_ADD_FOLLOW: "新增並跟隨",
|
||||
TITLE_COPY: "複製分支為文字",
|
||||
TITLE_CUT: "剪下分支為文字",
|
||||
TITLE_PASTE: "從剪貼簿貼上列表",
|
||||
LABEL_ZOOM_LEVEL: "縮放級別",
|
||||
LABEL_GROWTH_STRATEGY: "生長策略",
|
||||
LABEL_FILL_SWEEP: "填充掃過角度",
|
||||
DESC_FILL_SWEEP: "立即在整個“最大掃過角度”範圍內分佈節點,而不是隨著節點數量增加逐漸擴大弧度。",
|
||||
LABEL_ARROW_TYPE: "曲線連線",
|
||||
LABEL_AUTO_LAYOUT: "自動佈局",
|
||||
LABEL_GROUP_BRANCHES: "分支編組",
|
||||
LABEL_BOX_CHILD_NODES: "為子節點新增邊框",
|
||||
LABEL_ROUNDED_CORNERS: "圓角",
|
||||
LABEL_USE_SCENE_STROKE: "使用場景線條樣式",
|
||||
DESC_USE_SCENE_STROKE: "使用場景中最新的線條樣式(實線、虛線、點線),否則分支將始終使用實線。",
|
||||
LABEL_BRANCH_SCALE: "分支粗細比例",
|
||||
LABEL_BASE_WIDTH: "基礎粗細",
|
||||
LABEL_MULTICOLOR_BRANCHES: "多色分支",
|
||||
LABEL_MAX_WRAP_WIDTH: "最大折行寬度",
|
||||
LABEL_CENTER_TEXT: "文字居中",
|
||||
DESC_CENTER_TEXT: "關閉:根據位置左/右對齊;開啟:文字強制居中。",
|
||||
LABEL_FONT_SIZES: "字型大小",
|
||||
HOTKEY_SECTION_TITLE: "熱鍵配置",
|
||||
HOTKEY_HINT: "這些熱鍵可能覆蓋 Obsidian 預設設定。熱鍵作用域預設為區域性(⌨️),使用 🌐/🎨/⌨️ 切換作用域:🌐 Excalidraw 標籤頁可見即生效,🎨 Excalidraw 聚焦時生效,⌨️ 輸入框聚焦時生效。",
|
||||
RECORD_HOTKEY_PROMPT: "按下熱鍵…",
|
||||
ARIA_SCOPE_INPUT: "區域性(Local):僅在輸入框聚焦時生效",
|
||||
ARIA_SCOPE_EXCALIDRAW: "Excalidraw:輸入框或 Excalidraw 聚焦時生效",
|
||||
ARIA_SCOPE_GLOBAL: "全域性(Global):在 Obsidian 任何位置,Excalidraw 可見即生效",
|
||||
ARIA_RESTORE_DEFAULT: "恢復預設",
|
||||
ARIA_CUSTOMIZE_HOTKEY: "自定義此熱鍵",
|
||||
ARIA_OVERRIDE_COMMAND: "將覆蓋 Obsidian 命令:\n{command}",
|
||||
|
||||
// Palette manager
|
||||
MODAL_PALETTE_TITLE: "導圖分支調色盤",
|
||||
LABEL_ENABLE_CUSTOM_PALETTE: "啟用自定義調色盤",
|
||||
DESC_ENABLE_CUSTOM_PALETTE: "使用以下顏色代替自動生成的顏色。",
|
||||
LABEL_RANDOMIZE_ORDER: "隨機順序",
|
||||
DESC_RANDOMIZE_ORDER: "隨機選擇顏色而非按順序選擇。",
|
||||
HEADING_ADD_NEW_COLOR: "新增新顏色",
|
||||
HEADING_EDIT_COLOR: "編輯顏色",
|
||||
LABEL_SELECT_COLOR: "選擇顏色",
|
||||
BUTTON_CANCEL_EDIT: "取消編輯",
|
||||
BUTTON_ADD_COLOR: "新增顏色",
|
||||
BUTTON_UPDATE_COLOR: "更新顏色",
|
||||
|
||||
// Layout configuration
|
||||
MODAL_LAYOUT_TITLE: "佈局配置",
|
||||
// Section Headers
|
||||
SECTION_GENERAL: "常規間距",
|
||||
SECTION_RADIAL: "徑向佈局(順時針)",
|
||||
SECTION_DIRECTIONAL: "定向佈局(左/右)",
|
||||
SECTION_VERTICAL: "垂直導圖(上/下)",
|
||||
SECTION_VISUALS: "視覺元素",
|
||||
SECTION_MANUAL: "手動模式行為",
|
||||
LAYOUT_RESET: "重置所有為預設值",
|
||||
LAYOUT_SAVE: "儲存並關閉",
|
||||
// Radial Strings
|
||||
RADIAL_ASPECT_RATIO: "橢圓長寬比",
|
||||
DESC_RADIAL_ASPECT_RATIO: "控制形狀。< 1.0 為瘦長(0.7 為縱向),1.0 為正圓,> 1.0 為寬扁(橫向)。",
|
||||
RADIAL_POLE_GAP_BONUS: "極點間距補償",
|
||||
DESC_RADIAL_POLE_GAP_BONUS: "增加橢圓南北兩極區域內節點的間距。值越大,節點沿弧線推得越遠。",
|
||||
RADIAL_START_ANGLE: "起始角度",
|
||||
DESC_RADIAL_START_ANGLE: "第一個節點出現的位置(度數)。270 為北,0 為東,90 為南。",
|
||||
RADIAL_MAX_SWEEP: "最大掃過角度",
|
||||
DESC_RADIAL_MAX_SWEEP: "分支可填充的弧範圍。360 為全圓。較小的值會使圓不完整。",
|
||||
// Others
|
||||
GAP_X: "水平間距(Gap X)",
|
||||
DESC_LAYOUT_GAP_X: "親代節點與子節點之間的水平距離。",
|
||||
GAP_Y: "垂直間距(Gap Y)",
|
||||
DESC_LAYOUT_GAP_Y: "同級節點之間的垂直距離。徑向佈局中的基礎間距。",
|
||||
GAP_MULTIPLIER: "間距倍數",
|
||||
DESC_LAYOUT_GAP_MULTIPLIER: "葉節點(無子節點的節點)相對於字型大小的垂直間距。低:類似列表堆疊;高:標準樹狀間距。",
|
||||
DIRECTIONAL_ARC_SPAN_RADIANS: "定向張開弧度(Arc-span Radians)",
|
||||
DESC_LAYOUT_ARC_SPAN: "子節點排列的曲率。低(0.5):較平,類似列表。高(2.0):彎曲有機,但有重疊風險。",
|
||||
ROOT_RADIUS_FACTOR: "根節點半徑係數",
|
||||
DESC_LAYOUT_ROOT_RADIUS: "相對於根節點邊框的倍數,決定最初的半徑。",
|
||||
MIN_RADIUS: "最小半徑",
|
||||
DESC_LAYOUT_MIN_RADIUS: "從根節點中心到第一級節點的最小絕對距離。",
|
||||
RADIUS_PADDING_PER_NODE: "單節點徑向空白邊距",
|
||||
DESC_LAYOUT_RADIUS_PADDING: "每個子節點額外增加的半徑,以適應密集型導圖。",
|
||||
GAP_MULTIPLIER_RADIAL: "徑向佈局間距倍數",
|
||||
DESC_LAYOUT_GAP_RADIAL: "徑向佈局模式下的角度間距倍數。",
|
||||
GAP_MULTIPLIER_DIRECTIONAL: "垂直方向間距倍數",
|
||||
DESC_LAYOUT_GAP_DIRECTIONAL: "定向佈局頂層分支之間的間距倍數。",
|
||||
INDICATOR_OFFSET: "摺疊指示符偏移",
|
||||
DESC_LAYOUT_INDICATOR_OFFSET: "摺疊指示符(三連點)距離節點的距離。",
|
||||
INDICATOR_OPACITY: "摺疊指示符不透明度",
|
||||
DESC_LAYOUT_INDICATOR_OPACITY: "摺疊指示符的不透明度(0-100)。",
|
||||
CONTAINER_PADDING: "容器內邊距",
|
||||
DESC_LAYOUT_CONTAINER_PADDING: "使用邊框樣式時的內邊距。",
|
||||
MAX_SEGMENT_LENGTH: "邊界線精度",
|
||||
DESC_LAYOUT_BOUNDARY_LINE_PRECISION: "邊界平滑精度。值越小越精細(30 = 精細),值越大越粗略(200 = 粗略)。",
|
||||
VERTICAL_SUBTREE_WIDTH_BLEND_SINGLE: "子樹寬度參與度(單側)",
|
||||
DESC_VERTICAL_SUBTREE_WIDTH_BLEND_SINGLE: "垂直導圖中,單側生長的子圖佔用(左/右)水平空間的強度。影響程度高。",
|
||||
VERTICAL_SUBTREE_WIDTH_BLEND_DUAL: "子樹寬度參與度(雙側)",
|
||||
DESC_VERTICAL_SUBTREE_WIDTH_BLEND_DUAL: "垂直導圖中,雙側生長的子圖佔用(左右)水平空間的強度。影響程度高。",
|
||||
VERTICAL_SUBTREE_SMOOTH_THRESHOLD_MULTIPLIER: "子樹平滑壓縮觸發倍數",
|
||||
DESC_VERTICAL_SUBTREE_SMOOTH_THRESHOLD_MULTIPLIER: "超過 Gap Y 乘以該倍數後開始平滑壓縮,避免新增子節點間距突變。通常在大導圖中更明顯。",
|
||||
VERTICAL_SUBTREE_SMOOTH_MIN_SCALE: "子樹平滑壓縮下限",
|
||||
DESC_VERTICAL_SUBTREE_SMOOTH_MIN_SCALE: "垂直子樹寬度平滑壓縮到的最小值。值越大越保留原寬度。通常在大導圖中更明顯。",
|
||||
HORIZONTAL_L1_SOFTCAP_THRESHOLD: "L1 水平方向軟上限",
|
||||
DESC_HORIZONTAL_L1_SOFTCAP_THRESHOLD: "超過該 px 值後,上/下 L1 子樹寬度開始壓縮。對大導圖影響程度中到高。",
|
||||
HORIZONTAL_L1_COMPRESSION_MIN_SCALE: "L1 水平方向壓縮下限",
|
||||
DESC_HORIZONTAL_L1_COMPRESSION_MIN_SCALE: "上/下 L1 寬度壓縮到的最小值。值越大越保留原寬度。達到軟上限後影響中等。",
|
||||
VERTICAL_COMPACT_PARENT_CHILD_GAP_RATIO: "緊湊親子間距比例",
|
||||
DESC_VERTICAL_COMPACT_PARENT_CHILD_GAP_RATIO: "緊湊垂直子樹中,親子間距使用 Gap X 乘以該比例。極大影響視覺效果。",
|
||||
DIRECTIONAL_CROSS_AXIS_RATIO: "正交軸之比",
|
||||
DESC_DIRECTIONAL_CROSS_AXIS_RATIO: "與垂直於生長方向的軸(Cross-axis)的半徑之比(0.2 = 扁,1.0 = 圓)。極大影響 L1 展開形態。",
|
||||
MANUAL_GAP_MULTIPLIER: "手動佈局間距倍數",
|
||||
DESC_LAYOUT_MANUAL_GAP: "停用自動佈局時新增節點的間距倍數。",
|
||||
MANUAL_JITTER_RANGE: "手動佈局抖動範圍",
|
||||
DESC_LAYOUT_MANUAL_JITTER: "停用自動佈局時新增節點的隨機位置偏移。",
|
||||
|
||||
// Misc
|
||||
INPUT_TITLE_PASTE_ROOT: "MindMap Builder 貼上",
|
||||
INSTRUCTIONS: "> [!Tip]\n" +
|
||||
">🚀 想要進階?歡迎參加官方 [MindMap Builder 課程](https://www.visual-thinking-workshop.com/mindmap)!\n" +
|
||||
"\n" +
|
||||
"- **ENTER**:新增子節點並保留在當前親代節點上,方便快速輸入。" +
|
||||
"若輸入框為空時按回車,焦點將移動到最新新增的子節點。" +
|
||||
"連續按回車將在該節點的同級節點間迴圈切換。\n" +
|
||||
"- **熱鍵**:見側邊面板底部的配置選項。\n" +
|
||||
"- **停靠/取消停靠**:使用按鈕或配置好的熱鍵來切換輸入框位置。\n" +
|
||||
"- **摺疊**:僅在輸入框停靠時顯示按鈕;取消停靠時請使用熱鍵。\n" +
|
||||
"- **ESC**:將浮動輸入框停靠,但不啟用側邊面板。\n" +
|
||||
"- **著色**:頂層分支擁有獨立顏色(多色模式),後代節點繼承親代顏色。\n" +
|
||||
"- **編組**:\n" +
|
||||
" - 啟用“分支編組”將遞迴地編組子樹,從葉節點到頂層分支。\n" +
|
||||
"- **複製/貼上**:匯出/匯入含縮排的 Markdown 列表。\n" +
|
||||
"\n" +
|
||||
"😍 如果你覺得這個指令碼有用,歡迎 [請我喝杯咖啡 ☕](https://ko-fi.com/zsolt)。",
|
||||
});
|
||||
|
||||
const t = (key, params = {}) => {
|
||||
const str = STRINGS[LOCALE]?.[key] ?? STRINGS.en[key] ?? key;
|
||||
|
||||
@@ -59,10 +59,8 @@ export default {
|
||||
NEW_IN_POPOUT_WINDOW_EMBED: "Create new drawing - IN A POPOUT WINDOW - and embed into active document",
|
||||
TOGGLE_LOCK: "Toggle Text Element between edit RAW and PREVIEW",
|
||||
DELETE_FILE: "Delete selected image or Markdown file from Obsidian Vault",
|
||||
MARKER_FRAME_SHOW: "Show Marker Frames",
|
||||
MARKER_FRAME_HIDE: "Hide Marker Frames",
|
||||
MARKER_FRAME_TITLE_SHOW: "Show Marker Frame Titles",
|
||||
MARKER_FRAME_TITLE_HIDE: "Hide Marker Frame Titles",
|
||||
MARKER_FRAME_SHOW: "Marker Frames Visible",
|
||||
MARKER_FRAME_TITLE_SHOW: "Marker Frame Titles Visible",
|
||||
COPY_ELEMENT_LINK: "Copy [[link]] for selected element(s)",
|
||||
FRAME_WITH_NAME: "Copy frame link by name",
|
||||
COPY_DRAWING_LINK: "Copy ![[embed link]] for this drawing",
|
||||
@@ -94,10 +92,10 @@ export default {
|
||||
ERROR_TRY_AGAIN: "Please try again.",
|
||||
PASTE_CODEBLOCK: "Paste code block",
|
||||
INVERT_IMAGES_IN_DARK_MODE: "Invert image(s) in dark mode",
|
||||
DO_NOT_INVERT_IMAGES_IN_DARK_MODE: "Do not invert image(s) in dark mode",
|
||||
INSERT_LATEX:
|
||||
`Insert LaTeX formula (e.g. \\binom{n}{k} = \\frac{n!}{k!(n-k)!}).`,
|
||||
ENTER_LATEX: "Enter a valid LaTeX expression",
|
||||
EDIT_LATEX: "Edit LaTeX formula",
|
||||
READ_RELEASE_NOTES: "Read latest release notes",
|
||||
RUN_OCR: "OCR full drawing: Grab text from freedraw + images to clipboard and doc.props",
|
||||
RERUN_OCR: "OCR full drawing re-run: Grab text from freedraw + images to clipboard and doc.props",
|
||||
@@ -190,8 +188,6 @@ export default {
|
||||
CONVERT_TO_MARKDOWN: "Convert to file...",
|
||||
SELECT_TEXTELEMENT_ONLY: "Select text element only (not container)",
|
||||
REMOVE_LINK: "Remove text element link",
|
||||
LASER_ON: "Enable laser pointer",
|
||||
LASER_OFF: "Disable laser pointer",
|
||||
WELCOME_RANK_NEXT: "more drawings until the next rank!",
|
||||
WELCOME_RANK_LEGENDARY: "You're at the top. Keep on being legendary!",
|
||||
WELCOME_COMMAND_PALETTE: 'Type "Excalidraw" in the Command Palette',
|
||||
|
||||
@@ -59,9 +59,7 @@ export default {
|
||||
TOGGLE_LOCK: "Alternar Elemento de Texto entre edición RAW y VISTA PREVIA",
|
||||
DELETE_FILE: "Eliminar imagen o archivo Markdown seleccionado de la Bóveda de Obsidian",
|
||||
MARKER_FRAME_SHOW: "Mostrar Marker Frames(marcos de marcador)",
|
||||
MARKER_FRAME_HIDE: "Ocultar Marker Frames(marcos de marcador)",
|
||||
MARKER_FRAME_TITLE_SHOW: "Mostrar títulos de Marker Frames(marcos de marcador)",
|
||||
MARKER_FRAME_TITLE_HIDE: "Ocultar títulos de Marker Frames(marcos de marcador)",
|
||||
COPY_ELEMENT_LINK: "Copiar [[enlace]] para el/los elemento(s) seleccionado(s)",
|
||||
COPY_DRAWING_LINK: "Copiar ![[enlace incrustado]] de este bosquejo",
|
||||
INSERT_LINK_TO_ELEMENT:
|
||||
@@ -184,8 +182,6 @@ export default {
|
||||
CONVERT_TO_MARKDOWN: "Convertir a archivo...",
|
||||
SELECT_TEXTELEMENT_ONLY: "Seleccionar solo elemento de texto (no contenedor)",
|
||||
REMOVE_LINK: "Eliminar enlace del elemento de texto",
|
||||
LASER_ON: "Activar puntero láser",
|
||||
LASER_OFF: "Desactivar puntero láser",
|
||||
WELCOME_RANK_NEXT: "¡más bosquejos hasta el siguiente rango!",
|
||||
WELCOME_RANK_LEGENDARY: "Estás en la cima. ¡Sigue siendo legendario!",
|
||||
WELCOME_COMMAND_PALETTE: 'Escribe "Excalidraw" en la Paleta de Comandos',
|
||||
|
||||
@@ -132,8 +132,6 @@ export default {
|
||||
CONVERT_TO_MARKDOWN: "Преобразовать в файл...",
|
||||
SELECT_TEXTELEMENT_ONLY: "Выбрать только текстовый элемент (не контейнер)",
|
||||
REMOVE_LINK: "Удалить ссылку на текстовый элемент",
|
||||
LASER_ON: "Включить лазерный указатель",
|
||||
LASER_OFF: "Отключить лазерный указатель",
|
||||
WELCOME_RANK_NEXT: "Больше рисунков до следующего ранга!",
|
||||
WELCOME_RANK_LEGENDARY: "Вы на вершине. Продолжайте быть легендарным!",
|
||||
WELCOME_COMMAND_PALETTE: 'Введите «Excalidraw» в палитре коман',
|
||||
|
||||
@@ -60,9 +60,7 @@ export default {
|
||||
TOGGLE_LOCK: "文本元素:原文模式(RAW)⟺ 预览模式(PREVIEW)",
|
||||
DELETE_FILE: "从仓库中删除所选图片(或以图像形式嵌入的 Markdown)源文件",
|
||||
MARKER_FRAME_SHOW: "显示标记画框",
|
||||
MARKER_FRAME_HIDE: "隐藏标记画框",
|
||||
MARKER_FRAME_TITLE_SHOW: "显示标记画框名称",
|
||||
MARKER_FRAME_TITLE_HIDE: "隐藏标记画框名称",
|
||||
COPY_ELEMENT_LINK: "复制所选元素的 [[file#^id]] 链接",
|
||||
FRAME_WITH_NAME: "按名称复制画框链接",
|
||||
COPY_DRAWING_LINK: "复制绘图的 ![[drawing]] 链接",
|
||||
@@ -94,7 +92,6 @@ export default {
|
||||
ERROR_TRY_AGAIN: "请重试。",
|
||||
PASTE_CODEBLOCK: "粘贴代码块",
|
||||
INVERT_IMAGES_IN_DARK_MODE: "深色主题下反转颜色",
|
||||
DO_NOT_INVERT_IMAGES_IN_DARK_MODE: "取消深色主题下反转颜色",
|
||||
INSERT_LATEX:
|
||||
`插入 LaTeX 公式到当前绘图中`,
|
||||
ENTER_LATEX: "输入 LaTeX 公式",
|
||||
@@ -190,8 +187,6 @@ export default {
|
||||
CONVERT_TO_MARKDOWN: "转存为 Markdown 文档(并嵌入当前绘图)",
|
||||
SELECT_TEXTELEMENT_ONLY: "只选择文本元素(非容器)",
|
||||
REMOVE_LINK: "移除文字元素链接",
|
||||
LASER_ON: "启用激光笔",
|
||||
LASER_OFF: "关闭激光笔",
|
||||
WELCOME_RANK_NEXT: "张绘图之后,到达下一等级!",
|
||||
WELCOME_RANK_LEGENDARY: "您已是绘图大师,续写传奇吧!",
|
||||
WELCOME_COMMAND_PALETTE: '在命令面板中输入 "Excalidraw"',
|
||||
|
||||
@@ -60,9 +60,7 @@ export default {
|
||||
TOGGLE_LOCK: "文字元素:原文模式(RAW)⟺ 預覽模式(PREVIEW)",
|
||||
DELETE_FILE: "從倉庫中刪除所選圖片(或以影像形式嵌入的 Markdown)原始檔",
|
||||
MARKER_FRAME_SHOW: "顯示標記畫框",
|
||||
MARKER_FRAME_HIDE: "隱藏標記畫框",
|
||||
MARKER_FRAME_TITLE_SHOW: "顯示標記畫框名稱",
|
||||
MARKER_FRAME_TITLE_HIDE: "隱藏標記畫框名稱",
|
||||
COPY_ELEMENT_LINK: "複製所選元素的 [[file#^id]] 連結",
|
||||
FRAME_WITH_NAME: "按名稱複製畫框連結",
|
||||
COPY_DRAWING_LINK: "複製繪圖的 ![[drawing]] 連結",
|
||||
@@ -94,7 +92,6 @@ export default {
|
||||
ERROR_TRY_AGAIN: "請重試。",
|
||||
PASTE_CODEBLOCK: "貼上程式碼塊",
|
||||
INVERT_IMAGES_IN_DARK_MODE: "深色主題下反轉顏色",
|
||||
DO_NOT_INVERT_IMAGES_IN_DARK_MODE: "取消深色主題下反轉顏色",
|
||||
INSERT_LATEX:
|
||||
`插入 LaTeX 公式到當前繪圖中`,
|
||||
ENTER_LATEX: "輸入 LaTeX 公式",
|
||||
@@ -190,8 +187,6 @@ export default {
|
||||
CONVERT_TO_MARKDOWN: "轉存為 Markdown 文件(並嵌入當前繪圖)",
|
||||
SELECT_TEXTELEMENT_ONLY: "只選擇文字元素(非容器)",
|
||||
REMOVE_LINK: "移除文字元素連結",
|
||||
LASER_ON: "啟用雷射筆",
|
||||
LASER_OFF: "關閉雷射筆",
|
||||
WELCOME_RANK_NEXT: "張繪圖之後,到達下一等級!",
|
||||
WELCOME_RANK_LEGENDARY: "您已是繪圖大師,續寫傳奇吧!",
|
||||
WELCOME_COMMAND_PALETTE: '在命令面板中輸入 "Excalidraw"',
|
||||
|
||||
@@ -21,9 +21,10 @@ I build this plugin in my free time, as a labor of love. Curious about the philo
|
||||
## Fixed
|
||||
- Sizing of embedded images in Markdown when image type is set to SVG. [#2685](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2685)
|
||||
- Fixed Enter, Up/Down arrows, and TAB keys stop working in text element after deleting the \`#\` character [#2704](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2704)
|
||||
- Context menu styling [#2697](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2697) 🙏[@heinrich26](https://github.com/heinrich26)
|
||||
|
||||
## New
|
||||
- LaTeX editor is now floating [#2684](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2684) 🙏[@TravisLEBLANC1](https://github.com/TravisLEBLANC1)
|
||||
- LaTeX editor is now floating [#2684](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2684) 🙏[@TravisLEBLANC1](https://github.com/TravisLEBLANC1), [#2698](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2698) 🙏[@heinrich26](https://github.com/heinrich26)
|
||||
- Inline link suggester now supports triggers \`
|
||||
- New Context Menu options to disable arrow binding and midpoint snapping. [#10906](https://github.com/excalidraw/excalidraw/pull/10906)
|
||||
|
||||
@@ -323,34 +323,29 @@ export async function addBackOfTheNoteCard(
|
||||
export function renderContextMenuAction(
|
||||
React: any,
|
||||
label: string,
|
||||
action: Function,
|
||||
action: () => void,
|
||||
onClose: (callback?: () => void) => void,
|
||||
actionId?: string,
|
||||
checked: boolean = false,
|
||||
) {
|
||||
return React.createElement (
|
||||
return React.createElement(
|
||||
"li",
|
||||
{
|
||||
key: nanoid(),
|
||||
onClick: () => {
|
||||
onClose(()=>action())
|
||||
},
|
||||
onClick: () => onClose(action),
|
||||
"data-testid": actionId
|
||||
},
|
||||
React.createElement(
|
||||
"button",
|
||||
{
|
||||
className: "context-menu-item",
|
||||
},
|
||||
{ className: checked ? "context-menu-item checkmark" : "context-menu-item" },
|
||||
React.createElement(
|
||||
"div",
|
||||
{
|
||||
className: "context-menu-item__label",
|
||||
},
|
||||
{ className: "context-menu-item__label" },
|
||||
label,
|
||||
),
|
||||
React.createElement(
|
||||
"kbd",
|
||||
{
|
||||
className: "context-menu-item__shortcut",
|
||||
},
|
||||
{ className: "context-menu-item__shortcut" },
|
||||
"", //this is where the shortcut may go in the future
|
||||
),
|
||||
)
|
||||
|
||||
+93
-100
@@ -5173,42 +5173,31 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
const selectedElementIds = Object.keys(api.getAppState().selectedElementIds);
|
||||
const areElementsSelected = selectedElementIds.length > 0;
|
||||
|
||||
if(this.isLinkSelected()) {
|
||||
if (this.isLinkSelected()) {
|
||||
const isFormula = !(this.getSelectedTextElement()?.id) &&
|
||||
this.excalidrawData.hasEquation(this.getSelectedImageElement()?.fileId)
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
t("OPEN_LINK_CLICK"),
|
||||
isFormula ? t("EDIT_LATEX") : t("OPEN_LINK_CLICK"),
|
||||
() => {
|
||||
const event = emulateKeysForLinkClick("new-tab");
|
||||
this.handleLinkClick(event, true);
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
isFormula ? "editFormula" : "openLink"
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
if(appState.viewModeEnabled) {
|
||||
const isLaserOn = appState.activeTool?.type === "laser";
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
isLaserOn ? t("LASER_OFF") : t("LASER_ON"),
|
||||
() => {
|
||||
api.setActiveTool({type: isLaserOn ? "selection" : "laser"});
|
||||
},
|
||||
onClose
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
if(!appState.viewModeEnabled) {
|
||||
const selectedTextElements = this.getViewSelectedElements().filter(el=>el.type === "text");
|
||||
if(selectedTextElements.length===1) {
|
||||
if (!appState.viewModeEnabled) {
|
||||
const selectedTextElements = this.getViewSelectedElements().filter(el => el.type === "text");
|
||||
if (selectedTextElements.length === 1) {
|
||||
const selectedTextElement = selectedTextElements[0] as ExcalidrawTextElement;
|
||||
const containerElement = (this.getViewElements() as ExcalidrawElement[]).find(el=>el.id === selectedTextElement.containerId);
|
||||
const containerElement = (this.getViewElements() as ExcalidrawElement[]).find(el => el.id === selectedTextElement.containerId);
|
||||
|
||||
//if the text element in the container no longer has a link associated with it...
|
||||
if(
|
||||
if (
|
||||
containerElement &&
|
||||
selectedTextElement.link &&
|
||||
this.excalidrawData.getParsedText(selectedTextElement.id) === selectedTextElement.rawText
|
||||
@@ -5225,27 +5214,29 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
await ea.addElementsToView(false);
|
||||
ea.destroy();
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"removeLink"
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
if(containerElement) {
|
||||
if (containerElement) {
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
t("SELECT_TEXTELEMENT_ONLY"),
|
||||
() => {
|
||||
window.setTimeout(()=>
|
||||
window.setTimeout(() =>
|
||||
(this.excalidrawAPI as ExcalidrawImperativeAPI).selectElements([selectedTextElement])
|
||||
);
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"selectTextWithoutContainer"
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
if(!containerElement || (containerElement && containerElement.type !== "arrow")) {
|
||||
if (!containerElement || (containerElement && containerElement.type !== "arrow")) {
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
@@ -5253,28 +5244,30 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
() => {
|
||||
this.convertTextElementToMarkdown(selectedTextElement, containerElement);
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"convertToMarkdown"
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
const img = this.getSingleSelectedImage();
|
||||
if(img && img.embeddedFile?.isHyperLink) {
|
||||
if (img?.embeddedFile?.isHyperLink) {
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
t("CONVERT_URL_TO_FILE"),
|
||||
() => {
|
||||
window.setTimeout(()=>this.convertImageElWithURLToLocalFile(img));
|
||||
window.setTimeout(() => this.convertImageElWithURLToLocalFile(img));
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"convertImgUrlToFile"
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
if(
|
||||
img && img.embeddedFile && img.embeddedFile.mimeType === "image/svg+xml" &&
|
||||
if (
|
||||
img?.embeddedFile?.mimeType === "image/svg+xml" &&
|
||||
(!img.embeddedFile.file || (img.embeddedFile.file && !this.plugin.isExcalidrawFile(img.embeddedFile.file)))
|
||||
) {
|
||||
contextMenuActions.push([
|
||||
@@ -5285,27 +5278,28 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
const base64Content = img.embeddedFile.getImage(false).split(',')[1];
|
||||
// Decoding the base64 content
|
||||
const svg = atob(base64Content);
|
||||
if(!svg || svg === "") return;
|
||||
if (!svg || svg === "") return;
|
||||
const ea = getEA(this) as ExcalidrawAutomate;
|
||||
ea.importSVG(svg);
|
||||
ea.addToGroup(ea.getElements().map(el=>el.id));
|
||||
ea.addToGroup(ea.getElements().map(el => el.id));
|
||||
await ea.addElementsToView(true, true, true,true);
|
||||
ea.destroy();
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"convertSvgToStrokes"
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
const selectedImages = this.getViewSelectedElements().filter(el => el.type === "image") as ExcalidrawImageElement[];
|
||||
if(selectedImages.length > 0) {
|
||||
if (selectedImages.length > 0) {
|
||||
type ImageType = "svg" | "pdf" | "bitmap" | "excalidraw";
|
||||
|
||||
const getImageType = (embeddedFile: EmbeddedFile | null | undefined): ImageType | null => {
|
||||
if(!embeddedFile) return null;
|
||||
if(embeddedFile.file && this.plugin.isExcalidrawFile(embeddedFile.file)) return "excalidraw";
|
||||
if(embeddedFile.file?.extension?.toLowerCase?.() === "pdf" || !!embeddedFile.pdfPageViewProps) return "pdf";
|
||||
if(embeddedFile.mimeType === "image/svg+xml") return "svg";
|
||||
const getImageType = (embeddedFile?: EmbeddedFile): ImageType | null => {
|
||||
if (!embeddedFile) return null;
|
||||
if (embeddedFile.file && this.plugin.isExcalidrawFile(embeddedFile.file)) return "excalidraw";
|
||||
if (embeddedFile.file?.extension?.toLowerCase?.() === "pdf" || !!embeddedFile.pdfPageViewProps) return "pdf";
|
||||
if (embeddedFile.mimeType === "image/svg+xml") return "svg";
|
||||
return "bitmap";
|
||||
};
|
||||
|
||||
@@ -5315,13 +5309,14 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
imageType: ImageType,
|
||||
): boolean => {
|
||||
const invertBitmap = imageEl.customData?.invertBitmapInDarkmode;
|
||||
if(imageType === "svg" || imageType === "excalidraw") {
|
||||
return imageEl.customData?.doNotInvertSVGInDarkMode ? false : true;
|
||||
switch (imageType) {
|
||||
case "svg":
|
||||
case "excalidraw":
|
||||
return !imageEl.customData?.doNotInvertSVGInDarkMode;
|
||||
case "pdf":
|
||||
return invertBitmap ?? true;
|
||||
}
|
||||
if(imageType === "pdf") {
|
||||
return typeof invertBitmap === "boolean" ? invertBitmap : true;
|
||||
}
|
||||
return typeof invertBitmap === "boolean" ? invertBitmap : false;
|
||||
return invertBitmap ?? false;
|
||||
};
|
||||
|
||||
const imageMenuState = (() => {
|
||||
@@ -5331,7 +5326,7 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
.map(el => {
|
||||
const embeddedFile = getEmbeddedFileForImageElment(ea, el);
|
||||
const imageType = getImageType(embeddedFile);
|
||||
if(!embeddedFile || !imageType) return null;
|
||||
if (!embeddedFile || !imageType) return null;
|
||||
return {
|
||||
el,
|
||||
imageType,
|
||||
@@ -5339,22 +5334,22 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as { el: ExcalidrawImageElement; imageType: ImageType; invertInDarkMode: boolean; }[];
|
||||
if(imagesWithStatus.length === 0) return null;
|
||||
if (imagesWithStatus.length === 0) return null;
|
||||
const reference = imagesWithStatus[0].invertInDarkMode;
|
||||
if(!imagesWithStatus.every(img => img.invertInDarkMode === reference)) return null;
|
||||
if (!imagesWithStatus.every(img => img.invertInDarkMode === reference)) return null;
|
||||
return { imagesWithStatus, invertInDarkMode: reference };
|
||||
} finally {
|
||||
ea.destroy();
|
||||
}
|
||||
})();
|
||||
|
||||
if(imageMenuState) {
|
||||
if (imageMenuState) {
|
||||
const { imagesWithStatus, invertInDarkMode } = imageMenuState;
|
||||
const newInvertState = !invertInDarkMode;
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
newInvertState ? t("INVERT_IMAGES_IN_DARK_MODE") : t("DO_NOT_INVERT_IMAGES_IN_DARK_MODE"),
|
||||
t("INVERT_IMAGES_IN_DARK_MODE"),
|
||||
async () => {
|
||||
const ea = getEA(this) as ExcalidrawAutomate;
|
||||
ea.copyViewElementsToEAforEditing(imagesWithStatus.map(img => img.el));
|
||||
@@ -5362,7 +5357,7 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
const editableEl = ea.getElement(img.el.id) as Mutable<ExcalidrawImageElement>;
|
||||
const embeddedFile = getEmbeddedFileForImageElment(ea, editableEl);
|
||||
const imageType = getImageType(embeddedFile) ?? img.imageType;
|
||||
if(imageType === "svg" || imageType === "excalidraw") {
|
||||
if (imageType === "svg" || imageType === "excalidraw") {
|
||||
addAppendUpdateCustomData(editableEl, {
|
||||
doNotInvertSVGInDarkMode: newInvertState ? undefined : true,
|
||||
invertBitmapInDarkmode: undefined,
|
||||
@@ -5377,21 +5372,22 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
await ea.addElementsToView(false);
|
||||
ea.destroy();
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"invertImageInDarkmode",
|
||||
invertInDarkMode
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if(areElementsSelected) {
|
||||
if (areElementsSelected) {
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
t("COPY_ELEMENT_LINK"),
|
||||
() => {
|
||||
this.copyLinkToSelectedElementToClipboard("");
|
||||
},
|
||||
onClose
|
||||
() => this.copyLinkToSelectedElementToClipboard(""),
|
||||
onClose,
|
||||
"copyElementLink"
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
@@ -5403,25 +5399,24 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
const path = this.file.path.match(/(.*)(\.md)$/)?.[1];
|
||||
navigator.clipboard.writeText(`![[${path ?? this.file.path}]]`);
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"copyDrawingLink"
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
if(this.getViewSelectedElements().filter(el=>el.type==="embeddable").length === 1) {
|
||||
if (this.getViewSelectedElements().filter(el=> el.type === "embeddable").length === 1) {
|
||||
const embeddableData = this.getEmbeddableLeafElementById(
|
||||
this.getViewSelectedElements().filter(el=>el.type==="embeddable")[0].id
|
||||
this.getViewSelectedElements().find(el => el.type === "embeddable").id
|
||||
);
|
||||
const child = embeddableData?.node?.child;
|
||||
if(child && (child.file === this.file)) {
|
||||
if (embeddableData?.node?.child?.file === this.file) {
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
t("CONVERT_CARD_TO_FILE"),
|
||||
() => {
|
||||
this.moveBackOfTheNoteCardToFile();
|
||||
},
|
||||
onClose
|
||||
() => this.moveBackOfTheNoteCardToFile(),
|
||||
onClose,
|
||||
"convertCardToFile"
|
||||
),
|
||||
]);
|
||||
}
|
||||
@@ -5431,10 +5426,9 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
t("INSERT_CARD"),
|
||||
() => {
|
||||
this.insertBackOfTheNoteCard();
|
||||
},
|
||||
onClose
|
||||
() => this.insertBackOfTheNoteCard(),
|
||||
onClose,
|
||||
"insertCard"
|
||||
),
|
||||
]);
|
||||
contextMenuActions.push([
|
||||
@@ -5445,7 +5439,8 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
const insertFileModal = new UniversalInsertFileModal(this.plugin, this);
|
||||
insertFileModal.open();
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"insertAnyFile"
|
||||
),
|
||||
]);
|
||||
if (DEVICE.isTablet || DEVICE.isMobile) {
|
||||
@@ -5456,7 +5451,8 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
() => {
|
||||
this.plugin.insertLinkDialog.start(this.file.path, (markdownlink: string, path:string, alias:string) => this.addLink(markdownlink, path, alias));
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"insertLinkToFile"
|
||||
),
|
||||
// Add more context menu actions here if needed
|
||||
]);
|
||||
@@ -5467,55 +5463,52 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
|
||||
t("PASTE_CODEBLOCK"),
|
||||
async () => {
|
||||
const data = await navigator.clipboard?.readText();
|
||||
if(!data || data.trim() === "") return;
|
||||
if (!data || data.trim() === "") return;
|
||||
this.pasteCodeBlock(data);
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"pasteCodeblock"
|
||||
),
|
||||
])
|
||||
|
||||
if(
|
||||
!areElementsSelected &&
|
||||
elements.some(el=>el.type === "frame" && el.frameRole === "marker")
|
||||
) {
|
||||
const {frameRendering} = appState;
|
||||
if ( !areElementsSelected ) {
|
||||
const { frameRendering } = appState;
|
||||
const enabled = frameRendering.markerEnabled && frameRendering.enabled && frameRendering.outline;
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
frameRendering.markerEnabled && frameRendering.enabled && frameRendering.outline
|
||||
? t("MARKER_FRAME_HIDE")
|
||||
: t("MARKER_FRAME_SHOW"),
|
||||
t("MARKER_FRAME_SHOW"),
|
||||
() => {
|
||||
const markerEnabled = !(frameRendering.markerEnabled && frameRendering.enabled && frameRendering.outline);
|
||||
if(markerEnabled) {
|
||||
window.setTimeout(() => this.updateScene({appState: {frameRendering: {...frameRendering, enabled: true, outline: true, markerEnabled}}, captureUpdate: CaptureUpdateAction.NEVER}));
|
||||
} else {
|
||||
window.setTimeout(() => this.updateScene({appState: {frameRendering: {...frameRendering, markerEnabled}}, captureUpdate: CaptureUpdateAction.NEVER}));
|
||||
}
|
||||
window.setTimeout(() => this.updateScene({
|
||||
appState: { frameRendering: {...frameRendering, ...(enabled ? {} : { enabled: true, outline: true }), markerEnabled: !enabled } },
|
||||
captureUpdate: CaptureUpdateAction.NEVER
|
||||
}));
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"toggleMarkerFrames",
|
||||
enabled
|
||||
),
|
||||
]);
|
||||
if(frameRendering.markerEnabled && frameRendering.enabled && frameRendering.outline) {
|
||||
if (frameRendering.markerEnabled && frameRendering.enabled && frameRendering.outline) {
|
||||
contextMenuActions.push([
|
||||
renderContextMenuAction(
|
||||
React,
|
||||
frameRendering.markerName
|
||||
? t("MARKER_FRAME_TITLE_HIDE")
|
||||
: t("MARKER_FRAME_TITLE_SHOW"),
|
||||
t("MARKER_FRAME_TITLE_SHOW"),
|
||||
() => {
|
||||
window.setTimeout(() => this.updateScene({appState: {frameRendering: {...frameRendering, markerName: !frameRendering.markerName}}, captureUpdate: CaptureUpdateAction.NEVER}));
|
||||
},
|
||||
onClose
|
||||
onClose,
|
||||
"toggleMarkerFrameTitles",
|
||||
frameRendering.markerName
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(contextMenuActions.length === 0) return;
|
||||
return React.createElement (
|
||||
"div",
|
||||
if (contextMenuActions.length === 0) return;
|
||||
return React.createElement(
|
||||
React.Fragment,
|
||||
{},
|
||||
...contextMenuActions,
|
||||
React.createElement(
|
||||
|
||||
@@ -270,12 +270,7 @@ export class ObsidianMenu {
|
||||
public renderButton (isMobile: boolean, appState: AppState) {
|
||||
const isFullscreen = this.view.isFullscreen();
|
||||
return (
|
||||
<div className={clsx(
|
||||
{
|
||||
"ExcalidrawObsidianMenu--mobile": isMobile,
|
||||
"ExcalidrawObsidianMenu": !isMobile,
|
||||
},
|
||||
)}>
|
||||
<>
|
||||
<label
|
||||
className={clsx(
|
||||
"ToolIcon",
|
||||
@@ -284,7 +279,7 @@ export class ObsidianMenu {
|
||||
"is-mobile": isMobile,
|
||||
},
|
||||
)}
|
||||
onClick={this.actionShowHideMenu.bind(this,isMobile,appState)}
|
||||
onClick={this.actionShowHideMenu.bind(this, isMobile, appState)}
|
||||
>
|
||||
<div className="ToolIcon__icon" aria-label={t("OBSIDIAN_TOOLS_PANEL")}>
|
||||
{ICONS.obsidian}
|
||||
@@ -318,9 +313,9 @@ export class ObsidianMenu {
|
||||
{isFullscreen ? ICONS.exitFullScreen : ICONS.gotoFullScreen}
|
||||
</div>
|
||||
</label>
|
||||
{this.renderCustomPens(isMobile,appState)}
|
||||
{this.renderPinnedScriptButtons(isMobile,appState)}
|
||||
</div>
|
||||
{this.renderCustomPens(isMobile, appState)}
|
||||
{this.renderPinnedScriptButtons(isMobile, appState)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
+44
-59
@@ -118,14 +118,10 @@ li[data-testid] {
|
||||
padding: 0 !important;
|
||||
border-color: transparent !important;
|
||||
border: 0 !important;
|
||||
box-shadow: 0 !important;
|
||||
background-color: transparent !important;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
.excalidraw .popover {
|
||||
position: fixed !important;
|
||||
}
|
||||
}
|
||||
|
||||
.disable-zen-mode--visible {
|
||||
color: var(--text-primary-color);
|
||||
@@ -192,7 +188,7 @@ li[data-testid] {
|
||||
}
|
||||
|
||||
.excalidraw-dirty {
|
||||
color: red;
|
||||
color: var(--text-error);
|
||||
}
|
||||
|
||||
.workspace-leaf-content .excalidraw-view {
|
||||
@@ -325,6 +321,7 @@ textarea.excalidraw-wysiwyg {
|
||||
--default-icon-size: 1rem !important;
|
||||
--lg-button-size: 1.8rem !important;
|
||||
--lg-icon-size: 1rem !important;
|
||||
--editor-container-padding: var(--size-4-2);
|
||||
}
|
||||
|
||||
.excalidraw .tray-zoom {
|
||||
@@ -334,7 +331,7 @@ textarea.excalidraw-wysiwyg {
|
||||
padding-top: 0.05rem;
|
||||
}
|
||||
|
||||
.excalidraw-container.theme--dark {
|
||||
.excalidraw-container.theme--dark { /* unused */
|
||||
background-color: #121212;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -349,10 +346,6 @@ textarea.excalidraw-wysiwyg {
|
||||
max-height: 10rem;
|
||||
}
|
||||
|
||||
.excalidraw .FixedSideContainer_side_top {
|
||||
top: 0.3rem;
|
||||
}
|
||||
|
||||
.excalidraw .ToolIcon__keybinding {
|
||||
font-size: 0.45rem !important;
|
||||
}
|
||||
@@ -367,13 +360,6 @@ label.color-input-container > input {
|
||||
max-width: 5rem;
|
||||
}
|
||||
|
||||
.excalidraw .FixedSideContainer_side_top {
|
||||
left: 10px !important;
|
||||
top: 10px !important;
|
||||
right: 10px;
|
||||
bottom: 10px !important;
|
||||
}
|
||||
|
||||
.excalidraw-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -398,10 +384,6 @@ label.color-input-container > input {
|
||||
max-width: 13rem;
|
||||
}
|
||||
|
||||
.excalidraw button {
|
||||
width: initial;
|
||||
}
|
||||
|
||||
.excalidraw input[type="color"] {
|
||||
width: 1.65rem;
|
||||
height: 1.65rem;
|
||||
@@ -435,6 +417,26 @@ div.excalidraw-draginfo {
|
||||
position: absolute !important;
|
||||
}
|
||||
|
||||
/* In Obsidian-Excalidraw, the Sidebar-Trigger is sometimes in a Container/
|
||||
Island, so it shall be styled like any other of its .ToolIcon siblings */
|
||||
.excalidraw :where(.mobile-misc-tools-container, .tray-misc-tools-container) .sidebar-trigger {
|
||||
background-color: unset;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
/* this appears to me as the least impactful way of undoing the upstream mess */
|
||||
--lg-button-size: var(--button-height, var(--default-button-size));
|
||||
|
||||
&:hover {
|
||||
background-color: var(--button-hover-bg);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--button-hover-bg);
|
||||
box-shadow: none;
|
||||
border: 1px solid var(--button-active-border);
|
||||
}
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-container {
|
||||
height: 100%;
|
||||
}
|
||||
@@ -449,8 +451,8 @@ div.excalidraw-draginfo {
|
||||
.excalidraw-sidepanel__controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
padding: 0.35rem 0.5rem;
|
||||
gap: var(--size-4-1);
|
||||
padding: var(--size-4-2) var(--size-4-2);
|
||||
border-bottom: 1px solid var(--divider-color, var(--background-modifier-border));
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
@@ -459,28 +461,6 @@ div.excalidraw-draginfo {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__close-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.6rem;
|
||||
border: 1px solid var(--divider-color, var(--background-modifier-border));
|
||||
border-radius: 0.55rem;
|
||||
background: var(--background-primary);
|
||||
color: var(--text-normal);
|
||||
padding: 0 !important;
|
||||
transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__close-button:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__close-button:hover:not(:disabled) {
|
||||
background: var(--background-modifier-hover);
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__empty {
|
||||
padding: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
@@ -520,7 +500,7 @@ div.excalidraw-draginfo {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__button {
|
||||
.excalidraw-sidepanel-tab__button { /* probably unused */
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
@@ -1066,20 +1046,23 @@ textarea.excalidraw-wysiwyg, .excalidraw input {
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.excalidraw .undo-redo-buttons button {
|
||||
width: 3em;
|
||||
}
|
||||
.excalidraw--tray .App-bottom-bar > .Island > .App-toolbar > .App-toolbar-content {
|
||||
/* This will render the undo/redo buttons as if they weren't
|
||||
in a separate container, but simply part of the row */
|
||||
> :not([class]) {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.ExcalidrawObsidianMenu--mobile label.ToolIcon {
|
||||
margin-left: 4px;
|
||||
> .ToolIcon__icon:empty {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.excalidraw .excalidraw-ui-top-right.library-and-pen,
|
||||
.ExcalidrawObsidianMenu--mobile {
|
||||
display: flex;
|
||||
.excalidraw.excalidraw--mobile .excalidraw-ui-top-right {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
row-gap: 4px;
|
||||
gap: var(--size-4-1);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
@@ -1088,14 +1071,16 @@ textarea.excalidraw-wysiwyg, .excalidraw input {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.ExcalidrawObsidianMenu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.excalidraw :is(.mobile-misc-tools-container, .tray-misc-tools-container) {
|
||||
margin-right: unset;
|
||||
|
||||
&.layer-ui__wrapper__top-right--compact {
|
||||
gap: 0; /* there shouldn't be a larger gap in a "compact" mode */
|
||||
}
|
||||
}
|
||||
|
||||
.excalidraw .FixedSideContainer_side_top {
|
||||
padding-top: 0 !important;
|
||||
|
||||
}
|
||||
|
||||
.excalidraw .ToolIcon.ToolIcon__penMode {
|
||||
|
||||
Reference in new issue
Block a user