soliddesigner 0.1.4 → 0.1.31

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/README.md CHANGED
@@ -25,7 +25,6 @@ Le projet a pour vocation d'être packagé et réutilisable. Pour préparer une
25
25
  Compilez l'application Angular pour la production.
26
26
  ```shell
27
27
  npm run build
28
- ng build --configuration production
29
28
  ```
30
29
  *Les fichiers compilés se placeront dans le dossier `dist/soliddesigner/browser/` (qui est ciblé par le champ "files" et "main" du `package.json`).*
31
30
 
@@ -41,13 +41,7 @@
41
41
  "PICTO_SIZE": "Picto Size",
42
42
  "DELETE_LINE_EMPTY": "Delete line if empty",
43
43
  "DELETE_BLOCK_EMPTY": "Delete block if empty",
44
- "DOESNT_EXIST": "This attribute doesn't exist!",
45
- "TEXT_TRANSFORM": "Text Format",
46
- "TEXT_TRANSFORM_NORMAL": "Normal",
47
- "TEXT_TRANSFORM_UPPERCASE": "Uppercase",
48
- "TEXT_TRANSFORM_LOWERCASE": "Lowercase",
49
- "TEXT_TRANSFORM_CAPITALIZE": "Capitalize each word",
50
- "TEXT_TRANSFORM_FIRST_LETTER": "Capitalize first letter"
44
+ "DOESNT_EXIST": "This attribute doesn't exist!"
51
45
  },
52
46
  "TABLE": {
53
47
  "TITLE": "Table",
@@ -141,7 +135,6 @@
141
135
  }
142
136
  },
143
137
  "ERROR": "Error",
144
- "WARNING": "Warning",
145
138
  "PROPERTIES": {
146
139
  "CANVAS": {
147
140
  "SIZE": "Size",
@@ -259,26 +252,11 @@
259
252
  "IMAGE": {
260
253
  "TITLE": "Image Settings",
261
254
  "TRANSFORM_DYNAMIC": "Return to dynamic image",
262
- "HD_URL": "HD Image Link",
263
- "CROP": "Crop image",
264
- "EDITOR": "Edit Image",
265
- "EDITOR_TITLE": "Image Editor",
266
- "TAB_CROP": "Crop",
267
- "TAB_FILTERS": "Filters",
268
- "ROTATION": "Rotation",
269
- "CROP_HINT": "Adjust the crop frame or apply filters",
270
- "PASTE": {
271
- "TITLE": "Large Image Detected",
272
- "MESSAGE": "The image you are pasting exceeds the canvas size ({{width}}x{{height}}). Do you want to reduce it or keep its original size?",
273
- "KEEP_ORIGINAL": "Original Size",
274
- "REDUCE": "Reduce"
275
- }
255
+ "HD_URL": "HD Image Link"
276
256
  },
277
257
  "DYNAMIC_IMAGE": {
278
258
  "TITLE": "Dynamic Image",
279
259
  "TRANSFORM_STATIC": "Transform into static image",
280
- "IMPORT_FROM_DEVICE": "Import from device",
281
- "SELECT_ASSET": "Select an asset",
282
260
  "DATA_FIELD": "Data Field",
283
261
  "IMAGE_NUMBER": "Image n°"
284
262
  },
@@ -438,8 +416,7 @@
438
416
  "SET_DIMENSION": "Set Dimension",
439
417
  "DIMENSION_AUTO": "Auto",
440
418
  "DIMENSION_CUSTOM": "Custom",
441
- "DIMENSION_VALUE": "Value",
442
- "LOCK_WIDTH": "Lock table width"
419
+ "DIMENSION_VALUE": "Value"
443
420
  },
444
421
  "BACKGROUND_PREVIEW": {
445
422
  "TITLE": "Background",
@@ -471,12 +448,6 @@
471
448
  },
472
449
  "SHARE": {
473
450
  "TITLE": "Share",
474
- "COLOR_PROFILE": "Color Profile",
475
- "COLOR_PROFILE_RGB": "RGB (Standard)",
476
- "COLOR_PROFILE_CMYK": "CMYK (Original images)",
477
- "COLOR_PROFILE_CMYK_FULL": "CMYK (Full conversion)",
478
- "COLOR_PROFILE_CMYK_HINT": ".tiff files with transparency will lose their transparency.",
479
- "COLOR_PROFILE_CMYK_FULL_HINT": "All images with transparency will lose their transparency.",
480
451
  "GENERATE_PDF": "Generate PDF",
481
452
  "PREVIEW": "Preview",
482
453
  "DOWNLOAD_SD": "Download (SD)",
@@ -515,16 +486,7 @@
515
486
  },
516
487
  "ERRORS": {
517
488
  "DOCUMENT": "Could not retrieve the document.",
518
- "PAGE": "Error while opening the page.",
519
489
  "TOKEN": "No token provided, please provide a valid token."
520
490
  }
521
- },
522
- "CLIPBOARD": {
523
- "IMAGE_TOO_LARGE": "Image is too large (maximum {{size}} MB)."
524
- },
525
- "BROWSER_NOT_SUPPORTED": {
526
- "TITLE": "Browser not supported",
527
- "MESSAGE": "SolidDesigner is not yet available on Safari.",
528
- "SUGGESTION": "Please use Chrome or Firefox for the best experience."
529
491
  }
530
- }
492
+ }
@@ -41,13 +41,7 @@
41
41
  "PICTO_SIZE": "Tamaño del icono",
42
42
  "DELETE_LINE_EMPTY": "Eliminar línea si está vacía",
43
43
  "DELETE_BLOCK_EMPTY": "Eliminar bloque si está vacío",
44
- "DOESNT_EXIST": "¡Este atributo no existe!",
45
- "TEXT_TRANSFORM": "Formato de texto",
46
- "TEXT_TRANSFORM_NORMAL": "Normal",
47
- "TEXT_TRANSFORM_UPPERCASE": "Mayúsculas",
48
- "TEXT_TRANSFORM_LOWERCASE": "Minúsculas",
49
- "TEXT_TRANSFORM_CAPITALIZE": "Mayúscula en cada palabra",
50
- "TEXT_TRANSFORM_FIRST_LETTER": "Mayúscula al principio"
44
+ "DOESNT_EXIST": "¡Este atributo no existe!"
51
45
  },
52
46
  "TABLE": {
53
47
  "TITLE": "Tabla",
@@ -135,7 +129,6 @@
135
129
  }
136
130
  },
137
131
  "ERROR": "Error",
138
- "WARNING": "Advertencia",
139
132
  "PROPERTIES": {
140
133
  "CANVAS": {
141
134
  "SIZE": "Tamaño",
@@ -253,26 +246,11 @@
253
246
  "IMAGE": {
254
247
  "TITLE": "Configuración de imagen",
255
248
  "TRANSFORM_DYNAMIC": "Volver a imagen dinámica",
256
- "HD_URL": "Enlace a imagen HD",
257
- "CROP": "Recortar imagen",
258
- "EDITOR": "Editar imagen",
259
- "EDITOR_TITLE": "Editor de imagen",
260
- "TAB_CROP": "Recorte",
261
- "TAB_FILTERS": "Filtros",
262
- "ROTATION": "Rotación",
263
- "CROP_HINT": "Ajusta el marco de recorte o aplica filtros",
264
- "PASTE": {
265
- "TITLE": "Imagen grande detectada",
266
- "MESSAGE": "La imagen que estás pegando excede el tamaño del lienzo ({{width}}x{{height}}). ¿Deseas reducirla o mantener su tamaño original?",
267
- "KEEP_ORIGINAL": "Tamaño original",
268
- "REDUCE": "Reducir"
269
- }
249
+ "HD_URL": "Enlace a imagen HD"
270
250
  },
271
251
  "DYNAMIC_IMAGE": {
272
252
  "TITLE": "Imagen dinámica",
273
253
  "TRANSFORM_STATIC": "Transformar en imagen estática",
274
- "IMPORT_FROM_DEVICE": "Importar desde el dispositivo",
275
- "SELECT_ASSET": "Seleccionar un asset",
276
254
  "IMAGE_NUMBER": "Número de imagen"
277
255
  },
278
256
  "FILL": {
@@ -431,8 +409,7 @@
431
409
  "SET_DIMENSION": "Establecer dimensión",
432
410
  "DIMENSION_AUTO": "Automático",
433
411
  "DIMENSION_CUSTOM": "Personalizado",
434
- "DIMENSION_VALUE": "Valor",
435
- "LOCK_WIDTH": "Bloquear ancho de la tabla"
412
+ "DIMENSION_VALUE": "Valor"
436
413
  },
437
414
  "BACKGROUND_PREVIEW": {
438
415
  "TITLE": "Fondos",
@@ -464,12 +441,6 @@
464
441
  },
465
442
  "SHARE": {
466
443
  "TITLE": "Compartir",
467
- "COLOR_PROFILE": "Perfil de color",
468
- "COLOR_PROFILE_RGB": "RGB (Estándar)",
469
- "COLOR_PROFILE_CMYK": "CMYK (Imágenes de origen)",
470
- "COLOR_PROFILE_CMYK_FULL": "CMYK (Conversión completa)",
471
- "COLOR_PROFILE_CMYK_HINT": "Los archivos .tiff con transparencia perderán su transparencia.",
472
- "COLOR_PROFILE_CMYK_FULL_HINT": "Todas las imágenes con transparencia perderán su transparencia.",
473
444
  "GENERATE_PDF": "Generar PDF",
474
445
  "PREVIEW": "Vista previa",
475
446
  "DOWNLOAD_SD": "Descargar (SD)",
@@ -508,16 +479,7 @@
508
479
  },
509
480
  "ERRORS": {
510
481
  "DOCUMENT": "No se pudo recuperar el documento.",
511
- "PAGE": "Error al abrir la página.",
512
482
  "TOKEN": "No se proporcionó ningún token, por favor proporcione un token válido."
513
483
  }
514
- },
515
- "CLIPBOARD": {
516
- "IMAGE_TOO_LARGE": "La imagen es demasiado grande (máximo {{size}} MB)."
517
- },
518
- "BROWSER_NOT_SUPPORTED": {
519
- "TITLE": "Navegador no soportado",
520
- "MESSAGE": "SolidDesigner aún no está disponible en Safari.",
521
- "SUGGESTION": "Por favor, utiliza Chrome o Firefox para la mejor experiencia."
522
484
  }
523
- }
485
+ }
@@ -41,13 +41,7 @@
41
41
  "PICTO_SIZE": "Taille du pictogramme",
42
42
  "DELETE_LINE_EMPTY": "Supprimer la ligne si vide",
43
43
  "DELETE_BLOCK_EMPTY": "Supprimer le bloc si vide",
44
- "DOESNT_EXIST": "Cet attribut n'existe pas !",
45
- "TEXT_TRANSFORM": "Format texte",
46
- "TEXT_TRANSFORM_NORMAL": "Normal",
47
- "TEXT_TRANSFORM_UPPERCASE": "Majuscules",
48
- "TEXT_TRANSFORM_LOWERCASE": "Minuscules",
49
- "TEXT_TRANSFORM_CAPITALIZE": "Majuscule à chaque mot",
50
- "TEXT_TRANSFORM_FIRST_LETTER": "Majuscule au début"
44
+ "DOESNT_EXIST": "Cet attribut n'existe pas !"
51
45
  },
52
46
  "TABLE": {
53
47
  "TITLE": "Tableau",
@@ -140,7 +134,6 @@
140
134
  }
141
135
  },
142
136
  "ERROR": "Erreur",
143
- "WARNING": "Attention",
144
137
  "PROPERTIES": {
145
138
  "CANVAS": {
146
139
  "SIZE": "Taille",
@@ -258,26 +251,11 @@
258
251
  "IMAGE": {
259
252
  "TITLE": "Paramètres de l'image",
260
253
  "TRANSFORM_DYNAMIC": "Revenir en image dynamique",
261
- "HD_URL": "Lien vers image HD",
262
- "CROP": "Rogner l'image",
263
- "EDITOR": "Éditer l'image",
264
- "EDITOR_TITLE": "Édition de l'image",
265
- "TAB_CROP": "Recadrage",
266
- "TAB_FILTERS": "Filtres",
267
- "ROTATION": "Rotation",
268
- "CROP_HINT": "Ajustez le cadre de rognage ou appliquez des filtres",
269
- "PASTE": {
270
- "TITLE": "Grande image détectée",
271
- "MESSAGE": "L'image que vous collez dépasse la taille du canvas ({{width}}x{{height}}). Souhaitez-vous la réduire ou conserver sa taille originale ?",
272
- "KEEP_ORIGINAL": "Taille originale",
273
- "REDUCE": "Réduire"
274
- }
254
+ "HD_URL": "Lien vers image HD"
275
255
  },
276
256
  "DYNAMIC_IMAGE": {
277
257
  "TITLE": "Image dynamique",
278
258
  "TRANSFORM_STATIC": "Transformer en image statique",
279
- "IMPORT_FROM_DEVICE": "Importer depuis l'appareil (max 1mo)",
280
- "SELECT_ASSET": "Sélectionner un asset",
281
259
  "DATA_FIELD": "Champ de données",
282
260
  "IMAGE_NUMBER": "Numéro de l'image"
283
261
  },
@@ -437,8 +415,7 @@
437
415
  "SET_DIMENSION": "Définir la dimension",
438
416
  "DIMENSION_AUTO": "Automatique",
439
417
  "DIMENSION_CUSTOM": "Personnalisé",
440
- "DIMENSION_VALUE": "Valeur",
441
- "LOCK_WIDTH": "Verrouiller la largeur du tableau"
418
+ "DIMENSION_VALUE": "Valeur"
442
419
  },
443
420
  "BACKGROUND_PREVIEW": {
444
421
  "TITLE": "Arrière-plan",
@@ -470,12 +447,6 @@
470
447
  },
471
448
  "SHARE": {
472
449
  "TITLE": "Partager",
473
- "COLOR_PROFILE": "Profil de couleur",
474
- "COLOR_PROFILE_RGB": "RGB (Standard)",
475
- "COLOR_PROFILE_CMYK": "CMYK (Images d’origine)",
476
- "COLOR_PROFILE_CMYK_FULL": "CMYK (Conversion complète)",
477
- "COLOR_PROFILE_CMYK_HINT": "Les fichiers .tiff avec transparence perdront leur transparence.",
478
- "COLOR_PROFILE_CMYK_FULL_HINT": "Toutes les images avec transparence perdront leur transparence.",
479
450
  "GENERATE_PDF": "Générer un PDF",
480
451
  "PREVIEW": "Aperçu",
481
452
  "DOWNLOAD_SD": "Télécharger (SD)",
@@ -514,16 +485,7 @@
514
485
  },
515
486
  "ERRORS": {
516
487
  "DOCUMENT": "Impossible de récupérer le document.",
517
- "PAGE": "Erreur lors de l'ouverture de la page.",
518
488
  "TOKEN": "Aucun jeton fourni, veuillez fournir un jeton valide."
519
489
  }
520
- },
521
- "CLIPBOARD": {
522
- "IMAGE_TOO_LARGE": "L'image est trop volumineuse (maximum {{size}} Mo)."
523
- },
524
- "BROWSER_NOT_SUPPORTED": {
525
- "TITLE": "Navigateur non supporté",
526
- "MESSAGE": "SolidDesigner n'est pas encore disponible sur Safari.",
527
- "SUGGESTION": "Veuillez utiliser Chrome ou Firefox pour une expérience optimale."
528
490
  }
529
- }
491
+ }
@@ -0,0 +1 @@
1
+ import{A as S,E as X,I as W,R as Y,T as I,U as q,V as J,m as k,y as R}from"./chunk-T55JQPIL.js";import{$a as V,Bb as x,Ec as N,Fd as C,Lf as c,Nd as y,Nf as l,Oi as M,Pc as d,Ri as b,Ve as _,Xe as H,Za as p,_a as m,a as E,b as L,bb as B,ch as $,dh as j,if as w,kf as F,lf as U,mf as A,nf as o,of as s,pb as h,pf as u,tf as z,xa as g,yg as f,zg as v}from"./chunk-B3PWEOJU.js";var D=class a{index;imageUrl;isCurrent=!1;selectPage=new h;dragStarted=new h;dropped=new h;contextMenuEvent=new h;dragOver=!1;dropSide=null;saveService=g(I);cacheBuster="";constructor(){b(()=>{let e=this.saveService.saveSuccessPulse(),t=typeof e=="object"?e.count:e;this.isCurrent&&t>0&&(this.cacheBuster=`t=${t}`)})}get displayImageUrl(){if(!this.cacheBuster||!this.imageUrl)return this.imageUrl;let e=this.imageUrl.includes("?")?"&":"?";return`${this.imageUrl}${e}${this.cacheBuster}`}onDragStart(e){this.dragStarted.emit(this.index),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")}onDragOver(e){e.preventDefault(),this.dragOver=!0;let t=e.currentTarget.getBoundingClientRect(),i=t.left+t.width/2;this.dropSide=e.clientX<i?"before":"after"}onDrop(e){e.preventDefault(),this.dropSide&&this.dropped.emit({targetIndex:this.index,side:this.dropSide}),this.onDragEnd()}onDragLeave(){this.dragOver=!1,this.dropSide=null}onDragEnd(){this.dragOver=!1,this.dropSide=null}onContextMenu(e){e.preventDefault(),this.contextMenuEvent.emit({event:e,index:this.index})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=C({type:a,selectors:[["app-page-grid-item"]],inputs:{index:"index",imageUrl:"imageUrl",isCurrent:"isCurrent"},outputs:{selectPage:"selectPage",dragStarted:"dragStarted",dropped:"dropped",contextMenuEvent:"contextMenuEvent"},decls:4,vars:8,consts:[["draggable","true",1,"page-grid-item",3,"dragstart","dragover","dragleave","drop","dragend","click","contextmenu"],["alt","Page Thumbnail","loading","lazy",1,"page-image",3,"src"],[1,"page-number"]],template:function(t,i){t&1&&(o(0,"div",0),c("dragstart",function(r){return i.onDragStart(r)})("dragover",function(r){return i.onDragOver(r)})("dragleave",function(){return i.onDragLeave()})("drop",function(r){return i.onDrop(r)})("dragend",function(){return i.onDragEnd()})("click",function(){return i.selectPage.emit(i.index)})("contextmenu",function(r){return i.onContextMenu(r)}),u(1,"img",1),o(2,"span",2),f(3),s()()),t&2&&(H("current",i.isCurrent)("drag-before",i.dragOver&&i.dropSide==="before")("drag-after",i.dragOver&&i.dropSide==="after"),d(),_("src",i.displayImageUrl,N),d(2),v(i.index+1))},dependencies:[k,S],styles:[`[_nghost-%COMP%]{display:block}.page-grid-item[_ngcontent-%COMP%]{background-color:var(--gray-4);border-radius:var(--radius-xs);padding:var(--spacing-xs);display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:1px solid var(--gray-3);align-items:center;cursor:move;margin:0;position:relative;transition:transform .2s,background-color .2s;box-sizing:border-box}.page-grid-item[_ngcontent-%COMP%]:hover{transform:scale(1.05);background-color:var(--gray-3)}.page-grid-item.current[_ngcontent-%COMP%]{border-color:var(--active)}.page-image[_ngcontent-%COMP%]{background-color:#fff;border-radius:0;pointer-events:none;height:calc(100% - 2 * var(--spacing-xs) - 15px);width:auto;max-width:100%;object-fit:contain}.page-number[_ngcontent-%COMP%]{font-size:10px;color:var(--white)}.page-grid-item[_ngcontent-%COMP%]:before, .page-grid-item[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;width:4px;background:var(--active);z-index:100;opacity:0;transition:opacity .2s;border-radius:2px}.page-grid-item.drag-before[_ngcontent-%COMP%]:before{left:-4px;opacity:1}.page-grid-item.drag-after[_ngcontent-%COMP%]:after{right:-4px;opacity:1}[_nghost-%COMP%]:nth-child(odd) .page-grid-item[_ngcontent-%COMP%]{margin:0!important;border-right:0!important;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:2px 0 5px #0003}[_nghost-%COMP%]:nth-child(odd) .page-image[_ngcontent-%COMP%]{margin-left:auto;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3e %3cline x1='100%25' y1='0' x2='100%25' y2='20' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='26' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='34' x2='100%25' y2='54' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='60' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='68' x2='100%25' y2='88' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='64' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='102' x2='100%25' y2='122' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='128' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='136' x2='100%25' y2='156' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='162' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='170' x2='100%25' y2='190' stroke='%234f4f59' stroke-width='1.5'/%3e %3cline x1='0' y1='0' x2='100%25' y2='0' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='0' x2='0' y2='100%25' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='100%25' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3c/svg%3e");border-right:0}[_nghost-%COMP%]:nth-child(2n) .page-grid-item[_ngcontent-%COMP%]{margin:0!important;border-left:0!important;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:-2px 0 5px #0003}[_nghost-%COMP%]:nth-child(2n) .page-image[_ngcontent-%COMP%]{margin-right:auto;background-image:url("data:image/svg+xml, %3csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3e %3cline x1='0' y1='0' x2='0' y2='20' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='26' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='34' x2='0' y2='54' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='60' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='68' x2='0' y2='88' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='94' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='102' x2='0' y2='122' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='128' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='136' x2='0' y2='156' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='162' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='170' x2='0' y2='190' stroke='%234f4f59' stroke-width='1.5'/%3e %3cline x1='0' y1='0' x2='100%25' y2='0' stroke='black' stroke-width='2'/%3e %3cline x1='100%25' y1='0' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='100%25' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3c/svg%3e");border-left:0}`]})};function ne(a,e){a&1&&u(0,"div",26)}function re(a,e){if(a&1){let t=z();o(0,"app-page-grid-item",28),c("selectPage",function(n){p(t);let r=l(3);return m(r.goToPage(n))})("dragStarted",function(n){p(t);let r=l(3);return m(r.onDragStart(n))})("dropped",function(n){p(t);let r=l(3);return m(r.onDrop(n))})("contextMenuEvent",function(n){p(t);let r=l(3);return m(r.onPageContextMenu(n))}),s()}if(a&2){let t=l().$implicit,i=l(2);_("index",t.index)("imageUrl",i.pageImageUrls()[t.index])("isCurrent",t.index===i.currentPageIndex())}}function ae(a,e){if(a&1&&y(0,ne,1,0,"div",26)(1,re,1,3,"app-page-grid-item",27),a&2){let t=e.$implicit;w(t.isFake?0:1)}}function oe(a,e){if(a&1&&(o(0,"div",17),U(1,ae,2,1,null,null,F),s()),a&2){let t=e.$implicit;d(),A(t)}}function se(a,e){a&1&&(o(0,"div",24),u(1,"div",29),s())}function de(a,e){if(a&1){let t=z();o(0,"app-confirm-delete-modal",30),c("confirm",function(){p(t);let n=l();return m(n.confirmDelete())})("cancel",function(){p(t);let n=l();return m(n.cancelDelete())}),s()}}var K=class a{appParams=g(X);assetsService=g(Y);modalService=g(W);saveService=g(I);onPageSelect;isLoading=x(!1);pages=x([]);currentPageIndex=M(()=>{let e=this.appParams.pageGuid();return this.pages().findIndex(i=>i.documentPageGuid===e)});pageSpreads=M(()=>{let e=this.pages(),t=[{isFake:!0}];e.forEach((n,r)=>{t.push(L(E({},n),{index:r}))});let i=[];for(let n=0;n<t.length;n+=2)i.push(t.slice(n,n+2));return i});pageCacheBusters=x({});sessionBuster=`s=${Date.now()}`;pageImageUrls=M(()=>{let e=this.pageCacheBusters();return this.pages().map(t=>{let i=t.publicationTemplateUrl;if(!i)return"";let n=t.documentPageGuid,r=e[n]||this.sessionBuster,P=i.includes("?")?"&":"?";return`${i}${P}${r}`})});dragSourceIndex=null;contextMenuVisible=!1;contextMenuPosition={x:0,y:0};contextMenuPageIndex=null;showDeleteConfirm=x(!1);deleteIndex=null;constructor(){b(()=>{let t=this.appParams.params().documentData;t&&Array.isArray(t)&&this.pages.set([...t])}),b(()=>{let e=this.saveService.saveSuccessPulse(),t=typeof e=="object"?e.count:e,i=this.pages()[this.currentPageIndex()];if(i&&t>0){let n=i.documentPageGuid;this.pageCacheBusters.update(r=>L(E({},r),{[n]:`t=${t}`}))}})}ngOnInit(){}addPage(){let e=this.appParams.guid;e&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(e).subscribe(t=>{t?this.refreshPages():this.isLoading.set(!1)}))}addPageBefore(e){let t=this.appParams.guid;t&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(t,e+1).subscribe(i=>{i?this.refreshPages():this.isLoading.set(!1)}))}addPageAfter(e){let t=this.appParams.guid;t&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(t,e+2).subscribe(i=>{i?this.refreshPages():this.isLoading.set(!1)}))}duplicatePage(e){let t=this.appParams.guid,i=this.pages()[e];!t||!i||(this.isLoading.set(!0),this.assetsService.duplicateDocumentPage(t,i.documentPageGuid).subscribe(n=>{n?this.refreshPages():this.isLoading.set(!1)}))}deletePage(e){this.deleteIndex=e,this.showDeleteConfirm.set(!0)}confirmDelete(){if(this.deleteIndex===null)return;let e=this.deleteIndex,t=this.pages()[e],i=this.appParams.guid;if(!i||!t){this.cancelDelete();return}this.isLoading.set(!0),this.assetsService.deleteDocumentPage(i,t.documentPageGuid).subscribe(n=>{n?this.refreshPages():this.isLoading.set(!1)}),this.cancelDelete()}cancelDelete(){this.showDeleteConfirm.set(!1),this.deleteIndex=null}refreshPages(){let e=this.appParams.guid;e&&this.assetsService.getSVGDocumentPages(e).subscribe(t=>{t&&t.template&&this.appParams.setParams({documentData:[...t.template]}),this.isLoading.set(!1)})}close(){this.modalService.close()}goToPage(e){this.onPageSelect&&this.onPageSelect(e),this.close()}onDragStart(e){this.dragSourceIndex=e}onDrop(e){if(this.dragSourceIndex===null)return;let t=this.dragSourceIndex,i=e.targetIndex;if(e.side==="after"&&i++,i===t||i===t+1){this.dragSourceIndex=null;return}let n=this.appParams.guid;if(!n)return;let r=this.pages(),P=r[t];if(!P)return;let Q=P.documentPageGuid,O=i;t<i&&O--;let Z=O+1;this.pages.update(G=>{let T=[...G],[ee]=T.splice(t,1);return T.splice(O,0,ee),T}),this.assetsService.moveDocumentPage(n,Q,Z).subscribe({next:G=>{G||this.pages.set(r)},error:()=>{this.pages.set(r)}}),this.dragSourceIndex=null}onPageContextMenu(e){this.contextMenuPosition={x:e.event.clientX,y:e.event.clientY},this.contextMenuPageIndex=e.index,this.contextMenuVisible=!0}onContextMenuAction(e){switch(e.action){case"open":this.goToPage(e.index);break;case"insert-before":this.addPageBefore(e.index);break;case"insert-after":this.addPageAfter(e.index);break;case"duplicate":this.duplicatePage(e.index);break;case"delete":this.deletePage(e.index);break}this.contextMenuVisible=!1}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=C({type:a,selectors:[["app-page-grid-modal"]],inputs:{onPageSelect:"onPageSelect"},decls:33,vars:12,consts:[["id","page-grid-backdrop",3,"click"],["id","page-grid",3,"click"],["id","page-grid-title"],["id","icon-page-grid",1,"icon"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["x","3","y","3","width","5","height","5","fill","var(--white)"],["x","9.5","y","3","width","5","height","5","fill","var(--white)"],["x","16","y","3","width","5","height","5","fill","var(--white)"],["x","3","y","9.5","width","5","height","5","fill","var(--white)"],["x","9.5","y","9.5","width","5","height","5","fill","var(--white)"],["x","16","y","9.5","width","5","height","5","fill","var(--white)"],["x","3","y","16","width","5","height","5","fill","var(--white)"],["x","9.5","y","16","width","5","height","5","fill","var(--white)"],["x","16","y","16","width","5","height","5","fill","var(--white)"],["id","title-page-grid"],["id","close-page-grid",1,"close-btn",3,"click"],[1,"page-grid-content"],[1,"page-spread"],[1,"page-grid-item-add",3,"click"],[1,"page-grid-item-add-page"],["width","48","height","48","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["x1","12","y1","5","x2","12","y2","19","stroke","var(--gray-1)","stroke-width","2","stroke-linecap","round"],["x1","5","y1","12","x2","19","y2","12","stroke","var(--gray-1)","stroke-width","2","stroke-linecap","round"],[1,"page-number"],[1,"page-grid-loader"],[3,"action","closeMenu","visible","position","pageIndex","isCurrentPage"],[1,"page-grid-fake-item"],[3,"index","imageUrl","isCurrent"],[3,"selectPage","dragStarted","dropped","contextMenuEvent","index","imageUrl","isCurrent"],[1,"spinner"],[3,"confirm","cancel"]],template:function(t,i){t&1&&(o(0,"div",0),c("click",function(){return i.close()}),o(1,"div",1),c("click",function(r){return r.stopPropagation()}),o(2,"div",2)(3,"span",3),V(),o(4,"svg",4),u(5,"rect",5)(6,"rect",6)(7,"rect",7)(8,"rect",8)(9,"rect",9)(10,"rect",10)(11,"rect",11)(12,"rect",12)(13,"rect",13),s()(),B(),o(14,"span",14),f(15),$(16,"translate"),s(),o(17,"button",15),c("click",function(){return i.close()}),f(18," \xD7 "),s()(),o(19,"div",16),U(20,oe,3,0,"div",17,F),o(22,"div",18),c("click",function(){return i.addPage()}),o(23,"div",19),V(),o(24,"svg",20),u(25,"line",21)(26,"line",22),s()(),B(),o(27,"span",23),f(28),$(29,"translate"),s()()()(),y(30,se,2,0,"div",24),s(),o(31,"app-page-context-menu",25),c("action",function(r){return i.onContextMenuAction(r)})("closeMenu",function(){return i.contextMenuVisible=!1}),s(),y(32,de,1,0,"app-confirm-delete-modal")),t&2&&(d(15),v(j(16,8,"GLOBAL.PAGES.GRID_VIEW")),d(5),A(i.pageSpreads()),d(8),v(j(29,10,"GLOBAL.PAGES.ADD_PAGE")),d(2),w(i.isLoading()?30:-1),d(),_("visible",i.contextMenuVisible)("position",i.contextMenuPosition)("pageIndex",i.contextMenuPageIndex)("isCurrentPage",i.contextMenuPageIndex===i.currentPageIndex()),d(),w(i.showDeleteConfirm()?32:-1))},dependencies:[k,S,R,D,q,J],styles:["#page-grid-backdrop[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000000b3;z-index:2000;display:flex;justify-content:center;align-items:center}#page-grid[_ngcontent-%COMP%]{position:absolute;top:var(--spacing-s);left:var(--spacing-s);right:var(--spacing-s);bottom:var(--spacing-s);width:calc(100vw - 2 * var(--spacing-s));height:calc(100vh - 2 * var(--spacing-s));background-color:var(--gray-5);border-radius:var(--radius-s);padding:0 20px;display:flex;flex-direction:column;opacity:1;transition:opacity .5s ease;pointer-events:auto;overflow-y:auto;box-sizing:border-box}#page-grid-title[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;padding-top:var(--spacing-s);flex-shrink:0}#page-grid-title[_ngcontent-%COMP%] #icon-page-grid[_ngcontent-%COMP%]{background:var(--gray-3);border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center}#page-grid-title[_ngcontent-%COMP%] #title-page-grid[_ngcontent-%COMP%]{font-size:var(--font-size-medium);font-weight:var(--font-weight-bold);color:var(--white);margin-top:var(--spacing-s);margin-bottom:var(--spacing-xs);margin-left:var(--spacing-xs)!important}#close-page-grid[_ngcontent-%COMP%]{margin-left:auto;background:none;border:none;font-size:32px;cursor:pointer;color:var(--white)}.page-grid-content[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:center;padding-bottom:40px;gap:var(--spacing-m)}.page-spread[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:flex-end}.page-grid-content[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-bottom:var(--spacing-s)}.page-grid-fake-item[_ngcontent-%COMP%]{background-color:var(--gray-4);border-radius:var(--radius-xs);border-top-right-radius:0;border-bottom-right-radius:0;padding:var(--spacing-xs);display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:1px solid var(--gray-3);border-right:0;align-items:center;margin:0;box-sizing:border-box;box-shadow:2px 0 5px #0003}.page-grid-item-add[_ngcontent-%COMP%]{background-color:var(--gray-3);border-radius:var(--radius-xs);padding:var(--spacing-xs);display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:none;align-items:center;cursor:pointer;margin:var(--spacing-s) 0;box-sizing:border-box;transition:transform .2s,background-color .2s}.page-grid-item-add[_ngcontent-%COMP%]:hover{transform:scale(1.05);background-color:var(--gray-2)}.page-grid-item-add-page[_ngcontent-%COMP%]{display:flex;align-content:center;flex-direction:column;justify-content:center;align-items:center;width:120px;height:180px;background:#fff;border:2px solid black;box-sizing:border-box;min-width:130px;min-height:186px}.page-number[_ngcontent-%COMP%]{font-size:10px;color:var(--white);text-align:center}.page-grid-loader[_ngcontent-%COMP%]{position:absolute;inset:0;background:#0006;display:flex;justify-content:center;align-items:center;z-index:3000;border-radius:var(--radius-s)}.spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:4px solid rgba(255,255,255,.3);border-top:4px solid var(--white);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"]})};export{K as PageGridModalComponent};