Skip to content

Commit

Permalink
0.17.6-6, 2.6.0, glyph worker, host plugin fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Oct 23, 2024
1 parent 653a32e commit 06e854e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/excalidraw/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ import {
getExcalidrawContentEl,
getMaxZoom,
hideFreedrawPenmodeCursor,
initializeObsidianUtils,
} from "../obsidianUtils";
import {
hitElementBoundText,
Expand Down Expand Up @@ -711,6 +712,7 @@ class App extends React.Component<AppProps, AppState> {
};

this.id = nanoid();
initializeObsidianUtils();
this.library = new Library(this);
this.actionManager = new ActionManager(
this.syncActionResult,
Expand Down
1 change: 0 additions & 1 deletion packages/excalidraw/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ export {
getBoundTextMaxWidth, //zsviczian
mermaidToExcalidraw, //zsviczian
destroyObsidianUtils, //zsviczian
initializeObsidianUtils, //zsviczian
registerLocalFont, //zsviczian
getFontFamilies, //zsviczian
getFontFamilyString, //zsviczian
Expand Down
5 changes: 3 additions & 2 deletions packages/excalidraw/obsidianUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export function destroyObsidianUtils() {
hostPlugin = null;
}

export function initializeObsidianUtils(obsidianPlugin: any) {
hostPlugin = obsidianPlugin;
export function initializeObsidianUtils() {
//@ts-ignore
hostPlugin = app.plugins.plugins["obsidian-excalidraw-plugin"];
}

export function getAreaLimit() {
Expand Down
2 changes: 1 addition & 1 deletion packages/excalidraw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zsviczian/excalidraw",
"version": "0.17.6-5",
"version": "0.17.6-6",
"main": "main.js",
"types": "types/excalidraw/index.d.ts",
"files": [
Expand Down
4 changes: 3 additions & 1 deletion packages/excalidraw/subset/subset-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { WorkerInTheMainChunkError, WorkerUrlNotDefinedError } from "../errors";

import type { Commands } from "./subset-shared.chunk";

let shouldUseWorkers = typeof Worker !== "undefined";
// one day maybe... I don't knwo how to convert this to work locally in Obsidian :(
// https://chatgpt.com/c/67191889-c740-800a-bebb-a0fca2e800fd
let shouldUseWorkers = false; //zsviczian typeof Worker !== "undefined";

/**
* Tries to subset glyphs in a font based on the used codepoints, returning the font as dataurl.
Expand Down
1 change: 0 additions & 1 deletion packages/utils/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ export { getBoundTextMaxWidth } from "../excalidraw/element/textElement"; //zsvi
export { mermaidToExcalidraw } from "../excalidraw/components/TTDDialog/MermaidToExcalidraw"; //zsviczian
export {
destroyObsidianUtils,
initializeObsidianUtils,
registerLocalFont,
getFontFamilies,
registerFontsInCSS,
Expand Down

0 comments on commit 06e854e

Please sign in to comment.