forked from excalidraw/excalidraw
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
30 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,34 @@ | ||
|
||
//zsviczian, my dirty little secrets. These are hacks I am not proud of... | ||
export let hostPlugin: any = null; | ||
|
||
export const initializeObsidianUtils = (obsidianPlugin: any) => { | ||
hostPlugin = obsidianPlugin; | ||
} | ||
|
||
export const destroyObsidianUtils = () => { | ||
export function destroyObsidianUtils() { | ||
hostPlugin = null; | ||
} | ||
|
||
const getExcalidrawConfig = () => hostPlugin.excalidrawConfig; | ||
export function initializeObsidianUtils (obsidianPlugin: any) { | ||
hostPlugin = obsidianPlugin; | ||
} | ||
|
||
export const getAreaLimit = () => { | ||
return getExcalidrawConfig().areaLimit ?? 16777216; | ||
export function getAreaLimit() { | ||
return hostPlugin.excalidrawConfig.areaLimit ?? 16777216; | ||
} | ||
|
||
export const getWidthHeightLimit = () => { | ||
return getExcalidrawConfig().widthHeightLimit ?? 32767; | ||
export function getWidthHeightLimit() { | ||
return hostPlugin.excalidrawConfig.widthHeightLimit ?? 32767; | ||
} | ||
|
||
export const isExcaliBrainView = () => { | ||
export function isExcaliBrainView() { | ||
const excalidrawView = hostPlugin.activeExcalidrawView; | ||
if(!excalidrawView) return false; | ||
return excalidrawView.linksAlwaysOpenInANewPane && excalidrawView.allowFrameButtonsInViewMode; | ||
} | ||
|
||
export const getExcalidrawContentEl = ():HTMLElement => { | ||
export function getExcalidrawContentEl():HTMLElement { | ||
const excalidrawView = hostPlugin.activeExcalidrawView; | ||
if(!excalidrawView) return document.body; | ||
return excalidrawView.contentEl as HTMLElement; | ||
} | ||
|
||
export const hideFreedrawPenmodeCursor = () => { | ||
export function hideFreedrawPenmodeCursor() { | ||
return !hostPlugin.settings.penModeCrosshairVisible; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters