@templatical/editor 0.52.0 → 0.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiAltTextPopover-Cm11CsKH.js → AiAltTextPopover-DawbUywc.js} +13 -13
- package/dist/{AiAltTextReview-DE8t8Rud.js → AiAltTextReview-9ySsXOTU.js} +22 -22
- package/dist/{AiChatPanel-7ftS7d40.js → AiChatPanel-CupPhmsN.js} +137 -137
- package/dist/{AiPanels-CxGp6klr.js → AiPanels-DqT4PgQ0.js} +4 -4
- package/dist/{AiRewriteMenu-DNI-5CUj.js → AiRewriteMenu-28agTycW.js} +62 -62
- package/dist/BlockIssueBadge-BxpDy3u-.js +33 -0
- package/dist/{BlockPreviewCanvas-Df9iz7sK.js → BlockPreviewCanvas-B-4bmJ3t.js} +23 -23
- package/dist/{CloudHeaderExtras-CsgyNNV1.js → CloudHeaderExtras-QI82yF54.js} +3 -3
- package/dist/{CloudPanels-BDV4XQ_l.js → CloudPanels-BKJaLkUN.js} +50 -50
- package/dist/{CollaborationNotices-JQ3vQoqO.js → CollaborationNotices-CTw4JThq.js} +11 -11
- package/dist/{CollaboratorBar-EeqqWcX6.js → CollaboratorBar-CXQqN3VP.js} +15 -15
- package/dist/{CommentsPanel-BuftXc0U.js → CommentsPanel-DwwFuh1h.js} +2 -2
- package/dist/CommentsSidebar-9ZfiC2DO.js +500 -0
- package/dist/{CountdownBlock-BT3ZTH1F.js → CountdownBlock-CU2yTWtF.js} +20 -20
- package/dist/{CountdownToolbar-CrL4WKy9.js → CountdownToolbar-BqoYzf_6.js} +53 -53
- package/dist/IssuesPanel-4ykrf1ax.js +359 -0
- package/dist/{LoadingTrack-DZA5AoP9.js → LoadingTrack-DM4g6j7b.js} +1 -1
- package/dist/{LogicTagInsertButton-CSD9cfJB.js → LogicTagInsertButton-CfscnwCn.js} +234 -234
- package/dist/{MediaEditModal-DQl5w44r.js → MediaEditModal-Dy08GEwE.js} +446 -446
- package/dist/{MediaPanels-BFWYuJot.js → MediaPanels-BgEp7iCp.js} +2 -2
- package/dist/{MergeTagInput-DE7kWwXx.js → MergeTagInput-B9dtUthD.js} +11 -11
- package/dist/{MergeTagModeToggle-DvD0ne7N.js → MergeTagModeToggle-DxujhYJ4.js} +30 -30
- package/dist/{MergeTagTextarea-DVPQkiYY.js → MergeTagTextarea-CPFEjJZd.js} +11 -11
- package/dist/{ParagraphEditor-D-nqs82g.js → ParagraphEditor-CWXfurGh.js} +201 -201
- package/dist/{RestoreVersionDialog-DqUPsLB9.js → RestoreVersionDialog-C4s_JYCx.js} +14 -14
- package/dist/{RichTextEditorContent-Xq9D0Zs3.js → RichTextEditorContent-o6HmE8GR.js} +40 -39
- package/dist/{SaveBlockDialog-DAPv70p4.js → SaveBlockDialog-CWLrly6l.js} +56 -56
- package/dist/SavedBlocksBrowserModal-CE8n4EBS.js +359 -0
- package/dist/{SavedBlocksPanels-ChbL9v9x.js → SavedBlocksPanels-BE1N9rNZ.js} +6 -6
- package/dist/{SavedBlocksPickBar-hRaiLNdu.js → SavedBlocksPickBar-Dwl94xhP.js} +12 -12
- package/dist/{TemplateSettings-D0XcH32O.js → TemplateSettings-CS0f1Ues.js} +74 -74
- package/dist/{TestEmailModal-Cb5t0yB2.js → TestEmailModal-DBD0X5nV.js} +52 -52
- package/dist/{TestEmailPanel-COJQa2A9.js → TestEmailPanel-DaFjP9QK.js} +2 -2
- package/dist/{TitleEditor-BYk_9SpQ.js → TitleEditor-DSqtle77.js} +75 -75
- package/dist/{ToggleSwitch-poGWbduy.js → ToggleSwitch-JykPyD_8.js} +4 -4
- package/dist/{Toolbar-Dku_pZni.js → Toolbar-BZPFfKrf.js} +913 -913
- package/dist/{TplModal-9IndEYk5.js → TplModal-DLMssVlt.js} +15 -15
- package/dist/{VersionHistoryMenu-BG5qayvg.js → VersionHistoryMenu-BkbYUs0Q.js} +35 -35
- package/dist/{VersionHistoryPanels-hPg7Q5-f.js → VersionHistoryPanels-DP7HaYWv.js} +4 -4
- package/dist/{VersionPreviewBanner-CSs7zum_.js → VersionPreviewBanner-DECaBwLq.js} +9 -9
- package/dist/{WrapperBlock-DwjK_IdJ.js → WrapperBlock-BsJv_Fiw.js} +16 -16
- package/dist/{blockTypeIcons-yt7SLzub.js → blockTypeIcons-BHjlPnPf.js} +23 -22
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiAltTextPopover-DjMoJCgU.js → AiAltTextPopover-SEEjkd-I.js} +21 -21
- package/dist/cdn/chunks/{AiAltTextPopover-DjMoJCgU.js.map → AiAltTextPopover-SEEjkd-I.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js → AiAltTextReview-BGLLSKLm.js} +41 -41
- package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js.map → AiAltTextReview-BGLLSKLm.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-DXeZgc7D.js → AiChatPanel-DKDAaBNi.js} +127 -127
- package/dist/cdn/chunks/{AiChatPanel-DXeZgc7D.js.map → AiChatPanel-DKDAaBNi.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js → AiPanels-0wBarZSH.js} +3 -3
- package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js.map → AiPanels-0wBarZSH.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js → AiRewriteMenu-qf-cfEpy.js} +43 -43
- package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js.map → AiRewriteMenu-qf-cfEpy.js.map} +1 -1
- package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +34 -0
- package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +1 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js → BlockPreviewCanvas-DGBh6mqe.js} +20 -20
- package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js.map → BlockPreviewCanvas-DGBh6mqe.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js → CloudHeaderExtras-BMNK_F9p.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js.map → CloudHeaderExtras-BMNK_F9p.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js → CloudPanels-JMWIoVWh.js} +32 -32
- package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js.map → CloudPanels-JMWIoVWh.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-Hf8r08Sw.js → CollaborationNotices-Bsf1rGW9.js} +12 -12
- package/dist/cdn/chunks/{CollaborationNotices-Hf8r08Sw.js.map → CollaborationNotices-Bsf1rGW9.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js → CollaboratorBar-CXByAoUz.js} +14 -14
- package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js.map → CollaboratorBar-CXByAoUz.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js → CommentsPanel-DoJnKLXI.js} +3 -3
- package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js.map → CommentsPanel-DoJnKLXI.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-Dj8sDiLN.js → CommentsSidebar-CUtgvdBC.js} +100 -99
- package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js → CountdownBlock-BqRw147R.js} +18 -18
- package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js.map → CountdownBlock-BqRw147R.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CguFJdqn.js → CountdownToolbar-xobieKoU.js} +26 -26
- package/dist/cdn/chunks/{CountdownToolbar-CguFJdqn.js.map → CountdownToolbar-xobieKoU.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js → IssuesPanel-C7LfxaAY.js} +75 -75
- package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js.map → IssuesPanel-C7LfxaAY.js.map} +1 -1
- package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js → LoadingTrack-CZuLTazv.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js.map → LoadingTrack-CZuLTazv.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js → LogicTagInsertButton-BIi05UQu.js} +250 -250
- package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js.map → LogicTagInsertButton-BIi05UQu.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js → MediaEditModal-Cpcod6_U.js} +148 -148
- package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js.map → MediaEditModal-Cpcod6_U.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js → MediaPanels-BIdcW_1f.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js.map → MediaPanels-BIdcW_1f.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js → MergeTagInput-BvWg8o5E.js} +32 -32
- package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js.map → MergeTagInput-BvWg8o5E.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js → MergeTagModeToggle-BgKEVUtV.js} +27 -27
- package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js.map → MergeTagModeToggle-BgKEVUtV.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-Zo0mYWbf.js → MergeTagTextarea-tBz8McZf.js} +32 -32
- package/dist/cdn/chunks/{MergeTagTextarea-Zo0mYWbf.js.map → MergeTagTextarea-tBz8McZf.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DsPLVAgm.js → ParagraphEditor-B3Rj_cWF.js} +191 -191
- package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js → RestoreVersionDialog-CjOdD2xj.js} +19 -19
- package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js.map → RestoreVersionDialog-CjOdD2xj.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js → RichTextEditorContent-DNjR_sNN.js} +29 -29
- package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js.map → RichTextEditorContent-DNjR_sNN.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js → SaveBlockDialog-CUhpawq0.js} +75 -75
- package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js.map → SaveBlockDialog-CUhpawq0.js.map} +1 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js +356 -0
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-B9XCjDfm.js.map → SavedBlocksBrowserModal-BPYcRoGa.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js → SavedBlocksPanels-C6--Bc81.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js.map → SavedBlocksPanels-C6--Bc81.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js → SavedBlocksPickBar-DUavxpbU.js} +14 -14
- package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js.map → SavedBlocksPickBar-DUavxpbU.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-jWpmuWDR.js → TemplateSettings-CKtI-dof.js} +69 -69
- package/dist/cdn/chunks/{TemplateSettings-jWpmuWDR.js.map → TemplateSettings-CKtI-dof.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js → TestEmailModal-CDQTgESD.js} +65 -65
- package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js.map → TestEmailModal-CDQTgESD.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js → TestEmailPanel-CcUpEpAn.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js.map → TestEmailPanel-CcUpEpAn.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-R2lQw6WA.js → TitleEditor-Cob7RLyK.js} +70 -70
- package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +1 -0
- package/dist/cdn/chunks/{ToggleSwitch-BDMugNES.js → ToggleSwitch-J7Vwhvha.js} +5 -5
- package/dist/cdn/chunks/{ToggleSwitch-BDMugNES.js.map → ToggleSwitch-J7Vwhvha.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-CnvfW72e.js → Toolbar-CdpsvNOR.js} +893 -893
- package/dist/cdn/chunks/{Toolbar-CnvfW72e.js.map → Toolbar-CdpsvNOR.js.map} +1 -1
- package/dist/cdn/chunks/TplModal-CFPDgbwQ.js +51 -0
- package/dist/cdn/chunks/{TplModal-BDyeS69p.js.map → TplModal-CFPDgbwQ.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js → VersionHistoryMenu-BYlLRvRJ.js} +32 -32
- package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js.map → VersionHistoryMenu-BYlLRvRJ.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js → VersionHistoryPanels-C6SOVoiT.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js.map → VersionHistoryPanels-C6SOVoiT.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-CZ--HOoa.js → VersionPreviewBanner-Dvg0ZfAW.js} +10 -10
- package/dist/cdn/chunks/{VersionPreviewBanner-CZ--HOoa.js.map → VersionPreviewBanner-Dvg0ZfAW.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-D3obNGab.js → WrapperBlock-C7Md56IT.js} +13 -13
- package/dist/cdn/chunks/{WrapperBlock-D3obNGab.js.map → WrapperBlock-C7Md56IT.js.map} +1 -1
- package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js +21 -0
- package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js → createCloudRuntime-Cth2JCEh.js} +36 -36
- package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js.map → createCloudRuntime-Cth2JCEh.js.map} +1 -1
- package/dist/cdn/chunks/{dist-C2epoAwW.js → dist-8ym3y-pH.js} +43 -43
- package/dist/cdn/chunks/{dist-C2epoAwW.js.map → dist-8ym3y-pH.js.map} +1 -1
- package/dist/{dist-BA-jTQgw.js → cdn/chunks/dist-BMzNabtD.js} +106 -107
- package/dist/cdn/chunks/{dist-CONcGNwy.js.map → dist-BMzNabtD.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-B8hTTYFO.js → draggable-Du8AUMFT.js} +639 -636
- package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js → editor-modal-CyCe560f.js} +891 -891
- package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js.map → editor-modal-CyCe560f.js.map} +1 -1
- package/dist/cdn/chunks/en-TIqv4ag3.js +1 -0
- package/dist/cdn/chunks/{extensions-ClDhn88e.js → extensions-CFF2KWy-.js} +55 -55
- package/dist/cdn/chunks/{extensions-ClDhn88e.js.map → extensions-CFF2KWy-.js.map} +1 -1
- package/dist/cdn/chunks/{icons-HCBP93Ch.js → icons-okSPsLOa.js} +99 -97
- package/dist/cdn/chunks/icons-okSPsLOa.js.map +1 -0
- package/dist/cdn/chunks/{keys-BF9gazbd.js → keys-CUj6UA38.js} +2 -2
- package/dist/cdn/chunks/{keys-BF9gazbd.js.map → keys-CUj6UA38.js.map} +1 -1
- package/dist/cdn/chunks/{liquid.browser-DkLBNrft.js → liquid.browser-rubac0VA.js} +782 -746
- package/dist/cdn/chunks/liquid.browser-rubac0VA.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-DpHCSESZ.js → normalizeMergeTagMarkup-C_KlfSW4.js} +2 -2
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-DpHCSESZ.js.map → normalizeMergeTagMarkup-C_KlfSW4.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js → preRenderCustomBlocks-BcXIz7oJ.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js.map → preRenderCustomBlocks-BcXIz7oJ.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-B2h15u0_.js → sanitizeHtml-CN85EDrO.js} +2 -2
- package/dist/cdn/chunks/{sanitizeHtml-B2h15u0_.js.map → sanitizeHtml-CN85EDrO.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-rJoqO1TJ.js → socialIcons-jsTDmkbb.js} +480 -480
- package/dist/cdn/chunks/{socialIcons-rJoqO1TJ.js.map → socialIcons-jsTDmkbb.js.map} +1 -1
- package/dist/cdn/chunks/{src-CUH_EI7k.js → src-C7bkofBL.js} +6 -6
- package/dist/cdn/chunks/{src-CUH_EI7k.js.map → src-C7bkofBL.js.map} +1 -1
- package/dist/cdn/chunks/{src-BKpAis_q.js → src-DEd87i_U.js} +2 -2
- package/dist/cdn/chunks/{src-BKpAis_q.js.map → src-DEd87i_U.js.map} +1 -1
- package/dist/cdn/chunks/{src-C9DTvn1H.js → src-DwWrYnUj.js} +3 -22
- package/dist/cdn/chunks/src-DwWrYnUj.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-ChSZybTi.js → tiptap-CbiTlECY.js} +45 -45
- package/dist/cdn/chunks/{tiptap-ChSZybTi.js.map → tiptap-CbiTlECY.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js → useCloudI18n-DY8_-ETE.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js.map → useCloudI18n-DY8_-ETE.js.map} +1 -1
- package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +2582 -0
- package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +1 -0
- package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-BT3c9CXj.js.map → useEditorRoot-vjZJwKrV.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-11iqzC6m.js → useI18n-D8pY4LTq.js} +3 -3
- package/dist/cdn/chunks/{useI18n-11iqzC6m.js.map → useI18n-D8pY4LTq.js.map} +1 -1
- package/dist/{useLogicTag-DFDYJeMN.js → cdn/chunks/useLogicTag-DBJDtpKA.js} +5 -3
- package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js.map → useLogicTag-DBJDtpKA.js.map} +1 -1
- package/dist/{useMergeTag-B46vACAG.js → cdn/chunks/useMergeTag-B-aG--s1.js} +7 -5
- package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js.map → useMergeTag-B-aG--s1.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-AnVIwiVv.js → usePopoverPosition-DSMtmu2W.js} +4 -4
- package/dist/cdn/chunks/{usePopoverPosition-AnVIwiVv.js.map → usePopoverPosition-DSMtmu2W.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js → useScrollToBlock-vjQ0fe-L.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js.map → useScrollToBlock-vjQ0fe-L.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js → withCurrentFont-hZTvYBHO.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js.map → withCurrentFont-hZTvYBHO.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +1422 -1422
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-N3x4z_rH.js → check-BZ8o0eet.js} +1 -1
- package/dist/{chevron-down-gXu9qNwO.js → chevron-down-DfAAfILv.js} +1 -1
- package/dist/{chevron-right-rL0ayGk5.js → chevron-right-Bk4mGdr7.js} +1 -1
- package/dist/{chevron-up-0ugh8HnW.js → chevron-up-MhUf_azW.js} +1 -1
- package/dist/{circle-alert-B9Ls75B5.js → circle-alert-CShJwVFv.js} +1 -1
- package/dist/{clock-BqHBaCLm.js → clock-CTfD6OCt.js} +1 -1
- package/dist/{createCloudRuntime-B5VIdnwz.js → createCloudRuntime-DCgO4A1r.js} +24 -24
- package/dist/{createLucideIcon-BV7Gwz_Z.js → createLucideIcon-CvhTA2KG.js} +6 -6
- package/dist/{cdn/chunks/dist-CONcGNwy.js → dist-ByCWA2Tv.js} +100 -99
- package/dist/{dist-CzrLYq2s.js → dist-CKi_npZM.js} +2 -21
- package/dist/{dist-CEdyyDn7.js → dist-CVy-7PHQ.js} +54 -54
- package/dist/{dist-DDN7yR-w.js → dist-D6cMdrfG.js} +129 -129
- package/dist/{editor-modal-Du9VI9q4.js → editor-modal-zaZHcmlO.js} +812 -812
- package/dist/en-Db76vJbY.js +1 -0
- package/dist/{extensions-FRYhx7qa.js → extensions-fo_c-vqf.js} +32 -32
- package/dist/{eye-BKj9Tfnc.js → eye-7W4t5e0Q.js} +1 -1
- package/dist/{image-DNdvdTla.js → image-BDiRFzSd.js} +1 -1
- package/dist/{info-Bx-kBkbH.js → info-Cxi3-Kh9.js} +1 -1
- package/dist/{keys-DBjrQkYH.js → keys-BgRERHzu.js} +1 -1
- package/dist/{link-D8-rYdIQ.js → link-ju_2Cmir.js} +1 -1
- package/dist/{liquid.browser-D1RxawkY.js → liquid.browser-DUXEekoN.js} +781 -745
- package/dist/{list-BneisA27.js → list-DYZJf0aZ.js} +1 -1
- package/dist/{loader-circle-DBEXphyx.js → loader-circle-BZRD0a4I.js} +1 -1
- package/dist/{message-circle-Bg4xInCM.js → message-circle-DuEw4Zfx.js} +1 -1
- package/dist/{normalizeMergeTagMarkup-IH8COHzd.js → normalizeMergeTagMarkup-CELnOlgK.js} +1 -1
- package/dist/{package-B40Vkfsp.js → package-CePMr2kK.js} +1 -1
- package/dist/{pencil-CYdAHTds.js → pencil-D3aFCL7c.js} +1 -1
- package/dist/{preRenderCustomBlocks-AbZArwkR.js → preRenderCustomBlocks--_xc0XK3.js} +1 -1
- package/dist/{refresh-cw-Bb1FWrU0.js → refresh-cw-xnro7_Sk.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-CLGymEyk.js → runtime-dom.esm-bundler-BURR-bj5.js} +118 -118
- package/dist/{sanitizeHtml-CnOA1efV.js → sanitizeHtml-BzfzpYJY.js} +1 -1
- package/dist/{search-BZEo08gi.js → search-CDrstRBv.js} +1 -1
- package/dist/{send-DHtrnXQs.js → send-DROkPOaX.js} +1 -1
- package/dist/{smartphone-dlN3vpA3.js → smartphone-Bx6u_tjn.js} +1 -1
- package/dist/{socialIcons-B_d52_eS.js → socialIcons-D7MGsg0d.js} +366 -366
- package/dist/{sparkles-NOttoDnJ.js → sparkles-CdaTtvoz.js} +1 -1
- package/dist/{square-B1CJgdt2.js → square-BbCROH_f.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +1096 -1096
- package/dist/{text-align-start-zpoXmb-Z.js → text-align-start-CGacJ9Vw.js} +1 -1
- package/dist/{trash-CGbk4Sgt.js → trash-DxCd7zIy.js} +1 -1
- package/dist/{triangle-alert-CKLMyGVp.js → triangle-alert-7_oaitpf.js} +1 -1
- package/dist/{upload-DQoackAn.js → upload-DuFEOi_0.js} +1 -1
- package/dist/{useCloudI18n-DcLtxOQZ.js → useCloudI18n-DEMmUKuO.js} +2 -2
- package/dist/{useEditorCore-DG9UvWUm.js → useEditorCore-BSo2sSID.js} +1518 -1470
- package/dist/useEditorRoot-BMcoCLBx.js +7 -0
- package/dist/{useI18n-CeTm777E.js → useI18n-BBrHTdu8.js} +2 -2
- package/dist/{cdn/chunks/useLogicTag-vy5KGg5D.js → useLogicTag-ZPC39rfH.js} +3 -5
- package/dist/{cdn/chunks/useMergeTag-BFBBjnwh.js → useMergeTag-BQ4qqWpQ.js} +5 -7
- package/dist/{usePopoverPosition-C42kD7zt.js → usePopoverPosition-DV1PxL66.js} +3 -3
- package/dist/{useScrollToBlock-C-NzvjeO.js → useScrollToBlock-BSyAV4pk.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-CrlI8j5R.js → vue.runtime.esm-bundler-CnEeTfhs.js} +993 -990
- package/dist/{withCurrentFont-v_a4Oso8.js → withCurrentFont-B22FXAF5.js} +1 -1
- package/dist/{x-zcrnmcmU.js → x-BpfG7v9g.js} +1 -1
- package/package.json +10 -10
- package/dist/BlockIssueBadge-6Ri2FfX-.js +0 -33
- package/dist/CommentsSidebar-Co3x4uH0.js +0 -499
- package/dist/IssuesPanel-BHFQ3wrP.js +0 -359
- package/dist/SavedBlocksBrowserModal-SRtN5h9q.js +0 -359
- package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js +0 -34
- package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-B9XCjDfm.js +0 -356
- package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js.map +0 -1
- package/dist/cdn/chunks/TplModal-BDyeS69p.js +0 -51
- package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js +0 -21
- package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js.map +0 -1
- package/dist/cdn/chunks/draggable-B8hTTYFO.js.map +0 -1
- package/dist/cdn/chunks/en-CKAXAo3Z.js +0 -1
- package/dist/cdn/chunks/icons-HCBP93Ch.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-DkLBNrft.js.map +0 -1
- package/dist/cdn/chunks/src-C9DTvn1H.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-CjaEV_01.js +0 -2534
- package/dist/cdn/chunks/useEditorCore-CjaEV_01.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-BT3c9CXj.js +0 -9
- package/dist/en-CyEE7FPY.js +0 -1
- package/dist/useEditorRoot-BKr6nNkC.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiChatPanel-DXeZgc7D.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","ref","nextTick","defineComponent","inject","renderList","renderSlot","openBlock","withCtx","watch","withDirectives","createElementBlock","createTextVNode","toDisplayString","createCommentVNode","createBlock","normalizeClass","createBaseVNode","vModelText","unref","computed","Fragment","createVNode","useTimeoutFn","useIntervalFn","UI_LOCALE_KEY","useI18n","Sparkles","Paperclip","CircleAlert","Square","LoaderCircle","Image","Send","Undo2","X","MessageSquarePlus","FileText","Redo2","LoadingTrack_default","_plugin_vue_export_helper_default","aiErrorMessage","secondaryBtnCompactClass","_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","_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","\"color\"","_hoisted_9","_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","AiChatPanel_default","props","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 { UI_LOCALE_KEY } from \"../../keys\";\nimport { validateChatAttachments } from \"../../utils/aiAttachments\";\nimport { aiErrorMessage } from \"../../utils/aiErrors\";\n\nconst props = defineProps<{ feature: UseAiFeatureReturn }>();\nconst emit = defineEmits<{ (e: \"close\"): void }>();\n\nconst { t, format } = useI18n();\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 <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 <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 { UI_LOCALE_KEY } from \"../../keys\";\nimport { validateChatAttachments } from \"../../utils/aiAttachments\";\nimport { aiErrorMessage } from \"../../utils/aiErrors\";\n\nconst props = defineProps<{ feature: UseAiFeatureReturn }>();\nconst emit = defineEmits<{ (e: \"close\"): void }>();\n\nconst { t, format } = useI18n();\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 <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 <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,IAAMyF,IAAOD;E,kBAIX/E,EAAA,GAAAC,EA2CM,OAAA;GA1CJ,MAAK;GACJ,cAAYgF,EAAA;GACZ,eAAaA,EAAA;GACd,OAAM;;GAGN/E,EA+BM,OA/BNV,GA+BM,CA5BJU,EAcM,OAdNT,GAcM,CAbJS,EAKM,OALNR,GAKM,CAFJS,EAA4DC,EAAAiD,CAAA,GAAA;IAAjD,MAAM;IAAK,gBAAc;IAAG,eAAY;G,IACnDnD,EAAqD,QAArDP,GAAqDU,EAAf4E,EAAA,KAAK,GAAA,CAAA,C,IAGrCA,EAAA,YADRjF,EAAA,GAAAC,EAMI,KANJL,GAMIS,EADC4E,EAAA,QAAQ,GAAA,CAAA,K,aAGf/E,EAYM,OAZNL,GAYM,CAXJU,EAAuB2E,EAAA,QAAA,SAAA,GACvBhF,EASS,UAAA;IARP,MAAK;IACL,eAAY;IACZ,OAAM;IACL,cAAY+E,EAAA;IACZ,OAAOA,EAAA;IACP,SAAK,AAAAE,EAAA,QAAA,MAAEH,EAAI,OAAA;G,IAEZ7E,EAAqDC,EAAAyD,CAAA,GAAA;IAAjD,MAAM;IAAK,gBAAc;IAAG,eAAY;;GAIlD3D,EAEM,OAFNH,GAEM,CADJQ,EAAQ2E,EAAA,QAAA,SAAA,C;GAEV3E,EAAsB2E,EAAA,QAAA,QAAA;;;A,IErDpBE,oBAAQ,IAAI,IAAI;CACpB;CACA;CACA;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,eAAY;MACX,OAAKW,EAAER,EAAAuD,CAAA,CAAwB;MAC/B,UAAUgF,EAAA;MACV,UAAK,MAAEwB,GAAWF,CAAI;K,IAGfA,EAAK,UADbjK,EAAA,GAAAU,EAKEN,EAAAmD,EAAA,GAAA;;MAHC,MAAM;MACN,gBAAc;MACf,eAAY;K,OAEdvD,EAAA,GAAAU,EAKEN,EAAA+C,EAAA,GAAA;;MAHC,MAAM;MACN,gBAAc;MACf,eAAY;K,KACZpC,EAAA,MACFJ,EAAGsJ,EAAK,SAAS7J,EAAAkI,CAAA,CAAC,CAAC,GAAG,KAAK,OAAOlI,EAAAkI,CAAA,CAAC,CAAC,GAAG,KAAK,IAAI,GAAA,CAAA,C;KAI5C2B,EAAK,WADbjK,EAAA,GAAAC,EAOI,KAPJiG,IAOIvF,EADCuJ,GAAYD,CAAI,CAAA,GAAA,CAAA,K;;IASrBX,EAAA,MAAS,WAAM,KAAUD,EAAA,MAAS,SAAM,KADhDrJ,EAAA,GAAAC,EA+BM,OA/BNkG,IA+BM,CAvBJ5F,EAsBM,OAtBN6F,IAsBM,EArBJpG,EAAA,EAAA,GAAAC,EAoBSO,GAAA,MAAAC,EAnBoB4I,EAAA,QAAnB,GAAS,OADnBrJ,EAAA,GAAAC,EAoBS,UAAA;KAlBN,KAAK4I;KACN,MAAK;KACL,eAAY;KACZ,OAAKjI,EAAA,CAAC,kMACiByI,EAAA,MAAS,SAAM,IAAOR,IAAQO,EAAA,Q;KAKrD,OAAA;MAAA,gBAAA;MAAAvD,OAAA;MAAA,oBAAA;MAAA,cAAA;KAAA;KAMC,UAAK,MAAEuE,GAAcC,CAAO;IAE1B,GAAA1J,EAAA0J,CAAO,GAAA,IAAAhE,EAAA,E"}
|
|
1
|
+
{"version":3,"file":"AiChatPanel-DKDAaBNi.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","nextTick","defineComponent","inject","withDirectives","renderList","renderSlot","openBlock","watch","withCtx","createElementBlock","createTextVNode","ref","toDisplayString","createCommentVNode","createBlock","createBaseVNode","vModelText","computed","unref","Fragment","normalizeClass","createVNode","useTimeoutFn","useIntervalFn","UI_LOCALE_KEY","useI18n","Sparkles","CircleAlert","Paperclip","Square","FileText","Image","LoaderCircle","Send","Undo2","X","MessageSquarePlus","Redo2","LoadingTrack_default","_plugin_vue_export_helper_default","aiErrorMessage","secondaryBtnCompactClass","_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","_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","\"color\"","_hoisted_9","_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","AiChatPanel_default","props","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 { UI_LOCALE_KEY } from \"../../keys\";\nimport { validateChatAttachments } from \"../../utils/aiAttachments\";\nimport { aiErrorMessage } from \"../../utils/aiErrors\";\n\nconst props = defineProps<{ feature: UseAiFeatureReturn }>();\nconst emit = defineEmits<{ (e: \"close\"): void }>();\n\nconst { t, format } = useI18n();\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 <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 <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 { UI_LOCALE_KEY } from \"../../keys\";\nimport { validateChatAttachments } from \"../../utils/aiAttachments\";\nimport { aiErrorMessage } from \"../../utils/aiErrors\";\n\nconst props = defineProps<{ feature: UseAiFeatureReturn }>();\nconst emit = defineEmits<{ (e: \"close\"): void }>();\n\nconst { t, format } = useI18n();\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 <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 <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,IAAMyF,IAAOD;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AAK,OAAOlI,EAAAkI,CAAA,CAAC,CAAC,GAAG,KAAK,IAAI,GAAA,CAAA,C;KAI5C2B,EAAK,WADbjK,EAAA,GAAAC,EAOI,KAPJiG,IAOIvF,EADCuJ,GAAYD,CAAI,CAAA,GAAA,CAAA,K;;IASrBX,EAAA,MAAS,WAAM,KAAUD,EAAA,MAAS,SAAM,KADhDrJ,EAAA,GAAAC,EA+BM,OA/BNkG,IA+BM,CAvBJ5F,EAsBM,OAtBN6F,IAsBM,EArBJpG,EAAA,EAAA,GAAAC,EAoBSO,GAAA,MAAAC,EAnBoB4I,EAAA,QAAnB,GAAS,OADnBrJ,EAAA,GAAAC,EAoBS,UAAA;KAlBN,KAAK4I;KACN,MAAK;KACL,eAAY;KACZ,OAAKjI,EAAA,CAAC,kMACiByI,EAAA,MAAS,SAAM,IAAOR,IAAQO,EAAA,Q;KAKrD,OAAA;MAAA,gBAAA;MAAAvD,OAAA;MAAA,oBAAA;MAAA,cAAA;KAAA;KAMC,UAAK,MAAEuE,GAAcC,CAAO;IAE1B,GAAA1J,EAAA0J,CAAO,GAAA,IAAAhE,EAAA,E"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as e, P as t, S as n,
|
|
1
|
+
import { C as e, P as t, S as n, W as r, d as i, g as a, h as o, n as s, p as c, z as l } from "./draggable-Du8AUMFT.js";
|
|
2
2
|
import { t as u } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
3
3
|
// src/components/ai/AiPanels.vue
|
|
4
4
|
var d = /*#__PURE__*/ u(/* @__PURE__ */ e({
|
|
5
5
|
__name: "AiPanels",
|
|
6
6
|
props: { feature: {} },
|
|
7
7
|
setup(e) {
|
|
8
|
-
let u = n(() => import("./AiChatPanel-
|
|
8
|
+
let u = n(() => import("./AiChatPanel-DKDAaBNi.js")), d = e, f = { chat: u }, p = c(() => {
|
|
9
9
|
let e = d.feature.panel.value;
|
|
10
10
|
return e !== null && e in f ? f[e] : null;
|
|
11
11
|
});
|
|
@@ -29,4 +29,4 @@ var d = /*#__PURE__*/ u(/* @__PURE__ */ e({
|
|
|
29
29
|
}), [["__scopeId", "data-v-3d8e197c"]]);
|
|
30
30
|
export { d as default };
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=AiPanels-
|
|
32
|
+
//# sourceMappingURL=AiPanels-0wBarZSH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiPanels-
|
|
1
|
+
{"version":3,"file":"AiPanels-0wBarZSH.js","names":["_openBlock","_createBlock","_Transition","_withCtx","_KeepAlive","_resolveDynamicComponent","_createCommentVNode","_sfc_main","defineComponent","openBlock","defineAsyncComponent","withCtx","KeepAlive","createCommentVNode","createBlock","Transition","computed","resolveDynamicComponent","_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,IAAcV,QAA2B,OAAO,4BAAoB,GAEpEW,IAAQC,GAERC,IAAS,EACb,MAAMH,EACR,GAEMI,IAAUR,QAAe;GAC7B,IAAMS,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,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ne, xt as re } from "./src-
|
|
3
|
-
import { $ as ie, F as ae, O as oe, P as se, X as ce, t as le } from "./keys-
|
|
4
|
-
import { t as ue } from "./useI18n-
|
|
5
|
-
import { t as de } from "./sanitizeHtml-
|
|
6
|
-
import { D as fe, T as pe, a as me,
|
|
7
|
-
import { r as _e } from "./normalizeMergeTagMarkup-
|
|
1
|
+
import { C as e, D as t, G as n, I as r, P as i, _ as a, b as o, et as s, ft as c, g as l, j as ee, m as u, o as te, p as d, st as f, u as p, ut as m, x as h } from "./draggable-Du8AUMFT.js";
|
|
2
|
+
import { n as ne, xt as re } from "./src-DwWrYnUj.js";
|
|
3
|
+
import { $ as ie, F as ae, O as oe, P as se, X as ce, t as le } from "./keys-CUj6UA38.js";
|
|
4
|
+
import { t as ue } from "./useI18n-D8pY4LTq.js";
|
|
5
|
+
import { t as de } from "./sanitizeHtml-CN85EDrO.js";
|
|
6
|
+
import { D as fe, T as pe, a as me, mt as he, t as ge } from "./icons-okSPsLOa.js";
|
|
7
|
+
import { r as _e } from "./normalizeMergeTagMarkup-C_KlfSW4.js";
|
|
8
8
|
import { n as ve } from "./aiErrors-C3QEMB0x.js";
|
|
9
9
|
import { n as ye, t as be } from "./aiRewritePreview-DlMyx6Si.js";
|
|
10
10
|
import { S as g, y as _ } from "./styleConstants-B8xVRiwX.js";
|
|
11
|
-
import { n as v } from "./ParagraphEditor-
|
|
11
|
+
import { n as v } from "./ParagraphEditor-B3Rj_cWF.js";
|
|
12
12
|
// src/components/ai/AiRewriteMenu.vue?vue&type=script&setup=true&lang.ts
|
|
13
13
|
var y = { class: "tpl:relative tpl:flex tpl:items-center" }, b = [
|
|
14
14
|
"aria-label",
|
|
@@ -23,22 +23,22 @@ var y = { class: "tpl:relative tpl:flex tpl:items-center" }, b = [
|
|
|
23
23
|
}, k = {
|
|
24
24
|
"data-testid": "ai-rewrite-preview",
|
|
25
25
|
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)]"
|
|
26
|
-
}, A = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, j = ["data-testid", "onClick"], M = { class: "tpl:flex tpl:items-center tpl:gap-2" }, N = ["disabled"], xe = { class: "tpl:flex tpl:items-end tpl:gap-2" }, Se = ["aria-label", "placeholder"],
|
|
26
|
+
}, A = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, j = ["data-testid", "onClick"], M = { class: "tpl:flex tpl:items-center tpl:gap-2" }, N = ["disabled"], xe = { class: "tpl:flex tpl:items-end tpl:gap-2" }, Se = ["aria-label", "placeholder"], P = ["disabled"], Ce = {
|
|
27
27
|
key: 0,
|
|
28
28
|
role: "alert",
|
|
29
29
|
"data-testid": "ai-rewrite-error",
|
|
30
30
|
class: "tpl:m-0 tpl:text-xs tpl:text-[var(--tpl-danger)]"
|
|
31
|
-
},
|
|
31
|
+
}, we = { class: "tpl:m-0 tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, F = /* @__PURE__ */ e({
|
|
32
32
|
__name: "AiRewriteMenu",
|
|
33
33
|
props: { editor: {} },
|
|
34
|
-
setup(
|
|
35
|
-
let F =
|
|
34
|
+
setup(e) {
|
|
35
|
+
let F = e, { t: I, format: Te } = ue(), Ee = ie(le, "AiRewriteMenu"), De = t(oe, ae), Oe = t(se, ne.liquid), L = t(ce, void 0), ke = [
|
|
36
36
|
"shorten",
|
|
37
37
|
"expand",
|
|
38
38
|
"friendlier",
|
|
39
39
|
"formal",
|
|
40
40
|
"fixGrammar"
|
|
41
|
-
], R = ye(L), z =
|
|
41
|
+
], R = ye(L), z = s(!1), B = s(R[0].value), V = s(""), H = s(!1), U = s(""), W = s(null), G = s(null), K = null, q = 0, J = d(() => W.value === null ? null : de(_e(W.value, De.value, Oe))), Ae = d(() => be(U.value)), Y = d(() => G.value ? ve(G.value, I.ai.errors, Te, L) : "");
|
|
42
42
|
function X() {
|
|
43
43
|
q++;
|
|
44
44
|
let e = K;
|
|
@@ -84,7 +84,7 @@ var y = { class: "tpl:relative tpl:flex tpl:items-center" }, b = [
|
|
|
84
84
|
function Me() {
|
|
85
85
|
J.value !== null && (F.editor.chain().focus().setContent(J.value, { emitUpdate: !0 }).run(), Q());
|
|
86
86
|
}
|
|
87
|
-
return ee(X), (e, t) => (i(),
|
|
87
|
+
return ee(X), (e, t) => (i(), a("div", y, [u("button", {
|
|
88
88
|
type: "button",
|
|
89
89
|
"data-testid": "ai-rewrite-trigger",
|
|
90
90
|
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)]",
|
|
@@ -97,17 +97,17 @@ var y = { class: "tpl:relative tpl:flex tpl:items-center" }, b = [
|
|
|
97
97
|
size: 16,
|
|
98
98
|
"stroke-width": 2,
|
|
99
99
|
"aria-hidden": "true"
|
|
100
|
-
}),
|
|
100
|
+
}), o(" " + c(f(I).ai.menu.button), 1)], 8, b), z.value ? (i(), a("div", {
|
|
101
101
|
key: 0,
|
|
102
102
|
role: "dialog",
|
|
103
103
|
"aria-label": f(I).ai.rewrite.title,
|
|
104
104
|
"data-testid": "ai-rewrite-panel",
|
|
105
105
|
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)]"
|
|
106
|
-
}, [
|
|
106
|
+
}, [u("div", S, [u("span", C, [h(f(me), {
|
|
107
107
|
size: 14,
|
|
108
108
|
"stroke-width": 2,
|
|
109
109
|
"aria-hidden": "true"
|
|
110
|
-
}),
|
|
110
|
+
}), o(" " + c(f(I).ai.rewrite.title), 1)]), u("button", {
|
|
111
111
|
type: "button",
|
|
112
112
|
class: "tpl:rounded-md tpl:p-0.5 tpl:text-[var(--tpl-text-muted)]",
|
|
113
113
|
"aria-label": f(I).ai.rewrite.close,
|
|
@@ -117,28 +117,28 @@ var y = { class: "tpl:relative tpl:flex tpl:items-center" }, b = [
|
|
|
117
117
|
size: 14,
|
|
118
118
|
"stroke-width": 2,
|
|
119
119
|
"aria-hidden": "true"
|
|
120
|
-
})], 8, w)]), J.value === null ? H.value ? (i(),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
})], 8, w)]), J.value === null ? H.value ? (i(), a(p, { key: 1 }, [
|
|
121
|
+
u("span", O, c(f(I).ai.rewrite.suggestionLabel), 1),
|
|
122
|
+
u("p", k, c(Ae.value || f(I).ai.rewrite.rewriting), 1),
|
|
123
|
+
u("button", {
|
|
124
124
|
type: "button",
|
|
125
125
|
"data-testid": "ai-rewrite-stop",
|
|
126
|
-
class:
|
|
126
|
+
class: m([f(g), "tpl:self-end"]),
|
|
127
127
|
onClick: X
|
|
128
128
|
}, [h(f(pe), {
|
|
129
129
|
size: 12,
|
|
130
130
|
"stroke-width": 2,
|
|
131
131
|
"aria-hidden": "true"
|
|
132
|
-
}),
|
|
133
|
-
], 64)) : (i(),
|
|
134
|
-
|
|
132
|
+
}), o(" " + c(f(I).ai.rewrite.stop), 1)], 2)
|
|
133
|
+
], 64)) : (i(), a(p, { key: 2 }, [
|
|
134
|
+
u("div", A, [(i(), a(p, null, r(ke, (e) => u("button", {
|
|
135
135
|
key: e,
|
|
136
136
|
type: "button",
|
|
137
137
|
"data-testid": `ai-rewrite-preset-${e}`,
|
|
138
|
-
class:
|
|
138
|
+
class: m(f(g)),
|
|
139
139
|
onClick: (t) => $(e)
|
|
140
140
|
}, c(f(I).ai.rewrite.presets[e]), 11, j)), 64))]),
|
|
141
|
-
|
|
141
|
+
u("div", M, [
|
|
142
142
|
h(f(he), {
|
|
143
143
|
size: 14,
|
|
144
144
|
"stroke-width": 2,
|
|
@@ -156,15 +156,15 @@ var y = { class: "tpl:relative tpl:flex tpl:items-center" }, b = [
|
|
|
156
156
|
"options",
|
|
157
157
|
"label"
|
|
158
158
|
]),
|
|
159
|
-
|
|
159
|
+
u("button", {
|
|
160
160
|
type: "button",
|
|
161
161
|
"data-testid": "ai-rewrite-preset-translate",
|
|
162
|
-
class:
|
|
162
|
+
class: m(f(g)),
|
|
163
163
|
disabled: B.value === "",
|
|
164
164
|
onClick: t[1] ||= (e) => $("translate")
|
|
165
165
|
}, c(f(I).ai.rewrite.presets.translate), 11, N)
|
|
166
166
|
]),
|
|
167
|
-
|
|
167
|
+
u("div", xe, [n(u("textarea", {
|
|
168
168
|
"onUpdate:modelValue": t[2] ||= (e) => V.value = e,
|
|
169
169
|
"data-testid": "ai-rewrite-instruction",
|
|
170
170
|
maxlength: "500",
|
|
@@ -172,31 +172,31 @@ var y = { class: "tpl:relative tpl:flex tpl:items-center" }, b = [
|
|
|
172
172
|
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)]",
|
|
173
173
|
"aria-label": f(I).ai.rewrite.instructionLabel,
|
|
174
174
|
placeholder: f(I).ai.rewrite.instructionPlaceholder
|
|
175
|
-
}, null, 8, Se), [[te, V.value]]),
|
|
175
|
+
}, null, 8, Se), [[te, V.value]]), u("button", {
|
|
176
176
|
type: "button",
|
|
177
177
|
"data-testid": "ai-rewrite-run",
|
|
178
|
-
class:
|
|
178
|
+
class: m(f(_)),
|
|
179
179
|
disabled: V.value.trim() === "",
|
|
180
180
|
onClick: t[3] ||= (e) => $(null)
|
|
181
|
-
}, c(f(I).ai.rewrite.run), 11,
|
|
182
|
-
Y.value ? (i(),
|
|
183
|
-
|
|
184
|
-
], 64)) : (i(),
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
}, c(f(I).ai.rewrite.run), 11, P)]),
|
|
182
|
+
Y.value ? (i(), a("p", Ce, c(Y.value), 1)) : l("", !0),
|
|
183
|
+
u("p", we, c(f(I).ai.chat.disclaimer), 1)
|
|
184
|
+
], 64)) : (i(), a(p, { key: 0 }, [
|
|
185
|
+
u("span", T, c(f(I).ai.rewrite.suggestionLabel), 1),
|
|
186
|
+
u("div", {
|
|
187
187
|
"data-testid": "ai-rewrite-preview",
|
|
188
188
|
class: "tpl:max-h-48 tpl:overflow-y-auto tpl:text-sm tpl:text-[var(--tpl-text)]",
|
|
189
189
|
innerHTML: J.value
|
|
190
190
|
}, null, 8, E),
|
|
191
|
-
|
|
191
|
+
u("div", D, [u("button", {
|
|
192
192
|
type: "button",
|
|
193
193
|
"data-testid": "ai-rewrite-discard",
|
|
194
|
-
class:
|
|
194
|
+
class: m(f(g)),
|
|
195
195
|
onClick: Z
|
|
196
|
-
}, c(f(I).ai.rewrite.discard), 3),
|
|
196
|
+
}, c(f(I).ai.rewrite.discard), 3), u("button", {
|
|
197
197
|
type: "button",
|
|
198
198
|
"data-testid": "ai-rewrite-replace",
|
|
199
|
-
class:
|
|
199
|
+
class: m(f(_)),
|
|
200
200
|
onClick: Me
|
|
201
201
|
}, c(f(I).ai.rewrite.replaceAction), 3)])
|
|
202
202
|
], 64))], 8, x)) : l("", !0)]));
|
|
@@ -204,4 +204,4 @@ var y = { class: "tpl:relative tpl:flex tpl:items-center" }, b = [
|
|
|
204
204
|
});
|
|
205
205
|
export { F as default };
|
|
206
206
|
|
|
207
|
-
//# sourceMappingURL=AiRewriteMenu-
|
|
207
|
+
//# sourceMappingURL=AiRewriteMenu-qf-cfEpy.js.map
|