mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2026-11-27 06:32:42 +00:00
2.17.0-beta-6, 0.18.0-48 (merged EditorInterface refactor)
This commit is contained in:
1 parent
5696a33e60
commit
97da7c680f
6 files changed
+38
-5
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "2.17.0-beta-5",
|
||||
"version": "2.17.0-beta-6",
|
||||
"minAppVersion": "1.5.7",
|
||||
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
|
||||
"author": "Zsolt Viczian",
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@popperjs/core": "^2.11.8",
|
||||
"@zsviczian/excalidraw": "0.18.0-47",
|
||||
"@zsviczian/excalidraw": "0.18.0-48",
|
||||
"chroma-js": "^3.1.2",
|
||||
"clsx": "^2.0.0",
|
||||
"@zsviczian/colormaster": "^1.2.2",
|
||||
|
||||
@@ -26,6 +26,7 @@ import { PENS } from "src/utils/pens";
|
||||
import {
|
||||
addYouTubeThumbnail,
|
||||
fragWithHTML,
|
||||
setDesktopUIMode,
|
||||
setLeftHandedMode,
|
||||
setTrayMode,
|
||||
} from "src/utils/utils";
|
||||
@@ -179,6 +180,7 @@ export interface ExcalidrawSettings {
|
||||
};
|
||||
defaultTrayMode: boolean;
|
||||
compactModeOnTablets: boolean;
|
||||
compactModeOnDesktops: boolean;
|
||||
previousRelease: string;
|
||||
showReleaseNotes: boolean;
|
||||
compareManifestToPluginVersion: boolean;
|
||||
@@ -366,6 +368,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
|
||||
scriptEngineSettings: {},
|
||||
defaultTrayMode: true,
|
||||
compactModeOnTablets: true,
|
||||
compactModeOnDesktops: false,
|
||||
previousRelease: "0.0.0",
|
||||
showReleaseNotes: true,
|
||||
compareManifestToPluginVersion: true,
|
||||
@@ -1277,6 +1280,19 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
|
||||
})
|
||||
);
|
||||
|
||||
new Setting(detailsEl)
|
||||
.setName(t("PREFER_COMPACT_MODE_DESKTOP_NAME"))
|
||||
.setDesc(fragWithHTML(t("PREFER_COMPACT_MODE_DESKTOP_DESC")))
|
||||
.addToggle((toggle) =>
|
||||
toggle
|
||||
.setValue(this.plugin.settings.compactModeOnDesktops)
|
||||
.onChange((value) => {
|
||||
this.plugin.settings.compactModeOnDesktops = value;
|
||||
setDesktopUIMode(this.app, this.plugin.settings);
|
||||
this.applySettingsUpdate();
|
||||
}),
|
||||
);
|
||||
|
||||
new Setting(detailsEl)
|
||||
.setName(t("COMPACT_MODE_NAME"))
|
||||
.setDesc(fragWithHTML(t("COMPACT_MODE_DESC")))
|
||||
|
||||
@@ -454,8 +454,11 @@ export default {
|
||||
"⚠️ You must close and reopen the Excalidraw/markdown file for changes to take effect. ⚠️",
|
||||
MODES_HEAD: "Modes",
|
||||
TRAY_MODE_NAME: "Enable tray-mode",
|
||||
COMPACT_MODE_NAME: "Compact-mode on Tablets",
|
||||
COMPACT_MODE_DESC: "Overrides tray-mode on tablets, allowing the native Excalidraw compact-mode to be used instead.",
|
||||
PREFER_COMPACT_MODE_DESKTOP_NAME: "Prefer compact-mode on Desktop",
|
||||
PREFER_COMPACT_MODE_DESKTOP_DESC: "When toggling tray-mode on a desktop, if this option is enabled, Excalidraw will toggle between compact-mode and tray-mode. " +
|
||||
"If this setting is off, it will toggle betweeen full-mode and tray-mode.",
|
||||
COMPACT_MODE_NAME: "Prefer compact-mode on Tablets",
|
||||
COMPACT_MODE_DESC: "This setting allows you to have a different default mode on tablets, then on desktops. You can default to compact mode on tablets, and to tray-mode on desktops with the help of this setting.",
|
||||
HOTKEY_OVERRIDE_HEAD: "Hotkey overrides",
|
||||
HOTKEY_OVERRIDE_DESC: `Some of the Excalidraw hotkeys such as <code>${labelCTRL()}+Enter</code> to edit text or <code>${labelCTRL()}+K</code> to create an element link ` +
|
||||
"conflict with Obsidian hotkey settings. The hotkey combinations you add below will override Obsidian's hotkey settings while using Excalidraw, thus " +
|
||||
|
||||
@@ -22,6 +22,7 @@ I build this plugin in my free time, as a labor of love. Curious about the philo
|
||||
- Phone UI from Excalidraw.com [#9996](https://github.com/excalidraw/excalidraw/pull/9996)
|
||||
- Custom pen settings now allow pen width to be set at 0.1 increments from 0.1 to 8.0
|
||||
- Updated the "Palm Guard" script to support the change UI configurations.
|
||||
- Setting under Modes in Plugin Settings to prefer "compact-mode" on desktops when toggling tray mode.
|
||||
|
||||
## Fixed
|
||||
- side panel does not attach correctly when library is pinned [#2510](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2510)
|
||||
|
||||
+14
-1
@@ -6,7 +6,7 @@ import {
|
||||
TFolder,
|
||||
} from "obsidian";
|
||||
import { Random } from "roughjs/bin/math";
|
||||
import { BinaryFileData, DataURL} from "@zsviczian/excalidraw/types/excalidraw/types";
|
||||
import { BinaryFileData, DataURL, ExcalidrawImperativeAPI} from "@zsviczian/excalidraw/types/excalidraw/types";
|
||||
import {
|
||||
exportToSvg,
|
||||
exportToBlob,
|
||||
@@ -639,6 +639,19 @@ export function setTrayMode(app: App, settings: ExcalidrawSettings) {
|
||||
getExcalidrawViews(app).forEach((view) => view.setTrayMode(isTrayMode));
|
||||
}
|
||||
|
||||
export function setDesktopUIMode(app: App, settings: ExcalidrawSettings) {
|
||||
const isTrayMode = settings.defaultTrayMode;
|
||||
getExcalidrawViews(app).forEach((view) => view
|
||||
.setDesktopUIMode(
|
||||
isTrayMode
|
||||
? "tray"
|
||||
: settings.compactModeOnDesktops
|
||||
? "compact"
|
||||
: "full"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export type LinkParts = {
|
||||
original: string;
|
||||
path: string;
|
||||
|
||||
Reference in new issue
Block a user