|
|
|
|
@@ -4,8 +4,7 @@ type SuggestorInfo = {
|
|
|
|
|
field: string,
|
|
|
|
|
code: string,
|
|
|
|
|
desc: string,
|
|
|
|
|
after: string,
|
|
|
|
|
alt: boolean
|
|
|
|
|
after: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const EXCALIDRAW_AUTOMATE_INFO:SuggestorInfo[] = [
|
|
|
|
|
@@ -14,504 +13,438 @@ export const EXCALIDRAW_AUTOMATE_INFO:SuggestorInfo[] = [
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "The ExcalidrawPlugin object",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "elementsDict",
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "The {} dictionary object, contains the ExcalidrawElements currently edited in Automate indexed by el.id",
|
|
|
|
|
after: '[""]',
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "imagesDict",
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "the images files including DataURL, indexed by fileId",
|
|
|
|
|
after: '[""]',
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.strokeColor",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "A valid css color. See <a onclick='window.open(\"https://www.w3schools.com/colors/default.asp\")'>W3 School Colors</a> for more.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.backgroundColor",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "A valid css color. See <a onclick='window.open(\"https://www.w3schools.com/colors/default.asp\")'>W3 School Colors</a> for more.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.angle",
|
|
|
|
|
code: "[number]",
|
|
|
|
|
desc: "Rotation of the object in radian",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.fillStyle",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "'hachure' | 'cross-hatch' | 'solid'",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.strokeWidth",
|
|
|
|
|
code: "[number]",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.strokeStyle",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "'solid' | 'dashed' | 'dotted'",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.roughness",
|
|
|
|
|
code: "[number]",
|
|
|
|
|
desc: "0:Architect\n1:Artist\n2:Cartoonist",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.opacity",
|
|
|
|
|
code: "[number]",
|
|
|
|
|
desc: "100: Fully opaque\n0: Fully transparent",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.strokeSharpness",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "'round' | 'sharp'",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.fontFamily",
|
|
|
|
|
code: "[number]",
|
|
|
|
|
desc: "1: Virgil, 2:Helvetica, 3:Cascadia, 4:LocalFont",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.fontSize",
|
|
|
|
|
code: "[number]",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.textAlign",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "'left' | 'right' | 'center'",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.verticalAlign",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "For future use, has no effect currently; 'top' | 'bottom' | 'middle'",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.startArrowHead",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "'triangle' | 'dot' | 'arrow' | 'bar' | null",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "style.endArrowHead",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "'triangle' | 'dot' | 'arrow' | 'bar' | null",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "canvas.theme",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "'dark' | 'light'",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "canvas.viewBackgroundColor",
|
|
|
|
|
code: "[string]",
|
|
|
|
|
desc: "A valid css color.\nSee <a onclick='window.open(\"https://www.w3schools.com/colors/default.asp\")'>W3 School Colors</a> for more.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "canvas.gridSize",
|
|
|
|
|
code: "[number]",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addToGroup",
|
|
|
|
|
code: "addToGroup(objectIds: []): string;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "toCliboard",
|
|
|
|
|
code: "toClipboard(templatePath?: string): void;",
|
|
|
|
|
desc: "Copies current elements using template to clipboard, ready to be pasted into an excalidraw canvas",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getElements",
|
|
|
|
|
code: "getElements(): ExcalidrawElement[];",
|
|
|
|
|
desc: "Get all elements from ExcalidrawAutomate elementsDict",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getElement",
|
|
|
|
|
code: "getElement(id: string): ExcalidrawElement;",
|
|
|
|
|
desc: "Get single element from ExcalidrawAutomate elementsDict",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "create",
|
|
|
|
|
code: 'create(params?: {filename?: string, foldername?: string, templatePath?: string, onNewPane?: boolean, frontmatterKeys?: { "excalidraw-plugin"?: "raw" | "parsed", "excalidraw-link-prefix"?: string, "excalidraw-link-brackets"?: boolean, "excalidraw-url-prefix"?: string,},}): Promise<string>;',
|
|
|
|
|
desc: 'Create a drawing and save it to filename.\nIf filename is null: default filename as defined in Excalidraw settings.\nIf folder is null: default folder as defined in Excalidraw settings\n',
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "createSVG",
|
|
|
|
|
code: "createSVG(templatePath?: string, embedFont?: boolean, exportSettings?: ExportSettings, loader?: EmbeddedFilesLoader, theme?: string,): Promise<SVGSVGElement>;",
|
|
|
|
|
desc: "Use ExcalidrawAutomate.getExportSettings(boolean,boolean) to create an ExportSettings object.\nUse ExcalidrawAutomate.getEmbeddedFilesLoader(boolean?) to create an EmbeddedFilesLoader object.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "createPNG",
|
|
|
|
|
code: "createPNG(templatePath?: string, scale?: number, exportSettings?: ExportSettings, loader?: EmbeddedFilesLoader, theme?: string,): Promise<any>;",
|
|
|
|
|
desc: "Use ExcalidrawAutomate.getExportSettings(boolean,boolean) to create an ExportSettings object.\nUse ExcalidrawAutomate.getEmbeddedFilesLoader(boolean?) to create an EmbeddedFilesLoader object.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "wrapText",
|
|
|
|
|
code: "wrapText(text: string, lineLen: number): string;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addRect",
|
|
|
|
|
code: "addRect(topX: number, topY: number, width: number, height: number): string;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addDiamond",
|
|
|
|
|
code: "addDiamond(topX: number, topY: number, width: number, height: number): string;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addEllipse",
|
|
|
|
|
code: "addEllipse(topX: number, topY: number, width: number, height: number): string;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addBlob",
|
|
|
|
|
code: "addBlob(topX: number, topY: number, width: number, height: number): string;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addText",
|
|
|
|
|
code: 'addText(topX: number, topY: number, text: string, formatting?: {wrapAt?: number; width?: number; height?: number; textAlign?: string; box?: boolean | "box" | "blob" | "ellipse" | "diamond"; boxPadding?: number;}, id?: string,): string;',
|
|
|
|
|
desc: 'If box is !null, then text will be boxed\nThe function returns the id of the TextElement. If the text element is boxed i.e. it is a sticky note, then the id of the container object',
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addLine",
|
|
|
|
|
code: "addLine(points: [[x: number, y: number]]): string;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addArrow",
|
|
|
|
|
code: "addArrow(points: [[x: number, y: number]], formatting?: { startArrowHead?: string; endArrowHead?: string; startObjectId?: string; endObjectId?: string;},): string;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addImage",
|
|
|
|
|
code: "addImage(topX: number, topY: number, imageFile: TFile): Promise<string>;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addLaTex",
|
|
|
|
|
code: "addLaTex(topX: number, topY: number, tex: string): Promise<string>;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "connectObjects",
|
|
|
|
|
code: 'connectObjects(objectA: string, connectionA: ConnectionPoint, objectB: string, connectionB: ConnectionPoint, formatting?: {numberOfPoints?: number; startArrowHead?: string; endArrowHead?: string; padding?: number;},): void;',
|
|
|
|
|
desc: 'type ConnectionPoint = "top" | "bottom" | "left" | "right" | null\nWhen null is passed as ConnectionPoint then Excalidraw will automatically decide\nnumberOfPoints is the number of points on the line. Default is 0 i.e. line will only have a start and end point.\nArrowHead: "triangle"|"dot"|"arrow"|"bar"|null',
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "clear",
|
|
|
|
|
code: "clear(): void;",
|
|
|
|
|
desc: "Clears elementsDict and imagesDict only",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "reset",
|
|
|
|
|
code: "reset(): void;",
|
|
|
|
|
desc: "clear() + reset all style values to default",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "isExcalidrawFile",
|
|
|
|
|
code: "isExcalidrawFile(f: TFile): boolean;",
|
|
|
|
|
desc: "Returns true if MD file is an Excalidraw file",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "targetView",
|
|
|
|
|
code: "targetView: ExcalidrawView;",
|
|
|
|
|
desc: "The Obsidian view currently edited",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "setView",
|
|
|
|
|
code: 'setView(view: ExcalidrawView | "first" | "active"): ExcalidrawView;',
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getExcalidrawAPI",
|
|
|
|
|
code: "getExcalidrawAPI(): any;",
|
|
|
|
|
desc: "<a onclick='window.open(\"https://github.com/excalidraw/excalidraw/tree/master/src/packages/excalidraw#ref\")'>Excalidraw API</a>",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getViewElements",
|
|
|
|
|
code: "getViewElements(): ExcalidrawElement[];",
|
|
|
|
|
desc: "Get elements in View",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "deleteViewElements",
|
|
|
|
|
code: "deleteViewElements(el: ExcalidrawElement[]): boolean;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getViewSelectedElement",
|
|
|
|
|
code: "getViewSelectedElement(): ExcalidrawElement;",
|
|
|
|
|
desc: "Get the selected element in the view, if more are selected, get the first",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getViewSelectedElements",
|
|
|
|
|
code: "getViewSelectedElements(): ExcalidrawElement[];",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getViewFileForImageElement",
|
|
|
|
|
code: "getViewFileForImageElement(el: ExcalidrawElement): TFile | null;",
|
|
|
|
|
desc: "Returns the TFile file handle for the image element",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "copyViewElementsToEAforEditing",
|
|
|
|
|
code: "copyViewElementsToEAforEditing(elements: ExcalidrawElement[]): void;",
|
|
|
|
|
desc: "Copies elements from view to elementsDict for editing",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "viewToggleFullScreen",
|
|
|
|
|
code: "viewToggleFullScreen(forceViewMode?: boolean): void;",
|
|
|
|
|
desc: null,
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "connectObjectWithViewSelectedElement",
|
|
|
|
|
code: "connectObjectWithViewSelectedElement(objectA: string, connectionA: ConnectionPoint, connectionB: ConnectionPoint, formatting?: {numberOfPoints?: number; startArrowHead?: string; endArrowHead?: string; padding?: number;},): boolean;",
|
|
|
|
|
desc: "Connect an object to the selected element in the view\nSee tooltip for connectObjects for details",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "addElementsToView",
|
|
|
|
|
code: "addElementsToView(repositionToCursor?: boolean, save?: boolean, newElementsOnTop?: boolean,): Promise<boolean>;",
|
|
|
|
|
desc: "Adds elements from elementsDict to the current view\nrepositionToCursor: default is false\nsave: default is true\nnewElementsOnTop: default is false, i.e. the new elements get to the bottom of the stack\nnewElementsOnTop controls whether elements created with ExcalidrawAutomate are added at the bottom of the stack or the top of the stack of elements already in the view\nNote that elements copied to the view with copyViewElementsToEAforEditing retain their position in the stack of elements in the view even if modified using EA",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "onDropHook",
|
|
|
|
|
code: 'onDropHook(data: {ea: ExcalidrawAutomate, event: React.DragEvent<HTMLDivElement>, draggable: any, type: "file" | "text" | "unknown", payload: {files: TFile[], text: string,}, excalidrawFile: TFile, view: ExcalidrawView, pointerPosition: { x: number, y: number},}): boolean;',
|
|
|
|
|
desc: 'If set Excalidraw will call this function onDrop events.\nA return of true will stop the default onDrop processing in Excalidraw.\n\ndraggable is the Obsidian draggable object\nfiles is the array of dropped files\nexcalidrawFile is the file receiving the drop event\nview is the excalidraw view receiving the drop.\npointerPosition is the pointer position on canvas at the time of drop.',
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "mostRecentMarkdownSVG",
|
|
|
|
|
code: "mostRecentMarkdownSVG: SVGSVGElement;",
|
|
|
|
|
desc: "Markdown renderer will drop a copy of the most recent SVG here for debugging purposes",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getEmbeddedFilesLoader",
|
|
|
|
|
code: "getEmbeddedFilesLoader(isDark?: boolean): EmbeddedFilesLoader;",
|
|
|
|
|
desc: "Utility function to generate EmbeddedFilesLoader object",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getExportSettings",
|
|
|
|
|
code: "getExportSettings(withBackground: boolean, withTheme: boolean,): ExportSettings;",
|
|
|
|
|
desc: "Utility function to generate ExportSettings object",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getBoundingBox",
|
|
|
|
|
code: "getBoundingBox(elements: ExcalidrawElement[]): {topX: number, topY: number, width: number, height: number,};",
|
|
|
|
|
desc: "Gets the bounding box of elements. The bounding box is the box encapsulating all of the elements completely.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getMaximumGroups",
|
|
|
|
|
code: "getMaximumGroups(elements: ExcalidrawElement[]): ExcalidrawElement[][];",
|
|
|
|
|
desc: "Elements grouped by the highest level groups",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getLargestElement",
|
|
|
|
|
code: "getLargestElement(elements: ExcalidrawElement[]): ExcalidrawElement;",
|
|
|
|
|
desc: "Gets the largest element from a group. useful when a text element is grouped with a box, and you want to connect an arrow to the box",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "intersectElementWithLine",
|
|
|
|
|
code: "intersectElementWithLine(element: ExcalidrawBindableElement, a: readonly [number, number], b: readonly [number, number], gap?: number,): Point[];",
|
|
|
|
|
desc: "If gap is given, the element is inflated by this value.\nReturns 2 or 0 intersection points between line going through `a` and `b` and the `element`, in ascending order of distance from `a`.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getLargestElement",
|
|
|
|
|
code: "getLargestElement(elements: ExcalidrawElement[]): ExcalidrawElement;",
|
|
|
|
|
desc: "Gets the largest element from a group. useful when a text element is grouped with a box, and you want to connect an arrow to the box",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "activeScript",
|
|
|
|
|
code: "activeScript: string;",
|
|
|
|
|
desc: "Mandatory to set before calling the get and set ScriptSettings functions. Set automatically by the ScriptEngine\nSee for more details: <a onclick='window.open(\"https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html\")'>Script Engine Help</a>",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "getScriptSettings",
|
|
|
|
|
code: "getScriptSettings(): {};",
|
|
|
|
|
desc: "Returns script settings. Saves settings in plugin settings, under the activeScript key. See for more details: <a onclick='window.open(\"https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html\")'>Script Engine Help</a>",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "setScriptSettings",
|
|
|
|
|
code: "setScriptSettings(settings: any): Promise<void>;",
|
|
|
|
|
desc: "Sets script settings.\nSee for more details: <a onclick='window.open(\"https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html\")'>Script Engine Help</a>",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "openFileInNewOrAdjacentLeaf",
|
|
|
|
|
code: "openFileInNewOrAdjacentLeaf(file: TFile): WorkspaceLeaf;",
|
|
|
|
|
desc: "Open a file in a new workspaceleaf or reuse an existing adjacent leaf depending on Excalidraw Plugin Settings",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "measureText",
|
|
|
|
|
code: "measureText(text: string): { width: number; height: number };",
|
|
|
|
|
desc: "Measures text size based on current style settings",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "verifyMinimumPluginVersion",
|
|
|
|
|
code: 'verifyMinimumPluginVersion(requiredVersion: string): boolean;',
|
|
|
|
|
desc: 'Returns true if plugin version is >= than required\nrecommended use:\n<code>if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("1.5.20")) {new Notice("message");return;}<code>',
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "selectElementsInView",
|
|
|
|
|
code: "selectElementsInView(elements: ExcalidrawElement[]):void;",
|
|
|
|
|
desc: "Elements provided will be set as selected in the targetView.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "generateElementId",
|
|
|
|
|
code: "generateElementId(): string;",
|
|
|
|
|
desc: "Returns an 8 character long random id",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "cloneElement",
|
|
|
|
|
code: "cloneElement(element: ExcalidrawElement): ExcalidrawElement;",
|
|
|
|
|
desc: "Returns a clone of the element with a new element id",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "moveViewElementToZIndex",
|
|
|
|
|
code: "moveViewElementToZIndex(elementId:number, newZIndex:number): void;",
|
|
|
|
|
desc: "Moves the element to a specific position in the z-index",
|
|
|
|
|
after: "",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
@@ -521,14 +454,12 @@ export const EXCALIDRAW_SCRIPTENGINE_INFO:SuggestorInfo[] = [
|
|
|
|
|
code: "inputPrompt: (header: string, placeholder?: string, value?: string);",
|
|
|
|
|
desc: "Opens a prompt that asks for an input.\nReturns a string with the input.\nYou need to await the result of inputPrompt.",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "suggester",
|
|
|
|
|
code: "suggester: (displayItems: string[], items: any[], hint?: string, instructions?:Instruction[]);",
|
|
|
|
|
desc: "Opens a suggester. Displays the displayItems and returns the corresponding item from items[]\nYou need to await the result of suggester.\nIf the user cancels (ESC), suggester will return undefined\nHint and instructions are optional\n\n<code>interface Instruction {command: string;purpose: string;}</code>",
|
|
|
|
|
after: "",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
@@ -538,55 +469,47 @@ export const FRONTMATTER_KEYS_INFO:SuggestorInfo[] = [
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "Denotes an excalidraw file. If key is not present, the file will not be recognized as an Excalidarw file. Valid values are 'parsed' and 'raw'",
|
|
|
|
|
after: ": parsed",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: FRONTMATTER_KEY_CUSTOM_PREFIX,
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "Set custom prefix to denote text element containing a valid internal link. Set to empty string if you do not want to show a prefix",
|
|
|
|
|
after: ': "📍"',
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: FRONTMATTER_KEY_CUSTOM_URL_PREFIX,
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "Set custom prefix to denote text element containing a valid external link. Set to empty string if you do not want to show a prefix",
|
|
|
|
|
after: ': "🌐"',
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: FRONTMATTER_KEY_CUSTOM_LINK_BRACKETS,
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "Set to true, if you want to display [[square brackets]] around the links in Text Elements",
|
|
|
|
|
after: ": true",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: FRONTMATTER_KEY_DEFAULT_MODE,
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "Specifies how Excalidraw should open by default. Valid values are: view|zen",
|
|
|
|
|
after: ": view",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: FRONTMATTER_KEY_FONT,
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "This key applies to Markdown Embeds. You can control the appearance of the embedded markdown file on a file by file bases by adding the this front matter keys to your markdown document. Valid values are: Virgil|Cascadia|font_file_name.extension",
|
|
|
|
|
after: ": Virgil",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: FRONTMATTER_KEY_FONTCOLOR,
|
|
|
|
|
code: null,
|
|
|
|
|
desc: "This key applies to Markdown Embeds. You can control the appearance of the embedded markdown file on a file by file bases by adding the this front matter keys to your markdown document. Valid values are: css-color-name|#HEXcolor|any-other-html-standard-format",
|
|
|
|
|
after: ": SteelBlue",
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: FRONTMATTER_KEY_MD_STYLE,
|
|
|
|
|
code: null,
|
|
|
|
|
desc: 'This key applies to Markdown Embeds. You can control the appearance of the embedded markdown file on a file by file bases by adding the this front matter keys to your markdown document. Valid values are: "css-filename|css snippet"',
|
|
|
|
|
after: ': ""',
|
|
|
|
|
alt: true,
|
|
|
|
|
},
|
|
|
|
|
];
|