soliddesigner 0.1.6 → 0.1.7
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/dist/soliddesigner/browser/assets/i18n/en.json +4 -0
- package/dist/soliddesigner/browser/assets/i18n/es.json +4 -0
- package/dist/soliddesigner/browser/assets/i18n/fr.json +4 -0
- package/dist/soliddesigner/browser/{chunk-RA7VQV2H.js → chunk-KHRF3JSK.js} +1 -1
- package/dist/soliddesigner/browser/{chunk-REUN7VOV.js → chunk-VPM3BUYR.js} +2 -2
- package/dist/soliddesigner/browser/index.html +2 -2
- package/dist/soliddesigner/browser/main.js +16 -16
- package/package.json +1 -1
|
@@ -501,6 +501,10 @@
|
|
|
501
501
|
"READY": "Ready",
|
|
502
502
|
"FAILED": "Generation failed",
|
|
503
503
|
"HD_HINT": "It may take a moment",
|
|
504
|
+
"HD_LABEL": "Do you want the PDF in high definition?",
|
|
505
|
+
"BLEED_LABEL": "Do you want bleed margins?",
|
|
506
|
+
"CUTTING_LABEL": "Do you want cutting lines?",
|
|
507
|
+
"GENERATE": "Generate",
|
|
504
508
|
"TOAST_GENERATING": "PDF generation in progress...",
|
|
505
509
|
"TOAST_FINISHED": "PDF generation finished!"
|
|
506
510
|
},
|
|
@@ -494,6 +494,10 @@
|
|
|
494
494
|
"READY": "Listo",
|
|
495
495
|
"FAILED": "Error de generación",
|
|
496
496
|
"HD_HINT": "Puede tomar un momento",
|
|
497
|
+
"HD_LABEL": "¿Quieres el PDF en alta definición?",
|
|
498
|
+
"BLEED_LABEL": "¿Quieres márgenes de sangrado?",
|
|
499
|
+
"CUTTING_LABEL": "¿Quieres líneas de corte?",
|
|
500
|
+
"GENERATE": "Generar",
|
|
497
501
|
"TOAST_GENERATING": "Generación de PDF en progreso...",
|
|
498
502
|
"TOAST_FINISHED": "¡Generación de PDF finalizada!"
|
|
499
503
|
},
|
|
@@ -651,6 +651,10 @@
|
|
|
651
651
|
"READY": "Prêt",
|
|
652
652
|
"FAILED": "Échec de la génération",
|
|
653
653
|
"HD_HINT": "Peut prendre un moment",
|
|
654
|
+
"HD_LABEL": "Voulez-vous le PDF en haute définition ?",
|
|
655
|
+
"BLEED_LABEL": "Voulez vous des marges de fond perdu ?",
|
|
656
|
+
"CUTTING_LABEL": "Voulez-vous des traits de coupe ?",
|
|
657
|
+
"GENERATE": "Générer",
|
|
654
658
|
"TOAST_GENERATING": "Génération du PDF en cours...",
|
|
655
659
|
"TOAST_FINISHED": "Génération du PDF terminée !"
|
|
656
660
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as k,E as K,J as Q,U as Z,W as S,X as ee,Y as te,n as M,y as J}from"./chunk-REUN7VOV.js";import"./chunk-TOQU4CNM.js";import{$e as U,Ba as l,Ed as P,Ff as g,Hf as Y,If as c,Jh as w,Kc as d,Kh as v,Lg as N,Mg as j,Qc as h,Ta as p,Ua as m,Uf as q,Va as L,Ve as C,Xa as V,Xe as y,Xf as u,Yf as _,Ze as B,_e as F,a as T,af as A,b as E,bf as o,cf as s,df as x,ef as z,fb as f,ff as R,gf as X,nf as $,of as W,yc as H}from"./chunk-KMNI2D3U.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=l(S);cacheBuster="";constructor(){v(()=>{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=P({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&&(z(0,"div",0),Y("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)}),X(1,"img",1),z(2,"span",2),u(3),R()()),t&2&&(q("current",i.isCurrent)("drag-before",i.dragOver&&i.dropSide==="before")("drag-after",i.dragOver&&i.dropSide==="after"),d(),W("src",i.displayImageUrl,H),d(2),_(i.index+1))},dependencies:[M,k],styles:[`[_nghost-%COMP%]{display:block}.page-grid-item[_ngcontent-%COMP%]{background-color:var(--gray-4);border-radius:var(--radius-xs);padding:var(--spacing-xs) 0;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 de(a,e){a&1&&x(0,"div",26)}function ce(a,e){if(a&1){let t=$();o(0,"app-page-grid-item",28),g("selectPage",function(n){p(t);let r=c(3);return m(r.goToPage(n))})("dragStarted",function(n){p(t);let r=c(3);return m(r.onDragStart(n))})("dropped",function(n){p(t);let r=c(3);return m(r.onDrop(n))})("contextMenuEvent",function(n){p(t);let r=c(3);return m(r.onPageContextMenu(n))}),s()}if(a&2){let t=c().$implicit,i=c(2);A("index",t.index)("imageUrl",i.pageImageUrls()[t.index])("isCurrent",t.index===i.currentPageIndex())}}function ge(a,e){if(a&1&&C(0,de,1,0,"div",26)(1,ce,1,3,"app-page-grid-item",27),a&2){let t=e.$implicit;y(t.isFake?0:1)}}function le(a,e){if(a&1&&(o(0,"div",17),F(1,ge,2,1,null,null,B),s()),a&2){let t=e.$implicit;d(),U(t)}}function pe(a,e){a&1&&(o(0,"div",24),x(1,"div",29),s())}function me(a,e){if(a&1){let t=$();o(0,"app-confirm-delete-modal",30),g("confirm",function(){p(t);let n=c();return m(n.confirmDelete())})("cancel",function(){p(t);let n=c();return m(n.cancelDelete())}),s()}}var ie=class a{appParams=l(K);assetsService=l(Z);modalService=l(Q);saveService=l(S);onPageSelect;isLoading=f(!1);pages=f([]);currentPageIndex=w(()=>{let e=this.appParams.pageGuid();return this.pages().findIndex(i=>i.documentPageGuid===e)});pageSpreads=w(()=>{let e=this.pages(),t=[{isFake:!0}];e.forEach((n,r)=>{t.push(E(T({},n),{index:r}))});let i=[];for(let n=0;n<t.length;n+=2)i.push(t.slice(n,n+2));return i});pageCacheBusters=f({});sessionBuster=`s=${Date.now()}`;pageImageUrls=w(()=>{let e=this.pageCacheBusters();return this.pages().map(t=>{let i=t.publicationTemplateThumbnail||t.publicationTemplateUrl;if(!i)return"";let n=t.documentPageGuid,r=e[n]||this.sessionBuster,b=i.includes("?")?"&":"?";return`${i}${b}${r}`})});dragSourceIndex=null;contextMenuVisible=!1;contextMenuPosition={x:0,y:0};contextMenuPageIndex=null;showDeleteConfirm=f(!1);deleteIndex=null;constructor(){v(()=>{let t=this.appParams.params().documentData;t&&Array.isArray(t)&&this.pages.set([...t])}),v(()=>{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=>E(T({},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(),b=r[t];if(!b)return;let ne=b.documentPageGuid,I=i;t<i&&I--;let re=I+1;this.pages.update(O=>{let G=[...O],[ae]=G.splice(t,1);return G.splice(I,0,ae),G}),this.isLoading.set(!0),this.assetsService.moveDocumentPage(n,ne,re).subscribe({next:O=>{O?this.refreshPages():(this.pages.set(r),this.isLoading.set(!1))},error:()=>{this.pages.set(r),this.isLoading.set(!1)}}),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=P({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),g("click",function(){return i.close()}),o(1,"div",1),g("click",function(r){return r.stopPropagation()}),o(2,"div",2)(3,"span",3),L(),o(4,"svg",4),x(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()(),V(),o(14,"span",14),u(15),N(16,"translate"),s(),o(17,"button",15),g("click",function(){return i.close()}),u(18," \xD7 "),s()(),o(19,"div",16),F(20,le,3,0,"div",17,B),o(22,"div",18),g("click",function(){return i.addPage()}),o(23,"div",19),L(),o(24,"svg",20),x(25,"line",21)(26,"line",22),s()(),V(),o(27,"span",23),u(28),N(29,"translate"),s()()()(),C(30,pe,2,0,"div",24),s(),o(31,"app-page-context-menu",25),g("action",function(r){return i.onContextMenuAction(r)})("closeMenu",function(){return i.contextMenuVisible=!1}),s(),C(32,me,1,0,"app-confirm-delete-modal")),t&2&&(d(15),_(j(16,8,"GLOBAL.PAGES.GRID_VIEW")),d(5),U(i.pageSpreads()),d(8),_(j(29,10,"GLOBAL.PAGES.ADD_PAGE")),d(2),y(i.isLoading()?30:-1),d(),A("visible",i.contextMenuVisible)("position",i.contextMenuPosition)("pageIndex",i.contextMenuPageIndex)("isCurrentPage",i.contextMenuPageIndex===i.currentPageIndex()),d(),y(i.showDeleteConfirm()?32:-1))},dependencies:[M,k,D,ee,te,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{ie as PageGridModalComponent};
|
|
1
|
+
import{A as k,E as K,J as Q,U as Z,W as S,X as ee,Y as te,n as M,y as J}from"./chunk-VPM3BUYR.js";import"./chunk-TOQU4CNM.js";import{$e as U,Ba as l,Ed as P,Ff as g,Hf as Y,If as c,Jh as w,Kc as d,Kh as v,Lg as N,Mg as j,Qc as h,Ta as p,Ua as m,Uf as q,Va as L,Ve as C,Xa as V,Xe as y,Xf as u,Yf as _,Ze as B,_e as F,a as T,af as A,b as E,bf as o,cf as s,df as x,ef as z,fb as f,ff as R,gf as X,nf as $,of as W,yc as H}from"./chunk-KMNI2D3U.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=l(S);cacheBuster="";constructor(){v(()=>{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=P({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&&(z(0,"div",0),Y("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)}),X(1,"img",1),z(2,"span",2),u(3),R()()),t&2&&(q("current",i.isCurrent)("drag-before",i.dragOver&&i.dropSide==="before")("drag-after",i.dragOver&&i.dropSide==="after"),d(),W("src",i.displayImageUrl,H),d(2),_(i.index+1))},dependencies:[M,k],styles:[`[_nghost-%COMP%]{display:block}.page-grid-item[_ngcontent-%COMP%]{background-color:var(--gray-4);border-radius:var(--radius-xs);padding:var(--spacing-xs) 0;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 de(a,e){a&1&&x(0,"div",26)}function ce(a,e){if(a&1){let t=$();o(0,"app-page-grid-item",28),g("selectPage",function(n){p(t);let r=c(3);return m(r.goToPage(n))})("dragStarted",function(n){p(t);let r=c(3);return m(r.onDragStart(n))})("dropped",function(n){p(t);let r=c(3);return m(r.onDrop(n))})("contextMenuEvent",function(n){p(t);let r=c(3);return m(r.onPageContextMenu(n))}),s()}if(a&2){let t=c().$implicit,i=c(2);A("index",t.index)("imageUrl",i.pageImageUrls()[t.index])("isCurrent",t.index===i.currentPageIndex())}}function ge(a,e){if(a&1&&C(0,de,1,0,"div",26)(1,ce,1,3,"app-page-grid-item",27),a&2){let t=e.$implicit;y(t.isFake?0:1)}}function le(a,e){if(a&1&&(o(0,"div",17),F(1,ge,2,1,null,null,B),s()),a&2){let t=e.$implicit;d(),U(t)}}function pe(a,e){a&1&&(o(0,"div",24),x(1,"div",29),s())}function me(a,e){if(a&1){let t=$();o(0,"app-confirm-delete-modal",30),g("confirm",function(){p(t);let n=c();return m(n.confirmDelete())})("cancel",function(){p(t);let n=c();return m(n.cancelDelete())}),s()}}var ie=class a{appParams=l(K);assetsService=l(Z);modalService=l(Q);saveService=l(S);onPageSelect;isLoading=f(!1);pages=f([]);currentPageIndex=w(()=>{let e=this.appParams.pageGuid();return this.pages().findIndex(i=>i.documentPageGuid===e)});pageSpreads=w(()=>{let e=this.pages(),t=[{isFake:!0}];e.forEach((n,r)=>{t.push(E(T({},n),{index:r}))});let i=[];for(let n=0;n<t.length;n+=2)i.push(t.slice(n,n+2));return i});pageCacheBusters=f({});sessionBuster=`s=${Date.now()}`;pageImageUrls=w(()=>{let e=this.pageCacheBusters();return this.pages().map(t=>{let i=t.publicationTemplateThumbnail||t.publicationTemplateUrl;if(!i)return"";let n=t.documentPageGuid,r=e[n]||this.sessionBuster,b=i.includes("?")?"&":"?";return`${i}${b}${r}`})});dragSourceIndex=null;contextMenuVisible=!1;contextMenuPosition={x:0,y:0};contextMenuPageIndex=null;showDeleteConfirm=f(!1);deleteIndex=null;constructor(){v(()=>{let t=this.appParams.params().documentData;t&&Array.isArray(t)&&this.pages.set([...t])}),v(()=>{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=>E(T({},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(),b=r[t];if(!b)return;let ne=b.documentPageGuid,I=i;t<i&&I--;let re=I+1;this.pages.update(O=>{let G=[...O],[ae]=G.splice(t,1);return G.splice(I,0,ae),G}),this.isLoading.set(!0),this.assetsService.moveDocumentPage(n,ne,re).subscribe({next:O=>{O?this.refreshPages():(this.pages.set(r),this.isLoading.set(!1))},error:()=>{this.pages.set(r),this.isLoading.set(!1)}}),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=P({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),g("click",function(){return i.close()}),o(1,"div",1),g("click",function(r){return r.stopPropagation()}),o(2,"div",2)(3,"span",3),L(),o(4,"svg",4),x(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()(),V(),o(14,"span",14),u(15),N(16,"translate"),s(),o(17,"button",15),g("click",function(){return i.close()}),u(18," \xD7 "),s()(),o(19,"div",16),F(20,le,3,0,"div",17,B),o(22,"div",18),g("click",function(){return i.addPage()}),o(23,"div",19),L(),o(24,"svg",20),x(25,"line",21)(26,"line",22),s()(),V(),o(27,"span",23),u(28),N(29,"translate"),s()()()(),C(30,pe,2,0,"div",24),s(),o(31,"app-page-context-menu",25),g("action",function(r){return i.onContextMenuAction(r)})("closeMenu",function(){return i.contextMenuVisible=!1}),s(),C(32,me,1,0,"app-confirm-delete-modal")),t&2&&(d(15),_(j(16,8,"GLOBAL.PAGES.GRID_VIEW")),d(5),U(i.pageSpreads()),d(8),_(j(29,10,"GLOBAL.PAGES.ADD_PAGE")),d(2),y(i.isLoading()?30:-1),d(),A("visible",i.contextMenuVisible)("position",i.contextMenuPosition)("pageIndex",i.contextMenuPageIndex)("isCurrentPage",i.contextMenuPageIndex===i.currentPageIndex()),d(),y(i.showDeleteConfirm()?32:-1))},dependencies:[M,k,D,ee,te,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{ie as PageGridModalComponent};
|