@creaditor/web-starterkit 1.0.39 → 1.0.41
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 +19 -19
- 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 +554 -224
- 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 +2 -2
- package/dist/1260.creaditor.bundle.js +0 -459
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1393.creaditor.bundle.js +0 -1
- package/dist/1393.creaditor.bundle.js.gz +0 -0
- package/dist/1452.creaditor.bundle.js +0 -23
- package/dist/1452.creaditor.bundle.js.gz +0 -0
- package/dist/1565.creaditor.bundle.js +0 -1216
- package/dist/1565.creaditor.bundle.js.gz +0 -0
- package/dist/1756.creaditor.bundle.js +0 -1
- package/dist/1756.creaditor.bundle.js.gz +0 -0
- package/dist/1936.creaditor.bundle.js +0 -177
- package/dist/1936.creaditor.bundle.js.LICENSE.txt +0 -29
- package/dist/1936.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/1936.creaditor.bundle.js.gz +0 -0
- package/dist/2438.creaditor.bundle.js +0 -67
- package/dist/2438.creaditor.bundle.js.gz +0 -0
- package/dist/2834.creaditor.bundle.js +0 -14
- package/dist/2834.creaditor.bundle.js.LICENSE.txt +0 -5
- package/dist/2834.creaditor.bundle.js.gz +0 -0
- package/dist/307.creaditor.bundle.js +0 -23
- package/dist/307.creaditor.bundle.js.gz +0 -0
- package/dist/3095.creaditor.bundle.js +0 -194
- package/dist/3095.creaditor.bundle.js.gz +0 -0
- package/dist/365.creaditor.bundle.js +0 -26
- package/dist/365.creaditor.bundle.js.gz +0 -0
- package/dist/3778.creaditor.bundle.js +0 -1
- package/dist/3778.creaditor.bundle.js.gz +0 -0
- package/dist/3932.creaditor.bundle.js +0 -30
- package/dist/3932.creaditor.bundle.js.gz +0 -0
- package/dist/4217.creaditor.bundle.js +0 -105
- package/dist/4217.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js.LICENSE.txt +0 -5
- package/dist/4569.creaditor.bundle.js +0 -887
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4739.creaditor.bundle.js +0 -1
- package/dist/4739.creaditor.bundle.js.gz +0 -0
- package/dist/4970.creaditor.bundle.js +0 -1316
- package/dist/4970.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +0 -157
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/5428.creaditor.bundle.js +0 -23
- package/dist/5428.creaditor.bundle.js.gz +0 -0
- package/dist/5813.creaditor.bundle.js +0 -613
- package/dist/5813.creaditor.bundle.js.LICENSE.txt +0 -10
- package/dist/5813.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/5813.creaditor.bundle.js.gz +0 -0
- package/dist/6151.creaditor.bundle.js +0 -1
- package/dist/6151.creaditor.bundle.js.gz +0 -0
- package/dist/6459.creaditor.bundle.js +0 -23
- package/dist/6459.creaditor.bundle.js.gz +0 -0
- package/dist/6713.creaditor.bundle.js +0 -151
- package/dist/6713.creaditor.bundle.js.gz +0 -0
- package/dist/763.creaditor.bundle.js +0 -1
- package/dist/763.creaditor.bundle.js.gz +0 -0
- package/dist/7759.creaditor.bundle.js +0 -25
- package/dist/7759.creaditor.bundle.js.gz +0 -0
- package/dist/8141.creaditor.bundle.js.LICENSE.txt +0 -5
- package/dist/8303.creaditor.bundle.js +0 -57
- package/dist/8303.creaditor.bundle.js.LICENSE.txt +0 -10
- package/dist/8303.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/8303.creaditor.bundle.js.gz +0 -0
- package/dist/8305.creaditor.bundle.js +0 -32
- package/dist/8305.creaditor.bundle.js.gz +0 -0
- package/dist/8386.creaditor.bundle.js +0 -1420
- package/dist/8386.creaditor.bundle.js.gz +0 -0
- package/dist/84702e107adede1a967468c78921d455.mp4 +0 -0
- package/dist/8478.creaditor.bundle.js +0 -1
- package/dist/8478.creaditor.bundle.js.gz +0 -0
- package/dist/8676.creaditor.bundle.js +0 -24
- package/dist/8676.creaditor.bundle.js.gz +0 -0
- package/dist/88.creaditor.bundle.js +0 -1
- package/dist/88.creaditor.bundle.js.gz +0 -0
- package/dist/8876.creaditor.bundle.js +0 -25
- package/dist/8876.creaditor.bundle.js.LICENSE.txt +0 -32
- package/dist/8876.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/8876.creaditor.bundle.js.gz +0 -0
- package/dist/9089.creaditor.bundle.js +0 -21
- package/dist/9089.creaditor.bundle.js.gz +0 -0
- package/dist/9162.creaditor.bundle.js +0 -24
- package/dist/9162.creaditor.bundle.js.gz +0 -0
- package/dist/9184.creaditor.bundle.js +0 -23
- package/dist/9184.creaditor.bundle.js.gz +0 -0
- package/dist/9193.creaditor.bundle.js +0 -1
- package/dist/9193.creaditor.bundle.js.gz +0 -0
- package/dist/9338.creaditor.bundle.js +0 -1
- package/dist/9338.creaditor.bundle.js.gz +0 -0
- package/dist/951.creaditor.bundle.js +0 -1
- package/dist/951.creaditor.bundle.js.gz +0 -0
|
@@ -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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8646],{48646(e,t,
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8646],{48646(e,t,o){o.r(t),o.d(t,{Drawer:()=>r});var i=o(59929),s=o(69600);class r extends i.WF{constructor(){super(),this.closeEvent=void 0,this.openEvent=void 0,this.backdropColor="transparent",this.width="600px",this.obKeyDown=this.obKeyDown.bind(this),this.closeEvent=new UIEvent("close",{view:window,bubbles:!0,cancelable:!0}),this.openEvent=new UIEvent("open",{view:window,bubbles:!0,cancelable:!0})}onClickOutside(e){let{target:t}=e;t.closest(".drawer")||t.closest("cdtr-drawer")||this.onClose()}onClose(){const e=this.shadowRoot.querySelector(".drawer");e&&e.classList.add("slide-out"),setTimeout(()=>{this.dispatchEvent(this.closeEvent),e&&e.classList.remove("slide-out"),this.opened=!1,this.requestUpdate()},200)}obKeyDown(e){"Escape"===e.key?this.onClose():"m"===e.key&&e.ctrlKey&&this.dispatchEvent(this.openEvent)}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.obKeyDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.obKeyDown)}render(){return this.style.zIndex=(0,s.A)(),this.opened?i.qy`<div
|
|
2
2
|
@dragover=${e=>{e.preventDefault(),this.onClose()}}
|
|
3
3
|
@mousedown=${this.onClickOutside}
|
|
4
4
|
.style="background:${this.backdropColor};z-index:${(0,s.A)()};${this.backdropStyle};"
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
class="drawer" role="navigation"
|
|
11
11
|
>
|
|
12
12
|
<div class="header">
|
|
13
|
-
<
|
|
13
|
+
<button
|
|
14
|
+
class="close-button"
|
|
14
15
|
@click=${this.onClose}
|
|
15
|
-
style="padding:0;z-index:3;min-width:32px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:6px;margin-inline-start:8px;"
|
|
16
16
|
>
|
|
17
17
|
<cdtr-close-icon class="close-icon" icon="close">
|
|
18
18
|
</cdtr-close-icon>
|
|
19
|
-
</
|
|
19
|
+
</button>
|
|
20
20
|
<h1 class="header-text">
|
|
21
21
|
<lang-text text="${this.headerText}"></lang-text>
|
|
22
22
|
</h1>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<slot></slot>
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
|
-
</div>`:null}}
|
|
28
|
+
</div>`:null}}r.properties={portal:{type:Object},opened:{type:Boolean,reflect:!0},backdropColor:{type:String},width:{type:String},headerText:{type:String},backdropStyle:{},dim:{type:Boolean,reflect:!0}},r.styles=i.AH`
|
|
29
29
|
.backdrop {
|
|
30
30
|
width: 100vw;
|
|
31
31
|
height: 100vh;
|
|
@@ -42,42 +42,34 @@
|
|
|
42
42
|
font-size: var(--text-lg, 16px);
|
|
43
43
|
font-weight: 600;
|
|
44
44
|
font-family: var(--font-sans, -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif);
|
|
45
|
-
text-align: right;
|
|
46
|
-
display: block;
|
|
47
|
-
width: 95%;
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: 50%;
|
|
50
|
-
left: 0;
|
|
51
|
-
transform: translateY(-50%);
|
|
52
|
-
padding: 0 var(--space-4, 16px);
|
|
53
|
-
direction: var(--direction-locale);
|
|
54
|
-
box-sizing: border-box;
|
|
55
45
|
color: var(--color-text, #1a1a1f);
|
|
46
|
+
direction: var(--direction-locale, ltr);
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
white-space: nowrap;
|
|
56
50
|
}
|
|
57
51
|
.drawer {
|
|
58
|
-
width: ${500}px;
|
|
59
52
|
height: 100vh;
|
|
60
53
|
background: var(--color-bg, #fff);
|
|
61
54
|
position: absolute;
|
|
62
55
|
right: 0;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
animation: slide-in 0.5s forwards;
|
|
56
|
+
border-left: 1px solid var(--color-border, #e8e8ec);
|
|
57
|
+
transition: width var(--duration-normal, 200ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
|
|
58
|
+
box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04));
|
|
59
|
+
animation: slide-in var(--duration-normal, 200ms) var(--ease-out, cubic-bezier(0, 0, 0.2, 1)) forwards;
|
|
68
60
|
}
|
|
69
61
|
.slide-out {
|
|
70
|
-
|
|
71
|
-
-webkit-animation-delay: 2s;
|
|
72
|
-
animation: slide-out 0.5s forwards;
|
|
62
|
+
animation: slide-out 160ms var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1)) forwards;
|
|
73
63
|
}
|
|
74
64
|
.header {
|
|
75
65
|
height: 48px;
|
|
76
66
|
width: 100%;
|
|
67
|
+
padding: 0 var(--space-4, 16px);
|
|
77
68
|
border-bottom: 1px solid var(--color-border, #e8e8ec);
|
|
78
69
|
display: flex;
|
|
79
70
|
align-items: center;
|
|
80
|
-
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
gap: var(--space-2, 8px);
|
|
81
73
|
box-sizing: border-box;
|
|
82
74
|
}
|
|
83
75
|
.body {
|
|
@@ -87,33 +79,40 @@
|
|
|
87
79
|
}
|
|
88
80
|
.close-button {
|
|
89
81
|
cursor: pointer;
|
|
82
|
+
flex: 0 0 auto;
|
|
83
|
+
width: 32px;
|
|
84
|
+
height: 32px;
|
|
85
|
+
border: 0;
|
|
86
|
+
padding: 0;
|
|
87
|
+
border-radius: var(--radius-sm, 6px);
|
|
88
|
+
background: transparent;
|
|
89
|
+
color: var(--color-text-muted, #888888);
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
transition: background var(--duration-fast, 120ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
|
|
90
94
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
transform: rotate(180deg);
|
|
94
|
-
}
|
|
95
|
+
.close-button:hover {
|
|
96
|
+
background: var(--color-bg-muted, #f4f4f6);
|
|
95
97
|
}
|
|
96
98
|
@keyframes slide-in {
|
|
97
99
|
0% {
|
|
98
100
|
opacity: 0;
|
|
99
|
-
right:
|
|
101
|
+
right: -100%;
|
|
100
102
|
}
|
|
101
103
|
100% {
|
|
104
|
+
opacity: 1;
|
|
102
105
|
right: 0;
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
|
-
@-webkit-keyframes slide-out {
|
|
106
|
-
100% {
|
|
107
|
-
transform: rotate(180deg);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
108
|
@keyframes slide-out {
|
|
111
109
|
0% {
|
|
112
110
|
opacity: 1;
|
|
113
111
|
right: 0;
|
|
114
112
|
}
|
|
115
113
|
100% {
|
|
116
|
-
|
|
114
|
+
opacity: 0;
|
|
115
|
+
right: -100%;
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
|
-
`,customElements.define("cdtr-drawer",
|
|
118
|
+
`,customElements.define("cdtr-drawer",r)}}]);
|
|
Binary file
|