@scaleflex/uploader 0.2.1 → 0.2.3
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/.claude/skills/integrate-uploader/SKILL.md +458 -0
- package/README.md +30 -0
- package/dist/components/drop-zone.d.ts +1 -0
- package/dist/components/drop-zone.d.ts.map +1 -1
- package/dist/components/file-item.d.ts +1 -0
- package/dist/components/file-item.d.ts.map +1 -1
- package/dist/components/file-list.d.ts +13 -0
- package/dist/components/file-list.d.ts.map +1 -1
- package/dist/components/success-card.d.ts +4 -0
- package/dist/components/success-card.d.ts.map +1 -1
- package/dist/define.cjs +1 -1
- package/dist/define.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{provider-browser-ixqCA0XP.js → provider-browser-CMbbN8PZ.js} +1 -1
- package/dist/{provider-browser-yW3pZFSP.cjs → provider-browser-DbjyF_Ou.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.d.ts +12 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +95 -60
- package/dist/{search-provider-browser-B5ZWGUl8.js → search-provider-browser-9oZjABnB.js} +1 -1
- package/dist/{search-provider-browser-BrKVwGf_.cjs → search-provider-browser-KQs6JI8u.cjs} +1 -1
- package/dist/{sfx-uploader-CU9IwNC7.js → sfx-uploader-DTfESjzm.js} +3765 -2475
- package/dist/sfx-uploader-DXyLpoIJ.cjs +4407 -0
- package/dist/sfx-uploader.d.ts +39 -4
- package/dist/sfx-uploader.d.ts.map +1 -1
- package/dist/store/store.types.d.ts +2 -0
- package/dist/store/store.types.d.ts.map +1 -1
- package/dist/test-utils.d.ts.map +1 -1
- package/dist/utils/file-utils.d.ts +2 -0
- package/dist/utils/file-utils.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/sfx-uploader-ziRTzw0k.cjs +0 -3298
|
@@ -0,0 +1,4407 @@
|
|
|
1
|
+
"use strict";const s=require("lit"),p=require("lit/decorators.js"),U=require("lit/directives/unsafe-svg.js"),D=require("lit/directives/unsafe-html.js");class Se{constructor(e){this.listeners=new Set,this._notifying=!1,this._pendingState=null,this.state=e}getState(){return this.state}setState(e){if(this._notifying){this._pendingState={...this._pendingState||{},...e};return}const t=this.state;this.state={...t,...e},this._notifying=!0;try{this.listeners.forEach(i=>i(this.state,t))}finally{this._notifying=!1}if(this._pendingState){const i=this._pendingState;this._pendingState=null,this.setState(i)}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}destroy(){this.listeners.clear()}}function S(n,e,t){const i=n.getState().files,r=i.get(e);if(!r)return;const o=new Map(i);o.set(e,{...r,...t}),n.setState({files:o})}function M(n,e){const t=new Map(n.getState().files);t.set(e.id,e),n.setState({files:t})}function be(n,e){const t=n.getState().files;if(!t.has(e))return;const i=new Map(t);i.delete(e),n.setState({files:i})}function Ee(){return new Se({files:new Map,queueConfig:{concurrency:3,autoProceed:!1,retryConfig:{maxRetries:0,baseDelay:1e3,maxDelay:3e4,backoffFactor:2}},isPaused:!1,restrictions:{maxFileSize:null,maxTotalFilesSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,blockedFileTypes:null},targetFolder:"/",totalProgress:0,totalSpeed:0,totalBytesUploaded:0,totalBytes:0,isUploading:!1})}class Fe{constructor(e,t){this.host=e,this.store=t,e.addController(this)}get state(){return this.store.getState()}setState(e){this.store.setState(e)}hostConnected(){this.unsubscribe=this.store.subscribe(()=>{this.host.requestUpdate()})}hostDisconnected(){var e;(e=this.unsubscribe)==null||e.call(this)}}function Oe(n,e){const t=new XMLHttpRequest;let i=!1;const o=`${e.apiBase.replace(/\/+$/,"")}/v4/files?folder=${encodeURIComponent(e.folder)}`;t.open("POST",o);for(const[l,d]of Object.entries(e.authHeaders))t.setRequestHeader(l,d);t.upload.addEventListener("progress",l=>{l.lengthComputable&&!i&&e.onProgress(l.loaded,l.total)}),t.addEventListener("load",()=>{if(i)return;let l;try{l=JSON.parse(t.responseText)}catch{e.onError(new Error(`Invalid JSON response (HTTP ${t.status})`));return}t.status>=200&&t.status<300&&l.status==="success"?e.onComplete(l):e.onError(new Error(l.hint||l.msg||`Upload failed (HTTP ${t.status})`))}),t.addEventListener("error",()=>{i||e.onError(new Error("Network error — check your connection"))}),t.addEventListener("timeout",()=>{i||e.onError(new Error("Upload timed out"))});const a=new FormData;if(n.file){const l={name:n.name,type:n.type};Object.keys(n.meta).length>0&&(l.meta=n.meta),n.tags.length>0&&(l.tags=n.tags),a.append("info[files[]]",JSON.stringify(l)),a.append("files[]",n.file,n.name)}return t.timeout=6e4,t.send(a),{abort(){i=!0,t.abort()}}}function Te(n,e){const t=new XMLHttpRequest;let i=!1;const o=`${e.apiBase.replace(/\/+$/,"")}/v4/files/upload_url`;t.open("POST",o);for(const[l,d]of Object.entries(e.authHeaders))t.setRequestHeader(l,d);if(t.setRequestHeader("Content-Type","application/json"),t.addEventListener("load",()=>{if(i)return;let l;try{l=JSON.parse(t.responseText)}catch{e.onError(new Error(`Invalid JSON response (HTTP ${t.status})`));return}t.status>=200&&t.status<300&&l.status==="success"?e.onComplete(l):e.onError(new Error(l.hint||l.msg||`Upload failed (HTTP ${t.status})`))}),t.addEventListener("error",()=>{i||e.onError(new Error("Network error — check your connection"))}),t.addEventListener("timeout",()=>{i||e.onError(new Error("Upload timed out"))}),!n.remoteUrl)return e.onError(new Error("Remote URL is required for URL upload")),{abort(){}};const a={files_urls:[{url:n.remoteUrl,name:n.name}],dir:e.folder};return t.timeout=6e4,t.send(JSON.stringify(a)),{abort(){i=!0,t.abort()}}}function Q(n){return{Accept:"application/json","Content-Type":"application/json","uppy-auth-token":n}}function H(n){return n.replace(/\/+$/,"")}const je={"google-drive":"drive",dropbox:"dropbox",onedrive:"onedrive",box:"box",instagram:"instagram",facebook:"facebook",unsplash:"unsplash"};function Y(n){return je[n]??n}function Le(n,e){const t=H(n),i=btoa(JSON.stringify({origin:window.location.origin})),r=Y(e);return`${t}/${r}/connect?state=${encodeURIComponent(i)}`}async function Me(n,e,t,i=""){const r=H(n),o=i?`/${i}`:"",a=Y(e),l=await fetch(`${r}/${a}/list${o}`,{method:"GET",headers:Q(t),credentials:"same-origin"});if(l.status===401)throw new ee;if(!l.ok){const d=await l.json().catch(()=>null);throw new Error((d==null?void 0:d.message)||`Companion list failed (HTTP ${l.status})`)}return l.json()}async function Be(n,e,t){const i=H(n),r=await fetch(`${i}/${t}`,{method:"GET",headers:Q(e),credentials:"same-origin"});if(r.status===401)throw new ee;if(!r.ok){const o=await r.json().catch(()=>null);throw new Error((o==null?void 0:o.message)||`Companion list failed (HTTP ${r.status})`)}return r.json()}async function Re(n,e,t,i){const r=H(n),o=Y(e),a=i?`q=${encodeURIComponent(t)}&${i}`:`q=${encodeURIComponent(t)}`,l=await fetch(`${r}/search/${o}/list?${a}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"same-origin"});if(!l.ok){const d=await l.json().catch(()=>null);throw new Error((d==null?void 0:d.message)||`Search failed (HTTP ${l.status})`)}return l.json()}async function Ae(n,e,t,i,r,o=!1){const a=H(n),l=Y(e),d=o?`${a}/search/${l}/get/${i}`:`${a}/${l}/get/${i}`,c=o?{Accept:"application/json","Content-Type":"application/json"}:Q(t),h=await fetch(d,{method:"POST",headers:c,credentials:"same-origin",body:JSON.stringify({...r,httpMethod:r.httpMethod??"POST",useFormData:r.useFormData??!0,fieldname:r.fieldname??"files[]"})});if(h.status===401)throw new ee;if(!h.ok){const x=await h.json().catch(()=>null);throw new Error((x==null?void 0:x.message)||`Companion upload failed (HTTP ${h.status})`)}return h.json()}async function Ie(n,e,t){const i=H(n),r=Y(e),o=await fetch(`${i}/${r}/logout`,{method:"GET",headers:Q(t),credentials:"same-origin"});return o.ok?o.json():{ok:!1,revoked:!1}}function He(n){var r;const t=((r=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(n))==null?void 0:r[1])??n;return`${location.protocol==="https:"?"wss":"ws"}://${t}`}class ee extends Error{constructor(){super("Authentication expired"),this.name="AuthExpiredError"}}function qe(n,e){const t=n.remoteInfo;if(!t)return e.onError(new Error("remoteInfo is required for companion upload")),{abort(){}};let i=!1,r=null;const a=`${e.apiBase.replace(/\/+$/,"")}/v4/files?folder=${encodeURIComponent(e.folder)}`,l={};n.meta&&Object.keys(n.meta).length>0&&Object.assign(l,n.meta),n.tags&&n.tags.length>0&&(l.tags=n.tags);const d=!t.token;return Ae(t.companionUrl,t.provider,t.token,t.requestPath,{fileId:t.fileId,endpoint:a,headers:e.authHeaders,size:t.size,metadata:Object.keys(l).length>0?l:void 0},d).then(c=>{if(i)return;const x=`${He(t.companionUrl)}/api/${c.token}`;try{r=new WebSocket(x)}catch{e.onError(new Error("Failed to connect to upload progress channel"));return}r.onmessage=u=>{var f,v,w;if(!i)try{const m=JSON.parse(u.data);switch(m.action){case"progress":{const b=m.payload,y=b.bytesUploaded??0,E=b.bytesTotal??(t.size||1);e.onProgress(y,E);break}case"success":{const b=m.payload;if(r==null||r.close(),(f=b.response)!=null&&f.responseText)try{const y=JSON.parse(b.response.responseText);if(y.status==="success"){e.onComplete(y);return}e.onError(new Error(y.msg||"Upload failed"));return}catch{}e.onError(new Error("Upload completed but no valid response received"));break}case"error":{r==null||r.close();const b=m.payload;let y=((v=b.error)==null?void 0:v.message)||"Upload failed";if((w=b.response)!=null&&w.responseText)try{const E=JSON.parse(b.response.responseText);y=E.hint||E.msg||E.message||y}catch{}e.onError(new Error(y));break}}}catch{}},r.onerror=()=>{i||e.onError(new Error("Upload progress connection failed"))},r.onclose=()=>{r=null}}).catch(c=>{i||e.onError(c instanceof Error?c:new Error(String(c)))}),{abort(){if(i=!0,r){try{r.send(JSON.stringify({action:"cancel",payload:{}}))}catch{}r.close(),r=null}}}}class Ue{constructor(e,t){this.activeUploads=new Map,this.retryTimers=new Map,this.unsubscribe=null,this.store=e,this.config=t}start(){this.unsubscribe||(this.unsubscribe=this.store.subscribe(()=>this.processQueue()),this.processQueue())}uploadAll(){const{files:e}=this.store.getState();let t=!1;for(const i of e.values())i.status==="idle"?(S(this.store,i.id,{status:"queued"}),t=!0):i.status==="queued"&&(t=!0);t&&(this.store.setState({isUploading:!0}),this.processQueue())}retryFile(e){const t=this.store.getState().files.get(e);!t||t.status!=="error"&&t.status!=="failed"||(S(this.store,e,{status:"queued",error:null,progress:0,bytesUploaded:0,speed:0}),this.processQueue())}retryAll(){const{files:e}=this.store.getState();for(const t of e.values())(t.status==="error"||t.status==="failed")&&S(this.store,t.id,{status:"queued",error:null,progress:0,bytesUploaded:0,speed:0});this.processQueue()}cancelFile(e){const t=this.store.getState().files.get(e);!t||!we(t.status)||(this.abortUpload(e),S(this.store,e,{status:"cancelled"}))}cancelAll(){const{files:e}=this.store.getState();for(const t of e.values())we(t.status)&&(this.abortUpload(t.id),S(this.store,t.id,{status:"cancelled"}));this.store.setState({isUploading:!1})}updateConfig(e){Object.assign(this.config,e)}destroy(){var e;for(const t of this.activeUploads.keys())this.abortUpload(t);for(const t of this.retryTimers.values())clearTimeout(t);this.retryTimers.clear(),(e=this.unsubscribe)==null||e.call(this),this.unsubscribe=null}processQueue(){const e=this.store.getState();if(e.isPaused)return;const{concurrency:t}=e.queueConfig,i=this.activeUploads.size,r=t-i;if(r<=0)return;const a=[...e.files.values()].filter(l=>l.status==="queued").sort((l,d)=>l.retryCount!==d.retryCount?d.retryCount-l.retryCount:l.addedAt-d.addedAt).slice(0,r);for(const l of a)this.startUpload(l)}startUpload(e){S(this.store,e.id,{status:"uploading",error:null});let t=0,i=Date.now(),r=0;const o={apiBase:this.config.apiBase,authHeaders:this.config.authHeaders,folder:this.store.getState().targetFolder,onComplete:d=>this.handleComplete(e.id,d),onError:d=>this.handleError(e.id,d)},a=(d,c)=>{const h=Date.now(),x=(h-i)/1e3;if(x>0){const f=(d-t)/x;r=r===0?f:.3*f+.7*r}t=d,i=h;const u=c>0?Math.min(d/c*100,100):0;S(this.store,e.id,{progress:u,bytesUploaded:d,speed:r}),this.updateTotalProgress()};let l;e.remoteInfo?l=qe(e,{...o,onProgress:a}):e.remoteUrl?l=Te(e,o):l=Oe(e,{...o,onProgress:a}),this.activeUploads.set(e.id,l)}handleComplete(e,t){this.activeUploads.delete(e),S(this.store,e,{status:"complete",progress:100,response:t}),this.updateTotalProgress(),this.checkAllComplete(),this.processQueue()}handleError(e,t){this.activeUploads.delete(e);const i=this.store.getState().files.get(e);if(!i)return;const{retryConfig:r}=this.store.getState().queueConfig,o=i.retryCount+1;if(o<=r.maxRetries){const a=Math.min(r.baseDelay*Math.pow(r.backoffFactor,i.retryCount),r.maxDelay);S(this.store,e,{status:"retrying",error:t.message,retryCount:o});const l=setTimeout(()=>{this.retryTimers.delete(e),S(this.store,e,{status:"queued"}),this.processQueue()},a);this.retryTimers.set(e,l)}else S(this.store,e,{status:"failed",error:t.message}),this.checkAllComplete(),this.processQueue()}abortUpload(e){var i;(i=this.activeUploads.get(e))==null||i.abort(),this.activeUploads.delete(e);const t=this.retryTimers.get(e);t&&(clearTimeout(t),this.retryTimers.delete(e))}updateTotalProgress(){const{files:e}=this.store.getState();let t=0,i=0,r=0;for(const o of e.values())(o.status==="queued"||o.status==="uploading"||o.status==="retrying"||o.status==="complete"||o.status==="failed")&&(t+=o.size,i+=o.status==="complete"?o.size:o.bytesUploaded),o.status==="uploading"&&(r+=o.speed);this.store.setState({totalBytes:t,totalBytesUploaded:i,totalSpeed:r,totalProgress:t>0?Math.min(i/t*100,100):0})}checkAllComplete(){const{files:e}=this.store.getState();![...e.values()].some(i=>i.status==="queued"||i.status==="uploading"||i.status==="retrying")&&this.store.getState().isUploading&&this.store.setState({isUploading:!1})}}function we(n){return n==="queued"||n==="uploading"||n==="retrying"}function te(n){return`https://api.filerobot.com/${n}`}async function ze(n,e){const t=`${te(n)}/key/${encodeURIComponent(e)}`,i=new AbortController,r=setTimeout(()=>i.abort(),3e4);try{const o=await fetch(t,{signal:i.signal});if(clearTimeout(r),!o.ok)throw new Error(`SASS key exchange failed (HTTP ${o.status})`);const a=await o.json();if(a.status==="error")throw new Error(`SASS key exchange failed: ${a.msg||"Unknown error"}`);return a.key}catch(o){throw clearTimeout(r),o instanceof DOMException&&o.name==="AbortError"?new Error("SASS key exchange timed out"):o}}function K(n,e){const t={};switch(n.mode){case"security-template":if(!e)throw new Error("[sfx-uploader] Cannot build auth headers for security-template mode: SASS key exchange has not been performed. Call resolveAuth() first or use sass-key mode with a pre-resolved key.");t["X-Filerobot-Key"]=e;break;case"sass-key":t["X-Filerobot-Key"]=n.sassKey;break}return n.airboxPuid&&(t["X-Filerobot-Airbox-Puid"]=n.airboxPuid),t}async function Pe(n){const e=te(n.container);if(n.mode==="security-template"){const t=await ze(n.container,n.securityTemplateId);return{apiBase:e,headers:K(n,t),sassKey:t}}return{apiBase:e,headers:K(n)}}const g={FILE_ADDED:"sfx-file-added",FILE_REMOVED:"sfx-file-removed",FILE_REJECTED:"sfx-file-rejected",UPLOAD_STARTED:"sfx-upload-started",UPLOAD_PROGRESS:"sfx-upload-progress",UPLOAD_COMPLETE:"sfx-upload-complete",UPLOAD_ERROR:"sfx-upload-error",UPLOAD_RETRY:"sfx-upload-retry",ALL_COMPLETE:"sfx-all-complete",TOTAL_PROGRESS:"sfx-total-progress",BEFORE_UPLOAD:"sfx-before-upload",OPEN:"sfx-open",CLOSE:"sfx-close",CANCEL:"sfx-cancel",COMPLETE_ACTION:"sfx-complete-action",FILE_PREVIEW:"sfx-file-preview",FILL_METADATA:"sfx-fill-metadata"};let Ye=0;function B(){return`file-${Date.now()}-${++Ye}`}function R(n){if(n<=0)return"0 B";const e=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(n)/Math.log(1024)),e.length-1),i=n/Math.pow(1024,t);return`${t===0?i:i.toFixed(1)} ${e[t]}`}function ie(n){if(!isFinite(n)||n<=0)return"0s";const e=Math.round(n);if(e<60)return`${e}s`;const t=Math.floor(e/60),i=e%60;return i>0?`${t}m ${i}s`:`${t}m`}function q(n){var t;const e=((t=n.name.split(".").pop())==null?void 0:t.toLowerCase())??"";return n.type.startsWith("image/")?"image":n.type.startsWith("video/")||["mp4","mov","avi","webm","mkv"].includes(e)?"vid":n.type==="application/pdf"||e==="pdf"?"pdf":["doc","docx","xls","xlsx","ppt","pptx","txt","rtf","odt"].includes(e)?"doc":["zip","rar","7z","tar","gz","bz2"].includes(e)?"zip":"gen"}function Ve(n){const e=n.lastIndexOf(".");return e>=0?n.slice(e+1).toUpperCase():""}const Ne={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",mp4:"video/mp4",mov:"video/quicktime",avi:"video/x-msvideo",webm:"video/webm",pdf:"application/pdf",zip:"application/zip",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};function Xe(n){var t;const e=((t=n.split(".").pop())==null?void 0:t.toLowerCase())??"";return Ne[e]||""}function We(n){return new Promise(e=>{const t=document.createElement("video");t.preload="metadata",t.muted=!0,t.playsInline=!0;const i=URL.createObjectURL(n);let r=!1;const o=()=>{r||(r=!0,e(null)),t.removeAttribute("src"),t.load(),URL.revokeObjectURL(i)};t.addEventListener("seeked",()=>{try{const a=document.createElement("canvas");a.width=t.videoWidth||320,a.height=t.videoHeight||240;const l=a.getContext("2d");if(l){l.drawImage(t,0,0,a.width,a.height),a.toBlob(d=>{r||(r=!0,e(d?URL.createObjectURL(d):null),t.removeAttribute("src"),t.load(),URL.revokeObjectURL(i))},"image/jpeg",.7);return}}catch{}o()},{once:!0}),t.addEventListener("error",()=>o(),{once:!0}),setTimeout(()=>o(),5e3),t.src=i,t.addEventListener("loadeddata",()=>{t.currentTime=.1},{once:!0})})}function oe(n,e,t){var i,r;if(e.maxFileSize!=null&&n.size>0&&n.size>e.maxFileSize)return`File exceeds ${(e.maxFileSize/1048576).toFixed(1)} MB limit`;if(e.maxTotalFilesSize!=null&&n.size>0){let o=n.size;for(const a of t.values())a.status!=="rejected"&&a.status!=="cancelled"&&(o+=a.size);if(o>e.maxTotalFilesSize)return"Total file size limit exceeded"}if(e.maxNumberOfFiles!=null){let o=0;for(const a of t.values())a.status!=="rejected"&&a.status!=="cancelled"&&o++;if(o>=e.maxNumberOfFiles)return`Maximum ${e.maxNumberOfFiles} files allowed`}if(e.allowedFileTypes!=null){const o=e.allowedFileTypes,a="."+(((i=n.name.split(".").pop())==null?void 0:i.toLowerCase())??"");if(!o.some(d=>d.startsWith(".")?a===d.toLowerCase():d.endsWith("/*")?n.type.startsWith(d.slice(0,-1)):n.type===d))return"File type not allowed"}if(e.blockedFileTypes!=null){const o=e.blockedFileTypes,a="."+(((r=n.name.split(".").pop())==null?void 0:r.toLowerCase())??"");if(o.some(d=>d.startsWith(".")?a===d.toLowerCase():d.endsWith("/*")?n.type.startsWith(d.slice(0,-1)):n.type===d))return"File type is blocked"}return null}function Ge(n,e,t){return oe(n,e,t)}function ye(n){return n.allowedFileTypes?n.allowedFileTypes.join(","):""}const _e={"google-drive":{id:"google-drive",label:"Google Drive",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:transparent"><svg width="16" height="16" viewBox="0 0 87.3 78"><path d="M6.6 66.85l3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3L27.5 53H0c0 1.55.4 3.1 1.2 4.5z" fill="#0066da"/><path d="M43.65 25L29.9 1.2C28.55 2 27.4 3.1 26.6 4.5L1.2 48.5C.4 49.9 0 51.45 0 53h27.5z" fill="#00ac47"/><path d="M73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5H59.8l5.65 10.85z" fill="#ea4335"/><path d="M43.65 25L57.4 1.2C56.05.4 54.5 0 52.9 0H34.4c-1.6 0-3.15.45-4.5 1.2z" fill="#00832d"/><path d="M59.8 53H27.5L13.75 76.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z" fill="#2684fc"/><path d="M73.4 26.5l-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3L43.65 25 59.8 53h27.45c0-1.55-.4-3.1-1.2-4.5z" fill="#ffba00"/></svg></span>'},dropbox:{id:"dropbox",label:"Dropbox",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#0061ff"><svg width="11" height="11" viewBox="0 0 528 512" fill="white"><path d="M264.4 116.3l-132 84.3 132 84.3-132 84.3L0 284.1l132.3-84.3L0 116.3 132.3 32l132.1 84.3zm-132 284.5l132-84.3 132 84.3-132 84.4-132-84.4zm132-116.6l132.3-84.3-132.3-83.9 131.6-84.3L528 116.3l-132.3 84.1L528 284.7l-132.4 83.9-131.2-84.4z"/></svg></span>'},onedrive:{id:"onedrive",label:"OneDrive",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#0078d4"><svg width="11" height="11" viewBox="0 0 24 24" fill="white"><path d="M10.5 13.5C10.5 11.57 12.07 10 14 10h6.5c.17 0 .34.01.5.02A6 6 0 009.01 11.6 4 4 0 0010.5 13.5zM12 14.5a5 5 0 00-5-5 5 5 0 00-5 5 3 3 0 003 3h9.5A3.5 3.5 0 0018 14c0-.18-.01-.35-.03-.52A5.48 5.48 0 0112 14.5z"/></svg></span>'},box:{id:"box",label:"Box",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#0e50a0;font-size:9px;font-weight:800;color:#fff">box</span>'},instagram:{id:"instagram",label:"Instagram",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888)"><svg width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M12 2.16c2.94 0 3.29.01 4.45.06 1.07.05 1.8.22 2.43.46.66.25 1.21.6 1.77 1.16.55.55.9 1.1 1.16 1.77.25.64.41 1.37.46 2.43.05 1.16.06 1.51.06 4.45s-.01 3.29-.06 4.45c-.05 1.07-.22 1.8-.46 2.43a4.9 4.9 0 01-1.16 1.77c-.55.55-1.1.9-1.77 1.16-.64.25-1.37.41-2.43.46-1.16.05-1.51.06-4.45.06s-3.29-.01-4.45-.06c-1.07-.05-1.8-.22-2.43-.46a4.9 4.9 0 01-1.77-1.16 4.9 4.9 0 01-1.16-1.77c-.25-.64-.41-1.37-.46-2.43C2.17 15.29 2.16 14.94 2.16 12s.01-3.29.06-4.45c.05-1.07.22-1.8.46-2.43a4.9 4.9 0 011.16-1.77A4.9 4.9 0 015.61 2.2c.64-.25 1.37-.41 2.43-.46C9.21 2.17 9.56 2.16 12 2.16zM12 16a4 4 0 110-8 4 4 0 010 8zm6.4-9.85a1.44 1.44 0 100 2.88 1.44 1.44 0 000-2.88z"/></svg></span>'},facebook:{id:"facebook",label:"Facebook",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#1877f2"><svg width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M24 12.07C24 5.41 18.63 0 12 0S0 5.41 0 12.07c0 6.02 4.39 11.02 10.12 11.93v-8.44H7.08v-3.49h3.04V9.41c0-3.02 1.79-4.69 4.53-4.69 1.31 0 2.68.24 2.68.24v2.97h-1.51c-1.49 0-1.95.93-1.95 1.89v2.26h3.33l-.53 3.49h-2.8v8.44C19.61 23.09 24 18.09 24 12.07z"/></svg></span>'},unsplash:{id:"unsplash",label:"Unsplash",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#111"><svg width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M8.5 11.5v5h7v-5h5.5V21h-18v-9.5h5.5zm7-8v5h-7v-5h7z"/></svg></span>'}};function De(n){return n.filter(e=>e in _e).map(e=>_e[e])}var Ke=Object.defineProperty,Ze=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&Ke(e,t,r),r};const Je='<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>',Qe='<path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"/>',et='<path d="M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"/><circle cx="12" cy="13" r="4"/>',tt='<rect x="2" y="3" width="20" height="14" rx="2"/><circle cx="12" cy="10" r="1"/><path d="M7 21l5-5 5 5"/>',A=[{id:"device",label:"My Device",icon:Je,iconColor:"#2563eb"},{id:"url",label:"URL link",icon:Qe,iconColor:"#16a34a"},{id:"camera",label:"Camera",icon:et,iconColor:"#7c3aed"},{id:"screen-cast",label:"Screen capture",icon:tt,iconColor:"#ea580c"}],le=class le extends s.LitElement{constructor(){super(...arguments),this.sources=A}_handleClick(e){this.dispatchEvent(new CustomEvent("source-click",{detail:{source:e.id},bubbles:!0,composed:!0}))}render(){return s.html`
|
|
2
|
+
${this.sources.map(e=>s.html`
|
|
3
|
+
<button @click=${()=>this._handleClick(e)}>
|
|
4
|
+
${e.brandHtml?D.unsafeHTML(e.brandHtml):s.svg`<svg viewBox="0 0 24 24" class=${e.fillIcon?"fill-icon":""}>${U.unsafeSVG(e.icon)}</svg>`}
|
|
5
|
+
${e.label}
|
|
6
|
+
</button>
|
|
7
|
+
`)}
|
|
8
|
+
`}};le.styles=s.css`
|
|
9
|
+
:host {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
button {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 9px;
|
|
20
|
+
padding: 13px 24px;
|
|
21
|
+
border-radius: 50px;
|
|
22
|
+
border: 1.5px solid var(--sfx-up-border, #e8edf5);
|
|
23
|
+
background: var(--sfx-up-bg, #fff);
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
color: var(--sfx-up-text-secondary, #475569);
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
transition: all 0.18s ease;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
|
31
|
+
font-family: inherit;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
button:hover {
|
|
35
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
36
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
37
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
38
|
+
box-shadow: 0 2px 10px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
|
|
39
|
+
transform: translateY(-1px);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
button:active {
|
|
43
|
+
transform: translateY(0) scale(0.98);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host > button > svg {
|
|
47
|
+
width: 17px;
|
|
48
|
+
height: 17px;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
fill: none;
|
|
51
|
+
stroke: currentColor;
|
|
52
|
+
stroke-width: 2;
|
|
53
|
+
stroke-linecap: round;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host > button > svg.fill-icon {
|
|
57
|
+
fill: currentColor;
|
|
58
|
+
stroke: none;
|
|
59
|
+
stroke-width: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.brand-ico {
|
|
63
|
+
width: 20px;
|
|
64
|
+
height: 20px;
|
|
65
|
+
border-radius: 5px;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
line-height: 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.brand-ico svg {
|
|
74
|
+
width: auto;
|
|
75
|
+
height: auto;
|
|
76
|
+
fill: white;
|
|
77
|
+
stroke: none;
|
|
78
|
+
stroke-width: 0;
|
|
79
|
+
}
|
|
80
|
+
`;let Z=le;Ze([p.property({type:Array})],Z.prototype,"sources");var rt=Object.defineProperty,P=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&rt(e,t,r),r};const ke=3,de=class de extends s.LitElement{constructor(){super(...arguments),this.compact=!1,this.externalDragOver=!1,this.accept="",this.sources=[],this.sourcesLayout="pills",this._dragOver=!1,this._moreOpen=!1,this._visiblePills=ke,this._dragCounter=0,this._onDragEnter=e=>{e.preventDefault(),this._dragCounter++,this._dragCounter===1&&(this._dragOver=!0)},this._onDragOver=e=>{e.preventDefault()},this._onDragLeave=e=>{e.preventDefault(),this._dragCounter--,this._dragCounter<=0&&(this._dragCounter=0,this._dragOver=!1)},this._onDrop=e=>{var i;e.preventDefault(),e.stopPropagation(),this._dragCounter=0,this._dragOver=!1;const t=Array.from(((i=e.dataTransfer)==null?void 0:i.files)??[]);t.length>0&&this._emitFiles(t)},this._onClick=e=>{const t=this.shadowRoot.querySelector(".drop-zone");if(t&&this._rippleEl){const i=t.getBoundingClientRect();this._rippleEl.style.left=`${e.clientX-i.left}px`,this._rippleEl.style.top=`${e.clientY-i.top}px`,this._rippleEl.classList.remove("go"),this._rippleEl.offsetWidth,this._rippleEl.classList.add("go")}this.browse()},this._onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.browse())},this._onFileChange=e=>{const t=e.target,i=Array.from(t.files??[]);i.length>0&&this._emitFiles(i),t.value=""},this._onPaste=e=>{var r;if(!this.isConnected||this.offsetWidth===0)return;const t=(r=e.clipboardData)==null?void 0:r.items;if(!t)return;const i=[];for(const o of t)if(o.kind==="file"){const a=o.getAsFile();a&&i.push(a)}i.length>0&&(e.preventDefault(),this._emitFiles(i))},this._onDocClick=()=>{this._moreOpen&&(this._moreOpen=!1)},this._onDocKeyDown=e=>{e.key==="Escape"&&this._moreOpen&&(this._moreOpen=!1)},this._resizeTimer=null,this._onScrollOrResize=()=>{this._moreOpen&&this._positionDropdown(),this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>this._updateVisiblePills(),100)}}browse(){var e;(e=this.fileInput)==null||e.click()}_onSourceIconClick(e){this.dispatchEvent(new CustomEvent("source-click",{detail:{source:e.id},bubbles:!0,composed:!0}))}_emitFiles(e){this.dispatchEvent(new CustomEvent("files-selected",{detail:{files:e},bubbles:!0,composed:!0}))}_toggleMore(e){e.stopPropagation(),this._moreOpen=!this._moreOpen,this._moreOpen&&requestAnimationFrame(()=>this._positionDropdown())}_positionDropdown(){var x,u;const e=(x=this.shadowRoot)==null?void 0:x.querySelector(".more-wrap > button"),t=(u=this.shadowRoot)==null?void 0:u.querySelector(".more-dropdown");if(!e||!t)return;const i=e.getBoundingClientRect(),r=8,o=t.scrollHeight,a=t.offsetWidth,l=i.top,d=window.innerHeight-i.bottom;l>=o+r||l>d?(t.classList.add("above"),t.classList.remove("below"),t.style.top=`${i.top-o-r}px`):(t.classList.add("below"),t.classList.remove("above"),t.style.top=`${i.bottom+r}px`);let h=i.right-a;h=Math.max(8,Math.min(h,window.innerWidth-a-8)),t.style.left=`${h}px`}_onMoreItemClick(e,t){t.stopPropagation(),this._moreOpen=!1,this._onSourceIconClick(e)}_updateVisiblePills(){const e=window.innerWidth;this.sourcesLayout==="cards"?e<=480?this._visiblePills=2:e<=768?this._visiblePills=3:this._visiblePills=5:e<=480?this._visiblePills=1:e<=768?this._visiblePills=2:this._visiblePills=ke}connectedCallback(){super.connectedCallback(),document.addEventListener("paste",this._onPaste),document.addEventListener("click",this._onDocClick),document.addEventListener("keydown",this._onDocKeyDown),window.addEventListener("scroll",this._onScrollOrResize,!0),window.addEventListener("resize",this._onScrollOrResize),this._updateVisiblePills()}updated(e){e.has("sourcesLayout")&&this._updateVisiblePills()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("paste",this._onPaste),document.removeEventListener("click",this._onDocClick),document.removeEventListener("keydown",this._onDocKeyDown),window.removeEventListener("scroll",this._onScrollOrResize,!0),window.removeEventListener("resize",this._onScrollOrResize),this._resizeTimer&&clearTimeout(this._resizeTimer)}_renderPill(e){return s.html`
|
|
81
|
+
<button
|
|
82
|
+
class="src-pill"
|
|
83
|
+
@click=${t=>{t.stopPropagation(),this._onSourceIconClick(e)}}
|
|
84
|
+
>
|
|
85
|
+
${e.brandHtml?D.unsafeHTML(e.brandHtml):s.html`<span class="pill-ico" style=${e.iconColor?`color:${e.iconColor}`:""}>
|
|
86
|
+
${s.svg`<svg viewBox="0 0 24 24" class=${e.fillIcon?"fill-icon":""}>${U.unsafeSVG(e.icon)}</svg>`}
|
|
87
|
+
</span>`}
|
|
88
|
+
${e.label}
|
|
89
|
+
</button>
|
|
90
|
+
`}_renderCard(e){return s.html`
|
|
91
|
+
<button
|
|
92
|
+
class="src-card"
|
|
93
|
+
aria-label=${e.label}
|
|
94
|
+
@click=${t=>{t.stopPropagation(),this._onSourceIconClick(e)}}
|
|
95
|
+
>
|
|
96
|
+
${e.brandHtml?s.html`<span class="card-ico">${D.unsafeHTML(e.brandHtml)}</span>`:s.html`<span class="card-ico" style=${e.iconColor?`color:${e.iconColor}`:""}>
|
|
97
|
+
${s.svg`<svg viewBox="0 0 24 24" class=${e.fillIcon?"fill-icon":""}>${U.unsafeSVG(e.icon)}</svg>`}
|
|
98
|
+
</span>`}
|
|
99
|
+
<span class="card-label">${e.label}</span>
|
|
100
|
+
</button>
|
|
101
|
+
`}_renderMoreCard(e){return s.html`
|
|
102
|
+
<div class="more-wrap ${this._moreOpen?"open":""}">
|
|
103
|
+
<button class="src-card" @click=${t=>this._toggleMore(t)}>
|
|
104
|
+
<span class="card-ico" style="color: var(--sfx-up-text-muted, #94a3b8)">
|
|
105
|
+
<svg viewBox="0 0 24 24" style="fill: currentColor; stroke: none">
|
|
106
|
+
<circle cx="5" cy="12" r="2.5"/>
|
|
107
|
+
<circle cx="12" cy="12" r="2.5"/>
|
|
108
|
+
<circle cx="19" cy="12" r="2.5"/>
|
|
109
|
+
</svg>
|
|
110
|
+
</span>
|
|
111
|
+
<span class="card-label">More</span>
|
|
112
|
+
</button>
|
|
113
|
+
<div class="more-dropdown">
|
|
114
|
+
${e.map(t=>s.html`
|
|
115
|
+
<button class="more-item" @click=${i=>this._onMoreItemClick(t,i)}>
|
|
116
|
+
<div class="more-item-ico">
|
|
117
|
+
${t.brandHtml?D.unsafeHTML(t.brandHtml):t.iconColor?s.html`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${U.unsafeSVG(t.icon)}</svg>`:s.svg`<svg viewBox="0 0 24 24">${U.unsafeSVG(t.icon)}</svg>`}
|
|
118
|
+
</div>
|
|
119
|
+
${t.label}
|
|
120
|
+
</button>
|
|
121
|
+
`)}
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
`}_renderMoreDropdown(e){return s.html`
|
|
125
|
+
<div class="more-wrap ${this._moreOpen?"open":""}">
|
|
126
|
+
<button class="more-pill" @click=${t=>this._toggleMore(t)}>
|
|
127
|
+
More
|
|
128
|
+
<svg class="more-chevron" viewBox="0 0 24 24"><polyline points="6 9 12 15 18 9"/></svg>
|
|
129
|
+
</button>
|
|
130
|
+
<div class="more-dropdown">
|
|
131
|
+
${e.map(t=>s.html`
|
|
132
|
+
<button class="more-item" @click=${i=>this._onMoreItemClick(t,i)}>
|
|
133
|
+
<div class="more-item-ico">
|
|
134
|
+
${t.brandHtml?D.unsafeHTML(t.brandHtml):t.iconColor?s.html`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${U.unsafeSVG(t.icon)}</svg>`:s.svg`<svg viewBox="0 0 24 24">${U.unsafeSVG(t.icon)}</svg>`}
|
|
135
|
+
</div>
|
|
136
|
+
${t.label}
|
|
137
|
+
</button>
|
|
138
|
+
`)}
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
`}render(){const e=["drop-zone",this._dragOver||this.externalDragOver?"drag-over":"",this.compact?"compact":""].filter(Boolean).join(" "),t=this.sources.slice(0,this._visiblePills),i=this.sources.slice(this._visiblePills);return s.html`
|
|
142
|
+
<div
|
|
143
|
+
class=${e}
|
|
144
|
+
role="button"
|
|
145
|
+
tabindex="0"
|
|
146
|
+
aria-label="Drop files here or click to browse"
|
|
147
|
+
@dragenter=${this._onDragEnter}
|
|
148
|
+
@dragover=${this._onDragOver}
|
|
149
|
+
@dragleave=${this._onDragLeave}
|
|
150
|
+
@drop=${this._onDrop}
|
|
151
|
+
@click=${this._onClick}
|
|
152
|
+
@keydown=${this._onKeyDown}
|
|
153
|
+
>
|
|
154
|
+
<div class="dz-glow"></div>
|
|
155
|
+
<div class="rings">
|
|
156
|
+
<div class="ring"></div>
|
|
157
|
+
<div class="ring"></div>
|
|
158
|
+
<div class="core">
|
|
159
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
|
|
160
|
+
<polyline points="16 16 12 12 8 16" />
|
|
161
|
+
<line x1="12" y1="12" x2="12" y2="21" />
|
|
162
|
+
<path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3" />
|
|
163
|
+
</svg>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div class="title">
|
|
168
|
+
Drag & Drop or click to <span>browse</span>
|
|
169
|
+
</div>
|
|
170
|
+
${this.compact?s.nothing:s.html`<div class="subtitle">Drop files anywhere on this page</div>`}
|
|
171
|
+
|
|
172
|
+
${!this.compact&&this.sources.length>0?s.html`
|
|
173
|
+
<div class="import-divider"><span>or import from</span></div>
|
|
174
|
+
${this.sourcesLayout==="cards"?s.html`
|
|
175
|
+
<div class="sources-cards">
|
|
176
|
+
${t.map(r=>this._renderCard(r))}
|
|
177
|
+
${i.length>0?this._renderMoreCard(i):s.nothing}
|
|
178
|
+
</div>
|
|
179
|
+
`:s.html`
|
|
180
|
+
<div class="sources-grid">
|
|
181
|
+
${t.map(r=>this._renderPill(r))}
|
|
182
|
+
${i.length>0?this._renderMoreDropdown(i):s.nothing}
|
|
183
|
+
</div>
|
|
184
|
+
`}
|
|
185
|
+
`:s.nothing}
|
|
186
|
+
|
|
187
|
+
${this.compact&&this.sources.length>0?s.html`
|
|
188
|
+
<div class="sources-row">
|
|
189
|
+
${this.sources.map(r=>s.html`
|
|
190
|
+
<button
|
|
191
|
+
class="src-ico"
|
|
192
|
+
style=${r.iconColor&&!r.brandHtml?`color:${r.iconColor}`:""}
|
|
193
|
+
data-tip=${r.label}
|
|
194
|
+
aria-label=${r.label}
|
|
195
|
+
@click=${o=>{o.stopPropagation(),this._onSourceIconClick(r)}}
|
|
196
|
+
>
|
|
197
|
+
${r.brandHtml?D.unsafeHTML(r.brandHtml):s.svg`<svg viewBox="0 0 24 24" class=${r.fillIcon?"fill-icon":""}>${U.unsafeSVG(r.icon)}</svg>`}
|
|
198
|
+
</button>
|
|
199
|
+
`)}
|
|
200
|
+
</div>
|
|
201
|
+
`:s.nothing}
|
|
202
|
+
|
|
203
|
+
<div class="ripple"></div>
|
|
204
|
+
<input
|
|
205
|
+
type="file"
|
|
206
|
+
multiple
|
|
207
|
+
accept=${this.accept||s.nothing}
|
|
208
|
+
@change=${this._onFileChange}
|
|
209
|
+
/>
|
|
210
|
+
</div>
|
|
211
|
+
`}};de.styles=s.css`
|
|
212
|
+
:host {
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-shrink: 0;
|
|
215
|
+
flex: 1;
|
|
216
|
+
min-height: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
:host([compact]) {
|
|
220
|
+
flex: 0 0 auto;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.drop-zone {
|
|
224
|
+
border: none;
|
|
225
|
+
border-radius: 12px;
|
|
226
|
+
background: var(--sfx-up-bg, #fff);
|
|
227
|
+
padding: 50px 40px 50px;
|
|
228
|
+
display: flex;
|
|
229
|
+
flex-direction: column;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
text-align: center;
|
|
233
|
+
cursor: pointer;
|
|
234
|
+
position: relative;
|
|
235
|
+
overflow: visible;
|
|
236
|
+
transition: background 0.22s;
|
|
237
|
+
user-select: none;
|
|
238
|
+
flex: 1;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.drop-zone:hover {
|
|
242
|
+
background: transparent;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* Drag over state */
|
|
246
|
+
.drop-zone.drag-over {
|
|
247
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.drag-over .ring {
|
|
251
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
252
|
+
animation-duration: 3s;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.drag-over .ring:nth-child(2) {
|
|
256
|
+
border-color: var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.4));
|
|
257
|
+
animation-duration: 2s;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.drag-over .core {
|
|
261
|
+
background: var(--sfx-up-primary, #2563eb);
|
|
262
|
+
color: var(--sfx-up-bg, #fff);
|
|
263
|
+
transform: scale(1.12);
|
|
264
|
+
box-shadow: 0 8px 24px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.38));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* Compact state when files exist */
|
|
268
|
+
.drop-zone.compact {
|
|
269
|
+
padding: 14px 16px;
|
|
270
|
+
flex-direction: row;
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: 12px;
|
|
273
|
+
justify-content: flex-start;
|
|
274
|
+
overflow: visible;
|
|
275
|
+
border: 1.5px dashed var(--sfx-up-ring-color, #c4d5ef);
|
|
276
|
+
border-radius: 12px;
|
|
277
|
+
animation: compactIn 0.3s ease both;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@keyframes compactIn {
|
|
281
|
+
from {
|
|
282
|
+
opacity: 0;
|
|
283
|
+
transform: translateY(-8px);
|
|
284
|
+
}
|
|
285
|
+
to {
|
|
286
|
+
opacity: 1;
|
|
287
|
+
transform: translateY(0);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* --- Radial glow --- */
|
|
292
|
+
.dz-glow {
|
|
293
|
+
position: absolute;
|
|
294
|
+
width: 260px;
|
|
295
|
+
height: 260px;
|
|
296
|
+
top: 20px;
|
|
297
|
+
left: 50%;
|
|
298
|
+
transform: translateX(-50%);
|
|
299
|
+
background: radial-gradient(circle at center, rgba(37, 99, 235, 0.04) 0%, rgba(37, 99, 235, 0.02) 40%, transparent 70%);
|
|
300
|
+
border-radius: 50%;
|
|
301
|
+
pointer-events: none;
|
|
302
|
+
z-index: 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.compact .dz-glow {
|
|
306
|
+
display: none;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/* --- Rings --- */
|
|
310
|
+
.rings {
|
|
311
|
+
width: 120px;
|
|
312
|
+
height: 120px;
|
|
313
|
+
position: relative;
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
justify-content: center;
|
|
317
|
+
margin-bottom: 24px;
|
|
318
|
+
flex-shrink: 0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.ring {
|
|
322
|
+
position: absolute;
|
|
323
|
+
inset: 0;
|
|
324
|
+
border-radius: 50%;
|
|
325
|
+
border: 1.5px dashed var(--sfx-up-ring-color, #c4d5ef);
|
|
326
|
+
animation: slowSpin 20s linear infinite;
|
|
327
|
+
transition: border-color 0.3s;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.ring:nth-child(2) {
|
|
331
|
+
inset: 13px;
|
|
332
|
+
border-color: var(--sfx-up-ring-color-light, #d8e5f5);
|
|
333
|
+
border-style: dotted;
|
|
334
|
+
animation-direction: reverse;
|
|
335
|
+
animation-duration: 14s;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.compact .rings {
|
|
339
|
+
display: none;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* --- Core icon --- */
|
|
343
|
+
.core {
|
|
344
|
+
width: 58px;
|
|
345
|
+
height: 58px;
|
|
346
|
+
border-radius: 50%;
|
|
347
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
348
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
349
|
+
display: flex;
|
|
350
|
+
align-items: center;
|
|
351
|
+
justify-content: center;
|
|
352
|
+
z-index: 1;
|
|
353
|
+
transition: all 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
|
|
354
|
+
box-shadow: 0 3px 12px rgba(37, 99, 235, 0.15);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.core svg {
|
|
358
|
+
width: 26px;
|
|
359
|
+
height: 26px;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.drop-zone:hover .core {
|
|
363
|
+
transform: translateY(-2px);
|
|
364
|
+
box-shadow: 0 5px 18px rgba(37, 99, 235, 0.22);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* --- Text --- */
|
|
368
|
+
.title {
|
|
369
|
+
font-size: 20px;
|
|
370
|
+
font-weight: 700;
|
|
371
|
+
color: var(--sfx-up-text, #1e293b);
|
|
372
|
+
margin-bottom: 6px;
|
|
373
|
+
transition: font-size 0.3s, margin 0.3s;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.title span {
|
|
377
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
378
|
+
cursor: pointer;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.subtitle {
|
|
382
|
+
font-size: 14px;
|
|
383
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
384
|
+
transition: opacity 0.15s;
|
|
385
|
+
margin-bottom: 24px;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.compact .title {
|
|
389
|
+
font-size: 14px;
|
|
390
|
+
font-weight: 600;
|
|
391
|
+
margin-bottom: 0;
|
|
392
|
+
white-space: nowrap;
|
|
393
|
+
overflow: hidden;
|
|
394
|
+
text-overflow: ellipsis;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.compact .subtitle {
|
|
398
|
+
display: none;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* --- "or Import From" divider --- */
|
|
402
|
+
.import-divider {
|
|
403
|
+
display: flex;
|
|
404
|
+
align-items: center;
|
|
405
|
+
gap: 12px;
|
|
406
|
+
width: 100%;
|
|
407
|
+
max-width: 420px;
|
|
408
|
+
margin-bottom: 20px;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.import-divider::before,
|
|
412
|
+
.import-divider::after {
|
|
413
|
+
content: '';
|
|
414
|
+
flex: 1;
|
|
415
|
+
height: 1px;
|
|
416
|
+
background: var(--sfx-up-border, #e2e8f0);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.import-divider span {
|
|
420
|
+
font-size: 12px;
|
|
421
|
+
font-weight: 500;
|
|
422
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
423
|
+
white-space: nowrap;
|
|
424
|
+
letter-spacing: 0.3px;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.compact .import-divider {
|
|
428
|
+
display: none;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* --- Source pills grid (expanded mode) --- */
|
|
432
|
+
.sources-grid {
|
|
433
|
+
display: flex;
|
|
434
|
+
justify-content: center;
|
|
435
|
+
align-items: center;
|
|
436
|
+
gap: 8px;
|
|
437
|
+
flex-wrap: wrap;
|
|
438
|
+
min-height: 92px;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.compact .sources-grid {
|
|
442
|
+
display: none;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.src-pill {
|
|
446
|
+
display: inline-flex;
|
|
447
|
+
align-items: center;
|
|
448
|
+
gap: 8px;
|
|
449
|
+
padding: 9px 18px;
|
|
450
|
+
height: 38px;
|
|
451
|
+
box-sizing: border-box;
|
|
452
|
+
border-radius: 50px;
|
|
453
|
+
border: 1.5px solid rgba(226, 232, 240, 0.6);
|
|
454
|
+
background: rgba(255, 255, 255, 0.7);
|
|
455
|
+
backdrop-filter: blur(8px);
|
|
456
|
+
-webkit-backdrop-filter: blur(8px);
|
|
457
|
+
font-size: 14px;
|
|
458
|
+
font-weight: 500;
|
|
459
|
+
color: var(--sfx-up-text-secondary, #475569);
|
|
460
|
+
cursor: pointer;
|
|
461
|
+
transition: all 0.15s ease;
|
|
462
|
+
white-space: nowrap;
|
|
463
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
|
464
|
+
font-family: inherit;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.src-pill:hover {
|
|
468
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
469
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
470
|
+
background: rgba(239, 246, 255, 0.85);
|
|
471
|
+
box-shadow: 0 2px 10px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
|
|
472
|
+
transform: translateY(-1px);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.src-pill:active {
|
|
476
|
+
transform: translateY(0) scale(0.98);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.src-pill .pill-ico {
|
|
480
|
+
display: flex;
|
|
481
|
+
align-items: center;
|
|
482
|
+
justify-content: center;
|
|
483
|
+
flex-shrink: 0;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.src-pill .pill-ico svg {
|
|
487
|
+
width: 16px;
|
|
488
|
+
height: 16px;
|
|
489
|
+
flex-shrink: 0;
|
|
490
|
+
fill: none;
|
|
491
|
+
stroke: currentColor;
|
|
492
|
+
stroke-width: 2;
|
|
493
|
+
stroke-linecap: round;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.src-pill .pill-ico svg.fill-icon {
|
|
497
|
+
fill: currentColor;
|
|
498
|
+
stroke: none;
|
|
499
|
+
stroke-width: 0;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.src-pill .brand-ico svg {
|
|
503
|
+
width: auto;
|
|
504
|
+
height: auto;
|
|
505
|
+
fill: white;
|
|
506
|
+
stroke: none;
|
|
507
|
+
stroke-width: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.src-pill .canva-ico {
|
|
511
|
+
width: 22px;
|
|
512
|
+
height: 22px;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.src-pill .canva-ico svg {
|
|
516
|
+
width: 22px;
|
|
517
|
+
height: 22px;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/* --- Source cards grid (expanded mode, cards layout) --- */
|
|
521
|
+
.sources-cards {
|
|
522
|
+
display: flex;
|
|
523
|
+
justify-content: center;
|
|
524
|
+
gap: 10px;
|
|
525
|
+
flex-wrap: wrap;
|
|
526
|
+
width: 100%;
|
|
527
|
+
max-width: 700px;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.compact .sources-cards {
|
|
531
|
+
display: none;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.sources-cards > .more-wrap {
|
|
535
|
+
display: contents;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.sources-cards > .more-wrap > .src-card {
|
|
539
|
+
/* restore flex item behaviour lost by display:contents on the wrapper */
|
|
540
|
+
flex: 1;
|
|
541
|
+
min-width: 88px;
|
|
542
|
+
max-width: 130px;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.src-card {
|
|
546
|
+
display: flex;
|
|
547
|
+
flex-direction: column;
|
|
548
|
+
align-items: center;
|
|
549
|
+
justify-content: center;
|
|
550
|
+
gap: 10px;
|
|
551
|
+
padding: 20px 12px 16px;
|
|
552
|
+
border-radius: 16px;
|
|
553
|
+
border: 1.5px solid rgba(226, 232, 240, 0.6);
|
|
554
|
+
background: rgba(255, 255, 255, 0.7);
|
|
555
|
+
backdrop-filter: blur(8px);
|
|
556
|
+
-webkit-backdrop-filter: blur(8px);
|
|
557
|
+
cursor: pointer;
|
|
558
|
+
transition: all 0.18s ease;
|
|
559
|
+
flex: 1;
|
|
560
|
+
min-width: 88px;
|
|
561
|
+
max-width: 130px;
|
|
562
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
|
563
|
+
font-family: inherit;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.src-card:hover {
|
|
567
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
568
|
+
background: rgba(239, 246, 255, 0.85);
|
|
569
|
+
box-shadow: 0 4px 14px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
|
|
570
|
+
transform: translateY(-2px);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.src-card:active {
|
|
574
|
+
transform: translateY(0) scale(0.97);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.src-card .card-ico {
|
|
578
|
+
display: flex;
|
|
579
|
+
align-items: center;
|
|
580
|
+
justify-content: center;
|
|
581
|
+
flex-shrink: 0;
|
|
582
|
+
width: 28px;
|
|
583
|
+
height: 28px;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.src-card .card-ico svg {
|
|
587
|
+
width: 28px;
|
|
588
|
+
height: 28px;
|
|
589
|
+
fill: none;
|
|
590
|
+
stroke: currentColor;
|
|
591
|
+
stroke-width: 2;
|
|
592
|
+
stroke-linecap: round;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.src-card .card-ico svg.fill-icon {
|
|
596
|
+
fill: currentColor;
|
|
597
|
+
stroke: none;
|
|
598
|
+
stroke-width: 0;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.src-card .card-label {
|
|
602
|
+
font-size: 12px;
|
|
603
|
+
font-weight: 500;
|
|
604
|
+
color: var(--sfx-up-text-secondary, #475569);
|
|
605
|
+
white-space: nowrap;
|
|
606
|
+
overflow: hidden;
|
|
607
|
+
text-overflow: ellipsis;
|
|
608
|
+
max-width: 100%;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.src-card .brand-ico {
|
|
612
|
+
width: 28px;
|
|
613
|
+
height: 28px;
|
|
614
|
+
border-radius: 7px;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.src-card .brand-ico svg {
|
|
618
|
+
width: 24px;
|
|
619
|
+
height: 24px;
|
|
620
|
+
fill: white;
|
|
621
|
+
stroke: none;
|
|
622
|
+
stroke-width: 0;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/* Google Drive has transparent background — show SVG at full card-ico size */
|
|
626
|
+
.src-card .brand-ico[style*="transparent"] {
|
|
627
|
+
background: none !important;
|
|
628
|
+
width: auto;
|
|
629
|
+
height: auto;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.src-card .brand-ico[style*="transparent"] svg {
|
|
633
|
+
width: 28px;
|
|
634
|
+
height: 28px;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.src-card .canva-ico {
|
|
638
|
+
width: 32px;
|
|
639
|
+
height: 32px;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.src-card .canva-ico svg {
|
|
643
|
+
width: 32px;
|
|
644
|
+
height: 32px;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/* --- "More" pill + dropdown --- */
|
|
648
|
+
.more-wrap {
|
|
649
|
+
position: relative;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.more-pill {
|
|
653
|
+
display: inline-flex;
|
|
654
|
+
align-items: center;
|
|
655
|
+
gap: 6px;
|
|
656
|
+
padding: 9px 18px;
|
|
657
|
+
border-radius: 50px;
|
|
658
|
+
border: 1.5px solid rgba(226, 232, 240, 0.6);
|
|
659
|
+
background: rgba(255, 255, 255, 0.7);
|
|
660
|
+
backdrop-filter: blur(8px);
|
|
661
|
+
-webkit-backdrop-filter: blur(8px);
|
|
662
|
+
font-size: 14px;
|
|
663
|
+
font-weight: 500;
|
|
664
|
+
color: var(--sfx-up-text-secondary, #475569);
|
|
665
|
+
cursor: pointer;
|
|
666
|
+
transition: all 0.15s ease;
|
|
667
|
+
white-space: nowrap;
|
|
668
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
|
669
|
+
font-family: inherit;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.more-pill:hover,
|
|
673
|
+
.more-wrap.open .more-pill {
|
|
674
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
675
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
676
|
+
background: rgba(239, 246, 255, 0.85);
|
|
677
|
+
box-shadow: 0 2px 10px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.more-pill:hover {
|
|
681
|
+
transform: translateY(-1px);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.more-pill svg {
|
|
685
|
+
flex-shrink: 0;
|
|
686
|
+
fill: none;
|
|
687
|
+
stroke: currentColor;
|
|
688
|
+
stroke-width: 2.2;
|
|
689
|
+
stroke-linecap: round;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.more-chevron {
|
|
693
|
+
width: 12px;
|
|
694
|
+
height: 12px;
|
|
695
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
696
|
+
transition: transform 0.18s ease;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.more-wrap.open .more-chevron {
|
|
700
|
+
transform: rotate(180deg);
|
|
701
|
+
color: currentColor;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/* Dropdown uses position:fixed to escape overflow:hidden ancestors */
|
|
705
|
+
.more-dropdown {
|
|
706
|
+
position: fixed;
|
|
707
|
+
background: var(--sfx-up-bg, #fff);
|
|
708
|
+
border-radius: 12px;
|
|
709
|
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
710
|
+
border: 1px solid var(--sfx-up-border, #e8edf5);
|
|
711
|
+
padding: 6px;
|
|
712
|
+
min-width: 210px;
|
|
713
|
+
max-height: 340px;
|
|
714
|
+
overflow-y: auto;
|
|
715
|
+
z-index: 99999;
|
|
716
|
+
opacity: 0;
|
|
717
|
+
visibility: hidden;
|
|
718
|
+
pointer-events: none;
|
|
719
|
+
transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.more-dropdown.above {
|
|
723
|
+
transform: translateY(-6px);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.more-dropdown.below {
|
|
727
|
+
transform: translateY(6px);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.more-wrap.open .more-dropdown {
|
|
731
|
+
opacity: 1;
|
|
732
|
+
visibility: visible;
|
|
733
|
+
pointer-events: all;
|
|
734
|
+
transform: translateY(0);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.more-item {
|
|
738
|
+
display: flex;
|
|
739
|
+
align-items: center;
|
|
740
|
+
gap: 10px;
|
|
741
|
+
padding: 10px 14px;
|
|
742
|
+
border-radius: 6px;
|
|
743
|
+
border: none;
|
|
744
|
+
background: none;
|
|
745
|
+
width: 100%;
|
|
746
|
+
font-size: 13px;
|
|
747
|
+
font-weight: 500;
|
|
748
|
+
color: var(--sfx-up-text, #1e293b);
|
|
749
|
+
cursor: pointer;
|
|
750
|
+
transition: background 0.15s;
|
|
751
|
+
font-family: inherit;
|
|
752
|
+
white-space: nowrap;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.more-item:hover {
|
|
756
|
+
background: var(--sfx-up-primary-bg, #f5f7fa);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.more-item .more-item-ico {
|
|
760
|
+
width: 32px;
|
|
761
|
+
height: 32px;
|
|
762
|
+
border-radius: 8px;
|
|
763
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
764
|
+
display: flex;
|
|
765
|
+
align-items: center;
|
|
766
|
+
justify-content: center;
|
|
767
|
+
flex-shrink: 0;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.more-item .more-item-ico svg {
|
|
771
|
+
width: 16px;
|
|
772
|
+
height: 16px;
|
|
773
|
+
fill: none;
|
|
774
|
+
stroke: currentColor;
|
|
775
|
+
stroke-width: 2;
|
|
776
|
+
stroke-linecap: round;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.more-item .brand-ico {
|
|
780
|
+
width: 20px;
|
|
781
|
+
height: 20px;
|
|
782
|
+
border-radius: 5px;
|
|
783
|
+
display: flex;
|
|
784
|
+
align-items: center;
|
|
785
|
+
justify-content: center;
|
|
786
|
+
flex-shrink: 0;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.more-item .brand-ico svg {
|
|
790
|
+
fill: white;
|
|
791
|
+
stroke: none;
|
|
792
|
+
stroke-width: 0;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/* --- Brand icon container (for provider logos) --- */
|
|
796
|
+
.brand-ico {
|
|
797
|
+
width: 20px;
|
|
798
|
+
height: 20px;
|
|
799
|
+
border-radius: 5px;
|
|
800
|
+
display: flex;
|
|
801
|
+
align-items: center;
|
|
802
|
+
justify-content: center;
|
|
803
|
+
flex-shrink: 0;
|
|
804
|
+
line-height: 1;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.src-ico .brand-ico {
|
|
808
|
+
width: 20px;
|
|
809
|
+
height: 20px;
|
|
810
|
+
border-radius: 5px;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.src-ico .brand-ico svg {
|
|
814
|
+
width: 12px;
|
|
815
|
+
height: 12px;
|
|
816
|
+
stroke: none;
|
|
817
|
+
stroke-width: 0;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
.src-ico .canva-ico,
|
|
821
|
+
.more-item .canva-ico {
|
|
822
|
+
width: 22px;
|
|
823
|
+
height: 22px;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
.src-ico .canva-ico svg,
|
|
827
|
+
.more-item .canva-ico svg {
|
|
828
|
+
width: 22px;
|
|
829
|
+
height: 22px;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/* --- Source icons row (compact mode) --- */
|
|
833
|
+
.sources-row {
|
|
834
|
+
display: none;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
.compact .sources-row {
|
|
838
|
+
display: flex;
|
|
839
|
+
align-items: center;
|
|
840
|
+
gap: 6px;
|
|
841
|
+
margin-left: auto;
|
|
842
|
+
flex-shrink: 0;
|
|
843
|
+
position: relative;
|
|
844
|
+
z-index: 20;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.src-divider {
|
|
848
|
+
width: 1px;
|
|
849
|
+
height: 24px;
|
|
850
|
+
background: var(--sfx-up-border, #e5e7eb);
|
|
851
|
+
margin-right: 4px;
|
|
852
|
+
flex-shrink: 0;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.src-ico {
|
|
856
|
+
width: 36px;
|
|
857
|
+
height: 36px;
|
|
858
|
+
border-radius: 8px;
|
|
859
|
+
border: 1.5px solid var(--sfx-up-border, #e2e8f0);
|
|
860
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
861
|
+
cursor: pointer;
|
|
862
|
+
display: flex;
|
|
863
|
+
align-items: center;
|
|
864
|
+
justify-content: center;
|
|
865
|
+
transition: all 0.15s ease;
|
|
866
|
+
position: relative;
|
|
867
|
+
flex-shrink: 0;
|
|
868
|
+
color: var(--sfx-up-text-muted, #6b7280);
|
|
869
|
+
padding: 0;
|
|
870
|
+
font-family: inherit;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.src-ico > svg {
|
|
874
|
+
width: 15px;
|
|
875
|
+
height: 15px;
|
|
876
|
+
fill: none;
|
|
877
|
+
stroke: currentColor;
|
|
878
|
+
stroke-width: 2;
|
|
879
|
+
stroke-linecap: round;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
.src-ico > svg.fill-icon {
|
|
883
|
+
fill: currentColor;
|
|
884
|
+
stroke: none;
|
|
885
|
+
stroke-width: 0;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
.src-ico:hover {
|
|
889
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
890
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
891
|
+
transform: translateY(-1px);
|
|
892
|
+
box-shadow: 0 2px 8px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
|
|
893
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
.src-ico::after {
|
|
897
|
+
content: attr(data-tip);
|
|
898
|
+
position: absolute;
|
|
899
|
+
bottom: -28px;
|
|
900
|
+
left: 50%;
|
|
901
|
+
transform: translateX(-50%);
|
|
902
|
+
background: var(--sfx-up-bg, #fff);
|
|
903
|
+
color: var(--sfx-up-text, #374151);
|
|
904
|
+
font-size: 10px;
|
|
905
|
+
font-weight: 500;
|
|
906
|
+
border: 1px solid var(--sfx-up-border, #e5e7eb);
|
|
907
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
908
|
+
padding: 3px 8px;
|
|
909
|
+
border-radius: 5px;
|
|
910
|
+
white-space: nowrap;
|
|
911
|
+
opacity: 0;
|
|
912
|
+
visibility: hidden;
|
|
913
|
+
transition: opacity 0.15s, visibility 0.15s;
|
|
914
|
+
pointer-events: none;
|
|
915
|
+
z-index: 50;
|
|
916
|
+
font-family: inherit;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.src-ico:hover::after {
|
|
920
|
+
opacity: 1;
|
|
921
|
+
visibility: visible;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/* --- Ripple --- */
|
|
925
|
+
.ripple {
|
|
926
|
+
position: absolute;
|
|
927
|
+
width: 10px;
|
|
928
|
+
height: 10px;
|
|
929
|
+
border-radius: 50%;
|
|
930
|
+
background: var(--sfx-up-primary, #2563eb);
|
|
931
|
+
opacity: 0;
|
|
932
|
+
pointer-events: none;
|
|
933
|
+
transform: translate(-50%, -50%) scale(0);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.ripple.go {
|
|
937
|
+
animation: ripple 0.55s ease-out forwards;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/* --- Hidden input --- */
|
|
941
|
+
input[type='file'] {
|
|
942
|
+
display: none;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
@keyframes slowSpin {
|
|
946
|
+
to {
|
|
947
|
+
transform: rotate(360deg);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
@keyframes ripple {
|
|
952
|
+
from {
|
|
953
|
+
transform: translate(-50%, -50%) scale(0);
|
|
954
|
+
opacity: 0.18;
|
|
955
|
+
}
|
|
956
|
+
to {
|
|
957
|
+
transform: translate(-50%, -50%) scale(12);
|
|
958
|
+
opacity: 0;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
.drop-zone:focus-visible,
|
|
963
|
+
.src-pill:focus-visible,
|
|
964
|
+
.src-card:focus-visible,
|
|
965
|
+
.more-pill:focus-visible,
|
|
966
|
+
.src-ico:focus-visible,
|
|
967
|
+
.more-item:focus-visible {
|
|
968
|
+
outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
969
|
+
outline-offset: 2px;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
@media (max-width: 480px) {
|
|
973
|
+
.drop-zone:not(.compact) {
|
|
974
|
+
padding: 32px 20px;
|
|
975
|
+
}
|
|
976
|
+
.title { font-size: 16px; }
|
|
977
|
+
.rings { width: 90px; height: 90px; }
|
|
978
|
+
.core { width: 44px; height: 44px; }
|
|
979
|
+
.core svg { width: 20px; height: 20px; }
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
@media (prefers-reduced-motion: reduce) {
|
|
983
|
+
.ring {
|
|
984
|
+
animation: none;
|
|
985
|
+
}
|
|
986
|
+
.ripple.go {
|
|
987
|
+
animation: none;
|
|
988
|
+
}
|
|
989
|
+
.drop-zone.compact {
|
|
990
|
+
animation: none;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
`;let C=de;P([p.property({type:Boolean,reflect:!0})],C.prototype,"compact");P([p.property({type:Boolean,attribute:"external-drag-over"})],C.prototype,"externalDragOver");P([p.property({type:String})],C.prototype,"accept");P([p.property({type:Array})],C.prototype,"sources");P([p.property({type:String,attribute:"sources-layout"})],C.prototype,"sourcesLayout");P([p.state()],C.prototype,"_dragOver");P([p.state()],C.prototype,"_moreOpen");P([p.state()],C.prototype,"_visiblePills");P([p.query(".ripple")],C.prototype,"_rippleEl");P([p.query('input[type="file"]')],C.prototype,"fileInput");const ce=class ce extends s.LitElement{render(){return s.html`
|
|
994
|
+
<div class="line"></div>
|
|
995
|
+
<div class="label">or import from</div>
|
|
996
|
+
<div class="line"></div>
|
|
997
|
+
`}};ce.styles=s.css`
|
|
998
|
+
:host {
|
|
999
|
+
display: flex;
|
|
1000
|
+
align-items: center;
|
|
1001
|
+
gap: 14px;
|
|
1002
|
+
padding: 20px 0;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
.line {
|
|
1006
|
+
flex: 1;
|
|
1007
|
+
height: 1px;
|
|
1008
|
+
background: var(--sfx-up-border-light, #f1f5f9);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.label {
|
|
1012
|
+
font-size: 11px;
|
|
1013
|
+
font-weight: 600;
|
|
1014
|
+
color: var(--sfx-up-text-muted, #cbd5e1);
|
|
1015
|
+
text-transform: uppercase;
|
|
1016
|
+
letter-spacing: 1px;
|
|
1017
|
+
white-space: nowrap;
|
|
1018
|
+
}
|
|
1019
|
+
`;let se=ce;var it=Object.defineProperty,V=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&it(e,t,r),r};const pe=class pe extends s.LitElement{constructor(){super(...arguments),this.files=[],this.showDropTile=!1,this.sources=[],this.accept="",this._moreOpen=!1,this._outsideClickHandler=e=>{const t=e.composedPath(),i=this.renderRoot.querySelector(".drop-tile-more-wrap");i&&!t.includes(i)&&(this._moreOpen=!1,document.removeEventListener("click",this._outsideClickHandler,!0))}}_onDropTileClick(){const e=this.renderRoot.querySelector('input[type="file"]');e==null||e.click()}_onFileInput(e){const t=e.target,i=Array.from(t.files??[]);i.length>0&&this.dispatchEvent(new CustomEvent("files-selected",{detail:{files:i},bubbles:!0,composed:!0})),t.value=""}_onSourceClick(e,t){if(e.stopPropagation(),t.id==="device"){const i=this.renderRoot.querySelector('input[type="file"]');i==null||i.click();return}this.dispatchEvent(new CustomEvent("source-click",{detail:{source:t},bubbles:!0,composed:!0}))}_toggleMore(e){e.stopPropagation(),this._moreOpen=!this._moreOpen,this._moreOpen?requestAnimationFrame(()=>document.addEventListener("click",this._outsideClickHandler,!0)):document.removeEventListener("click",this._outsideClickHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),this._moreOpen=!1,document.removeEventListener("click",this._outsideClickHandler,!0)}_onMoreSourceClick(e,t){this._moreOpen=!1,document.removeEventListener("click",this._outsideClickHandler,!0),this._onSourceClick(e,t)}_renderDropTile(){const t=this.sources.slice(0,3),i=this.sources.slice(3);return s.html`
|
|
1020
|
+
<div class="drop-tile" @click=${this._onDropTileClick}>
|
|
1021
|
+
<div class="drop-tile-rings">
|
|
1022
|
+
<div class="drop-tile-ring"></div>
|
|
1023
|
+
<div class="drop-tile-ring"></div>
|
|
1024
|
+
<div class="drop-tile-core">
|
|
1025
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
|
|
1026
|
+
<polyline points="16 16 12 12 8 16" />
|
|
1027
|
+
<line x1="12" y1="12" x2="12" y2="21" />
|
|
1028
|
+
<path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3" />
|
|
1029
|
+
</svg>
|
|
1030
|
+
</div>
|
|
1031
|
+
</div>
|
|
1032
|
+
<div class="drop-tile-text">Drop files or<br>click to <span>browse</span></div>
|
|
1033
|
+
${t.length>0?s.html`
|
|
1034
|
+
<div class="drop-tile-sources">
|
|
1035
|
+
${t.map(r=>s.html`
|
|
1036
|
+
<button
|
|
1037
|
+
class="drop-tile-src"
|
|
1038
|
+
style=${r.iconColor&&!r.brandHtml?`color:${r.iconColor}`:""}
|
|
1039
|
+
title=${r.label}
|
|
1040
|
+
@click=${o=>this._onSourceClick(o,r)}
|
|
1041
|
+
>
|
|
1042
|
+
${r.brandHtml?D.unsafeHTML(r.brandHtml):s.svg`<svg viewBox="0 0 24 24" class=${r.fillIcon?"fill-icon":""}>${U.unsafeSVG(r.icon)}</svg>`}
|
|
1043
|
+
</button>
|
|
1044
|
+
`)}
|
|
1045
|
+
${i.length>0?s.html`
|
|
1046
|
+
<div class="drop-tile-more-wrap">
|
|
1047
|
+
<button class="drop-tile-more" title="More sources" @click=${r=>this._toggleMore(r)}>···</button>
|
|
1048
|
+
${this._moreOpen?s.html`
|
|
1049
|
+
<div class="more-dropdown">
|
|
1050
|
+
${i.map(r=>s.html`
|
|
1051
|
+
<button
|
|
1052
|
+
class="more-dropdown-item"
|
|
1053
|
+
@click=${o=>this._onMoreSourceClick(o,r)}
|
|
1054
|
+
>
|
|
1055
|
+
<span class="more-dropdown-ico" style=${r.iconColor&&!r.brandHtml?`color:${r.iconColor}`:""}>
|
|
1056
|
+
${r.brandHtml?D.unsafeHTML(r.brandHtml):s.svg`<svg viewBox="0 0 24 24" class=${r.fillIcon?"fill-icon":""}>${U.unsafeSVG(r.icon)}</svg>`}
|
|
1057
|
+
</span>
|
|
1058
|
+
${r.label}
|
|
1059
|
+
</button>
|
|
1060
|
+
`)}
|
|
1061
|
+
</div>
|
|
1062
|
+
`:s.nothing}
|
|
1063
|
+
</div>
|
|
1064
|
+
`:s.nothing}
|
|
1065
|
+
</div>
|
|
1066
|
+
`:s.nothing}
|
|
1067
|
+
<input type="file" multiple accept=${this.accept||s.nothing} @change=${this._onFileInput} />
|
|
1068
|
+
</div>
|
|
1069
|
+
`}render(){return s.html`
|
|
1070
|
+
<div class="grid">
|
|
1071
|
+
${this.showDropTile?this._renderDropTile():s.nothing}
|
|
1072
|
+
${this.files.map((e,t)=>s.html`<sfx-file-item .file=${e} style="--tile-index:${t}"></sfx-file-item>`)}
|
|
1073
|
+
</div>
|
|
1074
|
+
`}};pe.styles=s.css`
|
|
1075
|
+
:host {
|
|
1076
|
+
display: block;
|
|
1077
|
+
flex: 1;
|
|
1078
|
+
min-height: 0;
|
|
1079
|
+
overflow-y: auto;
|
|
1080
|
+
padding-bottom: 8px;
|
|
1081
|
+
scrollbar-width: thin;
|
|
1082
|
+
scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
|
|
1083
|
+
scrollbar-gutter: stable;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
:host::-webkit-scrollbar {
|
|
1087
|
+
width: var(--sfx-scrollbar-w, 12px);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
:host::-webkit-scrollbar-track {
|
|
1091
|
+
background: transparent;
|
|
1092
|
+
margin: 8px 0;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
:host::-webkit-scrollbar-thumb {
|
|
1096
|
+
background-color: rgba(0, 0, 0, 0.15);
|
|
1097
|
+
border-radius: 6px;
|
|
1098
|
+
border-left: var(--sfx-scrollbar-inset-left, 3px) solid transparent;
|
|
1099
|
+
border-right: var(--sfx-scrollbar-inset-right, 3px) solid transparent;
|
|
1100
|
+
background-clip: padding-box;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
.grid {
|
|
1104
|
+
display: grid;
|
|
1105
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--sfx-up-grid-min, max(24%, 140px)), 1fr));
|
|
1106
|
+
gap: 12px;
|
|
1107
|
+
padding: 2px 12px 16px 16px;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
@media (max-width: 480px) {
|
|
1111
|
+
.grid {
|
|
1112
|
+
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
1113
|
+
gap: 8px;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
/* --- Drop tile (first card in grid) --- */
|
|
1118
|
+
.drop-tile {
|
|
1119
|
+
border-radius: 10px;
|
|
1120
|
+
border: 1.5px dashed var(--sfx-up-border, #c4d5ef);
|
|
1121
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
1122
|
+
display: flex;
|
|
1123
|
+
flex-direction: column;
|
|
1124
|
+
align-items: center;
|
|
1125
|
+
justify-content: center;
|
|
1126
|
+
gap: 8px;
|
|
1127
|
+
cursor: pointer;
|
|
1128
|
+
transition: all 0.18s ease;
|
|
1129
|
+
padding: 16px 12px;
|
|
1130
|
+
position: relative;
|
|
1131
|
+
z-index: 1;
|
|
1132
|
+
min-height: 0;
|
|
1133
|
+
overflow: hidden;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
.drop-tile:hover {
|
|
1137
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
1138
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
.drop-tile-rings {
|
|
1142
|
+
width: clamp(48px, 8vw, 72px);
|
|
1143
|
+
height: clamp(48px, 8vw, 72px);
|
|
1144
|
+
position: relative;
|
|
1145
|
+
display: flex;
|
|
1146
|
+
align-items: center;
|
|
1147
|
+
justify-content: center;
|
|
1148
|
+
flex-shrink: 0;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
.drop-tile-ring {
|
|
1152
|
+
position: absolute;
|
|
1153
|
+
inset: 0;
|
|
1154
|
+
border-radius: 50%;
|
|
1155
|
+
border: 1px dashed var(--sfx-up-ring-color, #c4d5ef);
|
|
1156
|
+
animation: tileSpin 20s linear infinite;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
.drop-tile-ring:nth-child(2) {
|
|
1160
|
+
inset: 8px;
|
|
1161
|
+
border-color: var(--sfx-up-ring-color-light, #d8e5f5);
|
|
1162
|
+
border-style: dotted;
|
|
1163
|
+
animation-direction: reverse;
|
|
1164
|
+
animation-duration: 14s;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
@keyframes tileSpin {
|
|
1168
|
+
to { transform: rotate(360deg); }
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
.drop-tile-core {
|
|
1172
|
+
width: clamp(28px, 5vw, 40px);
|
|
1173
|
+
height: clamp(28px, 5vw, 40px);
|
|
1174
|
+
border-radius: 50%;
|
|
1175
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
1176
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
1177
|
+
display: flex;
|
|
1178
|
+
align-items: center;
|
|
1179
|
+
justify-content: center;
|
|
1180
|
+
z-index: 1;
|
|
1181
|
+
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
|
|
1182
|
+
transition: all 0.2s ease;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.drop-tile:hover .drop-tile-core {
|
|
1186
|
+
transform: translateY(-1px);
|
|
1187
|
+
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
.drop-tile-core svg {
|
|
1191
|
+
width: 20px;
|
|
1192
|
+
height: 20px;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
.drop-tile-text {
|
|
1196
|
+
font-size: 12px;
|
|
1197
|
+
font-weight: 500;
|
|
1198
|
+
color: var(--sfx-up-text-secondary, #475569);
|
|
1199
|
+
text-align: center;
|
|
1200
|
+
line-height: 1.4;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
.drop-tile-text span {
|
|
1204
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
1205
|
+
font-weight: 600;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
.drop-tile-sources {
|
|
1209
|
+
display: flex;
|
|
1210
|
+
gap: 4px;
|
|
1211
|
+
margin-top: 4px;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.drop-tile-src {
|
|
1215
|
+
width: 28px;
|
|
1216
|
+
height: 28px;
|
|
1217
|
+
border-radius: 6px;
|
|
1218
|
+
border: 1px solid var(--sfx-up-border, #e2e8f0);
|
|
1219
|
+
background: var(--sfx-up-bg, #fff);
|
|
1220
|
+
display: flex;
|
|
1221
|
+
align-items: center;
|
|
1222
|
+
justify-content: center;
|
|
1223
|
+
cursor: pointer;
|
|
1224
|
+
transition: all 0.15s ease;
|
|
1225
|
+
padding: 0;
|
|
1226
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
.drop-tile-src:hover {
|
|
1230
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
1231
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
1232
|
+
transform: translateY(-1px);
|
|
1233
|
+
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
.drop-tile-src svg {
|
|
1237
|
+
width: 14px;
|
|
1238
|
+
height: 14px;
|
|
1239
|
+
fill: none;
|
|
1240
|
+
stroke: currentColor;
|
|
1241
|
+
stroke-width: 2;
|
|
1242
|
+
stroke-linecap: round;
|
|
1243
|
+
stroke-linejoin: round;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
.drop-tile-src svg.fill-icon {
|
|
1247
|
+
fill: currentColor;
|
|
1248
|
+
stroke: none;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
.drop-tile-more-wrap {
|
|
1252
|
+
position: relative;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
.drop-tile-more {
|
|
1256
|
+
width: 28px;
|
|
1257
|
+
height: 28px;
|
|
1258
|
+
border-radius: 6px;
|
|
1259
|
+
border: 1px solid var(--sfx-up-border, #e2e8f0);
|
|
1260
|
+
background: var(--sfx-up-bg, #fff);
|
|
1261
|
+
display: flex;
|
|
1262
|
+
align-items: center;
|
|
1263
|
+
justify-content: center;
|
|
1264
|
+
cursor: pointer;
|
|
1265
|
+
transition: all 0.15s ease;
|
|
1266
|
+
padding: 0;
|
|
1267
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
1268
|
+
font-size: 14px;
|
|
1269
|
+
font-weight: 700;
|
|
1270
|
+
letter-spacing: 1px;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.drop-tile-more:hover {
|
|
1274
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
1275
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
1276
|
+
transform: translateY(-1px);
|
|
1277
|
+
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
.more-dropdown {
|
|
1281
|
+
position: absolute;
|
|
1282
|
+
top: 36px;
|
|
1283
|
+
right: 0;
|
|
1284
|
+
background: #fff;
|
|
1285
|
+
border: 1px solid var(--sfx-up-border, #e2e8f0);
|
|
1286
|
+
border-radius: 10px;
|
|
1287
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
|
|
1288
|
+
padding: 6px;
|
|
1289
|
+
z-index: 10;
|
|
1290
|
+
min-width: 180px;
|
|
1291
|
+
animation: dropIn 0.15s ease;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
@keyframes dropIn {
|
|
1295
|
+
from { opacity: 0; transform: translateY(-4px); }
|
|
1296
|
+
to { opacity: 1; transform: translateY(0); }
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
.more-dropdown-item {
|
|
1300
|
+
display: flex;
|
|
1301
|
+
align-items: center;
|
|
1302
|
+
gap: 10px;
|
|
1303
|
+
width: 100%;
|
|
1304
|
+
padding: 8px 12px;
|
|
1305
|
+
border: none;
|
|
1306
|
+
background: none;
|
|
1307
|
+
border-radius: 6px;
|
|
1308
|
+
cursor: pointer;
|
|
1309
|
+
font-size: 13px;
|
|
1310
|
+
font-weight: 500;
|
|
1311
|
+
color: var(--sfx-up-text, #1e293b);
|
|
1312
|
+
white-space: nowrap;
|
|
1313
|
+
transition: background 0.15s;
|
|
1314
|
+
font-family: inherit;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
.more-dropdown-item:hover {
|
|
1318
|
+
background: var(--sfx-up-primary-bg, #f5f7fa);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
.more-dropdown-ico {
|
|
1322
|
+
width: 32px;
|
|
1323
|
+
height: 32px;
|
|
1324
|
+
border-radius: 8px;
|
|
1325
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
1326
|
+
display: flex;
|
|
1327
|
+
align-items: center;
|
|
1328
|
+
justify-content: center;
|
|
1329
|
+
flex-shrink: 0;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
.more-dropdown-ico svg {
|
|
1333
|
+
width: 16px;
|
|
1334
|
+
height: 16px;
|
|
1335
|
+
fill: none;
|
|
1336
|
+
stroke: currentColor;
|
|
1337
|
+
stroke-width: 2;
|
|
1338
|
+
stroke-linecap: round;
|
|
1339
|
+
stroke-linejoin: round;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
.more-dropdown-ico svg.fill-icon {
|
|
1343
|
+
fill: currentColor;
|
|
1344
|
+
stroke: none;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
.more-dropdown-ico .brand-ico {
|
|
1348
|
+
width: 20px;
|
|
1349
|
+
height: 20px;
|
|
1350
|
+
border-radius: 5px;
|
|
1351
|
+
display: flex;
|
|
1352
|
+
align-items: center;
|
|
1353
|
+
justify-content: center;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
.more-dropdown-ico .brand-ico svg {
|
|
1357
|
+
fill: white;
|
|
1358
|
+
stroke: none;
|
|
1359
|
+
stroke-width: 0;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
.more-dropdown-ico .canva-ico {
|
|
1363
|
+
width: 22px;
|
|
1364
|
+
height: 22px;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
.more-dropdown-ico .canva-ico svg {
|
|
1368
|
+
width: 22px;
|
|
1369
|
+
height: 22px;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
input[type="file"] {
|
|
1373
|
+
display: none;
|
|
1374
|
+
}
|
|
1375
|
+
`;let F=pe;V([p.property({attribute:!1})],F.prototype,"files");V([p.property({type:Boolean})],F.prototype,"showDropTile");V([p.property({attribute:!1})],F.prototype,"sources");V([p.property({type:String})],F.prototype,"accept");V([p.state()],F.prototype,"_moreOpen");var ot=Object.defineProperty,st=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&ot(e,t,r),r};const fe=class fe extends s.LitElement{_remove(){this.dispatchEvent(new CustomEvent("file-remove",{detail:{fileId:this.file.id},bubbles:!0,composed:!0}))}_retry(){this.dispatchEvent(new CustomEvent("file-retry",{detail:{fileId:this.file.id},bubbles:!0,composed:!0}))}_preview(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("file-preview",{detail:{fileId:this.file.id},bubbles:!0,composed:!0}))}render(){const e=this.file;if(!e)return s.nothing;const t=q(e),i=e.status==="complete",r=e.status==="uploading",o=e.status==="error"||e.status==="failed",a=e.status==="rejected",l=Ve(e.name),d=["tile",i?"done":"",r?"uploading":"",a?"rejected":""].filter(Boolean).join(" ");return s.html`
|
|
1376
|
+
<div class=${d} tabindex="0">
|
|
1377
|
+
<!-- Preview area -->
|
|
1378
|
+
<div class="preview">
|
|
1379
|
+
${e.previewUrl?s.html`<div class="preview-bg" style="background-image:url(${e.previewUrl})"></div>`:s.html`
|
|
1380
|
+
<div class="preview-bg ${t}"></div>
|
|
1381
|
+
<div class="type-icon">
|
|
1382
|
+
<div class="type-icon-inner ${t}">
|
|
1383
|
+
${this._renderTypeIcon(t)}
|
|
1384
|
+
${l?s.html`<div class="ext-label">${l}</div>`:s.nothing}
|
|
1385
|
+
</div>
|
|
1386
|
+
</div>
|
|
1387
|
+
`}
|
|
1388
|
+
|
|
1389
|
+
<!-- Preview button -->
|
|
1390
|
+
${!i&&!r&&!o&&e.status!=="rejected"?s.html`
|
|
1391
|
+
<button class="preview-btn" @click=${this._preview} aria-label="Preview file">
|
|
1392
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
1393
|
+
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
|
|
1394
|
+
<circle cx="12" cy="12" r="3"/>
|
|
1395
|
+
</svg>
|
|
1396
|
+
Preview
|
|
1397
|
+
</button>
|
|
1398
|
+
`:s.nothing}
|
|
1399
|
+
|
|
1400
|
+
<!-- Spinner overlay -->
|
|
1401
|
+
<div class="spinner-overlay">
|
|
1402
|
+
<div class="spin-ring"></div>
|
|
1403
|
+
</div>
|
|
1404
|
+
|
|
1405
|
+
<!-- Done badge -->
|
|
1406
|
+
${i?s.html`<div class="done-badge">
|
|
1407
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round">
|
|
1408
|
+
<polyline points="20 6 9 17 4 12" />
|
|
1409
|
+
</svg>
|
|
1410
|
+
</div>`:s.nothing}
|
|
1411
|
+
|
|
1412
|
+
<!-- Progress bar -->
|
|
1413
|
+
${e.status==="uploading"?s.html`
|
|
1414
|
+
<div class="progress">
|
|
1415
|
+
<div class="progress-fill" style="transform:scaleX(${Math.min(e.progress,100)/100})"></div>
|
|
1416
|
+
</div>
|
|
1417
|
+
`:s.nothing}
|
|
1418
|
+
|
|
1419
|
+
<!-- Error / rejected badge -->
|
|
1420
|
+
${(o||a)&&e.error?s.html`<div class="error-badge" title=${e.error}>${e.error}</div>`:s.nothing}
|
|
1421
|
+
|
|
1422
|
+
<!-- Video duration badge (hidden when error badge is shown to avoid overlap) -->
|
|
1423
|
+
${!(o||a)&&e.duration!=null&&e.duration>0?s.html`<div class="duration-badge">${this._formatDuration(e.duration)}</div>`:s.nothing}
|
|
1424
|
+
</div>
|
|
1425
|
+
|
|
1426
|
+
<!-- Action buttons -->
|
|
1427
|
+
<div class="actions">
|
|
1428
|
+
${o?s.html`
|
|
1429
|
+
<button class="act-btn retry" @click=${this._retry} title="Retry" aria-label="Retry upload">
|
|
1430
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
1431
|
+
<polyline points="23 4 23 10 17 10" />
|
|
1432
|
+
<path d="M20.49 15a9 9 0 11-2.12-9.36L23 10" />
|
|
1433
|
+
</svg>
|
|
1434
|
+
</button>
|
|
1435
|
+
`:s.nothing}
|
|
1436
|
+
<button class="act-btn del" @click=${this._remove} title="Remove" aria-label="Remove file">
|
|
1437
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
1438
|
+
<polyline points="3 6 5 6 21 6" />
|
|
1439
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />
|
|
1440
|
+
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
1441
|
+
<line x1="10" y1="11" x2="10" y2="17" />
|
|
1442
|
+
<line x1="14" y1="11" x2="14" y2="17" />
|
|
1443
|
+
</svg>
|
|
1444
|
+
</button>
|
|
1445
|
+
</div>
|
|
1446
|
+
|
|
1447
|
+
<!-- Info bar -->
|
|
1448
|
+
<div class="info">
|
|
1449
|
+
<div class="name" title=${e.name}>${e.name}</div>
|
|
1450
|
+
<div class="meta">${l||""}${e.size?` · ${R(e.size)}`:""}</div>
|
|
1451
|
+
</div>
|
|
1452
|
+
</div>
|
|
1453
|
+
`}_formatDuration(e){const t=Math.floor(e/60),i=Math.floor(e%60);return`${t}:${i.toString().padStart(2,"0")}`}_renderTypeIcon(e){switch(e){case"pdf":return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>`;case"doc":return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>`;case"vid":return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2"/></svg>`;case"zip":return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M21 8v13H3V8"/><path d="M1 3h22v5H1z"/><path d="M10 12h4"/></svg>`;default:return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z"/><polyline points="13 2 13 9 20 9"/></svg>`}}};fe.styles=s.css`
|
|
1454
|
+
:host {
|
|
1455
|
+
display: block;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
.tile {
|
|
1459
|
+
border-radius: 10px;
|
|
1460
|
+
background: var(--sfx-up-bg, #fff);
|
|
1461
|
+
border: 1px solid #dde3ed;
|
|
1462
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
|
|
1463
|
+
animation: tileIn 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) both;
|
|
1464
|
+
animation-delay: calc(min(var(--tile-index, 0), 8) * 0.04s);
|
|
1465
|
+
will-change: transform, opacity;
|
|
1466
|
+
transition: box-shadow 0.15s, transform 0.15s;
|
|
1467
|
+
cursor: default;
|
|
1468
|
+
display: flex;
|
|
1469
|
+
flex-direction: column;
|
|
1470
|
+
position: relative;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
.tile:hover {
|
|
1474
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.08);
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
/* --- Preview area --- */
|
|
1478
|
+
.preview {
|
|
1479
|
+
position: relative;
|
|
1480
|
+
aspect-ratio: 16 / 10;
|
|
1481
|
+
overflow: hidden;
|
|
1482
|
+
flex-shrink: 0;
|
|
1483
|
+
background: var(--sfx-up-border-light, #f3f4f6);
|
|
1484
|
+
border-radius: 10px 10px 0 0;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
.preview-bg {
|
|
1488
|
+
position: absolute;
|
|
1489
|
+
inset: 0;
|
|
1490
|
+
background-size: cover;
|
|
1491
|
+
background-position: center;
|
|
1492
|
+
transition: transform 0.4s ease;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
.tile:hover .preview-bg {
|
|
1496
|
+
transform: none;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
.preview-bg.pdf { background: linear-gradient(135deg, var(--destructive-10, #fef2f2), var(--destructive-10, #fee2e2)); }
|
|
1500
|
+
.preview-bg.doc { background: linear-gradient(135deg, var(--sfx-up-primary-bg, #eff6ff), var(--sfx-up-primary-bg, #dbeafe)); }
|
|
1501
|
+
.preview-bg.vid { background: linear-gradient(135deg, #f5f3ff, #ede9fe); }
|
|
1502
|
+
.preview-bg.zip { background: linear-gradient(135deg, var(--warning-10, #fffbeb), var(--warning-10, #fef3c7)); }
|
|
1503
|
+
.preview-bg.gen { background: linear-gradient(135deg, var(--sfx-up-border-light, #f8fafc), var(--sfx-up-border-light, #f1f5f9)); }
|
|
1504
|
+
|
|
1505
|
+
/* --- File type icon --- */
|
|
1506
|
+
.type-icon {
|
|
1507
|
+
position: absolute;
|
|
1508
|
+
inset: 0;
|
|
1509
|
+
display: flex;
|
|
1510
|
+
align-items: center;
|
|
1511
|
+
justify-content: center;
|
|
1512
|
+
pointer-events: none;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
.type-icon-inner {
|
|
1516
|
+
width: 44px;
|
|
1517
|
+
height: 44px;
|
|
1518
|
+
border-radius: 12px;
|
|
1519
|
+
display: flex;
|
|
1520
|
+
align-items: center;
|
|
1521
|
+
justify-content: center;
|
|
1522
|
+
background: rgba(255, 255, 255, 0.9);
|
|
1523
|
+
box-shadow: 0 2px 10px var(--sfx-up-shadow, rgba(0, 0, 0, 0.08));
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
.type-icon-inner svg {
|
|
1527
|
+
width: 22px;
|
|
1528
|
+
height: 22px;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
.type-icon-inner.pdf { color: var(--sfx-up-error, #dc2626); }
|
|
1532
|
+
.type-icon-inner.doc { color: var(--sfx-up-primary, #1d4ed8); }
|
|
1533
|
+
.type-icon-inner.vid { color: #7c3aed; }
|
|
1534
|
+
.type-icon-inner.zip { color: var(--warning-foreground, #b45309); }
|
|
1535
|
+
.type-icon-inner.gen { color: var(--sfx-up-text-muted, #64748b); }
|
|
1536
|
+
|
|
1537
|
+
.ext-label {
|
|
1538
|
+
font-size: 12px;
|
|
1539
|
+
font-weight: 800;
|
|
1540
|
+
text-transform: uppercase;
|
|
1541
|
+
margin-top: 2px;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
.duration-badge {
|
|
1545
|
+
position: absolute;
|
|
1546
|
+
bottom: 6px;
|
|
1547
|
+
right: 6px;
|
|
1548
|
+
background: rgba(0, 0, 0, 0.65);
|
|
1549
|
+
color: #fff;
|
|
1550
|
+
font-size: 11px;
|
|
1551
|
+
font-weight: 600;
|
|
1552
|
+
padding: 2px 6px;
|
|
1553
|
+
border-radius: 4px;
|
|
1554
|
+
line-height: 1.3;
|
|
1555
|
+
pointer-events: none;
|
|
1556
|
+
z-index: 2;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
/* --- Info bar --- */
|
|
1560
|
+
.info {
|
|
1561
|
+
padding: 8px 12px;
|
|
1562
|
+
min-width: 0;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.name {
|
|
1566
|
+
font-size: 14px;
|
|
1567
|
+
font-weight: 400;
|
|
1568
|
+
color: var(--foreground, var(--sfx-up-text, #111827));
|
|
1569
|
+
white-space: nowrap;
|
|
1570
|
+
overflow: hidden;
|
|
1571
|
+
text-overflow: ellipsis;
|
|
1572
|
+
margin-bottom: 2px;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
.meta {
|
|
1576
|
+
font-size: 12px;
|
|
1577
|
+
font-weight: 400;
|
|
1578
|
+
color: var(--sfx-up-text-muted, #9ca3af);
|
|
1579
|
+
white-space: nowrap;
|
|
1580
|
+
overflow: hidden;
|
|
1581
|
+
text-overflow: ellipsis;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
.tile.done {
|
|
1585
|
+
box-shadow: 0 0 0 2px var(--sfx-up-primary, #2563eb);
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
/* --- Action buttons --- */
|
|
1589
|
+
.actions {
|
|
1590
|
+
position: absolute;
|
|
1591
|
+
top: 6px;
|
|
1592
|
+
right: 6px;
|
|
1593
|
+
display: flex;
|
|
1594
|
+
gap: 4px;
|
|
1595
|
+
opacity: 0;
|
|
1596
|
+
transition: opacity 0.15s;
|
|
1597
|
+
z-index: 10;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
.tile:hover .actions,
|
|
1601
|
+
.tile:focus-within .actions {
|
|
1602
|
+
opacity: 1;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
/* Touch devices: always show actions since there is no hover */
|
|
1606
|
+
@media (hover: none) {
|
|
1607
|
+
.actions { opacity: 1; }
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
.act-btn {
|
|
1611
|
+
width: 26px;
|
|
1612
|
+
height: 26px;
|
|
1613
|
+
border-radius: 6px;
|
|
1614
|
+
border: none;
|
|
1615
|
+
background: var(--sfx-up-bg, #fff);
|
|
1616
|
+
box-shadow: 0 1px 4px var(--sfx-up-shadow, rgba(0, 0, 0, 0.15));
|
|
1617
|
+
cursor: pointer;
|
|
1618
|
+
display: flex;
|
|
1619
|
+
align-items: center;
|
|
1620
|
+
justify-content: center;
|
|
1621
|
+
transition: background 0.15s, transform 0.15s;
|
|
1622
|
+
color: var(--sfx-up-text-muted, #9ca3af);
|
|
1623
|
+
padding: 0;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
.act-btn:hover {
|
|
1627
|
+
background: var(--sfx-up-border-light, #f3f4f6);
|
|
1628
|
+
transform: scale(1.08);
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
.act-btn.del:hover {
|
|
1632
|
+
background: var(--destructive-10, #fee2e2);
|
|
1633
|
+
color: var(--sfx-up-error, #dc2626);
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
.act-btn.retry:hover {
|
|
1637
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
1638
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
.act-btn svg {
|
|
1642
|
+
width: 11px;
|
|
1643
|
+
height: 11px;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
/* --- Preview button --- */
|
|
1647
|
+
.preview-btn {
|
|
1648
|
+
position: absolute;
|
|
1649
|
+
bottom: 50%;
|
|
1650
|
+
left: 50%;
|
|
1651
|
+
transform: translate(-50%, 50%);
|
|
1652
|
+
padding: 6px 16px;
|
|
1653
|
+
border-radius: 6px;
|
|
1654
|
+
border: 1.5px solid var(--sfx-up-primary, #2563eb);
|
|
1655
|
+
background: var(--sfx-up-bg, #fff);
|
|
1656
|
+
cursor: pointer;
|
|
1657
|
+
display: flex;
|
|
1658
|
+
align-items: center;
|
|
1659
|
+
gap: 5px;
|
|
1660
|
+
opacity: 0;
|
|
1661
|
+
transition: all 0.15s ease;
|
|
1662
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
1663
|
+
font-family: inherit;
|
|
1664
|
+
font-size: 11px;
|
|
1665
|
+
font-weight: 600;
|
|
1666
|
+
white-space: nowrap;
|
|
1667
|
+
z-index: 5;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
.tile:hover .preview-btn,
|
|
1671
|
+
.tile:focus-within .preview-btn {
|
|
1672
|
+
opacity: 1;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
@media (hover: none) {
|
|
1676
|
+
.preview-btn { opacity: 1; }
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
.preview-btn:hover {
|
|
1680
|
+
background: var(--sfx-up-primary, #2563eb);
|
|
1681
|
+
color: var(--sfx-up-bg, #fff);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
.preview-btn:hover svg {
|
|
1685
|
+
stroke: var(--sfx-up-bg, #fff);
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
.preview-btn svg {
|
|
1689
|
+
width: 13px;
|
|
1690
|
+
height: 13px;
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
/* --- Progress bar --- */
|
|
1694
|
+
.progress {
|
|
1695
|
+
position: absolute;
|
|
1696
|
+
bottom: 0;
|
|
1697
|
+
left: 0;
|
|
1698
|
+
right: 0;
|
|
1699
|
+
height: 2px;
|
|
1700
|
+
background: rgba(0, 0, 0, 0.06);
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
.progress-fill {
|
|
1704
|
+
height: 100%;
|
|
1705
|
+
background: var(--sfx-up-primary, #2563eb);
|
|
1706
|
+
transform-origin: left;
|
|
1707
|
+
transition: transform 0.32s ease;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/* --- Uploading spinner overlay --- */
|
|
1711
|
+
.spinner-overlay {
|
|
1712
|
+
position: absolute;
|
|
1713
|
+
inset: 0;
|
|
1714
|
+
display: flex;
|
|
1715
|
+
align-items: center;
|
|
1716
|
+
justify-content: center;
|
|
1717
|
+
background: rgba(0, 0, 0, 0.22);
|
|
1718
|
+
opacity: 0;
|
|
1719
|
+
transition: opacity 0.2s;
|
|
1720
|
+
pointer-events: none;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
.tile.uploading .spinner-overlay {
|
|
1724
|
+
opacity: 1;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
.spin-ring {
|
|
1728
|
+
width: 28px;
|
|
1729
|
+
height: 28px;
|
|
1730
|
+
border: 2.5px solid rgba(255, 255, 255, 0.22);
|
|
1731
|
+
border-top-color: #fff;
|
|
1732
|
+
border-radius: 50%;
|
|
1733
|
+
animation: spinRing 0.7s linear infinite;
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
/* --- Done badge --- */
|
|
1737
|
+
.done-badge {
|
|
1738
|
+
position: absolute;
|
|
1739
|
+
top: 8px;
|
|
1740
|
+
left: 8px;
|
|
1741
|
+
width: 24px;
|
|
1742
|
+
height: 24px;
|
|
1743
|
+
border-radius: 50%;
|
|
1744
|
+
background: var(--sfx-up-primary, #2563eb);
|
|
1745
|
+
display: flex;
|
|
1746
|
+
align-items: center;
|
|
1747
|
+
justify-content: center;
|
|
1748
|
+
pointer-events: none;
|
|
1749
|
+
z-index: 10;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
.done-badge svg {
|
|
1753
|
+
width: 14px;
|
|
1754
|
+
height: 14px;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
/* --- Error / rejected state --- */
|
|
1758
|
+
.error-badge {
|
|
1759
|
+
position: absolute;
|
|
1760
|
+
bottom: 6px;
|
|
1761
|
+
left: 6px;
|
|
1762
|
+
right: 6px;
|
|
1763
|
+
font-size: 11px;
|
|
1764
|
+
font-weight: 500;
|
|
1765
|
+
line-height: 1.3;
|
|
1766
|
+
color: #fff;
|
|
1767
|
+
background: color-mix(in srgb, var(--sfx-up-error, #dc2626) 85%, transparent);
|
|
1768
|
+
border-radius: 6px;
|
|
1769
|
+
padding: 4px 8px;
|
|
1770
|
+
text-align: center;
|
|
1771
|
+
display: -webkit-box;
|
|
1772
|
+
-webkit-line-clamp: 2;
|
|
1773
|
+
line-clamp: 2;
|
|
1774
|
+
-webkit-box-orient: vertical;
|
|
1775
|
+
overflow: hidden;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
.tile.rejected {
|
|
1779
|
+
opacity: 0.6;
|
|
1780
|
+
box-shadow: 0 0 0 2px var(--sfx-up-error, #dc2626);
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
@keyframes tileIn {
|
|
1784
|
+
0% {
|
|
1785
|
+
opacity: 0;
|
|
1786
|
+
transform: scale(0.92) translateY(14px);
|
|
1787
|
+
}
|
|
1788
|
+
60% {
|
|
1789
|
+
opacity: 1;
|
|
1790
|
+
}
|
|
1791
|
+
80% {
|
|
1792
|
+
transform: scale(1.02) translateY(-2px);
|
|
1793
|
+
}
|
|
1794
|
+
100% {
|
|
1795
|
+
opacity: 1;
|
|
1796
|
+
transform: scale(1) translateY(0);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
@keyframes popBounce {
|
|
1801
|
+
0% { transform: scale(0); opacity: 0; }
|
|
1802
|
+
55% { transform: scale(1.2); opacity: 1; }
|
|
1803
|
+
75% { transform: scale(0.94); }
|
|
1804
|
+
100% { transform: scale(1); }
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
@keyframes spinRing {
|
|
1808
|
+
to { transform: rotate(360deg); }
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
.tile:focus-visible {
|
|
1812
|
+
outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
1813
|
+
outline-offset: 2px;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
.act-btn:focus-visible,
|
|
1817
|
+
.preview-btn:focus-visible {
|
|
1818
|
+
outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
1819
|
+
outline-offset: 2px;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1823
|
+
.tile { animation: none; }
|
|
1824
|
+
.spin-ring { animation: none; }
|
|
1825
|
+
}
|
|
1826
|
+
`;let J=fe;st([p.property({attribute:!1})],J.prototype,"file");const N=s.css`
|
|
1827
|
+
.btn,
|
|
1828
|
+
.btn-ghost,
|
|
1829
|
+
.btn-primary,
|
|
1830
|
+
.btn-sec,
|
|
1831
|
+
.btn-retry,
|
|
1832
|
+
.btn-upload,
|
|
1833
|
+
.btn-danger {
|
|
1834
|
+
height: 36px;
|
|
1835
|
+
padding: 0 16px;
|
|
1836
|
+
border-radius: 6px;
|
|
1837
|
+
border: none;
|
|
1838
|
+
font-family: inherit;
|
|
1839
|
+
font-size: 14px;
|
|
1840
|
+
font-weight: 500;
|
|
1841
|
+
cursor: pointer;
|
|
1842
|
+
display: inline-flex;
|
|
1843
|
+
align-items: center;
|
|
1844
|
+
justify-content: center;
|
|
1845
|
+
gap: 6px;
|
|
1846
|
+
transition: all 0.15s ease;
|
|
1847
|
+
white-space: nowrap;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
.btn svg,
|
|
1851
|
+
.btn-ghost svg,
|
|
1852
|
+
.btn-primary svg,
|
|
1853
|
+
.btn-sec svg,
|
|
1854
|
+
.btn-retry svg,
|
|
1855
|
+
.btn-upload svg,
|
|
1856
|
+
.btn-danger svg {
|
|
1857
|
+
width: 14px;
|
|
1858
|
+
height: 14px;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
.btn-ghost {
|
|
1862
|
+
background: none;
|
|
1863
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
1864
|
+
border: 1.5px solid var(--sfx-up-border, #e2e8f0);
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
.btn-ghost:hover {
|
|
1868
|
+
background: var(--sfx-up-border-light, #f8faff);
|
|
1869
|
+
color: var(--sfx-up-text-secondary, #64748b);
|
|
1870
|
+
border-color: var(--sfx-up-border, #d1dff0);
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
.btn-primary {
|
|
1874
|
+
background: linear-gradient(135deg, var(--sfx-up-primary, #2563eb), var(--sfx-up-primary-mid, #3b82f6));
|
|
1875
|
+
color: var(--primary-foreground, #fff);
|
|
1876
|
+
box-shadow: 0 2px 10px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.28));
|
|
1877
|
+
position: relative;
|
|
1878
|
+
overflow: hidden;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
.btn-primary:hover:not(:disabled) {
|
|
1882
|
+
background: linear-gradient(135deg, var(--sfx-up-primary-hover, #1d4ed8), var(--sfx-up-primary, #2563eb));
|
|
1883
|
+
box-shadow: 0 4px 16px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.38));
|
|
1884
|
+
transform: translateY(-1px);
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
.btn-primary:active {
|
|
1888
|
+
transform: translateY(0);
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
.btn-primary:disabled {
|
|
1892
|
+
opacity: 0.55;
|
|
1893
|
+
cursor: not-allowed;
|
|
1894
|
+
}
|
|
1895
|
+
`,X=s.css`
|
|
1896
|
+
button:focus-visible {
|
|
1897
|
+
outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
1898
|
+
outline-offset: 2px;
|
|
1899
|
+
}
|
|
1900
|
+
`;var at=Object.defineProperty,W=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&at(e,t,r),r};const Ce=7,he=class he extends s.LitElement{constructor(){super(...arguments),this.fileCount=0,this.totalSize=0,this.thumbnails=[],this.primaryLabel="Done",this.failedFiles=[]}_uploadMore(){this.dispatchEvent(new CustomEvent("upload-more",{bubbles:!0,composed:!0}))}_primaryAction(){this.dispatchEvent(new CustomEvent("primary-action",{bubbles:!0,composed:!0}))}render(){const e=this.thumbnails.slice(0,Ce),t=this.thumbnails.length-Ce,i=this.fileCount>0,r=this.failedFiles.length>0,o=r&&!i;return s.html`
|
|
1901
|
+
<div class="card" role="status" aria-live="polite">
|
|
1902
|
+
<div class="icon ${o?"error":r?"warning":""}">
|
|
1903
|
+
${o?s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1904
|
+
<circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/>
|
|
1905
|
+
</svg>`:r?s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1906
|
+
<path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/>
|
|
1907
|
+
</svg>`:s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
1908
|
+
<polyline points="20 6 9 17 4 12" />
|
|
1909
|
+
</svg>`}
|
|
1910
|
+
</div>
|
|
1911
|
+
<div class="title">${o?"Upload failed":r?"Partially uploaded":"Uploaded successfully!"}</div>
|
|
1912
|
+
<div class="subtitle">${o?`${this.failedFiles.length===1?"File":"Files"} could not be uploaded`:r?`${this.fileCount} ${this.fileCount===1?"file":"files"} uploaded, ${this.failedFiles.length} failed`:"All files are ready for use"}</div>
|
|
1913
|
+
|
|
1914
|
+
${e.length>0?s.html`
|
|
1915
|
+
<div class="thumbs">
|
|
1916
|
+
${e.map(a=>s.html`<img class="thumb" src=${a} alt="" />`)}
|
|
1917
|
+
${t>0?s.html`<div class="thumb-more">+${t}</div>`:s.nothing}
|
|
1918
|
+
</div>
|
|
1919
|
+
`:s.nothing}
|
|
1920
|
+
|
|
1921
|
+
${i?s.html`<div class="summary">${this.fileCount} ${this.fileCount===1?"file":"files"} · ${R(this.totalSize)} uploaded</div>`:s.nothing}
|
|
1922
|
+
|
|
1923
|
+
${r?s.html`
|
|
1924
|
+
<div class="failed-list">
|
|
1925
|
+
${this.failedFiles.map(a=>s.html`
|
|
1926
|
+
<div class="failed-item">
|
|
1927
|
+
<svg class="failed-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Error"><title>Error</title><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
|
|
1928
|
+
<div class="failed-info">
|
|
1929
|
+
<div class="failed-name">${a.name}</div>
|
|
1930
|
+
<div class="failed-reason">${a.error}</div>
|
|
1931
|
+
</div>
|
|
1932
|
+
</div>
|
|
1933
|
+
`)}
|
|
1934
|
+
</div>
|
|
1935
|
+
`:s.nothing}
|
|
1936
|
+
|
|
1937
|
+
<div class="actions">
|
|
1938
|
+
<button class="btn-ghost" @click=${this._uploadMore}>Upload more</button>
|
|
1939
|
+
<button class="btn-primary" @click=${this._primaryAction}>${this.primaryLabel}</button>
|
|
1940
|
+
</div>
|
|
1941
|
+
</div>
|
|
1942
|
+
`}};he.styles=[N,X,s.css`
|
|
1943
|
+
:host {
|
|
1944
|
+
display: flex;
|
|
1945
|
+
flex: 1;
|
|
1946
|
+
justify-content: center;
|
|
1947
|
+
align-items: center;
|
|
1948
|
+
padding-bottom: 24px;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
.card {
|
|
1952
|
+
display: flex;
|
|
1953
|
+
flex-direction: column;
|
|
1954
|
+
align-items: center;
|
|
1955
|
+
text-align: center;
|
|
1956
|
+
animation: fadeUp 0.4s ease both;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
.icon {
|
|
1960
|
+
width: 64px;
|
|
1961
|
+
height: 64px;
|
|
1962
|
+
border-radius: 50%;
|
|
1963
|
+
background: #f0fdf4;
|
|
1964
|
+
display: flex;
|
|
1965
|
+
align-items: center;
|
|
1966
|
+
justify-content: center;
|
|
1967
|
+
margin-bottom: 18px;
|
|
1968
|
+
color: #22c55e;
|
|
1969
|
+
box-shadow: none;
|
|
1970
|
+
animation: popBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
.icon svg {
|
|
1974
|
+
width: 30px;
|
|
1975
|
+
height: 30px;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
.icon.error {
|
|
1979
|
+
background: #fef2f2;
|
|
1980
|
+
color: #ef4444;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
.icon.warning {
|
|
1984
|
+
background: #fffbeb;
|
|
1985
|
+
color: #f59e0b;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
.title {
|
|
1989
|
+
font-size: 20px;
|
|
1990
|
+
font-weight: 700;
|
|
1991
|
+
color: var(--sfx-up-text, #0f172a);
|
|
1992
|
+
letter-spacing: -0.4px;
|
|
1993
|
+
margin-bottom: 8px;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
.subtitle {
|
|
1997
|
+
font-size: 14px;
|
|
1998
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
1999
|
+
line-height: 1.6;
|
|
2000
|
+
max-width: 320px;
|
|
2001
|
+
margin-bottom: 20px;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
/* --- Thumbnail strip --- */
|
|
2005
|
+
.thumbs {
|
|
2006
|
+
display: flex;
|
|
2007
|
+
justify-content: center;
|
|
2008
|
+
gap: 6px;
|
|
2009
|
+
margin-bottom: 14px;
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
.thumb {
|
|
2013
|
+
width: 56px;
|
|
2014
|
+
height: 56px;
|
|
2015
|
+
border-radius: 8px;
|
|
2016
|
+
object-fit: cover;
|
|
2017
|
+
border: 1px solid var(--sfx-up-border, #e8eaed);
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
.thumb-more {
|
|
2021
|
+
width: 56px;
|
|
2022
|
+
height: 56px;
|
|
2023
|
+
border-radius: 8px;
|
|
2024
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
2025
|
+
border: 1px solid var(--sfx-up-border, #e8eaed);
|
|
2026
|
+
display: flex;
|
|
2027
|
+
align-items: center;
|
|
2028
|
+
justify-content: center;
|
|
2029
|
+
font-size: 14px;
|
|
2030
|
+
font-weight: 600;
|
|
2031
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
/* --- Summary chip --- */
|
|
2035
|
+
.summary {
|
|
2036
|
+
font-size: 14px;
|
|
2037
|
+
font-weight: 400;
|
|
2038
|
+
color: var(--sfx-up-text, #1e293b);
|
|
2039
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
2040
|
+
border-radius: 8px;
|
|
2041
|
+
padding: 6px 14px;
|
|
2042
|
+
margin-bottom: 22px;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
.actions {
|
|
2046
|
+
display: flex;
|
|
2047
|
+
gap: 8px;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
.actions .btn-primary {
|
|
2051
|
+
background: linear-gradient(135deg, #22c55e, #16a34a);
|
|
2052
|
+
box-shadow: 0 2px 10px rgba(34, 197, 94, 0.28);
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
.actions .btn-primary:hover:not(:disabled) {
|
|
2056
|
+
background: linear-gradient(135deg, #16a34a, #15803d);
|
|
2057
|
+
box-shadow: 0 4px 16px rgba(34, 197, 94, 0.38);
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
/* --- Failed files list --- */
|
|
2061
|
+
.failed-list {
|
|
2062
|
+
width: 100%;
|
|
2063
|
+
max-width: 360px;
|
|
2064
|
+
margin-bottom: 20px;
|
|
2065
|
+
border-radius: 8px;
|
|
2066
|
+
border: 1px solid var(--sfx-up-border, #e8eaed);
|
|
2067
|
+
overflow: hidden;
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
.failed-item {
|
|
2071
|
+
display: flex;
|
|
2072
|
+
align-items: flex-start;
|
|
2073
|
+
gap: 8px;
|
|
2074
|
+
padding: 8px 12px;
|
|
2075
|
+
border-bottom: 1px solid var(--sfx-up-border, #f1f5f9);
|
|
2076
|
+
text-align: left;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
.failed-item:last-child {
|
|
2080
|
+
border-bottom: none;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
.failed-icon {
|
|
2084
|
+
width: 16px;
|
|
2085
|
+
height: 16px;
|
|
2086
|
+
flex-shrink: 0;
|
|
2087
|
+
color: #ef4444;
|
|
2088
|
+
margin-top: 1px;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
.failed-info {
|
|
2092
|
+
flex: 1;
|
|
2093
|
+
min-width: 0;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
.failed-name {
|
|
2097
|
+
font-size: 12px;
|
|
2098
|
+
font-weight: 500;
|
|
2099
|
+
color: var(--sfx-up-text, #1e293b);
|
|
2100
|
+
white-space: nowrap;
|
|
2101
|
+
overflow: hidden;
|
|
2102
|
+
text-overflow: ellipsis;
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
.failed-reason {
|
|
2106
|
+
font-size: 11px;
|
|
2107
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
2108
|
+
line-height: 1.4;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
@keyframes fadeUp {
|
|
2112
|
+
from {
|
|
2113
|
+
opacity: 0;
|
|
2114
|
+
transform: translateY(12px);
|
|
2115
|
+
}
|
|
2116
|
+
to {
|
|
2117
|
+
opacity: 1;
|
|
2118
|
+
transform: translateY(0);
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
@keyframes popBounce {
|
|
2123
|
+
0% { transform: scale(0); opacity: 0; }
|
|
2124
|
+
55% { transform: scale(1.2); opacity: 1; }
|
|
2125
|
+
75% { transform: scale(0.94); }
|
|
2126
|
+
100% { transform: scale(1); }
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
@media (max-width: 480px) {
|
|
2130
|
+
.icon { width: 48px; height: 48px; margin-bottom: 12px; }
|
|
2131
|
+
.icon svg { width: 24px; height: 24px; }
|
|
2132
|
+
.title { font-size: 18px; }
|
|
2133
|
+
.thumb, .thumb-more { width: 44px; height: 44px; }
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2137
|
+
.card { animation: none; }
|
|
2138
|
+
.icon { animation: none; }
|
|
2139
|
+
}
|
|
2140
|
+
`];let O=he;W([p.property({type:Number})],O.prototype,"fileCount");W([p.property({type:Number})],O.prototype,"totalSize");W([p.property({type:Array})],O.prototype,"thumbnails");W([p.property({type:String})],O.prototype,"primaryLabel");W([p.property({type:Array})],O.prototype,"failedFiles");var nt=Object.defineProperty,L=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&nt(e,t,r),r};const ue=class ue extends s.LitElement{constructor(){super(...arguments),this.uploadState="idle",this.fileCount=0,this.totalSize=0,this.failedCount=0,this.showFillMetadata=!1,this.completedCount=0,this.uploadProgress=0}_clear(){this.dispatchEvent(new CustomEvent("clear-all",{bubbles:!0,composed:!0}))}_addMore(){this.dispatchEvent(new CustomEvent("add-more",{bubbles:!0,composed:!0}))}_fillMetadata(){this.dispatchEvent(new CustomEvent("fill-metadata",{bubbles:!0,composed:!0}))}_upload(){this.dispatchEvent(new CustomEvent("upload-start",{bubbles:!0,composed:!0}))}_retryAll(){this.dispatchEvent(new CustomEvent("retry-all",{bubbles:!0,composed:!0}))}render(){const e=this.uploadState==="uploading";return s.html`
|
|
2141
|
+
${e?s.html`
|
|
2142
|
+
<div class="progress-row">
|
|
2143
|
+
<div class="progress-track" role="progressbar" aria-valuenow=${Math.round(this.uploadProgress)} aria-valuemin="0" aria-valuemax="100" aria-label="Upload progress">
|
|
2144
|
+
<div class="progress-fill" style="width:${this.uploadProgress}%"></div>
|
|
2145
|
+
</div>
|
|
2146
|
+
<span class="progress-label">${this.completedCount}/${this.fileCount} files</span>
|
|
2147
|
+
</div>
|
|
2148
|
+
`:s.nothing}
|
|
2149
|
+
<div class="buttons-row">
|
|
2150
|
+
<div class="left">
|
|
2151
|
+
${this.showFillMetadata&&this.uploadState==="idle"?s.html`
|
|
2152
|
+
<button class="btn-sec" @click=${this._fillMetadata}>
|
|
2153
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2154
|
+
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
|
|
2155
|
+
<polyline points="14 2 14 8 20 8"/>
|
|
2156
|
+
<line x1="16" y1="13" x2="8" y2="13"/>
|
|
2157
|
+
<line x1="16" y1="17" x2="8" y2="17"/>
|
|
2158
|
+
<line x1="10" y1="9" x2="8" y2="9"/>
|
|
2159
|
+
</svg>
|
|
2160
|
+
Fill Metadata
|
|
2161
|
+
</button>
|
|
2162
|
+
`:s.nothing}
|
|
2163
|
+
</div>
|
|
2164
|
+
<div class="right">
|
|
2165
|
+
<button class="btn-ghost" @click=${this._clear}>
|
|
2166
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2167
|
+
<path d="M3 6h18" />
|
|
2168
|
+
<path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" />
|
|
2169
|
+
<path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" />
|
|
2170
|
+
<line x1="10" y1="11" x2="10" y2="17" />
|
|
2171
|
+
<line x1="14" y1="11" x2="14" y2="17" />
|
|
2172
|
+
</svg>
|
|
2173
|
+
Clear
|
|
2174
|
+
</button>
|
|
2175
|
+
<button class="btn-sec" @click=${this._addMore}>
|
|
2176
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
|
|
2177
|
+
<line x1="12" y1="5" x2="12" y2="19" />
|
|
2178
|
+
<line x1="5" y1="12" x2="19" y2="12" />
|
|
2179
|
+
</svg>
|
|
2180
|
+
Add more
|
|
2181
|
+
</button>
|
|
2182
|
+
${this.failedCount>0?s.html`
|
|
2183
|
+
<button class="btn-retry" @click=${this._retryAll}>
|
|
2184
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
|
|
2185
|
+
<polyline points="23 4 23 10 17 10" />
|
|
2186
|
+
<path d="M20.49 15a9 9 0 11-2.12-9.36L23 10" />
|
|
2187
|
+
</svg>
|
|
2188
|
+
Retry all (${this.failedCount})
|
|
2189
|
+
</button>
|
|
2190
|
+
`:s.nothing}
|
|
2191
|
+
${this._renderUploadButton()}
|
|
2192
|
+
</div>
|
|
2193
|
+
</div>
|
|
2194
|
+
`}_renderUploadButton(){const e=this.uploadState==="uploading",t=this.uploadState==="done",i=["btn-primary",t?"done-state":""].filter(Boolean).join(" ");return s.html`
|
|
2195
|
+
<button
|
|
2196
|
+
class=${i}
|
|
2197
|
+
@click=${this._upload}
|
|
2198
|
+
?disabled=${e}
|
|
2199
|
+
>
|
|
2200
|
+
${e?s.html`<span class="btn-spin"></span> Uploading\u2026`:t?s.html`
|
|
2201
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
2202
|
+
<polyline points="20 6 9 17 4 12" />
|
|
2203
|
+
</svg>
|
|
2204
|
+
Done!
|
|
2205
|
+
`:s.html`
|
|
2206
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
|
|
2207
|
+
<polyline points="16 16 12 12 8 16" />
|
|
2208
|
+
<line x1="12" y1="12" x2="12" y2="21" />
|
|
2209
|
+
<path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3" />
|
|
2210
|
+
</svg>
|
|
2211
|
+
Upload
|
|
2212
|
+
`}
|
|
2213
|
+
</button>
|
|
2214
|
+
`}};ue.styles=[N,X,s.css`
|
|
2215
|
+
:host {
|
|
2216
|
+
display: flex;
|
|
2217
|
+
flex-direction: column;
|
|
2218
|
+
background: var(--sfx-up-bg, #ffffff);
|
|
2219
|
+
border-top: 1px solid var(--sfx-up-border, #e2e8f0);
|
|
2220
|
+
flex-shrink: 0;
|
|
2221
|
+
box-shadow: none;
|
|
2222
|
+
animation: barSlideUp 0.3s cubic-bezier(0.34, 1.2, 0.64, 1) both;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
@keyframes barSlideUp {
|
|
2226
|
+
from {
|
|
2227
|
+
opacity: 0;
|
|
2228
|
+
transform: translateY(12px);
|
|
2229
|
+
}
|
|
2230
|
+
to {
|
|
2231
|
+
opacity: 1;
|
|
2232
|
+
transform: translateY(0);
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
/* --- Progress row --- */
|
|
2237
|
+
.progress-row {
|
|
2238
|
+
display: flex;
|
|
2239
|
+
align-items: center;
|
|
2240
|
+
gap: 12px;
|
|
2241
|
+
padding: 10px 24px 0;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
.progress-track {
|
|
2245
|
+
flex: 1;
|
|
2246
|
+
height: 4px;
|
|
2247
|
+
background: var(--sfx-up-border, #e2e8f0);
|
|
2248
|
+
border-radius: 2px;
|
|
2249
|
+
overflow: hidden;
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
.progress-fill {
|
|
2253
|
+
height: 100%;
|
|
2254
|
+
background: var(--sfx-up-primary, #2563eb);
|
|
2255
|
+
border-radius: 2px;
|
|
2256
|
+
transition: width 0.3s ease;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
.progress-label {
|
|
2260
|
+
font-size: 13px;
|
|
2261
|
+
font-weight: 600;
|
|
2262
|
+
color: var(--sfx-up-text, #1e293b);
|
|
2263
|
+
white-space: nowrap;
|
|
2264
|
+
flex-shrink: 0;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
/* --- Buttons row --- */
|
|
2268
|
+
.buttons-row {
|
|
2269
|
+
display: flex;
|
|
2270
|
+
align-items: center;
|
|
2271
|
+
justify-content: space-between;
|
|
2272
|
+
padding: 14px 24px;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
.left {
|
|
2276
|
+
display: flex;
|
|
2277
|
+
align-items: center;
|
|
2278
|
+
gap: 8px;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
.right {
|
|
2282
|
+
display: flex;
|
|
2283
|
+
align-items: center;
|
|
2284
|
+
gap: 8px;
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
/* --- Button overrides (base in shared-styles) --- */
|
|
2288
|
+
|
|
2289
|
+
.btn-sec {
|
|
2290
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
2291
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
2292
|
+
border: 1.5px solid var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.15));
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
.btn-sec:hover {
|
|
2296
|
+
background: var(--sfx-up-primary-bg, #dbeafe);
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
.btn-retry {
|
|
2300
|
+
background: var(--destructive-10, #fef2f2);
|
|
2301
|
+
color: var(--sfx-up-error, #dc2626);
|
|
2302
|
+
border: 1.5px solid var(--sfx-up-error, rgba(220, 38, 38, 0.2));
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
.btn-retry:hover {
|
|
2306
|
+
background: var(--destructive-10, #fee2e2);
|
|
2307
|
+
color: var(--destructive-foreground, #b91c1c);
|
|
2308
|
+
border-color: var(--sfx-up-error, rgba(220, 38, 38, 0.35));
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
.btn-primary {
|
|
2312
|
+
min-width: 110px;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
.btn-primary.done-state {
|
|
2316
|
+
background: var(--sfx-up-success, #16a34a);
|
|
2317
|
+
box-shadow: 0 2px 10px var(--sfx-up-shadow, rgba(22, 163, 74, 0.28));
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
/* --- Spinner --- */
|
|
2321
|
+
.btn-spin {
|
|
2322
|
+
width: 14px;
|
|
2323
|
+
height: 14px;
|
|
2324
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
2325
|
+
border-top-color: #fff;
|
|
2326
|
+
border-radius: 50%;
|
|
2327
|
+
animation: spinRing 0.7s linear infinite;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
/* --- Count --- */
|
|
2331
|
+
.count {
|
|
2332
|
+
font-size: 14px;
|
|
2333
|
+
font-weight: 700;
|
|
2334
|
+
color: var(--sfx-up-text, #1e293b);
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
.count span {
|
|
2338
|
+
font-weight: 400;
|
|
2339
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
@keyframes spinRing {
|
|
2343
|
+
to { transform: rotate(360deg); }
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
@media (max-width: 480px) {
|
|
2347
|
+
.buttons-row {
|
|
2348
|
+
padding: 10px 12px;
|
|
2349
|
+
flex-wrap: wrap;
|
|
2350
|
+
gap: 8px;
|
|
2351
|
+
}
|
|
2352
|
+
button {
|
|
2353
|
+
height: 32px;
|
|
2354
|
+
font-size: 12px;
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2359
|
+
:host { animation: none; }
|
|
2360
|
+
.btn-spin { animation: none; }
|
|
2361
|
+
}
|
|
2362
|
+
`];let z=ue;L([p.property({type:String})],z.prototype,"uploadState");L([p.property({type:Number})],z.prototype,"fileCount");L([p.property({type:Number})],z.prototype,"totalSize");L([p.property({type:Number})],z.prototype,"failedCount");L([p.property({type:Boolean})],z.prototype,"showFillMetadata");L([p.property({type:Number})],z.prototype,"completedCount");L([p.property({type:Number})],z.prototype,"uploadProgress");const lt='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ae(n,e){return t=>{if(t.key!=="Tab")return;const i=n();if(!i)return;const r=i.querySelector(e);if(!r)return;const o=Array.from(r.querySelectorAll(lt));if(o.length===0)return;const a=o[0],l=o[o.length-1],d=i.activeElement;t.shiftKey?(d===a||!r.contains(d))&&(t.preventDefault(),l.focus()):(d===l||!r.contains(d))&&(t.preventDefault(),a.focus())}}var dt=Object.defineProperty,ne=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&dt(e,t,r),r};const xe=class xe extends s.LitElement{constructor(){super(...arguments),this._url="",this._name="",this._error="",this._onBackdropClick=e=>{e.target===e.currentTarget&&this._cancel()},this._onUrlInput=e=>{this._url=e.target.value,this._error="",this._autoName()},this._onNameInput=e=>{this._name=e.target.value},this._focusTrap=ae(()=>this.shadowRoot,".card"),this._onKeyDown=e=>{var t;e.key==="Escape"&&this._cancel(),e.key==="Enter"&&((t=e.target)==null?void 0:t.tagName)==="INPUT"&&this._submit(),this._focusTrap(e)}}_autoName(){var e;if(!this._name)try{const t=new URL(this._url).pathname.split("/"),i=t[t.length-1];if(i){const r=(e=this.shadowRoot)==null?void 0:e.querySelector("#nameInput");r&&(r.placeholder=i)}}catch{}}_cancel(){this.dispatchEvent(new CustomEvent("url-cancel",{bubbles:!0,composed:!0}))}_submit(){const e=this._url.trim();if(!e){this._error="Please enter a URL";return}try{new URL(e)}catch{this._error="Please enter a valid URL";return}this._error="";let t=this._name.trim();if(!t)try{const i=new URL(e).pathname.split("/");t=i[i.length-1]||"imported-file"}catch{t="imported-file"}this.dispatchEvent(new CustomEvent("url-submit",{detail:{url:e,name:t},bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var e,t;(t=(e=this.shadowRoot)==null?void 0:e.querySelector("#urlInput"))==null||t.focus()})}render(){return s.html`
|
|
2363
|
+
<div class="backdrop" @click=${this._onBackdropClick} @keydown=${this._onKeyDown}>
|
|
2364
|
+
<div class="card">
|
|
2365
|
+
<div class="head">
|
|
2366
|
+
<div class="head-icon">
|
|
2367
|
+
<svg viewBox="0 0 24 24">
|
|
2368
|
+
<path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71" />
|
|
2369
|
+
<path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71" />
|
|
2370
|
+
</svg>
|
|
2371
|
+
</div>
|
|
2372
|
+
<div class="title">Import from URL</div>
|
|
2373
|
+
<button class="close-btn" aria-label="Close" @click=${this._cancel}>\u2715</button>
|
|
2374
|
+
</div>
|
|
2375
|
+
<div class="body">
|
|
2376
|
+
<div class="field">
|
|
2377
|
+
<label for="urlInput">File URL</label>
|
|
2378
|
+
<input
|
|
2379
|
+
id="urlInput"
|
|
2380
|
+
type="url"
|
|
2381
|
+
placeholder="https://example.com/file.pdf"
|
|
2382
|
+
.value=${this._url}
|
|
2383
|
+
@input=${this._onUrlInput}
|
|
2384
|
+
/>
|
|
2385
|
+
</div>
|
|
2386
|
+
<div class="field">
|
|
2387
|
+
<label for="nameInput">File name <span class="optional">(optional)</span></label>
|
|
2388
|
+
<input
|
|
2389
|
+
id="nameInput"
|
|
2390
|
+
type="text"
|
|
2391
|
+
placeholder="document.pdf"
|
|
2392
|
+
.value=${this._name}
|
|
2393
|
+
@input=${this._onNameInput}
|
|
2394
|
+
/>
|
|
2395
|
+
</div>
|
|
2396
|
+
${this._error?s.html`<div class="error">${this._error}</div>`:""}
|
|
2397
|
+
<div class="actions">
|
|
2398
|
+
<button class="btn btn-ghost" @click=${this._cancel}>Cancel</button>
|
|
2399
|
+
<button class="btn btn-primary" @click=${this._submit}>
|
|
2400
|
+
Import file
|
|
2401
|
+
</button>
|
|
2402
|
+
</div>
|
|
2403
|
+
</div>
|
|
2404
|
+
</div>
|
|
2405
|
+
</div>
|
|
2406
|
+
`}};xe.styles=[N,X,s.css`
|
|
2407
|
+
:host {
|
|
2408
|
+
display: block;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
.backdrop {
|
|
2412
|
+
position: fixed;
|
|
2413
|
+
inset: 0;
|
|
2414
|
+
z-index: 1000;
|
|
2415
|
+
background: var(--sfx-up-backdrop, rgba(0, 0, 0, 0.45));
|
|
2416
|
+
backdrop-filter: blur(6px);
|
|
2417
|
+
display: flex;
|
|
2418
|
+
align-items: center;
|
|
2419
|
+
justify-content: center;
|
|
2420
|
+
padding: 20px;
|
|
2421
|
+
animation: fadeIn 0.18s ease both;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
.card {
|
|
2425
|
+
background: var(--sfx-up-bg, #fff);
|
|
2426
|
+
border-radius: 12px;
|
|
2427
|
+
box-shadow: 0 28px 80px var(--sfx-up-shadow, rgba(0, 0, 0, 0.18)), 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
2428
|
+
width: 100%;
|
|
2429
|
+
max-width: 480px;
|
|
2430
|
+
overflow: hidden;
|
|
2431
|
+
display: flex;
|
|
2432
|
+
flex-direction: column;
|
|
2433
|
+
transform: translateY(18px) scale(0.97);
|
|
2434
|
+
animation: slideUp 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
.head {
|
|
2438
|
+
display: flex;
|
|
2439
|
+
align-items: center;
|
|
2440
|
+
gap: 10px;
|
|
2441
|
+
padding: 18px 20px 0;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
.head-icon {
|
|
2445
|
+
width: 32px;
|
|
2446
|
+
height: 32px;
|
|
2447
|
+
border-radius: 8px;
|
|
2448
|
+
background: var(--sfx-up-primary-bg, #f5f5f7);
|
|
2449
|
+
display: flex;
|
|
2450
|
+
align-items: center;
|
|
2451
|
+
justify-content: center;
|
|
2452
|
+
flex-shrink: 0;
|
|
2453
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
.head-icon svg {
|
|
2457
|
+
width: 18px;
|
|
2458
|
+
height: 18px;
|
|
2459
|
+
fill: none;
|
|
2460
|
+
stroke: currentColor;
|
|
2461
|
+
stroke-width: 2;
|
|
2462
|
+
stroke-linecap: round;
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
.title {
|
|
2466
|
+
font-size: 16px;
|
|
2467
|
+
font-weight: 700;
|
|
2468
|
+
color: var(--sfx-up-text, #1a1a1a);
|
|
2469
|
+
flex: 1;
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
.close-btn {
|
|
2473
|
+
width: 28px;
|
|
2474
|
+
height: 28px;
|
|
2475
|
+
border-radius: 8px;
|
|
2476
|
+
border: none;
|
|
2477
|
+
background: var(--sfx-up-border-light, #f0f0f0);
|
|
2478
|
+
color: var(--sfx-up-text-muted, #888);
|
|
2479
|
+
font-size: 14px;
|
|
2480
|
+
cursor: pointer;
|
|
2481
|
+
display: flex;
|
|
2482
|
+
align-items: center;
|
|
2483
|
+
justify-content: center;
|
|
2484
|
+
transition: background 0.15s, color 0.15s;
|
|
2485
|
+
flex-shrink: 0;
|
|
2486
|
+
line-height: 1;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
.close-btn:hover {
|
|
2490
|
+
background: var(--sfx-up-border, #e4e4e4);
|
|
2491
|
+
color: var(--sfx-up-text, #333);
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
.body {
|
|
2495
|
+
padding: 18px 20px 20px;
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
.field {
|
|
2499
|
+
margin-bottom: 14px;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
label {
|
|
2503
|
+
display: block;
|
|
2504
|
+
font-size: 12px;
|
|
2505
|
+
font-weight: 600;
|
|
2506
|
+
color: var(--sfx-up-text-muted, #aaa);
|
|
2507
|
+
margin-bottom: 5px;
|
|
2508
|
+
text-transform: uppercase;
|
|
2509
|
+
letter-spacing: 0.7px;
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
label .optional {
|
|
2513
|
+
color: var(--sfx-up-border, #ccc);
|
|
2514
|
+
font-weight: 400;
|
|
2515
|
+
text-transform: none;
|
|
2516
|
+
letter-spacing: 0;
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
input {
|
|
2520
|
+
width: 100%;
|
|
2521
|
+
height: 40px;
|
|
2522
|
+
border: 1.5px solid var(--sfx-up-border, #ebebeb);
|
|
2523
|
+
border-radius: 6px;
|
|
2524
|
+
padding: 0 14px;
|
|
2525
|
+
font-size: 14px;
|
|
2526
|
+
font-family: inherit;
|
|
2527
|
+
color: var(--sfx-up-text, #1a1a1a);
|
|
2528
|
+
background: var(--sfx-up-border-light, #fafafa);
|
|
2529
|
+
transition: border-color 0.15s, background 0.15s;
|
|
2530
|
+
outline: none;
|
|
2531
|
+
box-sizing: border-box;
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
input:focus {
|
|
2535
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
2536
|
+
background: var(--sfx-up-bg, #fff);
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
input::placeholder {
|
|
2540
|
+
color: var(--sfx-up-text-muted, #ccc);
|
|
2541
|
+
text-align: center;
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
.error {
|
|
2545
|
+
font-size: 12px;
|
|
2546
|
+
color: var(--sfx-up-error, #dc2626);
|
|
2547
|
+
margin-top: -6px;
|
|
2548
|
+
margin-bottom: 8px;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
.actions {
|
|
2552
|
+
display: flex;
|
|
2553
|
+
gap: 8px;
|
|
2554
|
+
justify-content: flex-end;
|
|
2555
|
+
margin-top: 18px;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
|
|
2559
|
+
|
|
2560
|
+
@keyframes fadeIn {
|
|
2561
|
+
from { opacity: 0; }
|
|
2562
|
+
to { opacity: 1; }
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
@keyframes slideUp {
|
|
2566
|
+
from { transform: translateY(18px) scale(0.97); }
|
|
2567
|
+
to { transform: translateY(0) scale(1); }
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
.close-btn:focus-visible {
|
|
2571
|
+
outline: 2px solid var(--sfx-up-primary, #2563eb);
|
|
2572
|
+
outline-offset: 2px;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
input:focus-visible {
|
|
2576
|
+
outline: none;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
`];let I=xe;ne([p.state()],I.prototype,"_url");ne([p.state()],I.prototype,"_name");ne([p.state()],I.prototype,"_error");var ct=Object.defineProperty,re=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&ct(e,t,r),r};const ge=class ge extends s.LitElement{constructor(){super(...arguments),this._stream=null,this._error="",this._captured=null,this._previewUrl="",this._onBackdropClick=e=>{e.target===e.currentTarget&&this._cancel()},this._focusTrap=ae(()=>this.shadowRoot,".card"),this._onKeyDown=e=>{e.key==="Escape"&&this._cancel(),this._focusTrap(e)},this._capture=()=>{var r,o;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("video"),t=(o=this.shadowRoot)==null?void 0:o.querySelector("canvas");if(!e||!t)return;t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0),t.toBlob(a=>{a&&(this._captured=a,this._previewUrl=URL.createObjectURL(a),this._stopStream())},"image/jpeg",.92)},this._retake=()=>{this._previewUrl&&URL.revokeObjectURL(this._previewUrl),this._captured=null,this._previewUrl="",this._startCamera()},this._usePhoto=()=>{if(!this._captured)return;const e=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),t=new File([this._captured],`camera-${e}.jpg`,{type:"image/jpeg"});this.dispatchEvent(new CustomEvent("camera-capture",{detail:{file:t},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this._startCamera()}disconnectedCallback(){super.disconnectedCallback(),this._stopStream(),this._previewUrl&&URL.revokeObjectURL(this._previewUrl)}async _startCamera(){var e;try{this._stream=await navigator.mediaDevices.getUserMedia({video:!0,audio:!1}),await this.updateComplete;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("video");t&&(t.srcObject=this._stream)}catch{this._error="Could not access camera. Please check your permissions."}}_stopStream(){var e;(e=this._stream)==null||e.getTracks().forEach(t=>t.stop()),this._stream=null}_cancel(){this._stopStream(),this.dispatchEvent(new CustomEvent("camera-cancel",{bubbles:!0,composed:!0}))}render(){return s.html`
|
|
2580
|
+
<div class="backdrop" @click=${this._onBackdropClick} @keydown=${this._onKeyDown}>
|
|
2581
|
+
<div class="card">
|
|
2582
|
+
<div class="head">
|
|
2583
|
+
<div class="head-icon">
|
|
2584
|
+
<svg viewBox="0 0 24 24">
|
|
2585
|
+
<path d="M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"/>
|
|
2586
|
+
<circle cx="12" cy="13" r="4"/>
|
|
2587
|
+
</svg>
|
|
2588
|
+
</div>
|
|
2589
|
+
<div class="title">Camera</div>
|
|
2590
|
+
<button class="close-btn" aria-label="Close" @click=${this._cancel}>\u2715</button>
|
|
2591
|
+
</div>
|
|
2592
|
+
<div class="body">
|
|
2593
|
+
${this._error?s.html`<div class="error">${this._error}</div>`:this._captured?s.html`
|
|
2594
|
+
<img class="preview-img" src=${this._previewUrl} alt="Captured photo" />
|
|
2595
|
+
<div class="actions">
|
|
2596
|
+
<button class="btn btn-ghost" @click=${this._retake}>Retake</button>
|
|
2597
|
+
<button class="btn btn-primary" @click=${this._usePhoto}>Use photo</button>
|
|
2598
|
+
</div>
|
|
2599
|
+
`:s.html`
|
|
2600
|
+
<video autoplay playsinline muted></video>
|
|
2601
|
+
<canvas></canvas>
|
|
2602
|
+
<div class="actions">
|
|
2603
|
+
<button class="btn-capture" @click=${this._capture}></button>
|
|
2604
|
+
</div>
|
|
2605
|
+
`}
|
|
2606
|
+
</div>
|
|
2607
|
+
</div>
|
|
2608
|
+
</div>
|
|
2609
|
+
`}};ge.styles=[N,X,s.css`
|
|
2610
|
+
:host { display: block; }
|
|
2611
|
+
|
|
2612
|
+
.backdrop {
|
|
2613
|
+
position: fixed; inset: 0; z-index: 1000;
|
|
2614
|
+
background: var(--sfx-up-backdrop, rgba(0, 0, 0, 0.45));
|
|
2615
|
+
backdrop-filter: blur(6px);
|
|
2616
|
+
display: flex; align-items: center; justify-content: center;
|
|
2617
|
+
padding: 20px;
|
|
2618
|
+
animation: fadeIn 0.18s ease both;
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
.card {
|
|
2622
|
+
background: var(--sfx-up-bg, #fff);
|
|
2623
|
+
border-radius: 12px;
|
|
2624
|
+
box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
2625
|
+
width: 100%; max-width: 520px;
|
|
2626
|
+
height: 520px;
|
|
2627
|
+
overflow: hidden; display: flex; flex-direction: column;
|
|
2628
|
+
animation: slideUp 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
.head {
|
|
2632
|
+
display: flex; align-items: center; gap: 10px;
|
|
2633
|
+
padding: 18px 20px 0;
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
.head-icon {
|
|
2637
|
+
width: 32px; height: 32px; border-radius: 8px;
|
|
2638
|
+
background: var(--sfx-up-primary-bg, #f5f5f7);
|
|
2639
|
+
display: flex; align-items: center; justify-content: center;
|
|
2640
|
+
flex-shrink: 0; color: var(--sfx-up-primary, #2563eb);
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
.head-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
|
|
2644
|
+
|
|
2645
|
+
.title { font-size: 16px; font-weight: 700; color: var(--sfx-up-text, #1a1a1a); flex: 1; }
|
|
2646
|
+
|
|
2647
|
+
.close-btn {
|
|
2648
|
+
width: 28px; height: 28px; border-radius: 8px; border: none;
|
|
2649
|
+
background: var(--sfx-up-border-light, #f0f0f0); color: var(--sfx-up-text-muted, #888); font-size: 14px; cursor: pointer;
|
|
2650
|
+
display: flex; align-items: center; justify-content: center;
|
|
2651
|
+
transition: background 0.15s, color 0.15s; flex-shrink: 0; line-height: 1;
|
|
2652
|
+
}
|
|
2653
|
+
.close-btn:hover { background: var(--sfx-up-border, #e4e4e4); color: var(--sfx-up-text, #333); }
|
|
2654
|
+
|
|
2655
|
+
.body { padding: 18px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; flex: 1; min-height: 0; justify-content: center; }
|
|
2656
|
+
|
|
2657
|
+
video, canvas {
|
|
2658
|
+
width: 100%; flex: 1; min-height: 0; border-radius: 12px;
|
|
2659
|
+
background: #000; object-fit: cover;
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
canvas { display: none; }
|
|
2663
|
+
|
|
2664
|
+
.preview-img {
|
|
2665
|
+
width: 100%; max-height: 320px; border-radius: 12px;
|
|
2666
|
+
object-fit: contain; background: #000;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
.error { font-size: 13px; color: var(--sfx-up-error, #dc2626); text-align: center; padding: 40px 20px; }
|
|
2670
|
+
|
|
2671
|
+
.actions { display: flex; gap: 8px; justify-content: center; width: 100%; }
|
|
2672
|
+
|
|
2673
|
+
.btn-capture {
|
|
2674
|
+
width: 52px; height: 52px; border-radius: 50%; padding: 0;
|
|
2675
|
+
background: var(--sfx-up-error, #dc2626); border: 4px solid var(--sfx-up-bg, #fff);
|
|
2676
|
+
box-shadow: 0 0 0 2px var(--sfx-up-error, #dc2626), 0 4px 12px var(--sfx-up-shadow, rgba(220, 38, 38, 0.3));
|
|
2677
|
+
cursor: pointer; transition: all 0.15s;
|
|
2678
|
+
}
|
|
2679
|
+
.btn-capture:hover { background: var(--destructive-foreground, #b91c1c); transform: scale(1.05); }
|
|
2680
|
+
|
|
2681
|
+
.close-btn:focus-visible,
|
|
2682
|
+
.btn-capture:focus-visible {
|
|
2683
|
+
outline: 2px solid var(--sfx-up-primary, #2563eb);
|
|
2684
|
+
outline-offset: 2px;
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
2688
|
+
@keyframes slideUp { from { transform: translateY(18px) scale(0.97); } to { transform: translateY(0) scale(1); } }
|
|
2689
|
+
`];let j=ge;re([p.state()],j.prototype,"_stream");re([p.state()],j.prototype,"_error");re([p.state()],j.prototype,"_captured");re([p.state()],j.prototype,"_previewUrl");var pt=Object.defineProperty,G=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&pt(e,t,r),r};const ve=class ve extends s.LitElement{constructor(){super(...arguments),this._stream=null,this._recording=!1,this._error="",this._recordedBlob=null,this._previewUrl="",this._recorder=null,this._chunks=[],this._onBackdropClick=e=>{e.target===e.currentTarget&&this._cancel()},this._focusTrap=ae(()=>this.shadowRoot,".card"),this._onKeyDown=e=>{e.key==="Escape"&&this._cancel(),this._focusTrap(e)},this._startRecording=async()=>{var e;try{this._stream=await navigator.mediaDevices.getDisplayMedia({video:{width:1280,height:720,frameRate:5},audio:!0}),this._stream.getVideoTracks()[0].addEventListener("ended",()=>{this._stopRecording()}),this._recording=!0,await this.updateComplete;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("video");t&&(t.srcObject=this._stream),this._chunks=[];const i=MediaRecorder.isTypeSupported("video/webm;codecs=vp9")?"video/webm;codecs=vp9":"video/webm";this._recorder=new MediaRecorder(this._stream,{mimeType:i}),this._recorder.ondataavailable=r=>{r.data.size>0&&this._chunks.push(r.data)},this._recorder.onstop=()=>{var o;const r=new Blob(this._chunks,{type:"video/webm"});this._recordedBlob=r,this._previewUrl=URL.createObjectURL(r),(o=this._stream)==null||o.getTracks().forEach(a=>a.stop()),this._stream=null},this._recorder.start()}catch{this._error="Could not start screen capture. Please check your permissions."}},this._stopRecording=()=>{var e;this._recording=!1,((e=this._recorder)==null?void 0:e.state)==="recording"&&this._recorder.stop(),this._recorder=null},this._useRecording=()=>{if(!this._recordedBlob)return;const e=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),t=new File([this._recordedBlob],`screencap-${e}.webm`,{type:"video/webm"});this.dispatchEvent(new CustomEvent("screencast-capture",{detail:{file:t},bubbles:!0,composed:!0}))},this._discard=()=>{this._previewUrl&&URL.revokeObjectURL(this._previewUrl),this._recordedBlob=null,this._previewUrl=""}}disconnectedCallback(){super.disconnectedCallback(),this._stopAll(),this._previewUrl&&URL.revokeObjectURL(this._previewUrl)}_stopAll(){var e,t;(e=this._recorder)==null||e.stop(),this._recorder=null,(t=this._stream)==null||t.getTracks().forEach(i=>i.stop()),this._stream=null}_cancel(){this._stopAll(),this.dispatchEvent(new CustomEvent("screencast-cancel",{bubbles:!0,composed:!0}))}render(){return s.html`
|
|
2690
|
+
<div class="backdrop" @click=${this._onBackdropClick} @keydown=${this._onKeyDown}>
|
|
2691
|
+
<div class="card">
|
|
2692
|
+
<div class="head">
|
|
2693
|
+
<div class="head-icon">
|
|
2694
|
+
<svg viewBox="0 0 24 24">
|
|
2695
|
+
<rect x="2" y="3" width="20" height="14" rx="2"/>
|
|
2696
|
+
<circle cx="12" cy="10" r="3"/>
|
|
2697
|
+
<path d="M7 21h10"/>
|
|
2698
|
+
</svg>
|
|
2699
|
+
</div>
|
|
2700
|
+
<div class="title">Screen cast</div>
|
|
2701
|
+
<button class="close-btn" aria-label="Close" @click=${this._cancel}>\u2715</button>
|
|
2702
|
+
</div>
|
|
2703
|
+
<div class="body">
|
|
2704
|
+
${this._error?s.html`<div class="error">${this._error}</div>`:this._recordedBlob?s.html`
|
|
2705
|
+
<video src=${this._previewUrl} controls></video>
|
|
2706
|
+
<div class="actions">
|
|
2707
|
+
<button class="btn btn-ghost" @click=${this._discard}>Discard</button>
|
|
2708
|
+
<button class="btn btn-primary" @click=${this._useRecording}>Use recording</button>
|
|
2709
|
+
</div>
|
|
2710
|
+
`:this._recording?s.html`
|
|
2711
|
+
<video autoplay playsinline muted></video>
|
|
2712
|
+
<div class="status"><div class="rec-dot"></div> Recording...</div>
|
|
2713
|
+
<div class="actions">
|
|
2714
|
+
<button class="btn btn-danger" @click=${this._stopRecording}>Stop recording</button>
|
|
2715
|
+
</div>
|
|
2716
|
+
`:s.html`
|
|
2717
|
+
<div class="start-view">
|
|
2718
|
+
<div class="start-icon">
|
|
2719
|
+
<svg viewBox="0 0 24 24">
|
|
2720
|
+
<rect x="2" y="3" width="20" height="14" rx="2"/>
|
|
2721
|
+
<circle cx="12" cy="10" r="3"/>
|
|
2722
|
+
<path d="M7 21h10"/>
|
|
2723
|
+
</svg>
|
|
2724
|
+
</div>
|
|
2725
|
+
<div class="start-text">Share your screen to record a video that will be added to your uploads.</div>
|
|
2726
|
+
<div class="actions">
|
|
2727
|
+
<button class="btn btn-ghost" @click=${this._cancel}>Cancel</button>
|
|
2728
|
+
<button class="btn btn-primary" @click=${this._startRecording}>Start recording</button>
|
|
2729
|
+
</div>
|
|
2730
|
+
</div>
|
|
2731
|
+
`}
|
|
2732
|
+
</div>
|
|
2733
|
+
</div>
|
|
2734
|
+
</div>
|
|
2735
|
+
`}};ve.styles=[N,X,s.css`
|
|
2736
|
+
:host { display: block; }
|
|
2737
|
+
|
|
2738
|
+
.backdrop {
|
|
2739
|
+
position: fixed; inset: 0; z-index: 1000;
|
|
2740
|
+
background: var(--sfx-up-backdrop, rgba(0, 0, 0, 0.45));
|
|
2741
|
+
backdrop-filter: blur(6px);
|
|
2742
|
+
display: flex; align-items: center; justify-content: center;
|
|
2743
|
+
padding: 20px;
|
|
2744
|
+
animation: fadeIn 0.18s ease both;
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
.card {
|
|
2748
|
+
background: var(--sfx-up-bg, #fff);
|
|
2749
|
+
border-radius: 12px;
|
|
2750
|
+
box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
2751
|
+
width: 100%; max-width: 560px;
|
|
2752
|
+
overflow: hidden; display: flex; flex-direction: column;
|
|
2753
|
+
animation: slideUp 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
.head {
|
|
2757
|
+
display: flex; align-items: center; gap: 10px;
|
|
2758
|
+
padding: 18px 20px 0;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
.head-icon {
|
|
2762
|
+
width: 32px; height: 32px; border-radius: 8px;
|
|
2763
|
+
background: var(--sfx-up-primary-bg, #f5f5f7);
|
|
2764
|
+
display: flex; align-items: center; justify-content: center;
|
|
2765
|
+
flex-shrink: 0; color: var(--sfx-up-primary, #2563eb);
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
.head-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
|
|
2769
|
+
|
|
2770
|
+
.title { font-size: 16px; font-weight: 700; color: var(--sfx-up-text, #1a1a1a); flex: 1; }
|
|
2771
|
+
|
|
2772
|
+
.close-btn {
|
|
2773
|
+
width: 28px; height: 28px; border-radius: 8px; border: none;
|
|
2774
|
+
background: var(--sfx-up-border-light, #f0f0f0); color: var(--sfx-up-text-muted, #888); font-size: 14px; cursor: pointer;
|
|
2775
|
+
display: flex; align-items: center; justify-content: center;
|
|
2776
|
+
transition: background 0.15s, color 0.15s; flex-shrink: 0; line-height: 1;
|
|
2777
|
+
}
|
|
2778
|
+
.close-btn:hover { background: var(--sfx-up-border, #e4e4e4); color: var(--sfx-up-text, #333); }
|
|
2779
|
+
|
|
2780
|
+
.body { padding: 18px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
|
|
2781
|
+
|
|
2782
|
+
video {
|
|
2783
|
+
width: 100%; max-height: 320px; border-radius: 12px;
|
|
2784
|
+
background: #000; object-fit: contain;
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
.error { font-size: 13px; color: var(--sfx-up-error, #dc2626); text-align: center; padding: 40px 20px; }
|
|
2788
|
+
|
|
2789
|
+
.status {
|
|
2790
|
+
font-size: 13px; color: var(--sfx-up-text-secondary, #475569);
|
|
2791
|
+
display: flex; align-items: center; gap: 8px;
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
.rec-dot {
|
|
2795
|
+
width: 10px; height: 10px; border-radius: 50%;
|
|
2796
|
+
background: var(--sfx-up-error, #dc2626); animation: pulse 1s ease-in-out infinite;
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
.actions { display: flex; gap: 8px; justify-content: center; width: 100%; }
|
|
2800
|
+
|
|
2801
|
+
.btn-danger {
|
|
2802
|
+
background: var(--sfx-up-error, #dc2626); color: var(--primary-foreground, #fff);
|
|
2803
|
+
box-shadow: 0 2px 10px var(--sfx-up-shadow, rgba(220, 38, 38, 0.28));
|
|
2804
|
+
}
|
|
2805
|
+
.btn-danger:hover { background: var(--destructive-foreground, #b91c1c); }
|
|
2806
|
+
|
|
2807
|
+
.start-view {
|
|
2808
|
+
display: flex; flex-direction: column; align-items: center; gap: 16px;
|
|
2809
|
+
padding: 30px 20px; text-align: center;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
.start-icon {
|
|
2813
|
+
width: 56px; height: 56px; border-radius: 16px;
|
|
2814
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
2815
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
2816
|
+
display: flex; align-items: center; justify-content: center;
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
.start-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
|
|
2820
|
+
|
|
2821
|
+
.start-text {
|
|
2822
|
+
font-size: 14px; color: var(--sfx-up-text-secondary, #475569); max-width: 300px;
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
.close-btn:focus-visible {
|
|
2826
|
+
outline: 2px solid var(--sfx-up-primary, #2563eb);
|
|
2827
|
+
outline-offset: 2px;
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2830
|
+
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
2831
|
+
@keyframes slideUp { from { transform: translateY(18px) scale(0.97); } to { transform: translateY(0) scale(1); } }
|
|
2832
|
+
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
|
|
2833
|
+
`];let T=ve;G([p.state()],T.prototype,"_stream");G([p.state()],T.prototype,"_recording");G([p.state()],T.prototype,"_error");G([p.state()],T.prototype,"_recordedBlob");G([p.state()],T.prototype,"_previewUrl");var ft=Object.defineProperty,k=(n,e,t,i)=>{for(var r=void 0,o=n.length-1,a;o>=0;o--)(a=n[o])&&(r=a(e,t,r)||r);return r&&ft(e,t,r),r};const $e=new Set(["unsplash"]);var $;const _=($=class extends s.LitElement{constructor(){super(),this.config=null,this._isOpen=!1,this._activeConnector=null,this._showUrlDialog=!1,this._showCameraDialog=!1,this._showScreenCastDialog=!1,this._previewFileId=null,this._previewDims="—",this._fullscreenPreviewUrl=null,this._fullscreenVideoFile=null,this._fullscreenZoomed=!1,this._fsPanX=0,this._fsPanY=0,this._fsDragging=!1,this._fsDragStartX=0,this._fsDragStartY=0,this._fsPanStartX=0,this._fsPanStartY=0,this._bodyDragOver=!1,this._isMinimized=!1,this._isPillExpanded=!1,this._bodyDragCounter=0,this._videoBlobUrls=new Map,this._engine=null,this._cachedSources=A,this._cachedSourcesConfig=void 0,this._rejectedTimers=new Map,this._closeOnCompleteTimer=null,this._apiBase=null,this._authHeaders=null,this._authResolveId=0,this._prevStoreState=null,this._unsubStoreEvents=null,this._portalContainer=null,this._onFilesSelected=e=>{this._processIncomingFiles(e.detail.files)},this._onDropTileSourceClick=e=>{this._handleSourceActivation(e.detail.source.id)},this._onSourceClick=async e=>{this._handleSourceActivation(e.detail.source)},this._handleSourceActivation=async e=>{var r,o;const t=this._mergedSources.find(a=>a.id===e);if(t!=null&&t.onActivate){try{t.onActivate(this)}catch(a){console.error(`[sfx-uploader] onActivate for custom source "${e}" threw:`,a)}return}if(e==="device"){const a=this.shadowRoot.querySelector("sfx-drop-zone");a==null||a.browse();return}if(e==="url"){this._showUrlDialog=!0;return}if(e==="camera"){this._showCameraDialog=!0;return}if(e==="screen-cast"){this._showScreenCastDialog=!0;return}if((((o=(r=this.config)==null?void 0:r.connectors)==null?void 0:o.providers)??[]).includes(e)){if($e.has(e)){if(!customElements.get("sfx-search-provider-browser")){const{SfxSearchProviderBrowser:l}=await Promise.resolve().then(()=>require("./search-provider-browser-KQs6JI8u.cjs"));customElements.define("sfx-search-provider-browser",l)}}else if(!customElements.get("sfx-provider-browser")){const{SfxProviderBrowser:l}=await Promise.resolve().then(()=>require("./provider-browser-DbjyF_Ou.cjs"));customElements.define("sfx-provider-browser",l)}this._activeConnector=e}},this._onUrlSubmit=e=>{var h,x,u;this._showUrlDialog=!1;const{url:t,name:i}=e.detail,r=(h=this.config)==null?void 0:h.callbacks,o=Xe(i),a=o.startsWith("image/"),l=this._store.getState(),d=oe({name:i,size:0,type:o},l.restrictions,l.files);if(d){const f={id:B(),status:"rejected",file:null,remoteUrl:t,name:i,size:0,type:o,previewUrl:null,duration:null,progress:0,speed:0,bytesUploaded:0,error:d,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:null};M(this._store,f),this._dispatchPublic(g.FILE_REJECTED,{file:f,reason:d}),(x=r==null?void 0:r.onFileRejected)==null||x.call(r,f,d);return}const c={id:B(),status:"idle",file:null,remoteUrl:t,name:i,size:0,type:o,previewUrl:a?t:null,duration:null,progress:0,speed:0,bytesUploaded:0,error:null,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:null};M(this._store,c),this._dispatchPublic(g.FILE_ADDED,{file:c}),(u=r==null?void 0:r.onFileAdded)==null||u.call(r,c),this._store.getState().queueConfig.autoProceed&&this.upload()},this._onUrlCancel=()=>{this._showUrlDialog=!1},this._onCameraCapture=e=>{this._showCameraDialog=!1,this._processIncomingFiles([e.detail.file])},this._onCameraCancel=()=>{this._showCameraDialog=!1},this._onScreenCastCapture=e=>{this._showScreenCastDialog=!1,this._processIncomingFiles([e.detail.file])},this._onScreenCastCancel=()=>{this._showScreenCastDialog=!1},this._onFileRemove=e=>{this._removeFile(e.detail.fileId)},this._onFilePreview=e=>{var i,r,o;const t=this._store.getState().files.get(e.detail.fileId);t&&(this._previewFileId=t.id,this._dispatchPublic(g.FILE_PREVIEW,{file:t}),(o=(r=(i=this.config)==null?void 0:i.callbacks)==null?void 0:r.onFilePreview)==null||o.call(r,t))},this._onFillMetadata=()=>{var t,i,r;const e=[...this._store.getState().files.values()].filter(o=>$._MODIFIABLE_STATUSES.has(o.status));this._dispatchPublic(g.FILL_METADATA,{files:e}),(r=(i=(t=this.config)==null?void 0:t.callbacks)==null?void 0:i.onFillMetadata)==null||r.call(i,e)},this._onFileRetry=e=>{var t;this._ensureEngine(),(t=this._engine)==null||t.retryFile(e.detail.fileId)},this._onRetryAll=()=>{var e;this._ensureEngine(),(e=this._engine)==null||e.retryAll()},this._onClearAll=()=>{var i,r,o;const e=(i=this.config)==null?void 0:i.callbacks;this._closeOnCompleteTimer&&(clearTimeout(this._closeOnCompleteTimer),this._closeOnCompleteTimer=null),(r=this._engine)==null||r.cancelAll();const t=[...this._store.getState().files.values()];for(const a of t)a.previewUrl&&URL.revokeObjectURL(a.previewUrl),this._dispatchPublic(g.FILE_REMOVED,{file:a}),(o=e==null?void 0:e.onFileRemoved)==null||o.call(e,a);this._revokeVideoBlobUrls();for(const a of this._rejectedTimers.values())clearTimeout(a);this._rejectedTimers.clear(),this._dimCache.clear(),this._previewFileId=null,this._fullscreenPreviewUrl=null,this._fullscreenVideoFile=null,this._store.setState({files:new Map,isUploading:!1,totalProgress:0,totalSpeed:0,totalBytesUploaded:0,totalBytes:0})},this._onAddMore=()=>{var r;const e=this.shadowRoot.querySelector("sfx-drop-zone");if(e){e.browse();return}const t=this.shadowRoot.querySelector("sfx-file-list"),i=(r=t==null?void 0:t.shadowRoot)==null?void 0:r.querySelector('input[type="file"]');i==null||i.click()},this._onUploadStart=()=>{var e;if(this._phase==="complete"){((e=this.config)==null?void 0:e.clearOnComplete)!==!1&&this._onClearAll();return}this.upload()},this._onUploadMore=()=>{this._onClearAll()},this._onConnectorFilesSelected=e=>{var i,r,o;const t=(i=this.config)==null?void 0:i.callbacks;for(const a of e.detail.files){const l=this._store.getState(),d=oe({name:a.name,size:a.size,type:a.mimeType},l.restrictions,l.files);if(d){const h={id:B(),status:"rejected",file:null,remoteUrl:null,name:a.name,size:a.size,type:a.mimeType,previewUrl:a.thumbnail,duration:null,progress:0,speed:0,bytesUploaded:0,error:d,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:a};M(this._store,h),this._dispatchPublic(g.FILE_REJECTED,{file:h,reason:d}),(r=t==null?void 0:t.onFileRejected)==null||r.call(t,h,d);continue}const c={id:B(),status:"idle",file:null,remoteUrl:null,name:a.name,size:a.size,type:a.mimeType,previewUrl:a.thumbnail,duration:null,progress:0,speed:0,bytesUploaded:0,error:null,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:a};M(this._store,c),this._dispatchPublic(g.FILE_ADDED,{file:c}),(o=t==null?void 0:t.onFileAdded)==null||o.call(t,c)}this._activeConnector=null,this._store.getState().queueConfig.autoProceed&&this.upload()},this._onConnectorClose=()=>{this._activeConnector=null},this._onConnectorBackdropClick=e=>{e.target===e.currentTarget&&(this._activeConnector=null)},this._onPrimaryAction=()=>{var e,t,i,r,o;this._dispatchPublic(g.COMPLETE_ACTION,{}),(i=(t=(e=this.config)==null?void 0:e.callbacks)==null?void 0:t.onCompleteAction)==null||i.call(t),((r=this.config)==null?void 0:r.mode)==="modal"?this.close():((o=this.config)==null?void 0:o.clearOnComplete)!==!1&&this._onClearAll()},this._onInlineDismiss=()=>{var e,t,i;(i=(t=(e=this.config)==null?void 0:e.callbacks)==null?void 0:t.onCancel)==null||i.call(t),this._dispatchPublic(g.CANCEL,{})},this._onModalDismiss=()=>{var e,t,i;(i=(t=(e=this.config)==null?void 0:e.callbacks)==null?void 0:t.onCancel)==null||i.call(t),this._dispatchPublic(g.CANCEL,{}),this.close()},this._onMinimize=()=>{this._isMinimized=!0,this._isPillExpanded=!0,this.requestUpdate()},this._onPillClick=()=>{this._isPillExpanded=!this._isPillExpanded,this.requestUpdate()},this._onPillDismiss=()=>{this._isMinimized=!1,this._isPillExpanded=!1,this._isOpen=!0,this.requestUpdate()},this._onModalBackdropClick=e=>{e.target===e.currentTarget&&this._onModalDismiss()},this._onBodyDragEnter=e=>{e.preventDefault(),this._bodyDragCounter++,this._bodyDragCounter===1&&(this._bodyDragOver=!0)},this._onBodyDragOver=e=>{e.preventDefault()},this._onBodyDragLeave=e=>{e.preventDefault(),this._bodyDragCounter--,this._bodyDragCounter<=0&&(this._bodyDragCounter=0,this._bodyDragOver=!1)},this._onBodyDrop=e=>{var i;e.preventDefault(),this._bodyDragCounter=0,this._bodyDragOver=!1;const t=Array.from(((i=e.dataTransfer)==null?void 0:i.files)??[]);t.length>0&&this._onFilesSelected(new CustomEvent("files-selected",{detail:{files:t}}))},this._onKeyDown=e=>{var t,i;if(e.key==="Escape"){if(this._fullscreenPreviewUrl||this._fullscreenVideoFile){this._onFsClose();return}this._isOpen&&((t=this.config)==null?void 0:t.mode)==="modal"&&(((i=this.config)==null?void 0:i.headerButton)??"close")!=="none"&&this._onModalDismiss()}},this._dimCache=new Map,this._onFsToggleZoom=e=>{e==null||e.stopPropagation(),this._fullscreenZoomed=!this._fullscreenZoomed,this._fullscreenZoomed||(this._fsPanX=0,this._fsPanY=0)},this._onFsOverlayClick=e=>{this._fsDragDidMove||this._onFsToggleZoom(e)},this._fsDragDidMove=!1,this._onFsPanStart=e=>{this._fullscreenZoomed&&(this._fsDragging=!0,this._fsDragDidMove=!1,this._fsDragStartX=e.clientX,this._fsDragStartY=e.clientY,this._fsPanStartX=this._fsPanX,this._fsPanStartY=this._fsPanY,e.preventDefault())},this._onFsPanMove=e=>{if(!this._fsDragging)return;const t=e.clientX-this._fsDragStartX,i=e.clientY-this._fsDragStartY;(Math.abs(t)>3||Math.abs(i)>3)&&(this._fsDragDidMove=!0),this._fsPanX=this._fsPanStartX+t,this._fsPanY=this._fsPanStartY+i,this.requestUpdate()},this._onFsPanEnd=()=>{this._fsDragging=!1,requestAnimationFrame(()=>{this._fsDragDidMove=!1})},this._onFsTouchStart=e=>{if(!this._fullscreenZoomed||e.touches.length!==1)return;const t=e.touches[0];this._fsDragging=!0,this._fsDragDidMove=!1,this._fsDragStartX=t.clientX,this._fsDragStartY=t.clientY,this._fsPanStartX=this._fsPanX,this._fsPanStartY=this._fsPanY},this._onFsTouchMove=e=>{if(!this._fsDragging||e.touches.length!==1)return;const t=e.touches[0],i=t.clientX-this._fsDragStartX,r=t.clientY-this._fsDragStartY;(Math.abs(i)>3||Math.abs(r)>3)&&(this._fsDragDidMove=!0),this._fsPanX=this._fsPanStartX+i,this._fsPanY=this._fsPanStartY+r,this.requestUpdate(),e.preventDefault()},this._onFsClose=e=>{e==null||e.stopPropagation(),this._fullscreenPreviewUrl=null,this._fullscreenVideoFile=null,this._fullscreenZoomed=!1,this._fsPanX=0,this._fsPanY=0},this._store=Ee(),this._storeCtrl=new Fe(this,this._store)}open(){var e,t,i;this._isMinimized&&(this._isMinimized=!1,this._isPillExpanded=!1),!this._isOpen&&(this._isOpen=!0,(i=(t=(e=this.config)==null?void 0:e.callbacks)==null?void 0:t.onOpen)==null||i.call(t),this._dispatchPublic(g.OPEN,{}),this.requestUpdate())}close(){var e,t,i,r;this._isOpen&&(this._isOpen=!1,this._closeOnCompleteTimer&&(clearTimeout(this._closeOnCompleteTimer),this._closeOnCompleteTimer=null),((e=this.config)==null?void 0:e.clearOnClose)!==!1&&this._onClearAll(),this._previewFileId=null,(r=(i=(t=this.config)==null?void 0:t.callbacks)==null?void 0:i.onClose)==null||r.call(i),this._dispatchPublic(g.CLOSE,{}),this.requestUpdate())}upload(){var r,o,a,l,d;if(this._ensureEngine(),!this._engine){console.warn("[sfx-uploader] Cannot upload: auth not resolved yet");return}const e=[...this._store.getState().files.values()].filter(c=>c.status==="idle"||c.status==="queued");if((o=(r=this.config)==null?void 0:r.callbacks)!=null&&o.onBeforeUpload&&this.config.callbacks.onBeforeUpload(e)===!1)return;const t=new CustomEvent(g.BEFORE_UPLOAD,{bubbles:!0,composed:!0,cancelable:!0,detail:{files:e}});this.dispatchEvent(t)&&(this._dispatchPublic(g.UPLOAD_STARTED,{files:e}),(d=(l=(a=this.config)==null?void 0:a.callbacks)==null?void 0:l.onUploadStarted)==null||d.call(l,e),this._engine.uploadAll())}addFiles(e){this._processIncomingFiles(e)}resumeUpload(e){var t;if(e&&e.length>0){const i=this._store.getState().files,r=new Map(i);let o=!1;for(const a of e){const l=i.get(a.id);l&&(r.set(a.id,{...l,...a}),o=!0)}o&&this._store.setState({files:r})}this._ensureEngine(),(t=this._engine)==null||t.uploadAll()}cancelUpload(){var e;(e=this._engine)==null||e.cancelAll()}getFiles(){return[...this._store.getState().files.values()]}getFile(e){return this._store.getState().files.get(e)}updateFileMeta(e,t,i){const r=this._store.getState().files,o=r.get(e);if(!o||!$._MODIFIABLE_STATUSES.has(o.status))return;const a=new Map(r);a.set(e,{...o,meta:t!=null?{...o.meta,...t}:o.meta,tags:i??o.tags}),this._store.setState({files:a})}updateFilesMeta(e){const t=this._store.getState().files,i=new Map(t);let r=!1;for(const{fileId:o,meta:a,tags:l}of e){const d=t.get(o);!d||!$._MODIFIABLE_STATUSES.has(d.status)||(i.set(o,{...d,meta:a!=null?{...d.meta,...a}:d.meta,tags:l??d.tags}),r=!0)}r&&this._store.setState({files:i})}updated(e){if(e.has("config")&&this.config&&this._applyConfig(this.config),e.has("_previewFileId")&&this._previewFileId){const t=this._previewFileId,i=this._store.getState().files.get(t);i?this._getImageDimensions(i).then(r=>{this._previewFileId===t&&(this._previewDims=r?`${r.w} × ${r.h}`:"—")}):this._previewDims="—"}this._updateFloatingPortal()}_injectFloatStyles(){if(document.querySelector("style[data-sfx-upload-float-styles]"))return;const e=document.createElement("style");e.setAttribute("data-sfx-upload-float-styles",""),e.textContent=`
|
|
2834
|
+
[data-sfx-upload-float] .upload-float { position:fixed; bottom:24px; right:24px; z-index:10000; width:320px; border-radius:12px; background:#fff; box-shadow:0 8px 32px rgba(0,0,0,0.12),0 2px 8px rgba(0,0,0,0.06); overflow:hidden; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; animation:sfxFloatIn .3s ease both; }
|
|
2835
|
+
[data-sfx-upload-float] .float-header { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-bottom:1px solid #e8edf5; }
|
|
2836
|
+
[data-sfx-upload-float] .float-header-left { display:flex; align-items:center; gap:8px; }
|
|
2837
|
+
[data-sfx-upload-float] .float-icon { width:28px; height:28px; border-radius:6px; background:#eff6ff; color:#2563eb; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
|
|
2838
|
+
[data-sfx-upload-float] .float-icon svg { width:14px; height:14px; }
|
|
2839
|
+
[data-sfx-upload-float] .float-icon.done { background:#f0fdf4; color:#22c55e; }
|
|
2840
|
+
[data-sfx-upload-float] .float-icon.warn { background:#fffbeb; color:#f59e0b; }
|
|
2841
|
+
[data-sfx-upload-float] .float-title { font-size:13px; font-weight:600; color:#1e293b; }
|
|
2842
|
+
[data-sfx-upload-float] .float-subtitle { font-size:11px; color:#94a3b8; }
|
|
2843
|
+
[data-sfx-upload-float] .float-actions { display:flex; gap:4px; }
|
|
2844
|
+
[data-sfx-upload-float] .float-actions button { width:26px; height:26px; border:none; background:none; cursor:pointer; border-radius:6px; display:flex; align-items:center; justify-content:center; color:#94a3b8; transition:background .15s; padding:0; }
|
|
2845
|
+
[data-sfx-upload-float] .float-actions button:hover { background:#f8fafc; color:#374151; }
|
|
2846
|
+
[data-sfx-upload-float] .float-actions button svg { width:14px; height:14px; }
|
|
2847
|
+
[data-sfx-upload-float] .float-progress { padding:10px 14px; border-bottom:1px solid #e8edf5; }
|
|
2848
|
+
[data-sfx-upload-float] .float-progress-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
|
|
2849
|
+
[data-sfx-upload-float] .float-progress-label { font-size:12px; color:#475569; }
|
|
2850
|
+
[data-sfx-upload-float] .float-progress-pct { font-size:12px; font-weight:600; color:#2563eb; }
|
|
2851
|
+
[data-sfx-upload-float] .float-progress-pct.done { color:#22c55e; }
|
|
2852
|
+
[data-sfx-upload-float] .float-progress-pct.warn { color:#f59e0b; }
|
|
2853
|
+
[data-sfx-upload-float] .float-bar { height:4px; background:#e8edf5; border-radius:2px; overflow:hidden; }
|
|
2854
|
+
[data-sfx-upload-float] .float-bar-fill { height:100%; background:#2563eb; border-radius:2px; transition:width .3s ease; }
|
|
2855
|
+
[data-sfx-upload-float] .float-bar-fill.done { background:#22c55e; }
|
|
2856
|
+
[data-sfx-upload-float] .float-bar-fill.warn { background:#f59e0b; }
|
|
2857
|
+
[data-sfx-upload-float] .float-items { max-height:200px; overflow-y:auto; }
|
|
2858
|
+
[data-sfx-upload-float] .float-item { display:flex; align-items:center; gap:10px; padding:8px 14px; border-bottom:1px solid #f1f5f9; }
|
|
2859
|
+
[data-sfx-upload-float] .float-item:last-child { border-bottom:none; }
|
|
2860
|
+
[data-sfx-upload-float] .float-item-thumb { width:32px; height:32px; border-radius:6px; background:#f8fafc; display:flex; align-items:center; justify-content:center; color:#94a3b8; flex-shrink:0; }
|
|
2861
|
+
[data-sfx-upload-float] .float-item-thumb svg { width:16px; height:16px; }
|
|
2862
|
+
[data-sfx-upload-float] .float-item-info { flex:1; min-width:0; }
|
|
2863
|
+
[data-sfx-upload-float] .float-item-name { font-size:12px; font-weight:500; color:#1e293b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
|
2864
|
+
[data-sfx-upload-float] .float-item-size { font-size:11px; color:#94a3b8; }
|
|
2865
|
+
[data-sfx-upload-float] .float-item-done { width:18px; height:18px; border-radius:50%; background:#f0fdf4; color:#22c55e; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
|
|
2866
|
+
[data-sfx-upload-float] .float-item-done svg { width:12px; height:12px; }
|
|
2867
|
+
[data-sfx-upload-float] .float-item-spinner { width:16px; height:16px; border:2px solid #e8edf5; border-top-color:#2563eb; border-radius:50%; animation:sfxSpin .8s linear infinite; flex-shrink:0; }
|
|
2868
|
+
[data-sfx-upload-float] .float-item-error { color:#ef4444; width:16px; height:16px; flex-shrink:0; cursor:help; }
|
|
2869
|
+
[data-sfx-upload-float] .float-collapsed { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; width:320px; border-radius:12px; }
|
|
2870
|
+
[data-sfx-upload-float] .float-collapsed-left { display:flex; align-items:center; gap:8px; }
|
|
2871
|
+
[data-sfx-upload-float] .float-collapsed-spinner { width:18px; height:18px; border:2.5px solid #e8edf5; border-top-color:#2563eb; border-radius:50%; animation:sfxSpin .8s linear infinite; flex-shrink:0; }
|
|
2872
|
+
[data-sfx-upload-float] .float-collapsed-icon { width:18px; height:18px; flex-shrink:0; }
|
|
2873
|
+
[data-sfx-upload-float] .float-collapsed-icon svg { width:18px; height:18px; }
|
|
2874
|
+
[data-sfx-upload-float] .float-collapsed-icon.done { color:#22c55e; }
|
|
2875
|
+
[data-sfx-upload-float] .float-collapsed-icon.warn { color:#f59e0b; }
|
|
2876
|
+
[data-sfx-upload-float] .float-collapsed-text { font-size:13px; font-weight:500; color:#1e293b; white-space:nowrap; }
|
|
2877
|
+
[data-sfx-upload-float] .float-collapsed-pct { font-size:13px; font-weight:600; color:#2563eb; }
|
|
2878
|
+
[data-sfx-upload-float] .float-collapsed-actions { display:flex; gap:4px; }
|
|
2879
|
+
[data-sfx-upload-float] .float-collapsed-actions button { width:26px; height:26px; border:none; background:none; cursor:pointer; border-radius:6px; display:flex; align-items:center; justify-content:center; color:#94a3b8; transition:background .15s; padding:0; }
|
|
2880
|
+
[data-sfx-upload-float] .float-collapsed-actions button:hover { background:#f1f5f9; color:#374151; }
|
|
2881
|
+
[data-sfx-upload-float] .float-collapsed-actions button svg { width:14px; height:14px; }
|
|
2882
|
+
@keyframes sfxFloatIn { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
|
|
2883
|
+
@keyframes sfxSpin { to{transform:rotate(360deg)} }
|
|
2884
|
+
`,document.head.appendChild(e)}_updateFloatingPortal(){const e=[...this._storeCtrl.state.files.values()];this._isMinimized&&e.length>0?(this._injectFloatStyles(),this._portalContainer||(this._portalContainer=document.createElement("div"),this._portalContainer.setAttribute("data-sfx-upload-float",""),document.body.appendChild(this._portalContainer)),s.render(this._renderFloatingPill(e),this._portalContainer)):this._portalContainer&&(s.render(s.nothing,this._portalContainer),this._portalContainer.remove(),this._portalContainer=null)}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._onKeyDown),this._prevStoreState=this._store.getState(),this._unsubStoreEvents=this._store.subscribe(()=>this._onStoreChange())}disconnectedCallback(){var e,t,i,r;super.disconnectedCallback(),document.removeEventListener("keydown",this._onKeyDown),(e=this._unsubStoreEvents)==null||e.call(this),this._unsubStoreEvents=null,this._prevStoreState=null,(t=this._portalContainer)==null||t.remove(),this._portalContainer=null,document.querySelector("[data-sfx-upload-float]")||(i=document.querySelector("style[data-sfx-upload-float-styles]"))==null||i.remove(),this._revokeVideoBlobUrls();for(const o of this._rejectedTimers.values())clearTimeout(o);this._rejectedTimers.clear(),this._closeOnCompleteTimer&&(clearTimeout(this._closeOnCompleteTimer),this._closeOnCompleteTimer=null);for(const o of this._store.getState().files.values())o.previewUrl&&URL.revokeObjectURL(o.previewUrl);(r=this._engine)==null||r.destroy(),this._engine=null}_applyConfig(e){const t={};if(e.targetFolder&&(t.targetFolder=e.targetFolder),e.restrictions&&(t.restrictions={...this._store.getState().restrictions,...e.restrictions}),e.concurrency!=null){const i=this._store.getState().queueConfig;t.queueConfig={...i,concurrency:e.concurrency}}if(e.autoProceed!=null){const i=t.queueConfig??this._store.getState().queueConfig;t.queueConfig={...i,autoProceed:e.autoProceed}}Object.keys(t).length>0&&this._store.setState(t),this._resolveAuthAndEngine(e),(e.mode==="inline"||!e.mode)&&(this._isOpen=!0)}async _resolveAuthAndEngine(e){var r,o;const t=e.auth;if(t.mode==="sass-key"){this._apiBase=te(t.container),this._authHeaders=K(t),this._ensureEngine(),(r=this._engine)==null||r.updateConfig({apiBase:this._apiBase,authHeaders:this._authHeaders});return}const i=++this._authResolveId;try{const a=await Pe(t);if(i!==this._authResolveId)return;this._apiBase=a.apiBase,this._authHeaders=a.headers,this._ensureEngine(),(o=this._engine)==null||o.updateConfig({apiBase:this._apiBase,authHeaders:this._authHeaders})}catch(a){if(i!==this._authResolveId)return;console.error("[sfx-uploader] Auth resolution failed:",a)}}_ensureEngine(){!this._engine&&this._apiBase&&this._authHeaders&&(this._engine=new Ue(this._store,{apiBase:this._apiBase,authHeaders:this._authHeaders}),this._engine.start())}_dispatchPublic(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}_onStoreChange(){var r,o,a,l,d,c,h,x;const e=this._store.getState(),t=this._prevStoreState;if(this._prevStoreState=e,!t)return;const i=(r=this.config)==null?void 0:r.callbacks;for(const[u,f]of e.files){const v=t.files.get(u);if(v){if(v.status!==f.status)switch(f.status){case"uploading":break;case"complete":f.response&&(this._dispatchPublic(g.UPLOAD_COMPLETE,{file:f,response:f.response}),(o=i==null?void 0:i.onUploadComplete)==null||o.call(i,f,f.response));break;case"error":case"failed":{const w=new Error(f.error??"Upload failed");this._dispatchPublic(g.UPLOAD_ERROR,{file:f,error:w}),(a=i==null?void 0:i.onUploadError)==null||a.call(i,f,w);break}case"retrying":this._dispatchPublic(g.UPLOAD_RETRY,{file:f,attempt:f.retryCount}),(l=i==null?void 0:i.onUploadRetry)==null||l.call(i,f,f.retryCount);break}f.status==="uploading"&&v.progress!==f.progress&&(this._dispatchPublic(g.UPLOAD_PROGRESS,{file:f,progress:f.progress,speed:f.speed}),(d=i==null?void 0:i.onUploadProgress)==null||d.call(i,f,f.progress,f.speed))}}if(e.totalProgress!==t.totalProgress||e.totalSpeed!==t.totalSpeed){const u=e.totalSpeed>0?(e.totalBytes-e.totalBytesUploaded)/e.totalSpeed:0;this._dispatchPublic(g.TOTAL_PROGRESS,{percentage:e.totalProgress,speed:e.totalSpeed,eta:u}),(c=i==null?void 0:i.onTotalProgress)==null||c.call(i,e.totalProgress,e.totalSpeed,u)}if(t.isUploading&&!e.isUploading){const u=[...e.files.values()];if(!u.some(v=>v.status==="cancelled")){const v=u.filter(b=>b.status==="complete"),w=u.filter(b=>b.status==="failed"||b.status==="error");this._dispatchPublic(g.ALL_COMPLETE,{successful:v,failed:w}),(h=i==null?void 0:i.onAllComplete)==null||h.call(i,v,w);const m=(x=this.config)==null?void 0:x.closeOnComplete;if(m){const b=typeof m=="number"?m:1500;this._closeOnCompleteTimer=setTimeout(()=>{var y,E,me;this._closeOnCompleteTimer=null,this._phase==="complete"&&(this._dispatchPublic(g.COMPLETE_ACTION,{}),(me=(E=(y=this.config)==null?void 0:y.callbacks)==null?void 0:E.onCompleteAction)==null||me.call(E),this.close())},b)}}}}get _mergedSources(){var d;const e=(d=this.config)==null?void 0:d.connectors;if(e===this._cachedSourcesConfig)return this._cachedSources;if(this._cachedSourcesConfig=e,!e)return this._cachedSources=A,this._cachedSources;const t=e.providers.length>0?De(e.providers):[],i=e.customSources??[],r=A.filter(c=>c.id==="device"||c.id==="url"),o=A.filter(c=>c.id!=="device"&&c.id!=="url"),a=new Set,l=[];for(const c of[...r,...t,...o,...i])if(!a.has(c.id)){if($._RESERVED_IDS.has(c.id)&&c.onActivate){console.warn(`[sfx-uploader] Custom source id "${c.id}" conflicts with a built-in source and was skipped.`);continue}a.add(c.id),l.push(c)}return this._cachedSources=l,this._cachedSources}get _phase(){const e=this._storeCtrl.state,t=[...e.files.values()];if(t.length===0)return"empty";if(e.isUploading)return"uploading";const i=new Set(["complete","rejected","cancelled","failed"]);return t.every(r=>i.has(r.status))&&t.some(r=>r.status==="complete"||r.status==="failed")?"complete":"ready"}_processIncomingFiles(e){var i,r,o,a;const t=(i=this.config)==null?void 0:i.callbacks;for(const l of e){const d=this._store.getState(),c=Ge(l,d.restrictions,d.files);if(c){const u=l.type.startsWith("image/")?URL.createObjectURL(l):null,f={id:B(),status:"rejected",file:l,remoteUrl:null,name:l.name,size:l.size,type:l.type,previewUrl:u,duration:null,progress:0,speed:0,bytesUploaded:0,error:c,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:null};M(this._store,f),this._dispatchPublic(g.FILE_REJECTED,{file:f,reason:c}),(r=t==null?void 0:t.onFileRejected)==null||r.call(t,f,c);const v=(o=this.config)==null?void 0:o.rejectedFileAutoRemoveDelay,w=v===!1||v===0||v===void 0?0:v;if(w>0){const m=f.id,b=setTimeout(()=>{this._rejectedTimers.delete(m);const y=this._store.getState().files.get(m);y&&y.status==="rejected"&&be(this._store,m)},w);this._rejectedTimers.set(m,b)}continue}let h=null;l.type.startsWith("image/")&&(h=URL.createObjectURL(l));const x={id:B(),status:"idle",file:l,remoteUrl:null,name:l.name,size:l.size,type:l.type,previewUrl:h,duration:null,progress:0,speed:0,bytesUploaded:0,error:null,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:null};if(M(this._store,x),this._dispatchPublic(g.FILE_ADDED,{file:x}),(a=t==null?void 0:t.onFileAdded)==null||a.call(t,x),l.type.startsWith("video/")){We(l).then(f=>{if(!f)return;const v=this._store.getState(),w=v.files.get(x.id);if(w){const m=new Map(v.files);m.set(x.id,{...w,previewUrl:f}),this._store.setState({files:m})}else URL.revokeObjectURL(f)});const u=document.createElement("video");u.preload="metadata",u.src=URL.createObjectURL(l),u.onerror=()=>{URL.revokeObjectURL(u.src)},u.onloadedmetadata=()=>{const f=u.duration;if(URL.revokeObjectURL(u.src),!isFinite(f))return;const v=this._store.getState(),w=v.files.get(x.id);if(w){const m=new Map(v.files);m.set(x.id,{...w,duration:f}),this._store.setState({files:m})}}}}this._store.getState().queueConfig.autoProceed&&this.upload()}_removeFile(e){var o,a,l,d;const t=this._store.getState().files.get(e);if(!t)return;const i={...t};if((this._fullscreenPreviewUrl&&this._fullscreenPreviewUrl===t.previewUrl||this._fullscreenVideoFile&&this._fullscreenVideoFile===t.file)&&(this._fullscreenPreviewUrl=null,this._fullscreenVideoFile=null),t.previewUrl&&URL.revokeObjectURL(t.previewUrl),t.file){const c=this._videoBlobUrls.get(t.file);c&&(URL.revokeObjectURL(c),this._videoBlobUrls.delete(t.file))}(t.status==="uploading"||t.status==="queued"||t.status==="retrying")&&((o=this._engine)==null||o.cancelFile(e)),be(this._store,e),this._dimCache.delete(e);const r=this._rejectedTimers.get(e);if(r&&(clearTimeout(r),this._rejectedTimers.delete(e)),this._previewFileId===e){const c=[...this._store.getState().files.values()];this._previewFileId=c.length>0?c[0].id:null}this._dispatchPublic(g.FILE_REMOVED,{file:i}),(d=(l=(a=this.config)==null?void 0:a.callbacks)==null?void 0:l.onFileRemoved)==null||d.call(l,i)}render(){var t;const e=((t=this.config)==null?void 0:t.mode)??"modal";return[...this._storeCtrl.state.files.values()],e==="modal"?s.html`
|
|
2885
|
+
${this._isOpen&&!this._isMinimized?s.html`
|
|
2886
|
+
<div class="modal-backdrop" @click=${this._onModalBackdropClick}>
|
|
2887
|
+
<div class="modal-card">
|
|
2888
|
+
${this._renderHeader()}
|
|
2889
|
+
${this._renderBody()}
|
|
2890
|
+
</div>
|
|
2891
|
+
</div>
|
|
2892
|
+
`:s.nothing}
|
|
2893
|
+
`:s.html`
|
|
2894
|
+
<div class="inline">
|
|
2895
|
+
${this._renderHeader()}
|
|
2896
|
+
${this._renderBody()}
|
|
2897
|
+
</div>
|
|
2898
|
+
`}_renderHeader(){var a,l;if(this._phase==="complete")return s.nothing;if(this._phase==="uploading"){const d=this._storeCtrl.state,c=[...d.files.values()],h=c.filter(u=>u.status==="complete").length,x=d.totalSpeed>0?(d.totalBytes-d.totalBytesUploaded)/d.totalSpeed:0;return s.html`
|
|
2899
|
+
<div class="header upload-header">
|
|
2900
|
+
<div class="float-header-left">
|
|
2901
|
+
<div class="float-icon">
|
|
2902
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><polyline points="16 16 12 12 8 16"/><line x1="12" y1="12" x2="12" y2="21"/><path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3"/></svg>
|
|
2903
|
+
</div>
|
|
2904
|
+
<div>
|
|
2905
|
+
<div class="float-title">Uploading ${c.length} ${c.length===1?"file":"files"}</div>
|
|
2906
|
+
<div class="float-subtitle">${h} of ${c.length}${x>0?` · ~${ie(x)} left`:""}</div>
|
|
2907
|
+
</div>
|
|
2908
|
+
</div>
|
|
2909
|
+
</div>
|
|
2910
|
+
`}const e=((a=this.config)==null?void 0:a.mode)??"modal",t=((l=this.config)==null?void 0:l.headerButton)??(e==="modal"?"close":"none"),i=e==="modal"?this._onModalDismiss:this._onInlineDismiss,r=t==="back"?s.html`<button class="header-btn header-btn-back" aria-label="Back to Asset Picker" @click=${i}>
|
|
2911
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2912
|
+
<polyline points="15 18 9 12 15 6"/>
|
|
2913
|
+
</svg>
|
|
2914
|
+
</button>`:s.nothing,o=t==="close"?s.html`<button class="header-btn header-btn-close" aria-label="Close" @click=${i}>
|
|
2915
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
2916
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
2917
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
2918
|
+
</svg>
|
|
2919
|
+
</button>`:s.nothing;return s.html`
|
|
2920
|
+
<div class="header">
|
|
2921
|
+
${r}
|
|
2922
|
+
${t!=="back"?s.html`
|
|
2923
|
+
<div class="header-icon">
|
|
2924
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
|
|
2925
|
+
<polyline points="16 16 12 12 8 16" />
|
|
2926
|
+
<line x1="12" y1="12" x2="12" y2="21" />
|
|
2927
|
+
<path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3" />
|
|
2928
|
+
</svg>
|
|
2929
|
+
</div>`:s.nothing}
|
|
2930
|
+
<div class="header-title">Upload Files</div>
|
|
2931
|
+
${o}
|
|
2932
|
+
</div>
|
|
2933
|
+
`}_getImageDimensions(e){return e.previewUrl?this._dimCache.has(e.id)?Promise.resolve(this._dimCache.get(e.id)):new Promise(t=>{const i=new Image;i.onload=()=>{const r={w:i.naturalWidth,h:i.naturalHeight};this._dimCache.set(e.id,r),t(r)},i.onerror=()=>{this._dimCache.set(e.id,null),t(null)},i.src=e.previewUrl}):Promise.resolve(null)}_renderUploadOverlay(e){var a;const t=this._storeCtrl.state,i=Math.round(t.totalProgress??0),r=e.filter(l=>l.status==="complete").length,o=t.totalSpeed>0?(t.totalBytes-t.totalBytesUploaded)/t.totalSpeed:0;return s.html`
|
|
2934
|
+
<div class="upload-overlay">
|
|
2935
|
+
<div class="upload-overlay-spinner"></div>
|
|
2936
|
+
<div class="upload-overlay-percent">${i}%</div>
|
|
2937
|
+
<div class="upload-overlay-title">Uploading ${e.length} ${e.length===1?"file":"files"}</div>
|
|
2938
|
+
<div class="upload-overlay-subtitle">${r} of ${e.length} complete${o>0?s.html` · ~${ie(o)} left`:s.nothing}</div>
|
|
2939
|
+
<div class="upload-overlay-bar">
|
|
2940
|
+
<div class="upload-overlay-bar-fill" style="width:${i}%"></div>
|
|
2941
|
+
</div>
|
|
2942
|
+
${(a=this.config)!=null&&a.minimizeOnUpload?s.html`<button class="upload-overlay-minimize" @click=${this._onMinimize}>Minimize & continue in background</button>`:s.nothing}
|
|
2943
|
+
</div>
|
|
2944
|
+
`}_renderFloatingPill(e){const t=this._storeCtrl.state,i=Math.round(t.totalProgress??0),r=this._phase==="complete",o=e.filter(d=>d.status==="complete").length,a=e.filter(d=>d.status==="failed").length,l=t.totalSpeed>0?(t.totalBytes-t.totalBytesUploaded)/t.totalSpeed:0;return this._isPillExpanded===!1?s.html`
|
|
2945
|
+
<div class="upload-float float-collapsed">
|
|
2946
|
+
<div class="float-collapsed-left">
|
|
2947
|
+
${r?a>0?s.html`<div class="float-collapsed-icon warn"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></div>`:s.html`<div class="float-collapsed-icon done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg></div>`:s.html`<div class="float-collapsed-spinner"></div>`}
|
|
2948
|
+
<span class="float-collapsed-text">${r?a>0?`${a} ${a===1?"file":"files"} not uploaded`:"Upload complete":`Uploading ${e.length} ${e.length===1?"file":"files"}`}</span>
|
|
2949
|
+
${r?s.nothing:s.html`<span class="float-collapsed-pct">${i}%</span>`}
|
|
2950
|
+
</div>
|
|
2951
|
+
<div class="float-collapsed-actions">
|
|
2952
|
+
<button title="Expand" @click=${this._onPillClick}>
|
|
2953
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="18 15 12 9 6 15"/></svg>
|
|
2954
|
+
</button>
|
|
2955
|
+
<button title="Dismiss" @click=${this._onPillDismiss}>
|
|
2956
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
|
2957
|
+
</button>
|
|
2958
|
+
</div>
|
|
2959
|
+
</div>
|
|
2960
|
+
`:s.html`
|
|
2961
|
+
<div class="upload-float">
|
|
2962
|
+
<div class="float-header">
|
|
2963
|
+
<div class="float-header-left">
|
|
2964
|
+
<div class="float-icon ${r?a>0?"warn":"done":""}">
|
|
2965
|
+
${r?a>0?s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>`:s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg>`:s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><polyline points="16 16 12 12 8 16"/><line x1="12" y1="12" x2="12" y2="21"/><path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3"/></svg>`}
|
|
2966
|
+
</div>
|
|
2967
|
+
<div>
|
|
2968
|
+
<div class="float-title">${r?a>0?`${a} ${a===1?"file":"files"} not uploaded`:"Upload complete":`Uploading ${e.length} ${e.length===1?"file":"files"}`}</div>
|
|
2969
|
+
<div class="float-subtitle">${r?`${o} ${o===1?"file":"files"} uploaded${a>0?`, ${a} failed`:""}`:`${o} of ${e.length}${l>0?` · ~${ie(l)} left`:""}`}</div>
|
|
2970
|
+
</div>
|
|
2971
|
+
</div>
|
|
2972
|
+
<div class="float-actions">
|
|
2973
|
+
<button title="Collapse" @click=${this._onPillClick}>
|
|
2974
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="6 9 12 15 18 9"/></svg>
|
|
2975
|
+
</button>
|
|
2976
|
+
<button title="Dismiss" @click=${this._onPillDismiss}>
|
|
2977
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
|
2978
|
+
</button>
|
|
2979
|
+
</div>
|
|
2980
|
+
</div>
|
|
2981
|
+
<div class="float-progress">
|
|
2982
|
+
<div class="float-progress-top">
|
|
2983
|
+
<span class="float-progress-label">Overall progress</span>
|
|
2984
|
+
<span class="float-progress-pct ${r?a>0?"warn":"done":""}">${r?"Done":`${i}%`}</span>
|
|
2985
|
+
</div>
|
|
2986
|
+
<div class="float-bar"><div class="float-bar-fill ${r?a>0?"warn":"done":""}" style="width:${r?100:i}%"></div></div>
|
|
2987
|
+
</div>
|
|
2988
|
+
<div class="float-items">
|
|
2989
|
+
${e.map(d=>s.html`
|
|
2990
|
+
<div class="float-item">
|
|
2991
|
+
<div class="float-item-thumb">
|
|
2992
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>
|
|
2993
|
+
</div>
|
|
2994
|
+
<div class="float-item-info">
|
|
2995
|
+
<div class="float-item-name">${d.name}</div>
|
|
2996
|
+
<div class="float-item-size">${R(d.size)}</div>
|
|
2997
|
+
</div>
|
|
2998
|
+
<div class="float-item-status">
|
|
2999
|
+
${d.status==="complete"?s.html`<div class="float-item-done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg></div>`:d.status==="failed"||d.status==="error"?s.html`<svg class="float-item-error" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>${d.error||"Upload failed"}</title><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>`:s.html`<div class="float-item-spinner"></div>`}
|
|
3000
|
+
</div>
|
|
3001
|
+
</div>
|
|
3002
|
+
`)}
|
|
3003
|
+
</div>
|
|
3004
|
+
</div>
|
|
3005
|
+
`}_renderPreviewLayout(e){var l;if(e.length===0)return s.nothing;const t=e.find(d=>d.id===this._previewFileId)??e[0],i=((l=t.name.split(".").pop())==null?void 0:l.toUpperCase())||"",r=new Date(t.addedAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),o=this._store.getState().targetFolder,a=e.reduce((d,c)=>d+(c.size||0),0);return s.html`
|
|
3006
|
+
<div class="preview-topbar"></div>
|
|
3007
|
+
<div class="preview-layout">
|
|
3008
|
+
<div class="file-grid-side">
|
|
3009
|
+
<div class="file-grid-header">
|
|
3010
|
+
<span class="file-grid-header-text">${e.length} ${e.length===1?"asset":"assets"} · ${R(a)}</span>
|
|
3011
|
+
</div>
|
|
3012
|
+
<sfx-file-list
|
|
3013
|
+
.files=${e}
|
|
3014
|
+
.showDropTile=${!0}
|
|
3015
|
+
.sources=${this._mergedSources}
|
|
3016
|
+
.accept=${ye(this._storeCtrl.state.restrictions)}
|
|
3017
|
+
@source-click=${this._onDropTileSourceClick}
|
|
3018
|
+
></sfx-file-list>
|
|
3019
|
+
</div>
|
|
3020
|
+
<div class="preview-divider"></div>
|
|
3021
|
+
<div class="preview-panel">
|
|
3022
|
+
<div class="preview-panel-header">
|
|
3023
|
+
<span class="preview-panel-filename" title=${t.name}>${t.name}</span>
|
|
3024
|
+
<div class="preview-header-actions">
|
|
3025
|
+
${t.previewUrl||t.type.startsWith("video/")&&t.file?s.html`
|
|
3026
|
+
<button @click=${()=>{this._fullscreenPreviewUrl=t.previewUrl,this._fullscreenVideoFile=t.type.startsWith("video/")&&t.file?t.file:null,this._fullscreenZoomed=!1}} title="Fullscreen">
|
|
3027
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
3028
|
+
<polyline points="15 3 21 3 21 9" />
|
|
3029
|
+
<polyline points="9 21 3 21 3 15" />
|
|
3030
|
+
<line x1="21" y1="3" x2="14" y2="10" />
|
|
3031
|
+
<line x1="3" y1="21" x2="10" y2="14" />
|
|
3032
|
+
</svg>
|
|
3033
|
+
</button>
|
|
3034
|
+
`:s.nothing}
|
|
3035
|
+
<button @click=${()=>{this._previewFileId=null}} title="Close">
|
|
3036
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
|
|
3037
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
3038
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
3039
|
+
</svg>
|
|
3040
|
+
</button>
|
|
3041
|
+
</div>
|
|
3042
|
+
</div>
|
|
3043
|
+
${t.type.startsWith("video/")&&t.file?s.html`
|
|
3044
|
+
<div class="preview-img-wrap">
|
|
3045
|
+
<video class="preview-image" src=${this._getVideoBlobUrl(t.file)} controls playsinline></video>
|
|
3046
|
+
<button class="preview-nav prev" ?disabled=${e.indexOf(t)===0} @click=${()=>this._navigatePreview(e,-1)}>
|
|
3047
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="15 18 9 12 15 6"/></svg>
|
|
3048
|
+
</button>
|
|
3049
|
+
<button class="preview-nav next" ?disabled=${e.indexOf(t)===e.length-1} @click=${()=>this._navigatePreview(e,1)}>
|
|
3050
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="9 6 15 12 9 18"/></svg>
|
|
3051
|
+
</button>
|
|
3052
|
+
</div>
|
|
3053
|
+
`:t.previewUrl?s.html`
|
|
3054
|
+
<div class="preview-img-wrap">
|
|
3055
|
+
<img class="preview-image" src=${t.previewUrl} alt=${t.name} />
|
|
3056
|
+
<button class="preview-nav prev" ?disabled=${e.indexOf(t)===0} @click=${()=>this._navigatePreview(e,-1)}>
|
|
3057
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="15 18 9 12 15 6"/></svg>
|
|
3058
|
+
</button>
|
|
3059
|
+
<button class="preview-nav next" ?disabled=${e.indexOf(t)===e.length-1} @click=${()=>this._navigatePreview(e,1)}>
|
|
3060
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="9 6 15 12 9 18"/></svg>
|
|
3061
|
+
</button>
|
|
3062
|
+
</div>
|
|
3063
|
+
`:s.html`
|
|
3064
|
+
<div class="preview-doc-wrap ${q(t)}">
|
|
3065
|
+
<div class="preview-doc-icon ${q(t)}">
|
|
3066
|
+
${this._renderDocTypeIcon(q(t))}
|
|
3067
|
+
<span class="preview-doc-ext ${q(t)}">${i}</span>
|
|
3068
|
+
</div>
|
|
3069
|
+
<button class="preview-nav prev" ?disabled=${e.indexOf(t)===0} @click=${()=>this._navigatePreview(e,-1)}>
|
|
3070
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="15 18 9 12 15 6"/></svg>
|
|
3071
|
+
</button>
|
|
3072
|
+
<button class="preview-nav next" ?disabled=${e.indexOf(t)===e.length-1} @click=${()=>this._navigatePreview(e,1)}>
|
|
3073
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="9 6 15 12 9 18"/></svg>
|
|
3074
|
+
</button>
|
|
3075
|
+
</div>
|
|
3076
|
+
`}
|
|
3077
|
+
<div class="preview-meta-list">
|
|
3078
|
+
<div class="preview-meta-row">
|
|
3079
|
+
<span class="preview-meta-label">Type</span>
|
|
3080
|
+
<span class="preview-meta-value">${i}</span>
|
|
3081
|
+
</div>
|
|
3082
|
+
<div class="preview-meta-row">
|
|
3083
|
+
<span class="preview-meta-label">Size</span>
|
|
3084
|
+
<span class="preview-meta-value">${R(t.size)}</span>
|
|
3085
|
+
</div>
|
|
3086
|
+
<div class="preview-meta-row">
|
|
3087
|
+
<span class="preview-meta-label">Dimensions</span>
|
|
3088
|
+
<span class="preview-meta-value">${this._previewDims}</span>
|
|
3089
|
+
</div>
|
|
3090
|
+
<div class="preview-meta-row">
|
|
3091
|
+
<span class="preview-meta-label">Name</span>
|
|
3092
|
+
<span class="preview-meta-value truncate" title=${t.name}>${t.name}</span>
|
|
3093
|
+
</div>
|
|
3094
|
+
${o?s.html`
|
|
3095
|
+
<div class="preview-meta-row">
|
|
3096
|
+
<span class="preview-meta-label">Folder</span>
|
|
3097
|
+
<span class="preview-meta-value">${o}</span>
|
|
3098
|
+
</div>`:s.html`
|
|
3099
|
+
<div class="preview-meta-row">
|
|
3100
|
+
<span class="preview-meta-label">Added</span>
|
|
3101
|
+
<span class="preview-meta-value">${r}</span>
|
|
3102
|
+
</div>`}
|
|
3103
|
+
</div>
|
|
3104
|
+
</div>
|
|
3105
|
+
</div>
|
|
3106
|
+
`}_renderDocTypeIcon(e){switch(e){case"pdf":return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>`;case"doc":return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>`;case"vid":return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2"/></svg>`;case"zip":return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M21 8v13H3V8"/><path d="M1 3h22v5H1z"/><path d="M10 12h4"/></svg>`;default:return s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z"/><polyline points="13 2 13 9 20 9"/></svg>`}}_navigatePreview(e,t){var o;const r=e.findIndex(a=>a.id===this._previewFileId)+t;if(r>=0&&r<e.length){const a=(o=this.shadowRoot)==null?void 0:o.querySelector(".preview-image[controls]");a&&(a.pause(),a.removeAttribute("src"),a.load()),this._previewFileId=e[r].id}}_renderBody(){var a,l,d;const e=this._storeCtrl.state,t=[...e.files.values()],i=this._phase,r=ye(e.restrictions),o=t.length>0;return s.html`
|
|
3107
|
+
<div class="content"
|
|
3108
|
+
@files-selected=${this._onFilesSelected}
|
|
3109
|
+
@source-click=${this._onSourceClick}
|
|
3110
|
+
@file-remove=${this._onFileRemove}
|
|
3111
|
+
@file-preview=${this._onFilePreview}
|
|
3112
|
+
@file-retry=${this._onFileRetry}
|
|
3113
|
+
@fill-metadata=${this._onFillMetadata}
|
|
3114
|
+
@retry-all=${this._onRetryAll}
|
|
3115
|
+
@clear-all=${this._onClearAll}
|
|
3116
|
+
@add-more=${this._onAddMore}
|
|
3117
|
+
@upload-start=${this._onUploadStart}
|
|
3118
|
+
@upload-more=${this._onUploadMore}
|
|
3119
|
+
@primary-action=${this._onPrimaryAction}
|
|
3120
|
+
@connector-files-selected=${this._onConnectorFilesSelected}
|
|
3121
|
+
@connector-close=${this._onConnectorClose}
|
|
3122
|
+
@url-submit=${this._onUrlSubmit}
|
|
3123
|
+
@url-cancel=${this._onUrlCancel}
|
|
3124
|
+
@camera-capture=${this._onCameraCapture}
|
|
3125
|
+
@camera-cancel=${this._onCameraCancel}
|
|
3126
|
+
@screencast-capture=${this._onScreenCastCapture}
|
|
3127
|
+
@screencast-cancel=${this._onScreenCastCancel}
|
|
3128
|
+
>
|
|
3129
|
+
<div
|
|
3130
|
+
class="body ${o?"has-files":""} ${this._bodyDragOver?"body-drag-over":""}"
|
|
3131
|
+
@dragenter=${o?this._onBodyDragEnter:s.nothing}
|
|
3132
|
+
@dragover=${o?this._onBodyDragOver:s.nothing}
|
|
3133
|
+
@dragleave=${o?this._onBodyDragLeave:s.nothing}
|
|
3134
|
+
@drop=${o?this._onBodyDrop:s.nothing}
|
|
3135
|
+
>
|
|
3136
|
+
${i==="complete"?s.html`
|
|
3137
|
+
<sfx-success-card
|
|
3138
|
+
.fileCount=${t.filter(c=>c.status==="complete").length}
|
|
3139
|
+
.totalSize=${t.filter(c=>c.status==="complete").reduce((c,h)=>c+(h.size||0),0)}
|
|
3140
|
+
.thumbnails=${t.filter(c=>c.status==="complete"&&c.previewUrl).map(c=>c.previewUrl)}
|
|
3141
|
+
.failedFiles=${t.filter(c=>c.status==="failed").map(c=>({name:c.name,error:c.error||"Upload failed"}))}
|
|
3142
|
+
></sfx-success-card>
|
|
3143
|
+
`:i==="uploading"?this._renderUploadOverlay(t):s.html`
|
|
3144
|
+
${o?s.nothing:s.html`<sfx-drop-zone
|
|
3145
|
+
.compact=${o}
|
|
3146
|
+
.externalDragOver=${this._bodyDragOver}
|
|
3147
|
+
.accept=${r}
|
|
3148
|
+
.sources=${this._mergedSources}
|
|
3149
|
+
.sourcesLayout=${((a=this.config)==null?void 0:a.sourcesLayout)??"pills"}
|
|
3150
|
+
></sfx-drop-zone>`}
|
|
3151
|
+
|
|
3152
|
+
${o?this._previewFileId?this._renderPreviewLayout(t):s.html`
|
|
3153
|
+
<div class="asset-count">${t.length} ${t.length===1?"file":"files"} · ${R(t.reduce((c,h)=>c+(h.size||0),0))}</div>
|
|
3154
|
+
<sfx-file-list
|
|
3155
|
+
.files=${t}
|
|
3156
|
+
.showDropTile=${!0}
|
|
3157
|
+
.sources=${this._mergedSources}
|
|
3158
|
+
.accept=${r}
|
|
3159
|
+
@source-click=${this._onDropTileSourceClick}
|
|
3160
|
+
></sfx-file-list>
|
|
3161
|
+
`:s.nothing}
|
|
3162
|
+
`}
|
|
3163
|
+
</div>
|
|
3164
|
+
|
|
3165
|
+
${o&&i!=="complete"&&i!=="uploading"?s.html`
|
|
3166
|
+
<sfx-actions-bar
|
|
3167
|
+
.uploadState=${"idle"}
|
|
3168
|
+
.fileCount=${t.length}
|
|
3169
|
+
.totalSize=${t.reduce((c,h)=>c+(h.size||0),0)}
|
|
3170
|
+
.failedCount=${t.filter(c=>c.status==="failed"||c.status==="error").length}
|
|
3171
|
+
.completedCount=${t.filter(c=>c.status==="complete").length}
|
|
3172
|
+
.uploadProgress=${e.totalProgress??0}
|
|
3173
|
+
.showFillMetadata=${!!((l=this.config)!=null&&l.showFillMetadata)}
|
|
3174
|
+
></sfx-actions-bar>
|
|
3175
|
+
`:s.nothing}
|
|
3176
|
+
|
|
3177
|
+
${this._showUrlDialog?s.html`<sfx-url-dialog></sfx-url-dialog>`:s.nothing}
|
|
3178
|
+
${this._showCameraDialog?s.html`<sfx-camera-dialog></sfx-camera-dialog>`:s.nothing}
|
|
3179
|
+
${this._showScreenCastDialog?s.html`<sfx-screen-cast-dialog></sfx-screen-cast-dialog>`:s.nothing}
|
|
3180
|
+
${this._activeConnector&&((d=this.config)!=null&&d.connectors)?s.html`
|
|
3181
|
+
<div class="connector-modal-backdrop" @click=${this._onConnectorBackdropClick}>
|
|
3182
|
+
<div class="connector-modal">
|
|
3183
|
+
${$e.has(this._activeConnector)?s.html`
|
|
3184
|
+
<sfx-search-provider-browser
|
|
3185
|
+
.provider=${this._activeConnector}
|
|
3186
|
+
.companionUrl=${this.config.connectors.companionUrl}
|
|
3187
|
+
></sfx-search-provider-browser>
|
|
3188
|
+
`:s.html`
|
|
3189
|
+
<sfx-provider-browser
|
|
3190
|
+
.provider=${this._activeConnector}
|
|
3191
|
+
.companionUrl=${this.config.connectors.companionUrl}
|
|
3192
|
+
></sfx-provider-browser>
|
|
3193
|
+
`}
|
|
3194
|
+
</div>
|
|
3195
|
+
</div>
|
|
3196
|
+
`:s.nothing}
|
|
3197
|
+
|
|
3198
|
+
${this._fullscreenPreviewUrl||this._fullscreenVideoFile?s.html`
|
|
3199
|
+
<div
|
|
3200
|
+
class="fs-overlay ${this._fullscreenZoomed?"zoomed":""} ${this._fsDragging?"panning":""}"
|
|
3201
|
+
@click=${this._onFsOverlayClick}
|
|
3202
|
+
@mousedown=${this._onFsPanStart}
|
|
3203
|
+
@mousemove=${this._onFsPanMove}
|
|
3204
|
+
@mouseup=${this._onFsPanEnd}
|
|
3205
|
+
@mouseleave=${this._onFsPanEnd}
|
|
3206
|
+
@touchstart=${this._onFsTouchStart}
|
|
3207
|
+
@touchmove=${this._onFsTouchMove}
|
|
3208
|
+
@touchend=${this._onFsPanEnd}
|
|
3209
|
+
>
|
|
3210
|
+
<div class="fs-toolbar" @click=${c=>c.stopPropagation()}>
|
|
3211
|
+
<button class="fs-btn" @click=${this._onFsToggleZoom} title="${this._fullscreenZoomed?"Zoom out":"Zoom in"}">
|
|
3212
|
+
${this._fullscreenZoomed?s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></svg>`:s.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>`}
|
|
3213
|
+
</button>
|
|
3214
|
+
<button class="fs-btn" @click=${this._onFsClose} title="Close">
|
|
3215
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
3216
|
+
<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
|
|
3217
|
+
</svg>
|
|
3218
|
+
</button>
|
|
3219
|
+
</div>
|
|
3220
|
+
${this._fullscreenVideoFile?s.html`<video
|
|
3221
|
+
class="fs-img"
|
|
3222
|
+
src=${this._getVideoBlobUrl(this._fullscreenVideoFile)}
|
|
3223
|
+
controls playsinline
|
|
3224
|
+
draggable="false"
|
|
3225
|
+
@click=${c=>c.stopPropagation()}
|
|
3226
|
+
></video>`:s.html`<img
|
|
3227
|
+
class="fs-img"
|
|
3228
|
+
src=${this._fullscreenPreviewUrl}
|
|
3229
|
+
alt=""
|
|
3230
|
+
style=${this._fullscreenZoomed?`transform: scale(2) translate(${this._fsPanX}px, ${this._fsPanY}px)`:""}
|
|
3231
|
+
draggable="false"
|
|
3232
|
+
/>`}
|
|
3233
|
+
<button class="fs-nav prev" @click=${c=>{c.stopPropagation(),this._navigateFs(-1)}}>
|
|
3234
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="15 18 9 12 15 6"/></svg>
|
|
3235
|
+
</button>
|
|
3236
|
+
<button class="fs-nav next" @click=${c=>{c.stopPropagation(),this._navigateFs(1)}}>
|
|
3237
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="9 6 15 12 9 18"/></svg>
|
|
3238
|
+
</button>
|
|
3239
|
+
</div>
|
|
3240
|
+
`:s.nothing}
|
|
3241
|
+
</div>
|
|
3242
|
+
`}_navigateFs(e){const t=[...this._store.getState().files.values()].filter(o=>o.previewUrl||o.type.startsWith("video/")&&o.file),i=t.findIndex(o=>o.id===this._previewFileId);if(i===-1)return;const r=i+e;if(r>=0&&r<t.length){const o=t[r];this._fullscreenPreviewUrl=o.previewUrl,this._fullscreenVideoFile=o.type.startsWith("video/")&&o.file?o.file:null,this._previewFileId=o.id,this._fullscreenZoomed=!1,this._fsPanX=0,this._fsPanY=0}}_getVideoBlobUrl(e){let t=this._videoBlobUrls.get(e);return t||(t=URL.createObjectURL(e),this._videoBlobUrls.set(e,t)),t}_revokeVideoBlobUrls(){for(const e of this._videoBlobUrls.values())URL.revokeObjectURL(e);this._videoBlobUrls.clear()}},$.styles=s.css`
|
|
3243
|
+
:host {
|
|
3244
|
+
display: block;
|
|
3245
|
+
font-family: var(--sfx-up-font, 'Inter', system-ui, -apple-system, sans-serif);
|
|
3246
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3247
|
+
/* Bridge to Scaleflex design system with standalone fallbacks */
|
|
3248
|
+
--sfx-up-primary: var(--primary, #2563eb);
|
|
3249
|
+
--sfx-up-primary-hover: var(--primary-hover, #1d4ed8);
|
|
3250
|
+
--sfx-up-primary-mid: var(--primary-mid, #3b82f6);
|
|
3251
|
+
--sfx-up-primary-bg: var(--accent, #eff6ff);
|
|
3252
|
+
--sfx-up-primary-glow: rgba(37, 99, 235, 0.18);
|
|
3253
|
+
--sfx-up-success: var(--success, #16a34a);
|
|
3254
|
+
--sfx-up-error: var(--destructive, #dc2626);
|
|
3255
|
+
--sfx-up-text: var(--foreground, #1e293b);
|
|
3256
|
+
--sfx-up-text-secondary: var(--secondary-foreground, #475569);
|
|
3257
|
+
--sfx-up-text-muted: var(--muted-foreground, #94a3b8);
|
|
3258
|
+
--sfx-up-border: var(--border, #e8edf5);
|
|
3259
|
+
--sfx-up-border-light: var(--muted, #f1f5f9);
|
|
3260
|
+
--sfx-up-bg: var(--background, #ffffff);
|
|
3261
|
+
--sfx-up-radius: 16px;
|
|
3262
|
+
--sfx-up-font: 'Inter', system-ui, -apple-system, sans-serif;
|
|
3263
|
+
--sfx-up-shadow: var(--shadow, rgba(0, 0, 0, 0.1));
|
|
3264
|
+
--sfx-up-surface: var(--card, #f8fafc);
|
|
3265
|
+
--sfx-up-backdrop: rgba(0, 0, 0, 0.45);
|
|
3266
|
+
--sfx-up-ring: var(--ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
3267
|
+
--sfx-up-max-height: 88vh;
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
/* --- Modal overlay --- */
|
|
3271
|
+
.modal-backdrop {
|
|
3272
|
+
position: fixed;
|
|
3273
|
+
inset: 0;
|
|
3274
|
+
background: var(--sfx-up-backdrop);
|
|
3275
|
+
backdrop-filter: blur(6px);
|
|
3276
|
+
display: flex;
|
|
3277
|
+
align-items: center;
|
|
3278
|
+
justify-content: center;
|
|
3279
|
+
z-index: 9999;
|
|
3280
|
+
padding: 24px;
|
|
3281
|
+
animation: fadeIn 0.2s ease;
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
.modal-card {
|
|
3285
|
+
background: var(--sfx-up-bg, #fff);
|
|
3286
|
+
border-radius: 16px;
|
|
3287
|
+
box-shadow: 0 28px 80px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
3288
|
+
width: 100%;
|
|
3289
|
+
max-width: 912px;
|
|
3290
|
+
min-height: var(--sfx-up-min-height, 660px);
|
|
3291
|
+
max-height: var(--sfx-up-max-height, 88vh);
|
|
3292
|
+
display: flex;
|
|
3293
|
+
flex-direction: column;
|
|
3294
|
+
overflow: hidden;
|
|
3295
|
+
position: relative;
|
|
3296
|
+
animation: modalIn 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
|
|
3297
|
+
}
|
|
3298
|
+
|
|
3299
|
+
/* --- Header --- */
|
|
3300
|
+
.header {
|
|
3301
|
+
display: flex;
|
|
3302
|
+
align-items: center;
|
|
3303
|
+
padding: 16px 24px;
|
|
3304
|
+
background: var(--sfx-up-bg, #fff);
|
|
3305
|
+
border-bottom: 1px solid var(--sfx-up-border, #e2e8f0);
|
|
3306
|
+
flex-shrink: 0;
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
.header-icon {
|
|
3310
|
+
width: 32px;
|
|
3311
|
+
height: 32px;
|
|
3312
|
+
border-radius: 8px;
|
|
3313
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
3314
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
3315
|
+
display: flex;
|
|
3316
|
+
align-items: center;
|
|
3317
|
+
justify-content: center;
|
|
3318
|
+
margin-right: 12px;
|
|
3319
|
+
flex-shrink: 0;
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
.header-icon-done {
|
|
3323
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
3324
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
.header-icon svg {
|
|
3328
|
+
width: 16px;
|
|
3329
|
+
height: 16px;
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
.header-title {
|
|
3333
|
+
font-size: 16px;
|
|
3334
|
+
font-weight: 700;
|
|
3335
|
+
color: var(--sfx-up-text, #111827);
|
|
3336
|
+
flex: 1;
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
|
+
.header-btn {
|
|
3340
|
+
width: 30px;
|
|
3341
|
+
height: 30px;
|
|
3342
|
+
border-radius: 8px;
|
|
3343
|
+
border: none;
|
|
3344
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
3345
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
3346
|
+
cursor: pointer;
|
|
3347
|
+
display: flex;
|
|
3348
|
+
align-items: center;
|
|
3349
|
+
justify-content: center;
|
|
3350
|
+
transition: background 0.15s, color 0.15s;
|
|
3351
|
+
flex-shrink: 0;
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
.header-btn svg {
|
|
3355
|
+
width: 16px;
|
|
3356
|
+
height: 16px;
|
|
3357
|
+
}
|
|
3358
|
+
|
|
3359
|
+
.header-btn:hover {
|
|
3360
|
+
background: var(--sfx-up-border, #e2e8f0);
|
|
3361
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3362
|
+
}
|
|
3363
|
+
|
|
3364
|
+
.header-btn:focus-visible {
|
|
3365
|
+
outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
3366
|
+
outline-offset: 2px;
|
|
3367
|
+
}
|
|
3368
|
+
|
|
3369
|
+
.header-btn-back {
|
|
3370
|
+
margin-right: 12px;
|
|
3371
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
3372
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
3373
|
+
width: 32px;
|
|
3374
|
+
height: 32px;
|
|
3375
|
+
position: relative;
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
.header-btn-back:hover {
|
|
3379
|
+
background: #dbeafe;
|
|
3380
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
3381
|
+
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
.header-btn-back::after {
|
|
3385
|
+
content: 'Back to Asset Picker';
|
|
3386
|
+
position: absolute;
|
|
3387
|
+
left: calc(100% + 8px);
|
|
3388
|
+
top: 50%;
|
|
3389
|
+
transform: translateY(-50%);
|
|
3390
|
+
background: #fff;
|
|
3391
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3392
|
+
font-size: 12px;
|
|
3393
|
+
font-weight: 500;
|
|
3394
|
+
white-space: nowrap;
|
|
3395
|
+
padding: 6px 12px;
|
|
3396
|
+
border-radius: 8px;
|
|
3397
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
|
|
3398
|
+
opacity: 0;
|
|
3399
|
+
pointer-events: none;
|
|
3400
|
+
transition: opacity 0.15s ease;
|
|
3401
|
+
z-index: 10;
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
.header-btn-back:hover::after {
|
|
3405
|
+
opacity: 1;
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3408
|
+
.header-btn-close {
|
|
3409
|
+
margin-left: auto;
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3412
|
+
/* --- Responsive header buttons --- */
|
|
3413
|
+
@media (max-width: 768px) {
|
|
3414
|
+
.header-btn { width: 28px; height: 28px; }
|
|
3415
|
+
.header-btn svg { width: 14px; height: 14px; }
|
|
3416
|
+
}
|
|
3417
|
+
@media (max-width: 480px) {
|
|
3418
|
+
.header-btn { width: 26px; height: 26px; }
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
/* --- Content wrapper (holds body + actions bar) --- */
|
|
3422
|
+
.content {
|
|
3423
|
+
flex: 1;
|
|
3424
|
+
display: flex;
|
|
3425
|
+
flex-direction: column;
|
|
3426
|
+
min-height: 0;
|
|
3427
|
+
}
|
|
3428
|
+
|
|
3429
|
+
/* --- Body --- */
|
|
3430
|
+
.body {
|
|
3431
|
+
flex: 1;
|
|
3432
|
+
overflow: hidden;
|
|
3433
|
+
padding: 24px;
|
|
3434
|
+
display: flex;
|
|
3435
|
+
flex-direction: column;
|
|
3436
|
+
align-items: stretch;
|
|
3437
|
+
justify-content: stretch;
|
|
3438
|
+
gap: 4px;
|
|
3439
|
+
min-height: 0;
|
|
3440
|
+
background: var(--sfx-up-bg, #fff);
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
.body.body-drag-over {
|
|
3444
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
3445
|
+
border-radius: 8px;
|
|
3446
|
+
position: relative;
|
|
3447
|
+
}
|
|
3448
|
+
|
|
3449
|
+
.body.body-drag-over::after {
|
|
3450
|
+
content: '';
|
|
3451
|
+
position: absolute;
|
|
3452
|
+
inset: 4px;
|
|
3453
|
+
border: 2px dashed var(--sfx-up-primary, #2563eb);
|
|
3454
|
+
border-radius: 8px;
|
|
3455
|
+
z-index: 100;
|
|
3456
|
+
pointer-events: none;
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
.body.has-files {
|
|
3460
|
+
justify-content: flex-start;
|
|
3461
|
+
align-items: stretch;
|
|
3462
|
+
overflow: hidden;
|
|
3463
|
+
gap: 0;
|
|
3464
|
+
padding: 0 0 0 8px;
|
|
3465
|
+
animation: bodyReveal 0.35s ease both;
|
|
3466
|
+
}
|
|
3467
|
+
|
|
3468
|
+
.body.has-files:has(.preview-layout) {
|
|
3469
|
+
padding-right: 0;
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
@keyframes bodyReveal {
|
|
3473
|
+
from { opacity: 0.5; }
|
|
3474
|
+
to { opacity: 1; }
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3477
|
+
.body.has-files::-webkit-scrollbar-thumb:hover {
|
|
3478
|
+
background: rgba(0, 0, 0, 0.25);
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
.body sfx-drop-zone {
|
|
3482
|
+
position: relative;
|
|
3483
|
+
z-index: 1;
|
|
3484
|
+
overflow: visible;
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3487
|
+
.asset-count {
|
|
3488
|
+
font-size: 14px;
|
|
3489
|
+
font-weight: 400;
|
|
3490
|
+
color: var(--sfx-up-text-secondary, #64748b);
|
|
3491
|
+
padding: 16px;
|
|
3492
|
+
min-height: 61px;
|
|
3493
|
+
box-sizing: border-box;
|
|
3494
|
+
display: flex;
|
|
3495
|
+
align-items: center;
|
|
3496
|
+
flex-shrink: 0;
|
|
3497
|
+
}
|
|
3498
|
+
|
|
3499
|
+
/* --- Inline mode --- */
|
|
3500
|
+
.inline {
|
|
3501
|
+
border: 1px solid var(--sfx-up-border, #e2e8f0);
|
|
3502
|
+
border-radius: var(--sfx-up-radius, 16px);
|
|
3503
|
+
background: var(--sfx-up-bg, #fff);
|
|
3504
|
+
display: flex;
|
|
3505
|
+
flex-direction: column;
|
|
3506
|
+
overflow: hidden;
|
|
3507
|
+
height: 100%;
|
|
3508
|
+
min-height: var(--sfx-up-min-height, 660px);
|
|
3509
|
+
max-height: var(--sfx-up-max-height, 88vh);
|
|
3510
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
|
|
3511
|
+
transition: box-shadow 0.25s ease;
|
|
3512
|
+
animation: inlineIn 0.25s ease;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
.inline:hover {
|
|
3516
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
3517
|
+
}
|
|
3518
|
+
|
|
3519
|
+
/* --- Preview split layout --- */
|
|
3520
|
+
.preview-layout {
|
|
3521
|
+
display: flex;
|
|
3522
|
+
flex: 1;
|
|
3523
|
+
min-height: 0;
|
|
3524
|
+
overflow: hidden;
|
|
3525
|
+
}
|
|
3526
|
+
|
|
3527
|
+
.preview-layout .file-grid-side {
|
|
3528
|
+
flex: 54;
|
|
3529
|
+
min-width: 0;
|
|
3530
|
+
min-height: 100%;
|
|
3531
|
+
overflow: hidden;
|
|
3532
|
+
display: flex;
|
|
3533
|
+
flex-direction: column;
|
|
3534
|
+
position: relative;
|
|
3535
|
+
--sfx-up-grid-min: max(48%, 140px);
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3538
|
+
.preview-layout .file-grid-side::after {
|
|
3539
|
+
content: '';
|
|
3540
|
+
position: absolute;
|
|
3541
|
+
top: 0;
|
|
3542
|
+
bottom: 0;
|
|
3543
|
+
right: 14px;
|
|
3544
|
+
width: 1px;
|
|
3545
|
+
background: var(--sfx-up-border, #e8edf5);
|
|
3546
|
+
pointer-events: none;
|
|
3547
|
+
z-index: 3;
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3550
|
+
.preview-layout sfx-file-list {
|
|
3551
|
+
padding-right: 16px;
|
|
3552
|
+
--sfx-scrollbar-w: 14px;
|
|
3553
|
+
--sfx-scrollbar-inset-left: 2px;
|
|
3554
|
+
--sfx-scrollbar-inset-right: 6px;
|
|
3555
|
+
}
|
|
3556
|
+
|
|
3557
|
+
/* NOTE: scrollbar border-radius is hardcoded to 6px in sfx-file-list */
|
|
3558
|
+
|
|
3559
|
+
.file-grid-header {
|
|
3560
|
+
display: flex;
|
|
3561
|
+
align-items: center;
|
|
3562
|
+
justify-content: space-between;
|
|
3563
|
+
gap: 8px;
|
|
3564
|
+
padding: 16px;
|
|
3565
|
+
min-height: 61px;
|
|
3566
|
+
box-sizing: border-box;
|
|
3567
|
+
flex-shrink: 0;
|
|
3568
|
+
position: sticky;
|
|
3569
|
+
top: 0;
|
|
3570
|
+
z-index: 2;
|
|
3571
|
+
background: var(--sfx-up-bg, #fff);
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
.file-grid-header-text {
|
|
3575
|
+
font-size: 14px;
|
|
3576
|
+
font-weight: 400;
|
|
3577
|
+
color: var(--sfx-up-text-secondary, #64748b);
|
|
3578
|
+
}
|
|
3579
|
+
|
|
3580
|
+
.preview-topbar {
|
|
3581
|
+
display: flex;
|
|
3582
|
+
align-items: center;
|
|
3583
|
+
justify-content: space-between;
|
|
3584
|
+
flex-shrink: 0;
|
|
3585
|
+
padding: 0;
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
.preview-divider {
|
|
3589
|
+
width: 1px;
|
|
3590
|
+
background: var(--sfx-up-border, #e8edf5);
|
|
3591
|
+
flex-shrink: 0;
|
|
3592
|
+
position: relative;
|
|
3593
|
+
display: flex;
|
|
3594
|
+
align-items: center;
|
|
3595
|
+
justify-content: center;
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
.preview-divider::after {
|
|
3599
|
+
display: none;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
.preview-panel {
|
|
3603
|
+
flex: 46;
|
|
3604
|
+
min-width: 0;
|
|
3605
|
+
display: flex;
|
|
3606
|
+
flex-direction: column;
|
|
3607
|
+
overflow: hidden;
|
|
3608
|
+
padding: 0;
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3611
|
+
.preview-panel::-webkit-scrollbar { width: 5px; }
|
|
3612
|
+
.preview-panel::-webkit-scrollbar-track { background: transparent; }
|
|
3613
|
+
.preview-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
|
|
3614
|
+
|
|
3615
|
+
.preview-panel-header {
|
|
3616
|
+
display: flex;
|
|
3617
|
+
align-items: center;
|
|
3618
|
+
justify-content: space-between;
|
|
3619
|
+
gap: 8px;
|
|
3620
|
+
padding: 16px 24px 16px 16px;
|
|
3621
|
+
flex-shrink: 0;
|
|
3622
|
+
border-bottom: 1px solid var(--sfx-up-border, #e8edf5);
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3625
|
+
.preview-header-actions {
|
|
3626
|
+
display: flex;
|
|
3627
|
+
align-items: center;
|
|
3628
|
+
gap: 4px;
|
|
3629
|
+
flex-shrink: 0;
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
.preview-panel-filename {
|
|
3633
|
+
font-size: 16px;
|
|
3634
|
+
font-weight: 400;
|
|
3635
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3636
|
+
white-space: nowrap;
|
|
3637
|
+
overflow: hidden;
|
|
3638
|
+
text-overflow: ellipsis;
|
|
3639
|
+
min-width: 0;
|
|
3640
|
+
}
|
|
3641
|
+
|
|
3642
|
+
.preview-panel-header button {
|
|
3643
|
+
width: 28px;
|
|
3644
|
+
height: 28px;
|
|
3645
|
+
border-radius: 6px;
|
|
3646
|
+
border: none;
|
|
3647
|
+
background: none;
|
|
3648
|
+
cursor: pointer;
|
|
3649
|
+
display: flex;
|
|
3650
|
+
align-items: center;
|
|
3651
|
+
justify-content: center;
|
|
3652
|
+
color: var(--sfx-up-text-muted, #9ca3af);
|
|
3653
|
+
transition: background 0.15s, color 0.15s;
|
|
3654
|
+
padding: 0;
|
|
3655
|
+
flex-shrink: 0;
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3658
|
+
.preview-panel-header button:hover {
|
|
3659
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
3660
|
+
color: var(--sfx-up-text, #374151);
|
|
3661
|
+
}
|
|
3662
|
+
|
|
3663
|
+
.preview-panel-header button svg {
|
|
3664
|
+
width: 16px;
|
|
3665
|
+
height: 16px;
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
.file-info-header {
|
|
3669
|
+
display: flex;
|
|
3670
|
+
align-items: center;
|
|
3671
|
+
justify-content: space-between;
|
|
3672
|
+
padding: 14px 0 10px;
|
|
3673
|
+
font-size: 14px;
|
|
3674
|
+
font-weight: 600;
|
|
3675
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3676
|
+
border-top: 1px solid var(--sfx-up-border, #e8edf5);
|
|
3677
|
+
margin-top: 4px;
|
|
3678
|
+
flex-shrink: 0;
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
.file-info-header svg {
|
|
3682
|
+
width: 16px;
|
|
3683
|
+
height: 16px;
|
|
3684
|
+
color: var(--sfx-up-text-muted, #9ca3af);
|
|
3685
|
+
}
|
|
3686
|
+
|
|
3687
|
+
.preview-doc-wrap {
|
|
3688
|
+
position: relative;
|
|
3689
|
+
flex: 1;
|
|
3690
|
+
min-height: 0;
|
|
3691
|
+
display: flex;
|
|
3692
|
+
align-items: center;
|
|
3693
|
+
justify-content: center;
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
.preview-doc-wrap.pdf { background: linear-gradient(135deg, #fef2f2, #fee2e2); }
|
|
3697
|
+
.preview-doc-wrap.doc { background: linear-gradient(135deg, var(--sfx-up-primary-bg, #eff6ff), var(--sfx-up-primary-bg, #dbeafe)); }
|
|
3698
|
+
.preview-doc-wrap.vid { background: linear-gradient(135deg, #f5f3ff, #ede9fe); }
|
|
3699
|
+
.preview-doc-wrap.zip { background: linear-gradient(135deg, var(--warning-10, #fffbeb), var(--warning-10, #fef3c7)); }
|
|
3700
|
+
.preview-doc-wrap.gen { background: linear-gradient(135deg, var(--sfx-up-border-light, #f8fafc), var(--sfx-up-border-light, #f1f5f9)); }
|
|
3701
|
+
|
|
3702
|
+
.preview-doc-icon {
|
|
3703
|
+
display: flex;
|
|
3704
|
+
flex-direction: column;
|
|
3705
|
+
align-items: center;
|
|
3706
|
+
gap: 8px;
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
.preview-doc-icon svg {
|
|
3710
|
+
width: 48px;
|
|
3711
|
+
height: 48px;
|
|
3712
|
+
stroke-width: 1.5;
|
|
3713
|
+
}
|
|
3714
|
+
|
|
3715
|
+
.preview-doc-icon.pdf svg { color: var(--sfx-up-error, #dc2626); }
|
|
3716
|
+
.preview-doc-icon.doc svg { color: var(--sfx-up-primary, #1d4ed8); }
|
|
3717
|
+
.preview-doc-icon.vid svg { color: #7c3aed; }
|
|
3718
|
+
.preview-doc-icon.zip svg { color: var(--warning-foreground, #b45309); }
|
|
3719
|
+
.preview-doc-icon.gen svg { color: var(--sfx-up-text-muted, #64748b); }
|
|
3720
|
+
|
|
3721
|
+
.preview-doc-ext {
|
|
3722
|
+
font-size: 13px;
|
|
3723
|
+
font-weight: 700;
|
|
3724
|
+
text-transform: uppercase;
|
|
3725
|
+
letter-spacing: 0.05em;
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3728
|
+
.preview-doc-ext.pdf { color: var(--sfx-up-error, #dc2626); }
|
|
3729
|
+
.preview-doc-ext.doc { color: var(--sfx-up-primary, #1d4ed8); }
|
|
3730
|
+
.preview-doc-ext.vid { color: #7c3aed; }
|
|
3731
|
+
.preview-doc-ext.zip { color: var(--warning-foreground, #b45309); }
|
|
3732
|
+
.preview-doc-ext.gen { color: var(--sfx-up-text-muted, #64748b); }
|
|
3733
|
+
|
|
3734
|
+
.preview-img-wrap {
|
|
3735
|
+
position: relative;
|
|
3736
|
+
flex: 1;
|
|
3737
|
+
min-height: 0;
|
|
3738
|
+
background: var(--sfx-up-surface, #f1f5f9);
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
.preview-image {
|
|
3742
|
+
width: 100%;
|
|
3743
|
+
height: 100%;
|
|
3744
|
+
object-fit: contain;
|
|
3745
|
+
display: block;
|
|
3746
|
+
border: none;
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
.preview-nav {
|
|
3750
|
+
position: absolute;
|
|
3751
|
+
top: 50%;
|
|
3752
|
+
transform: translateY(-50%);
|
|
3753
|
+
width: 36px;
|
|
3754
|
+
height: 36px;
|
|
3755
|
+
border-radius: 50%;
|
|
3756
|
+
border: none;
|
|
3757
|
+
background: #fff;
|
|
3758
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
|
|
3759
|
+
cursor: pointer;
|
|
3760
|
+
display: flex;
|
|
3761
|
+
align-items: center;
|
|
3762
|
+
justify-content: center;
|
|
3763
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3764
|
+
transition: all 0.15s;
|
|
3765
|
+
z-index: 2;
|
|
3766
|
+
padding: 0;
|
|
3767
|
+
}
|
|
3768
|
+
|
|
3769
|
+
.preview-nav:hover {
|
|
3770
|
+
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
|
|
3771
|
+
transform: translateY(-50%) scale(1.06);
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
.preview-nav:active {
|
|
3775
|
+
transform: translateY(-50%) scale(0.96);
|
|
3776
|
+
}
|
|
3777
|
+
|
|
3778
|
+
.preview-nav svg {
|
|
3779
|
+
width: 18px;
|
|
3780
|
+
height: 18px;
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
.preview-nav.prev { left: 10px; }
|
|
3784
|
+
.preview-nav.next { right: 10px; }
|
|
3785
|
+
|
|
3786
|
+
.preview-nav:disabled {
|
|
3787
|
+
opacity: 0.35;
|
|
3788
|
+
cursor: default;
|
|
3789
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
.preview-nav:disabled:hover {
|
|
3793
|
+
transform: translateY(-50%);
|
|
3794
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
.preview-meta-list {
|
|
3798
|
+
display: flex;
|
|
3799
|
+
flex-direction: column;
|
|
3800
|
+
flex-shrink: 0;
|
|
3801
|
+
padding: 0 16px 12px;
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
.preview-meta-row {
|
|
3805
|
+
display: flex;
|
|
3806
|
+
align-items: baseline;
|
|
3807
|
+
padding: 12px 0;
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
.preview-meta-label {
|
|
3811
|
+
width: 110px;
|
|
3812
|
+
flex-shrink: 0;
|
|
3813
|
+
font-size: 14px;
|
|
3814
|
+
font-weight: 400;
|
|
3815
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
3816
|
+
}
|
|
3817
|
+
|
|
3818
|
+
.preview-meta-value {
|
|
3819
|
+
font-size: 14px;
|
|
3820
|
+
font-weight: 400;
|
|
3821
|
+
color: var(--foreground, var(--sfx-up-text, #1e293b));
|
|
3822
|
+
word-break: break-all;
|
|
3823
|
+
min-width: 0;
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
.preview-meta-value.truncate {
|
|
3827
|
+
white-space: nowrap;
|
|
3828
|
+
overflow: hidden;
|
|
3829
|
+
text-overflow: ellipsis;
|
|
3830
|
+
word-break: normal;
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
/* --- Upload overlay (in-modal) --- */
|
|
3834
|
+
.upload-overlay {
|
|
3835
|
+
display: flex;
|
|
3836
|
+
flex-direction: column;
|
|
3837
|
+
align-items: center;
|
|
3838
|
+
justify-content: center;
|
|
3839
|
+
flex: 1;
|
|
3840
|
+
gap: 8px;
|
|
3841
|
+
padding: 32px 24px;
|
|
3842
|
+
animation: fadeUp 0.3s ease both;
|
|
3843
|
+
}
|
|
3844
|
+
|
|
3845
|
+
.upload-overlay-spinner {
|
|
3846
|
+
width: 48px;
|
|
3847
|
+
height: 48px;
|
|
3848
|
+
border: 3px solid var(--sfx-up-border, #e2e8f0);
|
|
3849
|
+
border-top-color: var(--sfx-up-primary, #2563eb);
|
|
3850
|
+
border-radius: 50%;
|
|
3851
|
+
animation: spin 0.8s linear infinite;
|
|
3852
|
+
margin-bottom: 8px;
|
|
3853
|
+
}
|
|
3854
|
+
|
|
3855
|
+
.upload-overlay-percent {
|
|
3856
|
+
font-size: 40px;
|
|
3857
|
+
font-weight: 700;
|
|
3858
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
3859
|
+
line-height: 1;
|
|
3860
|
+
}
|
|
3861
|
+
|
|
3862
|
+
.upload-overlay-title {
|
|
3863
|
+
font-size: 16px;
|
|
3864
|
+
font-weight: 600;
|
|
3865
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3866
|
+
}
|
|
3867
|
+
|
|
3868
|
+
.upload-overlay-subtitle {
|
|
3869
|
+
font-size: 13px;
|
|
3870
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
3871
|
+
margin-bottom: 8px;
|
|
3872
|
+
}
|
|
3873
|
+
|
|
3874
|
+
.upload-overlay-bar {
|
|
3875
|
+
width: 240px;
|
|
3876
|
+
height: 6px;
|
|
3877
|
+
background: var(--sfx-up-border, #e2e8f0);
|
|
3878
|
+
border-radius: 3px;
|
|
3879
|
+
overflow: hidden;
|
|
3880
|
+
margin-bottom: 16px;
|
|
3881
|
+
}
|
|
3882
|
+
|
|
3883
|
+
.upload-overlay-bar-fill {
|
|
3884
|
+
height: 100%;
|
|
3885
|
+
background: var(--sfx-up-primary, #2563eb);
|
|
3886
|
+
border-radius: 3px;
|
|
3887
|
+
transition: width 0.3s ease;
|
|
3888
|
+
}
|
|
3889
|
+
|
|
3890
|
+
.upload-overlay-minimize {
|
|
3891
|
+
padding: 8px 20px;
|
|
3892
|
+
border: 1px solid var(--sfx-up-border, #e2e8f0);
|
|
3893
|
+
background: var(--sfx-up-bg, #fff);
|
|
3894
|
+
border-radius: 8px;
|
|
3895
|
+
font-size: 13px;
|
|
3896
|
+
font-weight: 500;
|
|
3897
|
+
color: var(--sfx-up-text-secondary, #475569);
|
|
3898
|
+
cursor: pointer;
|
|
3899
|
+
transition: all 0.15s;
|
|
3900
|
+
font-family: inherit;
|
|
3901
|
+
}
|
|
3902
|
+
|
|
3903
|
+
.upload-overlay-minimize:hover {
|
|
3904
|
+
border-color: var(--sfx-up-primary, #2563eb);
|
|
3905
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
3906
|
+
}
|
|
3907
|
+
|
|
3908
|
+
.upload-header {
|
|
3909
|
+
justify-content: space-between;
|
|
3910
|
+
}
|
|
3911
|
+
|
|
3912
|
+
.upload-header .float-actions button {
|
|
3913
|
+
width: 28px;
|
|
3914
|
+
height: 28px;
|
|
3915
|
+
border: none;
|
|
3916
|
+
background: none;
|
|
3917
|
+
cursor: pointer;
|
|
3918
|
+
border-radius: 6px;
|
|
3919
|
+
display: flex;
|
|
3920
|
+
align-items: center;
|
|
3921
|
+
justify-content: center;
|
|
3922
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
3923
|
+
transition: background 0.15s;
|
|
3924
|
+
padding: 0;
|
|
3925
|
+
}
|
|
3926
|
+
|
|
3927
|
+
.upload-header .float-actions button:hover {
|
|
3928
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
3929
|
+
color: var(--sfx-up-text, #374151);
|
|
3930
|
+
}
|
|
3931
|
+
|
|
3932
|
+
.upload-header .float-actions button svg { width: 16px; height: 16px; }
|
|
3933
|
+
|
|
3934
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
3935
|
+
@keyframes fadeUp {
|
|
3936
|
+
from { opacity: 0; transform: translateY(12px); }
|
|
3937
|
+
to { opacity: 1; transform: translateY(0); }
|
|
3938
|
+
}
|
|
3939
|
+
|
|
3940
|
+
/* --- Floating upload card (Variant 3 style) --- */
|
|
3941
|
+
.upload-float {
|
|
3942
|
+
position: fixed;
|
|
3943
|
+
bottom: 24px;
|
|
3944
|
+
right: 24px;
|
|
3945
|
+
z-index: 10000;
|
|
3946
|
+
width: 320px;
|
|
3947
|
+
border-radius: 12px;
|
|
3948
|
+
background: var(--sfx-up-bg, #fff);
|
|
3949
|
+
box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
|
|
3950
|
+
overflow: hidden;
|
|
3951
|
+
font-family: inherit;
|
|
3952
|
+
animation: floatSlideIn 0.3s ease both;
|
|
3953
|
+
}
|
|
3954
|
+
|
|
3955
|
+
.float-header {
|
|
3956
|
+
display: flex;
|
|
3957
|
+
align-items: center;
|
|
3958
|
+
justify-content: space-between;
|
|
3959
|
+
padding: 10px 14px;
|
|
3960
|
+
border-bottom: 1px solid var(--sfx-up-border, #e8edf5);
|
|
3961
|
+
}
|
|
3962
|
+
|
|
3963
|
+
.float-header-left {
|
|
3964
|
+
display: flex;
|
|
3965
|
+
align-items: center;
|
|
3966
|
+
gap: 8px;
|
|
3967
|
+
}
|
|
3968
|
+
|
|
3969
|
+
.float-icon {
|
|
3970
|
+
width: 28px;
|
|
3971
|
+
height: 28px;
|
|
3972
|
+
border-radius: 6px;
|
|
3973
|
+
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
3974
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
3975
|
+
display: flex;
|
|
3976
|
+
align-items: center;
|
|
3977
|
+
justify-content: center;
|
|
3978
|
+
flex-shrink: 0;
|
|
3979
|
+
}
|
|
3980
|
+
|
|
3981
|
+
.float-icon svg { width: 14px; height: 14px; }
|
|
3982
|
+
|
|
3983
|
+
.float-icon.done {
|
|
3984
|
+
background: #f0fdf4;
|
|
3985
|
+
color: #22c55e;
|
|
3986
|
+
}
|
|
3987
|
+
|
|
3988
|
+
.float-title {
|
|
3989
|
+
font-size: 13px;
|
|
3990
|
+
font-weight: 600;
|
|
3991
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3992
|
+
}
|
|
3993
|
+
|
|
3994
|
+
.float-subtitle {
|
|
3995
|
+
font-size: 11px;
|
|
3996
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
3997
|
+
}
|
|
3998
|
+
|
|
3999
|
+
.float-actions {
|
|
4000
|
+
display: flex;
|
|
4001
|
+
gap: 4px;
|
|
4002
|
+
}
|
|
4003
|
+
|
|
4004
|
+
.float-actions button {
|
|
4005
|
+
width: 26px;
|
|
4006
|
+
height: 26px;
|
|
4007
|
+
border: none;
|
|
4008
|
+
background: none;
|
|
4009
|
+
cursor: pointer;
|
|
4010
|
+
border-radius: 6px;
|
|
4011
|
+
display: flex;
|
|
4012
|
+
align-items: center;
|
|
4013
|
+
justify-content: center;
|
|
4014
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
4015
|
+
transition: background 0.15s;
|
|
4016
|
+
padding: 0;
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
.float-actions button:hover {
|
|
4020
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
4021
|
+
color: var(--sfx-up-text, #374151);
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
.float-actions button svg { width: 14px; height: 14px; }
|
|
4025
|
+
|
|
4026
|
+
.float-progress {
|
|
4027
|
+
padding: 10px 14px;
|
|
4028
|
+
border-bottom: 1px solid var(--sfx-up-border, #e8edf5);
|
|
4029
|
+
}
|
|
4030
|
+
|
|
4031
|
+
.float-progress-top {
|
|
4032
|
+
display: flex;
|
|
4033
|
+
align-items: center;
|
|
4034
|
+
justify-content: space-between;
|
|
4035
|
+
margin-bottom: 6px;
|
|
4036
|
+
}
|
|
4037
|
+
|
|
4038
|
+
.float-progress-label {
|
|
4039
|
+
font-size: 12px;
|
|
4040
|
+
color: var(--sfx-up-text-secondary, #475569);
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
.float-progress-pct {
|
|
4044
|
+
font-size: 12px;
|
|
4045
|
+
font-weight: 600;
|
|
4046
|
+
color: var(--sfx-up-primary, #2563eb);
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
.float-progress-pct.done {
|
|
4050
|
+
color: #22c55e;
|
|
4051
|
+
}
|
|
4052
|
+
|
|
4053
|
+
.float-bar {
|
|
4054
|
+
height: 4px;
|
|
4055
|
+
background: var(--sfx-up-border, #e8edf5);
|
|
4056
|
+
border-radius: 2px;
|
|
4057
|
+
overflow: hidden;
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
.float-bar-fill {
|
|
4061
|
+
height: 100%;
|
|
4062
|
+
background: var(--sfx-up-primary, #2563eb);
|
|
4063
|
+
border-radius: 2px;
|
|
4064
|
+
transition: width 0.3s ease;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
.float-bar-fill.done {
|
|
4068
|
+
background: #22c55e;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
.float-items {
|
|
4072
|
+
max-height: 200px;
|
|
4073
|
+
overflow-y: auto;
|
|
4074
|
+
scrollbar-width: thin;
|
|
4075
|
+
scrollbar-color: rgba(0,0,0,0.1) transparent;
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
.float-item {
|
|
4079
|
+
display: flex;
|
|
4080
|
+
align-items: center;
|
|
4081
|
+
gap: 10px;
|
|
4082
|
+
padding: 8px 14px;
|
|
4083
|
+
border-bottom: 1px solid #f1f5f9;
|
|
4084
|
+
}
|
|
4085
|
+
|
|
4086
|
+
.float-item:last-child { border-bottom: none; }
|
|
4087
|
+
|
|
4088
|
+
.float-item-thumb {
|
|
4089
|
+
width: 32px;
|
|
4090
|
+
height: 32px;
|
|
4091
|
+
border-radius: 6px;
|
|
4092
|
+
background: var(--sfx-up-surface, #f8fafc);
|
|
4093
|
+
display: flex;
|
|
4094
|
+
align-items: center;
|
|
4095
|
+
justify-content: center;
|
|
4096
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
4097
|
+
flex-shrink: 0;
|
|
4098
|
+
}
|
|
4099
|
+
|
|
4100
|
+
.float-item-thumb svg { width: 16px; height: 16px; }
|
|
4101
|
+
|
|
4102
|
+
.float-item-info { flex: 1; min-width: 0; }
|
|
4103
|
+
|
|
4104
|
+
.float-item-name {
|
|
4105
|
+
font-size: 12px;
|
|
4106
|
+
font-weight: 500;
|
|
4107
|
+
color: var(--sfx-up-text, #1e293b);
|
|
4108
|
+
white-space: nowrap;
|
|
4109
|
+
overflow: hidden;
|
|
4110
|
+
text-overflow: ellipsis;
|
|
4111
|
+
}
|
|
4112
|
+
|
|
4113
|
+
.float-item-size {
|
|
4114
|
+
font-size: 11px;
|
|
4115
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
4116
|
+
}
|
|
4117
|
+
|
|
4118
|
+
.float-item-done {
|
|
4119
|
+
width: 18px;
|
|
4120
|
+
height: 18px;
|
|
4121
|
+
border-radius: 50%;
|
|
4122
|
+
background: #f0fdf4;
|
|
4123
|
+
color: #22c55e;
|
|
4124
|
+
display: flex;
|
|
4125
|
+
align-items: center;
|
|
4126
|
+
justify-content: center;
|
|
4127
|
+
flex-shrink: 0;
|
|
4128
|
+
}
|
|
4129
|
+
|
|
4130
|
+
.float-item-done svg { width: 12px; height: 12px; }
|
|
4131
|
+
|
|
4132
|
+
.float-item-spinner {
|
|
4133
|
+
width: 16px;
|
|
4134
|
+
height: 16px;
|
|
4135
|
+
border: 2px solid var(--sfx-up-border, #e8edf5);
|
|
4136
|
+
border-top-color: var(--sfx-up-primary, #2563eb);
|
|
4137
|
+
border-radius: 50%;
|
|
4138
|
+
animation: spin 0.8s linear infinite;
|
|
4139
|
+
flex-shrink: 0;
|
|
4140
|
+
}
|
|
4141
|
+
|
|
4142
|
+
.float-item-error {
|
|
4143
|
+
color: #ef4444;
|
|
4144
|
+
width: 16px;
|
|
4145
|
+
height: 16px;
|
|
4146
|
+
flex-shrink: 0;
|
|
4147
|
+
}
|
|
4148
|
+
|
|
4149
|
+
@keyframes floatSlideIn {
|
|
4150
|
+
from { opacity: 0; transform: translateY(20px); }
|
|
4151
|
+
to { opacity: 1; transform: translateY(0); }
|
|
4152
|
+
}
|
|
4153
|
+
|
|
4154
|
+
/* --- Connector modal overlay --- */
|
|
4155
|
+
.connector-modal-backdrop {
|
|
4156
|
+
position: fixed;
|
|
4157
|
+
inset: 0;
|
|
4158
|
+
z-index: 1000;
|
|
4159
|
+
background: var(--sfx-up-backdrop);
|
|
4160
|
+
backdrop-filter: blur(6px);
|
|
4161
|
+
display: flex;
|
|
4162
|
+
align-items: center;
|
|
4163
|
+
justify-content: center;
|
|
4164
|
+
padding: 20px;
|
|
4165
|
+
animation: fadeIn 0.18s ease both;
|
|
4166
|
+
}
|
|
4167
|
+
|
|
4168
|
+
.connector-modal {
|
|
4169
|
+
background: var(--sfx-up-bg, #fff);
|
|
4170
|
+
border-radius: 12px;
|
|
4171
|
+
box-shadow: 0 28px 80px var(--sfx-up-shadow, rgba(0, 0, 0, 0.18)), 0 4px 16px oklch(0 0 0 / 0.06);
|
|
4172
|
+
width: 100%;
|
|
4173
|
+
max-width: 520px;
|
|
4174
|
+
height: 75vh;
|
|
4175
|
+
max-height: 640px;
|
|
4176
|
+
min-height: 400px;
|
|
4177
|
+
overflow: hidden;
|
|
4178
|
+
display: flex;
|
|
4179
|
+
flex-direction: column;
|
|
4180
|
+
animation: modalIn 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
|
|
4181
|
+
}
|
|
4182
|
+
|
|
4183
|
+
@keyframes fadeIn {
|
|
4184
|
+
from { opacity: 0; }
|
|
4185
|
+
to { opacity: 1; }
|
|
4186
|
+
}
|
|
4187
|
+
|
|
4188
|
+
@keyframes modalIn {
|
|
4189
|
+
from {
|
|
4190
|
+
opacity: 0;
|
|
4191
|
+
transform: scale(0.92) translateY(10px);
|
|
4192
|
+
}
|
|
4193
|
+
to {
|
|
4194
|
+
opacity: 1;
|
|
4195
|
+
transform: scale(1) translateY(0);
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
|
|
4199
|
+
@keyframes inlineIn {
|
|
4200
|
+
from { opacity: 0; }
|
|
4201
|
+
to { opacity: 1; }
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
/* --- Fullscreen preview overlay --- */
|
|
4205
|
+
.fs-overlay {
|
|
4206
|
+
position: fixed;
|
|
4207
|
+
inset: 0;
|
|
4208
|
+
z-index: 10000;
|
|
4209
|
+
background: rgba(0, 0, 0, 0.92);
|
|
4210
|
+
display: flex;
|
|
4211
|
+
align-items: center;
|
|
4212
|
+
justify-content: center;
|
|
4213
|
+
animation: fadeIn 0.2s ease;
|
|
4214
|
+
cursor: zoom-in;
|
|
4215
|
+
}
|
|
4216
|
+
|
|
4217
|
+
.fs-overlay.zoomed {
|
|
4218
|
+
cursor: grab;
|
|
4219
|
+
overflow: hidden;
|
|
4220
|
+
}
|
|
4221
|
+
|
|
4222
|
+
.fs-overlay.zoomed.panning {
|
|
4223
|
+
cursor: grabbing;
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4226
|
+
.fs-overlay.zoomed .fs-img {
|
|
4227
|
+
max-width: none;
|
|
4228
|
+
max-height: none;
|
|
4229
|
+
width: auto;
|
|
4230
|
+
height: auto;
|
|
4231
|
+
}
|
|
4232
|
+
|
|
4233
|
+
.fs-img {
|
|
4234
|
+
max-width: 92vw;
|
|
4235
|
+
max-height: 88vh;
|
|
4236
|
+
object-fit: contain;
|
|
4237
|
+
border-radius: 4px;
|
|
4238
|
+
user-select: none;
|
|
4239
|
+
-webkit-user-drag: none;
|
|
4240
|
+
transition: transform 0.25s ease;
|
|
4241
|
+
}
|
|
4242
|
+
|
|
4243
|
+
.fs-overlay.panning .fs-img {
|
|
4244
|
+
transition: none;
|
|
4245
|
+
}
|
|
4246
|
+
|
|
4247
|
+
.fs-toolbar {
|
|
4248
|
+
position: fixed;
|
|
4249
|
+
top: 16px;
|
|
4250
|
+
right: 16px;
|
|
4251
|
+
display: flex;
|
|
4252
|
+
gap: 8px;
|
|
4253
|
+
z-index: 10001;
|
|
4254
|
+
}
|
|
4255
|
+
|
|
4256
|
+
.fs-btn {
|
|
4257
|
+
width: 40px;
|
|
4258
|
+
height: 40px;
|
|
4259
|
+
border-radius: 6px;
|
|
4260
|
+
border: none;
|
|
4261
|
+
background: rgba(255, 255, 255, 0.12);
|
|
4262
|
+
backdrop-filter: blur(8px);
|
|
4263
|
+
color: #fff;
|
|
4264
|
+
cursor: pointer;
|
|
4265
|
+
display: flex;
|
|
4266
|
+
align-items: center;
|
|
4267
|
+
justify-content: center;
|
|
4268
|
+
transition: background 0.15s;
|
|
4269
|
+
}
|
|
4270
|
+
|
|
4271
|
+
.fs-btn:hover {
|
|
4272
|
+
background: rgba(255, 255, 255, 0.25);
|
|
4273
|
+
}
|
|
4274
|
+
|
|
4275
|
+
.fs-btn svg {
|
|
4276
|
+
width: 20px;
|
|
4277
|
+
height: 20px;
|
|
4278
|
+
}
|
|
4279
|
+
|
|
4280
|
+
.fs-nav {
|
|
4281
|
+
position: fixed;
|
|
4282
|
+
top: 50%;
|
|
4283
|
+
transform: translateY(-50%);
|
|
4284
|
+
width: 44px;
|
|
4285
|
+
height: 44px;
|
|
4286
|
+
border-radius: 50%;
|
|
4287
|
+
border: none;
|
|
4288
|
+
background: rgba(255, 255, 255, 0.15);
|
|
4289
|
+
backdrop-filter: blur(8px);
|
|
4290
|
+
color: #fff;
|
|
4291
|
+
cursor: pointer;
|
|
4292
|
+
display: flex;
|
|
4293
|
+
align-items: center;
|
|
4294
|
+
justify-content: center;
|
|
4295
|
+
z-index: 10001;
|
|
4296
|
+
transition: background 0.15s;
|
|
4297
|
+
padding: 0;
|
|
4298
|
+
}
|
|
4299
|
+
|
|
4300
|
+
.fs-nav:hover { background: rgba(255, 255, 255, 0.3); }
|
|
4301
|
+
.fs-nav:disabled { opacity: 0.3; cursor: default; }
|
|
4302
|
+
.fs-nav:disabled:hover { background: rgba(255, 255, 255, 0.15); }
|
|
4303
|
+
.fs-nav svg { width: 22px; height: 22px; }
|
|
4304
|
+
.fs-nav.prev { left: 20px; }
|
|
4305
|
+
.fs-nav.next { right: 20px; }
|
|
4306
|
+
|
|
4307
|
+
.fs-filename {
|
|
4308
|
+
position: fixed;
|
|
4309
|
+
bottom: 20px;
|
|
4310
|
+
left: 50%;
|
|
4311
|
+
transform: translateX(-50%);
|
|
4312
|
+
color: rgba(255, 255, 255, 0.7);
|
|
4313
|
+
font-size: 13px;
|
|
4314
|
+
font-weight: 500;
|
|
4315
|
+
background: rgba(0, 0, 0, 0.4);
|
|
4316
|
+
backdrop-filter: blur(8px);
|
|
4317
|
+
padding: 6px 16px;
|
|
4318
|
+
border-radius: 8px;
|
|
4319
|
+
white-space: nowrap;
|
|
4320
|
+
z-index: 10001;
|
|
4321
|
+
}
|
|
4322
|
+
|
|
4323
|
+
.preview-nav:focus-visible,
|
|
4324
|
+
.fs-btn:focus-visible {
|
|
4325
|
+
outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
4326
|
+
outline-offset: 2px;
|
|
4327
|
+
}
|
|
4328
|
+
|
|
4329
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4330
|
+
.modal-backdrop { animation: none; }
|
|
4331
|
+
.modal-card { animation: none; }
|
|
4332
|
+
.inline { animation: none; }
|
|
4333
|
+
.fs-overlay { animation: none; }
|
|
4334
|
+
.body.has-files { animation: none; }
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
/* --- Responsive: Tablet (≤ 768px) --- */
|
|
4338
|
+
@media (max-width: 768px) {
|
|
4339
|
+
.modal-backdrop { padding: 12px; }
|
|
4340
|
+
.modal-card { border-radius: 12px; max-height: 92vh; min-height: auto; }
|
|
4341
|
+
.header { padding: 12px 16px; }
|
|
4342
|
+
.header-icon { width: 28px; height: 28px; margin-right: 10px; }
|
|
4343
|
+
.header-icon svg { width: 14px; height: 14px; }
|
|
4344
|
+
.header-title { font-size: 14px; }
|
|
4345
|
+
.body { padding: 16px; }
|
|
4346
|
+
.body.has-files { padding: 0 0 12px 8px; }
|
|
4347
|
+
|
|
4348
|
+
.preview-layout { flex-direction: column; }
|
|
4349
|
+
.preview-layout .file-grid-side {
|
|
4350
|
+
width: 100%;
|
|
4351
|
+
max-height: 140px;
|
|
4352
|
+
overflow-x: auto;
|
|
4353
|
+
overflow-y: hidden;
|
|
4354
|
+
flex-shrink: 0;
|
|
4355
|
+
}
|
|
4356
|
+
.preview-panel { padding: 0 0 16px; }
|
|
4357
|
+
|
|
4358
|
+
.preview-topbar { padding: 8px 0; }
|
|
4359
|
+
|
|
4360
|
+
.inline { border-radius: 12px; min-height: auto; }
|
|
4361
|
+
|
|
4362
|
+
.connector-modal-backdrop { padding: 8px; }
|
|
4363
|
+
.connector-modal {
|
|
4364
|
+
max-width: 100%;
|
|
4365
|
+
height: 85vh;
|
|
4366
|
+
max-height: none;
|
|
4367
|
+
border-radius: 14px;
|
|
4368
|
+
}
|
|
4369
|
+
}
|
|
4370
|
+
|
|
4371
|
+
/* --- Responsive: Mobile (≤ 480px) --- */
|
|
4372
|
+
@media (max-width: 480px) {
|
|
4373
|
+
.modal-backdrop { padding: 0; }
|
|
4374
|
+
.modal-card {
|
|
4375
|
+
border-radius: 0;
|
|
4376
|
+
max-height: 100vh;
|
|
4377
|
+
max-width: 100%;
|
|
4378
|
+
height: 100%;
|
|
4379
|
+
}
|
|
4380
|
+
.header { padding: 10px 14px; }
|
|
4381
|
+
.header-icon { width: 26px; height: 26px; margin-right: 8px; }
|
|
4382
|
+
.header-title { font-size: 14px; }
|
|
4383
|
+
.body { padding: 12px; }
|
|
4384
|
+
.body.has-files { padding: 0 0 8px 8px; }
|
|
4385
|
+
|
|
4386
|
+
.preview-layout .file-grid-side { max-height: 100px; }
|
|
4387
|
+
.preview-panel { padding: 0 0 12px; }
|
|
4388
|
+
.preview-meta-row { padding: 6px 0; }
|
|
4389
|
+
.preview-meta-label { width: 90px; font-size: 12px; }
|
|
4390
|
+
.preview-meta-value { font-size: 12px; }
|
|
4391
|
+
|
|
4392
|
+
.inline { max-height: 100vh; border-radius: 8px; box-shadow: none; }
|
|
4393
|
+
|
|
4394
|
+
.connector-modal-backdrop { padding: 0; }
|
|
4395
|
+
.connector-modal {
|
|
4396
|
+
border-radius: 0;
|
|
4397
|
+
height: 100vh;
|
|
4398
|
+
min-height: auto;
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4401
|
+
|
|
4402
|
+
/* --- Responsive: Landscape / short viewports --- */
|
|
4403
|
+
@media (max-height: 700px) {
|
|
4404
|
+
.modal-card { min-height: auto; }
|
|
4405
|
+
.inline { min-height: auto; }
|
|
4406
|
+
}
|
|
4407
|
+
`,$._MODIFIABLE_STATUSES=new Set(["idle","queued","rejected"]),$._RESERVED_IDS=new Set(["device","camera","url","screen-cast"]),$);k([p.property({attribute:!1})],_.prototype,"config");k([p.state()],_.prototype,"_isOpen");k([p.state()],_.prototype,"_activeConnector");k([p.state()],_.prototype,"_showUrlDialog");k([p.state()],_.prototype,"_showCameraDialog");k([p.state()],_.prototype,"_showScreenCastDialog");k([p.state()],_.prototype,"_previewFileId");k([p.state()],_.prototype,"_previewDims");k([p.state()],_.prototype,"_fullscreenPreviewUrl");k([p.state()],_.prototype,"_fullscreenVideoFile");k([p.state()],_.prototype,"_fullscreenZoomed");k([p.state()],_.prototype,"_bodyDragOver");k([p.state()],_.prototype,"_isMinimized");k([p.state()],_.prototype,"_isPillExpanded");let ht=_;exports.AuthExpiredError=ee;exports.CORE_SOURCES=A;exports.PublicEvents=g;exports.SfxActionsBar=z;exports.SfxCameraDialog=j;exports.SfxDropZone=C;exports.SfxFileItem=J;exports.SfxFileList=F;exports.SfxImportDivider=se;exports.SfxScreenCastDialog=T;exports.SfxSourcePills=Z;exports.SfxSuccessCard=O;exports.SfxUploader=ht;exports.SfxUrlDialog=I;exports.Store=Se;exports.UploadEngine=Ue;exports.buildAuthHeaders=K;exports.createStore=Ee;exports.exchangeSassKey=ze;exports.getApiBase=te;exports.getAuthUrl=Le;exports.getProviderSources=De;exports.listFiles=Me;exports.listNextPage=Be;exports.logout=Ie;exports.resolveAuth=Pe;exports.searchProvider=Re;
|