@aswin.dev/editor 0.7.1 → 0.7.2

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.
Files changed (144) hide show
  1. package/LICENSE +56 -0
  2. package/dist/{AccessibilityPanel-COL6Wm7p.js → AccessibilityPanel-EmQ19wiS.js} +1 -1
  3. package/dist/{AiChatSidebar-DWGPVtvC.js → AiChatSidebar-DeB0w_32.js} +38 -52
  4. package/dist/{AiFeatureMenu-duUFSfDf.js → AiFeatureMenu-DoLD5Cde.js} +5 -5
  5. package/dist/{BlockA11yBadge-Qs6HtXid.js → BlockA11yBadge-DkNbDvJA.js} +1 -1
  6. package/dist/{CloudEditor-CFldoCOb.js → CloudEditor-zo9PjjvY.js} +255 -248
  7. package/dist/{CollaboratorBar-Bw-lbt61.js → CollaboratorBar-BsXMY-8e.js} +3 -3
  8. package/dist/{CommentsSidebar-BaD5F53-.js → CommentsSidebar-DIWIa4rS.js} +6 -6
  9. package/dist/{CountdownToolbar-Dg4F8MTk.js → CountdownToolbar-BuS8p5ju.js} +2 -2
  10. package/dist/{DesignReferenceSidebar-BSH7uNP_.js → DesignReferenceSidebar-RDlnhL-6.js} +5 -5
  11. package/dist/{LoadingTrack-Ba2pfF57.js → LoadingTrack-BJ59h9ok.js} +1 -1
  12. package/dist/{ModuleBrowserModal-6phxZSKI.js → ModuleBrowserModal-b7HbpByz.js} +7 -7
  13. package/dist/{ModulePreviewCanvas-BW8L3eQX.js → ModulePreviewCanvas-D__YlOLS.js} +1 -1
  14. package/dist/{NumberWithSuffix-BpUzQOJt.js → NumberWithSuffix-Ca3vNY84.js} +1 -1
  15. package/dist/{ParagraphEditor-DNSzAB-I.js → ParagraphEditor-B1aYPO-6.js} +18 -18
  16. package/dist/{RichTextEditorContent-CrqPQdnk.js → RichTextEditorContent-BmEVMrkJ.js} +1 -1
  17. package/dist/{SaveModuleDialog-zMQTpez7.js → SaveModuleDialog-ClovqI6h.js} +3 -3
  18. package/dist/{SnapshotHistory-Do-A5rYU.js → SnapshotHistory-DoqtH0cw.js} +3 -3
  19. package/dist/{TemplateScoringPanel-CS7o62zS.js → TemplateScoringPanel-DQv2ZAiL.js} +7 -7
  20. package/dist/{TestEmailModal-DGj_9V1u.js → TestEmailModal-iIeYJYsj.js} +3 -3
  21. package/dist/{TitleEditor-C7IDnAoS.js → TitleEditor-CTDIwRF_.js} +7 -7
  22. package/dist/{TplModal-BAsVzcTb.js → TplModal-CBq1J1pG.js} +1 -1
  23. package/dist/{blockTypeIcons-C6LDKvmd.js → blockTypeIcons-QkC6f5UE.js} +1 -1
  24. package/dist/bundle-stats.json +7 -7
  25. package/dist/cdn/chunks/AccessibilityPanel-BeU8nz7A.js +97 -0
  26. package/dist/cdn/chunks/AccessibilityPanel-BeU8nz7A.js.map +1 -0
  27. package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js +59 -0
  28. package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js.map +1 -0
  29. package/dist/cdn/chunks/BlockA11yBadge-C4g77gF0.js +33 -0
  30. package/dist/cdn/chunks/BlockA11yBadge-C4g77gF0.js.map +1 -0
  31. package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js +1183 -0
  32. package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js.map +1 -0
  33. package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js +51 -0
  34. package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js.map +1 -0
  35. package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js +93 -0
  36. package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js.map +1 -0
  37. package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js +212 -0
  38. package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js.map +1 -0
  39. package/dist/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js +195 -0
  40. package/dist/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js.map +1 -0
  41. package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js +109 -0
  42. package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js.map +1 -0
  43. package/dist/cdn/chunks/NumberWithSuffix-Ty1bp9vB.js +423 -0
  44. package/dist/cdn/chunks/NumberWithSuffix-Ty1bp9vB.js.map +1 -0
  45. package/dist/cdn/chunks/ParagraphEditor-BA1WbHI7.js +544 -0
  46. package/dist/cdn/chunks/ParagraphEditor-BA1WbHI7.js.map +1 -0
  47. package/dist/cdn/chunks/RichTextEditorContent-BtWCA_Oc.js +106 -0
  48. package/dist/cdn/chunks/RichTextEditorContent-BtWCA_Oc.js.map +1 -0
  49. package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js +119 -0
  50. package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js.map +1 -0
  51. package/dist/cdn/chunks/TitleEditor-DbSyeixS.js +171 -0
  52. package/dist/cdn/chunks/TitleEditor-DbSyeixS.js.map +1 -0
  53. package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js +23 -0
  54. package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js.map +1 -0
  55. package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
  56. package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
  57. package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
  58. package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
  59. package/dist/cdn/chunks/de-_tooy3Q8.js +771 -0
  60. package/dist/cdn/chunks/de-_tooy3Q8.js.map +1 -0
  61. package/dist/cdn/chunks/draggable-C-1_gch3.js +11572 -0
  62. package/dist/cdn/chunks/draggable-C-1_gch3.js.map +1 -0
  63. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
  64. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
  65. package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
  66. package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
  67. package/dist/cdn/chunks/en-CNqLoIm9.js +771 -0
  68. package/dist/cdn/chunks/en-CNqLoIm9.js.map +1 -0
  69. package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
  70. package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
  71. package/dist/cdn/chunks/extensions-BVKQw_sp.js +598 -0
  72. package/dist/cdn/chunks/extensions-BVKQw_sp.js.map +1 -0
  73. package/dist/cdn/chunks/features-DIBEo4xl.js +7913 -0
  74. package/dist/cdn/chunks/features-DIBEo4xl.js.map +1 -0
  75. package/dist/cdn/chunks/icons-C1Gg-ov-.js +992 -0
  76. package/dist/cdn/chunks/icons-C1Gg-ov-.js.map +1 -0
  77. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
  78. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
  79. package/dist/cdn/chunks/media-library-BTF_Ko70.js +6014 -0
  80. package/dist/cdn/chunks/media-library-BTF_Ko70.js.map +1 -0
  81. package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
  82. package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
  83. package/dist/cdn/chunks/quality-C5AmotmP.js +1456 -0
  84. package/dist/cdn/chunks/quality-C5AmotmP.js.map +1 -0
  85. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  86. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  87. package/dist/cdn/chunks/renderer-D0L44Vlp.js +642 -0
  88. package/dist/cdn/chunks/renderer-D0L44Vlp.js.map +1 -0
  89. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  90. package/dist/cdn/chunks/src-RKexlYjA.js +497 -0
  91. package/dist/cdn/chunks/src-RKexlYjA.js.map +1 -0
  92. package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js +57 -0
  93. package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js.map +1 -0
  94. package/dist/cdn/chunks/styles-CQR6ed13.js +4976 -0
  95. package/dist/cdn/chunks/styles-CQR6ed13.js.map +1 -0
  96. package/dist/cdn/chunks/tiptap-CDzAbF2j.js +14654 -0
  97. package/dist/cdn/chunks/tiptap-CDzAbF2j.js.map +1 -0
  98. package/dist/cdn/editor.css +2 -0
  99. package/dist/cdn/editor.js +338 -0
  100. package/dist/cdn/editor.js.map +1 -0
  101. package/dist/{cloud-6ZmAvF0j.js → cloud-DJG4tb4_.js} +1 -1
  102. package/dist/{de-DWcgp-7T.js → de-2LEvILeZ.js} +40 -0
  103. package/dist/{dist-DtiDUrX-.js → dist-BHAeXaUY.js} +1 -1
  104. package/dist/{dist-BUzw1buG.js → dist-BSJvAvH3.js} +1 -1
  105. package/dist/{dist-COSzWQUs.js → dist-BeFnymxK.js} +1 -1
  106. package/dist/dist-Bmir0gYb.js +1167 -0
  107. package/dist/{dist-C3T2AKtB.js → dist-BvPgo-UK.js} +1 -1
  108. package/dist/{dist-C9ckKEZL.js → dist-CPVBKMmd.js} +1 -1
  109. package/dist/{dist-BadNx4qo.js → dist-Df4ie7vZ.js} +1 -1
  110. package/dist/{dist-CBItRG-Z.js → dist-DxOoemkW.js} +1 -1
  111. package/dist/{dist-Dzt5foyL.js → dist-HEQ52gTJ.js} +1 -1
  112. package/dist/{dist-BZyY-SS4.js → dist-b-XUqAoF.js} +1 -1
  113. package/dist/{dist-Bz3M4RXG.js → dist-kZfaVUpW.js} +3 -3
  114. package/dist/{dist-BesOh2mk.js → dist-wfAedlzi.js} +1 -1
  115. package/dist/{en-Cxd4fhNm.js → en-D2RU2Poj.js} +40 -0
  116. package/dist/{extensions-D__hOlV1.js → extensions-BQ1xXx3d.js} +21 -21
  117. package/dist/index.d.ts +17 -6
  118. package/dist/style.css +1 -1
  119. package/dist/{styles-B4tjX5SP.js → styles-CavWjvol.js} +1573 -1310
  120. package/dist/templatical-editor.js +161 -132
  121. package/dist/undo-2-Cg8I7obC.js +16 -0
  122. package/dist/{useEditorCore-wslttMH-.js → useEditorCore-BGnzcT7p.js} +37 -37
  123. package/dist/{useMergeTag-DX0XG5V9.js → useMergeTag-CfuZq2fF.js} +3 -3
  124. package/package.json +12 -12
  125. package/dist/dist-C04s_fLA.js +0 -563
  126. /package/dist/{CountdownBlock-DaYGxKqo.js → CountdownBlock-BCi7-DAM.js} +0 -0
  127. /package/dist/{_plugin-vue_export-helper-BVAJ4lgT.js → _plugin-vue_export-helper-Bwh4ceeO.js} +0 -0
  128. /package/dist/{de-GOtR9DwW.js → de-D2npYjrZ.js} +0 -0
  129. /package/dist/{dist-DXa1uAMh.js → dist-DvHLtWVP.js} +0 -0
  130. /package/dist/{emojiData-DrBuvEoP.js → emojiData-DvQBBzmO.js} +0 -0
  131. /package/dist/{en-dFFQVzNn.js → en-ib-4h3_o.js} +0 -0
  132. /package/dist/{formatRelativeTime-BhhO8yCl.js → formatRelativeTime-CFDZnEIs.js} +0 -0
  133. /package/dist/{liquid.browser-BvCyLQII.js → liquid.browser-7Rv0QDiO.js} +0 -0
  134. /package/dist/{readableTextColor-DVuzNX1y.js → readableTextColor-C_9OpzBw.js} +0 -0
  135. /package/dist/{scan-line-CzfFJO1o.js → scan-line-DlghmhNf.js} +0 -0
  136. /package/dist/{send-D2eSo4GH.js → send-DDdhIRj8.js} +0 -0
  137. /package/dist/{shield-check-jkpgcC0-.js → shield-check-OSQ-JVTX.js} +0 -0
  138. /package/dist/{sparkles-Chm5CZfb.js → sparkles-BN4a-CoF.js} +0 -0
  139. /package/dist/{styleConstants-34eUKPOZ.js → styleConstants-wWRbcuEK.js} +0 -0
  140. /package/dist/{text-align-start-CzBnJsW8.js → text-align-start-D1weisjS.js} +0 -0
  141. /package/dist/{trash-2-CtK2apEH.js → trash-2-CMWvQ5KX.js} +0 -0
  142. /package/dist/{triangle-alert-KpDVNbpn.js → triangle-alert-DyidRNX_.js} +0 -0
  143. /package/dist/{useCloudI18n-DOKSZql1.js → useCloudI18n-BTTNBk5i.js} +0 -0
  144. /package/dist/{x-BkaOMosX.js → x-CgIhNcT9.js} +0 -0
@@ -1,563 +0,0 @@
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 };
File without changes
File without changes
File without changes
File without changes
File without changes