@aswin.dev/editor 0.6.3 → 0.7.1
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/README.md +3 -3
- package/dist/AccessibilityPanel-COL6Wm7p.js +108 -0
- package/dist/AiChatSidebar-DWGPVtvC.js +229 -0
- package/dist/AiFeatureMenu-duUFSfDf.js +63 -0
- package/dist/BlockA11yBadge-Qs6HtXid.js +34 -0
- package/dist/CloudEditor-CFldoCOb.js +1207 -0
- package/dist/CollaboratorBar-Bw-lbt61.js +95 -0
- package/dist/CommentsSidebar-BaD5F53-.js +436 -0
- package/dist/CountdownBlock-DaYGxKqo.js +92 -0
- package/dist/CountdownToolbar-Dg4F8MTk.js +210 -0
- package/dist/DesignReferenceSidebar-BSH7uNP_.js +276 -0
- package/dist/LoadingTrack-Ba2pfF57.js +10 -0
- package/dist/ModuleBrowserModal-6phxZSKI.js +206 -0
- package/dist/ModulePreviewCanvas-BW8L3eQX.js +108 -0
- package/dist/NumberWithSuffix-BpUzQOJt.js +422 -0
- package/dist/ParagraphEditor-DNSzAB-I.js +695 -0
- package/dist/RichTextEditorContent-CrqPQdnk.js +137 -0
- package/dist/SaveModuleDialog-zMQTpez7.js +123 -0
- package/dist/SnapshotHistory-Do-A5rYU.js +122 -0
- package/dist/TemplateScoringPanel-CS7o62zS.js +256 -0
- package/dist/TestEmailModal-DGj_9V1u.js +94 -0
- package/dist/TitleEditor-C7IDnAoS.js +172 -0
- package/dist/TplModal-BAsVzcTb.js +44 -0
- package/dist/_plugin-vue_export-helper-BVAJ4lgT.js +8 -0
- package/dist/accessibility-BU09xZrQ.js +27 -0
- package/dist/blockTypeIcons-C6LDKvmd.js +140 -0
- package/dist/bundle-stats.json +10 -0
- package/dist/check-DJrpDKO_.js +7 -0
- package/dist/chevron-down-C5oBUhT8.js +7 -0
- package/dist/chevron-right-BqCptpdp.js +10 -0
- package/dist/circle-alert-ZQQc98HC.js +25 -0
- package/dist/clock-ik2pRJKG.js +12 -0
- package/dist/cloud-6ZmAvF0j.js +1791 -0
- package/dist/createLucideIcon-ClREiSx3.js +43 -0
- package/dist/de-DWcgp-7T.js +729 -0
- package/dist/de-GOtR9DwW.js +207 -0
- package/dist/dist-BUzw1buG.js +35 -0
- package/dist/dist-BZyY-SS4.js +74 -0
- package/dist/dist-BadNx4qo.js +5 -0
- package/dist/dist-BesOh2mk.js +35 -0
- package/dist/dist-Bz3M4RXG.js +2082 -0
- package/dist/dist-C04s_fLA.js +563 -0
- package/dist/dist-C3T2AKtB.js +776 -0
- package/dist/dist-C9ckKEZL.js +519 -0
- package/dist/dist-CBItRG-Z.js +47 -0
- package/dist/dist-COSzWQUs.js +5 -0
- package/dist/dist-CivF9P8b.js +382 -0
- package/dist/dist-DXa1uAMh.js +10658 -0
- package/dist/dist-DtiDUrX-.js +189 -0
- package/dist/dist-Dzt5foyL.js +61 -0
- package/dist/emojiData-DrBuvEoP.js +17 -0
- package/dist/en-Cxd4fhNm.js +729 -0
- package/dist/en-dFFQVzNn.js +207 -0
- package/dist/extensions-D__hOlV1.js +799 -0
- package/dist/formatRelativeTime-BhhO8yCl.js +12 -0
- package/dist/image-up-DT7gcJLN.js +23 -0
- package/dist/index.d.ts +352 -0
- package/dist/info-BSPGcsSM.js +19 -0
- package/dist/keys-CvX8D-8C.js +10 -0
- package/dist/liquid.browser-BvCyLQII.js +3277 -0
- package/dist/loader-circle-Balo8p3d.js +7 -0
- package/dist/message-circle-B39qAHxs.js +7 -0
- package/dist/pencil-BZJPNYWR.js +10 -0
- package/dist/readableTextColor-DVuzNX1y.js +30 -0
- package/dist/refresh-cw-DwDqGUM0.js +29 -0
- package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
- package/dist/scan-line-CzfFJO1o.js +25 -0
- package/dist/send-D2eSo4GH.js +10 -0
- package/dist/shield-check-jkpgcC0-.js +10 -0
- package/dist/sparkles-Chm5CZfb.js +23 -0
- package/dist/style.css +2 -0
- package/dist/styleConstants-34eUKPOZ.js +55 -0
- package/dist/styles-B4tjX5SP.js +5224 -0
- package/dist/templatical-editor.js +312 -0
- package/dist/text-align-start-CzBnJsW8.js +43 -0
- package/dist/timeouts-BSGxjuUF.js +4 -0
- package/dist/trash-2-CtK2apEH.js +25 -0
- package/dist/triangle-alert-KpDVNbpn.js +17 -0
- package/dist/useCloudI18n-DOKSZql1.js +23 -0
- package/dist/useEditorCore-wslttMH-.js +9517 -0
- package/dist/useI18n-C2xQZ6K9.js +17 -0
- package/dist/useMergeTag-DX0XG5V9.js +34 -0
- package/dist/vue.runtime.esm-bundler-CjauPXjj.js +5775 -0
- package/dist/x-BkaOMosX.js +10 -0
- package/package.json +10 -10
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
//#region ../types/dist/index.js
|
|
2
|
+
var e = {
|
|
3
|
+
1: 36,
|
|
4
|
+
2: 28,
|
|
5
|
+
3: 22,
|
|
6
|
+
4: 18
|
|
7
|
+
};
|
|
8
|
+
function t(e) {
|
|
9
|
+
return e.type === "custom";
|
|
10
|
+
}
|
|
11
|
+
var n = {
|
|
12
|
+
content: "<p>Enter your title</p>",
|
|
13
|
+
level: 2,
|
|
14
|
+
color: "#1a1a1a",
|
|
15
|
+
textAlign: "left"
|
|
16
|
+
}, r = { content: "<p>Enter your text here</p>" }, i = {
|
|
17
|
+
src: "",
|
|
18
|
+
alt: "",
|
|
19
|
+
width: "full",
|
|
20
|
+
align: "center"
|
|
21
|
+
}, a = {
|
|
22
|
+
text: "Click Here",
|
|
23
|
+
url: "",
|
|
24
|
+
backgroundColor: "#333333",
|
|
25
|
+
textColor: "#ffffff",
|
|
26
|
+
borderRadius: 6,
|
|
27
|
+
fontSize: 15,
|
|
28
|
+
buttonPadding: {
|
|
29
|
+
top: 12,
|
|
30
|
+
right: 24,
|
|
31
|
+
bottom: 12,
|
|
32
|
+
left: 24
|
|
33
|
+
},
|
|
34
|
+
borderWidth: 0,
|
|
35
|
+
borderColor: "#000000",
|
|
36
|
+
borderSides: "all"
|
|
37
|
+
}, ee = {
|
|
38
|
+
inputType: "text",
|
|
39
|
+
name: "field",
|
|
40
|
+
label: "Label",
|
|
41
|
+
placeholder: "",
|
|
42
|
+
defaultValue: "",
|
|
43
|
+
required: !1,
|
|
44
|
+
labelMargin: {
|
|
45
|
+
top: 0,
|
|
46
|
+
right: 0,
|
|
47
|
+
bottom: 8,
|
|
48
|
+
left: 0
|
|
49
|
+
},
|
|
50
|
+
labelPadding: {
|
|
51
|
+
top: 0,
|
|
52
|
+
right: 0,
|
|
53
|
+
bottom: 0,
|
|
54
|
+
left: 0
|
|
55
|
+
},
|
|
56
|
+
labelFontSize: 14,
|
|
57
|
+
labelColor: "#374151",
|
|
58
|
+
labelFontWeight: "normal",
|
|
59
|
+
labelTextAlign: "left",
|
|
60
|
+
inputMargin: {
|
|
61
|
+
top: 0,
|
|
62
|
+
right: 0,
|
|
63
|
+
bottom: 0,
|
|
64
|
+
left: 0
|
|
65
|
+
},
|
|
66
|
+
inputPadding: {
|
|
67
|
+
top: 10,
|
|
68
|
+
right: 12,
|
|
69
|
+
bottom: 10,
|
|
70
|
+
left: 12
|
|
71
|
+
},
|
|
72
|
+
inputBackgroundColor: "#ffffff",
|
|
73
|
+
inputTextColor: "#111827",
|
|
74
|
+
inputPlaceholderColor: "#9ca3af",
|
|
75
|
+
inputFontSize: 15,
|
|
76
|
+
inputBorderRadius: 6,
|
|
77
|
+
inputBorderWidth: 1,
|
|
78
|
+
inputBorderColor: "#d1d5db",
|
|
79
|
+
inputBorderSides: "all",
|
|
80
|
+
inputWidth: "full"
|
|
81
|
+
}, o = {
|
|
82
|
+
lineStyle: "solid",
|
|
83
|
+
color: "#e0e0e0",
|
|
84
|
+
thickness: 1,
|
|
85
|
+
width: "full"
|
|
86
|
+
}, s = { columns: "1" }, c = {
|
|
87
|
+
url: "",
|
|
88
|
+
thumbnailUrl: "",
|
|
89
|
+
alt: "Video",
|
|
90
|
+
width: "full",
|
|
91
|
+
align: "center"
|
|
92
|
+
}, l = {
|
|
93
|
+
iconStyle: "solid",
|
|
94
|
+
iconSize: "medium",
|
|
95
|
+
spacing: 10,
|
|
96
|
+
align: "center"
|
|
97
|
+
}, u = { height: 24 }, d = { content: "" }, f = {
|
|
98
|
+
fontSize: 15,
|
|
99
|
+
color: "#1a1a1a",
|
|
100
|
+
textAlign: "center",
|
|
101
|
+
separator: "|",
|
|
102
|
+
separatorColor: "#e0e0e0",
|
|
103
|
+
spacing: 10
|
|
104
|
+
}, p = {
|
|
105
|
+
hasHeaderRow: !0,
|
|
106
|
+
borderColor: "#e0e0e0",
|
|
107
|
+
borderWidth: 1,
|
|
108
|
+
cellPadding: 8,
|
|
109
|
+
fontSize: 15,
|
|
110
|
+
color: "#1a1a1a",
|
|
111
|
+
textAlign: "left"
|
|
112
|
+
}, m = {
|
|
113
|
+
targetDate: "",
|
|
114
|
+
timezone: "UTC",
|
|
115
|
+
showDays: !0,
|
|
116
|
+
showHours: !0,
|
|
117
|
+
showMinutes: !0,
|
|
118
|
+
showSeconds: !0,
|
|
119
|
+
separator: ":",
|
|
120
|
+
digitFontSize: 32,
|
|
121
|
+
digitColor: "#1a1a1a",
|
|
122
|
+
labelColor: "#6b7280",
|
|
123
|
+
labelFontSize: 12,
|
|
124
|
+
backgroundColor: "#ffffff",
|
|
125
|
+
labelDays: "Days",
|
|
126
|
+
labelHours: "Hours",
|
|
127
|
+
labelMinutes: "Minutes",
|
|
128
|
+
labelSeconds: "Seconds",
|
|
129
|
+
expiredMessage: "This offer has expired",
|
|
130
|
+
expiredImageUrl: "",
|
|
131
|
+
hideOnExpiry: !1
|
|
132
|
+
}, h = {
|
|
133
|
+
width: 600,
|
|
134
|
+
backgroundColor: "#ffffff",
|
|
135
|
+
fontFamily: "Arial",
|
|
136
|
+
locale: "en"
|
|
137
|
+
};
|
|
138
|
+
function g(e) {
|
|
139
|
+
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
140
|
+
}
|
|
141
|
+
function _(e, t) {
|
|
142
|
+
let n = { ...e };
|
|
143
|
+
for (let r of Object.keys(t)) {
|
|
144
|
+
let i = e[r], a = t[r];
|
|
145
|
+
a !== void 0 && (g(i) && g(a) ? n[r] = _(i, a) : n[r] = a);
|
|
146
|
+
}
|
|
147
|
+
return n;
|
|
148
|
+
}
|
|
149
|
+
function v(e) {
|
|
150
|
+
if (!e.canvasPages?.length) return e;
|
|
151
|
+
let t = e.activeCanvasPageId ?? e.canvasPages[0].id, n = e.canvasPages.find((e) => e.id === t) ?? e.canvasPages[0];
|
|
152
|
+
return {
|
|
153
|
+
...e,
|
|
154
|
+
activeCanvasPageId: n.id,
|
|
155
|
+
blocks: n.blocks
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function te(e = "Arial", t) {
|
|
159
|
+
return {
|
|
160
|
+
blocks: [],
|
|
161
|
+
settings: {
|
|
162
|
+
...h,
|
|
163
|
+
fontFamily: e,
|
|
164
|
+
...t
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
var y = [
|
|
169
|
+
{
|
|
170
|
+
id: "UTC",
|
|
171
|
+
label: "GMT+0000 (Coordinated Universal Time)"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "America/Los_Angeles",
|
|
175
|
+
label: "GMT−0800 (Pacific Time)"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: "America/Denver",
|
|
179
|
+
label: "GMT−0700 (Mountain Time)"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: "America/Chicago",
|
|
183
|
+
label: "GMT−0600 (Central Time)"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: "America/New_York",
|
|
187
|
+
label: "GMT−0500 (Eastern Time)"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: "America/Sao_Paulo",
|
|
191
|
+
label: "GMT−0300 (Brasília Time)"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "Europe/London",
|
|
195
|
+
label: "GMT+0000 (United Kingdom)"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: "Europe/Paris",
|
|
199
|
+
label: "GMT+0100 (Central European Time)"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: "Asia/Dubai",
|
|
203
|
+
label: "GMT+0400 (Gulf Standard Time)"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: "Asia/Kolkata",
|
|
207
|
+
label: "GMT+0530 (India Standard Time)"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: "Asia/Singapore",
|
|
211
|
+
label: "GMT+0800 (Singapore)"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: "Asia/Tokyo",
|
|
215
|
+
label: "GMT+0900 (Japan Standard Time)"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: "Australia/Sydney",
|
|
219
|
+
label: "GMT+1000 / GMT+1100 (Australian Eastern)"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: "Pacific/Auckland",
|
|
223
|
+
label: "GMT+1200 / GMT+1300 (New Zealand)"
|
|
224
|
+
}
|
|
225
|
+
], b = {
|
|
226
|
+
small: 380,
|
|
227
|
+
medium: 480,
|
|
228
|
+
large: 600,
|
|
229
|
+
fullscreen: 960,
|
|
230
|
+
fullHeight: 420,
|
|
231
|
+
custom: 600
|
|
232
|
+
};
|
|
233
|
+
function x() {
|
|
234
|
+
return [{
|
|
235
|
+
id: "schedule-slot-1",
|
|
236
|
+
dayPreset: "everyday",
|
|
237
|
+
startTime: "00:00",
|
|
238
|
+
endTime: "23:59"
|
|
239
|
+
}, {
|
|
240
|
+
id: "schedule-slot-2",
|
|
241
|
+
dayPreset: "everyday",
|
|
242
|
+
startTime: "00:00",
|
|
243
|
+
endTime: "23:59"
|
|
244
|
+
}];
|
|
245
|
+
}
|
|
246
|
+
function S() {
|
|
247
|
+
return {
|
|
248
|
+
triggers: {
|
|
249
|
+
onLanding: {
|
|
250
|
+
enabled: !0,
|
|
251
|
+
triggerConditions: !1
|
|
252
|
+
},
|
|
253
|
+
onExit: { enabled: !1 },
|
|
254
|
+
onScroll: {
|
|
255
|
+
enabled: !1,
|
|
256
|
+
scrollPercent: 50,
|
|
257
|
+
triggerConditions: !1
|
|
258
|
+
},
|
|
259
|
+
onClick: {
|
|
260
|
+
enabled: !1,
|
|
261
|
+
clickAnchor: "#popup",
|
|
262
|
+
triggerConditions: !1
|
|
263
|
+
},
|
|
264
|
+
onHover: {
|
|
265
|
+
enabled: !1,
|
|
266
|
+
hoverElementId: "",
|
|
267
|
+
triggerConditions: !1
|
|
268
|
+
},
|
|
269
|
+
onCustomEvent: {
|
|
270
|
+
enabled: !1,
|
|
271
|
+
customEventName: "",
|
|
272
|
+
triggerConditions: !1
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
design: {
|
|
276
|
+
sizePreset: "large",
|
|
277
|
+
contentPadding: {
|
|
278
|
+
top: 24,
|
|
279
|
+
right: 24,
|
|
280
|
+
bottom: 24,
|
|
281
|
+
left: 24
|
|
282
|
+
},
|
|
283
|
+
useOverlay: !0,
|
|
284
|
+
overlayImage: !1,
|
|
285
|
+
backgroundImage: !1,
|
|
286
|
+
multiColumnEnabled: !0,
|
|
287
|
+
multiColumnPreset: "two",
|
|
288
|
+
rtl: !1,
|
|
289
|
+
popupPosition: "center",
|
|
290
|
+
displayAnimation: "smooth",
|
|
291
|
+
displayCloseButton: !0,
|
|
292
|
+
closeButtonPosition: "right",
|
|
293
|
+
closeOnOverlayClick: !0
|
|
294
|
+
},
|
|
295
|
+
schedule: {
|
|
296
|
+
timeZone: "Asia/Kolkata",
|
|
297
|
+
startDate: "",
|
|
298
|
+
endDate: "",
|
|
299
|
+
detailedScheduleEnabled: !0,
|
|
300
|
+
slots: x()
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
function C(e, t) {
|
|
305
|
+
return !t || Object.keys(t).length === 0 ? e : _(e, t);
|
|
306
|
+
}
|
|
307
|
+
function w() {
|
|
308
|
+
return crypto.randomUUID();
|
|
309
|
+
}
|
|
310
|
+
function T(e = 0) {
|
|
311
|
+
return {
|
|
312
|
+
top: e,
|
|
313
|
+
right: e,
|
|
314
|
+
bottom: e,
|
|
315
|
+
left: e
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function E(e = 10) {
|
|
319
|
+
return {
|
|
320
|
+
padding: T(e),
|
|
321
|
+
margin: T(0)
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function D(e = {}) {
|
|
325
|
+
return C({
|
|
326
|
+
id: w(),
|
|
327
|
+
type: "title",
|
|
328
|
+
...n,
|
|
329
|
+
styles: E()
|
|
330
|
+
}, e);
|
|
331
|
+
}
|
|
332
|
+
function O(e = {}) {
|
|
333
|
+
return C({
|
|
334
|
+
id: w(),
|
|
335
|
+
type: "paragraph",
|
|
336
|
+
...r,
|
|
337
|
+
styles: E()
|
|
338
|
+
}, e);
|
|
339
|
+
}
|
|
340
|
+
function k(e = {}) {
|
|
341
|
+
return C({
|
|
342
|
+
id: w(),
|
|
343
|
+
type: "image",
|
|
344
|
+
...i,
|
|
345
|
+
styles: E()
|
|
346
|
+
}, e);
|
|
347
|
+
}
|
|
348
|
+
function A(e = {}) {
|
|
349
|
+
return C({
|
|
350
|
+
id: w(),
|
|
351
|
+
type: "button",
|
|
352
|
+
...a,
|
|
353
|
+
styles: E()
|
|
354
|
+
}, e);
|
|
355
|
+
}
|
|
356
|
+
function j(e = {}) {
|
|
357
|
+
return C({
|
|
358
|
+
id: w(),
|
|
359
|
+
type: "input",
|
|
360
|
+
...ee,
|
|
361
|
+
styles: E()
|
|
362
|
+
}, e);
|
|
363
|
+
}
|
|
364
|
+
function M(e = {}) {
|
|
365
|
+
return C({
|
|
366
|
+
id: w(),
|
|
367
|
+
type: "divider",
|
|
368
|
+
...o,
|
|
369
|
+
styles: E(20)
|
|
370
|
+
}, e);
|
|
371
|
+
}
|
|
372
|
+
function N(e = {}) {
|
|
373
|
+
return C({
|
|
374
|
+
id: w(),
|
|
375
|
+
type: "section",
|
|
376
|
+
...s,
|
|
377
|
+
children: [[]],
|
|
378
|
+
styles: E(20)
|
|
379
|
+
}, e);
|
|
380
|
+
}
|
|
381
|
+
function P(e = {}) {
|
|
382
|
+
return C({
|
|
383
|
+
id: w(),
|
|
384
|
+
type: "video",
|
|
385
|
+
...c,
|
|
386
|
+
styles: E()
|
|
387
|
+
}, e);
|
|
388
|
+
}
|
|
389
|
+
function F(e = {}) {
|
|
390
|
+
return C({
|
|
391
|
+
id: w(),
|
|
392
|
+
type: "social",
|
|
393
|
+
icons: [],
|
|
394
|
+
...l,
|
|
395
|
+
styles: E()
|
|
396
|
+
}, e);
|
|
397
|
+
}
|
|
398
|
+
function I(e = {}) {
|
|
399
|
+
return C({
|
|
400
|
+
id: w(),
|
|
401
|
+
type: "spacer",
|
|
402
|
+
...u,
|
|
403
|
+
styles: E(0)
|
|
404
|
+
}, e);
|
|
405
|
+
}
|
|
406
|
+
function L(e = {}) {
|
|
407
|
+
return C({
|
|
408
|
+
id: w(),
|
|
409
|
+
type: "html",
|
|
410
|
+
...d,
|
|
411
|
+
styles: E()
|
|
412
|
+
}, e);
|
|
413
|
+
}
|
|
414
|
+
function R(e = {}) {
|
|
415
|
+
return C({
|
|
416
|
+
id: w(),
|
|
417
|
+
type: "menu",
|
|
418
|
+
items: [],
|
|
419
|
+
...f,
|
|
420
|
+
styles: E()
|
|
421
|
+
}, e);
|
|
422
|
+
}
|
|
423
|
+
function z(e, t) {
|
|
424
|
+
return Array.from({ length: t }, () => ({
|
|
425
|
+
id: w(),
|
|
426
|
+
cells: Array.from({ length: e }, () => ({
|
|
427
|
+
id: w(),
|
|
428
|
+
content: ""
|
|
429
|
+
}))
|
|
430
|
+
}));
|
|
431
|
+
}
|
|
432
|
+
function B(e = {}) {
|
|
433
|
+
return C({
|
|
434
|
+
id: w(),
|
|
435
|
+
type: "table",
|
|
436
|
+
rows: z(3, 3),
|
|
437
|
+
...p,
|
|
438
|
+
styles: E()
|
|
439
|
+
}, e);
|
|
440
|
+
}
|
|
441
|
+
function V(e = {}) {
|
|
442
|
+
return C({
|
|
443
|
+
id: w(),
|
|
444
|
+
type: "countdown",
|
|
445
|
+
...m,
|
|
446
|
+
styles: E()
|
|
447
|
+
}, e);
|
|
448
|
+
}
|
|
449
|
+
function H(e) {
|
|
450
|
+
return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
|
|
451
|
+
}
|
|
452
|
+
function U(e) {
|
|
453
|
+
let t = {};
|
|
454
|
+
for (let n of e.fields) t[n.key] = H(n);
|
|
455
|
+
return {
|
|
456
|
+
id: w(),
|
|
457
|
+
type: "custom",
|
|
458
|
+
customType: e.type,
|
|
459
|
+
fieldValues: t,
|
|
460
|
+
styles: E(),
|
|
461
|
+
...e.dataSource ? { dataSourceFetched: !1 } : {}
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
function W(e, t) {
|
|
465
|
+
switch (e) {
|
|
466
|
+
case "section": return N(t?.section);
|
|
467
|
+
case "title": return D(t?.title);
|
|
468
|
+
case "paragraph": return O(t?.paragraph);
|
|
469
|
+
case "image": return k(t?.image);
|
|
470
|
+
case "button": return A(t?.button);
|
|
471
|
+
case "input": return j(t?.input);
|
|
472
|
+
case "divider": return M(t?.divider);
|
|
473
|
+
case "video": return P(t?.video);
|
|
474
|
+
case "social": return F(t?.social);
|
|
475
|
+
case "spacer": return I(t?.spacer);
|
|
476
|
+
case "html": return L(t?.html);
|
|
477
|
+
case "menu": return R(t?.menu);
|
|
478
|
+
case "table": return B(t?.table);
|
|
479
|
+
case "countdown": return V(t?.countdown);
|
|
480
|
+
default: throw Error(`Unknown block type: ${e}`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
function G(e) {
|
|
484
|
+
let t = JSON.parse(JSON.stringify(e));
|
|
485
|
+
return t.id = w(), t.type === "section" && (t.children = t.children.map((e) => e.map((e) => G(e)))), t;
|
|
486
|
+
}
|
|
487
|
+
var K = {
|
|
488
|
+
liquid: {
|
|
489
|
+
value: /\{\{.+?\}\}/g,
|
|
490
|
+
logic: /\{%-?\s*(\w+).*?-?%\}/g
|
|
491
|
+
},
|
|
492
|
+
handlebars: {
|
|
493
|
+
value: /\{\{\{?.+?\}?\}\}/g,
|
|
494
|
+
logic: /\{\{[#/](\w+).*?\}\}/g
|
|
495
|
+
},
|
|
496
|
+
mailchimp: {
|
|
497
|
+
value: /\*\|\w+\|\*/g,
|
|
498
|
+
logic: /\*\|(\w+)[:|].*?\|\*/g
|
|
499
|
+
},
|
|
500
|
+
ampscript: {
|
|
501
|
+
value: /%%=.+?=%%/g,
|
|
502
|
+
logic: /%%\[\s*(\w+).*?\]%%/g
|
|
503
|
+
}
|
|
504
|
+
}, q = {
|
|
505
|
+
liquid: "{{",
|
|
506
|
+
handlebars: "{{",
|
|
507
|
+
mailchimp: "*|",
|
|
508
|
+
ampscript: "%%="
|
|
509
|
+
};
|
|
510
|
+
function J(e) {
|
|
511
|
+
for (let t of Object.keys(K)) if (K[t].value.source === e.value.source) return q[t];
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
function Y(e) {
|
|
515
|
+
return e ? typeof e == "string" ? K[e] ?? K.liquid : e : K.liquid;
|
|
516
|
+
}
|
|
517
|
+
function X(e) {
|
|
518
|
+
let t = e.source, n = e.flags.replace("g", "");
|
|
519
|
+
return RegExp(`^${t}$`, n);
|
|
520
|
+
}
|
|
521
|
+
function Z(e, t) {
|
|
522
|
+
let n = e?.trim() || "";
|
|
523
|
+
return X(t.logic).test(n) ? !1 : X(t.value).test(n);
|
|
524
|
+
}
|
|
525
|
+
function Q(e, t) {
|
|
526
|
+
let n = t.find((t) => t.value === e);
|
|
527
|
+
return n ? n.label : e;
|
|
528
|
+
}
|
|
529
|
+
function ne(e, t) {
|
|
530
|
+
return e.replace(/(<span[^>]*\sdata-merge-tag="([^"]*)"[^>]*>)(.*?)(<\/span>)/g, (e, n, r, i, a) => `${n}${Q(r, t)}${a}`);
|
|
531
|
+
}
|
|
532
|
+
function re(e, t) {
|
|
533
|
+
if (!e) return !1;
|
|
534
|
+
let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
|
|
535
|
+
return n.test(e) || r.test(e);
|
|
536
|
+
}
|
|
537
|
+
function ie(e, t) {
|
|
538
|
+
return X(t.logic).test(e?.trim() || "");
|
|
539
|
+
}
|
|
540
|
+
function $(e, t) {
|
|
541
|
+
let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
|
|
542
|
+
return r && r[1] ? r[1].toUpperCase() : e;
|
|
543
|
+
}
|
|
544
|
+
function ae(e, t) {
|
|
545
|
+
return e.replace(/(<span[^>]*\sdata-logic-merge-tag="([^"]*)"[^>]*>)(.*?)(<\/span>)/g, (e, n, r, i, a) => `${n}${$(r, t)}${a}`);
|
|
546
|
+
}
|
|
547
|
+
var oe = class extends Error {
|
|
548
|
+
constructor(e, t) {
|
|
549
|
+
super(e), this.statusCode = t, this.name = "SdkError";
|
|
550
|
+
}
|
|
551
|
+
statusCode;
|
|
552
|
+
get isNotFound() {
|
|
553
|
+
return this.statusCode === 404;
|
|
554
|
+
}
|
|
555
|
+
get isUnauthorized() {
|
|
556
|
+
return this.statusCode === 401;
|
|
557
|
+
}
|
|
558
|
+
get isServerError() {
|
|
559
|
+
return this.statusCode !== void 0 && this.statusCode >= 500;
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
//#endregion
|
|
563
|
+
export { t as A, B as C, $ as D, w as E, ne as F, Y as I, Z as M, v as N, Q as O, ae as P, I as S, P as T, j as _, oe as a, N as b, W as c, U as d, S as f, k as g, L as h, K as i, ie as j, J as k, A as l, M as m, y as n, G as o, te as p, b as r, re as s, e as t, V as u, R as v, D as w, F as x, O as y };
|