@templatical/editor 0.18.0 → 0.20.0
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/{AiChatSidebar-BWIzNePR.js → AiChatSidebar-ChrE6pUq.js} +10 -10
- package/dist/{AiFeatureMenu-IoLW8c6m.js → AiFeatureMenu-DkQ9HhQ6.js} +7 -7
- package/dist/{BlockIssueBadge-FbyZBJlf.js → BlockIssueBadge-B4QjePax.js} +4 -4
- package/dist/{CloudEditor-txLsdvcR.js → CloudEditor-CfX-aMiV.js} +24 -22
- package/dist/{CollaboratorBar-CpLOFt43.js → CollaboratorBar-DTibhQ1j.js} +3 -3
- package/dist/ColorPicker-4vDYhdGe.js +552 -0
- package/dist/{CommentsSidebar-C8xFu9qy.js → CommentsSidebar-D-o5Stlg.js} +12 -12
- package/dist/{CountdownBlock-CaU40Htk.js → CountdownBlock-Bn5w7C-p.js} +1 -1
- package/dist/{CountdownToolbar-CBbGAxmF.js → CountdownToolbar-D7yQqnA2.js} +3 -3
- package/dist/{DesignReferenceSidebar-BWZgqmT-.js → DesignReferenceSidebar-DnO6ZdwS.js} +10 -10
- package/dist/{IssuesPanel-CBzfmzRM.js → IssuesPanel-X_vkNGrs.js} +7 -7
- package/dist/{ModuleBrowserModal-C9qHpjaS.js → ModuleBrowserModal-AJt--JPh.js} +9 -9
- package/dist/{ModulePreviewCanvas-xEMWMJwf.js → ModulePreviewCanvas-BKYOcVCh.js} +2 -2
- package/dist/{NumberWithSuffix-BreqtON_.js → NumberWithSuffix-Bf3rNxza.js} +1 -1
- package/dist/{ParagraphEditor-iRJI_YbA.js → ParagraphEditor-C5ixOIYb.js} +46 -46
- package/dist/{RichTextEditorContent-DkXai9qP.js → RichTextEditorContent-DwhDnMsG.js} +7 -7
- package/dist/{SaveModuleDialog-DqDmk0rO.js → SaveModuleDialog-B4QX9eiv.js} +7 -7
- package/dist/{SnapshotHistory-BVe5aCHi.js → SnapshotHistory-DaVueFv6.js} +8 -8
- package/dist/{TemplateScoringPanel-CRqt9-T5.js → TemplateScoringPanel-B0UHoTLx.js} +77 -77
- package/dist/{TestEmailModal-jpy4hnYZ.js → TestEmailModal-BkauxF7j.js} +4 -4
- package/dist/{TitleEditor-Bf6Jv2qI.js → TitleEditor-n6WDVDjW.js} +9 -9
- package/dist/{TplModal-DAtccv6o.js → TplModal-BDDyvT-C.js} +3 -3
- package/dist/{blockTypeIcons-CnlwyvkL.js → blockTypeIcons-4D0aFXNg.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +2 -1
- package/dist/cdn/chunks/{AiFeatureMenu-B4oJlFQI.js → AiFeatureMenu-CIBHAGSz.js} +5 -5
- package/dist/cdn/chunks/{AiFeatureMenu-B4oJlFQI.js.map → AiFeatureMenu-CIBHAGSz.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-C7Ts7bT7.js → BlockIssueBadge-CxMiLo3p.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-C7Ts7bT7.js.map → BlockIssueBadge-CxMiLo3p.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BRO-2CcF.js → CloudEditor-CEa3Xgqh.js} +133 -131
- package/dist/cdn/chunks/CloudEditor-CEa3Xgqh.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-BsWOjOCS.js → CollaboratorBar-Bk1gD02G.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-BsWOjOCS.js.map → CollaboratorBar-Bk1gD02G.js.map} +1 -1
- package/dist/cdn/chunks/ColorPicker-ll8pynws.js +550 -0
- package/dist/cdn/chunks/ColorPicker-ll8pynws.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-BUGxk8GI.js → CountdownBlock-eGUE7hhw.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-BUGxk8GI.js.map → CountdownBlock-eGUE7hhw.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-C8tWWfGw.js → CountdownToolbar-C1bkSjUR.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-C8tWWfGw.js.map → CountdownToolbar-C1bkSjUR.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-C5izyrbm.js → IssuesPanel-Csasylf_.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-C5izyrbm.js.map → IssuesPanel-Csasylf_.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-DySKXKFF.js → ModuleBrowserModal-DznWWtBI.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-DySKXKFF.js.map → ModuleBrowserModal-DznWWtBI.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-qqEvLBp2.js → ModulePreviewCanvas-D-h7fr87.js} +8 -8
- package/dist/cdn/chunks/{ModulePreviewCanvas-qqEvLBp2.js.map → ModulePreviewCanvas-D-h7fr87.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-DttdbXsh.js → NumberWithSuffix-Dt-0odUN.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-DttdbXsh.js.map → NumberWithSuffix-Dt-0odUN.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CQJ23PXU.js → ParagraphEditor-v0_XEL-v.js} +110 -110
- package/dist/cdn/chunks/{ParagraphEditor-CQJ23PXU.js.map → ParagraphEditor-v0_XEL-v.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-C4vxiXng.js → RichTextEditorContent-NQExNsaV.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-C4vxiXng.js.map → RichTextEditorContent-NQExNsaV.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-D5eddgzd.js → SaveModuleDialog-BpFhTi-k.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-D5eddgzd.js.map → SaveModuleDialog-BpFhTi-k.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-5TkwDrPL.js → TitleEditor-CS-_MzYs.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-5TkwDrPL.js.map → TitleEditor-CS-_MzYs.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-CbmN4aSw.js → blockTypeIcons-B0Hjh42a.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-CbmN4aSw.js.map → blockTypeIcons-B0Hjh42a.js.map} +1 -1
- package/dist/cdn/chunks/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +3 -2
- package/dist/cdn/chunks/{ca-CSl--oWR.js.map → ca-DbWoy4rG.js.map} +1 -1
- package/dist/{de-ZaffrKDP.js → cdn/chunks/de-CgGOnerg.js} +4 -1
- package/dist/cdn/chunks/{de-ZaffrKDP.js.map → de-CgGOnerg.js.map} +1 -1
- package/dist/cdn/chunks/{en-CHuXeJDt.js → en-DrUV9xth.js} +3 -2
- package/dist/cdn/chunks/{en-CHuXeJDt.js.map → en-DrUV9xth.js.map} +1 -1
- package/dist/{es-CaC8VQjO.js → cdn/chunks/es-DwbKjU7q.js} +4 -1
- package/dist/cdn/chunks/{es-CaC8VQjO.js.map → es-DwbKjU7q.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-B3M4IqhZ.js → extensions-Di3hdIRT.js} +25 -25
- package/dist/cdn/chunks/{extensions-B3M4IqhZ.js.map → extensions-Di3hdIRT.js.map} +1 -1
- package/dist/cdn/chunks/{features-HBwOEo4D.js → features-CLIZ7Q-Y.js} +1129 -1002
- package/dist/cdn/chunks/features-CLIZ7Q-Y.js.map +1 -0
- package/dist/cdn/chunks/{icons-D4vTsN4p.js → icons-GX40Qm2W.js} +2 -2
- package/dist/cdn/chunks/{icons-D4vTsN4p.js.map → icons-GX40Qm2W.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-CfExuiSG.js → media-library-yYAkAagU.js} +537 -537
- package/dist/cdn/chunks/{media-library-CfExuiSG.js.map → media-library-yYAkAagU.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +3 -2
- package/dist/cdn/chunks/{pt-BR-C74zfEWH.js.map → pt-BR-Bcc5Tjed.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-CIwiKF8H.js → pusher-R0v5p99W.js} +27 -22
- package/dist/cdn/chunks/pusher-R0v5p99W.js.map +1 -0
- package/dist/cdn/chunks/quality-DffYv9j5.js +2180 -0
- package/dist/cdn/chunks/{quality-nh1R42eb.js.map → quality-DffYv9j5.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-BLvlUayY.js → renderer-DpBGiXOg.js} +16 -16
- package/dist/cdn/chunks/{renderer-BLvlUayY.js.map → renderer-DpBGiXOg.js.map} +1 -1
- package/dist/cdn/chunks/{src-Cks4RrLL.js → src-9K6uFiuK.js} +6 -6
- package/dist/cdn/chunks/{src-Cks4RrLL.js.map → src-9K6uFiuK.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CPCN13az.js → styles-DHSmjlpX.js} +820 -816
- package/dist/cdn/chunks/styles-DHSmjlpX.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +54 -52
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-Cg6Mc2pP.js → check-Bl4J_tYV.js} +1 -1
- package/dist/{chevron-down-dClfxKrJ.js → chevron-down-COEcl2iP.js} +1 -1
- package/dist/{circle-alert-Bhzm-fNA.js → circle-alert-CvHi5etc.js} +1 -1
- package/dist/{clock-m7TwQw4b.js → clock-CZZw62e8.js} +1 -1
- package/dist/{cloud-BogxOeZu.js → cloud-B-RebwxI.js} +5 -5
- package/dist/{createLucideIcon-FSF4peHQ.js → createLucideIcon-_peTZQtY.js} +2 -2
- package/dist/{cdn/chunks/de-ZaffrKDP.js → de-CgGOnerg.js} +2 -3
- package/dist/{dist-DoRIUsfz.js → dist-BJbqgyPn.js} +108 -94
- package/dist/{en-CHuXeJDt.js → en-DrUV9xth.js} +2 -1
- package/dist/{cdn/chunks/es-CaC8VQjO.js → es-DwbKjU7q.js} +2 -3
- package/dist/{extensions-gpFdCinj.js → extensions-BCA9pyer.js} +11 -11
- package/dist/{image-up-CDEgJqwA.js → image-up-D26rNdfX.js} +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/{info-BNP8yGsK.js → info-CE3JSTqk.js} +1 -1
- package/dist/keys-DFaIbGR8.js +10 -0
- package/dist/{list-checks-jepi4iYr.js → list-checks-BQsLrtBB.js} +1 -1
- package/dist/{loader-circle-BT38qSm3.js → loader-circle-s9Rh5lLd.js} +1 -1
- package/dist/{message-circle-BAHcL9S-.js → message-circle-CI62d690.js} +1 -1
- package/dist/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +2 -1
- package/dist/{refresh-cw-as5Bmg4X.js → refresh-cw-DlYfl65Y.js} +1 -1
- package/dist/{scan-line-IAMjPtRw.js → scan-line-CHadrYVb.js} +1 -1
- package/dist/{send-DvMay6bt.js → send-CbP40otC.js} +1 -1
- package/dist/{shield-check-YYDhGroE.js → shield-check-Bnj9aRoJ.js} +1 -1
- package/dist/{sparkles-CCwQMMMZ.js → sparkles-CncWT57a.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-CJ6WmkYL.js → styles-DkF_-uX8.js} +677 -673
- package/dist/templatical-editor.js +14 -12
- package/dist/{text-align-start-BwsA6QzC.js → text-align-start-B458vzYw.js} +1 -1
- package/dist/{trash-2-CRBDolnR.js → trash-2-DO0yjSU1.js} +1 -1
- package/dist/{triangle-alert-B2g0ALvq.js → triangle-alert-C18_ima6.js} +1 -1
- package/dist/{upload-y4gxiFp5.js → upload-DsCd2zTR.js} +1 -1
- package/dist/{useCloudI18n-DIn74fK2.js → useCloudI18n-PCDOC2kz.js} +1 -1
- package/dist/{useEditorCore-LJJNXXqC.js → useEditorCore-kKUemYY6.js} +1047 -961
- package/dist/{useI18n-OaMLWqhY.js → useI18n-BNMzZTM5.js} +1 -1
- package/dist/{useMergeTag-CZMgwVvr.js → useMergeTag-DfEY0eK5.js} +5 -5
- package/dist/{usePopoverPosition-QDY09q9H.js → usePopoverPosition-F9STHRIr.js} +33 -6
- package/dist/{x-Ctg_250T.js → x-BCFQuE_q.js} +1 -1
- package/package.json +10 -10
- package/dist/ColorPicker-BXCcUYsZ.js +0 -473
- package/dist/cdn/chunks/CloudEditor-BRO-2CcF.js.map +0 -1
- package/dist/cdn/chunks/ColorPicker-DEtVX4gN.js +0 -471
- package/dist/cdn/chunks/ColorPicker-DEtVX4gN.js.map +0 -1
- package/dist/cdn/chunks/features-HBwOEo4D.js.map +0 -1
- package/dist/cdn/chunks/pusher-CIwiKF8H.js.map +0 -1
- package/dist/cdn/chunks/quality-nh1R42eb.js +0 -2180
- package/dist/cdn/chunks/styles-CPCN13az.js.map +0 -1
- package/dist/keys-DAxnnmXs.js +0 -10
|
@@ -128,7 +128,7 @@ var r = {
|
|
|
128
128
|
cellPadding: 8,
|
|
129
129
|
fontSize: 15,
|
|
130
130
|
textAlign: "left"
|
|
131
|
-
},
|
|
131
|
+
}, h = {
|
|
132
132
|
targetDate: "",
|
|
133
133
|
timezone: "UTC",
|
|
134
134
|
showDays: !0,
|
|
@@ -148,7 +148,21 @@ var r = {
|
|
|
148
148
|
expiredMessage: "This offer has expired",
|
|
149
149
|
expiredImageUrl: "",
|
|
150
150
|
hideOnExpiry: !1
|
|
151
|
-
},
|
|
151
|
+
}, g = {
|
|
152
|
+
title: r,
|
|
153
|
+
paragraph: i,
|
|
154
|
+
image: a,
|
|
155
|
+
button: o,
|
|
156
|
+
divider: s,
|
|
157
|
+
section: c,
|
|
158
|
+
video: l,
|
|
159
|
+
social: u,
|
|
160
|
+
spacer: d,
|
|
161
|
+
html: f,
|
|
162
|
+
menu: p,
|
|
163
|
+
table: m,
|
|
164
|
+
countdown: h
|
|
165
|
+
}, _ = {
|
|
152
166
|
width: 600,
|
|
153
167
|
backgroundColor: "#ffffff",
|
|
154
168
|
textColor: "#1a1a1a",
|
|
@@ -156,34 +170,34 @@ var r = {
|
|
|
156
170
|
fontFamily: "Arial",
|
|
157
171
|
locale: "en"
|
|
158
172
|
};
|
|
159
|
-
function
|
|
173
|
+
function v(e) {
|
|
160
174
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
161
175
|
}
|
|
162
|
-
function
|
|
176
|
+
function y(e, t) {
|
|
163
177
|
let n = { ...e };
|
|
164
178
|
for (let r of Object.keys(t)) {
|
|
165
179
|
let i = e[r], a = t[r];
|
|
166
|
-
a !== void 0 && (
|
|
180
|
+
a !== void 0 && (v(i) && v(a) ? n[r] = y(i, a) : n[r] = a);
|
|
167
181
|
}
|
|
168
182
|
return n;
|
|
169
183
|
}
|
|
170
|
-
function
|
|
184
|
+
function b(e = "Arial", t) {
|
|
171
185
|
return {
|
|
172
186
|
blocks: [],
|
|
173
187
|
settings: {
|
|
174
|
-
...
|
|
188
|
+
..._,
|
|
175
189
|
fontFamily: e,
|
|
176
190
|
...t
|
|
177
191
|
}
|
|
178
192
|
};
|
|
179
193
|
}
|
|
180
|
-
function
|
|
181
|
-
return !t || Object.keys(t).length === 0 ? e :
|
|
194
|
+
function x(e, t) {
|
|
195
|
+
return !t || Object.keys(t).length === 0 ? e : y(e, t);
|
|
182
196
|
}
|
|
183
|
-
function
|
|
197
|
+
function S() {
|
|
184
198
|
return crypto.randomUUID();
|
|
185
199
|
}
|
|
186
|
-
function
|
|
200
|
+
function C(e = 0) {
|
|
187
201
|
return {
|
|
188
202
|
top: e,
|
|
189
203
|
right: e,
|
|
@@ -191,135 +205,135 @@ function x(e = 0) {
|
|
|
191
205
|
left: e
|
|
192
206
|
};
|
|
193
207
|
}
|
|
194
|
-
function
|
|
195
|
-
return { padding:
|
|
208
|
+
function w(e = 10) {
|
|
209
|
+
return { padding: C(e) };
|
|
196
210
|
}
|
|
197
|
-
function
|
|
198
|
-
return
|
|
199
|
-
id:
|
|
211
|
+
function T(e = {}) {
|
|
212
|
+
return x({
|
|
213
|
+
id: S(),
|
|
200
214
|
type: "title",
|
|
201
215
|
...r,
|
|
202
|
-
styles:
|
|
216
|
+
styles: w()
|
|
203
217
|
}, e);
|
|
204
218
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
207
|
-
id:
|
|
219
|
+
function E(e = {}) {
|
|
220
|
+
return x({
|
|
221
|
+
id: S(),
|
|
208
222
|
type: "paragraph",
|
|
209
223
|
...i,
|
|
210
|
-
styles:
|
|
224
|
+
styles: w()
|
|
211
225
|
}, e);
|
|
212
226
|
}
|
|
213
|
-
function
|
|
214
|
-
return
|
|
215
|
-
id:
|
|
227
|
+
function D(e = {}) {
|
|
228
|
+
return x({
|
|
229
|
+
id: S(),
|
|
216
230
|
type: "image",
|
|
217
231
|
...a,
|
|
218
|
-
styles:
|
|
232
|
+
styles: w()
|
|
219
233
|
}, e);
|
|
220
234
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
223
|
-
id:
|
|
235
|
+
function O(e = {}) {
|
|
236
|
+
return x({
|
|
237
|
+
id: S(),
|
|
224
238
|
type: "button",
|
|
225
239
|
...o,
|
|
226
|
-
styles:
|
|
240
|
+
styles: w()
|
|
227
241
|
}, e);
|
|
228
242
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
231
|
-
id:
|
|
243
|
+
function k(e = {}) {
|
|
244
|
+
return x({
|
|
245
|
+
id: S(),
|
|
232
246
|
type: "divider",
|
|
233
247
|
...s,
|
|
234
|
-
styles:
|
|
248
|
+
styles: w(20)
|
|
235
249
|
}, e);
|
|
236
250
|
}
|
|
237
|
-
function
|
|
238
|
-
return
|
|
239
|
-
id:
|
|
251
|
+
function A(e = {}) {
|
|
252
|
+
return x({
|
|
253
|
+
id: S(),
|
|
240
254
|
type: "section",
|
|
241
255
|
...c,
|
|
242
256
|
children: [[]],
|
|
243
|
-
styles:
|
|
257
|
+
styles: w(20)
|
|
244
258
|
}, e);
|
|
245
259
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
248
|
-
id:
|
|
260
|
+
function j(e = {}) {
|
|
261
|
+
return x({
|
|
262
|
+
id: S(),
|
|
249
263
|
type: "video",
|
|
250
264
|
...l,
|
|
251
|
-
styles:
|
|
265
|
+
styles: w()
|
|
252
266
|
}, e);
|
|
253
267
|
}
|
|
254
|
-
function
|
|
255
|
-
return
|
|
256
|
-
id:
|
|
268
|
+
function M(e = {}) {
|
|
269
|
+
return x({
|
|
270
|
+
id: S(),
|
|
257
271
|
type: "social",
|
|
258
272
|
icons: [],
|
|
259
273
|
...u,
|
|
260
|
-
styles:
|
|
274
|
+
styles: w()
|
|
261
275
|
}, e);
|
|
262
276
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
265
|
-
id:
|
|
277
|
+
function N(e = {}) {
|
|
278
|
+
return x({
|
|
279
|
+
id: S(),
|
|
266
280
|
type: "spacer",
|
|
267
281
|
...d,
|
|
268
|
-
styles:
|
|
282
|
+
styles: w(0)
|
|
269
283
|
}, e);
|
|
270
284
|
}
|
|
271
|
-
function
|
|
272
|
-
return
|
|
273
|
-
id:
|
|
285
|
+
function P(e = {}) {
|
|
286
|
+
return x({
|
|
287
|
+
id: S(),
|
|
274
288
|
type: "html",
|
|
275
289
|
...f,
|
|
276
|
-
styles:
|
|
290
|
+
styles: w()
|
|
277
291
|
}, e);
|
|
278
292
|
}
|
|
279
|
-
function
|
|
280
|
-
return
|
|
281
|
-
id:
|
|
293
|
+
function F(e = {}) {
|
|
294
|
+
return x({
|
|
295
|
+
id: S(),
|
|
282
296
|
type: "menu",
|
|
283
297
|
items: [],
|
|
284
298
|
...p,
|
|
285
|
-
styles:
|
|
299
|
+
styles: w()
|
|
286
300
|
}, e);
|
|
287
301
|
}
|
|
288
|
-
function
|
|
302
|
+
function ee(e, t) {
|
|
289
303
|
return Array.from({ length: t }, () => ({
|
|
290
|
-
id:
|
|
304
|
+
id: S(),
|
|
291
305
|
cells: Array.from({ length: e }, () => ({
|
|
292
|
-
id:
|
|
306
|
+
id: S(),
|
|
293
307
|
content: ""
|
|
294
308
|
}))
|
|
295
309
|
}));
|
|
296
310
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
299
|
-
id:
|
|
311
|
+
function I(e = {}) {
|
|
312
|
+
return x({
|
|
313
|
+
id: S(),
|
|
300
314
|
type: "table",
|
|
301
|
-
rows:
|
|
315
|
+
rows: ee(3, 3),
|
|
302
316
|
...m,
|
|
303
|
-
styles:
|
|
317
|
+
styles: w()
|
|
304
318
|
}, e);
|
|
305
319
|
}
|
|
306
|
-
function
|
|
307
|
-
return
|
|
308
|
-
id:
|
|
320
|
+
function L(e = {}) {
|
|
321
|
+
return x({
|
|
322
|
+
id: S(),
|
|
309
323
|
type: "countdown",
|
|
310
|
-
...
|
|
311
|
-
styles:
|
|
324
|
+
...h,
|
|
325
|
+
styles: w()
|
|
312
326
|
}, e);
|
|
313
327
|
}
|
|
314
|
-
function
|
|
328
|
+
function R(e) {
|
|
315
329
|
return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
|
|
316
330
|
}
|
|
317
|
-
function
|
|
331
|
+
function te(e) {
|
|
318
332
|
let t = {};
|
|
319
|
-
for (let n of e.fields) t[n.key] =
|
|
320
|
-
let n =
|
|
333
|
+
for (let n of e.fields) t[n.key] = R(n);
|
|
334
|
+
let n = x(w(), e.defaultStyles);
|
|
321
335
|
return {
|
|
322
|
-
id:
|
|
336
|
+
id: S(),
|
|
323
337
|
type: "custom",
|
|
324
338
|
customType: e.type,
|
|
325
339
|
fieldValues: t,
|
|
@@ -327,27 +341,27 @@ function L(e) {
|
|
|
327
341
|
...e.dataSource ? { dataSourceFetched: !1 } : {}
|
|
328
342
|
};
|
|
329
343
|
}
|
|
330
|
-
function
|
|
344
|
+
function ne(e, t) {
|
|
331
345
|
switch (e) {
|
|
332
|
-
case "section": return
|
|
333
|
-
case "title": return
|
|
334
|
-
case "paragraph": return
|
|
335
|
-
case "image": return
|
|
336
|
-
case "button": return
|
|
337
|
-
case "divider": return
|
|
338
|
-
case "video": return
|
|
339
|
-
case "social": return
|
|
340
|
-
case "spacer": return
|
|
341
|
-
case "html": return
|
|
342
|
-
case "menu": return
|
|
343
|
-
case "table": return
|
|
344
|
-
case "countdown": return
|
|
346
|
+
case "section": return A(t?.section);
|
|
347
|
+
case "title": return T(t?.title);
|
|
348
|
+
case "paragraph": return E(t?.paragraph);
|
|
349
|
+
case "image": return D(t?.image);
|
|
350
|
+
case "button": return O(t?.button);
|
|
351
|
+
case "divider": return k(t?.divider);
|
|
352
|
+
case "video": return j(t?.video);
|
|
353
|
+
case "social": return M(t?.social);
|
|
354
|
+
case "spacer": return N(t?.spacer);
|
|
355
|
+
case "html": return P(t?.html);
|
|
356
|
+
case "menu": return F(t?.menu);
|
|
357
|
+
case "table": return I(t?.table);
|
|
358
|
+
case "countdown": return L(t?.countdown);
|
|
345
359
|
default: throw Error(`Unknown block type: ${e}`);
|
|
346
360
|
}
|
|
347
361
|
}
|
|
348
362
|
function z(e) {
|
|
349
363
|
let t = JSON.parse(JSON.stringify(e));
|
|
350
|
-
return t.id =
|
|
364
|
+
return t.id = S(), t.type === "section" && (t.children = t.children.map((e) => e.map((e) => z(e)))), t;
|
|
351
365
|
}
|
|
352
366
|
function B(e) {
|
|
353
367
|
let t = /* @__PURE__ */ new WeakSet();
|
|
@@ -418,14 +432,14 @@ function Z(e, t) {
|
|
|
418
432
|
let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
|
|
419
433
|
return n.test(e) || r.test(e);
|
|
420
434
|
}
|
|
421
|
-
function
|
|
435
|
+
function re(e, t) {
|
|
422
436
|
return q(t.logic).test(e?.trim() || "");
|
|
423
437
|
}
|
|
424
438
|
function Q(e, t) {
|
|
425
439
|
let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
|
|
426
440
|
return r && r[1] ? r[1].toUpperCase() : e;
|
|
427
441
|
}
|
|
428
|
-
function
|
|
442
|
+
function ie(e, t) {
|
|
429
443
|
return $(e, "data-logic-merge-tag", (e) => Q(e, t));
|
|
430
444
|
}
|
|
431
445
|
function $(e, t, n) {
|
|
@@ -461,7 +475,7 @@ function $(e, t, n) {
|
|
|
461
475
|
}
|
|
462
476
|
return i;
|
|
463
477
|
}
|
|
464
|
-
var
|
|
478
|
+
var ae = class extends Error {
|
|
465
479
|
statusCode;
|
|
466
480
|
constructor(e, t) {
|
|
467
481
|
super(e), this.statusCode = t, this.name = "SdkError";
|
|
@@ -477,4 +491,4 @@ var ie = class extends Error {
|
|
|
477
491
|
}
|
|
478
492
|
};
|
|
479
493
|
//#endregion
|
|
480
|
-
export {
|
|
494
|
+
export { n as A, T as C, Y as D, Q as E, K as F, B as I, J as M, ie as N, G as O, X as P, I as S, S as T, F as _, V as a, M as b, Z as c, L as d, te as f, D as g, P as h, t as i, re as j, W as k, ne as l, k as m, _ as n, ae as o, b as p, e as r, z as s, g as t, O as u, E as v, j as w, N as x, A as y };
|
|
@@ -393,7 +393,8 @@ var e = {
|
|
|
393
393
|
pickColor: "Elegir un color",
|
|
394
394
|
hexValue: "Valor de color Hex",
|
|
395
395
|
notSet: "No establecido",
|
|
396
|
-
clear: "Limpiar color"
|
|
396
|
+
clear: "Limpiar color",
|
|
397
|
+
presetColors: "Colores predefinidos"
|
|
397
398
|
},
|
|
398
399
|
mergeTag: {
|
|
399
400
|
clickToEdit: "Haz clic para editar",
|
|
@@ -558,5 +559,3 @@ var e = {
|
|
|
558
559
|
};
|
|
559
560
|
//#endregion
|
|
560
561
|
export { e as default };
|
|
561
|
-
|
|
562
|
-
//# sourceMappingURL=es-CaC8VQjO.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Dt as e, Et as t, O as n, Ot as r, R as i, Y as a, _ as o, c as s, d as c, l, nt as u, s as d, u as f, w as p, z as m } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
|
|
2
2
|
import { a as h, c as g, s as _ } from "./runtime-dom.esm-bundler-GdMI8WqG.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as S } from "./useI18n-
|
|
5
|
-
import { t as C } from "./useMergeTag-
|
|
3
|
+
import { D as v, E as y, a as b, j as x } from "./dist-BJbqgyPn.js";
|
|
4
|
+
import { t as S } from "./useI18n-BNMzZTM5.js";
|
|
5
|
+
import { t as C } from "./useMergeTag-DfEY0eK5.js";
|
|
6
6
|
import { i as w, o as T, p as E, qt as D, u as O } from "./dist-CgTKuIUN.js";
|
|
7
7
|
import { i as k, r as A, t as j } from "./MergeTagSuggestion-DCuaSOPQ.js";
|
|
8
8
|
import { n as M, t as N } from "./dist-8TKf-Jpg.js";
|
|
@@ -87,7 +87,7 @@ var P = w.create({
|
|
|
87
87
|
updateAttributes: { type: Function }
|
|
88
88
|
},
|
|
89
89
|
setup(o) {
|
|
90
|
-
let v = o, { syntax: b } = C(), { t: w } = S(), T = d(() =>
|
|
90
|
+
let v = o, { syntax: b } = C(), { t: w } = S(), T = d(() => x(v.node.attrs.value, b)), E = d(() => y(v.node.attrs.value, b)), D = a(!1), O = a(""), k = a(null), A = !1;
|
|
91
91
|
function j() {
|
|
92
92
|
O.value = v.node.attrs.value, A = !1, D.value = !0, p(() => {
|
|
93
93
|
k.value?.focus(), k.value?.select();
|
|
@@ -103,7 +103,7 @@ var P = w.create({
|
|
|
103
103
|
}
|
|
104
104
|
e !== v.node.attrs.value && v.updateAttributes({
|
|
105
105
|
value: e,
|
|
106
|
-
keyword:
|
|
106
|
+
keyword: x(e, b) ? y(e, b) : ""
|
|
107
107
|
}), D.value = !1;
|
|
108
108
|
}
|
|
109
109
|
function P(e) {
|
|
@@ -207,12 +207,12 @@ var U = O.create({
|
|
|
207
207
|
return [{ tag: "span[data-logic-merge-tag]" }];
|
|
208
208
|
},
|
|
209
209
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
210
|
-
if (!
|
|
210
|
+
if (!x(e.attrs.value, this.options.syntax)) return [
|
|
211
211
|
"span",
|
|
212
212
|
{},
|
|
213
213
|
e.attrs.value
|
|
214
214
|
];
|
|
215
|
-
let n =
|
|
215
|
+
let n = y(e.attrs.value, this.options.syntax);
|
|
216
216
|
return [
|
|
217
217
|
"span",
|
|
218
218
|
D(t, {
|
|
@@ -236,8 +236,8 @@ var U = O.create({
|
|
|
236
236
|
find: RegExp(this.options.syntax.logic.source + "$", ""),
|
|
237
237
|
handler: ({ state: e, range: t, match: n }) => {
|
|
238
238
|
let r = n[0];
|
|
239
|
-
if (!
|
|
240
|
-
let i =
|
|
239
|
+
if (!x(r, this.options.syntax)) return;
|
|
240
|
+
let i = y(r, this.options.syntax), a = this.type.create({
|
|
241
241
|
value: r,
|
|
242
242
|
keyword: i
|
|
243
243
|
});
|
|
@@ -250,8 +250,8 @@ var U = O.create({
|
|
|
250
250
|
find: new RegExp(this.options.syntax.logic.source, "g"),
|
|
251
251
|
handler: ({ state: e, range: t, match: n }) => {
|
|
252
252
|
let r = n[0];
|
|
253
|
-
if (!
|
|
254
|
-
let i =
|
|
253
|
+
if (!x(r, this.options.syntax)) return;
|
|
254
|
+
let i = y(r, this.options.syntax), a = this.type.create({
|
|
255
255
|
value: r,
|
|
256
256
|
keyword: i
|
|
257
257
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AiConfig } from '@templatical/types';
|
|
2
2
|
import { BlockDefaults } from '@templatical/types';
|
|
3
3
|
import type { CollaborationConfig } from '@templatical/types';
|
|
4
|
+
import { ColorsConfig } from '@templatical/types';
|
|
4
5
|
import type { CommentEvent } from '@templatical/types';
|
|
5
6
|
import { ComputedRef } from 'vue';
|
|
6
7
|
import type { CustomBlock } from '@templatical/types';
|
|
@@ -28,6 +29,8 @@ import { ViewportSize } from '@templatical/types';
|
|
|
28
29
|
|
|
29
30
|
export { BlockDefaults }
|
|
30
31
|
|
|
32
|
+
export { ColorsConfig }
|
|
33
|
+
|
|
31
34
|
export { CustomBlockDefinition }
|
|
32
35
|
|
|
33
36
|
export { CustomFont }
|
|
@@ -230,6 +233,14 @@ export declare interface TemplaticalCloudEditorConfig {
|
|
|
230
233
|
*/
|
|
231
234
|
htmlBlockPreview?: HtmlBlockPreviewConfig;
|
|
232
235
|
fonts?: FontsConfig;
|
|
236
|
+
/**
|
|
237
|
+
* Editor-wide color-picker palette. `presets` render as a clickable grid in
|
|
238
|
+
* every color picker popover; `allowCustom: false` (with `presets`) hides the
|
|
239
|
+
* wheel and hex input so authors can only pick from the palette. Ignored with
|
|
240
|
+
* a warning when no `presets` are configured. See `colors` on the OSS editor
|
|
241
|
+
* config for details and an example.
|
|
242
|
+
*/
|
|
243
|
+
colors?: ColorsConfig;
|
|
233
244
|
onChange?: (content: TemplateContent) => void;
|
|
234
245
|
onSave?: (result: SaveResult) => void;
|
|
235
246
|
onCreate?: (template: Template) => void;
|
|
@@ -396,6 +407,26 @@ export declare interface TemplaticalEditorConfig {
|
|
|
396
407
|
*/
|
|
397
408
|
htmlBlockPreview?: HtmlBlockPreviewConfig;
|
|
398
409
|
fonts?: FontsConfig;
|
|
410
|
+
/**
|
|
411
|
+
* Editor-wide color-picker palette. `presets` appear as a clickable grid in
|
|
412
|
+
* every color picker popover (block toolbars, template settings, rich-text
|
|
413
|
+
* color, custom-block color fields) — clicking one applies it, and the preset
|
|
414
|
+
* matching the current value is marked selected.
|
|
415
|
+
*
|
|
416
|
+
* ```ts
|
|
417
|
+
* colors: {
|
|
418
|
+
* presets: ['#0b5cff', '#111827', '#6b7280', '#ffffff'],
|
|
419
|
+
* allowCustom: false, // lock authors to the presets above
|
|
420
|
+
* }
|
|
421
|
+
* ```
|
|
422
|
+
*
|
|
423
|
+
* `allowCustom` defaults to `true`. Set it to `false` (together with
|
|
424
|
+
* `presets`) to hide the wheel and hex input so authors can only pick from the
|
|
425
|
+
* palette — useful when embedding the editor as a white-label / brand-kit
|
|
426
|
+
* tool. `allowCustom: false` is ignored, with a warning, when no `presets` are
|
|
427
|
+
* configured, since that would leave the picker with no way to set a color.
|
|
428
|
+
*/
|
|
429
|
+
colors?: ColorsConfig;
|
|
399
430
|
blockDefaults?: BlockDefaults;
|
|
400
431
|
templateDefaults?: TemplateDefaults;
|
|
401
432
|
theme?: ThemeOverrides;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { x as e } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
|
|
2
|
+
//#region src/keys.ts
|
|
3
|
+
var t = Symbol("translations"), n = Symbol("editor"), r = Symbol("history"), i = Symbol("blockActions"), a = Symbol("conditionPreview"), o = Symbol("fontsManager"), s = Symbol("themeStyles"), c = Symbol("tplUiTheme"), l = Symbol("blockDefaults"), u = Symbol("blockRegistry"), d = Symbol("customBlockDefinitions"), f = Symbol("paletteBlocks"), p = Symbol("htmlBlockPreview"), m = Symbol("colors"), h = Symbol("customBlockStylesheets"), g = Symbol("mergeTags"), _ = Symbol("mergeTagSyntax"), v = Symbol("onRequestMergeTag"), y = Symbol("mergeTagAutocomplete"), b = Symbol("mergeTagPicker"), x = Symbol("logicTags"), S = Symbol("logicPairs"), C = Symbol("logicPicker"), w = Symbol("onRequestLogic"), T = Symbol("onRequestMedia"), E = Symbol("imageUrlResolver"), D = Symbol("displayConditions"), O = Symbol("allowCustomConditions"), k = Symbol("capabilities"), A = Symbol("keyboardReorder"), j = Symbol("templateLint"), M = Symbol("editorRoot"), N = Symbol("popoverRoot"), P = Symbol("authManager"), F = Symbol("aiConfig"), I = Symbol("comments"), L = Symbol("savedModulesHeadless"), R = Symbol("scoring"), z = Symbol("cloudTranslations");
|
|
4
|
+
function B(t, n) {
|
|
5
|
+
let r = e(t, null);
|
|
6
|
+
if (r == null) throw Error(`${n} requires a provider for ${t.description ?? "unknown key"}. Ensure it is a descendant of Editor or CloudEditor.`);
|
|
7
|
+
return r;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { T as A, B, x as C, b as D, y as E, R as F, j as I, s as L, f as M, N, _ as O, L as P, t as R, S, g as T, o as _, l as a, E as b, z as c, a as d, d as f, M as g, n as h, i, v as j, w as k, m as l, D as m, O as n, u as o, h as p, P as r, k as s, F as t, I as u, r as v, C as w, A as x, p as y, c as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./createLucideIcon-
|
|
1
|
+
import { t as e } from "./createLucideIcon-_peTZQtY.js";
|
|
2
2
|
var t = e("message-circle", [["path", {
|
|
3
3
|
d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",
|
|
4
4
|
key: "1sd12s"
|
|
@@ -393,7 +393,8 @@ var e = {
|
|
|
393
393
|
pickColor: "Escolher uma cor",
|
|
394
394
|
hexValue: "Valor hexadecimal da cor",
|
|
395
395
|
notSet: "Não definido",
|
|
396
|
-
clear: "Limpar cor"
|
|
396
|
+
clear: "Limpar cor",
|
|
397
|
+
presetColors: "Cores predefinidas"
|
|
397
398
|
},
|
|
398
399
|
mergeTag: {
|
|
399
400
|
clickToEdit: "Clique para editar",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./createLucideIcon-
|
|
1
|
+
import { t as e } from "./createLucideIcon-_peTZQtY.js";
|
|
2
2
|
var t = e("eye", [["path", {
|
|
3
3
|
d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
|
|
4
4
|
key: "1nclc0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./createLucideIcon-
|
|
1
|
+
import { t as e } from "./createLucideIcon-_peTZQtY.js";
|
|
2
2
|
var t = e("send", [["path", {
|
|
3
3
|
d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
|
|
4
4
|
key: "1ffxy3"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./createLucideIcon-
|
|
1
|
+
import { t as e } from "./createLucideIcon-_peTZQtY.js";
|
|
2
2
|
var t = e("shield-check", [["path", {
|
|
3
3
|
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
4
4
|
key: "oel41y"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./createLucideIcon-
|
|
1
|
+
import { t as e } from "./createLucideIcon-_peTZQtY.js";
|
|
2
2
|
var t = e("sparkles", [
|
|
3
3
|
["path", {
|
|
4
4
|
d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",
|