@templatical/editor 0.17.1 → 0.19.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.
Files changed (111) hide show
  1. package/dist/{AiChatSidebar-LxCHMdcj.js → AiChatSidebar-DAQTFuvi.js} +2 -2
  2. package/dist/{AiFeatureMenu-Cr8pLXMj.js → AiFeatureMenu-aFSO20PR.js} +3 -3
  3. package/dist/{BlockIssueBadge-BQ1yB1me.js → BlockIssueBadge-BQmq1bxn.js} +2 -2
  4. package/dist/{CloudEditor-qzoNS8K4.js → CloudEditor-D0K-m1GA.js} +15 -13
  5. package/dist/{CollaboratorBar-BkfR0CyD.js → CollaboratorBar-CJO3l6Dt.js} +2 -2
  6. package/dist/ColorPicker-BsgpTJqK.js +552 -0
  7. package/dist/{CommentsSidebar-Cl93TN96.js → CommentsSidebar-BYMVucZh.js} +4 -4
  8. package/dist/{CountdownBlock-DbXfzwae.js → CountdownBlock-Bn5w7C-p.js} +1 -1
  9. package/dist/{CountdownToolbar-BqaMWRyB.js → CountdownToolbar-PJI3ffi1.js} +3 -3
  10. package/dist/{DesignReferenceSidebar-jVrdS8wW.js → DesignReferenceSidebar-QfAV8XT9.js} +13 -14
  11. package/dist/{IssuesPanel-Bq3yXg6M.js → IssuesPanel-CTjRgz8w.js} +2 -2
  12. package/dist/{ModuleBrowserModal-XEHfEO0O.js → ModuleBrowserModal-BNalLx0k.js} +7 -7
  13. package/dist/{ModulePreviewCanvas-BM8XUgbc.js → ModulePreviewCanvas-BwObwisa.js} +2 -2
  14. package/dist/{NumberWithSuffix-9FG7mNnn.js → NumberWithSuffix-D3BKz66W.js} +1 -1
  15. package/dist/{ParagraphEditor-Cs47wU1V.js → ParagraphEditor-Cf75UfSo.js} +42 -42
  16. package/dist/{RichTextEditorContent-DCzmVeyb.js → RichTextEditorContent-MdaLz6Q3.js} +5 -5
  17. package/dist/{SaveModuleDialog-BgOS9vCQ.js → SaveModuleDialog-MTjwiF9D.js} +6 -6
  18. package/dist/{SnapshotHistory-CLfYzwv9.js → SnapshotHistory-C_Y1LzAY.js} +4 -4
  19. package/dist/{TemplateScoringPanel-CMrfa9Rd.js → TemplateScoringPanel-DikuKc6i.js} +3 -3
  20. package/dist/{TestEmailModal-DTLfATNt.js → TestEmailModal-BW8aTtzf.js} +3 -3
  21. package/dist/{TitleEditor-Bq9S0C8Z.js → TitleEditor-CCUkbRN0.js} +7 -7
  22. package/dist/{TplModal-BW0FAtYe.js → TplModal-DoOwUKlT.js} +3 -3
  23. package/dist/{blockTypeIcons-CvSfLeyV.js → blockTypeIcons-BlPKjD7M.js} +1 -1
  24. package/dist/bundle-stats.json +7 -7
  25. package/dist/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +2 -1
  26. package/dist/cdn/chunks/{AiFeatureMenu-B0zH66nO.js → AiFeatureMenu-RwJiaPXZ.js} +5 -5
  27. package/dist/cdn/chunks/{AiFeatureMenu-B0zH66nO.js.map → AiFeatureMenu-RwJiaPXZ.js.map} +1 -1
  28. package/dist/cdn/chunks/{BlockIssueBadge-yD4pKsU9.js → BlockIssueBadge-DM-TDKbr.js} +5 -5
  29. package/dist/cdn/chunks/{BlockIssueBadge-yD4pKsU9.js.map → BlockIssueBadge-DM-TDKbr.js.map} +1 -1
  30. package/dist/cdn/chunks/{CloudEditor-Da-aSmw5.js → CloudEditor-Dufl354p.js} +132 -130
  31. package/dist/cdn/chunks/CloudEditor-Dufl354p.js.map +1 -0
  32. package/dist/cdn/chunks/{CollaboratorBar-DixaFis-.js → CollaboratorBar-xsU20iPl.js} +3 -3
  33. package/dist/cdn/chunks/{CollaboratorBar-DixaFis-.js.map → CollaboratorBar-xsU20iPl.js.map} +1 -1
  34. package/dist/{ColorPicker-DfzDyNKe.js → cdn/chunks/ColorPicker-y_obnw4o.js} +234 -157
  35. package/dist/cdn/chunks/ColorPicker-y_obnw4o.js.map +1 -0
  36. package/dist/cdn/chunks/{CountdownBlock-jgBPbI1p.js → CountdownBlock-sHsRMe1q.js} +2 -2
  37. package/dist/cdn/chunks/{CountdownBlock-jgBPbI1p.js.map → CountdownBlock-sHsRMe1q.js.map} +1 -1
  38. package/dist/cdn/chunks/{CountdownToolbar-DrmZwvIH.js → CountdownToolbar-Ckc_jEi-.js} +4 -4
  39. package/dist/cdn/chunks/{CountdownToolbar-DrmZwvIH.js.map → CountdownToolbar-Ckc_jEi-.js.map} +1 -1
  40. package/dist/cdn/chunks/{IssuesPanel-CpyhXg9M.js → IssuesPanel-DF5Ajuna.js} +7 -7
  41. package/dist/cdn/chunks/{IssuesPanel-CpyhXg9M.js.map → IssuesPanel-DF5Ajuna.js.map} +1 -1
  42. package/dist/cdn/chunks/{ModuleBrowserModal-DPQLFTti.js → ModuleBrowserModal-DG4AVFjH.js} +8 -8
  43. package/dist/cdn/chunks/{ModuleBrowserModal-DPQLFTti.js.map → ModuleBrowserModal-DG4AVFjH.js.map} +1 -1
  44. package/dist/cdn/chunks/{ModulePreviewCanvas-Csc6M0RA.js → ModulePreviewCanvas-Bc_PcJuc.js} +24 -24
  45. package/dist/cdn/chunks/{ModulePreviewCanvas-Csc6M0RA.js.map → ModulePreviewCanvas-Bc_PcJuc.js.map} +1 -1
  46. package/dist/cdn/chunks/{NumberWithSuffix-YmcsBmCd.js → NumberWithSuffix-8fOO-LC_.js} +2 -2
  47. package/dist/cdn/chunks/{NumberWithSuffix-YmcsBmCd.js.map → NumberWithSuffix-8fOO-LC_.js.map} +1 -1
  48. package/dist/cdn/chunks/{ParagraphEditor-DR5AcHB0.js → ParagraphEditor-BkafKSju.js} +107 -107
  49. package/dist/cdn/chunks/{ParagraphEditor-DR5AcHB0.js.map → ParagraphEditor-BkafKSju.js.map} +1 -1
  50. package/dist/cdn/chunks/{RichTextEditorContent-52c2EuCT.js → RichTextEditorContent-BthhzOZS.js} +5 -5
  51. package/dist/cdn/chunks/{RichTextEditorContent-52c2EuCT.js.map → RichTextEditorContent-BthhzOZS.js.map} +1 -1
  52. package/dist/cdn/chunks/{SaveModuleDialog-dpRlVrrQ.js → SaveModuleDialog-DhsfYf2n.js} +4 -4
  53. package/dist/cdn/chunks/{SaveModuleDialog-dpRlVrrQ.js.map → SaveModuleDialog-DhsfYf2n.js.map} +1 -1
  54. package/dist/cdn/chunks/{TitleEditor-DtQTPAg3.js → TitleEditor-DLv9cXba.js} +8 -8
  55. package/dist/cdn/chunks/{TitleEditor-DtQTPAg3.js.map → TitleEditor-DLv9cXba.js.map} +1 -1
  56. package/dist/cdn/chunks/{blockTypeIcons-B0ktHdUG.js → blockTypeIcons-B0uibGX7.js} +7 -7
  57. package/dist/cdn/chunks/{blockTypeIcons-B0ktHdUG.js.map → blockTypeIcons-B0uibGX7.js.map} +1 -1
  58. package/dist/cdn/chunks/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +3 -2
  59. package/dist/cdn/chunks/{ca-CSl--oWR.js.map → ca-DbWoy4rG.js.map} +1 -1
  60. package/dist/cdn/chunks/{de-ZaffrKDP.js → de-CgGOnerg.js} +3 -2
  61. package/dist/cdn/chunks/{de-ZaffrKDP.js.map → de-CgGOnerg.js.map} +1 -1
  62. package/dist/cdn/chunks/{en-CHuXeJDt.js → en-DrUV9xth.js} +3 -2
  63. package/dist/cdn/chunks/{en-CHuXeJDt.js.map → en-DrUV9xth.js.map} +1 -1
  64. package/dist/{es-CaC8VQjO.js → cdn/chunks/es-DwbKjU7q.js} +4 -1
  65. package/dist/cdn/chunks/{es-CaC8VQjO.js.map → es-DwbKjU7q.js.map} +1 -1
  66. package/dist/cdn/chunks/{extensions-CiewgCtw.js → extensions-DLHvZ0UH.js} +19 -19
  67. package/dist/cdn/chunks/{extensions-CiewgCtw.js.map → extensions-DLHvZ0UH.js.map} +1 -1
  68. package/dist/cdn/chunks/{features-DLu_D-6j.js → features-Cnfv4QAY.js} +1442 -1295
  69. package/dist/cdn/chunks/features-Cnfv4QAY.js.map +1 -0
  70. package/dist/cdn/chunks/{icons-B03IY-pm.js → icons-DbcM69bb.js} +2 -2
  71. package/dist/cdn/chunks/{icons-B03IY-pm.js.map → icons-DbcM69bb.js.map} +1 -1
  72. package/dist/cdn/chunks/{media-library-CYF18RNk.js → media-library-DpSMwHd4.js} +524 -524
  73. package/dist/cdn/chunks/{media-library-CYF18RNk.js.map → media-library-DpSMwHd4.js.map} +1 -1
  74. package/dist/cdn/chunks/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +3 -2
  75. package/dist/cdn/chunks/{pt-BR-C74zfEWH.js.map → pt-BR-Bcc5Tjed.js.map} +1 -1
  76. package/dist/cdn/chunks/{quality-LmsngN2B.js → quality-D9QqkRcU.js} +77 -77
  77. package/dist/cdn/chunks/{quality-LmsngN2B.js.map → quality-D9QqkRcU.js.map} +1 -1
  78. package/dist/cdn/chunks/{renderer-DAeNIQqa.js → renderer-BsLQZNXU.js} +14 -14
  79. package/dist/cdn/chunks/{renderer-DAeNIQqa.js.map → renderer-BsLQZNXU.js.map} +1 -1
  80. package/dist/cdn/chunks/{src-CModhUDN.js → src-zu1ehVNN.js} +6 -6
  81. package/dist/cdn/chunks/{src-CModhUDN.js.map → src-zu1ehVNN.js.map} +1 -1
  82. package/dist/cdn/chunks/{styles-hd_LBGaF.js → styles-Dx-jXeCd.js} +184 -184
  83. package/dist/cdn/chunks/{styles-hd_LBGaF.js.map → styles-Dx-jXeCd.js.map} +1 -1
  84. package/dist/cdn/editor.css +1 -1
  85. package/dist/cdn/editor.js +55 -52
  86. package/dist/cdn/editor.js.map +1 -1
  87. package/dist/{cloud-BogxOeZu.js → cloud-B-RebwxI.js} +5 -5
  88. package/dist/{de-ZaffrKDP.js → de-CgGOnerg.js} +2 -1
  89. package/dist/{dist-DoRIUsfz.js → dist-BJbqgyPn.js} +108 -94
  90. package/dist/{en-CHuXeJDt.js → en-DrUV9xth.js} +2 -1
  91. package/dist/{cdn/chunks/es-CaC8VQjO.js → es-DwbKjU7q.js} +2 -3
  92. package/dist/{extensions-DhgbhfBX.js → extensions-BCA9pyer.js} +11 -11
  93. package/dist/index.d.ts +68 -0
  94. package/dist/keys-DFaIbGR8.js +10 -0
  95. package/dist/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +2 -1
  96. package/dist/style.css +1 -1
  97. package/dist/{styles-BWC0jc5-.js → styles-64uLkPJV.js} +136 -136
  98. package/dist/templatical-editor.js +15 -12
  99. package/dist/{upload-BKg6hDRW.js → upload-y4gxiFp5.js} +3 -2
  100. package/dist/{useCloudI18n-CIKI0hCd.js → useCloudI18n-PCDOC2kz.js} +1 -1
  101. package/dist/{useEditorCore-FLMIhtv1.js → useEditorCore-ea9OrrH3.js} +870 -764
  102. package/dist/{useI18n-0EU_JVe7.js → useI18n-BNMzZTM5.js} +1 -1
  103. package/dist/{useMergeTag-C7v6MVah.js → useMergeTag-DfEY0eK5.js} +5 -5
  104. package/dist/{usePopoverPosition-BDqqnMeo.js → usePopoverPosition-F9STHRIr.js} +33 -6
  105. package/package.json +7 -7
  106. package/dist/cdn/chunks/CloudEditor-Da-aSmw5.js.map +0 -1
  107. package/dist/cdn/chunks/ColorPicker-O6xXCPEg.js +0 -471
  108. package/dist/cdn/chunks/ColorPicker-O6xXCPEg.js.map +0 -1
  109. package/dist/cdn/chunks/features-DLu_D-6j.js.map +0 -1
  110. package/dist/keys-WVNarXg8.js +0 -10
  111. package/dist/timeouts-Bmi_yePw.js +0 -4
@@ -128,7 +128,7 @@ var r = {
128
128
  cellPadding: 8,
129
129
  fontSize: 15,
130
130
  textAlign: "left"
131
- }, ee = {
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
- }, h = {
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 g(e) {
173
+ function v(e) {
160
174
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
161
175
  }
162
- function _(e, t) {
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 && (g(i) && g(a) ? n[r] = _(i, a) : n[r] = a);
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 v(e = "Arial", t) {
184
+ function b(e = "Arial", t) {
171
185
  return {
172
186
  blocks: [],
173
187
  settings: {
174
- ...h,
188
+ ..._,
175
189
  fontFamily: e,
176
190
  ...t
177
191
  }
178
192
  };
179
193
  }
180
- function y(e, t) {
181
- return !t || Object.keys(t).length === 0 ? e : _(e, t);
194
+ function x(e, t) {
195
+ return !t || Object.keys(t).length === 0 ? e : y(e, t);
182
196
  }
183
- function b() {
197
+ function S() {
184
198
  return crypto.randomUUID();
185
199
  }
186
- function x(e = 0) {
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 S(e = 10) {
195
- return { padding: x(e) };
208
+ function w(e = 10) {
209
+ return { padding: C(e) };
196
210
  }
197
- function C(e = {}) {
198
- return y({
199
- id: b(),
211
+ function T(e = {}) {
212
+ return x({
213
+ id: S(),
200
214
  type: "title",
201
215
  ...r,
202
- styles: S()
216
+ styles: w()
203
217
  }, e);
204
218
  }
205
- function w(e = {}) {
206
- return y({
207
- id: b(),
219
+ function E(e = {}) {
220
+ return x({
221
+ id: S(),
208
222
  type: "paragraph",
209
223
  ...i,
210
- styles: S()
224
+ styles: w()
211
225
  }, e);
212
226
  }
213
- function T(e = {}) {
214
- return y({
215
- id: b(),
227
+ function D(e = {}) {
228
+ return x({
229
+ id: S(),
216
230
  type: "image",
217
231
  ...a,
218
- styles: S()
232
+ styles: w()
219
233
  }, e);
220
234
  }
221
- function E(e = {}) {
222
- return y({
223
- id: b(),
235
+ function O(e = {}) {
236
+ return x({
237
+ id: S(),
224
238
  type: "button",
225
239
  ...o,
226
- styles: S()
240
+ styles: w()
227
241
  }, e);
228
242
  }
229
- function D(e = {}) {
230
- return y({
231
- id: b(),
243
+ function k(e = {}) {
244
+ return x({
245
+ id: S(),
232
246
  type: "divider",
233
247
  ...s,
234
- styles: S(20)
248
+ styles: w(20)
235
249
  }, e);
236
250
  }
237
- function O(e = {}) {
238
- return y({
239
- id: b(),
251
+ function A(e = {}) {
252
+ return x({
253
+ id: S(),
240
254
  type: "section",
241
255
  ...c,
242
256
  children: [[]],
243
- styles: S(20)
257
+ styles: w(20)
244
258
  }, e);
245
259
  }
246
- function k(e = {}) {
247
- return y({
248
- id: b(),
260
+ function j(e = {}) {
261
+ return x({
262
+ id: S(),
249
263
  type: "video",
250
264
  ...l,
251
- styles: S()
265
+ styles: w()
252
266
  }, e);
253
267
  }
254
- function A(e = {}) {
255
- return y({
256
- id: b(),
268
+ function M(e = {}) {
269
+ return x({
270
+ id: S(),
257
271
  type: "social",
258
272
  icons: [],
259
273
  ...u,
260
- styles: S()
274
+ styles: w()
261
275
  }, e);
262
276
  }
263
- function j(e = {}) {
264
- return y({
265
- id: b(),
277
+ function N(e = {}) {
278
+ return x({
279
+ id: S(),
266
280
  type: "spacer",
267
281
  ...d,
268
- styles: S(0)
282
+ styles: w(0)
269
283
  }, e);
270
284
  }
271
- function M(e = {}) {
272
- return y({
273
- id: b(),
285
+ function P(e = {}) {
286
+ return x({
287
+ id: S(),
274
288
  type: "html",
275
289
  ...f,
276
- styles: S()
290
+ styles: w()
277
291
  }, e);
278
292
  }
279
- function N(e = {}) {
280
- return y({
281
- id: b(),
293
+ function F(e = {}) {
294
+ return x({
295
+ id: S(),
282
296
  type: "menu",
283
297
  items: [],
284
298
  ...p,
285
- styles: S()
299
+ styles: w()
286
300
  }, e);
287
301
  }
288
- function P(e, t) {
302
+ function ee(e, t) {
289
303
  return Array.from({ length: t }, () => ({
290
- id: b(),
304
+ id: S(),
291
305
  cells: Array.from({ length: e }, () => ({
292
- id: b(),
306
+ id: S(),
293
307
  content: ""
294
308
  }))
295
309
  }));
296
310
  }
297
- function F(e = {}) {
298
- return y({
299
- id: b(),
311
+ function I(e = {}) {
312
+ return x({
313
+ id: S(),
300
314
  type: "table",
301
- rows: P(3, 3),
315
+ rows: ee(3, 3),
302
316
  ...m,
303
- styles: S()
317
+ styles: w()
304
318
  }, e);
305
319
  }
306
- function I(e = {}) {
307
- return y({
308
- id: b(),
320
+ function L(e = {}) {
321
+ return x({
322
+ id: S(),
309
323
  type: "countdown",
310
- ...ee,
311
- styles: S()
324
+ ...h,
325
+ styles: w()
312
326
  }, e);
313
327
  }
314
- function te(e) {
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 L(e) {
331
+ function te(e) {
318
332
  let t = {};
319
- for (let n of e.fields) t[n.key] = te(n);
320
- let n = y(S(), e.defaultStyles);
333
+ for (let n of e.fields) t[n.key] = R(n);
334
+ let n = x(w(), e.defaultStyles);
321
335
  return {
322
- id: b(),
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 R(e, t) {
344
+ function ne(e, t) {
331
345
  switch (e) {
332
- case "section": return O(t?.section);
333
- case "title": return C(t?.title);
334
- case "paragraph": return w(t?.paragraph);
335
- case "image": return T(t?.image);
336
- case "button": return E(t?.button);
337
- case "divider": return D(t?.divider);
338
- case "video": return k(t?.video);
339
- case "social": return A(t?.social);
340
- case "spacer": return j(t?.spacer);
341
- case "html": return M(t?.html);
342
- case "menu": return N(t?.menu);
343
- case "table": return F(t?.table);
344
- case "countdown": return I(t?.countdown);
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 = b(), t.type === "section" && (t.children = t.children.map((e) => e.map((e) => z(e)))), t;
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 ne(e, t) {
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 re(e, t) {
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 ie = class extends Error {
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 { J as A, b as C, W as D, G as E, X as M, K as N, n as O, B as P, k as S, Y as T, O as _, z as a, F as b, E as c, v as d, D as f, w as g, N as h, ie as i, re as j, ne as k, I as l, T as m, t as n, Z as o, M as p, V as r, R as s, e as t, L as u, A as v, Q as w, C as x, j as y };
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: "Pick a color",
394
394
  hexValue: "Hex color value",
395
395
  notSet: "Not set",
396
- clear: "Clear color"
396
+ clear: "Clear color",
397
+ presetColors: "Preset colors"
397
398
  },
398
399
  mergeTag: {
399
400
  clickToEdit: "Click to edit",
@@ -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 { T as v, k as y, r as b, w as x } from "./dist-DoRIUsfz.js";
4
- import { t as S } from "./useI18n-0EU_JVe7.js";
5
- import { t as C } from "./useMergeTag-C7v6MVah.js";
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(() => y(v.node.attrs.value, b)), E = d(() => x(v.node.attrs.value, b)), D = a(!1), O = a(""), k = a(null), A = !1;
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: y(e, b) ? x(e, b) : ""
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 (!y(e.attrs.value, this.options.syntax)) return [
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 = x(e.attrs.value, this.options.syntax);
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 (!y(r, this.options.syntax)) return;
240
- let i = x(r, this.options.syntax), a = this.type.create({
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 (!y(r, this.options.syntax)) return;
254
- let i = x(r, this.options.syntax), a = this.type.create({
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 }
@@ -106,6 +109,15 @@ export { MergeTagsConfig }
106
109
  /** Function type for media browser requests, used by both OSS and Cloud editors. */
107
110
  export declare type OnRequestMedia = (context?: MediaRequestContext) => Promise<MediaResult | null>;
108
111
 
112
+ /**
113
+ * Display-only resolver for image `src` values (`config.resolveImageUrl`,
114
+ * #415). Maps a canonical src (e.g. a plain file name like `logo.png`) to a
115
+ * URL the canvas can actually display (e.g. an ephemeral `blob:` URL).
116
+ * Returning `null` (or the input value) means "use the src as-is". The
117
+ * resolved value never enters the content model or the MJML export.
118
+ */
119
+ export declare type ResolveImageUrl = (src: string) => string | null | Promise<string | null>;
120
+
109
121
  export { SaveResult }
110
122
 
111
123
  export { Template }
@@ -221,6 +233,14 @@ export declare interface TemplaticalCloudEditorConfig {
221
233
  */
222
234
  htmlBlockPreview?: HtmlBlockPreviewConfig;
223
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;
224
244
  onChange?: (content: TemplateContent) => void;
225
245
  onSave?: (result: SaveResult) => void;
226
246
  onCreate?: (template: Template) => void;
@@ -310,6 +330,34 @@ export declare interface TemplaticalEditorConfig {
310
330
  onSave?: (content: TemplateContent) => void;
311
331
  onError?: (error: Error) => void;
312
332
  onRequestMedia?: OnRequestMedia;
333
+ /**
334
+ * Display-only resolver for image `src` values. The canvas calls this to
335
+ * obtain a preview URL for a src the user entered; the content model (and
336
+ * `toMjml()` output) always keeps the canonical value. Return `null` — or
337
+ * the input value — to use the src as-is.
338
+ *
339
+ * Use this when templates reference images by a value that isn't directly
340
+ * displayable, e.g. plain file names resolved to ephemeral `blob:` URLs
341
+ * from local storage:
342
+ *
343
+ * ```ts
344
+ * resolveImageUrl: async (src) => {
345
+ * const file = await fileStore.lookup(src);
346
+ * return file ? URL.createObjectURL(file) : null;
347
+ * }
348
+ * ```
349
+ *
350
+ * The resolver is called once per committed src value (typing in the src
351
+ * input is debounced, so partial values never reach it) and results are
352
+ * cached per src for the editor's lifetime — including failures, which
353
+ * fall back to displaying the src verbatim. Note the caching applies to
354
+ * transient failures too: a src that failed to resolve stays unresolved
355
+ * until the editor is re-initialized (a re-resolve hook may be added
356
+ * later). Applies to image srcs, design-time placeholder previews, and
357
+ * explicit video thumbnails; auto-derived provider thumbnails (YouTube/
358
+ * Vimeo) are already real URLs and are never resolved.
359
+ */
360
+ resolveImageUrl?: ResolveImageUrl;
313
361
  mergeTags?: MergeTagsConfig;
314
362
  /**
315
363
  * Standalone logic tags — control-flow tokens (`{% else %}`) and open/close
@@ -359,6 +407,26 @@ export declare interface TemplaticalEditorConfig {
359
407
  */
360
408
  htmlBlockPreview?: HtmlBlockPreviewConfig;
361
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;
362
430
  blockDefaults?: BlockDefaults;
363
431
  templateDefaults?: TemplateDefaults;
364
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 };
@@ -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",