@solidpepper/solidpepper-flipbook 0.1.3 → 0.1.5
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
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { OnInit, AfterViewInit, OnDestroy, ElementRef, EventEmitter, ChangeDetectorRef, OnChanges, SimpleChanges } from '@angular/core';
|
|
3
|
+
import * as _solidpepper_solidpepper_icons from '@solidpepper/solidpepper-icons';
|
|
3
4
|
import { TranslateService } from '@ngx-translate/core';
|
|
4
5
|
import { PageFlip } from 'page-flip';
|
|
5
6
|
import { HttpClient } from '@angular/common/http';
|
|
@@ -16,8 +17,8 @@ declare class TranslationService {
|
|
|
16
17
|
code: string;
|
|
17
18
|
text: string;
|
|
18
19
|
}[];
|
|
19
|
-
static ɵfac:
|
|
20
|
-
static ɵprov:
|
|
20
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TranslationService, never>;
|
|
21
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TranslationService>;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
declare enum LoadingError {
|
|
@@ -26,12 +27,12 @@ declare enum LoadingError {
|
|
|
26
27
|
PAGE = "LOADER.ERRORS.PAGE"
|
|
27
28
|
}
|
|
28
29
|
declare class LoadingService {
|
|
29
|
-
readonly isLoading:
|
|
30
|
-
readonly hasError:
|
|
31
|
-
readonly errorKey:
|
|
32
|
-
readonly isCanvasLoading:
|
|
33
|
-
readonly canvasHasError:
|
|
34
|
-
readonly canvasErrorKey:
|
|
30
|
+
readonly isLoading: _angular_core.WritableSignal<boolean>;
|
|
31
|
+
readonly hasError: _angular_core.WritableSignal<boolean>;
|
|
32
|
+
readonly errorKey: _angular_core.WritableSignal<LoadingError>;
|
|
33
|
+
readonly isCanvasLoading: _angular_core.WritableSignal<boolean>;
|
|
34
|
+
readonly canvasHasError: _angular_core.WritableSignal<boolean>;
|
|
35
|
+
readonly canvasErrorKey: _angular_core.WritableSignal<LoadingError>;
|
|
35
36
|
showLoader(): void;
|
|
36
37
|
hideLoader(): void;
|
|
37
38
|
showError(error: LoadingError): void;
|
|
@@ -39,8 +40,8 @@ declare class LoadingService {
|
|
|
39
40
|
hideCanvasLoader(): void;
|
|
40
41
|
showCanvasError(error: LoadingError): void;
|
|
41
42
|
reset(): void;
|
|
42
|
-
static ɵfac:
|
|
43
|
-
static ɵprov:
|
|
43
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LoadingService, never>;
|
|
44
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<LoadingService>;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
interface AppParams {
|
|
@@ -56,8 +57,8 @@ interface AppParams {
|
|
|
56
57
|
interactiveColor?: string;
|
|
57
58
|
}
|
|
58
59
|
declare class AppParamsService {
|
|
59
|
-
readonly params:
|
|
60
|
-
readonly pageGuid:
|
|
60
|
+
readonly params: _angular_core.WritableSignal<AppParams>;
|
|
61
|
+
readonly pageGuid: _angular_core.WritableSignal<string>;
|
|
61
62
|
setParams(params: Partial<AppParams>): void;
|
|
62
63
|
updateTemplateName(newName: string): void;
|
|
63
64
|
get guid(): string | undefined;
|
|
@@ -69,31 +70,36 @@ declare class AppParamsService {
|
|
|
69
70
|
get debug(): boolean;
|
|
70
71
|
get isDemo(): boolean;
|
|
71
72
|
get interactiveColor(): string | undefined;
|
|
72
|
-
static ɵfac:
|
|
73
|
-
static ɵprov:
|
|
73
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AppParamsService, never>;
|
|
74
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AppParamsService>;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
declare class FlipbookService {
|
|
77
78
|
private http;
|
|
78
79
|
private appParams;
|
|
79
80
|
constructor(http: HttpClient, appParams: AppParamsService);
|
|
80
|
-
getFlipbookInfo(): Observable<any>;
|
|
81
|
-
static ɵfac:
|
|
82
|
-
static ɵprov:
|
|
81
|
+
getFlipbookInfo(password?: string): Observable<any>;
|
|
82
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FlipbookService, never>;
|
|
83
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<FlipbookService>;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
interface InteractiveData {
|
|
86
|
-
type: 'link' | 'product';
|
|
87
|
+
type: 'link' | 'product' | 'page';
|
|
88
|
+
shape?: 'rect' | 'point';
|
|
87
89
|
x: number;
|
|
88
90
|
y: number;
|
|
89
91
|
width: number;
|
|
90
92
|
height: number;
|
|
91
93
|
tooltip?: string;
|
|
92
94
|
src?: string;
|
|
95
|
+
linkType?: 'url' | 'page' | 'dynamic';
|
|
96
|
+
pageTarget?: number;
|
|
93
97
|
showBox?: boolean;
|
|
94
98
|
clickBox?: boolean;
|
|
95
99
|
showIcon?: boolean;
|
|
96
100
|
color?: string;
|
|
101
|
+
icon?: string;
|
|
102
|
+
size?: 'sm' | 'md' | 'lg' | number;
|
|
97
103
|
'icon-align'?: 'start' | 'center' | 'end';
|
|
98
104
|
'icon-justify'?: 'start' | 'center' | 'end';
|
|
99
105
|
}
|
|
@@ -109,17 +115,28 @@ interface FlipbookPage {
|
|
|
109
115
|
pageDatasJson: string;
|
|
110
116
|
pageData?: PageData;
|
|
111
117
|
}
|
|
118
|
+
interface FlipbookSpread {
|
|
119
|
+
spreadIndex: number;
|
|
120
|
+
leftPage?: FlipbookPage;
|
|
121
|
+
rightPage?: FlipbookPage;
|
|
122
|
+
}
|
|
112
123
|
declare class FlipbookDataService {
|
|
113
124
|
private http;
|
|
114
125
|
private flipbookService;
|
|
115
126
|
private loadingService;
|
|
127
|
+
private appParams;
|
|
116
128
|
private _pages;
|
|
117
129
|
pages$: BehaviorSubject<FlipbookPage[]>;
|
|
118
|
-
|
|
130
|
+
getSpreads(pages: FlipbookPage[]): FlipbookSpread[];
|
|
131
|
+
readonly authChallenge: _angular_core.WritableSignal<{
|
|
132
|
+
type: "password" | "organization";
|
|
133
|
+
isInvalid?: boolean;
|
|
134
|
+
} | null>;
|
|
135
|
+
constructor(http: HttpClient, flipbookService: FlipbookService, loadingService: LoadingService, appParams: AppParamsService);
|
|
119
136
|
/**
|
|
120
137
|
* Fetch flipbook info and initialize pages
|
|
121
138
|
*/
|
|
122
|
-
loadFlipbookInfo(): Promise<
|
|
139
|
+
loadFlipbookInfo(password?: string): Promise<boolean>;
|
|
123
140
|
/**
|
|
124
141
|
* Generates a set of test pages.
|
|
125
142
|
* @param count Number of pages to generate
|
|
@@ -132,14 +149,15 @@ declare class FlipbookDataService {
|
|
|
132
149
|
* @param pageIndex Index of the page (0-based)
|
|
133
150
|
*/
|
|
134
151
|
loadPageData(pageIndex: number): Promise<PageData | null>;
|
|
135
|
-
static ɵfac:
|
|
136
|
-
static ɵprov:
|
|
152
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FlipbookDataService, never>;
|
|
153
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<FlipbookDataService>;
|
|
137
154
|
}
|
|
138
155
|
|
|
139
156
|
declare class FlipbookViewerComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
140
157
|
private dataService;
|
|
141
158
|
private paramsService;
|
|
142
159
|
private cdr;
|
|
160
|
+
readonly spIconCollapse: _solidpepper_solidpepper_icons.SpIcon;
|
|
143
161
|
pages: any[];
|
|
144
162
|
images: string[];
|
|
145
163
|
flipbookRef: ElementRef<HTMLDivElement>;
|
|
@@ -190,6 +208,9 @@ declare class FlipbookViewerComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
190
208
|
flipEnd(): void;
|
|
191
209
|
goToPage(pageNumber: number): void;
|
|
192
210
|
getCurrentPageIndex(): number;
|
|
211
|
+
get isPortrait(): boolean;
|
|
212
|
+
get isSpreadMode(): boolean;
|
|
213
|
+
get hasSlider(): boolean;
|
|
193
214
|
get isDebugVisible(): boolean;
|
|
194
215
|
get debugInfo(): string;
|
|
195
216
|
get isZoomed(): boolean;
|
|
@@ -200,6 +221,7 @@ declare class FlipbookViewerComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
200
221
|
resetZoom(): void;
|
|
201
222
|
onZoomIn(): void;
|
|
202
223
|
onZoomOut(): void;
|
|
224
|
+
setZoom(targetScale: number): void;
|
|
203
225
|
private applyZoomAt;
|
|
204
226
|
startDrag(event: MouseEvent): void;
|
|
205
227
|
onDrag(event: MouseEvent): void;
|
|
@@ -211,10 +233,12 @@ declare class FlipbookViewerComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
211
233
|
handleOverlayStart(event: MouseEvent | TouchEvent): void;
|
|
212
234
|
private isMouseEvent;
|
|
213
235
|
handleKeyDown(event: KeyboardEvent): void;
|
|
236
|
+
toggleFullscreen(): void;
|
|
237
|
+
onFullscreenChange(): void;
|
|
214
238
|
resize(): void;
|
|
215
239
|
ngOnDestroy(): void;
|
|
216
|
-
static ɵfac:
|
|
217
|
-
static ɵcmp:
|
|
240
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FlipbookViewerComponent, never>;
|
|
241
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FlipbookViewerComponent, "app-flipbook-viewer", never, {}, { "pagesLoaded": "pagesLoaded"; "pageChanged": "pageChanged"; "toggleSidebar": "toggleSidebar"; "toggleMap": "toggleMap"; "zoomChanged": "zoomChanged"; }, never, never, true, never>;
|
|
218
242
|
}
|
|
219
243
|
|
|
220
244
|
interface PDFConversionProgress {
|
|
@@ -231,26 +255,28 @@ declare class PDFService {
|
|
|
231
255
|
* @param onProgress Callback de progression
|
|
232
256
|
*/
|
|
233
257
|
convertPDFToImages(file: File, scale?: number, onProgress?: (progress: PDFConversionProgress) => void): Promise<string[]>;
|
|
234
|
-
static ɵfac:
|
|
235
|
-
static ɵprov:
|
|
258
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PDFService, never>;
|
|
259
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<PDFService>;
|
|
236
260
|
}
|
|
237
261
|
|
|
238
262
|
declare class ThemeService {
|
|
239
|
-
isDarkMode:
|
|
263
|
+
isDarkMode: _angular_core.WritableSignal<boolean>;
|
|
240
264
|
constructor();
|
|
241
265
|
toggleTheme(): void;
|
|
242
266
|
private applyTheme;
|
|
243
|
-
static ɵfac:
|
|
244
|
-
static ɵprov:
|
|
267
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
268
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ThemeService>;
|
|
245
269
|
}
|
|
246
270
|
|
|
247
271
|
declare class AppComponent implements OnInit, OnChanges, OnDestroy {
|
|
248
272
|
private translationService;
|
|
249
273
|
private appParamsService;
|
|
250
274
|
loadingService: LoadingService;
|
|
251
|
-
|
|
275
|
+
flipbookDataService: FlipbookDataService;
|
|
252
276
|
private pdfService;
|
|
253
277
|
themeService: ThemeService;
|
|
278
|
+
private http;
|
|
279
|
+
readonly spIconTags: _solidpepper_solidpepper_icons.SpIcon;
|
|
254
280
|
guid?: string;
|
|
255
281
|
alias?: string;
|
|
256
282
|
type?: string;
|
|
@@ -274,19 +300,28 @@ declare class AppComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
274
300
|
private initializationCount;
|
|
275
301
|
exitEditor: EventEmitter<void>;
|
|
276
302
|
viewerRef: FlipbookViewerComponent;
|
|
277
|
-
isSafari:
|
|
278
|
-
isMobile:
|
|
303
|
+
isSafari: _angular_core.WritableSignal<boolean>;
|
|
304
|
+
isMobile: _angular_core.WritableSignal<boolean>;
|
|
279
305
|
isInitialized: boolean;
|
|
280
306
|
currentPageIndex: number;
|
|
281
307
|
showSidebar: boolean;
|
|
282
308
|
showMap: boolean;
|
|
283
309
|
scale: number;
|
|
284
|
-
showDemoModal:
|
|
285
|
-
showPricingModal:
|
|
286
|
-
isDemoLoading:
|
|
287
|
-
conversionProgress:
|
|
310
|
+
showDemoModal: _angular_core.WritableSignal<boolean>;
|
|
311
|
+
showPricingModal: _angular_core.WritableSignal<boolean>;
|
|
312
|
+
isDemoLoading: _angular_core.WritableSignal<boolean>;
|
|
313
|
+
conversionProgress: _angular_core.WritableSignal<number>;
|
|
288
314
|
private pricingTimer;
|
|
289
|
-
|
|
315
|
+
readonly spIconLock: _solidpepper_solidpepper_icons.SpIcon;
|
|
316
|
+
readonly spIconUser: _solidpepper_solidpepper_icons.SpIcon;
|
|
317
|
+
enteredPassword: _angular_core.WritableSignal<string>;
|
|
318
|
+
authLogin: _angular_core.WritableSignal<string>;
|
|
319
|
+
authPassword: _angular_core.WritableSignal<string>;
|
|
320
|
+
authError: _angular_core.WritableSignal<string | null>;
|
|
321
|
+
isSubmittingAuth: _angular_core.WritableSignal<boolean>;
|
|
322
|
+
constructor(translationService: TranslationService, appParamsService: AppParamsService, loadingService: LoadingService, flipbookDataService: FlipbookDataService, pdfService: PDFService, themeService: ThemeService, http: HttpClient);
|
|
323
|
+
unlockWithPassword(): Promise<void>;
|
|
324
|
+
loginOrganization(): void;
|
|
290
325
|
ngOnInit(): void;
|
|
291
326
|
ngOnDestroy(): void;
|
|
292
327
|
onResize(): void;
|
|
@@ -303,6 +338,7 @@ declare class AppComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
303
338
|
onResetZoom(): void;
|
|
304
339
|
onZoomIn(): void;
|
|
305
340
|
onZoomOut(): void;
|
|
341
|
+
onSetZoom(targetScale: number): void;
|
|
306
342
|
toggleSidebar(): void;
|
|
307
343
|
toggleMap(): void;
|
|
308
344
|
flipStart(): void;
|
|
@@ -310,9 +346,9 @@ declare class AppComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
310
346
|
flipNext(): void;
|
|
311
347
|
flipEnd(): void;
|
|
312
348
|
goToPage(page: number): void;
|
|
313
|
-
static ɵfac:
|
|
314
|
-
static ɵcmp:
|
|
349
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AppComponent, never>;
|
|
350
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AppComponent, "solidpepper-flipbook", never, { "guid": { "alias": "guid"; "required": false; }; "alias": { "alias": "alias"; "required": false; }; "type": { "alias": "type"; "required": false; }; "apiUrl1": { "alias": "apiurl"; "required": false; }; "apiUrl2": { "alias": "api-url"; "required": false; }; "language": { "alias": "language"; "required": false; }; "disableModals": { "alias": "disableModals"; "required": false; }; "interactiveColor": { "alias": "interactiveColor"; "required": false; }; "interactiveColorHyphen": { "alias": "interactive-color"; "required": false; }; "linkColorInput": { "alias": "linkColor"; "required": false; }; "linkColorHyphen": { "alias": "link-color"; "required": false; }; "colorInput": { "alias": "color"; "required": false; }; "isDemo1": { "alias": "isDemo"; "required": false; }; "isDemo2": { "alias": "isdemo"; "required": false; }; "isDemo3": { "alias": "is-demo"; "required": false; }; }, { "exitEditor": "exitEditor"; }, never, never, true, never>;
|
|
315
351
|
}
|
|
316
352
|
|
|
317
353
|
export { AppParamsService, AppComponent as FlipbookComponent, FlipbookDataService };
|
|
318
|
-
export type { AppParams, FlipbookPage, InteractiveData, PageData };
|
|
354
|
+
export type { AppParams, FlipbookPage, FlipbookSpread, InteractiveData, PageData };
|