task(G3): title block with attributes - frame + attributed texts (ATTDEF convention), auto-insert as layout frame block
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
import * as Y from 'yjs';
|
||||
import { YjsDocument } from '../../crdt/YjsDocument';
|
||||
import type { CADElement, CADLayer, LayoutDefinition } from '../../types/cad.types';
|
||||
import type { CADElement, CADLayer, LayoutDefinition, BlockDefinition } from '../../types/cad.types';
|
||||
|
||||
export class CADDocument {
|
||||
private readonly ydoc: YjsDocument;
|
||||
@@ -99,6 +99,18 @@ export class CADDocument {
|
||||
});
|
||||
}
|
||||
|
||||
// ── Blöcke (Task G3 — bewusst NICHT undo-getrackt, siehe UndoManager-Kommentar) ──
|
||||
|
||||
/** Eine Blockdefinition per ID (oder undefined). */
|
||||
getBlock(id: string): BlockDefinition | undefined {
|
||||
return this.ydoc.data.blocks.get(id);
|
||||
}
|
||||
|
||||
/** Fügt eine Blockdefinition hinzu (überschreibt gleiche ID). */
|
||||
addBlock(block: BlockDefinition): void {
|
||||
this.ydoc.data.blocks.set(block.id, block);
|
||||
}
|
||||
|
||||
// ── Schreiben ────────────────────────────────────────────
|
||||
|
||||
/** Fügt ein Element hinzu (einzelner Aufruf = eigener Undo-Schritt). */
|
||||
|
||||
Reference in New Issue
Block a user