Refactors project structure for improved modularity
Moves components and modules to more appropriate directories. This change improves project organization and maintainability by grouping related files into logical directories, enhancing code discoverability and reducing potential naming conflicts.
This commit is contained in:
16 files changed
+21
-21
No files matched your search
@@ -26,10 +26,10 @@ import { ModalSettingsHelper } from './src/core/ModalSettingsHelper';
|
||||
import { ExportErrorHandler } from './src/core/ExportErrorHandler';
|
||||
import { TempDirectoryManager } from './src/core/TempDirectoryManager';
|
||||
import { PandocTypstConverter } from './src/converters/PandocTypstConverter';
|
||||
import { ExportConfigModal } from './src/modal/ExportConfigModal';
|
||||
import { ExportConfig, ExportConfigModalSettings } from './src/modal/types';
|
||||
import { ExportConfigModal } from './src/ui/modal/ExportConfigModal';
|
||||
import { ExportConfig, ExportConfigModalSettings } from './src/ui/modal/modalTypes';
|
||||
import { TemplateManager } from './src/templates/TemplateManager';
|
||||
import { FolderSuggest } from './src/components/FolderSuggest';
|
||||
import { FolderSuggest } from './src/ui/components/FolderSuggest';
|
||||
import { SUPPORTED_PAPER_SIZES } from './src/utils/paperSizeMapper';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
@@ -441,7 +441,7 @@ export class obsidianTypstPDFExport extends Plugin {
|
||||
const tempDir = tempManager.ensureTempDir('images');
|
||||
|
||||
// Preprocess the markdown content using MarkdownPreprocessor
|
||||
const { MarkdownPreprocessor } = await import('./src/MarkdownPreprocessor');
|
||||
const { MarkdownPreprocessor } = await import('./src/converters/MarkdownPreprocessor');
|
||||
const preprocessor = new MarkdownPreprocessor({
|
||||
vaultPath: vaultPath,
|
||||
options: {
|
||||
|
||||
File renamed without changes.
@@ -9,7 +9,7 @@ import { promises as fsPromises } from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import { mapToTypstPaperSize } from '../utils/paperSizeMapper';
|
||||
import { PandocOptions, TypstSettings, ConversionResult, ProgressCallback } from './types';
|
||||
import { PandocOptions, TypstSettings, ConversionResult, ProgressCallback } from './converterTypes';
|
||||
import type { obsidianTypstPDFExportSettings } from '../core/settings';
|
||||
import { TempDirectoryManager } from '../core/TempDirectoryManager';
|
||||
|
||||
@@ -136,7 +136,7 @@ export class PandocTypstConverter {
|
||||
* Process PDF embeds by converting them to images and creating combined output
|
||||
*/
|
||||
async processPdfEmbeds(processedResult: any, vaultBasePath: string, tempDir: string): Promise<void> {
|
||||
const { PdfToImageConverter } = require('../PdfToImageConverter');
|
||||
const { PdfToImageConverter } = require('./PdfToImageConverter');
|
||||
const converter = PdfToImageConverter.getInstance(this.plugin);
|
||||
|
||||
for (const pdfEmbed of processedResult.metadata.pdfEmbeds) {
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -4,7 +4,7 @@
|
||||
|
||||
import { TFile } from 'obsidian';
|
||||
import { obsidianTypstPDFExportSettings } from './settings';
|
||||
import { ExportConfigModalSettings } from '../modal/types';
|
||||
import { ExportConfigModalSettings } from '../ui/modal/modalTypes';
|
||||
|
||||
export interface ModalSettingsInput {
|
||||
/** Primary file for the export */
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -4,14 +4,14 @@
|
||||
*/
|
||||
|
||||
import { Modal, App, Notice } from 'obsidian';
|
||||
import { obsidianTypstPDFExport } from '../../main';
|
||||
import { ExportConfig, ExportConfigModalSettings, ModalSection } from './types';
|
||||
import { obsidianTypstPDFExport } from '../../../main';
|
||||
import { ExportConfig, ExportConfigModalSettings, ModalSection } from './modalTypes';
|
||||
import { ModalState } from './state/ModalState';
|
||||
import { GeneralSection } from './sections/GeneralSection';
|
||||
import { TypographySection } from './sections/TypographySection';
|
||||
import { PageSetupSection } from './sections/PageSetupSection';
|
||||
import { BehaviorSection } from './sections/BehaviorSection';
|
||||
import { TemplateManager } from '../templates/TemplateManager';
|
||||
import { TemplateManager } from '../../templates/TemplateManager';
|
||||
|
||||
export class ExportConfigModal extends Modal {
|
||||
plugin: obsidianTypstPDFExport;
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { TFile } from 'obsidian';
|
||||
import { ExportFormat } from '../core/settings';
|
||||
import { ExportFormat } from '../../core/settings';
|
||||
|
||||
export interface ExportConfig {
|
||||
/** Override default template */
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { Setting } from 'obsidian';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||
|
||||
export class BehaviorSection implements ModalSection {
|
||||
private container: HTMLElement | null = null;
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
|
||||
import { Setting, App } from 'obsidian';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
||||
import { ExportFormat } from '../../core/settings';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||
import { ExportFormat } from '../../../core/settings';
|
||||
import { FolderSuggest } from '../../components/FolderSuggest';
|
||||
|
||||
export class GeneralSection implements ModalSection {
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
|
||||
import { Setting } from 'obsidian';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
||||
import { SUPPORTED_PAPER_SIZES } from '../../utils/paperSizeMapper';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||
import { SUPPORTED_PAPER_SIZES } from '../../../utils/paperSizeMapper';
|
||||
|
||||
export class LayoutSection implements ModalSection {
|
||||
private container: HTMLElement | null = null;
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
|
||||
import { Setting } from 'obsidian';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
||||
import { SUPPORTED_PAPER_SIZES } from '../../utils/paperSizeMapper';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||
import { SUPPORTED_PAPER_SIZES } from '../../../utils/paperSizeMapper';
|
||||
|
||||
export class PageSetupSection implements ModalSection {
|
||||
private container: HTMLElement | null = null;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { Setting, App } from 'obsidian';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
||||
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||
|
||||
export class TypographySection implements ModalSection {
|
||||
private container: HTMLElement | null = null;
|
||||
@@ -3,8 +3,8 @@
|
||||
* Centralized state management for the Export Configuration Modal
|
||||
*/
|
||||
|
||||
import { ExportConfigModalSettings, ExportConfig, ModalState as IModalState } from '../types';
|
||||
import { ExportFormat } from '../../core/settings';
|
||||
import { ExportConfigModalSettings, ExportConfig, ModalState as IModalState } from '../modalTypes';
|
||||
import { ExportFormat } from '../../../core/settings';
|
||||
|
||||
export class ModalState implements IModalState {
|
||||
settings: ExportConfigModalSettings;
|
||||
Reference in new issue
Block a user