Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
179 changes: 179 additions & 0 deletions js/Audios-0teLnv5A.chunk.mjs

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions js/Audios-0teLnv5A.chunk.mjs.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: @videojs/core developers
SPDX-FileCopyrightText: @videojs/html developers
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors

This file is generated from multiple sources. Included packages:
- @nextcloud/viewer
- version: 2.0.0-beta.19
- license: AGPL-3.0-or-later
- @videojs/core
- version: 10.2.0
- license: Apache-2.0
- @videojs/html
- version: 10.2.0
- license: Apache-2.0
1 change: 1 addition & 0 deletions js/Audios-0teLnv5A.chunk.mjs.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/Audios-0teLnv5A.chunk.mjs.map.license
65 changes: 65 additions & 0 deletions js/ImageEditor-CC5NAjCj.chunk.mjs

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions js/ImageEditor-CC5NAjCj.chunk.mjs.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: BSD-3-Clause
SPDX-License-Identifier: MIT
SPDX-FileCopyrightText: @nextcloud/dialogs developers
SPDX-FileCopyrightText: Anton Lavrenov
SPDX-FileCopyrightText: Borys Serebrov
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: Scott Cooper <scttcper@gmail.com>
SPDX-FileCopyrightText: chenkai

This file is generated from multiple sources. Included packages:
- @ckpack/vue-color
- version: 1.6.0
- license: MIT
- @ctrl/tinycolor
- version: 3.6.1
- license: MIT
- @nextcloud/dialogs
- version: 7.6.0
- license: AGPL-3.0-or-later
- @nextcloud/image-editor
- version: 1.0.0-beta.7
- license: AGPL-3.0-or-later
- @nextcloud/viewer
- version: 2.0.0-beta.19
- license: AGPL-3.0-or-later
- @nextcloud/vue
- version: 9.14.0
- license: AGPL-3.0-or-later
- emoji-mart-vue-fast
- version: 15.0.5
- license: BSD-3-Clause
- konva
- version: 10.3.3
- license: MIT
1 change: 1 addition & 0 deletions js/ImageEditor-CC5NAjCj.chunk.mjs.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/ImageEditor-CC5NAjCj.chunk.mjs.map.license
3 changes: 3 additions & 0 deletions js/Images-D15tD-uO.chunk.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".image-differences[data-v-c9b762ef]{position:relative;margin:0;max-width:100%;max-height:100%}.image-differences__image[data-v-c9b762ef]{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;-webkit-user-select:none;user-select:none}.image-differences__label[data-v-c9b762ef]{position:absolute;transition:opacity var(--animation-quick, .1s);top:calc(2 * var(--default-grid-baseline));padding:calc(1.5 * var(--default-grid-baseline)) calc(3 * var(--default-grid-baseline));border-radius:var(--border-radius-element, var(--border-radius-large));background-color:#000000bf;color:#fff;font-size:var(--default-font-size, 15px);font-weight:700;line-height:1.3;pointer-events:none;box-sizing:border-box;max-width:calc(50% - 3 * var(--default-grid-baseline))}.image-differences__label--base[data-v-c9b762ef]{inset-inline-start:calc(2 * var(--default-grid-baseline))}.image-differences__label--other[data-v-c9b762ef]{inset-inline-end:calc(2 * var(--default-grid-baseline))}.image-differences--touched .image-differences__label[data-v-c9b762ef]{opacity:0}@media(hover:hover){.image-differences:hover .image-differences__label[data-v-c9b762ef]{opacity:0}}.image-differences__divider[data-v-c9b762ef]{position:absolute;top:0;bottom:0;width:2px;margin-inline-start:-1px;background-color:#fff;box-shadow:0 0 4px #0009;pointer-events:none}.image-differences__slider[data-v-c9b762ef]{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:ew-resize}.image-differences__slider:focus-visible+.image-differences__divider[data-v-c9b762ef]{width:4px;margin-inline-start:-2px;outline:2px solid var(--color-primary-element)}.image_container[data-v-7d63f0cd]{display:flex;align-items:center;height:100%;justify-content:center}img[data-v-7d63f0cd],video[data-v-7d63f0cd]{align-self:center;justify-self:center;background-color:#000;transition:none!important;touch-action:none}img[data-v-7d63f0cd]:hover,video[data-v-7d63f0cd]:hover{background-image:linear-gradient(45deg,#efefef 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#efefef 75%),linear-gradient(45deg,transparent 75%,#efefef 75%),linear-gradient(45deg,#efefef 25%,#fff 25%);background-size:16px 16px;background-position:0 0,0 0,-8px -8px,8px 8px}img.loaded[data-v-7d63f0cd],video.loaded[data-v-7d63f0cd]{background-color:#fff}img.zoomed[data-v-7d63f0cd],video.zoomed[data-v-7d63f0cd]{z-index:10010;cursor:move}img.dragging[data-v-7d63f0cd],video.dragging[data-v-7d63f0cd]{transition:none!important;cursor:move}.live-photo_play_button[data-v-7d63f0cd]{position:absolute;top:0;margin:16px!important;display:flex;align-items:center;border:none;gap:4px;border-radius:var(--border-radius);padding:4px 8px;background-color:var(--color-main-background-blur)}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
import{d as Oe,f as r,p as ze,w as H,l as Y,h as E,n as ea,o as aa,j as la,_ as ta,k as h,m as fe,q as x,F as Ae,s as f,u as V,v as me,x as N,y as Xe,z as na,A as C,B as Q,N as ua,C as ia,D as ee,E as v,G as oa,H as ra,I as va,J as sa}from"./store-DT5_o2He.chunk.mjs";import{_ as ge}from"./_plugin-vue_export-helper-D8VWKLTF.chunk.mjs";import{g as pe,a as da}from"./previewUtils-a7UGvJa0.chunk.mjs";import{u as ca,p as fa,a as De,b as ha}from"./useViewerProps-BgGfCZKj.chunk.mjs";import{c as he}from"./canDownload-C1jVjD_-.chunk.mjs";import{f as ma}from"./livePhotoUtils-C4mNnUu-.chunk.mjs";const pa={name:"PlayCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ga=["aria-hidden","aria-label"],ya=["fill","width","height"],wa={d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M10,16.5L16,12L10,7.5V16.5Z"},xa={key:0};function ba(p,R,a,d,L,m){return h(),x("span",sa(p.$attrs,{"aria-hidden":a.title?null:"true","aria-label":a.title,class:"material-design-icon play-circle-outline-icon",role:"img",onClick:R[0]||(R[0]=g=>p.$emit("click",g))}),[(h(),x("svg",{fill:a.fillColor,class:"material-design-icon__svg",width:a.size,height:a.size,viewBox:"0 0 24 24"},[C("path",wa,[a.title?(h(),x("title",xa,ee(a.title),1)):N("",!0)])],8,ya))],16,ga)}const _a=ge(pa,[["render",ba]]),ka=["alt","src"],Ma=["alt","src"],Sa={class:"image-differences__label image-differences__label--base"},Ca={class:"image-differences__label image-differences__label--other"},La=["aria-label"],Wa=Oe({__name:"ImageDifferences",props:{files:{},maxWidth:{},maxHeight:{},shown:{type:Boolean}},emits:["loaded","errored","update:canSwipe","update:editing","update:playing"],setup(p,{emit:R}){const a=p,d=R,L=oa("slider");H(()=>a.shown,u=>{u&&L.value?.focus({preventScroll:!0})});const m=v(()=>a.files[0]),g=v(()=>a.files[1]),y=v(()=>({width:a.maxWidth,height:a.maxHeight})),w=v(()=>pe(m.value,y.value)),W=v(()=>pe(g.value,y.value)),b=r(),U=v(()=>{if(b.value===void 0)return{width:a.maxWidth,height:a.maxHeight};const{width:u,height:i}=b.value,c=Math.min(1,a.maxWidth/u,a.maxHeight/i);return{width:Math.round(u*c),height:Math.round(i*c)}}),I=r(50),P=r(!1);ra(()=>d("update:canSwipe",!1));let s=0,_=!1;function k(u){const{naturalWidth:i,naturalHeight:c}=u.target;b.value===void 0&&i>0&&c>0&&(b.value={width:i,height:c}),s++,s===2&&d("loaded")}function $(){_||(_=!0,d("errored",new Error(E("Failed to load image."))))}return(u,i)=>(h(),x("figure",{class:me(["image-differences",{"image-differences--touched":P.value}]),style:V({width:`${U.value.width}px`,height:`${U.value.height}px`})},[C("img",{class:"image-differences__image",alt:m.value.displayname,src:w.value,onLoad:k,onError:$},null,40,ka),C("img",{class:"image-differences__image",alt:g.value.displayname,src:W.value,style:V({clipPath:`inset(0 0 0 ${I.value}%)`}),onLoad:k,onError:$},null,44,Ma),C("span",Sa,ee(m.value.displayname),1),C("span",Ca,ee(g.value.displayname),1),Xe(C("input",{ref_key:"slider",ref:L,"onUpdate:modelValue":i[0]||(i[0]=c=>I.value=c),class:"image-differences__slider",type:"range",min:"0",max:"100","aria-label":Q(E)("Slide to compare {base} with {other}",{base:m.value.displayname,other:g.value.displayname}),onPointerdown:i[1]||(i[1]=c=>P.value=!0),onPointerup:i[2]||(i[2]=c=>P.value=!1),onPointercancel:i[3]||(i[3]=c=>P.value=!1)},null,40,La),[[va,I.value,void 0,{number:!0}]]),C("span",{class:"image-differences__divider",style:V({insetInlineStart:`${I.value}%`})},null,4)],6))}}),Ia=ge(Wa,[["__scopeId","data-v-c9b762ef"]]),Pa={key:1,class:"image_container"},$a=["alt","src"],Ha=["poster","src"],Ea=["disabled","aria-label"],Fe=5,Ra=4,Ua=Oe({name:"ViewerImages",__name:"Images",props:{file:{},files:{},maxHeight:{},maxWidth:{},editing:{type:Boolean,default:!1},isSidebarShown:{type:Boolean},shown:{type:Boolean},turns:{},localSource:{},comparison:{},embedded:{type:Boolean}},emits:["loaded","errored","update:canSwipe","update:editing","update:playing"],setup(p,{emit:R}){const a=p,d=R,L=a.comparison==="differences",{filename:m,src:g}=ca(a),y=r(),w=r(),W=r(!1),b=r(0),U=r(0),I=r(0),P=r(1),s=r([]),_=r(0),k=r(0),$=r(!1),u=r(1),i=r(null),c=r(!1),B=r(!1),z=r(!1),T=r(0),M=r(0),q=r(!1),A=r(ze(a.file)?.width??0);let G=null,ae=!1,J=null;const ye=v(()=>M.value>0?Math.max(Fe,Ra*A.value/M.value):Fe),le=v(()=>a.file.mime),te=v(()=>a.file.attributes?.hasPreview??!1),ne=v(()=>a.file.attributes?.previewUrl),we=v(()=>a.file.attributes?.["metadata-files-live-photo"]),xe=v(()=>pe(a.file,{width:a.maxWidth,height:a.maxHeight})),Z=v(()=>Number(a.turns??0)%4),D=v(()=>Z.value%2===1),F=v(()=>D.value?T.value:M.value),O=v(()=>D.value?M.value:T.value),ue=v(()=>Math.round(T.value*u.value)),ie=v(()=>Math.round(M.value*u.value)),Ye=v(()=>a.file.displayname),be=v(()=>{const e=Z.value===0?void 0:`rotate(${-90*Z.value}deg)`,l=D.value?(ue.value-ie.value)/2:0,t=D.value?(ie.value-ue.value)/2:0,n=u.value===1?{x:0,y:0}:{x:_.value*2,y:k.value*2};return{marginTop:Math.round(n.y+t)+"px",marginBottom:Math.round(t)+"px",marginLeft:Math.round(n.x+l)+"px",marginRight:Math.round(l)+"px",height:ue.value+"px",width:ie.value+"px",transform:e}}),_e=v(()=>{if(we.value!==void 0)return ma(we.value,a.files)}),Ve=v(()=>_e.value?.encodedSource??null);let j=null,X=null;function ke(e){X!==null&&URL.revokeObjectURL(X),X=e,i.value=e}H(()=>a.file.source,()=>{L||(Ne(),Me())}),H(i,e=>{e!==null&&e===G||(z.value=!1,je())}),H(()=>a.localSource,e=>{e&&(i.value=e)}),L||Me();function Me(){Se().catch(e=>{Y.error(`Loading of file ${m.value} failed`,{error:e}),d("errored",new Error(E("Failed to load image.")))})}async function Se(){j!==null&&j.source!==a.file.source&&j.controller.abort();const e=new AbortController;j={controller:e,source:a.file.source};const{signal:l}=e;if(q.value=!1,a.localSource){i.value=a.localSource;return}if(le.value==="image/svg+xml"){i.value=await Te(l);return}if(c.value){const t=he(a.file);ke(t?await fa(a.file,l):await De(xe.value,l)),q.value=!t&&te.value&&!ne.value;return}if(le.value==="image/gif"){i.value=g.value;return}if(a.file.source&&!te.value&&!ne.value){i.value=g.value;return}i.value=xe.value,q.value=te.value&&!ne.value}async function je(){await ea();const e=y.value;e?.complete&&e.naturalWidth>0&&!z.value&&oe()}function oe(){z.value=!0,A.value=Math.max(A.value,y.value?.naturalWidth??0),!(i.value!==null&&i.value===G)&&K()}async function Ce(){if(ae||!q.value)return;const e=da(a.file);if(e===void 0)return;ae=!0;const l=new AbortController;J=l;const{signal:t}=l;let n=null;try{const o=he(a.file)?e:await De(e,t);n=o===e?null:o;const S=await ha(o,t);if(t.aborted||(A.value=Math.max(A.value,S),S<=(y.value?.naturalWidth??0)))return;G=o,n===null?i.value=o:(ke(o),n=null)}catch(o){t.aborted||Y.debug(`Could not fetch a sharper preview of ${m.value}`,{error:o})}finally{n!==null&&URL.revokeObjectURL(n)}}function Ne(){J?.abort(),J=null,G=null,ae=!1,A.value=ze(a.file)?.width??0}H(z,e=>{e&&d("loaded")},{flush:"post"});function K(){const e=y.value?.naturalWidth||w.value?.videoWidth,l=y.value?.naturalHeight||w.value?.videoHeight;if(!e||!l)return;const t=D.value?l:e,n=D.value?e:l,o=Math.min(a.maxHeight/n,a.maxWidth/t);M.value=Math.floor(e*o),T.value=Math.floor(l*o)}H([()=>a.maxWidth,()=>a.maxHeight],K),H(Z,()=>{re(),K()}),aa(()=>{j?.controller.abort(),J?.abort(),X!==null&&(URL.revokeObjectURL(X),X=null)});async function Te(e){const l=await la.get(g.value,{signal:e}),{default:t}=await ta(async()=>{const{default:o}=await import("./store-DT5_o2He.chunk.mjs").then(S=>S.bA);return{default:o}},[],import.meta.url),n=t.sanitize(l.data);return`data:${le.value};base64,${btoa(unescape(encodeURIComponent(n)))}`}function Le(e,l,t){const n=F.value*t-F.value,o=O.value*t-O.value;_.value=Math.min(Math.max(e,-n/2),n/2),k.value=Math.min(Math.max(l,-o/2),o/2)}function We(e,l,t){const n=y.value??w.value;if(!n)return;const o=e-n.getBoundingClientRect().x-F.value*u.value/2,S=l-n.getBoundingClientRect().y-O.value*u.value/2,ce=o/(F.value*u.value),Ge=S/(O.value*u.value),Je=F.value*t-F.value*u.value,Ze=O.value*t-O.value*u.value,Ke=_.value-ce*Je,Qe=k.value-Ge*Ze;Le(Ke,Qe,t),u.value=t,t>1&&Ce()}function Ie(){const e=s.value[0],l=s.value[1];if(!e||!l)return 0;const t=l.x-e.x,n=l.y-e.y;return Math.sqrt(t*t+n*n)}function Pe(e){const l=e.deltaY<0?Math.min(u.value*1.1,ye.value):Math.max(u.value/1.1,1);if(l===1)return re();d("update:canSwipe",!1),We(e.clientX,e.clientY,l)}function re(){d("update:canSwipe",!0),u.value=1,_.value=0,k.value=0}function $e(e){s.value.push({pointerId:e.pointerId,x:e.clientX,y:e.clientY}),s.value.length===1&&(b.value=e.clientX,U.value=e.clientY,W.value=!0),s.value.length===2&&(I.value=Ie(),P.value=u.value,$.value=!0,d("update:canSwipe",!1))}function ve(e){const l=s.value.findIndex(t=>t.pointerId===e.pointerId);l!==-1&&(s.value.splice(l,1),W.value=!1,$.value=!1)}function He(e){ve(e),s.value.length===0&&u.value===1&&d("update:canSwipe",!0)}function Ee(e){if(s.value.length>0){const l=s.value.findIndex(n=>n.pointerId===e.pointerId),t=l>=0?s.value[l]:void 0;t&&(t.x=e.clientX,t.y=e.clientY)}if(s.value.length===1&&W.value&&!$.value&&u.value>1){const{clientX:l,clientY:t}=e,n=_.value+(l-b.value),o=k.value+(t-U.value);Le(n,o,u.value),b.value=l,U.value=t}if(s.value.length===2&&$.value){const l=Ie(),t=Math.min(Math.max(P.value*(l/I.value),1),ye.value),n=s.value[0],o=s.value[1];if(!n||!o)return;const S=(n.x+o.x)/2,ce=(n.y+o.y)/2;We(S,ce,t)}}function Re(){u.value>1?re():(u.value=1.3,Ce())}function Ue(){return he(a.file)?E("Failed to load image."):E("No preview available, download is disabled.")}async function Be(){if(c.value){Y.error(`Loading of file ${m.value} failed even after fallback`),d("errored",new Error(Ue()));return}Y.error(`Loading of file ${m.value} failed, falling back to fetching it by hand`),c.value=!0;try{await Se()}catch(e){Y.error(`Fallback fetch of ${m.value} failed`,{error:e}),d("errored",new Error(Ue()))}}function qe(){B.value=!0,oe()}function se(){!B.value||!w.value||w.value.play().catch(e=>{Y.debug("The browser refused to play the live photo",{error:e})})}function de(){w.value&&w.value.load()}return(e,l)=>L?(h(),fe(Ia,{key:0,files:p.files,maxWidth:p.maxWidth,maxHeight:p.maxHeight,shown:p.shown,onLoaded:l[0]||(l[0]=t=>d("loaded")),onErrored:l[1]||(l[1]=t=>d("errored",t)),"onUpdate:canSwipe":l[2]||(l[2]=t=>d("update:canSwipe",t))},null,8,["files","maxWidth","maxHeight","shown"])):(h(),x("div",Pa,[i.value!==null?(h(),x(Ae,{key:0},[B.value?N("",!0):(h(),x("img",{key:0,ref_key:"image",ref:y,alt:Ye.value,class:me({dragging:W.value,loaded:z.value,zoomed:u.value>1}),src:i.value,style:V(be.value),onErrorCapture:f(Be,["prevent","stop"]),onLoad:oe,onWheel:f(Pe,["stop","prevent"]),onDblclick:f(Re,["prevent"]),onPointerdown:f($e,["prevent"]),onPointerup:f(ve,["prevent"]),onPointercancel:f(He,["prevent"]),onPointermove:f(Ee,["prevent"])},null,46,$a)),_e.value?(h(),x(Ae,{key:1},[Xe(C("video",{ref_key:"video",ref:w,class:me({dragging:W.value,loaded:z.value,zoomed:u.value>1}),style:V(be.value),playsinline:!0,muted:"",poster:i.value??void 0,src:Ve.value??void 0,preload:"metadata",onCanplaythrough:qe,onLoadedmetadata:K,onWheel:f(Pe,["stop","prevent"]),onErrorCaptureOnce:f(Be,["prevent","stop"]),onDblclick:f(Re,["prevent"]),onPointerdown:f($e,["prevent"]),onPointerup:f(ve,["prevent"]),onPointercancel:f(He,["prevent"]),onPointermove:f(Ee,["prevent"]),onEnded:de},null,46,Ha),[[na,B.value]]),M.value!==0?(h(),x("button",{key:0,class:"live-photo_play_button",style:V({left:`calc(50% - ${M.value/2}px)`}),disabled:!B.value,"aria-label":Q(E)("Play the live photo"),onClick:se,onPointerenter:se,onFocus:se,onPointerleave:de,onBlur:de},[B.value?(h(),fe(_a,{key:0})):(h(),fe(Q(ua),{key:1})),ia(" "+ee(Q(E)("LIVE")),1)],44,Ea)):N("",!0)],64)):N("",!0)],64)):N("",!0)]))}}),Xa=ge(Ua,[["__scopeId","data-v-7d63f0cd"]]);export{Xa as default};
//# sourceMappingURL=Images-D15tD-uO.chunk.mjs.map
7 changes: 7 additions & 0 deletions js/Images-D15tD-uO.chunk.mjs.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors

This file is generated from multiple sources. Included packages:
- @nextcloud/viewer
- version: 2.0.0-beta.19
- license: AGPL-3.0-or-later
1 change: 1 addition & 0 deletions js/Images-D15tD-uO.chunk.mjs.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/Images-D15tD-uO.chunk.mjs.map.license
Loading
Loading