@templatical/editor 0.56.1 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +1 -1
  2. package/dist/{AiAltTextPopover-CpZ7UeAZ.js → AiAltTextPopover-BjClNscQ.js} +5 -5
  3. package/dist/{AiAltTextReview-LYxvn7Qe.js → AiAltTextReview-DeMdVbtT.js} +6 -6
  4. package/dist/{AiChatPanel-Cy05P-iO.js → AiChatPanel-Cros4ZCM.js} +22 -25
  5. package/dist/AiPanels-D_CdHqFZ.js +26 -0
  6. package/dist/{AiRewriteMenu-DgqJHnza.js → AiRewriteMenu-BSzj1dKC.js} +53 -53
  7. package/dist/{BlockIssueBadge-CxHJmuOh.js → BlockIssueBadge-i2cZy5PB.js} +5 -5
  8. package/dist/{BlockPreviewCanvas-DEmNZkEG.js → BlockPreviewCanvas-D-If_vd_.js} +27 -27
  9. package/dist/{CloudHeaderExtras-Cqhw-jMz.js → CloudHeaderExtras-CJsXi4Ku.js} +2 -2
  10. package/dist/{CloudPanels-Bmlf05Il.js → CloudPanels-DPeK_siQ.js} +6 -6
  11. package/dist/{CollaborationNotices-C27GCMvK.js → CollaborationNotices-DkYX-ose.js} +3 -3
  12. package/dist/{CollaboratorBar-CLQjksX-.js → CollaboratorBar-xDweDvB6.js} +3 -3
  13. package/dist/CommentsPanel-t3w16YUl.js +23 -0
  14. package/dist/CommentsSidebar-B3M90RY_.js +516 -0
  15. package/dist/{CountdownBlock-D8dqjm3F.js → CountdownBlock-BrR2uqM3.js} +4 -4
  16. package/dist/{CountdownToolbar-IjpCOjCd.js → CountdownToolbar-DBu2ZqC6.js} +7 -7
  17. package/dist/{IssuesPanel-uwuzeMSW.js → IssuesPanel-BnUut-p-.js} +13 -13
  18. package/dist/{LanguageMenu-C-eQ0lFy.js → LanguageMenu-DfTxrbvp.js} +16 -16
  19. package/dist/{LoadingTrack-BG8cg9xi.js → LoadingTrack-c4SeD16s.js} +1 -1
  20. package/dist/{LocaleNotices-CDK_9D7P.js → LocaleNotices-D6zk-QCL.js} +5 -5
  21. package/dist/{LogicTagInsertButton-BSolF7Fd.js → LogicTagInsertButton-CJ1Jk6jv.js} +65 -65
  22. package/dist/{MediaEditModal-C8yc9dxt.js → MediaEditModal-BxbwZxnf.js} +4 -4
  23. package/dist/{MediaPanels-FI4I8asn.js → MediaPanels-BiUxsTMM.js} +2 -2
  24. package/dist/{MergeTagInput-B1nl2ZMT.js → MergeTagInput-CV-z85s9.js} +2 -2
  25. package/dist/{MergeTagModeToggle-DXvb80OE.js → MergeTagModeToggle-CixgX5C_.js} +7 -7
  26. package/dist/{MergeTagTextarea-DJlf3VbS.js → MergeTagTextarea-B1zOC_Nr.js} +9 -9
  27. package/dist/{ParagraphEditor-Dqco128s.js → ParagraphEditor-C9UhWvRB.js} +51 -51
  28. package/dist/{RestoreVersionDialog-hqLCuGV5.js → RestoreVersionDialog-Do7fZWpT.js} +5 -5
  29. package/dist/{RichTextEditorContent-xIEF0Y3Z.js → RichTextEditorContent-wW_SMun2.js} +10 -10
  30. package/dist/{SaveBlockDialog-CQlCP_XC.js → SaveBlockDialog-CCHIUfR-.js} +15 -15
  31. package/dist/{SavedBlocksBrowserModal-BXA32Fx6.js → SavedBlocksBrowserModal-DtPHhfw9.js} +13 -13
  32. package/dist/{SavedBlocksPanels-BKUzbamj.js → SavedBlocksPanels-CYIby5pR.js} +2 -2
  33. package/dist/{SavedBlocksPickBar-BlvF-4UF.js → SavedBlocksPickBar-CCwBugqN.js} +4 -4
  34. package/dist/{TemplateSettings-CYFtR8zv.js → TemplateSettings-B8IVy5q9.js} +14 -14
  35. package/dist/{TestEmailModal-BbaL17HO.js → TestEmailModal-CS5JoKRH.js} +13 -13
  36. package/dist/{TestEmailPanel-DhB1CSpg.js → TestEmailPanel-sOIZfKzc.js} +2 -2
  37. package/dist/{TitleEditor-3BRl8u5l.js → TitleEditor-ZlBcq9_P.js} +14 -14
  38. package/dist/{ToggleSwitch-R3wCCYE6.js → ToggleSwitch-BIPdFWUr.js} +1 -1
  39. package/dist/{Toolbar-pzNIakGM.js → Toolbar-c4_rLLJT.js} +218 -218
  40. package/dist/{TplModal-WNuWhHZm.js → TplModal-DnFFEulp.js} +6 -6
  41. package/dist/{VersionHistoryMenu--T-Qp_mH.js → VersionHistoryMenu-Cd2IaHgT.js} +10 -10
  42. package/dist/{VersionHistoryPanels-BPubvYIE.js → VersionHistoryPanels-TdGaMaa_.js} +2 -2
  43. package/dist/{VersionPreviewBanner-ClL3Wkln.js → VersionPreviewBanner-lkAf7tc8.js} +3 -3
  44. package/dist/{WrapperBlock-CjfCPceb.js → WrapperBlock-BiW4ye3w.js} +5 -5
  45. package/dist/{blockTypeIcons-12OMwVyN.js → blockTypeIcons-D1aYMC1M.js} +3 -3
  46. package/dist/bundle-stats.json +7 -7
  47. package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js → AiAltTextPopover-CfGJNBOb.js} +5 -5
  48. package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js.map → AiAltTextPopover-CfGJNBOb.js.map} +1 -1
  49. package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js → AiAltTextReview-PKe31R_g.js} +6 -6
  50. package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js.map → AiAltTextReview-PKe31R_g.js.map} +1 -1
  51. package/dist/cdn/chunks/{AiChatPanel-C2gpq4kP.js → AiChatPanel-DNCUpV8n.js} +15 -18
  52. package/dist/cdn/chunks/AiChatPanel-DNCUpV8n.js.map +1 -0
  53. package/dist/cdn/chunks/AiPanels-IV0VEkBL.js +27 -0
  54. package/dist/cdn/chunks/AiPanels-IV0VEkBL.js.map +1 -0
  55. package/dist/cdn/chunks/{AiRewriteMenu-CnkyjPEu.js → AiRewriteMenu-ZDBwReuU.js} +58 -58
  56. package/dist/cdn/chunks/AiRewriteMenu-ZDBwReuU.js.map +1 -0
  57. package/dist/cdn/chunks/{BlockIssueBadge-DncZ-HDf.js → BlockIssueBadge-DIlFDDwh.js} +5 -5
  58. package/dist/cdn/chunks/BlockIssueBadge-DIlFDDwh.js.map +1 -0
  59. package/dist/cdn/chunks/{BlockPreviewCanvas-CCSEzL46.js → BlockPreviewCanvas-D7U6nQ7t.js} +28 -28
  60. package/dist/cdn/chunks/BlockPreviewCanvas-D7U6nQ7t.js.map +1 -0
  61. package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js → CloudHeaderExtras-CazfMn6A.js} +3 -3
  62. package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js.map → CloudHeaderExtras-CazfMn6A.js.map} +1 -1
  63. package/dist/cdn/chunks/{CloudPanels-CRztnw4M.js → CloudPanels-EXXNMLbs.js} +5 -5
  64. package/dist/cdn/chunks/CloudPanels-EXXNMLbs.js.map +1 -0
  65. package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js → CollaborationNotices-DGA8XRZJ.js} +4 -4
  66. package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js.map → CollaborationNotices-DGA8XRZJ.js.map} +1 -1
  67. package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js → CollaboratorBar-BWL1Shc1.js} +4 -4
  68. package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js.map → CollaboratorBar-BWL1Shc1.js.map} +1 -1
  69. package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js +24 -0
  70. package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js.map +1 -0
  71. package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js +486 -0
  72. package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js.map +1 -0
  73. package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js → CountdownBlock-Do6oItNW.js} +5 -5
  74. package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js.map → CountdownBlock-Do6oItNW.js.map} +1 -1
  75. package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js → CountdownToolbar-BN2_zvRj.js} +8 -8
  76. package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js.map → CountdownToolbar-BN2_zvRj.js.map} +1 -1
  77. package/dist/cdn/chunks/{IssuesPanel-CrplCzo8.js → IssuesPanel-BDwegn0s.js} +9 -9
  78. package/dist/cdn/chunks/IssuesPanel-BDwegn0s.js.map +1 -0
  79. package/dist/cdn/chunks/{LanguageMenu-B6MNInCL.js → LanguageMenu-DXq9cXUd.js} +105 -105
  80. package/dist/cdn/chunks/LanguageMenu-DXq9cXUd.js.map +1 -0
  81. package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js → LoadingTrack-o-89hApJ.js} +2 -2
  82. package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js.map → LoadingTrack-o-89hApJ.js.map} +1 -1
  83. package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js → LocaleNotices-CUN5K5QJ.js} +5 -5
  84. package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js.map → LocaleNotices-CUN5K5QJ.js.map} +1 -1
  85. package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js → LogicTagInsertButton-BEArlbra.js} +12 -12
  86. package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js.map → LogicTagInsertButton-BEArlbra.js.map} +1 -1
  87. package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js → MediaEditModal-BHTMNHx0.js} +4 -4
  88. package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js.map → MediaEditModal-BHTMNHx0.js.map} +1 -1
  89. package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js → MediaPanels-BlianNRh.js} +3 -3
  90. package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js.map → MediaPanels-BlianNRh.js.map} +1 -1
  91. package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js → MergeTagInput-B3SLXXzL.js} +3 -3
  92. package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js.map → MergeTagInput-B3SLXXzL.js.map} +1 -1
  93. package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js → MergeTagModeToggle-Dywp9ntA.js} +6 -6
  94. package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js.map → MergeTagModeToggle-Dywp9ntA.js.map} +1 -1
  95. package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js → MergeTagTextarea-B9TM7FgM.js} +7 -7
  96. package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js.map → MergeTagTextarea-B9TM7FgM.js.map} +1 -1
  97. package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js → ParagraphEditor-CVGtTYta.js} +30 -30
  98. package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js.map → ParagraphEditor-CVGtTYta.js.map} +1 -1
  99. package/dist/cdn/chunks/{RestoreVersionDialog-CPrrWTsT.js → RestoreVersionDialog-Dt_0qOOW.js} +5 -5
  100. package/dist/cdn/chunks/RestoreVersionDialog-Dt_0qOOW.js.map +1 -0
  101. package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js → RichTextEditorContent-BjN4mnzL.js} +9 -9
  102. package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js.map → RichTextEditorContent-BjN4mnzL.js.map} +1 -1
  103. package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js → SaveBlockDialog-D9eBjE99.js} +13 -13
  104. package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js.map → SaveBlockDialog-D9eBjE99.js.map} +1 -1
  105. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js → SavedBlocksBrowserModal-ClsTpkdk.js} +9 -9
  106. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js.map → SavedBlocksBrowserModal-ClsTpkdk.js.map} +1 -1
  107. package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js → SavedBlocksPanels-CxlNHhUs.js} +3 -3
  108. package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js.map → SavedBlocksPanels-CxlNHhUs.js.map} +1 -1
  109. package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js → SavedBlocksPickBar-C7_Z8phX.js} +5 -5
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js.map → SavedBlocksPickBar-C7_Z8phX.js.map} +1 -1
  111. package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js → TemplateSettings-B6zDtjSs.js} +12 -12
  112. package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js.map → TemplateSettings-B6zDtjSs.js.map} +1 -1
  113. package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js → TestEmailModal-CJ_QYFua.js} +10 -10
  114. package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js.map → TestEmailModal-CJ_QYFua.js.map} +1 -1
  115. package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js → TestEmailPanel-CsFrTq_a.js} +3 -3
  116. package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js.map → TestEmailPanel-CsFrTq_a.js.map} +1 -1
  117. package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js → TitleEditor-CuKJptyw.js} +13 -13
  118. package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js.map → TitleEditor-CuKJptyw.js.map} +1 -1
  119. package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js → ToggleSwitch-C0w0srN_.js} +2 -2
  120. package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js.map → ToggleSwitch-C0w0srN_.js.map} +1 -1
  121. package/dist/cdn/chunks/{Toolbar-VH07SzX7.js → Toolbar-TS2WwlPW.js} +302 -302
  122. package/dist/cdn/chunks/Toolbar-TS2WwlPW.js.map +1 -0
  123. package/dist/cdn/chunks/{TplModal-DMe6J811.js → TplModal-CsadClrH.js} +6 -6
  124. package/dist/cdn/chunks/{TplModal-DMe6J811.js.map → TplModal-CsadClrH.js.map} +1 -1
  125. package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js → VersionHistoryMenu-BNPxnWiO.js} +9 -9
  126. package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js.map → VersionHistoryMenu-BNPxnWiO.js.map} +1 -1
  127. package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js → VersionHistoryPanels-CieY91f0.js} +3 -3
  128. package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js.map → VersionHistoryPanels-CieY91f0.js.map} +1 -1
  129. package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js → VersionPreviewBanner-BldFvgxJ.js} +4 -4
  130. package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js.map → VersionPreviewBanner-BldFvgxJ.js.map} +1 -1
  131. package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js → WrapperBlock-DtnRuKWE.js} +6 -6
  132. package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js.map → WrapperBlock-DtnRuKWE.js.map} +1 -1
  133. package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js → blockTypeIcons-19xd5ZPi.js} +6 -6
  134. package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js.map → blockTypeIcons-19xd5ZPi.js.map} +1 -1
  135. package/dist/cdn/chunks/{composables-D3lsO7Io.js → composables-CUIiW9OD.js} +750 -730
  136. package/dist/cdn/chunks/composables-CUIiW9OD.js.map +1 -0
  137. package/dist/cdn/chunks/{createCloudRuntime-CE79GB1H.js → createCloudRuntime-B7D04wKf.js} +157 -143
  138. package/dist/cdn/chunks/createCloudRuntime-B7D04wKf.js.map +1 -0
  139. package/dist/cdn/chunks/da-CYWJkrTg.js +97 -0
  140. package/dist/cdn/chunks/da-CYWJkrTg.js.map +1 -0
  141. package/dist/cdn/chunks/da-qQzj0QGy.js +950 -0
  142. package/dist/cdn/chunks/da-qQzj0QGy.js.map +1 -0
  143. package/dist/cdn/chunks/{dist-BzXULHvI.js → dist-BtWMy7UQ.js} +3 -3
  144. package/dist/cdn/chunks/{dist-BzXULHvI.js.map → dist-BtWMy7UQ.js.map} +1 -1
  145. package/dist/cdn/chunks/{dist-Cf1pSluo.js → dist-zu1jwYIS.js} +4 -4
  146. package/dist/cdn/chunks/{dist-Cf1pSluo.js.map → dist-zu1jwYIS.js.map} +1 -1
  147. package/dist/cdn/chunks/{draggable-DepKdldn.js → draggable-IRVFEZ-b.js} +1535 -1500
  148. package/dist/cdn/chunks/draggable-IRVFEZ-b.js.map +1 -0
  149. package/dist/cdn/chunks/{editor-modal-CN69NlOK.js → editor-modal-CarOiAYJ.js} +77 -76
  150. package/dist/cdn/chunks/{editor-modal-CN69NlOK.js.map → editor-modal-CarOiAYJ.js.map} +1 -1
  151. package/dist/cdn/chunks/en-B4s_0ryk.js +1 -0
  152. package/dist/cdn/chunks/{extensions-8dlM-fU4.js → extensions-Cbvk9i08.js} +7 -7
  153. package/dist/cdn/chunks/{extensions-8dlM-fU4.js.map → extensions-Cbvk9i08.js.map} +1 -1
  154. package/dist/cdn/chunks/{icons-DHExFLlT.js → icons-Cl4oR2mf.js} +73 -73
  155. package/dist/cdn/chunks/icons-Cl4oR2mf.js.map +1 -0
  156. package/dist/cdn/chunks/keys-BQqbBUag.js +11 -0
  157. package/dist/cdn/chunks/keys-BQqbBUag.js.map +1 -0
  158. package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js → normalizeMergeTagMarkup-BJ-MnCqF.js} +55 -55
  159. package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js.map → normalizeMergeTagMarkup-BJ-MnCqF.js.map} +1 -1
  160. package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js → preRenderCustomBlocks-D2wISRHq.js} +2 -2
  161. package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js.map → preRenderCustomBlocks-D2wISRHq.js.map} +1 -1
  162. package/dist/cdn/chunks/{sanitizeHtml-B3njfkSy.js → sanitizeHtml-CB7fjHFs.js} +22 -11
  163. package/dist/cdn/chunks/sanitizeHtml-CB7fjHFs.js.map +1 -0
  164. package/dist/cdn/chunks/{socialIcons-BFgc3qqJ.js → socialIcons-C_yggK1_.js} +575 -524
  165. package/dist/cdn/chunks/socialIcons-C_yggK1_.js.map +1 -0
  166. package/dist/cdn/chunks/{src-C9JWWxAk.js → src-Bp7bZcuD.js} +108 -95
  167. package/dist/cdn/chunks/src-Bp7bZcuD.js.map +1 -0
  168. package/dist/cdn/chunks/{src-mXG-Of9A.js → src-CdVAke9t.js} +721 -696
  169. package/dist/cdn/chunks/src-CdVAke9t.js.map +1 -0
  170. package/dist/cdn/chunks/{src-GgKlXNxy.js → src-D-URHI0Z.js} +232 -228
  171. package/dist/cdn/chunks/src-D-URHI0Z.js.map +1 -0
  172. package/dist/cdn/chunks/{tiptap-C940SvId.js → tiptap-BPiZqxCt.js} +40 -31
  173. package/dist/cdn/chunks/tiptap-BPiZqxCt.js.map +1 -0
  174. package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js → useCloudI18n-Dr4S2TRW.js} +3 -3
  175. package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js.map → useCloudI18n-Dr4S2TRW.js.map} +1 -1
  176. package/dist/cdn/chunks/useEditorRoot-B_kf_k-g.js +9 -0
  177. package/dist/cdn/chunks/{useEditorRoot-Beau2Z_T.js.map → useEditorRoot-B_kf_k-g.js.map} +1 -1
  178. package/dist/cdn/chunks/{useI18n-D8s7HtTn.js → useI18n-CSf-ZpcM.js} +3 -3
  179. package/dist/cdn/chunks/{useI18n-D8s7HtTn.js.map → useI18n-CSf-ZpcM.js.map} +1 -1
  180. package/dist/cdn/chunks/useLocalizedDisplay-slFOCPrh.js +33 -0
  181. package/dist/cdn/chunks/{useLocalizedDisplay-Bgg4qpev.js.map → useLocalizedDisplay-slFOCPrh.js.map} +1 -1
  182. package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js → useLogicTag-lPjCGeGC.js} +4 -4
  183. package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js.map → useLogicTag-lPjCGeGC.js.map} +1 -1
  184. package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js → useMergeTag-BKNBwIry.js} +4 -4
  185. package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js.map → useMergeTag-BKNBwIry.js.map} +1 -1
  186. package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js → usePopoverPosition-BJFFi8x6.js} +3 -3
  187. package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js.map → usePopoverPosition-BJFFi8x6.js.map} +1 -1
  188. package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js → useScrollToBlock-MI4PP5lk.js} +3 -3
  189. package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js.map → useScrollToBlock-MI4PP5lk.js.map} +1 -1
  190. package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js → withCurrentFont-CzTFFaJA.js} +2 -2
  191. package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js.map → withCurrentFont-CzTFFaJA.js.map} +1 -1
  192. package/dist/cdn/editor.css +1 -1
  193. package/dist/cdn/editor.js +685 -663
  194. package/dist/cdn/editor.js.map +1 -1
  195. package/dist/{check-CcuCoJDh.js → check-C7ua4TAK.js} +1 -1
  196. package/dist/{chevron-down-BfYIbFbC.js → chevron-down-DftQrAkI.js} +1 -1
  197. package/dist/{chevron-right-DyjFqY35.js → chevron-right-B-DULGbg.js} +1 -1
  198. package/dist/{chevron-up-BHEIxuS-.js → chevron-up-CeYsyD8c.js} +1 -1
  199. package/dist/{circle-alert-Tq7kAh9S.js → circle-exclamation-point-DHjORV_I.js} +3 -3
  200. package/dist/{clock-Df0ZiXwQ.js → clock-CajOtLEZ.js} +1 -1
  201. package/dist/{composables-DreAt_0A.js → composables-DbjgUQlV.js} +1123 -1103
  202. package/dist/{createCloudRuntime-CL4tUlDC.js → createCloudRuntime-Cnh2M6iT.js} +42 -28
  203. package/dist/{createLucideIcon-CfBdtoUw.js → createLucideIcon-D-mELTSY.js} +6 -6
  204. package/dist/da-CYWJkrTg.js +95 -0
  205. package/dist/da-qQzj0QGy.js +948 -0
  206. package/dist/{dist-CX7skkvG.js → dist-A328tG0Z.js} +2 -2
  207. package/dist/{dist-BjzK1g4Z.js → dist-B15BvV94.js} +2 -2
  208. package/dist/{dist-DDytHU_6.js → dist-B3G4Yvpd.js} +3 -3
  209. package/dist/{dist-CiYotUR8.js → dist-B6ptxfPo.js} +3 -3
  210. package/dist/{dist-0GWMyHtM.js → dist-BmV-2uBJ.js} +2 -2
  211. package/dist/{dist-CCLRTtJP.js → dist-BxKFi2h_.js} +5 -5
  212. package/dist/{dist-BMUUt3zJ.js → dist-CAvsz9cW.js} +680 -655
  213. package/dist/{dist-CsknfjrZ.js → dist-CMBOqk9I.js} +7 -7
  214. package/dist/{dist-ZrT0vAB6.js → dist-CXTsTO5h.js} +2 -2
  215. package/dist/{dist-Dq9VnANT.js → dist-D5BUcCjv.js} +2 -2
  216. package/dist/dist-D9cbSSSx.js +4 -0
  217. package/dist/{dist-BsumKKh9.js → dist-DAdrn64r.js} +2 -2
  218. package/dist/{dist-C3avsUq9.js → dist-DENg3ORe.js} +31 -22
  219. package/dist/{dist-Cr1CLCmx.js → dist-DI_8rB1X.js} +2 -2
  220. package/dist/dist-ELLEk-lS.js +4 -0
  221. package/dist/{editor-modal-BD32TXws.js → editor-modal-CgsaLpwB.js} +20 -19
  222. package/dist/en-DBLcB-CW.js +1 -0
  223. package/dist/{extensions-DKxHlSd7.js → extensions-7fb-XtNJ.js} +21 -21
  224. package/dist/{eye-B3psrAqd.js → eye-fe5sKF_K.js} +1 -1
  225. package/dist/{image-C3yuPDxx.js → image-CUC7SZiW.js} +1 -1
  226. package/dist/index.d.ts +6 -4
  227. package/dist/{info-DKja7A68.js → info-DDbLU4pT.js} +1 -1
  228. package/dist/keys-D9oKZN1h.js +9 -0
  229. package/dist/{link-DhzPI4Hn.js → link-C2icj0iH.js} +1 -1
  230. package/dist/{list-DVGn7Ik2.js → list-KYC_Jb5A.js} +1 -1
  231. package/dist/{loader-circle-DqKWsMHO.js → loader-circle-DmyagWpc.js} +1 -1
  232. package/dist/{message-circle-C4TonoBs.js → message-circle-ijyWn6UJ.js} +1 -1
  233. package/dist/{normalizeMergeTagMarkup-Da9JAgx7.js → normalizeMergeTagMarkup-GrXJfXsQ.js} +82 -82
  234. package/dist/{package-9OkiEO4S.js → package-CKYm_jQY.js} +1 -1
  235. package/dist/{pencil-M9vkOB7C.js → pencil-C2TRSR-Y.js} +1 -1
  236. package/dist/{plus-DxZiv9YC.js → plus-CotJVDxb.js} +1 -1
  237. package/dist/{preRenderCustomBlocks-CdqSp2P7.js → preRenderCustomBlocks-DuXtzD-F.js} +3 -3
  238. package/dist/{refresh-cw-UY8_sdFG.js → refresh-cw-CuCRV6D5.js} +1 -1
  239. package/dist/{rotate-ccw-BFTGCpHn.js → rotate-ccw-BlnQ3y6R.js} +1 -1
  240. package/dist/{runtime-dom.esm-bundler-DlHp8xgy.js → runtime-dom.esm-bundler-nN-jsqr1.js} +20 -20
  241. package/dist/{sanitizeHtml-wBibnBF4.js → sanitizeHtml-eV4_BpI6.js} +25 -14
  242. package/dist/{search-RuGJnMEn.js → search-Dxw6oFrZ.js} +1 -1
  243. package/dist/{send-DGB1ar02.js → send-C-blQBZ9.js} +1 -1
  244. package/dist/{smartphone-CVA29CU_.js → smartphone-rLz4X-Dd.js} +1 -1
  245. package/dist/{socialIcons-oo4uL16Y.js → socialIcons-brRkK9Om.js} +600 -549
  246. package/dist/{sparkles-IHfEwEcd.js → sparkles-JWQlUiSn.js} +1 -1
  247. package/dist/{square-_Cl44UU6.js → square-DshDy1Il.js} +1 -1
  248. package/dist/style.css +1 -1
  249. package/dist/templatical-editor.js +748 -726
  250. package/dist/{text-align-start-Dqk2Xt_Q.js → text-align-start-CyasaQtr.js} +13 -13
  251. package/dist/{trash-Cr7rD5Hh.js → trash-B1lZp2Tv.js} +1 -1
  252. package/dist/{triangle-alert-CKcpwtUj.js → triangle-exclamation-point-BhJvBEoT.js} +3 -3
  253. package/dist/{upload-DR9pqVON.js → upload-CNK8JX38.js} +1 -1
  254. package/dist/{useCloudI18n-BczJoFf4.js → useCloudI18n-HhCZYRV6.js} +2 -2
  255. package/dist/useEditorRoot-B0Njczhx.js +7 -0
  256. package/dist/{useI18n-zeWYtWSv.js → useI18n-CM9vKbYc.js} +2 -2
  257. package/dist/{cdn/chunks/useLocalizedDisplay-Bgg4qpev.js → useLocalizedDisplay-DoaT7nWk.js} +2 -4
  258. package/dist/{useLogicTag-B4Zpk3eo.js → useLogicTag-cTC2KbWd.js} +3 -3
  259. package/dist/{useMergeTag-B5qlq8px.js → useMergeTag-D2YDZ8vR.js} +3 -3
  260. package/dist/{usePopoverPosition-Br3zt_MQ.js → usePopoverPosition-CVRzzLkC.js} +2 -2
  261. package/dist/{useScrollToBlock-BfOzc1Z6.js → useScrollToBlock-vf_KD0FM.js} +3 -3
  262. package/dist/{vue.runtime.esm-bundler-BJXc_Mri.js → vue.runtime.esm-bundler-BE5V8ADU.js} +414 -362
  263. package/dist/{withCurrentFont-m_PHcOD0.js → withCurrentFont-DAmED4fN.js} +1 -1
  264. package/dist/{x-DZSFHafL.js → x-DbLX5Qdm.js} +1 -1
  265. package/package.json +23 -23
  266. package/dist/AiPanels-CwKmXzyr.js +0 -31
  267. package/dist/CommentsPanel-B5NqPMmY.js +0 -16
  268. package/dist/CommentsSidebar-BDrcrDxS.js +0 -526
  269. package/dist/cdn/chunks/AiChatPanel-C2gpq4kP.js.map +0 -1
  270. package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js +0 -32
  271. package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js.map +0 -1
  272. package/dist/cdn/chunks/AiRewriteMenu-CnkyjPEu.js.map +0 -1
  273. package/dist/cdn/chunks/BlockIssueBadge-DncZ-HDf.js.map +0 -1
  274. package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js.map +0 -1
  275. package/dist/cdn/chunks/CloudPanels-CRztnw4M.js.map +0 -1
  276. package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js +0 -18
  277. package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js.map +0 -1
  278. package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js +0 -496
  279. package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js.map +0 -1
  280. package/dist/cdn/chunks/IssuesPanel-CrplCzo8.js.map +0 -1
  281. package/dist/cdn/chunks/LanguageMenu-B6MNInCL.js.map +0 -1
  282. package/dist/cdn/chunks/RestoreVersionDialog-CPrrWTsT.js.map +0 -1
  283. package/dist/cdn/chunks/Toolbar-VH07SzX7.js.map +0 -1
  284. package/dist/cdn/chunks/composables-D3lsO7Io.js.map +0 -1
  285. package/dist/cdn/chunks/createCloudRuntime-CE79GB1H.js.map +0 -1
  286. package/dist/cdn/chunks/draggable-DepKdldn.js.map +0 -1
  287. package/dist/cdn/chunks/en-Bcz4gS9U.js +0 -1
  288. package/dist/cdn/chunks/icons-DHExFLlT.js.map +0 -1
  289. package/dist/cdn/chunks/keys-BUmIvYy3.js +0 -11
  290. package/dist/cdn/chunks/keys-BUmIvYy3.js.map +0 -1
  291. package/dist/cdn/chunks/sanitizeHtml-B3njfkSy.js.map +0 -1
  292. package/dist/cdn/chunks/socialIcons-BFgc3qqJ.js.map +0 -1
  293. package/dist/cdn/chunks/src-C9JWWxAk.js.map +0 -1
  294. package/dist/cdn/chunks/src-GgKlXNxy.js.map +0 -1
  295. package/dist/cdn/chunks/src-mXG-Of9A.js.map +0 -1
  296. package/dist/cdn/chunks/tiptap-C940SvId.js.map +0 -1
  297. package/dist/cdn/chunks/useEditorRoot-Beau2Z_T.js +0 -9
  298. package/dist/dist-B_0FPmoy.js +0 -4
  299. package/dist/dist-DKV9m4Uu.js +0 -4
  300. package/dist/en-Dgs_-NBw.js +0 -1
  301. package/dist/keys-w_VRjoMu.js +0 -9
  302. package/dist/useEditorRoot-BcXKhM_8.js +0 -7
  303. package/dist/useLocalizedDisplay-Cbhx208c.js +0 -31
@@ -1 +0,0 @@
1
- {"version":3,"file":"AiChatPanel-C2gpq4kP.js","names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_unref","_toDisplayString","_createCommentVNode","_renderSlot","_sfc_main","_openBlock","_createElementBlock","_createVNode","AiPanelShell","_unref","_withCtx","_createCommentVNode","_createElementVNode","_Fragment","_renderList","_createBlock","_toDisplayString","_normalizeClass","_withDirectives","_vModelText","_createTextVNode","LoadingTrack","_sfc_main","defineComponent","openBlock","withCtx","watch","withDirectives","renderList","inject","renderSlot","createElementBlock","createTextVNode","unref","normalizeClass","createCommentVNode","createBlock","nextTick","createBaseVNode","toDisplayString","vModelText","computed","ref","Fragment","Sparkles","CircleAlert","Paperclip","Square","FileText","Image","LoaderCircle","Send","Undo2","X","MessageSquarePlus","Redo2","useTimeoutFn","useIntervalFn","LoadingTrack_default","useI18n","secondaryBtnCompactClass","UI_LOCALE_KEY","EDITOR_KEY","languageName","aiErrorMessage","_plugin_vue_export_helper_default","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_hoisted_5$1","_hoisted_6$1","_hoisted_7$1","_hoisted_8$1","_hoisted_9$1","AiPanelShell_default","__emit","emit","__props","createVNode","_ctx","_cache","TYPES","validateChatAttachments","accepted","existing","errors","total","sum","file","added","reason","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","\"color\"","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","AiChatPanel_default","props","editor","uiLocale","promptInput","composer","fileInput","attachments","attachmentErrors","dragDepth","canAttach","attach","result","files","keys","format","t","error","picked","input","event","isBusy","removeAttachment","index","isFileDrag","dragEnter","dragLeave","dragOver","drop","messagesContainer","visibleStarterCount","starters","messages","failureText","failure","pauseReveal","resumeReveal","startReveal","count","scrollToBottom","prompt","send","appliedLabel","item","itemFailure","toggleUndo","chooseStarter","starter","onKeydown","$event","attachment"],"sources":["../../../src/components/ai/AiPanelShell.vue","../../../src/components/ai/AiPanelShell.vue","../../../src/utils/aiAttachments.ts","../../../src/components/ai/AiChatPanel.vue","../../../src/components/ai/AiChatPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Sparkles, X } from \"@lucide/vue\";\n\ndefineProps<{\n title: string;\n subtitle?: string;\n /** `ai-panel-chat`. */\n testid: string;\n closeLabel: string;\n}>();\n\nconst emit = defineEmits<{ (e: \"close\"): void }>();\n</script>\n\n<template>\n <div\n role=\"complementary\"\n :aria-label=\"title\"\n :data-testid=\"testid\"\n class=\"tpl-ai-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]\"\n >\n <!-- The header names the panel an AI feature (EU AI Act Art. 50). -->\n <div\n class=\"tpl:flex tpl:items-start tpl:justify-between tpl:gap-2 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3\"\n >\n <div class=\"tpl:flex tpl:min-w-0 tpl:flex-col tpl:gap-0.5\">\n <div\n class=\"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]\"\n >\n <Sparkles :size=\"13\" :stroke-width=\"2\" aria-hidden=\"true\" />\n <span data-testid=\"ai-panel-title\">{{ title }}</span>\n </div>\n <p\n v-if=\"subtitle\"\n data-testid=\"ai-panel-subtitle\"\n class=\"tpl:m-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ subtitle }}\n </p>\n </div>\n <div class=\"tpl:flex tpl:items-center tpl:gap-1\">\n <slot name=\"actions\" />\n <button\n type=\"button\"\n data-testid=\"ai-panel-close\"\n class=\"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"closeLabel\"\n :title=\"closeLabel\"\n @click=\"emit('close')\"\n >\n <X :size=\"14\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n <div class=\"tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col\">\n <slot />\n </div>\n <slot name=\"footer\" />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { Sparkles, X } from \"@lucide/vue\";\n\ndefineProps<{\n title: string;\n subtitle?: string;\n /** `ai-panel-chat`. */\n testid: string;\n closeLabel: string;\n}>();\n\nconst emit = defineEmits<{ (e: \"close\"): void }>();\n</script>\n\n<template>\n <div\n role=\"complementary\"\n :aria-label=\"title\"\n :data-testid=\"testid\"\n class=\"tpl-ai-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]\"\n >\n <!-- The header names the panel an AI feature (EU AI Act Art. 50). -->\n <div\n class=\"tpl:flex tpl:items-start tpl:justify-between tpl:gap-2 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3\"\n >\n <div class=\"tpl:flex tpl:min-w-0 tpl:flex-col tpl:gap-0.5\">\n <div\n class=\"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]\"\n >\n <Sparkles :size=\"13\" :stroke-width=\"2\" aria-hidden=\"true\" />\n <span data-testid=\"ai-panel-title\">{{ title }}</span>\n </div>\n <p\n v-if=\"subtitle\"\n data-testid=\"ai-panel-subtitle\"\n class=\"tpl:m-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ subtitle }}\n </p>\n </div>\n <div class=\"tpl:flex tpl:items-center tpl:gap-1\">\n <slot name=\"actions\" />\n <button\n type=\"button\"\n data-testid=\"ai-panel-close\"\n class=\"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"closeLabel\"\n :title=\"closeLabel\"\n @click=\"emit('close')\"\n >\n <X :size=\"14\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n <div class=\"tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col\">\n <slot />\n </div>\n <slot name=\"footer\" />\n </div>\n</template>\n","/** Chat file limits, matching the AI wire. */\nexport const AI_ATTACHMENTS_MAX = 4;\nexport const AI_ATTACHMENT_MAX_BYTES = 5 * 1024 * 1024;\nexport const AI_ATTACHMENTS_TOTAL_MAX_BYTES = 10 * 1024 * 1024;\nconst TYPES = new Set([\n \"image/png\",\n \"image/jpeg\",\n \"image/webp\",\n \"image/gif\",\n \"application/pdf\",\n]);\nexport function validateChatAttachments(\n existing: File[],\n added: File[],\n): {\n accepted: File[];\n errors: {\n name: string;\n reason: \"tooMany\" | \"tooLarge\" | \"totalTooLarge\" | \"wrongType\";\n }[];\n} {\n const accepted = [...existing];\n const errors: ReturnType<typeof validateChatAttachments>[\"errors\"] = [];\n let total = existing.reduce((sum, file) => sum + file.size, 0);\n for (const file of added) {\n const reason =\n accepted.length >= AI_ATTACHMENTS_MAX\n ? \"tooMany\"\n : !TYPES.has(file.type)\n ? \"wrongType\"\n : file.size > AI_ATTACHMENT_MAX_BYTES\n ? \"tooLarge\"\n : total + file.size > AI_ATTACHMENTS_TOTAL_MAX_BYTES\n ? \"totalTooLarge\"\n : null;\n if (reason) errors.push({ name: file.name, reason });\n else {\n accepted.push(file);\n total += file.size;\n }\n }\n return { accepted, errors };\n}\n","<script setup lang=\"ts\">\nimport {\n CircleAlert,\n FileText,\n Image,\n Paperclip,\n X,\n LoaderCircle,\n MessageSquarePlus,\n Redo2,\n Send,\n Sparkles,\n Square,\n Undo2,\n} from \"@lucide/vue\";\nimport { computed, inject, nextTick, ref, watch } from \"vue\";\nimport { useIntervalFn, useTimeoutFn } from \"@vueuse/core\";\nimport LoadingTrack from \"../LoadingTrack.vue\";\nimport AiPanelShell from \"./AiPanelShell.vue\";\nimport type {\n AiChatItem,\n UseAiFeatureReturn,\n} from \"../../composables/useAiFeature\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport { secondaryBtnCompactClass } from \"../../constants/styleConstants\";\nimport { EDITOR_KEY, UI_LOCALE_KEY } from \"../../keys\";\nimport { validateChatAttachments } from \"../../utils/aiAttachments\";\nimport { languageName } from \"../../utils/languageName\";\nimport { aiErrorMessage } from \"../../utils/aiErrors\";\n\nconst props = defineProps<{ feature: UseAiFeatureReturn }>();\nconst emit = defineEmits<{ (e: \"close\"): void }>();\n\nconst { t, format } = useI18n();\nconst editor = inject(EDITOR_KEY, null);\nconst uiLocale = inject(UI_LOCALE_KEY, undefined);\n\nconst promptInput = ref(\"\");\nconst composer = ref<HTMLTextAreaElement | null>(null);\nconst fileInput = ref<HTMLInputElement | null>(null);\nconst attachments = ref<File[]>([]);\nconst attachmentErrors = ref<string[]>([]);\nconst dragDepth = ref(0);\nwatch(\n () => props.feature.templateSession.value,\n () => {\n promptInput.value = \"\";\n attachments.value = [];\n attachmentErrors.value = [];\n dragDepth.value = 0;\n },\n { flush: \"sync\" },\n);\nconst canAttach = computed(() => props.feature.has(\"chatAttachments\"));\nfunction attach(files: File[]): void {\n const result = validateChatAttachments(attachments.value, files);\n attachments.value = result.accepted;\n const keys = {\n tooMany: \"attachTooMany\",\n tooLarge: \"attachTooLarge\",\n totalTooLarge: \"attachTotalTooLarge\",\n wrongType: \"attachWrongType\",\n } as const;\n attachmentErrors.value = result.errors.map((error) =>\n format(t.ai.chat[keys[error.reason]], { name: error.name }),\n );\n}\nfunction picked(event: Event): void {\n const input = event.target as HTMLInputElement;\n if (!isBusy.value && canAttach.value) attach(Array.from(input.files ?? []));\n input.value = \"\";\n}\nfunction removeAttachment(index: number): void {\n if (isBusy.value) return;\n attachments.value.splice(index, 1);\n attachmentErrors.value = [];\n}\nfunction isFileDrag(event: DragEvent): boolean {\n return Array.from(event.dataTransfer?.types ?? []).includes(\"Files\");\n}\nfunction dragEnter(event: DragEvent): void {\n if (!canAttach.value || isBusy.value || !isFileDrag(event)) return;\n event.preventDefault();\n dragDepth.value++;\n}\nfunction dragLeave(event: DragEvent): void {\n if (!isFileDrag(event)) return;\n dragDepth.value = Math.max(0, dragDepth.value - 1);\n}\nfunction dragOver(event: DragEvent): void {\n if (canAttach.value && isFileDrag(event)) event.preventDefault();\n}\nfunction drop(event: DragEvent): void {\n dragDepth.value = 0;\n if (!canAttach.value || !isFileDrag(event)) return;\n event.preventDefault();\n if (!isBusy.value) attach(Array.from(event.dataTransfer?.files ?? []));\n}\nwatch(\n () => props.feature.importQueue.value,\n (files) => {\n if (!canAttach.value || !files.length) return;\n attach(files);\n if (!promptInput.value.trim()) promptInput.value = t.ai.import.prompt;\n props.feature.importQueue.value = [];\n void nextTick(() => composer.value?.focus());\n },\n { immediate: true },\n);\nconst messagesContainer = ref<HTMLElement | null>(null);\nconst visibleStarterCount = ref(0);\n\nconst starters = computed(() =>\n props.feature.isTemplateEmpty.value\n ? [\n t.ai.starters.emptyWelcome,\n t.ai.starters.emptyLaunch,\n t.ai.starters.emptyNewsletter,\n ]\n : [\n t.ai.starters.filledShorten,\n t.ai.starters.filledFriendlier,\n t.ai.starters.filledDates,\n t.ai.starters.filledCta,\n ],\n);\nconst messages = computed(() => props.feature.messages.value);\nconst isBusy = computed(() => props.feature.isRunning.value);\nconst failureText = computed(() => {\n const failure = props.feature.failure.value;\n return failure\n ? aiErrorMessage(\n failure.error,\n t.ai.errors,\n format,\n uiLocale,\n failure.context,\n )\n : \"\";\n});\n\nconst { pause: pauseReveal, resume: resumeReveal } = useIntervalFn(\n () => {\n if (visibleStarterCount.value < starters.value.length) {\n visibleStarterCount.value++;\n } else {\n pauseReveal();\n }\n },\n 150,\n { immediate: false },\n);\nconst { start: startReveal } = useTimeoutFn(() => resumeReveal(), 100, {\n immediate: false,\n});\n\nwatch(\n () => starters.value.length,\n (count) => {\n pauseReveal();\n visibleStarterCount.value = 0;\n if (count > 0) startReveal();\n },\n { immediate: true },\n);\n\nfunction scrollToBottom(): void {\n void nextTick(() => {\n if (messagesContainer.value) {\n messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight;\n }\n });\n}\n\nwatch(() => messages.value.length, scrollToBottom);\n\n// A failed turn gives its prompt back (D15).\nwatch(\n () =>\n [\n props.feature.failedPrompt.value,\n props.feature.failedAttachments.value,\n ] as const,\n ([prompt, files]) => {\n if (prompt) {\n promptInput.value = prompt;\n attachments.value = [...files];\n }\n },\n { immediate: true },\n);\n\nasync function send(): Promise<void> {\n const prompt = promptInput.value.trim();\n if (!prompt || isBusy.value) return;\n const files = [...attachments.value];\n promptInput.value = \"\";\n attachments.value = [];\n attachmentErrors.value = [];\n scrollToBottom();\n await props.feature.send(prompt, files);\n scrollToBottom();\n}\n\nfunction appliedLabel(item: AiChatItem): string {\n if (item.undone) return t.ai.chat.undone;\n return item.operationCount === 1\n ? t.ai.chat.appliedChange\n : format(t.ai.chat.appliedChanges, { count: item.operationCount });\n}\n\nfunction itemFailure(item: AiChatItem): string {\n return item.failure\n ? aiErrorMessage(\n item.failure.error,\n t.ai.errors,\n format,\n uiLocale,\n item.failure.context,\n )\n : \"\";\n}\n\nfunction toggleUndo(item: AiChatItem): void {\n if (item.undone) void props.feature.redoMessage(item.id);\n else void props.feature.undoMessage(item.id);\n}\n\nfunction chooseStarter(starter: string): void {\n pauseReveal();\n promptInput.value = starter;\n void send();\n}\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.isComposing || event.keyCode === 229) return;\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n void send();\n }\n}\n</script>\n\n<template>\n <div\n class=\"tpl:contents\"\n data-testid=\"ai-chat-dropzone\"\n @dragenter=\"dragEnter\"\n @dragleave=\"dragLeave\"\n @dragover=\"dragOver\"\n @drop=\"drop\"\n >\n <AiPanelShell\n :title=\"t.ai.chat.title\"\n :subtitle=\"t.ai.chat.notice\"\n testid=\"ai-panel-chat\"\n :close-label=\"t.ai.chat.close\"\n @close=\"emit('close')\"\n >\n <template #actions>\n <button\n v-if=\"feature.canClear && messages.length > 0\"\n type=\"button\"\n data-testid=\"ai-chat-new\"\n class=\"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-muted)] tpl:disabled:opacity-40\"\n :aria-label=\"t.ai.chat.newChat\"\n :title=\"t.ai.chat.newChat\"\n :disabled=\"isBusy\"\n @click=\"feature.newChat()\"\n >\n <MessageSquarePlus :size=\"14\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n </template>\n\n <div\n v-if=\"canAttach && dragDepth > 0 && !isBusy\"\n data-testid=\"ai-chat-drop-hint\"\n class=\"tpl:absolute tpl:inset-0 tpl:z-20 tpl:flex tpl:items-center tpl:justify-center tpl:border-2 tpl:border-dashed tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-4 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-primary)] tpl:pointer-events-none\"\n >\n {{ t.ai.chat.dropHint }}\n </div>\n <div\n ref=\"messagesContainer\"\n class=\"tpl:flex-1 tpl:overflow-y-auto tpl:p-4\"\n >\n <div\n v-if=\"feature.isLoadingHistory.value\"\n class=\"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center\"\n >\n <LoaderCircle\n class=\"tpl-spinner tpl:text-[var(--tpl-text-muted)]\"\n :size=\"24\"\n :stroke-width=\"2\"\n aria-hidden=\"true\"\n />\n <p class=\"tpl:text-sm tpl:text-[var(--tpl-text-muted)]\">\n {{ t.ai.chat.loadingHistory }}\n </p>\n </div>\n\n <div\n v-else-if=\"messages.length === 0\"\n class=\"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center\"\n >\n <Sparkles\n :size=\"32\"\n :stroke-width=\"1.5\"\n class=\"tpl:text-[var(--tpl-text-dim)]\"\n aria-hidden=\"true\"\n />\n <p\n class=\"tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.ai.chat.placeholder }}\n </p>\n </div>\n\n <!-- Text is interpolated, never `v-html`. -->\n <div v-else class=\"tpl:flex tpl:flex-col tpl:gap-4\">\n <div\n v-for=\"item in messages\"\n :key=\"item.id\"\n class=\"tpl:flex tpl:flex-col tpl:gap-2\"\n >\n <span\n v-if=\"typeof item.locale === 'string'\"\n data-testid=\"ai-chat-language\"\n class=\"tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ languageName(item.locale) }}\n </span>\n <div\n v-if=\"item.role === 'user'\"\n data-testid=\"ai-chat-prompt\"\n class=\"tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap\"\n style=\"\n background-color: var(--tpl-primary-light);\n color: var(--tpl-text);\n max-width: 85%;\n box-shadow: var(--tpl-shadow);\n \"\n >\n {{ item.text }}\n <span\n v-for=\"(attachment, index) in item.attachments\"\n :key=\"index\"\n data-testid=\"ai-chat-history-attachment\"\n class=\"tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:px-2 tpl:py-1 tpl:text-xs\"\n >\n <FileText\n v-if=\"attachment.kind === 'pdf'\"\n :size=\"12\"\n aria-hidden=\"true\"\n /><Image v-else :size=\"12\" aria-hidden=\"true\" />{{\n attachment.name\n }}\n </span>\n </div>\n\n <div v-else class=\"tpl:flex tpl:flex-col tpl:gap-2\">\n <LoadingTrack\n v-if=\"item.text === '' && item.status === 'streaming'\"\n />\n <div\n v-else-if=\"item.text !== ''\"\n data-testid=\"ai-chat-reply\"\n class=\"tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap\"\n style=\"\n max-width: 85%;\n background-color: var(--tpl-bg);\n color: var(--tpl-text);\n box-shadow: var(--tpl-shadow);\n \"\n >\n {{ item.text }}\n </div>\n <div\n v-if=\"item.operationCount > 0\"\n data-testid=\"ai-chat-applied\"\n class=\"tpl:flex tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n <span>{{ appliedLabel(item) }}</span>\n <button\n v-if=\"item.undone ? item.canRedo : item.canUndo\"\n type=\"button\"\n data-testid=\"ai-chat-undo\"\n :class=\"secondaryBtnCompactClass\"\n :disabled=\"isBusy\"\n @click=\"toggleUndo(item)\"\n >\n <Redo2\n v-if=\"item.undone\"\n :size=\"12\"\n :stroke-width=\"2\"\n aria-hidden=\"true\"\n />\n <Undo2\n v-else\n :size=\"12\"\n :stroke-width=\"2\"\n aria-hidden=\"true\"\n />\n {{ item.undone ? t.ai.chat.redo : t.ai.chat.undo }}\n </button>\n </div>\n <p\n v-if=\"item.failure\"\n role=\"alert\"\n data-testid=\"ai-chat-item-error\"\n class=\"tpl:m-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ itemFailure(item) }}\n </p>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Starter prompts, over the empty state (D21). -->\n <div\n v-if=\"messages.length === 0 && starters.length > 0\"\n class=\"tpl:absolute tpl:right-0 tpl:bottom-0 tpl:left-0 tpl:z-10 tpl:px-3 tpl:pb-3\"\n style=\"\n background-color: color-mix(in srgb, var(--tpl-bg) 50%, transparent);\n backdrop-filter: blur(2px);\n \"\n >\n <div class=\"tpl:flex tpl:flex-col tpl:gap-1.5\">\n <button\n v-for=\"(starter, index) in starters\"\n :key=\"index\"\n type=\"button\"\n data-testid=\"ai-chat-starter\"\n class=\"tpl-starter-btn tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:leading-snug tpl:transition-all tpl:duration-300 tpl:ease-out\"\n :class=\"\n starters.length - 1 - index < visibleStarterCount\n ? 'tpl:translate-y-0 tpl:opacity-100'\n : 'tpl:pointer-events-none tpl:-translate-y-2 tpl:opacity-0'\n \"\n style=\"\n border-color: var(--tpl-border);\n color: var(--tpl-primary);\n background-color: var(--tpl-bg);\n box-shadow: var(--tpl-shadow);\n \"\n @click=\"chooseStarter(starter)\"\n >\n {{ starter }}\n </button>\n </div>\n </div>\n\n <template #footer>\n <div class=\"tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]\">\n <template v-if=\"canAttach\">\n <input\n ref=\"fileInput\"\n data-testid=\"ai-chat-files\"\n type=\"file\"\n multiple\n accept=\"image/png,image/jpeg,image/webp,image/gif,application/pdf\"\n hidden\n :disabled=\"isBusy\"\n @change=\"picked\"\n />\n <div\n v-if=\"attachments.length\"\n class=\"tpl:mb-2 tpl:flex tpl:flex-wrap tpl:gap-1\"\n >\n <span\n v-for=\"(file, index) in attachments\"\n :key=\"index\"\n data-testid=\"ai-chat-attachment\"\n class=\"tpl:flex tpl:max-w-full tpl:items-center tpl:gap-1 tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text)]\"\n >\n <FileText\n v-if=\"file.type === 'application/pdf'\"\n :size=\"12\"\n aria-hidden=\"true\"\n /><Image v-else :size=\"12\" aria-hidden=\"true\" />\n <span class=\"tpl:truncate\">{{ file.name }}</span>\n <button\n type=\"button\"\n :aria-label=\"\n format(t.ai.chat.removeAttachment, { name: file.name })\n \"\n :disabled=\"isBusy\"\n class=\"tpl:shrink-0 tpl:rounded tpl:p-0.5 tpl:disabled:opacity-40\"\n @click=\"removeAttachment(index)\"\n >\n <X :size=\"12\" aria-hidden=\"true\" />\n </button>\n </span>\n </div>\n <p\n v-if=\"attachments.length\"\n class=\"tpl:mb-2 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.ai.import.placeholderNote }}\n </p>\n <div\n aria-live=\"polite\"\n class=\"tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n <p\n v-for=\"(error, index) in attachmentErrors\"\n :key=\"index\"\n class=\"tpl:mb-2\"\n >\n {{ error }}\n </p>\n </div>\n </template>\n <div\n v-if=\"feature.keptYourVersion.value\"\n role=\"status\"\n class=\"tpl:mb-2 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n <p>{{ t.ai.chat.keptYourVersion }}</p>\n <button\n type=\"button\"\n :disabled=\"isBusy\"\n :class=\"secondaryBtnCompactClass\"\n @click=\"feature.reloadTemplate()\"\n >\n {{ t.ai.chat.reload }}\n </button>\n </div>\n <div\n v-if=\"failureText\"\n role=\"alert\"\n data-testid=\"ai-chat-error\"\n class=\"tpl:mx-3 tpl:mb-2 tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs\"\n style=\"\n background-color: var(--tpl-danger-light);\n color: var(--tpl-danger);\n \"\n >\n <CircleAlert\n :size=\"14\"\n :stroke-width=\"2\"\n class=\"tpl:mt-0.5 tpl:shrink-0\"\n aria-hidden=\"true\"\n />\n <span>{{ failureText }}</span>\n </div>\n <div\n class=\"tpl-ai-input-wrapper tpl-focus-ring-host tpl:flex tpl:flex-col tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]\"\n >\n <p\n v-if=\"editor?.activeLocale?.value\"\n data-testid=\"ai-active-language\"\n class=\"tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]\"\n >\n {{\n format(t.localization.aiActiveLanguage, {\n language: languageName(editor.activeLocale.value),\n })\n }}\n </p>\n <textarea\n ref=\"composer\"\n v-model=\"promptInput\"\n data-testid=\"ai-chat-input\"\n class=\"tpl:max-h-32 tpl:min-h-[44px] tpl:w-full tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-sm tpl:outline-none tpl:text-[var(--tpl-text)]\"\n :placeholder=\"t.ai.chat.inputPlaceholder\"\n :aria-label=\"t.ai.chat.inputPlaceholder\"\n :disabled=\"isBusy\"\n maxlength=\"4000\"\n rows=\"3\"\n @keydown=\"onKeydown\"\n />\n <div class=\"tpl:flex tpl:items-center tpl:justify-between\">\n <button\n v-if=\"canAttach\"\n type=\"button\"\n :aria-label=\"t.ai.chat.attach\"\n :title=\"t.ai.chat.attach\"\n :disabled=\"isBusy\"\n class=\"tpl:-ml-1.5 tpl:shrink-0 tpl:rounded-md tpl:p-1.5 tpl:text-[var(--tpl-text-muted)] tpl:disabled:opacity-40\"\n @click=\"fileInput?.click()\"\n >\n <Paperclip :size=\"16\" aria-hidden=\"true\" />\n </button>\n <button\n v-if=\"isBusy\"\n type=\"button\"\n data-testid=\"ai-chat-stop\"\n class=\"tpl-ai-send-btn tpl:ml-auto tpl:-mr-1.5 tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:text-[var(--tpl-primary)]\"\n :aria-label=\"t.ai.chat.stop\"\n :title=\"t.ai.chat.stop\"\n @click=\"feature.stop()\"\n >\n <Square :size=\"16\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n <button\n v-else\n type=\"button\"\n data-testid=\"ai-chat-send\"\n class=\"tpl-ai-send-btn tpl:ml-auto tpl:-mr-1.5 tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]\"\n :aria-label=\"t.ai.chat.send\"\n :title=\"t.ai.chat.send\"\n :disabled=\"!promptInput.trim()\"\n @click=\"send\"\n >\n <Send :size=\"16\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n <p\n class=\"tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.ai.chat.disclaimer }}\n </p>\n </div>\n </template>\n </AiPanelShell>\n </div>\n</template>\n\n<style scoped>\n.tpl-ai-input-wrapper:focus-within {\n border-color: var(--tpl-primary);\n box-shadow: var(--tpl-ring);\n}\n\n.tpl-ai-send-btn:not(:disabled):hover {\n transform: scale(1.05);\n}\n\n.tpl-starter-btn:hover {\n border-color: var(--tpl-primary) !important;\n background-color: var(--tpl-primary-light) !important;\n}\n</style>\n","<script setup lang=\"ts\">\nimport {\n CircleAlert,\n FileText,\n Image,\n Paperclip,\n X,\n LoaderCircle,\n MessageSquarePlus,\n Redo2,\n Send,\n Sparkles,\n Square,\n Undo2,\n} from \"@lucide/vue\";\nimport { computed, inject, nextTick, ref, watch } from \"vue\";\nimport { useIntervalFn, useTimeoutFn } from \"@vueuse/core\";\nimport LoadingTrack from \"../LoadingTrack.vue\";\nimport AiPanelShell from \"./AiPanelShell.vue\";\nimport type {\n AiChatItem,\n UseAiFeatureReturn,\n} from \"../../composables/useAiFeature\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport { secondaryBtnCompactClass } from \"../../constants/styleConstants\";\nimport { EDITOR_KEY, UI_LOCALE_KEY } from \"../../keys\";\nimport { validateChatAttachments } from \"../../utils/aiAttachments\";\nimport { languageName } from \"../../utils/languageName\";\nimport { aiErrorMessage } from \"../../utils/aiErrors\";\n\nconst props = defineProps<{ feature: UseAiFeatureReturn }>();\nconst emit = defineEmits<{ (e: \"close\"): void }>();\n\nconst { t, format } = useI18n();\nconst editor = inject(EDITOR_KEY, null);\nconst uiLocale = inject(UI_LOCALE_KEY, undefined);\n\nconst promptInput = ref(\"\");\nconst composer = ref<HTMLTextAreaElement | null>(null);\nconst fileInput = ref<HTMLInputElement | null>(null);\nconst attachments = ref<File[]>([]);\nconst attachmentErrors = ref<string[]>([]);\nconst dragDepth = ref(0);\nwatch(\n () => props.feature.templateSession.value,\n () => {\n promptInput.value = \"\";\n attachments.value = [];\n attachmentErrors.value = [];\n dragDepth.value = 0;\n },\n { flush: \"sync\" },\n);\nconst canAttach = computed(() => props.feature.has(\"chatAttachments\"));\nfunction attach(files: File[]): void {\n const result = validateChatAttachments(attachments.value, files);\n attachments.value = result.accepted;\n const keys = {\n tooMany: \"attachTooMany\",\n tooLarge: \"attachTooLarge\",\n totalTooLarge: \"attachTotalTooLarge\",\n wrongType: \"attachWrongType\",\n } as const;\n attachmentErrors.value = result.errors.map((error) =>\n format(t.ai.chat[keys[error.reason]], { name: error.name }),\n );\n}\nfunction picked(event: Event): void {\n const input = event.target as HTMLInputElement;\n if (!isBusy.value && canAttach.value) attach(Array.from(input.files ?? []));\n input.value = \"\";\n}\nfunction removeAttachment(index: number): void {\n if (isBusy.value) return;\n attachments.value.splice(index, 1);\n attachmentErrors.value = [];\n}\nfunction isFileDrag(event: DragEvent): boolean {\n return Array.from(event.dataTransfer?.types ?? []).includes(\"Files\");\n}\nfunction dragEnter(event: DragEvent): void {\n if (!canAttach.value || isBusy.value || !isFileDrag(event)) return;\n event.preventDefault();\n dragDepth.value++;\n}\nfunction dragLeave(event: DragEvent): void {\n if (!isFileDrag(event)) return;\n dragDepth.value = Math.max(0, dragDepth.value - 1);\n}\nfunction dragOver(event: DragEvent): void {\n if (canAttach.value && isFileDrag(event)) event.preventDefault();\n}\nfunction drop(event: DragEvent): void {\n dragDepth.value = 0;\n if (!canAttach.value || !isFileDrag(event)) return;\n event.preventDefault();\n if (!isBusy.value) attach(Array.from(event.dataTransfer?.files ?? []));\n}\nwatch(\n () => props.feature.importQueue.value,\n (files) => {\n if (!canAttach.value || !files.length) return;\n attach(files);\n if (!promptInput.value.trim()) promptInput.value = t.ai.import.prompt;\n props.feature.importQueue.value = [];\n void nextTick(() => composer.value?.focus());\n },\n { immediate: true },\n);\nconst messagesContainer = ref<HTMLElement | null>(null);\nconst visibleStarterCount = ref(0);\n\nconst starters = computed(() =>\n props.feature.isTemplateEmpty.value\n ? [\n t.ai.starters.emptyWelcome,\n t.ai.starters.emptyLaunch,\n t.ai.starters.emptyNewsletter,\n ]\n : [\n t.ai.starters.filledShorten,\n t.ai.starters.filledFriendlier,\n t.ai.starters.filledDates,\n t.ai.starters.filledCta,\n ],\n);\nconst messages = computed(() => props.feature.messages.value);\nconst isBusy = computed(() => props.feature.isRunning.value);\nconst failureText = computed(() => {\n const failure = props.feature.failure.value;\n return failure\n ? aiErrorMessage(\n failure.error,\n t.ai.errors,\n format,\n uiLocale,\n failure.context,\n )\n : \"\";\n});\n\nconst { pause: pauseReveal, resume: resumeReveal } = useIntervalFn(\n () => {\n if (visibleStarterCount.value < starters.value.length) {\n visibleStarterCount.value++;\n } else {\n pauseReveal();\n }\n },\n 150,\n { immediate: false },\n);\nconst { start: startReveal } = useTimeoutFn(() => resumeReveal(), 100, {\n immediate: false,\n});\n\nwatch(\n () => starters.value.length,\n (count) => {\n pauseReveal();\n visibleStarterCount.value = 0;\n if (count > 0) startReveal();\n },\n { immediate: true },\n);\n\nfunction scrollToBottom(): void {\n void nextTick(() => {\n if (messagesContainer.value) {\n messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight;\n }\n });\n}\n\nwatch(() => messages.value.length, scrollToBottom);\n\n// A failed turn gives its prompt back (D15).\nwatch(\n () =>\n [\n props.feature.failedPrompt.value,\n props.feature.failedAttachments.value,\n ] as const,\n ([prompt, files]) => {\n if (prompt) {\n promptInput.value = prompt;\n attachments.value = [...files];\n }\n },\n { immediate: true },\n);\n\nasync function send(): Promise<void> {\n const prompt = promptInput.value.trim();\n if (!prompt || isBusy.value) return;\n const files = [...attachments.value];\n promptInput.value = \"\";\n attachments.value = [];\n attachmentErrors.value = [];\n scrollToBottom();\n await props.feature.send(prompt, files);\n scrollToBottom();\n}\n\nfunction appliedLabel(item: AiChatItem): string {\n if (item.undone) return t.ai.chat.undone;\n return item.operationCount === 1\n ? t.ai.chat.appliedChange\n : format(t.ai.chat.appliedChanges, { count: item.operationCount });\n}\n\nfunction itemFailure(item: AiChatItem): string {\n return item.failure\n ? aiErrorMessage(\n item.failure.error,\n t.ai.errors,\n format,\n uiLocale,\n item.failure.context,\n )\n : \"\";\n}\n\nfunction toggleUndo(item: AiChatItem): void {\n if (item.undone) void props.feature.redoMessage(item.id);\n else void props.feature.undoMessage(item.id);\n}\n\nfunction chooseStarter(starter: string): void {\n pauseReveal();\n promptInput.value = starter;\n void send();\n}\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.isComposing || event.keyCode === 229) return;\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n void send();\n }\n}\n</script>\n\n<template>\n <div\n class=\"tpl:contents\"\n data-testid=\"ai-chat-dropzone\"\n @dragenter=\"dragEnter\"\n @dragleave=\"dragLeave\"\n @dragover=\"dragOver\"\n @drop=\"drop\"\n >\n <AiPanelShell\n :title=\"t.ai.chat.title\"\n :subtitle=\"t.ai.chat.notice\"\n testid=\"ai-panel-chat\"\n :close-label=\"t.ai.chat.close\"\n @close=\"emit('close')\"\n >\n <template #actions>\n <button\n v-if=\"feature.canClear && messages.length > 0\"\n type=\"button\"\n data-testid=\"ai-chat-new\"\n class=\"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-muted)] tpl:disabled:opacity-40\"\n :aria-label=\"t.ai.chat.newChat\"\n :title=\"t.ai.chat.newChat\"\n :disabled=\"isBusy\"\n @click=\"feature.newChat()\"\n >\n <MessageSquarePlus :size=\"14\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n </template>\n\n <div\n v-if=\"canAttach && dragDepth > 0 && !isBusy\"\n data-testid=\"ai-chat-drop-hint\"\n class=\"tpl:absolute tpl:inset-0 tpl:z-20 tpl:flex tpl:items-center tpl:justify-center tpl:border-2 tpl:border-dashed tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-4 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-primary)] tpl:pointer-events-none\"\n >\n {{ t.ai.chat.dropHint }}\n </div>\n <div\n ref=\"messagesContainer\"\n class=\"tpl:flex-1 tpl:overflow-y-auto tpl:p-4\"\n >\n <div\n v-if=\"feature.isLoadingHistory.value\"\n class=\"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center\"\n >\n <LoaderCircle\n class=\"tpl-spinner tpl:text-[var(--tpl-text-muted)]\"\n :size=\"24\"\n :stroke-width=\"2\"\n aria-hidden=\"true\"\n />\n <p class=\"tpl:text-sm tpl:text-[var(--tpl-text-muted)]\">\n {{ t.ai.chat.loadingHistory }}\n </p>\n </div>\n\n <div\n v-else-if=\"messages.length === 0\"\n class=\"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center\"\n >\n <Sparkles\n :size=\"32\"\n :stroke-width=\"1.5\"\n class=\"tpl:text-[var(--tpl-text-dim)]\"\n aria-hidden=\"true\"\n />\n <p\n class=\"tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.ai.chat.placeholder }}\n </p>\n </div>\n\n <!-- Text is interpolated, never `v-html`. -->\n <div v-else class=\"tpl:flex tpl:flex-col tpl:gap-4\">\n <div\n v-for=\"item in messages\"\n :key=\"item.id\"\n class=\"tpl:flex tpl:flex-col tpl:gap-2\"\n >\n <span\n v-if=\"typeof item.locale === 'string'\"\n data-testid=\"ai-chat-language\"\n class=\"tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ languageName(item.locale) }}\n </span>\n <div\n v-if=\"item.role === 'user'\"\n data-testid=\"ai-chat-prompt\"\n class=\"tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap\"\n style=\"\n background-color: var(--tpl-primary-light);\n color: var(--tpl-text);\n max-width: 85%;\n box-shadow: var(--tpl-shadow);\n \"\n >\n {{ item.text }}\n <span\n v-for=\"(attachment, index) in item.attachments\"\n :key=\"index\"\n data-testid=\"ai-chat-history-attachment\"\n class=\"tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:px-2 tpl:py-1 tpl:text-xs\"\n >\n <FileText\n v-if=\"attachment.kind === 'pdf'\"\n :size=\"12\"\n aria-hidden=\"true\"\n /><Image v-else :size=\"12\" aria-hidden=\"true\" />{{\n attachment.name\n }}\n </span>\n </div>\n\n <div v-else class=\"tpl:flex tpl:flex-col tpl:gap-2\">\n <LoadingTrack\n v-if=\"item.text === '' && item.status === 'streaming'\"\n />\n <div\n v-else-if=\"item.text !== ''\"\n data-testid=\"ai-chat-reply\"\n class=\"tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap\"\n style=\"\n max-width: 85%;\n background-color: var(--tpl-bg);\n color: var(--tpl-text);\n box-shadow: var(--tpl-shadow);\n \"\n >\n {{ item.text }}\n </div>\n <div\n v-if=\"item.operationCount > 0\"\n data-testid=\"ai-chat-applied\"\n class=\"tpl:flex tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n <span>{{ appliedLabel(item) }}</span>\n <button\n v-if=\"item.undone ? item.canRedo : item.canUndo\"\n type=\"button\"\n data-testid=\"ai-chat-undo\"\n :class=\"secondaryBtnCompactClass\"\n :disabled=\"isBusy\"\n @click=\"toggleUndo(item)\"\n >\n <Redo2\n v-if=\"item.undone\"\n :size=\"12\"\n :stroke-width=\"2\"\n aria-hidden=\"true\"\n />\n <Undo2\n v-else\n :size=\"12\"\n :stroke-width=\"2\"\n aria-hidden=\"true\"\n />\n {{ item.undone ? t.ai.chat.redo : t.ai.chat.undo }}\n </button>\n </div>\n <p\n v-if=\"item.failure\"\n role=\"alert\"\n data-testid=\"ai-chat-item-error\"\n class=\"tpl:m-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ itemFailure(item) }}\n </p>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Starter prompts, over the empty state (D21). -->\n <div\n v-if=\"messages.length === 0 && starters.length > 0\"\n class=\"tpl:absolute tpl:right-0 tpl:bottom-0 tpl:left-0 tpl:z-10 tpl:px-3 tpl:pb-3\"\n style=\"\n background-color: color-mix(in srgb, var(--tpl-bg) 50%, transparent);\n backdrop-filter: blur(2px);\n \"\n >\n <div class=\"tpl:flex tpl:flex-col tpl:gap-1.5\">\n <button\n v-for=\"(starter, index) in starters\"\n :key=\"index\"\n type=\"button\"\n data-testid=\"ai-chat-starter\"\n class=\"tpl-starter-btn tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:leading-snug tpl:transition-all tpl:duration-300 tpl:ease-out\"\n :class=\"\n starters.length - 1 - index < visibleStarterCount\n ? 'tpl:translate-y-0 tpl:opacity-100'\n : 'tpl:pointer-events-none tpl:-translate-y-2 tpl:opacity-0'\n \"\n style=\"\n border-color: var(--tpl-border);\n color: var(--tpl-primary);\n background-color: var(--tpl-bg);\n box-shadow: var(--tpl-shadow);\n \"\n @click=\"chooseStarter(starter)\"\n >\n {{ starter }}\n </button>\n </div>\n </div>\n\n <template #footer>\n <div class=\"tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]\">\n <template v-if=\"canAttach\">\n <input\n ref=\"fileInput\"\n data-testid=\"ai-chat-files\"\n type=\"file\"\n multiple\n accept=\"image/png,image/jpeg,image/webp,image/gif,application/pdf\"\n hidden\n :disabled=\"isBusy\"\n @change=\"picked\"\n />\n <div\n v-if=\"attachments.length\"\n class=\"tpl:mb-2 tpl:flex tpl:flex-wrap tpl:gap-1\"\n >\n <span\n v-for=\"(file, index) in attachments\"\n :key=\"index\"\n data-testid=\"ai-chat-attachment\"\n class=\"tpl:flex tpl:max-w-full tpl:items-center tpl:gap-1 tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text)]\"\n >\n <FileText\n v-if=\"file.type === 'application/pdf'\"\n :size=\"12\"\n aria-hidden=\"true\"\n /><Image v-else :size=\"12\" aria-hidden=\"true\" />\n <span class=\"tpl:truncate\">{{ file.name }}</span>\n <button\n type=\"button\"\n :aria-label=\"\n format(t.ai.chat.removeAttachment, { name: file.name })\n \"\n :disabled=\"isBusy\"\n class=\"tpl:shrink-0 tpl:rounded tpl:p-0.5 tpl:disabled:opacity-40\"\n @click=\"removeAttachment(index)\"\n >\n <X :size=\"12\" aria-hidden=\"true\" />\n </button>\n </span>\n </div>\n <p\n v-if=\"attachments.length\"\n class=\"tpl:mb-2 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.ai.import.placeholderNote }}\n </p>\n <div\n aria-live=\"polite\"\n class=\"tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n <p\n v-for=\"(error, index) in attachmentErrors\"\n :key=\"index\"\n class=\"tpl:mb-2\"\n >\n {{ error }}\n </p>\n </div>\n </template>\n <div\n v-if=\"feature.keptYourVersion.value\"\n role=\"status\"\n class=\"tpl:mb-2 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n <p>{{ t.ai.chat.keptYourVersion }}</p>\n <button\n type=\"button\"\n :disabled=\"isBusy\"\n :class=\"secondaryBtnCompactClass\"\n @click=\"feature.reloadTemplate()\"\n >\n {{ t.ai.chat.reload }}\n </button>\n </div>\n <div\n v-if=\"failureText\"\n role=\"alert\"\n data-testid=\"ai-chat-error\"\n class=\"tpl:mx-3 tpl:mb-2 tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs\"\n style=\"\n background-color: var(--tpl-danger-light);\n color: var(--tpl-danger);\n \"\n >\n <CircleAlert\n :size=\"14\"\n :stroke-width=\"2\"\n class=\"tpl:mt-0.5 tpl:shrink-0\"\n aria-hidden=\"true\"\n />\n <span>{{ failureText }}</span>\n </div>\n <div\n class=\"tpl-ai-input-wrapper tpl-focus-ring-host tpl:flex tpl:flex-col tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]\"\n >\n <p\n v-if=\"editor?.activeLocale?.value\"\n data-testid=\"ai-active-language\"\n class=\"tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]\"\n >\n {{\n format(t.localization.aiActiveLanguage, {\n language: languageName(editor.activeLocale.value),\n })\n }}\n </p>\n <textarea\n ref=\"composer\"\n v-model=\"promptInput\"\n data-testid=\"ai-chat-input\"\n class=\"tpl:max-h-32 tpl:min-h-[44px] tpl:w-full tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-sm tpl:outline-none tpl:text-[var(--tpl-text)]\"\n :placeholder=\"t.ai.chat.inputPlaceholder\"\n :aria-label=\"t.ai.chat.inputPlaceholder\"\n :disabled=\"isBusy\"\n maxlength=\"4000\"\n rows=\"3\"\n @keydown=\"onKeydown\"\n />\n <div class=\"tpl:flex tpl:items-center tpl:justify-between\">\n <button\n v-if=\"canAttach\"\n type=\"button\"\n :aria-label=\"t.ai.chat.attach\"\n :title=\"t.ai.chat.attach\"\n :disabled=\"isBusy\"\n class=\"tpl:-ml-1.5 tpl:shrink-0 tpl:rounded-md tpl:p-1.5 tpl:text-[var(--tpl-text-muted)] tpl:disabled:opacity-40\"\n @click=\"fileInput?.click()\"\n >\n <Paperclip :size=\"16\" aria-hidden=\"true\" />\n </button>\n <button\n v-if=\"isBusy\"\n type=\"button\"\n data-testid=\"ai-chat-stop\"\n class=\"tpl-ai-send-btn tpl:ml-auto tpl:-mr-1.5 tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:text-[var(--tpl-primary)]\"\n :aria-label=\"t.ai.chat.stop\"\n :title=\"t.ai.chat.stop\"\n @click=\"feature.stop()\"\n >\n <Square :size=\"16\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n <button\n v-else\n type=\"button\"\n data-testid=\"ai-chat-send\"\n class=\"tpl-ai-send-btn tpl:ml-auto tpl:-mr-1.5 tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]\"\n :aria-label=\"t.ai.chat.send\"\n :title=\"t.ai.chat.send\"\n :disabled=\"!promptInput.trim()\"\n @click=\"send\"\n >\n <Send :size=\"16\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n <p\n class=\"tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.ai.chat.disclaimer }}\n </p>\n </div>\n </template>\n </AiPanelShell>\n </div>\n</template>\n\n<style scoped>\n.tpl-ai-input-wrapper:focus-within {\n border-color: var(--tpl-primary);\n box-shadow: var(--tpl-ring);\n}\n\n.tpl-ai-send-btn:not(:disabled):hover {\n transform: scale(1.05);\n}\n\n.tpl-starter-btn:hover {\n border-color: var(--tpl-primary) !important;\n background-color: var(--tpl-primary-light) !important;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAWA,IAAM0F,IAAOD;E,kBAIXhF,EAAA,GAAAC,EA2CM,OAAA;GA1CJ,MAAK;GACJ,cAAYiF,EAAA;GACZ,eAAaA,EAAA;GACd,OAAM;;GAGNhF,EA+BM,OA/BNV,GA+BM,CA5BJU,EAcM,OAdNT,GAcM,CAbJS,EAKM,OALNR,GAKM,CAFJS,EAA4DC,EA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EN,EAAA8C,EAAA,GAAA;;MAHC,MAAM;MACN,gBAAc;MACf,eAAY;K,OAEdlD,EAAA,GAAAU,EAKEN,EAAA2C,EAAA,GAAA;;MAHC,MAAM;MACN,gBAAc;MACf,eAAY;K,KACZhC,EAAA,MACFJ,EAAG2J,EAAK,SAASlK,EAAAuI,CAAA,CAAC,CAAC,GAAG,KAAK,OAAOvI,EAAAuI,CAAA,CAAC,CAAC,GAAG,KAAK,IAAI,GAAA,CAAA,C;KAI5C2B,EAAK,WADbtK,EAAA,GAAAC,EAOI,KAPJoG,IAOI1F,EADC4J,GAAYD,CAAI,CAAA,GAAA,CAAA,K;;IASrBX,EAAA,MAAS,WAAM,KAAUD,EAAA,MAAS,SAAM,KADhD1J,EAAA,GAAAC,EA+BM,OA/BNqG,IA+BM,CAvBJ/F,EAsBM,OAtBNgG,IAsBM,EArBJvG,EAAA,EAAA,GAAAC,EAoBSO,GAAA,MAAAC,EAnBoBiJ,EAAA,QAAnB,GAAS,OADnB1J,EAAA,GAAAC,EAoBS,UAAA;KAlBN,KAAKiJ;KACN,MAAK;KACL,eAAY;KACZ,OAAKtI,EAAA,CAAC,kMACiB8I,EAAA,MAAS,SAAM,IAAOR,IAAQO,EAAA,Q;KAKrD,OAAA;MAAA,gBAAA;MAAAzD,OAAA;MAAA,oBAAA;MAAA,cAAA;KAAA;KAMC,UAAK,MAAEyE,GAAcC,CAAO;IAE1B,GAAA/J,EAAA+J,CAAO,GAAA,IAAAlE,EAAA,E"}
@@ -1,32 +0,0 @@
1
- import { B as e, C as t, F as n, G as r, S as i, d as a, g as o, h as s, n as c, p as l } from "./draggable-DepKdldn.js";
2
- import { t as u } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
3
- // src/components/ai/AiPanels.vue
4
- var d = /*#__PURE__*/ u(/* @__PURE__ */ t({
5
- __name: "AiPanels",
6
- props: { feature: {} },
7
- setup(t) {
8
- let u = i(() => import("./AiChatPanel-C2gpq4kP.js")), d = t, f = { chat: u }, p = l(() => {
9
- let e = d.feature.panel.value;
10
- return e !== null && e in f ? f[e] : null;
11
- });
12
- return (i, l) => (n(), s(c, {
13
- "enter-active-class": "tpl-ai-slide-enter-active",
14
- "enter-from-class": "tpl:translate-x-full",
15
- "enter-to-class": "tpl:translate-x-0",
16
- "leave-active-class": "tpl-ai-slide-leave-active",
17
- "leave-from-class": "tpl:translate-x-0",
18
- "leave-to-class": "tpl:translate-x-full",
19
- mode: "out-in"
20
- }, {
21
- default: r(() => [(n(), s(a, null, [p.value ? (n(), s(e(p.value), {
22
- key: t.feature.panel.value ?? "none",
23
- feature: t.feature,
24
- onClose: l[0] ||= (e) => t.feature.close()
25
- }, null, 40, ["feature"])) : o("", !0)], 1024))]),
26
- _: 1
27
- }));
28
- }
29
- }), [["__scopeId", "data-v-3d8e197c"]]);
30
- export { d as default };
31
-
32
- //# sourceMappingURL=AiPanels-Cx3PE2mE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AiPanels-Cx3PE2mE.js","names":["_openBlock","_createBlock","_Transition","_withCtx","_KeepAlive","_resolveDynamicComponent","_createCommentVNode","_sfc_main","resolveDynamicComponent","defineComponent","openBlock","withCtx","defineAsyncComponent","KeepAlive","createCommentVNode","createBlock","Transition","computed","_plugin_vue_export_helper_default","AiPanels_default","AiChatPanel","props","__props","PANELS","current","panel","_cache"],"sources":["../../../src/components/ai/AiPanels.vue","../../../src/components/ai/AiPanels.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, defineAsyncComponent } from \"vue\";\nimport type { UseAiFeatureReturn } from \"../../composables/useAiFeature\";\n\nconst AiChatPanel = defineAsyncComponent(() => import(\"./AiChatPanel.vue\"));\n\nconst props = defineProps<{ feature: UseAiFeatureReturn }>();\n\nconst PANELS = {\n chat: AiChatPanel,\n} as const;\n\nconst current = computed(() => {\n const panel = props.feature.panel.value;\n return panel !== null && panel in PANELS\n ? PANELS[panel as keyof typeof PANELS]\n : null;\n});\n</script>\n\n<template>\n <Transition\n enter-active-class=\"tpl-ai-slide-enter-active\"\n enter-from-class=\"tpl:translate-x-full\"\n enter-to-class=\"tpl:translate-x-0\"\n leave-active-class=\"tpl-ai-slide-leave-active\"\n leave-from-class=\"tpl:translate-x-0\"\n leave-to-class=\"tpl:translate-x-full\"\n mode=\"out-in\"\n >\n <!-- Keep chat state when the panel closes. -->\n <KeepAlive>\n <component\n :is=\"current\"\n v-if=\"current\"\n :key=\"feature.panel.value ?? 'none'\"\n :feature=\"feature\"\n @close=\"feature.close()\"\n />\n </KeepAlive>\n </Transition>\n</template>\n\n<style scoped>\n.tpl-ai-slide-enter-active {\n transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.tpl-ai-slide-leave-active {\n transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tpl-ai-slide-enter-active,\n .tpl-ai-slide-leave-active {\n transition: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, defineAsyncComponent } from \"vue\";\nimport type { UseAiFeatureReturn } from \"../../composables/useAiFeature\";\n\nconst AiChatPanel = defineAsyncComponent(() => import(\"./AiChatPanel.vue\"));\n\nconst props = defineProps<{ feature: UseAiFeatureReturn }>();\n\nconst PANELS = {\n chat: AiChatPanel,\n} as const;\n\nconst current = computed(() => {\n const panel = props.feature.panel.value;\n return panel !== null && panel in PANELS\n ? PANELS[panel as keyof typeof PANELS]\n : null;\n});\n</script>\n\n<template>\n <Transition\n enter-active-class=\"tpl-ai-slide-enter-active\"\n enter-from-class=\"tpl:translate-x-full\"\n enter-to-class=\"tpl:translate-x-0\"\n leave-active-class=\"tpl-ai-slide-leave-active\"\n leave-from-class=\"tpl:translate-x-0\"\n leave-to-class=\"tpl:translate-x-full\"\n mode=\"out-in\"\n >\n <!-- Keep chat state when the panel closes. -->\n <KeepAlive>\n <component\n :is=\"current\"\n v-if=\"current\"\n :key=\"feature.panel.value ?? 'none'\"\n :feature=\"feature\"\n @close=\"feature.close()\"\n />\n </KeepAlive>\n </Transition>\n</template>\n\n<style scoped>\n.tpl-ai-slide-enter-active {\n transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.tpl-ai-slide-leave-active {\n transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tpl-ai-slide-enter-active,\n .tpl-ai-slide-leave-active {\n transition: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;EAIA,IAAMoB,IAAcR,QAA2B,OAAO,4BAAoB,GAEpES,IAAQC,GAERC,IAAS,EACb,MAAMH,EACR,GAEMI,IAAUP,QAAe;GAC7B,IAAMQ,IAAQJ,EAAM,QAAQ,MAAM;GAClC,OAAOI,MAAU,QAAQA,KAASF,IAC9BA,EAAOE,KACP;EACN,CAAC;E,kBAICzB,EAAA,GAAAC,EAmBaC,GAAA;GAlBX,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;GACf,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;GACf,MAAK;;GAGL,SAAAC,QAQY,EARZH,EAAA,GAAAC,EAQYG,GAAA,MAAA,CALFoB,EAAA,SAFRxB,EAAA,GAAAC,EAMEI,EALKmB,EAAA,KAAO,GAAA;IAEX,KAAKF,EAAA,QAAQ,MAAM,SAAK;IACxB,SAASA,EAAA;IACT,SAAK,AAAAI,EAAA,QAAA,MAAEJ,EAAA,QAAQ,MAAK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AiRewriteMenu-CnkyjPEu.js","names":["_openBlock","_createElementBlock","_createElementVNode","_unref","_createVNode","_createTextVNode","_toDisplayString","_Fragment","_normalizeClass","_renderList","ToolbarSelect","_withDirectives","_vModelText","_createCommentVNode","_sfc_main","defineComponent","openBlock","watch","withDirectives","renderList","onBeforeUnmount","inject","createElementBlock","createTextVNode","unref","normalizeClass","createCommentVNode","createBaseVNode","toDisplayString","vModelText","computed","ref","Fragment","createVNode","SYNTAX_PRESETS","SdkError","Sparkles","Square","WandSparkles","Languages","X","ToolbarSelect_default","useI18n","secondaryBtnCompactClass","primaryBtnCompactClass","MERGE_TAG_SYNTAX_KEY","MERGE_TAGS_KEY","NO_MERGE_TAGS","UI_LOCALE_KEY","AI_FEATURE_KEY","requireInject","EDITOR_KEY","aiErrorMessage","rewriteLanguageOptions","htmlToPlainText","normalizeMergeTagsInHtml","sanitizeHtml","_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","AiRewriteMenu_default","props","__props","feature","mergeTags","syntax","uiLocale","templateEditor","PRESETS","languages","isOpen","language","instruction","isRewriting","streamed","raw","failure","controller","generation","result","streamingPreview","errorText","t","format","stop","activeController","reset","close","toggle","run","text","preset","html","requestController","token","answer","chunk","error","replace","_cache","$event"],"sources":["../../../src/components/ai/AiRewriteMenu.vue","../../../src/components/ai/AiRewriteMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from \"@tiptap/core\";\nimport {\n SdkError,\n SYNTAX_PRESETS,\n type AiRewritePreset,\n} from \"@templatical/types\";\nimport { Languages, Sparkles, Square, WandSparkles, X } from \"@lucide/vue\";\nimport { computed, inject, onBeforeUnmount, ref, watch } from \"vue\";\nimport ToolbarSelect from \"../toolbar/ToolbarSelect.vue\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport {\n primaryBtnCompactClass,\n secondaryBtnCompactClass,\n} from \"../../constants/styleConstants\";\nimport {\n AI_FEATURE_KEY,\n EDITOR_KEY,\n MERGE_TAGS_KEY,\n MERGE_TAG_SYNTAX_KEY,\n NO_MERGE_TAGS,\n UI_LOCALE_KEY,\n requireInject,\n} from \"../../keys\";\nimport { aiErrorMessage } from \"../../utils/aiErrors\";\nimport {\n htmlToPlainText,\n rewriteLanguageOptions,\n} from \"../../utils/aiRewritePreview\";\nimport { normalizeMergeTagsInHtml } from \"../../utils/normalizeMergeTagMarkup\";\nimport { sanitizeHtml } from \"../../utils/sanitizeHtml\";\n\n/**\n * Rewrite with AI, in the paragraph text toolbar: a preset or the user's own\n * instruction, streamed into a preview labelled as an AI suggestion. Replace\n * puts it into the paragraph through TipTap, so it is the user's own edit\n * (an ordinary change, on the normal undo stack, a normal batch with\n * collaboration). Rendered inside `.tpl-text-toolbar` and never teleported:\n * the paragraph leaves edit mode on a mousedown outside the toolbar.\n */\nconst props = defineProps<{ editor: Editor }>();\n\nconst { t, format } = useI18n();\nconst feature = requireInject(AI_FEATURE_KEY, \"AiRewriteMenu\");\nconst mergeTags = inject(MERGE_TAGS_KEY, NO_MERGE_TAGS);\nconst syntax = inject(MERGE_TAG_SYNTAX_KEY, SYNTAX_PRESETS.liquid);\nconst uiLocale = inject(UI_LOCALE_KEY, undefined);\nconst templateEditor = inject(EDITOR_KEY, null);\n\nconst PRESETS: Exclude<AiRewritePreset, \"translate\">[] = [\n \"shorten\",\n \"expand\",\n \"friendlier\",\n \"formal\",\n \"fixGrammar\",\n];\nconst languages = rewriteLanguageOptions(uiLocale);\n\nconst isOpen = ref(false);\nconst language = ref(languages[0].value);\nconst instruction = ref(\"\");\nconst isRewriting = ref(false);\nconst streamed = ref(\"\");\nconst raw = ref<string | null>(null);\nconst failure = ref<unknown>(null);\nlet controller: AbortController | null = null;\nlet generation = 0;\n\n/** The finished rewrite as the editor will hold it: tags, then sanitized (D22). */\nconst result = computed(() =>\n raw.value === null\n ? null\n : sanitizeHtml(\n normalizeMergeTagsInHtml(raw.value, mergeTags.value, syntax),\n ),\n);\nconst streamingPreview = computed(() => htmlToPlainText(streamed.value));\nconst errorText = computed(() =>\n failure.value\n ? aiErrorMessage(failure.value, t.ai.errors, format, uiLocale)\n : \"\",\n);\n\nfunction stop(): void {\n generation++;\n const activeController = controller;\n controller = null;\n isRewriting.value = false;\n activeController?.abort();\n}\n\nfunction reset(): void {\n stop();\n streamed.value = \"\";\n raw.value = null;\n failure.value = null;\n}\n\nfunction close(): void {\n reset();\n isOpen.value = false;\n}\n\nfunction toggle(): void {\n if (isOpen.value) close();\n else isOpen.value = true;\n}\n\nasync function run(preset: AiRewritePreset | null): Promise<void> {\n const text = instruction.value.trim();\n if (\n isRewriting.value ||\n (preset === null && text === \"\") ||\n (preset === \"translate\" && language.value === \"\")\n )\n return;\n reset();\n const html = props.editor.getHTML();\n if (Array.from(html).length > 20_000) {\n failure.value = new SdkError(t.ai.rewrite.tooLarge, 413);\n return;\n }\n const requestController = new AbortController();\n const token = ++generation;\n controller = requestController;\n isRewriting.value = true;\n try {\n const answer = await feature.rewrite(\n {\n html,\n preset,\n language: preset === \"translate\" ? language.value : null,\n instruction: text === \"\" ? null : text,\n },\n (chunk) => {\n if (token !== generation) return;\n streamed.value += chunk;\n },\n requestController.signal,\n );\n if (token !== generation) return;\n raw.value = answer.html;\n } catch (error) {\n if (\n token === generation &&\n !(error instanceof Error && error.name === \"AbortError\")\n )\n failure.value = error;\n } finally {\n if (token === generation) {\n isRewriting.value = false;\n controller = null;\n }\n }\n}\n\nfunction replace(): void {\n if (result.value === null) return;\n props.editor\n .chain()\n .focus()\n .setContent(result.value, { emitUpdate: true })\n .run();\n close();\n}\n\nif (templateEditor?.activeLocale)\n watch(templateEditor.activeLocale, close, { flush: \"sync\" });\nonBeforeUnmount(stop);\n</script>\n\n<template>\n <div class=\"tpl:relative tpl:flex tpl:items-center\">\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-trigger\"\n class=\"tpl:flex tpl:h-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)] tpl:transition-all tpl:hover:bg-[var(--tpl-bg-active)]\"\n :aria-label=\"t.ai.rewrite.title\"\n :title=\"t.ai.rewrite.title\"\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n @click=\"toggle\"\n >\n <Sparkles :size=\"16\" :stroke-width=\"2\" aria-hidden=\"true\" />\n {{ t.ai.menu.button }}\n </button>\n\n <div\n v-if=\"isOpen\"\n role=\"dialog\"\n :aria-label=\"t.ai.rewrite.title\"\n data-testid=\"ai-rewrite-panel\"\n class=\"tpl-ai-rewrite-panel tpl:absolute tpl:top-full tpl:right-0 tpl:z-50 tpl:mt-2 tpl:flex tpl:w-80 tpl:flex-col tpl:gap-3 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3 tpl:shadow-[var(--tpl-shadow-lg)]\"\n >\n <div class=\"tpl:flex tpl:items-center tpl:justify-between\">\n <span\n class=\"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]\"\n >\n <WandSparkles :size=\"14\" :stroke-width=\"2\" aria-hidden=\"true\" />\n {{ t.ai.rewrite.title }}\n </span>\n <button\n type=\"button\"\n class=\"tpl:rounded-md tpl:p-0.5 tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"t.ai.rewrite.close\"\n :title=\"t.ai.rewrite.close\"\n @click=\"close\"\n >\n <X :size=\"14\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n </div>\n\n <!-- The finished rewrite: normalized and sanitized, labelled (Art. 50). -->\n <template v-if=\"result !== null\">\n <span\n data-testid=\"ai-rewrite-label\"\n class=\"tpl:self-start tpl:rounded tpl:px-1.5 tpl:py-px tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-secondary-light)] tpl:text-[var(--tpl-text)]\"\n >\n {{ t.ai.rewrite.suggestionLabel }}\n </span>\n <div\n data-testid=\"ai-rewrite-preview\"\n class=\"tpl:max-h-48 tpl:overflow-y-auto tpl:text-sm tpl:text-[var(--tpl-text)]\"\n v-html=\"result\"\n />\n <div class=\"tpl:flex tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-discard\"\n :class=\"secondaryBtnCompactClass\"\n @click=\"reset\"\n >\n {{ t.ai.rewrite.discard }}\n </button>\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-replace\"\n :class=\"primaryBtnCompactClass\"\n @click=\"replace\"\n >\n {{ t.ai.rewrite.replaceAction }}\n </button>\n </div>\n </template>\n\n <!-- Streaming: plain text only. -->\n <template v-else-if=\"isRewriting\">\n <span\n data-testid=\"ai-rewrite-label\"\n class=\"tpl:self-start tpl:rounded tpl:px-1.5 tpl:py-px tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-secondary-light)] tpl:text-[var(--tpl-text)]\"\n >\n {{ t.ai.rewrite.suggestionLabel }}\n </span>\n <p\n data-testid=\"ai-rewrite-preview\"\n class=\"tpl:m-0 tpl:max-h-48 tpl:overflow-y-auto tpl:whitespace-pre-wrap tpl:text-sm tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ streamingPreview || t.ai.rewrite.rewriting }}\n </p>\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-stop\"\n :class=\"[secondaryBtnCompactClass, 'tpl:self-end']\"\n @click=\"stop\"\n >\n <Square :size=\"12\" :stroke-width=\"2\" aria-hidden=\"true\" />\n {{ t.ai.rewrite.stop }}\n </button>\n </template>\n\n <template v-else>\n <div class=\"tpl:flex tpl:flex-wrap tpl:gap-1.5\">\n <button\n v-for=\"preset in PRESETS\"\n :key=\"preset\"\n type=\"button\"\n :data-testid=\"`ai-rewrite-preset-${preset}`\"\n :class=\"secondaryBtnCompactClass\"\n @click=\"run(preset)\"\n >\n {{ t.ai.rewrite.presets[preset] }}\n </button>\n </div>\n <div class=\"tpl:flex tpl:items-center tpl:gap-2\">\n <Languages\n :size=\"14\"\n :stroke-width=\"2\"\n class=\"tpl:shrink-0 tpl:text-[var(--tpl-text-muted)]\"\n aria-hidden=\"true\"\n />\n <ToolbarSelect\n v-model=\"language\"\n :options=\"languages\"\n :label=\"t.ai.rewrite.language\"\n width-class=\"tpl:flex-1\"\n />\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-preset-translate\"\n :class=\"secondaryBtnCompactClass\"\n :disabled=\"language === ''\"\n @click=\"run('translate')\"\n >\n {{ t.ai.rewrite.presets.translate }}\n </button>\n </div>\n <div class=\"tpl:flex tpl:items-end tpl:gap-2\">\n <textarea\n v-model=\"instruction\"\n data-testid=\"ai-rewrite-instruction\"\n maxlength=\"500\"\n rows=\"2\"\n class=\"tpl:flex-1 tpl:resize-none tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:py-1.5 tpl:font-sans tpl:text-sm tpl:text-[var(--tpl-text)]\"\n :aria-label=\"t.ai.rewrite.instructionLabel\"\n :placeholder=\"t.ai.rewrite.instructionPlaceholder\"\n />\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-run\"\n :class=\"primaryBtnCompactClass\"\n :disabled=\"instruction.trim() === ''\"\n @click=\"run(null)\"\n >\n {{ t.ai.rewrite.run }}\n </button>\n </div>\n <p\n v-if=\"errorText\"\n role=\"alert\"\n data-testid=\"ai-rewrite-error\"\n class=\"tpl:m-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ errorText }}\n </p>\n <p class=\"tpl:m-0 tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\">\n {{ t.ai.chat.disclaimer }}\n </p>\n </template>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { Editor } from \"@tiptap/core\";\nimport {\n SdkError,\n SYNTAX_PRESETS,\n type AiRewritePreset,\n} from \"@templatical/types\";\nimport { Languages, Sparkles, Square, WandSparkles, X } from \"@lucide/vue\";\nimport { computed, inject, onBeforeUnmount, ref, watch } from \"vue\";\nimport ToolbarSelect from \"../toolbar/ToolbarSelect.vue\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport {\n primaryBtnCompactClass,\n secondaryBtnCompactClass,\n} from \"../../constants/styleConstants\";\nimport {\n AI_FEATURE_KEY,\n EDITOR_KEY,\n MERGE_TAGS_KEY,\n MERGE_TAG_SYNTAX_KEY,\n NO_MERGE_TAGS,\n UI_LOCALE_KEY,\n requireInject,\n} from \"../../keys\";\nimport { aiErrorMessage } from \"../../utils/aiErrors\";\nimport {\n htmlToPlainText,\n rewriteLanguageOptions,\n} from \"../../utils/aiRewritePreview\";\nimport { normalizeMergeTagsInHtml } from \"../../utils/normalizeMergeTagMarkup\";\nimport { sanitizeHtml } from \"../../utils/sanitizeHtml\";\n\n/**\n * Rewrite with AI, in the paragraph text toolbar: a preset or the user's own\n * instruction, streamed into a preview labelled as an AI suggestion. Replace\n * puts it into the paragraph through TipTap, so it is the user's own edit\n * (an ordinary change, on the normal undo stack, a normal batch with\n * collaboration). Rendered inside `.tpl-text-toolbar` and never teleported:\n * the paragraph leaves edit mode on a mousedown outside the toolbar.\n */\nconst props = defineProps<{ editor: Editor }>();\n\nconst { t, format } = useI18n();\nconst feature = requireInject(AI_FEATURE_KEY, \"AiRewriteMenu\");\nconst mergeTags = inject(MERGE_TAGS_KEY, NO_MERGE_TAGS);\nconst syntax = inject(MERGE_TAG_SYNTAX_KEY, SYNTAX_PRESETS.liquid);\nconst uiLocale = inject(UI_LOCALE_KEY, undefined);\nconst templateEditor = inject(EDITOR_KEY, null);\n\nconst PRESETS: Exclude<AiRewritePreset, \"translate\">[] = [\n \"shorten\",\n \"expand\",\n \"friendlier\",\n \"formal\",\n \"fixGrammar\",\n];\nconst languages = rewriteLanguageOptions(uiLocale);\n\nconst isOpen = ref(false);\nconst language = ref(languages[0].value);\nconst instruction = ref(\"\");\nconst isRewriting = ref(false);\nconst streamed = ref(\"\");\nconst raw = ref<string | null>(null);\nconst failure = ref<unknown>(null);\nlet controller: AbortController | null = null;\nlet generation = 0;\n\n/** The finished rewrite as the editor will hold it: tags, then sanitized (D22). */\nconst result = computed(() =>\n raw.value === null\n ? null\n : sanitizeHtml(\n normalizeMergeTagsInHtml(raw.value, mergeTags.value, syntax),\n ),\n);\nconst streamingPreview = computed(() => htmlToPlainText(streamed.value));\nconst errorText = computed(() =>\n failure.value\n ? aiErrorMessage(failure.value, t.ai.errors, format, uiLocale)\n : \"\",\n);\n\nfunction stop(): void {\n generation++;\n const activeController = controller;\n controller = null;\n isRewriting.value = false;\n activeController?.abort();\n}\n\nfunction reset(): void {\n stop();\n streamed.value = \"\";\n raw.value = null;\n failure.value = null;\n}\n\nfunction close(): void {\n reset();\n isOpen.value = false;\n}\n\nfunction toggle(): void {\n if (isOpen.value) close();\n else isOpen.value = true;\n}\n\nasync function run(preset: AiRewritePreset | null): Promise<void> {\n const text = instruction.value.trim();\n if (\n isRewriting.value ||\n (preset === null && text === \"\") ||\n (preset === \"translate\" && language.value === \"\")\n )\n return;\n reset();\n const html = props.editor.getHTML();\n if (Array.from(html).length > 20_000) {\n failure.value = new SdkError(t.ai.rewrite.tooLarge, 413);\n return;\n }\n const requestController = new AbortController();\n const token = ++generation;\n controller = requestController;\n isRewriting.value = true;\n try {\n const answer = await feature.rewrite(\n {\n html,\n preset,\n language: preset === \"translate\" ? language.value : null,\n instruction: text === \"\" ? null : text,\n },\n (chunk) => {\n if (token !== generation) return;\n streamed.value += chunk;\n },\n requestController.signal,\n );\n if (token !== generation) return;\n raw.value = answer.html;\n } catch (error) {\n if (\n token === generation &&\n !(error instanceof Error && error.name === \"AbortError\")\n )\n failure.value = error;\n } finally {\n if (token === generation) {\n isRewriting.value = false;\n controller = null;\n }\n }\n}\n\nfunction replace(): void {\n if (result.value === null) return;\n props.editor\n .chain()\n .focus()\n .setContent(result.value, { emitUpdate: true })\n .run();\n close();\n}\n\nif (templateEditor?.activeLocale)\n watch(templateEditor.activeLocale, close, { flush: \"sync\" });\nonBeforeUnmount(stop);\n</script>\n\n<template>\n <div class=\"tpl:relative tpl:flex tpl:items-center\">\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-trigger\"\n class=\"tpl:flex tpl:h-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)] tpl:transition-all tpl:hover:bg-[var(--tpl-bg-active)]\"\n :aria-label=\"t.ai.rewrite.title\"\n :title=\"t.ai.rewrite.title\"\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n @click=\"toggle\"\n >\n <Sparkles :size=\"16\" :stroke-width=\"2\" aria-hidden=\"true\" />\n {{ t.ai.menu.button }}\n </button>\n\n <div\n v-if=\"isOpen\"\n role=\"dialog\"\n :aria-label=\"t.ai.rewrite.title\"\n data-testid=\"ai-rewrite-panel\"\n class=\"tpl-ai-rewrite-panel tpl:absolute tpl:top-full tpl:right-0 tpl:z-50 tpl:mt-2 tpl:flex tpl:w-80 tpl:flex-col tpl:gap-3 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3 tpl:shadow-[var(--tpl-shadow-lg)]\"\n >\n <div class=\"tpl:flex tpl:items-center tpl:justify-between\">\n <span\n class=\"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]\"\n >\n <WandSparkles :size=\"14\" :stroke-width=\"2\" aria-hidden=\"true\" />\n {{ t.ai.rewrite.title }}\n </span>\n <button\n type=\"button\"\n class=\"tpl:rounded-md tpl:p-0.5 tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"t.ai.rewrite.close\"\n :title=\"t.ai.rewrite.close\"\n @click=\"close\"\n >\n <X :size=\"14\" :stroke-width=\"2\" aria-hidden=\"true\" />\n </button>\n </div>\n\n <!-- The finished rewrite: normalized and sanitized, labelled (Art. 50). -->\n <template v-if=\"result !== null\">\n <span\n data-testid=\"ai-rewrite-label\"\n class=\"tpl:self-start tpl:rounded tpl:px-1.5 tpl:py-px tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-secondary-light)] tpl:text-[var(--tpl-text)]\"\n >\n {{ t.ai.rewrite.suggestionLabel }}\n </span>\n <div\n data-testid=\"ai-rewrite-preview\"\n class=\"tpl:max-h-48 tpl:overflow-y-auto tpl:text-sm tpl:text-[var(--tpl-text)]\"\n v-html=\"result\"\n />\n <div class=\"tpl:flex tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-discard\"\n :class=\"secondaryBtnCompactClass\"\n @click=\"reset\"\n >\n {{ t.ai.rewrite.discard }}\n </button>\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-replace\"\n :class=\"primaryBtnCompactClass\"\n @click=\"replace\"\n >\n {{ t.ai.rewrite.replaceAction }}\n </button>\n </div>\n </template>\n\n <!-- Streaming: plain text only. -->\n <template v-else-if=\"isRewriting\">\n <span\n data-testid=\"ai-rewrite-label\"\n class=\"tpl:self-start tpl:rounded tpl:px-1.5 tpl:py-px tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-secondary-light)] tpl:text-[var(--tpl-text)]\"\n >\n {{ t.ai.rewrite.suggestionLabel }}\n </span>\n <p\n data-testid=\"ai-rewrite-preview\"\n class=\"tpl:m-0 tpl:max-h-48 tpl:overflow-y-auto tpl:whitespace-pre-wrap tpl:text-sm tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ streamingPreview || t.ai.rewrite.rewriting }}\n </p>\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-stop\"\n :class=\"[secondaryBtnCompactClass, 'tpl:self-end']\"\n @click=\"stop\"\n >\n <Square :size=\"12\" :stroke-width=\"2\" aria-hidden=\"true\" />\n {{ t.ai.rewrite.stop }}\n </button>\n </template>\n\n <template v-else>\n <div class=\"tpl:flex tpl:flex-wrap tpl:gap-1.5\">\n <button\n v-for=\"preset in PRESETS\"\n :key=\"preset\"\n type=\"button\"\n :data-testid=\"`ai-rewrite-preset-${preset}`\"\n :class=\"secondaryBtnCompactClass\"\n @click=\"run(preset)\"\n >\n {{ t.ai.rewrite.presets[preset] }}\n </button>\n </div>\n <div class=\"tpl:flex tpl:items-center tpl:gap-2\">\n <Languages\n :size=\"14\"\n :stroke-width=\"2\"\n class=\"tpl:shrink-0 tpl:text-[var(--tpl-text-muted)]\"\n aria-hidden=\"true\"\n />\n <ToolbarSelect\n v-model=\"language\"\n :options=\"languages\"\n :label=\"t.ai.rewrite.language\"\n width-class=\"tpl:flex-1\"\n />\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-preset-translate\"\n :class=\"secondaryBtnCompactClass\"\n :disabled=\"language === ''\"\n @click=\"run('translate')\"\n >\n {{ t.ai.rewrite.presets.translate }}\n </button>\n </div>\n <div class=\"tpl:flex tpl:items-end tpl:gap-2\">\n <textarea\n v-model=\"instruction\"\n data-testid=\"ai-rewrite-instruction\"\n maxlength=\"500\"\n rows=\"2\"\n class=\"tpl:flex-1 tpl:resize-none tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:py-1.5 tpl:font-sans tpl:text-sm tpl:text-[var(--tpl-text)]\"\n :aria-label=\"t.ai.rewrite.instructionLabel\"\n :placeholder=\"t.ai.rewrite.instructionPlaceholder\"\n />\n <button\n type=\"button\"\n data-testid=\"ai-rewrite-run\"\n :class=\"primaryBtnCompactClass\"\n :disabled=\"instruction.trim() === ''\"\n @click=\"run(null)\"\n >\n {{ t.ai.rewrite.run }}\n </button>\n </div>\n <p\n v-if=\"errorText\"\n role=\"alert\"\n data-testid=\"ai-rewrite-error\"\n class=\"tpl:m-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ errorText }}\n </p>\n <p class=\"tpl:m-0 tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\">\n {{ t.ai.chat.disclaimer }}\n </p>\n </template>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCA,IAAM8E,IAAQC,GAER,EAAE,MAAG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AKM,EAAEL,EAAAyC,CAAA,CAAsB;IAC7B,SAAOuE;GAEL,GAAA7G,EAAAH,EAAAgG,CAAA,CAAC,CAAC,GAAG,QAAQ,aAAa,GAAA,CAAA,C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockIssueBadge-DncZ-HDf.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createBlock","_unref","_createCommentVNode","_sfc_main","defineComponent","openBlock","inject","createElementBlock","unref","normalizeClass","createCommentVNode","createBlock","computed","CircleAlert","TriangleAlert","useI18n","TEMPLATE_LINT_KEY","EDITOR_KEY","_hoisted_1","BlockIssueBadge_default","props","__props","lint","editor","blockIssues","i","severity","tooltip","t"],"sources":["../../../src/components/canvas/BlockIssueBadge.vue","../../../src/components/canvas/BlockIssueBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, inject } from \"vue\";\nimport { CircleAlert, TriangleAlert } from \"@lucide/vue\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport { EDITOR_KEY, TEMPLATE_LINT_KEY } from \"../../keys\";\n\nconst props = defineProps<{ blockId: string }>();\nconst { t } = useI18n();\nconst lint = inject(TEMPLATE_LINT_KEY, null);\nconst editor = inject(EDITOR_KEY, null);\n\nconst blockIssues = computed(() =>\n (lint?.issues.value ?? []).filter(\n (i) =>\n i.blockId === props.blockId &&\n !(editor?.activeLocale?.value && i.ruleId.startsWith(\"localization.\")),\n ),\n);\n\nconst severity = computed<\"error\" | \"warning\" | null>(() => {\n if (blockIssues.value.some((i) => i.severity === \"error\")) return \"error\";\n if (blockIssues.value.some((i) => i.severity === \"warning\")) return \"warning\";\n return null;\n});\n\nconst tooltip = computed(() =>\n severity.value === \"error\" ? t.issues.badgeError : t.issues.badgeWarning,\n);\n</script>\n\n<template>\n <span\n v-if=\"severity\"\n class=\"tpl-block-issue-badge tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:ring-1 tpl:ring-[var(--tpl-border)] tpl:hover:shadow-[var(--tpl-shadow-sm)]\"\n :class=\"\n severity === 'error'\n ? 'tpl:text-[var(--tpl-danger)]'\n : 'tpl:text-[var(--tpl-warning)]'\n \"\n :title=\"tooltip\"\n :aria-label=\"tooltip\"\n role=\"img\"\n >\n <CircleAlert\n v-if=\"severity === 'error'\"\n :size=\"14\"\n :stroke-width=\"2.25\"\n fill=\"currentColor\"\n stroke=\"var(--tpl-bg)\"\n />\n <TriangleAlert\n v-else\n :size=\"14\"\n :stroke-width=\"2.25\"\n fill=\"currentColor\"\n stroke=\"var(--tpl-bg)\"\n />\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, inject } from \"vue\";\nimport { CircleAlert, TriangleAlert } from \"@lucide/vue\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport { EDITOR_KEY, TEMPLATE_LINT_KEY } from \"../../keys\";\n\nconst props = defineProps<{ blockId: string }>();\nconst { t } = useI18n();\nconst lint = inject(TEMPLATE_LINT_KEY, null);\nconst editor = inject(EDITOR_KEY, null);\n\nconst blockIssues = computed(() =>\n (lint?.issues.value ?? []).filter(\n (i) =>\n i.blockId === props.blockId &&\n !(editor?.activeLocale?.value && i.ruleId.startsWith(\"localization.\")),\n ),\n);\n\nconst severity = computed<\"error\" | \"warning\" | null>(() => {\n if (blockIssues.value.some((i) => i.severity === \"error\")) return \"error\";\n if (blockIssues.value.some((i) => i.severity === \"warning\")) return \"warning\";\n return null;\n});\n\nconst tooltip = computed(() =>\n severity.value === \"error\" ? t.issues.badgeError : t.issues.badgeWarning,\n);\n</script>\n\n<template>\n <span\n v-if=\"severity\"\n class=\"tpl-block-issue-badge tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:ring-1 tpl:ring-[var(--tpl-border)] tpl:hover:shadow-[var(--tpl-shadow-sm)]\"\n :class=\"\n severity === 'error'\n ? 'tpl:text-[var(--tpl-danger)]'\n : 'tpl:text-[var(--tpl-warning)]'\n \"\n :title=\"tooltip\"\n :aria-label=\"tooltip\"\n role=\"img\"\n >\n <CircleAlert\n v-if=\"severity === 'error'\"\n :size=\"14\"\n :stroke-width=\"2.25\"\n fill=\"currentColor\"\n stroke=\"var(--tpl-bg)\"\n />\n <TriangleAlert\n v-else\n :size=\"14\"\n :stroke-width=\"2.25\"\n fill=\"currentColor\"\n stroke=\"var(--tpl-bg)\"\n />\n </span>\n</template>\n"],"mappings":";;;;;;;;;EAMA,IAAMuB,IAAQC,GACR,EAAE,SAAMN,EAAQ,GAChBO,IAAOhB,EAAOU,GAAmB,IAAI,GACrCO,IAASjB,EAAOW,GAAY,IAAI,GAEhCO,IAAcZ,SACjBU,GAAM,OAAO,SAAS,CAAC,EAAA,CAAG,QACxB,MACCG,EAAE,YAAYL,EAAM,WACpB,EAAEG,GAAQ,cAAc,SAASE,EAAE,OAAO,WAAW,eAAe,EACxE,CACF,GAEMC,IAAWd,QACXY,EAAY,MAAM,MAAM,MAAMC,EAAE,aAAa,OAAO,IAAU,UAC9DD,EAAY,MAAM,MAAM,MAAMC,EAAE,aAAa,SAAS,IAAU,YAC7D,IACR,GAEKE,IAAUf,QACdc,EAAS,UAAU,UAAUE,EAAE,OAAO,aAAaA,EAAE,OAAO,YAC9D;E,iBAKUF,EAAA,SADR7B,EAAA,GAAAC,EA0BO,QAAA;;GAxBL,OAAKC,EAAA,CAAC,sNACS2B,EAAA,UAAQ,U;GAKtB,OAAOC,EAAA;GACP,cAAYA,EAAA;GACb,MAAK;E,IAGGD,EAAA,UAAQ,WADhB7B,EAAA,GAAAG,EAMEC,EAAAY,CAAA,GAAA;;GAJC,MAAM;GACN,gBAAc;GACf,MAAK;GACL,QAAO;E,OAEThB,EAAA,GAAAG,EAMEC,EAAAa,CAAA,GAAA;;GAJC,MAAM;GACN,gBAAc;GACf,MAAK;GACL,QAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockPreviewCanvas-CCSEzL46.js","names":["_hoisted_1","TitleBlock","ParagraphBlock","ImageBlock","VideoBlock","ButtonBlock","DividerBlock","SocialIconsBlock","MenuBlock","TableBlock","SpacerBlock","HtmlBlock","CustomBlock","_resolveComponent","_openBlock","_createElementBlock","_createElementVNode","_Fragment","_renderList","_normalizeStyle","_unref","_createBlock","_resolveDynamicComponent","_sfc_main","PreviewSectionBlock","TitleBlock","ParagraphBlock","ImageBlock","VideoBlock","ButtonBlock","DividerBlock","SocialIconsBlock","MenuBlock","TableBlock","SpacerBlock","HtmlBlock","CustomBlock","WrapperBlock","_openBlock","_createElementBlock","_normalizeStyle","_createElementVNode","_unref","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_sfc_main","__exportAll","resolveDynamicComponent","defineComponent","openBlock","provide","renderList","inject","createElementBlock","unref","createBlock","createBaseVNode","computed","normalizeStyle","Fragment","resolveComponent","getDocumentStyle","resolveBlockComponent","getCachedBlockWrapperStyle","DividerBlock_default","SpacerBlock_default","HtmlBlock_default","ImageBlock_default","TableBlock_default","MenuBlock_default","SocialIconsBlock_default","ParagraphBlock_default","VideoBlock_default","TitleBlock_default","CustomBlock_default","getBlockWrapperStyle","EMAIL_FRAME_WIDTH_VAR","MERGE_TAG_SYNTAX_KEY","IMAGE_URL_RESOLVER_KEY","MERGE_TAG_SAMPLE_MODE_KEY","FONTS_MANAGER_KEY","BLOCK_REGISTRY_KEY","CONDITION_PREVIEW_KEY","USE_MERGE_TAG_SAMPLES_KEY","requireInject","EDITOR_KEY","WrapperBlock_default","EMAIL_FRAME_WIDTH_TRANSITION","getEmailFrameWidth","matchImageBoxWidth","resolveContentDirection","_hoisted_1$1","_hoisted_2","PreviewSectionBlock_default","previewBlockComponentMap","ButtonBlock_default","props","__props","blockRegistry","columnWidths","columns","count","children","getColumnBlocks","colIndex","getBlockComponent","block","_component_PreviewSectionBlock","childBlock","_hoisted_1","BlockPreviewCanvas_vue_vue_type_script_setup_true_lang_default","editor","conditionPreview","fontsManager","imageUrlResolver","mergeTagSyntax","SYNTAX_PRESETS","mergeTagSampleMode","visibleBlocks","previewSettings","frameWidth","documentStyle","contentLang","contentDir","emailBackground","stageWidth","previewComponentMap","previewBlockStyle","settings","BlockPreviewCanvas_exports","BlockPreviewCanvas_default"],"sources":["../../../src/components/blocks/PreviewSectionBlock.vue","../../../src/components/blocks/PreviewSectionBlock.vue","../../../src/components/BlockPreviewCanvas.vue","../../../src/components/BlockPreviewCanvas.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport ButtonBlock from \"./ButtonBlock.vue\";\nimport CustomBlock from \"./CustomBlock.vue\";\nimport DividerBlock from \"./DividerBlock.vue\";\nimport HtmlBlock from \"./HtmlBlock.vue\";\nimport ImageBlock from \"./ImageBlock.vue\";\nimport MenuBlock from \"./MenuBlock.vue\";\nimport SocialIconsBlock from \"./SocialIconsBlock.vue\";\nimport SpacerBlock from \"./SpacerBlock.vue\";\nimport TableBlock from \"./TableBlock.vue\";\nimport TitleBlock from \"./TitleBlock.vue\";\nimport ParagraphBlock from \"./ParagraphBlock.vue\";\nimport VideoBlock from \"./VideoBlock.vue\";\nimport {\n resolveBlockComponent,\n getBlockWrapperStyle,\n} from \"../../utils/blockComponentResolver\";\nimport type {\n Block,\n SectionBlock as SectionBlockType,\n} from \"@templatical/types\";\nimport { computed, inject, type Component } from \"vue\";\nimport { BLOCK_REGISTRY_KEY } from \"../../keys\";\n\nconst previewBlockComponentMap: Record<string, Component> = {\n title: TitleBlock,\n paragraph: ParagraphBlock,\n image: ImageBlock,\n video: VideoBlock,\n button: ButtonBlock,\n divider: DividerBlock,\n social: SocialIconsBlock,\n menu: MenuBlock,\n table: TableBlock,\n spacer: SpacerBlock,\n html: HtmlBlock,\n custom: CustomBlock,\n};\n\nconst props = defineProps<{\n block: SectionBlockType;\n viewport: \"desktop\";\n}>();\n\ndefineOptions({ name: \"PreviewSectionBlock\" });\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY, null);\n\nconst columnWidths = computed(() => {\n switch (props.block.columns) {\n case \"2\":\n return [\"50%\", \"50%\"];\n case \"3\":\n return [\"33.33%\", \"33.33%\", \"33.33%\"];\n case \"4\":\n return [\"25%\", \"25%\", \"25%\", \"25%\"];\n case \"1-2\":\n return [\"33.33%\", \"66.67%\"];\n case \"2-1\":\n return [\"66.67%\", \"33.33%\"];\n case \"1-3\":\n return [\"25%\", \"75%\"];\n case \"3-1\":\n return [\"75%\", \"25%\"];\n case \"1-2-1\":\n return [\"25%\", \"50%\", \"25%\"];\n default:\n return [\"100%\"];\n }\n});\n\nconst columns = computed(() => {\n const count = columnWidths.value.length;\n const children = [...props.block.children];\n while (children.length < count) {\n children.push([]);\n }\n return children.slice(0, count);\n});\n\nfunction getColumnBlocks(colIndex: number): Block[] {\n return columns.value[colIndex] || [];\n}\n\nfunction getBlockComponent(block: Block): Component | null {\n return resolveBlockComponent(block, blockRegistry, previewBlockComponentMap);\n}\n</script>\n\n<template>\n <div class=\"tpl:w-full\">\n <div class=\"tpl:flex tpl:gap-0\">\n <div\n v-for=\"(_, colIndex) in columns\"\n :key=\"colIndex\"\n :style=\"{ width: columnWidths[colIndex] }\"\n >\n <div\n v-for=\"childBlock in getColumnBlocks(colIndex)\"\n :key=\"childBlock.id\"\n :style=\"getBlockWrapperStyle(childBlock)\"\n >\n <!-- Recursive self-reference for nested sections -->\n <PreviewSectionBlock\n v-if=\"childBlock.type === 'section'\"\n :block=\"childBlock\"\n viewport=\"desktop\"\n />\n <component\n :is=\"getBlockComponent(childBlock)\"\n v-else\n :block=\"childBlock\"\n viewport=\"desktop\"\n />\n </div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ButtonBlock from \"./ButtonBlock.vue\";\nimport CustomBlock from \"./CustomBlock.vue\";\nimport DividerBlock from \"./DividerBlock.vue\";\nimport HtmlBlock from \"./HtmlBlock.vue\";\nimport ImageBlock from \"./ImageBlock.vue\";\nimport MenuBlock from \"./MenuBlock.vue\";\nimport SocialIconsBlock from \"./SocialIconsBlock.vue\";\nimport SpacerBlock from \"./SpacerBlock.vue\";\nimport TableBlock from \"./TableBlock.vue\";\nimport TitleBlock from \"./TitleBlock.vue\";\nimport ParagraphBlock from \"./ParagraphBlock.vue\";\nimport VideoBlock from \"./VideoBlock.vue\";\nimport {\n resolveBlockComponent,\n getBlockWrapperStyle,\n} from \"../../utils/blockComponentResolver\";\nimport type {\n Block,\n SectionBlock as SectionBlockType,\n} from \"@templatical/types\";\nimport { computed, inject, type Component } from \"vue\";\nimport { BLOCK_REGISTRY_KEY } from \"../../keys\";\n\nconst previewBlockComponentMap: Record<string, Component> = {\n title: TitleBlock,\n paragraph: ParagraphBlock,\n image: ImageBlock,\n video: VideoBlock,\n button: ButtonBlock,\n divider: DividerBlock,\n social: SocialIconsBlock,\n menu: MenuBlock,\n table: TableBlock,\n spacer: SpacerBlock,\n html: HtmlBlock,\n custom: CustomBlock,\n};\n\nconst props = defineProps<{\n block: SectionBlockType;\n viewport: \"desktop\";\n}>();\n\ndefineOptions({ name: \"PreviewSectionBlock\" });\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY, null);\n\nconst columnWidths = computed(() => {\n switch (props.block.columns) {\n case \"2\":\n return [\"50%\", \"50%\"];\n case \"3\":\n return [\"33.33%\", \"33.33%\", \"33.33%\"];\n case \"4\":\n return [\"25%\", \"25%\", \"25%\", \"25%\"];\n case \"1-2\":\n return [\"33.33%\", \"66.67%\"];\n case \"2-1\":\n return [\"66.67%\", \"33.33%\"];\n case \"1-3\":\n return [\"25%\", \"75%\"];\n case \"3-1\":\n return [\"75%\", \"25%\"];\n case \"1-2-1\":\n return [\"25%\", \"50%\", \"25%\"];\n default:\n return [\"100%\"];\n }\n});\n\nconst columns = computed(() => {\n const count = columnWidths.value.length;\n const children = [...props.block.children];\n while (children.length < count) {\n children.push([]);\n }\n return children.slice(0, count);\n});\n\nfunction getColumnBlocks(colIndex: number): Block[] {\n return columns.value[colIndex] || [];\n}\n\nfunction getBlockComponent(block: Block): Component | null {\n return resolveBlockComponent(block, blockRegistry, previewBlockComponentMap);\n}\n</script>\n\n<template>\n <div class=\"tpl:w-full\">\n <div class=\"tpl:flex tpl:gap-0\">\n <div\n v-for=\"(_, colIndex) in columns\"\n :key=\"colIndex\"\n :style=\"{ width: columnWidths[colIndex] }\"\n >\n <div\n v-for=\"childBlock in getColumnBlocks(colIndex)\"\n :key=\"childBlock.id\"\n :style=\"getBlockWrapperStyle(childBlock)\"\n >\n <!-- Recursive self-reference for nested sections -->\n <PreviewSectionBlock\n v-if=\"childBlock.type === 'section'\"\n :block=\"childBlock\"\n viewport=\"desktop\"\n />\n <component\n :is=\"getBlockComponent(childBlock)\"\n v-else\n :block=\"childBlock\"\n viewport=\"desktop\"\n />\n </div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ButtonBlock from \"./blocks/ButtonBlock.vue\";\nimport CustomBlock from \"./blocks/CustomBlock.vue\";\nimport DividerBlock from \"./blocks/DividerBlock.vue\";\nimport HtmlBlock from \"./blocks/HtmlBlock.vue\";\nimport ImageBlock from \"./blocks/ImageBlock.vue\";\nimport MenuBlock from \"./blocks/MenuBlock.vue\";\nimport PreviewSectionBlock from \"./blocks/PreviewSectionBlock.vue\";\nimport SocialIconsBlock from \"./blocks/SocialIconsBlock.vue\";\nimport SpacerBlock from \"./blocks/SpacerBlock.vue\";\nimport TableBlock from \"./blocks/TableBlock.vue\";\nimport TitleBlock from \"./blocks/TitleBlock.vue\";\nimport ParagraphBlock from \"./blocks/ParagraphBlock.vue\";\nimport VideoBlock from \"./blocks/VideoBlock.vue\";\nimport WrapperBlock from \"./blocks/WrapperBlock.vue\";\nimport {\n BLOCK_REGISTRY_KEY,\n CONDITION_PREVIEW_KEY,\n EDITOR_KEY,\n FONTS_MANAGER_KEY,\n IMAGE_URL_RESOLVER_KEY,\n MERGE_TAG_SAMPLE_MODE_KEY,\n MERGE_TAG_SYNTAX_KEY,\n USE_MERGE_TAG_SAMPLES_KEY,\n requireInject,\n} from \"../keys\";\nimport {\n EMAIL_FRAME_WIDTH_VAR,\n resolveBlockComponent,\n getCachedBlockWrapperStyle,\n getDocumentStyle,\n} from \"../utils/blockComponentResolver\";\nimport {\n EMAIL_FRAME_WIDTH_TRANSITION,\n EMAIL_GUTTER,\n getEmailFrameWidth,\n} from \"../utils/emailFrameWidth\";\nimport { matchImageBoxWidth } from \"../utils/imageRoom\";\nimport {\n SYNTAX_PRESETS,\n resolveContentDirection,\n type Block,\n type TemplateSettings,\n type ViewportSize,\n} from \"@templatical/types\";\nimport { computed, inject, provide, type Component } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n blocks: Block[];\n /**\n * Which viewport to render. Defaults to `desktop`, so the saved-blocks\n * surfaces — which have no viewport control — behave exactly as before.\n * The test-email dialog passes the user's choice so responsive blocks show\n * the variant a recipient on that device would receive.\n */\n viewport?: ViewportSize;\n /**\n * Whether the hand-toggled display-condition filter still applies here.\n * `false` where a resolver owns the preview: it has already evaluated every\n * condition against real data, so layering a manual hide on top would veto\n * the answer that was asked for.\n *\n * A prop rather than an injected `PREVIEW_RESOLUTION_KEY` read, because the\n * test-email dialog builds its *own* resolution instance (keyed to the\n * selected recipient) — injecting would consult the shared canvas instance\n * and get the wrong answer.\n */\n applyConditionFilter?: boolean;\n /**\n * Document settings for this surface. Test-email passes the composed\n * document so the mat is layout `backgroundColor` (`mj-body`). Saved-block\n * previews omit it and read the live editor template.\n */\n settings?: TemplateSettings;\n }>(),\n { viewport: \"desktop\", applyConditionFilter: true, settings: undefined },\n);\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\nconst conditionPreview = inject(CONDITION_PREVIEW_KEY, null);\nconst fontsManager = requireInject(FONTS_MANAGER_KEY, \"BlockPreviewCanvas\");\nconst imageUrlResolver = inject(IMAGE_URL_RESOLVER_KEY, null);\nconst mergeTagSyntax = inject(MERGE_TAG_SYNTAX_KEY, SYNTAX_PRESETS.liquid);\n\n/**\n * This canvas is only ever a preview — nothing here is editable — so it honours\n * the user's mode directly, with no `previewMode` gate of the kind `Canvas.vue`\n * needs. Re-provided rather than left to inherit, because a `BlockPreviewCanvas`\n * inside a dialog may sit under an editing `Canvas` that provides `false`.\n */\nconst mergeTagSampleMode = inject(MERGE_TAG_SAMPLE_MODE_KEY, null);\nprovide(\n USE_MERGE_TAG_SAMPLES_KEY,\n computed(() => mergeTagSampleMode?.value ?? false),\n);\n\n/**\n * Blocks a display condition currently excludes, so a preview never shows\n * content the recipient won't get. The canvas does the same via\n * `v-show=\"!conditionPreview?.isHidden(block.id)\"`.\n *\n * A no-op for the saved-blocks browser: entries there carry their *stored* ids,\n * which aren't in the current template, so nothing is tracked as hidden. It\n * bites where it should — the save dialog and the test-email preview, both of\n * which show blocks that are live on the canvas.\n *\n * Skipped entirely when `applyConditionFilter` is false — see the prop.\n */\nconst visibleBlocks = computed(() =>\n props.applyConditionFilter\n ? props.blocks.filter((block) => !conditionPreview?.isHidden(block.id))\n : props.blocks,\n);\n\nconst previewSettings = computed(\n () => props.settings ?? editor?.content.value.settings,\n);\n\n/**\n * Frame width, from the one helper the canvas and the scaled preview rows also\n * use — so all three agree by construction rather than by three constants that\n * happen to match. A template with a custom body width now previews at that\n * width instead of a flat 600.\n */\nconst frameWidth = computed(() =>\n getEmailFrameWidth(previewSettings.value, props.viewport),\n);\n\n/**\n * The same document-level style the canvas applies, so a previewed block\n * renders identically to the canvas one: without it the font falls back to the\n * editor UI's and the link rules hit their unset defaults, dropping the\n * underline and the link colour.\n *\n * Read from the *current* template even in the saved-blocks browser, where the\n * previewed content came from elsewhere — a saved block stores only `Block[]`,\n * and the current settings are what it will actually look like once inserted.\n */\nconst documentStyle = computed(() =>\n previewSettings.value\n ? getDocumentStyle(previewSettings.value, fontsManager.resolveFontFamily)\n : {},\n);\n\n/**\n * The email's own language, for the browser's spellchecker and hyphenation —\n * the same binding the editing canvas carries, so a preview is checked by the\n * same rules as the block it mirrors.\n *\n * From `settings.locale`, never `config.locale`: the chrome's language says\n * nothing about the content's. Read from the *current* template for the same\n * reason `documentStyle` is — a saved block stores only `Block[]`. Undefined\n * rather than `\"\"`, which would declare \"unknown language\" and suppress\n * spellcheck instead of falling back.\n */\nconst contentLang = computed(\n () => previewSettings.value?.locale?.trim() || undefined,\n);\nconst contentDir = computed(() =>\n resolveContentDirection(previewSettings.value ?? { locale: \"en\" }),\n);\n\n/**\n * The email's body background — `mj-body background-color` when sent, and the\n * `.tpl-canvas-bg` layer on the editing canvas.\n *\n * Deliberately NOT part of `getDocumentStyle`: the canvas applies that helper\n * to `.tpl-canvas`, which must stay transparent so the invertible background\n * layer beneath it shows through. A background there would double-paint and\n * defeat the dark-mode preview.\n *\n * Truthiness, not `??`: the colour pickers clear to an empty string to mean\n * \"unset\", which as an inline style renders the frame transparent rather than\n * falling back to the neutral preview surface.\n */\nconst emailBackground = computed(\n () => previewSettings.value?.backgroundColor || \"var(--tpl-canvas-bg)\",\n);\n\n/**\n * Width the stage asks for: the content column plus a full gutter on each side,\n * the same stage the canvas builds. It is an ask rather than a fixed size —\n * paired with `max-width: 100%` below, so a container with less room hands over\n * what it has and shows a narrower band instead of overflowing.\n *\n * It has to be a specified width, not `100%`: `TplModal`'s wrapper is\n * shrink-to-fit, so a percentage there resolves against a container whose size\n * the stage is itself supposed to influence, and the stage collapses to its\n * `min-width` — no gutters, on the one surface this exists for.\n */\nconst stageWidth = computed(() => frameWidth.value + EMAIL_GUTTER * 2);\n\nconst previewComponentMap: Record<string, Component> = {\n section: PreviewSectionBlock,\n title: TitleBlock,\n paragraph: ParagraphBlock,\n image: ImageBlock,\n video: VideoBlock,\n button: ButtonBlock,\n divider: DividerBlock,\n social: SocialIconsBlock,\n menu: MenuBlock,\n table: TableBlock,\n spacer: SpacerBlock,\n html: HtmlBlock,\n custom: CustomBlock,\n wrapper: WrapperBlock,\n};\n\nfunction getBlockComponent(block: Block): Component | null {\n return resolveBlockComponent(block, blockRegistry, previewComponentMap);\n}\n\n// This loop reads the resolver cache and never starts a lookup itself, so a\n// section's background image paints whatever the canvas has already resolved;\n// nested components (e.g. `ImageBlock`, a layout `WrapperBlock`) may resolve\n// their own images.\nfunction previewBlockStyle(block: Block): Record<string, string> {\n const settings = previewSettings.value;\n return getCachedBlockWrapperStyle(\n block,\n imageUrlResolver,\n mergeTagSyntax,\n matchImageBoxWidth(\n block,\n settings ? { blocks: props.blocks, settings } : undefined,\n ),\n );\n}\n</script>\n\n<template>\n <!-- STAGE — the email body, holding the background and a gutter of it on\n each side of the content column, the same shape `Canvas.vue` builds.\n `max-width: 100%` is what makes it fit anywhere: a roomy surface shows\n the full band, a dialog shows as much as it has, and a container sized to\n the content column shows none. `min-width` keeps it from squeezing the\n column, so a cramped surface clips exactly as it did when the frame\n carried the width itself. -->\n <div\n data-testid=\"block-preview-stage\"\n class=\"tpl-canvas-pane tpl:pointer-events-none tpl:mx-auto tpl:flex tpl:select-none tpl:justify-center tpl:rounded-lg\"\n :style=\"{\n width: `${stageWidth}px`,\n minWidth: `${frameWidth}px`,\n maxWidth: '100%',\n backgroundColor: emailBackground,\n boxShadow: 'var(--tpl-shadow-sm)',\n }\"\n >\n <!-- CONTENT COLUMN — the blocks at their true email width. Keeps the\n testid: this is the element whose width *is* the email width, which is\n what every viewport assertion measures. -->\n <div\n data-testid=\"block-preview-canvas\"\n :lang=\"contentLang\"\n :dir=\"contentDir\"\n :style=\"{\n width: `${frameWidth}px`,\n [EMAIL_FRAME_WIDTH_VAR]: `${frameWidth}px`,\n transition: EMAIL_FRAME_WIDTH_TRANSITION,\n ...documentStyle,\n }\"\n >\n <div\n v-for=\"block in visibleBlocks\"\n :key=\"block.id\"\n :style=\"previewBlockStyle(block)\"\n >\n <component\n :is=\"getBlockComponent(block)\"\n :block=\"block\"\n :viewport=\"viewport\"\n />\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ButtonBlock from \"./blocks/ButtonBlock.vue\";\nimport CustomBlock from \"./blocks/CustomBlock.vue\";\nimport DividerBlock from \"./blocks/DividerBlock.vue\";\nimport HtmlBlock from \"./blocks/HtmlBlock.vue\";\nimport ImageBlock from \"./blocks/ImageBlock.vue\";\nimport MenuBlock from \"./blocks/MenuBlock.vue\";\nimport PreviewSectionBlock from \"./blocks/PreviewSectionBlock.vue\";\nimport SocialIconsBlock from \"./blocks/SocialIconsBlock.vue\";\nimport SpacerBlock from \"./blocks/SpacerBlock.vue\";\nimport TableBlock from \"./blocks/TableBlock.vue\";\nimport TitleBlock from \"./blocks/TitleBlock.vue\";\nimport ParagraphBlock from \"./blocks/ParagraphBlock.vue\";\nimport VideoBlock from \"./blocks/VideoBlock.vue\";\nimport WrapperBlock from \"./blocks/WrapperBlock.vue\";\nimport {\n BLOCK_REGISTRY_KEY,\n CONDITION_PREVIEW_KEY,\n EDITOR_KEY,\n FONTS_MANAGER_KEY,\n IMAGE_URL_RESOLVER_KEY,\n MERGE_TAG_SAMPLE_MODE_KEY,\n MERGE_TAG_SYNTAX_KEY,\n USE_MERGE_TAG_SAMPLES_KEY,\n requireInject,\n} from \"../keys\";\nimport {\n EMAIL_FRAME_WIDTH_VAR,\n resolveBlockComponent,\n getCachedBlockWrapperStyle,\n getDocumentStyle,\n} from \"../utils/blockComponentResolver\";\nimport {\n EMAIL_FRAME_WIDTH_TRANSITION,\n EMAIL_GUTTER,\n getEmailFrameWidth,\n} from \"../utils/emailFrameWidth\";\nimport { matchImageBoxWidth } from \"../utils/imageRoom\";\nimport {\n SYNTAX_PRESETS,\n resolveContentDirection,\n type Block,\n type TemplateSettings,\n type ViewportSize,\n} from \"@templatical/types\";\nimport { computed, inject, provide, type Component } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n blocks: Block[];\n /**\n * Which viewport to render. Defaults to `desktop`, so the saved-blocks\n * surfaces — which have no viewport control — behave exactly as before.\n * The test-email dialog passes the user's choice so responsive blocks show\n * the variant a recipient on that device would receive.\n */\n viewport?: ViewportSize;\n /**\n * Whether the hand-toggled display-condition filter still applies here.\n * `false` where a resolver owns the preview: it has already evaluated every\n * condition against real data, so layering a manual hide on top would veto\n * the answer that was asked for.\n *\n * A prop rather than an injected `PREVIEW_RESOLUTION_KEY` read, because the\n * test-email dialog builds its *own* resolution instance (keyed to the\n * selected recipient) — injecting would consult the shared canvas instance\n * and get the wrong answer.\n */\n applyConditionFilter?: boolean;\n /**\n * Document settings for this surface. Test-email passes the composed\n * document so the mat is layout `backgroundColor` (`mj-body`). Saved-block\n * previews omit it and read the live editor template.\n */\n settings?: TemplateSettings;\n }>(),\n { viewport: \"desktop\", applyConditionFilter: true, settings: undefined },\n);\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\nconst conditionPreview = inject(CONDITION_PREVIEW_KEY, null);\nconst fontsManager = requireInject(FONTS_MANAGER_KEY, \"BlockPreviewCanvas\");\nconst imageUrlResolver = inject(IMAGE_URL_RESOLVER_KEY, null);\nconst mergeTagSyntax = inject(MERGE_TAG_SYNTAX_KEY, SYNTAX_PRESETS.liquid);\n\n/**\n * This canvas is only ever a preview — nothing here is editable — so it honours\n * the user's mode directly, with no `previewMode` gate of the kind `Canvas.vue`\n * needs. Re-provided rather than left to inherit, because a `BlockPreviewCanvas`\n * inside a dialog may sit under an editing `Canvas` that provides `false`.\n */\nconst mergeTagSampleMode = inject(MERGE_TAG_SAMPLE_MODE_KEY, null);\nprovide(\n USE_MERGE_TAG_SAMPLES_KEY,\n computed(() => mergeTagSampleMode?.value ?? false),\n);\n\n/**\n * Blocks a display condition currently excludes, so a preview never shows\n * content the recipient won't get. The canvas does the same via\n * `v-show=\"!conditionPreview?.isHidden(block.id)\"`.\n *\n * A no-op for the saved-blocks browser: entries there carry their *stored* ids,\n * which aren't in the current template, so nothing is tracked as hidden. It\n * bites where it should — the save dialog and the test-email preview, both of\n * which show blocks that are live on the canvas.\n *\n * Skipped entirely when `applyConditionFilter` is false — see the prop.\n */\nconst visibleBlocks = computed(() =>\n props.applyConditionFilter\n ? props.blocks.filter((block) => !conditionPreview?.isHidden(block.id))\n : props.blocks,\n);\n\nconst previewSettings = computed(\n () => props.settings ?? editor?.content.value.settings,\n);\n\n/**\n * Frame width, from the one helper the canvas and the scaled preview rows also\n * use — so all three agree by construction rather than by three constants that\n * happen to match. A template with a custom body width now previews at that\n * width instead of a flat 600.\n */\nconst frameWidth = computed(() =>\n getEmailFrameWidth(previewSettings.value, props.viewport),\n);\n\n/**\n * The same document-level style the canvas applies, so a previewed block\n * renders identically to the canvas one: without it the font falls back to the\n * editor UI's and the link rules hit their unset defaults, dropping the\n * underline and the link colour.\n *\n * Read from the *current* template even in the saved-blocks browser, where the\n * previewed content came from elsewhere — a saved block stores only `Block[]`,\n * and the current settings are what it will actually look like once inserted.\n */\nconst documentStyle = computed(() =>\n previewSettings.value\n ? getDocumentStyle(previewSettings.value, fontsManager.resolveFontFamily)\n : {},\n);\n\n/**\n * The email's own language, for the browser's spellchecker and hyphenation —\n * the same binding the editing canvas carries, so a preview is checked by the\n * same rules as the block it mirrors.\n *\n * From `settings.locale`, never `config.locale`: the chrome's language says\n * nothing about the content's. Read from the *current* template for the same\n * reason `documentStyle` is — a saved block stores only `Block[]`. Undefined\n * rather than `\"\"`, which would declare \"unknown language\" and suppress\n * spellcheck instead of falling back.\n */\nconst contentLang = computed(\n () => previewSettings.value?.locale?.trim() || undefined,\n);\nconst contentDir = computed(() =>\n resolveContentDirection(previewSettings.value ?? { locale: \"en\" }),\n);\n\n/**\n * The email's body background — `mj-body background-color` when sent, and the\n * `.tpl-canvas-bg` layer on the editing canvas.\n *\n * Deliberately NOT part of `getDocumentStyle`: the canvas applies that helper\n * to `.tpl-canvas`, which must stay transparent so the invertible background\n * layer beneath it shows through. A background there would double-paint and\n * defeat the dark-mode preview.\n *\n * Truthiness, not `??`: the colour pickers clear to an empty string to mean\n * \"unset\", which as an inline style renders the frame transparent rather than\n * falling back to the neutral preview surface.\n */\nconst emailBackground = computed(\n () => previewSettings.value?.backgroundColor || \"var(--tpl-canvas-bg)\",\n);\n\n/**\n * Width the stage asks for: the content column plus a full gutter on each side,\n * the same stage the canvas builds. It is an ask rather than a fixed size —\n * paired with `max-width: 100%` below, so a container with less room hands over\n * what it has and shows a narrower band instead of overflowing.\n *\n * It has to be a specified width, not `100%`: `TplModal`'s wrapper is\n * shrink-to-fit, so a percentage there resolves against a container whose size\n * the stage is itself supposed to influence, and the stage collapses to its\n * `min-width` — no gutters, on the one surface this exists for.\n */\nconst stageWidth = computed(() => frameWidth.value + EMAIL_GUTTER * 2);\n\nconst previewComponentMap: Record<string, Component> = {\n section: PreviewSectionBlock,\n title: TitleBlock,\n paragraph: ParagraphBlock,\n image: ImageBlock,\n video: VideoBlock,\n button: ButtonBlock,\n divider: DividerBlock,\n social: SocialIconsBlock,\n menu: MenuBlock,\n table: TableBlock,\n spacer: SpacerBlock,\n html: HtmlBlock,\n custom: CustomBlock,\n wrapper: WrapperBlock,\n};\n\nfunction getBlockComponent(block: Block): Component | null {\n return resolveBlockComponent(block, blockRegistry, previewComponentMap);\n}\n\n// This loop reads the resolver cache and never starts a lookup itself, so a\n// section's background image paints whatever the canvas has already resolved;\n// nested components (e.g. `ImageBlock`, a layout `WrapperBlock`) may resolve\n// their own images.\nfunction previewBlockStyle(block: Block): Record<string, string> {\n const settings = previewSettings.value;\n return getCachedBlockWrapperStyle(\n block,\n imageUrlResolver,\n mergeTagSyntax,\n matchImageBoxWidth(\n block,\n settings ? { blocks: props.blocks, settings } : undefined,\n ),\n );\n}\n</script>\n\n<template>\n <!-- STAGE — the email body, holding the background and a gutter of it on\n each side of the content column, the same shape `Canvas.vue` builds.\n `max-width: 100%` is what makes it fit anywhere: a roomy surface shows\n the full band, a dialog shows as much as it has, and a container sized to\n the content column shows none. `min-width` keeps it from squeezing the\n column, so a cramped surface clips exactly as it did when the frame\n carried the width itself. -->\n <div\n data-testid=\"block-preview-stage\"\n class=\"tpl-canvas-pane tpl:pointer-events-none tpl:mx-auto tpl:flex tpl:select-none tpl:justify-center tpl:rounded-lg\"\n :style=\"{\n width: `${stageWidth}px`,\n minWidth: `${frameWidth}px`,\n maxWidth: '100%',\n backgroundColor: emailBackground,\n boxShadow: 'var(--tpl-shadow-sm)',\n }\"\n >\n <!-- CONTENT COLUMN — the blocks at their true email width. Keeps the\n testid: this is the element whose width *is* the email width, which is\n what every viewport assertion measures. -->\n <div\n data-testid=\"block-preview-canvas\"\n :lang=\"contentLang\"\n :dir=\"contentDir\"\n :style=\"{\n width: `${frameWidth}px`,\n [EMAIL_FRAME_WIDTH_VAR]: `${frameWidth}px`,\n transition: EMAIL_FRAME_WIDTH_TRANSITION,\n ...documentStyle,\n }\"\n >\n <div\n v-for=\"block in visibleBlocks\"\n :key=\"block.id\"\n :style=\"previewBlockStyle(block)\"\n >\n <component\n :is=\"getBlockComponent(block)\"\n :block=\"block\"\n :viewport=\"viewport\"\n />\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAwBA,IAAMgG,IAAsD;GAC1D,OAAO/F;GACP,WAAWC;GACX,OAAOC;GACP,OAAOC;GACP,QAAQC;GACR,SAASC;GACT,QAAQC;GACR,MAAMC;GACN,OAAOC;GACP,QAAQC;GACR,MAAMC;GACN,QAAQC;EACV,GAEMsF,IAAQC,GAORC,IAAgB9C,EAAO6B,GAAoB,IAAI,GAE/CkB,IAAe1C,QAAe;GAClC,QAAQuC,EAAM,MAAM,SAApB;IACE,KAAK,KACH,OAAO,CAAC,OAAO,KAAK;IACtB,KAAK,KACH,OAAO;KAAC;KAAU;KAAU;IAAQ;IACtC,KAAK,KACH,OAAO;KAAC;KAAO;KAAO;KAAO;IAAK;IACpC,KAAK,OACH,OAAO,CAAC,UAAU,QAAQ;IAC5B,KAAK,OACH,OAAO,CAAC,UAAU,QAAQ;IAC5B,KAAK,OACH,OAAO,CAAC,OAAO,KAAK;IACtB,KAAK,OACH,OAAO,CAAC,OAAO,KAAK;IACtB,KAAK,SACH,OAAO;KAAC;KAAO;KAAO;IAAK;IAC7B,SACE,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F;EACF;E,kBAWE5D,EAAA,GAAAC,EAqCM,OAAA;GApCJ,eAAY;GACZ,OAAM;GACL,OAAKC,EAAA;IAAoB,OAAA,GAAAuF,GAAA,MAAU;IAAyB,UAAA,GAAAL,EAAA,MAAU;;IAAqD,iBAAAI,GAAA;;;E,IAW5HrF,EAsBM,OAAA;GArBJ,eAAY;GACX,MAAMmF,GAAA;GACN,KAAKC,GAAA;GACL,OAAKrF,EAAA;IAAsB,OAAA,GAAAkF,EAAA,MAAU;KAAehF,EAAAoC,CAAA,IAAqB,GAAM4C,EAAA,MAAU;IAA0B,YAAAhF,EAAA+C,EAAA;IAAyC,GAAAkC,GAAA;;E,KAO7JrF,EAAA,EAAA,GAAAC,EAUMI,GAAA,MAAAC,EATY4E,EAAA,QAAT,OADTlF,EAAA,GAAAC,EAUM,OAAA;GARH,KAAKqE,EAAM;GACX,OAAKpE,EAAEyF,GAAkBrB,CAAK,CAAA;E,KAE/BtE,EAAA,GAAAO,EAIEC,EAHK6D,GAAkBC,CAAK,CAAA,GAAA;GACpB;GACP,UAAUT,EAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CloudPanels-CRztnw4M.js","names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_unref","_toDisplayString","_normalizeClass","_createCommentVNode","_sfc_main","_hoisted_1","_hoisted_2","_hoisted_3","_openBlock","_createElementBlock","_unref","_createStaticVNode","_createElementVNode","_Fragment","_renderList","_createCommentVNode","_sfc_main","_openBlock","_createBlock","TplModal","_withCtx","_createElementVNode","_createVNode","_unref","AlertTriangle","_toDisplayString","_createElementBlock","_Fragment","_renderList","_normalizeClass","_sfc_main","_openBlock","_createElementBlock","_Fragment","_createVNode","_Transition","_withCtx","CloudLoadingOverlay","CloudErrorOverlay","CloudSaveGateModal","_sfc_main","defineComponent","openBlock","withCtx","renderList","createElementBlock","unref","normalizeClass","createCommentVNode","createBlock","createBaseVNode","toDisplayString","Transition","Fragment","createVNode","createStaticVNode","CircleAlert","TriangleAlert","secondaryBtnClass","primaryBtnClass","dangerBtnClass","useCloudI18nStrict","TplModal_default","_hoisted_1$2","_hoisted_2$2","_hoisted_3$2","_hoisted_4$1","_hoisted_5$1","CloudErrorOverlay_default","__emit","emit","cloudT","getErrorMessage","error","isNotFoundError","__props","_cache","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","CloudLoadingOverlay_default","n","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","CloudSaveGateModal_default","issue","CloudPanels_default"],"sources":["../../../src/cloud/components/CloudErrorOverlay.vue","../../../src/cloud/components/CloudErrorOverlay.vue","../../../src/cloud/components/CloudLoadingOverlay.vue","../../../src/cloud/components/CloudLoadingOverlay.vue","../../../src/cloud/components/CloudSaveGateModal.vue","../../../src/cloud/components/CloudSaveGateModal.vue","../../../src/cloud/components/CloudPanels.vue","../../../src/cloud/components/CloudPanels.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CircleAlert } from \"@lucide/vue\";\nimport { primaryBtnClass } from \"../../constants/styleConstants\";\nimport { useCloudI18nStrict } from \"../../composables/useCloudI18n\";\n\ndefineProps<{\n error: Error | null;\n visible: boolean;\n}>();\n\nconst emit = defineEmits<{\n (e: \"retry\"): void;\n}>();\n\nconst { t: cloudT } = useCloudI18nStrict();\n\nfunction getErrorMessage(error: Error): string {\n if (\n \"isUnauthorized\" in error &&\n (error as { isUnauthorized: boolean }).isUnauthorized\n ) {\n return cloudT.error.authFailed;\n }\n if (\"isNotFound\" in error && (error as { isNotFound: boolean }).isNotFound) {\n return cloudT.error.templateNotFound;\n }\n return cloudT.error.defaultMessage;\n}\n\nfunction isNotFoundError(error: Error): boolean {\n return (\n \"isNotFound\" in error && !!(error as { isNotFound: boolean }).isNotFound\n );\n}\n</script>\n\n<template>\n <div\n v-if=\"visible && error\"\n role=\"alert\"\n class=\"tpl-error tpl:absolute tpl:inset-0 tpl:z-[100] tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]\"\n >\n <div\n class=\"tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]\"\n >\n <CircleAlert\n :size=\"32\"\n :stroke-width=\"1.5\"\n class=\"tpl:text-[var(--tpl-danger)]\"\n />\n </div>\n <div\n class=\"tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center\"\n >\n <h2 class=\"tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]\">\n {{ cloudT.error.title }}\n </h2>\n <p class=\"tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]\">\n {{ getErrorMessage(error) }}\n </p>\n </div>\n <button\n v-if=\"!isNotFoundError(error)\"\n type=\"button\"\n :class=\"primaryBtnClass\"\n @click=\"emit('retry')\"\n >\n {{ cloudT.error.retry }}\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { CircleAlert } from \"@lucide/vue\";\nimport { primaryBtnClass } from \"../../constants/styleConstants\";\nimport { useCloudI18nStrict } from \"../../composables/useCloudI18n\";\n\ndefineProps<{\n error: Error | null;\n visible: boolean;\n}>();\n\nconst emit = defineEmits<{\n (e: \"retry\"): void;\n}>();\n\nconst { t: cloudT } = useCloudI18nStrict();\n\nfunction getErrorMessage(error: Error): string {\n if (\n \"isUnauthorized\" in error &&\n (error as { isUnauthorized: boolean }).isUnauthorized\n ) {\n return cloudT.error.authFailed;\n }\n if (\"isNotFound\" in error && (error as { isNotFound: boolean }).isNotFound) {\n return cloudT.error.templateNotFound;\n }\n return cloudT.error.defaultMessage;\n}\n\nfunction isNotFoundError(error: Error): boolean {\n return (\n \"isNotFound\" in error && !!(error as { isNotFound: boolean }).isNotFound\n );\n}\n</script>\n\n<template>\n <div\n v-if=\"visible && error\"\n role=\"alert\"\n class=\"tpl-error tpl:absolute tpl:inset-0 tpl:z-[100] tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]\"\n >\n <div\n class=\"tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]\"\n >\n <CircleAlert\n :size=\"32\"\n :stroke-width=\"1.5\"\n class=\"tpl:text-[var(--tpl-danger)]\"\n />\n </div>\n <div\n class=\"tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center\"\n >\n <h2 class=\"tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]\">\n {{ cloudT.error.title }}\n </h2>\n <p class=\"tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]\">\n {{ getErrorMessage(error) }}\n </p>\n </div>\n <button\n v-if=\"!isNotFoundError(error)\"\n type=\"button\"\n :class=\"primaryBtnClass\"\n @click=\"emit('retry')\"\n >\n {{ cloudT.error.retry }}\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { useCloudI18nStrict } from \"../../composables/useCloudI18n\";\n\ndefineProps<{\n visible: boolean;\n}>();\n\nconst { t: cloudT } = useCloudI18nStrict();\n</script>\n\n<template>\n <div\n v-if=\"visible\"\n role=\"status\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n :aria-label=\"cloudT.loading.initializing\"\n class=\"tpl-loading tpl:absolute tpl:inset-0 tpl:z-[100] tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]\"\n >\n <!-- Skeleton header -->\n <div\n class=\"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]\"\n >\n <div\n class=\"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n <div class=\"tpl:flex tpl:gap-3\">\n <div\n class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n <div\n class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n </div>\n </div>\n <!-- Skeleton body -->\n <div class=\"tpl:flex tpl:flex-1 tpl:overflow-hidden\">\n <!-- Left sidebar rail -->\n <div\n class=\"tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]\"\n >\n <div\n v-for=\"n in 5\"\n :key=\"n\"\n class=\"tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n </div>\n <!-- Canvas area -->\n <div\n class=\"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]\"\n >\n <div\n class=\"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]\"\n >\n <div class=\"tpl:space-y-2 tpl:py-4\">\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded\"></div>\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div>\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded\"></div>\n </div>\n <div class=\"tpl:py-4\">\n <div\n class=\"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n </div>\n <div class=\"tpl:space-y-2 tpl:py-4\">\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div>\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded\"></div>\n </div>\n <div class=\"tpl:flex tpl:justify-center tpl:py-4\">\n <div\n class=\"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n </div>\n <div class=\"tpl:space-y-2 tpl:py-4\">\n <div\n class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded\"\n ></div>\n <div\n class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded\"\n ></div>\n </div>\n </div>\n </div>\n <!-- Right panel -->\n <div\n class=\"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]\"\n >\n <div\n class=\"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n <div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div>\n <div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { useCloudI18nStrict } from \"../../composables/useCloudI18n\";\n\ndefineProps<{\n visible: boolean;\n}>();\n\nconst { t: cloudT } = useCloudI18nStrict();\n</script>\n\n<template>\n <div\n v-if=\"visible\"\n role=\"status\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n :aria-label=\"cloudT.loading.initializing\"\n class=\"tpl-loading tpl:absolute tpl:inset-0 tpl:z-[100] tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]\"\n >\n <!-- Skeleton header -->\n <div\n class=\"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]\"\n >\n <div\n class=\"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n <div class=\"tpl:flex tpl:gap-3\">\n <div\n class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n <div\n class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n </div>\n </div>\n <!-- Skeleton body -->\n <div class=\"tpl:flex tpl:flex-1 tpl:overflow-hidden\">\n <!-- Left sidebar rail -->\n <div\n class=\"tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]\"\n >\n <div\n v-for=\"n in 5\"\n :key=\"n\"\n class=\"tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n </div>\n <!-- Canvas area -->\n <div\n class=\"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]\"\n >\n <div\n class=\"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]\"\n >\n <div class=\"tpl:space-y-2 tpl:py-4\">\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded\"></div>\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div>\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded\"></div>\n </div>\n <div class=\"tpl:py-4\">\n <div\n class=\"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n </div>\n <div class=\"tpl:space-y-2 tpl:py-4\">\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div>\n <div class=\"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded\"></div>\n </div>\n <div class=\"tpl:flex tpl:justify-center tpl:py-4\">\n <div\n class=\"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n </div>\n <div class=\"tpl:space-y-2 tpl:py-4\">\n <div\n class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded\"\n ></div>\n <div\n class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded\"\n ></div>\n </div>\n </div>\n </div>\n <!-- Right panel -->\n <div\n class=\"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]\"\n >\n <div\n class=\"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]\"\n ></div>\n <div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div>\n <div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { AlertTriangle } from \"@lucide/vue\";\nimport {\n dangerBtnClass,\n secondaryBtnClass,\n} from \"../../constants/styleConstants\";\nimport TplModal from \"../../components/TplModal.vue\";\nimport { useCloudI18nStrict } from \"../../composables/useCloudI18n\";\nimport type { LintIssue } from \"../../composables/useTemplateLint\";\n\ndefineProps<{\n open: boolean;\n issues: LintIssue[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"cancel\"): void;\n (e: \"confirm\"): void;\n}>();\n\nconst { t: cloudT } = useCloudI18nStrict();\n</script>\n\n<template>\n <TplModal :visible=\"open\" @close=\"emit('cancel')\">\n <div\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby=\"tpl-save-gate-title\"\n aria-describedby=\"tpl-save-gate-body\"\n data-testid=\"cloud-save-gate-dialog\"\n class=\"tpl:flex tpl:max-h-[80%] tpl:w-full tpl:max-w-md tpl:flex-col tpl:gap-4 tpl:overflow-y-auto tpl:rounded-[var(--tpl-radius-lg)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-5 tpl:shadow-[var(--tpl-shadow-lg)]\"\n >\n <header class=\"tpl:flex tpl:items-center tpl:gap-2\">\n <AlertTriangle\n :size=\"18\"\n :stroke-width=\"2\"\n class=\"tpl:text-[var(--tpl-warning)]\"\n />\n <h2\n id=\"tpl-save-gate-title\"\n class=\"tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ cloudT.saveGate.title }}\n </h2>\n </header>\n\n <p\n id=\"tpl-save-gate-body\"\n class=\"tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ cloudT.saveGate.body }}\n </p>\n\n <ul\n class=\"tpl:m-0 tpl:flex tpl:max-h-64 tpl:list-none tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-2\"\n >\n <li\n v-for=\"issue in issues\"\n :key=\"`${issue.ruleId}-${issue.blockId ?? 'template'}`\"\n class=\"tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5\"\n >\n <span class=\"tpl:text-xs tpl:text-[var(--tpl-text)]\">\n {{ issue.message }}\n </span>\n <span\n class=\"tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ issue.ruleId }}\n </span>\n </li>\n </ul>\n\n <footer class=\"tpl:flex tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n data-testid=\"cloud-save-gate-cancel\"\n :class=\"secondaryBtnClass\"\n @click=\"emit('cancel')\"\n >\n {{ cloudT.saveGate.cancel }}\n </button>\n <button\n type=\"button\"\n data-testid=\"cloud-save-gate-confirm\"\n :class=\"dangerBtnClass\"\n @click=\"emit('confirm')\"\n >\n {{ cloudT.saveGate.confirm }}\n </button>\n </footer>\n </div>\n </TplModal>\n</template>\n","<script setup lang=\"ts\">\nimport { AlertTriangle } from \"@lucide/vue\";\nimport {\n dangerBtnClass,\n secondaryBtnClass,\n} from \"../../constants/styleConstants\";\nimport TplModal from \"../../components/TplModal.vue\";\nimport { useCloudI18nStrict } from \"../../composables/useCloudI18n\";\nimport type { LintIssue } from \"../../composables/useTemplateLint\";\n\ndefineProps<{\n open: boolean;\n issues: LintIssue[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"cancel\"): void;\n (e: \"confirm\"): void;\n}>();\n\nconst { t: cloudT } = useCloudI18nStrict();\n</script>\n\n<template>\n <TplModal :visible=\"open\" @close=\"emit('cancel')\">\n <div\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby=\"tpl-save-gate-title\"\n aria-describedby=\"tpl-save-gate-body\"\n data-testid=\"cloud-save-gate-dialog\"\n class=\"tpl:flex tpl:max-h-[80%] tpl:w-full tpl:max-w-md tpl:flex-col tpl:gap-4 tpl:overflow-y-auto tpl:rounded-[var(--tpl-radius-lg)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-5 tpl:shadow-[var(--tpl-shadow-lg)]\"\n >\n <header class=\"tpl:flex tpl:items-center tpl:gap-2\">\n <AlertTriangle\n :size=\"18\"\n :stroke-width=\"2\"\n class=\"tpl:text-[var(--tpl-warning)]\"\n />\n <h2\n id=\"tpl-save-gate-title\"\n class=\"tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ cloudT.saveGate.title }}\n </h2>\n </header>\n\n <p\n id=\"tpl-save-gate-body\"\n class=\"tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ cloudT.saveGate.body }}\n </p>\n\n <ul\n class=\"tpl:m-0 tpl:flex tpl:max-h-64 tpl:list-none tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-2\"\n >\n <li\n v-for=\"issue in issues\"\n :key=\"`${issue.ruleId}-${issue.blockId ?? 'template'}`\"\n class=\"tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5\"\n >\n <span class=\"tpl:text-xs tpl:text-[var(--tpl-text)]\">\n {{ issue.message }}\n </span>\n <span\n class=\"tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ issue.ruleId }}\n </span>\n </li>\n </ul>\n\n <footer class=\"tpl:flex tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n data-testid=\"cloud-save-gate-cancel\"\n :class=\"secondaryBtnClass\"\n @click=\"emit('cancel')\"\n >\n {{ cloudT.saveGate.cancel }}\n </button>\n <button\n type=\"button\"\n data-testid=\"cloud-save-gate-confirm\"\n :class=\"dangerBtnClass\"\n @click=\"emit('confirm')\"\n >\n {{ cloudT.saveGate.confirm }}\n </button>\n </footer>\n </div>\n </TplModal>\n</template>\n","<script setup lang=\"ts\">\nimport type { UseEditorReturn } from \"@templatical/core\";\n\nimport type { UseEditorCoreReturn } from \"../../composables/useEditorCore\";\nimport type { CloudAttachment, CloudReady, CloudRuntime } from \"../runtime\";\n\nimport CloudErrorOverlay from \"./CloudErrorOverlay.vue\";\nimport CloudLoadingOverlay from \"./CloudLoadingOverlay.vue\";\nimport CloudSaveGateModal from \"./CloudSaveGateModal.vue\";\n\n/**\n * Every piece of Cloud chrome that renders outside the header.\n *\n * `Editor.vue` mounts this behind one lazy `defineAsyncComponent` gated on a\n * cloud runtime being present, so an OSS consumer downloads none of it — the\n * `SavedBlocksPanels` / `TestEmailPanel` pattern.\n *\n * The overlays live here rather than in the shared editor deliberately: `init()`\n * cannot fail after it mounts, and OSS should not grow the ability.\n *\n * The comments sidebar is deliberately not here: it is shared, as `CommentsPanel`\n * in `Editor.vue` over a `CommentsProvider`. Its filter target lives on the shared\n * feature rather than being relayed through this component, so it survives the\n * lazy panel's mount without a runtime hop.\n *\n * The media library is not here either: it is shared, as `MediaPanels` in\n * `Editor.vue` over a `MediaProvider`. Cloud supplies that provider; it does\n * not mount a second modal.\n */\ndefineProps<{\n editor: UseEditorReturn;\n core: UseEditorCoreReturn;\n runtime: CloudRuntime;\n cloud: CloudAttachment;\n ready: CloudReady;\n}>();\n</script>\n\n<template>\n <!-- A template create / load in flight. Cloud reads its content from the\n server, so there is a real gap where the canvas shows the wrong thing. -->\n <Transition\n enter-active-class=\"tpl:transition-opacity tpl:duration-200\"\n enter-from-class=\"tpl:opacity-100\"\n enter-to-class=\"tpl:opacity-100\"\n leave-active-class=\"tpl:transition-opacity tpl:duration-300\"\n leave-from-class=\"tpl:opacity-100\"\n leave-to-class=\"tpl:opacity-0\"\n >\n <CloudLoadingOverlay :visible=\"editor.state.isLoading\" />\n </Transition>\n\n <!-- Session failure — an auth refresh that could not renew the token. The\n *bootstrap* has no overlay any more: it runs before the mount, so a\n failure there rejects `initCloud()` instead of mounting a dead editor. -->\n <Transition\n enter-active-class=\"tpl:transition-opacity tpl:duration-200\"\n enter-from-class=\"tpl:opacity-0\"\n enter-to-class=\"tpl:opacity-100\"\n leave-active-class=\"tpl:transition-opacity tpl:duration-300\"\n leave-from-class=\"tpl:opacity-100\"\n leave-to-class=\"tpl:opacity-0\"\n >\n <CloudErrorOverlay\n :error=\"ready.sessionError.value\"\n :visible=\"!!ready.sessionError.value\"\n @retry=\"ready.retry\"\n />\n </Transition>\n\n <CloudSaveGateModal\n :open=\"ready.saveGate.modalOpen.value\"\n :issues=\"ready.saveGate.blockingIssues.value\"\n @cancel=\"ready.saveGate.cancel\"\n @confirm=\"ready.saveGate.confirmAndSave\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport type { UseEditorReturn } from \"@templatical/core\";\n\nimport type { UseEditorCoreReturn } from \"../../composables/useEditorCore\";\nimport type { CloudAttachment, CloudReady, CloudRuntime } from \"../runtime\";\n\nimport CloudErrorOverlay from \"./CloudErrorOverlay.vue\";\nimport CloudLoadingOverlay from \"./CloudLoadingOverlay.vue\";\nimport CloudSaveGateModal from \"./CloudSaveGateModal.vue\";\n\n/**\n * Every piece of Cloud chrome that renders outside the header.\n *\n * `Editor.vue` mounts this behind one lazy `defineAsyncComponent` gated on a\n * cloud runtime being present, so an OSS consumer downloads none of it — the\n * `SavedBlocksPanels` / `TestEmailPanel` pattern.\n *\n * The overlays live here rather than in the shared editor deliberately: `init()`\n * cannot fail after it mounts, and OSS should not grow the ability.\n *\n * The comments sidebar is deliberately not here: it is shared, as `CommentsPanel`\n * in `Editor.vue` over a `CommentsProvider`. Its filter target lives on the shared\n * feature rather than being relayed through this component, so it survives the\n * lazy panel's mount without a runtime hop.\n *\n * The media library is not here either: it is shared, as `MediaPanels` in\n * `Editor.vue` over a `MediaProvider`. Cloud supplies that provider; it does\n * not mount a second modal.\n */\ndefineProps<{\n editor: UseEditorReturn;\n core: UseEditorCoreReturn;\n runtime: CloudRuntime;\n cloud: CloudAttachment;\n ready: CloudReady;\n}>();\n</script>\n\n<template>\n <!-- A template create / load in flight. Cloud reads its content from the\n server, so there is a real gap where the canvas shows the wrong thing. -->\n <Transition\n enter-active-class=\"tpl:transition-opacity tpl:duration-200\"\n enter-from-class=\"tpl:opacity-100\"\n enter-to-class=\"tpl:opacity-100\"\n leave-active-class=\"tpl:transition-opacity tpl:duration-300\"\n leave-from-class=\"tpl:opacity-100\"\n leave-to-class=\"tpl:opacity-0\"\n >\n <CloudLoadingOverlay :visible=\"editor.state.isLoading\" />\n </Transition>\n\n <!-- Session failure — an auth refresh that could not renew the token. The\n *bootstrap* has no overlay any more: it runs before the mount, so a\n failure there rejects `initCloud()` instead of mounting a dead editor. -->\n <Transition\n enter-active-class=\"tpl:transition-opacity tpl:duration-200\"\n enter-from-class=\"tpl:opacity-0\"\n enter-to-class=\"tpl:opacity-100\"\n leave-active-class=\"tpl:transition-opacity tpl:duration-300\"\n leave-from-class=\"tpl:opacity-100\"\n leave-to-class=\"tpl:opacity-0\"\n >\n <CloudErrorOverlay\n :error=\"ready.sessionError.value\"\n :visible=\"!!ready.sessionError.value\"\n @retry=\"ready.retry\"\n />\n </Transition>\n\n <CloudSaveGateModal\n :open=\"ready.saveGate.modalOpen.value\"\n :issues=\"ready.saveGate.blockingIssues.value\"\n @cancel=\"ready.saveGate.cancel\"\n @confirm=\"ready.saveGate.conf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AAqC,CAAA,CAAc;KACrB,SAAK,AAAAgB,EAAA,QAAA,MAAEN,EAAI,SAAA;IAET,GAAA7C,EAAAF,EAAAgD,CAAA,CAAM,CAAC,SAAS,OAAO,GAAA,CAAA,C;;;;;;;;;;;;;;;;GE/ClCrC,EASaC,GAAA;IARX,sBAAmB;IACnB,oBAAiB;IACjB,kBAAe;IACf,sBAAmB;IACnB,oBAAiB;IACjB,kBAAe;;IAEf,SAAAC,QAAyD,CAAzDF,EAAyDG,GAAA,EAAnC,SAASsC,EAAA,OAAO,MAAM,U;;;GAM9CzC,EAaaC,GAAA;IAZX,sBAAmB;IACnB,oBAAiB;IACjB,kBAAe;IACf,sBAAmB;IACnB,oBAAiB;IACjB,kBAAe;;IAEf,SAAAC,QAIE,CAJFF,EAIEI,GAAA;KAHC,OAAOqC,EAAA,MAAM,aAAa;KAC1B,SAAO,CAAA,CAAIA,EAAA,MAAM,aAAa;KAC9B,SAAOA,EAAA,MAAM;;;;;;;;GAIlBzC,EAKEK,GAAA;IAJC,MAAMoC,EAAA,MAAM,SAAS,UAAU;IAC/B,QAAQA,EAAA,MAAM,SAAS,eAAe;IACtC,UAAQA,EAAA,MAAM,SAAS;IACvB,WAASA,EAAA,MAAM,SAAS"}
@@ -1,18 +0,0 @@
1
- import { C as e, F as t, S as n, ct as r, g as i, h as a } from "./draggable-DepKdldn.js";
2
- // src/components/CommentsPanel.vue
3
- var o = /* @__PURE__ */ e({
4
- __name: "CommentsPanel",
5
- props: { feature: {} },
6
- setup(e) {
7
- let o = n(() => import("./CommentsSidebar-DTold7iy.js"));
8
- return (n, s) => e.feature.isOpen.value ? (t(), a(r(o), {
9
- key: 0,
10
- visible: e.feature.isOpen.value,
11
- feature: e.feature,
12
- onClose: s[0] ||= (t) => e.feature.close()
13
- }, null, 8, ["visible", "feature"])) : i("", !0);
14
- }
15
- });
16
- export { o as default };
17
-
18
- //# sourceMappingURL=CommentsPanel-lgjJNrrY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommentsPanel-lgjJNrrY.js","names":["_openBlock","_createBlock","_unref","_createCommentVNode","_sfc_main","defineComponent","openBlock","defineAsyncComponent","unref","createCommentVNode","createBlock","CommentsPanel_default","CommentsSidebar","__props","_cache"],"sources":["../../../src/components/CommentsPanel.vue","../../../src/components/CommentsPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Mount point for the comments sidebar, shared by both entry points.\n *\n * The sidebar is `defineAsyncComponent` behind a `v-if` on its open state, so its\n * chunk is fetched only when the user actually opens the panel. `Editor.vue` in\n * turn lazy-loads *this* wrapper and renders it only when a `CommentsProvider` and\n * a `user` are configured, so a consumer with neither downloads none of it —\n * the `TestEmailPanel` / `SavedBlocksPanels` shape.\n *\n * Never static-import `CommentsSidebar` into `Editor.vue`: that collapses the\n * whole panel into the main entry for every consumer. Guarded by\n * `tests/cdn-chunk-granularity.test.ts`.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { UseCommentsFeatureReturn } from \"../composables/useCommentsFeature\";\n\ndefineProps<{\n feature: UseCommentsFeatureReturn;\n}>();\n\nconst CommentsSidebar = defineAsyncComponent(\n () => import(\"./CommentsSidebar.vue\"),\n);\n</script>\n\n<template>\n <CommentsSidebar\n v-if=\"feature.isOpen.value\"\n :visible=\"feature.isOpen.value\"\n :feature=\"feature\"\n @close=\"feature.close()\"\n />\n</template>\n","<script setup lang=\"ts\">\n/**\n * Mount point for the comments sidebar, shared by both entry points.\n *\n * The sidebar is `defineAsyncComponent` behind a `v-if` on its open state, so its\n * chunk is fetched only when the user actually opens the panel. `Editor.vue` in\n * turn lazy-loads *this* wrapper and renders it only when a `CommentsProvider` and\n * a `user` are configured, so a consumer with neither downloads none of it —\n * the `TestEmailPanel` / `SavedBlocksPanels` shape.\n *\n * Never static-import `CommentsSidebar` into `Editor.vue`: that collapses the\n * whole panel into the main entry for every consumer. Guarded by\n * `tests/cdn-chunk-granularity.test.ts`.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { UseCommentsFeatureReturn } from \"../composables/useCommentsFeature\";\n\ndefineProps<{\n feature: UseCommentsFeatureReturn;\n}>();\n\nconst CommentsSidebar = defineAsyncComponent(\n () => import(\"./CommentsSidebar.vue\"),\n);\n</script>\n\n<template>\n <CommentsSidebar\n v-if=\"feature.isOpen.value\"\n :visible=\"feature.isOpen.value\"\n :feature=\"feature\"\n @close=\"feature.close()\"\n />\n</template>\n"],"mappings":";;;;;;EAqBA,IAAMY,IAAkBL,QAChB,OAAO,gCACf;E,iBAKUM,EAAA,QAAQ,OAAO,SADvBb,EAAA,GAAAC,EAKEC,EAAAU,CAAA,GAAA;;GAHC,SAASC,EAAA,QAAQ,OAAO;GACxB,SAASA,EAAA;GACT,SAAK,AAAAC,EAAA,QAAA,MAAED,EAAA,QAAQ,MAAK"}