@templatical/editor 0.51.1 → 0.52.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 (380) hide show
  1. package/THIRD_PARTY_NOTICES.md +208 -0
  2. package/dist/{AiAltTextPopover-BZQ95GXL.js → AiAltTextPopover-DawbUywc.js} +16 -17
  3. package/dist/{AiAltTextReview-DoBEudnE.js → AiAltTextReview-9ySsXOTU.js} +25 -26
  4. package/dist/{AiChatPanel-Bs6sES3b.js → AiChatPanel-CupPhmsN.js} +141 -143
  5. package/dist/{AiPanels-CfN7A-ZA.js → AiPanels-DqT4PgQ0.js} +6 -8
  6. package/dist/{AiRewriteMenu-C3ZfDDYy.js → AiRewriteMenu-28agTycW.js} +66 -67
  7. package/dist/BlockIssueBadge-BxpDy3u-.js +33 -0
  8. package/dist/{BlockPreviewCanvas-BXNLLLYi.js → BlockPreviewCanvas-B-4bmJ3t.js} +26 -27
  9. package/dist/{CloudHeaderExtras-CsJMEiyN.js → CloudHeaderExtras-QI82yF54.js} +4 -5
  10. package/dist/{CloudPanels-B4F5m7vy.js → CloudPanels-BKJaLkUN.js} +52 -53
  11. package/dist/{CollaborationNotices-CNuDp7Y2.js → CollaborationNotices-CTw4JThq.js} +12 -13
  12. package/dist/{CollaboratorBar-BtHPiuHq.js → CollaboratorBar-CXQqN3VP.js} +16 -17
  13. package/dist/{CommentsPanel-CyCM-BvT.js → CommentsPanel-DwwFuh1h.js} +3 -5
  14. package/dist/CommentsSidebar-9ZfiC2DO.js +500 -0
  15. package/dist/{CountdownBlock-DR4Xm2-T.js → CountdownBlock-CU2yTWtF.js} +21 -22
  16. package/dist/{CountdownToolbar-CEIMPojJ.js → CountdownToolbar-BqoYzf_6.js} +55 -56
  17. package/dist/IssuesPanel-4ykrf1ax.js +359 -0
  18. package/dist/{LoadingTrack-B0RKQWq3.js → LoadingTrack-DM4g6j7b.js} +3 -4
  19. package/dist/{LogicTagInsertButton-CqfU52CO.js → LogicTagInsertButton-CfscnwCn.js} +243 -250
  20. package/dist/{MediaEditModal-DHtkZ4OU.js → MediaEditModal-Dy08GEwE.js} +449 -452
  21. package/dist/{MediaPanels-CGcOB2pR.js → MediaPanels-BgEp7iCp.js} +3 -5
  22. package/dist/{MergeTagInput-YnEkorTZ.js → MergeTagInput-B9dtUthD.js} +14 -15
  23. package/dist/{MergeTagModeToggle-Dhb1DAcQ.js → MergeTagModeToggle-DxujhYJ4.js} +30 -31
  24. package/dist/{MergeTagTextarea-e4lnwtqZ.js → MergeTagTextarea-CPFEjJZd.js} +12 -13
  25. package/dist/{ParagraphEditor-B6NK0ytw.js → ParagraphEditor-CWXfurGh.js} +233 -236
  26. package/dist/{RestoreVersionDialog-Bq_IGOLJ.js → RestoreVersionDialog-C4s_JYCx.js} +16 -17
  27. package/dist/{RichTextEditorContent-AOM6fylS.js → RichTextEditorContent-o6HmE8GR.js} +40 -40
  28. package/dist/{SaveBlockDialog-C8GngfQx.js → SaveBlockDialog-CWLrly6l.js} +58 -59
  29. package/dist/SavedBlocksBrowserModal-CE8n4EBS.js +359 -0
  30. package/dist/{SavedBlocksPanels-C2s3q0pJ.js → SavedBlocksPanels-BE1N9rNZ.js} +7 -9
  31. package/dist/{SavedBlocksPickBar-BjcTiV87.js → SavedBlocksPickBar-Dwl94xhP.js} +14 -15
  32. package/dist/{TemplateSettings-BVBWpiDU.js → TemplateSettings-CS0f1Ues.js} +75 -76
  33. package/dist/{TestEmailModal-SyhO9bn3.js → TestEmailModal-DBD0X5nV.js} +54 -56
  34. package/dist/{TestEmailPanel-BDd2Rtav.js → TestEmailPanel-DaFjP9QK.js} +3 -5
  35. package/dist/{TitleEditor-pxD53y_l.js → TitleEditor-DSqtle77.js} +78 -79
  36. package/dist/{ToggleSwitch-D51U9cmR.js → ToggleSwitch-JykPyD_8.js} +5 -6
  37. package/dist/{Toolbar-CZSPZYbj.js → Toolbar-BZPFfKrf.js} +977 -985
  38. package/dist/{TplModal-DCzBzicE.js → TplModal-DLMssVlt.js} +16 -17
  39. package/dist/{VersionHistoryMenu-BQeWPT85.js → VersionHistoryMenu-BkbYUs0Q.js} +37 -38
  40. package/dist/{VersionHistoryPanels-BBm7YbRQ.js → VersionHistoryPanels-DP7HaYWv.js} +5 -7
  41. package/dist/{VersionPreviewBanner-DUGF0tUJ.js → VersionPreviewBanner-DECaBwLq.js} +11 -12
  42. package/dist/WrapperBlock-BsJv_Fiw.js +44 -0
  43. package/dist/{_plugin-vue_export-helper-B3ysoDQm.js → _plugin-vue_export-helper-Djzt4Yr7.js} +1 -2
  44. package/dist/{aiErrors-D5UOoYOt.js → aiErrors-C3QEMB0x.js} +3 -5
  45. package/dist/{aiImageContext-BH4Ss1h3.js → aiImageContext-BQ5mQ6B5.js} +2 -3
  46. package/dist/{aiRewritePreview-DLGM05Ge.js → aiRewritePreview-DlMyx6Si.js} +1 -2
  47. package/dist/{blockTypeIcons-NzaYvAI4.js → blockTypeIcons-BHjlPnPf.js} +23 -23
  48. package/dist/bundle-stats.json +6 -6
  49. package/dist/{ca-C7mTzW1r.js → ca-CD-Kt1qz.js} +1 -2
  50. package/dist/{ca-CYQH3J0b.js → ca-Cc6eL0ZS.js} +1 -2
  51. package/dist/cdn/chunks/{AiAltTextPopover-CQu0Q_ZX.js → AiAltTextPopover-SEEjkd-I.js} +24 -25
  52. package/dist/cdn/chunks/{AiAltTextPopover-CQu0Q_ZX.js.map → AiAltTextPopover-SEEjkd-I.js.map} +1 -1
  53. package/dist/cdn/chunks/{AiAltTextReview-CI2HbWfn.js → AiAltTextReview-BGLLSKLm.js} +43 -44
  54. package/dist/cdn/chunks/{AiAltTextReview-CI2HbWfn.js.map → AiAltTextReview-BGLLSKLm.js.map} +1 -1
  55. package/dist/cdn/chunks/{AiChatPanel-BYqn1bKu.js → AiChatPanel-DKDAaBNi.js} +129 -131
  56. package/dist/cdn/chunks/{AiChatPanel-BYqn1bKu.js.map → AiChatPanel-DKDAaBNi.js.map} +1 -1
  57. package/dist/cdn/chunks/{AiPanels-CIFKQv8Y.js → AiPanels-0wBarZSH.js} +5 -7
  58. package/dist/cdn/chunks/{AiPanels-CIFKQv8Y.js.map → AiPanels-0wBarZSH.js.map} +1 -1
  59. package/dist/cdn/chunks/{AiRewriteMenu-Bhh71zcc.js → AiRewriteMenu-qf-cfEpy.js} +52 -53
  60. package/dist/cdn/chunks/AiRewriteMenu-qf-cfEpy.js.map +1 -0
  61. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +34 -0
  62. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +1 -0
  63. package/dist/cdn/chunks/{BlockPreviewCanvas-D0--EQkP.js → BlockPreviewCanvas-DGBh6mqe.js} +22 -23
  64. package/dist/cdn/chunks/{BlockPreviewCanvas-D0--EQkP.js.map → BlockPreviewCanvas-DGBh6mqe.js.map} +1 -1
  65. package/dist/cdn/chunks/{CloudHeaderExtras-DaUU8P8R.js → CloudHeaderExtras-BMNK_F9p.js} +4 -5
  66. package/dist/cdn/chunks/{CloudHeaderExtras-DaUU8P8R.js.map → CloudHeaderExtras-BMNK_F9p.js.map} +1 -1
  67. package/dist/cdn/chunks/{CloudPanels-C3jsxo_f.js → CloudPanels-JMWIoVWh.js} +34 -35
  68. package/dist/cdn/chunks/{CloudPanels-C3jsxo_f.js.map → CloudPanels-JMWIoVWh.js.map} +1 -1
  69. package/dist/cdn/chunks/{CollaborationNotices-DjRI8gvs.js → CollaborationNotices-Bsf1rGW9.js} +13 -14
  70. package/dist/cdn/chunks/{CollaborationNotices-DjRI8gvs.js.map → CollaborationNotices-Bsf1rGW9.js.map} +1 -1
  71. package/dist/cdn/chunks/{CollaboratorBar-Dfzm6A9A.js → CollaboratorBar-CXByAoUz.js} +16 -17
  72. package/dist/cdn/chunks/{CollaboratorBar-Dfzm6A9A.js.map → CollaboratorBar-CXByAoUz.js.map} +1 -1
  73. package/dist/cdn/chunks/{CommentsPanel-CSO79OeX.js → CommentsPanel-DoJnKLXI.js} +4 -6
  74. package/dist/cdn/chunks/{CommentsPanel-CSO79OeX.js.map → CommentsPanel-DoJnKLXI.js.map} +1 -1
  75. package/dist/cdn/chunks/{CommentsSidebar-CCvplq1Z.js → CommentsSidebar-CUtgvdBC.js} +110 -110
  76. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +1 -0
  77. package/dist/cdn/chunks/{CountdownBlock-C6USdwk3.js → CountdownBlock-BqRw147R.js} +19 -20
  78. package/dist/cdn/chunks/{CountdownBlock-C6USdwk3.js.map → CountdownBlock-BqRw147R.js.map} +1 -1
  79. package/dist/cdn/chunks/{CountdownToolbar-Cjud2Tos.js → CountdownToolbar-xobieKoU.js} +28 -29
  80. package/dist/cdn/chunks/{CountdownToolbar-Cjud2Tos.js.map → CountdownToolbar-xobieKoU.js.map} +1 -1
  81. package/dist/cdn/chunks/{IssuesPanel-BaWHPDxZ.js → IssuesPanel-C7LfxaAY.js} +76 -77
  82. package/dist/cdn/chunks/{IssuesPanel-BaWHPDxZ.js.map → IssuesPanel-C7LfxaAY.js.map} +1 -1
  83. package/dist/cdn/chunks/LoadingTrack-CZuLTazv.js +11 -0
  84. package/dist/cdn/chunks/{LoadingTrack-BIcL4NiY.js.map → LoadingTrack-CZuLTazv.js.map} +1 -1
  85. package/dist/cdn/chunks/{LogicTagInsertButton-CsL2JDOG.js → LogicTagInsertButton-BIi05UQu.js} +258 -265
  86. package/dist/cdn/chunks/{LogicTagInsertButton-CsL2JDOG.js.map → LogicTagInsertButton-BIi05UQu.js.map} +1 -1
  87. package/dist/cdn/chunks/{MediaEditModal-BuHCiyMu.js → MediaEditModal-Cpcod6_U.js} +152 -155
  88. package/dist/cdn/chunks/{MediaEditModal-BuHCiyMu.js.map → MediaEditModal-Cpcod6_U.js.map} +1 -1
  89. package/dist/cdn/chunks/{MediaPanels-DAgUf_T1.js → MediaPanels-BIdcW_1f.js} +4 -6
  90. package/dist/cdn/chunks/{MediaPanels-DAgUf_T1.js.map → MediaPanels-BIdcW_1f.js.map} +1 -1
  91. package/dist/cdn/chunks/{MergeTagInput-C8U-7LxL.js → MergeTagInput-BvWg8o5E.js} +35 -36
  92. package/dist/cdn/chunks/{MergeTagInput-C8U-7LxL.js.map → MergeTagInput-BvWg8o5E.js.map} +1 -1
  93. package/dist/cdn/chunks/{MergeTagModeToggle-Mm-p0A52.js → MergeTagModeToggle-BgKEVUtV.js} +28 -29
  94. package/dist/cdn/chunks/{MergeTagModeToggle-Mm-p0A52.js.map → MergeTagModeToggle-BgKEVUtV.js.map} +1 -1
  95. package/dist/cdn/chunks/{MergeTagTextarea-DuLScsWM.js → MergeTagTextarea-tBz8McZf.js} +33 -34
  96. package/dist/cdn/chunks/{MergeTagTextarea-DuLScsWM.js.map → MergeTagTextarea-tBz8McZf.js.map} +1 -1
  97. package/dist/cdn/chunks/{ParagraphEditor-CqSj6Ayz.js → ParagraphEditor-B3Rj_cWF.js} +197 -200
  98. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +1 -0
  99. package/dist/cdn/chunks/{RestoreVersionDialog-CdA5osuA.js → RestoreVersionDialog-CjOdD2xj.js} +21 -22
  100. package/dist/cdn/chunks/{RestoreVersionDialog-CdA5osuA.js.map → RestoreVersionDialog-CjOdD2xj.js.map} +1 -1
  101. package/dist/cdn/chunks/{RichTextEditorContent-Q1d2xqBT.js → RichTextEditorContent-DNjR_sNN.js} +30 -31
  102. package/dist/cdn/chunks/{RichTextEditorContent-Q1d2xqBT.js.map → RichTextEditorContent-DNjR_sNN.js.map} +1 -1
  103. package/dist/cdn/chunks/{SaveBlockDialog-CijargAy.js → SaveBlockDialog-CUhpawq0.js} +77 -78
  104. package/dist/cdn/chunks/{SaveBlockDialog-CijargAy.js.map → SaveBlockDialog-CUhpawq0.js.map} +1 -1
  105. package/dist/cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js +356 -0
  106. package/dist/cdn/chunks/{SavedBlocksBrowserModal-DtOz_X5S.js.map → SavedBlocksBrowserModal-BPYcRoGa.js.map} +1 -1
  107. package/dist/cdn/chunks/{SavedBlocksPanels-BowyED5h.js → SavedBlocksPanels-C6--Bc81.js} +4 -6
  108. package/dist/cdn/chunks/{SavedBlocksPanels-BowyED5h.js.map → SavedBlocksPanels-C6--Bc81.js.map} +1 -1
  109. package/dist/cdn/chunks/{SavedBlocksPickBar-BPRaJBv3.js → SavedBlocksPickBar-DUavxpbU.js} +16 -17
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-BPRaJBv3.js.map → SavedBlocksPickBar-DUavxpbU.js.map} +1 -1
  111. package/dist/cdn/chunks/{TemplateSettings-ByZeBO34.js → TemplateSettings-CKtI-dof.js} +72 -73
  112. package/dist/cdn/chunks/{TemplateSettings-ByZeBO34.js.map → TemplateSettings-CKtI-dof.js.map} +1 -1
  113. package/dist/cdn/chunks/{TestEmailModal-BUVTj3Ic.js → TestEmailModal-CDQTgESD.js} +68 -70
  114. package/dist/cdn/chunks/{TestEmailModal-BUVTj3Ic.js.map → TestEmailModal-CDQTgESD.js.map} +1 -1
  115. package/dist/cdn/chunks/{TestEmailPanel-BxutYoWg.js → TestEmailPanel-CcUpEpAn.js} +4 -6
  116. package/dist/cdn/chunks/{TestEmailPanel-BxutYoWg.js.map → TestEmailPanel-CcUpEpAn.js.map} +1 -1
  117. package/dist/cdn/chunks/{TitleEditor-Ccv6uoTz.js → TitleEditor-Cob7RLyK.js} +71 -72
  118. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +1 -0
  119. package/dist/cdn/chunks/{ToggleSwitch-Ctdmj621.js → ToggleSwitch-J7Vwhvha.js} +6 -7
  120. package/dist/cdn/chunks/{ToggleSwitch-Ctdmj621.js.map → ToggleSwitch-J7Vwhvha.js.map} +1 -1
  121. package/dist/cdn/chunks/{Toolbar-DoprRgTn.js → Toolbar-CdpsvNOR.js} +977 -985
  122. package/dist/cdn/chunks/{Toolbar-DoprRgTn.js.map → Toolbar-CdpsvNOR.js.map} +1 -1
  123. package/dist/cdn/chunks/TplModal-CFPDgbwQ.js +51 -0
  124. package/dist/cdn/chunks/{TplModal-BXQzmsJX.js.map → TplModal-CFPDgbwQ.js.map} +1 -1
  125. package/dist/cdn/chunks/{VersionHistoryMenu-BF2fNCvq.js → VersionHistoryMenu-BYlLRvRJ.js} +34 -35
  126. package/dist/cdn/chunks/{VersionHistoryMenu-BF2fNCvq.js.map → VersionHistoryMenu-BYlLRvRJ.js.map} +1 -1
  127. package/dist/cdn/chunks/{VersionHistoryPanels-Dal0Uk69.js → VersionHistoryPanels-C6SOVoiT.js} +4 -6
  128. package/dist/cdn/chunks/{VersionHistoryPanels-Dal0Uk69.js.map → VersionHistoryPanels-C6SOVoiT.js.map} +1 -1
  129. package/dist/cdn/chunks/{VersionPreviewBanner-BaGcn-b1.js → VersionPreviewBanner-Dvg0ZfAW.js} +12 -13
  130. package/dist/cdn/chunks/{VersionPreviewBanner-BaGcn-b1.js.map → VersionPreviewBanner-Dvg0ZfAW.js.map} +1 -1
  131. package/dist/cdn/chunks/{WrapperBlock-DkQJtLz0.js → WrapperBlock-C7Md56IT.js} +14 -15
  132. package/dist/cdn/chunks/{WrapperBlock-DkQJtLz0.js.map → WrapperBlock-C7Md56IT.js.map} +1 -1
  133. package/dist/cdn/chunks/{_plugin-vue_export-helper-B3ysoDQm.js → _plugin-vue_export-helper-Djzt4Yr7.js} +1 -2
  134. package/dist/cdn/chunks/{aiErrors-D5UOoYOt.js → aiErrors-C3QEMB0x.js} +4 -6
  135. package/dist/cdn/chunks/{aiErrors-D5UOoYOt.js.map → aiErrors-C3QEMB0x.js.map} +1 -1
  136. package/dist/cdn/chunks/{aiImageContext-BH4Ss1h3.js → aiImageContext-BQ5mQ6B5.js} +3 -4
  137. package/dist/cdn/chunks/{aiImageContext-BH4Ss1h3.js.map → aiImageContext-BQ5mQ6B5.js.map} +1 -1
  138. package/dist/cdn/chunks/{aiRewritePreview-DLGM05Ge.js → aiRewritePreview-DlMyx6Si.js} +2 -3
  139. package/dist/cdn/chunks/{aiRewritePreview-DLGM05Ge.js.map → aiRewritePreview-DlMyx6Si.js.map} +1 -1
  140. package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js +21 -0
  141. package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js.map +1 -0
  142. package/dist/cdn/chunks/{ca-C7mTzW1r.js → ca-CD-Kt1qz.js} +2 -3
  143. package/dist/cdn/chunks/{ca-C7mTzW1r.js.map → ca-CD-Kt1qz.js.map} +1 -1
  144. package/dist/cdn/chunks/{ca-CYQH3J0b.js → ca-Cc6eL0ZS.js} +2 -3
  145. package/dist/cdn/chunks/{ca-CYQH3J0b.js.map → ca-Cc6eL0ZS.js.map} +1 -1
  146. package/dist/cdn/chunks/{createCloudRuntime-DpBWhrv3.js → createCloudRuntime-Cth2JCEh.js} +58 -77
  147. package/dist/cdn/chunks/{createCloudRuntime-DpBWhrv3.js.map → createCloudRuntime-Cth2JCEh.js.map} +1 -1
  148. package/dist/cdn/chunks/{de-DBOTcDj2.js → de-6M4JoHoD.js} +2 -3
  149. package/dist/cdn/chunks/{de-DBOTcDj2.js.map → de-6M4JoHoD.js.map} +1 -1
  150. package/dist/cdn/chunks/{de-DNuYQTmS.js → de-CeFJ6wbM.js} +2 -3
  151. package/dist/cdn/chunks/{de-DNuYQTmS.js.map → de-CeFJ6wbM.js.map} +1 -1
  152. package/dist/cdn/chunks/{de-JvCTMJPy.js → de-DtrXVcuY.js} +2 -3
  153. package/dist/cdn/chunks/{de-JvCTMJPy.js.map → de-DtrXVcuY.js.map} +1 -1
  154. package/dist/cdn/chunks/{dist-Bo8Thh8v.js → dist-8ym3y-pH.js} +44 -45
  155. package/dist/cdn/chunks/{dist-Bo8Thh8v.js.map → dist-8ym3y-pH.js.map} +1 -1
  156. package/dist/{dist-DI4_YSnG.js → cdn/chunks/dist-BMzNabtD.js} +107 -109
  157. package/dist/cdn/chunks/{dist-S-rLGqax.js.map → dist-BMzNabtD.js.map} +1 -1
  158. package/dist/cdn/chunks/dompurify-JVtr5-B1.js +872 -0
  159. package/dist/cdn/chunks/dompurify-JVtr5-B1.js.map +1 -0
  160. package/dist/cdn/chunks/{draggable-DZ0gwUJ6.js → draggable-Du8AUMFT.js} +654 -654
  161. package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +1 -0
  162. package/dist/{editor-modal-Bzhl-PgI.js → cdn/chunks/editor-modal-CyCe560f.js} +893 -979
  163. package/dist/cdn/chunks/{editor-modal-CI6EfeMd.js.map → editor-modal-CyCe560f.js.map} +1 -1
  164. package/dist/cdn/chunks/{emojiData-6m0DBh7O.js → emojiData-CBNuCfum.js} +2 -3
  165. package/dist/cdn/chunks/{emojiData-6m0DBh7O.js.map → emojiData-CBNuCfum.js.map} +1 -1
  166. package/dist/cdn/chunks/{en-CW71OK66.js → en-D14i5nFh.js} +2 -3
  167. package/dist/cdn/chunks/{en-CW71OK66.js.map → en-D14i5nFh.js.map} +1 -1
  168. package/dist/cdn/chunks/{en-CDhWRrF_.js → en-FzUuJ8HW.js} +2 -3
  169. package/dist/cdn/chunks/{en-CDhWRrF_.js.map → en-FzUuJ8HW.js.map} +1 -1
  170. package/dist/cdn/chunks/en-TIqv4ag3.js +1 -0
  171. package/dist/cdn/chunks/{es-CAv-Vldw.js → es-Dw_h7Oll.js} +2 -3
  172. package/dist/cdn/chunks/{es-CAv-Vldw.js.map → es-Dw_h7Oll.js.map} +1 -1
  173. package/dist/cdn/chunks/{es-DdK7zQfi.js → es-zDacbMhs.js} +2 -3
  174. package/dist/cdn/chunks/{es-DdK7zQfi.js.map → es-zDacbMhs.js.map} +1 -1
  175. package/dist/cdn/chunks/{extensions-taJTZlLK.js → extensions-CFF2KWy-.js} +60 -65
  176. package/dist/cdn/chunks/{extensions-taJTZlLK.js.map → extensions-CFF2KWy-.js.map} +1 -1
  177. package/dist/cdn/chunks/{formatAbsoluteDateTime-DMmop3C-.js → formatAbsoluteDateTime-Ck2_zXra.js} +2 -3
  178. package/dist/cdn/chunks/{formatAbsoluteDateTime-DMmop3C-.js.map → formatAbsoluteDateTime-Ck2_zXra.js.map} +1 -1
  179. package/dist/cdn/chunks/{formatRelativeTime-CtUU-QZ8.js → formatRelativeTime-BTD8Ktt-.js} +1 -2
  180. package/dist/cdn/chunks/{formatRelativeTime-CtUU-QZ8.js.map → formatRelativeTime-BTD8Ktt-.js.map} +1 -1
  181. package/dist/cdn/chunks/{fr-DVPtxpR6.js → fr-BJaeKu_8.js} +2 -3
  182. package/dist/cdn/chunks/{fr-DVPtxpR6.js.map → fr-BJaeKu_8.js.map} +1 -1
  183. package/dist/cdn/chunks/{fr-Dz5Bgb7-.js → fr-CSgYtjOd.js} +2 -3
  184. package/dist/cdn/chunks/{fr-Dz5Bgb7-.js.map → fr-CSgYtjOd.js.map} +1 -1
  185. package/dist/cdn/chunks/{htmlparser-CDRsn-gn.js → htmlparser-hu3YnNQU.js} +6 -11
  186. package/dist/cdn/chunks/{htmlparser-CDRsn-gn.js.map → htmlparser-hu3YnNQU.js.map} +1 -1
  187. package/dist/cdn/chunks/{icons-DNX6StSs.js → icons-okSPsLOa.js} +111 -114
  188. package/dist/cdn/chunks/icons-okSPsLOa.js.map +1 -0
  189. package/dist/cdn/chunks/{ja-Di-zJiT8.js → ja-B7H3ID8O.js} +2 -3
  190. package/dist/cdn/chunks/{ja-Di-zJiT8.js.map → ja-B7H3ID8O.js.map} +1 -1
  191. package/dist/cdn/chunks/{ja-dcWzjStz.js → ja-Cu2HdYaK.js} +2 -3
  192. package/dist/cdn/chunks/{ja-dcWzjStz.js.map → ja-Cu2HdYaK.js.map} +1 -1
  193. package/dist/cdn/chunks/{keys-BTpmg2Tt.js → keys-CUj6UA38.js} +3 -4
  194. package/dist/cdn/chunks/{keys-BTpmg2Tt.js.map → keys-CUj6UA38.js.map} +1 -1
  195. package/dist/{liquid.browser-Ct2-EezB.js → cdn/chunks/liquid.browser-rubac0VA.js} +993 -937
  196. package/dist/cdn/chunks/liquid.browser-rubac0VA.js.map +1 -0
  197. package/dist/cdn/chunks/{logger-Tj0RPskW.js → logger-CqQTfJGx.js} +2 -3
  198. package/dist/cdn/chunks/{logger-Tj0RPskW.js.map → logger-CqQTfJGx.js.map} +1 -1
  199. package/dist/cdn/chunks/{nl-CvVuHYFL.js → nl-176ySmc5.js} +2 -3
  200. package/dist/cdn/chunks/{nl-CvVuHYFL.js.map → nl-176ySmc5.js.map} +1 -1
  201. package/dist/cdn/chunks/{nl-LZNqQgE4.js → nl-1Ai2NykB.js} +2 -3
  202. package/dist/cdn/chunks/{nl-LZNqQgE4.js.map → nl-1Ai2NykB.js.map} +1 -1
  203. package/dist/cdn/chunks/{normalizeMergeTagMarkup-DyePIGqu.js → normalizeMergeTagMarkup-C_KlfSW4.js} +3 -4
  204. package/dist/cdn/chunks/{normalizeMergeTagMarkup-DyePIGqu.js.map → normalizeMergeTagMarkup-C_KlfSW4.js.map} +1 -1
  205. package/dist/cdn/chunks/{preRenderCustomBlocks-Dc-QLntG.js → preRenderCustomBlocks-BcXIz7oJ.js} +6 -7
  206. package/dist/cdn/chunks/{preRenderCustomBlocks-Dc-QLntG.js.map → preRenderCustomBlocks-BcXIz7oJ.js.map} +1 -1
  207. package/dist/cdn/chunks/{pt-BR-CHM-ZKvE.js → pt-BR-Bp92Fc6J.js} +2 -3
  208. package/dist/cdn/chunks/{pt-BR-CHM-ZKvE.js.map → pt-BR-Bp92Fc6J.js.map} +1 -1
  209. package/dist/cdn/chunks/{pt-BR-D6P_mNwA.js → pt-BR-CIbp__Z7.js} +2 -3
  210. package/dist/cdn/chunks/{pt-BR-D6P_mNwA.js.map → pt-BR-CIbp__Z7.js.map} +1 -1
  211. package/dist/cdn/chunks/{pt-BR-ZhO4vgyq.js → pt-BR-dDlTwX18.js} +2 -3
  212. package/dist/cdn/chunks/{pt-BR-ZhO4vgyq.js.map → pt-BR-dDlTwX18.js.map} +1 -1
  213. package/dist/cdn/chunks/{pusher-Cs4GGEtd.js → pusher-x9rNqzon.js} +3 -4
  214. package/dist/cdn/chunks/{pusher-Cs4GGEtd.js.map → pusher-x9rNqzon.js.map} +1 -1
  215. package/dist/cdn/chunks/{readableTextColor-f8Kykfnh.js → readableTextColor-BfZUGnVj.js} +2 -3
  216. package/dist/cdn/chunks/{readableTextColor-f8Kykfnh.js.map → readableTextColor-BfZUGnVj.js.map} +1 -1
  217. package/dist/cdn/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
  218. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js +72 -0
  219. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js.map +1 -0
  220. package/dist/cdn/chunks/{socialIcons-BBvsTwCV.js → socialIcons-jsTDmkbb.js} +608 -632
  221. package/dist/cdn/chunks/{socialIcons-BBvsTwCV.js.map → socialIcons-jsTDmkbb.js.map} +1 -1
  222. package/dist/cdn/chunks/src-C7bkofBL.js +647 -0
  223. package/dist/cdn/chunks/src-C7bkofBL.js.map +1 -0
  224. package/dist/cdn/chunks/{src-Bs_yxk3h.js → src-DEd87i_U.js} +502 -537
  225. package/dist/cdn/chunks/src-DEd87i_U.js.map +1 -0
  226. package/dist/cdn/chunks/{src-BNFnxfrA.js → src-DwWrYnUj.js} +188 -171
  227. package/dist/cdn/chunks/src-DwWrYnUj.js.map +1 -0
  228. package/dist/cdn/chunks/{styleConstants-v1dNKgJf.js → styleConstants-B8xVRiwX.js} +2 -3
  229. package/dist/cdn/chunks/{styleConstants-v1dNKgJf.js.map → styleConstants-B8xVRiwX.js.map} +1 -1
  230. package/dist/cdn/chunks/{templateSettingsFields-YCFVBVYh.js → templateSettingsFields-cjlP-jdw.js} +2 -3
  231. package/dist/cdn/chunks/{templateSettingsFields-YCFVBVYh.js.map → templateSettingsFields-cjlP-jdw.js.map} +1 -1
  232. package/dist/cdn/chunks/{tiptap-CtVrAViq.js → tiptap-CbiTlECY.js} +3402 -3278
  233. package/dist/cdn/chunks/tiptap-CbiTlECY.js.map +1 -0
  234. package/dist/cdn/chunks/{useCloudI18n-AVXhzbhQ.js → useCloudI18n-DY8_-ETE.js} +4 -5
  235. package/dist/cdn/chunks/{useCloudI18n-AVXhzbhQ.js.map → useCloudI18n-DY8_-ETE.js.map} +1 -1
  236. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +2582 -0
  237. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +1 -0
  238. package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +9 -0
  239. package/dist/cdn/chunks/{useEditorRoot-CR5GjJD6.js.map → useEditorRoot-vjZJwKrV.js.map} +1 -1
  240. package/dist/cdn/chunks/{useI18n-CbVubQhM.js → useI18n-D8pY4LTq.js} +4 -5
  241. package/dist/cdn/chunks/{useI18n-CbVubQhM.js.map → useI18n-D8pY4LTq.js.map} +1 -1
  242. package/dist/{useLogicTag-DKLZ1T9H.js → cdn/chunks/useLogicTag-DBJDtpKA.js} +6 -5
  243. package/dist/cdn/chunks/{useLogicTag-B49Nc53Y.js.map → useLogicTag-DBJDtpKA.js.map} +1 -1
  244. package/dist/{useMergeTag-Bhdx7AKk.js → cdn/chunks/useMergeTag-B-aG--s1.js} +8 -7
  245. package/dist/cdn/chunks/{useMergeTag-B0KryMj8.js.map → useMergeTag-B-aG--s1.js.map} +1 -1
  246. package/dist/{usePopoverPosition-BZea45XK.js → cdn/chunks/usePopoverPosition-DSMtmu2W.js} +8 -10
  247. package/dist/cdn/chunks/{usePopoverPosition-C829ps5i.js.map → usePopoverPosition-DSMtmu2W.js.map} +1 -1
  248. package/dist/cdn/chunks/{useScrollToBlock-CAwvulog.js → useScrollToBlock-vjQ0fe-L.js} +5 -7
  249. package/dist/cdn/chunks/{useScrollToBlock-CAwvulog.js.map → useScrollToBlock-vjQ0fe-L.js.map} +1 -1
  250. package/dist/cdn/chunks/{withCurrentFont-DFPXeVfG.js → withCurrentFont-hZTvYBHO.js} +3 -4
  251. package/dist/cdn/chunks/{withCurrentFont-DFPXeVfG.js.map → withCurrentFont-hZTvYBHO.js.map} +1 -1
  252. package/dist/cdn/editor.css +1 -1
  253. package/dist/cdn/editor.js +1433 -1454
  254. package/dist/cdn/editor.js.map +1 -1
  255. package/dist/{check-yYsp5Xpk.js → check-BZ8o0eet.js} +1 -2
  256. package/dist/{chevron-down-DTmD06_j.js → chevron-down-DfAAfILv.js} +1 -2
  257. package/dist/{chevron-right-BSeYZOxc.js → chevron-right-Bk4mGdr7.js} +1 -2
  258. package/dist/{chevron-up-BOApwrxi.js → chevron-up-MhUf_azW.js} +1 -2
  259. package/dist/{circle-alert-BMszY8im.js → circle-alert-CShJwVFv.js} +1 -2
  260. package/dist/{clock-HADxnl6-.js → clock-CTfD6OCt.js} +1 -2
  261. package/dist/{createCloudRuntime-DVQI_ReU.js → createCloudRuntime-DCgO4A1r.js} +31 -37
  262. package/dist/{createLucideIcon-0lYYH3EW.js → createLucideIcon-CvhTA2KG.js} +6 -11
  263. package/dist/{de-DBOTcDj2.js → de-6M4JoHoD.js} +1 -2
  264. package/dist/{de-DNuYQTmS.js → de-CeFJ6wbM.js} +1 -2
  265. package/dist/{de-JvCTMJPy.js → de-DtrXVcuY.js} +1 -2
  266. package/dist/{dist-BC-ZEYLd.js → dist-BF5zEHop.js} +2 -3
  267. package/dist/{dist-CyBwSiAa.js → dist-BS5uKktL.js} +2 -3
  268. package/dist/{cdn/chunks/dist-S-rLGqax.js → dist-ByCWA2Tv.js} +101 -101
  269. package/dist/{dist-DtOF3bDW.js → dist-CKi_npZM.js} +378 -343
  270. package/dist/{dist-C7EtxNCb.js → dist-CVy-7PHQ.js} +55 -56
  271. package/dist/{dist-Cr7RPxI9.js → dist-CWSG7Kj0.js} +478 -461
  272. package/dist/{dist-DXyGqIDE.js → dist-Cy8I5scI.js} +2 -3
  273. package/dist/{dist-C_dV9QAx.js → dist-D6cMdrfG.js} +133 -133
  274. package/dist/{dist-DVNjPKsH.js → dist-D6fZec6r.js} +3 -4
  275. package/dist/{dist-CuLwJF7H.js → dist-Dd5MU2Ev.js} +23 -14
  276. package/dist/dist-DyFArF_G.js +4 -0
  277. package/dist/{dist-DBxgrOeo.js → dist-V7W1UhVr.js} +1882 -1792
  278. package/dist/{dist-DPcf6XZ8.js → dist-p3wymUDt.js} +2 -3
  279. package/dist/dist-pA3ooG6N.js +4 -0
  280. package/dist/{dist-3HpYixwF.js → dist-txQLT2sF.js} +173 -161
  281. package/dist/{cdn/chunks/editor-modal-CI6EfeMd.js → editor-modal-zaZHcmlO.js} +915 -859
  282. package/dist/{emojiData-6m0DBh7O.js → emojiData-CBNuCfum.js} +1 -2
  283. package/dist/{en-CW71OK66.js → en-D14i5nFh.js} +1 -2
  284. package/dist/en-Db76vJbY.js +1 -0
  285. package/dist/{en-CDhWRrF_.js → en-FzUuJ8HW.js} +1 -2
  286. package/dist/{es-CAv-Vldw.js → es-Dw_h7Oll.js} +1 -2
  287. package/dist/{es-DdK7zQfi.js → es-zDacbMhs.js} +1 -2
  288. package/dist/{extensions-CdyweA50.js → extensions-fo_c-vqf.js} +82 -91
  289. package/dist/{eye-DWkSvYpj.js → eye-7W4t5e0Q.js} +1 -2
  290. package/dist/{formatAbsoluteDateTime-DMmop3C-.js → formatAbsoluteDateTime-Ck2_zXra.js} +1 -2
  291. package/dist/{formatRelativeTime-CtUU-QZ8.js → formatRelativeTime-BTD8Ktt-.js} +0 -1
  292. package/dist/{fr-DVPtxpR6.js → fr-BJaeKu_8.js} +1 -2
  293. package/dist/{fr-Dz5Bgb7-.js → fr-CSgYtjOd.js} +1 -2
  294. package/dist/{image-DesWjcZ4.js → image-BDiRFzSd.js} +1 -2
  295. package/dist/index.d.ts +6 -6
  296. package/dist/{info-ClWJGoZy.js → info-Cxi3-Kh9.js} +1 -2
  297. package/dist/{ja-Di-zJiT8.js → ja-B7H3ID8O.js} +1 -2
  298. package/dist/{ja-dcWzjStz.js → ja-Cu2HdYaK.js} +1 -2
  299. package/dist/{keys-Zd9KWRD1.js → keys-BgRERHzu.js} +2 -3
  300. package/dist/{link-BqRicFTA.js → link-ju_2Cmir.js} +1 -2
  301. package/dist/{cdn/chunks/liquid.browser-Bbt17cVz.js → liquid.browser-DUXEekoN.js} +991 -939
  302. package/dist/{list-bojQr9bn.js → list-DYZJf0aZ.js} +1 -2
  303. package/dist/{loader-circle-B2B8LbUu.js → loader-circle-BZRD0a4I.js} +1 -2
  304. package/dist/{logger-k9Nbj3Cp.js → logger-BOu7oEtk.js} +1 -2
  305. package/dist/{message-circle-BEuiNsyZ.js → message-circle-DuEw4Zfx.js} +1 -2
  306. package/dist/{nl-CvVuHYFL.js → nl-176ySmc5.js} +1 -2
  307. package/dist/{nl-LZNqQgE4.js → nl-1Ai2NykB.js} +1 -2
  308. package/dist/{normalizeMergeTagMarkup-P6SUBuPv.js → normalizeMergeTagMarkup-CELnOlgK.js} +30 -31
  309. package/dist/{package-DCROB4aM.js → package-CePMr2kK.js} +1 -2
  310. package/dist/{pencil-CEotCKbf.js → pencil-D3aFCL7c.js} +1 -2
  311. package/dist/{preRenderCustomBlocks-D8rr61_z.js → preRenderCustomBlocks--_xc0XK3.js} +4 -5
  312. package/dist/{pt-BR-CHM-ZKvE.js → pt-BR-Bp92Fc6J.js} +1 -2
  313. package/dist/{pt-BR-D6P_mNwA.js → pt-BR-CIbp__Z7.js} +1 -2
  314. package/dist/{pt-BR-ZhO4vgyq.js → pt-BR-dDlTwX18.js} +1 -2
  315. package/dist/{readableTextColor-f8Kykfnh.js → readableTextColor-BfZUGnVj.js} +1 -2
  316. package/dist/{refresh-cw-C6M2mHNC.js → refresh-cw-xnro7_Sk.js} +1 -2
  317. package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
  318. package/dist/{runtime-dom.esm-bundler-B8WCZWUm.js → runtime-dom.esm-bundler-BURR-bj5.js} +121 -122
  319. package/dist/sanitizeHtml-BzfzpYJY.js +942 -0
  320. package/dist/{search-Cy99zPYf.js → search-CDrstRBv.js} +1 -2
  321. package/dist/{send-BDLJFsf3.js → send-DROkPOaX.js} +1 -2
  322. package/dist/{smartphone-CVvQaNA4.js → smartphone-Bx6u_tjn.js} +1 -2
  323. package/dist/{socialIcons-Dd-jRiVe.js → socialIcons-D7MGsg0d.js} +553 -564
  324. package/dist/{sparkles-Ce0Qz0ox.js → sparkles-CdaTtvoz.js} +1 -2
  325. package/dist/{square-BWlolnXe.js → square-BbCROH_f.js} +1 -2
  326. package/dist/style.css +1 -1
  327. package/dist/{styleConstants-v1dNKgJf.js → styleConstants-B8xVRiwX.js} +1 -2
  328. package/dist/{templateSettingsFields-YCFVBVYh.js → templateSettingsFields-cjlP-jdw.js} +1 -2
  329. package/dist/templatical-editor.js +1231 -1251
  330. package/dist/{text-align-start-D1V5gPTy.js → text-align-start-CGacJ9Vw.js} +1 -2
  331. package/dist/{trash-CZfiUFmw.js → trash-DxCd7zIy.js} +1 -2
  332. package/dist/{triangle-alert-CFDzyFC7.js → triangle-alert-7_oaitpf.js} +1 -2
  333. package/dist/{upload-BJfvdIrD.js → upload-DuFEOi_0.js} +1 -2
  334. package/dist/{useCloudI18n-Dcjua65H.js → useCloudI18n-DEMmUKuO.js} +3 -4
  335. package/dist/{useEditorCore-BTLeAVlM.js → useEditorCore-BSo2sSID.js} +1568 -1573
  336. package/dist/useEditorRoot-BMcoCLBx.js +7 -0
  337. package/dist/{useI18n-BdoY7xDE.js → useI18n-BBrHTdu8.js} +3 -4
  338. package/dist/{cdn/chunks/useLogicTag-B49Nc53Y.js → useLogicTag-ZPC39rfH.js} +4 -7
  339. package/dist/{cdn/chunks/useMergeTag-B0KryMj8.js → useMergeTag-BQ4qqWpQ.js} +6 -9
  340. package/dist/{cdn/chunks/usePopoverPosition-C829ps5i.js → usePopoverPosition-DV1PxL66.js} +6 -12
  341. package/dist/{useScrollToBlock-FmNMALM_.js → useScrollToBlock-BSyAV4pk.js} +4 -6
  342. package/dist/{vue.runtime.esm-bundler-DgFJ6GPG.js → vue.runtime.esm-bundler-CnEeTfhs.js} +1001 -1002
  343. package/dist/{withCurrentFont-BATJHNve.js → withCurrentFont-B22FXAF5.js} +2 -3
  344. package/dist/{x-CZ0Js0hA.js → x-BpfG7v9g.js} +1 -2
  345. package/package.json +26 -24
  346. package/dist/BlockIssueBadge-CKwZ1Vgn.js +0 -34
  347. package/dist/CommentsSidebar-Ca3DyFOX.js +0 -500
  348. package/dist/IssuesPanel-C8nMUccy.js +0 -360
  349. package/dist/SavedBlocksBrowserModal-wnkvxpm_.js +0 -360
  350. package/dist/WrapperBlock-BO619LAb.js +0 -45
  351. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js.map +0 -1
  352. package/dist/cdn/chunks/BlockIssueBadge-DAn2vsMJ.js +0 -35
  353. package/dist/cdn/chunks/BlockIssueBadge-DAn2vsMJ.js.map +0 -1
  354. package/dist/cdn/chunks/CommentsSidebar-CCvplq1Z.js.map +0 -1
  355. package/dist/cdn/chunks/LoadingTrack-BIcL4NiY.js +0 -12
  356. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js.map +0 -1
  357. package/dist/cdn/chunks/SavedBlocksBrowserModal-DtOz_X5S.js +0 -357
  358. package/dist/cdn/chunks/TitleEditor-Ccv6uoTz.js.map +0 -1
  359. package/dist/cdn/chunks/TplModal-BXQzmsJX.js +0 -52
  360. package/dist/cdn/chunks/blockTypeIcons-ikZAmd6U.js +0 -22
  361. package/dist/cdn/chunks/blockTypeIcons-ikZAmd6U.js.map +0 -1
  362. package/dist/cdn/chunks/draggable-DZ0gwUJ6.js.map +0 -1
  363. package/dist/cdn/chunks/en-ifvu6oPv.js +0 -1
  364. package/dist/cdn/chunks/icons-DNX6StSs.js.map +0 -1
  365. package/dist/cdn/chunks/liquid.browser-Bbt17cVz.js.map +0 -1
  366. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js +0 -62
  367. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js.map +0 -1
  368. package/dist/cdn/chunks/src-BNFnxfrA.js.map +0 -1
  369. package/dist/cdn/chunks/src-Bs_yxk3h.js.map +0 -1
  370. package/dist/cdn/chunks/src-YGkzYyu0.js +0 -649
  371. package/dist/cdn/chunks/src-YGkzYyu0.js.map +0 -1
  372. package/dist/cdn/chunks/tiptap-CtVrAViq.js.map +0 -1
  373. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js +0 -2586
  374. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js.map +0 -1
  375. package/dist/cdn/chunks/useEditorRoot-CR5GjJD6.js +0 -10
  376. package/dist/dist-BPFcLKTw.js +0 -5
  377. package/dist/dist-D7Yj7E-F.js +0 -5
  378. package/dist/en-DwV15ltA.js +0 -1
  379. package/dist/sanitizeRichTextHtml-DeISfLFr.js +0 -60
  380. package/dist/useEditorRoot-DUy67lJu.js +0 -8
@@ -1,20 +1,20 @@
1
- import { $ as e, C as t, D as n, I as r, M as i, P as a, U as o, V as s, W as c, _ as l, b as u, c as d, dt as f, g as p, h as m, j as h, l as g, lt as _, m as v, o as y, ot as b, p as x, t as S, u as C, ut as w, x as T, z as ee } from "./draggable-DZ0gwUJ6.js";
2
- import { c as E, v as D } from "./socialIcons-BBvsTwCV.js";
3
- import "./useEditorCore-CCVFi1YZ.js";
4
- import { $ as O, U as k, g as A, p as j } from "./keys-BTpmg2Tt.js";
5
- import { t as M } from "./useI18n-CbVubQhM.js";
6
- import { Ft as te, Rt as N, ot as P, vt as F } from "./icons-DNX6StSs.js";
7
- import { v as I } from "./styleConstants-v1dNKgJf.js";
8
- import { t as L } from "./TplModal-BXQzmsJX.js";
9
- import { t as R } from "./BlockPreviewCanvas-D0--EQkP.js";
10
- //#region src/components/SavedBlockPreviewRow.vue?vue&type=script&setup=true&lang.ts
1
+ import { C as e, D as t, G as n, I as r, M as i, P as a, V as o, W as s, _ as c, b as l, c as u, dt as d, et as f, ft as p, g as m, h, j as g, l as _, m as v, o as y, p as b, st as x, t as S, u as C, ut as w, x as T, z as E } from "./draggable-Du8AUMFT.js";
2
+ import { c as D, v as O } from "./socialIcons-jsTDmkbb.js";
3
+ import "./useEditorCore-BrY66C2y.js";
4
+ import { $ as k, U as A, g as j, p as M } from "./keys-CUj6UA38.js";
5
+ import { t as ee } from "./useI18n-D8pY4LTq.js";
6
+ import { It as te, at as N, yt as P, zt as F } from "./icons-okSPsLOa.js";
7
+ import { v as I } from "./styleConstants-B8xVRiwX.js";
8
+ import { t as L } from "./TplModal-CFPDgbwQ.js";
9
+ import { t as R } from "./BlockPreviewCanvas-DGBh6mqe.js";
10
+ // src/components/SavedBlockPreviewRow.vue?vue&type=script&setup=true&lang.ts
11
11
  var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relative tpl:min-w-0 tpl:flex-1" }, H = {
12
12
  key: 0,
13
13
  "data-testid": "saved-blocks-preview-fade",
14
14
  "aria-hidden": "true",
15
15
  class: "tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10",
16
16
  style: { background: "linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n )" }
17
- }, U = ["aria-label", "aria-expanded"], W = 240, G = /* @__PURE__ */ t({
17
+ }, U = ["aria-label", "aria-expanded"], W = 240, G = /* @__PURE__ */ e({
18
18
  __name: "SavedBlockPreviewRow",
19
19
  props: {
20
20
  block: {},
@@ -22,29 +22,29 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
22
22
  total: {}
23
23
  },
24
24
  emits: ["move"],
25
- setup(t, { emit: r }) {
26
- let o = t, s = r, { t: c, format: _ } = M(), y = n(j, []), S = n(A, null), C = x(() => E(S?.content.value.settings)), O = e(null), k = e(null), P = e(1), I = e(null), L = e(!1), G = null, K = x(() => I.value !== null && I.value > W), q = x(() => I.value === null ? null : L.value || !K.value ? I.value : W);
25
+ setup(e, { emit: n }) {
26
+ let r = e, o = n, { t: s, format: y } = ee(), S = t(M, []), C = t(j, null), w = b(() => D(C?.content.value.settings)), k = f(null), A = f(null), N = f(1), I = f(null), L = f(!1), G = null, K = b(() => I.value !== null && I.value > W), q = b(() => I.value === null ? null : L.value || !K.value ? I.value : W);
27
27
  function J() {
28
- let e = O.value, t = k.value;
28
+ let e = k.value, t = A.value;
29
29
  if (!e || !t) return;
30
30
  let n = e.clientWidth;
31
31
  if (n <= 0) return;
32
- let r = Math.min(1, n / C.value);
33
- P.value = r, I.value = t.offsetHeight * r;
32
+ let r = Math.min(1, n / w.value);
33
+ N.value = r, I.value = t.offsetHeight * r;
34
34
  }
35
35
  i(() => {
36
- J(), typeof ResizeObserver < "u" && (G = new ResizeObserver(() => J()), O.value && G.observe(O.value), k.value && G.observe(k.value));
37
- }), h(() => {
36
+ J(), typeof ResizeObserver < "u" && (G = new ResizeObserver(() => J()), k.value && G.observe(k.value), A.value && G.observe(A.value));
37
+ }), g(() => {
38
38
  G?.disconnect(), G = null;
39
39
  });
40
- let Y = x(() => D(o.block, c, y)), X = x(() => _(c.savedBlocks.reorderHandle, {
40
+ let Y = b(() => O(r.block, s, S)), X = b(() => y(s.savedBlocks.reorderHandle, {
41
41
  block: Y.value,
42
- position: o.position,
43
- total: o.total
44
- })), Z = x(() => _(L.value ? c.savedBlocks.collapsePreview : c.savedBlocks.expandPreview, { block: Y.value }));
45
- return (e, n) => (a(), l("div", {
42
+ position: r.position,
43
+ total: r.total
44
+ })), Z = b(() => y(L.value ? s.savedBlocks.collapsePreview : s.savedBlocks.expandPreview, { block: Y.value }));
45
+ return (t, n) => (a(), c("div", {
46
46
  "data-testid": "saved-blocks-reorder-row",
47
- "data-block-id": t.block.id,
47
+ "data-block-id": e.block.id,
48
48
  class: "tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]",
49
49
  style: { "background-color": "var(--tpl-bg)" }
50
50
  }, [v("button", {
@@ -52,28 +52,28 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
52
52
  "data-testid": "saved-blocks-reorder-handle",
53
53
  class: "tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]",
54
54
  "aria-label": X.value,
55
- title: b(c).savedBlocks.reorderHint,
56
- onKeydown: [n[0] ||= d(g((e) => s("move", -1), ["prevent"]), ["up"]), n[1] ||= d(g((e) => s("move", 1), ["prevent"]), ["down"])]
57
- }, [T(b(F), {
55
+ title: x(s).savedBlocks.reorderHint,
56
+ onKeydown: [n[0] ||= u(_((e) => o("move", -1), ["prevent"]), ["up"]), n[1] ||= u(_((e) => o("move", 1), ["prevent"]), ["down"])]
57
+ }, [T(x(P), {
58
58
  size: 14,
59
59
  "stroke-width": 1.5
60
60
  })], 40, B), v("div", V, [
61
61
  v("div", {
62
62
  ref_key: "frameEl",
63
- ref: O,
63
+ ref: k,
64
64
  class: "tpl:overflow-hidden",
65
- style: w({ height: q.value === null ? void 0 : `${q.value}px` })
65
+ style: d({ height: q.value === null ? void 0 : `${q.value}px` })
66
66
  }, [v("div", {
67
67
  ref_key: "contentEl",
68
- ref: k,
69
- style: w({
70
- width: `${C.value}px`,
71
- transform: `scale(${P.value})`,
68
+ ref: A,
69
+ style: d({
70
+ width: `${w.value}px`,
71
+ transform: `scale(${N.value})`,
72
72
  transformOrigin: "top left"
73
73
  })
74
- }, [T(R, { blocks: [t.block] }, null, 8, ["blocks"])], 4)], 4),
75
- K.value && !L.value ? (a(), l("div", H)) : p("", !0),
76
- K.value ? (a(), l("button", {
74
+ }, [T(R, { blocks: [e.block] }, null, 8, ["blocks"])], 4)], 4),
75
+ K.value && !L.value ? (a(), c("div", H)) : m("", !0),
76
+ K.value ? (a(), c("button", {
77
77
  key: 1,
78
78
  type: "button",
79
79
  "data-testid": "saved-blocks-preview-toggle",
@@ -81,10 +81,10 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
81
81
  "aria-label": Z.value,
82
82
  "aria-expanded": L.value,
83
83
  onClick: n[2] ||= (e) => L.value = !L.value
84
- }, [(a(), m(ee(b(L.value ? te : N)), {
84
+ }, [(a(), h(E(x(L.value ? te : F)), {
85
85
  size: 11,
86
86
  "stroke-width": 2
87
- })), u(" " + f(L.value ? b(c).savedBlocks.collapse : b(c).savedBlocks.expand), 1)], 8, U)) : p("", !0)
87
+ })), l(" " + p(L.value ? x(s).savedBlocks.collapse : x(s).savedBlocks.expand), 1)], 8, U)) : m("", !0)
88
88
  ])], 8, z));
89
89
  }
90
90
  }), K = ["aria-busy"], q = {
@@ -111,18 +111,18 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
111
111
  }, de = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2" }, fe = ["disabled"], pe = ["disabled"], me = {
112
112
  key: 0,
113
113
  class: "tpl:flex tpl:items-center tpl:gap-1.5"
114
- }, he = { key: 1 }, Q = /* @__PURE__ */ t({
114
+ }, he = { key: 1 }, Q = /* @__PURE__ */ e({
115
115
  __name: "SaveBlockDialog",
116
116
  props: {
117
117
  visible: { type: Boolean },
118
118
  pickedIds: {}
119
119
  },
120
120
  emits: ["close", "saved"],
121
- setup(t, { emit: i }) {
122
- let d = t, h = i, { t: g, format: w } = M(), ee = O(A, "SaveBlockDialog"), E = O(k, "SaveBlockDialog"), te = n(j, []), N = e(""), F = e(""), R = e(!1), z = e(null), B = e(""), V = e([]), H = x(() => {
123
- let e = new Map(ee.content.value.blocks.map((e) => [e.id, e]));
121
+ setup(e, { emit: i }) {
122
+ let u = e, d = i, { t: g, format: _ } = ee(), E = k(j, "SaveBlockDialog"), D = k(A, "SaveBlockDialog"), te = t(M, []), P = f(""), F = f(""), R = f(!1), z = f(null), B = f(""), V = f([]), H = b(() => {
123
+ let e = new Map(E.content.value.blocks.map((e) => [e.id, e]));
124
124
  return V.value.map((t) => e.get(t)).filter((e) => e !== void 0);
125
- }), U = x({
125
+ }), U = b({
126
126
  get: () => H.value,
127
127
  set: (e) => {
128
128
  V.value = e.map((e) => e.id);
@@ -133,27 +133,27 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
133
133
  if (r === -1 || i < 0 || i >= n.length) return;
134
134
  [n[r], n[i]] = [n[i], n[r]], V.value = n;
135
135
  let a = H.value[i];
136
- B.value = a ? w(g.savedBlocks.reorderAnnouncement, {
136
+ B.value = a ? _(g.savedBlocks.reorderAnnouncement, {
137
137
  block: Q(a),
138
138
  position: i + 1,
139
139
  total: n.length
140
140
  }) : "";
141
141
  }
142
142
  function Q(e) {
143
- return D(e, g, te);
143
+ return O(e, g, te);
144
144
  }
145
- let ge = x(() => H.value.map(Q).join(", "));
146
- s(() => d.visible, (e) => {
147
- e && (N.value = "", F.value = "", z.value = null, B.value = "", V.value = [...d.pickedIds]);
145
+ let ge = b(() => H.value.map(Q).join(", "));
146
+ o(() => u.visible, (e) => {
147
+ e && (P.value = "", F.value = "", z.value = null, B.value = "", V.value = [...u.pickedIds]);
148
148
  }, { immediate: !0 });
149
- let _e = x(() => N.value.trim().length > 0 && H.value.length > 0 && !R.value);
149
+ let _e = b(() => P.value.trim().length > 0 && H.value.length > 0 && !R.value);
150
150
  async function ve() {
151
151
  if (!_e.value) return;
152
152
  let e = H.value;
153
153
  if (e.length !== 0) {
154
154
  R.value = !0, z.value = null;
155
155
  try {
156
- await E.create(N.value.trim(), e, F.value.trim() || void 0), h("saved"), h("close");
156
+ await D.create(P.value.trim(), e, F.value.trim() || void 0), d("saved"), d("close");
157
157
  } catch (e) {
158
158
  z.value = e.message;
159
159
  } finally {
@@ -162,17 +162,17 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
162
162
  }
163
163
  }
164
164
  function $() {
165
- R.value || h("close");
165
+ R.value || d("close");
166
166
  }
167
167
  function ye(e) {
168
168
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), ve()), e.key === "Escape" && $();
169
169
  }
170
- return (e, n) => (a(), m(L, {
171
- visible: t.visible,
170
+ return (t, i) => (a(), h(L, {
171
+ visible: e.visible,
172
172
  onClose: $,
173
173
  onKeydown: ye
174
174
  }, {
175
- default: o(() => [v("div", {
175
+ default: s(() => [v("div", {
176
176
  role: "dialog",
177
177
  "aria-modal": "true",
178
178
  "aria-busy": R.value,
@@ -183,37 +183,37 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
183
183
  "box-shadow": "var(--tpl-shadow-xl)"
184
184
  }
185
185
  }, [
186
- v("h3", q, f(b(g).savedBlocks.saveAsBlock), 1),
187
- v("div", J, [v("label", Y, f(b(g).savedBlocks.name), 1), c(v("input", {
188
- "onUpdate:modelValue": n[0] ||= (e) => N.value = e,
186
+ v("h3", q, p(x(g).savedBlocks.saveAsBlock), 1),
187
+ v("div", J, [v("label", Y, p(x(g).savedBlocks.name), 1), n(v("input", {
188
+ "onUpdate:modelValue": i[0] ||= (e) => P.value = e,
189
189
  type: "text",
190
190
  "data-testid": "saved-blocks-name-input",
191
- placeholder: b(g).savedBlocks.namePlaceholder,
191
+ placeholder: x(g).savedBlocks.namePlaceholder,
192
192
  class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
193
193
  disabled: R.value
194
- }, null, 8, X), [[y, N.value]])]),
194
+ }, null, 8, X), [[y, P.value]])]),
195
195
  v("div", Z, [
196
- v("label", ne, f(b(g).savedBlocks.category), 1),
197
- c(v("input", {
196
+ v("label", ne, p(x(g).savedBlocks.category), 1),
197
+ n(v("input", {
198
198
  id: "tpl-save-block-category",
199
- "onUpdate:modelValue": n[1] ||= (e) => F.value = e,
199
+ "onUpdate:modelValue": i[1] ||= (e) => F.value = e,
200
200
  type: "text",
201
201
  "data-testid": "saved-blocks-category-input",
202
202
  list: "tpl-saved-block-categories",
203
- placeholder: b(g).savedBlocks.categoryPlaceholder,
203
+ placeholder: x(g).savedBlocks.categoryPlaceholder,
204
204
  class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
205
205
  disabled: R.value
206
206
  }, null, 8, re), [[y, F.value]]),
207
- v("datalist", ie, [(a(!0), l(C, null, r(b(E).categories.value, (e) => (a(), l("option", {
207
+ v("datalist", ie, [(a(!0), c(C, null, r(x(D).categories.value, (e) => (a(), c("option", {
208
208
  key: e,
209
209
  value: e
210
210
  }, null, 8, ae))), 128))])
211
211
  ]),
212
- v("p", oe, [u(f(b(w)(b(g).savedBlocks.savingCount, { count: H.value.length })) + " ", 1), v("span", se, f(ge.value), 1)]),
213
- H.value.length > 1 ? (a(), l("p", ce, f(b(g).savedBlocks.reorderHint), 1)) : p("", !0),
214
- T(b(S), {
212
+ v("p", oe, [l(p(x(_)(x(g).savedBlocks.savingCount, { count: H.value.length })) + " ", 1), v("span", se, p(ge.value), 1)]),
213
+ H.value.length > 1 ? (a(), c("p", ce, p(x(g).savedBlocks.reorderHint), 1)) : m("", !0),
214
+ T(x(S), {
215
215
  modelValue: U.value,
216
- "onUpdate:modelValue": n[2] ||= (e) => U.value = e,
216
+ "onUpdate:modelValue": i[2] ||= (e) => U.value = e,
217
217
  "data-testid": "saved-blocks-reorder-list",
218
218
  animation: 150,
219
219
  "ghost-class": "tpl-ghost",
@@ -222,7 +222,7 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
222
222
  "force-fallback": !0,
223
223
  class: "tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto"
224
224
  }, {
225
- default: o(() => [(a(!0), l(C, null, r(U.value, (e, t) => (a(), m(G, {
225
+ default: s(() => [(a(!0), c(C, null, r(U.value, (e, t) => (a(), h(G, {
226
226
  key: e.id,
227
227
  block: e,
228
228
  position: t + 1,
@@ -236,29 +236,28 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
236
236
  ]))), 128))]),
237
237
  _: 1
238
238
  }, 8, ["modelValue"]),
239
- v("div", le, f(B.value), 1),
240
- z.value ? (a(), l("p", ue, f(z.value), 1)) : p("", !0),
239
+ v("div", le, p(B.value), 1),
240
+ z.value ? (a(), c("p", ue, p(z.value), 1)) : m("", !0),
241
241
  v("div", de, [v("button", {
242
242
  type: "button",
243
- class: _(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]", { "tpl:cursor-not-allowed tpl:opacity-50": R.value }]),
243
+ class: w(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]", { "tpl:cursor-not-allowed tpl:opacity-50": R.value }]),
244
244
  disabled: R.value,
245
245
  onClick: $
246
- }, f(b(g).savedBlocks.cancel), 11, fe), v("button", {
246
+ }, p(x(g).savedBlocks.cancel), 11, fe), v("button", {
247
247
  type: "button",
248
- class: _(b(I)),
248
+ class: w(x(I)),
249
249
  disabled: !_e.value,
250
250
  onClick: ve
251
- }, [R.value ? (a(), l("span", me, [T(b(P), {
251
+ }, [R.value ? (a(), c("span", me, [T(x(N), {
252
252
  class: "tpl:animate-spin",
253
253
  size: 12,
254
254
  "stroke-width": 2
255
- }), u(" " + f(b(g).savedBlocks.saving), 1)])) : (a(), l("span", he, f(b(g).savedBlocks.save), 1))], 10, pe)])
255
+ }), l(" " + p(x(g).savedBlocks.saving), 1)])) : (a(), c("span", he, p(x(g).savedBlocks.save), 1))], 10, pe)])
256
256
  ], 8, K)]),
257
257
  _: 1
258
258
  }, 8, ["visible"]));
259
259
  }
260
260
  });
261
- //#endregion
262
261
  export { Q as default };
263
262
 
264
- //# sourceMappingURL=SaveBlockDialog-CijargAy.js.map
263
+ //# sourceMappingURL=SaveBlockDialog-CUhpawq0.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveBlockDialog-CijargAy.js","names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_openBlock","_createElementBlock","_createElementVNode","_unref","_withKeys","_withModifiers","_createVNode","_normalizeStyle","BlockPreviewCanvas","_createCommentVNode","_createBlock","_resolveDynamicComponent","_createTextVNode","_toDisplayString","_sfc_main","_openBlock","_createBlock","TplModal","_withCtx","_createElementVNode","_toDisplayString","_unref","_withDirectives","_vModelText","_createElementBlock","_Fragment","_renderList","_createTextVNode","_createCommentVNode","_createVNode","VueDraggable","SavedBlockPreviewRow","_normalizeClass","_sfc_main","ref","defineComponent","inject","renderList","onMounted","openBlock","withCtx","watch","withDirectives","createElementBlock","createTextVNode","withKeys","toDisplayString","createCommentVNode","createBlock","onBeforeUnmount","withModifiers","normalizeClass","createBaseVNode","vModelText","unref","computed","lo","Fragment","normalizeStyle","createVNode","resolveDynamicComponent","getEmailFrameWidth","getBlockLabel","requireInject","SAVED_BLOCKS_KEY","EDITOR_KEY","CUSTOM_BLOCK_DEFINITIONS_KEY","useI18n","ChevronUp","ChevronDown","LoaderCircle","GripVertical","primaryBtnClass","TplModal_default","BlockPreviewCanvas_default","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","\"background\"","_hoisted_5$1","COLLAPSED_HEIGHT","SavedBlockPreviewRow_default","__emit","props","__props","emit","customBlockDefinitions","editor","previewWidth","frameEl","contentEl","scale","fullHeight","expanded","observer","isClipped","frameHeight","measure","frame","content","width","next","blockLabel","t","handleLabel","format","toggleLabel","_cache","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","SaveBlockDialog_default","savedBlocks","name","category","isSaving","error","announcement","orderedIds","pickedBlocks","byId","b","id","orderedBlocks","blocks","moveBlock","order","from","blockId","to","delta","moved","label","block","summary","visible","canSave","handleSave","err","handleClose","handleKeydown","event","$event","option","index"],"sources":["../../../src/components/SavedBlockPreviewRow.vue","../../../src/components/SavedBlockPreviewRow.vue","../../../src/components/SaveBlockDialog.vue","../../../src/components/SaveBlockDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One reorderable row in the save dialog's preview list: a grip handle beside a\n * scaled-down render of the real block.\n *\n * The preview is the same `BlockPreviewCanvas` the browser modal uses, so\n * a row shows what the block actually looks like rather than a description of\n * it. That canvas is fixed at the 600px email width every block component\n * renders against, so the row shrinks it with `transform: scale()` instead of\n * re-flowing it at dialog width — a re-flow would show a layout the recipient\n * will never see.\n *\n * `transform` doesn't participate in layout, so the frame would keep reserving\n * the full unscaled height; a `ResizeObserver` mirrors the scaled height back\n * onto it. The handle is a sibling of the scaled subtree, so it stays full size\n * and keeps its real hit area.\n *\n * Row chrome uses the raw theme tokens, not the `--tpl-chrome-*` aliases: the\n * chrome is an ancestor and a sibling of the rendered email content, never a\n * descendant, so the `.tpl-block-content` token override can't reach it.\n */\nimport BlockPreviewCanvas from \"./BlockPreviewCanvas.vue\";\nimport { useI18n } from \"../composables\";\nimport { CUSTOM_BLOCK_DEFINITIONS_KEY, EDITOR_KEY } from \"../keys\";\nimport { getEmailFrameWidth } from \"../utils/emailFrameWidth\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { ChevronDown, ChevronUp, GripVertical } from \"@lucide/vue\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, onBeforeUnmount, onMounted, ref } from \"vue\";\n\nconst props = defineProps<{\n block: Block;\n /** 1-based position in the list — spoken by the handle's label. */\n position: number;\n total: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"move\", delta: -1 | 1): void;\n}>();\n\nconst { t, format } = useI18n();\n// Optional: absent when the consumer registers no custom blocks.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst editor = inject(EDITOR_KEY, null);\n\n/**\n * The width the nested `BlockPreviewCanvas` actually renders at.\n *\n * MUST come from the same helper the canvas uses, because the scale factor below\n * divides by it: a mismatch scales every row by the wrong amount, so a template\n * with a custom body width would overflow its frame or under-fill it. Rows are\n * always the desktop width — the save dialog has no viewport control.\n */\nconst previewWidth = computed(() =>\n getEmailFrameWidth(editor?.content.value.settings),\n);\n/**\n * Collapsed height for a tall block. A hero card or a multi-row section would\n * otherwise be taller than the whole list, leaving one row on screen — and\n * seeing the rows together is what makes them orderable. Anything taller\n * collapses to this, fades out at the cut, and can be expanded in place.\n */\nconst COLLAPSED_HEIGHT = 240;\n\nconst frameEl = ref<HTMLElement | null>(null);\nconst contentEl = ref<HTMLElement | null>(null);\nconst scale = ref(1);\n/** Scaled height of the whole block; `null` until first measured. */\nconst fullHeight = ref<number | null>(null);\nconst expanded = ref(false);\n\nlet observer: ResizeObserver | null = null;\n\n/** Only a block taller than the collapsed cap needs fading or expanding. */\nconst isClipped = computed(\n () => fullHeight.value !== null && fullHeight.value > COLLAPSED_HEIGHT,\n);\n\nconst frameHeight = computed(() => {\n if (fullHeight.value === null) return null;\n if (expanded.value || !isClipped.value) return fullHeight.value;\n return COLLAPSED_HEIGHT;\n});\n\nfunction measure(): void {\n const frame = frameEl.value;\n const content = contentEl.value;\n if (!frame || !content) return;\n const width = frame.clientWidth;\n if (width <= 0) return;\n // Never scale up: a dialog wider than the email would blow the preview past\n // its real proportions.\n const next = Math.min(1, width / previewWidth.value);\n scale.value = next;\n fullHeight.value = content.offsetHeight * next;\n}\n\nonMounted(() => {\n measure();\n // Absent in non-DOM test environments. Without it the frame simply falls back\n // to the untransformed height and clips — degraded, never broken.\n if (typeof ResizeObserver === \"undefined\") return;\n observer = new ResizeObserver(() => measure());\n if (frameEl.value) observer.observe(frameEl.value);\n if (contentEl.value) observer.observe(contentEl.value);\n});\n\nonBeforeUnmount(() => {\n observer?.disconnect();\n observer = null;\n});\n\nconst blockLabel = computed(() =>\n getBlockLabel(props.block, t, customBlockDefinitions),\n);\n\nconst handleLabel = computed(() =>\n format(t.savedBlocks.reorderHandle, {\n block: blockLabel.value,\n position: props.position,\n total: props.total,\n }),\n);\n\nconst toggleLabel = computed(() =>\n format(\n expanded.value\n ? t.savedBlocks.collapsePreview\n : t.savedBlocks.expandPreview,\n { block: blockLabel.value },\n ),\n);\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-reorder-row\"\n :data-block-id=\"block.id\"\n class=\"tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]\"\n style=\"background-color: var(--tpl-bg)\"\n >\n <!-- Sortable's `handle` selector points here, so a pointer-drag can only\n start from the grip — never from the preview itself. -->\n <button\n type=\"button\"\n data-testid=\"saved-blocks-reorder-handle\"\n class=\"tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"handleLabel\"\n :title=\"t.savedBlocks.reorderHint\"\n @keydown.up.prevent=\"emit('move', -1)\"\n @keydown.down.prevent=\"emit('move', 1)\"\n >\n <GripVertical :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n\n <div class=\"tpl:relative tpl:min-w-0 tpl:flex-1\">\n <div\n ref=\"frameEl\"\n class=\"tpl:overflow-hidden\"\n :style=\"{\n height: frameHeight !== null ? `${frameHeight}px` : undefined,\n }\"\n >\n <div\n ref=\"contentEl\"\n :style=\"{\n width: `${previewWidth}px`,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }\"\n >\n <BlockPreviewCanvas :blocks=\"[block]\" />\n </div>\n </div>\n\n <!-- Fade over the cut, so a clipped block reads as truncated rather than\n as a block that simply ends there. Pointer-transparent: it sits over\n the preview, and swallowing clicks would break the row. -->\n <div\n v-if=\"isClipped && !expanded\"\n data-testid=\"saved-blocks-preview-fade\"\n aria-hidden=\"true\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10\"\n style=\"\n background: linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n );\n \"\n />\n\n <button\n v-if=\"isClipped\"\n type=\"button\"\n data-testid=\"saved-blocks-preview-toggle\"\n class=\"tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"toggleLabel\"\n :aria-expanded=\"expanded\"\n @click=\"expanded = !expanded\"\n >\n <component\n :is=\"expanded ? ChevronUp : ChevronDown\"\n :size=\"11\"\n :stroke-width=\"2\"\n />\n {{ expanded ? t.savedBlocks.collapse : t.savedBlocks.expand }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * One reorderable row in the save dialog's preview list: a grip handle beside a\n * scaled-down render of the real block.\n *\n * The preview is the same `BlockPreviewCanvas` the browser modal uses, so\n * a row shows what the block actually looks like rather than a description of\n * it. That canvas is fixed at the 600px email width every block component\n * renders against, so the row shrinks it with `transform: scale()` instead of\n * re-flowing it at dialog width — a re-flow would show a layout the recipient\n * will never see.\n *\n * `transform` doesn't participate in layout, so the frame would keep reserving\n * the full unscaled height; a `ResizeObserver` mirrors the scaled height back\n * onto it. The handle is a sibling of the scaled subtree, so it stays full size\n * and keeps its real hit area.\n *\n * Row chrome uses the raw theme tokens, not the `--tpl-chrome-*` aliases: the\n * chrome is an ancestor and a sibling of the rendered email content, never a\n * descendant, so the `.tpl-block-content` token override can't reach it.\n */\nimport BlockPreviewCanvas from \"./BlockPreviewCanvas.vue\";\nimport { useI18n } from \"../composables\";\nimport { CUSTOM_BLOCK_DEFINITIONS_KEY, EDITOR_KEY } from \"../keys\";\nimport { getEmailFrameWidth } from \"../utils/emailFrameWidth\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { ChevronDown, ChevronUp, GripVertical } from \"@lucide/vue\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, onBeforeUnmount, onMounted, ref } from \"vue\";\n\nconst props = defineProps<{\n block: Block;\n /** 1-based position in the list — spoken by the handle's label. */\n position: number;\n total: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"move\", delta: -1 | 1): void;\n}>();\n\nconst { t, format } = useI18n();\n// Optional: absent when the consumer registers no custom blocks.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst editor = inject(EDITOR_KEY, null);\n\n/**\n * The width the nested `BlockPreviewCanvas` actually renders at.\n *\n * MUST come from the same helper the canvas uses, because the scale factor below\n * divides by it: a mismatch scales every row by the wrong amount, so a template\n * with a custom body width would overflow its frame or under-fill it. Rows are\n * always the desktop width — the save dialog has no viewport control.\n */\nconst previewWidth = computed(() =>\n getEmailFrameWidth(editor?.content.value.settings),\n);\n/**\n * Collapsed height for a tall block. A hero card or a multi-row section would\n * otherwise be taller than the whole list, leaving one row on screen — and\n * seeing the rows together is what makes them orderable. Anything taller\n * collapses to this, fades out at the cut, and can be expanded in place.\n */\nconst COLLAPSED_HEIGHT = 240;\n\nconst frameEl = ref<HTMLElement | null>(null);\nconst contentEl = ref<HTMLElement | null>(null);\nconst scale = ref(1);\n/** Scaled height of the whole block; `null` until first measured. */\nconst fullHeight = ref<number | null>(null);\nconst expanded = ref(false);\n\nlet observer: ResizeObserver | null = null;\n\n/** Only a block taller than the collapsed cap needs fading or expanding. */\nconst isClipped = computed(\n () => fullHeight.value !== null && fullHeight.value > COLLAPSED_HEIGHT,\n);\n\nconst frameHeight = computed(() => {\n if (fullHeight.value === null) return null;\n if (expanded.value || !isClipped.value) return fullHeight.value;\n return COLLAPSED_HEIGHT;\n});\n\nfunction measure(): void {\n const frame = frameEl.value;\n const content = contentEl.value;\n if (!frame || !content) return;\n const width = frame.clientWidth;\n if (width <= 0) return;\n // Never scale up: a dialog wider than the email would blow the preview past\n // its real proportions.\n const next = Math.min(1, width / previewWidth.value);\n scale.value = next;\n fullHeight.value = content.offsetHeight * next;\n}\n\nonMounted(() => {\n measure();\n // Absent in non-DOM test environments. Without it the frame simply falls back\n // to the untransformed height and clips — degraded, never broken.\n if (typeof ResizeObserver === \"undefined\") return;\n observer = new ResizeObserver(() => measure());\n if (frameEl.value) observer.observe(frameEl.value);\n if (contentEl.value) observer.observe(contentEl.value);\n});\n\nonBeforeUnmount(() => {\n observer?.disconnect();\n observer = null;\n});\n\nconst blockLabel = computed(() =>\n getBlockLabel(props.block, t, customBlockDefinitions),\n);\n\nconst handleLabel = computed(() =>\n format(t.savedBlocks.reorderHandle, {\n block: blockLabel.value,\n position: props.position,\n total: props.total,\n }),\n);\n\nconst toggleLabel = computed(() =>\n format(\n expanded.value\n ? t.savedBlocks.collapsePreview\n : t.savedBlocks.expandPreview,\n { block: blockLabel.value },\n ),\n);\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-reorder-row\"\n :data-block-id=\"block.id\"\n class=\"tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]\"\n style=\"background-color: var(--tpl-bg)\"\n >\n <!-- Sortable's `handle` selector points here, so a pointer-drag can only\n start from the grip — never from the preview itself. -->\n <button\n type=\"button\"\n data-testid=\"saved-blocks-reorder-handle\"\n class=\"tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"handleLabel\"\n :title=\"t.savedBlocks.reorderHint\"\n @keydown.up.prevent=\"emit('move', -1)\"\n @keydown.down.prevent=\"emit('move', 1)\"\n >\n <GripVertical :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n\n <div class=\"tpl:relative tpl:min-w-0 tpl:flex-1\">\n <div\n ref=\"frameEl\"\n class=\"tpl:overflow-hidden\"\n :style=\"{\n height: frameHeight !== null ? `${frameHeight}px` : undefined,\n }\"\n >\n <div\n ref=\"contentEl\"\n :style=\"{\n width: `${previewWidth}px`,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }\"\n >\n <BlockPreviewCanvas :blocks=\"[block]\" />\n </div>\n </div>\n\n <!-- Fade over the cut, so a clipped block reads as truncated rather than\n as a block that simply ends there. Pointer-transparent: it sits over\n the preview, and swallowing clicks would break the row. -->\n <div\n v-if=\"isClipped && !expanded\"\n data-testid=\"saved-blocks-preview-fade\"\n aria-hidden=\"true\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10\"\n style=\"\n background: linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n );\n \"\n />\n\n <button\n v-if=\"isClipped\"\n type=\"button\"\n data-testid=\"saved-blocks-preview-toggle\"\n class=\"tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"toggleLabel\"\n :aria-expanded=\"expanded\"\n @click=\"expanded = !expanded\"\n >\n <component\n :is=\"expanded ? ChevronUp : ChevronDown\"\n :size=\"11\"\n :stroke-width=\"2\"\n />\n {{ expanded ? t.savedBlocks.collapse : t.savedBlocks.expand }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { primaryBtnClass } from \"../constants/styleConstants\";\nimport SavedBlockPreviewRow from \"./SavedBlockPreviewRow.vue\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport {\n CUSTOM_BLOCK_DEFINITIONS_KEY,\n EDITOR_KEY,\n SAVED_BLOCKS_KEY,\n requireInject,\n} from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { LoaderCircle } from \"@lucide/vue\";\nimport { VueDraggable } from \"vue-draggable-plus\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n /**\n * Blocks chosen during the canvas pick session, in the order they were\n * picked — `pickedIds` is built from a `Set`, which iterates in insertion\n * order. That order seeds the reorderable list below. Every id must be a\n * top-level block, which is what the session guarantees.\n */\n pickedIds: readonly string[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"saved\"): void;\n}>();\n\nconst { t, format } = useI18n();\nconst editor = requireInject(EDITOR_KEY, \"SaveBlockDialog\");\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SaveBlockDialog\");\n// Optional: a consumer with no custom blocks never provides definitions, and\n// the label helper degrades to the type slug rather than throwing.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst name = ref(\"\");\nconst category = ref(\"\");\nconst isSaving = ref(false);\nconst error = ref<string | null>(null);\nconst announcement = ref(\"\");\n\n/**\n * The order the blocks will be saved in: seeded from the pick order, then owned\n * by this dialog once the user drags a row.\n *\n * Ids rather than blocks, deliberately. Resolving late means a block edited\n * while the dialog is open (a collaborator in Cloud) is persisted as it stands\n * at save time, not as it looked when the dialog opened, and an id that stops\n * resolving drops out on its own instead of leaving a stale snapshot behind.\n */\nconst orderedIds = ref<string[]>([]);\n\n/**\n * The picked blocks in the list's current order. Ids that no longer resolve (a\n * block deleted mid-session) simply drop out.\n */\nconst pickedBlocks = computed(() => {\n const byId = new Map(editor.content.value.blocks.map((b) => [b.id, b]));\n return orderedIds.value\n .map((id) => byId.get(id))\n .filter((b): b is Block => b !== undefined);\n});\n\n/**\n * Sortable's model. The setter reads ids straight back off the emitted entries\n * rather than storing them, so a Sortable `el` expando can never reach the\n * payload `create()` sends to the provider — and because the getter is already\n * filtered, writing through it prunes unresolvable ids too.\n */\nconst orderedBlocks = computed<Block[]>({\n get: () => pickedBlocks.value,\n set: (blocks) => {\n orderedIds.value = blocks.map((b) => b.id);\n },\n});\n\n/** Keyboard reorder from a focused grip: swap with the neighbouring row. */\nfunction moveBlock(blockId: string, delta: -1 | 1): void {\n const order = pickedBlocks.value.map((b) => b.id);\n const from = order.indexOf(blockId);\n const to = from + delta;\n if (from === -1 || to < 0 || to >= order.length) return;\n [order[from], order[to]] = [order[to], order[from]];\n orderedIds.value = order;\n\n const moved = pickedBlocks.value[to];\n announcement.value = moved\n ? format(t.savedBlocks.reorderAnnouncement, {\n block: label(moved),\n position: to + 1,\n total: order.length,\n })\n : \"\";\n}\n\n/** Custom blocks read as the consumer's name for them, not the type `custom`. */\nfunction label(block: Block): string {\n return getBlockLabel(block, t, customBlockDefinitions);\n}\n\n/** e.g. \"Title, Paragraph, Button\" — what the user is about to save. */\nconst summary = computed(() => pickedBlocks.value.map(label).join(\", \"));\n\n// `immediate` matters: the dialog is mounted lazily behind a `v-if` on the\n// same state that drives `visible`, so it can mount with `visible` already\n// true and would otherwise never reset the name field or seed the order.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n name.value = \"\";\n category.value = \"\";\n error.value = null;\n announcement.value = \"\";\n orderedIds.value = [...props.pickedIds];\n }\n },\n { immediate: true },\n);\n\nconst canSave = computed(\n () =>\n name.value.trim().length > 0 &&\n pickedBlocks.value.length > 0 &&\n !isSaving.value,\n);\n\nasync function handleSave(): Promise<void> {\n if (!canSave.value) return;\n\n const blocks = pickedBlocks.value;\n // Defence in depth: never persist an empty saved block (it would list as\n // \"0 block(s)\" and insert nothing). Guards a pick set whose ids no longer\n // resolve to anything on the canvas.\n if (blocks.length === 0) return;\n\n isSaving.value = true;\n error.value = null;\n\n try {\n // Empty stays undefined rather than \"\": an entry is either categorised or\n // it isn't, and a blank string would show up as a nameless filter option.\n await savedBlocks.create(\n name.value.trim(),\n blocks,\n category.value.trim() || undefined,\n );\n emit(\"saved\");\n emit(\"close\");\n } catch (err) {\n error.value = (err as Error).message;\n } finally {\n isSaving.value = false;\n }\n}\n\nfunction handleClose(): void {\n if (!isSaving.value) {\n emit(\"close\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n handleSave();\n }\n if (event.key === \"Escape\") {\n handleClose();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-busy=\"isSaving\"\n aria-labelledby=\"tpl-save-block-title\"\n class=\"tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <h3\n id=\"tpl-save-block-title\"\n class=\"tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.saveAsBlock }}\n </h3>\n\n <!-- Saved block name -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.name }}\n </label>\n <input\n v-model=\"name\"\n type=\"text\"\n data-testid=\"saved-blocks-name-input\"\n :placeholder=\"t.savedBlocks.namePlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n </div>\n\n <!-- Category: free text, with the already-used categories offered as\n suggestions. A datalist rather than a <select> because the set is\n derived from existing entries — there is no registry to pick from,\n and the first entry in a category has to be able to name it. -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n for=\"tpl-save-block-category\"\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.category }}\n </label>\n <input\n id=\"tpl-save-block-category\"\n v-model=\"category\"\n type=\"text\"\n data-testid=\"saved-blocks-category-input\"\n list=\"tpl-saved-block-categories\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n <datalist id=\"tpl-saved-block-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n </div>\n\n <!-- Summary of what the pick session chose. Which blocks were picked is\n settled on the canvas — the dialog re-presents them only so the user\n can see and order what they're about to save. -->\n <p\n data-testid=\"saved-blocks-save-summary\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ format(t.savedBlocks.savingCount, { count: pickedBlocks.length }) }}\n <span class=\"tpl:text-[var(--tpl-text-dim)]\">{{ summary }}</span>\n </p>\n\n <!-- Reorderable preview. Seeded in pick order and saved in whatever order\n the list ends up in. Its own Sortable instance with no `group`, so it\n can never exchange items with the canvas or a section column. -->\n <p\n v-if=\"pickedBlocks.length > 1\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.reorderHint }}\n </p>\n <!-- The only growing region: takes whatever the dialog's backdrop cap\n leaves after the fixed chrome, rather than a hand-tuned vh guess that\n a row expanding to full height would blow past. `min-h-0` is what\n lets a flex child actually shrink below its content and scroll. -->\n <VueDraggable\n v-model=\"orderedBlocks\"\n data-testid=\"saved-blocks-reorder-list\"\n :animation=\"150\"\n ghost-class=\"tpl-ghost\"\n drag-class=\"tpl-dragging\"\n handle=\".tpl-saved-block-reorder-handle\"\n :force-fallback=\"true\"\n class=\"tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto\"\n >\n <SavedBlockPreviewRow\n v-for=\"(block, index) in orderedBlocks\"\n :key=\"block.id\"\n :block=\"block\"\n :position=\"index + 1\"\n :total=\"orderedBlocks.length\"\n @move=\"(delta) => moveBlock(block.id, delta)\"\n />\n </VueDraggable>\n\n <!-- Keyboard reorder announcement region (visually hidden, live) -->\n <div\n class=\"tpl-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ announcement }}\n </div>\n\n <!-- Error message -->\n <p\n v-if=\"error\"\n role=\"alert\"\n class=\"tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ error }}\n </p>\n\n <!-- Actions -->\n <div class=\"tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n :disabled=\"isSaving\"\n :class=\"{\n 'tpl:cursor-not-allowed tpl:opacity-50': isSaving,\n }\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n :class=\"primaryBtnClass\"\n :disabled=\"!canSave\"\n @click=\"handleSave\"\n >\n <span v-if=\"isSaving\" class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <LoaderCircle\n class=\"tpl:animate-spin\"\n :size=\"12\"\n :stroke-width=\"2\"\n />\n {{ t.savedBlocks.saving }}\n </span>\n <span v-else>\n {{ t.savedBlocks.save }}\n </span>\n </button>\n </div>\n </div>\n </TplModal>\n</template>\n","<script setup lang=\"ts\">\nimport { primaryBtnClass } from \"../constants/styleConstants\";\nimport SavedBlockPreviewRow from \"./SavedBlockPreviewRow.vue\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport {\n CUSTOM_BLOCK_DEFINITIONS_KEY,\n EDITOR_KEY,\n SAVED_BLOCKS_KEY,\n requireInject,\n} from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { LoaderCircle } from \"@lucide/vue\";\nimport { VueDraggable } from \"vue-draggable-plus\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n /**\n * Blocks chosen during the canvas pick session, in the order they were\n * picked — `pickedIds` is built from a `Set`, which iterates in insertion\n * order. That order seeds the reorderable list below. Every id must be a\n * top-level block, which is what the session guarantees.\n */\n pickedIds: readonly string[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"saved\"): void;\n}>();\n\nconst { t, format } = useI18n();\nconst editor = requireInject(EDITOR_KEY, \"SaveBlockDialog\");\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SaveBlockDialog\");\n// Optional: a consumer with no custom blocks never provides definitions, and\n// the label helper degrades to the type slug rather than throwing.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst name = ref(\"\");\nconst category = ref(\"\");\nconst isSaving = ref(false);\nconst error = ref<string | null>(null);\nconst announcement = ref(\"\");\n\n/**\n * The order the blocks will be saved in: seeded from the pick order, then owned\n * by this dialog once the user drags a row.\n *\n * Ids rather than blocks, deliberately. Resolving late means a block edited\n * while the dialog is open (a collaborator in Cloud) is persisted as it stands\n * at save time, not as it looked when the dialog opened, and an id that stops\n * resolving drops out on its own instead of leaving a stale snapshot behind.\n */\nconst orderedIds = ref<string[]>([]);\n\n/**\n * The picked blocks in the list's current order. Ids that no longer resolve (a\n * block deleted mid-session) simply drop out.\n */\nconst pickedBlocks = computed(() => {\n const byId = new Map(editor.content.value.blocks.map((b) => [b.id, b]));\n return orderedIds.value\n .map((id) => byId.get(id))\n .filter((b): b is Block => b !== undefined);\n});\n\n/**\n * Sortable's model. The setter reads ids straight back off the emitted entries\n * rather than storing them, so a Sortable `el` expando can never reach the\n * payload `create()` sends to the provider — and because the getter is already\n * filtered, writing through it prunes unresolvable ids too.\n */\nconst orderedBlocks = computed<Block[]>({\n get: () => pickedBlocks.value,\n set: (blocks) => {\n orderedIds.value = blocks.map((b) => b.id);\n },\n});\n\n/** Keyboard reorder from a focused grip: swap with the neighbouring row. */\nfunction moveBlock(blockId: string, delta: -1 | 1): void {\n const order = pickedBlocks.value.map((b) => b.id);\n const from = order.indexOf(blockId);\n const to = from + delta;\n if (from === -1 || to < 0 || to >= order.length) return;\n [order[from], order[to]] = [order[to], order[from]];\n orderedIds.value = order;\n\n const moved = pickedBlocks.value[to];\n announcement.value = moved\n ? format(t.savedBlocks.reorderAnnouncement, {\n block: label(moved),\n position: to + 1,\n total: order.length,\n })\n : \"\";\n}\n\n/** Custom blocks read as the consumer's name for them, not the type `custom`. */\nfunction label(block: Block): string {\n return getBlockLabel(block, t, customBlockDefinitions);\n}\n\n/** e.g. \"Title, Paragraph, Button\" — what the user is about to save. */\nconst summary = computed(() => pickedBlocks.value.map(label).join(\", \"));\n\n// `immediate` matters: the dialog is mounted lazily behind a `v-if` on the\n// same state that drives `visible`, so it can mount with `visible` already\n// true and would otherwise never reset the name field or seed the order.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n name.value = \"\";\n category.value = \"\";\n error.value = null;\n announcement.value = \"\";\n orderedIds.value = [...props.pickedIds];\n }\n },\n { immediate: true },\n);\n\nconst canSave = computed(\n () =>\n name.value.trim().length > 0 &&\n pickedBlocks.value.length > 0 &&\n !isSaving.value,\n);\n\nasync function handleSave(): Promise<void> {\n if (!canSave.value) return;\n\n const blocks = pickedBlocks.value;\n // Defence in depth: never persist an empty saved block (it would list as\n // \"0 block(s)\" and insert nothing). Guards a pick set whose ids no longer\n // resolve to anything on the canvas.\n if (blocks.length === 0) return;\n\n isSaving.value = true;\n error.value = null;\n\n try {\n // Empty stays undefined rather than \"\": an entry is either categorised or\n // it isn't, and a blank string would show up as a nameless filter option.\n await savedBlocks.create(\n name.value.trim(),\n blocks,\n category.value.trim() || undefined,\n );\n emit(\"saved\");\n emit(\"close\");\n } catch (err) {\n error.value = (err as Error).message;\n } finally {\n isSaving.value = false;\n }\n}\n\nfunction handleClose(): void {\n if (!isSaving.value) {\n emit(\"close\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n handleSave();\n }\n if (event.key === \"Escape\") {\n handleClose();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-busy=\"isSaving\"\n aria-labelledby=\"tpl-save-block-title\"\n class=\"tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <h3\n id=\"tpl-save-block-title\"\n class=\"tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.saveAsBlock }}\n </h3>\n\n <!-- Saved block name -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.name }}\n </label>\n <input\n v-model=\"name\"\n type=\"text\"\n data-testid=\"saved-blocks-name-input\"\n :placeholder=\"t.savedBlocks.namePlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n </div>\n\n <!-- Category: free text, with the already-used categories offered as\n suggestions. A datalist rather than a <select> because the set is\n derived from existing entries — there is no registry to pick from,\n and the first entry in a category has to be able to name it. -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n for=\"tpl-save-block-category\"\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.category }}\n </label>\n <input\n id=\"tpl-save-block-category\"\n v-model=\"category\"\n type=\"text\"\n data-testid=\"saved-blocks-category-input\"\n list=\"tpl-saved-block-categories\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n <datalist id=\"tpl-saved-block-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n </div>\n\n <!-- Summary of what the pick session chose. Which blocks were picked is\n settled on the canvas — the dialog re-presents them only so the user\n can see and order what they're about to save. -->\n <p\n data-testid=\"saved-blocks-save-summary\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ format(t.savedBlocks.savingCount, { count: pickedBlocks.length }) }}\n <span class=\"tpl:text-[var(--tpl-text-dim)]\">{{ summary }}</span>\n </p>\n\n <!-- Reorderable preview. Seeded in pick order and saved in whatever order\n the list ends up in. Its own Sortable instance with no `group`, so it\n can never exchange items with the canvas or a section column. -->\n <p\n v-if=\"pickedBlocks.length > 1\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.reorderHint }}\n </p>\n <!-- The only growing region: takes whatever the dialog's backdrop cap\n leaves after the fixed chrome, rather than a hand-tuned vh guess that\n a row expanding to full height would blow past. `min-h-0` is what\n lets a flex child actually shrink below its content and scroll. -->\n <VueDraggable\n v-model=\"orderedBlocks\"\n data-testid=\"saved-blocks-reorder-list\"\n :animation=\"150\"\n ghost-class=\"tpl-ghost\"\n drag-class=\"tpl-dragging\"\n handle=\".tpl-saved-block-reorder-handle\"\n :force-fallback=\"true\"\n class=\"tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto\"\n >\n <SavedBlockPreviewRow\n v-for=\"(block, index) in orderedBlocks\"\n :key=\"block.id\"\n :block=\"block\"\n :position=\"index + 1\"\n :total=\"orderedBlocks.length\"\n @move=\"(delta) => moveBlock(block.id, delta)\"\n />\n </VueDraggable>\n\n <!-- Keyboard reorder announcement region (visually hidden, live) -->\n <div\n class=\"tpl-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ announcement }}\n </div>\n\n <!-- Error message -->\n <p\n v-if=\"error\"\n role=\"alert\"\n class=\"tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ error }}\n </p>\n\n <!-- Actions -->\n <div class=\"tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n :disabled=\"isSaving\"\n :class=\"{\n 'tpl:cursor-not-allowed tpl:opacity-50': isSaving,\n }\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n :class=\"primaryBtnClass\"\n :disabled=\"!canSave\"\n @click=\"handleSave\"\n >\n <span v-if=\"isSaving\" class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <LoaderCircle\n class=\"tpl:animate-spin\"\n :size=\"12\"\n :stroke-width=\"2\"\n />\n {{ t.savedBlocks.saving }}\n </span>\n <span v-else>\n {{ t.savedBlocks.save }}\n </span>\n </button>\n </div>\n </div>\n </TplModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;A,wCAgEMsF,IAAmB,K;;;;;;;;;EAlCzB,IAAM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A,SADRvH,EAAA,GAAAS,EAMI,KANJmG,IAMIvG,EADCkH,EAAA,KAAK,GAAA,CAAA,K;IAIVnH,EA8BM,OA9BNyG,IA8BM,CA7BJzG,EAUS,UAAA;KATP,MAAK;KACL,OAAKa,EAAA,CAAC,sOAAoO,EAE3K,yCAAAqG,EAAA,M;KAD9D,UAAUA,EAAA;KAIV,SAAOwB;IAEL,GAAAzI,EAAAC,EAAAmF,CAAA,CAAC,CAAC,YAAY,MAAM,GAAA,IAAAqB,EAAA,GAEzB1G,EAiBS,UAAA;KAhBP,MAAK;KACJ,OAAKa,EAAEX,EAAAmD,CAAA,CAAe;KACtB,UAAQ,CAAGkF,GAAA;KACX,SAAOC;I,IAEItB,EAAA,SAAZtH,EAAA,GAAAS,EAOO,QAPPuG,IAOO,CANLlG,EAIER,EAAAiD,CAAA,GAAA;KAHA,OAAM;KACL,MAAM;KACN,gBAAc;I,IACf3C,EAAA,MACFP,EAAGC,EAAAmF,CAAA,CAAC,CAAC,YAAY,MAAM,GAAA,CAAA,C,OAEzBzF,EAAA,GAAAS,EAEO,QAAAwG,IAAA5G,EADFC,EAAAmF,CAAA,CAAC,CAAC,YAAY,IAAI,GAAA,CAAA,E"}
1
+ {"version":3,"file":"SaveBlockDialog-CUhpawq0.js","names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_openBlock","_createElementBlock","_createElementVNode","_unref","_withKeys","_withModifiers","_createVNode","_normalizeStyle","BlockPreviewCanvas","_createCommentVNode","_createBlock","_resolveDynamicComponent","_createTextVNode","_toDisplayString","_sfc_main","_openBlock","_createBlock","TplModal","_withCtx","_createElementVNode","_toDisplayString","_unref","_withDirectives","_vModelText","_createElementBlock","_Fragment","_renderList","_createTextVNode","_createCommentVNode","_createVNode","VueDraggable","SavedBlockPreviewRow","_normalizeClass","_sfc_main","defineComponent","inject","withDirectives","renderList","onMounted","openBlock","watch","withCtx","createElementBlock","createTextVNode","withKeys","normalizeStyle","ref","toDisplayString","createCommentVNode","onBeforeUnmount","withModifiers","createBaseVNode","vModelText","computed","unref","lo","Fragment","normalizeClass","createVNode","resolveDynamicComponent","getEmailFrameWidth","getBlockLabel","requireInject","SAVED_BLOCKS_KEY","EDITOR_KEY","CUSTOM_BLOCK_DEFINITIONS_KEY","useI18n","ChevronUp","LoaderCircle","GripVertical","ChevronDown","primaryBtnClass","TplModal_default","BlockPreviewCanvas_default","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","\"background\"","_hoisted_5$1","COLLAPSED_HEIGHT","SavedBlockPreviewRow_default","__emit","props","__props","emit","customBlockDefinitions","editor","previewWidth","frameEl","contentEl","scale","fullHeight","expanded","observer","isClipped","frameHeight","measure","frame","content","width","next","blockLabel","t","handleLabel","format","toggleLabel","_cache","createBlock","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","SaveBlockDialog_default","savedBlocks","name","category","isSaving","error","announcement","orderedIds","pickedBlocks","byId","b","id","orderedBlocks","blocks","moveBlock","order","from","blockId","to","delta","moved","label","block","summary","visible","canSave","handleSave","err","handleClose","handleKeydown","event","$event","option","index"],"sources":["../../../src/components/SavedBlockPreviewRow.vue","../../../src/components/SavedBlockPreviewRow.vue","../../../src/components/SaveBlockDialog.vue","../../../src/components/SaveBlockDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One reorderable row in the save dialog's preview list: a grip handle beside a\n * scaled-down render of the real block.\n *\n * The preview is the same `BlockPreviewCanvas` the browser modal uses, so\n * a row shows what the block actually looks like rather than a description of\n * it. That canvas is fixed at the 600px email width every block component\n * renders against, so the row shrinks it with `transform: scale()` instead of\n * re-flowing it at dialog width — a re-flow would show a layout the recipient\n * will never see.\n *\n * `transform` doesn't participate in layout, so the frame would keep reserving\n * the full unscaled height; a `ResizeObserver` mirrors the scaled height back\n * onto it. The handle is a sibling of the scaled subtree, so it stays full size\n * and keeps its real hit area.\n *\n * Row chrome uses the raw theme tokens, not the `--tpl-chrome-*` aliases: the\n * chrome is an ancestor and a sibling of the rendered email content, never a\n * descendant, so the `.tpl-block-content` token override can't reach it.\n */\nimport BlockPreviewCanvas from \"./BlockPreviewCanvas.vue\";\nimport { useI18n } from \"../composables\";\nimport { CUSTOM_BLOCK_DEFINITIONS_KEY, EDITOR_KEY } from \"../keys\";\nimport { getEmailFrameWidth } from \"../utils/emailFrameWidth\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { ChevronDown, ChevronUp, GripVertical } from \"@lucide/vue\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, onBeforeUnmount, onMounted, ref } from \"vue\";\n\nconst props = defineProps<{\n block: Block;\n /** 1-based position in the list — spoken by the handle's label. */\n position: number;\n total: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"move\", delta: -1 | 1): void;\n}>();\n\nconst { t, format } = useI18n();\n// Optional: absent when the consumer registers no custom blocks.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst editor = inject(EDITOR_KEY, null);\n\n/**\n * The width the nested `BlockPreviewCanvas` actually renders at.\n *\n * MUST come from the same helper the canvas uses, because the scale factor below\n * divides by it: a mismatch scales every row by the wrong amount, so a template\n * with a custom body width would overflow its frame or under-fill it. Rows are\n * always the desktop width — the save dialog has no viewport control.\n */\nconst previewWidth = computed(() =>\n getEmailFrameWidth(editor?.content.value.settings),\n);\n/**\n * Collapsed height for a tall block. A hero card or a multi-row section would\n * otherwise be taller than the whole list, leaving one row on screen — and\n * seeing the rows together is what makes them orderable. Anything taller\n * collapses to this, fades out at the cut, and can be expanded in place.\n */\nconst COLLAPSED_HEIGHT = 240;\n\nconst frameEl = ref<HTMLElement | null>(null);\nconst contentEl = ref<HTMLElement | null>(null);\nconst scale = ref(1);\n/** Scaled height of the whole block; `null` until first measured. */\nconst fullHeight = ref<number | null>(null);\nconst expanded = ref(false);\n\nlet observer: ResizeObserver | null = null;\n\n/** Only a block taller than the collapsed cap needs fading or expanding. */\nconst isClipped = computed(\n () => fullHeight.value !== null && fullHeight.value > COLLAPSED_HEIGHT,\n);\n\nconst frameHeight = computed(() => {\n if (fullHeight.value === null) return null;\n if (expanded.value || !isClipped.value) return fullHeight.value;\n return COLLAPSED_HEIGHT;\n});\n\nfunction measure(): void {\n const frame = frameEl.value;\n const content = contentEl.value;\n if (!frame || !content) return;\n const width = frame.clientWidth;\n if (width <= 0) return;\n // Never scale up: a dialog wider than the email would blow the preview past\n // its real proportions.\n const next = Math.min(1, width / previewWidth.value);\n scale.value = next;\n fullHeight.value = content.offsetHeight * next;\n}\n\nonMounted(() => {\n measure();\n // Absent in non-DOM test environments. Without it the frame simply falls back\n // to the untransformed height and clips — degraded, never broken.\n if (typeof ResizeObserver === \"undefined\") return;\n observer = new ResizeObserver(() => measure());\n if (frameEl.value) observer.observe(frameEl.value);\n if (contentEl.value) observer.observe(contentEl.value);\n});\n\nonBeforeUnmount(() => {\n observer?.disconnect();\n observer = null;\n});\n\nconst blockLabel = computed(() =>\n getBlockLabel(props.block, t, customBlockDefinitions),\n);\n\nconst handleLabel = computed(() =>\n format(t.savedBlocks.reorderHandle, {\n block: blockLabel.value,\n position: props.position,\n total: props.total,\n }),\n);\n\nconst toggleLabel = computed(() =>\n format(\n expanded.value\n ? t.savedBlocks.collapsePreview\n : t.savedBlocks.expandPreview,\n { block: blockLabel.value },\n ),\n);\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-reorder-row\"\n :data-block-id=\"block.id\"\n class=\"tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]\"\n style=\"background-color: var(--tpl-bg)\"\n >\n <!-- Sortable's `handle` selector points here, so a pointer-drag can only\n start from the grip — never from the preview itself. -->\n <button\n type=\"button\"\n data-testid=\"saved-blocks-reorder-handle\"\n class=\"tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"handleLabel\"\n :title=\"t.savedBlocks.reorderHint\"\n @keydown.up.prevent=\"emit('move', -1)\"\n @keydown.down.prevent=\"emit('move', 1)\"\n >\n <GripVertical :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n\n <div class=\"tpl:relative tpl:min-w-0 tpl:flex-1\">\n <div\n ref=\"frameEl\"\n class=\"tpl:overflow-hidden\"\n :style=\"{\n height: frameHeight !== null ? `${frameHeight}px` : undefined,\n }\"\n >\n <div\n ref=\"contentEl\"\n :style=\"{\n width: `${previewWidth}px`,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }\"\n >\n <BlockPreviewCanvas :blocks=\"[block]\" />\n </div>\n </div>\n\n <!-- Fade over the cut, so a clipped block reads as truncated rather than\n as a block that simply ends there. Pointer-transparent: it sits over\n the preview, and swallowing clicks would break the row. -->\n <div\n v-if=\"isClipped && !expanded\"\n data-testid=\"saved-blocks-preview-fade\"\n aria-hidden=\"true\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10\"\n style=\"\n background: linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n );\n \"\n />\n\n <button\n v-if=\"isClipped\"\n type=\"button\"\n data-testid=\"saved-blocks-preview-toggle\"\n class=\"tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"toggleLabel\"\n :aria-expanded=\"expanded\"\n @click=\"expanded = !expanded\"\n >\n <component\n :is=\"expanded ? ChevronUp : ChevronDown\"\n :size=\"11\"\n :stroke-width=\"2\"\n />\n {{ expanded ? t.savedBlocks.collapse : t.savedBlocks.expand }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * One reorderable row in the save dialog's preview list: a grip handle beside a\n * scaled-down render of the real block.\n *\n * The preview is the same `BlockPreviewCanvas` the browser modal uses, so\n * a row shows what the block actually looks like rather than a description of\n * it. That canvas is fixed at the 600px email width every block component\n * renders against, so the row shrinks it with `transform: scale()` instead of\n * re-flowing it at dialog width — a re-flow would show a layout the recipient\n * will never see.\n *\n * `transform` doesn't participate in layout, so the frame would keep reserving\n * the full unscaled height; a `ResizeObserver` mirrors the scaled height back\n * onto it. The handle is a sibling of the scaled subtree, so it stays full size\n * and keeps its real hit area.\n *\n * Row chrome uses the raw theme tokens, not the `--tpl-chrome-*` aliases: the\n * chrome is an ancestor and a sibling of the rendered email content, never a\n * descendant, so the `.tpl-block-content` token override can't reach it.\n */\nimport BlockPreviewCanvas from \"./BlockPreviewCanvas.vue\";\nimport { useI18n } from \"../composables\";\nimport { CUSTOM_BLOCK_DEFINITIONS_KEY, EDITOR_KEY } from \"../keys\";\nimport { getEmailFrameWidth } from \"../utils/emailFrameWidth\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { ChevronDown, ChevronUp, GripVertical } from \"@lucide/vue\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, onBeforeUnmount, onMounted, ref } from \"vue\";\n\nconst props = defineProps<{\n block: Block;\n /** 1-based position in the list — spoken by the handle's label. */\n position: number;\n total: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"move\", delta: -1 | 1): void;\n}>();\n\nconst { t, format } = useI18n();\n// Optional: absent when the consumer registers no custom blocks.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst editor = inject(EDITOR_KEY, null);\n\n/**\n * The width the nested `BlockPreviewCanvas` actually renders at.\n *\n * MUST come from the same helper the canvas uses, because the scale factor below\n * divides by it: a mismatch scales every row by the wrong amount, so a template\n * with a custom body width would overflow its frame or under-fill it. Rows are\n * always the desktop width — the save dialog has no viewport control.\n */\nconst previewWidth = computed(() =>\n getEmailFrameWidth(editor?.content.value.settings),\n);\n/**\n * Collapsed height for a tall block. A hero card or a multi-row section would\n * otherwise be taller than the whole list, leaving one row on screen — and\n * seeing the rows together is what makes them orderable. Anything taller\n * collapses to this, fades out at the cut, and can be expanded in place.\n */\nconst COLLAPSED_HEIGHT = 240;\n\nconst frameEl = ref<HTMLElement | null>(null);\nconst contentEl = ref<HTMLElement | null>(null);\nconst scale = ref(1);\n/** Scaled height of the whole block; `null` until first measured. */\nconst fullHeight = ref<number | null>(null);\nconst expanded = ref(false);\n\nlet observer: ResizeObserver | null = null;\n\n/** Only a block taller than the collapsed cap needs fading or expanding. */\nconst isClipped = computed(\n () => fullHeight.value !== null && fullHeight.value > COLLAPSED_HEIGHT,\n);\n\nconst frameHeight = computed(() => {\n if (fullHeight.value === null) return null;\n if (expanded.value || !isClipped.value) return fullHeight.value;\n return COLLAPSED_HEIGHT;\n});\n\nfunction measure(): void {\n const frame = frameEl.value;\n const content = contentEl.value;\n if (!frame || !content) return;\n const width = frame.clientWidth;\n if (width <= 0) return;\n // Never scale up: a dialog wider than the email would blow the preview past\n // its real proportions.\n const next = Math.min(1, width / previewWidth.value);\n scale.value = next;\n fullHeight.value = content.offsetHeight * next;\n}\n\nonMounted(() => {\n measure();\n // Absent in non-DOM test environments. Without it the frame simply falls back\n // to the untransformed height and clips — degraded, never broken.\n if (typeof ResizeObserver === \"undefined\") return;\n observer = new ResizeObserver(() => measure());\n if (frameEl.value) observer.observe(frameEl.value);\n if (contentEl.value) observer.observe(contentEl.value);\n});\n\nonBeforeUnmount(() => {\n observer?.disconnect();\n observer = null;\n});\n\nconst blockLabel = computed(() =>\n getBlockLabel(props.block, t, customBlockDefinitions),\n);\n\nconst handleLabel = computed(() =>\n format(t.savedBlocks.reorderHandle, {\n block: blockLabel.value,\n position: props.position,\n total: props.total,\n }),\n);\n\nconst toggleLabel = computed(() =>\n format(\n expanded.value\n ? t.savedBlocks.collapsePreview\n : t.savedBlocks.expandPreview,\n { block: blockLabel.value },\n ),\n);\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-reorder-row\"\n :data-block-id=\"block.id\"\n class=\"tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]\"\n style=\"background-color: var(--tpl-bg)\"\n >\n <!-- Sortable's `handle` selector points here, so a pointer-drag can only\n start from the grip — never from the preview itself. -->\n <button\n type=\"button\"\n data-testid=\"saved-blocks-reorder-handle\"\n class=\"tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"handleLabel\"\n :title=\"t.savedBlocks.reorderHint\"\n @keydown.up.prevent=\"emit('move', -1)\"\n @keydown.down.prevent=\"emit('move', 1)\"\n >\n <GripVertical :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n\n <div class=\"tpl:relative tpl:min-w-0 tpl:flex-1\">\n <div\n ref=\"frameEl\"\n class=\"tpl:overflow-hidden\"\n :style=\"{\n height: frameHeight !== null ? `${frameHeight}px` : undefined,\n }\"\n >\n <div\n ref=\"contentEl\"\n :style=\"{\n width: `${previewWidth}px`,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }\"\n >\n <BlockPreviewCanvas :blocks=\"[block]\" />\n </div>\n </div>\n\n <!-- Fade over the cut, so a clipped block reads as truncated rather than\n as a block that simply ends there. Pointer-transparent: it sits over\n the preview, and swallowing clicks would break the row. -->\n <div\n v-if=\"isClipped && !expanded\"\n data-testid=\"saved-blocks-preview-fade\"\n aria-hidden=\"true\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10\"\n style=\"\n background: linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n );\n \"\n />\n\n <button\n v-if=\"isClipped\"\n type=\"button\"\n data-testid=\"saved-blocks-preview-toggle\"\n class=\"tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"toggleLabel\"\n :aria-expanded=\"expanded\"\n @click=\"expanded = !expanded\"\n >\n <component\n :is=\"expanded ? ChevronUp : ChevronDown\"\n :size=\"11\"\n :stroke-width=\"2\"\n />\n {{ expanded ? t.savedBlocks.collapse : t.savedBlocks.expand }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { primaryBtnClass } from \"../constants/styleConstants\";\nimport SavedBlockPreviewRow from \"./SavedBlockPreviewRow.vue\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport {\n CUSTOM_BLOCK_DEFINITIONS_KEY,\n EDITOR_KEY,\n SAVED_BLOCKS_KEY,\n requireInject,\n} from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { LoaderCircle } from \"@lucide/vue\";\nimport { VueDraggable } from \"vue-draggable-plus\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n /**\n * Blocks chosen during the canvas pick session, in the order they were\n * picked — `pickedIds` is built from a `Set`, which iterates in insertion\n * order. That order seeds the reorderable list below. Every id must be a\n * top-level block, which is what the session guarantees.\n */\n pickedIds: readonly string[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"saved\"): void;\n}>();\n\nconst { t, format } = useI18n();\nconst editor = requireInject(EDITOR_KEY, \"SaveBlockDialog\");\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SaveBlockDialog\");\n// Optional: a consumer with no custom blocks never provides definitions, and\n// the label helper degrades to the type slug rather than throwing.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst name = ref(\"\");\nconst category = ref(\"\");\nconst isSaving = ref(false);\nconst error = ref<string | null>(null);\nconst announcement = ref(\"\");\n\n/**\n * The order the blocks will be saved in: seeded from the pick order, then owned\n * by this dialog once the user drags a row.\n *\n * Ids rather than blocks, deliberately. Resolving late means a block edited\n * while the dialog is open (a collaborator in Cloud) is persisted as it stands\n * at save time, not as it looked when the dialog opened, and an id that stops\n * resolving drops out on its own instead of leaving a stale snapshot behind.\n */\nconst orderedIds = ref<string[]>([]);\n\n/**\n * The picked blocks in the list's current order. Ids that no longer resolve (a\n * block deleted mid-session) simply drop out.\n */\nconst pickedBlocks = computed(() => {\n const byId = new Map(editor.content.value.blocks.map((b) => [b.id, b]));\n return orderedIds.value\n .map((id) => byId.get(id))\n .filter((b): b is Block => b !== undefined);\n});\n\n/**\n * Sortable's model. The setter reads ids straight back off the emitted entries\n * rather than storing them, so a Sortable `el` expando can never reach the\n * payload `create()` sends to the provider — and because the getter is already\n * filtered, writing through it prunes unresolvable ids too.\n */\nconst orderedBlocks = computed<Block[]>({\n get: () => pickedBlocks.value,\n set: (blocks) => {\n orderedIds.value = blocks.map((b) => b.id);\n },\n});\n\n/** Keyboard reorder from a focused grip: swap with the neighbouring row. */\nfunction moveBlock(blockId: string, delta: -1 | 1): void {\n const order = pickedBlocks.value.map((b) => b.id);\n const from = order.indexOf(blockId);\n const to = from + delta;\n if (from === -1 || to < 0 || to >= order.length) return;\n [order[from], order[to]] = [order[to], order[from]];\n orderedIds.value = order;\n\n const moved = pickedBlocks.value[to];\n announcement.value = moved\n ? format(t.savedBlocks.reorderAnnouncement, {\n block: label(moved),\n position: to + 1,\n total: order.length,\n })\n : \"\";\n}\n\n/** Custom blocks read as the consumer's name for them, not the type `custom`. */\nfunction label(block: Block): string {\n return getBlockLabel(block, t, customBlockDefinitions);\n}\n\n/** e.g. \"Title, Paragraph, Button\" — what the user is about to save. */\nconst summary = computed(() => pickedBlocks.value.map(label).join(\", \"));\n\n// `immediate` matters: the dialog is mounted lazily behind a `v-if` on the\n// same state that drives `visible`, so it can mount with `visible` already\n// true and would otherwise never reset the name field or seed the order.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n name.value = \"\";\n category.value = \"\";\n error.value = null;\n announcement.value = \"\";\n orderedIds.value = [...props.pickedIds];\n }\n },\n { immediate: true },\n);\n\nconst canSave = computed(\n () =>\n name.value.trim().length > 0 &&\n pickedBlocks.value.length > 0 &&\n !isSaving.value,\n);\n\nasync function handleSave(): Promise<void> {\n if (!canSave.value) return;\n\n const blocks = pickedBlocks.value;\n // Defence in depth: never persist an empty saved block (it would list as\n // \"0 block(s)\" and insert nothing). Guards a pick set whose ids no longer\n // resolve to anything on the canvas.\n if (blocks.length === 0) return;\n\n isSaving.value = true;\n error.value = null;\n\n try {\n // Empty stays undefined rather than \"\": an entry is either categorised or\n // it isn't, and a blank string would show up as a nameless filter option.\n await savedBlocks.create(\n name.value.trim(),\n blocks,\n category.value.trim() || undefined,\n );\n emit(\"saved\");\n emit(\"close\");\n } catch (err) {\n error.value = (err as Error).message;\n } finally {\n isSaving.value = false;\n }\n}\n\nfunction handleClose(): void {\n if (!isSaving.value) {\n emit(\"close\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n handleSave();\n }\n if (event.key === \"Escape\") {\n handleClose();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-busy=\"isSaving\"\n aria-labelledby=\"tpl-save-block-title\"\n class=\"tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <h3\n id=\"tpl-save-block-title\"\n class=\"tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.saveAsBlock }}\n </h3>\n\n <!-- Saved block name -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.name }}\n </label>\n <input\n v-model=\"name\"\n type=\"text\"\n data-testid=\"saved-blocks-name-input\"\n :placeholder=\"t.savedBlocks.namePlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n </div>\n\n <!-- Category: free text, with the already-used categories offered as\n suggestions. A datalist rather than a <select> because the set is\n derived from existing entries — there is no registry to pick from,\n and the first entry in a category has to be able to name it. -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n for=\"tpl-save-block-category\"\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.category }}\n </label>\n <input\n id=\"tpl-save-block-category\"\n v-model=\"category\"\n type=\"text\"\n data-testid=\"saved-blocks-category-input\"\n list=\"tpl-saved-block-categories\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n <datalist id=\"tpl-saved-block-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n </div>\n\n <!-- Summary of what the pick session chose. Which blocks were picked is\n settled on the canvas — the dialog re-presents them only so the user\n can see and order what they're about to save. -->\n <p\n data-testid=\"saved-blocks-save-summary\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ format(t.savedBlocks.savingCount, { count: pickedBlocks.length }) }}\n <span class=\"tpl:text-[var(--tpl-text-dim)]\">{{ summary }}</span>\n </p>\n\n <!-- Reorderable preview. Seeded in pick order and saved in whatever order\n the list ends up in. Its own Sortable instance with no `group`, so it\n can never exchange items with the canvas or a section column. -->\n <p\n v-if=\"pickedBlocks.length > 1\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.reorderHint }}\n </p>\n <!-- The only growing region: takes whatever the dialog's backdrop cap\n leaves after the fixed chrome, rather than a hand-tuned vh guess that\n a row expanding to full height would blow past. `min-h-0` is what\n lets a flex child actually shrink below its content and scroll. -->\n <VueDraggable\n v-model=\"orderedBlocks\"\n data-testid=\"saved-blocks-reorder-list\"\n :animation=\"150\"\n ghost-class=\"tpl-ghost\"\n drag-class=\"tpl-dragging\"\n handle=\".tpl-saved-block-reorder-handle\"\n :force-fallback=\"true\"\n class=\"tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto\"\n >\n <SavedBlockPreviewRow\n v-for=\"(block, index) in orderedBlocks\"\n :key=\"block.id\"\n :block=\"block\"\n :position=\"index + 1\"\n :total=\"orderedBlocks.length\"\n @move=\"(delta) => moveBlock(block.id, delta)\"\n />\n </VueDraggable>\n\n <!-- Keyboard reorder announcement region (visually hidden, live) -->\n <div\n class=\"tpl-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ announcement }}\n </div>\n\n <!-- Error message -->\n <p\n v-if=\"error\"\n role=\"alert\"\n class=\"tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ error }}\n </p>\n\n <!-- Actions -->\n <div class=\"tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n :disabled=\"isSaving\"\n :class=\"{\n 'tpl:cursor-not-allowed tpl:opacity-50': isSaving,\n }\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n :class=\"primaryBtnClass\"\n :disabled=\"!canSave\"\n @click=\"handleSave\"\n >\n <span v-if=\"isSaving\" class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <LoaderCircle\n class=\"tpl:animate-spin\"\n :size=\"12\"\n :stroke-width=\"2\"\n />\n {{ t.savedBlocks.saving }}\n </span>\n <span v-else>\n {{ t.savedBlocks.save }}\n </span>\n </button>\n </div>\n </div>\n </TplModal>\n</template>\n","<script setup lang=\"ts\">\nimport { primaryBtnClass } from \"../constants/styleConstants\";\nimport SavedBlockPreviewRow from \"./SavedBlockPreviewRow.vue\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport {\n CUSTOM_BLOCK_DEFINITIONS_KEY,\n EDITOR_KEY,\n SAVED_BLOCKS_KEY,\n requireInject,\n} from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { LoaderCircle } from \"@lucide/vue\";\nimport { VueDraggable } from \"vue-draggable-plus\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n /**\n * Blocks chosen during the canvas pick session, in the order they were\n * picked — `pickedIds` is built from a `Set`, which iterates in insertion\n * order. That order seeds the reorderable list below. Every id must be a\n * top-level block, which is what the session guarantees.\n */\n pickedIds: readonly string[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"saved\"): void;\n}>();\n\nconst { t, format } = useI18n();\nconst editor = requireInject(EDITOR_KEY, \"SaveBlockDialog\");\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SaveBlockDialog\");\n// Optional: a consumer with no custom blocks never provides definitions, and\n// the label helper degrades to the type slug rather than throwing.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst name = ref(\"\");\nconst category = ref(\"\");\nconst isSaving = ref(false);\nconst error = ref<string | null>(null);\nconst announcement = ref(\"\");\n\n/**\n * The order the blocks will be saved in: seeded from the pick order, then owned\n * by this dialog once the user drags a row.\n *\n * Ids rather than blocks, deliberately. Resolving late means a block edited\n * while the dialog is open (a collaborator in Cloud) is persisted as it stands\n * at save time, not as it looked when the dialog opened, and an id that stops\n * resolving drops out on its own instead of leaving a stale snapshot behind.\n */\nconst orderedIds = ref<string[]>([]);\n\n/**\n * The picked blocks in the list's current order. Ids that no longer resolve (a\n * block deleted mid-session) simply drop out.\n */\nconst pickedBlocks = computed(() => {\n const byId = new Map(editor.content.value.blocks.map((b) => [b.id, b]));\n return orderedIds.value\n .map((id) => byId.get(id))\n .filter((b): b is Block => b !== undefined);\n});\n\n/**\n * Sortable's model. The setter reads ids straight back off the emitted entries\n * rather than storing them, so a Sortable `el` expando can never reach the\n * payload `create()` sends to the provider — and because the getter is already\n * filtered, writing through it prunes unresolvable ids too.\n */\nconst orderedBlocks = computed<Block[]>({\n get: () => pickedBlocks.value,\n set: (blocks) => {\n orderedIds.value = blocks.map((b) => b.id);\n },\n});\n\n/** Keyboard reorder from a focused grip: swap with the neighbouring row. */\nfunction moveBlock(blockId: string, delta: -1 | 1): void {\n const order = pickedBlocks.value.map((b) => b.id);\n const from = order.indexOf(blockId);\n const to = from + delta;\n if (from === -1 || to < 0 || to >= order.length) return;\n [order[from], order[to]] = [order[to], order[from]];\n orderedIds.value = order;\n\n const moved = pickedBlocks.value[to];\n announcement.value = moved\n ? format(t.savedBlocks.reorderAnnouncement, {\n block: label(moved),\n position: to + 1,\n total: order.length,\n })\n : \"\";\n}\n\n/** Custom blocks read as the consumer's name for them, not the type `custom`. */\nfunction label(block: Block): string {\n return getBlockLabel(block, t, customBlockDefinitions);\n}\n\n/** e.g. \"Title, Paragraph, Button\" — what the user is about to save. */\nconst summary = computed(() => pickedBlocks.value.map(label).join(\", \"));\n\n// `immediate` matters: the dialog is mounted lazily behind a `v-if` on the\n// same state that drives `visible`, so it can mount with `visible` already\n// true and would otherwise never reset the name field or seed the order.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n name.value = \"\";\n category.value = \"\";\n error.value = null;\n announcement.value = \"\";\n orderedIds.value = [...props.pickedIds];\n }\n },\n { immediate: true },\n);\n\nconst canSave = computed(\n () =>\n name.value.trim().length > 0 &&\n pickedBlocks.value.length > 0 &&\n !isSaving.value,\n);\n\nasync function handleSave(): Promise<void> {\n if (!canSave.value) return;\n\n const blocks = pickedBlocks.value;\n // Defence in depth: never persist an empty saved block (it would list as\n // \"0 block(s)\" and insert nothing). Guards a pick set whose ids no longer\n // resolve to anything on the canvas.\n if (blocks.length === 0) return;\n\n isSaving.value = true;\n error.value = null;\n\n try {\n // Empty stays undefined rather than \"\": an entry is either categorised or\n // it isn't, and a blank string would show up as a nameless filter option.\n await savedBlocks.create(\n name.value.trim(),\n blocks,\n category.value.trim() || undefined,\n );\n emit(\"saved\");\n emit(\"close\");\n } catch (err) {\n error.value = (err as Error).message;\n } finally {\n isSaving.value = false;\n }\n}\n\nfunction handleClose(): void {\n if (!isSaving.value) {\n emit(\"close\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n handleSave();\n }\n if (event.key === \"Escape\") {\n handleClose();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-busy=\"isSaving\"\n aria-labelledby=\"tpl-save-block-title\"\n class=\"tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <h3\n id=\"tpl-save-block-title\"\n class=\"tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.saveAsBlock }}\n </h3>\n\n <!-- Saved block name -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.name }}\n </label>\n <input\n v-model=\"name\"\n type=\"text\"\n data-testid=\"saved-blocks-name-input\"\n :placeholder=\"t.savedBlocks.namePlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n </div>\n\n <!-- Category: free text, with the already-used categories offered as\n suggestions. A datalist rather than a <select> because the set is\n derived from existing entries — there is no registry to pick from,\n and the first entry in a category has to be able to name it. -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n for=\"tpl-save-block-category\"\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.category }}\n </label>\n <input\n id=\"tpl-save-block-category\"\n v-model=\"category\"\n type=\"text\"\n data-testid=\"saved-blocks-category-input\"\n list=\"tpl-saved-block-categories\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n <datalist id=\"tpl-saved-block-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n </div>\n\n <!-- Summary of what the pick session chose. Which blocks were picked is\n settled on the canvas — the dialog re-presents them only so the user\n can see and order what they're about to save. -->\n <p\n data-testid=\"saved-blocks-save-summary\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ format(t.savedBlocks.savingCount, { count: pickedBlocks.length }) }}\n <span class=\"tpl:text-[var(--tpl-text-dim)]\">{{ summary }}</span>\n </p>\n\n <!-- Reorderable preview. Seeded in pick order and saved in whatever order\n the list ends up in. Its own Sortable instance with no `group`, so it\n can never exchange items with the canvas or a section column. -->\n <p\n v-if=\"pickedBlocks.length > 1\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.reorderHint }}\n </p>\n <!-- The only growing region: takes whatever the dialog's backdrop cap\n leaves after the fixed chrome, rather than a hand-tuned vh guess that\n a row expanding to full height would blow past. `min-h-0` is what\n lets a flex child actually shrink below its content and scroll. -->\n <VueDraggable\n v-model=\"orderedBlocks\"\n data-testid=\"saved-blocks-reorder-list\"\n :animation=\"150\"\n ghost-class=\"tpl-ghost\"\n drag-class=\"tpl-dragging\"\n handle=\".tpl-saved-block-reorder-handle\"\n :force-fallback=\"true\"\n class=\"tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto\"\n >\n <SavedBlockPreviewRow\n v-for=\"(block, index) in orderedBlocks\"\n :key=\"block.id\"\n :block=\"block\"\n :position=\"index + 1\"\n :total=\"orderedBlocks.length\"\n @move=\"(delta) => moveBlock(block.id, delta)\"\n />\n </VueDraggable>\n\n <!-- Keyboard reorder announcement region (visually hidden, live) -->\n <div\n class=\"tpl-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ announcement }}\n </div>\n\n <!-- Error message -->\n <p\n v-if=\"error\"\n role=\"alert\"\n class=\"tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ error }}\n </p>\n\n <!-- Actions -->\n <div class=\"tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n :disabled=\"isSaving\"\n :class=\"{\n 'tpl:cursor-not-allowed tpl:opacity-50': isSaving,\n }\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n :class=\"primaryBtnClass\"\n :disabled=\"!canSave\"\n @click=\"handleSave\"\n >\n <span v-if=\"isSaving\" class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <LoaderCircle\n class=\"tpl:animate-spin\"\n :size=\"12\"\n :stroke-width=\"2\"\n />\n {{ t.savedBlocks.saving }}\n </span>\n <span v-else>\n {{ t.savedBlocks.save }}\n </span>\n </button>\n </div>\n </div>\n </TplModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;A,wCAgEMqF,IAAmB,K;;;;;;;;;EAlCzB,IAAMG,IAAQC,GAORC,IAAOH,GAIP,EAAE,MAAG,cAAWhB,GAAQ,GAExBoB,IAAyBnD,EAAO8B,GAA8B,CAAC,CAAC,GAEhEsB,IAASpD,EAAO6B,GAAY,IAAI,GAUhCwB,IAAenC,QACnBO,EAAmB2B,GAAQ,QAAQ,MAAM,QAAQ,CACnD,GASME,IAAU3C,EAAwB,IAAI,GACtC4C,IAAY5C,EAAwB,IAAI,GACxC6C,IAAQ7C,EAAI,CAAC,GAEb8C,IAAa9C,EAAmB,IAAI,GACpC+C,IAAW/C,EAAI,EAAK,GAEtBgD,IAAkC,MAGhCC,IAAY1C,QACVuC,EAAW,UAAU,QAAQA,EAAW,QAAQZ,CACxD,GAEMgB,IAAc3C,QACduC,EAAW,UAAU,OAAa,OAClCC,EAAS,SAAS,CAACE,EAAU,QAAcH,EAAW,QACnDZ,CACR;EAED,SAASiB,IAAgB;GACvB,IAAMC,IAAQT,EAAQ,OAChBU,IAAUT,EAAU;GAC1B,IAAI,CAACQ,KAAS,CAACC,GAAS;GACxB,IAAMC,IAAQF,EAAM;GACpB,IAAIE,KAAS,GAAG;GAGhB,IAAMC,IAAO,KAAK,IAAI,GAAGD,IAAQZ,EAAa,KAAK;GAEnD,AADA,EAAM,QAAQa,GACd,EAAW,QAAQF,EAAQ,eAAeE;EAC5C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