@templatical/editor 0.26.3 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/README.md +3 -1
  2. package/dist/{AiChatSidebar-CMBz6Wix.js → AiChatSidebar-iVJDzqjr.js} +60 -60
  3. package/dist/AiFeatureMenu-DrLGc2H2.js +57 -0
  4. package/dist/{BlockIssueBadge-Buk3_6QF.js → BlockIssueBadge-BHysq7XQ.js} +11 -11
  5. package/dist/BlockPreviewCanvas-2WASf5A4.js +121 -0
  6. package/dist/CloudHeaderExtras-DWApyc4P.js +59 -0
  7. package/dist/CloudPanels-DvOhGdRj.js +232 -0
  8. package/dist/{CollaboratorBar-BGwbg9aN.js → CollaboratorBar-C6MC0UCk.js} +21 -21
  9. package/dist/ColorPicker-Di8L5TLQ.js +501 -0
  10. package/dist/CommentsPanel-D5wQB1Kf.js +18 -0
  11. package/dist/CommentsSidebar-BoTIxpLE.js +481 -0
  12. package/dist/{cdn/chunks/CountdownBlock-vLTkTI9e.js → CountdownBlock-BFX8iU90.js} +19 -21
  13. package/dist/{cdn/chunks/CountdownToolbar-DPjcgcVR.js → CountdownToolbar-d9QM4m5x.js} +52 -53
  14. package/dist/{DesignReferenceSidebar-Bx96XFmK.js → DesignReferenceSidebar-DKsx2TiL.js} +72 -71
  15. package/dist/{IssuesPanel-Do7RLXsP.js → IssuesPanel-flKKwKpM.js} +38 -38
  16. package/dist/{LoadingTrack-BexpNuTV.js → LoadingTrack-C2T8ixEL.js} +3 -3
  17. package/dist/{MergeTagModeToggle-P-UguQHc.js → MergeTagModeToggle-PKCoKAoF.js} +43 -43
  18. package/dist/{MergeTagSuggestion-BJ43ihWR.js → MergeTagSuggestion-DGha0WRp.js} +46 -46
  19. package/dist/{cdn/chunks/NumberWithSuffix-BXrRdfq1.js → NumberWithSuffix-D9mPtMJB.js} +42 -44
  20. package/dist/{ParagraphEditor-6WN5jmXr.js → ParagraphEditor-iwTjkjtx.js} +200 -198
  21. package/dist/RestoreVersionDialog-DyMPGfsr.js +86 -0
  22. package/dist/{RichTextEditorContent-fbYJXAio.js → RichTextEditorContent-BVXG9oF4.js} +44 -44
  23. package/dist/SaveBlockDialog-BMCAIfK9.js +266 -0
  24. package/dist/{SavedBlocksBrowserModal-GMrajvfV.js → SavedBlocksBrowserModal-p5ma1qay.js} +116 -115
  25. package/dist/{cdn/chunks/SavedBlocksPanels-CUtYoi5Z.js → SavedBlocksPanels-BsiSstsZ.js} +9 -11
  26. package/dist/{SavedBlocksPickBar-Dk_IaMO9.js → SavedBlocksPickBar-fU4Mjm-8.js} +17 -17
  27. package/dist/{TemplateScoringPanel-BZUsb3FD.js → TemplateScoringPanel-Bv_bBsJi.js} +87 -87
  28. package/dist/TestEmailModal-EFYcrmTk.js +206 -0
  29. package/dist/{cdn/chunks/TestEmailPanel-B8y7JabA.js → TestEmailPanel-ljriUqs1.js} +4 -6
  30. package/dist/TitleEditor-BqRW7HTz.js +198 -0
  31. package/dist/TplModal-CTC9-w6B.js +49 -0
  32. package/dist/VersionHistoryMenu-Cq4rH56t.js +155 -0
  33. package/dist/VersionHistoryPanels-GkxkBiSi.js +46 -0
  34. package/dist/VersionPreviewBanner-BdtTu9mI.js +38 -0
  35. package/dist/{blockTypeIcons-C7wRSaT3.js → blockTypeIcons-CIrMr1SJ.js} +6 -6
  36. package/dist/bundle-stats.json +8 -8
  37. package/dist/{ca-D1zgI9fQ.js → ca-CEuJ6IRr.js} +73 -106
  38. package/dist/cdn/chunks/{AiChatSidebar-CQ8KUmNB.js → AiChatSidebar-DTUoBH5a.js} +54 -54
  39. package/dist/cdn/chunks/AiChatSidebar-DTUoBH5a.js.map +1 -0
  40. package/dist/cdn/chunks/AiFeatureMenu-BQz9Kczt.js +57 -0
  41. package/dist/cdn/chunks/AiFeatureMenu-BQz9Kczt.js.map +1 -0
  42. package/dist/cdn/chunks/{BlockIssueBadge-BEEY9o2o.js → BlockIssueBadge-UzSSOM_2.js} +13 -13
  43. package/dist/cdn/chunks/{BlockIssueBadge-BEEY9o2o.js.map → BlockIssueBadge-UzSSOM_2.js.map} +1 -1
  44. package/dist/cdn/chunks/{BlockPreviewCanvas-msj619wT.js → BlockPreviewCanvas-40ocpXDD.js} +42 -42
  45. package/dist/cdn/chunks/{BlockPreviewCanvas-msj619wT.js.map → BlockPreviewCanvas-40ocpXDD.js.map} +1 -1
  46. package/dist/cdn/chunks/CloudHeaderExtras-F_ySlW1S.js +60 -0
  47. package/dist/cdn/chunks/CloudHeaderExtras-F_ySlW1S.js.map +1 -0
  48. package/dist/cdn/chunks/CloudPanels-C34bcHpc.js +232 -0
  49. package/dist/cdn/chunks/CloudPanels-C34bcHpc.js.map +1 -0
  50. package/dist/cdn/chunks/{CollaboratorBar-G_sZDZXw.js → CollaboratorBar-WBtrPPnM.js} +22 -22
  51. package/dist/cdn/chunks/CollaboratorBar-WBtrPPnM.js.map +1 -0
  52. package/dist/cdn/chunks/ColorPicker-CxKYd_8N.js +502 -0
  53. package/dist/cdn/chunks/ColorPicker-CxKYd_8N.js.map +1 -0
  54. package/dist/cdn/chunks/CommentsPanel-jzZ2X0P4.js +20 -0
  55. package/dist/cdn/chunks/CommentsPanel-jzZ2X0P4.js.map +1 -0
  56. package/dist/cdn/chunks/CommentsSidebar-Dxke-vUP.js +460 -0
  57. package/dist/cdn/chunks/CommentsSidebar-Dxke-vUP.js.map +1 -0
  58. package/dist/{CountdownBlock-DuyvGcr8.js → cdn/chunks/CountdownBlock-BYSrJWxg.js} +25 -23
  59. package/dist/cdn/chunks/{CountdownBlock-vLTkTI9e.js.map → CountdownBlock-BYSrJWxg.js.map} +1 -1
  60. package/dist/{CountdownToolbar-CBE9wRaV.js → cdn/chunks/CountdownToolbar-pVbkPNVo.js} +66 -63
  61. package/dist/cdn/chunks/{CountdownToolbar-DPjcgcVR.js.map → CountdownToolbar-pVbkPNVo.js.map} +1 -1
  62. package/dist/cdn/chunks/{DesignReferenceSidebar-B-HFXV0W.js → DesignReferenceSidebar-sZWciECR.js} +64 -64
  63. package/dist/cdn/chunks/DesignReferenceSidebar-sZWciECR.js.map +1 -0
  64. package/dist/cdn/chunks/{IssuesPanel-DKTS4QVb.js → IssuesPanel-CHtetM9i.js} +36 -36
  65. package/dist/cdn/chunks/IssuesPanel-CHtetM9i.js.map +1 -0
  66. package/dist/cdn/chunks/{LoadingTrack-C52ZGL5q.js → LoadingTrack-Dp_QZvAK.js} +3 -3
  67. package/dist/cdn/chunks/{LoadingTrack-C52ZGL5q.js.map → LoadingTrack-Dp_QZvAK.js.map} +1 -1
  68. package/dist/cdn/chunks/{MergeTagModeToggle-DQ79SqQc.js → MergeTagModeToggle-ZwW-5EeN.js} +39 -39
  69. package/dist/cdn/chunks/{MergeTagModeToggle-DQ79SqQc.js.map → MergeTagModeToggle-ZwW-5EeN.js.map} +1 -1
  70. package/dist/cdn/chunks/{MergeTagSuggestion-Dn8dExNa.js → MergeTagSuggestion-DhllqTA3.js} +47 -47
  71. package/dist/cdn/chunks/MergeTagSuggestion-DhllqTA3.js.map +1 -0
  72. package/dist/{NumberWithSuffix-D37ZWiZh.js → cdn/chunks/NumberWithSuffix-mm6AfIv4.js} +37 -35
  73. package/dist/cdn/chunks/NumberWithSuffix-mm6AfIv4.js.map +1 -0
  74. package/dist/cdn/chunks/{ParagraphEditor-CZ5Z6AgG.js → ParagraphEditor-BBcIQQK2.js} +234 -233
  75. package/dist/cdn/chunks/ParagraphEditor-BBcIQQK2.js.map +1 -0
  76. package/dist/cdn/chunks/RestoreVersionDialog-DNUZHFa_.js +87 -0
  77. package/dist/cdn/chunks/RestoreVersionDialog-DNUZHFa_.js.map +1 -0
  78. package/dist/cdn/chunks/{RichTextEditorContent-DtL49Jpo.js → RichTextEditorContent-Cl-acKAD.js} +44 -44
  79. package/dist/cdn/chunks/RichTextEditorContent-Cl-acKAD.js.map +1 -0
  80. package/dist/cdn/chunks/SaveBlockDialog-BXTZ729e.js +265 -0
  81. package/dist/cdn/chunks/SaveBlockDialog-BXTZ729e.js.map +1 -0
  82. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BkQXEUE2.js → SavedBlocksBrowserModal-BqGNBpRR.js} +114 -113
  83. package/dist/cdn/chunks/SavedBlocksBrowserModal-BqGNBpRR.js.map +1 -0
  84. package/dist/{SavedBlocksPanels-DEPmNhi6.js → cdn/chunks/SavedBlocksPanels-nbK0UQTp.js} +11 -9
  85. package/dist/cdn/chunks/{SavedBlocksPanels-CUtYoi5Z.js.map → SavedBlocksPanels-nbK0UQTp.js.map} +1 -1
  86. package/dist/cdn/chunks/{SavedBlocksPickBar-C80qJykl.js → SavedBlocksPickBar-B9mbw3Gk.js} +17 -17
  87. package/dist/cdn/chunks/SavedBlocksPickBar-B9mbw3Gk.js.map +1 -0
  88. package/dist/cdn/chunks/{TemplateScoringPanel-NucRtAP0.js → TemplateScoringPanel-Xdkp2EMY.js} +81 -81
  89. package/dist/cdn/chunks/TemplateScoringPanel-Xdkp2EMY.js.map +1 -0
  90. package/dist/cdn/chunks/TestEmailModal-DE6fi3he.js +206 -0
  91. package/dist/cdn/chunks/TestEmailModal-DE6fi3he.js.map +1 -0
  92. package/dist/{TestEmailPanel-DubocPxf.js → cdn/chunks/TestEmailPanel-CAjQDXle.js} +6 -4
  93. package/dist/cdn/chunks/{TestEmailPanel-B8y7JabA.js.map → TestEmailPanel-CAjQDXle.js.map} +1 -1
  94. package/dist/cdn/chunks/{TitleEditor-C8WDXf4P.js → TitleEditor-BP0ewaWF.js} +83 -83
  95. package/dist/cdn/chunks/TitleEditor-BP0ewaWF.js.map +1 -0
  96. package/dist/cdn/chunks/TplModal-C4kJduTr.js +50 -0
  97. package/dist/cdn/chunks/TplModal-C4kJduTr.js.map +1 -0
  98. package/dist/cdn/chunks/VersionHistoryMenu-_MAj3qZj.js +148 -0
  99. package/dist/cdn/chunks/VersionHistoryMenu-_MAj3qZj.js.map +1 -0
  100. package/dist/cdn/chunks/VersionHistoryPanels-DMq2PRee.js +48 -0
  101. package/dist/cdn/chunks/VersionHistoryPanels-DMq2PRee.js.map +1 -0
  102. package/dist/cdn/chunks/VersionPreviewBanner-04CL1SGY.js +40 -0
  103. package/dist/cdn/chunks/VersionPreviewBanner-04CL1SGY.js.map +1 -0
  104. package/dist/cdn/chunks/{blockTypeIcons-FXlMM3PL.js → blockTypeIcons-hX_W4dqo.js} +2 -2
  105. package/dist/cdn/chunks/{blockTypeIcons-FXlMM3PL.js.map → blockTypeIcons-hX_W4dqo.js.map} +1 -1
  106. package/dist/cdn/chunks/{ca-D1zgI9fQ.js → ca-CEuJ6IRr.js} +74 -107
  107. package/dist/cdn/chunks/ca-CEuJ6IRr.js.map +1 -0
  108. package/dist/{cloud-qINCmQbn.js → cdn/chunks/cloud-BA0OpRh-.js} +400 -609
  109. package/dist/cdn/chunks/cloud-BA0OpRh-.js.map +1 -0
  110. package/dist/cdn/chunks/createCloudRuntime-gXA8_QRU.js +344 -0
  111. package/dist/cdn/chunks/createCloudRuntime-gXA8_QRU.js.map +1 -0
  112. package/dist/{de-uVoSP1xF.js → cdn/chunks/de-BytZwgn6.js} +4 -88
  113. package/dist/cdn/chunks/de-BytZwgn6.js.map +1 -0
  114. package/dist/{de-DHra3lvx.js → cdn/chunks/de-aRxhZF_K.js} +75 -106
  115. package/dist/cdn/chunks/de-aRxhZF_K.js.map +1 -0
  116. package/dist/cdn/chunks/{dist-B2HKGHnc.js → dist-CM8TB0VD.js} +136 -136
  117. package/dist/cdn/chunks/{dist-B2HKGHnc.js.map → dist-CM8TB0VD.js.map} +1 -1
  118. package/dist/cdn/chunks/{dist-C6z8AjBC.js → dist-CYLJiSiH.js} +63 -63
  119. package/dist/cdn/chunks/{dist-C6z8AjBC.js.map → dist-CYLJiSiH.js.map} +1 -1
  120. package/dist/cdn/chunks/{draggable-DCs9qL-b.js → draggable-BfpsXFg7.js} +916 -905
  121. package/dist/cdn/chunks/{draggable-DCs9qL-b.js.map → draggable-BfpsXFg7.js.map} +1 -1
  122. package/dist/cdn/chunks/{en-DE_y1YWU.js → en-BCgVx9zM.js} +4 -3
  123. package/dist/cdn/chunks/{en-DE_y1YWU.js.map → en-BCgVx9zM.js.map} +1 -1
  124. package/dist/{en-DlqX2YWZ.js → cdn/chunks/en-BX4V_7YO.js} +75 -106
  125. package/dist/cdn/chunks/en-BX4V_7YO.js.map +1 -0
  126. package/dist/{en-CjhsJxb-.js → cdn/chunks/en-DyOSV0lY.js} +4 -88
  127. package/dist/cdn/chunks/en-DyOSV0lY.js.map +1 -0
  128. package/dist/{es-Cuss2snv.js → cdn/chunks/es-CA9uQ-5x.js} +75 -106
  129. package/dist/cdn/chunks/es-CA9uQ-5x.js.map +1 -0
  130. package/dist/cdn/chunks/{extensions-qhcN3RMT.js → extensions-CMcVw2uu.js} +53 -53
  131. package/dist/cdn/chunks/{extensions-qhcN3RMT.js.map → extensions-CMcVw2uu.js.map} +1 -1
  132. package/dist/{fr-Cm85vB2g.js → cdn/chunks/fr-iBuE60Ap.js} +75 -106
  133. package/dist/cdn/chunks/fr-iBuE60Ap.js.map +1 -0
  134. package/dist/cdn/chunks/{icons-CvYN6zrM.js → icons-C36Ha5VU.js} +11 -11
  135. package/dist/cdn/chunks/{icons-CvYN6zrM.js.map → icons-C36Ha5VU.js.map} +1 -1
  136. package/dist/{keys-fwF3qZax.js → cdn/chunks/keys-CbQuRX85.js} +6 -4
  137. package/dist/cdn/chunks/keys-CbQuRX85.js.map +1 -0
  138. package/dist/cdn/chunks/logger-ByvdoAwq.js +23 -0
  139. package/dist/cdn/chunks/logger-ByvdoAwq.js.map +1 -0
  140. package/dist/{nl-dmiIX7oT.js → cdn/chunks/nl-Btw4ojNo.js} +75 -106
  141. package/dist/cdn/chunks/nl-Btw4ojNo.js.map +1 -0
  142. package/dist/cdn/chunks/preRenderCustomBlocks-CbA3RcAy.js +23 -0
  143. package/dist/cdn/chunks/preRenderCustomBlocks-CbA3RcAy.js.map +1 -0
  144. package/dist/{pt-BR-CTzHTqJD.js → cdn/chunks/pt-BR-C1WLSGDh.js} +4 -88
  145. package/dist/cdn/chunks/pt-BR-C1WLSGDh.js.map +1 -0
  146. package/dist/{pt-BR-CaIG-7EM.js → cdn/chunks/pt-BR-GjVsCqbN.js} +75 -106
  147. package/dist/cdn/chunks/pt-BR-GjVsCqbN.js.map +1 -0
  148. package/dist/cdn/chunks/src-B_QJduQD.js.map +1 -1
  149. package/dist/cdn/chunks/{src-xkGep9eN.js → src-CoHDh8Ua.js} +1485 -1483
  150. package/dist/cdn/chunks/src-CoHDh8Ua.js.map +1 -0
  151. package/dist/cdn/chunks/{src-BwbnXShT.js → src-Ct4Fsx3t.js} +148 -134
  152. package/dist/cdn/chunks/src-Ct4Fsx3t.js.map +1 -0
  153. package/dist/cdn/chunks/styleConstants-9oK5kn21.js +59 -0
  154. package/dist/cdn/chunks/styleConstants-9oK5kn21.js.map +1 -0
  155. package/dist/cdn/chunks/timeouts-DHPZQ0G3.js +6 -0
  156. package/dist/cdn/chunks/timeouts-DHPZQ0G3.js.map +1 -0
  157. package/dist/cdn/chunks/{tiptap-C44S1Cmh.js → tiptap-DmpGap5g.js} +40 -40
  158. package/dist/cdn/chunks/{tiptap-C44S1Cmh.js.map → tiptap-DmpGap5g.js.map} +1 -1
  159. package/dist/cdn/chunks/{useAliveFlag-Dxwgo6P4.js → useAliveFlag-Dtm174fG.js} +2 -2
  160. package/dist/cdn/chunks/{useAliveFlag-Dxwgo6P4.js.map → useAliveFlag-Dtm174fG.js.map} +1 -1
  161. package/dist/cdn/chunks/{useCloudI18n-8wkJtuJD.js → useCloudI18n-NVa1aeY8.js} +5 -5
  162. package/dist/cdn/chunks/{useCloudI18n-8wkJtuJD.js.map → useCloudI18n-NVa1aeY8.js.map} +1 -1
  163. package/dist/cdn/chunks/{useEditorCore-CcgxY-Gy.js → useEditorCore-DC8gmfs6.js} +1434 -1147
  164. package/dist/cdn/chunks/useEditorCore-DC8gmfs6.js.map +1 -0
  165. package/dist/cdn/chunks/{useI18n-UMs0F71x.js → useI18n-DVWCJJFH.js} +5 -5
  166. package/dist/cdn/chunks/{useI18n-UMs0F71x.js.map → useI18n-DVWCJJFH.js.map} +1 -1
  167. package/dist/cdn/chunks/{useMergeTag-JmXOtpln.js → useMergeTag-BfZBRPQp.js} +4 -4
  168. package/dist/cdn/chunks/{useMergeTag-JmXOtpln.js.map → useMergeTag-BfZBRPQp.js.map} +1 -1
  169. package/dist/cdn/chunks/{usePopoverPosition-cf8Y-ynK.js → usePopoverPosition-BC-HA7TK.js} +3 -3
  170. package/dist/cdn/chunks/{usePopoverPosition-cf8Y-ynK.js.map → usePopoverPosition-BC-HA7TK.js.map} +1 -1
  171. package/dist/cdn/editor.css +1 -1
  172. package/dist/cdn/editor.js +5119 -284
  173. package/dist/cdn/editor.js.map +1 -1
  174. package/dist/{check-On4TSac-.js → check-DZbmkMQe.js} +1 -1
  175. package/dist/{chevron-down-69EiBGoB.js → chevron-down-nYScOLeZ.js} +1 -1
  176. package/dist/{chevron-up-Dh3MG1Dw.js → chevron-up-CpYpDLnc.js} +1 -1
  177. package/dist/{circle-alert-cilwzafX.js → circle-alert-CuuK6thq.js} +1 -1
  178. package/dist/{clock-Dt0APH92.js → clock-DxkrtqOr.js} +1 -1
  179. package/dist/cloud-BAefVBb_.js +1444 -0
  180. package/dist/createCloudRuntime-Bt8W-ajI.js +342 -0
  181. package/dist/{createLucideIcon-C8WzBYCv.js → createLucideIcon-L-wQXW_R.js} +9 -9
  182. package/dist/{cdn/chunks/de-uVoSP1xF.js → de-BytZwgn6.js} +2 -90
  183. package/dist/{cdn/chunks/de-DHra3lvx.js → de-aRxhZF_K.js} +73 -108
  184. package/dist/dist-B5iReTtK.js +251 -0
  185. package/dist/{dist-Cl8J0IES.js → dist-Ck9roB6K.js} +42 -42
  186. package/dist/{dist-BpKxrUi2.js → dist-CqcGTIiX.js} +46 -46
  187. package/dist/{cdn/chunks/en-DlqX2YWZ.js → en-BX4V_7YO.js} +73 -108
  188. package/dist/{cdn/chunks/en-CjhsJxb-.js → en-DyOSV0lY.js} +2 -90
  189. package/dist/{cdn/chunks/es-Cuss2snv.js → es-CA9uQ-5x.js} +73 -108
  190. package/dist/{extensions-Cwg9S-0f.js → extensions-CX87G4aL.js} +42 -42
  191. package/dist/{cdn/chunks/fr-Cm85vB2g.js → fr-iBuE60Ap.js} +73 -108
  192. package/dist/{image-up-Ceggh_R3.js → image-up-DouZRGVt.js} +1 -1
  193. package/dist/index.d.ts +499 -23
  194. package/dist/{info-DO5odBcZ.js → info-puX5V6Iq.js} +1 -1
  195. package/dist/{cdn/chunks/keys-Cmc2Yl3D.js → keys-BxixS0TN.js} +4 -6
  196. package/dist/{list-checks-BSkPKbuI.js → list-checks-jw-ZlvWY.js} +1 -1
  197. package/dist/{loader-circle-bO7o7_HD.js → loader-circle-DqTxB7Kr.js} +1 -1
  198. package/dist/logger-BBlvSn6q.js +21 -0
  199. package/dist/{message-circle-BEkAk65X.js → message-circle-BZ7YpB22.js} +1 -1
  200. package/dist/{cdn/chunks/nl-dmiIX7oT.js → nl-Btw4ojNo.js} +73 -108
  201. package/dist/{pencil-t6m0EtKL.js → pencil-DmbRhTJu.js} +1 -1
  202. package/dist/preRenderCustomBlocks-BebjKtmw.js +21 -0
  203. package/dist/{cdn/chunks/pt-BR-CTzHTqJD.js → pt-BR-C1WLSGDh.js} +2 -90
  204. package/dist/{cdn/chunks/pt-BR-CaIG-7EM.js → pt-BR-GjVsCqbN.js} +73 -108
  205. package/dist/{refresh-cw-CkOYVzK5.js → refresh-cw-OK_O-cL0.js} +1 -1
  206. package/dist/{runtime-dom.esm-bundler-CepEmvwF.js → runtime-dom.esm-bundler-BgKXIPLV.js} +144 -144
  207. package/dist/{scan-line-DwSVj25O.js → scan-line-DyaSTsJ5.js} +1 -1
  208. package/dist/{send-CWsWN8PQ.js → send-B-wasJJC.js} +1 -1
  209. package/dist/{shield-check-qje8Kufw.js → shield-check-DUIyRrTo.js} +1 -1
  210. package/dist/{sparkles-DumaWRW-.js → sparkles-DYEMATWC.js} +1 -1
  211. package/dist/style.css +1 -1
  212. package/dist/styleConstants-9oK5kn21.js +57 -0
  213. package/dist/templatical-editor.js +5319 -289
  214. package/dist/{text-align-start-Ir8Ah4mT.js → text-align-start-CzjLeBLe.js} +1 -1
  215. package/dist/timeouts-DHPZQ0G3.js +4 -0
  216. package/dist/{trash-2-CklAFCmO.js → trash-2-C0shEPry.js} +1 -1
  217. package/dist/{triangle-alert-BBi4n93g.js → triangle-alert-Fw0ce8oQ.js} +1 -1
  218. package/dist/{upload-sVqqppuv.js → upload-D69C2CBx.js} +3 -4
  219. package/dist/{useAliveFlag-cvyBxHp7.js → useAliveFlag-BGIAZii_.js} +1 -1
  220. package/dist/{useCloudI18n-DKVm6PCa.js → useCloudI18n-CAZTZ9_a.js} +2 -2
  221. package/dist/{useEditorCore-P4UkhcyS.js → useEditorCore-CFLzobo_.js} +1604 -1320
  222. package/dist/{useI18n-DoVKdCTH.js → useI18n-BfXff_Sy.js} +2 -2
  223. package/dist/{useMergeTag-CYZk7dZD.js → useMergeTag-Dd4I7kge.js} +3 -3
  224. package/dist/usePopoverPosition-CxhCX3SQ.js +59 -0
  225. package/dist/{vue.runtime.esm-bundler-D1diBMsm.js → vue.runtime.esm-bundler-DzEsDRtY.js} +447 -436
  226. package/dist/{x-Mby7KlhS.js → x-BjTlFqRv.js} +1 -1
  227. package/package.json +8 -8
  228. package/dist/AiFeatureMenu-Cy-PVrNT.js +0 -63
  229. package/dist/BlockPreviewCanvas-BZKslwGI.js +0 -121
  230. package/dist/CloudEditor-CPRkQCRa.js +0 -1188
  231. package/dist/ColorPicker-ClETsjA3.js +0 -550
  232. package/dist/CommentsSidebar-CdRCCSDD.js +0 -435
  233. package/dist/SaveBlockDialog-21vDlEBS.js +0 -265
  234. package/dist/SnapshotHistory-Cb4WW2gf.js +0 -128
  235. package/dist/TestEmailModal-BHDKmd6B.js +0 -205
  236. package/dist/TitleEditor-Cy4B3UNe.js +0 -198
  237. package/dist/TplModal-Dv9zgSWI.js +0 -49
  238. package/dist/cdn/chunks/AiChatSidebar-CQ8KUmNB.js.map +0 -1
  239. package/dist/cdn/chunks/AiFeatureMenu-Cb9gaRBn.js +0 -63
  240. package/dist/cdn/chunks/AiFeatureMenu-Cb9gaRBn.js.map +0 -1
  241. package/dist/cdn/chunks/CloudEditor-DbyEsIxu.js +0 -1166
  242. package/dist/cdn/chunks/CloudEditor-DbyEsIxu.js.map +0 -1
  243. package/dist/cdn/chunks/CollaboratorBar-G_sZDZXw.js.map +0 -1
  244. package/dist/cdn/chunks/ColorPicker-W_UyiVGc.js +0 -552
  245. package/dist/cdn/chunks/ColorPicker-W_UyiVGc.js.map +0 -1
  246. package/dist/cdn/chunks/CommentsSidebar-BLRZRSSC.js +0 -412
  247. package/dist/cdn/chunks/CommentsSidebar-BLRZRSSC.js.map +0 -1
  248. package/dist/cdn/chunks/DesignReferenceSidebar-B-HFXV0W.js.map +0 -1
  249. package/dist/cdn/chunks/IssuesPanel-DKTS4QVb.js.map +0 -1
  250. package/dist/cdn/chunks/MergeTagSuggestion-Dn8dExNa.js.map +0 -1
  251. package/dist/cdn/chunks/NumberWithSuffix-BXrRdfq1.js.map +0 -1
  252. package/dist/cdn/chunks/ParagraphEditor-CZ5Z6AgG.js.map +0 -1
  253. package/dist/cdn/chunks/RichTextEditorContent-DtL49Jpo.js.map +0 -1
  254. package/dist/cdn/chunks/SaveBlockDialog-CVIVZEuy.js +0 -264
  255. package/dist/cdn/chunks/SaveBlockDialog-CVIVZEuy.js.map +0 -1
  256. package/dist/cdn/chunks/SavedBlocksBrowserModal-BkQXEUE2.js.map +0 -1
  257. package/dist/cdn/chunks/SavedBlocksPickBar-C80qJykl.js.map +0 -1
  258. package/dist/cdn/chunks/SnapshotHistory-DFinMrg_.js +0 -121
  259. package/dist/cdn/chunks/SnapshotHistory-DFinMrg_.js.map +0 -1
  260. package/dist/cdn/chunks/TemplateScoringPanel-NucRtAP0.js.map +0 -1
  261. package/dist/cdn/chunks/TestEmailModal-IxS-QjeH.js +0 -205
  262. package/dist/cdn/chunks/TestEmailModal-IxS-QjeH.js.map +0 -1
  263. package/dist/cdn/chunks/TitleEditor-C8WDXf4P.js.map +0 -1
  264. package/dist/cdn/chunks/TplModal-Ce0QuHyo.js +0 -50
  265. package/dist/cdn/chunks/TplModal-Ce0QuHyo.js.map +0 -1
  266. package/dist/cdn/chunks/ca-D1zgI9fQ.js.map +0 -1
  267. package/dist/cdn/chunks/cloud-DcC8bPwn.js +0 -1787
  268. package/dist/cdn/chunks/cloud-DcC8bPwn.js.map +0 -1
  269. package/dist/cdn/chunks/de-DHra3lvx.js.map +0 -1
  270. package/dist/cdn/chunks/de-uVoSP1xF.js.map +0 -1
  271. package/dist/cdn/chunks/en-CjhsJxb-.js.map +0 -1
  272. package/dist/cdn/chunks/en-DlqX2YWZ.js.map +0 -1
  273. package/dist/cdn/chunks/es-Cuss2snv.js.map +0 -1
  274. package/dist/cdn/chunks/fr-Cm85vB2g.js.map +0 -1
  275. package/dist/cdn/chunks/keys-Cmc2Yl3D.js.map +0 -1
  276. package/dist/cdn/chunks/nl-dmiIX7oT.js.map +0 -1
  277. package/dist/cdn/chunks/pt-BR-CTzHTqJD.js.map +0 -1
  278. package/dist/cdn/chunks/pt-BR-CaIG-7EM.js.map +0 -1
  279. package/dist/cdn/chunks/src-BwbnXShT.js.map +0 -1
  280. package/dist/cdn/chunks/src-xkGep9eN.js.map +0 -1
  281. package/dist/cdn/chunks/styles-DLAfU4Uf.js +0 -4140
  282. package/dist/cdn/chunks/styles-DLAfU4Uf.js.map +0 -1
  283. package/dist/cdn/chunks/timeouts-SsLMC4a3.js +0 -6
  284. package/dist/cdn/chunks/timeouts-SsLMC4a3.js.map +0 -1
  285. package/dist/cdn/chunks/useEditorCore-CcgxY-Gy.js.map +0 -1
  286. package/dist/styles-Dx__pP9O.js +0 -4318
  287. package/dist/usePopoverPosition-C0dPEF4X.js +0 -308
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-Ct4Fsx3t.js","names":[],"sources":["../../../../renderer/package.json","../../../../renderer/src/render-context.ts","../../../../renderer/src/visibility.ts","../../../../renderer/src/unrenderable.ts","../../../../renderer/src/escape.ts","../../../../renderer/src/padding.ts","../../../../renderer/src/utils.ts","../../../../renderer/src/renderers/title.ts","../../../../renderer/src/renderers/paragraph.ts","../../../../renderer/src/renderers/image.ts","../../../../renderer/src/renderers/button.ts","../../../../renderer/src/renderers/divider.ts","../../../../renderer/src/renderers/spacer.ts","../../../../renderer/src/renderers/html.ts","../../../../renderer/src/renderers/social.ts","../../../../renderer/src/renderers/menu.ts","../../../../renderer/src/renderers/table.ts","../../../../renderer/src/renderers/custom.ts","../../../../renderer/src/columns.ts","../../../../renderer/src/display-condition.ts","../../../../renderer/src/renderers/section.ts","../../../../renderer/src/renderers/video.ts","../../../../renderer/src/renderers/index.ts","../../../../renderer/src/index.ts"],"sourcesContent":["{\n \"name\": \"@templatical/renderer\",\n \"description\": \"Render Templatical email templates to MJML\",\n \"version\": \"0.27.1\",\n \"bugs\": \"https://github.com/templatical/sdk/issues\",\n \"dependencies\": {\n \"@templatical/types\": \"workspace:*\"\n },\n \"devDependencies\": {\n \"@resvg/resvg-js\": \"^2.6.2\",\n \"mjml\": \"^5.4.0\",\n \"typescript\": \"^6.0.3\",\n \"vitest\": \"^4.1.10\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"assets\"\n ],\n \"homepage\": \"https://templatical.com\",\n \"keywords\": [\n \"email\",\n \"email-template\",\n \"html-email\",\n \"mjml\",\n \"renderer\",\n \"templatical\"\n ],\n \"license\": \"MIT\",\n \"module\": \"./dist/index.js\",\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/templatical/sdk.git\",\n \"directory\": \"packages/renderer\"\n },\n \"scripts\": {\n \"build\": \"tsdown && node scripts/rasterize-social.mjs\",\n \"test\": \"vitest run --config vitest.config.ts\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"type\": \"module\",\n \"types\": \"./dist/index.d.ts\"\n}\n","import type { Block, BlockType, CustomFont } from \"@templatical/types\";\nimport pkg from \"../package.json\" with { type: \"json\" };\n\n/**\n * A function type that renders a single block to MJML markup.\n */\nexport type BlockRenderer = (block: Block, context: RenderContext) => string;\n\n/**\n * Per-block-type renderer overrides, keyed by `block.type`. An entry replaces the\n * built-in renderer for that type wholesale — including its hidden-on-all-\n * viewports check, which becomes the override's responsibility.\n *\n * Generalises `renderCustomBlock`, which is the same idea for one block type. Its\n * reason to exist is that Templatical Cloud's render output is a deliberate\n * *superset*: countdown blocks resolve to a server-generated animated GIF and\n * video thumbnails get a composited play button, neither of which a browser can\n * do at render time. With this hook Cloud's renderer is the published one plus\n * two injected functions, so parity for every other block type holds by\n * construction instead of by review.\n */\nexport type BlockRendererMap = Partial<Record<BlockType, BlockRenderer>>;\n\nexport const DEFAULT_SOCIAL_ICONS_BASE_URL = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${pkg.version}/assets/social`;\n\nconst BUILT_IN_FONT_FALLBACKS: Record<string, string> = {\n arial: \"Arial, sans-serif\",\n helvetica: \"Helvetica, sans-serif\",\n georgia: \"Georgia, serif\",\n \"times new roman\": \"'Times New Roman', serif\",\n verdana: \"Verdana, sans-serif\",\n \"trebuchet ms\": \"'Trebuchet MS', sans-serif\",\n \"courier new\": \"'Courier New', monospace\",\n tahoma: \"Tahoma, sans-serif\",\n};\n\n/**\n * Immutable context passed through the block rendering chain.\n */\nexport class RenderContext {\n constructor(\n public readonly containerWidth: number,\n public readonly customFonts: CustomFont[],\n public readonly defaultFallbackFont: string,\n public readonly allowHtmlBlocks: boolean,\n /**\n * Map of custom block id → pre-rendered HTML, populated by `renderToMjml`\n * before the synchronous render pass. Set when the consumer provides a\n * `renderCustomBlock` option. Empty by default.\n */\n public readonly customBlockHtml: ReadonlyMap<string, string> = new Map(),\n /**\n * Base URL (no trailing slash) for the social icon PNG assets. Resolved to\n * `${baseUrl}/${style}/${platform}.png`. Outlook desktop has no SVG support\n * and rejects base64 data URIs in `<img src>`, so PNGs must be served over\n * HTTP. Default points at the version-pinned jsDelivr mirror of this\n * package; consumers can override to self-host.\n */\n public readonly socialIconsBaseUrl: string = DEFAULT_SOCIAL_ICONS_BASE_URL,\n /**\n * Per-block-type renderer overrides from `RenderOptions.blockRenderers`.\n * Consulted before every built-in renderer — see {@link BlockRendererMap}.\n */\n public readonly blockRenderers: BlockRendererMap = {},\n ) {}\n\n /**\n * Create a new context with a different container width.\n * Used when rendering columns with narrower widths.\n */\n withContainerWidth(width: number): RenderContext {\n return new RenderContext(\n width,\n this.customFonts,\n this.defaultFallbackFont,\n this.allowHtmlBlocks,\n this.customBlockHtml,\n this.socialIconsBaseUrl,\n this.blockRenderers,\n );\n }\n\n /**\n * Resolve a font family name to include custom font fallbacks.\n * If the font matches a custom font, returns `'FontName', fallback`.\n * Otherwise returns the original font family string.\n */\n resolveFontFamily(fontFamily: string): string {\n // Check custom fonts first\n for (const customFont of this.customFonts) {\n if (customFont.name.toLowerCase() === fontFamily.toLowerCase()) {\n const fallback = customFont.fallback ?? this.defaultFallbackFont;\n\n return `'${customFont.name}', ${fallback}`;\n }\n }\n\n // Resolve built-in fonts to include fallback stacks\n const builtIn = BUILT_IN_FONT_FALLBACKS[fontFamily.toLowerCase()];\n if (builtIn) {\n return builtIn;\n }\n\n return fontFamily;\n }\n}\n","import type { Block } from \"@templatical/types\";\n\n/**\n * Check if a block is hidden on all viewports.\n */\nexport function isHiddenOnAll(block: Block): boolean {\n const visibility = block.visibility;\n\n if (!visibility) {\n return false;\n }\n\n return !visibility.desktop && !visibility.mobile;\n}\n\n/**\n * Get the MJML css-class attribute string for visibility hiding.\n * Returns a string like ` css-class=\"tpl-hide-desktop\"` or empty string.\n */\nexport function getCssClassAttr(block: Block): string {\n const classes = getCssClasses(block);\n\n if (classes === \"\") {\n return \"\";\n }\n\n return ` css-class=\"${classes}\"`;\n}\n\n/**\n * Get the CSS classes for visibility hiding.\n */\nexport function getCssClasses(block: Block): string {\n const visibility = block.visibility;\n\n if (!visibility) {\n return \"\";\n }\n\n const classes: string[] = [];\n\n if (!visibility.desktop) {\n classes.push(\"tpl-hide-desktop\");\n }\n\n if (!visibility.mobile) {\n classes.push(\"tpl-hide-mobile\");\n }\n\n return classes.join(\" \");\n}\n","import type { Block } from \"@templatical/types\";\n\n/**\n * Prefix every unrenderable-block marker carries. Stable and greppable on\n * purpose: it is what a consumer searches for after noticing a gap in a rendered\n * email, and what a send pipeline can scan for before shipping.\n */\nexport const UNRENDERABLE_MARKER_PREFIX = \"templatical:unrenderable-block\";\n\n/**\n * Strip anything that would terminate or nest an HTML comment. `-->` inside the\n * marker would close it early and leak the rest as body text; a lone `--` is\n * enough to make the comment non-conforming, so both collapse.\n */\nfunction commentSafe(value: string): string {\n return value.replace(/-{2,}/g, \"-\").replace(/[<>]/g, \"\");\n}\n\n/**\n * Emit the placeholder for a block no renderer can handle — no built-in renderer\n * and no `blockRenderers` override for its type.\n *\n * **A marker, not a throw and not silence.** The renderer runs inside send\n * pipelines, so killing an entire render over one block is worse than shipping a\n * marked gap. Silence is worse still: a block that simply vanishes reaches\n * recipients as a missing section with nothing anywhere explaining why. The rule\n * is general rather than countdown-specific, so\n * a block type added to `@templatical/types` before its renderer lands degrades\n * the same way.\n *\n * `mj-raw` is used because it is the one element that passes its content through\n * verbatim and is valid everywhere a block renders — inside `mj-column`, which is\n * where every non-section block ends up.\n */\nexport function renderUnrenderableBlock(block: Block): string {\n console.warn(\n `[Templatical] No renderer for block type \"${block.type}\" (id: ${block.id}). ` +\n \"A placeholder comment was emitted in its place. Pass a `blockRenderers` \" +\n \"entry for this type to render it.\",\n );\n\n const type = commentSafe(block.type);\n const id = commentSafe(block.id);\n\n return `<mj-raw><!-- ${UNRENDERABLE_MARKER_PREFIX} type=\"${type}\" id=\"${id}\" --></mj-raw>`;\n}\n","import { findOpenTagEnd, getTagAttrValue } from \"@templatical/types\";\n\nconst HTML_ENTITIES: Record<string, string> = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n '\"': \"&quot;\",\n \"'\": \"&#039;\",\n};\n\nconst HTML_ENTITY_REGEX = /[&<>\"']/g;\n\n/**\n * Escape HTML special characters (& < > \" ').\n * Equivalent to PHP htmlspecialchars with ENT_QUOTES | ENT_HTML5.\n */\nexport function escapeHtml(text: string): string {\n if (text === \"\") {\n return \"\";\n }\n\n return text.replace(HTML_ENTITY_REGEX, (char) => HTML_ENTITIES[char] ?? char);\n}\n\n/**\n * Escape a string for use in an HTML attribute value.\n * Same implementation as escapeHtml for consistency with PHP.\n */\nexport function escapeAttr(text: string): string {\n if (text === \"\") {\n return \"\";\n }\n\n return text.replace(HTML_ENTITY_REGEX, (char) => HTML_ENTITIES[char] ?? char);\n}\n\n/**\n * Escape a string for use as a CSS property value inside an inline\n * `style=\"prop: ${value}\"` attribute. Beyond HTML entity escaping (so the\n * value survives the attribute boundary), this strips characters that\n * could break out of the property value into a sibling property:\n *\n * `;` — separates CSS declarations\n * `{`/`}` — opens/closes a CSS rule (rejected by attribute parsers but\n * still safer to remove)\n * `\\n`/`\\r` — would smuggle past line-based CSS sanitizers\n *\n * Without this, an attacker-controlled color like\n * `\"red; background: url('//attacker/log')\"` lands as a real CSS rule.\n */\nexport function escapeCssValue(text: string): string {\n if (text === \"\") {\n return \"\";\n }\n return escapeAttr(text).replace(/[;{}\\r\\n]/g, \"\");\n}\n\n/**\n * Replace merge tag span elements with their data attribute values.\n * Converts `<span data-merge-tag=\"{{name}}\">Label</span>` to `{{name}}`.\n * Also handles `data-logic-merge-tag` attributes.\n *\n * Uses a single-pass linear scan instead of an `[^>]*…[^>]*` regex because\n * the latter is polynomial-ReDoS over inputs that contain many `<span`\n * starts but no closing `>` — the engine retries `[^>]*` at every span\n * position. The scan below resolves each `<span>` open tag with a bounded,\n * quote-aware `findOpenTagEnd`, keeping the work strictly O(n).\n */\nexport function convertMergeTagsToValues(html: string): string {\n if (html === \"\") {\n return \"\";\n }\n\n return rewriteMergeTagSpans(\n html,\n (attrs) =>\n findAttr(attrs, \"data-merge-tag\") ??\n findAttr(attrs, \"data-logic-merge-tag\"),\n );\n}\n\n/**\n * Walk `html`, find every `<span …>…</span>`, and replace the entire span\n * with whatever `extract` returns for its attribute string (or leave it\n * alone if `extract` returns `null`). Linear in the length of `html`:\n * every `indexOf` advances the cursor monotonically.\n */\nfunction rewriteMergeTagSpans(\n html: string,\n extract: (attrs: string) => string | null,\n): string {\n let out = \"\";\n let i = 0;\n while (i < html.length) {\n const open = html.indexOf(\"<span\", i);\n if (open === -1) {\n out += html.substring(i);\n break;\n }\n // `<span` must be followed by `>` or whitespace to be a real opening tag.\n const afterTagName = html[open + 5];\n if (\n afterTagName !== \">\" &&\n afterTagName !== \" \" &&\n afterTagName !== \"\\t\" &&\n afterTagName !== \"\\n\" &&\n afterTagName !== \"\\r\" &&\n afterTagName !== \"/\"\n ) {\n out += html.substring(i, open + 5);\n i = open + 5;\n continue;\n }\n const openEnd = findOpenTagEnd(html, open + 5);\n if (openEnd === -1) {\n out += html.substring(i);\n break;\n }\n const closeStart = html.indexOf(\"</span>\", openEnd + 1);\n if (closeStart === -1) {\n out += html.substring(i);\n break;\n }\n const attrs = html.substring(open + 5, openEnd);\n const replacement = extract(attrs);\n if (replacement === null) {\n // This `<span>` isn't a merge-tag — emit up to and including the\n // `<span` literal and let the next iteration scan inward, so any\n // nested merge-tag span still gets a chance to match.\n out += html.substring(i, open + 5);\n i = open + 5;\n continue;\n }\n out += html.substring(i, open);\n out += replacement;\n i = closeStart + 7;\n }\n return out;\n}\n\n/**\n * Extract the value of `name=\"…\"` from an HTML attribute string, or `null`\n * if absent.\n *\n * Delegates to `@templatical/types` so the editor's preview rewriter and this\n * export rewriter read markup identically. They were separate regexes once, and\n * both excluded `<` / `>` from the value — which silently left the whole span\n * in the rendered MJML whenever a consumer configured a merge-tag syntax whose\n * values contain those characters (`<% $email %>`), so the ESP never received\n * the token.\n */\nfunction findAttr(attrs: string, name: string): string | null {\n return getTagAttrValue(attrs, name);\n}\n","import type { SpacingValue } from \"@templatical/types\";\n\n/**\n * Convert a SpacingValue to a CSS padding string like \"10px 10px 10px 10px\".\n */\nexport function toPaddingString(padding: SpacingValue): string {\n return `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;\n}\n","/**\n * MJML attribute helpers — single source of truth for placement rules\n * that the MJML spec enforces but accepts silently when violated.\n *\n * MJML drops unrecognized attributes without error. The most common trap is\n * background placement: only `mj-section`, `mj-button`, `mj-wrapper`, `mj-hero`\n * accept the native `background-color` attribute. Inner content elements\n * (`mj-text`, `mj-image`, `mj-table`, `mj-navbar`, `mj-video`) require\n * `container-background-color`, which paints the enclosing `<td>`. Passing\n * `background-color` to an inner element results in the attribute being\n * silently dropped — the email ships without the bg.\n *\n * https://documentation.mjml.io/\n */\n\n/**\n * Where the MJML element accepts a background-color attribute.\n * - `native`: the element has its own `background-color` (mj-section, mj-button).\n * - `container`: the element only accepts `container-background-color`,\n * which colors the wrapping `<td>` (mj-text, mj-image, mj-table, mj-navbar, mj-video).\n */\nexport type BgPlacement = \"native\" | \"container\";\n\n/**\n * Render the appropriate background-color attribute for an MJML element.\n * Returns an empty string when no color is set, or a leading-space attribute\n * fragment ready to interpolate into a tag's attribute list.\n */\nexport function bgAttr(\n backgroundColor: string | undefined,\n placement: BgPlacement,\n): string {\n if (!backgroundColor) {\n return \"\";\n }\n\n const name =\n placement === \"native\" ? \"background-color\" : \"container-background-color\";\n\n return ` ${name}=\"${backgroundColor}\"`;\n}\n","import type { TitleBlock } from \"@templatical/types\";\nimport { HEADING_LEVEL_FONT_SIZE } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { convertMergeTagsToValues, escapeAttr } from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a title block to MJML markup.\n */\nexport function renderTitle(block: TitleBlock, context: RenderContext): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n const content = unwrapParagraph(convertMergeTagsToValues(block.content));\n // Clamp out-of-range levels to a defined entry so we never interpolate\n // `undefined` into `font-size=\"${...}px\"` (mjml@5 rejects \"undefinedpx\").\n const fontSize =\n HEADING_LEVEL_FONT_SIZE[block.level] ?? HEADING_LEVEL_FONT_SIZE[2];\n // Emit the color only when the block sets one; otherwise the `mj-text`\n // inherits the document `textColor` default from `<mj-attributes>`.\n const colorAttr = block.color ? `\\n color=\"${escapeAttr(block.color)}\"` : \"\";\n const align = block.textAlign;\n const fontFamilyAttr = renderFontFamilyAttr(block.fontFamily, context);\n const visibilityAttr = getCssClassAttr(block);\n // Same clamp logic as fontSize so that an out-of-range level still\n // produces a valid heading element.\n const safeLevel = HEADING_LEVEL_FONT_SIZE[block.level] ? block.level : 2;\n const tag = `h${safeLevel}`;\n\n return `<mj-text\n font-size=\"${fontSize}px\"${colorAttr}\n align=\"${align}\"\n line-height=\"1.3\"\n padding=\"${padding}\"${bgColor}${fontFamilyAttr}${visibilityAttr}\n><${tag} style=\"margin:0;font-size:inherit;color:inherit;line-height:inherit\">${content}</${tag}></mj-text>`;\n}\n\n/**\n * The editor stores title content as a TipTap paragraph (`<p>...</p>`),\n * but the renderer wraps it in `<h${level}>`. `<p>` is invalid inside a\n * heading, so strip a single outer `<p>` wrapper if present.\n */\nfunction unwrapParagraph(html: string): string {\n const match = html.match(/^\\s*<p\\b[^>]*>([\\s\\S]*)<\\/p>\\s*$/);\n if (!match) return html;\n // Only unwrap when there is exactly one top-level <p> — otherwise the\n // content has multiple paragraphs and we must leave it alone.\n if (/<\\/p>\\s*<p\\b/i.test(match[1])) return html;\n return match[1];\n}\n\nfunction renderFontFamilyAttr(\n fontFamily: string | undefined,\n context: RenderContext,\n): string {\n if (!fontFamily) {\n return \"\";\n }\n\n const resolved = context.resolveFontFamily(fontFamily);\n\n return ` font-family=\"${resolved}\"`;\n}\n","import type { ParagraphBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { convertMergeTagsToValues } from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a paragraph block to MJML markup.\n * All text formatting is inline in the HTML content (managed by TipTap).\n */\nexport function renderParagraph(\n block: ParagraphBlock,\n _context: RenderContext,\n): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n // Skip when the user has cleared the paragraph — otherwise we emit a\n // styled `<td>` cell that adds visible whitespace to the email even\n // though the canvas shows nothing for an empty paragraph.\n //\n // Use `[^<>]*` (not `[^>]*`) inside the tag to keep the regex linear:\n // `[^>]*` lets the engine consume across nested `<` chars and then\n // backtrack one char at a time when no closing `>` exists, which is\n // O(n²) over inputs like `<p<p<p<p…`. `[^<>]*` fails fast at the\n // next `<` and keeps each match attempt O(1). Real HTML attributes\n // never contain a raw `<`, so the restriction is semantics-preserving.\n const stripped = block.content.replace(/<\\/?p\\b[^<>]*>/gi, \"\").trim();\n if (stripped === \"\") {\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n const content = convertMergeTagsToValues(block.content);\n const visibilityAttr = getCssClassAttr(block);\n\n return `<mj-text\n line-height=\"1.5\"\n padding=\"${padding}\"${bgColor}${visibilityAttr}\n>${content}</mj-text>`;\n}\n","import type { ImageBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { escapeAttr } from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render an image block to MJML markup.\n */\nexport function renderImage(block: ImageBlock, context: RenderContext): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n if (block.src === \"\") {\n // Skip rather than emit `<mj-image src=\"\">` which compiles to a\n // broken-image icon. Mirrors video.ts behavior when no source is set.\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n const width =\n block.width === \"full\" ? context.containerWidth + \"px\" : block.width + \"px\";\n\n const visibilityAttr = getCssClassAttr(block);\n\n let linkAttr = \"\";\n if (block.linkUrl) {\n linkAttr = ` href=\"${escapeAttr(block.linkUrl)}\"`;\n if (block.linkOpenInNewTab) {\n linkAttr += ' target=\"_blank\" rel=\"noopener\"';\n }\n }\n\n const src = escapeAttr(block.src);\n const decorative = block.decorative === true;\n const alt = decorative ? \"\" : escapeAttr(block.alt);\n const align = block.align;\n const roleAttr = decorative ? ' role=\"presentation\"' : \"\";\n\n return `<mj-image\n src=\"${src}\"\n alt=\"${alt}\"\n width=\"${width}\"\n align=\"${align}\"\n padding=\"${padding}\"${bgColor}${linkAttr}${visibilityAttr}${roleAttr}\n/>`;\n}\n","import type { ButtonBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { escapeAttr, escapeHtml } from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a button block to MJML markup.\n */\nexport function renderButton(\n block: ButtonBlock,\n context: RenderContext,\n): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n const buttonPadding = toPaddingString(block.buttonPadding);\n\n // Omit href entirely when no URL is set so we don't emit a clickable\n // `<a href=\"\">` that navigates to whatever URL the email is opened from.\n const href = block.url === \"\" ? \"\" : escapeAttr(block.url);\n const hrefAttr = href === \"\" ? \"\" : ` href=\"${href}\"`;\n const backgroundColor = escapeAttr(block.backgroundColor);\n const textColor = escapeAttr(block.textColor);\n const fontSize = block.fontSize;\n const borderRadius = block.borderRadius;\n const text = escapeHtml(block.text);\n const targetAttr = block.openInNewTab\n ? ' target=\"_blank\" rel=\"noopener\"'\n : \"\";\n const fontFamilyAttr = renderFontFamilyAttr(block.fontFamily, context);\n const widthAttr = renderWidthAttr(block.width);\n const visibilityAttr = getCssClassAttr(block);\n // Templates stored before `align` existed have no value for it. Fall back to\n // MJML's own default so they keep rendering exactly as they did.\n const align = block.align ?? \"center\";\n\n return `<mj-button${hrefAttr}${targetAttr}\n background-color=\"${backgroundColor}\"\n color=\"${textColor}\"\n font-size=\"${fontSize}px\"\n font-weight=\"bold\"\n border-radius=\"${borderRadius}px\"\n inner-padding=\"${buttonPadding}\"\n align=\"${align}\"\n padding=\"${padding}\"${bgColor}${fontFamilyAttr}${widthAttr}${visibilityAttr}\n>${text}</mj-button>`;\n}\n\nfunction renderFontFamilyAttr(\n fontFamily: string | undefined,\n context: RenderContext,\n): string {\n if (!fontFamily) {\n return \"\";\n }\n\n const resolved = context.resolveFontFamily(fontFamily);\n\n return ` font-family=\"${resolved}\"`;\n}\n\nfunction renderWidthAttr(width: number | \"full\" | undefined): string {\n if (width === undefined) {\n return \"\";\n }\n\n const value = width === \"full\" ? \"100%\" : `${width}px`;\n\n return ` width=\"${value}\"`;\n}\n","import type { DividerBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { escapeAttr } from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a divider block to MJML markup.\n */\nexport function renderDivider(\n block: DividerBlock,\n _context: RenderContext,\n): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = block.styles.backgroundColor\n ? ` container-background-color=\"${escapeAttr(block.styles.backgroundColor)}\"`\n : \"\";\n const width = block.width === \"full\" ? \"100%\" : block.width + \"px\";\n const thickness = block.thickness;\n const lineStyle = block.lineStyle;\n const color = escapeAttr(block.color);\n const visibilityAttr = getCssClassAttr(block);\n\n return `<mj-divider\n border-width=\"${thickness}px\"\n border-style=\"${lineStyle}\"\n border-color=\"${color}\"\n width=\"${width}\"\n padding=\"${padding}\"${bgColor}${visibilityAttr}\n/>`;\n}\n","import type { SpacerBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { escapeAttr } from \"../escape\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a spacer block to MJML markup.\n *\n * The canvas renders a spacer at exactly `block.height` pixels and ignores\n * `block.styles.padding`. Match that here: emit `padding=\"0\"` so the\n * exported email's spacer occupies the same vertical space the user saw\n * in the editor preview. Any non-zero `block.styles.padding` on a spacer\n * is meaningless and silently dropped from the export.\n */\nexport function renderSpacer(\n block: SpacerBlock,\n _context: RenderContext,\n): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n const height = block.height;\n const bgColor = block.styles.backgroundColor\n ? ` container-background-color=\"${escapeAttr(block.styles.backgroundColor)}\"`\n : \"\";\n const visibilityAttr = getCssClassAttr(block);\n\n return `<mj-spacer height=\"${height}px\" padding=\"0\"${bgColor}${visibilityAttr} />`;\n}\n","import type { HtmlBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render an HTML block to MJML markup.\n * No sanitization in the OSS version -- consumers are responsible for content safety.\n */\nexport function renderHtml(block: HtmlBlock, context: RenderContext): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n if (!context.allowHtmlBlocks) {\n return \"\";\n }\n\n const content = block.content;\n\n if (content === \"\") {\n return \"\";\n }\n\n const visibilityAttr = getCssClassAttr(block);\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n\n // Use mj-text to render HTML content inside proper table cell structure.\n // mj-raw bypasses MJML's table layout and content won't be visible.\n return `<mj-text padding=\"${padding}\"${bgColor}${visibilityAttr}>\n${content}\n</mj-text>`;\n}\n","import type { SocialIconsBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { escapeAttr } from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a social icons block to MJML markup.\n *\n * Icons are emitted as `<img src=\"…/{style}/{platform}.png\">` rather than\n * inline SVG or base64 data URIs. Outlook desktop (Word rendering engine)\n * does not support SVG and rejects base64 in `<img src>`, so hosted PNGs are\n * the only format that renders across every mainstream client. The base URL\n * is read from `context.socialIconsBaseUrl` (configurable via\n * `RenderOptions.socialIconsBaseUrl`; default is the version-pinned jsDelivr\n * mirror of this package).\n */\nexport function renderSocialIcons(\n block: SocialIconsBlock,\n context: RenderContext,\n): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n const icons = block.icons;\n\n if (icons.length === 0) {\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = block.styles.backgroundColor\n ? ` container-background-color=\"${escapeAttr(block.styles.backgroundColor)}\"`\n : \"\";\n const visibilityAttr = getCssClassAttr(block);\n const align = block.align;\n const iconSize = block.iconSize;\n const iconStyle = block.iconStyle;\n const spacing = block.spacing;\n\n let iconSizePx: number;\n switch (iconSize) {\n case \"small\":\n iconSizePx = 24;\n break;\n case \"large\":\n iconSizePx = 48;\n break;\n default:\n iconSizePx = 32;\n break;\n }\n\n // MJML mj-social-element has default border-radius of 3px, override per style\n let borderRadius: string;\n switch (iconStyle) {\n case \"circle\":\n borderRadius = \"50%\";\n break;\n case \"rounded\":\n borderRadius = \"8px\";\n break;\n case \"square\":\n borderRadius = \"0\";\n break;\n default:\n borderRadius = \"4px\"; // solid, outlined\n break;\n }\n\n const iconCount = icons.length;\n const socialElements = icons.map((icon, index) => {\n const platform = icon.platform;\n const url = escapeAttr(icon.url);\n const iconSrc = `${context.socialIconsBaseUrl}/${iconStyle}/${platform}.png`;\n\n // Apply spacing as right padding only (except last icon) to match CSS gap behavior\n const rightPad = index === iconCount - 1 ? 0 : spacing;\n\n // Empty content hides the platform name text, matching the editor display\n return `<mj-social-element src=\"${iconSrc}\" href=\"${url}\" icon-size=\"${iconSizePx}px\" padding=\"0 ${rightPad}px 0 0\" border-radius=\"${borderRadius}\" background-color=\"transparent\"></mj-social-element>`;\n });\n\n const socialContent = socialElements.join(\"\\n\");\n\n return `<mj-social\n mode=\"horizontal\"\n align=\"${align}\"\n icon-padding=\"0\"\n padding=\"${padding}\"${bgColor}${visibilityAttr}\n>\n${socialContent}\n</mj-social>`;\n}\n","import type { MenuBlock, MenuItemData } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { escapeHtml, escapeAttr, escapeCssValue } from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a menu block to MJML markup.\n * Uses mj-text with inline <a> tags separated by styled <span> separators.\n */\nexport function renderMenu(block: MenuBlock, context: RenderContext): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n if (block.items.length === 0) {\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n const visibilityAttr = getCssClassAttr(block);\n const fontFamilyAttr = renderFontFamilyAttr(block.fontFamily, context);\n const align = block.textAlign;\n const fontSize = block.fontSize;\n // Emit the color only when set; otherwise the `mj-text` inherits the\n // document `textColor` and the item anchors below inherit it in turn.\n const colorAttr = block.color ? `\\n color=\"${escapeAttr(block.color)}\"` : \"\";\n\n const content = renderMenuItems(block);\n\n return `<mj-text\n font-size=\"${fontSize}px\"${colorAttr}\n align=\"${align}\"\n line-height=\"1.5\"\n padding=\"${padding}\"${bgColor}${fontFamilyAttr}${visibilityAttr}\n>${content}</mj-text>`;\n}\n\nfunction renderMenuItems(block: MenuBlock): string {\n const items = block.items;\n const separator = escapeHtml(block.separator);\n const separatorColor = escapeCssValue(block.separatorColor);\n const spacing = block.spacing;\n const linkColor = block.linkColor ?? block.color;\n\n const parts: string[] = [];\n const itemCount = items.length;\n\n for (let index = 0; index < itemCount; index++) {\n parts.push(renderMenuItem(items[index], linkColor));\n\n if (index < itemCount - 1) {\n parts.push(\n `<span style=\"color: ${separatorColor}; padding: 0 ${spacing}px;\">${separator}</span>`,\n );\n }\n }\n\n return parts.join(\"\");\n}\n\nfunction renderMenuItem(\n item: MenuItemData,\n linkColor: string | undefined,\n): string {\n const text = escapeHtml(item.text);\n const url = escapeAttr(item.url);\n // Item color, else the menu link color; when neither is set the anchor omits\n // an explicit color and inherits the mj-text color (the document `textColor`).\n const resolvedColor = item.color ?? linkColor;\n const target = item.openInNewTab ? ' target=\"_blank\" rel=\"noopener\"' : \"\";\n\n const styles: string[] = [\"text-decoration: none\"];\n\n if (resolvedColor) {\n styles.unshift(`color: ${escapeCssValue(resolvedColor)}`);\n }\n\n if (item.bold) {\n styles.push(\"font-weight: bold\");\n }\n\n if (item.underline) {\n styles.push(\"text-decoration: underline\");\n }\n\n const styleAttr = styles.join(\"; \");\n\n return `<a href=\"${url}\" style=\"${styleAttr}\"${target}>${text}</a>`;\n}\n\nfunction renderFontFamilyAttr(\n fontFamily: string | undefined,\n context: RenderContext,\n): string {\n if (!fontFamily) {\n return \"\";\n }\n\n const resolved = context.resolveFontFamily(fontFamily);\n\n return ` font-family=\"${resolved}\"`;\n}\n","import type {\n TableBlock,\n TableRowData,\n TableCellData,\n} from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport {\n escapeAttr,\n escapeCssValue,\n escapeHtml,\n convertMergeTagsToValues,\n} from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a table block to MJML markup.\n * Uses mj-text wrapping an HTML <table> with styled <tr>/<td> elements.\n */\nexport function renderTable(block: TableBlock, context: RenderContext): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n if (block.rows.length === 0) {\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n const visibilityAttr = getCssClassAttr(block);\n const fontFamilyAttr = renderFontFamilyAttr(block.fontFamily, context);\n const fontSize = block.fontSize;\n // Emit the color only when set; otherwise the `mj-text` (and its cells,\n // which carry no color of their own) inherit the document `textColor`.\n const colorAttr = block.color ? `\\n color=\"${escapeAttr(block.color)}\"` : \"\";\n const align = block.textAlign;\n\n const tableHtml = renderTableElement(block);\n\n return `<mj-text\n font-size=\"${fontSize}px\"${colorAttr}\n align=\"${align}\"\n line-height=\"1.5\"\n padding=\"${padding}\"${bgColor}${fontFamilyAttr}${visibilityAttr}\n>${tableHtml}</mj-text>`;\n}\n\nfunction renderTableElement(block: TableBlock): string {\n const borderColor = escapeCssValue(block.borderColor);\n const borderWidth = block.borderWidth;\n\n const tableStyle = \"width: 100%; border-collapse: collapse;\";\n\n let rowsHtml = \"\";\n\n for (let index = 0; index < block.rows.length; index++) {\n const row = block.rows[index];\n const isHeader = block.hasHeaderRow && index === 0;\n rowsHtml += renderRow(row, block, isHeader, borderColor, borderWidth);\n }\n\n return `<table style=\"${tableStyle}\">${rowsHtml}</table>`;\n}\n\nfunction renderRow(\n row: TableRowData,\n block: TableBlock,\n isHeader: boolean,\n borderColor: string,\n borderWidth: number,\n): string {\n let cellsHtml = \"\";\n\n for (const cell of row.cells) {\n cellsHtml += renderCell(cell, block, isHeader, borderColor, borderWidth);\n }\n\n return `<tr>${cellsHtml}</tr>`;\n}\n\nfunction renderCell(\n cell: TableCellData,\n block: TableBlock,\n isHeader: boolean,\n borderColor: string,\n borderWidth: number,\n): string {\n const cellPadding = block.cellPadding;\n\n const styles: string[] = [\n `border: ${borderWidth}px solid ${borderColor}`,\n `padding: ${cellPadding}px`,\n ];\n\n if (isHeader) {\n styles.push(\"font-weight: bold\");\n\n if (block.headerBackgroundColor) {\n styles.push(\n `background-color: ${escapeCssValue(block.headerBackgroundColor)}`,\n );\n }\n }\n\n const styleAttr = styles.join(\"; \");\n // Cells are a plain-text field (the editor stores innerText; TableCellData\n // carries no rich-text hint), so escape the content like menu/button. Merge\n // tags are resolved first: convertMergeTagsToValues matches a literal\n // `<span`, so escaping has to run after it — escaping first would turn the\n // span into `&lt;span` and the `{{value}}` placeholder would never resolve.\n const content = escapeHtml(convertMergeTagsToValues(cell.content));\n\n const tag = isHeader ? \"th\" : \"td\";\n\n return `<${tag} style=\"${styleAttr}\">${content}</${tag}>`;\n}\n\nfunction renderFontFamilyAttr(\n fontFamily: string | undefined,\n context: RenderContext,\n): string {\n if (!fontFamily) {\n return \"\";\n }\n\n const resolved = context.resolveFontFamily(fontFamily);\n\n return ` font-family=\"${resolved}\"`;\n}\n","import type { CustomBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Render a custom block to MJML markup.\n *\n * Custom block HTML resolution order:\n * 1. `context.customBlockHtml` map — populated by `renderToMjml` when the\n * caller passes a `renderCustomBlock` option (typical for editor\n * consumers and headless callers wiring their own resolver).\n * 2. `block.renderedHtml` — populated by an external pre-render step\n * (e.g., a previous render pass that mutated the block).\n * 3. Empty — block omitted from output.\n */\nexport function renderCustom(\n block: CustomBlock,\n context: RenderContext,\n): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n const fromContext = context.customBlockHtml.get(block.id);\n const content = fromContext ?? block.renderedHtml;\n\n if (!content || content === \"\") {\n return \"\";\n }\n\n const visibilityAttr = getCssClassAttr(block);\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n\n return `<mj-text padding=\"${padding}\"${bgColor}${visibilityAttr}>\n${content}\n</mj-text>`;\n}\n","import type { ColumnLayout } from \"@templatical/types\";\n\n/**\n * Get width percentages for each column in a layout.\n */\nexport function getWidthPercentages(layout: ColumnLayout): string[] {\n switch (layout) {\n case \"2\":\n return [\"50%\", \"50%\"];\n case \"3\":\n // 33.33 × 3 = 99.99% — let the last column absorb the rounding gap\n // so widths sum to exactly 100% in the compiled HTML.\n return [\"33.33%\", \"33.33%\", \"33.34%\"];\n case \"1-2\":\n return [\"33.33%\", \"66.67%\"];\n case \"2-1\":\n return [\"66.67%\", \"33.33%\"];\n default:\n return [\"100%\"];\n }\n}\n\n/**\n * Get width in pixels for each column in a layout.\n */\nexport function getWidthPixels(\n layout: ColumnLayout,\n containerWidth: number,\n): number[] {\n switch (layout) {\n case \"2\":\n return [containerWidth * 0.5, containerWidth * 0.5];\n case \"3\":\n return [containerWidth / 3, containerWidth / 3, containerWidth / 3];\n case \"1-2\":\n return [containerWidth / 3, (containerWidth * 2) / 3];\n case \"2-1\":\n return [(containerWidth * 2) / 3, containerWidth / 3];\n default:\n return [containerWidth];\n }\n}\n","import type { Block } from \"@templatical/types\";\n\n/**\n * Wrap rendered block markup in the block's liquid display-condition guards\n * (`<mj-raw>{% if %}</mj-raw>` … `<mj-raw>{% endif %}</mj-raw>`), if present.\n *\n * Returns the input unchanged when the block has no display condition, and an\n * empty string when the rendered markup is empty (a hidden block) so callers\n * can keep using an `=== \"\"` filter to drop it.\n *\n * Used for BOTH top-level blocks (`index.ts`) and blocks nested inside section\n * columns (`renderers/section.ts`). A condition on a nested block must emit the\n * same guards as a top-level one — otherwise conditional content placed inside\n * a multi-column section renders unconditionally for every recipient.\n */\nexport function wrapWithDisplayCondition(\n block: Block,\n rendered: string,\n): string {\n if (rendered === \"\") {\n return \"\";\n }\n\n const displayCondition = block.displayCondition;\n\n if (!displayCondition) {\n return rendered;\n }\n\n return (\n `<mj-raw>${displayCondition.before}</mj-raw>` +\n \"\\n\" +\n rendered +\n \"\\n\" +\n `<mj-raw>${displayCondition.after}</mj-raw>`\n );\n}\n","import type { Block, SectionBlock } from \"@templatical/types\";\nimport { isSection } from \"@templatical/types\";\nimport type { BlockRenderer, RenderContext } from \"../render-context\";\nimport { getWidthPercentages, getWidthPixels } from \"../columns\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\nimport { wrapWithDisplayCondition } from \"../display-condition\";\n\n// `BlockRenderer` is defined in `../render-context`, next to the `blockRenderers`\n// override map it types. Re-exported here so the package's\n// `export type { BlockRenderer } from \"./renderers/section\"` entry point resolves\n// for consumers.\nexport type { BlockRenderer };\n\n/**\n * Render a section block with columns to MJML markup.\n */\nexport function renderSection(\n block: SectionBlock,\n context: RenderContext,\n renderBlock: BlockRenderer,\n): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n const columnsLayout = block.columns;\n const columnWidths = getWidthPercentages(columnsLayout);\n const columnWidthsPx = getWidthPixels(columnsLayout, context.containerWidth);\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"native\");\n const visibilityAttr = getCssClassAttr(block);\n const borderRadiusAttr =\n block.borderRadius && block.borderRadius > 0\n ? ` border-radius=\"${block.borderRadius}px\"`\n : \"\";\n\n const children = block.children;\n const columnsContent: string[] = [];\n\n for (let index = 0; index < children.length; index++) {\n const column = children[index];\n const width = columnWidths[index] ?? \"100%\";\n const columnWidth = Math.floor(\n columnWidthsPx[index] ?? context.containerWidth,\n );\n\n // Sections cannot be nested inside columns per MJML spec — drop any\n // SectionBlocks that landed inside a column (via tampered JSON or a\n // future API). Keeping them would emit `<mj-section>` inside\n // `<mj-column>`, which mjml@5 rejects with a hard error.\n const filteredColumn = filterHtmlBlocks(\n column,\n context.allowHtmlBlocks,\n ).filter((child) => !isSection(child));\n const columnContext = context.withContainerWidth(columnWidth);\n\n const columnBlocks = filteredColumn\n .map((child) =>\n wrapWithDisplayCondition(child, renderBlock(child, columnContext)),\n )\n .filter((value) => value !== \"\")\n .join(\"\\n\");\n\n const content =\n columnBlocks === \"\" ? \"<mj-text>&nbsp;</mj-text>\" : columnBlocks;\n\n columnsContent.push(`<mj-column width=\"${width}\">\n${content}\n</mj-column>`);\n }\n\n const columns = columnsContent.join(\"\\n\");\n\n // Opting out of mobile stacking wraps the columns in an `<mj-group>`, which\n // keeps them side-by-side below 480px instead of stacking (MJML's default).\n // `mj-group` requires percentage column widths — `getWidthPercentages`\n // already guarantees that. Only meaningful with 2+ columns.\n const body =\n block.stackOnMobile === false && columnsContent.length > 1\n ? `<mj-group>\n${columns}\n</mj-group>`\n : columns;\n\n return `<mj-section${bgColor} padding=\"${padding}\"${borderRadiusAttr}${visibilityAttr}>\n${body}\n</mj-section>`;\n}\n\n/**\n * Filter out HTML blocks if they are not allowed.\n */\nfunction filterHtmlBlocks(blocks: Block[], allowHtmlBlocks: boolean): Block[] {\n if (allowHtmlBlocks) {\n return blocks;\n }\n\n return blocks.filter((block) => block.type !== \"html\");\n}\n","import type { VideoBlock } from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { escapeAttr } from \"../escape\";\nimport { toPaddingString } from \"../padding\";\nimport { bgAttr } from \"../utils\";\nimport { isHiddenOnAll, getCssClassAttr } from \"../visibility\";\n\n/**\n * Extract video thumbnail URL from common platforms.\n * Works without server-side processing — YouTube and Vimeo thumbnails are publicly accessible.\n */\nfunction getVideoThumbnail(\n url: string,\n customThumbnail?: string,\n): string | null {\n if (customThumbnail) {\n return customThumbnail;\n }\n\n if (!url) {\n return null;\n }\n\n // YouTube\n const youtubePatterns = [\n /(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/|youtube\\.com\\/embed\\/)([a-zA-Z0-9_-]{11})/,\n /youtube\\.com\\/shorts\\/([a-zA-Z0-9_-]{11})/,\n ];\n\n for (const pattern of youtubePatterns) {\n const match = url.match(pattern);\n if (match) {\n return `https://img.youtube.com/vi/${match[1]}/maxresdefault.jpg`;\n }\n }\n\n // Vimeo\n const vimeoMatch = url.match(/vimeo\\.com\\/(?:video\\/)?(\\d+)/);\n if (vimeoMatch) {\n return `https://vumbnail.com/${vimeoMatch[1]}.jpg`;\n }\n\n return null;\n}\n\n/**\n * Render a video block to MJML markup.\n * Videos in email are rendered as a linked thumbnail image pointing to the video URL.\n */\nexport function renderVideo(block: VideoBlock, context: RenderContext): string {\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n const thumbnailUrl = getVideoThumbnail(block.url, block.thumbnailUrl);\n\n if (!thumbnailUrl) {\n return \"\";\n }\n\n const padding = toPaddingString(block.styles.padding);\n const bgColor = bgAttr(block.styles.backgroundColor, \"container\");\n const width =\n block.width === \"full\" ? context.containerWidth + \"px\" : block.width + \"px\";\n const visibilityAttr = getCssClassAttr(block);\n\n const src = escapeAttr(thumbnailUrl);\n const alt = escapeAttr(block.alt);\n const align = block.align;\n const href = escapeAttr(block.url);\n\n return `<mj-image\n src=\"${src}\"\n alt=\"${alt}\"\n width=\"${width}\"\n align=\"${align}\"\n padding=\"${padding}\"\n href=\"${href}\"\n target=\"_blank\"\n rel=\"noopener\"${bgColor}${visibilityAttr}\n/>`;\n}\n","import type { Block } from \"@templatical/types\";\nimport {\n isSection,\n isTitle,\n isParagraph,\n isImage,\n isButton,\n isDivider,\n isSpacer,\n isHtml,\n isSocialIcons,\n isMenu,\n isTable,\n isVideo,\n isCustomBlock,\n} from \"@templatical/types\";\nimport type { RenderContext } from \"../render-context\";\nimport { isHiddenOnAll } from \"../visibility\";\nimport { renderUnrenderableBlock } from \"../unrenderable\";\nimport { renderTitle } from \"./title\";\nimport { renderParagraph } from \"./paragraph\";\nimport { renderImage } from \"./image\";\nimport { renderButton } from \"./button\";\nimport { renderDivider } from \"./divider\";\nimport { renderSpacer } from \"./spacer\";\nimport { renderHtml } from \"./html\";\nimport { renderSocialIcons } from \"./social\";\nimport { renderMenu } from \"./menu\";\nimport { renderTable } from \"./table\";\nimport { renderCustom } from \"./custom\";\nimport { renderSection } from \"./section\";\nimport { renderVideo } from \"./video\";\n\n/**\n * Render a single block to MJML markup.\n * Dispatches to the appropriate block-type renderer.\n *\n * A `blockRenderers` override for the block's type wins over the built-in\n * renderer — see {@link RenderContext.blockRenderers}. A type with neither gets a\n * placeholder marker plus a warning rather than disappearing.\n */\nexport function renderBlock(block: Block, context: RenderContext): string {\n // Checked first so an override replaces the built-in wholesale rather than\n // running after it. The override then owns everything the built-in did,\n // including the hidden-on-all-viewports early return.\n const override = context.blockRenderers[block.type];\n if (override) {\n return override(block, context);\n }\n\n if (isSection(block)) {\n return renderSection(block, context, renderBlock);\n }\n\n if (isTitle(block)) {\n return renderTitle(block, context);\n }\n\n if (isParagraph(block)) {\n return renderParagraph(block, context);\n }\n\n if (isImage(block)) {\n return renderImage(block, context);\n }\n\n if (isButton(block)) {\n return renderButton(block, context);\n }\n\n if (isDivider(block)) {\n return renderDivider(block, context);\n }\n\n if (isSpacer(block)) {\n return renderSpacer(block, context);\n }\n\n if (isHtml(block)) {\n return renderHtml(block, context);\n }\n\n if (isSocialIcons(block)) {\n return renderSocialIcons(block, context);\n }\n\n if (isMenu(block)) {\n return renderMenu(block, context);\n }\n\n if (isTable(block)) {\n return renderTable(block, context);\n }\n\n if (isVideo(block)) {\n return renderVideo(block, context);\n }\n\n if (isCustomBlock(block)) {\n return renderCustom(block, context);\n }\n\n // Nothing here knows how to render this type. A block the author hid on every\n // viewport is meant to produce nothing, so it still does — every built-in\n // renderer above makes the same call, and warning about a deliberate hide would\n // be noise. Everything else gets a marker: `countdown` today (Cloud renders it\n // server-side as an animated GIF, which no browser can do), and any future type\n // whose renderer hasn't landed yet.\n if (isHiddenOnAll(block)) {\n return \"\";\n }\n\n return renderUnrenderableBlock(block);\n}\n","import type {\n Block,\n CustomBlock,\n TemplateContent,\n CustomFont,\n SectionWrapper,\n} from \"@templatical/types\";\nimport { isSection, isCustomBlock } from \"@templatical/types\";\nimport { RenderContext, DEFAULT_SOCIAL_ICONS_BASE_URL } from \"./render-context\";\nimport type { BlockRendererMap } from \"./render-context\";\nimport { renderBlock } from \"./renderers\";\nimport { escapeHtml, escapeAttr, escapeCssValue } from \"./escape\";\nimport { wrapWithDisplayCondition } from \"./display-condition\";\nimport { bgAttr } from \"./utils\";\nimport { toPaddingString } from \"./padding\";\n\nexport interface RenderOptions {\n customFonts?: CustomFont[];\n defaultFallbackFont?: string;\n allowHtmlBlocks?: boolean;\n /**\n * Resolves custom blocks to their HTML representation. Called once per\n * custom block in the content tree before MJML rendering. The renderer\n * has no built-in knowledge of how to render custom blocks; consumers\n * provide this function.\n *\n * Editor consumers: pass `editor.renderCustomBlock`.\n *\n * Headless consumers (Node.js, server, CLI): provide your own resolver,\n * typically using the same liquid template + field values pipeline as\n * the editor uses. If omitted, custom blocks fall back to\n * `block.renderedHtml` (if present) and otherwise are omitted from the\n * output.\n */\n renderCustomBlock?: (block: CustomBlock) => Promise<string>;\n /**\n * Per-block-type renderer overrides, keyed by `block.type`. An entry replaces\n * the built-in renderer for that type wholesale — including its\n * hidden-on-all-viewports check, which becomes the override's responsibility.\n *\n * ```ts\n * renderToMjml(content, {\n * blockRenderers: {\n * countdown: (block) => `<mj-image src=\"${countdownGifUrl(block)}\" />`,\n * video: (block, ctx) => renderVideoWithPlayButton(block, ctx),\n * },\n * });\n * ```\n *\n * This generalises {@link renderCustomBlock}, which is the same idea for a\n * single block type. It exists so a backend whose render output is a *superset*\n * of the browser's — a server-generated countdown GIF, a composited video\n * thumbnail — can inject exactly that delta instead of forking the renderer:\n * parity for every other block type then holds by construction.\n *\n * A block type with neither a built-in renderer nor an override emits an\n * `mj-raw` placeholder comment and warns, rather than vanishing from the\n * output.\n */\n blockRenderers?: BlockRendererMap;\n /**\n * Resolves the definition-level CSS for a custom block type. Called once\n * per unique `customType` present in the content tree (not per instance).\n * The non-empty results are deduped by content and emitted as additional\n * `<mj-style>` blocks inside `<mj-head>` alongside the built-in visibility\n * media queries.\n *\n * Editor consumers: pass a function that reads\n * `blockRegistry.getDefinition(customType)?.stylesheet`.\n *\n * Headless consumers: provide your own resolver, typically from the same\n * definitions map used by `renderCustomBlock`. Return `undefined` or `null`\n * for definitions without a stylesheet — those are skipped.\n */\n getCustomBlockStylesheet?: (customType: string) => string | undefined | null;\n /**\n * Base URL (no trailing slash) for the social icon PNG assets. Resolved to\n * `${baseUrl}/${style}/${platform}.png` per icon. Defaults to the\n * version-pinned jsDelivr mirror of this package. Override to self-host\n * (e.g., behind your own CDN or for air-gapped environments).\n *\n * Why PNGs: Outlook desktop (Word rendering engine) does not support SVG\n * and rejects base64 data URIs in `<img src>`, so social icons must be\n * served as raster images over HTTP for cross-client compatibility.\n */\n socialIconsBaseUrl?: string;\n}\n\n/**\n * Render template content to an MJML string.\n *\n * The function is async because resolving custom blocks may require\n * asynchronous work (e.g., the editor's liquid renderer dynamically imports\n * `liquidjs`). When the content has no custom blocks or `renderCustomBlock`\n * is omitted, no async work is performed but the function still resolves\n * synchronously — i.e., it always returns a Promise.\n */\nexport async function renderToMjml(\n content: TemplateContent,\n options?: RenderOptions,\n): Promise<string> {\n const customFonts = options?.customFonts ?? [];\n const defaultFallbackFont =\n options?.defaultFallbackFont ?? \"Arial, sans-serif\";\n const allowHtmlBlocks = options?.allowHtmlBlocks ?? true;\n const socialIconsBaseUrl = stripTrailingSlash(\n options?.socialIconsBaseUrl ?? DEFAULT_SOCIAL_ICONS_BASE_URL,\n );\n\n const customBlockHtml = await resolveCustomBlocks(\n content,\n options?.renderCustomBlock,\n );\n\n const customBlockStylesheets = collectCustomBlockStylesheets(\n content,\n options?.getCustomBlockStylesheet,\n );\n\n const renderContext = new RenderContext(\n content.settings.width,\n customFonts,\n defaultFallbackFont,\n allowHtmlBlocks,\n customBlockHtml,\n socialIconsBaseUrl,\n options?.blockRenderers ?? {},\n );\n\n const blocks = filterHtmlBlocks(content.blocks, allowHtmlBlocks);\n const fontFamily = renderContext.resolveFontFamily(\n content.settings.fontFamily,\n );\n const backgroundColor = content.settings.backgroundColor;\n // Document-level default text color → the `<mj-text>` default below. Blocks\n // that set their own color (e.g. Title) or carry inline text-color marks\n // override it. Omitted when unset so existing templates render identically.\n const textColorAttr = content.settings.textColor\n ? ` color=\"${escapeAttr(content.settings.textColor)}\"`\n : \"\";\n // Document-level link styling → the global `a { … }` rule below, cascading to\n // every link (rich-text and menu). An unset `linkColor` keeps `color: inherit`\n // so links follow the text color and legacy content renders identically; a\n // per-link/per-item color still overrides (inline styles beat this rule).\n const linkColor = content.settings.linkColor\n ? escapeCssValue(content.settings.linkColor)\n : \"inherit\";\n const linkDecoration = content.settings.linkUnderline ? \"underline\" : \"none\";\n\n const bodyContent = blocks\n .map((block) => renderTopLevelBlock(block, renderContext))\n .filter((value) => value !== \"\")\n .join(\"\\n\");\n\n const fontDeclarations = generateFontDeclarations(customFonts);\n const previewTag = generatePreviewTag(content.settings.preheaderText);\n\n const lang = escapeAttr(content.settings.locale);\n\n return `<mjml lang=\"${lang}\">\n <mj-head>${previewTag}\n <mj-attributes>\n <mj-all font-family=\"${fontFamily}\" />\n <mj-text font-size=\"14px\"${textColorAttr} />\n <mj-section padding=\"0\" />\n <mj-column padding=\"0\" />\n <mj-image fluid-on-mobile=\"true\" />\n </mj-attributes>${fontDeclarations}\n <mj-style>\n a { color: ${linkColor}; text-decoration: ${linkDecoration}; }\n @media only screen and (max-width: 480px) {\n .tpl-hide-mobile { display: none !important; mso-hide: all !important; }\n }\n @media only screen and (min-width: 481px) {\n .tpl-hide-desktop { display: none !important; mso-hide: all !important; }\n }\n </mj-style>${renderCustomBlockStylesheets(customBlockStylesheets)}\n </mj-head>\n <mj-body width=\"${renderContext.containerWidth}px\" background-color=\"${backgroundColor}\">\n${bodyContent}\n </mj-body>\n</mjml>`;\n}\n\n/**\n * Render a top-level block. Sections are rendered directly,\n * non-section blocks are wrapped in a default section/column.\n */\nfunction renderTopLevelBlock(block: Block, context: RenderContext): string {\n if (isSection(block)) {\n const rendered = renderBlock(block, context);\n // An empty render (hidden section) stays empty — never emit a bare wrapper.\n const framed =\n block.wrapper && rendered !== \"\"\n ? renderSectionWrapper(rendered, block.wrapper)\n : rendered;\n return wrapWithDisplayCondition(block, framed);\n }\n\n const content = renderBlock(block, context);\n const wrapped = wrapInSection(content);\n return wrapWithDisplayCondition(block, wrapped);\n}\n\n/**\n * Wrap a rendered section's `mj-section` in an `mj-wrapper` — a full-width band\n * (its own background + padding + optional radius) that frames the section.\n * `mj-wrapper` is the only MJML element that may contain `mj-section`.\n */\nfunction renderSectionWrapper(inner: string, wrapper: SectionWrapper): string {\n const bg = bgAttr(wrapper.backgroundColor, \"native\");\n const padding = ` padding=\"${\n wrapper.padding ? toPaddingString(wrapper.padding) : \"0\"\n }\"`;\n const radius =\n wrapper.borderRadius && wrapper.borderRadius > 0\n ? ` border-radius=\"${wrapper.borderRadius}px\"`\n : \"\";\n return `<mj-wrapper${bg}${padding}${radius}>\n${inner}\n</mj-wrapper>`;\n}\n\n/**\n * Wrap block content in a default mj-section/mj-column for non-section blocks.\n */\nfunction wrapInSection(content: string): string {\n if (content === \"\") {\n return \"\";\n }\n\n return `<mj-section>\n <mj-column>\n${content}\n </mj-column>\n</mj-section>`;\n}\n\nfunction stripTrailingSlash(url: string): string {\n return url.endsWith(\"/\") ? url.slice(0, -1) : url;\n}\n\nfunction generatePreviewTag(preheaderText?: string): string {\n if (!preheaderText) {\n return \"\";\n }\n\n const trimmed = preheaderText.trim();\n\n if (trimmed === \"\") {\n return \"\";\n }\n\n const escaped = escapeHtml(trimmed);\n\n return `\\n <mj-preview>${escaped}</mj-preview>`;\n}\n\nfunction generateFontDeclarations(customFonts: CustomFont[]): string {\n if (customFonts.length === 0) {\n return \"\";\n }\n\n return customFonts\n .map(\n (font) =>\n `\\n <mj-font name=\"${escapeAttr(font.name)}\" href=\"${escapeAttr(font.url)}\" />`,\n )\n .join(\"\");\n}\n\n/**\n * Filter out HTML blocks if they are not allowed.\n */\nfunction filterHtmlBlocks(blocks: Block[], allowHtmlBlocks: boolean): Block[] {\n if (allowHtmlBlocks) {\n return blocks;\n }\n\n return blocks.filter((block) => block.type !== \"html\");\n}\n\n/**\n * Walk the content tree, collect every custom block, then resolve each in\n * parallel via the supplied callback. Returns a map keyed by block id that\n * the synchronous render pass reads from. If no callback is provided, returns\n * an empty map and the sync pass falls back to `block.renderedHtml`.\n *\n * Per-block failures bubble up — the caller decides whether to swallow or\n * rethrow. We don't replace failures with placeholders here because that's\n * a policy decision (the editor swallows; a strict CLI may want to fail).\n */\nasync function resolveCustomBlocks(\n content: TemplateContent,\n renderCustomBlock: RenderOptions[\"renderCustomBlock\"],\n): Promise<Map<string, string>> {\n const result = new Map<string, string>();\n\n if (!renderCustomBlock) {\n return result;\n }\n\n const customBlocks: CustomBlock[] = [];\n collectCustomBlocks(content.blocks, customBlocks);\n\n if (customBlocks.length === 0) {\n return result;\n }\n\n const rendered = await Promise.all(\n customBlocks.map((block) => renderCustomBlock(block)),\n );\n\n for (let index = 0; index < customBlocks.length; index++) {\n result.set(customBlocks[index].id, rendered[index]);\n }\n\n return result;\n}\n\nfunction collectCustomBlocks(blocks: Block[], out: CustomBlock[]): void {\n for (const block of blocks) {\n if (isCustomBlock(block)) {\n out.push(block);\n continue;\n }\n\n if (isSection(block)) {\n for (const column of block.children) {\n collectCustomBlocks(column, out);\n }\n }\n }\n}\n\n/**\n * Walk the content tree, find every unique `customType`, ask the consumer's\n * resolver for that definition's stylesheet, and return the non-empty,\n * content-deduped set in insertion order.\n *\n * Content-level dedupe (not just by customType) means two definitions that\n * happen to ship the same stylesheet string emit it only once — cheap and\n * matches the \"one rule, emitted once\" mental model. Whitespace-only and\n * empty stylesheets are skipped.\n */\nfunction collectCustomBlockStylesheets(\n content: TemplateContent,\n resolver: RenderOptions[\"getCustomBlockStylesheet\"],\n): string[] {\n if (!resolver) {\n return [];\n }\n\n const customBlocks: CustomBlock[] = [];\n collectCustomBlocks(content.blocks, customBlocks);\n\n if (customBlocks.length === 0) {\n return [];\n }\n\n const seenTypes = new Set<string>();\n const seenContent = new Set<string>();\n const stylesheets: string[] = [];\n\n for (const block of customBlocks) {\n if (seenTypes.has(block.customType)) {\n continue;\n }\n seenTypes.add(block.customType);\n\n const css = resolver(block.customType);\n if (!css) {\n continue;\n }\n\n const trimmed = css.trim();\n if (trimmed === \"\" || seenContent.has(trimmed)) {\n continue;\n }\n seenContent.add(trimmed);\n stylesheets.push(trimmed);\n }\n\n return stylesheets;\n}\n\nfunction renderCustomBlockStylesheets(stylesheets: string[]): string {\n if (stylesheets.length === 0) {\n return \"\";\n }\n\n // One `<mj-style>` per unique stylesheet so per-definition CSS can be\n // independently inspected in the rendered MJML, and authors can grep their\n // contribution without disentangling a merged blob.\n return stylesheets\n .map((css) => `\\n <mj-style>\\n${css}\\n </mj-style>`)\n .join(\"\");\n}\n\n// Re-export utilities for consumers\nexport { RenderContext } from \"./render-context\";\nexport { escapeHtml, escapeAttr, convertMergeTagsToValues } from \"./escape\";\nexport { isHiddenOnAll, getCssClassAttr, getCssClasses } from \"./visibility\";\nexport { getWidthPercentages, getWidthPixels } from \"./columns\";\nexport { toPaddingString } from \"./padding\";\nexport { DEFAULT_SOCIAL_ICONS_BASE_URL } from \"./render-context\";\nexport { renderBlock } from \"./renderers\";\nexport {\n renderUnrenderableBlock,\n UNRENDERABLE_MARKER_PREFIX,\n} from \"./unrenderable\";\nexport type { BlockRenderer, BlockRendererMap } from \"./render-context\";\n"],"mappings":";;;ACuBA,IAAa,IAAgC,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,EAAI,QAAQ,iBAEzG,IAAkD;CACtD,OAAO;CACP,WAAW;CACX,SAAS;CACT,mBAAmB;CACnB,SAAS;CACT,gBAAgB;CAChB,eAAe;CACf,QAAQ;AACV,GAKa,IAAb,MAAa,EAAc;CAEP;CACA;CACA;CACA;CAMA;CAQA;CAKA;CAvBlB,YACE,GACA,GACA,GACA,GAMA,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AM,IAAM,EAAS,EAAM,UAAU;EACrC,IAAI,CAAC,GACH;EAGF,IAAM,IAAU,EAAI,KAAK;EACrB,MAAY,MAAM,EAAY,IAAI,CAAO,MAG7C,EAAY,IAAI,CAAO,GACvB,EAAY,KAAK,CAAO;CAC1B;CAEA,OAAO;AACT;AAEA,SAAS,GAA6B,GAA+B;CAQnE,OAPI,EAAY,WAAW,IAClB,KAMF,EACJ,KAAK,MAAQ,qBAAqB,EAAI,kBAAkB,CAAC,CACzD,KAAK,EAAE;AACZ"}
@@ -0,0 +1,59 @@
1
+ //#region src/constants/styleConstants.ts
2
+ var e = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]", t = "tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-[var(--tpl-shadow-sm)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:placeholder:text-[var(--tpl-text-dim)]", n = "tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-l-[var(--tpl-radius-sm)] tpl:rounded-r-none tpl:border-r-0 tpl:shadow-[var(--tpl-shadow-sm)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:placeholder:text-[var(--tpl-text-dim)]", r = "tpl:flex tpl:items-center tpl:px-2.5 tpl:text-xs tpl:border tpl:border-l-0 tpl:text-[var(--tpl-text-dim)] tpl:bg-[var(--tpl-bg-hover)] tpl:border-[var(--tpl-border)] tpl:rounded-r-[var(--tpl-radius-sm)]", i = "tpl:flex-1 tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-mono tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-[var(--tpl-shadow-sm)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]", a = "tpl:rounded-[var(--tpl-radius)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-4 tpl:border tpl:border-[var(--tpl-border)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:hover:bg-[var(--tpl-bg-hover)]", o = "tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]", s = "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]", c = "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", l = "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border tpl:font-medium tpl:whitespace-nowrap tpl:transition-all tpl:focus-visible:outline-none tpl:focus-visible:shadow-[var(--tpl-ring)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50", u = "tpl:border-transparent tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-on-primary)] tpl:hover:bg-[var(--tpl-primary-hover)] tpl:hover:shadow-[var(--tpl-shadow-sm)]", d = "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)] tpl:hover:shadow-[var(--tpl-shadow-sm)]", f = "tpl:border-transparent tpl:bg-transparent tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[color-mix(in_srgb,var(--tpl-text)_8%,transparent)] tpl:hover:text-[var(--tpl-text)]", p = "tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:shadow-[var(--tpl-shadow-sm)]", m = "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm", h = "tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-2.5 tpl:text-xs", g = `${l} ${u} ${m}`, _ = `${l} ${d} ${m}`, v = `${l} ${u} ${h}`, y = `${l} ${d} ${h}`, b = `${l} ${p} ${m}`;
3
+ `${l}${p}${h}`;
4
+ var x = `${l} ${f} ${m}`, S = [
5
+ "10px",
6
+ "12px",
7
+ "14px",
8
+ "16px",
9
+ "18px",
10
+ "20px",
11
+ "24px",
12
+ "28px",
13
+ "32px",
14
+ "36px",
15
+ "48px",
16
+ "64px"
17
+ ], C = [
18
+ "1",
19
+ "1.2",
20
+ "1.4",
21
+ "1.5",
22
+ "1.6",
23
+ "1.8",
24
+ "2",
25
+ "2.5"
26
+ ], w = [
27
+ {
28
+ label: "Normal",
29
+ value: "normal"
30
+ },
31
+ {
32
+ label: "-0.5px",
33
+ value: "-0.5px"
34
+ },
35
+ {
36
+ label: "0.5px",
37
+ value: "0.5px"
38
+ },
39
+ {
40
+ label: "1px",
41
+ value: "1px"
42
+ },
43
+ {
44
+ label: "1.5px",
45
+ value: "1.5px"
46
+ },
47
+ {
48
+ label: "2px",
49
+ value: "2px"
50
+ },
51
+ {
52
+ label: "3px",
53
+ value: "3px"
54
+ }
55
+ ], T = "#000000", E = "#ffffff", D = "#ffff00", O = "#f2f2f2";
56
+ //#endregion
57
+ export { y as S, c as _, S as a, o as b, s as c, b as d, x as f, e as g, r as h, T as i, a as l, n as m, D as n, w as o, t as p, O as r, C as s, E as t, i as u, g as v, _ as x, v as y };
58
+
59
+ //# sourceMappingURL=styleConstants-9oK5kn21.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleConstants-9oK5kn21.js","names":[],"sources":["../../../src/constants/styleConstants.ts"],"sourcesContent":["export const labelClass =\n \"tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\";\n\nexport const inputClass =\n \"tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-[var(--tpl-shadow-sm)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:placeholder:text-[var(--tpl-text-dim)]\";\n\nexport const inputGroupInputClass =\n \"tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-l-[var(--tpl-radius-sm)] tpl:rounded-r-none tpl:border-r-0 tpl:shadow-[var(--tpl-shadow-sm)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:placeholder:text-[var(--tpl-text-dim)]\";\n\nexport const inputSuffixClass =\n \"tpl:flex tpl:items-center tpl:px-2.5 tpl:text-xs tpl:border tpl:border-l-0 tpl:text-[var(--tpl-text-dim)] tpl:bg-[var(--tpl-bg-hover)] tpl:border-[var(--tpl-border)] tpl:rounded-r-[var(--tpl-radius-sm)]\";\n\nexport const colorInputClass =\n \"tpl:w-10 tpl:shrink-0 tpl:h-10 tpl:p-0.5 tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:cursor-pointer tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]\";\n\nexport const colorTextClass =\n \"tpl:flex-1 tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-mono tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-[var(--tpl-shadow-sm)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]\";\n\nexport const btnClass =\n \"tpl:flex-1 tpl:px-2.5 tpl:py-[7px] tpl:text-sm tpl:font-medium tpl:cursor-pointer tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-muted)] tpl:bg-transparent tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]\";\n\nexport const btnActiveClass =\n \"tpl:flex-1 tpl:px-2.5 tpl:py-[7px] tpl:text-sm tpl:font-medium tpl:cursor-pointer tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)]\";\n\nexport const cardClass =\n \"tpl:rounded-[var(--tpl-radius)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-4 tpl:border tpl:border-[var(--tpl-border)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:hover:bg-[var(--tpl-bg-hover)]\";\n\nexport const removeItemBtnClass =\n \"tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]\";\n\nexport const addItemBtnClass =\n \"tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]\";\n\nexport const monoTextareaClass =\n \"tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]\";\n\n/**\n * The button system: two variants at two scales, composed from one base so a\n * change to focus, disabled or hover behaviour lands on all four at once.\n *\n * **Variants.** Primary is a Signal Amber surface, rare by design — amber\n * announces intent or selection, so a screen with several has nothing left to\n * emphasise. Secondary is the quiet default: muted at rest, saturating on hover,\n * which is how the rest of the chrome behaves so the canvas stays the foreground.\n *\n * **Scales.** The default is dialog and panel scale. The compact pair is for\n * dense chrome — the editor header, where 38px matches the viewport toggle's\n * outer box and 12px is the size every neighbouring control already uses (14px\n * beside those would be a 1.17x step at one weight, the flat scale the\n * Weight-Contrast Rule forbids).\n *\n * **Both are flat at rest.** Depth answers state, so `--tpl-shadow-sm` arrives on\n * hover. A resting shadow on a static control is the one thing DESIGN.md §5 says\n * the answer to is always no.\n *\n * **Primary's hover deepens, never lightens.** `--tpl-primary-hover` is a darker\n * amber; fading the surface with `opacity` instead washes it toward the page and\n * reads as the button going away rather than responding.\n *\n * Primary's label goes through `--tpl-on-primary` rather than naming `--tpl-bg`,\n * so the amber/label pairing is one decision — see the On-Amber Rule. It is\n * 2.80:1 in light mode, accepted under the Amber Contrast Exception, and 7.77:1\n * in dark.\n *\n * Duration and easing come from the `@theme` defaults in `styles/index.css`;\n * spelling them out per recipe is what let call sites drift off the house tempo.\n */\nconst btnBase =\n \"tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border tpl:font-medium tpl:whitespace-nowrap tpl:transition-all tpl:focus-visible:outline-none tpl:focus-visible:shadow-[var(--tpl-ring)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50\";\n\nconst btnPrimarySkin =\n \"tpl:border-transparent tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-on-primary)] tpl:hover:bg-[var(--tpl-primary-hover)] tpl:hover:shadow-[var(--tpl-shadow-sm)]\";\n\nconst btnSecondarySkin =\n \"tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)] tpl:hover:shadow-[var(--tpl-shadow-sm)]\";\n\n/**\n * Destructive actions. Outlined rather than filled, deliberately: a delete button\n * should be findable, not the loudest thing on the surface, and a filled danger\n * surface competes with the primary for the eye. It also costs nothing in\n * contrast — `--tpl-danger` on `--tpl-bg` and `--tpl-bg` on `--tpl-danger` are\n * the same pair, so filling buys no legibility.\n *\n * 3.76:1 in light and 5.41:1 in dark. That clears the 3:1 non-text floor in both\n * and the 4.5 text floor in dark; light mode falls short, which is the same\n * accepted trade the Amber Contrast Exception records — and a destructive action\n * is never signalled by colour alone here, since these buttons are always\n * confirm steps whose label says what they do.\n *\n * Hover deepens into `--tpl-danger-light` rather than fading, matching\n * `removeItemBtnClass`.\n */\n/**\n * Ghost: no surface of its own, so it belongs to whatever it sits on. Used where\n * a secondary action shares a tinted band with a primary one — the\n * version-preview banner's Cancel beside its Restore — and a bordered chip would\n * read as a foreign object dropped onto the tint.\n *\n * The hover wash is translucent rather than `--tpl-bg-active`. An opaque wash\n * only composes on paper: on the banner's `--tpl-primary-light` it would paint a\n * warm grey over amber, and in dark mode it would lighten where everything else\n * darkens. Mixing `--tpl-text` into transparency deepens whatever ground is\n * actually behind it, in either theme.\n */\nconst btnGhostSkin =\n \"tpl:border-transparent tpl:bg-transparent tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[color-mix(in_srgb,var(--tpl-text)_8%,transparent)] tpl:hover:text-[var(--tpl-text)]\";\n\nconst btnDangerSkin =\n \"tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:shadow-[var(--tpl-shadow-sm)]\";\n\n/** Dialog and panel scale. */\nconst btnSizeDefault = \"tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm\";\n\n/** Dense-chrome scale: 38px tall, matching the header's other controls. */\nconst btnSizeCompact =\n \"tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-2.5 tpl:text-xs\";\n\nexport const primaryBtnClass = `${btnBase} ${btnPrimarySkin} ${btnSizeDefault}`;\nexport const secondaryBtnClass = `${btnBase} ${btnSecondarySkin} ${btnSizeDefault}`;\nexport const primaryBtnCompactClass = `${btnBase} ${btnPrimarySkin} ${btnSizeCompact}`;\nexport const secondaryBtnCompactClass = `${btnBase} ${btnSecondarySkin} ${btnSizeCompact}`;\nexport const dangerBtnClass = `${btnBase} ${btnDangerSkin} ${btnSizeDefault}`;\nexport const dangerBtnCompactClass = `${btnBase} ${btnDangerSkin} ${btnSizeCompact}`;\nexport const ghostBtnClass = `${btnBase} ${btnGhostSkin} ${btnSizeDefault}`;\n\n// Rich text toolbar presets\nexport const FONT_SIZE_OPTIONS = [\n \"10px\",\n \"12px\",\n \"14px\",\n \"16px\",\n \"18px\",\n \"20px\",\n \"24px\",\n \"28px\",\n \"32px\",\n \"36px\",\n \"48px\",\n \"64px\",\n];\n\nexport const LINE_HEIGHT_OPTIONS = [\n \"1\",\n \"1.2\",\n \"1.4\",\n \"1.5\",\n \"1.6\",\n \"1.8\",\n \"2\",\n \"2.5\",\n];\n\nexport const LETTER_SPACING_OPTIONS = [\n { label: \"Normal\", value: \"normal\" },\n { label: \"-0.5px\", value: \"-0.5px\" },\n { label: \"0.5px\", value: \"0.5px\" },\n { label: \"1px\", value: \"1px\" },\n { label: \"1.5px\", value: \"1.5px\" },\n { label: \"2px\", value: \"2px\" },\n { label: \"3px\", value: \"3px\" },\n];\n\n// Default color constants\nexport const DEFAULT_TEXT_COLOR = \"#000000\";\nexport const DEFAULT_BG_COLOR = \"#ffffff\";\nexport const DEFAULT_HIGHLIGHT_COLOR = \"#ffff00\";\nexport const DEFAULT_TABLE_ROW_BG = \"#f2f2f2\";\n"],"mappings":";AAAA,IAAa,IACX,qFAEW,IACX,6aAEW,IACX,idAEW,IACX,8MAKW,IACX,gZAQW,IACX,yOAEW,IACX,8UAEW,IACX,qVAEW,IACX,+VAiCI,IACJ,4RAEI,IACJ,uKAEI,IACJ,sMA8BI,IACJ,gLAEI,IACJ,qKAGI,IAAiB,kDAGjB,IACJ,sEAEW,IAAkB,GAAG,EAAQ,GAAG,EAAe,GAAG,KAClD,IAAoB,GAAG,EAAQ,GAAG,EAAiB,GAAG,KACtD,IAAyB,GAAG,EAAQ,GAAG,EAAe,GAAG,KACzD,IAA2B,GAAG,EAAQ,GAAG,EAAiB,GAAG,KAC7D,IAAiB,GAAG,EAAQ,GAAG,EAAc,GAAG;AACxB,GAAG,EAAH,EAAc,EAAd,EAA+B,EAA/B;AACrC,IAAa,IAAgB,GAAG,EAAQ,GAAG,EAAa,GAAG,KAG9C,IAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEa,IAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEa,IAAyB;CACpC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAO,OAAO;CAAM;CAC7B;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAO,OAAO;CAAM;CAC7B;EAAE,OAAO;EAAO,OAAO;CAAM;AAC/B,GAGa,IAAqB,WACrB,IAAmB,WACnB,IAA0B,WAC1B,IAAuB"}
@@ -0,0 +1,6 @@
1
+ //#region src/constants/timeouts.ts
2
+ var e = 4e3, t = 10485760;
3
+ //#endregion
4
+ export { t as n, e as t };
5
+
6
+ //# sourceMappingURL=timeouts-DHPZQ0G3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeouts-DHPZQ0G3.js","names":[],"sources":["../../../src/constants/timeouts.ts"],"sourcesContent":["/** Timeout in ms for editor initialization before giving up. */\nexport const INIT_TIMEOUT_MS = 30000;\n\n/** Duration in ms to show the collaboration undo warning toast. */\nexport const COLLAB_UNDO_WARNING_MS = 4000;\n\n/** Maximum upload file size in bytes (10 MB). */\nexport const MAX_UPLOAD_SIZE_BYTES = 10 * 1024 * 1024;\n\n/**\n * Debounce in ms before an edited image src is sent to `resolveImageUrl`.\n * The src input commits per keystroke, so this is what turns \"per keystroke\"\n * into \"per committed value\" for the host's resolver. The initial src of a\n * mounted block resolves immediately (template load shouldn't wait).\n */\nexport const RESOLVE_IMAGE_DEBOUNCE_MS = 300;\n"],"mappings":";AAIA,IAAa,IAAyB,KAGzB,IAAwB"}
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./rolldown-runtime-B0aSnxlc.js";
2
- import { $ as t, A as n, B as r, C as i, N as a, O as o, S as s, W as c, Y as l, Z as u, et as d, i as f, it as p, k as m, ot as h, q as g, x as _ } from "./draggable-DCs9qL-b.js";
2
+ import { A as t, C as n, G as r, J as i, P as a, Q as o, S as s, V as c, X as l, at as u, et as d, i as f, j as p, k as m, st as h, tt as g, w as _ } from "./draggable-BfpsXFg7.js";
3
3
  //#region ../../node_modules/.pnpm/orderedmap@2.1.1/node_modules/orderedmap/dist/index.js
4
4
  function v(e) {
5
5
  this.content = e;
@@ -16577,7 +16577,7 @@ var xx = q.create({
16577
16577
  wrappingInputRule: () => hp
16578
16578
  });
16579
16579
  function Dx(e) {
16580
- return c((t, n) => ({
16580
+ return r((t, n) => ({
16581
16581
  get() {
16582
16582
  return t(), e;
16583
16583
  },
@@ -16594,7 +16594,7 @@ var Ox = class extends rp {
16594
16594
  constructor(e = {}) {
16595
16595
  return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = Dx(this.view.state), this.reactiveExtensionStorage = Dx(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
16596
16596
  this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
16597
- }), g(this);
16597
+ }), i(this);
16598
16598
  }
16599
16599
  get state() {
16600
16600
  return this.reactiveState ? this.reactiveState.value : this.view.state;
@@ -16610,35 +16610,35 @@ var Ox = class extends rp {
16610
16610
  let t = super.unregisterPlugin(e);
16611
16611
  return this.reactiveState && t && (this.reactiveState.value = t), t;
16612
16612
  }
16613
- }, kx = _({
16613
+ }, kx = s({
16614
16614
  name: "EditorContent",
16615
16615
  props: { editor: {
16616
16616
  default: null,
16617
16617
  type: Object
16618
16618
  } },
16619
16619
  setup(e) {
16620
- let t = u(), n = s();
16621
- return r(() => {
16622
- let r = e.editor;
16623
- r && r.options.element && t.value && o(() => {
16624
- if (!t.value || !r.view.dom?.parentNode) return;
16625
- let e = p(t.value);
16626
- t.value.append(...r.view.dom.parentNode.childNodes), r.contentComponent = n.ctx._, n && (r.appContext = {
16627
- ...n.appContext,
16628
- provides: n.provides
16629
- }), r.setOptions({ element: e }), r.createNodeViews();
16620
+ let r = o(), i = n();
16621
+ return c(() => {
16622
+ let t = e.editor;
16623
+ t && t.options.element && r.value && m(() => {
16624
+ if (!r.value || !t.view.dom?.parentNode) return;
16625
+ let e = u(r.value);
16626
+ r.value.append(...t.view.dom.parentNode.childNodes), t.contentComponent = i.ctx._, i && (t.appContext = {
16627
+ ...i.appContext,
16628
+ provides: i.provides
16629
+ }), t.setOptions({ element: e }), t.createNodeViews();
16630
16630
  });
16631
- }), m(() => {
16631
+ }), t(() => {
16632
16632
  let t = e.editor;
16633
16633
  t && (t.contentComponent = null, t.appContext = null);
16634
- }), { rootEl: t };
16634
+ }), { rootEl: r };
16635
16635
  },
16636
16636
  render() {
16637
- return i("div", { ref: (e) => {
16637
+ return _("div", { ref: (e) => {
16638
16638
  this.rootEl = e;
16639
16639
  } });
16640
16640
  }
16641
- }), Ax = _({
16641
+ }), Ax = s({
16642
16642
  name: "NodeViewContent",
16643
16643
  props: { as: {
16644
16644
  type: String,
@@ -16654,12 +16654,12 @@ var Ox = class extends rp {
16654
16654
  e && e(null);
16655
16655
  },
16656
16656
  render() {
16657
- return i(this.as, {
16657
+ return _(this.as, {
16658
16658
  style: { whiteSpace: "pre-wrap" },
16659
16659
  "data-node-view-content": ""
16660
16660
  });
16661
16661
  }
16662
- }), jx = _({
16662
+ }), jx = s({
16663
16663
  name: "NodeViewWrapper",
16664
16664
  props: { as: {
16665
16665
  type: String,
@@ -16668,7 +16668,7 @@ var Ox = class extends rp {
16668
16668
  inject: ["onDragStart", "decorationClasses"],
16669
16669
  render() {
16670
16670
  var e;
16671
- return i(this.as, {
16671
+ return _(this.as, {
16672
16672
  class: this.decorationClasses,
16673
16673
  style: { whiteSpace: "normal" },
16674
16674
  "data-node-view-wrapper": "",
@@ -16676,16 +16676,16 @@ var Ox = class extends rp {
16676
16676
  }, (e = this.$slots).default?.call(e));
16677
16677
  }
16678
16678
  }), Mx = (e = {}) => {
16679
- let r = t();
16680
- return n(() => {
16681
- r.value = new Ox(e);
16682
- }), m(() => {
16679
+ let n = d();
16680
+ return p(() => {
16681
+ n.value = new Ox(e);
16682
+ }), t(() => {
16683
16683
  var e;
16684
- (e = r.value) == null || e.destroy();
16685
- }), r;
16684
+ (e = n.value) == null || e.destroy();
16685
+ }), n;
16686
16686
  }, Nx = class {
16687
16687
  constructor(e, { props: t = {}, editor: n }) {
16688
- this.destroyed = !1, this.editor = n, this.component = g(e), this.el = document.createElement("div"), this.props = l(t), this.renderedComponent = this.renderComponent();
16688
+ this.destroyed = !1, this.editor = n, this.component = i(e), this.el = document.createElement("div"), this.props = l(t), this.renderedComponent = this.renderComponent();
16689
16689
  }
16690
16690
  get element() {
16691
16691
  return this.renderedComponent.el;
@@ -16695,7 +16695,7 @@ var Ox = class extends rp {
16695
16695
  }
16696
16696
  renderComponent() {
16697
16697
  if (this.destroyed) return this.renderedComponent;
16698
- let e = i(this.component, this.props);
16698
+ let e = _(this.component, this.props);
16699
16699
  return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && f(e, this.el), {
16700
16700
  vNode: e,
16701
16701
  destroy: () => {
@@ -16741,14 +16741,14 @@ var Ox = class extends rp {
16741
16741
  type: Object,
16742
16742
  required: !0
16743
16743
  }
16744
- }, Fx = _({
16744
+ }, Fx = s({
16745
16745
  name: "MarkViewContent",
16746
16746
  props: { as: {
16747
16747
  type: String,
16748
16748
  default: "span"
16749
16749
  } },
16750
16750
  render() {
16751
- return i(this.as, {
16751
+ return _(this.as, {
16752
16752
  style: { whiteSpace: "inherit" },
16753
16753
  "data-mark-view-content": ""
16754
16754
  });
@@ -16759,7 +16759,7 @@ var Ox = class extends rp {
16759
16759
  let r = {
16760
16760
  ...t,
16761
16761
  updateAttributes: this.updateAttributes.bind(this)
16762
- }, i = _({
16762
+ }, i = s({
16763
16763
  extends: { ...e },
16764
16764
  props: Object.keys(r),
16765
16765
  template: this.component.template,
@@ -16781,7 +16781,7 @@ var Ox = class extends rp {
16781
16781
  return this.dom.querySelector("[data-mark-view-content]");
16782
16782
  }
16783
16783
  updateAttributes(e) {
16784
- let t = d(this.mark);
16784
+ let t = g(this.mark);
16785
16785
  super.updateAttributes(e, t);
16786
16786
  }
16787
16787
  destroy() {
@@ -16866,8 +16866,8 @@ var Rx = {
16866
16866
  updateAttributes: (e = {}) => this.updateAttributes(e),
16867
16867
  deleteNode: () => this.deleteNode()
16868
16868
  }, t = e, n = this.onDragStart.bind(this);
16869
- this.decorationClasses = u(this.getDecorationClasses());
16870
- let r = _({
16869
+ this.decorationClasses = o(this.getDecorationClasses());
16870
+ let r = s({
16871
16871
  extends: { ...this.component },
16872
16872
  props: Object.keys(e),
16873
16873
  template: this.component.template,
@@ -16993,16 +16993,16 @@ function Wx(e, t) {
16993
16993
  }
16994
16994
  var Gx = /* @__PURE__ */ Symbol("tiptapVueWidgetCache");
16995
16995
  function Kx(e, t) {
16996
- let { editor: n, props: r = {} } = t, i = qx(e) ? Wx(e, r) : Jx(e, r);
16996
+ let { editor: n, props: r = {} } = t, a = qx(e) ? Wx(e, r) : Jx(e, r);
16997
16997
  return up({
16998
16998
  ...t,
16999
16999
  props: r,
17000
17000
  cacheKey: Gx,
17001
17001
  context: (e) => ({
17002
- editor: g(n),
17002
+ editor: i(n),
17003
17003
  getPos: e
17004
17004
  }),
17005
- create: (e) => new Nx(i, {
17005
+ create: (e) => new Nx(a, {
17006
17006
  editor: n,
17007
17007
  props: e
17008
17008
  }),
@@ -17013,7 +17013,7 @@ function qx(e) {
17013
17013
  return typeof e == "function";
17014
17014
  }
17015
17015
  function Jx(e, t) {
17016
- return _({
17016
+ return s({
17017
17017
  extends: { ...e },
17018
17018
  props: Hx(e, t),
17019
17019
  template: e.template,
@@ -17027,4 +17027,4 @@ function Jx(e, t) {
17027
17027
  //#endregion
17028
17028
  export { J as _, Tv as a, gv as c, Rh as d, Ih as f, Of as g, q as h, Cx as i, q_ as l, wh as m, Bx as n, Sv as o, Th as p, Ex as r, yv as s, jx as t, Bh as u, Pf as v, K as y };
17029
17029
 
17030
- //# sourceMappingURL=tiptap-C44S1Cmh.js.map
17030
+ //# sourceMappingURL=tiptap-DmpGap5g.js.map