@solidpepper/solidpepper-soliddesigner 0.3.0 → 0.3.2
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/fesm2022/solidpepper-solidpepper-soliddesigner-iframe-modal.component-C9bBywd4.mjs +618 -0
- package/fesm2022/solidpepper-solidpepper-soliddesigner-iframe-modal.component-C9bBywd4.mjs.map +1 -0
- package/fesm2022/{solidpepper-solidpepper-soliddesigner-image-utils-DvchiNMO.mjs → solidpepper-solidpepper-soliddesigner-image-utils-CAk9N60P.mjs} +2 -2
- package/fesm2022/{solidpepper-solidpepper-soliddesigner-image-utils-DvchiNMO.mjs.map → solidpepper-solidpepper-soliddesigner-image-utils-CAk9N60P.mjs.map} +1 -1
- package/fesm2022/solidpepper-solidpepper-soliddesigner-page-grid-modal.component-CX9XUnS3.mjs +1219 -0
- package/fesm2022/solidpepper-solidpepper-soliddesigner-page-grid-modal.component-CX9XUnS3.mjs.map +1 -0
- package/fesm2022/{solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-DbfRWWk5.mjs → solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-C0NEE_3w.mjs} +4881 -1619
- package/fesm2022/solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-C0NEE_3w.mjs.map +1 -0
- package/fesm2022/solidpepper-solidpepper-soliddesigner.mjs +1 -1
- package/index.d.ts +55 -13
- package/package.json +1 -1
- package/fesm2022/solidpepper-solidpepper-soliddesigner-iframe-modal.component-DRdUzn0b.mjs +0 -152
- package/fesm2022/solidpepper-solidpepper-soliddesigner-iframe-modal.component-DRdUzn0b.mjs.map +0 -1
- package/fesm2022/solidpepper-solidpepper-soliddesigner-page-grid-modal.component-CzgWwiAm.mjs +0 -851
- package/fesm2022/solidpepper-solidpepper-soliddesigner-page-grid-modal.component-CzgWwiAm.mjs.map +0 -1
- package/fesm2022/solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-DbfRWWk5.mjs.map +0 -1
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Input, Component } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import * as i2 from '@angular/forms';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import * as i2$1 from '@ngx-translate/core';
|
|
7
|
+
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
8
|
+
import { M as ModalService, A as AppParamsService, N as NotificationService, B as BasicModalComponent } from './solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-C0NEE_3w.mjs';
|
|
9
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
10
|
+
import { DocumentsService } from '@solidpepper/solidpepper-service';
|
|
11
|
+
import { SpButtonComponent } from '@solidpepper/solidpepper-component';
|
|
12
|
+
import { spIconBookOpen, spIconMessageSquare, spIconCopy, spIconCheck, spIconLock, spIconEye, spIconExternalLink, SpIconComponent } from '@solidpepper/solidpepper-icons';
|
|
13
|
+
|
|
14
|
+
class IframeModalComponent {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.modalService = inject(ModalService);
|
|
17
|
+
this.appParamsService = inject(AppParamsService);
|
|
18
|
+
this.sanitizer = inject(DomSanitizer);
|
|
19
|
+
this.documentsService = inject(DocumentsService);
|
|
20
|
+
this.notificationService = inject(NotificationService);
|
|
21
|
+
this.translate = inject(TranslateService);
|
|
22
|
+
this.moduleType = 'flipbook';
|
|
23
|
+
this.activeTab = 'flipbook';
|
|
24
|
+
this.flipbookAccessMode = 'public';
|
|
25
|
+
this.flipbookIsPassword = false;
|
|
26
|
+
this.flipbookPassword = '';
|
|
27
|
+
this.showFlipbookPassword = false;
|
|
28
|
+
this.reviewerAccessMode = 'public';
|
|
29
|
+
this.reviewerIsPassword = false;
|
|
30
|
+
this.reviewerPassword = '';
|
|
31
|
+
this.showReviewerPassword = false;
|
|
32
|
+
this.isSavingSecurity = false;
|
|
33
|
+
this.copiedLink = false;
|
|
34
|
+
this.copiedLinkPwd = false;
|
|
35
|
+
this.copiedCode = false;
|
|
36
|
+
// Icons
|
|
37
|
+
this.spIconBookOpen = spIconBookOpen;
|
|
38
|
+
this.spIconMessageSquare = spIconMessageSquare;
|
|
39
|
+
this.spIconCopy = spIconCopy;
|
|
40
|
+
this.spIconCheck = spIconCheck;
|
|
41
|
+
this.spIconLock = spIconLock;
|
|
42
|
+
this.spIconEye = spIconEye;
|
|
43
|
+
this.spIconExternalLink = spIconExternalLink;
|
|
44
|
+
this.cachedUrl = '';
|
|
45
|
+
this.cachedSafeUrl = null;
|
|
46
|
+
}
|
|
47
|
+
ngOnInit() {
|
|
48
|
+
this.activeTab = this.moduleType === 'reviewer' ? 'reviewer' : 'flipbook';
|
|
49
|
+
this.loadSecurity();
|
|
50
|
+
}
|
|
51
|
+
get currentLink() {
|
|
52
|
+
return this.getModuleLink(this.activeTab, false);
|
|
53
|
+
}
|
|
54
|
+
get currentLinkWithPassword() {
|
|
55
|
+
return this.getModuleLink(this.activeTab, true);
|
|
56
|
+
}
|
|
57
|
+
get currentSafeUrl() {
|
|
58
|
+
const url = this.currentLink;
|
|
59
|
+
if (url !== this.cachedUrl || !this.cachedSafeUrl) {
|
|
60
|
+
this.cachedUrl = url;
|
|
61
|
+
this.cachedSafeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
|
62
|
+
}
|
|
63
|
+
return this.cachedSafeUrl;
|
|
64
|
+
}
|
|
65
|
+
get currentIframeCode() {
|
|
66
|
+
return `<iframe src="${this.currentLink}" frameborder="0" style="width: 800px; height: 500px;" allowfullscreen></iframe>`;
|
|
67
|
+
}
|
|
68
|
+
setTab(tab) {
|
|
69
|
+
this.activeTab = tab;
|
|
70
|
+
}
|
|
71
|
+
getModuleLink(module, includePassword = false) {
|
|
72
|
+
const guid = this.appParamsService.guid;
|
|
73
|
+
const baseUrl = window.location.origin;
|
|
74
|
+
let url = baseUrl;
|
|
75
|
+
const token = this.appParamsService.token;
|
|
76
|
+
if (token && token.includes('.')) {
|
|
77
|
+
try {
|
|
78
|
+
const base64Payload = token.split('.')[1];
|
|
79
|
+
const decoded = JSON.parse(atob(base64Payload.replace(/-/g, '+').replace(/_/g, '/')));
|
|
80
|
+
if (!baseUrl.includes('localhost')) {
|
|
81
|
+
if (decoded.Alias && decoded.Alias.toLowerCase() !== 'youbooky') {
|
|
82
|
+
url += '/' + decoded.Alias + '/';
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
url += '/';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
url = url.replace(':4201', ':4200') + '/';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
console.error('Erreur de décodage du JWT', e);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
let link = `${url}iframe/module?type=${module}&nightMode=true&documentGuid=${guid}`;
|
|
97
|
+
const isPwd = module === 'flipbook' ? this.flipbookIsPassword : this.reviewerIsPassword;
|
|
98
|
+
const pwd = module === 'flipbook' ? this.flipbookPassword : this.reviewerPassword;
|
|
99
|
+
if (includePassword && isPwd && pwd) {
|
|
100
|
+
link += `&pwd=${encodeURIComponent(pwd)}`;
|
|
101
|
+
}
|
|
102
|
+
return link;
|
|
103
|
+
}
|
|
104
|
+
loadSecurity() {
|
|
105
|
+
const guid = this.appParamsService.guid;
|
|
106
|
+
if (!guid)
|
|
107
|
+
return;
|
|
108
|
+
this.documentsService.getDocumentSecurity(guid).subscribe({
|
|
109
|
+
next: (res) => {
|
|
110
|
+
if (res?.flipbook) {
|
|
111
|
+
this.flipbookAccessMode = res.flipbook.accessMode || 'public';
|
|
112
|
+
this.flipbookIsPassword = !!res.flipbook.isPasswordProtected;
|
|
113
|
+
this.flipbookPassword = res.flipbook.password || '';
|
|
114
|
+
}
|
|
115
|
+
if (res?.reviewer) {
|
|
116
|
+
this.reviewerAccessMode = res.reviewer.accessMode || 'public';
|
|
117
|
+
this.reviewerIsPassword = !!res.reviewer.isPasswordProtected;
|
|
118
|
+
this.reviewerPassword = res.reviewer.password || '';
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
error: (err) => console.warn('Could not load document security settings', err)
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
saveSecurity() {
|
|
125
|
+
const guid = this.appParamsService.guid;
|
|
126
|
+
if (!guid)
|
|
127
|
+
return;
|
|
128
|
+
this.isSavingSecurity = true;
|
|
129
|
+
const payload = {
|
|
130
|
+
flipbook: {
|
|
131
|
+
accessMode: this.flipbookAccessMode,
|
|
132
|
+
password: this.flipbookIsPassword ? this.flipbookPassword : ''
|
|
133
|
+
},
|
|
134
|
+
reviewer: {
|
|
135
|
+
accessMode: this.reviewerAccessMode,
|
|
136
|
+
password: this.reviewerIsPassword ? this.reviewerPassword : ''
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
this.documentsService.updateDocumentSecurity(guid, payload).subscribe({
|
|
140
|
+
next: () => {
|
|
141
|
+
this.isSavingSecurity = false;
|
|
142
|
+
const msg = this.translate.instant('IFRAME_MODAL.SECURITY_SAVED') || 'Paramètres de sécurité enregistrés !';
|
|
143
|
+
this.notificationService.success(msg);
|
|
144
|
+
},
|
|
145
|
+
error: (err) => {
|
|
146
|
+
this.isSavingSecurity = false;
|
|
147
|
+
console.error('Error saving document security', err);
|
|
148
|
+
this.notificationService.error('Erreur lors de la sauvegarde de la sécurité');
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
copyLink(includePassword = false) {
|
|
153
|
+
const text = includePassword ? this.currentLinkWithPassword : this.currentLink;
|
|
154
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
155
|
+
if (includePassword) {
|
|
156
|
+
this.copiedLinkPwd = true;
|
|
157
|
+
setTimeout(() => (this.copiedLinkPwd = false), 2500);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
this.copiedLink = true;
|
|
161
|
+
setTimeout(() => (this.copiedLink = false), 2500);
|
|
162
|
+
}
|
|
163
|
+
this.notificationService.success(this.translate.instant('IFRAME_MODAL.COPY_LINK') + ' !');
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
copyCode() {
|
|
167
|
+
navigator.clipboard.writeText(this.currentIframeCode).then(() => {
|
|
168
|
+
this.copiedCode = true;
|
|
169
|
+
setTimeout(() => (this.copiedCode = false), 2500);
|
|
170
|
+
this.notificationService.success(this.translate.instant('IFRAME_MODAL.COPY_CODE') + ' !');
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
openInNewTab() {
|
|
174
|
+
window.open(this.currentLink, '_blank');
|
|
175
|
+
}
|
|
176
|
+
close() {
|
|
177
|
+
this.modalService.close();
|
|
178
|
+
}
|
|
179
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: IframeModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
180
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: IframeModalComponent, isStandalone: true, selector: "app-iframe-modal", inputs: { moduleType: "moduleType" }, ngImport: i0, template: `
|
|
181
|
+
<app-basic-modal
|
|
182
|
+
[title]="'IFRAME_MODAL.TITLE' | translate"
|
|
183
|
+
[isOpen]="true"
|
|
184
|
+
[showFooter]="false"
|
|
185
|
+
(closeEvent)="close()"
|
|
186
|
+
>
|
|
187
|
+
<div class="flex flex-col gap-4 text-base-content min-w-[700px] max-w-4xl">
|
|
188
|
+
<!-- Module Tabs (Flipbook / SolidReviewer) -->
|
|
189
|
+
<div class="tabs tabs-boxed bg-base-200 p-1 flex items-center justify-between">
|
|
190
|
+
<div class="flex gap-1">
|
|
191
|
+
<button
|
|
192
|
+
type="button"
|
|
193
|
+
class="tab text-xs font-medium transition-all"
|
|
194
|
+
[class.tab-active]="activeTab === 'flipbook'"
|
|
195
|
+
(click)="setTab('flipbook')">
|
|
196
|
+
<sp-icon [icon]="spIconBookOpen" [size]="14" class="mr-1.5"></sp-icon>
|
|
197
|
+
{{ 'IFRAME_MODAL.FLIPBOOK_TAB' | translate }}
|
|
198
|
+
</button>
|
|
199
|
+
<button
|
|
200
|
+
type="button"
|
|
201
|
+
class="tab text-xs font-medium transition-all"
|
|
202
|
+
[class.tab-active]="activeTab === 'reviewer'"
|
|
203
|
+
(click)="setTab('reviewer')">
|
|
204
|
+
<sp-icon [icon]="spIconMessageSquare" [size]="14" class="mr-1.5"></sp-icon>
|
|
205
|
+
{{ 'IFRAME_MODAL.REVIEWER_TAB' | translate }}
|
|
206
|
+
</button>
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<button
|
|
210
|
+
type="button"
|
|
211
|
+
class="btn btn-xs btn-ghost gap-1 text-xs"
|
|
212
|
+
(click)="openInNewTab()">
|
|
213
|
+
<sp-icon [icon]="spIconExternalLink" [size]="13"></sp-icon>
|
|
214
|
+
<span>Ouvrir</span>
|
|
215
|
+
</button>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<div class="flex flex-col md:flex-row gap-5 min-h-[260px]">
|
|
219
|
+
<!-- Left: Preview -->
|
|
220
|
+
<div class="flex-1 border border-base-300 rounded-xl overflow-hidden bg-base-200/50 flex items-center justify-center min-h-[260px]">
|
|
221
|
+
<iframe
|
|
222
|
+
[src]="currentSafeUrl"
|
|
223
|
+
frameborder="0"
|
|
224
|
+
allowfullscreen
|
|
225
|
+
class="w-full h-full min-h-[260px] bg-white rounded-lg shadow-inner">
|
|
226
|
+
</iframe>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<!-- Right: Link + Iframe -->
|
|
230
|
+
<div class="w-full md:w-80 flex flex-col gap-3 justify-between">
|
|
231
|
+
<div class="flex flex-col gap-1.5">
|
|
232
|
+
<label class="text-xs font-semibold text-base-content/80 uppercase tracking-wider">
|
|
233
|
+
{{ 'IFRAME_MODAL.LINK_LABEL' | translate }}
|
|
234
|
+
</label>
|
|
235
|
+
<div class="flex gap-2">
|
|
236
|
+
<input
|
|
237
|
+
type="text"
|
|
238
|
+
[value]="currentLink"
|
|
239
|
+
readonly
|
|
240
|
+
class="input input-sm input-bordered w-full font-mono text-xs bg-base-200" />
|
|
241
|
+
<sp-button
|
|
242
|
+
[variant]="copiedLink ? 'success' : 'primary'"
|
|
243
|
+
size="xs"
|
|
244
|
+
(clicked)="copyLink(false)">
|
|
245
|
+
<sp-icon [icon]="copiedLink ? spIconCheck : spIconCopy" [size]="12"></sp-icon>
|
|
246
|
+
<span>{{ (copiedLink ? 'SHARE.COPIED' : 'IFRAME_MODAL.COPY_LINK') | translate }}</span>
|
|
247
|
+
</sp-button>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
@if ((activeTab === 'flipbook' && flipbookIsPassword && flipbookPassword) || (activeTab === 'reviewer' && reviewerIsPassword && reviewerPassword)) {
|
|
251
|
+
<button
|
|
252
|
+
type="button"
|
|
253
|
+
class="btn btn-xs btn-outline btn-neutral mt-1 w-full gap-1.5 justify-start text-[11px]"
|
|
254
|
+
(click)="copyLink(true)">
|
|
255
|
+
<sp-icon [icon]="spIconLock" [size]="12"></sp-icon>
|
|
256
|
+
<span>{{ 'IFRAME_MODAL.COPY_WITH_PASSWORD' | translate }}</span>
|
|
257
|
+
</button>
|
|
258
|
+
}
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
<div class="flex flex-col gap-1.5">
|
|
262
|
+
<label class="text-xs font-semibold text-base-content/80 uppercase tracking-wider">
|
|
263
|
+
{{ 'IFRAME_MODAL.INTEGRATE' | translate }}
|
|
264
|
+
</label>
|
|
265
|
+
<textarea
|
|
266
|
+
readonly
|
|
267
|
+
rows="3"
|
|
268
|
+
class="textarea textarea-bordered font-mono text-xs bg-base-200 resize-none w-full">{{ currentIframeCode }}</textarea>
|
|
269
|
+
<sp-button
|
|
270
|
+
[variant]="copiedCode ? 'success' : 'primary'"
|
|
271
|
+
size="xs"
|
|
272
|
+
customClass="w-full"
|
|
273
|
+
(clicked)="copyCode()">
|
|
274
|
+
<sp-icon [icon]="copiedCode ? spIconCheck : spIconCopy" [size]="12"></sp-icon>
|
|
275
|
+
<span>{{ (copiedCode ? 'SHARE.COPIED' : 'IFRAME_MODAL.COPY_CODE') | translate }}</span>
|
|
276
|
+
</sp-button>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<!-- Security & Access Section -->
|
|
282
|
+
<div class="p-3.5 rounded-xl bg-base-200/60 border border-base-300">
|
|
283
|
+
<div class="flex items-center justify-between pb-2 mb-2.5 border-b border-base-300/80">
|
|
284
|
+
<div class="flex items-center gap-2">
|
|
285
|
+
<sp-icon [icon]="spIconLock" [size]="14" class="text-primary"></sp-icon>
|
|
286
|
+
<h4 class="font-bold text-xs uppercase tracking-wider">
|
|
287
|
+
{{ 'IFRAME_MODAL.SECURITY_TITLE' | translate }} -
|
|
288
|
+
<span class="text-primary font-semibold">
|
|
289
|
+
{{ (activeTab === 'flipbook' ? 'IFRAME_MODAL.FLIPBOOK_TAB' : 'IFRAME_MODAL.REVIEWER_TAB') | translate }}
|
|
290
|
+
</span>
|
|
291
|
+
</h4>
|
|
292
|
+
</div>
|
|
293
|
+
|
|
294
|
+
<sp-button
|
|
295
|
+
variant="primary"
|
|
296
|
+
size="xs"
|
|
297
|
+
[disabled]="isSavingSecurity"
|
|
298
|
+
(clicked)="saveSecurity()">
|
|
299
|
+
@if (isSavingSecurity) {
|
|
300
|
+
<span class="loading loading-spinner loading-xs"></span>
|
|
301
|
+
} @else {
|
|
302
|
+
<sp-icon [icon]="spIconCheck" [size]="12"></sp-icon>
|
|
303
|
+
}
|
|
304
|
+
<span>{{ 'IFRAME_MODAL.SAVE_SECURITY' | translate }}</span>
|
|
305
|
+
</sp-button>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
@if (activeTab === 'flipbook') {
|
|
309
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 items-center">
|
|
310
|
+
<div>
|
|
311
|
+
<label class="label py-1">
|
|
312
|
+
<span class="label-text text-xs font-medium">{{ 'IFRAME_MODAL.ACCESS_MODE' | translate }}</span>
|
|
313
|
+
</label>
|
|
314
|
+
<select class="select select-bordered select-sm w-full font-medium" [(ngModel)]="flipbookAccessMode">
|
|
315
|
+
<option value="public">{{ 'IFRAME_MODAL.ACCESS_PUBLIC' | translate }}</option>
|
|
316
|
+
<option value="organization">{{ 'IFRAME_MODAL.ACCESS_ORGANIZATION' | translate }}</option>
|
|
317
|
+
</select>
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<div class="flex flex-col gap-1.5">
|
|
321
|
+
<div class="flex items-center justify-between">
|
|
322
|
+
<label class="label cursor-pointer gap-2 py-0">
|
|
323
|
+
<span class="label-text text-xs font-medium">{{ 'IFRAME_MODAL.PASSWORD_PROTECT' | translate }}</span>
|
|
324
|
+
<input type="checkbox" class="toggle toggle-primary toggle-sm" [(ngModel)]="flipbookIsPassword" />
|
|
325
|
+
</label>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
@if (flipbookIsPassword) {
|
|
329
|
+
<div class="join w-full">
|
|
330
|
+
<input
|
|
331
|
+
[type]="showFlipbookPassword ? 'text' : 'password'"
|
|
332
|
+
class="input input-sm input-bordered join-item w-full text-xs font-mono"
|
|
333
|
+
[placeholder]="'IFRAME_MODAL.PASSWORD_PLACEHOLDER' | translate"
|
|
334
|
+
[(ngModel)]="flipbookPassword" />
|
|
335
|
+
<button
|
|
336
|
+
type="button"
|
|
337
|
+
class="btn btn-sm btn-outline join-item"
|
|
338
|
+
(click)="showFlipbookPassword = !showFlipbookPassword">
|
|
339
|
+
<sp-icon [icon]="showFlipbookPassword ? spIconLock : spIconEye" [size]="14"></sp-icon>
|
|
340
|
+
</button>
|
|
341
|
+
</div>
|
|
342
|
+
}
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
@if (activeTab === 'reviewer') {
|
|
348
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 items-center">
|
|
349
|
+
<div>
|
|
350
|
+
<label class="label py-1">
|
|
351
|
+
<span class="label-text text-xs font-medium">{{ 'IFRAME_MODAL.ACCESS_MODE' | translate }}</span>
|
|
352
|
+
</label>
|
|
353
|
+
<select class="select select-bordered select-sm w-full font-medium" [(ngModel)]="reviewerAccessMode">
|
|
354
|
+
<option value="public">{{ 'IFRAME_MODAL.ACCESS_PUBLIC' | translate }}</option>
|
|
355
|
+
<option value="organization">{{ 'IFRAME_MODAL.ACCESS_ORGANIZATION' | translate }}</option>
|
|
356
|
+
</select>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
<div class="flex flex-col gap-1.5">
|
|
360
|
+
<div class="flex items-center justify-between">
|
|
361
|
+
<label class="label cursor-pointer gap-2 py-0">
|
|
362
|
+
<span class="label-text text-xs font-medium">{{ 'IFRAME_MODAL.PASSWORD_PROTECT' | translate }}</span>
|
|
363
|
+
<input type="checkbox" class="toggle toggle-primary toggle-sm" [(ngModel)]="reviewerIsPassword" />
|
|
364
|
+
</label>
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
@if (reviewerIsPassword) {
|
|
368
|
+
<div class="join w-full">
|
|
369
|
+
<input
|
|
370
|
+
[type]="showReviewerPassword ? 'text' : 'password'"
|
|
371
|
+
class="input input-sm input-bordered join-item w-full text-xs font-mono"
|
|
372
|
+
[placeholder]="'IFRAME_MODAL.PASSWORD_PLACEHOLDER' | translate"
|
|
373
|
+
[(ngModel)]="reviewerPassword" />
|
|
374
|
+
<button
|
|
375
|
+
type="button"
|
|
376
|
+
class="btn btn-sm btn-outline join-item"
|
|
377
|
+
(click)="showReviewerPassword = !showReviewerPassword">
|
|
378
|
+
<sp-icon [icon]="showReviewerPassword ? spIconLock : spIconEye" [size]="14"></sp-icon>
|
|
379
|
+
</button>
|
|
380
|
+
</div>
|
|
381
|
+
}
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
}
|
|
385
|
+
</div>
|
|
386
|
+
</div>
|
|
387
|
+
</app-basic-modal>
|
|
388
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: BasicModalComponent, selector: "app-basic-modal", inputs: ["title", "isOpen", "showFooter", "isSubmitDisabled"], outputs: ["closeEvent", "submitEvent"] }, { kind: "component", type: SpButtonComponent, selector: "sp-button", inputs: ["variant", "size", "type", "disabled", "loading", "active", "tooltip", "customClass", "fullWidth", "showTextWhileLoading"], outputs: ["clicked"] }, { kind: "component", type: SpIconComponent, selector: "sp-icon", inputs: ["icon", "name", "size", "color", "fill", "strokeWidth", "class", "ariaLabel"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
|
|
389
|
+
}
|
|
390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: IframeModalComponent, decorators: [{
|
|
391
|
+
type: Component,
|
|
392
|
+
args: [{
|
|
393
|
+
selector: 'app-iframe-modal',
|
|
394
|
+
standalone: true,
|
|
395
|
+
imports: [
|
|
396
|
+
CommonModule,
|
|
397
|
+
FormsModule,
|
|
398
|
+
TranslateModule,
|
|
399
|
+
BasicModalComponent,
|
|
400
|
+
SpButtonComponent,
|
|
401
|
+
SpIconComponent,
|
|
402
|
+
],
|
|
403
|
+
template: `
|
|
404
|
+
<app-basic-modal
|
|
405
|
+
[title]="'IFRAME_MODAL.TITLE' | translate"
|
|
406
|
+
[isOpen]="true"
|
|
407
|
+
[showFooter]="false"
|
|
408
|
+
(closeEvent)="close()"
|
|
409
|
+
>
|
|
410
|
+
<div class="flex flex-col gap-4 text-base-content min-w-[700px] max-w-4xl">
|
|
411
|
+
<!-- Module Tabs (Flipbook / SolidReviewer) -->
|
|
412
|
+
<div class="tabs tabs-boxed bg-base-200 p-1 flex items-center justify-between">
|
|
413
|
+
<div class="flex gap-1">
|
|
414
|
+
<button
|
|
415
|
+
type="button"
|
|
416
|
+
class="tab text-xs font-medium transition-all"
|
|
417
|
+
[class.tab-active]="activeTab === 'flipbook'"
|
|
418
|
+
(click)="setTab('flipbook')">
|
|
419
|
+
<sp-icon [icon]="spIconBookOpen" [size]="14" class="mr-1.5"></sp-icon>
|
|
420
|
+
{{ 'IFRAME_MODAL.FLIPBOOK_TAB' | translate }}
|
|
421
|
+
</button>
|
|
422
|
+
<button
|
|
423
|
+
type="button"
|
|
424
|
+
class="tab text-xs font-medium transition-all"
|
|
425
|
+
[class.tab-active]="activeTab === 'reviewer'"
|
|
426
|
+
(click)="setTab('reviewer')">
|
|
427
|
+
<sp-icon [icon]="spIconMessageSquare" [size]="14" class="mr-1.5"></sp-icon>
|
|
428
|
+
{{ 'IFRAME_MODAL.REVIEWER_TAB' | translate }}
|
|
429
|
+
</button>
|
|
430
|
+
</div>
|
|
431
|
+
|
|
432
|
+
<button
|
|
433
|
+
type="button"
|
|
434
|
+
class="btn btn-xs btn-ghost gap-1 text-xs"
|
|
435
|
+
(click)="openInNewTab()">
|
|
436
|
+
<sp-icon [icon]="spIconExternalLink" [size]="13"></sp-icon>
|
|
437
|
+
<span>Ouvrir</span>
|
|
438
|
+
</button>
|
|
439
|
+
</div>
|
|
440
|
+
|
|
441
|
+
<div class="flex flex-col md:flex-row gap-5 min-h-[260px]">
|
|
442
|
+
<!-- Left: Preview -->
|
|
443
|
+
<div class="flex-1 border border-base-300 rounded-xl overflow-hidden bg-base-200/50 flex items-center justify-center min-h-[260px]">
|
|
444
|
+
<iframe
|
|
445
|
+
[src]="currentSafeUrl"
|
|
446
|
+
frameborder="0"
|
|
447
|
+
allowfullscreen
|
|
448
|
+
class="w-full h-full min-h-[260px] bg-white rounded-lg shadow-inner">
|
|
449
|
+
</iframe>
|
|
450
|
+
</div>
|
|
451
|
+
|
|
452
|
+
<!-- Right: Link + Iframe -->
|
|
453
|
+
<div class="w-full md:w-80 flex flex-col gap-3 justify-between">
|
|
454
|
+
<div class="flex flex-col gap-1.5">
|
|
455
|
+
<label class="text-xs font-semibold text-base-content/80 uppercase tracking-wider">
|
|
456
|
+
{{ 'IFRAME_MODAL.LINK_LABEL' | translate }}
|
|
457
|
+
</label>
|
|
458
|
+
<div class="flex gap-2">
|
|
459
|
+
<input
|
|
460
|
+
type="text"
|
|
461
|
+
[value]="currentLink"
|
|
462
|
+
readonly
|
|
463
|
+
class="input input-sm input-bordered w-full font-mono text-xs bg-base-200" />
|
|
464
|
+
<sp-button
|
|
465
|
+
[variant]="copiedLink ? 'success' : 'primary'"
|
|
466
|
+
size="xs"
|
|
467
|
+
(clicked)="copyLink(false)">
|
|
468
|
+
<sp-icon [icon]="copiedLink ? spIconCheck : spIconCopy" [size]="12"></sp-icon>
|
|
469
|
+
<span>{{ (copiedLink ? 'SHARE.COPIED' : 'IFRAME_MODAL.COPY_LINK') | translate }}</span>
|
|
470
|
+
</sp-button>
|
|
471
|
+
</div>
|
|
472
|
+
|
|
473
|
+
@if ((activeTab === 'flipbook' && flipbookIsPassword && flipbookPassword) || (activeTab === 'reviewer' && reviewerIsPassword && reviewerPassword)) {
|
|
474
|
+
<button
|
|
475
|
+
type="button"
|
|
476
|
+
class="btn btn-xs btn-outline btn-neutral mt-1 w-full gap-1.5 justify-start text-[11px]"
|
|
477
|
+
(click)="copyLink(true)">
|
|
478
|
+
<sp-icon [icon]="spIconLock" [size]="12"></sp-icon>
|
|
479
|
+
<span>{{ 'IFRAME_MODAL.COPY_WITH_PASSWORD' | translate }}</span>
|
|
480
|
+
</button>
|
|
481
|
+
}
|
|
482
|
+
</div>
|
|
483
|
+
|
|
484
|
+
<div class="flex flex-col gap-1.5">
|
|
485
|
+
<label class="text-xs font-semibold text-base-content/80 uppercase tracking-wider">
|
|
486
|
+
{{ 'IFRAME_MODAL.INTEGRATE' | translate }}
|
|
487
|
+
</label>
|
|
488
|
+
<textarea
|
|
489
|
+
readonly
|
|
490
|
+
rows="3"
|
|
491
|
+
class="textarea textarea-bordered font-mono text-xs bg-base-200 resize-none w-full">{{ currentIframeCode }}</textarea>
|
|
492
|
+
<sp-button
|
|
493
|
+
[variant]="copiedCode ? 'success' : 'primary'"
|
|
494
|
+
size="xs"
|
|
495
|
+
customClass="w-full"
|
|
496
|
+
(clicked)="copyCode()">
|
|
497
|
+
<sp-icon [icon]="copiedCode ? spIconCheck : spIconCopy" [size]="12"></sp-icon>
|
|
498
|
+
<span>{{ (copiedCode ? 'SHARE.COPIED' : 'IFRAME_MODAL.COPY_CODE') | translate }}</span>
|
|
499
|
+
</sp-button>
|
|
500
|
+
</div>
|
|
501
|
+
</div>
|
|
502
|
+
</div>
|
|
503
|
+
|
|
504
|
+
<!-- Security & Access Section -->
|
|
505
|
+
<div class="p-3.5 rounded-xl bg-base-200/60 border border-base-300">
|
|
506
|
+
<div class="flex items-center justify-between pb-2 mb-2.5 border-b border-base-300/80">
|
|
507
|
+
<div class="flex items-center gap-2">
|
|
508
|
+
<sp-icon [icon]="spIconLock" [size]="14" class="text-primary"></sp-icon>
|
|
509
|
+
<h4 class="font-bold text-xs uppercase tracking-wider">
|
|
510
|
+
{{ 'IFRAME_MODAL.SECURITY_TITLE' | translate }} -
|
|
511
|
+
<span class="text-primary font-semibold">
|
|
512
|
+
{{ (activeTab === 'flipbook' ? 'IFRAME_MODAL.FLIPBOOK_TAB' : 'IFRAME_MODAL.REVIEWER_TAB') | translate }}
|
|
513
|
+
</span>
|
|
514
|
+
</h4>
|
|
515
|
+
</div>
|
|
516
|
+
|
|
517
|
+
<sp-button
|
|
518
|
+
variant="primary"
|
|
519
|
+
size="xs"
|
|
520
|
+
[disabled]="isSavingSecurity"
|
|
521
|
+
(clicked)="saveSecurity()">
|
|
522
|
+
@if (isSavingSecurity) {
|
|
523
|
+
<span class="loading loading-spinner loading-xs"></span>
|
|
524
|
+
} @else {
|
|
525
|
+
<sp-icon [icon]="spIconCheck" [size]="12"></sp-icon>
|
|
526
|
+
}
|
|
527
|
+
<span>{{ 'IFRAME_MODAL.SAVE_SECURITY' | translate }}</span>
|
|
528
|
+
</sp-button>
|
|
529
|
+
</div>
|
|
530
|
+
|
|
531
|
+
@if (activeTab === 'flipbook') {
|
|
532
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 items-center">
|
|
533
|
+
<div>
|
|
534
|
+
<label class="label py-1">
|
|
535
|
+
<span class="label-text text-xs font-medium">{{ 'IFRAME_MODAL.ACCESS_MODE' | translate }}</span>
|
|
536
|
+
</label>
|
|
537
|
+
<select class="select select-bordered select-sm w-full font-medium" [(ngModel)]="flipbookAccessMode">
|
|
538
|
+
<option value="public">{{ 'IFRAME_MODAL.ACCESS_PUBLIC' | translate }}</option>
|
|
539
|
+
<option value="organization">{{ 'IFRAME_MODAL.ACCESS_ORGANIZATION' | translate }}</option>
|
|
540
|
+
</select>
|
|
541
|
+
</div>
|
|
542
|
+
|
|
543
|
+
<div class="flex flex-col gap-1.5">
|
|
544
|
+
<div class="flex items-center justify-between">
|
|
545
|
+
<label class="label cursor-pointer gap-2 py-0">
|
|
546
|
+
<span class="label-text text-xs font-medium">{{ 'IFRAME_MODAL.PASSWORD_PROTECT' | translate }}</span>
|
|
547
|
+
<input type="checkbox" class="toggle toggle-primary toggle-sm" [(ngModel)]="flipbookIsPassword" />
|
|
548
|
+
</label>
|
|
549
|
+
</div>
|
|
550
|
+
|
|
551
|
+
@if (flipbookIsPassword) {
|
|
552
|
+
<div class="join w-full">
|
|
553
|
+
<input
|
|
554
|
+
[type]="showFlipbookPassword ? 'text' : 'password'"
|
|
555
|
+
class="input input-sm input-bordered join-item w-full text-xs font-mono"
|
|
556
|
+
[placeholder]="'IFRAME_MODAL.PASSWORD_PLACEHOLDER' | translate"
|
|
557
|
+
[(ngModel)]="flipbookPassword" />
|
|
558
|
+
<button
|
|
559
|
+
type="button"
|
|
560
|
+
class="btn btn-sm btn-outline join-item"
|
|
561
|
+
(click)="showFlipbookPassword = !showFlipbookPassword">
|
|
562
|
+
<sp-icon [icon]="showFlipbookPassword ? spIconLock : spIconEye" [size]="14"></sp-icon>
|
|
563
|
+
</button>
|
|
564
|
+
</div>
|
|
565
|
+
}
|
|
566
|
+
</div>
|
|
567
|
+
</div>
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
@if (activeTab === 'reviewer') {
|
|
571
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 items-center">
|
|
572
|
+
<div>
|
|
573
|
+
<label class="label py-1">
|
|
574
|
+
<span class="label-text text-xs font-medium">{{ 'IFRAME_MODAL.ACCESS_MODE' | translate }}</span>
|
|
575
|
+
</label>
|
|
576
|
+
<select class="select select-bordered select-sm w-full font-medium" [(ngModel)]="reviewerAccessMode">
|
|
577
|
+
<option value="public">{{ 'IFRAME_MODAL.ACCESS_PUBLIC' | translate }}</option>
|
|
578
|
+
<option value="organization">{{ 'IFRAME_MODAL.ACCESS_ORGANIZATION' | translate }}</option>
|
|
579
|
+
</select>
|
|
580
|
+
</div>
|
|
581
|
+
|
|
582
|
+
<div class="flex flex-col gap-1.5">
|
|
583
|
+
<div class="flex items-center justify-between">
|
|
584
|
+
<label class="label cursor-pointer gap-2 py-0">
|
|
585
|
+
<span class="label-text text-xs font-medium">{{ 'IFRAME_MODAL.PASSWORD_PROTECT' | translate }}</span>
|
|
586
|
+
<input type="checkbox" class="toggle toggle-primary toggle-sm" [(ngModel)]="reviewerIsPassword" />
|
|
587
|
+
</label>
|
|
588
|
+
</div>
|
|
589
|
+
|
|
590
|
+
@if (reviewerIsPassword) {
|
|
591
|
+
<div class="join w-full">
|
|
592
|
+
<input
|
|
593
|
+
[type]="showReviewerPassword ? 'text' : 'password'"
|
|
594
|
+
class="input input-sm input-bordered join-item w-full text-xs font-mono"
|
|
595
|
+
[placeholder]="'IFRAME_MODAL.PASSWORD_PLACEHOLDER' | translate"
|
|
596
|
+
[(ngModel)]="reviewerPassword" />
|
|
597
|
+
<button
|
|
598
|
+
type="button"
|
|
599
|
+
class="btn btn-sm btn-outline join-item"
|
|
600
|
+
(click)="showReviewerPassword = !showReviewerPassword">
|
|
601
|
+
<sp-icon [icon]="showReviewerPassword ? spIconLock : spIconEye" [size]="14"></sp-icon>
|
|
602
|
+
</button>
|
|
603
|
+
</div>
|
|
604
|
+
}
|
|
605
|
+
</div>
|
|
606
|
+
</div>
|
|
607
|
+
}
|
|
608
|
+
</div>
|
|
609
|
+
</div>
|
|
610
|
+
</app-basic-modal>
|
|
611
|
+
`
|
|
612
|
+
}]
|
|
613
|
+
}], propDecorators: { moduleType: [{
|
|
614
|
+
type: Input
|
|
615
|
+
}] } });
|
|
616
|
+
|
|
617
|
+
export { IframeModalComponent };
|
|
618
|
+
//# sourceMappingURL=solidpepper-solidpepper-soliddesigner-iframe-modal.component-C9bBywd4.mjs.map
|