feat(core): Refactor project structure for better modularity and code organization

This commit is contained in:
2024-12-02 16:04:58 +01:00
parent bab1ffc4b4
commit c9ad18538b
30 changed files with 100 additions and 83 deletions

View File

@@ -11,12 +11,10 @@ import {
domtools,
} from '@design.estate/dees-element';
import * as interfaces from '../../ts/interfaces/index.js';
import * as plugins from '../plugins.js';
import { defaultDocumentSettings } from './document.js';
import * as shared from '../../ts/shared/index.js';
declare global {
interface HTMLElementTagNameMap {
'dedocument-page': DePage;
@@ -67,7 +65,7 @@ export class DePage extends DeesElement {
type: Object,
reflect: true,
})
public documentSettings: interfaces.IDocumentSettings = defaultDocumentSettings;
public documentSettings: plugins.shared.interfaces.IDocumentSettings = defaultDocumentSettings;
constructor() {
super();
@@ -204,9 +202,9 @@ export class DePage extends DeesElement {
let scale = 1;
if (this.viewHeight) {
scale = this.viewHeight / shared.a4Height;
scale = this.viewHeight / plugins.shared.a4Height;
} else if (this.viewWidth) {
scale = this.viewWidth / shared.a4Width;
scale = this.viewWidth / plugins.shared.a4Width;
}
console.log(`new scale is ${scale}`);
scaleWrapper.style.transform = `scale(${scale})`;
@@ -214,6 +212,6 @@ export class DePage extends DeesElement {
// Adjust the outer dimensions so they match the scaled content
// this.style.width = `${shared.a4Width * scale}px`;
this.style.height = `${shared.a4Height * scale}px`;
this.style.height = `${plugins.shared.a4Height * scale}px`;
}
}