@templatical/editor 0.52.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/AiAltTextPopover-NMJqQKvD.js +106 -0
- package/dist/{AiAltTextReview-DE8t8Rud.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
- package/dist/{AiChatPanel-7ftS7d40.js → AiChatPanel-DdhtfsmO.js} +223 -210
- package/dist/{AiPanels-CxGp6klr.js → AiPanels-HBx7xoJR.js} +6 -6
- package/dist/{AiRewriteMenu-DNI-5CUj.js → AiRewriteMenu-DPzSekZt.js} +78 -107
- package/dist/BlockIssueBadge-eIXZJ9M3.js +33 -0
- package/dist/BlockPreviewCanvas-DO-2TP_6.js +140 -0
- package/dist/{CloudHeaderExtras-CsgyNNV1.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
- package/dist/{CloudPanels-BDV4XQ_l.js → CloudPanels-i2kZdrdP.js} +44 -44
- package/dist/CollaborationNotices-DANsjl7c.js +65 -0
- package/dist/{CollaboratorBar-EeqqWcX6.js → CollaboratorBar-CbbAA0m1.js} +24 -24
- package/dist/CommentsPanel-CYW3LWis.js +16 -0
- package/dist/CommentsSidebar-CcF4ISMi.js +526 -0
- package/dist/{CountdownBlock-BT3ZTH1F.js → CountdownBlock-BMezkFbJ.js} +21 -21
- package/dist/CountdownToolbar-D3Lv74kU.js +258 -0
- package/dist/{IssuesPanel-BHFQ3wrP.js → IssuesPanel-BMAG9042.js} +141 -129
- package/dist/LanguageMenu-FlP_Jbup.js +403 -0
- package/dist/{LoadingTrack-DZA5AoP9.js → LoadingTrack-BG8cg9xi.js} +2 -2
- package/dist/LocaleNotices-DAnVszWu.js +46 -0
- package/dist/{LogicTagInsertButton-CSD9cfJB.js → LogicTagInsertButton-BjYs-UQX.js} +439 -430
- package/dist/{MediaEditModal-DQl5w44r.js → MediaEditModal-LnG-cF_S.js} +160 -160
- package/dist/{MediaPanels-BFWYuJot.js → MediaPanels-C2r5fiFo.js} +4 -4
- package/dist/{cdn/chunks/MergeTagInput-CFu9VXPS.js → MergeTagInput-BsnogCeY.js} +32 -34
- package/dist/{MergeTagModeToggle-DvD0ne7N.js → MergeTagModeToggle-DiufIQ-_.js} +49 -49
- package/dist/MergeTagTextarea-BweI-Xsi.js +126 -0
- package/dist/{ParagraphEditor-D-nqs82g.js → ParagraphEditor-qgBp5yIB.js} +286 -257
- package/dist/{RestoreVersionDialog-DqUPsLB9.js → RestoreVersionDialog-DdYUrFiK.js} +23 -23
- package/dist/{RichTextEditorContent-Xq9D0Zs3.js → RichTextEditorContent-C5MAzx3E.js} +54 -53
- package/dist/{SaveBlockDialog-DAPv70p4.js → SaveBlockDialog-eK6fjtTy.js} +86 -86
- package/dist/SavedBlocksBrowserModal-D2QHd2Yp.js +359 -0
- package/dist/{SavedBlocksPanels-ChbL9v9x.js → SavedBlocksPanels-Cl61f4Mf.js} +9 -9
- package/dist/{SavedBlocksPickBar-hRaiLNdu.js → SavedBlocksPickBar-CXP2dkeB.js} +15 -15
- package/dist/TemplateSettings-BKJrdZcH.js +294 -0
- package/dist/TestEmailModal-DQotJg6g.js +212 -0
- package/dist/{TestEmailPanel-COJQa2A9.js → TestEmailPanel-CwiTzJsh.js} +4 -4
- package/dist/TitleEditor-CzSvsPAn.js +202 -0
- package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
- package/dist/Toolbar-Cd75ci5W.js +3711 -0
- package/dist/{TplModal-9IndEYk5.js → TplModal-ZoXu40T9.js} +17 -17
- package/dist/{VersionHistoryMenu-BG5qayvg.js → VersionHistoryMenu-BvhN-Ofk.js} +39 -39
- package/dist/{VersionHistoryPanels-hPg7Q5-f.js → VersionHistoryPanels-DPWMnYbd.js} +5 -5
- package/dist/VersionPreviewBanner-CuJnasxH.js +37 -0
- package/dist/WrapperBlock-D4fPwO0t.js +44 -0
- package/dist/{blockTypeIcons-yt7SLzub.js → blockTypeIcons-BXMxu86H.js} +27 -26
- package/dist/bundle-stats.json +8 -8
- package/dist/{cdn/chunks/ca-CD-Kt1qz.js → ca-DOuIxWRv.js} +114 -2
- package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js +107 -0
- package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js.map +1 -0
- package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js → AiAltTextReview-Dtm3A2cD.js} +71 -69
- package/dist/cdn/chunks/AiAltTextReview-Dtm3A2cD.js.map +1 -0
- package/dist/cdn/chunks/AiChatPanel-DciEt27y.js +487 -0
- package/dist/cdn/chunks/AiChatPanel-DciEt27y.js.map +1 -0
- package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js → AiPanels-BV5D1itk.js} +11 -11
- package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js.map → AiPanels-BV5D1itk.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js → AiRewriteMenu-D3jkh6Xb.js} +80 -80
- package/dist/cdn/chunks/AiRewriteMenu-D3jkh6Xb.js.map +1 -0
- package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js +34 -0
- package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js.map +1 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-RQFilqXC.js +142 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js.map → BlockPreviewCanvas-RQFilqXC.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js → CloudHeaderExtras-BtqdN777.js} +4 -4
- package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js → CloudPanels-BSJ-Z5Hw.js} +43 -43
- package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js.map → CloudPanels-BSJ-Z5Hw.js.map} +1 -1
- package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js +67 -0
- package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js → CollaboratorBar-Bc9914Az.js} +16 -16
- package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js.map → CollaboratorBar-Bc9914Az.js.map} +1 -1
- package/dist/cdn/chunks/CommentsPanel-DbR9phAk.js +18 -0
- package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js.map → CommentsPanel-DbR9phAk.js.map} +1 -1
- package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js +496 -0
- package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js → CountdownBlock-CjMhMhnv.js} +26 -26
- package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js +260 -0
- package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js → IssuesPanel-CUmI4HMm.js} +132 -120
- package/dist/cdn/chunks/IssuesPanel-CUmI4HMm.js.map +1 -0
- package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js +359 -0
- package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js.map +1 -0
- package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js → LoadingTrack-DUYcDHOV.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
- package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js +47 -0
- package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js.map +1 -0
- package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js → LogicTagInsertButton-5Z3fFzjc.js} +465 -456
- package/dist/cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js.map +1 -0
- package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js → MediaEditModal-DDCIwr9U.js} +439 -439
- package/dist/cdn/chunks/MediaEditModal-DDCIwr9U.js.map +1 -0
- package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js → MediaPanels-Dz79oy8P.js} +5 -5
- package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js.map → MediaPanels-Dz79oy8P.js.map} +1 -1
- package/dist/cdn/chunks/MergeTagInput-CIWy-cXf.js +82 -0
- package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js.map → MergeTagInput-CIWy-cXf.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js → MergeTagModeToggle-BrP5GR-x.js} +50 -50
- package/dist/cdn/chunks/MergeTagModeToggle-BrP5GR-x.js.map +1 -0
- package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js +128 -0
- package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js +660 -0
- package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js → RestoreVersionDialog-Crj1DBqC.js} +18 -18
- package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js.map → RestoreVersionDialog-Crj1DBqC.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js → RichTextEditorContent-rCCqFlwJ.js} +43 -43
- package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js.map → RichTextEditorContent-rCCqFlwJ.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js → SaveBlockDialog-C34RW1aM.js} +71 -71
- package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js.map → SaveBlockDialog-C34RW1aM.js.map} +1 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-CJnwWPT-.js +356 -0
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-B9XCjDfm.js.map → SavedBlocksBrowserModal-CJnwWPT-.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js → SavedBlocksPanels-CA2PqXIH.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js.map → SavedBlocksPanels-CA2PqXIH.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js → SavedBlocksPickBar-Dj3ortee.js} +16 -16
- package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js.map → SavedBlocksPickBar-Dj3ortee.js.map} +1 -1
- package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js +266 -0
- package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js → TestEmailModal-BXeCtTjU.js} +81 -78
- package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js → TestEmailPanel-CpZcpB9D.js} +5 -5
- package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js.map → TestEmailPanel-CpZcpB9D.js.map} +1 -1
- package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js +202 -0
- package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js.map +1 -0
- package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js +45 -0
- package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js.map +1 -0
- package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js +3626 -0
- package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-BDyeS69p.js → TplModal-DDDUDMYC.js} +19 -19
- package/dist/cdn/chunks/{TplModal-BDyeS69p.js.map → TplModal-DDDUDMYC.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js → VersionHistoryMenu-DSElv3Sv.js} +36 -36
- package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js.map → VersionHistoryMenu-DSElv3Sv.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js → VersionHistoryPanels-H2nuik1l.js} +6 -6
- package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js.map → VersionHistoryPanels-H2nuik1l.js.map} +1 -1
- package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js +39 -0
- package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js.map +1 -0
- package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js +46 -0
- package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-DMgLcuI8.js +21 -0
- package/dist/cdn/chunks/blockTypeIcons-DMgLcuI8.js.map +1 -0
- package/dist/{ca-CD-Kt1qz.js → cdn/chunks/ca-DOuIxWRv.js} +116 -0
- package/dist/cdn/chunks/ca-DOuIxWRv.js.map +1 -0
- package/dist/cdn/chunks/composables-D0UYam2P.js +3039 -0
- package/dist/cdn/chunks/composables-D0UYam2P.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js → createCloudRuntime-BdsclY8_.js} +85 -83
- package/dist/cdn/chunks/createCloudRuntime-BdsclY8_.js.map +1 -0
- package/dist/{de-CeFJ6wbM.js → cdn/chunks/de-DaOUfYBX.js} +116 -0
- package/dist/cdn/chunks/de-DaOUfYBX.js.map +1 -0
- package/dist/{dist-CEdyyDn7.js → cdn/chunks/dist-BzXULHvI.js} +63 -61
- package/dist/cdn/chunks/{dist-C2epoAwW.js.map → dist-BzXULHvI.js.map} +1 -1
- package/dist/{dist-BA-jTQgw.js → cdn/chunks/dist-DqGgijFI.js} +108 -109
- package/dist/cdn/chunks/{dist-CONcGNwy.js.map → dist-DqGgijFI.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-B8hTTYFO.js → draggable-DepKdldn.js} +1384 -1376
- package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js → editor-modal-CPbgthOv.js} +986 -986
- package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js.map → editor-modal-CPbgthOv.js.map} +1 -1
- package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
- package/dist/cdn/chunks/en-C0pHHMiR.js.map +1 -0
- package/dist/cdn/chunks/en-IYVryJRl.js +1 -0
- package/dist/{es-zDacbMhs.js → cdn/chunks/es-CxyEKr6n.js} +116 -0
- package/dist/cdn/chunks/es-CxyEKr6n.js.map +1 -0
- package/dist/cdn/chunks/{extensions-ClDhn88e.js → extensions-Uh9vuFfK.js} +57 -57
- package/dist/cdn/chunks/{extensions-ClDhn88e.js.map → extensions-Uh9vuFfK.js.map} +1 -1
- package/dist/{fr-CSgYtjOd.js → cdn/chunks/fr-CYbamiI6.js} +116 -0
- package/dist/cdn/chunks/fr-CYbamiI6.js.map +1 -0
- package/dist/cdn/chunks/{icons-HCBP93Ch.js → icons-CSSMtbGK.js} +187 -144
- package/dist/cdn/chunks/icons-CSSMtbGK.js.map +1 -0
- package/dist/{ja-B7H3ID8O.js → cdn/chunks/ja-DfaIAoGI.js} +116 -0
- package/dist/cdn/chunks/ja-DfaIAoGI.js.map +1 -0
- package/dist/cdn/chunks/keys-CoQtCqNv.js +11 -0
- package/dist/cdn/chunks/keys-CoQtCqNv.js.map +1 -0
- package/dist/cdn/chunks/languageName-DEEOhDWI.js +12 -0
- package/dist/cdn/chunks/languageName-DEEOhDWI.js.map +1 -0
- 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/{nl-176ySmc5.js → cdn/chunks/nl-DkrB-VKZ.js} +116 -0
- package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +1 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js +290 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js.map +1 -0
- package/dist/cdn/chunks/noticeTones-D7BPu-Le.js +16 -0
- package/dist/cdn/chunks/noticeTones-D7BPu-Le.js.map +1 -0
- package/dist/cdn/chunks/plural-CyxrJXL1.js +17 -0
- package/dist/cdn/chunks/plural-CyxrJXL1.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js → preRenderCustomBlocks-C8k7tw98.js} +5 -5
- package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js.map → preRenderCustomBlocks-C8k7tw98.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +115 -1
- package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
- package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js +61 -0
- package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js.map +1 -0
- package/dist/cdn/chunks/socialIcons-BAiuHyJs.js +2638 -0
- package/dist/cdn/chunks/socialIcons-BAiuHyJs.js.map +1 -0
- package/dist/cdn/chunks/src-CACM3o--.js +2606 -0
- package/dist/cdn/chunks/src-CACM3o--.js.map +1 -0
- package/dist/cdn/chunks/{src-CUH_EI7k.js → src-Ddpm4HsS.js} +225 -259
- package/dist/cdn/chunks/src-Ddpm4HsS.js.map +1 -0
- package/dist/cdn/chunks/{src-BKpAis_q.js → src-DheBmnvF.js} +635 -478
- package/dist/cdn/chunks/src-DheBmnvF.js.map +1 -0
- package/dist/{styleConstants-B8xVRiwX.js → cdn/chunks/styleConstants-CgiNKdnc.js} +7 -5
- package/dist/cdn/chunks/styleConstants-CgiNKdnc.js.map +1 -0
- package/dist/cdn/chunks/templateSettingsFields-cjlP-jdw.js.map +1 -1
- package/dist/cdn/chunks/{tiptap-ChSZybTi.js → tiptap-Dipw_zOQ.js} +48 -48
- package/dist/cdn/chunks/{tiptap-ChSZybTi.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js → useCloudI18n-Cc5NZqiI.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
- package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-BT3c9CXj.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-11iqzC6m.js → useI18n-BnJYydPv.js} +3 -3
- package/dist/cdn/chunks/{useI18n-11iqzC6m.js.map → useI18n-BnJYydPv.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js +33 -0
- package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js.map +1 -0
- package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js → useLogicTag-B7RpqVFQ.js} +5 -5
- package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js.map → useLogicTag-B7RpqVFQ.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js → useMergeTag-C-32ETjj.js} +6 -6
- package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js.map → useMergeTag-C-32ETjj.js.map} +1 -1
- package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js +78 -0
- package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js.map +1 -0
- package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
- package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
- package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js → withCurrentFont-D33ZXoWp.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js.map → withCurrentFont-D33ZXoWp.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +2503 -1809
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-N3x4z_rH.js → check-ChQ0l8EQ.js} +1 -1
- package/dist/{chevron-down-gXu9qNwO.js → chevron-down-Bh6cp6PI.js} +1 -1
- package/dist/{chevron-right-rL0ayGk5.js → chevron-right-LUgdqdoW.js} +1 -1
- package/dist/{chevron-up-0ugh8HnW.js → chevron-up-XsDeJxQN.js} +1 -1
- package/dist/{circle-alert-B9Ls75B5.js → circle-alert-lODfDsrj.js} +1 -1
- package/dist/{clock-BqHBaCLm.js → clock-DrqFEZkT.js} +1 -1
- package/dist/composables-BOP3ERRP.js +4517 -0
- package/dist/{createCloudRuntime-B5VIdnwz.js → createCloudRuntime-DGV5a5Af.js} +47 -45
- package/dist/{createLucideIcon-BV7Gwz_Z.js → createLucideIcon-Dw5e5gVE.js} +16 -16
- package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
- package/dist/{cdn/chunks/dist-CONcGNwy.js → dist-0alKVRc_.js} +100 -99
- package/dist/{dist-Cy8I5scI.js → dist-54VCNoC0.js} +2 -2
- package/dist/dist-6DU0me3E.js +4 -0
- package/dist/{dist-p3wymUDt.js → dist-B8dY8drK.js} +2 -2
- package/dist/{dist-Dd5MU2Ev.js → dist-B9a7iVye.js} +2 -2
- package/dist/{dist-V7W1UhVr.js → dist-BWflWcpW.js} +2 -2
- package/dist/{dist-D6fZec6r.js → dist-C3hu_C3w.js} +2 -2
- package/dist/{cdn/chunks/dist-C2epoAwW.js → dist-CX7skkvG.js} +29 -31
- package/dist/dist-CcOn7WCo.js +4 -0
- package/dist/dist-Cdkm20M6.js +2542 -0
- package/dist/{dist-BS5uKktL.js → dist-ChOb5XHW.js} +2 -2
- package/dist/{dist-BF5zEHop.js → dist-DZ3X-uB8.js} +2 -2
- package/dist/{dist-CWSG7Kj0.js → dist-D_XrUEET.js} +5 -5
- package/dist/{dist-txQLT2sF.js → dist-TAv500j6.js} +2 -2
- package/dist/{dist-DDN7yR-w.js → dist-fqSers8_.js} +131 -131
- package/dist/{editor-modal-Du9VI9q4.js → editor-modal-B_2EAOjN.js} +907 -906
- package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
- package/dist/en-DTtwco2Q.js +1 -0
- package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
- package/dist/{extensions-FRYhx7qa.js → extensions-DOLZkLzV.js} +173 -173
- package/dist/{eye-BKj9Tfnc.js → eye-DChfk0gi.js} +1 -1
- package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
- package/dist/{image-DNdvdTla.js → image--Hj2by1G.js} +1 -1
- package/dist/index.d.ts +182 -14
- package/dist/{info-Bx-kBkbH.js → info-BbXgy82f.js} +1 -1
- package/dist/{cdn/chunks/ja-B7H3ID8O.js → ja-DfaIAoGI.js} +114 -2
- package/dist/keys-BCqskl51.js +9 -0
- package/dist/languageName-DEEOhDWI.js +10 -0
- package/dist/{link-D8-rYdIQ.js → link-C2_8yJno.js} +1 -1
- package/dist/{liquid.browser-D1RxawkY.js → liquid.browser-DUXEekoN.js} +781 -745
- package/dist/{list-BneisA27.js → list-DLGs2n0V.js} +1 -1
- package/dist/{loader-circle-DBEXphyx.js → loader-circle-BbDItE_O.js} +1 -1
- package/dist/{message-circle-Bg4xInCM.js → message-circle-NAModq0p.js} +1 -1
- package/dist/{cdn/chunks/nl-176ySmc5.js → nl-DkrB-VKZ.js} +114 -2
- package/dist/normalizeMergeTagMarkup-CUCo7B5X.js +288 -0
- package/dist/noticeTones-D7BPu-Le.js +14 -0
- package/dist/{package-B40Vkfsp.js → package-BuzsfRyH.js} +1 -1
- package/dist/{pencil-CYdAHTds.js → pencil-BTUUECH4.js} +1 -1
- package/dist/plural-CyxrJXL1.js +15 -0
- package/dist/plus-Dm7DN65T.js +13 -0
- package/dist/{preRenderCustomBlocks-AbZArwkR.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -4
- package/dist/{pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -0
- package/dist/{refresh-cw-Bb1FWrU0.js → refresh-cw-xMURqGWi.js} +2 -12
- package/dist/rotate-ccw-DqVcEIn5.js +13 -0
- package/dist/{runtime-dom.esm-bundler-CLGymEyk.js → runtime-dom.esm-bundler-DlHp8xgy.js} +167 -167
- package/dist/sanitizeHtml-mKgNUdME.js +962 -0
- package/dist/{search-BZEo08gi.js → search-Cfr3W44N.js} +1 -1
- package/dist/{send-DHtrnXQs.js → send-CH1SrvyB.js} +1 -1
- package/dist/{smartphone-dlN3vpA3.js → smartphone-pAkvzjdI.js} +1 -1
- package/dist/socialIcons-Dqr4DJOz.js +2705 -0
- package/dist/{sparkles-NOttoDnJ.js → sparkles-CRO0cCnp.js} +1 -1
- package/dist/{square-B1CJgdt2.js → square-CaQWMntx.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{cdn/chunks/styleConstants-B8xVRiwX.js → styleConstants-CgiNKdnc.js} +5 -7
- package/dist/templatical-editor.js +2294 -1608
- package/dist/{text-align-start-zpoXmb-Z.js → text-align-start-BQ39AaRK.js} +1 -1
- package/dist/{trash-CGbk4Sgt.js → trash-BL5gEFHN.js} +1 -1
- package/dist/{triangle-alert-CKLMyGVp.js → triangle-alert-BYbKu7zZ.js} +1 -1
- package/dist/{upload-DQoackAn.js → upload-BhmL4Vqx.js} +1 -1
- package/dist/{useCloudI18n-DcLtxOQZ.js → useCloudI18n-Dh2iydo1.js} +4 -4
- package/dist/useEditorRoot-DY3mgcHm.js +7 -0
- package/dist/{useI18n-CeTm777E.js → useI18n-CgtvtF4C.js} +4 -4
- package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
- package/dist/{useLogicTag-DFDYJeMN.js → useLogicTag-BXXXQQmi.js} +4 -4
- package/dist/{useMergeTag-B46vACAG.js → useMergeTag-C9Okr87y.js} +5 -5
- package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
- package/dist/{useScrollToBlock-C-NzvjeO.js → useScrollToBlock-C0Kapxdh.js} +5 -5
- package/dist/{vue.runtime.esm-bundler-CrlI8j5R.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1247 -1239
- package/dist/withCurrentFont-DJiQqZzL.js +18 -0
- package/dist/{x-zcrnmcmU.js → x-B7NZYzhx.js} +1 -1
- package/package.json +23 -23
- package/dist/AiAltTextPopover-Cm11CsKH.js +0 -105
- package/dist/BlockIssueBadge-6Ri2FfX-.js +0 -33
- package/dist/BlockPreviewCanvas-Df9iz7sK.js +0 -140
- package/dist/CollaborationNotices-JQ3vQoqO.js +0 -75
- package/dist/CommentsPanel-BuftXc0U.js +0 -16
- package/dist/CommentsSidebar-Co3x4uH0.js +0 -499
- package/dist/CountdownToolbar-CrL4WKy9.js +0 -197
- package/dist/MergeTagInput-DE7kWwXx.js +0 -80
- package/dist/MergeTagTextarea-DVPQkiYY.js +0 -69
- package/dist/SavedBlocksBrowserModal-SRtN5h9q.js +0 -359
- package/dist/TemplateSettings-D0XcH32O.js +0 -236
- package/dist/TestEmailModal-Cb5t0yB2.js +0 -209
- package/dist/TitleEditor-BYk_9SpQ.js +0 -198
- package/dist/ToggleSwitch-poGWbduy.js +0 -36
- package/dist/Toolbar-Dku_pZni.js +0 -3145
- package/dist/VersionPreviewBanner-CSs7zum_.js +0 -37
- package/dist/WrapperBlock-DwjK_IdJ.js +0 -44
- package/dist/cdn/chunks/AiAltTextPopover-DjMoJCgU.js +0 -106
- package/dist/cdn/chunks/AiAltTextPopover-DjMoJCgU.js.map +0 -1
- package/dist/cdn/chunks/AiAltTextReview-BafAtBoA.js.map +0 -1
- package/dist/cdn/chunks/AiChatPanel-DXeZgc7D.js +0 -474
- package/dist/cdn/chunks/AiChatPanel-DXeZgc7D.js.map +0 -1
- package/dist/cdn/chunks/AiRewriteMenu-4F6vwhJ5.js.map +0 -1
- package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js +0 -34
- package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js.map +0 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-Ny1X_mee.js +0 -142
- package/dist/cdn/chunks/CollaborationNotices-Hf8r08Sw.js +0 -77
- package/dist/cdn/chunks/CollaborationNotices-Hf8r08Sw.js.map +0 -1
- package/dist/cdn/chunks/CommentsPanel-CAiwilM2.js +0 -18
- package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js +0 -469
- package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-CguFJdqn.js +0 -199
- package/dist/cdn/chunks/CountdownToolbar-CguFJdqn.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-pr7_nuLI.js.map +0 -1
- package/dist/cdn/chunks/LogicTagInsertButton-B_ldj3TO.js.map +0 -1
- package/dist/cdn/chunks/MediaEditModal-CGfzcHwP.js.map +0 -1
- package/dist/cdn/chunks/MergeTagModeToggle-BFpK5dxg.js.map +0 -1
- package/dist/cdn/chunks/MergeTagTextarea-Zo0mYWbf.js +0 -71
- package/dist/cdn/chunks/MergeTagTextarea-Zo0mYWbf.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js +0 -631
- package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-B9XCjDfm.js +0 -356
- package/dist/cdn/chunks/TemplateSettings-jWpmuWDR.js +0 -208
- package/dist/cdn/chunks/TemplateSettings-jWpmuWDR.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-DcwKhFnI.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js +0 -198
- package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js.map +0 -1
- package/dist/cdn/chunks/ToggleSwitch-BDMugNES.js +0 -38
- package/dist/cdn/chunks/ToggleSwitch-BDMugNES.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-CnvfW72e.js +0 -3061
- package/dist/cdn/chunks/Toolbar-CnvfW72e.js.map +0 -1
- package/dist/cdn/chunks/VersionPreviewBanner-CZ--HOoa.js +0 -39
- package/dist/cdn/chunks/VersionPreviewBanner-CZ--HOoa.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-D3obNGab.js +0 -46
- package/dist/cdn/chunks/WrapperBlock-D3obNGab.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js +0 -21
- package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js.map +0 -1
- package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-D6niZ2Rc.js.map +0 -1
- package/dist/cdn/chunks/de-CeFJ6wbM.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/en-D14i5nFh.js.map +0 -1
- package/dist/cdn/chunks/es-zDacbMhs.js.map +0 -1
- package/dist/cdn/chunks/fr-CSgYtjOd.js.map +0 -1
- package/dist/cdn/chunks/icons-HCBP93Ch.js.map +0 -1
- package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
- package/dist/cdn/chunks/keys-BF9gazbd.js +0 -11
- package/dist/cdn/chunks/keys-BF9gazbd.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-DkLBNrft.js.map +0 -1
- package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-DpHCSESZ.js +0 -198
- package/dist/cdn/chunks/normalizeMergeTagMarkup-DpHCSESZ.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
- package/dist/cdn/chunks/sanitizeHtml-B2h15u0_.js +0 -72
- package/dist/cdn/chunks/sanitizeHtml-B2h15u0_.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-rJoqO1TJ.js +0 -2008
- package/dist/cdn/chunks/socialIcons-rJoqO1TJ.js.map +0 -1
- package/dist/cdn/chunks/src-BKpAis_q.js.map +0 -1
- package/dist/cdn/chunks/src-C9DTvn1H.js +0 -1423
- package/dist/cdn/chunks/src-C9DTvn1H.js.map +0 -1
- package/dist/cdn/chunks/src-CUH_EI7k.js.map +0 -1
- package/dist/cdn/chunks/styleConstants-B8xVRiwX.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/cdn/chunks/usePopoverPosition-AnVIwiVv.js +0 -70
- package/dist/cdn/chunks/usePopoverPosition-AnVIwiVv.js.map +0 -1
- package/dist/cdn/chunks/useScrollToBlock-C0dawxGr.js.map +0 -1
- package/dist/dist-CzrLYq2s.js +0 -1363
- package/dist/dist-DyFArF_G.js +0 -4
- package/dist/dist-pA3ooG6N.js +0 -4
- package/dist/en-CyEE7FPY.js +0 -1
- package/dist/keys-DBjrQkYH.js +0 -9
- package/dist/normalizeMergeTagMarkup-IH8COHzd.js +0 -196
- package/dist/sanitizeHtml-CnOA1efV.js +0 -942
- package/dist/socialIcons-B_d52_eS.js +0 -2075
- package/dist/useEditorCore-DG9UvWUm.js +0 -4011
- package/dist/useEditorRoot-BKr6nNkC.js +0 -7
- package/dist/usePopoverPosition-C42kD7zt.js +0 -68
- package/dist/withCurrentFont-v_a4Oso8.js +0 -18
|
@@ -0,0 +1,3626 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime-QGRDbDUS.js";
|
|
2
|
+
import { $ as t, B as n, C as r, F as i, G as a, H as o, K as s, L as c, O as l, Q as u, R as d, S as f, _ as p, b as m, ct as h, dt as g, g as _, h as v, m as y, mt as b, o as x, p as S, pt as C, s as w, tt as T, u as E, v as D, x as O } from "./draggable-DepKdldn.js";
|
|
3
|
+
import { Pt as k, Z as A, an as j, bn as M, cn as N, fn as P, hn as F, j as I, ln as ee, mt as L, n as te, on as ne, pn as R, r as re, sn as ie, yn as ae } from "./src-CACM3o--.js";
|
|
4
|
+
import { F as oe, T as se, _ as ce, b as le, d as ue, f as de, g as fe, h as pe, i as me, l as he, m as ge, p as _e, r as ve, s as z, u as ye, v as be } from "./socialIcons-BAiuHyJs.js";
|
|
5
|
+
import { t as B } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
6
|
+
import { $ as xe, At as Se, Bt as Ce, H as V, It as we, Mt as Te, O as Ee, R as De, _ as Oe, _t as ke, c as Ae, et as je, f as Me, gt as Ne, it as Pe, lt as Fe, m as Ie, rt as Le, t as Re, v as ze } from "./icons-CSSMtbGK.js";
|
|
7
|
+
import { B as Be, C as Ve, O as He, T as Ue, U as We, X as Ge, _ as Ke, b as qe, h as Je, ot as Ye, p as Xe, r as Ze, v as Qe } from "./keys-CoQtCqNv.js";
|
|
8
|
+
import { t as H } from "./useI18n-BnJYydPv.js";
|
|
9
|
+
import { n as $e } from "./useLocalizedDisplay-yXbRKNrs.js";
|
|
10
|
+
import { t as et } from "./languageName-DEEOhDWI.js";
|
|
11
|
+
import { S as tt, _ as U, b as nt, c as rt, g as W, h as G, r as it, v as K, y as at } from "./styleConstants-CgiNKdnc.js";
|
|
12
|
+
import { _ as ot } from "./dist-BzXULHvI.js";
|
|
13
|
+
import { c as st, r as ct } from "./usePopoverPosition-BWAXWeBv.js";
|
|
14
|
+
import { t as lt } from "./blockTypeIcons-DMgLcuI8.js";
|
|
15
|
+
import { n as q, t as ut } from "./MergeTagTextarea-D3nNDlhV.js";
|
|
16
|
+
import { c as J } from "./LogicTagInsertButton-5Z3fFzjc.js";
|
|
17
|
+
import { t as Y } from "./ToggleSwitch-BSkySwA1.js";
|
|
18
|
+
import { n as dt, t as ft } from "./withCurrentFont-D33ZXoWp.js";
|
|
19
|
+
import { t as X } from "./MergeTagInput-CIWy-cXf.js";
|
|
20
|
+
// src/components/SlidingPillSelect.vue?vue&type=script&setup=true&lang.ts
|
|
21
|
+
var pt = [
|
|
22
|
+
"aria-checked",
|
|
23
|
+
"aria-label",
|
|
24
|
+
"disabled",
|
|
25
|
+
"aria-disabled",
|
|
26
|
+
"title",
|
|
27
|
+
"onClick"
|
|
28
|
+
], mt = { key: 1 }, Z = /* @__PURE__ */ r({
|
|
29
|
+
__name: "SlidingPillSelect",
|
|
30
|
+
props: {
|
|
31
|
+
options: {},
|
|
32
|
+
modelValue: {}
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:modelValue"],
|
|
35
|
+
setup(e, { emit: t }) {
|
|
36
|
+
let r = e, a = t, o = S(() => r.options.findIndex((e) => e.value === r.modelValue)), s = S(() => `translateX(${Math.max(o.value, 0) * 100}%)`);
|
|
37
|
+
return (t, r) => (i(), p("div", {
|
|
38
|
+
role: "radiogroup",
|
|
39
|
+
class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
|
|
40
|
+
style: C({
|
|
41
|
+
gridTemplateColumns: `repeat(${e.options.length}, 1fr)`,
|
|
42
|
+
backgroundColor: "var(--tpl-bg-hover)"
|
|
43
|
+
})
|
|
44
|
+
}, [o.value >= 0 ? (i(), p("div", {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
|
|
47
|
+
style: C({
|
|
48
|
+
left: "4px",
|
|
49
|
+
width: `calc((100% - 8px) / ${e.options.length})`,
|
|
50
|
+
transform: s.value,
|
|
51
|
+
backgroundColor: "var(--tpl-bg)",
|
|
52
|
+
boxShadow: "var(--tpl-shadow)",
|
|
53
|
+
transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
54
|
+
})
|
|
55
|
+
}, null, 4)) : _("", !0), (i(!0), p(E, null, c(e.options, (t) => (i(), p("button", {
|
|
56
|
+
key: t.value,
|
|
57
|
+
role: "radio",
|
|
58
|
+
"aria-checked": e.modelValue === t.value,
|
|
59
|
+
"aria-label": t.label,
|
|
60
|
+
disabled: t.disabled,
|
|
61
|
+
"aria-disabled": t.disabled ? "true" : void 0,
|
|
62
|
+
class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:disabled:cursor-not-allowed tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium",
|
|
63
|
+
style: C({
|
|
64
|
+
color: t.disabled ? "var(--tpl-text-dim)" : e.modelValue === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
65
|
+
transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
66
|
+
}),
|
|
67
|
+
title: t.label,
|
|
68
|
+
onClick: (e) => t.disabled || a("update:modelValue", t.value)
|
|
69
|
+
}, [t.icon ? (i(), v(n(t.icon), {
|
|
70
|
+
key: 0,
|
|
71
|
+
size: 14,
|
|
72
|
+
"stroke-width": 2
|
|
73
|
+
})) : (i(), p("span", mt, b(t.label), 1))], 12, pt))), 128))], 4));
|
|
74
|
+
}
|
|
75
|
+
}), ht = { class: "tpl:flex tpl:items-stretch" }, gt = [
|
|
76
|
+
"data-testid",
|
|
77
|
+
"value",
|
|
78
|
+
"min",
|
|
79
|
+
"max"
|
|
80
|
+
], _t = /* @__PURE__ */ r({
|
|
81
|
+
__name: "NumberWithSuffix",
|
|
82
|
+
props: {
|
|
83
|
+
modelValue: {},
|
|
84
|
+
min: {},
|
|
85
|
+
max: {},
|
|
86
|
+
suffix: {},
|
|
87
|
+
testid: {}
|
|
88
|
+
},
|
|
89
|
+
emits: ["update:modelValue"],
|
|
90
|
+
setup(e, { emit: t }) {
|
|
91
|
+
let n = t;
|
|
92
|
+
function r(e) {
|
|
93
|
+
let t = e.target;
|
|
94
|
+
t.validity?.badInput || n("update:modelValue", Number(t.value));
|
|
95
|
+
}
|
|
96
|
+
return (t, n) => (i(), p("div", ht, [y("input", {
|
|
97
|
+
type: "number",
|
|
98
|
+
"data-testid": e.testid,
|
|
99
|
+
class: g(h(W)),
|
|
100
|
+
value: e.modelValue,
|
|
101
|
+
min: e.min,
|
|
102
|
+
max: e.max,
|
|
103
|
+
onInput: r
|
|
104
|
+
}, null, 42, gt), y("span", { class: g(h(U)) }, b(e.suffix), 3)]));
|
|
105
|
+
}
|
|
106
|
+
}), vt = [
|
|
107
|
+
"aria-pressed",
|
|
108
|
+
"aria-label",
|
|
109
|
+
"title",
|
|
110
|
+
"data-testid"
|
|
111
|
+
], yt = /* @__PURE__ */ r({
|
|
112
|
+
__name: "LinkToggle",
|
|
113
|
+
props: {
|
|
114
|
+
linked: { type: Boolean },
|
|
115
|
+
linkLabel: {},
|
|
116
|
+
unlinkLabel: {},
|
|
117
|
+
testid: {}
|
|
118
|
+
},
|
|
119
|
+
emits: ["toggle"],
|
|
120
|
+
setup(e, { emit: t }) {
|
|
121
|
+
let n = t;
|
|
122
|
+
return (t, r) => (i(), p("button", {
|
|
123
|
+
type: "button",
|
|
124
|
+
class: g(["tpl:flex tpl:h-7 tpl:w-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", e.linked ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
|
|
125
|
+
"aria-pressed": e.linked ? "true" : "false",
|
|
126
|
+
"aria-label": e.linked ? e.unlinkLabel : e.linkLabel,
|
|
127
|
+
title: e.linked ? e.unlinkLabel : e.linkLabel,
|
|
128
|
+
"data-testid": e.testid,
|
|
129
|
+
onClick: r[0] ||= (e) => n("toggle")
|
|
130
|
+
}, [e.linked ? (i(), v(h(Fe), {
|
|
131
|
+
key: 0,
|
|
132
|
+
size: 14,
|
|
133
|
+
"stroke-width": 2
|
|
134
|
+
})) : (i(), v(h(Ae), {
|
|
135
|
+
key: 1,
|
|
136
|
+
size: 14,
|
|
137
|
+
"stroke-width": 2
|
|
138
|
+
}))], 10, vt));
|
|
139
|
+
}
|
|
140
|
+
}), bt = {
|
|
141
|
+
key: 0,
|
|
142
|
+
class: "tpl:mb-3.5"
|
|
143
|
+
}, xt = { class: "tpl:mb-3.5" }, St = { class: "tpl:mb-3.5" }, Ct = /* @__PURE__ */ r({
|
|
144
|
+
__name: "BorderControl",
|
|
145
|
+
props: {
|
|
146
|
+
path: {},
|
|
147
|
+
modelValue: {},
|
|
148
|
+
testidPrefix: {}
|
|
149
|
+
},
|
|
150
|
+
emits: ["update:modelValue"],
|
|
151
|
+
setup(e, { emit: t }) {
|
|
152
|
+
let n = e, r = t, { t: s } = H(), c = {
|
|
153
|
+
width: 0,
|
|
154
|
+
style: "solid",
|
|
155
|
+
color: "#000000"
|
|
156
|
+
};
|
|
157
|
+
function l(e, t) {
|
|
158
|
+
return e.width === t.width && e.style === t.style && e.color === t.color;
|
|
159
|
+
}
|
|
160
|
+
let u = S(() => {
|
|
161
|
+
let e = n.modelValue;
|
|
162
|
+
return !e || R.every((t) => l(e[t], e.top));
|
|
163
|
+
}), d = T(u.value);
|
|
164
|
+
o(u, (e) => {
|
|
165
|
+
!e && d.value && (d.value = !1);
|
|
166
|
+
});
|
|
167
|
+
let f = T("top"), m = S(() => n.modelValue?.[d.value ? "top" : f.value] ?? c), x = (e) => !!e && e.width > 0;
|
|
168
|
+
function C(e) {
|
|
169
|
+
if (d.value) {
|
|
170
|
+
r("update:modelValue", x(e) ? M(e) : void 0);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
let t = {
|
|
174
|
+
...n.modelValue ?? M(c),
|
|
175
|
+
[f.value]: e
|
|
176
|
+
}, i = R.some((e) => x(t[e]));
|
|
177
|
+
r("update:modelValue", i ? t : void 0);
|
|
178
|
+
}
|
|
179
|
+
function w(e) {
|
|
180
|
+
C({
|
|
181
|
+
...m.value,
|
|
182
|
+
width: e > 0 ? e : 0
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function D(e) {
|
|
186
|
+
C({
|
|
187
|
+
...m.value,
|
|
188
|
+
...e
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function k() {
|
|
192
|
+
if (d.value) {
|
|
193
|
+
d.value = !1;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
d.value = !0;
|
|
197
|
+
let e = n.modelValue;
|
|
198
|
+
if (!e) return;
|
|
199
|
+
let t = x(e[f.value]) ? e[f.value] : R.map((t) => e[t]).find(x);
|
|
200
|
+
r("update:modelValue", t ? M(t) : void 0);
|
|
201
|
+
}
|
|
202
|
+
let A = S(() => R.map((e) => ({
|
|
203
|
+
value: e,
|
|
204
|
+
label: s.spacingControl[e]
|
|
205
|
+
})));
|
|
206
|
+
return (t, n) => (i(), v(q, {
|
|
207
|
+
path: e.path,
|
|
208
|
+
label: h(s).blockSettings.border
|
|
209
|
+
}, {
|
|
210
|
+
"label-actions": a(() => [O(yt, {
|
|
211
|
+
linked: d.value,
|
|
212
|
+
"link-label": h(s).blockSettings.linkSides,
|
|
213
|
+
"unlink-label": h(s).blockSettings.unlinkSides,
|
|
214
|
+
testid: `${e.testidPrefix}-border-link`,
|
|
215
|
+
onToggle: k
|
|
216
|
+
}, null, 8, [
|
|
217
|
+
"linked",
|
|
218
|
+
"link-label",
|
|
219
|
+
"unlink-label",
|
|
220
|
+
"testid"
|
|
221
|
+
])]),
|
|
222
|
+
default: a(() => [
|
|
223
|
+
d.value ? _("", !0) : (i(), p("div", bt, [y("label", { class: g(h(K)) }, b(h(s).blockSettings.borderSide), 3), O(Z, {
|
|
224
|
+
options: A.value,
|
|
225
|
+
"model-value": f.value,
|
|
226
|
+
"onUpdate:modelValue": n[0] ||= (e) => f.value = e
|
|
227
|
+
}, null, 8, ["options", "model-value"])])),
|
|
228
|
+
y("div", xt, [y("label", { class: g(h(K)) }, b(h(s).blockSettings.borderWidth), 3), O(_t, {
|
|
229
|
+
"model-value": m.value.width,
|
|
230
|
+
min: 0,
|
|
231
|
+
suffix: "px",
|
|
232
|
+
testid: `${e.testidPrefix}-border-width-input`,
|
|
233
|
+
"onUpdate:modelValue": w
|
|
234
|
+
}, null, 8, ["model-value", "testid"])]),
|
|
235
|
+
m.value.width > 0 ? (i(), p(E, { key: 1 }, [y("div", St, [y("label", { class: g(h(K)) }, b(h(s).blockSettings.borderStyle), 3), O(Z, {
|
|
236
|
+
options: [
|
|
237
|
+
{
|
|
238
|
+
value: "solid",
|
|
239
|
+
label: h(s).divider.solid
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
value: "dashed",
|
|
243
|
+
label: h(s).divider.dashed
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
value: "dotted",
|
|
247
|
+
label: h(s).divider.dotted
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
"model-value": m.value.style,
|
|
251
|
+
"onUpdate:modelValue": n[1] ||= (e) => D({ style: e })
|
|
252
|
+
}, null, 8, ["options", "model-value"])]), y("div", null, [y("label", { class: g(h(K)) }, b(h(s).blockSettings.borderColor), 3), O(J, {
|
|
253
|
+
"model-value": m.value.color,
|
|
254
|
+
"onUpdate:modelValue": n[2] ||= (e) => D({ color: e })
|
|
255
|
+
}, null, 8, ["model-value"])])], 64)) : _("", !0)
|
|
256
|
+
]),
|
|
257
|
+
_: 1
|
|
258
|
+
}, 8, ["path", "label"]));
|
|
259
|
+
}
|
|
260
|
+
}), wt = {
|
|
261
|
+
key: 1,
|
|
262
|
+
class: "tpl:grid tpl:grid-cols-2 tpl:gap-2"
|
|
263
|
+
}, Tt = { class: "tpl:mb-1 tpl:block tpl:text-[10px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Et = /* @__PURE__ */ r({
|
|
264
|
+
__name: "RadiusControl",
|
|
265
|
+
props: {
|
|
266
|
+
path: {},
|
|
267
|
+
modelValue: {},
|
|
268
|
+
label: {},
|
|
269
|
+
testidPrefix: {},
|
|
270
|
+
max: {}
|
|
271
|
+
},
|
|
272
|
+
emits: ["update:modelValue"],
|
|
273
|
+
setup(e, { emit: t }) {
|
|
274
|
+
let n = e, r = t, { t: s } = H(), l = {
|
|
275
|
+
topLeft: "cornerTopLeft",
|
|
276
|
+
topRight: "cornerTopRight",
|
|
277
|
+
bottomRight: "cornerBottomRight",
|
|
278
|
+
bottomLeft: "cornerBottomLeft"
|
|
279
|
+
}, u = [
|
|
280
|
+
"topLeft",
|
|
281
|
+
"topRight",
|
|
282
|
+
"bottomLeft",
|
|
283
|
+
"bottomRight"
|
|
284
|
+
], d = S(() => {
|
|
285
|
+
let e = n.modelValue ?? 0;
|
|
286
|
+
return typeof e == "number" ? {
|
|
287
|
+
topLeft: e,
|
|
288
|
+
topRight: e,
|
|
289
|
+
bottomRight: e,
|
|
290
|
+
bottomLeft: e
|
|
291
|
+
} : e;
|
|
292
|
+
}), f = S(() => P.every((e) => d.value[e] === d.value.topLeft)), m = T(f.value);
|
|
293
|
+
o(f, (e) => {
|
|
294
|
+
!e && m.value && (m.value = !1);
|
|
295
|
+
});
|
|
296
|
+
function g(e) {
|
|
297
|
+
return Number.isFinite(e) && e >= 0;
|
|
298
|
+
}
|
|
299
|
+
function _(e) {
|
|
300
|
+
g(e) && r("update:modelValue", e);
|
|
301
|
+
}
|
|
302
|
+
function x(e, t) {
|
|
303
|
+
g(t) && r("update:modelValue", {
|
|
304
|
+
...d.value,
|
|
305
|
+
[e]: t
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
function C() {
|
|
309
|
+
m.value = !m.value, m.value && r("update:modelValue", d.value.topLeft);
|
|
310
|
+
}
|
|
311
|
+
return (t, n) => (i(), v(q, {
|
|
312
|
+
path: e.path,
|
|
313
|
+
label: e.label
|
|
314
|
+
}, {
|
|
315
|
+
"label-actions": a(() => [O(yt, {
|
|
316
|
+
linked: m.value,
|
|
317
|
+
"link-label": h(s).blockSettings.linkCorners,
|
|
318
|
+
"unlink-label": h(s).blockSettings.unlinkCorners,
|
|
319
|
+
testid: `${e.testidPrefix}-border-radius-link`,
|
|
320
|
+
onToggle: C
|
|
321
|
+
}, null, 8, [
|
|
322
|
+
"linked",
|
|
323
|
+
"link-label",
|
|
324
|
+
"unlink-label",
|
|
325
|
+
"testid"
|
|
326
|
+
])]),
|
|
327
|
+
default: a(() => [m.value ? (i(), v(_t, {
|
|
328
|
+
key: 0,
|
|
329
|
+
"model-value": d.value.topLeft,
|
|
330
|
+
min: 0,
|
|
331
|
+
max: e.max,
|
|
332
|
+
suffix: "px",
|
|
333
|
+
testid: `${e.testidPrefix}-border-radius-input`,
|
|
334
|
+
"onUpdate:modelValue": _
|
|
335
|
+
}, null, 8, [
|
|
336
|
+
"model-value",
|
|
337
|
+
"max",
|
|
338
|
+
"testid"
|
|
339
|
+
])) : (i(), p("div", wt, [(i(), p(E, null, c(u, (t) => y("div", { key: t }, [y("label", Tt, b(h(s).blockSettings[l[t]]), 1), O(_t, {
|
|
340
|
+
"model-value": d.value[t],
|
|
341
|
+
min: 0,
|
|
342
|
+
max: e.max,
|
|
343
|
+
suffix: "px",
|
|
344
|
+
testid: `${e.testidPrefix}-border-radius-${t}-input`,
|
|
345
|
+
"onUpdate:modelValue": (e) => x(t, e)
|
|
346
|
+
}, null, 8, [
|
|
347
|
+
"model-value",
|
|
348
|
+
"max",
|
|
349
|
+
"testid",
|
|
350
|
+
"onUpdate:modelValue"
|
|
351
|
+
])])), 64))]))]),
|
|
352
|
+
_: 1
|
|
353
|
+
}, 8, ["path", "label"]));
|
|
354
|
+
}
|
|
355
|
+
}), Dt = ["value"], Ot = { value: "" }, kt = ["value"], At = { class: "tpl:flex tpl:items-stretch" }, jt = ["value"], Mt = ["value"], Nt = { value: "auto" }, Pt = { value: "full" }, Ft = { value: "custom" }, It = {
|
|
356
|
+
key: 0,
|
|
357
|
+
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
358
|
+
}, Lt = ["value"], Rt = 200, zt = /* @__PURE__ */ r({
|
|
359
|
+
__name: "ButtonToolbar",
|
|
360
|
+
props: {
|
|
361
|
+
block: {},
|
|
362
|
+
fontFamilies: {}
|
|
363
|
+
},
|
|
364
|
+
emits: ["update"],
|
|
365
|
+
setup(e, { emit: t }) {
|
|
366
|
+
let n = e, r = t, { t: o } = H(), s = S(() => n.block.width === "full" ? "full" : typeof n.block.width == "number" ? "custom" : "auto");
|
|
367
|
+
function l(e, t) {
|
|
368
|
+
r("update", { [e]: t });
|
|
369
|
+
}
|
|
370
|
+
function u(e) {
|
|
371
|
+
e === "full" ? l("width", "full") : e === "custom" ? l("width", typeof n.block.width == "number" ? n.block.width : Rt) : l("width", void 0);
|
|
372
|
+
}
|
|
373
|
+
function d(e) {
|
|
374
|
+
let t = Number(e);
|
|
375
|
+
!Number.isFinite(t) || t <= 0 || l("width", t);
|
|
376
|
+
}
|
|
377
|
+
return (t, n) => (i(), p(E, null, [
|
|
378
|
+
O(q, {
|
|
379
|
+
label: h(o).button.fontFamily,
|
|
380
|
+
class: "tpl:mb-3.5",
|
|
381
|
+
path: "fontFamily"
|
|
382
|
+
}, {
|
|
383
|
+
default: a(() => [y("select", {
|
|
384
|
+
class: g(h(G)),
|
|
385
|
+
value: h(ft)(e.block.fontFamily),
|
|
386
|
+
onChange: n[0] ||= (e) => l("fontFamily", e.target.value || void 0)
|
|
387
|
+
}, [y("option", Ot, b(h(o).button.inheritFont), 1), (i(!0), p(E, null, c(e.fontFamilies, (e) => (i(), p("option", {
|
|
388
|
+
key: e.value,
|
|
389
|
+
value: e.value
|
|
390
|
+
}, b(e.label), 9, kt))), 128))], 42, Dt)]),
|
|
391
|
+
_: 1
|
|
392
|
+
}, 8, ["label"]),
|
|
393
|
+
O(q, {
|
|
394
|
+
label: h(o).button.text,
|
|
395
|
+
class: "tpl:mb-3.5",
|
|
396
|
+
path: "text"
|
|
397
|
+
}, {
|
|
398
|
+
default: a(() => [O(X, {
|
|
399
|
+
"model-value": e.block.text,
|
|
400
|
+
type: "text",
|
|
401
|
+
"onUpdate:modelValue": n[1] ||= (e) => l("text", e)
|
|
402
|
+
}, null, 8, ["model-value"])]),
|
|
403
|
+
_: 1
|
|
404
|
+
}, 8, ["label"]),
|
|
405
|
+
O(q, {
|
|
406
|
+
label: h(o).button.url,
|
|
407
|
+
class: "tpl:mb-3.5",
|
|
408
|
+
path: "url"
|
|
409
|
+
}, {
|
|
410
|
+
default: a(() => [O(X, {
|
|
411
|
+
"model-value": e.block.url,
|
|
412
|
+
type: "url",
|
|
413
|
+
placeholder: h(o).button.urlPlaceholder,
|
|
414
|
+
"onUpdate:modelValue": n[2] ||= (e) => l("url", e)
|
|
415
|
+
}, null, 8, ["model-value", "placeholder"]), e.block.url ? (i(), v(q, {
|
|
416
|
+
key: 0,
|
|
417
|
+
path: "openInNewTab",
|
|
418
|
+
label: h(o).button.openInNewTab
|
|
419
|
+
}, {
|
|
420
|
+
"label-actions": a(({ controlId: t }) => [O(Y, {
|
|
421
|
+
"control-id": t,
|
|
422
|
+
"hide-label": "",
|
|
423
|
+
class: "tpl:mt-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]",
|
|
424
|
+
"model-value": e.block.openInNewTab ?? !1,
|
|
425
|
+
label: h(o).button.openInNewTab,
|
|
426
|
+
"onUpdate:modelValue": n[3] ||= (e) => l("openInNewTab", e)
|
|
427
|
+
}, null, 8, [
|
|
428
|
+
"control-id",
|
|
429
|
+
"model-value",
|
|
430
|
+
"label"
|
|
431
|
+
])]),
|
|
432
|
+
_: 1
|
|
433
|
+
}, 8, ["label"])) : _("", !0)]),
|
|
434
|
+
_: 1
|
|
435
|
+
}, 8, ["label"]),
|
|
436
|
+
O(q, {
|
|
437
|
+
label: h(o).button.background,
|
|
438
|
+
class: "tpl:mb-3.5",
|
|
439
|
+
path: "backgroundColor"
|
|
440
|
+
}, {
|
|
441
|
+
default: a(() => [O(J, {
|
|
442
|
+
"model-value": e.block.backgroundColor,
|
|
443
|
+
"allow-transparent": "",
|
|
444
|
+
"onUpdate:modelValue": n[4] ||= (e) => l("backgroundColor", e)
|
|
445
|
+
}, null, 8, ["model-value"])]),
|
|
446
|
+
_: 1
|
|
447
|
+
}, 8, ["label"]),
|
|
448
|
+
O(q, {
|
|
449
|
+
label: h(o).button.textColor,
|
|
450
|
+
class: "tpl:mb-3.5",
|
|
451
|
+
path: "textColor"
|
|
452
|
+
}, {
|
|
453
|
+
default: a(() => [O(J, {
|
|
454
|
+
"model-value": e.block.textColor,
|
|
455
|
+
"onUpdate:modelValue": n[5] ||= (e) => l("textColor", e)
|
|
456
|
+
}, null, 8, ["model-value"])]),
|
|
457
|
+
_: 1
|
|
458
|
+
}, 8, ["label"]),
|
|
459
|
+
O(Ct, {
|
|
460
|
+
path: "border",
|
|
461
|
+
"model-value": e.block.border,
|
|
462
|
+
"testid-prefix": "button",
|
|
463
|
+
"onUpdate:modelValue": n[6] ||= (e) => l("border", e)
|
|
464
|
+
}, null, 8, ["model-value"]),
|
|
465
|
+
O(Et, {
|
|
466
|
+
path: "borderRadius",
|
|
467
|
+
"model-value": e.block.borderRadius,
|
|
468
|
+
label: h(o).button.borderRadius,
|
|
469
|
+
max: 50,
|
|
470
|
+
"testid-prefix": "button",
|
|
471
|
+
"onUpdate:modelValue": n[7] ||= (e) => l("borderRadius", e)
|
|
472
|
+
}, null, 8, ["model-value", "label"]),
|
|
473
|
+
O(q, {
|
|
474
|
+
label: h(o).button.fontSize,
|
|
475
|
+
class: "tpl:mb-3.5",
|
|
476
|
+
path: "fontSize"
|
|
477
|
+
}, {
|
|
478
|
+
default: a(() => [y("div", At, [y("input", {
|
|
479
|
+
type: "number",
|
|
480
|
+
class: g(h(W)),
|
|
481
|
+
value: e.block.fontSize,
|
|
482
|
+
min: "10",
|
|
483
|
+
max: "36",
|
|
484
|
+
onInput: n[8] ||= (e) => l("fontSize", Number(e.target.value))
|
|
485
|
+
}, null, 42, jt), y("span", { class: g(h(U)) }, "px", 2)])]),
|
|
486
|
+
_: 1
|
|
487
|
+
}, 8, ["label"]),
|
|
488
|
+
O(q, {
|
|
489
|
+
label: h(o).button.width,
|
|
490
|
+
class: "tpl:mb-3.5",
|
|
491
|
+
path: "width"
|
|
492
|
+
}, {
|
|
493
|
+
default: a(() => [y("select", {
|
|
494
|
+
class: g(h(G)),
|
|
495
|
+
value: s.value,
|
|
496
|
+
onChange: n[9] ||= (e) => u(e.target.value)
|
|
497
|
+
}, [
|
|
498
|
+
y("option", Nt, b(h(o).button.widthAuto), 1),
|
|
499
|
+
y("option", Pt, b(h(o).button.fullWidth), 1),
|
|
500
|
+
y("option", Ft, b(h(o).button.widthCustom), 1)
|
|
501
|
+
], 42, Mt), s.value === "custom" ? (i(), p("div", It, [y("input", {
|
|
502
|
+
type: "number",
|
|
503
|
+
class: g(h(W)),
|
|
504
|
+
value: typeof e.block.width == "number" ? e.block.width : Rt,
|
|
505
|
+
min: "20",
|
|
506
|
+
onInput: n[10] ||= (e) => d(e.target.value)
|
|
507
|
+
}, null, 42, Lt), y("span", { class: g(h(U)) }, "px", 2)])) : _("", !0)]),
|
|
508
|
+
_: 1
|
|
509
|
+
}, 8, ["label"]),
|
|
510
|
+
O(q, {
|
|
511
|
+
label: h(o).title.align,
|
|
512
|
+
class: "tpl:mb-3.5",
|
|
513
|
+
path: "align"
|
|
514
|
+
}, {
|
|
515
|
+
default: a(() => [O(Z, {
|
|
516
|
+
options: [
|
|
517
|
+
{
|
|
518
|
+
value: "left",
|
|
519
|
+
label: h(o).title.alignLeft
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
value: "center",
|
|
523
|
+
label: h(o).title.alignCenter
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
value: "right",
|
|
527
|
+
label: h(o).title.alignRight
|
|
528
|
+
}
|
|
529
|
+
],
|
|
530
|
+
"model-value": e.block.align ?? "center",
|
|
531
|
+
"onUpdate:modelValue": n[11] ||= (e) => l("align", e)
|
|
532
|
+
}, null, 8, ["options", "model-value"])]),
|
|
533
|
+
_: 1
|
|
534
|
+
}, 8, ["label"])
|
|
535
|
+
], 64));
|
|
536
|
+
}
|
|
537
|
+
}), Bt = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, Vt = { class: "tpl:flex tpl:items-center" }, Ht = ["aria-label"], Ut = ["value", "aria-label"], Wt = ["aria-label"], Gt = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Kt = { class: "tpl:flex tpl:items-center" }, qt = ["aria-label"], Jt = ["value", "aria-label"], Yt = ["aria-label"], Xt = ["aria-label", "title"], Zt = { class: "tpl:flex tpl:items-center" }, Qt = ["aria-label"], $t = ["value", "aria-label"], en = ["aria-label"], tn = { class: "tpl:flex tpl:items-center" }, nn = ["aria-label"], rn = ["value", "aria-label"], an = ["aria-label"], Q = "tpl:flex tpl:items-center tpl:justify-center tpl:w-8 tpl:h-8 tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg)] tpl:border tpl:border-[var(--tpl-border)] tpl:cursor-pointer tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)] tpl:active:bg-[var(--tpl-bg-active)]", on = "tpl:w-10 tpl:h-8 tpl:text-center tpl:text-xs tpl:font-medium tpl:border-y tpl:border-x-0 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]", sn = /*#__PURE__*/ B(/* @__PURE__ */ r({
|
|
538
|
+
__name: "SpacingControl",
|
|
539
|
+
props: {
|
|
540
|
+
path: {},
|
|
541
|
+
modelValue: {},
|
|
542
|
+
label: {}
|
|
543
|
+
},
|
|
544
|
+
emits: ["update:modelValue"],
|
|
545
|
+
setup(e, { emit: t }) {
|
|
546
|
+
let n = e, r = t, { t: s } = H(), c = S(() => n.modelValue.top === n.modelValue.right && n.modelValue.right === n.modelValue.bottom && n.modelValue.bottom === n.modelValue.left), l = T(c.value);
|
|
547
|
+
o(c, (e) => {
|
|
548
|
+
!e && l.value && (l.value = !1);
|
|
549
|
+
});
|
|
550
|
+
function u(e, t) {
|
|
551
|
+
let i = Math.max(0, n.modelValue[e] + t);
|
|
552
|
+
l.value ? r("update:modelValue", {
|
|
553
|
+
top: i,
|
|
554
|
+
right: i,
|
|
555
|
+
bottom: i,
|
|
556
|
+
left: i
|
|
557
|
+
}) : r("update:modelValue", {
|
|
558
|
+
...n.modelValue,
|
|
559
|
+
[e]: i
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
function d(e, t) {
|
|
563
|
+
let i = Math.max(0, t);
|
|
564
|
+
l.value ? r("update:modelValue", {
|
|
565
|
+
top: i,
|
|
566
|
+
right: i,
|
|
567
|
+
bottom: i,
|
|
568
|
+
left: i
|
|
569
|
+
}) : r("update:modelValue", {
|
|
570
|
+
...n.modelValue,
|
|
571
|
+
[e]: i
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
function f() {
|
|
575
|
+
if (l.value = !l.value, l.value) {
|
|
576
|
+
let e = n.modelValue.top;
|
|
577
|
+
r("update:modelValue", {
|
|
578
|
+
top: e,
|
|
579
|
+
right: e,
|
|
580
|
+
bottom: e,
|
|
581
|
+
left: e
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return (t, n) => (i(), v(q, {
|
|
586
|
+
class: "spacing-control",
|
|
587
|
+
path: e.path,
|
|
588
|
+
label: e.label
|
|
589
|
+
}, {
|
|
590
|
+
default: a(() => [y("div", Bt, [
|
|
591
|
+
y("div", Vt, [
|
|
592
|
+
y("button", {
|
|
593
|
+
"aria-label": h(s).spacingControl.decreaseTop,
|
|
594
|
+
class: g([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
595
|
+
onClick: n[0] ||= (e) => u("top", -1)
|
|
596
|
+
}, [O(h(je), {
|
|
597
|
+
size: 12,
|
|
598
|
+
"stroke-width": 2
|
|
599
|
+
})], 10, Ht),
|
|
600
|
+
y("input", {
|
|
601
|
+
type: "number",
|
|
602
|
+
class: g(on),
|
|
603
|
+
value: e.modelValue.top,
|
|
604
|
+
"aria-label": h(s).spacingControl.top,
|
|
605
|
+
min: "0",
|
|
606
|
+
onInput: n[1] ||= (e) => d("top", Number(e.target.value))
|
|
607
|
+
}, null, 40, Ut),
|
|
608
|
+
y("button", {
|
|
609
|
+
"aria-label": h(s).spacingControl.increaseTop,
|
|
610
|
+
class: g([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
611
|
+
onClick: n[2] ||= (e) => u("top", 1)
|
|
612
|
+
}, [O(h(V), {
|
|
613
|
+
size: 12,
|
|
614
|
+
"stroke-width": 2
|
|
615
|
+
})], 10, Wt)
|
|
616
|
+
]),
|
|
617
|
+
y("div", Gt, [
|
|
618
|
+
y("div", Kt, [
|
|
619
|
+
y("button", {
|
|
620
|
+
"aria-label": h(s).spacingControl.decreaseLeft,
|
|
621
|
+
class: g([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
622
|
+
onClick: n[3] ||= (e) => u("left", -1)
|
|
623
|
+
}, [O(h(je), {
|
|
624
|
+
size: 12,
|
|
625
|
+
"stroke-width": 2
|
|
626
|
+
})], 10, qt),
|
|
627
|
+
y("input", {
|
|
628
|
+
type: "number",
|
|
629
|
+
class: g(on),
|
|
630
|
+
value: e.modelValue.left,
|
|
631
|
+
"aria-label": h(s).spacingControl.left,
|
|
632
|
+
min: "0",
|
|
633
|
+
onInput: n[4] ||= (e) => d("left", Number(e.target.value))
|
|
634
|
+
}, null, 40, Jt),
|
|
635
|
+
y("button", {
|
|
636
|
+
"aria-label": h(s).spacingControl.increaseLeft,
|
|
637
|
+
class: g([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
638
|
+
onClick: n[5] ||= (e) => u("left", 1)
|
|
639
|
+
}, [O(h(V), {
|
|
640
|
+
size: 12,
|
|
641
|
+
"stroke-width": 2
|
|
642
|
+
})], 10, Yt)
|
|
643
|
+
]),
|
|
644
|
+
y("button", {
|
|
645
|
+
class: g(["tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", l.value ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
|
|
646
|
+
"aria-label": l.value ? h(s).spacingControl.unlock : h(s).spacingControl.lockAll,
|
|
647
|
+
title: l.value ? h(s).spacingControl.unlock : h(s).spacingControl.lockAll,
|
|
648
|
+
onClick: f
|
|
649
|
+
}, [l.value ? (i(), v(h(Le), {
|
|
650
|
+
key: 0,
|
|
651
|
+
size: 14,
|
|
652
|
+
"stroke-width": 2
|
|
653
|
+
})) : (i(), v(h(Pe), {
|
|
654
|
+
key: 1,
|
|
655
|
+
size: 14,
|
|
656
|
+
"stroke-width": 2
|
|
657
|
+
}))], 10, Xt),
|
|
658
|
+
y("div", Zt, [
|
|
659
|
+
y("button", {
|
|
660
|
+
"aria-label": h(s).spacingControl.decreaseRight,
|
|
661
|
+
class: g([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
662
|
+
onClick: n[6] ||= (e) => u("right", -1)
|
|
663
|
+
}, [O(h(je), {
|
|
664
|
+
size: 12,
|
|
665
|
+
"stroke-width": 2
|
|
666
|
+
})], 10, Qt),
|
|
667
|
+
y("input", {
|
|
668
|
+
type: "number",
|
|
669
|
+
class: g(on),
|
|
670
|
+
value: e.modelValue.right,
|
|
671
|
+
"aria-label": h(s).spacingControl.right,
|
|
672
|
+
min: "0",
|
|
673
|
+
onInput: n[7] ||= (e) => d("right", Number(e.target.value))
|
|
674
|
+
}, null, 40, $t),
|
|
675
|
+
y("button", {
|
|
676
|
+
"aria-label": h(s).spacingControl.increaseRight,
|
|
677
|
+
class: g([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
678
|
+
onClick: n[8] ||= (e) => u("right", 1)
|
|
679
|
+
}, [O(h(V), {
|
|
680
|
+
size: 12,
|
|
681
|
+
"stroke-width": 2
|
|
682
|
+
})], 10, en)
|
|
683
|
+
])
|
|
684
|
+
]),
|
|
685
|
+
y("div", tn, [
|
|
686
|
+
y("button", {
|
|
687
|
+
"aria-label": h(s).spacingControl.decreaseBottom,
|
|
688
|
+
class: g([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
689
|
+
onClick: n[9] ||= (e) => u("bottom", -1)
|
|
690
|
+
}, [O(h(je), {
|
|
691
|
+
size: 12,
|
|
692
|
+
"stroke-width": 2
|
|
693
|
+
})], 10, nn),
|
|
694
|
+
y("input", {
|
|
695
|
+
type: "number",
|
|
696
|
+
class: g(on),
|
|
697
|
+
value: e.modelValue.bottom,
|
|
698
|
+
"aria-label": h(s).spacingControl.bottom,
|
|
699
|
+
min: "0",
|
|
700
|
+
onInput: n[10] ||= (e) => d("bottom", Number(e.target.value))
|
|
701
|
+
}, null, 40, rn),
|
|
702
|
+
y("button", {
|
|
703
|
+
"aria-label": h(s).spacingControl.increaseBottom,
|
|
704
|
+
class: g([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
705
|
+
onClick: n[11] ||= (e) => u("bottom", 1)
|
|
706
|
+
}, [O(h(V), {
|
|
707
|
+
size: 12,
|
|
708
|
+
"stroke-width": 2
|
|
709
|
+
})], 10, an)
|
|
710
|
+
])
|
|
711
|
+
])]),
|
|
712
|
+
_: 1
|
|
713
|
+
}, 8, ["path", "label"]));
|
|
714
|
+
}
|
|
715
|
+
}), [["__scopeId", "data-v-94c2e6ff"]]);
|
|
716
|
+
// src/composables/useNaturalImageSize.ts
|
|
717
|
+
function cn(e) {
|
|
718
|
+
let t = T(null), n = () => {};
|
|
719
|
+
return o(e, (e) => {
|
|
720
|
+
n(), t.value = null, e && (n = _e(e, (e) => {
|
|
721
|
+
t.value = e;
|
|
722
|
+
}));
|
|
723
|
+
}, { immediate: !0 }), t;
|
|
724
|
+
}
|
|
725
|
+
function ln() {
|
|
726
|
+
let e = l(Ve, null);
|
|
727
|
+
return async (t) => ge(e ? await un(e, t) : t);
|
|
728
|
+
}
|
|
729
|
+
function un(e, t) {
|
|
730
|
+
let n = (e) => typeof e == "string" && e.length > 0 ? e : t;
|
|
731
|
+
e.lookup(t);
|
|
732
|
+
let r = e.get(t);
|
|
733
|
+
return r === void 0 ? new Promise((r) => {
|
|
734
|
+
let i = o(() => e.get(t), (e) => {
|
|
735
|
+
e !== void 0 && (i(), r(n(e)));
|
|
736
|
+
});
|
|
737
|
+
}) : Promise.resolve(n(r));
|
|
738
|
+
}
|
|
739
|
+
// src/components/toolbar/BackgroundImageControl.vue?vue&type=script&setup=true&lang.ts
|
|
740
|
+
var dn = { class: "tpl:space-y-3.5" }, fn = ["data-testid"], pn = ["data-testid"], mn = ["data-testid"], hn = ["aria-label", "data-testid"], gn = [
|
|
741
|
+
"aria-label",
|
|
742
|
+
"title",
|
|
743
|
+
"aria-pressed",
|
|
744
|
+
"data-testid",
|
|
745
|
+
"onClick"
|
|
746
|
+
], _n = ["data-testid"], vn = /* @__PURE__ */ r({
|
|
747
|
+
__name: "BackgroundImageControl",
|
|
748
|
+
props: {
|
|
749
|
+
hideLabel: { type: Boolean },
|
|
750
|
+
modelValue: {},
|
|
751
|
+
testidPrefix: {},
|
|
752
|
+
measure: { type: Boolean },
|
|
753
|
+
heroMode: { type: Boolean }
|
|
754
|
+
},
|
|
755
|
+
emits: ["update:modelValue"],
|
|
756
|
+
setup(e, { emit: t }) {
|
|
757
|
+
let n = e, r = t, { t: a } = H(), o = l(Be, te.liquid), s = S(() => typeof n.modelValue?.url == "string" ? n.modelValue.url : ""), d = S(() => s.value.trim() !== ""), f = ln(), x;
|
|
758
|
+
u(() => clearTimeout(x));
|
|
759
|
+
function C(e) {
|
|
760
|
+
n.measure && !re(e, o) && (x = setTimeout(async () => {
|
|
761
|
+
let t = await f(e), i = n.modelValue;
|
|
762
|
+
t && i?.url === e && r("update:modelValue", {
|
|
763
|
+
...i,
|
|
764
|
+
...pe(t)
|
|
765
|
+
});
|
|
766
|
+
}, 300));
|
|
767
|
+
}
|
|
768
|
+
function w(e, t = null) {
|
|
769
|
+
if (clearTimeout(x), e.trim() === "") {
|
|
770
|
+
r("update:modelValue", void 0);
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
let { naturalWidth: i, naturalHeight: a, ...o } = n.modelValue ?? ee(e), s = n.measure ? t : null;
|
|
774
|
+
r("update:modelValue", {
|
|
775
|
+
...o,
|
|
776
|
+
url: e,
|
|
777
|
+
...s ? pe(s) : {}
|
|
778
|
+
}), s || C(e);
|
|
779
|
+
}
|
|
780
|
+
function D(e) {
|
|
781
|
+
n.modelValue && r("update:modelValue", {
|
|
782
|
+
...n.modelValue,
|
|
783
|
+
...e
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
let k = S(() => [
|
|
787
|
+
{
|
|
788
|
+
value: "cover",
|
|
789
|
+
label: a.blockSettings.backgroundSizeCover
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
value: "contain",
|
|
793
|
+
label: a.blockSettings.backgroundSizeContain
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
value: "auto",
|
|
797
|
+
label: a.blockSettings.backgroundSizeAuto
|
|
798
|
+
}
|
|
799
|
+
]), A = S(() => ({
|
|
800
|
+
"top-left": a.blockSettings.backgroundPositionTopLeft,
|
|
801
|
+
"top-center": a.blockSettings.backgroundPositionTopCenter,
|
|
802
|
+
"top-right": a.blockSettings.backgroundPositionTopRight,
|
|
803
|
+
"center-left": a.blockSettings.backgroundPositionCenterLeft,
|
|
804
|
+
"center-center": a.blockSettings.backgroundPositionCenter,
|
|
805
|
+
"center-right": a.blockSettings.backgroundPositionCenterRight,
|
|
806
|
+
"bottom-left": a.blockSettings.backgroundPositionBottomLeft,
|
|
807
|
+
"bottom-center": a.blockSettings.backgroundPositionBottomCenter,
|
|
808
|
+
"bottom-right": a.blockSettings.backgroundPositionBottomRight
|
|
809
|
+
})), j = S(() => N.flatMap((e) => ie.map((t) => ({
|
|
810
|
+
x: t,
|
|
811
|
+
y: e,
|
|
812
|
+
label: A.value[`${e}-${t}`]
|
|
813
|
+
}))));
|
|
814
|
+
function M(e) {
|
|
815
|
+
return n.modelValue?.position?.x === e.x && n.modelValue?.position?.y === e.y;
|
|
816
|
+
}
|
|
817
|
+
let P = T(), { canBrowse: F, isUploading: I, showOverlay: L, openMediaBrowser: ne } = ye({
|
|
818
|
+
target: P,
|
|
819
|
+
blocked: () => re(s.value, o),
|
|
820
|
+
apply: (e) => w(e.url, ce(e.width, e.height))
|
|
821
|
+
});
|
|
822
|
+
return (t, n) => (i(), p("div", dn, [y("div", null, [e.hideLabel ? _("", !0) : (i(), p("label", {
|
|
823
|
+
key: 0,
|
|
824
|
+
class: g(h(K))
|
|
825
|
+
}, b(h(a).blockSettings.backgroundImage), 3)), y("div", {
|
|
826
|
+
ref_key: "dropZoneRef",
|
|
827
|
+
ref: P,
|
|
828
|
+
class: "tpl:relative",
|
|
829
|
+
"data-testid": `${e.testidPrefix}-bg-url`
|
|
830
|
+
}, [
|
|
831
|
+
h(L) ? (i(), v(de, {
|
|
832
|
+
key: 0,
|
|
833
|
+
uploading: h(I)
|
|
834
|
+
}, null, 8, ["uploading"])) : _("", !0),
|
|
835
|
+
O(X, {
|
|
836
|
+
"model-value": s.value,
|
|
837
|
+
type: "url",
|
|
838
|
+
placeholder: h(a).blockSettings.backgroundImagePlaceholder,
|
|
839
|
+
"onUpdate:modelValue": w
|
|
840
|
+
}, null, 8, ["model-value", "placeholder"]),
|
|
841
|
+
h(F) ? (i(), p("button", {
|
|
842
|
+
key: 1,
|
|
843
|
+
type: "button",
|
|
844
|
+
"data-testid": `${e.testidPrefix}-bg-browse`,
|
|
845
|
+
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all",
|
|
846
|
+
style: {
|
|
847
|
+
"border-color": "var(--tpl-border)",
|
|
848
|
+
color: "var(--tpl-primary)",
|
|
849
|
+
"background-color": "var(--tpl-bg)"
|
|
850
|
+
},
|
|
851
|
+
onClick: n[0] ||= (...e) => h(ne) && h(ne)(...e)
|
|
852
|
+
}, [O(h(ke), {
|
|
853
|
+
size: 14,
|
|
854
|
+
"stroke-width": 1.5
|
|
855
|
+
}), m(" " + b(h(a).image.browseMedia), 1)], 8, pn)) : _("", !0)
|
|
856
|
+
], 8, fn)]), d.value && e.modelValue ? (i(), p(E, { key: 0 }, [
|
|
857
|
+
e.heroMode ? _("", !0) : (i(), p("div", {
|
|
858
|
+
key: 0,
|
|
859
|
+
"data-testid": `${e.testidPrefix}-bg-size`
|
|
860
|
+
}, [y("label", { class: g(h(K)) }, b(h(a).blockSettings.backgroundSize), 3), O(Z, {
|
|
861
|
+
options: k.value,
|
|
862
|
+
"model-value": e.modelValue.size,
|
|
863
|
+
"onUpdate:modelValue": n[1] ||= (e) => D({ size: e })
|
|
864
|
+
}, null, 8, ["options", "model-value"])], 8, mn)),
|
|
865
|
+
y("div", null, [y("label", { class: g(h(K)) }, b(h(a).blockSettings.backgroundPosition), 3), y("div", {
|
|
866
|
+
role: "group",
|
|
867
|
+
"aria-label": h(a).blockSettings.backgroundPosition,
|
|
868
|
+
"data-testid": `${e.testidPrefix}-bg-position`,
|
|
869
|
+
class: "tpl:grid tpl:w-24 tpl:grid-cols-3 tpl:gap-1"
|
|
870
|
+
}, [(i(!0), p(E, null, c(j.value, (t) => (i(), p("button", {
|
|
871
|
+
key: `${t.y}-${t.x}`,
|
|
872
|
+
type: "button",
|
|
873
|
+
"aria-label": t.label,
|
|
874
|
+
title: t.label,
|
|
875
|
+
"aria-pressed": M(t),
|
|
876
|
+
"data-testid": `${e.testidPrefix}-bg-position-${t.y}-${t.x}`,
|
|
877
|
+
class: g(["tpl:flex tpl:h-6 tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:transition-colors", M(t) ? "tpl:border-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:hover:border-[var(--tpl-text-dim)]"]),
|
|
878
|
+
onClick: (e) => D({ position: {
|
|
879
|
+
x: t.x,
|
|
880
|
+
y: t.y
|
|
881
|
+
} })
|
|
882
|
+
}, [y("span", { class: g(["tpl:block tpl:h-1.5 tpl:w-1.5 tpl:rounded-full", M(t) ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-text-dim)]"]) }, null, 2)], 10, gn))), 128))], 8, hn)]),
|
|
883
|
+
e.heroMode ? _("", !0) : (i(), p("div", {
|
|
884
|
+
key: 1,
|
|
885
|
+
"data-testid": `${e.testidPrefix}-bg-repeat`
|
|
886
|
+
}, [O(Y, {
|
|
887
|
+
class: "tpl:text-xs tpl:text-[var(--tpl-text)]",
|
|
888
|
+
"model-value": e.modelValue.repeat,
|
|
889
|
+
label: h(a).blockSettings.backgroundRepeat,
|
|
890
|
+
"onUpdate:modelValue": n[2] ||= (e) => D({ repeat: e })
|
|
891
|
+
}, null, 8, ["model-value", "label"])], 8, _n))
|
|
892
|
+
], 64)) : _("", !0)]));
|
|
893
|
+
}
|
|
894
|
+
}), yn = ["data-testid"], bn = { class: "tpl:mt-3" }, xn = /* @__PURE__ */ r({
|
|
895
|
+
__name: "CollapsibleSection",
|
|
896
|
+
props: {
|
|
897
|
+
title: {},
|
|
898
|
+
open: { type: Boolean },
|
|
899
|
+
noBorder: { type: Boolean },
|
|
900
|
+
headerTestId: {}
|
|
901
|
+
},
|
|
902
|
+
emits: ["toggle"],
|
|
903
|
+
setup(e) {
|
|
904
|
+
return (t, n) => (i(), p("div", { class: g(["tpl:py-3", e.noBorder ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [y("button", {
|
|
905
|
+
type: "button",
|
|
906
|
+
"data-testid": e.headerTestId,
|
|
907
|
+
class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
908
|
+
onClick: n[0] ||= (e) => t.$emit("toggle")
|
|
909
|
+
}, [O(h(Ce), {
|
|
910
|
+
class: g(["tpl:transition-transform tpl:duration-200", e.open ? "tpl:rotate-0" : "tpl:-rotate-90"]),
|
|
911
|
+
size: 12,
|
|
912
|
+
"stroke-width": 2
|
|
913
|
+
}, null, 8, ["class"]), y("span", null, b(e.title), 1)], 8, yn), s(y("div", bn, [d(t.$slots, "default")], 512), [[w, e.open]])], 2));
|
|
914
|
+
}
|
|
915
|
+
}), Sn = {
|
|
916
|
+
key: 0,
|
|
917
|
+
"data-testid": "section-hero-columns-note",
|
|
918
|
+
class: "tpl:mt-3.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
919
|
+
}, Cn = {
|
|
920
|
+
key: 1,
|
|
921
|
+
"data-testid": "section-hero",
|
|
922
|
+
class: "tpl:mt-3.5 tpl:space-y-3.5"
|
|
923
|
+
}, wn = { "data-testid": "section-hero-height" }, Tn = {
|
|
924
|
+
key: 0,
|
|
925
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
926
|
+
}, En = {
|
|
927
|
+
key: 1,
|
|
928
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
929
|
+
}, Dn = {
|
|
930
|
+
key: 1,
|
|
931
|
+
"data-testid": "section-hero-align"
|
|
932
|
+
}, On = 300, kn = /* @__PURE__ */ r({
|
|
933
|
+
__name: "HeroControl",
|
|
934
|
+
props: { section: {} },
|
|
935
|
+
emits: ["update"],
|
|
936
|
+
setup(e, { emit: t }) {
|
|
937
|
+
function n(e) {
|
|
938
|
+
return typeof e == "number" && Number.isFinite(e) && e >= 1;
|
|
939
|
+
}
|
|
940
|
+
let r = e, a = t, { t: o } = H(), s = l(Be, te.liquid), c = l(Qe, null), u = l(Ue, void 0), d = ln(), f = S(() => typeof r.section.backgroundImage?.url == "string" ? r.section.backgroundImage.url : ""), m = S(() => f.value.trim() !== ""), x = S(() => re(f.value, s)), C = S(() => r.section.hero), w = S(() => r.section.columns === "1"), T = S(() => C.value ? n(C.value.height) ? "fixed" : "image" : "fit"), E = S(() => n(C.value?.height) ? C.value.height : On), D = S(() => [
|
|
941
|
+
{
|
|
942
|
+
value: "fit",
|
|
943
|
+
label: o.blockSettings.heroHeightFit
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
value: "image",
|
|
947
|
+
label: o.blockSettings.heroHeightImage,
|
|
948
|
+
disabled: x.value
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
value: "fixed",
|
|
952
|
+
label: o.blockSettings.heroHeightFixed
|
|
953
|
+
}
|
|
954
|
+
]), k = S(() => [
|
|
955
|
+
{
|
|
956
|
+
value: "top",
|
|
957
|
+
label: o.blockSettings.heroAlignTop
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
value: "middle",
|
|
961
|
+
label: o.blockSettings.heroAlignMiddle
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
value: "bottom",
|
|
965
|
+
label: o.blockSettings.heroAlignBottom
|
|
966
|
+
}
|
|
967
|
+
]), A = S(() => T.value === "image" && m.value && !x.value && j(r.section.backgroundImage) === null);
|
|
968
|
+
function M() {
|
|
969
|
+
return (c ? z(c.content.value, r.section.id, u, c.activeLocale?.value ?? void 0) : null) ?? he(c?.state.content.settings);
|
|
970
|
+
}
|
|
971
|
+
function N(e) {
|
|
972
|
+
let t = C.value?.verticalAlign ?? "middle";
|
|
973
|
+
if (e === "image") {
|
|
974
|
+
T.value !== "image" && a("update", { hero: {
|
|
975
|
+
height: "image",
|
|
976
|
+
verticalAlign: t
|
|
977
|
+
} }), P();
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
if (e === T.value) return;
|
|
981
|
+
if (e === "fit") {
|
|
982
|
+
a("update", { hero: void 0 });
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
let n = j(r.section.backgroundImage), i = n === null ? On : Math.round(M() * n);
|
|
986
|
+
a("update", { hero: {
|
|
987
|
+
height: i,
|
|
988
|
+
verticalAlign: t
|
|
989
|
+
} });
|
|
990
|
+
}
|
|
991
|
+
async function P() {
|
|
992
|
+
let e = r.section.backgroundImage;
|
|
993
|
+
if (!e || !m.value || x.value || j(e) !== null) return;
|
|
994
|
+
let t = e.url, n = await d(t), i = r.section.backgroundImage;
|
|
995
|
+
n && i && i.url === t && a("update", { backgroundImage: {
|
|
996
|
+
...i,
|
|
997
|
+
...pe(n)
|
|
998
|
+
} });
|
|
999
|
+
}
|
|
1000
|
+
function F(e) {
|
|
1001
|
+
!C.value || !Number.isFinite(e) || e < 1 || a("update", { hero: {
|
|
1002
|
+
...C.value,
|
|
1003
|
+
height: Math.round(e)
|
|
1004
|
+
} });
|
|
1005
|
+
}
|
|
1006
|
+
function I(e) {
|
|
1007
|
+
C.value && a("update", { hero: {
|
|
1008
|
+
...C.value,
|
|
1009
|
+
verticalAlign: e
|
|
1010
|
+
} });
|
|
1011
|
+
}
|
|
1012
|
+
return (e, t) => !w.value && C.value ? (i(), p("p", Sn, b(h(o).section.heroNeedsOneColumn), 1)) : w.value && (m.value || C.value) ? (i(), p("div", Cn, [
|
|
1013
|
+
y("div", wn, [
|
|
1014
|
+
y("label", { class: g(h(K)) }, b(h(o).blockSettings.heroHeight), 3),
|
|
1015
|
+
O(Z, {
|
|
1016
|
+
options: D.value,
|
|
1017
|
+
"model-value": T.value,
|
|
1018
|
+
"onUpdate:modelValue": N
|
|
1019
|
+
}, null, 8, ["options", "model-value"]),
|
|
1020
|
+
x.value ? (i(), p("p", Tn, b(h(o).blockSettings.heroMatchImageMergeTag), 1)) : A.value ? (i(), p("p", En, b(h(o).blockSettings.heroSizeUnknown), 1)) : _("", !0)
|
|
1021
|
+
]),
|
|
1022
|
+
T.value === "fixed" ? (i(), v(_t, {
|
|
1023
|
+
key: 0,
|
|
1024
|
+
"model-value": E.value,
|
|
1025
|
+
min: 1,
|
|
1026
|
+
suffix: "px",
|
|
1027
|
+
testid: "section-hero-height-px",
|
|
1028
|
+
"onUpdate:modelValue": F
|
|
1029
|
+
}, null, 8, ["model-value"])) : _("", !0),
|
|
1030
|
+
C.value ? (i(), p("div", Dn, [y("label", { class: g(h(K)) }, b(h(o).blockSettings.heroAlign), 3), O(Z, {
|
|
1031
|
+
options: k.value,
|
|
1032
|
+
"model-value": C.value.verticalAlign,
|
|
1033
|
+
"onUpdate:modelValue": I
|
|
1034
|
+
}, null, 8, ["options", "model-value"])])) : _("", !0)
|
|
1035
|
+
])) : _("", !0);
|
|
1036
|
+
}
|
|
1037
|
+
}), An = { class: "tpl:space-y-2" }, jn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Mn = { class: "tpl:space-y-2" }, Nn = ["value"], Pn = { value: "" }, Fn = ["label"], In = ["value"], Ln = ["value"], Rn = {
|
|
1038
|
+
key: 0,
|
|
1039
|
+
value: "__custom__"
|
|
1040
|
+
}, zn = {
|
|
1041
|
+
key: 0,
|
|
1042
|
+
class: "tpl:space-y-2"
|
|
1043
|
+
}, Bn = { class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Vn = { class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Hn = { class: "tpl:flex tpl:justify-end" }, Un = ["disabled"], Wn = {
|
|
1044
|
+
key: 0,
|
|
1045
|
+
class: "tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"
|
|
1046
|
+
}, Gn = { class: "tpl:space-y-1" }, Kn = { class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]" }, qn = {
|
|
1047
|
+
key: 0,
|
|
1048
|
+
class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"
|
|
1049
|
+
}, Jn = /* @__PURE__ */ r({
|
|
1050
|
+
__name: "CommonBlockSettings",
|
|
1051
|
+
props: {
|
|
1052
|
+
block: {},
|
|
1053
|
+
isFirstSection: { type: Boolean }
|
|
1054
|
+
},
|
|
1055
|
+
emits: ["update"],
|
|
1056
|
+
setup(e, { emit: r }) {
|
|
1057
|
+
let u = e, d = r, { t: f, format: C } = H(), w = l(Qe, null), D = l(He, void 0), k = S(() => w?.activeLocale?.value), A = S(() => !!(k.value && w?.selectedBlock?.value?.l10n?.[k.value]?.hidden)), j = l(Ke, []), M = l(Ze, !1), N = t(/* @__PURE__ */ new Set()), P = T(!1), F = T(""), I = T(""), ee = [{
|
|
1058
|
+
key: "desktop",
|
|
1059
|
+
icon: xe,
|
|
1060
|
+
labelKey: "showOnDesktop"
|
|
1061
|
+
}, {
|
|
1062
|
+
key: "mobile",
|
|
1063
|
+
icon: Ee,
|
|
1064
|
+
labelKey: "showOnMobile"
|
|
1065
|
+
}];
|
|
1066
|
+
function L(e) {
|
|
1067
|
+
N.has(e) ? N.delete(e) : N.add(e);
|
|
1068
|
+
}
|
|
1069
|
+
let te = S(() => j.length > 0 || M), R = S(() => u.block.displayCondition ? !j.some((e) => e.label === u.block.displayCondition?.label) : !1);
|
|
1070
|
+
function re() {
|
|
1071
|
+
P.value = !0, R.value && u.block.displayCondition ? (F.value = u.block.displayCondition.before, I.value = u.block.displayCondition.after ?? "") : (F.value = "", I.value = "");
|
|
1072
|
+
}
|
|
1073
|
+
function ie() {
|
|
1074
|
+
let e = F.value.trim(), t = I.value.trim();
|
|
1075
|
+
e && (d("update", { displayCondition: {
|
|
1076
|
+
label: f.blockSettings.customCondition,
|
|
1077
|
+
before: e,
|
|
1078
|
+
after: t
|
|
1079
|
+
} }), P.value = !1, F.value = e, I.value = t);
|
|
1080
|
+
}
|
|
1081
|
+
o([
|
|
1082
|
+
() => w?.state?.template?.id,
|
|
1083
|
+
() => u.block.id,
|
|
1084
|
+
() => u.block.displayCondition?.label,
|
|
1085
|
+
() => u.block.displayCondition?.before,
|
|
1086
|
+
() => u.block.displayCondition?.after
|
|
1087
|
+
], () => {
|
|
1088
|
+
let e = u.block.displayCondition;
|
|
1089
|
+
!e || !R.value ? (P.value = !1, F.value = "", I.value = "") : (F.value = e.before, I.value = e.after ?? "");
|
|
1090
|
+
}, { immediate: !0 });
|
|
1091
|
+
let ae = S(() => {
|
|
1092
|
+
let e = {};
|
|
1093
|
+
for (let t of j) {
|
|
1094
|
+
let n = t.group ?? "";
|
|
1095
|
+
e[n] || (e[n] = []), e[n].push(t);
|
|
1096
|
+
}
|
|
1097
|
+
return e;
|
|
1098
|
+
}), oe = S(() => u.block.type === "section" && ne(u.block)?.applied === !0);
|
|
1099
|
+
function se(e, t) {
|
|
1100
|
+
d("update", { styles: {
|
|
1101
|
+
...u.block.styles,
|
|
1102
|
+
[e]: t
|
|
1103
|
+
} });
|
|
1104
|
+
}
|
|
1105
|
+
function ce(e) {
|
|
1106
|
+
return u.block.visibility?.[e] !== !1;
|
|
1107
|
+
}
|
|
1108
|
+
function le(e) {
|
|
1109
|
+
let t = {
|
|
1110
|
+
desktop: ce("desktop"),
|
|
1111
|
+
mobile: ce("mobile")
|
|
1112
|
+
};
|
|
1113
|
+
t[e] = !t[e], d("update", { visibility: t });
|
|
1114
|
+
}
|
|
1115
|
+
return (t, r) => (i(), p("div", { class: g(["tpl:flex tpl:flex-col", e.isFirstSection ? "" : "tpl:mt-4"]) }, [
|
|
1116
|
+
O(xn, {
|
|
1117
|
+
title: h(f).blockSettings.spacing,
|
|
1118
|
+
open: N.has("spacing"),
|
|
1119
|
+
"no-border": e.isFirstSection,
|
|
1120
|
+
onToggle: r[1] ||= (e) => L("spacing")
|
|
1121
|
+
}, {
|
|
1122
|
+
default: a(() => [O(sn, {
|
|
1123
|
+
path: "styles.padding",
|
|
1124
|
+
label: h(f).blockSettings.padding,
|
|
1125
|
+
"model-value": e.block.styles.padding,
|
|
1126
|
+
"onUpdate:modelValue": r[0] ||= (e) => se("padding", e)
|
|
1127
|
+
}, null, 8, ["label", "model-value"])]),
|
|
1128
|
+
_: 1
|
|
1129
|
+
}, 8, [
|
|
1130
|
+
"title",
|
|
1131
|
+
"open",
|
|
1132
|
+
"no-border"
|
|
1133
|
+
]),
|
|
1134
|
+
O(xn, {
|
|
1135
|
+
title: h(f).blockSettings.background,
|
|
1136
|
+
open: N.has("bg"),
|
|
1137
|
+
"header-test-id": "block-settings-background",
|
|
1138
|
+
onToggle: r[5] ||= (e) => L("bg")
|
|
1139
|
+
}, {
|
|
1140
|
+
default: a(() => [
|
|
1141
|
+
O(q, {
|
|
1142
|
+
path: "styles.backgroundColor",
|
|
1143
|
+
label: h(f).blockSettings.color
|
|
1144
|
+
}, {
|
|
1145
|
+
default: a(() => [O(J, {
|
|
1146
|
+
"model-value": e.block.styles.backgroundColor ?? "",
|
|
1147
|
+
"allow-transparent": "",
|
|
1148
|
+
"onUpdate:modelValue": r[2] ||= (e) => se("backgroundColor", e)
|
|
1149
|
+
}, null, 8, ["model-value"])]),
|
|
1150
|
+
_: 1
|
|
1151
|
+
}, 8, ["label"]),
|
|
1152
|
+
e.block.type === "section" ? (i(), v(q, {
|
|
1153
|
+
key: 0,
|
|
1154
|
+
path: "backgroundImage",
|
|
1155
|
+
label: h(f).blockSettings.backgroundImage
|
|
1156
|
+
}, {
|
|
1157
|
+
default: a(() => [O(vn, {
|
|
1158
|
+
"hide-label": "",
|
|
1159
|
+
class: "tpl:mt-3.5",
|
|
1160
|
+
"model-value": e.block.backgroundImage,
|
|
1161
|
+
"testid-prefix": "section",
|
|
1162
|
+
measure: "",
|
|
1163
|
+
"hero-mode": oe.value,
|
|
1164
|
+
"onUpdate:modelValue": r[3] ||= (e) => d("update", { backgroundImage: e })
|
|
1165
|
+
}, null, 8, ["model-value", "hero-mode"])]),
|
|
1166
|
+
_: 1
|
|
1167
|
+
}, 8, ["label"])) : _("", !0),
|
|
1168
|
+
e.block.type === "section" ? (i(), v(q, {
|
|
1169
|
+
key: 1,
|
|
1170
|
+
path: "hero",
|
|
1171
|
+
label: h(f).blocks.hero
|
|
1172
|
+
}, {
|
|
1173
|
+
default: a(() => [O(kn, {
|
|
1174
|
+
section: e.block,
|
|
1175
|
+
onUpdate: r[4] ||= (e) => d("update", e)
|
|
1176
|
+
}, null, 8, ["section"])]),
|
|
1177
|
+
_: 1
|
|
1178
|
+
}, 8, ["label"])) : _("", !0)
|
|
1179
|
+
]),
|
|
1180
|
+
_: 1
|
|
1181
|
+
}, 8, ["title", "open"]),
|
|
1182
|
+
O(xn, {
|
|
1183
|
+
title: h(f).blockSettings.display,
|
|
1184
|
+
open: N.has("display"),
|
|
1185
|
+
onToggle: r[7] ||= (e) => L("display")
|
|
1186
|
+
}, {
|
|
1187
|
+
default: a(() => [y("div", An, [k.value && h(D) ? (i(), v(Y, {
|
|
1188
|
+
key: 0,
|
|
1189
|
+
"data-testid": "locale-hide",
|
|
1190
|
+
disabled: !h(D).locales.includes(k.value),
|
|
1191
|
+
"model-value": A.value,
|
|
1192
|
+
label: h(C)(h(f).localization.hide, { language: h(et)(k.value) }),
|
|
1193
|
+
"onUpdate:modelValue": r[6] ||= (t) => h(w)?.setBlockHidden?.(e.block.id, t)
|
|
1194
|
+
}, null, 8, [
|
|
1195
|
+
"disabled",
|
|
1196
|
+
"model-value",
|
|
1197
|
+
"label"
|
|
1198
|
+
])) : _("", !0), (i(), p(E, null, c(ee, (e) => O(q, {
|
|
1199
|
+
key: e.key,
|
|
1200
|
+
path: `visibility.${e.key}`,
|
|
1201
|
+
label: h(f).blockSettings[e.labelKey]
|
|
1202
|
+
}, {
|
|
1203
|
+
label: a(() => [y("span", jn, [(i(), v(n(e.icon), {
|
|
1204
|
+
size: 14,
|
|
1205
|
+
"stroke-width": 1.5
|
|
1206
|
+
})), m(" " + b(h(f).blockSettings[e.labelKey]), 1)])]),
|
|
1207
|
+
"label-actions": a(({ controlId: t }) => [O(Y, {
|
|
1208
|
+
"control-id": t,
|
|
1209
|
+
"hide-label": "",
|
|
1210
|
+
class: "tpl:text-xs tpl:text-[var(--tpl-text)]",
|
|
1211
|
+
"model-value": ce(e.key),
|
|
1212
|
+
label: h(f).blockSettings[e.labelKey],
|
|
1213
|
+
"onUpdate:modelValue": (t) => le(e.key)
|
|
1214
|
+
}, null, 8, [
|
|
1215
|
+
"control-id",
|
|
1216
|
+
"model-value",
|
|
1217
|
+
"label",
|
|
1218
|
+
"onUpdate:modelValue"
|
|
1219
|
+
])]),
|
|
1220
|
+
_: 2
|
|
1221
|
+
}, 1032, ["path", "label"])), 64))])]),
|
|
1222
|
+
_: 1
|
|
1223
|
+
}, 8, ["title", "open"]),
|
|
1224
|
+
te.value ? (i(), v(xn, {
|
|
1225
|
+
key: 0,
|
|
1226
|
+
"header-test-id": "display-condition-section",
|
|
1227
|
+
title: h(f).blockSettings.displayCondition,
|
|
1228
|
+
open: N.has("condition"),
|
|
1229
|
+
onToggle: r[11] ||= (e) => L("condition")
|
|
1230
|
+
}, {
|
|
1231
|
+
default: a(() => [y("div", Mn, [O(q, {
|
|
1232
|
+
path: "displayCondition",
|
|
1233
|
+
label: h(f).blockSettings.displayCondition
|
|
1234
|
+
}, {
|
|
1235
|
+
default: a(() => [y("select", {
|
|
1236
|
+
"data-testid": "display-condition-select",
|
|
1237
|
+
class: g(["tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", e.block.displayCondition ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"]),
|
|
1238
|
+
value: P.value || R.value ? "__custom__" : e.block.displayCondition?.label ?? "",
|
|
1239
|
+
onChange: r[8] ||= (e) => {
|
|
1240
|
+
let t = e.target.value;
|
|
1241
|
+
if (t === "__custom__") {
|
|
1242
|
+
re();
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
if (P.value = !1, !t) {
|
|
1246
|
+
d("update", { displayCondition: void 0 });
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
let n = h(j).find((e) => e.label === t);
|
|
1250
|
+
n && d("update", { displayCondition: n });
|
|
1251
|
+
}
|
|
1252
|
+
}, [
|
|
1253
|
+
y("option", Pn, b(h(f).blockSettings.noCondition), 1),
|
|
1254
|
+
(i(!0), p(E, null, c(ae.value, (e, t) => (i(), p(E, { key: t }, [t ? (i(), p("optgroup", {
|
|
1255
|
+
key: 0,
|
|
1256
|
+
label: String(t)
|
|
1257
|
+
}, [(i(!0), p(E, null, c(e, (e) => (i(), p("option", {
|
|
1258
|
+
key: e.label,
|
|
1259
|
+
value: e.label
|
|
1260
|
+
}, b(e.label), 9, In))), 128))], 8, Fn)) : (i(!0), p(E, { key: 1 }, c(e, (e) => (i(), p("option", {
|
|
1261
|
+
key: e.label,
|
|
1262
|
+
value: e.label
|
|
1263
|
+
}, b(e.label), 9, Ln))), 128))], 64))), 128)),
|
|
1264
|
+
h(M) ? (i(), p("option", Rn, b(h(f).blockSettings.customCondition), 1)) : _("", !0)
|
|
1265
|
+
], 42, Nn)]),
|
|
1266
|
+
_: 1
|
|
1267
|
+
}, 8, ["label"]), P.value || R.value ? (i(), p("div", zn, [
|
|
1268
|
+
y("div", null, [y("label", Bn, b(h(f).blockSettings.customConditionBefore), 1), s(y("textarea", {
|
|
1269
|
+
"onUpdate:modelValue": r[9] ||= (e) => F.value = e,
|
|
1270
|
+
rows: "2",
|
|
1271
|
+
class: g(h(at))
|
|
1272
|
+
}, null, 2), [[x, F.value]])]),
|
|
1273
|
+
y("div", null, [y("label", Vn, b(h(f).blockSettings.customConditionAfter), 1), s(y("textarea", {
|
|
1274
|
+
"onUpdate:modelValue": r[10] ||= (e) => I.value = e,
|
|
1275
|
+
rows: "2",
|
|
1276
|
+
class: g(h(at))
|
|
1277
|
+
}, null, 2), [[x, I.value]])]),
|
|
1278
|
+
y("div", Hn, [y("button", {
|
|
1279
|
+
type: "button",
|
|
1280
|
+
class: g(h(nt)),
|
|
1281
|
+
disabled: !F.value.trim(),
|
|
1282
|
+
onClick: ie
|
|
1283
|
+
}, b(h(f).blockSettings.applyCondition), 11, Un)])
|
|
1284
|
+
])) : e.block.displayCondition && !R.value ? (i(), p(E, { key: 1 }, [e.block.displayCondition.description ? (i(), p("p", Wn, b(e.block.displayCondition.description), 1)) : _("", !0), y("div", Gn, [y("pre", Kn, b(e.block.displayCondition.before), 1), e.block.displayCondition.after ? (i(), p("pre", qn, b(e.block.displayCondition.after), 1)) : _("", !0)])], 64)) : _("", !0)])]),
|
|
1285
|
+
_: 1
|
|
1286
|
+
}, 8, ["title", "open"])) : _("", !0)
|
|
1287
|
+
], 2));
|
|
1288
|
+
}
|
|
1289
|
+
}), Yn = ["title"], Xn = { class: "tpl-sr-only" }, Zn = ["title"], Qn = { class: "tpl-sr-only" }, $n = /* @__PURE__ */ r({
|
|
1290
|
+
__name: "FieldLabel",
|
|
1291
|
+
props: {
|
|
1292
|
+
label: {},
|
|
1293
|
+
required: { type: Boolean },
|
|
1294
|
+
readOnly: { type: Boolean }
|
|
1295
|
+
},
|
|
1296
|
+
setup(e) {
|
|
1297
|
+
let { t } = H();
|
|
1298
|
+
return (n, r) => (i(), p("span", null, [
|
|
1299
|
+
m(b(e.label) + " ", 1),
|
|
1300
|
+
e.readOnly ? (i(), p("span", {
|
|
1301
|
+
key: 0,
|
|
1302
|
+
title: h(t).customBlocks.dataSource.readOnlyTooltip
|
|
1303
|
+
}, [O(h(Le), {
|
|
1304
|
+
size: 12,
|
|
1305
|
+
class: "tpl:inline tpl:text-[var(--tpl-text-dim)]",
|
|
1306
|
+
"aria-hidden": "true"
|
|
1307
|
+
}), y("span", Xn, b(h(t).customBlocks.dataSource.readOnlyTooltip), 1)], 8, Yn)) : _("", !0),
|
|
1308
|
+
e.required ? (i(), p("span", {
|
|
1309
|
+
key: 1,
|
|
1310
|
+
class: "tpl:text-[var(--tpl-danger)]",
|
|
1311
|
+
title: h(t).customBlocks.fields.required
|
|
1312
|
+
}, [r[0] ||= y("span", { "aria-hidden": "true" }, "*", -1), y("span", Qn, b(h(t).customBlocks.fields.required), 1)], 8, Zn)) : _("", !0)
|
|
1313
|
+
]));
|
|
1314
|
+
}
|
|
1315
|
+
}), er = ["title"], tr = /* @__PURE__ */ r({
|
|
1316
|
+
__name: "BooleanField",
|
|
1317
|
+
props: {
|
|
1318
|
+
field: {},
|
|
1319
|
+
modelValue: { type: Boolean },
|
|
1320
|
+
readOnly: { type: Boolean },
|
|
1321
|
+
hideLabel: { type: Boolean },
|
|
1322
|
+
controlId: {}
|
|
1323
|
+
},
|
|
1324
|
+
emits: ["update:modelValue"],
|
|
1325
|
+
setup(e, { emit: t }) {
|
|
1326
|
+
let n = t, { t: r } = H();
|
|
1327
|
+
return (t, o) => (i(), p("div", {
|
|
1328
|
+
class: "tpl:mb-3.5",
|
|
1329
|
+
title: e.readOnly ? h(r).customBlocks.dataSource.readOnlyTooltip : void 0
|
|
1330
|
+
}, [O(Y, {
|
|
1331
|
+
"hide-label": e.hideLabel,
|
|
1332
|
+
"control-id": e.controlId,
|
|
1333
|
+
class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
1334
|
+
"model-value": e.modelValue,
|
|
1335
|
+
label: e.field.label,
|
|
1336
|
+
required: e.field.required,
|
|
1337
|
+
disabled: e.readOnly,
|
|
1338
|
+
"onUpdate:modelValue": o[0] ||= (e) => n("update:modelValue", e)
|
|
1339
|
+
}, {
|
|
1340
|
+
default: a(() => [m(b(e.field.label) + " ", 1), e.readOnly ? (i(), v(h(Le), {
|
|
1341
|
+
key: 0,
|
|
1342
|
+
size: 12,
|
|
1343
|
+
class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
|
|
1344
|
+
})) : _("", !0)]),
|
|
1345
|
+
_: 1
|
|
1346
|
+
}, 8, [
|
|
1347
|
+
"hide-label",
|
|
1348
|
+
"control-id",
|
|
1349
|
+
"model-value",
|
|
1350
|
+
"label",
|
|
1351
|
+
"required",
|
|
1352
|
+
"disabled"
|
|
1353
|
+
])], 8, er));
|
|
1354
|
+
}
|
|
1355
|
+
}), nr = { class: "tpl:mb-3.5" }, $ = /* @__PURE__ */ r({
|
|
1356
|
+
__name: "FieldWrapper",
|
|
1357
|
+
props: {
|
|
1358
|
+
label: {},
|
|
1359
|
+
hideLabel: { type: Boolean },
|
|
1360
|
+
required: { type: Boolean },
|
|
1361
|
+
readOnly: { type: Boolean }
|
|
1362
|
+
},
|
|
1363
|
+
setup(e) {
|
|
1364
|
+
return (t, n) => (i(), p("div", nr, [e.hideLabel ? _("", !0) : (i(), p("label", {
|
|
1365
|
+
key: 0,
|
|
1366
|
+
class: g(h(K))
|
|
1367
|
+
}, [O($n, {
|
|
1368
|
+
label: e.label,
|
|
1369
|
+
required: e.required,
|
|
1370
|
+
"read-only": e.readOnly
|
|
1371
|
+
}, null, 8, [
|
|
1372
|
+
"label",
|
|
1373
|
+
"required",
|
|
1374
|
+
"read-only"
|
|
1375
|
+
])], 2)), d(t.$slots, "default")]));
|
|
1376
|
+
}
|
|
1377
|
+
}), rr = /* @__PURE__ */ r({
|
|
1378
|
+
__name: "ColorField",
|
|
1379
|
+
props: {
|
|
1380
|
+
field: {},
|
|
1381
|
+
modelValue: {},
|
|
1382
|
+
readOnly: { type: Boolean },
|
|
1383
|
+
hideLabel: { type: Boolean }
|
|
1384
|
+
},
|
|
1385
|
+
emits: ["update:modelValue"],
|
|
1386
|
+
setup(e, { emit: t }) {
|
|
1387
|
+
let n = e, r = t, { t: o } = H(), s = l(Xe, ct), c = S(() => be(n.field, s));
|
|
1388
|
+
return (t, n) => (i(), v($, {
|
|
1389
|
+
"hide-label": e.hideLabel,
|
|
1390
|
+
label: e.field.label,
|
|
1391
|
+
required: e.field.required,
|
|
1392
|
+
"read-only": e.readOnly
|
|
1393
|
+
}, {
|
|
1394
|
+
default: a(() => [O(J, {
|
|
1395
|
+
"model-value": e.modelValue,
|
|
1396
|
+
placeholder: e.field.placeholder,
|
|
1397
|
+
disabled: e.readOnly,
|
|
1398
|
+
presets: c.value.presets,
|
|
1399
|
+
"allow-custom": c.value.allowCustom,
|
|
1400
|
+
title: e.readOnly ? h(o).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1401
|
+
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", e)
|
|
1402
|
+
}, null, 8, [
|
|
1403
|
+
"model-value",
|
|
1404
|
+
"placeholder",
|
|
1405
|
+
"disabled",
|
|
1406
|
+
"presets",
|
|
1407
|
+
"allow-custom",
|
|
1408
|
+
"title"
|
|
1409
|
+
])]),
|
|
1410
|
+
_: 1
|
|
1411
|
+
}, 8, [
|
|
1412
|
+
"hide-label",
|
|
1413
|
+
"label",
|
|
1414
|
+
"required",
|
|
1415
|
+
"read-only"
|
|
1416
|
+
]));
|
|
1417
|
+
}
|
|
1418
|
+
}), ir = [
|
|
1419
|
+
"value",
|
|
1420
|
+
"placeholder",
|
|
1421
|
+
"title"
|
|
1422
|
+
], ar = ["value", "placeholder"], or = /* @__PURE__ */ r({
|
|
1423
|
+
__name: "ImageField",
|
|
1424
|
+
props: {
|
|
1425
|
+
field: {},
|
|
1426
|
+
modelValue: {},
|
|
1427
|
+
readOnly: { type: Boolean },
|
|
1428
|
+
hideLabel: { type: Boolean }
|
|
1429
|
+
},
|
|
1430
|
+
emits: ["update:modelValue"],
|
|
1431
|
+
setup(e, { emit: t }) {
|
|
1432
|
+
let n = e, r = t, { t: o } = H(), s = T(), { canBrowse: c, isUploading: l, showOverlay: u, openMediaBrowser: d } = ye({
|
|
1433
|
+
target: s,
|
|
1434
|
+
blocked: () => !!n.readOnly,
|
|
1435
|
+
apply: (e) => r("update:modelValue", e.url)
|
|
1436
|
+
});
|
|
1437
|
+
return (t, n) => (i(), v($, {
|
|
1438
|
+
"hide-label": e.hideLabel,
|
|
1439
|
+
label: e.field.label,
|
|
1440
|
+
required: e.field.required,
|
|
1441
|
+
"read-only": e.readOnly
|
|
1442
|
+
}, {
|
|
1443
|
+
default: a(() => [y("div", {
|
|
1444
|
+
ref_key: "dropZoneRef",
|
|
1445
|
+
ref: s,
|
|
1446
|
+
class: "tpl:relative"
|
|
1447
|
+
}, [
|
|
1448
|
+
h(u) ? (i(), v(de, {
|
|
1449
|
+
key: 0,
|
|
1450
|
+
uploading: h(l)
|
|
1451
|
+
}, null, 8, ["uploading"])) : _("", !0),
|
|
1452
|
+
e.readOnly ? (i(), p("input", {
|
|
1453
|
+
key: 1,
|
|
1454
|
+
type: "url",
|
|
1455
|
+
class: g([h(G), "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1456
|
+
value: e.modelValue,
|
|
1457
|
+
placeholder: e.field.placeholder || "https://...",
|
|
1458
|
+
disabled: "",
|
|
1459
|
+
title: h(o).customBlocks.dataSource.readOnlyTooltip
|
|
1460
|
+
}, null, 10, ir)) : (i(), p("input", {
|
|
1461
|
+
key: 2,
|
|
1462
|
+
type: "url",
|
|
1463
|
+
class: g(h(G)),
|
|
1464
|
+
value: e.modelValue,
|
|
1465
|
+
placeholder: e.field.placeholder || "https://...",
|
|
1466
|
+
onInput: n[0] ||= (e) => r("update:modelValue", e.target.value)
|
|
1467
|
+
}, null, 42, ar)),
|
|
1468
|
+
h(c) && !e.readOnly ? (i(), p("button", {
|
|
1469
|
+
key: 3,
|
|
1470
|
+
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
|
|
1471
|
+
onClick: n[1] ||= (e) => h(d)()
|
|
1472
|
+
}, [O(h(ke), {
|
|
1473
|
+
size: 14,
|
|
1474
|
+
"stroke-width": 1.5
|
|
1475
|
+
}), m(" " + b(h(o).image.browseMedia), 1)])) : _("", !0)
|
|
1476
|
+
], 512)]),
|
|
1477
|
+
_: 1
|
|
1478
|
+
}, 8, [
|
|
1479
|
+
"hide-label",
|
|
1480
|
+
"label",
|
|
1481
|
+
"required",
|
|
1482
|
+
"read-only"
|
|
1483
|
+
]));
|
|
1484
|
+
}
|
|
1485
|
+
}), sr = [
|
|
1486
|
+
"value",
|
|
1487
|
+
"placeholder",
|
|
1488
|
+
"min",
|
|
1489
|
+
"max",
|
|
1490
|
+
"step",
|
|
1491
|
+
"disabled",
|
|
1492
|
+
"title"
|
|
1493
|
+
], cr = /* @__PURE__ */ r({
|
|
1494
|
+
__name: "NumberField",
|
|
1495
|
+
props: {
|
|
1496
|
+
field: {},
|
|
1497
|
+
modelValue: {},
|
|
1498
|
+
readOnly: { type: Boolean },
|
|
1499
|
+
hideLabel: { type: Boolean }
|
|
1500
|
+
},
|
|
1501
|
+
emits: ["update:modelValue"],
|
|
1502
|
+
setup(e, { emit: t }) {
|
|
1503
|
+
let n = t, { t: r } = H();
|
|
1504
|
+
return (t, o) => (i(), v($, {
|
|
1505
|
+
"hide-label": e.hideLabel,
|
|
1506
|
+
label: e.field.label,
|
|
1507
|
+
required: e.field.required,
|
|
1508
|
+
"read-only": e.readOnly
|
|
1509
|
+
}, {
|
|
1510
|
+
default: a(() => [y("input", {
|
|
1511
|
+
type: "number",
|
|
1512
|
+
class: g([h(G), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1513
|
+
value: e.modelValue,
|
|
1514
|
+
placeholder: e.field.placeholder,
|
|
1515
|
+
min: e.field.min,
|
|
1516
|
+
max: e.field.max,
|
|
1517
|
+
step: e.field.step,
|
|
1518
|
+
disabled: e.readOnly,
|
|
1519
|
+
title: e.readOnly ? h(r).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1520
|
+
onInput: o[0] ||= (t) => !e.readOnly && n("update:modelValue", Number(t.target.value))
|
|
1521
|
+
}, null, 42, sr)]),
|
|
1522
|
+
_: 1
|
|
1523
|
+
}, 8, [
|
|
1524
|
+
"hide-label",
|
|
1525
|
+
"label",
|
|
1526
|
+
"required",
|
|
1527
|
+
"read-only"
|
|
1528
|
+
]));
|
|
1529
|
+
}
|
|
1530
|
+
}), lr = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, ur = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, dr = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, fr = ["title", "onClick"], pr = {
|
|
1531
|
+
key: 1,
|
|
1532
|
+
class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
1533
|
+
}, mr = {
|
|
1534
|
+
key: 2,
|
|
1535
|
+
class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
1536
|
+
}, hr = /* @__PURE__ */ r({
|
|
1537
|
+
__name: "RepeatableField",
|
|
1538
|
+
props: {
|
|
1539
|
+
field: {},
|
|
1540
|
+
modelValue: {},
|
|
1541
|
+
readOnly: { type: Boolean },
|
|
1542
|
+
hideLabel: { type: Boolean }
|
|
1543
|
+
},
|
|
1544
|
+
emits: ["update:modelValue"],
|
|
1545
|
+
setup(e, { emit: t }) {
|
|
1546
|
+
let r = e, o = t, { t: s, format: l } = H(), u = S(() => r.modelValue || []), d = S(() => !r.field.maxItems || u.value.length < r.field.maxItems), f = S(() => !r.field.minItems || u.value.length > r.field.minItems);
|
|
1547
|
+
function x() {
|
|
1548
|
+
if (!d.value || r.readOnly) return;
|
|
1549
|
+
let e = {};
|
|
1550
|
+
for (let t of r.field.fields) e[t.key] = t.default ?? "";
|
|
1551
|
+
o("update:modelValue", [...u.value, e]);
|
|
1552
|
+
}
|
|
1553
|
+
function C(e) {
|
|
1554
|
+
if (!f.value || r.readOnly) return;
|
|
1555
|
+
let t = [...u.value];
|
|
1556
|
+
t.splice(e, 1), o("update:modelValue", t);
|
|
1557
|
+
}
|
|
1558
|
+
function w(e, t, n) {
|
|
1559
|
+
let r = u.value.map((r, i) => i === e ? {
|
|
1560
|
+
...r,
|
|
1561
|
+
[t]: n
|
|
1562
|
+
} : r);
|
|
1563
|
+
o("update:modelValue", r);
|
|
1564
|
+
}
|
|
1565
|
+
return (t, r) => (i(), v($, {
|
|
1566
|
+
"hide-label": e.hideLabel,
|
|
1567
|
+
label: e.field.label,
|
|
1568
|
+
required: e.field.required,
|
|
1569
|
+
"read-only": e.readOnly
|
|
1570
|
+
}, {
|
|
1571
|
+
default: a(() => [y("div", lr, [
|
|
1572
|
+
(i(!0), p(E, null, c(u.value, (t, r) => (i(), p("div", {
|
|
1573
|
+
key: `${e.field.key}-${r}`,
|
|
1574
|
+
class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
|
|
1575
|
+
}, [y("div", ur, [y("span", dr, " #" + b(r + 1), 1), f.value && !e.readOnly ? (i(), p("button", {
|
|
1576
|
+
key: 0,
|
|
1577
|
+
type: "button",
|
|
1578
|
+
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
|
|
1579
|
+
title: h(s).customBlocks.fields.removeItem,
|
|
1580
|
+
onClick: (e) => C(r)
|
|
1581
|
+
}, [O(h(Me), {
|
|
1582
|
+
size: 12,
|
|
1583
|
+
"stroke-width": 2
|
|
1584
|
+
})], 8, fr)) : _("", !0)]), (i(!0), p(E, null, c(e.field.fields, (a) => (i(), v(n(h(wr)(a.type)), {
|
|
1585
|
+
key: a.key,
|
|
1586
|
+
field: a,
|
|
1587
|
+
"model-value": t[a.key],
|
|
1588
|
+
"read-only": e.readOnly,
|
|
1589
|
+
"onUpdate:modelValue": (e) => w(r, a.key, e)
|
|
1590
|
+
}, null, 8, [
|
|
1591
|
+
"field",
|
|
1592
|
+
"model-value",
|
|
1593
|
+
"read-only",
|
|
1594
|
+
"onUpdate:modelValue"
|
|
1595
|
+
]))), 128))]))), 128)),
|
|
1596
|
+
d.value && !e.readOnly ? (i(), p("button", {
|
|
1597
|
+
key: 0,
|
|
1598
|
+
type: "button",
|
|
1599
|
+
class: g(h(rt)),
|
|
1600
|
+
onClick: x
|
|
1601
|
+
}, [O(h(V), {
|
|
1602
|
+
size: 14,
|
|
1603
|
+
"stroke-width": 2
|
|
1604
|
+
}), m(" " + b(h(s).customBlocks.fields.addItem), 1)], 2)) : _("", !0),
|
|
1605
|
+
!d.value && !e.readOnly ? (i(), p("p", pr, b(h(s).customBlocks.fields.maxItemsReached), 1)) : _("", !0),
|
|
1606
|
+
!f.value && !e.readOnly ? (i(), p("p", mr, b(h(l)(h(s).customBlocks.fields.minItemsRequired, { count: e.field.minItems ?? 0 })), 1)) : _("", !0)
|
|
1607
|
+
])]),
|
|
1608
|
+
_: 1
|
|
1609
|
+
}, 8, [
|
|
1610
|
+
"hide-label",
|
|
1611
|
+
"label",
|
|
1612
|
+
"required",
|
|
1613
|
+
"read-only"
|
|
1614
|
+
]));
|
|
1615
|
+
}
|
|
1616
|
+
}), gr = [
|
|
1617
|
+
"value",
|
|
1618
|
+
"disabled",
|
|
1619
|
+
"title"
|
|
1620
|
+
], _r = ["value"], vr = /* @__PURE__ */ r({
|
|
1621
|
+
__name: "SelectField",
|
|
1622
|
+
props: {
|
|
1623
|
+
field: {},
|
|
1624
|
+
modelValue: {},
|
|
1625
|
+
readOnly: { type: Boolean },
|
|
1626
|
+
hideLabel: { type: Boolean }
|
|
1627
|
+
},
|
|
1628
|
+
emits: ["update:modelValue"],
|
|
1629
|
+
setup(e, { emit: t }) {
|
|
1630
|
+
let n = t, { t: r } = H();
|
|
1631
|
+
return (t, o) => (i(), v($, {
|
|
1632
|
+
"hide-label": e.hideLabel,
|
|
1633
|
+
label: e.field.label,
|
|
1634
|
+
required: e.field.required,
|
|
1635
|
+
"read-only": e.readOnly
|
|
1636
|
+
}, {
|
|
1637
|
+
default: a(() => [y("select", {
|
|
1638
|
+
class: g([h(G), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1639
|
+
value: e.modelValue,
|
|
1640
|
+
disabled: e.readOnly,
|
|
1641
|
+
title: e.readOnly ? h(r).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1642
|
+
onChange: o[0] ||= (t) => !e.readOnly && n("update:modelValue", t.target.value)
|
|
1643
|
+
}, [(i(!0), p(E, null, c(e.field.options, (e) => (i(), p("option", {
|
|
1644
|
+
key: e.value,
|
|
1645
|
+
value: e.value
|
|
1646
|
+
}, b(e.label), 9, _r))), 128))], 42, gr)]),
|
|
1647
|
+
_: 1
|
|
1648
|
+
}, 8, [
|
|
1649
|
+
"hide-label",
|
|
1650
|
+
"label",
|
|
1651
|
+
"required",
|
|
1652
|
+
"read-only"
|
|
1653
|
+
]));
|
|
1654
|
+
}
|
|
1655
|
+
}), yr = [
|
|
1656
|
+
"value",
|
|
1657
|
+
"placeholder",
|
|
1658
|
+
"title"
|
|
1659
|
+
], br = /* @__PURE__ */ r({
|
|
1660
|
+
__name: "TextField",
|
|
1661
|
+
props: {
|
|
1662
|
+
field: {},
|
|
1663
|
+
modelValue: {},
|
|
1664
|
+
readOnly: { type: Boolean },
|
|
1665
|
+
hideLabel: { type: Boolean }
|
|
1666
|
+
},
|
|
1667
|
+
emits: ["update:modelValue"],
|
|
1668
|
+
setup(e, { emit: t }) {
|
|
1669
|
+
let n = t, { t: r } = H();
|
|
1670
|
+
return (t, o) => (i(), v($, {
|
|
1671
|
+
"hide-label": e.hideLabel,
|
|
1672
|
+
label: e.field.label,
|
|
1673
|
+
required: e.field.required,
|
|
1674
|
+
"read-only": e.readOnly
|
|
1675
|
+
}, {
|
|
1676
|
+
default: a(() => [e.readOnly ? (i(), p("input", {
|
|
1677
|
+
key: 0,
|
|
1678
|
+
type: "text",
|
|
1679
|
+
class: g([h(G), "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1680
|
+
value: e.modelValue,
|
|
1681
|
+
placeholder: e.field.placeholder,
|
|
1682
|
+
disabled: "",
|
|
1683
|
+
title: h(r).customBlocks.dataSource.readOnlyTooltip
|
|
1684
|
+
}, null, 10, yr)) : (i(), v(X, {
|
|
1685
|
+
key: 1,
|
|
1686
|
+
"model-value": e.modelValue,
|
|
1687
|
+
placeholder: e.field.placeholder,
|
|
1688
|
+
"onUpdate:modelValue": o[0] ||= (e) => n("update:modelValue", e)
|
|
1689
|
+
}, null, 8, ["model-value", "placeholder"]))]),
|
|
1690
|
+
_: 1
|
|
1691
|
+
}, 8, [
|
|
1692
|
+
"hide-label",
|
|
1693
|
+
"label",
|
|
1694
|
+
"required",
|
|
1695
|
+
"read-only"
|
|
1696
|
+
]));
|
|
1697
|
+
}
|
|
1698
|
+
}), xr = [
|
|
1699
|
+
"value",
|
|
1700
|
+
"placeholder",
|
|
1701
|
+
"title"
|
|
1702
|
+
], Sr = "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:opacity-60 tpl:cursor-not-allowed", Cr = {
|
|
1703
|
+
text: br,
|
|
1704
|
+
textarea: /* @__PURE__ */ r({
|
|
1705
|
+
__name: "TextareaField",
|
|
1706
|
+
props: {
|
|
1707
|
+
field: {},
|
|
1708
|
+
modelValue: {},
|
|
1709
|
+
readOnly: { type: Boolean },
|
|
1710
|
+
hideLabel: { type: Boolean }
|
|
1711
|
+
},
|
|
1712
|
+
emits: ["update:modelValue"],
|
|
1713
|
+
setup(e, { emit: t }) {
|
|
1714
|
+
let n = t, { t: r } = H();
|
|
1715
|
+
return (t, o) => (i(), v($, {
|
|
1716
|
+
"hide-label": e.hideLabel,
|
|
1717
|
+
label: e.field.label,
|
|
1718
|
+
required: e.field.required,
|
|
1719
|
+
"read-only": e.readOnly
|
|
1720
|
+
}, {
|
|
1721
|
+
default: a(() => [e.readOnly ? (i(), p("textarea", {
|
|
1722
|
+
key: 0,
|
|
1723
|
+
value: e.modelValue,
|
|
1724
|
+
placeholder: e.field.placeholder,
|
|
1725
|
+
rows: "3",
|
|
1726
|
+
disabled: "",
|
|
1727
|
+
title: h(r).customBlocks.dataSource.readOnlyTooltip,
|
|
1728
|
+
class: g(Sr)
|
|
1729
|
+
}, null, 8, xr)) : (i(), v(ut, {
|
|
1730
|
+
key: 1,
|
|
1731
|
+
"model-value": e.modelValue,
|
|
1732
|
+
placeholder: e.field.placeholder,
|
|
1733
|
+
"onUpdate:modelValue": o[0] ||= (e) => n("update:modelValue", e)
|
|
1734
|
+
}, null, 8, ["model-value", "placeholder"]))]),
|
|
1735
|
+
_: 1
|
|
1736
|
+
}, 8, [
|
|
1737
|
+
"hide-label",
|
|
1738
|
+
"label",
|
|
1739
|
+
"required",
|
|
1740
|
+
"read-only"
|
|
1741
|
+
]));
|
|
1742
|
+
}
|
|
1743
|
+
}),
|
|
1744
|
+
image: or,
|
|
1745
|
+
color: rr,
|
|
1746
|
+
number: cr,
|
|
1747
|
+
select: vr,
|
|
1748
|
+
boolean: tr,
|
|
1749
|
+
repeatable: hr
|
|
1750
|
+
};
|
|
1751
|
+
function wr(e) {
|
|
1752
|
+
return Cr[e] ?? br;
|
|
1753
|
+
}
|
|
1754
|
+
// src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
1755
|
+
var Tr = {
|
|
1756
|
+
key: 0,
|
|
1757
|
+
class: "tpl:p-4"
|
|
1758
|
+
}, Er = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Dr = { key: 1 }, Or = {
|
|
1759
|
+
key: 0,
|
|
1760
|
+
class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
1761
|
+
}, kr = {
|
|
1762
|
+
key: 1,
|
|
1763
|
+
class: "tpl:mb-4"
|
|
1764
|
+
}, Ar = {
|
|
1765
|
+
key: 1,
|
|
1766
|
+
class: "tpl:flex tpl:h-[32px] tpl:items-center"
|
|
1767
|
+
}, jr = {
|
|
1768
|
+
key: 0,
|
|
1769
|
+
class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
1770
|
+
}, Mr = {
|
|
1771
|
+
key: 2,
|
|
1772
|
+
class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
|
|
1773
|
+
}, Nr = /* @__PURE__ */ r({
|
|
1774
|
+
__name: "CustomBlockToolbar",
|
|
1775
|
+
props: { block: {} },
|
|
1776
|
+
emits: ["updateFieldValues", "updateDataSourceFetched"],
|
|
1777
|
+
setup(e, { emit: t }) {
|
|
1778
|
+
let r = e, o = t, { t: s } = H(), u = l(Je, []), d = S(() => u.find((e) => e.type === r.block.customType)), f = S(() => r.block), { isFetching: g, fetchError: x, fetch: C, hasDataSource: w, needsFetch: T } = oe({
|
|
1779
|
+
definition: d,
|
|
1780
|
+
block: f,
|
|
1781
|
+
onUpdate: (e, t) => {
|
|
1782
|
+
o("updateFieldValues", e), o("updateDataSourceFetched", t);
|
|
1783
|
+
}
|
|
1784
|
+
});
|
|
1785
|
+
function D(e) {
|
|
1786
|
+
return e.readOnly === !0 && w.value && !!r.block.dataSourceFetched;
|
|
1787
|
+
}
|
|
1788
|
+
function k(e, t) {
|
|
1789
|
+
o("updateFieldValues", {
|
|
1790
|
+
...r.block.fieldValues,
|
|
1791
|
+
[e]: t
|
|
1792
|
+
});
|
|
1793
|
+
}
|
|
1794
|
+
return (t, r) => d.value ? (i(), p("div", Dr, [
|
|
1795
|
+
d.value.description ? (i(), p("p", Or, b(d.value.description), 1)) : _("", !0),
|
|
1796
|
+
h(w) ? (i(), p("div", kr, [h(T) && !h(g) ? (i(), p("button", {
|
|
1797
|
+
key: 0,
|
|
1798
|
+
type: "button",
|
|
1799
|
+
class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-md tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-on-primary)] tpl:transition-all tpl:bg-[var(--tpl-primary)]",
|
|
1800
|
+
onClick: r[0] ||= (...e) => h(C) && h(C)(...e)
|
|
1801
|
+
}, b(d.value?.dataSource?.label || h(s).customBlocks.dataSource.fetchButton), 1)) : (i(), p("div", Ar, [h(g) ? (i(), p("div", jr, b(h(s).customBlocks.dataSource.fetching), 1)) : (i(), p("button", {
|
|
1802
|
+
key: 1,
|
|
1803
|
+
type: "button",
|
|
1804
|
+
class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
|
|
1805
|
+
onClick: r[1] ||= (...e) => h(C) && h(C)(...e)
|
|
1806
|
+
}, [O(h(De), { size: 12 }), m(" " + b(h(s).customBlocks.dataSource.changeButton), 1)]))])), h(x) ? (i(), p("p", Mr, [O(h(we), {
|
|
1807
|
+
size: 14,
|
|
1808
|
+
class: "tpl:shrink-0"
|
|
1809
|
+
}), m(" " + b(h(s).customBlocks.dataSource.fetchError), 1)])) : _("", !0)])) : _("", !0),
|
|
1810
|
+
(i(!0), p(E, null, c(d.value.fields, (t) => (i(), v(q, {
|
|
1811
|
+
key: t.key,
|
|
1812
|
+
path: `fieldValues.${t.key}`,
|
|
1813
|
+
label: t.label
|
|
1814
|
+
}, {
|
|
1815
|
+
label: a(() => [O($n, {
|
|
1816
|
+
label: t.label,
|
|
1817
|
+
required: t.required,
|
|
1818
|
+
"read-only": D(t)
|
|
1819
|
+
}, null, 8, [
|
|
1820
|
+
"label",
|
|
1821
|
+
"required",
|
|
1822
|
+
"read-only"
|
|
1823
|
+
])]),
|
|
1824
|
+
default: a(({ controlId: r }) => [(i(), v(n(h(wr)(t.type)), {
|
|
1825
|
+
"control-id": t.type === "boolean" ? r : void 0,
|
|
1826
|
+
field: t,
|
|
1827
|
+
"hide-label": "",
|
|
1828
|
+
"model-value": e.block.fieldValues[t.key],
|
|
1829
|
+
"read-only": D(t),
|
|
1830
|
+
"onUpdate:modelValue": (e) => k(t.key, e)
|
|
1831
|
+
}, null, 8, [
|
|
1832
|
+
"control-id",
|
|
1833
|
+
"field",
|
|
1834
|
+
"model-value",
|
|
1835
|
+
"read-only",
|
|
1836
|
+
"onUpdate:modelValue"
|
|
1837
|
+
]))]),
|
|
1838
|
+
_: 2
|
|
1839
|
+
}, 1032, ["path", "label"]))), 128))
|
|
1840
|
+
])) : (i(), p("div", Tr, [y("p", Er, b(h(s).customBlocks.toolbar.noDefinition), 1)]));
|
|
1841
|
+
}
|
|
1842
|
+
}), Pr = { class: "tpl:flex tpl:items-stretch" }, Fr = ["value"], Ir = /* @__PURE__ */ r({
|
|
1843
|
+
__name: "DividerToolbar",
|
|
1844
|
+
props: { block: {} },
|
|
1845
|
+
emits: ["update"],
|
|
1846
|
+
setup(e, { emit: t }) {
|
|
1847
|
+
let n = t, { t: r } = H();
|
|
1848
|
+
function o(e, t) {
|
|
1849
|
+
n("update", { [e]: t });
|
|
1850
|
+
}
|
|
1851
|
+
return (t, n) => (i(), p(E, null, [
|
|
1852
|
+
O(q, {
|
|
1853
|
+
label: h(r).divider.style,
|
|
1854
|
+
class: "tpl:mb-3.5",
|
|
1855
|
+
path: "lineStyle"
|
|
1856
|
+
}, {
|
|
1857
|
+
default: a(() => [O(Z, {
|
|
1858
|
+
options: [
|
|
1859
|
+
{
|
|
1860
|
+
value: "solid",
|
|
1861
|
+
label: h(r).divider.solid
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
value: "dashed",
|
|
1865
|
+
label: h(r).divider.dashed
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
value: "dotted",
|
|
1869
|
+
label: h(r).divider.dotted
|
|
1870
|
+
}
|
|
1871
|
+
],
|
|
1872
|
+
"model-value": e.block.lineStyle,
|
|
1873
|
+
"onUpdate:modelValue": n[0] ||= (e) => o("lineStyle", e)
|
|
1874
|
+
}, null, 8, ["options", "model-value"])]),
|
|
1875
|
+
_: 1
|
|
1876
|
+
}, 8, ["label"]),
|
|
1877
|
+
O(q, {
|
|
1878
|
+
label: h(r).divider.color,
|
|
1879
|
+
class: "tpl:mb-3.5",
|
|
1880
|
+
path: "color"
|
|
1881
|
+
}, {
|
|
1882
|
+
default: a(() => [O(J, {
|
|
1883
|
+
"model-value": e.block.color,
|
|
1884
|
+
"onUpdate:modelValue": n[1] ||= (e) => o("color", e)
|
|
1885
|
+
}, null, 8, ["model-value"])]),
|
|
1886
|
+
_: 1
|
|
1887
|
+
}, 8, ["label"]),
|
|
1888
|
+
O(q, {
|
|
1889
|
+
label: h(r).divider.thickness,
|
|
1890
|
+
class: "tpl:mb-3.5",
|
|
1891
|
+
path: "thickness"
|
|
1892
|
+
}, {
|
|
1893
|
+
default: a(() => [y("div", Pr, [y("input", {
|
|
1894
|
+
type: "number",
|
|
1895
|
+
class: g(h(W)),
|
|
1896
|
+
value: e.block.thickness,
|
|
1897
|
+
min: "1",
|
|
1898
|
+
max: "10",
|
|
1899
|
+
onInput: n[2] ||= (e) => o("thickness", Number(e.target.value))
|
|
1900
|
+
}, null, 42, Fr), y("span", { class: g(h(U)) }, "px", 2)])]),
|
|
1901
|
+
_: 1
|
|
1902
|
+
}, 8, ["label"])
|
|
1903
|
+
], 64));
|
|
1904
|
+
}
|
|
1905
|
+
}), Lr = ["value"], Rr = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, zr = /* @__PURE__ */ r({
|
|
1906
|
+
__name: "HtmlToolbar",
|
|
1907
|
+
props: { block: {} },
|
|
1908
|
+
emits: ["update"],
|
|
1909
|
+
setup(e, { emit: t }) {
|
|
1910
|
+
let n = t, { t: r } = H();
|
|
1911
|
+
return (t, o) => (i(), v(q, {
|
|
1912
|
+
label: h(r).html.content,
|
|
1913
|
+
class: "tpl:mb-3.5",
|
|
1914
|
+
path: "content"
|
|
1915
|
+
}, {
|
|
1916
|
+
default: a(() => [y("textarea", {
|
|
1917
|
+
value: e.block.content,
|
|
1918
|
+
placeholder: "<div>...</div>",
|
|
1919
|
+
rows: "10",
|
|
1920
|
+
class: g(h(at)),
|
|
1921
|
+
onInput: o[0] ||= (e) => n("update", { content: e.target.value })
|
|
1922
|
+
}, null, 42, Lr), y("p", Rr, [O(h(Ne), {
|
|
1923
|
+
size: 12,
|
|
1924
|
+
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
1925
|
+
}), m(" " + b(h(r).html.sanitizationHint), 1)])]),
|
|
1926
|
+
_: 1
|
|
1927
|
+
}, 8, ["label"]));
|
|
1928
|
+
}
|
|
1929
|
+
});
|
|
1930
|
+
// src/composables/useImageAspectLock.ts
|
|
1931
|
+
function Br(e) {
|
|
1932
|
+
let t = T(!1), n = T(null);
|
|
1933
|
+
o(() => e.block().id, () => {
|
|
1934
|
+
t.value = !1, n.value = null;
|
|
1935
|
+
});
|
|
1936
|
+
let r = S(() => fe(e.block()) ?? e.measured()), i = S(() => {
|
|
1937
|
+
let t = e.block().width;
|
|
1938
|
+
return t === "full" ? e.room() : t;
|
|
1939
|
+
}), a = S(() => {
|
|
1940
|
+
let e = r.value, t = i.value;
|
|
1941
|
+
return !e || t === null ? null : Math.round(t * e.height / e.width);
|
|
1942
|
+
}), s = S(() => r.value !== null), c = S(() => {
|
|
1943
|
+
let t = e.block().height;
|
|
1944
|
+
return t === void 0 || a.value !== null && Math.abs(a.value - t) <= 1;
|
|
1945
|
+
}), l = S(() => s.value && !t.value && c.value);
|
|
1946
|
+
function u() {
|
|
1947
|
+
if (fe(e.block())) return {};
|
|
1948
|
+
let t = e.measured();
|
|
1949
|
+
return t ? pe(t) : {};
|
|
1950
|
+
}
|
|
1951
|
+
function d(r) {
|
|
1952
|
+
if (n.value = null, !r) return t.value = !0, null;
|
|
1953
|
+
if (t.value = !1, !s.value) return null;
|
|
1954
|
+
let i = { ...u() };
|
|
1955
|
+
return e.block().height !== void 0 && (i.height = void 0), Object.keys(i).length > 0 ? i : null;
|
|
1956
|
+
}
|
|
1957
|
+
function f(e) {
|
|
1958
|
+
return n.value = null, l.value ? {
|
|
1959
|
+
width: e,
|
|
1960
|
+
height: void 0,
|
|
1961
|
+
...u()
|
|
1962
|
+
} : { width: e };
|
|
1963
|
+
}
|
|
1964
|
+
function p(t) {
|
|
1965
|
+
let i = r.value;
|
|
1966
|
+
if (!l.value || !i || !Number.isFinite(t) || t <= 0) return null;
|
|
1967
|
+
let a = Math.round(t * i.width / i.height);
|
|
1968
|
+
if (a < 1) return null;
|
|
1969
|
+
let o = e.room();
|
|
1970
|
+
return o !== null && a >= o ? (n.value = Math.round(o * i.height / i.width), {
|
|
1971
|
+
width: "full",
|
|
1972
|
+
height: void 0,
|
|
1973
|
+
...u()
|
|
1974
|
+
}) : (n.value = null, {
|
|
1975
|
+
width: a,
|
|
1976
|
+
height: void 0,
|
|
1977
|
+
...u()
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
return {
|
|
1981
|
+
available: s,
|
|
1982
|
+
locked: l,
|
|
1983
|
+
derivedHeight: a,
|
|
1984
|
+
cappedHeight: n,
|
|
1985
|
+
setLocked: d,
|
|
1986
|
+
widthUpdates: f,
|
|
1987
|
+
heightUpdates: p
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
// src/components/toolbar/ImageToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
1991
|
+
var Vr = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Hr = [
|
|
1992
|
+
"value",
|
|
1993
|
+
"placeholder",
|
|
1994
|
+
"title"
|
|
1995
|
+
], Ur = { class: "tpl:block tpl:text-[var(--tpl-text-dim)]" }, Wr = ["value"], Gr = { value: "full" }, Kr = { value: "custom" }, qr = {
|
|
1996
|
+
key: 0,
|
|
1997
|
+
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
1998
|
+
}, Jr = ["value"], Yr = { class: "tpl:flex tpl:items-stretch" }, Xr = ["value"], Zr = {
|
|
1999
|
+
key: 0,
|
|
2000
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
2001
|
+
role: "status",
|
|
2002
|
+
"data-testid": "image-height-capped"
|
|
2003
|
+
}, Qr = ["value"], $r = { value: "auto" }, ei = { value: "custom" }, ti = {
|
|
2004
|
+
key: 2,
|
|
2005
|
+
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
2006
|
+
}, ni = ["value"], ri = 350, ii = 200, ai = /* @__PURE__ */ r({
|
|
2007
|
+
__name: "ImageToolbar",
|
|
2008
|
+
props: { block: {} },
|
|
2009
|
+
emits: ["update"],
|
|
2010
|
+
setup(e, { emit: t }) {
|
|
2011
|
+
let n = e, r = t, { t: o, format: s } = H(), c = l(Be, te.liquid), u = l(Qe, null), d = u ? $e(u) : null, f = l(Ue, void 0), x = T(!1), C = T(!1), { start: w } = ot(() => {
|
|
2012
|
+
x.value = !1, C.value = !1;
|
|
2013
|
+
}, 1e3, { immediate: !1 }), k = [
|
|
2014
|
+
300,
|
|
2015
|
+
400,
|
|
2016
|
+
500
|
|
2017
|
+
], A = S(() => {
|
|
2018
|
+
let e = n.block.width;
|
|
2019
|
+
return e === "full" ? "full" : k.includes(e) ? String(e) : "custom";
|
|
2020
|
+
}), j = S(() => typeof n.block.height == "number" ? "custom" : "auto");
|
|
2021
|
+
function M(e, t) {
|
|
2022
|
+
r("update", { [e]: t });
|
|
2023
|
+
}
|
|
2024
|
+
function N(e) {
|
|
2025
|
+
if (e === "custom") {
|
|
2026
|
+
let e = n.block.width;
|
|
2027
|
+
(typeof e != "number" || k.includes(e)) && r("update", z.widthUpdates(ri));
|
|
2028
|
+
} else r("update", z.widthUpdates(e === "full" ? "full" : Number(e)));
|
|
2029
|
+
}
|
|
2030
|
+
function P(e) {
|
|
2031
|
+
M("height", e === "custom" ? ii : void 0);
|
|
2032
|
+
}
|
|
2033
|
+
function F(e) {
|
|
2034
|
+
let t = Number(e);
|
|
2035
|
+
!Number.isFinite(t) || t <= 0 || M("height", t);
|
|
2036
|
+
}
|
|
2037
|
+
function I(e) {
|
|
2038
|
+
M("borderRadius", ae(e) === null ? void 0 : e);
|
|
2039
|
+
}
|
|
2040
|
+
function ee(e) {
|
|
2041
|
+
let t = Number(e);
|
|
2042
|
+
!Number.isFinite(t) || t <= 0 || r("update", z.widthUpdates(t));
|
|
2043
|
+
}
|
|
2044
|
+
function L(e) {
|
|
2045
|
+
e !== n.block.src && r("update", {
|
|
2046
|
+
src: e,
|
|
2047
|
+
...pe(null)
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
function ne(e) {
|
|
2051
|
+
r("update", {
|
|
2052
|
+
src: e.url,
|
|
2053
|
+
...pe(ce(e.width, e.height))
|
|
2054
|
+
}), e.alt && (M("alt", e.alt), C.value = !0), x.value = !0, w();
|
|
2055
|
+
}
|
|
2056
|
+
let R = T(), ie = S(() => re(n.block.src, c)), { canBrowse: oe, isUploading: le, showOverlay: ue, openMediaBrowser: he } = ye({
|
|
2057
|
+
target: R,
|
|
2058
|
+
blocked: ie,
|
|
2059
|
+
apply: ne
|
|
2060
|
+
}), ge = se(() => ie.value || !n.block.src || fe(n.block) ? void 0 : n.block.src), _e = cn(() => ge.value), ve = S(() => d ? me(d.content.value, n.block.id, f) : null), z = Br({
|
|
2061
|
+
block: () => n.block,
|
|
2062
|
+
room: () => ve.value,
|
|
2063
|
+
measured: () => _e.value
|
|
2064
|
+
}), { available: be, locked: B, derivedHeight: xe, cappedHeight: Se } = z;
|
|
2065
|
+
function Ce() {
|
|
2066
|
+
let e = z.setLocked(!B.value);
|
|
2067
|
+
e && r("update", e);
|
|
2068
|
+
}
|
|
2069
|
+
let V = T(null);
|
|
2070
|
+
function we(e) {
|
|
2071
|
+
V.value = e;
|
|
2072
|
+
let t = z.heightUpdates(Number(e));
|
|
2073
|
+
t && r("update", t);
|
|
2074
|
+
}
|
|
2075
|
+
return (t, n) => (i(), p(E, null, [
|
|
2076
|
+
O(q, {
|
|
2077
|
+
label: h(o).image.imageUrl,
|
|
2078
|
+
class: "tpl:mb-3.5",
|
|
2079
|
+
path: "src"
|
|
2080
|
+
}, {
|
|
2081
|
+
default: a(() => [y("div", {
|
|
2082
|
+
ref_key: "dropZoneRef",
|
|
2083
|
+
ref: R,
|
|
2084
|
+
class: "tpl:relative"
|
|
2085
|
+
}, [
|
|
2086
|
+
h(ue) ? (i(), v(de, {
|
|
2087
|
+
key: 0,
|
|
2088
|
+
uploading: h(le)
|
|
2089
|
+
}, null, 8, ["uploading"])) : _("", !0),
|
|
2090
|
+
O(X, {
|
|
2091
|
+
"model-value": e.block.src,
|
|
2092
|
+
type: "url",
|
|
2093
|
+
placeholder: h(o).image.imageUrlPlaceholder,
|
|
2094
|
+
pulse: x.value,
|
|
2095
|
+
"onUpdate:modelValue": n[0] ||= (e) => L(e)
|
|
2096
|
+
}, null, 8, [
|
|
2097
|
+
"model-value",
|
|
2098
|
+
"placeholder",
|
|
2099
|
+
"pulse"
|
|
2100
|
+
]),
|
|
2101
|
+
h(oe) ? (i(), p("button", {
|
|
2102
|
+
key: 1,
|
|
2103
|
+
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all",
|
|
2104
|
+
style: {
|
|
2105
|
+
"border-color": "var(--tpl-border)",
|
|
2106
|
+
color: "var(--tpl-primary)",
|
|
2107
|
+
"background-color": "var(--tpl-bg)"
|
|
2108
|
+
},
|
|
2109
|
+
onClick: n[1] ||= (...e) => h(he) && h(he)(...e)
|
|
2110
|
+
}, [O(h(ke), {
|
|
2111
|
+
size: 14,
|
|
2112
|
+
"stroke-width": 1.5
|
|
2113
|
+
}), m(" " + b(h(o).image.browseMedia), 1)])) : _("", !0)
|
|
2114
|
+
], 512)]),
|
|
2115
|
+
_: 1
|
|
2116
|
+
}, 8, ["label"]),
|
|
2117
|
+
h(re)(e.block.src, h(c)) ? (i(), v(q, {
|
|
2118
|
+
key: 0,
|
|
2119
|
+
class: "tpl:mb-3.5",
|
|
2120
|
+
path: "placeholderUrl"
|
|
2121
|
+
}, {
|
|
2122
|
+
label: a(() => [m(b(h(o).image.placeholderUrl) + " ", 1), y("span", Vr, b(h(o).image.optional), 1)]),
|
|
2123
|
+
default: a(() => [y("input", {
|
|
2124
|
+
type: "url",
|
|
2125
|
+
class: g(h(G)),
|
|
2126
|
+
value: e.block.placeholderUrl || "",
|
|
2127
|
+
placeholder: h(o).image.placeholderUrlPlaceholder,
|
|
2128
|
+
title: h(o).image.placeholderUrlTooltip,
|
|
2129
|
+
onInput: n[2] ||= (e) => M("placeholderUrl", e.target.value)
|
|
2130
|
+
}, null, 42, Hr)]),
|
|
2131
|
+
_: 1
|
|
2132
|
+
})) : _("", !0),
|
|
2133
|
+
O(q, {
|
|
2134
|
+
label: h(o).image.altText,
|
|
2135
|
+
class: "tpl:mb-3.5",
|
|
2136
|
+
path: "alt"
|
|
2137
|
+
}, {
|
|
2138
|
+
default: a(() => [O(X, {
|
|
2139
|
+
"model-value": e.block.alt,
|
|
2140
|
+
type: "text",
|
|
2141
|
+
placeholder: h(o).image.altTextPlaceholder,
|
|
2142
|
+
pulse: C.value,
|
|
2143
|
+
disabled: e.block.decorative === !0,
|
|
2144
|
+
"onUpdate:modelValue": n[3] ||= (e) => M("alt", e)
|
|
2145
|
+
}, null, 8, [
|
|
2146
|
+
"model-value",
|
|
2147
|
+
"placeholder",
|
|
2148
|
+
"pulse",
|
|
2149
|
+
"disabled"
|
|
2150
|
+
]), O(q, {
|
|
2151
|
+
path: "decorative",
|
|
2152
|
+
label: h(o).image.decorative
|
|
2153
|
+
}, {
|
|
2154
|
+
label: a(() => [y("span", null, [m(b(h(o).image.decorative) + " ", 1), y("span", Ur, b(h(o).image.decorativeHint), 1)])]),
|
|
2155
|
+
"label-actions": a(({ controlId: t }) => [O(Y, {
|
|
2156
|
+
"control-id": t,
|
|
2157
|
+
"hide-label": "",
|
|
2158
|
+
class: "tpl:mt-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]",
|
|
2159
|
+
"model-value": e.block.decorative === !0,
|
|
2160
|
+
label: h(o).image.decorative,
|
|
2161
|
+
"onUpdate:modelValue": n[4] ||= (e) => M("decorative", e)
|
|
2162
|
+
}, null, 8, [
|
|
2163
|
+
"control-id",
|
|
2164
|
+
"model-value",
|
|
2165
|
+
"label"
|
|
2166
|
+
])]),
|
|
2167
|
+
_: 1
|
|
2168
|
+
}, 8, ["label"])]),
|
|
2169
|
+
_: 1
|
|
2170
|
+
}, 8, ["label"]),
|
|
2171
|
+
O(q, {
|
|
2172
|
+
label: h(o).image.width,
|
|
2173
|
+
class: "tpl:mb-3.5",
|
|
2174
|
+
path: "width"
|
|
2175
|
+
}, {
|
|
2176
|
+
default: a(() => [y("select", {
|
|
2177
|
+
class: g(h(G)),
|
|
2178
|
+
"data-testid": "image-width-mode",
|
|
2179
|
+
value: A.value,
|
|
2180
|
+
onChange: n[5] ||= (e) => N(e.target.value)
|
|
2181
|
+
}, [
|
|
2182
|
+
y("option", Gr, b(h(o).image.fullWidth), 1),
|
|
2183
|
+
n[15] ||= y("option", { value: "300" }, "300px", -1),
|
|
2184
|
+
n[16] ||= y("option", { value: "400" }, "400px", -1),
|
|
2185
|
+
n[17] ||= y("option", { value: "500" }, "500px", -1),
|
|
2186
|
+
y("option", Kr, b(h(o).image.widthCustom), 1)
|
|
2187
|
+
], 42, Wr), A.value === "custom" ? (i(), p("div", qr, [y("input", {
|
|
2188
|
+
type: "number",
|
|
2189
|
+
"data-testid": "image-width-input",
|
|
2190
|
+
class: g(h(W)),
|
|
2191
|
+
value: typeof e.block.width == "number" ? e.block.width : ri,
|
|
2192
|
+
min: "20",
|
|
2193
|
+
onInput: n[6] ||= (e) => ee(e.target.value)
|
|
2194
|
+
}, null, 42, Jr), y("span", { class: g(h(U)) }, "px", 2)])) : _("", !0)]),
|
|
2195
|
+
_: 1
|
|
2196
|
+
}, 8, ["label"]),
|
|
2197
|
+
O(q, {
|
|
2198
|
+
class: "tpl:mb-3.5",
|
|
2199
|
+
path: "height",
|
|
2200
|
+
label: h(o).image.height
|
|
2201
|
+
}, D({
|
|
2202
|
+
default: a(() => [
|
|
2203
|
+
h(B) ? (i(), p(E, { key: 0 }, [y("div", Yr, [y("input", {
|
|
2204
|
+
type: "number",
|
|
2205
|
+
"data-testid": "image-locked-height-input",
|
|
2206
|
+
class: g(h(W)),
|
|
2207
|
+
value: V.value ?? h(xe) ?? "",
|
|
2208
|
+
min: "1",
|
|
2209
|
+
onInput: n[7] ||= (e) => we(e.target.value),
|
|
2210
|
+
onBlur: n[8] ||= (e) => V.value = null
|
|
2211
|
+
}, null, 42, Xr), y("span", { class: g(h(U)) }, "px", 2)]), h(Se) === null ? _("", !0) : (i(), p("p", Zr, b(h(s)(h(o).image.heightCapped, { height: h(Se) })), 1))], 64)) : _("", !0),
|
|
2212
|
+
h(B) ? _("", !0) : (i(), p("select", {
|
|
2213
|
+
key: 1,
|
|
2214
|
+
class: g(h(G)),
|
|
2215
|
+
"data-testid": "image-height-mode",
|
|
2216
|
+
value: j.value,
|
|
2217
|
+
onChange: n[9] ||= (e) => P(e.target.value)
|
|
2218
|
+
}, [y("option", $r, b(h(o).image.heightAuto), 1), y("option", ei, b(h(o).image.heightCustom), 1)], 42, Qr)),
|
|
2219
|
+
!h(B) && j.value === "custom" ? (i(), p("div", ti, [y("input", {
|
|
2220
|
+
type: "number",
|
|
2221
|
+
"data-testid": "image-height-input",
|
|
2222
|
+
class: g(h(W)),
|
|
2223
|
+
value: e.block.height,
|
|
2224
|
+
min: "20",
|
|
2225
|
+
onInput: n[10] ||= (e) => F(e.target.value)
|
|
2226
|
+
}, null, 42, ni), y("span", { class: g(h(U)) }, "px", 2)])) : _("", !0)
|
|
2227
|
+
]),
|
|
2228
|
+
_: 2
|
|
2229
|
+
}, [h(be) ? {
|
|
2230
|
+
name: "label-actions",
|
|
2231
|
+
fn: a(() => [O(yt, {
|
|
2232
|
+
linked: h(B),
|
|
2233
|
+
"link-label": h(o).image.lockAspectRatio,
|
|
2234
|
+
"unlink-label": h(o).image.unlockAspectRatio,
|
|
2235
|
+
testid: "image-aspect-lock",
|
|
2236
|
+
onToggle: Ce
|
|
2237
|
+
}, null, 8, [
|
|
2238
|
+
"linked",
|
|
2239
|
+
"link-label",
|
|
2240
|
+
"unlink-label"
|
|
2241
|
+
])]),
|
|
2242
|
+
key: "0"
|
|
2243
|
+
} : void 0]), 1032, ["label"]),
|
|
2244
|
+
O(Et, {
|
|
2245
|
+
path: "borderRadius",
|
|
2246
|
+
"model-value": e.block.borderRadius,
|
|
2247
|
+
label: h(o).image.borderRadius,
|
|
2248
|
+
"testid-prefix": "image",
|
|
2249
|
+
"onUpdate:modelValue": I
|
|
2250
|
+
}, null, 8, ["model-value", "label"]),
|
|
2251
|
+
O(Ct, {
|
|
2252
|
+
path: "border",
|
|
2253
|
+
"model-value": e.block.border,
|
|
2254
|
+
"testid-prefix": "image",
|
|
2255
|
+
"onUpdate:modelValue": n[11] ||= (e) => M("border", e)
|
|
2256
|
+
}, null, 8, ["model-value"]),
|
|
2257
|
+
O(q, {
|
|
2258
|
+
label: h(o).title.align,
|
|
2259
|
+
class: "tpl:mb-3.5",
|
|
2260
|
+
path: "align"
|
|
2261
|
+
}, {
|
|
2262
|
+
default: a(() => [O(Z, {
|
|
2263
|
+
options: [
|
|
2264
|
+
{
|
|
2265
|
+
value: "left",
|
|
2266
|
+
label: h(o).title.alignLeft
|
|
2267
|
+
},
|
|
2268
|
+
{
|
|
2269
|
+
value: "center",
|
|
2270
|
+
label: h(o).title.alignCenter
|
|
2271
|
+
},
|
|
2272
|
+
{
|
|
2273
|
+
value: "right",
|
|
2274
|
+
label: h(o).title.alignRight
|
|
2275
|
+
}
|
|
2276
|
+
],
|
|
2277
|
+
"model-value": e.block.align,
|
|
2278
|
+
"onUpdate:modelValue": n[12] ||= (e) => M("align", e)
|
|
2279
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2280
|
+
_: 1
|
|
2281
|
+
}, 8, ["label"]),
|
|
2282
|
+
O(q, {
|
|
2283
|
+
label: h(o).image.linkUrl,
|
|
2284
|
+
class: "tpl:mb-3.5",
|
|
2285
|
+
path: "linkUrl"
|
|
2286
|
+
}, {
|
|
2287
|
+
default: a(() => [O(X, {
|
|
2288
|
+
"model-value": e.block.linkUrl || "",
|
|
2289
|
+
type: "url",
|
|
2290
|
+
placeholder: h(o).image.imageUrlPlaceholder,
|
|
2291
|
+
"onUpdate:modelValue": n[13] ||= (e) => M("linkUrl", e)
|
|
2292
|
+
}, null, 8, ["model-value", "placeholder"]), e.block.linkUrl ? (i(), v(q, {
|
|
2293
|
+
key: 0,
|
|
2294
|
+
path: "linkOpenInNewTab",
|
|
2295
|
+
label: h(o).image.openInNewTab
|
|
2296
|
+
}, {
|
|
2297
|
+
"label-actions": a(({ controlId: t }) => [O(Y, {
|
|
2298
|
+
"control-id": t,
|
|
2299
|
+
"hide-label": "",
|
|
2300
|
+
class: "tpl:mt-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]",
|
|
2301
|
+
"model-value": e.block.linkOpenInNewTab ?? !1,
|
|
2302
|
+
label: h(o).image.openInNewTab,
|
|
2303
|
+
"onUpdate:modelValue": n[14] ||= (e) => M("linkOpenInNewTab", e)
|
|
2304
|
+
}, null, 8, [
|
|
2305
|
+
"control-id",
|
|
2306
|
+
"model-value",
|
|
2307
|
+
"label"
|
|
2308
|
+
])]),
|
|
2309
|
+
_: 1
|
|
2310
|
+
}, 8, ["label"])) : _("", !0)]),
|
|
2311
|
+
_: 1
|
|
2312
|
+
}, 8, ["label"])
|
|
2313
|
+
], 64));
|
|
2314
|
+
}
|
|
2315
|
+
}), oi = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, si = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ci = [
|
|
2316
|
+
"value",
|
|
2317
|
+
"placeholder",
|
|
2318
|
+
"onInput"
|
|
2319
|
+
], li = ["title", "onClick"], ui = { class: "tpl:flex tpl:flex-wrap tpl:items-center tpl:gap-x-3 tpl:gap-y-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, di = { class: "tpl:flex tpl:items-center tpl:gap-2" }, fi = ["value"], pi = { value: "" }, mi = ["value"], hi = ["value"], gi = /* @__PURE__ */ r({
|
|
2320
|
+
__name: "MenuToolbar",
|
|
2321
|
+
props: {
|
|
2322
|
+
block: {},
|
|
2323
|
+
fontFamilies: {}
|
|
2324
|
+
},
|
|
2325
|
+
emits: ["update"],
|
|
2326
|
+
setup(e, { emit: t }) {
|
|
2327
|
+
let n = e, r = t, { t: o } = H(), s = S(() => [
|
|
2328
|
+
{
|
|
2329
|
+
key: "openInNewTab",
|
|
2330
|
+
label: o.menu.openInNewTab
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
key: "bold",
|
|
2334
|
+
label: o.menu.bold
|
|
2335
|
+
},
|
|
2336
|
+
{
|
|
2337
|
+
key: "underline",
|
|
2338
|
+
label: o.menu.underline
|
|
2339
|
+
}
|
|
2340
|
+
]), l = S(() => [
|
|
2341
|
+
{
|
|
2342
|
+
value: "left",
|
|
2343
|
+
label: o.title.alignLeft,
|
|
2344
|
+
icon: Ie
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
value: "center",
|
|
2348
|
+
label: o.title.alignCenter,
|
|
2349
|
+
icon: ze
|
|
2350
|
+
},
|
|
2351
|
+
{
|
|
2352
|
+
value: "right",
|
|
2353
|
+
label: o.title.alignRight,
|
|
2354
|
+
icon: Oe
|
|
2355
|
+
}
|
|
2356
|
+
]);
|
|
2357
|
+
function u(e, t) {
|
|
2358
|
+
r("update", { [e]: t });
|
|
2359
|
+
}
|
|
2360
|
+
function d() {
|
|
2361
|
+
let e = {
|
|
2362
|
+
id: A(),
|
|
2363
|
+
text: "",
|
|
2364
|
+
url: "",
|
|
2365
|
+
openInNewTab: !1,
|
|
2366
|
+
bold: !1,
|
|
2367
|
+
underline: !1
|
|
2368
|
+
};
|
|
2369
|
+
r("update", { items: [...n.block.items, e] });
|
|
2370
|
+
}
|
|
2371
|
+
function f(e, t, i) {
|
|
2372
|
+
let a = n.block.items.map((n) => n.id === e ? {
|
|
2373
|
+
...n,
|
|
2374
|
+
[t]: i
|
|
2375
|
+
} : n);
|
|
2376
|
+
r("update", { items: a });
|
|
2377
|
+
}
|
|
2378
|
+
function _(e) {
|
|
2379
|
+
r("update", { items: n.block.items.filter((t) => t.id !== e) });
|
|
2380
|
+
}
|
|
2381
|
+
return (t, n) => (i(), p(E, null, [
|
|
2382
|
+
O(q, { label: h(o).menu.items }, {
|
|
2383
|
+
default: a(() => [y("div", oi, [(i(!0), p(E, null, c(e.block.items, (t) => (i(), p("div", {
|
|
2384
|
+
key: t.id,
|
|
2385
|
+
class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
|
|
2386
|
+
}, [
|
|
2387
|
+
y("div", si, [O(q, {
|
|
2388
|
+
path: t.id.includes(".") ? void 0 : `items.${t.id}.text`,
|
|
2389
|
+
label: h(o).menu.text
|
|
2390
|
+
}, {
|
|
2391
|
+
default: a(() => [y("input", {
|
|
2392
|
+
type: "text",
|
|
2393
|
+
class: g([h(G), "tpl:flex-1"]),
|
|
2394
|
+
value: t.text,
|
|
2395
|
+
placeholder: h(o).menu.text,
|
|
2396
|
+
onInput: (e) => f(t.id, "text", e.target.value)
|
|
2397
|
+
}, null, 42, ci)]),
|
|
2398
|
+
_: 2
|
|
2399
|
+
}, 1032, ["path", "label"]), y("button", {
|
|
2400
|
+
class: g(h(tt)),
|
|
2401
|
+
title: h(o).menu.removeItem,
|
|
2402
|
+
onClick: (e) => _(t.id)
|
|
2403
|
+
}, [O(h(Re), {
|
|
2404
|
+
size: 14,
|
|
2405
|
+
"stroke-width": 2
|
|
2406
|
+
})], 10, li)]),
|
|
2407
|
+
O(q, {
|
|
2408
|
+
path: t.id.includes(".") ? void 0 : `items.${t.id}.url`,
|
|
2409
|
+
label: h(o).button.url
|
|
2410
|
+
}, {
|
|
2411
|
+
default: a(() => [O(X, {
|
|
2412
|
+
"model-value": t.url,
|
|
2413
|
+
type: "url",
|
|
2414
|
+
placeholder: h(o).menu.urlPlaceholder,
|
|
2415
|
+
"onUpdate:modelValue": (e) => f(t.id, "url", e)
|
|
2416
|
+
}, null, 8, [
|
|
2417
|
+
"model-value",
|
|
2418
|
+
"placeholder",
|
|
2419
|
+
"onUpdate:modelValue"
|
|
2420
|
+
])]),
|
|
2421
|
+
_: 2
|
|
2422
|
+
}, 1032, ["path", "label"]),
|
|
2423
|
+
y("div", ui, [(i(!0), p(E, null, c(s.value, (e) => (i(), v(q, {
|
|
2424
|
+
key: e.key,
|
|
2425
|
+
path: t.id.includes(".") ? void 0 : `items.${t.id}.${e.key}`,
|
|
2426
|
+
label: e.label
|
|
2427
|
+
}, {
|
|
2428
|
+
"label-actions": a(({ controlId: n }) => [O(Y, {
|
|
2429
|
+
"control-id": n,
|
|
2430
|
+
"hide-label": "",
|
|
2431
|
+
"model-value": t[e.key],
|
|
2432
|
+
label: e.label,
|
|
2433
|
+
"onUpdate:modelValue": (n) => f(t.id, e.key, n)
|
|
2434
|
+
}, null, 8, [
|
|
2435
|
+
"control-id",
|
|
2436
|
+
"model-value",
|
|
2437
|
+
"label",
|
|
2438
|
+
"onUpdate:modelValue"
|
|
2439
|
+
])]),
|
|
2440
|
+
_: 2
|
|
2441
|
+
}, 1032, ["path", "label"]))), 128))]),
|
|
2442
|
+
y("div", di, [O(q, {
|
|
2443
|
+
path: t.id.includes(".") ? void 0 : `items.${t.id}.color`,
|
|
2444
|
+
label: h(o).menu.color
|
|
2445
|
+
}, {
|
|
2446
|
+
default: a(() => [O(J, {
|
|
2447
|
+
"swatch-only": "",
|
|
2448
|
+
"model-value": t.color || e.block.linkColor || e.block.color || "",
|
|
2449
|
+
"onUpdate:modelValue": (e) => f(t.id, "color", e)
|
|
2450
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])]),
|
|
2451
|
+
_: 2
|
|
2452
|
+
}, 1032, ["path", "label"])])
|
|
2453
|
+
]))), 128)), y("button", {
|
|
2454
|
+
class: g(h(rt)),
|
|
2455
|
+
onClick: d
|
|
2456
|
+
}, [O(h(V), {
|
|
2457
|
+
size: 14,
|
|
2458
|
+
"stroke-width": 2
|
|
2459
|
+
}), m(" " + b(h(o).menu.addItem), 1)], 2)])]),
|
|
2460
|
+
_: 1
|
|
2461
|
+
}, 8, ["label"]),
|
|
2462
|
+
O(q, {
|
|
2463
|
+
path: "fontFamily",
|
|
2464
|
+
label: h(o).menu.fontFamily
|
|
2465
|
+
}, {
|
|
2466
|
+
default: a(() => [y("select", {
|
|
2467
|
+
class: g(h(G)),
|
|
2468
|
+
value: h(ft)(e.block.fontFamily),
|
|
2469
|
+
onChange: n[0] ||= (e) => u("fontFamily", e.target.value || void 0)
|
|
2470
|
+
}, [y("option", pi, b(h(o).title.inheritFont), 1), (i(!0), p(E, null, c(e.fontFamilies, (e) => (i(), p("option", {
|
|
2471
|
+
key: e.value,
|
|
2472
|
+
value: e.value
|
|
2473
|
+
}, b(e.label), 9, mi))), 128))], 42, fi)]),
|
|
2474
|
+
_: 1
|
|
2475
|
+
}, 8, ["label"]),
|
|
2476
|
+
O(q, {
|
|
2477
|
+
path: "fontSize",
|
|
2478
|
+
label: h(o).menu.fontSize
|
|
2479
|
+
}, {
|
|
2480
|
+
default: a(() => [O(_t, {
|
|
2481
|
+
"model-value": e.block.fontSize,
|
|
2482
|
+
min: 8,
|
|
2483
|
+
max: 48,
|
|
2484
|
+
suffix: "px",
|
|
2485
|
+
"onUpdate:modelValue": n[1] ||= (e) => u("fontSize", e)
|
|
2486
|
+
}, null, 8, ["model-value"])]),
|
|
2487
|
+
_: 1
|
|
2488
|
+
}, 8, ["label"]),
|
|
2489
|
+
O(q, {
|
|
2490
|
+
path: "color",
|
|
2491
|
+
label: h(o).menu.color
|
|
2492
|
+
}, {
|
|
2493
|
+
default: a(() => [O(J, {
|
|
2494
|
+
"model-value": e.block.color ?? "",
|
|
2495
|
+
"onUpdate:modelValue": n[2] ||= (e) => u("color", e || void 0)
|
|
2496
|
+
}, null, 8, ["model-value"])]),
|
|
2497
|
+
_: 1
|
|
2498
|
+
}, 8, ["label"]),
|
|
2499
|
+
O(q, {
|
|
2500
|
+
path: "linkColor",
|
|
2501
|
+
label: h(o).menu.linkColor
|
|
2502
|
+
}, {
|
|
2503
|
+
default: a(() => [O(J, {
|
|
2504
|
+
"model-value": e.block.linkColor || e.block.color || "",
|
|
2505
|
+
"onUpdate:modelValue": n[3] ||= (e) => u("linkColor", e || void 0)
|
|
2506
|
+
}, null, 8, ["model-value"])]),
|
|
2507
|
+
_: 1
|
|
2508
|
+
}, 8, ["label"]),
|
|
2509
|
+
O(q, {
|
|
2510
|
+
path: "textAlign",
|
|
2511
|
+
label: h(o).menu.textAlign
|
|
2512
|
+
}, {
|
|
2513
|
+
default: a(() => [O(Z, {
|
|
2514
|
+
options: l.value,
|
|
2515
|
+
"model-value": e.block.textAlign,
|
|
2516
|
+
"onUpdate:modelValue": n[4] ||= (e) => u("textAlign", e)
|
|
2517
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2518
|
+
_: 1
|
|
2519
|
+
}, 8, ["label"]),
|
|
2520
|
+
O(q, {
|
|
2521
|
+
path: "separator",
|
|
2522
|
+
label: h(o).menu.separator
|
|
2523
|
+
}, {
|
|
2524
|
+
default: a(() => [y("input", {
|
|
2525
|
+
type: "text",
|
|
2526
|
+
class: g(h(G)),
|
|
2527
|
+
value: e.block.separator,
|
|
2528
|
+
onInput: n[5] ||= (e) => u("separator", e.target.value)
|
|
2529
|
+
}, null, 42, hi)]),
|
|
2530
|
+
_: 1
|
|
2531
|
+
}, 8, ["label"]),
|
|
2532
|
+
O(q, {
|
|
2533
|
+
path: "separatorColor",
|
|
2534
|
+
label: h(o).menu.separatorColor
|
|
2535
|
+
}, {
|
|
2536
|
+
default: a(() => [O(J, {
|
|
2537
|
+
"model-value": e.block.separatorColor,
|
|
2538
|
+
"onUpdate:modelValue": n[6] ||= (e) => u("separatorColor", e)
|
|
2539
|
+
}, null, 8, ["model-value"])]),
|
|
2540
|
+
_: 1
|
|
2541
|
+
}, 8, ["label"]),
|
|
2542
|
+
O(q, {
|
|
2543
|
+
path: "spacing",
|
|
2544
|
+
label: h(o).menu.spacing
|
|
2545
|
+
}, {
|
|
2546
|
+
default: a(() => [O(_t, {
|
|
2547
|
+
"model-value": e.block.spacing,
|
|
2548
|
+
min: 0,
|
|
2549
|
+
max: 50,
|
|
2550
|
+
suffix: "px",
|
|
2551
|
+
"onUpdate:modelValue": n[7] ||= (e) => u("spacing", e)
|
|
2552
|
+
}, null, 8, ["model-value"])]),
|
|
2553
|
+
_: 1
|
|
2554
|
+
}, 8, ["label"])
|
|
2555
|
+
], 64));
|
|
2556
|
+
}
|
|
2557
|
+
}), _i = { class: "tpl:flex tpl:items-stretch" }, vi = ["value"], yi = /* @__PURE__ */ r({
|
|
2558
|
+
__name: "ParagraphToolbar",
|
|
2559
|
+
props: { block: {} },
|
|
2560
|
+
emits: ["update"],
|
|
2561
|
+
setup(e, { emit: t }) {
|
|
2562
|
+
let n = t, { t: r } = H();
|
|
2563
|
+
return (t, o) => (i(), v(q, {
|
|
2564
|
+
label: h(r).paragraph.paragraphSpacing,
|
|
2565
|
+
class: "tpl:mb-3.5",
|
|
2566
|
+
"data-testid": "paragraph-spacing",
|
|
2567
|
+
path: "paragraphSpacing"
|
|
2568
|
+
}, {
|
|
2569
|
+
default: a(() => [y("div", _i, [y("input", {
|
|
2570
|
+
type: "number",
|
|
2571
|
+
class: g(h(W)),
|
|
2572
|
+
value: e.block.paragraphSpacing ?? h(F).paragraphGap,
|
|
2573
|
+
min: "0",
|
|
2574
|
+
max: "64",
|
|
2575
|
+
onInput: o[0] ||= (e) => n("update", { paragraphSpacing: Number(e.target.value) })
|
|
2576
|
+
}, null, 42, vi), y("span", { class: g(h(U)) }, "px", 2)])]),
|
|
2577
|
+
_: 1
|
|
2578
|
+
}, 8, ["label"]));
|
|
2579
|
+
}
|
|
2580
|
+
});
|
|
2581
|
+
// src/utils/rebalanceColumnChildren.ts
|
|
2582
|
+
function bi(e, t) {
|
|
2583
|
+
let n = k(t);
|
|
2584
|
+
if (e.length === n) return e;
|
|
2585
|
+
if (e.length < n) {
|
|
2586
|
+
let t = Array.from({ length: n - e.length }, () => []);
|
|
2587
|
+
return [...e, ...t];
|
|
2588
|
+
}
|
|
2589
|
+
let r = e.slice(0, n), i = e.slice(n).flat(), a = [...r[n - 1], ...i];
|
|
2590
|
+
return [...r.slice(0, n - 1), a];
|
|
2591
|
+
}
|
|
2592
|
+
// src/components/toolbar/SectionToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
2593
|
+
var xi = { class: "tpl:mb-3.5" }, Si = ["value"], Ci = ["value"], wi = {
|
|
2594
|
+
key: 2,
|
|
2595
|
+
class: "tpl:mb-3.5"
|
|
2596
|
+
}, Ti = {
|
|
2597
|
+
key: 0,
|
|
2598
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
2599
|
+
}, Ei = {
|
|
2600
|
+
key: 1,
|
|
2601
|
+
class: "tpl:mt-3 tpl:ml-0.5 tpl:space-y-3 tpl:border-l tpl:border-[var(--tpl-border)] tpl:pl-3"
|
|
2602
|
+
}, Di = /* @__PURE__ */ r({
|
|
2603
|
+
__name: "SectionToolbar",
|
|
2604
|
+
props: { block: {} },
|
|
2605
|
+
emits: ["update"],
|
|
2606
|
+
setup(e, { emit: t }) {
|
|
2607
|
+
let n = e, r = t, { t: o } = H(), s = l(Ue, void 0), u = l(Ge, void 0), d = s !== void 0 && I(s), f = S(() => u !== !1 || !!n.block.wrapper), m = S(() => d && !n.block.wrapper), x = S(() => d && f.value), C = S(() => ne(n.block)?.applied === !0), w = S(() => [
|
|
2608
|
+
{
|
|
2609
|
+
value: "1",
|
|
2610
|
+
label: o.section.column1
|
|
2611
|
+
},
|
|
2612
|
+
{
|
|
2613
|
+
value: "2",
|
|
2614
|
+
label: o.section.column2
|
|
2615
|
+
},
|
|
2616
|
+
{
|
|
2617
|
+
value: "3",
|
|
2618
|
+
label: o.section.column3
|
|
2619
|
+
},
|
|
2620
|
+
{
|
|
2621
|
+
value: "1-2",
|
|
2622
|
+
label: o.section.ratio12
|
|
2623
|
+
},
|
|
2624
|
+
{
|
|
2625
|
+
value: "2-1",
|
|
2626
|
+
label: o.section.ratio21
|
|
2627
|
+
}
|
|
2628
|
+
]);
|
|
2629
|
+
function T(e) {
|
|
2630
|
+
let t = e.target.value, i = bi(n.block.children, t);
|
|
2631
|
+
r("update", {
|
|
2632
|
+
columns: t,
|
|
2633
|
+
children: i
|
|
2634
|
+
});
|
|
2635
|
+
}
|
|
2636
|
+
function D(e) {
|
|
2637
|
+
r("update", { stackOnMobile: e });
|
|
2638
|
+
}
|
|
2639
|
+
function k(e) {
|
|
2640
|
+
r("update", { borderRadius: e });
|
|
2641
|
+
}
|
|
2642
|
+
function A(e) {
|
|
2643
|
+
r("update", { wrapper: e ? { padding: {
|
|
2644
|
+
top: 20,
|
|
2645
|
+
right: 20,
|
|
2646
|
+
bottom: 20,
|
|
2647
|
+
left: 20
|
|
2648
|
+
} } : void 0 });
|
|
2649
|
+
}
|
|
2650
|
+
function j(e) {
|
|
2651
|
+
r("update", { wrapper: {
|
|
2652
|
+
...n.block.wrapper,
|
|
2653
|
+
...e
|
|
2654
|
+
} });
|
|
2655
|
+
}
|
|
2656
|
+
function M(e) {
|
|
2657
|
+
j({ padding: e });
|
|
2658
|
+
}
|
|
2659
|
+
function N(e) {
|
|
2660
|
+
j({ borderRadius: e });
|
|
2661
|
+
}
|
|
2662
|
+
return (t, n) => (i(), p(E, null, [
|
|
2663
|
+
y("div", xi, [y("label", { class: g(h(K)) }, b(h(o).section.columns), 3), y("select", {
|
|
2664
|
+
class: g(h(G)),
|
|
2665
|
+
value: e.block.columns,
|
|
2666
|
+
onChange: T
|
|
2667
|
+
}, [(i(!0), p(E, null, c(w.value, (e) => (i(), p("option", {
|
|
2668
|
+
key: e.value,
|
|
2669
|
+
value: e.value
|
|
2670
|
+
}, b(e.label), 9, Ci))), 128))], 42, Si)]),
|
|
2671
|
+
e.block.columns === "1" ? _("", !0) : (i(), v(q, {
|
|
2672
|
+
key: 0,
|
|
2673
|
+
class: "tpl:mb-3.5",
|
|
2674
|
+
path: "stackOnMobile",
|
|
2675
|
+
label: h(o).section.stackOnMobile
|
|
2676
|
+
}, {
|
|
2677
|
+
"label-actions": a(({ controlId: t }) => [O(Y, {
|
|
2678
|
+
"control-id": t,
|
|
2679
|
+
"hide-label": "",
|
|
2680
|
+
class: "tpl:text-xs tpl:text-[var(--tpl-text)]",
|
|
2681
|
+
"model-value": e.block.stackOnMobile !== !1,
|
|
2682
|
+
label: h(o).section.stackOnMobile,
|
|
2683
|
+
"onUpdate:modelValue": n[0] ||= (e) => D(e)
|
|
2684
|
+
}, null, 8, [
|
|
2685
|
+
"control-id",
|
|
2686
|
+
"model-value",
|
|
2687
|
+
"label"
|
|
2688
|
+
])]),
|
|
2689
|
+
_: 1
|
|
2690
|
+
}, 8, ["label"])),
|
|
2691
|
+
O(Et, {
|
|
2692
|
+
path: "borderRadius",
|
|
2693
|
+
"model-value": e.block.borderRadius,
|
|
2694
|
+
label: h(o).section.borderRadius,
|
|
2695
|
+
max: 50,
|
|
2696
|
+
"testid-prefix": "section",
|
|
2697
|
+
"onUpdate:modelValue": k
|
|
2698
|
+
}, null, 8, ["model-value", "label"]),
|
|
2699
|
+
C.value ? _("", !0) : (i(), v(Ct, {
|
|
2700
|
+
key: 1,
|
|
2701
|
+
path: "border",
|
|
2702
|
+
"model-value": e.block.border,
|
|
2703
|
+
"testid-prefix": "section",
|
|
2704
|
+
"onUpdate:modelValue": n[1] ||= (e) => r("update", { border: e })
|
|
2705
|
+
}, null, 8, ["model-value"])),
|
|
2706
|
+
f.value ? (i(), p("div", wi, [
|
|
2707
|
+
O(q, {
|
|
2708
|
+
path: "wrapper",
|
|
2709
|
+
label: h(o).section.wrapperEnable
|
|
2710
|
+
}, {
|
|
2711
|
+
"label-actions": a(({ controlId: t }) => [O(Y, {
|
|
2712
|
+
"control-id": t,
|
|
2713
|
+
"hide-label": "",
|
|
2714
|
+
class: "tpl:text-xs tpl:text-[var(--tpl-text)]",
|
|
2715
|
+
"model-value": !!e.block.wrapper,
|
|
2716
|
+
label: h(o).section.wrapperEnable,
|
|
2717
|
+
disabled: m.value,
|
|
2718
|
+
"onUpdate:modelValue": n[2] ||= (e) => A(e)
|
|
2719
|
+
}, null, 8, [
|
|
2720
|
+
"control-id",
|
|
2721
|
+
"model-value",
|
|
2722
|
+
"label",
|
|
2723
|
+
"disabled"
|
|
2724
|
+
])]),
|
|
2725
|
+
_: 1
|
|
2726
|
+
}, 8, ["label"]),
|
|
2727
|
+
x.value ? (i(), p("p", Ti, b(h(o).section.wrapperLayoutConflict), 1)) : _("", !0),
|
|
2728
|
+
e.block.wrapper ? (i(), p("div", Ei, [
|
|
2729
|
+
y("div", null, [O(q, {
|
|
2730
|
+
path: "wrapper.backgroundColor",
|
|
2731
|
+
label: h(o).blockSettings.color
|
|
2732
|
+
}, {
|
|
2733
|
+
default: a(() => [O(J, {
|
|
2734
|
+
"model-value": e.block.wrapper.backgroundColor ?? "",
|
|
2735
|
+
"allow-transparent": "",
|
|
2736
|
+
"onUpdate:modelValue": n[3] ||= (e) => j({ backgroundColor: e })
|
|
2737
|
+
}, null, 8, ["model-value"])]),
|
|
2738
|
+
_: 1
|
|
2739
|
+
}, 8, ["label"])]),
|
|
2740
|
+
O(q, {
|
|
2741
|
+
path: "wrapper.backgroundImage",
|
|
2742
|
+
label: h(o).blockSettings.backgroundImage
|
|
2743
|
+
}, {
|
|
2744
|
+
default: a(() => [O(vn, {
|
|
2745
|
+
"hide-label": "",
|
|
2746
|
+
"model-value": e.block.wrapper.backgroundImage,
|
|
2747
|
+
"testid-prefix": "section-wrapper",
|
|
2748
|
+
"onUpdate:modelValue": n[4] ||= (e) => j({ backgroundImage: e })
|
|
2749
|
+
}, null, 8, ["model-value"])]),
|
|
2750
|
+
_: 1
|
|
2751
|
+
}, 8, ["label"]),
|
|
2752
|
+
O(sn, {
|
|
2753
|
+
path: "wrapper.padding",
|
|
2754
|
+
label: h(o).blockSettings.padding,
|
|
2755
|
+
"model-value": e.block.wrapper.padding ?? {
|
|
2756
|
+
top: 0,
|
|
2757
|
+
right: 0,
|
|
2758
|
+
bottom: 0,
|
|
2759
|
+
left: 0
|
|
2760
|
+
},
|
|
2761
|
+
"onUpdate:modelValue": M
|
|
2762
|
+
}, null, 8, ["label", "model-value"]),
|
|
2763
|
+
O(Et, {
|
|
2764
|
+
path: "wrapper.borderRadius",
|
|
2765
|
+
"model-value": e.block.wrapper.borderRadius,
|
|
2766
|
+
label: h(o).section.borderRadius,
|
|
2767
|
+
max: 50,
|
|
2768
|
+
"testid-prefix": "section-wrapper",
|
|
2769
|
+
"onUpdate:modelValue": N
|
|
2770
|
+
}, null, 8, ["model-value", "label"])
|
|
2771
|
+
])) : _("", !0)
|
|
2772
|
+
])) : _("", !0)
|
|
2773
|
+
], 64));
|
|
2774
|
+
}
|
|
2775
|
+
}), Oi = { class: "tpl:mb-3.5" }, ki = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Ai = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ji = ["value", "onChange"], Mi = ["value"], Ni = ["title", "onClick"], Pi = ["value"], Fi = { value: "solid" }, Ii = { value: "outlined" }, Li = { value: "rounded" }, Ri = { value: "square" }, zi = { value: "circle" }, Bi = { value: "plain" }, Vi = ["value"], Hi = { value: "brand" }, Ui = { value: "dark" }, Wi = { value: "light" }, Gi = { class: "tpl:flex tpl:items-stretch" }, Ki = ["value"], qi = /* @__PURE__ */ r({
|
|
2776
|
+
__name: "SocialToolbar",
|
|
2777
|
+
props: { block: {} },
|
|
2778
|
+
emits: ["update"],
|
|
2779
|
+
setup(e, { emit: t }) {
|
|
2780
|
+
let n = e, r = t, { t: o } = H();
|
|
2781
|
+
function s(e, t) {
|
|
2782
|
+
r("update", { [e]: t });
|
|
2783
|
+
}
|
|
2784
|
+
function l() {
|
|
2785
|
+
let e = {
|
|
2786
|
+
id: A(),
|
|
2787
|
+
platform: "facebook",
|
|
2788
|
+
url: ""
|
|
2789
|
+
};
|
|
2790
|
+
r("update", { icons: [...n.block.icons, e] });
|
|
2791
|
+
}
|
|
2792
|
+
function u(e, t, i) {
|
|
2793
|
+
let a = n.block.icons.map((n) => n.id === e ? {
|
|
2794
|
+
...n,
|
|
2795
|
+
[t]: i
|
|
2796
|
+
} : n);
|
|
2797
|
+
r("update", { icons: a });
|
|
2798
|
+
}
|
|
2799
|
+
function d(e) {
|
|
2800
|
+
r("update", { icons: n.block.icons.filter((t) => t.id !== e) });
|
|
2801
|
+
}
|
|
2802
|
+
return (t, n) => (i(), p(E, null, [
|
|
2803
|
+
y("div", Oi, [y("label", { class: g(h(K)) }, b(h(o).social.icons), 3), y("div", ki, [(i(!0), p(E, null, c(e.block.icons, (e) => (i(), p("div", {
|
|
2804
|
+
key: e.id,
|
|
2805
|
+
class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
|
|
2806
|
+
}, [y("div", Ai, [O(q, {
|
|
2807
|
+
path: e.id.includes(".") ? void 0 : `icons.${e.id}.platform`,
|
|
2808
|
+
label: h(o).social.icons
|
|
2809
|
+
}, {
|
|
2810
|
+
default: a(() => [y("select", {
|
|
2811
|
+
"data-testid": "social-platform-select",
|
|
2812
|
+
class: g([h(G), "tpl:flex-1"]),
|
|
2813
|
+
value: e.platform,
|
|
2814
|
+
onChange: (t) => u(e.id, "platform", t.target.value)
|
|
2815
|
+
}, [(i(!0), p(E, null, c(h(ve), (e) => (i(), p("option", {
|
|
2816
|
+
key: e,
|
|
2817
|
+
value: e
|
|
2818
|
+
}, b(h(o).social.platforms[e]), 9, Mi))), 128))], 42, ji)]),
|
|
2819
|
+
_: 2
|
|
2820
|
+
}, 1032, ["path", "label"]), y("button", {
|
|
2821
|
+
class: g(h(tt)),
|
|
2822
|
+
title: h(o).social.removeIcon,
|
|
2823
|
+
onClick: (t) => d(e.id)
|
|
2824
|
+
}, [O(h(Re), {
|
|
2825
|
+
size: 14,
|
|
2826
|
+
"stroke-width": 2
|
|
2827
|
+
})], 10, Ni)]), O(q, {
|
|
2828
|
+
path: e.id.includes(".") ? void 0 : `icons.${e.id}.url`,
|
|
2829
|
+
label: h(o).button.url
|
|
2830
|
+
}, {
|
|
2831
|
+
default: a(() => [O(X, {
|
|
2832
|
+
"model-value": e.url,
|
|
2833
|
+
type: "url",
|
|
2834
|
+
placeholder: h(o).social.urlPlaceholder,
|
|
2835
|
+
"onUpdate:modelValue": (t) => u(e.id, "url", t)
|
|
2836
|
+
}, null, 8, [
|
|
2837
|
+
"model-value",
|
|
2838
|
+
"placeholder",
|
|
2839
|
+
"onUpdate:modelValue"
|
|
2840
|
+
])]),
|
|
2841
|
+
_: 2
|
|
2842
|
+
}, 1032, ["path", "label"])]))), 128)), y("button", {
|
|
2843
|
+
class: g(h(rt)),
|
|
2844
|
+
onClick: l
|
|
2845
|
+
}, [O(h(V), {
|
|
2846
|
+
size: 14,
|
|
2847
|
+
"stroke-width": 2
|
|
2848
|
+
}), m(" " + b(h(o).social.addIcon), 1)], 2)])]),
|
|
2849
|
+
O(q, {
|
|
2850
|
+
label: h(o).social.style,
|
|
2851
|
+
class: "tpl:mb-3.5",
|
|
2852
|
+
path: "iconStyle"
|
|
2853
|
+
}, {
|
|
2854
|
+
default: a(() => [y("select", {
|
|
2855
|
+
class: g(h(G)),
|
|
2856
|
+
value: e.block.iconStyle,
|
|
2857
|
+
onChange: n[0] ||= (e) => s("iconStyle", e.target.value)
|
|
2858
|
+
}, [
|
|
2859
|
+
y("option", Fi, b(h(o).social.styleSolid), 1),
|
|
2860
|
+
y("option", Ii, b(h(o).social.styleOutlined), 1),
|
|
2861
|
+
y("option", Li, b(h(o).social.styleRounded), 1),
|
|
2862
|
+
y("option", Ri, b(h(o).social.styleSquare), 1),
|
|
2863
|
+
y("option", zi, b(h(o).social.styleCircle), 1),
|
|
2864
|
+
y("option", Bi, b(h(o).social.stylePlain), 1)
|
|
2865
|
+
], 42, Pi)]),
|
|
2866
|
+
_: 1
|
|
2867
|
+
}, 8, ["label"]),
|
|
2868
|
+
O(q, {
|
|
2869
|
+
label: h(o).social.color,
|
|
2870
|
+
class: "tpl:mb-3.5",
|
|
2871
|
+
path: "iconTone"
|
|
2872
|
+
}, {
|
|
2873
|
+
default: a(() => [y("select", {
|
|
2874
|
+
"data-testid": "social-tone-select",
|
|
2875
|
+
class: g(h(G)),
|
|
2876
|
+
value: e.block.iconTone ?? "brand",
|
|
2877
|
+
onChange: n[1] ||= (e) => s("iconTone", e.target.value)
|
|
2878
|
+
}, [
|
|
2879
|
+
y("option", Hi, b(h(o).social.colorBrand), 1),
|
|
2880
|
+
y("option", Ui, b(h(o).social.colorDark), 1),
|
|
2881
|
+
y("option", Wi, b(h(o).social.colorLight), 1)
|
|
2882
|
+
], 42, Vi)]),
|
|
2883
|
+
_: 1
|
|
2884
|
+
}, 8, ["label"]),
|
|
2885
|
+
O(q, {
|
|
2886
|
+
label: h(o).social.size,
|
|
2887
|
+
class: "tpl:mb-3.5",
|
|
2888
|
+
path: "iconSize"
|
|
2889
|
+
}, {
|
|
2890
|
+
default: a(() => [O(Z, {
|
|
2891
|
+
options: [
|
|
2892
|
+
{
|
|
2893
|
+
value: "small",
|
|
2894
|
+
label: h(o).social.sizeSmall
|
|
2895
|
+
},
|
|
2896
|
+
{
|
|
2897
|
+
value: "medium",
|
|
2898
|
+
label: h(o).social.sizeMedium
|
|
2899
|
+
},
|
|
2900
|
+
{
|
|
2901
|
+
value: "large",
|
|
2902
|
+
label: h(o).social.sizeLarge
|
|
2903
|
+
}
|
|
2904
|
+
],
|
|
2905
|
+
"model-value": e.block.iconSize,
|
|
2906
|
+
"onUpdate:modelValue": n[2] ||= (e) => s("iconSize", e)
|
|
2907
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2908
|
+
_: 1
|
|
2909
|
+
}, 8, ["label"]),
|
|
2910
|
+
O(q, {
|
|
2911
|
+
label: h(o).social.spacing,
|
|
2912
|
+
class: "tpl:mb-3.5",
|
|
2913
|
+
path: "spacing"
|
|
2914
|
+
}, {
|
|
2915
|
+
default: a(() => [y("div", Gi, [y("input", {
|
|
2916
|
+
type: "number",
|
|
2917
|
+
class: g(h(W)),
|
|
2918
|
+
value: e.block.spacing,
|
|
2919
|
+
min: "0",
|
|
2920
|
+
max: "50",
|
|
2921
|
+
onInput: n[3] ||= (e) => s("spacing", Number(e.target.value))
|
|
2922
|
+
}, null, 42, Ki), y("span", { class: g(h(U)) }, "px", 2)])]),
|
|
2923
|
+
_: 1
|
|
2924
|
+
}, 8, ["label"]),
|
|
2925
|
+
O(q, {
|
|
2926
|
+
label: h(o).social.align,
|
|
2927
|
+
class: "tpl:mb-3.5",
|
|
2928
|
+
path: "align"
|
|
2929
|
+
}, {
|
|
2930
|
+
default: a(() => [O(Z, {
|
|
2931
|
+
options: [
|
|
2932
|
+
{
|
|
2933
|
+
value: "left",
|
|
2934
|
+
label: h(o).title.alignLeft,
|
|
2935
|
+
icon: h(Ie)
|
|
2936
|
+
},
|
|
2937
|
+
{
|
|
2938
|
+
value: "center",
|
|
2939
|
+
label: h(o).title.alignCenter,
|
|
2940
|
+
icon: h(ze)
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
value: "right",
|
|
2944
|
+
label: h(o).title.alignRight,
|
|
2945
|
+
icon: h(Oe)
|
|
2946
|
+
}
|
|
2947
|
+
],
|
|
2948
|
+
"model-value": e.block.align,
|
|
2949
|
+
"onUpdate:modelValue": n[4] ||= (e) => s("align", e)
|
|
2950
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2951
|
+
_: 1
|
|
2952
|
+
}, 8, ["label"])
|
|
2953
|
+
], 64));
|
|
2954
|
+
}
|
|
2955
|
+
}), Ji = { class: "tpl:flex tpl:items-stretch" }, Yi = ["value"], Xi = ["value"], Zi = /* @__PURE__ */ r({
|
|
2956
|
+
__name: "SpacerToolbar",
|
|
2957
|
+
props: { block: {} },
|
|
2958
|
+
emits: ["update"],
|
|
2959
|
+
setup(e, { emit: t }) {
|
|
2960
|
+
let n = t, { t: r } = H();
|
|
2961
|
+
return (t, o) => (i(), v(q, {
|
|
2962
|
+
label: h(r).spacer.height,
|
|
2963
|
+
class: "tpl:mb-3.5",
|
|
2964
|
+
path: "height"
|
|
2965
|
+
}, {
|
|
2966
|
+
default: a(() => [y("div", Ji, [y("input", {
|
|
2967
|
+
type: "number",
|
|
2968
|
+
class: g(h(W)),
|
|
2969
|
+
value: e.block.height,
|
|
2970
|
+
min: "10",
|
|
2971
|
+
max: "100",
|
|
2972
|
+
onInput: o[0] ||= (e) => n("update", { height: Number(e.target.value) })
|
|
2973
|
+
}, null, 42, Yi), y("span", { class: g(h(U)) }, "px", 2)]), y("input", {
|
|
2974
|
+
type: "range",
|
|
2975
|
+
class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
|
|
2976
|
+
value: e.block.height,
|
|
2977
|
+
min: "10",
|
|
2978
|
+
max: "100",
|
|
2979
|
+
onInput: o[1] ||= (e) => n("update", { height: Number(e.target.value) })
|
|
2980
|
+
}, null, 40, Xi)]),
|
|
2981
|
+
_: 1
|
|
2982
|
+
}, 8, ["label"]));
|
|
2983
|
+
}
|
|
2984
|
+
}), Qi = { class: "tpl:mb-3.5" }, $i = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ea = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, ta = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, na = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, ra = ["disabled"], ia = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, aa = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, oa = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, sa = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, ca = ["disabled"], la = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, ua = { class: "tpl:flex tpl:items-stretch" }, da = ["value"], fa = { class: "tpl:flex tpl:items-stretch" }, pa = ["value"], ma = ["value"], ha = { value: "" }, ga = ["value"], _a = { class: "tpl:flex tpl:items-stretch" }, va = ["value"], ya = /* @__PURE__ */ r({
|
|
2985
|
+
__name: "TableToolbar",
|
|
2986
|
+
props: {
|
|
2987
|
+
block: {},
|
|
2988
|
+
fontFamilies: {}
|
|
2989
|
+
},
|
|
2990
|
+
emits: ["update"],
|
|
2991
|
+
setup(e, { emit: t }) {
|
|
2992
|
+
let n = e, r = t, { t: o } = H(), s = S(() => n.block.rows.length > 0 ? n.block.rows[0].cells.length : 0);
|
|
2993
|
+
function l(e, t) {
|
|
2994
|
+
r("update", { [e]: t });
|
|
2995
|
+
}
|
|
2996
|
+
function u() {
|
|
2997
|
+
let e = n.block.rows.length > 0 ? n.block.rows[0].cells.length : 3, t = {
|
|
2998
|
+
id: A(),
|
|
2999
|
+
cells: Array.from({ length: e }, () => ({
|
|
3000
|
+
id: A(),
|
|
3001
|
+
content: ""
|
|
3002
|
+
}))
|
|
3003
|
+
};
|
|
3004
|
+
r("update", { rows: [...n.block.rows, t] });
|
|
3005
|
+
}
|
|
3006
|
+
function d(e) {
|
|
3007
|
+
r("update", { rows: n.block.rows.filter((t) => t.id !== e) });
|
|
3008
|
+
}
|
|
3009
|
+
function f() {
|
|
3010
|
+
let e = n.block.rows.map((e) => ({
|
|
3011
|
+
...e,
|
|
3012
|
+
cells: [...e.cells, {
|
|
3013
|
+
id: A(),
|
|
3014
|
+
content: ""
|
|
3015
|
+
}]
|
|
3016
|
+
}));
|
|
3017
|
+
r("update", { rows: e });
|
|
3018
|
+
}
|
|
3019
|
+
function m(e) {
|
|
3020
|
+
let t = n.block.rows.map((t) => ({
|
|
3021
|
+
...t,
|
|
3022
|
+
cells: t.cells.filter((t, n) => n !== e)
|
|
3023
|
+
}));
|
|
3024
|
+
r("update", { rows: t });
|
|
3025
|
+
}
|
|
3026
|
+
return (t, n) => (i(), p(E, null, [
|
|
3027
|
+
y("div", Qi, [y("label", { class: g(h(K)) }, b(h(o).table.dimensions), 3), y("div", $i, [y("div", ea, [y("span", ta, b(h(o).table.rows), 1), y("div", na, [
|
|
3028
|
+
y("button", {
|
|
3029
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
|
|
3030
|
+
disabled: e.block.rows.length <= 1,
|
|
3031
|
+
onClick: n[0] ||= (t) => d(e.block.rows[e.block.rows.length - 1].id)
|
|
3032
|
+
}, [O(h(je), {
|
|
3033
|
+
size: 12,
|
|
3034
|
+
"stroke-width": 2
|
|
3035
|
+
})], 8, ra),
|
|
3036
|
+
y("span", ia, b(e.block.rows.length), 1),
|
|
3037
|
+
y("button", {
|
|
3038
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:hover:text-[var(--tpl-primary)]",
|
|
3039
|
+
onClick: u
|
|
3040
|
+
}, [O(h(V), {
|
|
3041
|
+
size: 12,
|
|
3042
|
+
"stroke-width": 2
|
|
3043
|
+
})])
|
|
3044
|
+
])]), y("div", aa, [y("span", oa, b(h(o).table.columns), 1), y("div", sa, [
|
|
3045
|
+
y("button", {
|
|
3046
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
|
|
3047
|
+
disabled: s.value <= 1,
|
|
3048
|
+
onClick: n[1] ||= (e) => m(s.value - 1)
|
|
3049
|
+
}, [O(h(je), {
|
|
3050
|
+
size: 12,
|
|
3051
|
+
"stroke-width": 2
|
|
3052
|
+
})], 8, ca),
|
|
3053
|
+
y("span", la, b(s.value), 1),
|
|
3054
|
+
y("button", {
|
|
3055
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:hover:text-[var(--tpl-primary)]",
|
|
3056
|
+
onClick: f
|
|
3057
|
+
}, [O(h(V), {
|
|
3058
|
+
size: 12,
|
|
3059
|
+
"stroke-width": 2
|
|
3060
|
+
})])
|
|
3061
|
+
])])])]),
|
|
3062
|
+
O(q, {
|
|
3063
|
+
class: "tpl:mb-3.5",
|
|
3064
|
+
path: "hasHeaderRow",
|
|
3065
|
+
label: h(o).table.hasHeaderRow
|
|
3066
|
+
}, {
|
|
3067
|
+
"label-actions": a(({ controlId: t }) => [O(Y, {
|
|
3068
|
+
"control-id": t,
|
|
3069
|
+
"hide-label": "",
|
|
3070
|
+
class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
3071
|
+
"model-value": e.block.hasHeaderRow,
|
|
3072
|
+
label: h(o).table.hasHeaderRow,
|
|
3073
|
+
"onUpdate:modelValue": n[2] ||= (e) => l("hasHeaderRow", e)
|
|
3074
|
+
}, null, 8, [
|
|
3075
|
+
"control-id",
|
|
3076
|
+
"model-value",
|
|
3077
|
+
"label"
|
|
3078
|
+
])]),
|
|
3079
|
+
_: 1
|
|
3080
|
+
}, 8, ["label"]),
|
|
3081
|
+
e.block.hasHeaderRow ? (i(), v(q, {
|
|
3082
|
+
key: 0,
|
|
3083
|
+
label: h(o).table.headerBackgroundColor,
|
|
3084
|
+
class: "tpl:mb-3.5",
|
|
3085
|
+
path: "headerBackgroundColor"
|
|
3086
|
+
}, {
|
|
3087
|
+
default: a(() => [O(J, {
|
|
3088
|
+
"model-value": e.block.headerBackgroundColor ?? "",
|
|
3089
|
+
"seed-color": h(it),
|
|
3090
|
+
placeholder: h(o).table.noHeaderBg,
|
|
3091
|
+
"onUpdate:modelValue": n[3] ||= (e) => l("headerBackgroundColor", e || null)
|
|
3092
|
+
}, null, 8, [
|
|
3093
|
+
"model-value",
|
|
3094
|
+
"seed-color",
|
|
3095
|
+
"placeholder"
|
|
3096
|
+
])]),
|
|
3097
|
+
_: 1
|
|
3098
|
+
}, 8, ["label"])) : _("", !0),
|
|
3099
|
+
O(q, {
|
|
3100
|
+
label: h(o).table.borderColor,
|
|
3101
|
+
class: "tpl:mb-3.5",
|
|
3102
|
+
path: "borderColor"
|
|
3103
|
+
}, {
|
|
3104
|
+
default: a(() => [O(J, {
|
|
3105
|
+
"model-value": e.block.borderColor,
|
|
3106
|
+
"onUpdate:modelValue": n[4] ||= (e) => l("borderColor", e)
|
|
3107
|
+
}, null, 8, ["model-value"])]),
|
|
3108
|
+
_: 1
|
|
3109
|
+
}, 8, ["label"]),
|
|
3110
|
+
O(q, {
|
|
3111
|
+
label: h(o).table.borderWidth,
|
|
3112
|
+
class: "tpl:mb-3.5",
|
|
3113
|
+
path: "borderWidth"
|
|
3114
|
+
}, {
|
|
3115
|
+
default: a(() => [y("div", ua, [y("input", {
|
|
3116
|
+
type: "number",
|
|
3117
|
+
class: g(h(W)),
|
|
3118
|
+
value: e.block.borderWidth,
|
|
3119
|
+
min: "0",
|
|
3120
|
+
max: "10",
|
|
3121
|
+
onInput: n[5] ||= (e) => l("borderWidth", Number(e.target.value))
|
|
3122
|
+
}, null, 42, da), y("span", { class: g(h(U)) }, "px", 2)])]),
|
|
3123
|
+
_: 1
|
|
3124
|
+
}, 8, ["label"]),
|
|
3125
|
+
O(q, {
|
|
3126
|
+
label: h(o).table.cellPadding,
|
|
3127
|
+
class: "tpl:mb-3.5",
|
|
3128
|
+
path: "cellPadding"
|
|
3129
|
+
}, {
|
|
3130
|
+
default: a(() => [y("div", fa, [y("input", {
|
|
3131
|
+
type: "number",
|
|
3132
|
+
class: g(h(W)),
|
|
3133
|
+
value: e.block.cellPadding,
|
|
3134
|
+
min: "0",
|
|
3135
|
+
max: "30",
|
|
3136
|
+
onInput: n[6] ||= (e) => l("cellPadding", Number(e.target.value))
|
|
3137
|
+
}, null, 42, pa), y("span", { class: g(h(U)) }, "px", 2)])]),
|
|
3138
|
+
_: 1
|
|
3139
|
+
}, 8, ["label"]),
|
|
3140
|
+
O(q, {
|
|
3141
|
+
label: h(o).table.fontFamily,
|
|
3142
|
+
class: "tpl:mb-3.5",
|
|
3143
|
+
path: "fontFamily"
|
|
3144
|
+
}, {
|
|
3145
|
+
default: a(() => [y("select", {
|
|
3146
|
+
class: g(h(G)),
|
|
3147
|
+
value: h(ft)(e.block.fontFamily),
|
|
3148
|
+
onChange: n[7] ||= (e) => l("fontFamily", e.target.value || void 0)
|
|
3149
|
+
}, [y("option", ha, b(h(o).title.inheritFont), 1), (i(!0), p(E, null, c(e.fontFamilies, (e) => (i(), p("option", {
|
|
3150
|
+
key: e.value,
|
|
3151
|
+
value: e.value
|
|
3152
|
+
}, b(e.label), 9, ga))), 128))], 42, ma)]),
|
|
3153
|
+
_: 1
|
|
3154
|
+
}, 8, ["label"]),
|
|
3155
|
+
O(q, {
|
|
3156
|
+
label: h(o).table.fontSize,
|
|
3157
|
+
class: "tpl:mb-3.5",
|
|
3158
|
+
path: "fontSize"
|
|
3159
|
+
}, {
|
|
3160
|
+
default: a(() => [y("div", _a, [y("input", {
|
|
3161
|
+
type: "number",
|
|
3162
|
+
class: g(h(W)),
|
|
3163
|
+
value: e.block.fontSize,
|
|
3164
|
+
min: "10",
|
|
3165
|
+
max: "32",
|
|
3166
|
+
onInput: n[8] ||= (e) => l("fontSize", Number(e.target.value))
|
|
3167
|
+
}, null, 42, va), y("span", { class: g(h(U)) }, "px", 2)])]),
|
|
3168
|
+
_: 1
|
|
3169
|
+
}, 8, ["label"]),
|
|
3170
|
+
O(q, {
|
|
3171
|
+
label: h(o).table.color,
|
|
3172
|
+
class: "tpl:mb-3.5",
|
|
3173
|
+
path: "color"
|
|
3174
|
+
}, {
|
|
3175
|
+
default: a(() => [O(J, {
|
|
3176
|
+
"model-value": e.block.color ?? "",
|
|
3177
|
+
"onUpdate:modelValue": n[9] ||= (e) => l("color", e || void 0)
|
|
3178
|
+
}, null, 8, ["model-value"])]),
|
|
3179
|
+
_: 1
|
|
3180
|
+
}, 8, ["label"]),
|
|
3181
|
+
O(q, {
|
|
3182
|
+
label: h(o).table.textAlign,
|
|
3183
|
+
class: "tpl:mb-3.5",
|
|
3184
|
+
path: "textAlign"
|
|
3185
|
+
}, {
|
|
3186
|
+
default: a(() => [O(Z, {
|
|
3187
|
+
options: [
|
|
3188
|
+
{
|
|
3189
|
+
value: "left",
|
|
3190
|
+
label: h(o).title.alignLeft,
|
|
3191
|
+
icon: h(Ie)
|
|
3192
|
+
},
|
|
3193
|
+
{
|
|
3194
|
+
value: "center",
|
|
3195
|
+
label: h(o).title.alignCenter,
|
|
3196
|
+
icon: h(ze)
|
|
3197
|
+
},
|
|
3198
|
+
{
|
|
3199
|
+
value: "right",
|
|
3200
|
+
label: h(o).title.alignRight,
|
|
3201
|
+
icon: h(Oe)
|
|
3202
|
+
}
|
|
3203
|
+
],
|
|
3204
|
+
"model-value": e.block.textAlign,
|
|
3205
|
+
"onUpdate:modelValue": n[10] ||= (e) => l("textAlign", e)
|
|
3206
|
+
}, null, 8, ["options", "model-value"])]),
|
|
3207
|
+
_: 1
|
|
3208
|
+
}, 8, ["label"])
|
|
3209
|
+
], 64));
|
|
3210
|
+
}
|
|
3211
|
+
}), ba = ["value"], xa = { value: 1 }, Sa = { value: 2 }, Ca = { value: 3 }, wa = { value: 4 }, Ta = ["value"], Ea = { value: "" }, Da = ["value"], Oa = /* @__PURE__ */ r({
|
|
3212
|
+
__name: "TitleToolbar",
|
|
3213
|
+
props: {
|
|
3214
|
+
block: {},
|
|
3215
|
+
fontFamilies: {}
|
|
3216
|
+
},
|
|
3217
|
+
emits: ["update"],
|
|
3218
|
+
setup(e, { emit: t }) {
|
|
3219
|
+
let n = t, { t: r } = H();
|
|
3220
|
+
function o(e, t) {
|
|
3221
|
+
n("update", { [e]: t });
|
|
3222
|
+
}
|
|
3223
|
+
return (t, n) => (i(), p(E, null, [
|
|
3224
|
+
O(q, {
|
|
3225
|
+
label: h(r).title.level,
|
|
3226
|
+
class: "tpl:mb-3.5",
|
|
3227
|
+
path: "level"
|
|
3228
|
+
}, {
|
|
3229
|
+
default: a(() => [y("select", {
|
|
3230
|
+
class: g(h(G)),
|
|
3231
|
+
value: e.block.level,
|
|
3232
|
+
onChange: n[0] ||= (e) => o("level", Number(e.target.value))
|
|
3233
|
+
}, [
|
|
3234
|
+
y("option", xa, b(h(r).title.heading1), 1),
|
|
3235
|
+
y("option", Sa, b(h(r).title.heading2), 1),
|
|
3236
|
+
y("option", Ca, b(h(r).title.heading3), 1),
|
|
3237
|
+
y("option", wa, b(h(r).title.heading4), 1)
|
|
3238
|
+
], 42, ba)]),
|
|
3239
|
+
_: 1
|
|
3240
|
+
}, 8, ["label"]),
|
|
3241
|
+
O(q, {
|
|
3242
|
+
label: h(r).title.fontFamily,
|
|
3243
|
+
class: "tpl:mb-3.5",
|
|
3244
|
+
path: "fontFamily"
|
|
3245
|
+
}, {
|
|
3246
|
+
default: a(() => [y("select", {
|
|
3247
|
+
class: g(h(G)),
|
|
3248
|
+
value: h(ft)(e.block.fontFamily),
|
|
3249
|
+
onChange: n[1] ||= (e) => o("fontFamily", e.target.value || void 0)
|
|
3250
|
+
}, [y("option", Ea, b(h(r).title.inheritFont), 1), (i(!0), p(E, null, c(e.fontFamilies, (e) => (i(), p("option", {
|
|
3251
|
+
key: e.value,
|
|
3252
|
+
value: e.value
|
|
3253
|
+
}, b(e.label), 9, Da))), 128))], 42, Ta)]),
|
|
3254
|
+
_: 1
|
|
3255
|
+
}, 8, ["label"]),
|
|
3256
|
+
O(q, {
|
|
3257
|
+
label: h(r).title.color,
|
|
3258
|
+
class: "tpl:mb-3.5",
|
|
3259
|
+
path: "color"
|
|
3260
|
+
}, {
|
|
3261
|
+
default: a(() => [O(J, {
|
|
3262
|
+
"model-value": e.block.color ?? "",
|
|
3263
|
+
"onUpdate:modelValue": n[2] ||= (e) => o("color", e || void 0)
|
|
3264
|
+
}, null, 8, ["model-value"])]),
|
|
3265
|
+
_: 1
|
|
3266
|
+
}, 8, ["label"]),
|
|
3267
|
+
O(q, {
|
|
3268
|
+
label: h(r).title.align,
|
|
3269
|
+
class: "tpl:mb-3.5",
|
|
3270
|
+
path: "textAlign"
|
|
3271
|
+
}, {
|
|
3272
|
+
default: a(() => [O(Z, {
|
|
3273
|
+
options: [
|
|
3274
|
+
{
|
|
3275
|
+
value: "left",
|
|
3276
|
+
label: h(r).title.alignLeft,
|
|
3277
|
+
icon: h(Ie)
|
|
3278
|
+
},
|
|
3279
|
+
{
|
|
3280
|
+
value: "center",
|
|
3281
|
+
label: h(r).title.alignCenter,
|
|
3282
|
+
icon: h(ze)
|
|
3283
|
+
},
|
|
3284
|
+
{
|
|
3285
|
+
value: "right",
|
|
3286
|
+
label: h(r).title.alignRight,
|
|
3287
|
+
icon: h(Oe)
|
|
3288
|
+
}
|
|
3289
|
+
],
|
|
3290
|
+
"model-value": e.block.textAlign,
|
|
3291
|
+
"onUpdate:modelValue": n[3] ||= (e) => o("textAlign", e)
|
|
3292
|
+
}, null, 8, ["options", "model-value"])]),
|
|
3293
|
+
_: 1
|
|
3294
|
+
}, 8, ["label"])
|
|
3295
|
+
], 64));
|
|
3296
|
+
}
|
|
3297
|
+
}), ka = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Aa = [
|
|
3298
|
+
"value",
|
|
3299
|
+
"placeholder",
|
|
3300
|
+
"title"
|
|
3301
|
+
], ja = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Ma = ["value"], Na = { value: "full" }, Pa = { value: "custom" }, Fa = {
|
|
3302
|
+
key: 0,
|
|
3303
|
+
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
3304
|
+
}, Ia = ["value"], La = ["value"], Ra = { value: "auto" }, za = { value: "custom" }, Ba = {
|
|
3305
|
+
key: 0,
|
|
3306
|
+
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
3307
|
+
}, Va = ["value"], Ha = 350, Ua = 200, Wa = /* @__PURE__ */ r({
|
|
3308
|
+
__name: "VideoToolbar",
|
|
3309
|
+
props: { block: {} },
|
|
3310
|
+
emits: ["update"],
|
|
3311
|
+
setup(e, { emit: t }) {
|
|
3312
|
+
let n = e, r = t, { t: o } = H(), s = l(We, null), c = l(Be, te.liquid), u = ue(), d = [
|
|
3313
|
+
300,
|
|
3314
|
+
400,
|
|
3315
|
+
500
|
|
3316
|
+
], f = S(() => !!s), x = S(() => re(n.block.url, c)), C = S(() => {
|
|
3317
|
+
let e = n.block.width;
|
|
3318
|
+
return e === "full" ? "full" : d.includes(e) ? String(e) : "custom";
|
|
3319
|
+
}), w = S(() => typeof n.block.height == "number" ? "custom" : "auto"), D = T(!1), { start: k } = ot(() => {
|
|
3320
|
+
D.value = !1;
|
|
3321
|
+
}, 1e3, { immediate: !1 });
|
|
3322
|
+
function A(e, t) {
|
|
3323
|
+
r("update", { [e]: t });
|
|
3324
|
+
}
|
|
3325
|
+
function j(e) {
|
|
3326
|
+
if (e === "custom") {
|
|
3327
|
+
let e = n.block.width;
|
|
3328
|
+
(typeof e != "number" || d.includes(e)) && A("width", Ha);
|
|
3329
|
+
} else A("width", e === "full" ? "full" : Number(e));
|
|
3330
|
+
}
|
|
3331
|
+
function M(e) {
|
|
3332
|
+
let t = Number(e);
|
|
3333
|
+
!Number.isFinite(t) || t <= 0 || A("width", t);
|
|
3334
|
+
}
|
|
3335
|
+
function N(e) {
|
|
3336
|
+
A("height", e === "custom" ? Ua : void 0);
|
|
3337
|
+
}
|
|
3338
|
+
function P(e) {
|
|
3339
|
+
let t = Number(e);
|
|
3340
|
+
!Number.isFinite(t) || t <= 0 || A("height", t);
|
|
3341
|
+
}
|
|
3342
|
+
async function F() {
|
|
3343
|
+
let e = await s?.({ accept: ["images"] });
|
|
3344
|
+
u.alive && e && (A("thumbnailUrl", e.url), D.value = !0, k());
|
|
3345
|
+
}
|
|
3346
|
+
return (t, n) => (i(), p(E, null, [
|
|
3347
|
+
O(q, {
|
|
3348
|
+
label: h(o).video.videoUrl,
|
|
3349
|
+
class: "tpl:mb-3.5",
|
|
3350
|
+
path: "url"
|
|
3351
|
+
}, {
|
|
3352
|
+
default: a(() => [O(X, {
|
|
3353
|
+
"model-value": e.block.url,
|
|
3354
|
+
type: "url",
|
|
3355
|
+
placeholder: h(o).video.videoUrlPlaceholder,
|
|
3356
|
+
"onUpdate:modelValue": n[0] ||= (e) => A("url", e)
|
|
3357
|
+
}, null, 8, ["model-value", "placeholder"]), e.block.url ? (i(), v(q, {
|
|
3358
|
+
key: 0,
|
|
3359
|
+
path: "openInNewTab",
|
|
3360
|
+
label: h(o).video.openInNewTab
|
|
3361
|
+
}, {
|
|
3362
|
+
"label-actions": a(({ controlId: t }) => [O(Y, {
|
|
3363
|
+
"control-id": t,
|
|
3364
|
+
"hide-label": "",
|
|
3365
|
+
class: "tpl:mt-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]",
|
|
3366
|
+
"model-value": e.block.openInNewTab ?? !1,
|
|
3367
|
+
label: h(o).video.openInNewTab,
|
|
3368
|
+
"onUpdate:modelValue": n[1] ||= (e) => A("openInNewTab", e)
|
|
3369
|
+
}, null, 8, [
|
|
3370
|
+
"control-id",
|
|
3371
|
+
"model-value",
|
|
3372
|
+
"label"
|
|
3373
|
+
])]),
|
|
3374
|
+
_: 1
|
|
3375
|
+
}, 8, ["label"])) : _("", !0)]),
|
|
3376
|
+
_: 1
|
|
3377
|
+
}, 8, ["label"]),
|
|
3378
|
+
x.value ? (i(), v(q, {
|
|
3379
|
+
key: 0,
|
|
3380
|
+
class: "tpl:mb-3.5",
|
|
3381
|
+
path: "placeholderUrl"
|
|
3382
|
+
}, {
|
|
3383
|
+
label: a(() => [m(b(h(o).video.placeholderUrl) + " ", 1), y("span", ka, b(h(o).video.optional), 1)]),
|
|
3384
|
+
default: a(() => [y("input", {
|
|
3385
|
+
type: "url",
|
|
3386
|
+
class: g(h(G)),
|
|
3387
|
+
value: e.block.placeholderUrl || "",
|
|
3388
|
+
placeholder: h(o).video.placeholderUrlPlaceholder,
|
|
3389
|
+
title: h(o).video.placeholderUrlTooltip,
|
|
3390
|
+
onInput: n[2] ||= (e) => A("placeholderUrl", e.target.value)
|
|
3391
|
+
}, null, 42, Aa)]),
|
|
3392
|
+
_: 1
|
|
3393
|
+
})) : _("", !0),
|
|
3394
|
+
O(q, {
|
|
3395
|
+
class: "tpl:mb-3.5",
|
|
3396
|
+
path: "thumbnailUrl"
|
|
3397
|
+
}, {
|
|
3398
|
+
label: a(() => [m(b(h(o).video.customThumbnail) + " ", 1), y("span", ja, b(h(o).video.optional), 1)]),
|
|
3399
|
+
default: a(() => [O(X, {
|
|
3400
|
+
"model-value": e.block.thumbnailUrl,
|
|
3401
|
+
type: "url",
|
|
3402
|
+
placeholder: h(o).video.thumbnailPlaceholder,
|
|
3403
|
+
pulse: D.value,
|
|
3404
|
+
"onUpdate:modelValue": n[3] ||= (e) => A("thumbnailUrl", e)
|
|
3405
|
+
}, null, 8, [
|
|
3406
|
+
"model-value",
|
|
3407
|
+
"placeholder",
|
|
3408
|
+
"pulse"
|
|
3409
|
+
]), f.value ? (i(), p("button", {
|
|
3410
|
+
key: 0,
|
|
3411
|
+
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all",
|
|
3412
|
+
style: {
|
|
3413
|
+
"border-color": "var(--tpl-border)",
|
|
3414
|
+
color: "var(--tpl-primary)",
|
|
3415
|
+
"background-color": "var(--tpl-bg)"
|
|
3416
|
+
},
|
|
3417
|
+
onClick: F
|
|
3418
|
+
}, [O(h(ke), {
|
|
3419
|
+
size: 14,
|
|
3420
|
+
"stroke-width": 1.5
|
|
3421
|
+
}), m(" " + b(h(o).image.browseMedia), 1)])) : _("", !0)]),
|
|
3422
|
+
_: 1
|
|
3423
|
+
}),
|
|
3424
|
+
O(q, {
|
|
3425
|
+
label: h(o).video.altText,
|
|
3426
|
+
class: "tpl:mb-3.5",
|
|
3427
|
+
path: "alt"
|
|
3428
|
+
}, {
|
|
3429
|
+
default: a(() => [O(X, {
|
|
3430
|
+
"model-value": e.block.alt,
|
|
3431
|
+
type: "text",
|
|
3432
|
+
placeholder: h(o).video.altTextPlaceholder,
|
|
3433
|
+
"onUpdate:modelValue": n[4] ||= (e) => A("alt", e)
|
|
3434
|
+
}, null, 8, ["model-value", "placeholder"])]),
|
|
3435
|
+
_: 1
|
|
3436
|
+
}, 8, ["label"]),
|
|
3437
|
+
O(q, {
|
|
3438
|
+
label: h(o).video.width,
|
|
3439
|
+
class: "tpl:mb-3.5",
|
|
3440
|
+
path: "width"
|
|
3441
|
+
}, {
|
|
3442
|
+
default: a(() => [y("select", {
|
|
3443
|
+
class: g(h(G)),
|
|
3444
|
+
"data-testid": "video-width-mode",
|
|
3445
|
+
value: C.value,
|
|
3446
|
+
onChange: n[5] ||= (e) => j(e.target.value)
|
|
3447
|
+
}, [
|
|
3448
|
+
y("option", Na, b(h(o).video.fullWidth), 1),
|
|
3449
|
+
n[10] ||= y("option", { value: "300" }, "300px", -1),
|
|
3450
|
+
n[11] ||= y("option", { value: "400" }, "400px", -1),
|
|
3451
|
+
n[12] ||= y("option", { value: "500" }, "500px", -1),
|
|
3452
|
+
y("option", Pa, b(h(o).video.widthCustom), 1)
|
|
3453
|
+
], 42, Ma), C.value === "custom" ? (i(), p("div", Fa, [y("input", {
|
|
3454
|
+
type: "number",
|
|
3455
|
+
"data-testid": "video-width-input",
|
|
3456
|
+
class: g(h(W)),
|
|
3457
|
+
value: e.block.width,
|
|
3458
|
+
min: "20",
|
|
3459
|
+
onInput: n[6] ||= (e) => M(e.target.value)
|
|
3460
|
+
}, null, 42, Ia), y("span", { class: g(h(U)) }, "px", 2)])) : _("", !0)]),
|
|
3461
|
+
_: 1
|
|
3462
|
+
}, 8, ["label"]),
|
|
3463
|
+
O(q, {
|
|
3464
|
+
label: h(o).video.height,
|
|
3465
|
+
class: "tpl:mb-3.5",
|
|
3466
|
+
path: "height"
|
|
3467
|
+
}, {
|
|
3468
|
+
default: a(() => [y("select", {
|
|
3469
|
+
class: g(h(G)),
|
|
3470
|
+
"data-testid": "video-height-mode",
|
|
3471
|
+
value: w.value,
|
|
3472
|
+
onChange: n[7] ||= (e) => N(e.target.value)
|
|
3473
|
+
}, [y("option", Ra, b(h(o).video.heightAuto), 1), y("option", za, b(h(o).video.heightCustom), 1)], 42, La), w.value === "custom" ? (i(), p("div", Ba, [y("input", {
|
|
3474
|
+
type: "number",
|
|
3475
|
+
"data-testid": "video-height-input",
|
|
3476
|
+
class: g(h(W)),
|
|
3477
|
+
value: e.block.height,
|
|
3478
|
+
min: "20",
|
|
3479
|
+
onInput: n[8] ||= (e) => P(e.target.value)
|
|
3480
|
+
}, null, 42, Va), y("span", { class: g(h(U)) }, "px", 2)])) : _("", !0)]),
|
|
3481
|
+
_: 1
|
|
3482
|
+
}, 8, ["label"]),
|
|
3483
|
+
O(q, {
|
|
3484
|
+
label: h(o).title.align,
|
|
3485
|
+
class: "tpl:mb-3.5",
|
|
3486
|
+
path: "align"
|
|
3487
|
+
}, {
|
|
3488
|
+
default: a(() => [O(Z, {
|
|
3489
|
+
options: [
|
|
3490
|
+
{
|
|
3491
|
+
value: "left",
|
|
3492
|
+
label: h(o).title.alignLeft
|
|
3493
|
+
},
|
|
3494
|
+
{
|
|
3495
|
+
value: "center",
|
|
3496
|
+
label: h(o).title.alignCenter
|
|
3497
|
+
},
|
|
3498
|
+
{
|
|
3499
|
+
value: "right",
|
|
3500
|
+
label: h(o).title.alignRight
|
|
3501
|
+
}
|
|
3502
|
+
],
|
|
3503
|
+
"model-value": e.block.align,
|
|
3504
|
+
"onUpdate:modelValue": n[9] ||= (e) => A("align", e)
|
|
3505
|
+
}, null, 8, ["options", "model-value"])]),
|
|
3506
|
+
_: 1
|
|
3507
|
+
}, 8, ["label"])
|
|
3508
|
+
], 64));
|
|
3509
|
+
}
|
|
3510
|
+
}), Ga = ["aria-label"], Ka = ["disabled", "inert"], qa = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, Ja = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, Ya = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Xa = { class: "tpl:flex tpl:gap-1" }, Za = ["title"], Qa = ["title"], $a = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, eo = /*@__PURE__*/ r({
|
|
3511
|
+
__name: "Toolbar",
|
|
3512
|
+
props: { block: {} },
|
|
3513
|
+
emits: [
|
|
3514
|
+
"update",
|
|
3515
|
+
"delete",
|
|
3516
|
+
"duplicate"
|
|
3517
|
+
],
|
|
3518
|
+
setup(e, { emit: t }) {
|
|
3519
|
+
let r = f(() => import("./CountdownToolbar-DxwYBw-d.js")), a = e, o = t, { t: s } = H(), c = st(), u = Ye(qe, "Toolbar"), d = l(Je, []), m = S(() => a.block.type), g = S(() => L(a.block)), x = S(() => {
|
|
3520
|
+
if (g.value) return d.find((e) => e.type === a.block.customType);
|
|
3521
|
+
}), C = S(() => g.value ? x.value?.name ?? a.block.customType : le(m.value, s)), w = S(() => dt(u.fonts.value, "fontFamily" in a.block ? a.block.fontFamily : void 0));
|
|
3522
|
+
function T(e) {
|
|
3523
|
+
c.value && o("update", e);
|
|
3524
|
+
}
|
|
3525
|
+
return (t, a) => (i(), p("aside", {
|
|
3526
|
+
"data-testid": "block-toolbar",
|
|
3527
|
+
"aria-label": h(s).landmarks.blockToolbar,
|
|
3528
|
+
class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
|
|
3529
|
+
}, [y("fieldset", {
|
|
3530
|
+
disabled: !h(c),
|
|
3531
|
+
inert: !h(c),
|
|
3532
|
+
class: "tpl:contents"
|
|
3533
|
+
}, [y("div", qa, [y("div", Ja, [h(lt)[m.value] ? (i(), v(n(h(lt)[m.value]), {
|
|
3534
|
+
key: 0,
|
|
3535
|
+
size: 16,
|
|
3536
|
+
"stroke-width": 1.5
|
|
3537
|
+
})) : g.value ? (i(), v(h(Te), {
|
|
3538
|
+
key: 1,
|
|
3539
|
+
size: 16,
|
|
3540
|
+
"stroke-width": 1.5
|
|
3541
|
+
})) : _("", !0), y("h3", Ya, b(C.value), 1)]), y("div", Xa, [y("button", {
|
|
3542
|
+
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:bg-[var(--tpl-bg-active)] tpl:hover:text-[var(--tpl-text)]",
|
|
3543
|
+
title: h(s).toolbar.duplicate,
|
|
3544
|
+
onClick: a[0] ||= (e) => o("duplicate")
|
|
3545
|
+
}, [O(h(Se), {
|
|
3546
|
+
size: 14,
|
|
3547
|
+
"stroke-width": 2
|
|
3548
|
+
})], 8, Za), y("button", {
|
|
3549
|
+
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
|
|
3550
|
+
title: h(s).toolbar.delete,
|
|
3551
|
+
onClick: a[1] ||= (e) => o("delete")
|
|
3552
|
+
}, [O(h(Me), {
|
|
3553
|
+
size: 14,
|
|
3554
|
+
"stroke-width": 2
|
|
3555
|
+
})], 8, Qa)])]), y("div", $a, [g.value ? (i(), v(Nr, {
|
|
3556
|
+
key: 0,
|
|
3557
|
+
block: e.block,
|
|
3558
|
+
onUpdateFieldValues: a[2] ||= (e) => o("update", { fieldValues: e }),
|
|
3559
|
+
onUpdateDataSourceFetched: a[3] ||= (e) => o("update", { dataSourceFetched: e })
|
|
3560
|
+
}, null, 8, ["block"])) : m.value === "section" ? (i(), v(Di, {
|
|
3561
|
+
key: 1,
|
|
3562
|
+
block: e.block,
|
|
3563
|
+
onUpdate: T
|
|
3564
|
+
}, null, 8, ["block"])) : m.value === "title" ? (i(), v(Oa, {
|
|
3565
|
+
key: 2,
|
|
3566
|
+
block: e.block,
|
|
3567
|
+
"font-families": w.value,
|
|
3568
|
+
onUpdate: T
|
|
3569
|
+
}, null, 8, ["block", "font-families"])) : m.value === "paragraph" ? (i(), v(yi, {
|
|
3570
|
+
key: 3,
|
|
3571
|
+
block: e.block,
|
|
3572
|
+
onUpdate: T
|
|
3573
|
+
}, null, 8, ["block"])) : m.value === "image" ? (i(), v(ai, {
|
|
3574
|
+
key: 4,
|
|
3575
|
+
block: e.block,
|
|
3576
|
+
onUpdate: T
|
|
3577
|
+
}, null, 8, ["block"])) : m.value === "video" ? (i(), v(Wa, {
|
|
3578
|
+
key: 5,
|
|
3579
|
+
block: e.block,
|
|
3580
|
+
onUpdate: T
|
|
3581
|
+
}, null, 8, ["block"])) : m.value === "button" ? (i(), v(zt, {
|
|
3582
|
+
key: 6,
|
|
3583
|
+
block: e.block,
|
|
3584
|
+
"font-families": w.value,
|
|
3585
|
+
onUpdate: T
|
|
3586
|
+
}, null, 8, ["block", "font-families"])) : m.value === "divider" ? (i(), v(Ir, {
|
|
3587
|
+
key: 7,
|
|
3588
|
+
block: e.block,
|
|
3589
|
+
onUpdate: T
|
|
3590
|
+
}, null, 8, ["block"])) : m.value === "social" ? (i(), v(qi, {
|
|
3591
|
+
key: 8,
|
|
3592
|
+
block: e.block,
|
|
3593
|
+
onUpdate: T
|
|
3594
|
+
}, null, 8, ["block"])) : m.value === "menu" ? (i(), v(gi, {
|
|
3595
|
+
key: 9,
|
|
3596
|
+
block: e.block,
|
|
3597
|
+
"font-families": w.value,
|
|
3598
|
+
onUpdate: T
|
|
3599
|
+
}, null, 8, ["block", "font-families"])) : m.value === "table" ? (i(), v(ya, {
|
|
3600
|
+
key: 10,
|
|
3601
|
+
block: e.block,
|
|
3602
|
+
"font-families": w.value,
|
|
3603
|
+
onUpdate: T
|
|
3604
|
+
}, null, 8, ["block", "font-families"])) : m.value === "spacer" ? (i(), v(Zi, {
|
|
3605
|
+
key: 11,
|
|
3606
|
+
block: e.block,
|
|
3607
|
+
onUpdate: T
|
|
3608
|
+
}, null, 8, ["block"])) : m.value === "html" ? (i(), v(zr, {
|
|
3609
|
+
key: 12,
|
|
3610
|
+
block: e.block,
|
|
3611
|
+
onUpdate: T
|
|
3612
|
+
}, null, 8, ["block"])) : m.value === "countdown" ? (i(), v(h(r), {
|
|
3613
|
+
key: 13,
|
|
3614
|
+
block: e.block,
|
|
3615
|
+
"font-families": w.value,
|
|
3616
|
+
onUpdate: T
|
|
3617
|
+
}, null, 8, ["block", "font-families"])) : _("", !0), O(Jn, {
|
|
3618
|
+
block: e.block,
|
|
3619
|
+
"is-first-section": m.value === "paragraph",
|
|
3620
|
+
onUpdate: T
|
|
3621
|
+
}, null, 8, ["block", "is-first-section"])])], 8, Ka)], 8, Ga));
|
|
3622
|
+
}
|
|
3623
|
+
}), to = /* @__PURE__ */ e({ default: () => no }), no = /*#__PURE__*/ B(eo, [["__scopeId", "data-v-206f038f"]]);
|
|
3624
|
+
export { no as default, _t as n, Z as r, to as t };
|
|
3625
|
+
|
|
3626
|
+
//# sourceMappingURL=Toolbar-BJKpJ2Mg.js.map
|