@aswin.dev/editor 0.7.0 → 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 (182) hide show
  1. package/LICENSE +56 -0
  2. package/README.md +3 -3
  3. package/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-EmQ19wiS.js} +37 -37
  4. package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-DeB0w_32.js} +67 -81
  5. package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-DoLD5Cde.js} +22 -22
  6. package/dist/{BlockA11yBadge-CXDLqkcJ.js → BlockA11yBadge-DkNbDvJA.js} +12 -12
  7. package/dist/CloudEditor-zo9PjjvY.js +1214 -0
  8. package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-BsXMY-8e.js} +21 -21
  9. package/dist/CommentsSidebar-DIWIa4rS.js +436 -0
  10. package/dist/CountdownBlock-BCi7-DAM.js +92 -0
  11. package/dist/CountdownToolbar-BuS8p5ju.js +210 -0
  12. package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-RDlnhL-6.js} +58 -58
  13. package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-BJ59h9ok.js} +2 -2
  14. package/dist/ModuleBrowserModal-b7HbpByz.js +206 -0
  15. package/dist/ModulePreviewCanvas-D__YlOLS.js +108 -0
  16. package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-Ca3vNY84.js} +87 -87
  17. package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-B1aYPO-6.js} +182 -182
  18. package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-BmEVMrkJ.js} +38 -38
  19. package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-ClovqI6h.js} +28 -28
  20. package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-DoqtH0cw.js} +45 -50
  21. package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-DQv2ZAiL.js} +75 -75
  22. package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-iIeYJYsj.js} +28 -28
  23. package/dist/{TitleEditor-fStSADI-.js → TitleEditor-CTDIwRF_.js} +68 -68
  24. package/dist/{TplModal-BwSfxIHf.js → TplModal-CBq1J1pG.js} +14 -14
  25. package/dist/{accessibility-e8JYu_zd.js → accessibility-BU09xZrQ.js} +1 -1
  26. package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-QkC6f5UE.js} +19 -5
  27. package/dist/bundle-stats.json +7 -7
  28. package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js → AccessibilityPanel-BeU8nz7A.js} +28 -28
  29. package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js.map → AccessibilityPanel-BeU8nz7A.js.map} +1 -1
  30. package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js → AiFeatureMenu-B2mhscyP.js} +21 -21
  31. package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js.map +1 -0
  32. package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js → BlockA11yBadge-C4g77gF0.js} +11 -11
  33. package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js.map → BlockA11yBadge-C4g77gF0.js.map} +1 -1
  34. package/dist/{CloudEditor-BCz1ZTYC.js → cdn/chunks/CloudEditor-Btyr0b0_.js} +486 -475
  35. package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js.map +1 -0
  36. package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js → CollaboratorBar-YBiIjiRh.js} +15 -15
  37. package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js.map +1 -0
  38. package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js +93 -0
  39. package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js.map +1 -0
  40. package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js +212 -0
  41. package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js.map +1 -0
  42. package/dist/{ModuleBrowserModal-DrUFMTDx.js → cdn/chunks/ModuleBrowserModal-C2CDWKW6.js} +51 -62
  43. package/dist/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js.map +1 -0
  44. package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js +109 -0
  45. package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js.map +1 -0
  46. package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js → NumberWithSuffix-Ty1bp9vB.js} +64 -64
  47. package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js.map → NumberWithSuffix-Ty1bp9vB.js.map} +1 -1
  48. package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js → ParagraphEditor-BA1WbHI7.js} +188 -188
  49. package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js.map → ParagraphEditor-BA1WbHI7.js.map} +1 -1
  50. package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js → RichTextEditorContent-BtWCA_Oc.js} +30 -30
  51. package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js.map → RichTextEditorContent-BtWCA_Oc.js.map} +1 -1
  52. package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js → SaveModuleDialog-AwL0tkCV.js} +21 -21
  53. package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js.map +1 -0
  54. package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js → TitleEditor-DbSyeixS.js} +65 -65
  55. package/dist/cdn/chunks/TitleEditor-DbSyeixS.js.map +1 -0
  56. package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js +23 -0
  57. package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js.map +1 -0
  58. package/dist/cdn/chunks/{de-D8CnZxV9.js → de-_tooy3Q8.js} +250 -2
  59. package/dist/cdn/chunks/de-_tooy3Q8.js.map +1 -0
  60. package/dist/cdn/chunks/{draggable-Bcb86AsV.js → draggable-C-1_gch3.js} +2 -2
  61. package/dist/cdn/chunks/{draggable-Bcb86AsV.js.map → draggable-C-1_gch3.js.map} +1 -1
  62. package/dist/cdn/chunks/{en-8FHaQv4V.js → en-CNqLoIm9.js} +250 -2
  63. package/dist/cdn/chunks/en-CNqLoIm9.js.map +1 -0
  64. package/dist/cdn/chunks/{extensions-DIxF31tA.js → extensions-BVKQw_sp.js} +107 -107
  65. package/dist/cdn/chunks/extensions-BVKQw_sp.js.map +1 -0
  66. package/dist/cdn/chunks/{features-DEMb13KS.js → features-DIBEo4xl.js} +3388 -2289
  67. package/dist/cdn/chunks/features-DIBEo4xl.js.map +1 -0
  68. package/dist/cdn/chunks/{icons-CsLTcirh.js → icons-C1Gg-ov-.js} +346 -54
  69. package/dist/cdn/chunks/icons-C1Gg-ov-.js.map +1 -0
  70. package/dist/cdn/chunks/{media-library-CVaNvhpM.js → media-library-BTF_Ko70.js} +985 -985
  71. package/dist/cdn/chunks/media-library-BTF_Ko70.js.map +1 -0
  72. package/dist/cdn/chunks/{quality-BaBfc54_.js → quality-C5AmotmP.js} +312 -312
  73. package/dist/cdn/chunks/quality-C5AmotmP.js.map +1 -0
  74. package/dist/cdn/chunks/{renderer-CUxvx7ro.js → renderer-D0L44Vlp.js} +236 -142
  75. package/dist/cdn/chunks/renderer-D0L44Vlp.js.map +1 -0
  76. package/dist/cdn/chunks/{src-CRaqN-p8.js → src-RKexlYjA.js} +161 -161
  77. package/dist/cdn/chunks/src-RKexlYjA.js.map +1 -0
  78. package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js +57 -0
  79. package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js.map +1 -0
  80. package/dist/cdn/chunks/styles-CQR6ed13.js +4976 -0
  81. package/dist/cdn/chunks/styles-CQR6ed13.js.map +1 -0
  82. package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js → tiptap-CDzAbF2j.js} +43 -43
  83. package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js.map → tiptap-CDzAbF2j.js.map} +1 -1
  84. package/dist/cdn/editor.css +1 -1
  85. package/dist/cdn/editor.js +211 -123
  86. package/dist/cdn/editor.js.map +1 -1
  87. package/dist/{check-Da05j8yl.js → check-DJrpDKO_.js} +1 -1
  88. package/dist/{chevron-down-R2uY34iD.js → chevron-down-C5oBUhT8.js} +1 -1
  89. package/dist/chevron-right-BqCptpdp.js +10 -0
  90. package/dist/{circle-alert-DZuGWPX-.js → circle-alert-ZQQc98HC.js} +1 -1
  91. package/dist/{clock-CRp2sIub.js → clock-ik2pRJKG.js} +1 -1
  92. package/dist/{cloud-DEk_b4CR.js → cloud-DJG4tb4_.js} +485 -427
  93. package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-ClREiSx3.js} +6 -6
  94. package/dist/{de-Brqvgr43.js → de-2LEvILeZ.js} +249 -1
  95. package/dist/{dist-Cp0zXPAD.js → dist-BHAeXaUY.js} +1 -1
  96. package/dist/{dist-BaQIYPsn.js → dist-BSJvAvH3.js} +1 -1
  97. package/dist/{dist-wzMIGj-D.js → dist-BeFnymxK.js} +1 -1
  98. package/dist/dist-Bmir0gYb.js +1167 -0
  99. package/dist/{dist-DDJIWTRY.js → dist-BvPgo-UK.js} +1 -1
  100. package/dist/{dist-BFawx6IS.js → dist-CPVBKMmd.js} +51 -51
  101. package/dist/dist-CivF9P8b.js +382 -0
  102. package/dist/{dist-D6uC2xhi.js → dist-Df4ie7vZ.js} +1 -1
  103. package/dist/{dist-us-RpCWN.js → dist-DxOoemkW.js} +1 -1
  104. package/dist/{dist-KoBJjK1G.js → dist-HEQ52gTJ.js} +1 -1
  105. package/dist/{dist-DjviJBCi.js → dist-b-XUqAoF.js} +1 -1
  106. package/dist/{dist-D90y8dvT.js → dist-kZfaVUpW.js} +3 -3
  107. package/dist/{dist-aRzjfSRN.js → dist-wfAedlzi.js} +1 -1
  108. package/dist/{en-WDVp87TE.js → en-D2RU2Poj.js} +249 -1
  109. package/dist/{extensions-CUcl9Ok4.js → extensions-BQ1xXx3d.js} +103 -103
  110. package/dist/{image-up-MBZKKg9p.js → image-up-DT7gcJLN.js} +1 -1
  111. package/dist/index.d.ts +102 -14
  112. package/dist/{info-CJEC7piy.js → info-BSPGcsSM.js} +1 -1
  113. package/dist/keys-CvX8D-8C.js +10 -0
  114. package/dist/{loader-circle-DsY5Yg33.js → loader-circle-Balo8p3d.js} +1 -1
  115. package/dist/{message-circle-yElBbR2C.js → message-circle-B39qAHxs.js} +1 -1
  116. package/dist/pencil-BZJPNYWR.js +10 -0
  117. package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-DwDqGUM0.js} +1 -1
  118. package/dist/{scan-line-D0vcUekt.js → scan-line-DlghmhNf.js} +1 -1
  119. package/dist/{send-DH4oDQqC.js → send-DDdhIRj8.js} +1 -1
  120. package/dist/{shield-check-CfJgs2Hd.js → shield-check-OSQ-JVTX.js} +1 -1
  121. package/dist/{sparkles-CvRXGqFs.js → sparkles-BN4a-CoF.js} +1 -1
  122. package/dist/style.css +1 -1
  123. package/dist/styleConstants-wWRbcuEK.js +55 -0
  124. package/dist/styles-CavWjvol.js +5487 -0
  125. package/dist/templatical-editor.js +211 -119
  126. package/dist/{text-align-start-BT9VUDxK.js → text-align-start-D1weisjS.js} +1 -1
  127. package/dist/{trash-2-DbP2Y6t2.js → trash-2-CMWvQ5KX.js} +1 -1
  128. package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-DyidRNX_.js} +1 -1
  129. package/dist/undo-2-Cg8I7obC.js +16 -0
  130. package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-BTTNBk5i.js} +2 -2
  131. package/dist/{useEditorCore-C6ost42Q.js → useEditorCore-BGnzcT7p.js} +2424 -2249
  132. package/dist/{useI18n-lb2DHDiu.js → useI18n-C2xQZ6K9.js} +2 -2
  133. package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-CfuZq2fF.js} +4 -4
  134. package/dist/{vue.runtime.esm-bundler-DpvJL-nX.js → vue.runtime.esm-bundler-CjauPXjj.js} +1 -1
  135. package/dist/{x-u2oVmjN_.js → x-CgIhNcT9.js} +1 -1
  136. package/package.json +15 -15
  137. package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
  138. package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
  139. package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
  140. package/dist/ModulePreviewCanvas-CHdOwV_4.js +0 -106
  141. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +0 -1
  142. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +0 -1143
  143. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +0 -1
  144. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +0 -1
  145. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +0 -93
  146. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +0 -1
  147. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
  148. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +0 -1
  149. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +0 -195
  150. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +0 -1
  151. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +0 -107
  152. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +0 -1
  153. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +0 -1
  154. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +0 -1
  155. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +0 -22
  156. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +0 -1
  157. package/dist/cdn/chunks/de-D8CnZxV9.js.map +0 -1
  158. package/dist/cdn/chunks/en-8FHaQv4V.js.map +0 -1
  159. package/dist/cdn/chunks/extensions-DIxF31tA.js.map +0 -1
  160. package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
  161. package/dist/cdn/chunks/icons-CsLTcirh.js.map +0 -1
  162. package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +0 -1
  163. package/dist/cdn/chunks/quality-BaBfc54_.js.map +0 -1
  164. package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +0 -1
  165. package/dist/cdn/chunks/src-CRaqN-p8.js.map +0 -1
  166. package/dist/cdn/chunks/styleConstants-DP1VOca8.js +0 -57
  167. package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +0 -1
  168. package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
  169. package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
  170. package/dist/dist-B1IR0bpH.js +0 -326
  171. package/dist/dist-DJmnUmW9.js +0 -362
  172. package/dist/keys-ciNfSSGj.js +0 -10
  173. package/dist/styleConstants-fWzlIIwN.js +0 -55
  174. package/dist/styles-DEXEkBvg.js +0 -3176
  175. /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-Bwh4ceeO.js} +0 -0
  176. /package/dist/{de-DCaaCE5s.js → de-D2npYjrZ.js} +0 -0
  177. /package/dist/{dist-iLBdeBDR.js → dist-DvHLtWVP.js} +0 -0
  178. /package/dist/{emojiData-PQyVa4bU.js → emojiData-DvQBBzmO.js} +0 -0
  179. /package/dist/{en-DXCyK4-X.js → en-ib-4h3_o.js} +0 -0
  180. /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-CFDZnEIs.js} +0 -0
  181. /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-7Rv0QDiO.js} +0 -0
  182. /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-C_9OpzBw.js} +0 -0
@@ -1,218 +1,282 @@
1
- import { $ as e, H as t, M as n, N as r, S as i, U as a, _ as o, at as s, b as c, c as l, ct as ee, g as u, h as d, j as f, lt as p, m, n as te, r as h, st as g, w as _, y as v } from "./chunks/draggable-Bcb86AsV.js";
2
- import { J as y, Ln as b, dn as x, k as S, tt as C } from "./chunks/features-DEMb13KS.js";
3
- import { C as w } from "./chunks/icons-CsLTcirh.js";
4
- import { a as ne, c as re, i as ie, n as T, o as E, r as D, s as O, t as k } from "./chunks/styles-BHJULjNR.js";
1
+ import { C as e, F as t, G as n, M as r, N as i, P as a, T as o, W as s, _ as c, b as l, ct as u, dt as d, f, ft as p, g as m, h, l as g, m as _, n as ee, r as v, tt as y, ut as b, v as x, x as S } from "./chunks/draggable-C-1_gch3.js";
2
+ import { Nn as te, Pn as ne, Sn as re, Y as C, cn as w, k as ie, nn as ae, nt as T, rr as E } from "./chunks/features-DIBEo4xl.js";
3
+ import { T as D } from "./chunks/icons-C1Gg-ov-.js";
4
+ import { a as oe, c as se, d as ce, f as le, h as ue, i as de, l as fe, m as pe, n as me, o as O, p as k, r as A, s as j, t as M, u as N } from "./chunks/styles-CQR6ed13.js";
5
5
  //#region src/Editor.vue?vue&type=script&setup=true&lang.ts
6
- var A = ["data-tpl-theme"], j = {
6
+ var P = ["data-tpl-theme"], F = {
7
7
  class: "tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4 tpl:shadow-[var(--tpl-shadow-md)] tpl:border-b tpl:border-[var(--tpl-border)]",
8
8
  style: {
9
9
  "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
10
10
  "backdrop-filter": "blur(12px)",
11
11
  "-webkit-backdrop-filter": "blur(12px)"
12
12
  }
13
- }, M = { class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, N = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, P = { class: "tpl:flex tpl:justify-center tpl:p-8" }, F = ["aria-label"], I = /* @__PURE__ */ C(/* @__PURE__ */ i({
13
+ }, I = { class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, L = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, R = { class: "tpl:flex tpl:justify-center tpl:p-8" }, he = ["aria-label"], z = /* @__PURE__ */ T(/* @__PURE__ */ e({
14
14
  __name: "Editor",
15
15
  props: {
16
16
  config: {},
17
17
  translations: {},
18
18
  fontsManager: {}
19
19
  },
20
- setup(e, { expose: i }) {
21
- let h = e, _ = x({
22
- content: h.config.content,
23
- templateDefaults: h.config.templateDefaults
24
- }), y = S({
25
- editor: _,
20
+ setup(e, { expose: o }) {
21
+ let v = y(null), C = e, T = re({
22
+ content: C.config.content,
23
+ templateDefaults: C.config.templateDefaults
24
+ }), E = ie({
25
+ editor: T,
26
26
  config: {
27
- uiTheme: h.config.uiTheme,
28
- theme: h.config.theme,
29
- blockDefaults: h.config.blockDefaults,
30
- customBlocks: h.config.customBlocks,
31
- mergeTags: h.config.mergeTags,
32
- displayConditions: h.config.displayConditions,
33
- onRequestMedia: h.config.onRequestMedia,
34
- accessibility: re(h.config),
35
- onSave: h.config.onSave ? () => h.config.onSave(JSON.parse(JSON.stringify(_.state.content))) : void 0
27
+ uiTheme: C.config.uiTheme,
28
+ theme: C.config.theme,
29
+ blockDefaults: C.config.blockDefaults,
30
+ customBlocks: C.config.customBlocks,
31
+ mergeTags: C.config.mergeTags,
32
+ displayConditions: C.config.displayConditions,
33
+ onRequestMedia: C.config.onRequestMedia,
34
+ editorType: C.config.editorType,
35
+ accessibility: ue(C.config),
36
+ onSave: C.config.onSave ? () => C.config.onSave(JSON.parse(JSON.stringify(T.state.content))) : void 0
36
37
  },
37
- translations: h.translations,
38
- fontsManager: h.fontsManager,
39
- autoSaveOptions: h.config.onChange ? { onChange: () => h.config.onChange(JSON.parse(JSON.stringify(_.state.content))) } : null
38
+ translations: C.translations,
39
+ fontsManager: C.fontsManager,
40
+ autoSaveOptions: C.config.onChange ? { onChange: () => C.config.onChange(JSON.parse(JSON.stringify(T.state.content))) } : null
40
41
  });
41
- return f(async () => {
42
- await h.fontsManager.loadCustomFonts();
43
- }), n(() => {
44
- h.fontsManager.cleanupFontLinks(), y.destroy();
45
- }), i({
46
- getContent: () => _.content.value,
47
- setContent: (e) => _.setContent(e),
48
- setTheme: (e) => _.setUiTheme(e),
49
- renderCustomBlock: y.registry.renderCustomBlock
50
- }), (n, i) => (r(), o("div", {
51
- class: g(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": s(_).state.darkMode }]),
52
- "data-tpl-theme": s(y).resolvedTheme.value,
53
- style: ee(s(y).themeStyles.value)
42
+ r(async () => {
43
+ if (await C.fontsManager.loadCustomFonts(), w(C.config.editorType) === "popup" && !T.content.value.settings.popup) {
44
+ let e = ne();
45
+ T.updateSettings({
46
+ popup: e,
47
+ width: te[e.design.sizePreset]
48
+ });
49
+ }
50
+ }), i(() => {
51
+ C.fontsManager.cleanupFontLinks(), E.destroy();
52
+ });
53
+ let O = y("blocks");
54
+ t(ae, O);
55
+ let z = _(() => w(C.config.editorType) === "popup"), B = _(() => z.value && O.value === "displayRules"), V = _(() => z.value && O.value === "schedule"), H = _(() => O.value === "design"), U = _(() => z.value && (B.value || V.value || H.value)), W = _(() => {
56
+ if (T.state.previewMode) return ["tpl:left-0", "tpl:right-0"];
57
+ if (!z.value) return ["tpl:left-12", "tpl:right-[320px]"];
58
+ let e;
59
+ return e = O.value === "blocks" ? "tpl:left-[272px]" : H.value ? "tpl:left-[392px]" : "tpl:left-[72px]", [e, U.value ? "tpl:right-0" : "tpl:right-[320px]"];
60
+ }), G = _(() => B.value || V.value);
61
+ return o({
62
+ getContent: () => T.content.value,
63
+ setContent: (e) => T.setContent(e),
64
+ setTheme: (e) => T.setUiTheme(e),
65
+ undo: () => E.history.undo(),
66
+ redo: () => E.history.redo(),
67
+ canUndo: () => E.history.canUndo.value,
68
+ canRedo: () => E.history.canRedo.value,
69
+ renderCustomBlock: E.registry.renderCustomBlock,
70
+ startTour: (e) => v.value?.start(e),
71
+ dismissTour: () => v.value?.dismiss(),
72
+ resetTourDismissed: () => de(C.config.tour),
73
+ isTourDismissed: () => C.config.tour ? oe(C.config.tour) : !0
74
+ }), (t, r) => (a(), x("div", {
75
+ class: b(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": u(T).state.darkMode }]),
76
+ "data-tpl-theme": u(E).resolvedTheme.value,
77
+ style: d(u(E).themeStyles.value)
54
78
  }, [
55
- m("header", j, [
56
- i[5] ||= m("div", { class: "tpl:flex tpl:items-center tpl:gap-2.5" }, null, -1),
57
- m("div", M, [
58
- c(ie, {
59
- viewport: s(_).state.viewport,
60
- onChange: s(_).setViewport
79
+ h("header", F, [
80
+ r[5] ||= h("div", { class: "tpl:flex tpl:items-center tpl:gap-2.5" }, null, -1),
81
+ h("div", I, [
82
+ S(ce),
83
+ S(N, {
84
+ viewport: u(T).state.viewport,
85
+ onChange: u(T).setViewport
61
86
  }, null, 8, ["viewport", "onChange"]),
62
- c(T, {
63
- "dark-mode": s(_).state.darkMode,
64
- onChange: s(_).setDarkMode
87
+ S(se, {
88
+ "dark-mode": u(T).state.darkMode,
89
+ onChange: u(T).setDarkMode
65
90
  }, null, 8, ["dark-mode", "onChange"]),
66
- c(D, {
67
- "preview-mode": s(_).state.previewMode,
68
- onChange: s(_).setPreviewMode
91
+ S(fe, {
92
+ "preview-mode": u(T).state.previewMode,
93
+ onChange: u(T).setPreviewMode
69
94
  }, null, 8, ["preview-mode", "onChange"])
70
95
  ]),
71
- i[6] ||= m("div", { class: "tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, null, -1)
96
+ r[6] ||= h("div", { class: "tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, null, -1)
72
97
  ]),
73
- a(c(E, null, null, 512), [[l, !s(_).state.previewMode]]),
74
- m("div", {
75
- class: g(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto tpl:bg-[var(--tpl-canvas-bg)]", [s(_).state.previewMode ? "tpl:left-0 tpl:right-0" : "tpl:left-12 tpl:right-[320px]", "tpl:top-14"]]),
76
- style: { transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)" }
77
- }, [m("div", N, [c(te, { name: "tpl-restore-btn" }, {
78
- default: t(() => [s(y).conditionPreview.hasHiddenBlocks.value ? (r(), o("button", {
98
+ n(S(k, null, null, 512), [[g, !u(T).state.previewMode]]),
99
+ h("div", {
100
+ class: b(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...W.value, "tpl:top-14"]]),
101
+ style: d({
102
+ transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
103
+ backgroundColor: G.value ? "var(--tpl-bg)" : "var(--tpl-canvas-bg)"
104
+ })
105
+ }, [z.value && O.value === "displayRules" ? (a(), m(me, { key: 0 })) : z.value && O.value === "schedule" ? (a(), m(M, {
106
+ key: 1,
107
+ layout: "standalone"
108
+ })) : (a(), x(f, { key: 2 }, [h("div", L, [S(ee, { name: "tpl-restore-btn" }, {
109
+ default: s(() => [u(E).conditionPreview.hasHiddenBlocks.value ? (a(), x("button", {
79
110
  key: 0,
80
111
  class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80 tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)] tpl:border-[var(--tpl-warning)]",
81
112
  style: { "backdrop-filter": "blur(8px)" },
82
- onClick: i[0] ||= (e) => s(y).conditionPreview.reset()
83
- }, [c(s(w), {
113
+ onClick: r[0] ||= (e) => u(E).conditionPreview.reset()
114
+ }, [S(u(D), {
84
115
  size: 13,
85
116
  "stroke-width": 2
86
- }), v(" " + p(s(y).t.blockSettings.restoreHiddenBlocks), 1)])) : u("", !0)]),
117
+ }), l(" " + p(u(E).t.blockSettings.restoreHiddenBlocks), 1)])) : c("", !0)]),
87
118
  _: 1
88
- })]), m("div", P, [c(O, {
89
- viewport: s(_).state.viewport,
90
- content: s(_).content.value,
91
- "selected-block-id": s(_).state.selectedBlockId,
92
- "dark-mode": s(_).state.darkMode,
93
- "preview-mode": s(_).state.previewMode,
94
- onSelectBlock: s(_).selectBlock
119
+ })]), h("div", R, [S(pe, {
120
+ viewport: u(T).state.viewport,
121
+ content: u(T).content.value,
122
+ "selected-block-id": u(T).state.selectedBlockId,
123
+ "dark-mode": u(T).state.darkMode,
124
+ "preview-mode": u(T).state.previewMode,
125
+ "multi-page-canvas": e.config.multiPageCanvas ?? !1,
126
+ onSelectBlock: u(T).selectBlock
95
127
  }, null, 8, [
96
128
  "viewport",
97
129
  "content",
98
130
  "selected-block-id",
99
131
  "dark-mode",
100
132
  "preview-mode",
133
+ "multi-page-canvas",
101
134
  "onSelectBlock"
102
- ])])], 2),
103
- e.config.branding === !1 ? u("", !0) : (r(), d(k, {
135
+ ])])], 64))], 6),
136
+ e.config.branding === !1 ? c("", !0) : (a(), m(j, {
104
137
  key: 0,
105
- "position-class": [s(_).state.previewMode ? "tpl:left-0 tpl:right-0" : "tpl:left-12 tpl:right-[320px]"]
138
+ "position-class": W.value
106
139
  }, null, 8, ["position-class"])),
107
- m("div", {
140
+ h("div", {
108
141
  class: "tpl-sr-only",
109
142
  role: "status",
110
143
  "aria-live": "polite",
111
144
  "aria-atomic": "true",
112
- "aria-label": s(y).t.landmarks.reorderAnnouncements
113
- }, p(s(y).keyboardReorder.announcement.value), 9, F),
114
- a(c(ne, {
115
- "selected-block": s(_).selectedBlock.value,
116
- settings: s(_).content.value.settings,
117
- onUpdateBlock: i[1] ||= (e) => s(_).updateBlock(s(_).state.selectedBlockId, e),
118
- onDeleteBlock: i[2] ||= () => {
119
- s(_).state.selectedBlockId && s(y).blockActions.deleteBlock(s(_).state.selectedBlockId);
145
+ "aria-label": u(E).t.landmarks.reorderAnnouncements
146
+ }, p(u(E).keyboardReorder.announcement.value), 9, he),
147
+ n(S(le, {
148
+ "selected-block": u(T).selectedBlock.value,
149
+ settings: u(T).content.value.settings,
150
+ onUpdateBlock: r[1] ||= (e) => u(T).updateBlock(u(T).state.selectedBlockId, e),
151
+ onDeleteBlock: r[2] ||= () => {
152
+ u(T).state.selectedBlockId && u(E).blockActions.deleteBlock(u(T).state.selectedBlockId);
120
153
  },
121
- onDuplicateBlock: i[3] ||= () => {
122
- s(_).selectedBlock.value && s(y).blockActions.duplicateBlock(s(_).selectedBlock.value);
154
+ onDuplicateBlock: r[3] ||= () => {
155
+ u(T).selectedBlock.value && u(E).blockActions.duplicateBlock(u(T).selectedBlock.value);
123
156
  },
124
- onUpdateSettings: i[4] ||= (e) => s(_).updateSettings(e)
125
- }, null, 8, ["selected-block", "settings"]), [[l, !s(_).state.previewMode]])
126
- ], 14, A));
157
+ onUpdateSettings: r[4] ||= (e) => u(T).updateSettings(e)
158
+ }, null, 8, ["selected-block", "settings"]), [[g, !u(T).state.previewMode && !U.value]]),
159
+ e.config.tour ? (a(), m(A, {
160
+ key: 1,
161
+ ref_key: "editorTourRef",
162
+ ref: v,
163
+ "tour-config": e.config.tour,
164
+ "dark-mode": u(T).state.darkMode
165
+ }, null, 8, ["tour-config", "dark-mode"])) : c("", !0)
166
+ ], 14, P));
127
167
  }
128
- }), [["__scopeId", "data-v-9ffdcb5e"]]), L = /* @__PURE__ */ Object.assign({
129
- "./locales/de.ts": () => import("./chunks/de-D8CnZxV9.js"),
130
- "./locales/en.ts": () => import("./chunks/en-8FHaQv4V.js")
131
- }), R = /* @__PURE__ */ Object.assign({
168
+ }), [["__scopeId", "data-v-040fed1e"]]), B = /* @__PURE__ */ Object.assign({
169
+ "./locales/de.ts": () => import("./chunks/de-_tooy3Q8.js"),
170
+ "./locales/en.ts": () => import("./chunks/en-CNqLoIm9.js")
171
+ }), V = /* @__PURE__ */ Object.assign({
132
172
  "./locales/cloud/de.ts": () => import("./chunks/de-RQrZR56a.js"),
133
173
  "./locales/cloud/en.ts": () => import("./chunks/en-Bl1ecfRF.js")
134
174
  });
135
- function z(e) {
175
+ function H(e) {
136
176
  return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
137
177
  }
138
- var B = z(L), V = z(R);
139
- function H(e) {
178
+ var U = H(B), W = H(V);
179
+ function G(e) {
140
180
  return e.split("-")[0].toLowerCase();
141
181
  }
142
- function U(e, t) {
143
- let n = H(e);
182
+ function K(e, t) {
183
+ let n = G(e);
144
184
  return t.includes(n) ? n : "en";
145
185
  }
146
- async function W(e) {
147
- let t = L[`./locales/${U(e, B)}.ts`];
186
+ async function q(e) {
187
+ let t = B[`./locales/${K(e, U)}.ts`];
148
188
  return (await t()).default;
149
189
  }
150
- async function G(e) {
151
- let t = R[`./locales/cloud/${U(e, V)}.ts`];
190
+ async function ge(e) {
191
+ let t = V[`./locales/cloud/${K(e, W)}.ts`];
152
192
  return (await t()).default;
153
193
  }
154
194
  //#endregion
155
195
  //#region src/utils/toMjml.ts
156
- async function K(e) {
196
+ async function _e(e) {
157
197
  let t;
158
198
  try {
159
- t = await import("./chunks/renderer-CUxvx7ro.js").then((e) => e.t);
199
+ t = await import("./chunks/renderer-D0L44Vlp.js").then((e) => e.t);
160
200
  } catch {
161
- throw Error("[Templatical] toMjml() requires the @templatical/renderer package. Please install it.");
201
+ throw Error("[Templatical] toMjml() requires the @aswin.dev/renderer package. Please install it.");
162
202
  }
163
203
  return t.renderToMjml(e.getContent(), { renderCustomBlock: e.renderCustomBlock });
164
204
  }
165
205
  //#endregion
166
206
  //#region src/index.ts
167
- var q = null, J = e(null);
168
- async function Y(e) {
207
+ var J = null, Y = y(null);
208
+ async function ve(e) {
169
209
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
170
210
  if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
171
- let n = await W(e.locale ?? "en"), r = y(e.fonts);
172
- q && Q(), q = h({ setup() {
173
- return () => _(I, {
211
+ let n = await q(e.locale ?? "en"), r = C(e.fonts);
212
+ J && Q(), J = v({ setup() {
213
+ return () => o(z, {
174
214
  config: e,
175
215
  translations: n,
176
216
  fontsManager: r,
177
- ref: J
217
+ ref: Y
178
218
  });
179
- } }), q.mount(t);
219
+ } }), J.mount(t);
180
220
  let i = {
181
221
  getContent() {
182
- return JSON.parse(JSON.stringify(J.value ? J.value.getContent() : e.content));
222
+ return JSON.parse(JSON.stringify(Y.value ? Y.value.getContent() : e.content));
183
223
  },
184
224
  setContent(t) {
185
- J.value && J.value.setContent(t), e.content = t;
225
+ Y.value && Y.value.setContent(t), e.content = t;
186
226
  },
187
227
  setTheme(e) {
188
- J.value && J.value.setTheme(e);
228
+ Y.value && Y.value.setTheme(e);
189
229
  },
190
230
  unmount: Q,
231
+ startTour(e) {
232
+ Y.value?.startTour?.(e);
233
+ },
234
+ dismissTour() {
235
+ Y.value?.dismissTour?.();
236
+ },
237
+ resetTourDismissed() {
238
+ Y.value?.resetTourDismissed?.();
239
+ },
240
+ isTourDismissed() {
241
+ return Y.value?.isTourDismissed?.() ?? !0;
242
+ },
243
+ undo() {
244
+ Y.value?.undo?.();
245
+ },
246
+ redo() {
247
+ Y.value?.redo?.();
248
+ },
249
+ canUndo() {
250
+ return Y.value?.canUndo?.() ?? !1;
251
+ },
252
+ canRedo() {
253
+ return Y.value?.canRedo?.() ?? !1;
254
+ },
191
255
  renderCustomBlock(e) {
192
- return J.value ? J.value.renderCustomBlock(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Editor not ready"));
256
+ return Y.value ? Y.value.renderCustomBlock(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Editor not ready"));
193
257
  },
194
- toMjml: () => K(i)
258
+ toMjml: () => _e(i)
195
259
  };
196
260
  return i;
197
261
  }
198
- var X = null, Z = e(null);
199
- async function ae(e) {
262
+ var X = null, Z = y(null);
263
+ async function ye(e) {
200
264
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
201
265
  if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
202
- let { default: n } = await import("./chunks/CloudEditor-D2GsEC_n.js"), [r, i] = await Promise.all([W(e.locale ?? "en"), G(e.locale ?? "en")]), a = y(e.fonts);
203
- return X && $(), await new Promise((o, s) => {
204
- let c = setTimeout(() => {
205
- s(/* @__PURE__ */ Error("[Templatical] Cloud editor initialization timed out"));
206
- }, b);
207
- X = h({ setup() {
208
- return () => _(n, {
266
+ let { default: n } = await import("./chunks/CloudEditor-Btyr0b0_.js"), [r, i] = await Promise.all([q(e.locale ?? "en"), ge(e.locale ?? "en")]), a = C(e.fonts);
267
+ return X && $(), await new Promise((s, c) => {
268
+ let l = setTimeout(() => {
269
+ c(/* @__PURE__ */ Error("[Templatical] Cloud editor initialization timed out"));
270
+ }, E);
271
+ X = v({ setup() {
272
+ return () => o(n, {
209
273
  config: e,
210
274
  translations: r,
211
275
  cloudTranslations: i,
212
276
  fontsManager: a,
213
277
  ref: Z,
214
278
  onReady: () => {
215
- clearTimeout(c), o();
279
+ clearTimeout(l), s();
216
280
  }
217
281
  });
218
282
  } }), X.mount(t);
@@ -227,6 +291,30 @@ async function ae(e) {
227
291
  Z.value && Z.value.setTheme(e);
228
292
  },
229
293
  unmount: $,
294
+ startTour(e) {
295
+ Z.value?.startTour?.(e);
296
+ },
297
+ dismissTour() {
298
+ Z.value?.dismissTour?.();
299
+ },
300
+ resetTourDismissed() {
301
+ Z.value?.resetTourDismissed?.();
302
+ },
303
+ isTourDismissed() {
304
+ return Z.value?.isTourDismissed?.() ?? !0;
305
+ },
306
+ undo() {
307
+ Z.value?.undo?.();
308
+ },
309
+ redo() {
310
+ Z.value?.redo?.();
311
+ },
312
+ canUndo() {
313
+ return Z.value?.canUndo?.() ?? !1;
314
+ },
315
+ canRedo() {
316
+ return Z.value?.canRedo?.() ?? !1;
317
+ },
230
318
  create(e) {
231
319
  return Z.value ? Z.value.create(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Cloud editor not ready"));
232
320
  },
@@ -239,12 +327,12 @@ async function ae(e) {
239
327
  };
240
328
  }
241
329
  function Q() {
242
- q && (q.unmount(), q = null, J.value = null);
330
+ J && (J.unmount(), J = null, Y.value = null);
243
331
  }
244
332
  function $() {
245
333
  X && (X.unmount(), X = null, Z.value = null);
246
334
  }
247
335
  //#endregion
248
- export { Y as init, ae as initCloud, Q as unmount, y as useFonts };
336
+ export { O as DEFAULT_EDITOR_TOUR_STORAGE_KEY, ve as init, ye as initCloud, Q as unmount, C as useFonts };
249
337
 
250
338
  //# sourceMappingURL=editor.js.map