Skip to content

Commit

Permalink
Merge pull request #2169 from zsviczian/2.7.2-casing
Browse files Browse the repository at this point in the history
2.7.2 file and folder name casing + empty line before ## Text Elements
  • Loading branch information
zsviczian authored Dec 20, 2024
2 parents eebc428 + 6032861 commit 682307b
Show file tree
Hide file tree
Showing 110 changed files with 498 additions and 493 deletions.
8 changes: 4 additions & 4 deletions docs/API/ExcalidrawAutomate.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/// <reference types="react" />
import ExcalidrawPlugin from "src/Core/main";
import ExcalidrawPlugin from "src/core/main";
import { FillStyle, StrokeStyle, ExcalidrawElement, ExcalidrawBindableElement, FileId, NonDeletedExcalidrawElement, ExcalidrawImageElement, StrokeRoundness, RoundnessType } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { Editor, OpenViewState, TFile, WorkspaceLeaf } from "obsidian";
import * as obsidian_module from "obsidian";
import ExcalidrawView, { ExportSettings } from "src/View/ExcalidrawView";
import ExcalidrawView, { ExportSettings } from "src/view/ExcalidrawView";
import { AppState, BinaryFileData, DataURL, ExcalidrawImperativeAPI, Point } from "@zsviczian/excalidraw/types/excalidraw/types";
import { EmbeddedFilesLoader } from "src/EmbeddedFileLoader";
import { ConnectionPoint, DeviceType } from "src/Types/Types";
import { ConnectionPoint, DeviceType } from "src/types/types";
import { ColorMaster } from "colormaster";
import { TInput } from "colormaster/types";
import { ClipboardData } from "@zsviczian/excalidraw/types/excalidraw/clipboard";
import { PaneTarget } from "src/Utils/ModifierkeyHelper";
import { PaneTarget } from "src/utils/modifierkeyHelper";
export declare class ExcalidrawAutomate {
/**
* Utility function that returns the Obsidian Module object.
Expand Down
2 changes: 1 addition & 1 deletion docs/API/attributes_functions_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ConnectionPoint, DeviceType } from "src/types";
import { ColorMaster } from "colormaster";
import { TInput } from "colormaster/types";
import { ClipboardData } from "@zsviczian/excalidraw/types/clipboard";
import { PaneTarget } from "src/utils/ModifierkeyHelper";
import { PaneTarget } from "src/utils/modifierkeyHelper";
export declare class ExcalidrawAutomate {
/**
* Utility function that returns the Obsidian Module object.
Expand Down
15 changes: 10 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function minifyCode(code) {
}

function compressLanguageFile(lang) {
const inputDir = "./src/Lang/Locale";
const inputDir = "./src/lang/locale";
const filePath = `${inputDir}/${lang}.ts`;
let content = fs.readFileSync(filePath, "utf-8");
content = trimLastSemicolon(content.split("export default")[1].trim());
Expand Down Expand Up @@ -102,7 +102,7 @@ const packageString = isLib
'const PLUGIN_VERSION="' + manifest.version + '";';

const BASE_CONFIG = {
input: 'src/Core/main.ts',
input: 'src/core/main.ts',
external: [
'@codemirror/autocomplete',
'@codemirror/collab',
Expand Down Expand Up @@ -141,7 +141,12 @@ const BUILD_CONFIG = {
exports: 'default',
},
plugins: getRollupPlugins(
{tsconfig: isProd ? "tsconfig.json" : "tsconfig.dev.json"},
{
tsconfig: isProd ? "tsconfig.json" : "tsconfig.dev.json",
sourcemap: !isProd,
clean: true,
verbosity: isProd ? 1 : 2,
},
...(isProd ? [
terser({
toplevel: false,
Expand All @@ -166,10 +171,10 @@ const BUILD_CONFIG = {

const LIB_CONFIG = {
...BASE_CONFIG,
input: "src/Core/index.ts",
input: "src/core/index.ts",
output: {
dir: "lib",
sourcemap: true,
sourcemap: false,
format: "cjs",
name: "Excalidraw (Library)",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Copy, Crop, Globe, RotateCcw, Scan, Settings, TextSelect } from "lucide-react";
import * as React from "react";
import { PenStyle } from "src/Types/PenTypes";
import { PenStyle } from "src/types/penTypes";

export const ICONS = {
ExportImage: (
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { customAlphabet } from "nanoid";
import { DeviceType } from "../Types/Types";
import { ExcalidrawLib } from "../Types/ExcalidrawLib";
import { ExcalidrawLib } from "../types/excalidrawLib";
import { moment } from "obsidian";
import ExcalidrawPlugin from "src/Core/main";
import ExcalidrawPlugin from "src/core/main";
import { DeviceType } from "src/types/types";
//This is only for backward compatibility because an early version of obsidian included an encoding to avoid fantom links from littering Obsidian graph view
declare const PLUGIN_VERSION:string;
export let EXCALIDRAW_PLUGIN: ExcalidrawPlugin = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Extension } from "@codemirror/state";
import ExcalidrawPlugin from "src/Core/main";
import ExcalidrawPlugin from "src/core/main";
import { HideTextBetweenCommentsExtension } from "./Fadeout";
import { debug, DEBUGGING } from "src/Utils/DebugHelper";
import { debug, DEBUGGING } from "src/utils/debugHelper";
export const EDITOR_FADEOUT = "fadeOutExcalidrawMarkup";

const editorExtensions: {[key:string]:Extension}= {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Core/index.ts → src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "obsidian";
//export ExcalidrawAutomate from "./ExcalidrawAutomate";
//export {ExcalidrawAutomate} from "./ExcaildrawAutomate";
export type { ExcalidrawBindableElement, ExcalidrawElement, FileId, FillStyle, StrokeRoundness, StrokeStyle } from "@zsviczian/excalidraw/types/excalidraw/element/types";
export type { Point } from "src/Types/Types";
export type { Point } from "src/types/types";
export const getEA = (view?:any): any => {
try {
return window.ExcalidrawAutomate.getAPI(view);
Expand Down
64 changes: 32 additions & 32 deletions src/Core/main.ts → src/core/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ import {
updateExcalidrawLib,
loadMermaid,
setRootElementSize,
} from "../Constants/Constants";
} from "../constants/constants";
import { ExcalidrawSettings, DEFAULT_SETTINGS, ExcalidrawSettingTab } from "./settings";
import { initExcalidrawAutomate, ExcalidrawAutomate } from "../Shared/ExcalidrawAutomate";
import { initExcalidrawAutomate, ExcalidrawAutomate } from "../shared/ExcalidrawAutomate";
import { around, dedupe } from "monkey-around";
import { t } from "../Lang/Helpers";
import { t } from "../lang/helpers";
import {
checkAndCreateFolder,
fileShouldDefaultAsExcalidraw,
getDrawingFilename,
getIMGFilename,
getNewUniqueFilepath,
} from "../Utils/FileUtils";
} from "../utils/fileUtils";
import {
getFontDataURL,
errorlog,
Expand All @@ -59,35 +59,35 @@ import {
isCallerFromTemplaterPlugin,
versionUpdateCheckTimer,
getFontMetrics,
} from "../Utils/Utils";
import { foldExcalidrawSection, getExcalidrawViews, setExcalidrawView } from "../Utils/ObsidianUtils";
} from "../utils/utils";
import { foldExcalidrawSection, getExcalidrawViews, setExcalidrawView } from "../utils/obsidianUtils";
import { FileId } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { ScriptEngine } from "../Shared/Scripts";
import { hoverEvent, initializeMarkdownPostProcessor, markdownPostProcessor, legacyExcalidrawPopoverObserver } from "./Managers/MarkdownPostProcessor";
import { FieldSuggester } from "../Shared/Suggesters/FieldSuggester";
import { ReleaseNotes } from "../Shared/Dialogs/ReleaseNotes";
import { Packages } from "../Types/Types";
import { PreviewImageType } from "../Utils/UtilTypes";
import { emulateCTRLClickForLinks, linkClickModifierType, PaneTarget } from "../Utils/ModifierkeyHelper";
import { imageCache } from "../Utils/ImageCache";
import { StylesManager } from "../Utils/StylesManager";
import { CustomMutationObserver, debug, log, DEBUGGING, setDebugging, ts } from "../Utils/DebugHelper";
import { ExcalidrawConfig } from "../Utils/ExcalidrawConfig";
import { EditorHandler } from "./CodeMirrorExtension/EditorHandler";
import { ExcalidrawLib } from "../Types/ExcalidrawLib";
import { Rank, SwordColors } from "../View/Components/Menu/ActionIcons";
import { RankMessage } from "../Shared/Dialogs/RankMessage";
import { initCompressionWorker, terminateCompressionWorker } from "../Shared/Workers/compression-worker";
import { WeakArray } from "../Utils/WeakArray";
import { getCJKDataURLs } from "../Utils/CJKLoader";
import { ExcalidrawLoading, switchToExcalidraw } from "../View/ExcalidrawLoading";
import { clearMathJaxVariables } from "../Shared/LaTeX";
import { PluginFileManager } from "./Managers/FileManager";
import { ObserverManager } from "./Managers/ObserverManager";
import { PackageManager } from "./Managers/PackageManager";
import ExcalidrawView from "../View/ExcalidrawView";
import { CommandManager } from "./Managers/CommandManager";
import { EventManager } from "./Managers/EventManager";
import { ScriptEngine } from "../shared/Scripts";
import { hoverEvent, initializeMarkdownPostProcessor, markdownPostProcessor, legacyExcalidrawPopoverObserver } from "./managers/MarkdownPostProcessor";
import { FieldSuggester } from "../shared/Suggesters/FieldSuggester";
import { ReleaseNotes } from "../shared/Dialogs/ReleaseNotes";
import { Packages } from "../types/types";
import { PreviewImageType } from "../types/utilTypes";
import { emulateCTRLClickForLinks, linkClickModifierType, PaneTarget } from "../utils/modifierkeyHelper";
import { imageCache } from "../shared/ImageCache";
import { StylesManager } from "./managers/StylesManager";
import { CustomMutationObserver, debug, log, DEBUGGING, setDebugging, ts } from "../utils/debugHelper";
import { ExcalidrawConfig } from "../shared/ExcalidrawConfig";
import { EditorHandler } from "./editor/EditorHandler";
import { ExcalidrawLib } from "../types/excalidrawLib";
import { Rank, SwordColors } from "../constants/actionIcons";
import { RankMessage } from "../shared/Dialogs/RankMessage";
import { initCompressionWorker, terminateCompressionWorker } from "../shared/Workers/compression-worker";
import { WeakArray } from "../shared/WeakArray";
import { getCJKDataURLs } from "../utils/CJKLoader";
import { ExcalidrawLoading, switchToExcalidraw } from "../view/ExcalidrawLoading";
import { clearMathJaxVariables } from "../shared/LaTeX";
import { PluginFileManager } from "./managers/FileManager";
import { ObserverManager } from "./managers/ObserverManager";
import { PackageManager } from "./managers/PackageManager";
import ExcalidrawView from "../view/ExcalidrawView";
import { CommandManager } from "./managers/CommandManager";
import { EventManager } from "./managers/EventManager";

declare const PLUGIN_VERSION:string;
declare const INITIAL_TIMESTAMP: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ import {
IMAGE_TYPES,
DEVICE,
sceneCoordsToViewportCoords,
} from "../../Constants/Constants";
import ExcalidrawView, { TextMode } from "../../View/ExcalidrawView";
} from "../../constants/constants";
import ExcalidrawView, { TextMode } from "../../view/ExcalidrawView";
import {
REGEX_LINK,
} from "../../Shared/ExcalidrawData";
} from "../../shared/ExcalidrawData";
import { ExcalidrawSettings } from "../settings";
import { openDialogAction, OpenFileDialog } from "../../Shared/Dialogs/OpenDrawing";
import { InsertLinkDialog } from "../../Shared/Dialogs/InsertLinkDialog";
import { InsertCommandDialog } from "../../Shared/Dialogs/InsertCommandDialog";
import { InsertImageDialog } from "../../Shared/Dialogs/InsertImageDialog";
import { ImportSVGDialog } from "../../Shared/Dialogs/ImportSVGDialog";
import { InsertMDDialog } from "../../Shared/Dialogs/InsertMDDialog";
import { openDialogAction, OpenFileDialog } from "../../shared/Dialogs/OpenDrawing";
import { InsertLinkDialog } from "../../shared/Dialogs/InsertLinkDialog";
import { InsertCommandDialog } from "../../shared/Dialogs/InsertCommandDialog";
import { InsertImageDialog } from "../../shared/Dialogs/InsertImageDialog";
import { ImportSVGDialog } from "../../shared/Dialogs/ImportSVGDialog";
import { InsertMDDialog } from "../../shared/Dialogs/InsertMDDialog";
import {
ExcalidrawAutomate,
insertLaTeXToView,
search,
} from "../../Shared/ExcalidrawAutomate";
import { templatePromt } from "../../Shared/Dialogs/Prompt";
import { t } from "../../Lang/Helpers";
} from "../../shared/ExcalidrawAutomate";
import { templatePromt } from "../../shared/Dialogs/Prompt";
import { t } from "../../lang/helpers";
import {
getAliasWithSize,
getAnnotationFileNameAndFolder,
Expand All @@ -45,32 +45,32 @@ import {
getLink,
getListOfTemplateFiles,
getURLImageExtension,
} from "../../Utils/FileUtils";
} from "../../utils/fileUtils";
import {
setLeftHandedMode,
sleep,
decompress,
getImageSize,
} from "../../Utils/Utils";
import { extractSVGPNGFileName, getActivePDFPageNumberFromPDFView, getAttachmentsFolderAndFilePath, isObsidianThemeDark, mergeMarkdownFiles, setExcalidrawView } from "../../Utils/ObsidianUtils";
} from "../../utils/utils";
import { extractSVGPNGFileName, getActivePDFPageNumberFromPDFView, getAttachmentsFolderAndFilePath, isObsidianThemeDark, mergeMarkdownFiles, setExcalidrawView } from "../../utils/obsidianUtils";
import { ExcalidrawElement, ExcalidrawEmbeddableElement, ExcalidrawImageElement, ExcalidrawTextElement } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { ReleaseNotes } from "../../Shared/Dialogs/ReleaseNotes";
import { ScriptInstallPrompt } from "../../Shared/Dialogs/ScriptInstallPrompt";
import Taskbone from "../../Shared/OCR/Taskbone";
import { emulateCTRLClickForLinks, linkClickModifierType, PaneTarget } from "../../Utils/ModifierkeyHelper";
import { InsertPDFModal } from "../../Shared/Dialogs/InsertPDFModal";
import { ExportDialog } from "../../Shared/Dialogs/ExportDialog";
import { UniversalInsertFileModal } from "../../Shared/Dialogs/UniversalInsertFileModal";
import { PublishOutOfDateFilesDialog } from "../../Shared/Dialogs/PublishOutOfDateFiles";
import { EmbeddableSettings } from "../../Shared/Dialogs/EmbeddableSettings";
import { processLinkText } from "../../Utils/CustomEmbeddableUtils";
import { getEA } from "src/Core";
import { ReleaseNotes } from "../../shared/Dialogs/ReleaseNotes";
import { ScriptInstallPrompt } from "../../shared/Dialogs/ScriptInstallPrompt";
import Taskbone from "../../shared/OCR/Taskbone";
import { emulateCTRLClickForLinks, linkClickModifierType, PaneTarget } from "../../utils/modifierkeyHelper";
import { InsertPDFModal } from "../../shared/Dialogs/InsertPDFModal";
import { ExportDialog } from "../../shared/Dialogs/ExportDialog";
import { UniversalInsertFileModal } from "../../shared/Dialogs/UniversalInsertFileModal";
import { PublishOutOfDateFilesDialog } from "../../shared/Dialogs/PublishOutOfDateFiles";
import { EmbeddableSettings } from "../../shared/Dialogs/EmbeddableSettings";
import { processLinkText } from "../../utils/customEmbeddableUtils";
import { getEA } from "src/core";
import { ExcalidrawImperativeAPI } from "@zsviczian/excalidraw/types/excalidraw/types";
import { Mutable } from "@zsviczian/excalidraw/types/excalidraw/utility-types";
import { carveOutImage, carveOutPDF, createImageCropperFile } from "../../Utils/CarveOut";
import { showFrameSettings } from "../../Shared/Dialogs/FrameSettings";
import { insertImageToView } from "../../Utils/ExcalidrawViewUtils";
import ExcalidrawPlugin from "src/Core/main";
import { carveOutImage, carveOutPDF, createImageCropperFile } from "../../utils/carveout";
import { showFrameSettings } from "../../shared/Dialogs/FrameSettings";
import { insertImageToView } from "../../utils/excalidrawViewUtils";
import ExcalidrawPlugin from "src/core/main";

declare const PLUGIN_VERSION:string;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { WorkspaceLeaf, TFile, Editor, MarkdownView, MarkdownFileInfo, MetadataCache, App, EventRef, Menu, FileView } from "obsidian";
import { ExcalidrawElement } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { getLink } from "../../Utils/FileUtils";
import { editorInsertText, getParentOfClass, setExcalidrawView } from "../../Utils/ObsidianUtils";
import ExcalidrawPlugin from "src/Core/main";
import { DEBUGGING, debug } from "src/Utils/DebugHelper";
import { ExcalidrawAutomate } from "src/Shared/ExcalidrawAutomate";
import { DEVICE, FRONTMATTER_KEYS, ICON_NAME, VIEW_TYPE_EXCALIDRAW } from "src/Constants/Constants";
import ExcalidrawView from "src/View/ExcalidrawView";
import { t } from "src/Lang/Helpers";
import { getLink } from "../../utils/fileUtils";
import { editorInsertText, getParentOfClass, setExcalidrawView } from "../../utils/obsidianUtils";
import ExcalidrawPlugin from "src/core/main";
import { DEBUGGING, debug } from "src/utils/debugHelper";
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import { DEVICE, FRONTMATTER_KEYS, ICON_NAME, VIEW_TYPE_EXCALIDRAW } from "src/constants/constants";
import ExcalidrawView from "src/view/ExcalidrawView";
import { t } from "src/lang/helpers";

/**
* Registers event listeners for the plugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { debug } from "src/Utils/DebugHelper";
import { debug } from "src/utils/debugHelper";
import { App, FrontMatterCache, MarkdownView, MetadataCache, normalizePath, Notice, TAbstractFile, TFile, WorkspaceLeaf } from "obsidian";
import { BLANK_DRAWING, DARK_BLANK_DRAWING, DEVICE, EXPORT_TYPES, FRONTMATTER, FRONTMATTER_KEYS, JSON_parse, nanoid, VIEW_TYPE_EXCALIDRAW } from "src/Constants/Constants";
import { Prompt, templatePromt } from "src/Shared/Dialogs/Prompt";
import { changeThemeOfExcalidrawMD, ExcalidrawData, getMarkdownDrawingSection } from "../../Shared/ExcalidrawData";
import ExcalidrawView, { getTextMode } from "src/View/ExcalidrawView";
import ExcalidrawPlugin from "src/Core/main";
import { DEBUGGING } from "src/Utils/DebugHelper";
import { checkAndCreateFolder, download, getIMGFilename, getLink, getListOfTemplateFiles, getNewUniqueFilepath } from "src/Utils/FileUtils";
import { PaneTarget } from "src/Utils/ModifierkeyHelper";
import { getExcalidrawViews, getNewOrAdjacentLeaf, isObsidianThemeDark, openLeaf } from "src/Utils/ObsidianUtils";
import { errorlog, getExportTheme } from "src/Utils/Utils";
import { BLANK_DRAWING, DARK_BLANK_DRAWING, DEVICE, EXPORT_TYPES, FRONTMATTER, FRONTMATTER_KEYS, JSON_parse, nanoid, VIEW_TYPE_EXCALIDRAW } from "src/constants/constants";
import { Prompt, templatePromt } from "src/shared/Dialogs/Prompt";
import { changeThemeOfExcalidrawMD, ExcalidrawData, getMarkdownDrawingSection } from "../../shared/ExcalidrawData";
import ExcalidrawView, { getTextMode } from "src/view/ExcalidrawView";
import ExcalidrawPlugin from "src/core/main";
import { DEBUGGING } from "src/utils/debugHelper";
import { checkAndCreateFolder, download, getIMGFilename, getLink, getListOfTemplateFiles, getNewUniqueFilepath } from "src/utils/fileUtils";
import { PaneTarget } from "src/utils/modifierkeyHelper";
import { getExcalidrawViews, getNewOrAdjacentLeaf, isObsidianThemeDark, openLeaf } from "src/utils/obsidianUtils";
import { errorlog, getExportTheme } from "src/utils/utils";

export class PluginFileManager {
private plugin: ExcalidrawPlugin;
Expand Down Expand Up @@ -324,7 +324,7 @@ export class PluginFileManager {
const textElements = excalidrawData.elements?.filter(
(el: any) => el.type == "text",
);
let outString = `# Excalidraw Data\n## Text Elements\n`;
let outString = `# Excalidraw Data\n\n## Text Elements\n`;
let id: string;
for (const te of textElements) {
id = te.id;
Expand Down
Loading

0 comments on commit 682307b

Please sign in to comment.