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 { ExportErrorHandler } from './src/core/ExportErrorHandler';
|
||||||
import { TempDirectoryManager } from './src/core/TempDirectoryManager';
|
import { TempDirectoryManager } from './src/core/TempDirectoryManager';
|
||||||
import { PandocTypstConverter } from './src/converters/PandocTypstConverter';
|
import { PandocTypstConverter } from './src/converters/PandocTypstConverter';
|
||||||
import { ExportConfigModal } from './src/modal/ExportConfigModal';
|
import { ExportConfigModal } from './src/ui/modal/ExportConfigModal';
|
||||||
import { ExportConfig, ExportConfigModalSettings } from './src/modal/types';
|
import { ExportConfig, ExportConfigModalSettings } from './src/ui/modal/modalTypes';
|
||||||
import { TemplateManager } from './src/templates/TemplateManager';
|
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 { SUPPORTED_PAPER_SIZES } from './src/utils/paperSizeMapper';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
@@ -441,7 +441,7 @@ export class obsidianTypstPDFExport extends Plugin {
|
|||||||
const tempDir = tempManager.ensureTempDir('images');
|
const tempDir = tempManager.ensureTempDir('images');
|
||||||
|
|
||||||
// Preprocess the markdown content using MarkdownPreprocessor
|
// Preprocess the markdown content using MarkdownPreprocessor
|
||||||
const { MarkdownPreprocessor } = await import('./src/MarkdownPreprocessor');
|
const { MarkdownPreprocessor } = await import('./src/converters/MarkdownPreprocessor');
|
||||||
const preprocessor = new MarkdownPreprocessor({
|
const preprocessor = new MarkdownPreprocessor({
|
||||||
vaultPath: vaultPath,
|
vaultPath: vaultPath,
|
||||||
options: {
|
options: {
|
||||||
|
|||||||
File renamed without changes.
@@ -9,7 +9,7 @@ import { promises as fsPromises } from 'fs';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import { mapToTypstPaperSize } from '../utils/paperSizeMapper';
|
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 type { obsidianTypstPDFExportSettings } from '../core/settings';
|
||||||
import { TempDirectoryManager } from '../core/TempDirectoryManager';
|
import { TempDirectoryManager } from '../core/TempDirectoryManager';
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ export class PandocTypstConverter {
|
|||||||
* Process PDF embeds by converting them to images and creating combined output
|
* Process PDF embeds by converting them to images and creating combined output
|
||||||
*/
|
*/
|
||||||
async processPdfEmbeds(processedResult: any, vaultBasePath: string, tempDir: string): Promise<void> {
|
async processPdfEmbeds(processedResult: any, vaultBasePath: string, tempDir: string): Promise<void> {
|
||||||
const { PdfToImageConverter } = require('../PdfToImageConverter');
|
const { PdfToImageConverter } = require('./PdfToImageConverter');
|
||||||
const converter = PdfToImageConverter.getInstance(this.plugin);
|
const converter = PdfToImageConverter.getInstance(this.plugin);
|
||||||
|
|
||||||
for (const pdfEmbed of processedResult.metadata.pdfEmbeds) {
|
for (const pdfEmbed of processedResult.metadata.pdfEmbeds) {
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import { TFile } from 'obsidian';
|
import { TFile } from 'obsidian';
|
||||||
import { obsidianTypstPDFExportSettings } from './settings';
|
import { obsidianTypstPDFExportSettings } from './settings';
|
||||||
import { ExportConfigModalSettings } from '../modal/types';
|
import { ExportConfigModalSettings } from '../ui/modal/modalTypes';
|
||||||
|
|
||||||
export interface ModalSettingsInput {
|
export interface ModalSettingsInput {
|
||||||
/** Primary file for the export */
|
/** Primary file for the export */
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
@@ -4,14 +4,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Modal, App, Notice } from 'obsidian';
|
import { Modal, App, Notice } from 'obsidian';
|
||||||
import { obsidianTypstPDFExport } from '../../main';
|
import { obsidianTypstPDFExport } from '../../../main';
|
||||||
import { ExportConfig, ExportConfigModalSettings, ModalSection } from './types';
|
import { ExportConfig, ExportConfigModalSettings, ModalSection } from './modalTypes';
|
||||||
import { ModalState } from './state/ModalState';
|
import { ModalState } from './state/ModalState';
|
||||||
import { GeneralSection } from './sections/GeneralSection';
|
import { GeneralSection } from './sections/GeneralSection';
|
||||||
import { TypographySection } from './sections/TypographySection';
|
import { TypographySection } from './sections/TypographySection';
|
||||||
import { PageSetupSection } from './sections/PageSetupSection';
|
import { PageSetupSection } from './sections/PageSetupSection';
|
||||||
import { BehaviorSection } from './sections/BehaviorSection';
|
import { BehaviorSection } from './sections/BehaviorSection';
|
||||||
import { TemplateManager } from '../templates/TemplateManager';
|
import { TemplateManager } from '../../templates/TemplateManager';
|
||||||
|
|
||||||
export class ExportConfigModal extends Modal {
|
export class ExportConfigModal extends Modal {
|
||||||
plugin: obsidianTypstPDFExport;
|
plugin: obsidianTypstPDFExport;
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { TFile } from 'obsidian';
|
import { TFile } from 'obsidian';
|
||||||
import { ExportFormat } from '../core/settings';
|
import { ExportFormat } from '../../core/settings';
|
||||||
|
|
||||||
export interface ExportConfig {
|
export interface ExportConfig {
|
||||||
/** Override default template */
|
/** Override default template */
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Setting } from 'obsidian';
|
import { Setting } from 'obsidian';
|
||||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||||
|
|
||||||
export class BehaviorSection implements ModalSection {
|
export class BehaviorSection implements ModalSection {
|
||||||
private container: HTMLElement | null = null;
|
private container: HTMLElement | null = null;
|
||||||
@@ -4,8 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Setting, App } from 'obsidian';
|
import { Setting, App } from 'obsidian';
|
||||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||||
import { ExportFormat } from '../../core/settings';
|
import { ExportFormat } from '../../../core/settings';
|
||||||
import { FolderSuggest } from '../../components/FolderSuggest';
|
import { FolderSuggest } from '../../components/FolderSuggest';
|
||||||
|
|
||||||
export class GeneralSection implements ModalSection {
|
export class GeneralSection implements ModalSection {
|
||||||
@@ -4,8 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Setting } from 'obsidian';
|
import { Setting } from 'obsidian';
|
||||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||||
import { SUPPORTED_PAPER_SIZES } from '../../utils/paperSizeMapper';
|
import { SUPPORTED_PAPER_SIZES } from '../../../utils/paperSizeMapper';
|
||||||
|
|
||||||
export class LayoutSection implements ModalSection {
|
export class LayoutSection implements ModalSection {
|
||||||
private container: HTMLElement | null = null;
|
private container: HTMLElement | null = null;
|
||||||
@@ -4,8 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Setting } from 'obsidian';
|
import { Setting } from 'obsidian';
|
||||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||||
import { SUPPORTED_PAPER_SIZES } from '../../utils/paperSizeMapper';
|
import { SUPPORTED_PAPER_SIZES } from '../../../utils/paperSizeMapper';
|
||||||
|
|
||||||
export class PageSetupSection implements ModalSection {
|
export class PageSetupSection implements ModalSection {
|
||||||
private container: HTMLElement | null = null;
|
private container: HTMLElement | null = null;
|
||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Setting, App } from 'obsidian';
|
import { Setting, App } from 'obsidian';
|
||||||
import { ModalSection, ModalState, ValidationResult } from '../types';
|
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
|
||||||
|
|
||||||
export class TypographySection implements ModalSection {
|
export class TypographySection implements ModalSection {
|
||||||
private container: HTMLElement | null = null;
|
private container: HTMLElement | null = null;
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
* Centralized state management for the Export Configuration Modal
|
* Centralized state management for the Export Configuration Modal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ExportConfigModalSettings, ExportConfig, ModalState as IModalState } from '../types';
|
import { ExportConfigModalSettings, ExportConfig, ModalState as IModalState } from '../modalTypes';
|
||||||
import { ExportFormat } from '../../core/settings';
|
import { ExportFormat } from '../../../core/settings';
|
||||||
|
|
||||||
export class ModalState implements IModalState {
|
export class ModalState implements IModalState {
|
||||||
settings: ExportConfigModalSettings;
|
settings: ExportConfigModalSettings;
|
||||||
Reference in new issue
Block a user