@qaecy/cue-ui 0.0.33 → 0.0.35
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/112.js +1 -1
- package/170.js +1 -0
- package/311.js +1 -1
- package/36.js +1 -0
- package/418.js +1 -1
- package/446.js +1 -1
- package/493.js +1 -0
- package/5.js +1 -0
- package/571.js +1 -1
- package/627.js +1 -0
- package/722.js +1 -1
- package/828.js +1 -0
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/240.js +0 -1
- package/360.js +0 -1
- package/513.js +0 -1
- package/613.js +0 -1
- package/645.js +0 -1
- package/741.js +0 -1
- package/911.js +0 -1
package/36.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[36],{3036(_,F,e){e.r(F),e.d(F,{DocumentViewer:()=>V});var I=e(467),Q=e(9769),a=e(5802),h=e(7705),T=e(2271),o=e(5547),f=e(3418),r=e(6114);const M={bim:()=>Promise.all([e.e(598),e.e(76),e.e(419)]).then(e.bind(e,6419)).then(i=>i.BIMFragmentsViewer),cad:()=>Promise.all([e.e(598),e.e(560),e.e(76),e.e(629)]).then(e.bind(e,5873)).then(i=>i.DXFViewer),image:()=>e.e(560).then(e.bind(e,8560)).then(i=>i.ImageViewer),markdown:()=>e.e(376).then(e.bind(e,4376)).then(i=>i.MarkdownViewer),pdf:()=>Promise.all([e.e(560),e.e(76),e.e(311)]).then(e.bind(e,4311)).then(i=>i.PDFViewer),text:()=>e.e(523).then(e.bind(e,3523)).then(i=>i.TextViewer),spreadsheet:()=>Promise.all([e.e(903),e.e(336)]).then(e.bind(e,8336)).then(i=>i.Spreadsheet),code:()=>Promise.all([e.e(284),e.e(722)]).then(e.bind(e,2722)).then(i=>i.CodeViewer),email:()=>e.e(740).then(e.bind(e,5740)).then(i=>i.EmailViewer)},y=new Map([[r.N.DXF,"cad"],[r.N.FRAG,"bim"],[r.N.PDF,"pdf"],[r.N.PNG,"image"],[r.N.JPG,"image"],[r.N.JPEG,"image"],[r.N.SVG,"image"],[r.N.GIF,"image"],[r.N.WEBP,"image"],[r.N.BMP,"image"],[r.N.AVIF,"image"],[r.N.APNG,"image"],[r.N.CSV,"spreadsheet"],[r.N.XLSX,"spreadsheet"],[r.N.XLS,"spreadsheet"],[r.N.JSON,"code"],[r.N.JSONLD,"code"],[r.N.XML,"code"],[r.N.CSS,"code"],[r.N.JS,"code"],[r.N.HTML,"code"],[r.N.HTM,"code"],[r.N.SH,"code"],[r.N.TXT,"text"],[r.N.RST,"text"],[r.N.MD,"markdown"]]);var x=e(8807),L=e(2065);const b=["*"];let A=(()=>{class i{width=(0,h.hFB)("auto");height=(0,h.hFB)("auto");style=(0,h.hFB)("");getStyles=(0,T.EW)(()=>this.style());static \u0275fac=function(s){return new(s||i)};static \u0275cmp=o.VBU({type:i,selectors:[["cue-container"]],hostVars:6,hostBindings:function(s,c){2&s&&(o.Aen(c.getStyles()),o.xc7("max-width",c.width())("max-height",c.height()))},inputs:{width:[1,"width"],height:[1,"height"],style:[1,"style"]},ngContentSelectors:b,decls:1,vars:0,template:function(s,c){1&s&&(o.NAR(),o.SdG(0))},styles:["[_nghost-%COMP%]{display:flex;align-items:stretch;container-name:cue-container;container-type:inline-size}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{flex:1;max-width:100%}"]})}return i})();var E=e(2245),O=e(5381),H=e(5971),j=e(3319),w=e(5448),m=e(2014),$=e(7851),P=e(3191);let g=(()=>{class i{searchService=(0,a.WQX)(P.g);entityBeingPlaced=(0,a.vPA)(void 0);confirmedPlacement=(0,a.vPA)(void 0);rdfBaseURL=(0,a.vPA)("");contentUUID=(0,a.vPA)("");activePdfDoc=(0,a.vPA)(null);currentPage=(0,a.vPA)(1);requestedPage=(0,a.vPA)(null);navigateToPage(t){this.currentPage.set(t),this.requestedPage.set(t)}entityTextSearchResults=(0,a.vPA)([]);entityTextSearchResultsOnCurrentPage=(0,T.EW)(()=>this.entityTextSearchResults().filter(t=>t.page===this.currentPage()));currentPlacementBbox=(0,a.vPA)(null);categoryPreviewBoxes=(0,a.vPA)([]);_lastMatchIndex=(0,a.vPA)(null);matchCycleDisplay=(0,T.EW)(()=>{const t=this._lastMatchIndex(),s=this.entityTextSearchResultsOnCurrentPage().length;return null===t||0===s?"":`${t+1}/${s}`});cycleTextMatch(){const t=this.entityTextSearchResultsOnCurrentPage();if(!t.length)return;const s=this._lastMatchIndex(),c=null===s?0:(s+1)%t.length;this._lastMatchIndex.set(c);const n=t[c].xywhStr.replace("percent:",""),[p,v,d,l]=n.split(",").map(Number),U=Math.max(0,p-.5),B=Math.max(0,v-.5),N=Math.min(100-U,d+1),R=Math.min(100-B,l+1);this.currentPlacementBbox.set({xywhStr:`percent:${U.toFixed(2)},${B.toFixed(2)},${N.toFixed(2)},${R.toFixed(2)}`,color:"rgba(255, 160, 0, 0.9)",allowRemove:!1})}setManualBbox(t){this._lastMatchIndex.set(null),this.currentPlacementBbox.set({...t,allowRemove:!1})}clearPlacement(){this.currentPlacementBbox.set(null),this._lastMatchIndex.set(null)}constructor(){(0,a.QZP)(()=>{const t=this.entityBeingPlaced(),s=this.activePdfDoc();t?.value&&s?this.searchService.searchAll(s,t.value).then(c=>{this.entityTextSearchResults.set(c)}):this.entityTextSearchResults.set([])}),(0,a.QZP)(()=>{this.currentPage(),this._lastMatchIndex.set(null),this.currentPlacementBbox.set(null)}),(0,a.QZP)(()=>{const t=this.entityBeingPlaced();this._lastMatchIndex.set(null),void 0===t&&this.currentPlacementBbox.set(null)})}static \u0275fac=function(s){return new(s||i)};static \u0275prov=a.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var D=e(9352);const C=["viewerTarget"];function S(i,J){if(1&i){const t=o.RV6();o.j41(0,"cue-flexcontainer",2)(1,"cue-typography"),o.EFF(2),o.nI1(3,"transloco"),o.k0s(),o.j41(4,"cue-button",3),o.bIt("click",function(){a.eBV(t);const c=o.XpG();return a.Njj(c.downloadFile())}),o.j41(5,"cue-button-padder"),o.nrm(6,"cue-button-icon",4),o.k0s(),o.j41(7,"cue-button-label"),o.EFF(8),o.nI1(9,"transloco"),o.k0s()()()}2&i&&(o.R7$(2),o.JRh(o.bMT(3,2,"components.documentViewer.infoNoViewer")),o.R7$(6),o.JRh(o.bMT(9,4,"common.buttons.download")))}let V=(()=>{class i{_eps=(0,a.WQX)(g);_destroyed=!1;url=h.hFB.required();suffix=(0,h.hFB)();settings=(0,h.hFB)(new f.DocumentViewerSettings);viewerTypeOverride=(0,h.hFB)(void 0);interactions=(0,h.CGW)();viewerType=(0,T.EW)(()=>{const t=this.viewerTypeOverride();if(t)return t;const s=this.url(),c=void 0!==this.suffix()?this.suffix()?.trim():`.${s.split(".").pop()?.trim()}`,n=c?y.get(c):void 0;return console.log("[DocumentViewer] viewerType resolved",{url:s?.substring(0,80),suffix:c,viewerType:n}),void 0!==c?n:void 0});currentComponent=(0,a.vPA)(null);noViewer=(0,T.EW)(()=>null===this.currentComponent());isLoading=(0,a.vPA)(!1);viewerTarget;currentRef;_interactionsState=(0,a.vPA)(new f.DocumentViewerInteractions);constructor(){(0,a.QZP)(()=>{const t=this.viewerType(),s=this.url();console.log("[DocumentViewer] url/viewerType effect \u2014",{viewerType:t,url:s?.substring(0,80),destroyed:this._destroyed}),t?("pdf"!==t&&this._eps.activePdfDoc.set(null),this.isLoading.set(!0),this.loadViewerComponent(t,s,this.settings())):(this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0,console.info("No viewer available for this file type"),this.currentComponent.set(null),this.isLoading.set(!1),this._eps.activePdfDoc.set(null))}),(0,a.QZP)(()=>{this.interactions.emit(this._interactionsState())}),(0,a.QZP)(()=>{const t=this.settings().pdf,s=this.currentRef;s&&s.setInput("settings",t)})}ngOnDestroy(){this._destroyed=!0,this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0}loadViewerComponent(t,s,c){var n=this;return(0,I.A)(function*(){console.log("[DocumentViewer] loadViewerComponent",{viewerType:t,url:s?.substring(0,100)});try{const p=M[t],v=yield p();if(n._destroyed)return;if(n.currentComponent.set(v),n.isLoading.set(!1),n.viewerTarget.clear(),n.currentRef?.destroy(),n.currentRef=n.viewerTarget.createComponent(v),"pdf"===t)n.currentRef.setInput("src",s),void 0!==c?.pdf&&n.currentRef.setInput("settings",c.pdf),n.currentRef.instance.pdfLoaded&&n.currentRef.instance.pdfLoaded.subscribe(d=>{n._eps.currentPage.set(1),n._eps.activePdfDoc.set(d)}),n.currentRef.instance.settingsChange&&n.currentRef.instance.settingsChange.subscribe(d=>{const l=parseInt(d?.page,10);!isNaN(l)&&l>0&&n._eps.currentPage.set(l)}),n.currentRef.instance.artefactDrawn&&n.currentRef.instance.artefactDrawn.subscribe(d=>{"xywh"===d.type&&n._eps.setManualBbox(d.def)}),n.currentRef.instance.artefactEdited&&n.currentRef.instance.artefactEdited.subscribe(d=>{"bbox"===d.type&&n._eps.setManualBbox(d.after)});else if("bim"===t){const d=new x.di("model","Model",s);d.visible=!0,n.currentRef.setInput("data",{models:[d]}),void 0!==c?.bim&&n.currentRef.setInput("settings",c.bim),n.currentRef.instance.selectedElements&&n.currentRef.instance.selectedElements.subscribe(l=>{n._interactionsState.update(u=>(u.bim.selectedElements=l,Object.assign({},u)))}),n.currentRef.instance.clickedElement&&n.currentRef.instance.clickedElement.subscribe(l=>{n._interactionsState.update(u=>(u.bim.clickedElement=l,Object.assign({},u)))})}else if("cad"===t)n.currentRef.setInput("fileURL",s),void 0!==c?.cad&&n.currentRef.setInput("settings",c.cad);else if("image"===t)n.currentRef.setInput("src",s);else if("markdown"===t)n.currentRef.setInput("fileURL",s);else if("text"===t)n.currentRef.setInput("fileURL",s);else if("spreadsheet"===t){const d=n.suffix()?.split(".").pop()||s.split(".").pop()||"csv";n.currentRef.setInput("data",{url:s,format:d})}else if("code"===t){const u={".json":"json",".jsonld":"jsonld",".xml":"xml",".html":"xml",".htm":"xml",".css":"text",".js":"text",".sh":"text"}[n.suffix()??`.${s.split(".").pop()??""}`]??"text";n.currentRef.setInput("fileURL",s),n.currentRef.setInput("codeType",u)}else"email"===t&&n.currentRef.setInput("fileURL",s)}catch(p){console.error("Failed to load viewer component:",p),n.currentComponent.set(null)}})()}downloadFile(){var t=this;return(0,I.A)(function*(){const c=yield(yield fetch(t.url())).blob();(0,L.KE)(c,`document${t.suffix()??""}`)})()}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=o.VBU({type:i,selectors:[["cue-doc-viewer"]],viewQuery:function(s,c){if(1&s&&o.GBs(C,7,o.c1b),2&s){let n;o.mGM(n=o.lsd())&&(c.viewerTarget=n.first)}},inputs:{url:[1,"url"],suffix:[1,"suffix"],settings:[1,"settings"],viewerTypeOverride:[1,"viewerTypeOverride"]},outputs:{interactions:"interactions"},decls:4,vars:2,consts:[["viewerTarget",""],[2,"height","100%","width","100%",3,"cueLogoLoader"],["direction","column","align","center","justify","center",2,"height","100%","width","100%"],[3,"click"],["icon","download"]],template:function(s,c){1&s&&(o.j41(0,"cue-container",1),o.eu8(1,null,0),o.nVh(3,S,10,6,"cue-flexcontainer",2),o.k0s()),2&s&&(o.Y8G("cueLogoLoader",c.isLoading()),o.R7$(3),o.vxM(!c.isLoading()&&c.noViewer()?3:-1))},dependencies:[Q.MD,A,E.Typography,O.n,H.$,j.a,w.L,m.z,$.k,D.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return i})()},3191(_,F,e){e.d(F,{g:()=>a});var I=e(467),Q=e(5802);let a=(()=>{class h{searchPage(o,f,r){return(0,I.A)(function*(){if(!r||!r.trim())return[];const M=r.toLowerCase(),y=yield o.getPage(f),x=y.getViewport({scale:1}),b=(yield y.getTextContent()).items,A=[];let E="";const O=[],H=[];for(let m=0;m<b.length;m++){const P=b[m].str??"";for(let g=0;g<P.length;g++)E+=P[g],O.push(m),H.push(g)}const j=E.toLowerCase();let w=0;for(;w<j.length;){const m=j.indexOf(M,w);if(-1===m)break;const $=m+M.length-1;w=m+1;const P=new Set;for(let v=m;v<=$;v++)P.add(O[v]);let g=1/0,D=1/0,C=-1/0,S=-1/0;for(const v of P){const d=b[v],[l,u,U,B,N,R]=d.transform,G=d.width??0,W=d.height??Math.abs(l||B||12),X=Math.sqrt(l*l+u*u)||1,Z=l/X,K=u/X,Y=U/X,z=B/X,ne=[[N,R],[N+Z*G,R+K*G],[N+Z*G+Y*W,R+K*G+z*W],[N+Y*W,R+z*W]];for(const[se,oe]of ne){const[k,q]=x.convertToViewportPoint(se,oe);g=Math.min(g,k),D=Math.min(D,q),C=Math.max(C,k),S=Math.max(S,q)}}const V=x.width,i=x.height,J=.005*V,t=.005*i,c=(D-t)/i*100,n=(C-g+2*J)/V*100,p=(S-D+2*t)/i*100;n>0&&p>0&&A.push({page:f,xywhStr:`percent:${((g-J)/V*100).toFixed(2)},${c.toFixed(2)},${n.toFixed(2)},${p.toFixed(2)}`})}return A})()}searchAll(o,f){var r=this;return(0,I.A)(function*(){if(!f||!f.trim())return[];const M=o.numPages,y=[];for(let x=1;x<=M;x++){const L=yield r.searchPage(o,x,f);y.push(...L)}return y})()}static \u0275fac=function(f){return new(f||h)};static \u0275prov=Q.jDH({token:h,factory:h.\u0275fac,providedIn:"root"})}return h})()}}]);
|