@solidpepper/solidpepper-soliddesigner 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts ADDED
@@ -0,0 +1,814 @@
1
+ import * as i0 from '@angular/core';
2
+ import { RendererFactory2, Injector, Type, OnInit, OnChanges, EventEmitter, ElementRef, SimpleChanges } from '@angular/core';
3
+ import { TranslateService } from '@ngx-translate/core';
4
+ import { HttpClient } from '@angular/common/http';
5
+ import * as rxjs from 'rxjs';
6
+ import { Observable } from 'rxjs';
7
+ import * as signalR from '@microsoft/signalr';
8
+ import { Router } from '@angular/router';
9
+
10
+ declare class TranslationService {
11
+ translate: TranslateService;
12
+ private defaultLanguage;
13
+ private availablelangs;
14
+ constructor(translate: TranslateService);
15
+ setDefaultLang(lang: string): void;
16
+ useLanguage(lang: string): void;
17
+ getAvailableLanguages(): {
18
+ code: string;
19
+ text: string;
20
+ }[];
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<TranslationService, never>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<TranslationService>;
23
+ }
24
+
25
+ declare enum DocumentType {
26
+ BACKGROUND = "background",
27
+ COVERPAGE = "cover",
28
+ MARKETING = "marketing",
29
+ PRODUCTBLOCK = "productblock",
30
+ DOCUMENT = "document",
31
+ TEMPLATE = "template"
32
+ }
33
+
34
+ interface AppParams {
35
+ token?: string;
36
+ type?: DocumentType | string;
37
+ guid?: string;
38
+ apiUrl?: string;
39
+ language?: string;
40
+ unit?: string;
41
+ templateData?: any;
42
+ documentData?: any[];
43
+ documentName?: string;
44
+ }
45
+ declare class AppParamsService {
46
+ readonly params: i0.WritableSignal<AppParams>;
47
+ readonly pageGuid: i0.WritableSignal<string>;
48
+ setParams(params: Partial<AppParams>): void;
49
+ updateTemplateName(newName: string): void;
50
+ updateDocumentName(newName: string): void;
51
+ get token(): string | undefined;
52
+ get type(): string | undefined;
53
+ get guid(): string | undefined;
54
+ get apiUrl(): string | undefined;
55
+ get language(): string | undefined;
56
+ get templateData(): any;
57
+ get documentData(): any[] | undefined;
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppParamsService, never>;
59
+ static ɵprov: i0.ɵɵInjectableDeclaration<AppParamsService>;
60
+ }
61
+
62
+ declare class FontApiService {
63
+ private http;
64
+ private appParams;
65
+ constructor(http: HttpClient, appParams: AppParamsService);
66
+ private get headers();
67
+ getFonts(): Observable<any[]>;
68
+ addFont(formData: FormData): Observable<any>;
69
+ updateFont(font: any): Observable<any>;
70
+ deleteFont(fontId: number | string): Observable<any>;
71
+ getFontAsBase64(fontName: string, fontUrl: string, fontFilename: string): Observable<any>;
72
+ static ɵfac: i0.ɵɵFactoryDeclaration<FontApiService, never>;
73
+ static ɵprov: i0.ɵɵInjectableDeclaration<FontApiService>;
74
+ }
75
+
76
+ interface FontDefinition {
77
+ fontName: string;
78
+ fontFilename?: string;
79
+ fontUrl?: string;
80
+ fontPath?: string;
81
+ axes?: any;
82
+ publicationFontGuid?: string;
83
+ publicationFontId?: number;
84
+ fontGuid?: string;
85
+ }
86
+ declare class FontService {
87
+ private fontApiService;
88
+ fontsNames: i0.WritableSignal<string[]>;
89
+ availableFonts: i0.WritableSignal<{
90
+ [key: string]: FontDefinition;
91
+ }>;
92
+ private fontsImported;
93
+ private customFontFaces;
94
+ private baseFonts;
95
+ constructor(fontApiService: FontApiService);
96
+ init(): Promise<void>;
97
+ loadFonts(): Promise<void>;
98
+ private injectGoogleFontsPreconnect;
99
+ loadCustomFont(font: FontDefinition): Promise<void>;
100
+ deleteFont(font: FontDefinition): Promise<void>;
101
+ private getFontMimeAndType;
102
+ private isFontAlreadyInDocument;
103
+ getGoogleFontLink(fontName: string): string;
104
+ injectGoogleFont(fontName: string): void;
105
+ private injectAllGoogleFonts;
106
+ private injectDocumentFonts;
107
+ isGoogleFont(fontName: string): boolean;
108
+ getCustomFontUrlFace(fontName: string): string | null;
109
+ static ɵfac: i0.ɵɵFactoryDeclaration<FontService, never>;
110
+ static ɵprov: i0.ɵɵInjectableDeclaration<FontService>;
111
+ }
112
+
113
+ type NotificationType = 'info' | 'success' | 'warning' | 'error';
114
+ interface Notification {
115
+ id: string;
116
+ type: NotificationType;
117
+ message: string;
118
+ closing?: boolean;
119
+ }
120
+ declare class NotificationService {
121
+ private http;
122
+ private _settingsService;
123
+ notifications: i0.WritableSignal<Notification[]>;
124
+ private quantity;
125
+ show(message: string, type?: NotificationType, duration?: number): void;
126
+ success(message: string, duration?: number): void;
127
+ info(message: string, duration?: number): void;
128
+ warning(message: string, duration?: number): void;
129
+ error(message: string, duration?: number): void;
130
+ close(id: string): void;
131
+ sendUpdate(message: number): void;
132
+ getUpdate(): Observable<any>;
133
+ getNotifications(start?: any, limit?: any): Observable<Object>;
134
+ static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
135
+ static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
136
+ }
137
+
138
+ declare class WebsocketService {
139
+ private _settings;
140
+ _router: Router;
141
+ private rights;
142
+ _notification: NotificationService;
143
+ private _toastr;
144
+ private ngZone;
145
+ connection: signalR.HubConnection | null;
146
+ isConnected: boolean;
147
+ private userLogin;
148
+ informationMessage: any;
149
+ deliberateDisconnect: boolean;
150
+ room: any;
151
+ constructor();
152
+ initConnection(): void;
153
+ connect(): void;
154
+ listeners(): void;
155
+ listenersOnClose(): void;
156
+ disconnect(): void;
157
+ static ɵfac: i0.ɵɵFactoryDeclaration<WebsocketService, never>;
158
+ static ɵprov: i0.ɵɵInjectableDeclaration<WebsocketService>;
159
+ }
160
+
161
+ declare class AssetsService {
162
+ private http;
163
+ private appParams;
164
+ constructor(http: HttpClient, appParams: AppParamsService);
165
+ getAssetByGuid(assetGuid: string): Observable<any>;
166
+ getSVGTemplate(guid: string): Observable<any>;
167
+ getTemplateBackgroundsList(templateGuid: string): Observable<any>;
168
+ getTemplateProductBlocks(templateGuid: string): Observable<any[]>;
169
+ getSVGDocumentPages(guid: string): Observable<any>;
170
+ getTemplateDimensions(): Observable<any>;
171
+ saveDocument(type: string, formData: FormData): Observable<any>;
172
+ loadSvgFromUrl(svgUrl: string): Observable<string>;
173
+ addDocumentPage(assetGuid: string, position?: number): Observable<any>;
174
+ duplicateDocumentPage(assetGuid: string, fileGuid: string): Observable<any>;
175
+ moveDocumentPage(assetGuid: string, pageGuid: string, newPageId: number): Observable<any>;
176
+ deleteDocumentPage(assetGuid: string, pageGuid: string): Observable<any>;
177
+ updateTemplateField(fieldName: string, fieldValue: string): Observable<any>;
178
+ getTemplates(): Observable<any[]>;
179
+ publishYoubooky(): Observable<any>;
180
+ checkPdfExistence(): Observable<any>;
181
+ generatePdf(highDefinition?: boolean, imageColorProfile?: string, bleedMargin?: boolean, cuttingLines?: boolean, bleedMarginCustom?: boolean, bleedMarginValue?: number): Observable<any>;
182
+ getAssetsTemplates(): Observable<any[]>;
183
+ getTemplateGuidFromAssetGuid(assetGuid: string): Observable<string | null>;
184
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssetsService, never>;
185
+ static ɵprov: i0.ɵɵInjectableDeclaration<AssetsService>;
186
+ }
187
+
188
+ declare class CanvasService {
189
+ private _svgElement;
190
+ private _wrapperElement;
191
+ private readonly _transform;
192
+ readonly zoomLevel: i0.WritableSignal<number>;
193
+ readonly panOffset: i0.WritableSignal<{
194
+ x: number;
195
+ y: number;
196
+ }>;
197
+ readonly baseScale: i0.WritableSignal<number>;
198
+ readonly isReady: i0.WritableSignal<boolean>;
199
+ readonly currentContext: i0.WritableSignal<SVGSVGElement | SVGGElement | null>;
200
+ readonly modifiedPulse: i0.WritableSignal<number>;
201
+ readonly isSilent: i0.WritableSignal<boolean>;
202
+ readonly versionUpgraded: i0.WritableSignal<boolean>;
203
+ private disabledElems;
204
+ private readonly docService;
205
+ private readonly eventsService;
206
+ private readonly selectionStore;
207
+ private readonly colorService;
208
+ private injector;
209
+ constructor();
210
+ get svgElement(): SVGSVGElement;
211
+ get wrapperElement(): HTMLElement;
212
+ /**
213
+ * Called by the Canvas Component when the view is initialized
214
+ */
215
+ setSvgElement(el: SVGSVGElement): void;
216
+ private _mutationObserver;
217
+ private initMutationObserver;
218
+ setContext(elem: SVGGElement | SVGSVGElement | null): void;
219
+ private leaveContext;
220
+ /**
221
+ * Restores original opacities and pointer-events in a cloned SVG structure
222
+ * typically called during SVG serialization for saving.
223
+ */
224
+ restoreContextInClone(clone: SVGElement): void;
225
+ setWrapperElement(el: HTMLElement): void;
226
+ /**
227
+ * Clean up listeners
228
+ */
229
+ destroy(): void;
230
+ /**
231
+ * Get main drawing group (usually the first 'g' or a specific ID)
232
+ */
233
+ get drawingGroup(): SVGGElement | null;
234
+ /**
235
+ * Returns the correct container for inserting new elements.
236
+ * If not in a sub-context, it respects the active 'data-side' group.
237
+ */
238
+ get activeContainer(): SVGGElement;
239
+ /**
240
+ * Convert screen coordinates to SVG coordinates
241
+ * @param clientX Screen X
242
+ * @param clientY Screen Y
243
+ * @param relativeTo Optional element to get coordinates relative to its local coordinate system
244
+ */
245
+ getSvgPoint(clientX: number, clientY: number, relativeTo?: SVGGraphicsElement): DOMPoint;
246
+ /**
247
+ * Convert screen coordinates to local coordinates using a provided screen CTM
248
+ */
249
+ screenToLocal(clientX: number, clientY: number, screenCTM: DOMMatrix): DOMPoint;
250
+ /**
251
+ * Handle Mouse Wheel for Zooming and Panning
252
+ */
253
+ private handleWheel;
254
+ /**
255
+ * Zoom relative to a center point (screen coordinates)
256
+ */
257
+ zoom(factor: number, centerX: number, centerY: number): void;
258
+ /**
259
+ * Pan the canvas
260
+ */
261
+ pan(dx: number, dy: number): void;
262
+ /**
263
+ * Apply transform to the SVG element
264
+ */
265
+ private updateTransform;
266
+ getTransform(): {
267
+ x: number;
268
+ y: number;
269
+ scale: number;
270
+ };
271
+ /**
272
+ * Group selected elements
273
+ */
274
+ groupElements(elements: SVGElement[]): SVGGElement | null;
275
+ /**
276
+ * Align selected elements
277
+ * @param elements Elements to align
278
+ * @param type Alignment type
279
+ * @param bounds Reference bounds (either selection union or page)
280
+ */
281
+ alignElements(elements: SVGElement[], type: 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom', bounds: {
282
+ x: number;
283
+ y: number;
284
+ width: number;
285
+ height: number;
286
+ }): void;
287
+ /**
288
+ * Ungroup a group element
289
+ */
290
+ ungroupElement(group: SVGGElement): SVGElement[];
291
+ /**
292
+ * Migrates a legacy document to double-page mode.
293
+ * Moving current content into a left dataside group and cloning it into a right dataside group.
294
+ */
295
+ migrateLegacyToDoublePage(): void;
296
+ /**
297
+ * Delete the currently selected elements
298
+ */
299
+ deleteSelectedElements(): void;
300
+ /**
301
+ * Nudge selected elements by a certain amount
302
+ */
303
+ nudgeSelectedElements(dx: number, dy: number): void;
304
+ /**
305
+ * Rotate selected elements by a certain angle
306
+ */
307
+ rotateSelectedElements(angle: number): void;
308
+ /**
309
+ * Select all selectable elements in the current context
310
+ */
311
+ selectAllElements(): void;
312
+ /**
313
+ * Reset zoom to 100% and center paper
314
+ */
315
+ zoomReset(): void;
316
+ /**
317
+ * Bring selected elements to front
318
+ */
319
+ bringToFront(): void;
320
+ /**
321
+ * Send selected elements to back
322
+ */
323
+ sendToBack(): void;
324
+ /**
325
+ * Bring selected elements forward by one step
326
+ */
327
+ bringForward(): void;
328
+ /**
329
+ * Send selected elements backward by one step
330
+ */
331
+ sendBackward(): void;
332
+ /**
333
+ * Cycle selection to next or previous selectable element
334
+ */
335
+ cycleSelectedElement(direction: number): void;
336
+ loadedSvg: SVGSVGElement | null;
337
+ private creationOverlayRect;
338
+ startDrawingSelection(x: number, y: number): void;
339
+ updateDrawingSelection(x: number, y: number, w: number, h: number): void;
340
+ finishDrawingSelection(): void;
341
+ fitToScreen(): void;
342
+ panToSide(side: 'left' | 'right'): void;
343
+ isLockedOrOverlay(element: Element): boolean;
344
+ findSelectableElement(target: Element): SVGElement | null;
345
+ private _usedColorsCache;
346
+ private _lastColorPulse;
347
+ /**
348
+ * Scans the SVG for used colors and returns the most frequent ones.
349
+ * Cached based on modifiedPulse for performance.
350
+ */
351
+ getMostUsedColors(limit?: number): string[];
352
+ static ɵfac: i0.ɵɵFactoryDeclaration<CanvasService, never>;
353
+ static ɵprov: i0.ɵɵInjectableDeclaration<CanvasService>;
354
+ }
355
+
356
+ interface EditorEvent {
357
+ type: string;
358
+ payload?: any;
359
+ }
360
+ declare class EventsService {
361
+ private _eventBus;
362
+ constructor();
363
+ /**
364
+ * Publish an event to the bus
365
+ */
366
+ emit(type: string, payload?: any): void;
367
+ /**
368
+ * Listen for specific event types
369
+ */
370
+ on<T>(type: string): Observable<T>;
371
+ /**
372
+ * Listen to all events (for debug or broad monitoring)
373
+ */
374
+ get all$(): Observable<EditorEvent>;
375
+ private initGlobalListeners;
376
+ private handlePaste;
377
+ private handleKeyDown;
378
+ private handleKeyUp;
379
+ static ɵfac: i0.ɵɵFactoryDeclaration<EventsService, never>;
380
+ static ɵprov: i0.ɵɵInjectableDeclaration<EventsService>;
381
+ }
382
+
383
+ interface DocumentProperties {
384
+ width: number;
385
+ height: number;
386
+ unit: 'px' | 'cm' | 'mm' | 'in';
387
+ backgroundColor: string;
388
+ marginVertical: number;
389
+ headerHeight: number;
390
+ footerHeight: number;
391
+ marginLeft: number;
392
+ marginRight: number;
393
+ bleedMargin: number;
394
+ viewBox?: string;
395
+ doublePage?: boolean;
396
+ side?: 'left' | 'right';
397
+ }
398
+ declare class DocumentService {
399
+ private appParams;
400
+ readonly properties: i0.WritableSignal<DocumentProperties>;
401
+ private getInitialUnit;
402
+ constructor();
403
+ get dimensions(): i0.WritableSignal<DocumentProperties>;
404
+ updateDimensions(width: number, height: number): void;
405
+ updateUnit(unit: DocumentProperties['unit']): void;
406
+ updateProperty<K extends keyof DocumentProperties>(key: K, value: DocumentProperties[K]): void;
407
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentService, never>;
408
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentService>;
409
+ }
410
+
411
+ declare class SelectionStore {
412
+ readonly selectedElements: i0.WritableSignal<SVGElement[]>;
413
+ readonly updated: i0.WritableSignal<number>;
414
+ readonly count: i0.Signal<number>;
415
+ readonly isEmpty: i0.Signal<boolean>;
416
+ readonly first: i0.Signal<SVGElement>;
417
+ select(elements: SVGElement[]): void;
418
+ add(element: SVGElement): void;
419
+ toggle(element: SVGElement): void;
420
+ clear(): void;
421
+ /**
422
+ * Manually triggers an update notification.
423
+ * Useful when the content of a selected element changes (e.g. text edit)
424
+ * but the selection reference itself remains the same.
425
+ */
426
+ triggerUpdate(): void;
427
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectionStore, never>;
428
+ static ɵprov: i0.ɵɵInjectableDeclaration<SelectionStore>;
429
+ }
430
+
431
+ interface HSLA {
432
+ h: number;
433
+ s: number;
434
+ l: number;
435
+ a: number;
436
+ }
437
+ interface HSVA {
438
+ h: number;
439
+ s: number;
440
+ v: number;
441
+ a: number;
442
+ }
443
+ interface RGBA {
444
+ r: number;
445
+ g: number;
446
+ b: number;
447
+ a: number;
448
+ }
449
+ interface CMYK {
450
+ c: number;
451
+ m: number;
452
+ y: number;
453
+ k: number;
454
+ }
455
+ declare class ColorService {
456
+ constructor();
457
+ toSvgColor(color: string): string;
458
+ hexToRgba(hex: string): RGBA;
459
+ rgbaToHex(rgba: RGBA): string;
460
+ rgbToHsv(r: number, g: number, b: number): {
461
+ h: number;
462
+ s: number;
463
+ v: number;
464
+ };
465
+ hsvToRgb(h: number, s: number, v: number): {
466
+ r: number;
467
+ g: number;
468
+ b: number;
469
+ };
470
+ rgbToHsl(r: number, g: number, b: number): {
471
+ h: number;
472
+ s: number;
473
+ l: number;
474
+ };
475
+ hslToRgb(h: number, s: number, l: number): {
476
+ r: number;
477
+ g: number;
478
+ b: number;
479
+ };
480
+ rgbToCmyk(r: number, g: number, b: number): CMYK;
481
+ cmykToRgb(c: number, m: number, y: number, k: number): {
482
+ r: number;
483
+ g: number;
484
+ b: number;
485
+ };
486
+ isHex(color: any): boolean;
487
+ isRgb(color: any): boolean;
488
+ isHsl(color: any): boolean;
489
+ isHsv(color: any): boolean;
490
+ isCmyk(color: any): boolean;
491
+ toRgba(color: any): RGBA;
492
+ toHex(color: any): string;
493
+ toHsl(color: any): HSLA;
494
+ toHsv(color: any): HSVA;
495
+ toCmyk(color: any): CMYK;
496
+ parseRgbString(str: string): RGBA;
497
+ parseHslString(str: string): RGBA;
498
+ parseHsvString(str: string): RGBA;
499
+ parseCmykString(str: string): RGBA;
500
+ static ɵfac: i0.ɵɵFactoryDeclaration<ColorService, never>;
501
+ static ɵprov: i0.ɵɵInjectableDeclaration<ColorService>;
502
+ }
503
+
504
+ interface TableSize {
505
+ rows: number;
506
+ cols: number;
507
+ }
508
+ declare class TableElementService {
509
+ private readonly canvasService;
510
+ private colorService;
511
+ private readonly renderer;
512
+ constructor(rendererFactory: RendererFactory2, canvasService: CanvasService, colorService: ColorService);
513
+ /**
514
+ * Create a product table foreignObject element on the canvas.
515
+ */
516
+ createProductTable(x: number, y: number, width: number, height: number, copy?: Element): SVGForeignObjectElement;
517
+ /**
518
+ * Create a variants table foreignObject element on the canvas.
519
+ */
520
+ createVariantsTable(x: number, y: number, width: number, height: number, copy?: Element): SVGForeignObjectElement;
521
+ private _createTable;
522
+ addRow(container: Element, position: 'beforebegin' | 'afterend', ignoreSelectedCells?: boolean): void;
523
+ removeRow(container: Element): void;
524
+ moveRow(container: Element, direction: 'up' | 'down'): void;
525
+ addColumn(container: Element, position: 'beforebegin' | 'afterend', ignoreSelectedCells?: boolean): void;
526
+ removeColumn(container: Element, columnId?: number): void;
527
+ moveColumn(container: Element, direction: 'left' | 'right'): void;
528
+ mergeCells(container: Element): void;
529
+ splitCells(container: Element, forcedCell?: HTMLTableCellElement): void;
530
+ applyStyleToSelected(container: Element, attribute: string, value: string, defaultValue?: string): void;
531
+ applyBorderStylesToSelected(container: Element, attribute: string, value: string, sides?: string[]): void;
532
+ private _syncAdjacentBorder;
533
+ private _getVisibleCell;
534
+ clearTableStyle(container: Element): void;
535
+ clearTable(container: Element): void;
536
+ setDefaultStyleToCell(cell: HTMLElement): void;
537
+ resizeTableContainer(foreignObject: Element): void;
538
+ /**
539
+ * Enter edit mode: show index rows/cells, expand foreignObject,
540
+ * enable pointer-events on the table. Matching old designer's setTableEditMode().
541
+ */
542
+ setTableEditMode(foreignObject: Element): void;
543
+ /**
544
+ * Leave edit mode: hide indexes, collapse foreignObject, clear selection.
545
+ * Matching old designer's removeTableEditMode().
546
+ */
547
+ removeTableEditMode(foreignObject: Element): void;
548
+ getTableSize(container: Element): TableSize;
549
+ setTableSize(container: Element, targetRows: number, targetCols: number): void;
550
+ setEditInput(cell: HTMLElement): void;
551
+ removeEditInput(cell: HTMLElement): void;
552
+ selectCells(container: Element, cells: Element[]): void;
553
+ deselectAllCells(container: Element): void;
554
+ rewriteRowIndexes(container: Element): void;
555
+ rewriteColumnsIndexes(container: Element): void;
556
+ /**
557
+ * Export the table by stripping edit-mode indexes and returning clean HTML.
558
+ */
559
+ exportTable(container: Element): string;
560
+ /**
561
+ * Enable edit mode for a table: adds index rows/columns, resize handles, and handles variants table spacing.
562
+ */
563
+ enableEditMode(table: HTMLTableElement): void;
564
+ private _colIndexToLetter;
565
+ /** Get all elements in a given column (across all rows). */
566
+ _getColumnByIndex(table: Element, colIndex: number): Element[];
567
+ exportVariantsTableSettings(tableElement: HTMLElement): any;
568
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableElementService, never>;
569
+ static ɵprov: i0.ɵɵInjectableDeclaration<TableElementService>;
570
+ }
571
+
572
+ declare enum LoadingError {
573
+ NONE = "",
574
+ DOCUMENT = "LOADER.ERRORS.DOCUMENT",
575
+ PAGE = "LOADER.ERRORS.PAGE",
576
+ TOKEN = "LOADER.ERRORS.TOKEN"
577
+ }
578
+ declare class LoadingService {
579
+ readonly isLoading: i0.WritableSignal<boolean>;
580
+ readonly hasError: i0.WritableSignal<boolean>;
581
+ readonly errorKey: i0.WritableSignal<LoadingError>;
582
+ readonly isCanvasLoading: i0.WritableSignal<boolean>;
583
+ readonly canvasHasError: i0.WritableSignal<boolean>;
584
+ readonly canvasErrorKey: i0.WritableSignal<LoadingError>;
585
+ showLoader(): void;
586
+ hideLoader(): void;
587
+ showError(error: LoadingError): void;
588
+ showCanvasLoader(): void;
589
+ hideCanvasLoader(): void;
590
+ showCanvasError(error: LoadingError): void;
591
+ reset(): void;
592
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoadingService, never>;
593
+ static ɵprov: i0.ɵɵInjectableDeclaration<LoadingService>;
594
+ }
595
+
596
+ declare class SaveService {
597
+ private canvasService;
598
+ private appParams;
599
+ private docService;
600
+ private assetsService;
601
+ private notificationService;
602
+ private eventsService;
603
+ private fontService;
604
+ private tableService;
605
+ private loadingService;
606
+ isDirty: i0.WritableSignal<boolean>;
607
+ saveSuccessPulse: i0.WritableSignal<{
608
+ guid: string;
609
+ count: number;
610
+ }>;
611
+ private lastPulse;
612
+ private thumbnailService;
613
+ constructor(canvasService: CanvasService, appParams: AppParamsService, docService: DocumentService, assetsService: AssetsService, notificationService: NotificationService, eventsService: EventsService, fontService: FontService, tableService: TableElementService, loadingService: LoadingService);
614
+ setDirty(dirty: boolean): void;
615
+ /**
616
+ * Serialize the current SVG canvas to a string
617
+ */
618
+ getSvgString(): string;
619
+ /**
620
+ * Trigger a download/upload of the current SVG
621
+ */
622
+ save(): Promise<void>;
623
+ static ɵfac: i0.ɵɵFactoryDeclaration<SaveService, never>;
624
+ static ɵprov: i0.ɵɵInjectableDeclaration<SaveService>;
625
+ }
626
+
627
+ declare class OpenService {
628
+ private canvasService;
629
+ private eventsService;
630
+ private docService;
631
+ private injector;
632
+ private selectionStore;
633
+ private saveService;
634
+ constructor(canvasService: CanvasService, eventsService: EventsService, docService: DocumentService, injector: Injector, selectionStore: SelectionStore, saveService: SaveService);
635
+ /**
636
+ * Load SVG content string into the canvas
637
+ */
638
+ loadSvgString(svgContent: string): void;
639
+ loadFromFile(file: File): Promise<void>;
640
+ /**
641
+ * Import SVG content from string
642
+ */
643
+ importSvgContent(xmlString: string): void;
644
+ /**
645
+ * Process imported SVG element
646
+ */
647
+ processImportedSvg(newSvg: SVGSVGElement): void;
648
+ /**
649
+ * Import an SVG element (Delegate to processImportedSvg if root)
650
+ */
651
+ importSvgElement(svgEl: SVGElement): void;
652
+ static ɵfac: i0.ɵɵFactoryDeclaration<OpenService, never>;
653
+ static ɵprov: i0.ɵɵInjectableDeclaration<OpenService>;
654
+ }
655
+
656
+ declare abstract class Command {
657
+ abstract undo(): void;
658
+ abstract redo(): void;
659
+ abstract getDescription(): string;
660
+ }
661
+ declare class HistoryService {
662
+ private canvasService;
663
+ private toolManager;
664
+ private eventsService;
665
+ private selectionStore;
666
+ private injector;
667
+ private saveService;
668
+ private modalService;
669
+ private undoStack;
670
+ private redoStack;
671
+ private maxHistorySize;
672
+ private isUndoRedo;
673
+ private isPaused;
674
+ private isModalOpen;
675
+ private autosaveTimeoutId;
676
+ private lastModificationTime;
677
+ private isMonitoring;
678
+ private observer;
679
+ private targetElement;
680
+ private debounceTimer;
681
+ private complexStateCache;
682
+ private accumulatedChanges;
683
+ readonly historyChanged: i0.WritableSignal<number>;
684
+ constructor();
685
+ private initKeyboardShortcuts;
686
+ canUndo(): boolean;
687
+ canRedo(): boolean;
688
+ pushChange(cmd: Command): void;
689
+ undo(): boolean;
690
+ redo(): boolean;
691
+ private triggerAutosave;
692
+ private scheduleAutosave;
693
+ private clearAutosaveTimer;
694
+ private notifyChanged;
695
+ pause(): void;
696
+ resume(): void;
697
+ clear(): void;
698
+ private restoreElementEvents;
699
+ private getComplexRoot;
700
+ private updateComplexCache;
701
+ private initializeCache;
702
+ private startMonitoring;
703
+ private handleMutations;
704
+ private recordChanges;
705
+ private scheduleFlush;
706
+ private flushChanges;
707
+ static ɵfac: i0.ɵɵFactoryDeclaration<HistoryService, never>;
708
+ static ɵprov: i0.ɵɵInjectableDeclaration<HistoryService>;
709
+ }
710
+
711
+ interface BackgroundTemplate {
712
+ backgroundGuid: string;
713
+ backgroundName: string;
714
+ backgroundUrl: string;
715
+ backgroundFormatName: string;
716
+ backgroundIsDefault: boolean;
717
+ svgContent?: string;
718
+ svgUrl?: string;
719
+ width?: number;
720
+ height?: number;
721
+ marginHorizontal?: number;
722
+ headerHeight?: number;
723
+ footerHeight?: number;
724
+ }
725
+ declare class BackgroundPreviewService {
726
+ private assetsService;
727
+ private appParams;
728
+ private backgroundsSignal;
729
+ private activeBackgroundIndexSignal;
730
+ private isPreviewHiddenSignal;
731
+ backgrounds: i0.Signal<BackgroundTemplate[]>;
732
+ activeBackgroundIndex: i0.Signal<number>;
733
+ isPreviewHidden: i0.Signal<boolean>;
734
+ activeBackground: i0.Signal<BackgroundTemplate | null>;
735
+ constructor(assetsService: AssetsService, appParams: AppParamsService);
736
+ /**
737
+ * Loads the background templates and fetches their SVG contents
738
+ */
739
+ loadBackgrounds(): Promise<void>;
740
+ setActiveBackground(index: number): void;
741
+ setPreviewHidden(hidden: boolean): void;
742
+ static ɵfac: i0.ɵɵFactoryDeclaration<BackgroundPreviewService, never>;
743
+ static ɵprov: i0.ɵɵInjectableDeclaration<BackgroundPreviewService>;
744
+ }
745
+
746
+ interface ModalOptions {
747
+ component: Type<any>;
748
+ data?: any;
749
+ }
750
+ declare class ModalService {
751
+ private modalState;
752
+ modalState$: rxjs.Observable<ModalOptions | null>;
753
+ open(component: Type<any>, data?: any): void;
754
+ close(): void;
755
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModalService, never>;
756
+ static ɵprov: i0.ɵɵInjectableDeclaration<ModalService>;
757
+ }
758
+
759
+ interface EditorConfig {
760
+ showGrid: boolean;
761
+ showRulers: boolean;
762
+ showWireframe: boolean;
763
+ showMargins: boolean;
764
+ snapToGrid: boolean;
765
+ theme: 'light' | 'dark';
766
+ }
767
+ declare class ConfigService {
768
+ readonly config: i0.WritableSignal<EditorConfig>;
769
+ updateConfig(partialConfig: Partial<EditorConfig>): void;
770
+ toggleGrid(): void;
771
+ toggleRulers(): void;
772
+ toggleWireframe(): void;
773
+ toggleMargins(): void;
774
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfigService, never>;
775
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConfigService>;
776
+ }
777
+
778
+ declare class AppComponent implements OnInit, OnChanges {
779
+ private translationService;
780
+ private appParamsService;
781
+ private assetsService;
782
+ private openService;
783
+ private canvasService;
784
+ private historyService;
785
+ private backgroundService;
786
+ private fontService;
787
+ private eventsService;
788
+ private modalService;
789
+ private hostElement;
790
+ config: ConfigService;
791
+ private saveService;
792
+ loadingService: LoadingService;
793
+ private websocketService;
794
+ token?: string;
795
+ type: DocumentType.BACKGROUND | DocumentType.COVERPAGE | DocumentType.MARKETING | DocumentType.PRODUCTBLOCK | DocumentType.DOCUMENT | DocumentType.TEMPLATE;
796
+ guid?: string;
797
+ apiUrl: string;
798
+ language: string;
799
+ unit?: string;
800
+ exitEditor: EventEmitter<void>;
801
+ isSafari: i0.WritableSignal<boolean>;
802
+ isInitialized: boolean;
803
+ constructor(translationService: TranslationService, appParamsService: AppParamsService, assetsService: AssetsService, openService: OpenService, canvasService: CanvasService, historyService: HistoryService, backgroundService: BackgroundPreviewService, fontService: FontService, eventsService: EventsService, modalService: ModalService, hostElement: ElementRef, config: ConfigService, saveService: SaveService, loadingService: LoadingService, websocketService: WebsocketService);
804
+ ngOnInit(): void;
805
+ ngOnChanges(changes: SimpleChanges): void;
806
+ private tryInitialize;
807
+ private initShortcutListeners;
808
+ private checkBrowser;
809
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppComponent, never>;
810
+ static ɵcmp: i0.ɵɵComponentDeclaration<AppComponent, "solid-designer", never, { "token": { "alias": "token"; "required": false; }; "type": { "alias": "type"; "required": false; }; "guid": { "alias": "guid"; "required": false; }; "apiUrl": { "alias": "apiUrl"; "required": false; }; "language": { "alias": "language"; "required": false; }; "unit": { "alias": "unit"; "required": false; }; }, { "exitEditor": "exitEditor"; }, never, never, true, never>;
811
+ }
812
+
813
+ export { AppParamsService, AppComponent as SolidDesignerComponent };
814
+ export type { AppParams };