@creaditor/web-starterkit 1.0.63 → 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/112.creaditor.bundle.js.gz +0 -0
- package/dist/1142.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1317.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/1317.creaditor.bundle.js.gz +0 -0
- package/dist/1334.creaditor.bundle.js.gz +0 -0
- package/dist/1396.creaditor.bundle.js.gz +0 -0
- package/dist/1403.creaditor.bundle.js.gz +0 -0
- package/dist/1456.creaditor.bundle.js.gz +0 -0
- package/dist/1529.creaditor.bundle.js.gz +0 -0
- package/dist/168.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/168.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/175.creaditor.bundle.js.gz +0 -0
- package/dist/1972.creaditor.bundle.js.gz +0 -0
- package/dist/2001.creaditor.bundle.js +335 -0
- package/dist/2001.creaditor.bundle.js.LICENSE.txt +11 -0
- package/dist/{6442.creaditor.bundle.js.LICENSE.txt.gz → 2001.creaditor.bundle.js.LICENSE.txt.gz} +0 -0
- package/dist/2001.creaditor.bundle.js.gz +0 -0
- package/dist/211.creaditor.bundle.js.gz +0 -0
- package/dist/2112.creaditor.bundle.js.gz +0 -0
- package/dist/2154.creaditor.bundle.js.gz +0 -0
- package/dist/2234.creaditor.bundle.js.gz +0 -0
- package/dist/2298.creaditor.bundle.js.gz +0 -0
- package/dist/235.creaditor.bundle.js.gz +0 -0
- package/dist/2350.creaditor.bundle.js.gz +0 -0
- package/dist/2377.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/2397.creaditor.bundle.js.gz +0 -0
- package/dist/2409.creaditor.bundle.js.gz +0 -0
- package/dist/2547.creaditor.bundle.js.gz +0 -0
- package/dist/2550.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/2655.creaditor.bundle.js +16 -0
- package/dist/2655.creaditor.bundle.js.gz +0 -0
- package/dist/2706.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/2706.creaditor.bundle.js.gz +0 -0
- package/dist/271.creaditor.bundle.js.gz +0 -0
- package/dist/2717.creaditor.bundle.js.gz +0 -0
- package/dist/2765.creaditor.bundle.js.gz +0 -0
- package/dist/2773.creaditor.bundle.js.gz +0 -0
- package/dist/2833.creaditor.bundle.js.gz +0 -0
- package/dist/2837.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/2837.creaditor.bundle.js.gz +0 -0
- package/dist/2956.creaditor.bundle.js.gz +0 -0
- package/dist/2963.creaditor.bundle.js.gz +0 -0
- package/dist/3105.creaditor.bundle.js.gz +0 -0
- package/dist/3233.creaditor.bundle.js.gz +0 -0
- package/dist/3418.creaditor.bundle.js.gz +0 -0
- package/dist/3521.creaditor.bundle.js +2 -11
- package/dist/3521.creaditor.bundle.js.gz +0 -0
- package/dist/353.creaditor.bundle.js.gz +0 -0
- package/dist/3545.creaditor.bundle.js.gz +0 -0
- package/dist/3553.creaditor.bundle.js.gz +0 -0
- package/dist/3600.creaditor.bundle.js +1 -0
- package/dist/3600.creaditor.bundle.js.gz +0 -0
- package/dist/3606.creaditor.bundle.js.gz +0 -0
- package/dist/3792.creaditor.bundle.js.gz +0 -0
- package/dist/380.creaditor.bundle.js.gz +0 -0
- package/dist/3827.creaditor.bundle.js.gz +0 -0
- package/dist/3847.creaditor.bundle.js +9 -9
- package/dist/3847.creaditor.bundle.js.gz +0 -0
- package/dist/3875.creaditor.bundle.js.gz +0 -0
- package/dist/3971.creaditor.bundle.js.gz +0 -0
- package/dist/4000.creaditor.bundle.js +1 -0
- package/dist/4000.creaditor.bundle.js.gz +0 -0
- package/dist/4061.creaditor.bundle.js.gz +0 -0
- package/dist/407.creaditor.bundle.js.gz +0 -0
- package/dist/4074.creaditor.bundle.js.gz +0 -0
- package/dist/4100.creaditor.bundle.js.gz +0 -0
- package/dist/4109.creaditor.bundle.js.gz +0 -0
- package/dist/4114.creaditor.bundle.js.gz +0 -0
- package/dist/4161.creaditor.bundle.js.gz +0 -0
- package/dist/4186.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/4186.creaditor.bundle.js.gz +0 -0
- package/dist/4288.creaditor.bundle.js.gz +0 -0
- package/dist/4413.creaditor.bundle.js.gz +0 -0
- package/dist/4475.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4615.creaditor.bundle.js.gz +0 -0
- package/dist/4639.creaditor.bundle.js.gz +0 -0
- package/dist/467.creaditor.bundle.js.gz +0 -0
- package/dist/4762.creaditor.bundle.js.gz +0 -0
- package/dist/4770.creaditor.bundle.js.gz +0 -0
- package/dist/{6323.creaditor.bundle.js → 4819.creaditor.bundle.js} +7 -7
- package/dist/4819.creaditor.bundle.js.gz +0 -0
- package/dist/4947.creaditor.bundle.js.gz +0 -0
- package/dist/4987.creaditor.bundle.js.gz +0 -0
- package/dist/4988.creaditor.bundle.js.gz +0 -0
- package/dist/5133.creaditor.bundle.js.gz +0 -0
- package/dist/5156.creaditor.bundle.js.gz +0 -0
- package/dist/5284.creaditor.bundle.js.gz +0 -0
- package/dist/5379.creaditor.bundle.js.gz +0 -0
- package/dist/5391.creaditor.bundle.js.gz +0 -0
- package/dist/5411.creaditor.bundle.js.gz +0 -0
- package/dist/5501.creaditor.bundle.js.gz +0 -0
- package/dist/5530.creaditor.bundle.js.gz +0 -0
- package/dist/5666.creaditor.bundle.js.gz +0 -0
- package/dist/567.creaditor.bundle.js.gz +0 -0
- package/dist/5713.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/5713.creaditor.bundle.js.gz +0 -0
- package/dist/574.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/574.creaditor.bundle.js.gz +0 -0
- package/dist/578.creaditor.bundle.js.gz +0 -0
- package/dist/5791.creaditor.bundle.js +288 -0
- package/dist/5791.creaditor.bundle.js.gz +0 -0
- package/dist/5839.creaditor.bundle.js.gz +0 -0
- package/dist/5849.creaditor.bundle.js.gz +0 -0
- package/dist/5850.creaditor.bundle.js.gz +0 -0
- package/dist/5884.creaditor.bundle.js +8 -8
- package/dist/5884.creaditor.bundle.js.gz +0 -0
- package/dist/59.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/59.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +1 -1
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6036.creaditor.bundle.js.gz +0 -0
- package/dist/6151.creaditor.bundle.js.gz +0 -0
- package/dist/6216.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/6216.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6442.creaditor.bundle.js +214 -155
- package/dist/6442.creaditor.bundle.js.gz +0 -0
- package/dist/6496.creaditor.bundle.js.gz +0 -0
- package/dist/653.creaditor.bundle.js.gz +0 -0
- package/dist/6751.creaditor.bundle.js.gz +0 -0
- package/dist/6814.creaditor.bundle.js.gz +0 -0
- package/dist/6937.creaditor.bundle.js.gz +0 -0
- package/dist/7051.creaditor.bundle.js +162 -0
- package/dist/{6442.creaditor.bundle.js.LICENSE.txt → 7051.creaditor.bundle.js.LICENSE.txt} +0 -6
- package/dist/7051.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7051.creaditor.bundle.js.gz +0 -0
- package/dist/7055.creaditor.bundle.js.gz +0 -0
- package/dist/715.creaditor.bundle.js +142 -0
- package/dist/715.creaditor.bundle.js.LICENSE.txt +11 -0
- package/dist/715.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/715.creaditor.bundle.js.gz +0 -0
- package/dist/7155.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7238.creaditor.bundle.js.gz +0 -0
- package/dist/7255.creaditor.bundle.js.gz +0 -0
- package/dist/{8547.creaditor.bundle.js → 7348.creaditor.bundle.js} +66 -131
- package/dist/7348.creaditor.bundle.js.gz +0 -0
- package/dist/738.creaditor.bundle.js.gz +0 -0
- package/dist/7380.creaditor.bundle.js.gz +0 -0
- package/dist/7463.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7463.creaditor.bundle.js.gz +0 -0
- package/dist/7466.creaditor.bundle.js.gz +0 -0
- package/dist/7493.creaditor.bundle.js +48 -0
- package/dist/7493.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/7523.creaditor.bundle.js.gz +0 -0
- package/dist/7564.creaditor.bundle.js.gz +0 -0
- package/dist/7654.creaditor.bundle.js.gz +0 -0
- package/dist/767.creaditor.bundle.js.gz +0 -0
- package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7789.creaditor.bundle.js.gz +0 -0
- package/dist/7838.creaditor.bundle.js.gz +0 -0
- package/dist/7997.creaditor.bundle.js.gz +0 -0
- package/dist/8042.creaditor.bundle.js.gz +0 -0
- package/dist/8064.creaditor.bundle.js.gz +0 -0
- package/dist/8141.creaditor.bundle.js.gz +0 -0
- package/dist/8173.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/8173.creaditor.bundle.js.gz +0 -0
- package/dist/8196.creaditor.bundle.js.gz +0 -0
- package/dist/823.creaditor.bundle.js.gz +0 -0
- package/dist/8250.creaditor.bundle.js.gz +0 -0
- package/dist/8251.creaditor.bundle.js.gz +0 -0
- package/dist/8299.creaditor.bundle.js.gz +0 -0
- package/dist/8315.creaditor.bundle.js.gz +0 -0
- package/dist/8443.creaditor.bundle.js.gz +0 -0
- package/dist/8516.creaditor.bundle.js.gz +0 -0
- package/dist/8533.creaditor.bundle.js.gz +0 -0
- package/dist/8570.creaditor.bundle.js.gz +0 -0
- package/dist/8646.creaditor.bundle.js.gz +0 -0
- package/dist/8654.creaditor.bundle.js.gz +0 -0
- package/dist/8854.creaditor.bundle.js.gz +0 -0
- package/dist/8878.creaditor.bundle.js.gz +0 -0
- package/dist/8916.creaditor.bundle.js.gz +0 -0
- package/dist/8921.creaditor.bundle.js.gz +0 -0
- package/dist/898.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/898.creaditor.bundle.js.gz +0 -0
- package/dist/8983.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/9158.creaditor.bundle.js.gz +0 -0
- package/dist/9250.creaditor.bundle.js.gz +0 -0
- package/dist/9386.creaditor.bundle.js.gz +0 -0
- package/dist/9431.creaditor.bundle.js.gz +0 -0
- package/dist/9453.creaditor.bundle.js.gz +0 -0
- package/dist/9570.creaditor.bundle.js.gz +0 -0
- package/dist/9694.creaditor.bundle.js.gz +0 -0
- package/dist/975.creaditor.bundle.js.gz +0 -0
- package/dist/976.creaditor.bundle.js.gz +0 -0
- package/dist/9986.creaditor.bundle.js.gz +0 -0
- package/dist/9990.creaditor.bundle.js.gz +0 -0
- package/dist/9994.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +800 -345
- package/dist/creaditor.bundle.js.LICENSE.txt +6 -0
- package/dist/creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/index.html.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/dist/workbox-f3063069.js.gz +0 -0
- package/package.json +1 -1
- package/dist/1204.creaditor.bundle.js +0 -236
- package/dist/1204.creaditor.bundle.js.gz +0 -0
- package/dist/3601.creaditor.bundle.js +0 -288
- package/dist/3601.creaditor.bundle.js.gz +0 -0
- package/dist/507.creaditor.bundle.js +0 -334
- package/dist/507.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js +0 -48
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/6323.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +0 -51
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8088.creaditor.bundle.js +0 -141
- package/dist/8088.creaditor.bundle.js.gz +0 -0
- package/dist/8547.creaditor.bundle.js.gz +0 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5791],{25791(t,e,i){i.r(e),i.d(e,{MakeNewsletterAsEventPlugin:()=>p});var a=i(59929),o=i(49410),n=i(21421),r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=(t,e,i,a)=>{for(var o,n=a>1?void 0:a?s(e,i):e,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(a?o(e,i,n):o(n))||n);return a&&n&&r(e,i,n),n};let p=class extends a.WF{constructor(){super(...arguments),this.lang="en",this.primaryColor="#000000",this.primaryTextColor="#ffffff",this.buttonText="#ffffff",this.iconColor="#ffffff",this.buttonTextContent="",this.headerText="Create Event",this.startLabel="Start Date & Time",this.endLabel="End Date & Time",this.locationLabel="Location",this.linkLabel="Link (Optional)",this.saveButtonText="Save Event",this.cancelEventText="Cancel Event",this.confirmCancelText="Are you sure you want to cancel?",this.creatingEventText="Creating Event...",this.eventCreatedText="Event Created!",this.errorMessage="End date/time must be after start date/time",this.locationPlaceholder="Enter event location",this.linkPlaceholder="Enter event link",this.initialStartDate="",this.initialStartTime="",this.initialEndDate="",this.initialEndTime="",this.initialLocation="",this.initialLink="",this.startDate="",this.startTime="",this.endDate="",this.endTime="",this.location="",this.link="",this.error="",this.isSaving=!1,this.isSaved=!1,this.isConfirmingCancel=!1,this.popoverRef=(0,n._)(),this.cancelTimeout=null}get buttonDisplayText(){return this.isSaved?this.eventCreatedText:this.isSaving?this.creatingEventText:this.startDate&&this.startTime?new Date(`${this.startDate}T${this.startTime}`).toLocaleDateString(this.lang,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):this.buttonTextContent}connectedCallback(){super.connectedCallback(),this.initialStartDate&&this.initialStartTime&&(this.startDate=this.initialStartDate,this.startTime=this.initialStartTime),this.initialEndDate&&this.initialEndTime&&(this.endDate=this.initialEndDate,this.endTime=this.initialEndTime),this.initialLocation&&(this.location=this.initialLocation),this.initialLink&&(this.link=this.initialLink)}handleStartDateTimeChange(t){const e=t.target,[i,a]=e.value.split("T");if(this.startDate=i,this.startTime=a,!this.endDate&&!this.endTime){const t=new Date(new Date(`${i}T${a}`).getTime()+36e5);this.endDate=t.toISOString().split("T")[0],this.endTime=t.toTimeString().slice(0,5)}this.validateDates()}handleEndDateTimeChange(t){const e=t.target,[i,a]=e.value.split("T");this.endDate=i,this.endTime=a,this.validateDates()}validateDates(){if(this.startDate&&this.startTime&&this.endDate&&this.endTime){const t=new Date(`${this.startDate}T${this.startTime}`);new Date(`${this.endDate}T${this.endTime}`)<=t?this.error=this.errorMessage:this.error=""}}async handleSave(){var t;if(this.error)return;this.isSaving=!0,this.isSaved=!1;const e=new CustomEvent("event-created",{detail:{startDate:this.startDate,startTime:this.startTime,endDate:this.endDate,endTime:this.endTime,location:this.location,link:this.link},bubbles:!0,composed:!0});this.dispatchEvent(e),null==(t=this.popoverRef.value)||t.close(),await new Promise(t=>setTimeout(t,1500)),this.isSaving=!1,this.isSaved=!0,setTimeout(()=>{this.isSaved=!1},2e3)}handleCancelEvent(){var t;if(this.isConfirmingCancel){this.cancelTimeout&&(clearTimeout(this.cancelTimeout),this.cancelTimeout=null),this.startDate="",this.startTime="",this.endDate="",this.endTime="",this.location="",this.link="",this.error="",this.isConfirmingCancel=!1;const e=new CustomEvent("event-cancelled",{detail:{startDate:this.startDate,startTime:this.startTime,endDate:this.endDate,endTime:this.endTime,location:this.location,link:this.link},bubbles:!0,composed:!0});this.dispatchEvent(e),null==(t=this.popoverRef.value)||t.close()}else this.isConfirmingCancel=!0,this.cancelTimeout=window.setTimeout(()=>{this.isConfirmingCancel=!1},3e3)}disconnectedCallback(){super.disconnectedCallback(),this.cancelTimeout&&clearTimeout(this.cancelTimeout)}render(){return a.qy`
|
|
2
|
+
<cdtr-popover ${(0,n.K)(this.popoverRef)}>
|
|
3
|
+
<paper-button
|
|
4
|
+
color="primary"
|
|
5
|
+
slot="trigger"
|
|
6
|
+
dir="auto"
|
|
7
|
+
?disabled=${this.isSaving}
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
style="color:${this.iconColor}"
|
|
11
|
+
class="button-content ${this.isSaved?"hidden":""}"
|
|
12
|
+
>
|
|
13
|
+
<svg
|
|
14
|
+
width="20"
|
|
15
|
+
height="20"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="${this.iconColor||"currentColor"}"
|
|
19
|
+
>
|
|
20
|
+
<path
|
|
21
|
+
d="M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM11 13V17H6V13H11ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z"
|
|
22
|
+
></path>
|
|
23
|
+
</svg>
|
|
24
|
+
${this.buttonDisplayText}
|
|
25
|
+
</div>
|
|
26
|
+
<div
|
|
27
|
+
class="button-border ${this.isSaving?"loading":""} ${this.isSaved?"success":""}"
|
|
28
|
+
></div>
|
|
29
|
+
<svg
|
|
30
|
+
class="checkmark ${this.isSaved?"visible":""}"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
33
|
+
>
|
|
34
|
+
<path
|
|
35
|
+
d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"
|
|
36
|
+
fill="${"currentColor"}"
|
|
37
|
+
/>
|
|
38
|
+
</svg>
|
|
39
|
+
</paper-button>
|
|
40
|
+
<div slot="content" class="popover-content" dir="auto">
|
|
41
|
+
<div class="popover-header">
|
|
42
|
+
<h3 dir="auto">${this.headerText}</h3>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="input-group">
|
|
46
|
+
<label dir="auto">${this.startLabel}</label>
|
|
47
|
+
<input
|
|
48
|
+
type="datetime-local"
|
|
49
|
+
.value=${`${this.startDate}T${this.startTime}`}
|
|
50
|
+
@change=${this.handleStartDateTimeChange}
|
|
51
|
+
dir="auto"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div class="input-group">
|
|
56
|
+
<label dir="auto">${this.endLabel}</label>
|
|
57
|
+
<input
|
|
58
|
+
type="datetime-local"
|
|
59
|
+
.value=${`${this.endDate}T${this.endTime}`}
|
|
60
|
+
@change=${this.handleEndDateTimeChange}
|
|
61
|
+
dir="auto"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div class="input-group">
|
|
66
|
+
<label dir="auto">${this.locationLabel}</label>
|
|
67
|
+
<input
|
|
68
|
+
type="text"
|
|
69
|
+
.value=${this.location}
|
|
70
|
+
@input=${t=>this.location=t.target.value}
|
|
71
|
+
placeholder=${this.locationPlaceholder}
|
|
72
|
+
dir="auto"
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div class="input-group">
|
|
77
|
+
<label dir="auto">${this.linkLabel}</label>
|
|
78
|
+
<input
|
|
79
|
+
name="link"
|
|
80
|
+
type="url"
|
|
81
|
+
.value=${this.link}
|
|
82
|
+
@input=${t=>this.link=t.target.value}
|
|
83
|
+
placeholder=${this.linkPlaceholder}
|
|
84
|
+
dir="auto"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
${this.error?a.qy`<div class="error" dir="auto">${this.error}</div>`:""}
|
|
89
|
+
|
|
90
|
+
<div class="button-group">
|
|
91
|
+
${this.startDate||this.endDate?a.qy`
|
|
92
|
+
<paper-button
|
|
93
|
+
style=${`background: #ff0000;color:${this.primaryTextColor}`}
|
|
94
|
+
class="cancel-event ${this.isConfirmingCancel?"confirming":""}"
|
|
95
|
+
@click=${this.handleCancelEvent}
|
|
96
|
+
?disabled=${this.isSaving}
|
|
97
|
+
dir="auto"
|
|
98
|
+
>
|
|
99
|
+
${this.isConfirmingCancel?this.confirmCancelText:this.cancelEventText}
|
|
100
|
+
</paper-button>
|
|
101
|
+
`:""}
|
|
102
|
+
<paper-button
|
|
103
|
+
@click=${this.handleSave}
|
|
104
|
+
?disabled=${!!this.error||this.isSaving}
|
|
105
|
+
style=${`background: ${this.primaryColor};color:${this.primaryTextColor};width:100%;`}
|
|
106
|
+
dir="auto"
|
|
107
|
+
>
|
|
108
|
+
${this.saveButtonText}
|
|
109
|
+
</paper-button>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</cdtr-popover>
|
|
113
|
+
`}};p.styles=a.AH`
|
|
114
|
+
:host {
|
|
115
|
+
display: block;
|
|
116
|
+
}
|
|
117
|
+
* {
|
|
118
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
}
|
|
121
|
+
.popover-content {
|
|
122
|
+
padding: 16px;
|
|
123
|
+
min-width: 300px;
|
|
124
|
+
}
|
|
125
|
+
.popover-header {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 8px;
|
|
129
|
+
margin-bottom: 16px;
|
|
130
|
+
padding-bottom: 8px;
|
|
131
|
+
border-bottom: 1px solid #e0e0e0;
|
|
132
|
+
}
|
|
133
|
+
.popover-header h3 {
|
|
134
|
+
margin: 0;
|
|
135
|
+
font-size: 16px;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
color: #333;
|
|
138
|
+
}
|
|
139
|
+
.popover-header svg {
|
|
140
|
+
width: 20px;
|
|
141
|
+
height: 20px;
|
|
142
|
+
color: #666;
|
|
143
|
+
}
|
|
144
|
+
.input-group {
|
|
145
|
+
margin-bottom: 16px;
|
|
146
|
+
}
|
|
147
|
+
.input-group label {
|
|
148
|
+
display: block;
|
|
149
|
+
margin-bottom: 4px;
|
|
150
|
+
font-size: 14px;
|
|
151
|
+
color: #333;
|
|
152
|
+
}
|
|
153
|
+
.input-group input {
|
|
154
|
+
padding: 8px 12px;
|
|
155
|
+
border: 1px solid #ccc;
|
|
156
|
+
border-radius: 4px;
|
|
157
|
+
width: 100%;
|
|
158
|
+
font-size: 14px;
|
|
159
|
+
transition: border-color 0.2s;
|
|
160
|
+
}
|
|
161
|
+
.input-group input:focus {
|
|
162
|
+
border-color: #666;
|
|
163
|
+
outline: none;
|
|
164
|
+
}
|
|
165
|
+
.datetime-container {
|
|
166
|
+
display: grid;
|
|
167
|
+
grid-template-columns: 1fr 1fr;
|
|
168
|
+
gap: 8px;
|
|
169
|
+
}
|
|
170
|
+
.error {
|
|
171
|
+
color: #ff0000;
|
|
172
|
+
font-size: 12px;
|
|
173
|
+
margin-bottom: 8px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.button-content {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
gap: 8px;
|
|
180
|
+
position: relative;
|
|
181
|
+
z-index: 1;
|
|
182
|
+
transition: opacity 0.3s ease;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.button-content.hidden {
|
|
186
|
+
opacity: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.button-border {
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: 0;
|
|
192
|
+
left: 0;
|
|
193
|
+
right: 0;
|
|
194
|
+
bottom: 0;
|
|
195
|
+
border: 2px solid transparent;
|
|
196
|
+
border-radius: 4px;
|
|
197
|
+
pointer-events: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.button-border.loading {
|
|
201
|
+
border-color: #ffffff;
|
|
202
|
+
animation: borderRotate 1.5s linear infinite;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.button-border.success {
|
|
206
|
+
border-color: #4caf50;
|
|
207
|
+
animation: borderSuccess 0.5s ease-out forwards;
|
|
208
|
+
}
|
|
209
|
+
paper-button {
|
|
210
|
+
min-width: 10px;
|
|
211
|
+
max-height:40px;
|
|
212
|
+
}
|
|
213
|
+
.checkmark {
|
|
214
|
+
position: absolute;
|
|
215
|
+
top: 50%;
|
|
216
|
+
left: 50%;
|
|
217
|
+
transform: translate(-50%, -50%) scale(0);
|
|
218
|
+
width: 24px;
|
|
219
|
+
height: 24px;
|
|
220
|
+
opacity: 0;
|
|
221
|
+
transition: opacity 0.3s ease;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.checkmark.visible {
|
|
225
|
+
opacity: 1;
|
|
226
|
+
transform: translate(-50%, -50%) scale(1);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@keyframes borderRotate {
|
|
230
|
+
0% {
|
|
231
|
+
clip-path: polygon(0 0, 0 0, 0 0, 0 0);
|
|
232
|
+
}
|
|
233
|
+
25% {
|
|
234
|
+
clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
|
|
235
|
+
}
|
|
236
|
+
50% {
|
|
237
|
+
clip-path: polygon(100% 0, 100% 100%, 100% 100%, 100% 0);
|
|
238
|
+
}
|
|
239
|
+
75% {
|
|
240
|
+
clip-path: polygon(100% 100%, 0 100%, 0 100%, 100% 100%);
|
|
241
|
+
}
|
|
242
|
+
100% {
|
|
243
|
+
clip-path: polygon(0 100%, 0 0, 0 0, 0 100%);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@keyframes borderSuccess {
|
|
248
|
+
0% {
|
|
249
|
+
clip-path: polygon(0 0, 0 0, 0 0, 0 0);
|
|
250
|
+
}
|
|
251
|
+
100% {
|
|
252
|
+
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@keyframes checkmarkSuccess {
|
|
257
|
+
0% {
|
|
258
|
+
transform: translate(-50%, -50%) scale(0);
|
|
259
|
+
opacity: 0;
|
|
260
|
+
}
|
|
261
|
+
50% {
|
|
262
|
+
transform: translate(-50%, -50%) scale(1.2);
|
|
263
|
+
opacity: 1;
|
|
264
|
+
}
|
|
265
|
+
100% {
|
|
266
|
+
transform: translate(-50%, -50%) scale(1);
|
|
267
|
+
opacity: 1;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.button-group {
|
|
272
|
+
display: flex;
|
|
273
|
+
gap: 8px;
|
|
274
|
+
margin-top: 16px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@keyframes pulse {
|
|
278
|
+
0% {
|
|
279
|
+
transform: scale(1);
|
|
280
|
+
}
|
|
281
|
+
50% {
|
|
282
|
+
transform: scale(1.05);
|
|
283
|
+
}
|
|
284
|
+
100% {
|
|
285
|
+
transform: scale(1);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
`,l([(0,o.MZ)({type:String})],p.prototype,"lang",2),l([(0,o.MZ)({type:String})],p.prototype,"primaryColor",2),l([(0,o.MZ)({type:String})],p.prototype,"primaryTextColor",2),l([(0,o.MZ)({type:String})],p.prototype,"buttonText",2),l([(0,o.MZ)({type:String})],p.prototype,"iconColor",2),l([(0,o.MZ)({type:String})],p.prototype,"buttonTextContent",2),l([(0,o.MZ)({type:String})],p.prototype,"headerText",2),l([(0,o.MZ)({type:String})],p.prototype,"startLabel",2),l([(0,o.MZ)({type:String})],p.prototype,"endLabel",2),l([(0,o.MZ)({type:String})],p.prototype,"locationLabel",2),l([(0,o.MZ)({type:String})],p.prototype,"linkLabel",2),l([(0,o.MZ)({type:String})],p.prototype,"saveButtonText",2),l([(0,o.MZ)({type:String})],p.prototype,"cancelEventText",2),l([(0,o.MZ)({type:String})],p.prototype,"confirmCancelText",2),l([(0,o.MZ)({type:String})],p.prototype,"creatingEventText",2),l([(0,o.MZ)({type:String})],p.prototype,"eventCreatedText",2),l([(0,o.MZ)({type:String})],p.prototype,"errorMessage",2),l([(0,o.MZ)({type:String})],p.prototype,"locationPlaceholder",2),l([(0,o.MZ)({type:String})],p.prototype,"linkPlaceholder",2),l([(0,o.MZ)({type:String})],p.prototype,"initialStartDate",2),l([(0,o.MZ)({type:String})],p.prototype,"initialStartTime",2),l([(0,o.MZ)({type:String})],p.prototype,"initialEndDate",2),l([(0,o.MZ)({type:String})],p.prototype,"initialEndTime",2),l([(0,o.MZ)({type:String})],p.prototype,"initialLocation",2),l([(0,o.MZ)({type:String})],p.prototype,"initialLink",2),l([(0,o.MZ)()],p.prototype,"startDate",2),l([(0,o.MZ)()],p.prototype,"startTime",2),l([(0,o.MZ)()],p.prototype,"endDate",2),l([(0,o.MZ)()],p.prototype,"endTime",2),l([(0,o.MZ)()],p.prototype,"location",2),l([(0,o.MZ)()],p.prototype,"link",2),l([(0,o.MZ)()],p.prototype,"error",2),l([(0,o.MZ)()],p.prototype,"isSaving",2),l([(0,o.MZ)()],p.prototype,"isSaved",2),l([(0,o.MZ)()],p.prototype,"isConfirmingCancel",2),p=l([(0,o.EM)("cdtr-make-newsletter-as-event-plugin")],p)}}]);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5884],{55884(e,t,r){r.d(t,{default:()=>L});var o=r(12106),
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5884],{55884(e,t,r){r.d(t,{default:()=>L});var o=r(12106),i=r(59929);let s={};function n(e){s.selected=e}function c(e){return s.selected}var a=r(83423),l=r(81444);const d="https://img.creaditor.ai";function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t.width??24,o=t.height??24;let i=t.color??"000000";i.startsWith("#")&&(i=i.slice(1));const s=`${d}/icons/serve/${encodeURIComponent(e.category)}/${encodeURIComponent(e.name)}.png?width=${r}&height=${o}`;return(0,l.tG)(s,i)}class h extends i.WF{constructor(){super(),this.searchQuery="",this.iconColor="000000",this.iconSize=34,this.selectedSrc="",this._icons=[],this._loading=!1,this._error=""}willUpdate(e){e.has("searchQuery")&&this.searchQuery?this._fetchIcons():e.has("searchQuery")&&!this.searchQuery&&(this._icons=[],this._error="")}async _fetchIcons(){const e=(this.searchQuery||"").trim();if(e){this._loading=!0,this._error="";try{const t=new URLSearchParams({q:e,limit:"20"}),r=await fetch(`${d}/icons/search?${t.toString()}`);if(!r.ok)throw new Error(r.statusText);const o=await r.json();this._icons=o.icons||[]}catch(e){this._icons=[],this._error=e.message||"Failed to load icons"}finally{this._loading=!1}}else this._icons=[]}_onSelect(e){const t=(this.iconColor||"000000").replace(/^#/,""),r=Number(this.iconSize)||34,o=p(e,{width:r,height:r,color:t});this.dispatchEvent(new CustomEvent("icon-selected",{detail:{src:o,icon:e},bubbles:!0,composed:!0}))}render(){if(!this.searchQuery?.trim())return i.qy``;if(this._loading)return i.qy`<div class="loading"><span class="spinner"></span>Loading icons…</div>`;if(this._error)return i.qy`<div class="error">${this._error}</div>`;if(!this._icons.length)return i.qy``;const e=(this.iconColor||"000000").replace(/^#/,"");return i.qy`
|
|
2
2
|
|
|
3
3
|
<div class="grid">
|
|
4
|
-
${this._icons.map(t=>{const r=p(t,{width:24,height:24,color:e}),o=this.selectedSrc&&(this.selectedSrc.includes(t.name)||this.selectedSrc===r);return
|
|
4
|
+
${this._icons.map(t=>{const r=p(t,{width:24,height:24,color:e}),o=this.selectedSrc&&(this.selectedSrc.includes(t.name)||this.selectedSrc===r);return i.qy`
|
|
5
5
|
<button
|
|
6
6
|
type="button"
|
|
7
7
|
class="icon-wrap ${o?"selected":""}"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</button>
|
|
13
13
|
`})}
|
|
14
14
|
</div>
|
|
15
|
-
`}}h.properties={searchQuery:{type:String},iconColor:{type:String},iconSize:{type:Number},selectedSrc:{type:String},_icons:{type:Array,state:!0},_loading:{type:Boolean,state:!0},_error:{type:String,state:!0}},h.styles=
|
|
15
|
+
`}}h.properties={searchQuery:{type:String},iconColor:{type:String},iconSize:{type:Number},selectedSrc:{type:String},_icons:{type:Array,state:!0},_loading:{type:Boolean,state:!0},_error:{type:String,state:!0}},h.styles=i.AH`
|
|
16
16
|
:host {
|
|
17
17
|
display: block;
|
|
18
18
|
font-size: 12px;
|
|
@@ -77,15 +77,15 @@
|
|
|
77
77
|
.error {
|
|
78
78
|
color: var(--error-color, #c00);
|
|
79
79
|
}
|
|
80
|
-
`,customElements.define("social-icon-suggestions",h);var m=r(61919);const f=e=>{{const{component:t,commands:r}=e,o=()=>{let e=c();if(e||(e=t.props.items.find(e=>!e.link),!e&&t.props.items.length>0&&(e=t.props.items[0])),e){!t.props.items.find(t=>t.id===e.id)&&t.props.items.length>0&&(e=t.props.items[0])}return e};return{select:e=>{let{changeTab:t,tab:r}=e;"link"!==r&&t("link")},tabs:e=>{e||(e="link");const t=[{text:"image"},{text:"design"},{text:"link",selected:!0}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:
|
|
80
|
+
`,customElements.define("social-icon-suggestions",h);var m=r(61919);const f=e=>{{const{component:t,commands:r}=e,o=()=>{let e=c();if(e||(e=t.props.items.find(e=>!e.link),!e&&t.props.items.length>0&&(e=t.props.items[0])),e){!t.props.items.find(t=>t.id===e.id)&&t.props.items.length>0&&(e=t.props.items[0])}return e};return{select:e=>{let{changeTab:t,tab:r}=e;"link"!==r&&t("link")},tabs:e=>{e||(e="link");const t=[{text:"image"},{text:"design"},{text:"link",selected:!0}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:s,changeTab:n,tabs:c}=e;const d=o(),p=[{type:"node",node:()=>i.qy`<img
|
|
81
81
|
style="padding:10px;display:block;margin:auto"
|
|
82
82
|
width="52"
|
|
83
83
|
height="52"
|
|
84
84
|
src=${d?.src?(0,l.tG)(d.src,d.fgColor||d.iconColor):""}
|
|
85
|
-
/>`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const
|
|
86
|
-
.searchQuery=${
|
|
85
|
+
/>`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const i=o();if(!i)return;const s=[...t.props.items];if(s.length<2)return;const n=s.findIndex(e=>e.id===i.id);-1!==n&&(s.splice(n,1),r.execCommand("items",s))}},{type:"divider"},{type:"gallery",active:"image"===s.text,src:d?.src,hasPreview:!0,text:"open_gallery",justify:"flex-start",onChange:e=>{const i=o();if(!i)return;let s=e.detail;Array.isArray(s)&&(s=s[0]);const n=t.props,c=JSON.parse(JSON.stringify(n.items)),a=c.findIndex(e=>e.id===i.id);-1!==a&&(c[a].src=s.src,r.execCommand("items",c))}},{type:"custom",active:()=>{const e=d?.link?.href||d?.url,t=e?(0,l.IE)(a.A,e):null;return("link"===s.text||"image"===s.text)&&!!t},node:()=>{const e=d?.link?.href||d?.url,s=e&&(0,l.IE)(a.A,e)||"";return i.qy`<cdtr-editor-container><social-icon-suggestions
|
|
86
|
+
.searchQuery=${s}
|
|
87
87
|
.iconColor=${d?.fgColor||d?.iconColor||"000000"}
|
|
88
88
|
.iconSize=${parseInt(d?.style?.width,10)||34}
|
|
89
89
|
.selectedSrc=${d?.src||""}
|
|
90
|
-
@icon-selected=${e=>{const
|
|
91
|
-
></social-icon-suggestions></cdtr-editor-container>`}},{type:"divider"},{type:"linkpicker",href:d?.link||d?.url,active:()=>"link"===
|
|
90
|
+
@icon-selected=${e=>{const i=o();if(!i)return;const s=t.props,n=JSON.parse(JSON.stringify(s.items)),c=n.findIndex(e=>e.id===i.id);-1!==c&&(n[c].src=e.detail.src,r.execCommand("items",n))}}
|
|
91
|
+
></social-icon-suggestions></cdtr-editor-container>`}},{type:"divider"},{type:"linkpicker",href:d?.link||d?.url,active:()=>"link"===s.text&&!!d,onChange:e=>{const i=o();if(!i)return;const s=e.target.value,n=t.props,c=JSON.parse(JSON.stringify(n.items)),d=c.findIndex(e=>e.id===i.id);if(-1!==d){const e=c[d].fgColor||c[d].iconColor,t=function(e,t){const r=(0,l.IE)(a.A,e),o=r?a.A.find(e=>e.type===r):null,i=o?o.src:null;return i?(0,l.tG)(i,t):null}(s.href,e);t&&(c[d].src=t),c[d].url=s.href,c[d].link=s,r.execCommand("items",c)}}},{type:"slider",title:"size",active:"design"===s.text,value:parseInt(d?.style?.width),min:10,max:80,onInput:e=>{const o=e.target.value,i=[...t.props.items];i.forEach(e=>{e.style.width=o+"px",e.style.height=o+"px"}),r.execCommand("items",i)}},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>"design"===s.text&&!!d,value:d?.fgColor?d.fgColor.startsWith("#")?d.fgColor:"#"+d.fgColor:"#000000",onChange:e=>{const i=o();if(!i)return;let s=e.target.value;s=(0,m.A)(s).toHex(),s.startsWith("#")&&(s=s.slice(1)),8===s.length&&/^[0-9a-fA-F]+$/.test(s)&&(s=s.slice(0,6));const n=t.props,c=JSON.parse(JSON.stringify(n.items));if(!0===n.applyColorToAll)c.forEach(e=>{e.fgColor=s});else{const e=c.findIndex(e=>e.id===i.id);-1!==e&&(c[e].fgColor=s)}r.execCommand("items",c)}},{type:"checkbox",title:"color_them_all",checked:!!t.props.applyColorToAll,active:()=>"design"===s.text&&!!d,onChange:e=>{const t=!!e.target.checked;r.execCommand("applyColorToAll",t)}},{type:"divider"},{type:"slider",title:"spacing",active:"design"===s.text,value:parseFloat(t.props.style.gap),min:0,max:80,onInput:e=>{const t=e.target.value;r.execCommand("style",{gap:t+"px"})}}];return p}}}};var u=r(52144);const g=()=>({set:(e,t,r)=>{switch(t){case"style":if("object"==typeof r)return e[t]=(0,u.A)(e[t],r),!0;break;case"items":if(e[t]=r,Array.isArray(r)){const e=c(),t=r.find(t=>t.id===e?.id);t&&n(t)}return!0;case"src":const o=c();if(o&&Array.isArray(e.items)){const t=[...e.items],i=t.findIndex(e=>e.id===o.id);if(-1!==i)return t[i].src=r,e.items=t,!0}break;case"applyColorToAll":return e[t]=r,!0}}});var y=r(72591),x=r.n(y),b=r(88639),C=r.n(b),v=r(88128),A=r.n(v),k=r(30855),w=r.n(k),_=r(93051),S=r.n(_),I=r(89820),E={};E.setAttributes=w(),E.insert=A().bind(null,"head"),E.domAPI=C(),E.insertStyleElement=S();x()(I.A,E);const $=I.A&&I.A.locals?I.A.locals:void 0;var T=r(23571),O=r(91597);const L=()=>{const e="social";return{name:e,create:t=>{let{createElement:r,compose:i,helpers:s}=t;const d=(0,O.S)(),p=document.createElement("div"),h=document.createElement("div");h.classList.add($.root);new T.Ay(h,{sort:!0,delay:0,delayOnTouchOnly:!1,touchStartThreshold:0,disabled:!1,store:null,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",preventOnFilter:!0,draggable:".item",dataIdAttr:"data-id",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:1,direction:"horizontal",forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,dragoverBubble:!1,removeCloneOnHide:!0,emptyInsertThreshold:5,setData:function(e,t){e.setData("Text",t.textContent)},onChoose:function(e){e.oldIndex},onUnchoose:function(e){},onStart:function(e){e.oldIndex},onEnd:function(e){const t=JSON.parse(JSON.stringify(i.props.items)),{oldIndex:r,newIndex:o}=e,[s]=t.splice(r,1);t.splice(o,0,s),i.editor.store().execCommand("items",t)},onMove:function(e,t){e.dragged,e.draggedRect,e.related,e.relatedRect,e.willInsertAfter,t.clientY},onChange:function(e){e.newIndex}});p.appendChild(h);const m=r({name:e,id:i.id,template:p,draggable:{group:"element"},droppable:{group:"element"},render:()=>{const e=i.props.items;let t=!1;const r=e.map(e=>{const r=e.url||e.link?.link||"";if(!e.src&&r){const o=(0,l.IE)(a.A,r),i=o?a.A.find(e=>e.type===o):null;if(i)return t=!0,{...e,src:i.src}}return e});t&&setTimeout(()=>i.editor.store().execCommand("items",r),0);const d=t?r:e;for(;h.firstChild;)h.removeChild(h.firstChild);s.mergeDiff(h,{style:i.props.style});const p=c();d.forEach(e=>{const t=document.createElement("img");p?.id===e.id&&t.classList.add($.selected),t.addEventListener("click",()=>{n(e),Array.from(h.children).forEach(e=>{e.classList.remove($.selected)}),t.classList.add($.selected)}),t.classList.add("item"),e.id&&t.setAttribute("data-id",e.id);const r=(0,l.fm)(h);t.src=(0,l.Ff)(e,{color:e.fgColor||e.iconColor,bg:r})||"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png",s.mergeDiff(t,{style:e.style}),h.append(t)});const m=document.createElement("paper-button");m.style.cssText=["min-width:0","padding:0","margin:0 4px","width:28px","height:28px","border-radius:50%","display:inline-flex","align-items:center","justify-content:center","vertical-align:middle","flex:none","background:#fff","color:#1f1b1d","border:1px solid rgba(0,0,0,.18)","box-shadow:0 1px 3px rgba(0,0,0,.28)"].join(";"),m.innerHTML="<cdtr-icon icon='add' width='18' height='18'></cdtr-icon>",h.append(m),m.addEventListener("click",()=>{setTimeout(()=>{const e=i.props.items[i.props.items.length-1],t={id:(0,o.A)(),fgColor:"",bgColor:"",style:e.style,url:"",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},r=[...i.props.items];r.push(t),n(t),i.editor.store().execCommand("items",r)},200)})},handleBar:!0,defaultProps:{},validator:g(),schema:i.schema,onSelect:e=>{const t=c();if(t){const r=document.querySelector(`[data-id="${t.id}"]`);r?(window.___social_cdtr_item=r,r.classList.add("selected_underlined")):p.classList.add(e)}},onDeselect:e=>{c();window.___social_cdtr_item&&window.___social_cdtr_item.classList.remove("selected_underlined"),p?.classList?.remove(e)},elementProps:i,remove:()=>{p.remove()},createEditor:f});return m.app.on("update",()=>{d.run(()=>{const e=(0,l.fm)(h);if(!e)return;const t=h.querySelectorAll("img"),r=i.props.items;t.forEach((t,o)=>{const i=r[o];if(!i)return;const s=(0,l.Ff)(i,{color:i.fgColor||i.iconColor,bg:e});s&&(t.src=s)})})}),m}}}},89820(e,t,r){r.d(t,{A:()=>c});var o=r(82001),i=r.n(o),s=r(40935),n=r.n(s)()(i());n.push([e.id,".Z7AEJu5h_9kumGVl3K4x{\n display: flex;\n}\n.UA2xJ_pGYNrGNLfjkExO{\n border:1px solid var(--primary);\n}","",{version:3,sources:["webpack://./../newsletter-editors/social-editor-component-newsletter/lib/style.module.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB;AACA;IACI,+BAA+B;AACnC",sourcesContent:[".root{\n display: flex;\n}\n.selected{\n border:1px solid var(--primary);\n}"],sourceRoot:""}]),n.locals={root:"Z7AEJu5h_9kumGVl3K4x",selected:"UA2xJ_pGYNrGNLfjkExO"};const c=n}}]);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,n){n.r(e),n.d(e,{EditorTabs:()=>l});var o=n(59929),s=n(54804),i=n(86319),a=n(40648);
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,n){n.r(e),n.d(e,{EditorTabs:()=>l});var o=n(59929),s=n(54804),i=n(86319),a=n(40648);Promise.resolve().then(n.bind(n,67937));const r="cdtr-editor-tabs-hint-seen";class l extends o.WF{constructor(){super(),this.onConnected=this.onConnected.bind(this),this.onArrowNavigation=this.onArrowNavigation.bind(this),this.dismissHint=this.dismissHint.bind(this),this.scheduleSync=this.scheduleSync.bind(this),this.observeContent=this.observeContent.bind(this),this.toggleAllSections=this.toggleAllSections.bind(this),this.tabs=[],this.showHint=!1,this._sectionCount=0,this._allExpanded=!1}sectionElements(){const t=this.shadowRoot?.querySelector('slot[name="content"]');if(!t)return[];const e=[];for(const n of t.assignedElements({flatten:!0})){"CDTR-EDITOR-SECTION"===n.tagName&&e.push(n);for(const t of n.children)"CDTR-EDITOR-SECTION"===t.tagName&&e.push(t)}return e}syncSections(){const t=this.sectionElements();this._sectionCount=t.length,this._allExpanded=t.length>0&&t.every(t=>t.open)}observeContent(){this._contentObserver||(this._contentObserver=new MutationObserver(this.scheduleSync)),this._contentObserver.disconnect();const t=this.shadowRoot?.querySelector('slot[name="content"]');if(t){for(const e of t.assignedElements({flatten:!0}))this._contentObserver.observe(e,{childList:!0});this.scheduleSync()}}scheduleSync(){this._syncPending||(this._syncPending=!0,setTimeout(()=>{this._syncPending=!1,this.isConnected&&this.syncSections()},0))}toggleAllSections(){const t=!this._allExpanded;for(const e of this.sectionElements())e.open=t,(0,a.Q)(e.persistKey,t);this._allExpanded=t}hintAlreadySeen(){try{return"1"===localStorage.getItem(r)}catch(t){return!0}}dismissHint(){this.showHint=!1;try{localStorage.setItem(r,"1")}catch(t){}}onClickItem(t){let{target:e}=t;const n=this.value=e.value,o=[...this.tabs],s=o.findIndex(t=>t.text===n);-1!==s&&(o.forEach(t=>{t.selected=!1}),o[s].selected=!0),this.tabs=o,this.scheduleSync(),this.showHint&&this.dismissHint();const i=new UIEvent("tabChanged",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(i)}firstUpdated(){super.firstUpdated()}maybeShowHint(){this._hintChecked||this.tabs.length<=1||this.hintAlreadySeen()||(this._hintChecked=!0,setTimeout(()=>{this.isConnected&&!this.hintAlreadySeen()&&(this.showHint=!0)},700))}updated(){this.setAttribute("data-active-tab",this.value||""),this.maybeShowHint(),this.observeContent()}onConnected(t){let{name:e}=t;this.onClickItem({target:{value:e}})}onArrowNavigation(t){const{key:e,currentIcon:n}=t.detail,o=this.tabs.findIndex(t=>t.text===n);if(-1===o)return;let s=o;switch(e){case"ArrowUp":case"ArrowLeft":s=o>0?o-1:this.tabs.length-1;break;case"ArrowDown":case"ArrowRight":s=o<this.tabs.length-1?o+1:0;break;default:return}const i=this.tabs[s];i&&(this.onClickItem({target:{value:i.text}}),this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(`cdtr-editor-tab-item[icon="${i.text}"]`);t&&t.focus()}))}connectedCallback(){super.connectedCallback(),s.Ay.on("editor-tabs",this.onConnected),s.Ay.on("update",this.scheduleSync),s.Ay.on("select",this.scheduleSync)}disconnectedCallback(){super.disconnectedCallback(),s.Ay.off("editor-tabs",this.onConnected),s.Ay.off("update",this.scheduleSync),s.Ay.off("select",this.scheduleSync),this._contentObserver?.disconnect()}renderContent(){switch(this.value){case"animations":return n.e(3553).then(n.bind(n,3553)),o.qy`<cdtr-animations-editor>
|
|
2
2
|
<cdtr-block-loader></cdtr-block-loader
|
|
3
3
|
></cdtr-animations-editor>`;case"settings":case"setting":return n.e(7654).then(n.bind(n,37654)),o.qy`<cdtr-setting-editor>
|
|
4
4
|
<cdtr-block-loader></cdtr-block-loader
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|