diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 97901b9..43bf465 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,28 +1,463 @@ @@ -196,23 +599,4 @@ onBeforeUnmount(() => window.removeEventListener('keydown', onKeyDown)) background: #334155; color: white; } - -.app-main { - display: flex; - flex: 1; - min-height: 0; -} - -.app-sidebar { - width: 260px; - background: #f8fafc; - border-right: 1px solid #e2e8f0; - flex-shrink: 0; - overflow-y: auto; -} - -.app-sidebar--right { - border-right: none; - border-left: 1px solid #e2e8f0; -} diff --git a/frontend/src/components/editor/EditorCanvas.vue b/frontend/src/components/editor/EditorCanvas.vue index 33429ec..8bfbeba 100644 --- a/frontend/src/components/editor/EditorCanvas.vue +++ b/frontend/src/components/editor/EditorCanvas.vue @@ -1,5 +1,5 @@ + + + + diff --git a/frontend/src/lib/index.ts b/frontend/src/lib/index.ts new file mode 100644 index 0000000..ad28f37 --- /dev/null +++ b/frontend/src/lib/index.ts @@ -0,0 +1,35 @@ +export { default as DreportEditor } from './DreportEditor.vue' +export type { DreportEditorConfig } from './DreportEditor.vue' + +// Core types +export type { + Template, + TemplateElement, + ContainerElement, + LeafElement, + StaticTextElement, + TextElement, + LineElement, + ImageElement, + PageNumberElement, + BarcodeElement, + RepeatingTableElement, + SizeValue, + SizeConstraint, + PositionMode, + ScalarBinding, + ArrayBinding, + ElementBinding, + TextStyle, + LineStyle, + ContainerStyle, + ImageStyle, + BarcodeStyle, + BarcodeFormat, + TableColumn, + TableStyle, + FormatType, +} from '../core/types' + +// Schema types +export type { JsonSchema, SchemaNode } from '../core/schema-parser' diff --git a/frontend/src/stores/schema.ts b/frontend/src/stores/schema.ts index c7496b8..833cc7f 100644 --- a/frontend/src/stores/schema.ts +++ b/frontend/src/stores/schema.ts @@ -3,68 +3,14 @@ import { ref, computed } from 'vue' import type { JsonSchema, SchemaNode } from '../core/schema-parser' import { parseSchema, findArrayFields, findScalarFields } from '../core/schema-parser' -/** Varsayılan fatura schema'sı */ -const defaultSchema: JsonSchema = { - $id: 'fatura-schema', +/** Minimal boş schema — gerçek schema dışarıdan (DreportEditor prop) gelir */ +const emptySchema: JsonSchema = { type: 'object', - properties: { - firma: { - type: 'object', - title: 'Firma', - properties: { - unvan: { type: 'string', title: 'Firma Unvani' }, - vergiNo: { type: 'string', title: 'Vergi No' }, - logo: { type: 'string', title: 'Logo', format: 'image' }, - adres: { type: 'string', title: 'Adres' }, - telefon: { type: 'string', title: 'Telefon' }, - }, - }, - fatura: { - type: 'object', - title: 'Fatura', - properties: { - no: { type: 'string', title: 'Fatura No' }, - tarih: { type: 'string', title: 'Tarih', format: 'date' }, - }, - }, - musteri: { - type: 'object', - title: 'Musteri', - properties: { - unvan: { type: 'string', title: 'Musteri Unvani' }, - vergiNo: { type: 'string', title: 'Vergi No' }, - adres: { type: 'string', title: 'Adres' }, - }, - }, - kalemler: { - type: 'array', - title: 'Fatura Kalemleri', - items: { - type: 'object', - properties: { - siraNo: { type: 'integer', title: 'Sira No' }, - adi: { type: 'string', title: 'Urun / Hizmet Adi' }, - miktar: { type: 'number', title: 'Miktar' }, - birim: { type: 'string', title: 'Birim' }, - birimFiyat: { type: 'number', title: 'Birim Fiyat', format: 'currency' }, - tutar: { type: 'number', title: 'Tutar', format: 'currency' }, - }, - }, - }, - toplamlar: { - type: 'object', - title: 'Toplamlar', - properties: { - araToplam: { type: 'number', title: 'Ara Toplam', format: 'currency' }, - kdv: { type: 'number', title: 'KDV', format: 'currency' }, - genelToplam: { type: 'number', title: 'Genel Toplam', format: 'currency' }, - }, - }, - }, + properties: {}, } export const useSchemaStore = defineStore('schema', () => { - const rawSchema = ref(defaultSchema) + const rawSchema = ref(emptySchema) const schemaTree = computed(() => parseSchema(rawSchema.value)) diff --git a/frontend/src/stores/template.ts b/frontend/src/stores/template.ts index 59efd57..112ea40 100644 --- a/frontend/src/stores/template.ts +++ b/frontend/src/stores/template.ts @@ -47,7 +47,14 @@ function createDefaultTemplate(): Template { export const useTemplateStore = defineStore('template', () => { const template = ref