2.12.3, 0.18.0-23

This commit is contained in:
zsviczian
2025-06-14 23:36:37 +02:00
parent 5accd657d9
commit 32d0301366
10 changed files with 77 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.12.2",
"version": "2.12.3",
"minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",

View File

@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.12.2",
"version": "2.12.3",
"minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",

9
package-lock.json generated
View File

@@ -11,7 +11,7 @@
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/colormaster": "^1.2.2",
"@zsviczian/excalidraw": "0.18.0-21",
"@zsviczian/excalidraw": "0.18.0-23",
"chroma-js": "^2.4.2",
"clsx": "^2.0.0",
"es6-promise-pool": "2.5.0",
@@ -3494,10 +3494,9 @@
"license": "MIT"
},
"node_modules/@zsviczian/excalidraw": {
"version": "0.18.0-21",
"resolved": "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.18.0-21.tgz",
"integrity": "sha512-j7ltw+FY8SrcN7a2NlPACNnUsiG6eZCLAwjZNg275U2puDf4CVGzCl6d4hB24jUn9DL5F4HKrcKLspBhxJHKaA==",
"license": "MIT",
"version": "0.18.0-23",
"resolved": "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.18.0-23.tgz",
"integrity": "sha512-IFRPjBUZo2cfnhuc8EuXST17J/koJuu0m5A2SKl8yKBANUYmiszrNIL2nDVPPP3ZM3Io/prPpID6ZMUlgNEufQ==",
"dependencies": {
"@braintree/sanitize-url": "6.0.2",
"@excalidraw/random-username": "1.1.0",

View File

@@ -23,7 +23,7 @@
"license": "MIT",
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/excalidraw": "0.18.0-21",
"@zsviczian/excalidraw": "0.18.0-23",
"chroma-js": "^2.4.2",
"clsx": "^2.0.0",
"@zsviczian/colormaster": "^1.2.2",

View File

@@ -69,7 +69,9 @@ export interface ExcalidrawSettings {
drawingFilnameEmbedPostfix: string;
drawingFilenameDateTime: string;
useExcalidrawExtension: boolean;
cropSuffix: string;
cropPrefix: string;
annotateSuffix: string;
annotatePrefix: string;
annotatePreserveSize: boolean;
displaySVGInPreview: boolean; //No longer used since 1.9.13
@@ -252,7 +254,9 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
drawingFilnameEmbedPostfix: " ",
drawingFilenameDateTime: "YYYY-MM-DD HH.mm.ss",
useExcalidrawExtension: true,
cropSuffix: "",
cropPrefix: CROPPED_PREFIX,
annotateSuffix: "",
annotatePrefix: ANNOTATED_PREFIX,
annotatePreserveSize: false,
displaySVGInPreview: undefined,
@@ -320,7 +324,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
experimentalFileTag: "✏️",
experimentalLivePreview: true,
fadeOutExcalidrawMarkup: false,
loadPropertySuggestions: true,
loadPropertySuggestions: false,
experimentalEnableFourthFont: false,
experimantalFourthFont: "Virgil",
addDummyTextElement: false,
@@ -956,7 +960,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
.setDesc(fragWithHTML(t("CROP_PREFIX_DESC")))
.addText((text) =>
text
.setPlaceholder("e.g.: Cropped_ ")
.setPlaceholder("e.g.: cropped_")
.setValue(this.plugin.settings.cropPrefix)
.onChange(async (value) => {
this.plugin.settings.cropPrefix = value.replaceAll(
@@ -968,12 +972,29 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}),
);
new Setting(detailsEl)
.setName(t("CROP_SUFFIX_NAME"))
.setDesc(fragWithHTML(t("CROP_SUFFIX_DESC")))
.addText((text) =>
text
.setPlaceholder("e.g.: _cropped")
.setValue(this.plugin.settings.cropSuffix)
.onChange(async (value) => {
this.plugin.settings.cropSuffix = value.replaceAll(
/[<>:"/\\|?*]/g,
"_",
);
text.setValue(this.plugin.settings.cropSuffix);
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("ANNOTATE_PREFIX_NAME"))
.setDesc(fragWithHTML(t("ANNOTATE_PREFIX_DESC")))
.addText((text) =>
text
.setPlaceholder("e.g.: Annotated_ ")
.setPlaceholder("e.g.: annotated_")
.setValue(this.plugin.settings.annotatePrefix)
.onChange(async (value) => {
this.plugin.settings.annotatePrefix = value.replaceAll(
@@ -984,7 +1005,24 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("ANNOTATE_SUFFIX_NAME"))
.setDesc(fragWithHTML(t("ANNOTATE_SUFFIX_DESC")))
.addText((text) =>
text
.setPlaceholder("e.g.: _annotated")
.setValue(this.plugin.settings.annotateSuffix)
.onChange(async (value) => {
this.plugin.settings.annotateSuffix = value.replaceAll(
/[<>:"/\\|?*]/g,
"_",
);
text.setValue(this.plugin.settings.annotateSuffix);
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("ANNOTATE_PRESERVE_SIZE_NAME"))
.setDesc(fragWithHTML(t("ANNOTATE_PRESERVE_SIZE_DESC")))

View File

@@ -203,14 +203,22 @@ export default {
FOLDER_NAME: "Excalidraw folder (CAsE sEnsITive!)",
FOLDER_DESC:
"Default location for new drawings. If empty, drawings will be created in the Vault root.",
CROP_SUFFIX_NAME: "Crop file suffix",
CROP_SUFFIX_DESC:
"The last part of the filename for new drawings created when cropping an image. " +
"Leave empty if you don't need a sufix.",
CROP_PREFIX_NAME: "Crop file prefix",
CROP_PREFIX_DESC:
"The first part of the filename for new drawings created when cropping an image. " +
"If empty the default 'cropped_' will be used.",
"Leave empty if you don't need a prefix.",
ANNOTATE_SUFFIX_NAME: "Annotation file suffix",
ANNOTATE_SUFFIX_DESC:
"The last part of the filename for new drawings created when annotating an image. " +
"Leave empty if you don't need a suffix.",
ANNOTATE_PREFIX_NAME: "Annotation file prefix",
ANNOTATE_PREFIX_DESC:
"The first part of the filename for new drawings created when annotating an image. " +
"If empty the default 'annotated_' will be used.",
"Leave empty if you don't need a prefix.",
ANNOTATE_PRESERVE_SIZE_NAME: "Preserve image size when annotating",
ANNOTATE_PRESERVE_SIZE_DESC:
"When annotating an image in markdown the replacment image link will include the width of the original image.",

View File

@@ -17,6 +17,17 @@ I build this plugin in my free time, as a labor of love. Curious about the philo
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://storage.ko-fi.com/cdn/kofi6.png?v=6" border="0" alt="Buy Me a Coffee at ko-fi.com" height=45></a></div>
`,
"2.12.3":`
## Minor fixes
- Includes all recent updates and fixes from excalidraw.com
- Fixed issue with line editor snapping out of edit mode
- Fixed long-standing issue with wireframe to code calling a deprecated OpenAI endpoint
- "Load Excalidraw Properties into Obsidian Suggester" setting now defaults to false for new installations. [#2380](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2380)
- Taskbone OCR result does not get saved to frontmatter in some cases [#1123](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1123)
## New
- If the cropped file or annotated file prefix is set to empty, there will now be no prefix added to the file name. Additionally, now you can also set a suffix to the file name. [#2370](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2370)
`,
"2.12.2": `
## Fixed
- BUG: Excalidraw theme changes to Light from Dark when clicking line element node [#2360](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2360)

View File

@@ -114,7 +114,7 @@ export default class Taskbone {
if(addToFrontmatter) {
fe.setKey("taskbone-ocr",text);
view.data = fe.data;
view.save(false);
view.save(false, true, true);
}
window.navigator.clipboard.writeText(text);
new Notice(`I placed the recognized text onto the system clipboard${addToFrontmatter?" and to document properties":""}.`);

View File

@@ -405,8 +405,8 @@ export const getAliasWithSize = (alias: string, size: string): string => {
export const getCropFileNameAndFolder = async (plugin: ExcalidrawPlugin, hostPath: string, baseNewFileName: string):Promise<{folderpath: string, filename: string}> => {
let prefix = plugin.settings.cropPrefix || "";
if(prefix.trim() === "") prefix = CROPPED_PREFIX;
const filename = prefix + baseNewFileName + ".md";
let suffix = plugin.settings.cropSuffix || "";
const filename = prefix + baseNewFileName + suffix + ".md";
if(!plugin.settings.cropFolder || plugin.settings.cropFolder.trim() === "") {
const folderpath = (await getAttachmentsFolderAndFilePath(plugin.app, hostPath, filename)).folder;
return {folderpath, filename};
@@ -418,8 +418,8 @@ export const getCropFileNameAndFolder = async (plugin: ExcalidrawPlugin, hostPat
export const getAnnotationFileNameAndFolder = async (plugin: ExcalidrawPlugin, hostPath: string, baseNewFileName: string):Promise<{folderpath: string, filename: string}> => {
let prefix = plugin.settings.annotatePrefix || "";
if(prefix.trim() === "") prefix = ANNOTATED_PREFIX;
const filename = prefix + baseNewFileName + ".md";
let suffix = plugin.settings.annotateSuffix || "";
const filename = prefix + baseNewFileName + suffix + ".md";
if(!plugin.settings.annotateFolder || plugin.settings.annotateFolder.trim() === "") {
const folderpath = (await getAttachmentsFolderAndFilePath(plugin.app, hostPath, filename)).folder;
return {folderpath, filename};

View File

@@ -2518,6 +2518,7 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
if (!this.excalidrawAPI) {
return;
}
const loader = new EmbeddedFilesLoader(this.plugin);
const runLoader = (l: EmbeddedFilesLoader) => {
@@ -2705,7 +2706,7 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
if(this.getSceneVersion(inData.scene.elements) !== this.previousSceneVersion) {
this.setDirty(3);
}
this.updateScene({elements: sceneElements, storeAction: "capture"});
this.updateScene({elements: sceneElements, captureUpdate: CaptureUpdateAction.IMMEDIATELY});
if(reloadFiles.size>0) {
this.loadSceneFiles(false,reloadFiles);
}