@creaditor/newsletter-starterkit 1.0.62 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3847.creaditor.bundle.js +173 -116
- package/dist/3847.creaditor.bundle.js.gz +0 -0
- package/dist/5156.creaditor.bundle.js +1 -1
- package/dist/5156.creaditor.bundle.js.gz +0 -0
- package/dist/5909.creaditor.bundle.js +1 -1
- package/dist/5909.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +32 -30
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/767.creaditor.bundle.js +26 -70
- package/dist/767.creaditor.bundle.js.gz +0 -0
- package/dist/8547.creaditor.bundle.js +1 -1
- package/dist/8547.creaditor.bundle.js.gz +0 -0
- package/dist/8646.creaditor.bundle.js +36 -37
- package/dist/8646.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +520 -190
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2590,7209],{93967(e,t,s){s.d(t,{T:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2590,7209],{93967(e,t,s){s.d(t,{T:()=>i});const i=s(59929).AH`
|
|
2
2
|
:host {
|
|
3
3
|
direction: var(--direction-locale, ltr);
|
|
4
4
|
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
.moved {
|
|
29
29
|
position: absolute;
|
|
30
|
-
|
|
30
|
+
inset-inline-start: 0;
|
|
31
31
|
top: 0;
|
|
32
32
|
width: 100%;
|
|
33
33
|
background: #fff;
|
|
@@ -88,6 +88,8 @@
|
|
|
88
88
|
background: var(--color-bg-subtle, var(--alpha));
|
|
89
89
|
height: 100vh;
|
|
90
90
|
max-width: 210px;
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
padding-inline: var(--space-4, 16px);
|
|
91
93
|
}
|
|
92
94
|
.search {
|
|
93
95
|
--cdtr-input-height: 36px;
|
|
@@ -110,7 +112,7 @@
|
|
|
110
112
|
width: 100%;
|
|
111
113
|
top: 100%;
|
|
112
114
|
transform: translateY(-100%);
|
|
113
|
-
|
|
115
|
+
inset-inline-start: 0;
|
|
114
116
|
}
|
|
115
117
|
.scroll-body::-webkit-scrollbar {
|
|
116
118
|
width: var(--scrollbar-width, 6px);
|
|
@@ -146,7 +148,7 @@
|
|
|
146
148
|
.gallery-container {
|
|
147
149
|
padding: var(--space-8, 32px) var(--space-5, 20px);
|
|
148
150
|
}
|
|
149
|
-
`},27209(e,t,s){s.r(t),s.d(t,{CreaditorGalleryWrapper:()=>g});var
|
|
151
|
+
`},27209(e,t,s){s.r(t),s.d(t,{CreaditorGalleryWrapper:()=>b,DEFAULT_LABELS:()=>g});var i=s(59929),r=s(5441),o=s(86319),a=s(49549),l=s(91597),n=s(21421),d=s(93967);function c(e){try{localStorage.setItem("creaditor-gallery-folder",e)}catch(e){console.warn("Could not write to localStorage:",e)}}class p extends i.WF{constructor(){super(),this.newFolderModalRef=(0,n._)(),this.newFolderInputRef=(0,n._)(),this.drop=this.drop.bind(this),this.controls=!0,this.folderName=o.M.get("lang","myImages")||"My Images",this.sendFiles=this.sendFiles.bind(this),this.onSearch=this.onSearch.bind(this),this.coverEl=document.createElement("div"),this.sortItems=[{index:0,text:"fromNewToOld",value:{filter:"date",sortBy:"ASC"},checked:!0},{index:1,text:"fromOldToNew",value:{filter:"date",sortBy:"DESC"},checked:!1},{index:2,text:o.M.get("lang","aToZ"),value:{filter:"name",sortBy:"ASC"},checked:!1},{index:3,text:o.M.get("lang","zToA"),value:{filter:"name",sortBy:"DESC"},checked:!1}],this.filterItems=[{index:0,text:o.M.get("lang","folders"),value:"folders",checked:!0},{index:1,text:o.M.get("lang","images"),value:"images",checked:!0}]}openNewFolderModal(e){const t=this.newFolderModalRef.value;t&&(t.positionTarget=e.target,t.open(),this.newFolderInputRef.value.focus())}sendFiles(){const e={detail:this.files.filter(e=>e.selected),bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",e))}onLiked(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("like",t))}onClickFolder(e,t){this.freeImages=!1,this.controls=t;const s={detail:e,bubbles:!1,composed:!1};this.folderName=e.name,this.dispatchEvent(new CustomEvent("folder",s))}onSelectFile(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}onSelectPexelsImage(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}onUpload(){const e=(0,r.A)("input",{hidden:!0,type:"file",accept:"image/*"});e.onchange=e=>{const t=e.target;if(t.files&&t.files[0]){const e=new FileReader,s=t.files[0];e.onload=e=>{const t={detail:s,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("upload",t))},e.readAsDataURL(s)}},e.click()}onCreateNewFolder(){const e=this.newFolderInputRef.value.value;if(e.length<=30){const t={detail:e,bubbles:!1,composed:!1};this.newFolderModalRef.value.close(),this.dispatchEvent(new CustomEvent("newFolder",t)),this.newFolderInputRef.value.value=""}}onClickCategory(){}onReset(){c(null),this.freeImages=!1,this._favorites=!1,this.folderName=o.M.get("lang","myImages"),this.filterItems=this.filterItems.map(e=>"folders"===e.value?{...e,checked:!0}:e),this.dispatchEvent(new CustomEvent("reset",{}))}onFavorites(){c(null),this.freeImages=!1,this._favorites=!0,this.folderName="",this.filterItems=this.filterItems.map(e=>"folders"===e.value?{...e,checked:!1}:e),this.dispatchEvent(new CustomEvent("search",{detail:{value:"",isLiked:!0},bubbles:!1,composed:!1}))}onSearch(e,t){c(null),this.freeImages=!1;let s=!1;"object"==typeof t&&t.isLiked&&(s=!0);const i=e.target?.value||"";(0,l.A)(()=>{const e={detail:{value:i,isLiked:s},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("search",e))})}drop(e,t){e.preventDefault();const s=e.dataTransfer.getData("fileId"),i=(e.dataTransfer.getData("folderId"),{detail:{fileId:s,folderId:t},bubbles:!1,composed:!1});this.dispatchEvent(new CustomEvent("moveFile",i))}onFilterMedia(e){const t=e.detail.value,s=t.index,i=[...this.filterItems];i[s].checked=!i[s].checked,this.filterItems=i}onSort(e){const t=e.detail.value,s={detail:t,bubbles:!1,composed:!1},i=t.index,r=[...this.sortItems];r.forEach((e,t)=>{e.checked=i===t}),this.sortItems=r,this.dispatchEvent(new CustomEvent("filter",s))}onDeleteFile(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("deleteFile",t))}onDeleteFolder(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("deleteFolder",t))}dragStart(e,t){e.dataTransfer.setData("fileId",t)}dragOver(e,t){e.dataTransfer.setData("folderId",t),e.preventDefault()}onFreeImages(){this.freeImages=!0,c("freeImages"),s.e(767).then(s.bind(s,70767))}onScroll(e){const t=e.target;if(t.scrollTop+t.offsetHeight>=t.scrollHeight-50){const e={detail:{folderId:this.folderId,page:this.page},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("loadMore",e))}}connectedCallback(){super.connectedCallback(),s.e(5156).then(s.bind(s,85156));"freeImages"===function(){try{return localStorage.getItem("creaditor-gallery-folder")}catch(e){return console.warn("Could not read from localStorage:",e),null}}()&&(this.freeImages=!0,s.e(767).then(s.bind(s,70767)))}render(){Array.isArray(this.files)||(this.files=[]),Array.isArray(this.folders)||(this.folders=[]);const e=this.folders.filter(e=>"public"!==e.visibility),t=this.folders.filter(e=>"public"===e.visibility);return i.qy` <cdtr-row>
|
|
150
152
|
<cdtr-col class="list" sm="3">
|
|
151
153
|
<cdtr-row alignItems="center" class="upload-container">
|
|
152
154
|
<paper-button @click=${this.onUpload} class="upload">
|
|
@@ -162,17 +164,17 @@
|
|
|
162
164
|
><lang-text text="favorites"></lang-text
|
|
163
165
|
></paper-item>
|
|
164
166
|
<paper-item @click=${this.onFreeImages}> <lang-text text="freeImages"></lang-text> </paper-item>
|
|
165
|
-
${Array.isArray(t)?t.map(e=>
|
|
167
|
+
${Array.isArray(t)?t.map(e=>i.qy`<paper-item
|
|
166
168
|
@click=${()=>this.onClickFolder(e,!1)}
|
|
167
169
|
><lang-text text="${e.name}"></lang-text
|
|
168
170
|
></paper-item>`):null}
|
|
169
171
|
</paper-listbox>
|
|
170
172
|
</cdtr-col>
|
|
171
|
-
${this.freeImages?
|
|
173
|
+
${this.freeImages?i.qy`<cdtr-col>
|
|
172
174
|
<cdtr-pexels-gallery
|
|
173
175
|
@file=${e=>this.onSelectPexelsImage(e.detail)}
|
|
174
176
|
></cdtr-pexels-gallery>
|
|
175
|
-
</cdtr-col>`:
|
|
177
|
+
</cdtr-col>`:i.qy`<cdtr-col>
|
|
176
178
|
<div class="gallery-container">
|
|
177
179
|
<cdtr-row alignItems="center">
|
|
178
180
|
<cdtr-input
|
|
@@ -193,7 +195,7 @@
|
|
|
193
195
|
></paper-button>
|
|
194
196
|
</cdtr-row>
|
|
195
197
|
<cdtr-row mt="1">
|
|
196
|
-
${this.folderName?
|
|
198
|
+
${this.folderName?i.qy`
|
|
197
199
|
<cdtr-title style="font-size:14px"
|
|
198
200
|
><lang-text text="main"></lang-text
|
|
199
201
|
></cdtr-title>
|
|
@@ -207,7 +209,7 @@
|
|
|
207
209
|
`:null}
|
|
208
210
|
</cdtr-row>
|
|
209
211
|
<cdtr-row mt="2" justify="space-between">
|
|
210
|
-
${this.filterItems[0].checked?
|
|
212
|
+
${this.filterItems[0].checked?i.qy` <cdtr-col sm="2">
|
|
211
213
|
<cdtr-row
|
|
212
214
|
spacing="2px"
|
|
213
215
|
class="scroll-body"
|
|
@@ -221,7 +223,7 @@
|
|
|
221
223
|
name=${o.M.get("lang","myImages")}
|
|
222
224
|
></cdtr-editor-media-card>
|
|
223
225
|
</cdtr-col>
|
|
224
|
-
${(0,a.u)(e||[],e=>e.id,(e,t)=>
|
|
226
|
+
${(0,a.u)(e||[],e=>e.id,(e,t)=>i.qy`<cdtr-col sm="12">
|
|
225
227
|
<cdtr-editor-media-card
|
|
226
228
|
@deleteFolder=${()=>this.onDeleteFolder(e)}
|
|
227
229
|
@deleteFile=${()=>this.onDeleteFile(e)}
|
|
@@ -237,19 +239,19 @@
|
|
|
237
239
|
</cdtr-col>`)}
|
|
238
240
|
</cdtr-row>
|
|
239
241
|
</cdtr-col>`:null}
|
|
240
|
-
${this.filterItems[1].checked?
|
|
242
|
+
${this.filterItems[1].checked?i.qy` <cdtr-col sm="10">
|
|
241
243
|
<cdtr-row
|
|
242
244
|
@scroll=${this.onScroll}
|
|
243
245
|
class="scroll-body"
|
|
244
246
|
justify="space-evenly"
|
|
245
247
|
>
|
|
246
|
-
${this.files&&0!==this.files.length||this.filterItems[0].checked?null:
|
|
248
|
+
${this.files&&0!==this.files.length||this.filterItems[0].checked?null:i.qy`<cdtr-empty-state
|
|
247
249
|
icon="image"
|
|
248
250
|
heading="noImagesYet"
|
|
249
251
|
description="uploadOrPickImages"
|
|
250
252
|
></cdtr-empty-state>`}
|
|
251
|
-
${(0,a.u)(this.files||[],e=>e.id,(e,t)=>
|
|
252
|
-
${e.moved?
|
|
253
|
+
${(0,a.u)(this.files||[],e=>e.id,(e,t)=>i.qy`<cdtr-col class="file-col" sm="3">
|
|
254
|
+
${e.moved?i.qy` <div class="moved"></div> `:null}
|
|
253
255
|
<cdtr-editor-media-card
|
|
254
256
|
@deleteFile=${()=>this.onDeleteFile(e)}
|
|
255
257
|
@deleteFolder=${()=>this.onDeleteFolder(e)}
|
|
@@ -306,7 +308,7 @@
|
|
|
306
308
|
</cdtr-row>
|
|
307
309
|
</form>
|
|
308
310
|
</paper-dialog>
|
|
309
|
-
</cdtr-row>`}}p.styles=d.T,p.properties={folders:{type:Array},files:{type:Array},pageCount:{type:Number},prevUrl:{type:String},nextUrl:{type:String},folderName:{type:String},filterItems:{type:Array},multi:{type:Boolean},controls:{type:Boolean},freeImages:{type:Boolean}},customElements.define("cdtr-gallery-files",p);class h extends
|
|
311
|
+
</cdtr-row>`}}p.styles=d.T,p.properties={folders:{type:Array},files:{type:Array},pageCount:{type:Number},prevUrl:{type:String},nextUrl:{type:String},folderName:{type:String},filterItems:{type:Array},multi:{type:Boolean},controls:{type:Boolean},freeImages:{type:Boolean}},customElements.define("cdtr-gallery-files",p);class h extends i.WF{constructor(){super(),this.uploads={}}connectedCallback(){super.connectedCallback(),this.addEventListener("upload-start",this.handleUploadStart.bind(this)),this.addEventListener("upload-progress",this.handleUploadProgress.bind(this)),this.addEventListener("upload-complete",this.handleUploadComplete.bind(this)),this.addEventListener("upload-error",this.handleUploadError.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("upload-start",this.handleUploadStart.bind(this)),this.removeEventListener("upload-progress",this.handleUploadProgress.bind(this)),this.removeEventListener("upload-complete",this.handleUploadComplete.bind(this)),this.removeEventListener("upload-error",this.handleUploadError.bind(this))}handleUploadStart(e){const{uploadId:t,fileName:s}=e.detail;this.uploads[t]={fileName:s,status:"uploading",progress:0,error:null},this.requestUpdate()}handleUploadProgress(e){const{uploadId:t,progress:s}=e.detail;this.uploads[t]&&(this.uploads[t].progress=s,this.requestUpdate())}handleUploadComplete(e){const{uploadId:t}=e.detail;this.uploads[t]&&(this.uploads[t].status="completed",this.uploads[t].progress=100,this.requestUpdate(),setTimeout(()=>{this.removeUpload(t)},3e3))}handleUploadError(e){const{uploadId:t,error:s}=e.detail;this.uploads[t]&&(this.uploads[t].status="error",this.uploads[t].error=s,this.requestUpdate(),setTimeout(()=>{this.removeUpload(t)},5e3))}removeUpload(e){delete this.uploads[e],this.requestUpdate()}getStatusIcon(e){switch(e){case"uploading":default:return i.qy`<div class="status-icon uploading"></div>`;case"completed":return i.qy`<div class="status-icon completed"></div>`;case"error":return i.qy`<div class="status-icon error"></div>`}}getProgressFillClass(e){switch(e){case"completed":return"progress-fill completed";case"error":return"progress-fill error";default:return"progress-fill"}}render(){const e=Object.entries(this.uploads).map(e=>{let[t,s]=e;return i.qy`
|
|
310
312
|
<div class="upload-item">
|
|
311
313
|
<div class="upload-header">
|
|
312
314
|
<span class="file-name" title="${s.fileName}">${s.fileName}</span>
|
|
@@ -331,22 +333,22 @@
|
|
|
331
333
|
${"uploading"===s.status?`${s.progress}%`:"completed"===s.status?"Upload completed":"error"===s.status?"Upload failed":""}
|
|
332
334
|
</div>
|
|
333
335
|
|
|
334
|
-
${s.error?
|
|
336
|
+
${s.error?i.qy`
|
|
335
337
|
<div class="error-message">
|
|
336
338
|
${s.error.message||s.error}
|
|
337
339
|
</div>
|
|
338
340
|
`:""}
|
|
339
341
|
</div>
|
|
340
|
-
`});return
|
|
342
|
+
`});return i.qy`
|
|
341
343
|
<div>
|
|
342
344
|
${e}
|
|
343
345
|
</div>
|
|
344
|
-
`}}h.styles=
|
|
346
|
+
`}}h.styles=i.AH`
|
|
345
347
|
:host {
|
|
346
348
|
display: block;
|
|
347
349
|
position: fixed;
|
|
348
350
|
top: 20px;
|
|
349
|
-
|
|
351
|
+
inset-inline-end: 20px;
|
|
350
352
|
z-index: 9999;
|
|
351
353
|
max-width: 300px;
|
|
352
354
|
}
|
|
@@ -447,7 +449,7 @@
|
|
|
447
449
|
.progress-text {
|
|
448
450
|
font-size: 12px;
|
|
449
451
|
color: #666;
|
|
450
|
-
text-align:
|
|
452
|
+
text-align: end;
|
|
451
453
|
}
|
|
452
454
|
|
|
453
455
|
.error-message {
|
|
@@ -473,7 +475,7 @@
|
|
|
473
475
|
.close-btn:hover {
|
|
474
476
|
color: #666;
|
|
475
477
|
}
|
|
476
|
-
`,h.properties={uploads:{type:Object}},customElements.define("cdtr-upload-loading",h);s(2590);class u extends
|
|
478
|
+
`,h.properties={uploads:{type:Object}},customElements.define("cdtr-upload-loading",h);s(2590);class u extends i.WF{constructor(){super(),this.isVisible=!1,this.fileName="",this.status="uploading",this.progress=0,this.timeElapsed=0,this.pollInterval=null,this.timeoutId=null,this.progressInterval=null,this.startTime=null,this.maxDuration=3e4,this.pollFrequency=7e3}connectedCallback(){super.connectedCallback(),window.addEventListener("cdtr-upload-start",this.handleUploadStart.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.cleanup(),window.removeEventListener("cdtr-upload-start",this.handleUploadStart.bind(this))}handleUploadStart(e){console.log("Upload monitor received event:",e.detail);const{fileName:t,file:s}=e.detail;this.startUploadMonitor(t,s)}startUploadMonitor(e,t){console.log("Starting upload monitor for:",e),this.fileName=e,this.isVisible=!0,this.status="uploading",this.progress=0,this.timeElapsed=0,this.startTime=Date.now(),this.uploadedFile=t,console.log("Component should be visible now, isVisible:",this.isVisible),this.requestUpdate(),this.simulateUploadProgress(),setTimeout(()=>{this.status="checking",this.startPolling(),this.startTimeout()},this.pollFrequency)}simulateUploadProgress(){let e=0;this.progressInterval=setInterval(()=>{e+=15*Math.random(),e>=90&&(e=90,clearInterval(this.progressInterval),this.progressInterval=null),this.progress=Math.floor(e),this.requestUpdate()},300)}startPolling(){this.progress=100,this.status="completed",this.requestUpdate(),setTimeout(()=>{this.isVisible=!1,this.requestUpdate()},5e3)}startTimeout(){this.timeoutId=setTimeout(()=>{"completed"!==this.status&&this.handleTimeout()},this.maxDuration)}handleUploadSuccess(){this.cleanup(),this.status="completed",this.progress=100,this.requestUpdate(),setTimeout(()=>{this.isVisible=!1,this.requestUpdate()},2e3)}handleTimeout(){this.cleanup(),this.status="timeout",this.requestUpdate(),setTimeout(()=>{this.isVisible=!1,this.requestUpdate()},1e4)}cleanup(){this.pollInterval&&(clearInterval(this.pollInterval),this.pollInterval=null),this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.progressInterval&&(clearInterval(this.progressInterval),this.progressInterval=null)}getCircleProgress(){const e=2*Math.PI*26;return e-this.progress/100*e}renderContent(){switch(this.status){case"uploading":return i.qy`
|
|
477
479
|
<div class="progress-circle">
|
|
478
480
|
<svg class="progress-ring" width="60" height="60">
|
|
479
481
|
<circle class="progress-ring-bg" cx="30" cy="30" r="26"></circle>
|
|
@@ -491,31 +493,31 @@
|
|
|
491
493
|
<lang-text text="uploading"></lang-text>
|
|
492
494
|
</div>
|
|
493
495
|
<div class="file-name" title="${this.fileName}">${this.fileName}</div>
|
|
494
|
-
`;case"checking":return
|
|
496
|
+
`;case"checking":return i.qy`
|
|
495
497
|
<div class="spinner"></div>
|
|
496
498
|
<div class="status-text">
|
|
497
499
|
<lang-text text="verifying"></lang-text>
|
|
498
500
|
</div>
|
|
499
501
|
<div class="file-name" title="${this.fileName}">${this.fileName}</div>
|
|
500
|
-
`;case"completed":return
|
|
502
|
+
`;case"completed":return i.qy`
|
|
501
503
|
<div class="success-icon"></div>
|
|
502
504
|
<div class="status-text">
|
|
503
505
|
<lang-text text="completed"></lang-text>
|
|
504
506
|
</div>
|
|
505
507
|
<div class="file-name" title="${this.fileName}">${this.fileName}</div>
|
|
506
|
-
`;case"timeout":return
|
|
508
|
+
`;case"timeout":return i.qy`
|
|
507
509
|
<div class="error-icon"></div>
|
|
508
510
|
<div class="status-text"><lang-text text="timeout"></lang-text></div>
|
|
509
511
|
<div class="file-name" title="${this.fileName}">${this.fileName}</div>
|
|
510
512
|
<div style="font-size: 10px; color: #666; margin-top: 4px;">
|
|
511
513
|
File may be uploaded. Refresh gallery.
|
|
512
514
|
</div>
|
|
513
|
-
`;default:return
|
|
515
|
+
`;default:return i.qy``}}render(){return console.log("Render called - isVisible:",this.isVisible,"status:",this.status,"progress:",this.progress),this.isVisible?i.qy` <div class="upload-card">${this.renderContent()}</div> `:i.qy``}}u.styles=i.AH`
|
|
514
516
|
:host {
|
|
515
517
|
display: block;
|
|
516
518
|
position: fixed;
|
|
517
519
|
bottom: 20px;
|
|
518
|
-
|
|
520
|
+
inset-inline-start: 20px;
|
|
519
521
|
z-index: 10000;
|
|
520
522
|
}
|
|
521
523
|
|
|
@@ -575,7 +577,7 @@
|
|
|
575
577
|
.progress-text {
|
|
576
578
|
position: absolute;
|
|
577
579
|
top: 50%;
|
|
578
|
-
|
|
580
|
+
inset-inline-start: 50%;
|
|
579
581
|
transform: translate(-50%, -50%);
|
|
580
582
|
font-size: 14px;
|
|
581
583
|
font-weight: 600;
|
|
@@ -665,7 +667,7 @@
|
|
|
665
667
|
color: white;
|
|
666
668
|
font-weight: bold;
|
|
667
669
|
}
|
|
668
|
-
`,u.properties={isVisible:{type:Boolean},fileName:{type:String},status:{type:String},progress:{type:Number},timeElapsed:{type:Number}},customElements.define("cdtr-upload-progress-monitor",u);var
|
|
670
|
+
`,u.properties={isVisible:{type:Boolean},fileName:{type:String},status:{type:String},progress:{type:Number},timeElapsed:{type:Number}},customElements.define("cdtr-upload-progress-monitor",u);var m=s(18396),f=s(13681);const g={upload:"Upload Image",myImages:"My Images",favorites:"Favorites",freeImages:"Free images",search:"Search",newFolder:"New Folder",main:"Main",noImagesYet:"No images yet",uploadOrPickImages:"Upload an image or browse free stock.",choose:"Choose",addFolder:"Add folder",folderName:"Folder name","yes,Create":"Yes, Create",aToZ:"A-Z",zToA:"Z-A",folders:"Folders",images:"Images",savedSuccess:"Saved successfully",refresh:"Refresh",loading:"Loading…",loadingMore:"Loading more images...",uploading:"Uploading...",verifying:"Verifying...",completed:"Completed!",timeout:"Upload timeout"};let v=!1;class b extends i.WF{constructor(){super(),function(){if(v)return;v=!0;const e=o.M.get("lang")||{};Object.keys(g).some(t=>!(t in e))&&o.M.set({lang:{...g,...e}})}(),this.sortBy="ASC",this.files=[],this.folders=[],this.uploadStatus={},this.onSearch=this.onSearch.bind(this),this.close=this.close.bind(this),this.reset=this.reset.bind(this);const e=new m.A;this.eventEmitter=e,e.files=this.files,e.close=this.close;const t=this._manager||o.M.get("config","editor","configure","mediaGalleryManager");this._wireManager(t),this.reset()}get manager(){return this._manager}set manager(e){this._manager=e,this._wireManager(e),this.eventEmitter&&this.reset()}_wireManager(e){"function"==typeof e&&(this.eventEmitter.render=this.reset,console.log("init mediaGalleryManager"),e(this.eventEmitter))}get labels(){return this._labels}set labels(e){this._labels=e,e&&Object.keys(e).length>0&&o.M.set({lang:{...o.M.get("lang")||{},...e}})}reset(){this.dirId=null,this.eventEmitter.dispatch("load-folders",{resolve:e=>{this.folders=e}}),this.eventEmitter.dispatch("load-files",{resolve:e=>{this.files=Array.isArray(e)?[...e]:[]}})}uploadFile(e){this.folders||(this.folders=[]);const t=e.detail,s=this.folders.find(e=>e.selected),i=`${t.name}-${Date.now()}`;this.uploadStatus[i]={fileName:t.name,status:"uploading",progress:0,error:null},console.log("Dispatching cdtr-upload-start event for:",t.name),this.dispatchEvent(new CustomEvent("cdtr-upload-start",{detail:{uploadId:i,fileName:t.name,file:t},bubbles:!0,composed:!0})),console.log("Event dispatched"),this.eventEmitter.dispatch("upload-file",{file:t,dirId:s?s.id:null,uploadId:i,execCommand:(e,t)=>{const s=o.M.get("editor");s&&"function"==typeof s.store&&s.store().execCommand(e,t)},options:{},onProgress:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].progress=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("upload-progress",{detail:{uploadId:i,fileName:t.name,progress:e},bubbles:!0,composed:!0})))},onComplete:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="completed",this.uploadStatus[i].progress=100,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-complete",{detail:{uploadId:i,fileName:t.name,result:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},3e3))},onError:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="error",this.uploadStatus[i].error=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-error",{detail:{uploadId:i,fileName:t.name,error:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},5e3))}}),this.opened=!1}onSearch(e){const{value:t,isLiked:s}=e.detail;s?this.eventEmitter.dispatch("load-files",{isLiked:s,resolve:e=>{Array.isArray(e)?this.files=[...e]:console.error("files is not array",e)}}):t.trim().length>2?this.eventEmitter.dispatch("load-files",{filter:"name",search:t,resolve:e=>{this.files=Array.isArray(e)?[...e]:[]}}):0===t.trim().length&&this.reset()}onFilter(e){const t=e.detail;this.eventEmitter.dispatch("load-files",{filter:"name",search:t.value})}onSelectFolder(e){const t=e.detail,s=this.sortBy,i=t.id;this.dirId=i,this.eventEmitter.dispatch("load-files",{filter:"dir",dirId:i,sortBy:s,resolve:e=>{this.files=e}})}oncreateNewFolder(e){const t=e.detail;this.eventEmitter.dispatch("create-folder",{name:t,resolve:e=>{this.folders||(this.folders=[]);const t=[...this.folders];t.forEach(e=>e.selected=!1),e.selected=!0,t.unshift(e),this.folders=t,this.onSelectFolder({detail:e})}})}onMoveFile(e){const t=e.detail;this.eventEmitter.dispatch("on-move-file",{data:t,resolve:e=>{if(this.folders||(this.folders=[]),this.dirId===t.folderId)return;const s=this.files.findIndex(e=>e.id===t.fileId);if(-1!==s){const e=[...this.files];e[s].moved=!0,this.files=e}const i=this.folders.findIndex(e=>e.id===t.folderId);if(-1!==i){const e=[...this.folders];e[i].file_count+=1,this.folders=e}}})}onLike(e){const t=e.detail;this.eventEmitter.dispatch("on-like",{fileId:t.id,resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e[s].isLiked=!e[s].isLiked,this.files=e}}})}onselectFile(e){const t={detail:e.detail,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}close(){this.dispatchEvent(new CustomEvent("close",{}))}onDleteFile(e){const t=e.detail;this.eventEmitter.dispatch("delete-file",{id:t.id,type:"image",resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e.splice(s,1),this.files=e}}})}onLoadMore(){this.eventEmitter.dispatch("lazy-load-files-on-scroll",{resolve:e=>{if(Array.isArray(e)&&e.length>0){const t=[...this.files,...e];this.files=t}}})}onDeleteFolder(e){const t=e.detail;this.eventEmitter.dispatch("delete-folder",{id:t.id,resolve:e=>{this.folders||(this.folders=[]);const s=this.folders.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.folders];e.splice(s,1),this.folders=e}}})}connectedCallback(){super.connectedCallback(),f.vP.on("on:upload-file","gallery:on:upload-file",async e=>{let{image:t,type:s}=e;if("base64"===s){const e=t.split(",")[1]||t,s=atob(e),i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=s.charCodeAt(e);const r=new Uint8Array(i),o=new Blob([r],{type:"image/png"}),a=new File([o],"uploaded-image.png",{type:"image/png"});this.uploadFile({detail:a})}else if("url"===s){const e=await fetch(t),s=await e.blob(),i=new File([s],"uploaded-image.png",{type:s.type||"image/png"});this.uploadFile({detail:i})}})}render(){return i.qy`
|
|
669
671
|
<cdtr-upload-loading></cdtr-upload-loading>
|
|
670
672
|
<cdtr-upload-progress-monitor></cdtr-upload-progress-monitor>
|
|
671
673
|
<cdtr-drawer
|
|
@@ -693,9 +695,9 @@
|
|
|
693
695
|
.multi=${this.multi}
|
|
694
696
|
.folders=${this.folders}
|
|
695
697
|
></cdtr-gallery-files>
|
|
696
|
-
</cdtr-drawer>`}}
|
|
698
|
+
</cdtr-drawer>`}}b.styles=i.AH``,b.properties={folders:{type:Array},files:{type:Array},pageCount:{type:Number},prevUrl:{type:String},nextUrl:{type:String},opened:{type:Boolean},multi:{type:Boolean},uploadStatus:{type:Object}},customElements.define("cdtr-gallery",b)},2590(e,t,s){s.r(t),s.d(t,{TitleEditor:()=>o});var i=s(59929),r=s(86319);class o extends i.WF{constructor(){super(),this.text="",this.whiteSpace="pre"}connectedCallback(){super.connectedCallback(),this.style.fontFamily="var(--font-sans)",this.bold&&(this.style.fontWeight="bold"),this._onStoreChange=()=>this.requestUpdate(),r.M.connect(["lang","theme"],this._onStoreChange)}disconnectedCallback(){this._onStoreChange&&(r.M.disconnect(this._onStoreChange),this._onStoreChange=null),super.disconnectedCallback()}render(){const e=r.M.get("theme");e&&(this.style.direction=e.direction,this.style.textAlign=this.textAlign||e.textAlign);const t=r.M.get("lang",this.text);return i.qy`<slot
|
|
697
699
|
><span
|
|
698
700
|
style="-webkit-font-smoothing: antialiased;display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
|
|
699
701
|
>${t||this.text}</span
|
|
700
702
|
></slot
|
|
701
|
-
>`}}o.properties={text:{type:String,reflect:!1},whiteSpace:{type:String},textAlign:{type:String},bold:{type:Boolean}},customElements.get("lang-text")||customElements.define("lang-text",o)},13681(e,t,s){s.d(t,{vP:()=>c});const
|
|
703
|
+
>`}}o.properties={text:{type:String,reflect:!1},whiteSpace:{type:String},textAlign:{type:String},bold:{type:Boolean}},customElements.get("lang-text")||customElements.define("lang-text",o)},13681(e,t,s){s.d(t,{vP:()=>c});const i=window.cdtrSignalKey||`___${Math.random().toString(36).substr(2,9)}`;window.cdtrSignalKey=i,window[i]||(window[i]={});const r=window[i],o=window.__cdtrEvents||{};function a(e){return crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then(e=>Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join(""))}function l(e){if(e.length%2!=0)throw new Error("Invalid hex string");const t=new Uint8Array(e.length/2);for(let s=0;s<e.length;s+=2)t[s/2]=parseInt(e.substr(s,2),16);return t}async function n(e){const t=await a(e),s=r[t];if(s){const e=await crypto.subtle.importKey("raw",l(t),{name:"AES-GCM"},!1,["encrypt","decrypt"]),i=await async function(e,t,s){const i=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,s);return(new TextDecoder).decode(i)}(e,s.iv,s.encrypted);return JSON.parse(i)}return null}function d(e,t){if(o[e])for(const s in o[e])Object.prototype.hasOwnProperty.call(o[e],s)&&o[e][s].forEach(e=>e(t));Array.isArray(o["*"])&&o["*"].forEach(e=>e(t))}window.__cdtrEvents=o;const c={set:async function(e,t){const s=JSON.parse(JSON.stringify(t)),i=await a(e),n=await crypto.subtle.importKey("raw",l(i),{name:"AES-GCM"},!1,["encrypt","decrypt"]),c=await async function(e,t){const s=crypto.getRandomValues(new Uint8Array(12)),i=(new TextEncoder).encode(t),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},e,i);return{iv:s,encrypted:new Uint8Array(r)}}(n,JSON.stringify(s));r[i]=c,o.set&&o.set[i]&&o.set[i].forEach(e=>e(s)),Array.isArray(o["*"])&&o["*"].forEach(e=>e(s)),d(e,s)},get:n,remove:async function(e){const t=await a(e);delete r[t]},on:async function(e,t,s){o[e]||(o[e]={});const i=await a(t);o[e][i]||(o[e][i]=[]),o[e][i].push(e=>{!function(){const e=(new Error).stack;if(e&&e.indexOf(" at <anonymous>:1")>-1)throw console.warn("Function call blocked: Detected console execution."),new Error("Function call blocked: Detected console execution.")}(),s(e)});const r=await n(t);return r&&s(r),i},off:function(e,t){o[e]&&o[e][t]&&delete o[e][t]},dispatch:d,OPTIONS:{SET:"set"}}}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[767],{70767(e,t,r){r.r(t),r.d(t,{PexelsGallery:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[767],{70767(e,t,r){r.r(t),r.d(t,{PexelsGallery:()=>n});var a=r(59929),s=r(49549),o=r(93967),i=r(86959);function l(e){e||(e={query:"nature",per_page:1});const t=`${i.XW.agent_url}pexels/search/?query=${e.query||"marketing"}&per_page=${e.per_page||1}`;return fetch(t).then(e=>e.json()).then(e=>{if("success"===e.status&&e.data)return e.data.photos;throw new Error("Invalid response from backend")}).catch(e=>{throw console.error("Error fetching images:",e),e})}class n extends a.WF{constructor(){super(),this.images=[],this.loading=!1,this.searchQuery="",this.page=1,this.hasMore=!0,this.perPage=20,this.multi=!0,this.defaultSearchTerms=["nature","landscape","city","people","technology","food","architecture","travel","business","art"],this.cacheKey="pexels-gallery-cache",this.cacheExpiry=864e5,this.isTyping=!1,this.lastSearchQuery="",this.searchTimeout=null}connectedCallback(){super.connectedCallback(),this.loadFromCache()}getCacheData(){try{const e=localStorage.getItem(this.cacheKey);if(!e)return null;const t=JSON.parse(e),r=Date.now();return t.timestamp&&r-t.timestamp>this.cacheExpiry?(localStorage.removeItem(this.cacheKey),null):t}catch(e){return console.error("Error reading cache:",e),null}}saveToCache(){if(!this.isTyping)try{const e={images:this.images,searchQuery:this.searchQuery,page:this.page,hasMore:this.hasMore,timestamp:Date.now()};localStorage.setItem(this.cacheKey,JSON.stringify(e))}catch(e){console.error("Error saving to cache:",e)}}loadFromCache(){const e=this.getCacheData();e?(this.images=e.images||[],this.searchQuery=e.searchQuery||"",this.page=e.page||1,this.hasMore=void 0===e.hasMore||e.hasMore,console.log("Gallery state restored from cache"),this.requestUpdate(),this.updateComplete.then(()=>{this.updateSearchInput()})):this.loadRandomImages()}updateSearchInput(){const e=this.shadowRoot?.querySelector('cdtr-input[type="search"]');e&&(e.value=this.searchQuery)}async loadRandomImages(){this.loading=!0;try{const e=this.defaultSearchTerms[Math.floor(Math.random()*this.defaultSearchTerms.length)],t=await l({query:e,per_page:this.perPage});t?(this.images=t||[],this.hasMore=t&&t.length===this.perPage,this.searchQuery="",this.page=1,this.saveToCache()):(console.error("Failed to load images from Pexels"),this.images=[])}catch(e){console.error("Error loading images:",e),this.images=[]}finally{this.loading=!1}}async searchImages(e){if(!e.trim())return this.loadRandomImages();this.loading=!0,this.searchQuery=e,this.page=1;try{const t=await l({query:e,per_page:this.perPage});t?(this.images=t||[],this.hasMore=t&&t.length===this.perPage,this.saveToCache()):(console.error("Failed to search images from Pexels"),this.images=[])}catch(e){console.error("Error searching images:",e),this.images=[]}finally{this.loading=!1}}async loadMoreImages(){if(!this.loading&&this.hasMore){this.loading=!0,this.page++;try{const e=this.searchQuery||this.defaultSearchTerms[Math.floor(Math.random()*this.defaultSearchTerms.length)],t=await l({query:e,per_page:this.perPage});if(t.ok){const e=(await t.json()).photos||[];this.images=[...this.images,...e],this.hasMore=e.length===this.perPage,this.saveToCache()}}catch(e){console.error("Error loading more images:",e)}finally{this.loading=!1}}}onSearch(e){const t=e.target.value;this.isTyping=!0,t!==this.lastSearchQuery&&(this.lastSearchQuery=t,this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.isTyping=!1,this.searchImages(t)},500))}onSelectImage(e){const t=`Photo by ${e.photographer} on Pexels`,r=`Photo by <a href="${e.photographer_url}" target="_blank" rel="noopener noreferrer">${e.photographer}</a> on <a href="${e.url}" target="_blank" rel="noopener noreferrer">Pexels</a>`,a={detail:{id:e.id,src:e.src.medium||e.src.large||e.src.original,name:`Pexels Image ${e.id}`,size:`${e.width}x${e.height}`,photographer:e.photographer,photographerUrl:e.photographer_url,pexelsUrl:e.url,alt:e.alt||`Photo by ${e.photographer} on Pexels`,attributionText:t,attributionHtml:r},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",a))}sendSelectedImages(){const e={detail:this.images.filter(e=>e.selected).map(e=>{const t=`Photo by ${e.photographer} on Pexels`,r=`Photo by <a href="${e.photographer_url}" target="_blank" rel="noopener noreferrer">${e.photographer}</a> on <a href="${e.url}" target="_blank" rel="noopener noreferrer">Pexels</a>`;return{id:e.id,src:e.src.medium||e.src.large||e.src.original,name:`Pexels Image ${e.id}`,size:`${e.width}x${e.height}`,photographer:e.photographer,photographerUrl:e.photographer_url,pexelsUrl:e.url,alt:e.alt||`Photo by ${e.photographer} on Pexels`,attributionText:t,attributionHtml:r}}),bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",e))}onScroll(e){const t=e.target;t.scrollTop+t.offsetHeight>=t.scrollHeight-50&&this.loadMoreImages()}clearCache(){localStorage.removeItem(this.cacheKey),console.log("Gallery cache cleared")}render(){return a.qy`
|
|
2
2
|
<div class="gallery-container">
|
|
3
3
|
<cdtr-row alignItems="center">
|
|
4
4
|
<cdtr-input
|
|
@@ -10,48 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
<div class="divider-y"></div>
|
|
12
12
|
|
|
13
|
-
<!-- Color Filter Dropdown -->
|
|
14
|
-
<div class="color-dropdown">
|
|
15
|
-
<cdtr-dropdown
|
|
16
|
-
.value=${this.selectedColor||""}
|
|
17
|
-
@change=${this.onColorChange}
|
|
18
|
-
>
|
|
19
|
-
<paper-button slot="trigger">
|
|
20
|
-
<div
|
|
21
|
-
class="color-preview"
|
|
22
|
-
style="background-color: ${this.getSelectedColorHex()}"
|
|
23
|
-
></div>
|
|
24
|
-
</paper-button>
|
|
25
|
-
<div slot="content">
|
|
26
|
-
<cdtr-dropdown-item
|
|
27
|
-
value="all"
|
|
28
|
-
.selected=${!this.selectedColor}
|
|
29
|
-
>
|
|
30
|
-
<div
|
|
31
|
-
class="color-circle"
|
|
32
|
-
style="background-color: transparent; border: 2px dashed #ccc;"
|
|
33
|
-
></div>
|
|
34
|
-
<span style="margin-left: 8px; font-size: 12px;">All Colors</span>
|
|
35
|
-
</cdtr-dropdown-item>
|
|
36
|
-
${this.colorOptions.map(e=>o.qy`
|
|
37
|
-
<cdtr-dropdown-item
|
|
38
|
-
value="${e.value}"
|
|
39
|
-
.selected=${this.selectedColor===e.value}
|
|
40
|
-
>
|
|
41
|
-
<div
|
|
42
|
-
class="color-circle"
|
|
43
|
-
style="background-color: ${e.hex}"
|
|
44
|
-
></div>
|
|
45
|
-
<span style="margin-left: 8px; font-size: 12px;">${e.name}</span>
|
|
46
|
-
</cdtr-dropdown-item>
|
|
47
|
-
`)}
|
|
48
|
-
</div>
|
|
49
|
-
</cdtr-dropdown>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
13
|
<paper-button @click=${this.loadRandomImages} class="icon-btn">
|
|
53
14
|
<cdtr-tooltip delay="500,0" arrow=${!1} content="refresh">
|
|
54
|
-
|
|
15
|
+
<!-- cdtr-refresh-icon has no definition anywhere in this
|
|
16
|
+
codebase — a plain inline SVG in its place. -->
|
|
17
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
18
|
+
<path d="M21 12a9 9 0 1 1-2.64-6.36" />
|
|
19
|
+
<path d="M21 3v6h-6" />
|
|
20
|
+
</svg>
|
|
55
21
|
</cdtr-tooltip>
|
|
56
22
|
</paper-button>
|
|
57
23
|
</cdtr-row>
|
|
@@ -82,12 +48,12 @@
|
|
|
82
48
|
class="scroll-body"
|
|
83
49
|
justify="space-evenly"
|
|
84
50
|
>
|
|
85
|
-
${this.loading&&0===this.images.length?
|
|
51
|
+
${this.loading&&0===this.images.length?a.qy`<cdtr-col sm="12">
|
|
86
52
|
<cdtr-row justify="center">
|
|
87
|
-
<
|
|
53
|
+
<div class="fallback-spinner"></div>
|
|
88
54
|
<lang-text text="loading"></lang-text>
|
|
89
55
|
</cdtr-row>
|
|
90
|
-
</cdtr-col>`:(0,
|
|
56
|
+
</cdtr-col>`:(0,s.u)(this.images||[],e=>e.id,(e,t)=>a.qy`<cdtr-col class="file-col" sm="3">
|
|
91
57
|
<cdtr-editor-media-card
|
|
92
58
|
@dblclick=${()=>this.onSelectImage(e)}
|
|
93
59
|
@click=${t=>{t.shiftKey&&this.multi||this.images.forEach(e=>e.selected=!1),e.selected=!e.selected,this.images=[...this.images],this.isTyping||this.saveToCache()}}
|
|
@@ -118,9 +84,9 @@
|
|
|
118
84
|
</div>
|
|
119
85
|
</cdtr-editor-media-card>
|
|
120
86
|
</cdtr-col>`)}
|
|
121
|
-
${this.loading&&this.images.length>0?
|
|
87
|
+
${this.loading&&this.images.length>0?a.qy`<cdtr-col sm="12">
|
|
122
88
|
<cdtr-row justify="center">
|
|
123
|
-
<
|
|
89
|
+
<div class="fallback-spinner"></div>
|
|
124
90
|
<lang-text text="loadingMore"></lang-text>
|
|
125
91
|
</cdtr-row>
|
|
126
92
|
</cdtr-col>`:null}
|
|
@@ -134,38 +100,28 @@
|
|
|
134
100
|
</paper-button>
|
|
135
101
|
</cdtr-row>
|
|
136
102
|
</div>
|
|
137
|
-
`}}
|
|
103
|
+
`}}n.styles=[o.T,a.AH`
|
|
138
104
|
:host {
|
|
139
105
|
--alpha: rgba(0, 123, 255, 0.1);
|
|
140
106
|
--primary: #007bff;
|
|
141
107
|
}
|
|
142
108
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
width: 20px;
|
|
149
|
-
height: 20px;
|
|
109
|
+
/* cdtr-spinner has no definition anywhere in this codebase — a plain
|
|
110
|
+
CSS spinner in its place, scoped to this component only. */
|
|
111
|
+
.fallback-spinner {
|
|
112
|
+
width: 18px;
|
|
113
|
+
height: 18px;
|
|
150
114
|
border-radius: 50%;
|
|
151
|
-
border: 2px solid
|
|
152
|
-
|
|
153
|
-
|
|
115
|
+
border: 2px solid var(--alpha);
|
|
116
|
+
border-top-color: var(--primary);
|
|
117
|
+
animation: cdtr-fallback-spin 0.7s linear infinite;
|
|
154
118
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
border-radius: 50%;
|
|
160
|
-
border: 2px solid white;
|
|
161
|
-
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
162
|
-
display: inline-block;
|
|
119
|
+
@keyframes cdtr-fallback-spin {
|
|
120
|
+
to {
|
|
121
|
+
transform: rotate(360deg);
|
|
122
|
+
}
|
|
163
123
|
}
|
|
164
124
|
|
|
165
|
-
.clear-color {
|
|
166
|
-
color: #666;
|
|
167
|
-
font-style: italic;
|
|
168
|
-
}
|
|
169
125
|
.pexels-credit {
|
|
170
126
|
position: absolute;
|
|
171
127
|
bottom: 5px;
|
|
@@ -271,4 +227,4 @@
|
|
|
271
227
|
.pexels-header-link:hover {
|
|
272
228
|
color: #2563eb;
|
|
273
229
|
}
|
|
274
|
-
`],
|
|
230
|
+
`],n.properties={images:{type:Array},loading:{type:Boolean},searchQuery:{type:String},page:{type:Number},hasMore:{type:Boolean},multi:{type:Boolean}},customElements.define("cdtr-pexels-gallery",n)}}]);
|
|
Binary file
|
|
@@ -1267,4 +1267,4 @@
|
|
|
1267
1267
|
background: rgba(16, 24, 40, 0.055) !important;
|
|
1268
1268
|
color: #14171f;
|
|
1269
1269
|
}
|
|
1270
|
-
`,customElements.define("cdtr-font-family-editor",n)},13681(t,e,a){a.d(e,{vP:()=>d});const r=window.cdtrSignalKey||`___${Math.random().toString(36).substr(2,9)}`;window.cdtrSignalKey=r,window[r]||(window[r]={});const o=window[r],i=window.__cdtrEvents||{};function s(t){return crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then(t=>Array.from(new Uint8Array(t)).map(t=>t.toString(16).padStart(2,"0")).join(""))}function n(t){if(t.length%2!=0)throw new Error("Invalid hex string");const e=new Uint8Array(t.length/2);for(let a=0;a<t.length;a+=2)e[a/2]=parseInt(t.substr(a,2),16);return e}async function l(t){const e=await s(t),a=o[e];if(a){const t=await crypto.subtle.importKey("raw",n(e),{name:"AES-GCM"},!1,["encrypt","decrypt"]),r=await async function(t,e,a){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,a);return(new TextDecoder).decode(r)}(t,a.iv,a.encrypted);return JSON.parse(r)}return null}function c(t,e){if(i[t])for(const a in i[t])Object.prototype.hasOwnProperty.call(i[t],a)&&i[t][a].forEach(t=>t(e));Array.isArray(i["*"])&&i["*"].forEach(t=>t(e))}window.__cdtrEvents=i;const d={set:async function(t,e){const a=JSON.parse(JSON.stringify(e)),r=await s(t),l=await crypto.subtle.importKey("raw",n(r),{name:"AES-GCM"},!1,["encrypt","decrypt"]),d=await async function(t,e){const a=crypto.getRandomValues(new Uint8Array(12)),r=(new TextEncoder).encode(e),o=await crypto.subtle.encrypt({name:"AES-GCM",iv:a},t,r);return{iv:a,encrypted:new Uint8Array(o)}}(l,JSON.stringify(a));o[r]=d,i.set&&i.set[r]&&i.set[r].forEach(t=>t(a)),Array.isArray(i["*"])&&i["*"].forEach(t=>t(a)),c(t,a)},get:l,remove:async function(t){const e=await s(t);delete o[e]},on:async function(t,e,a){i[t]||(i[t]={});const r=await s(e);i[t][r]||(i[t][r]=[]),i[t][r].push(t=>{!function(){const t=(new Error).stack;if(t&&t.indexOf(" at <anonymous>:1")>-1)throw console.warn("Function call blocked: Detected console execution."),new Error("Function call blocked: Detected console execution.")}(),a(t)});const o=await l(e);return o&&a(o),r},off:function(t,e){i[t]&&i[t][e]&&delete i[t][e]},dispatch:c,OPTIONS:{SET:"set"}}},88385(t,e,a){a.d(e,{A:()=>n});const r=t=>!(!t||!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)),o=t=>!(!t||!t.replace("-","").match(/^[+]*[(]{0,1}[0-9]{9,9}[)]{0,1}[-\s\./0-9]*$/g)&&!t.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/));function i(t){const e={},a=/([^&=]+)=?([^&]*)/g,r=t=>{try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ")}},o=t.indexOf("?");let i,s=-1!==o?t.substring(o+1):"";for(;null!==(i=a.exec(s));){const t=r(i[1]),a=r(i[2]);t&&(e[t]=a)}return e}function s(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],encodeURIComponent(e).replace(/%24/g,"$")}class n{static getProtocol(t){if(!t)return"";const e=t.indexOf(":");return e>0?t.slice(0,e):""}constructor(t,e){if(this.protocol="",this.href="",this.fullHref="",this.target="_self",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.url="",this.isValid=!0,this.params={},"string"==typeof t?this.href=t:t&&"object"==typeof t&&Object.assign(this,t),/^\[\[[^\]]+\]\]
|
|
1270
|
+
`,customElements.define("cdtr-font-family-editor",n)},13681(t,e,a){a.d(e,{vP:()=>d});const r=window.cdtrSignalKey||`___${Math.random().toString(36).substr(2,9)}`;window.cdtrSignalKey=r,window[r]||(window[r]={});const o=window[r],i=window.__cdtrEvents||{};function s(t){return crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then(t=>Array.from(new Uint8Array(t)).map(t=>t.toString(16).padStart(2,"0")).join(""))}function n(t){if(t.length%2!=0)throw new Error("Invalid hex string");const e=new Uint8Array(t.length/2);for(let a=0;a<t.length;a+=2)e[a/2]=parseInt(t.substr(a,2),16);return e}async function l(t){const e=await s(t),a=o[e];if(a){const t=await crypto.subtle.importKey("raw",n(e),{name:"AES-GCM"},!1,["encrypt","decrypt"]),r=await async function(t,e,a){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,a);return(new TextDecoder).decode(r)}(t,a.iv,a.encrypted);return JSON.parse(r)}return null}function c(t,e){if(i[t])for(const a in i[t])Object.prototype.hasOwnProperty.call(i[t],a)&&i[t][a].forEach(t=>t(e));Array.isArray(i["*"])&&i["*"].forEach(t=>t(e))}window.__cdtrEvents=i;const d={set:async function(t,e){const a=JSON.parse(JSON.stringify(e)),r=await s(t),l=await crypto.subtle.importKey("raw",n(r),{name:"AES-GCM"},!1,["encrypt","decrypt"]),d=await async function(t,e){const a=crypto.getRandomValues(new Uint8Array(12)),r=(new TextEncoder).encode(e),o=await crypto.subtle.encrypt({name:"AES-GCM",iv:a},t,r);return{iv:a,encrypted:new Uint8Array(o)}}(l,JSON.stringify(a));o[r]=d,i.set&&i.set[r]&&i.set[r].forEach(t=>t(a)),Array.isArray(i["*"])&&i["*"].forEach(t=>t(a)),c(t,a)},get:l,remove:async function(t){const e=await s(t);delete o[e]},on:async function(t,e,a){i[t]||(i[t]={});const r=await s(e);i[t][r]||(i[t][r]=[]),i[t][r].push(t=>{!function(){const t=(new Error).stack;if(t&&t.indexOf(" at <anonymous>:1")>-1)throw console.warn("Function call blocked: Detected console execution."),new Error("Function call blocked: Detected console execution.")}(),a(t)});const o=await l(e);return o&&a(o),r},off:function(t,e){i[t]&&i[t][e]&&delete i[t][e]},dispatch:c,OPTIONS:{SET:"set"}}},88385(t,e,a){a.d(e,{A:()=>n});const r=t=>!(!t||!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)),o=t=>!(!t||!t.replace("-","").match(/^[+]*[(]{0,1}[0-9]{9,9}[)]{0,1}[-\s\./0-9]*$/g)&&!t.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/));function i(t){const e={},a=/([^&=]+)=?([^&]*)/g,r=t=>{try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ")}},o=t.indexOf("?");let i,s=-1!==o?t.substring(o+1):"";for(;null!==(i=a.exec(s));){const t=r(i[1]),a=r(i[2]);t&&(e[t]=a)}return e}function s(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],encodeURIComponent(e).replace(/%24/g,"$")}class n{static getProtocol(t){if(!t)return"";const e=t.indexOf(":");return e>0?t.slice(0,e):""}constructor(t,e){if(this.protocol="",this.href="",this.fullHref="",this.target="_self",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.url="",this.isValid=!0,this.params={},"string"==typeof t?this.href=t:t&&"object"==typeof t&&Object.assign(this,t),/^\[\[[^\]]+\]\](?:\?|$)/.test(this.href)){const t=this.href;this.isValid=!1,this.protocol=e?.protocol??"",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.params={...this.params,...e?.params,...i(t)};const a=t.indexOf("?");return this.url=a>-1?t.slice(0,a):t,this.href=t,void(this.fullHref=t)}this.isValid=this.isValidUrl(this.href),this.protocol=e?.protocol||this.protocol||n.getProtocol(this.href);const a=function(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],e}(this.href);if(this.isEmail=r(a),this.isPhone=o(a),this.protocol||(this.isEmail?this.protocol="mailto:":this.isPhone?this.protocol="tel:":this.isValid&&(this.protocol="https:")),this.isAnchor=this.href.startsWith("#"),e?.target){if(!["_blank","_self","_parent","_top"].includes(e.target))throw new Error(`Url: invalid target "${e.target}"`);this.target=e.target}this.params={...this.params,...e?.params,...i(this.href)},this.url=s(this.href),this.protocol&&!this.protocol.endsWith(":")&&(this.protocol+=":");const l="http:"===this.protocol||"https:"===this.protocol;this.href=l?`${this.protocol}//${this.url}`:this.protocol+this.url,this.fullHref=this.getUrlWithParams(),this.href=this.getUrlWithParams(),this.isAnchor="anchor:"===this.protocol||this.href.startsWith("#")}addParam(t,e){this.params[t]=e,this.href=this.getUrlWithParams()}getUrlWithParams(){let t,e="";try{t=decodeURIComponent(this.url)}catch(e){t=this.url}if(Object.keys(this.params).length>0){t+="?",e="?";for(const a in this.params){const r=this.params[a],o=encodeURIComponent(a).replace(/%24/g,"$");if(r){const a=encodeURIComponent(r).replace(/%24/g,"$");t+=`${o}=${a}&`,e+=`${o}=${a}&`}else t+=`${o}&`,e+=`${o}&`}t=t.slice(0,-1)}const a=t=>{try{return decodeURIComponent(t)}catch{return t}};if(this.protocol&&("http:"===this.protocol||"https:"===this.protocol))return a(this.protocol+"//"+t);if(this.isAnchor||"anchor:"===this.protocol)return t?a(t.startsWith("#")?t:`#${t}`):"";if("whatsapp:"===this.protocol){const r=this.extractPhoneFromTextUsingRegex(t);return r.length>0?a("https://wa.me/"+r[0]+e):a("https://wa.me/"+e)}return a(this.protocol+t)}extractPhoneFromTextUsingRegex(t){if(!t)return[];const e=[...t.matchAll(/(?:whatsapp:([^?\s]+)|\+?[\d\s\-\(\)\.]{7,20})/g)];return Array.from(new Set(e.map(t=>t[1]||t[0]).filter(t=>{const e=t.replace(/\D/g,"");return e.length>=7&&e.length<=15}).map(t=>t.trim())))}isValidUrl(t){if(!t)return!1;return/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(t)}}n.resetURL=s}}]);
|
|
Binary file
|