@templatical/editor 0.52.1 → 0.54.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-9ySsXOTU.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
- package/dist/AiChatPanel-C8SeEJRP.js +561 -0
- package/dist/{AiPanels-DqT4PgQ0.js → AiPanels-CR6zphjP.js} +6 -6
- package/dist/{AiRewriteMenu-28agTycW.js → AiRewriteMenu-CIHUnPud.js} +76 -105
- package/dist/BlockIssueBadge-DaPTq1RE.js +33 -0
- package/dist/BlockPreviewCanvas-B70RSavL.js +140 -0
- package/dist/{CloudHeaderExtras-QI82yF54.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
- package/dist/{CloudPanels-BKJaLkUN.js → CloudPanels-VpSQiLLL.js} +53 -53
- package/dist/CollaborationNotices-Cnx0XHzZ.js +65 -0
- package/dist/{CollaboratorBar-CXQqN3VP.js → CollaboratorBar-BaBoNhwB.js} +24 -24
- package/dist/CommentsPanel-Ck3QmqiC.js +16 -0
- package/dist/CommentsSidebar-CHknhOar.js +526 -0
- package/dist/{CountdownBlock-CU2yTWtF.js → CountdownBlock-BMezkFbJ.js} +15 -15
- package/dist/CountdownToolbar-CM4XNEuO.js +258 -0
- package/dist/IssuesPanel-1wGV0wiy.js +371 -0
- package/dist/LanguageMenu-d2GlX67r.js +403 -0
- package/dist/{LoadingTrack-DM4g6j7b.js → LoadingTrack-BG8cg9xi.js} +2 -2
- package/dist/LocaleNotices-WzsYtBRs.js +46 -0
- package/dist/LogicTagInsertButton-DgTJ6Lvx.js +1096 -0
- package/dist/{MediaEditModal-Dy08GEwE.js → MediaEditModal-C3U9Mi31.js} +451 -451
- package/dist/{MediaPanels-BgEp7iCp.js → MediaPanels-CGmk9ufe.js} +4 -4
- package/dist/{MergeTagInput-B9dtUthD.js → MergeTagInput-B_51YcQO.js} +30 -30
- package/dist/{MergeTagModeToggle-DxujhYJ4.js → MergeTagModeToggle-D3Q2z317.js} +49 -49
- package/dist/MergeTagTextarea-DZz1L9DE.js +126 -0
- package/dist/ParagraphEditor-CI68PYDL.js +825 -0
- package/dist/{RestoreVersionDialog-C4s_JYCx.js → RestoreVersionDialog-DcuhpOIz.js} +23 -23
- package/dist/{RichTextEditorContent-o6HmE8GR.js → RichTextEditorContent-Dstovi0m.js} +47 -47
- package/dist/{SaveBlockDialog-CWLrly6l.js → SaveBlockDialog-vuwvoi-d.js} +86 -86
- package/dist/{cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js → SavedBlocksBrowserModal-DUJm0dOv.js} +135 -132
- package/dist/{SavedBlocksPanels-BE1N9rNZ.js → SavedBlocksPanels-BiMXQ5lY.js} +9 -9
- package/dist/{SavedBlocksPickBar-Dwl94xhP.js → SavedBlocksPickBar-CAstZfG7.js} +15 -15
- package/dist/TemplateSettings-Baar78_s.js +294 -0
- package/dist/TestEmailModal-Bl_GHdrN.js +212 -0
- package/dist/{TestEmailPanel-DaFjP9QK.js → TestEmailPanel-CpTBF7B5.js} +4 -4
- package/dist/TitleEditor-DkbEDAZB.js +202 -0
- package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
- package/dist/Toolbar-bOZ_eq7X.js +3711 -0
- package/dist/{TplModal-DLMssVlt.js → TplModal-wk2gLa7_.js} +17 -17
- package/dist/{VersionHistoryMenu-BkbYUs0Q.js → VersionHistoryMenu-BnP0EyLl.js} +39 -39
- package/dist/{VersionHistoryPanels-DP7HaYWv.js → VersionHistoryPanels-Cq2rFKIX.js} +5 -5
- package/dist/VersionPreviewBanner-BPP939cD.js +37 -0
- package/dist/WrapperBlock-cWT_nZgQ.js +44 -0
- package/dist/{blockTypeIcons-BHjlPnPf.js → blockTypeIcons-BUyPZ7Su.js} +7 -7
- 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-Cnc_kUmb.js +107 -0
- package/dist/cdn/chunks/AiAltTextPopover-Cnc_kUmb.js.map +1 -0
- package/dist/cdn/chunks/{AiAltTextReview-BGLLSKLm.js → AiAltTextReview-DPeSY-7r.js} +70 -68
- package/dist/cdn/chunks/AiAltTextReview-DPeSY-7r.js.map +1 -0
- package/dist/cdn/chunks/AiChatPanel-By8Uo1nH.js +487 -0
- package/dist/cdn/chunks/AiChatPanel-By8Uo1nH.js.map +1 -0
- package/dist/cdn/chunks/{AiPanels-0wBarZSH.js → AiPanels-BblCSkQy.js} +11 -11
- package/dist/cdn/chunks/{AiPanels-0wBarZSH.js.map → AiPanels-BblCSkQy.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-qf-cfEpy.js → AiRewriteMenu-C4btyN4W.js} +79 -79
- package/dist/cdn/chunks/AiRewriteMenu-C4btyN4W.js.map +1 -0
- package/dist/cdn/chunks/BlockIssueBadge-D3Plo_wt.js +34 -0
- package/dist/cdn/chunks/BlockIssueBadge-D3Plo_wt.js.map +1 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-CTKmBPsq.js +142 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-DGBh6mqe.js.map → BlockPreviewCanvas-CTKmBPsq.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js → CloudHeaderExtras-BtqdN777.js} +4 -4
- package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js → CloudPanels-COU26R83.js} +45 -45
- package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js.map → CloudPanels-COU26R83.js.map} +1 -1
- package/dist/cdn/chunks/CollaborationNotices-DraFUhyo.js +67 -0
- package/dist/cdn/chunks/CollaborationNotices-DraFUhyo.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js → CollaboratorBar-0OEH3hrj.js} +17 -17
- package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js.map → CollaboratorBar-0OEH3hrj.js.map} +1 -1
- package/dist/cdn/chunks/CommentsPanel-tZZswofV.js +18 -0
- package/dist/cdn/chunks/{CommentsPanel-DoJnKLXI.js.map → CommentsPanel-tZZswofV.js.map} +1 -1
- package/dist/cdn/chunks/CommentsSidebar-7Hfl3Hdj.js +496 -0
- package/dist/cdn/chunks/CommentsSidebar-7Hfl3Hdj.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js → CountdownBlock-CjMhMhnv.js} +22 -22
- package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-CNgsNL5-.js +260 -0
- package/dist/cdn/chunks/CountdownToolbar-CNgsNL5-.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-C7LfxaAY.js → IssuesPanel-Duic0mIs.js} +133 -121
- package/dist/cdn/chunks/IssuesPanel-Duic0mIs.js.map +1 -0
- package/dist/cdn/chunks/LanguageMenu-B1Aue_lf.js +359 -0
- package/dist/cdn/chunks/LanguageMenu-B1Aue_lf.js.map +1 -0
- package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js → LoadingTrack-DUYcDHOV.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
- package/dist/cdn/chunks/LocaleNotices-8J2DRWeg.js +47 -0
- package/dist/cdn/chunks/LocaleNotices-8J2DRWeg.js.map +1 -0
- package/dist/{LogicTagInsertButton-CfscnwCn.js → cdn/chunks/LogicTagInsertButton-Bhvi0nWz.js} +422 -449
- package/dist/cdn/chunks/LogicTagInsertButton-Bhvi0nWz.js.map +1 -0
- package/dist/cdn/chunks/{MediaEditModal-Cpcod6_U.js → MediaEditModal-Dz972UFx.js} +421 -421
- package/dist/cdn/chunks/MediaEditModal-Dz972UFx.js.map +1 -0
- package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js → MediaPanels-C6Hqtp1H.js} +5 -5
- package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js.map → MediaPanels-C6Hqtp1H.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js → MergeTagInput-CrhZm-AW.js} +28 -28
- package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js.map → MergeTagInput-CrhZm-AW.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BgKEVUtV.js → MergeTagModeToggle-CWVtXLYa.js} +52 -52
- package/dist/cdn/chunks/MergeTagModeToggle-CWVtXLYa.js.map +1 -0
- package/dist/cdn/chunks/MergeTagTextarea-hTIBwX0F.js +128 -0
- package/dist/cdn/chunks/MergeTagTextarea-hTIBwX0F.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-B2UU1Q5I.js +660 -0
- package/dist/cdn/chunks/ParagraphEditor-B2UU1Q5I.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js → RestoreVersionDialog-C1Y5Ewo_.js} +22 -22
- package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js.map → RestoreVersionDialog-C1Y5Ewo_.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js → RichTextEditorContent-up4AqL7D.js} +44 -44
- package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js.map → RichTextEditorContent-up4AqL7D.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js → SaveBlockDialog-B9lwEP_T.js} +77 -77
- package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js.map → SaveBlockDialog-B9lwEP_T.js.map} +1 -1
- package/dist/{SavedBlocksBrowserModal-CE8n4EBS.js → cdn/chunks/SavedBlocksBrowserModal-fAeHUyxb.js} +103 -106
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BPYcRoGa.js.map → SavedBlocksBrowserModal-fAeHUyxb.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js → SavedBlocksPanels-DRDTLDyZ.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js.map → SavedBlocksPanels-DRDTLDyZ.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js → SavedBlocksPickBar-B6b5z-o3.js} +16 -16
- package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js.map → SavedBlocksPickBar-B6b5z-o3.js.map} +1 -1
- package/dist/cdn/chunks/TemplateSettings-CWUpUKJb.js +266 -0
- package/dist/cdn/chunks/TemplateSettings-CWUpUKJb.js.map +1 -0
- package/dist/cdn/chunks/TestEmailModal-DQxnW5Q5.js +212 -0
- package/dist/cdn/chunks/TestEmailModal-DQxnW5Q5.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js → TestEmailPanel-BcO_-16H.js} +5 -5
- package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js.map → TestEmailPanel-BcO_-16H.js.map} +1 -1
- package/dist/cdn/chunks/TitleEditor-pmycpmTd.js +202 -0
- package/dist/cdn/chunks/TitleEditor-pmycpmTd.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-BlWVQRcA.js +3626 -0
- package/dist/cdn/chunks/Toolbar-BlWVQRcA.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js → TplModal-ClSSGX7a.js} +20 -20
- package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js.map → TplModal-ClSSGX7a.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js → VersionHistoryMenu-CZury5gU.js} +33 -33
- package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js.map → VersionHistoryMenu-CZury5gU.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js → VersionHistoryPanels-B8GPBKMq.js} +6 -6
- package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js.map → VersionHistoryPanels-B8GPBKMq.js.map} +1 -1
- package/dist/cdn/chunks/VersionPreviewBanner-C4Ji8nu4.js +39 -0
- package/dist/cdn/chunks/VersionPreviewBanner-C4Ji8nu4.js.map +1 -0
- package/dist/cdn/chunks/WrapperBlock-BoUflYwY.js +46 -0
- package/dist/cdn/chunks/WrapperBlock-BoUflYwY.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js → blockTypeIcons-Cc6RJ27V.js} +5 -5
- package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js.map → blockTypeIcons-Cc6RJ27V.js.map} +1 -1
- 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-C1KU4ZHw.js +3039 -0
- package/dist/cdn/chunks/composables-C1KU4ZHw.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-Cth2JCEh.js → createCloudRuntime-C2Zs5F1O.js} +75 -73
- package/dist/cdn/chunks/createCloudRuntime-C2Zs5F1O.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/cdn/chunks/{dist-8ym3y-pH.js → dist-BzXULHvI.js} +48 -48
- package/dist/cdn/chunks/{dist-8ym3y-pH.js.map → dist-BzXULHvI.js.map} +1 -1
- package/dist/cdn/chunks/{dist-BMzNabtD.js → dist-DqGgijFI.js} +114 -114
- package/dist/cdn/chunks/{dist-BMzNabtD.js.map → dist-DqGgijFI.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-Du8AUMFT.js → draggable-DepKdldn.js} +1491 -1486
- package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-CyCe560f.js → editor-modal-erQEOHZN.js} +781 -781
- package/dist/cdn/chunks/{editor-modal-CyCe560f.js.map → editor-modal-erQEOHZN.js.map} +1 -1
- package/dist/cdn/chunks/en-B6tLGRHq.js +1 -0
- package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
- package/dist/cdn/chunks/en-C0pHHMiR.js.map +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-CFF2KWy-.js → extensions-DcMKZpzh.js} +59 -59
- package/dist/cdn/chunks/{extensions-CFF2KWy-.js.map → extensions-DcMKZpzh.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-okSPsLOa.js → icons-Da9GKjPx.js} +188 -147
- package/dist/cdn/chunks/icons-Da9GKjPx.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/{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-cC32Ox6A.js +290 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.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/{preRenderCustomBlocks--_xc0XK3.js → cdn/chunks/preRenderCustomBlocks-f7GEKdvw.js} +5 -3
- package/dist/cdn/chunks/{preRenderCustomBlocks-BcXIz7oJ.js.map → preRenderCustomBlocks-f7GEKdvw.js.map} +1 -1
- package/dist/{pt-BR-dDlTwX18.js → cdn/chunks/pt-BR-CY5Ye7eP.js} +116 -0
- package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
- package/dist/cdn/chunks/sanitizeHtml-WTfz9lZd.js +61 -0
- package/dist/cdn/chunks/sanitizeHtml-WTfz9lZd.js.map +1 -0
- package/dist/cdn/chunks/socialIcons-DeCYorUT.js +2638 -0
- package/dist/cdn/chunks/socialIcons-DeCYorUT.js.map +1 -0
- package/dist/cdn/chunks/{src-DEd87i_U.js → src-A_cKeTM_.js} +618 -461
- package/dist/cdn/chunks/src-A_cKeTM_.js.map +1 -0
- package/dist/cdn/chunks/src-BQUv2CYU.js +2606 -0
- package/dist/cdn/chunks/src-BQUv2CYU.js.map +1 -0
- package/dist/cdn/chunks/src-BWX_xVxO.js +671 -0
- package/dist/cdn/chunks/src-BWX_xVxO.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-CbiTlECY.js → tiptap-Dipw_zOQ.js} +40 -40
- package/dist/cdn/chunks/{tiptap-CbiTlECY.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js → useCloudI18n-Cc5NZqiI.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
- package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-vjZJwKrV.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-D8pY4LTq.js → useI18n-BnJYydPv.js} +3 -3
- package/dist/cdn/chunks/{useI18n-D8pY4LTq.js.map → useI18n-BnJYydPv.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-aGfnO90D.js +33 -0
- package/dist/cdn/chunks/useLocalizedDisplay-aGfnO90D.js.map +1 -0
- package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js → useLogicTag-DtYe8HIq.js} +5 -5
- package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js.map → useLogicTag-DtYe8HIq.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js → useMergeTag-B8ULmsnp.js} +6 -6
- package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js.map → useMergeTag-B8ULmsnp.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-vjQ0fe-L.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
- package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
- package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js → withCurrentFont-MK8ga9q9.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js.map → withCurrentFont-MK8ga9q9.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +2189 -1495
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-BZ8o0eet.js → check-XMnOOIEC.js} +1 -1
- package/dist/{chevron-down-DfAAfILv.js → chevron-down-DmamTEWQ.js} +1 -1
- package/dist/{chevron-right-Bk4mGdr7.js → chevron-right-BEFXOH27.js} +1 -1
- package/dist/{chevron-up-MhUf_azW.js → chevron-up-Dw7woXj8.js} +1 -1
- package/dist/{circle-alert-CShJwVFv.js → circle-alert-BTKC9vkq.js} +1 -1
- package/dist/{clock-CTfD6OCt.js → clock-BVT5u2uG.js} +1 -1
- package/dist/composables-CMIrGXJ1.js +4517 -0
- package/dist/{createCloudRuntime-DCgO4A1r.js → createCloudRuntime-DGV5a5Af.js} +54 -52
- package/dist/{createLucideIcon-CvhTA2KG.js → createLucideIcon-CgDE3xAR.js} +16 -16
- package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
- package/dist/{dist-ByCWA2Tv.js → dist-0alKVRc_.js} +101 -101
- 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/{dist-CVy-7PHQ.js → dist-CX7skkvG.js} +48 -48
- 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-D6cMdrfG.js → dist-fqSers8_.js} +55 -55
- package/dist/{editor-modal-zaZHcmlO.js → editor-modal-BeX6otLk.js} +953 -952
- package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
- package/dist/en-Do0SU6tR.js +1 -0
- package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
- package/dist/{extensions-fo_c-vqf.js → extensions-BJ184osp.js} +173 -173
- package/dist/{eye-7W4t5e0Q.js → eye-ByMgHeA_.js} +1 -1
- package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
- package/dist/{image-BDiRFzSd.js → image-Ch8tR35K.js} +1 -1
- package/dist/index.d.ts +182 -14
- package/dist/{info-Cxi3-Kh9.js → info-DzSD-Wpk.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-ju_2Cmir.js → link-oDn9AR2w.js} +1 -1
- package/dist/{list-DYZJf0aZ.js → list-C5t07dp8.js} +1 -1
- package/dist/{loader-circle-BZRD0a4I.js → loader-circle-k6xvKgUB.js} +1 -1
- package/dist/{message-circle-DuEw4Zfx.js → message-circle-C23R6OJR.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-CePMr2kK.js → package-C90eQ7NU.js} +1 -1
- package/dist/{pencil-D3aFCL7c.js → pencil-BK7GrQuA.js} +1 -1
- package/dist/plural-CyxrJXL1.js +15 -0
- package/dist/plus-Cr0Mis63.js +13 -0
- package/dist/{cdn/chunks/preRenderCustomBlocks-BcXIz7oJ.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -6
- package/dist/{cdn/chunks/pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -2
- package/dist/{refresh-cw-xnro7_Sk.js → refresh-cw-_ZLOIEvA.js} +2 -12
- package/dist/rotate-ccw-CB5wsHwv.js +13 -0
- package/dist/{runtime-dom.esm-bundler-BURR-bj5.js → runtime-dom.esm-bundler-DlHp8xgy.js} +154 -154
- package/dist/sanitizeHtml-2rjV0r-6.js +962 -0
- package/dist/{search-CDrstRBv.js → search-BmrQNox8.js} +1 -1
- package/dist/{send-DROkPOaX.js → send-blAsIBBg.js} +1 -1
- package/dist/{smartphone-Bx6u_tjn.js → smartphone-BPpWYrwV.js} +1 -1
- package/dist/socialIcons-TFiOkpoU.js +2705 -0
- package/dist/{sparkles-CdaTtvoz.js → sparkles-OqIxrNp-.js} +1 -1
- package/dist/{square-BbCROH_f.js → square-BP-V7iT-.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 +2438 -1752
- package/dist/{text-align-start-CGacJ9Vw.js → text-align-start-4mwX2o-F.js} +13 -13
- package/dist/{trash-DxCd7zIy.js → trash-B99WixTA.js} +1 -1
- package/dist/{triangle-alert-7_oaitpf.js → triangle-alert-CHMiDkHa.js} +1 -1
- package/dist/{upload-DuFEOi_0.js → upload-Cp8o-hrN.js} +1 -1
- package/dist/{useCloudI18n-DEMmUKuO.js → useCloudI18n-Dh2iydo1.js} +4 -4
- package/dist/useEditorRoot-DY3mgcHm.js +7 -0
- package/dist/{useI18n-BBrHTdu8.js → useI18n-CgtvtF4C.js} +4 -4
- package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
- package/dist/{useLogicTag-ZPC39rfH.js → useLogicTag-BXXXQQmi.js} +4 -4
- package/dist/{useMergeTag-BQ4qqWpQ.js → useMergeTag-C9Okr87y.js} +5 -5
- package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
- package/dist/{useScrollToBlock-BSyAV4pk.js → useScrollToBlock-B35ObCGK.js} +5 -5
- package/dist/{vue.runtime.esm-bundler-CnEeTfhs.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1373 -1368
- package/dist/withCurrentFont-DJiQqZzL.js +18 -0
- package/dist/{x-BpfG7v9g.js → x-BIBStNMS.js} +1 -1
- package/package.json +21 -21
- package/dist/AiAltTextPopover-DawbUywc.js +0 -105
- package/dist/AiChatPanel-CupPhmsN.js +0 -548
- package/dist/BlockIssueBadge-BxpDy3u-.js +0 -33
- package/dist/BlockPreviewCanvas-B-4bmJ3t.js +0 -140
- package/dist/CollaborationNotices-CTw4JThq.js +0 -75
- package/dist/CommentsPanel-DwwFuh1h.js +0 -16
- package/dist/CommentsSidebar-9ZfiC2DO.js +0 -500
- package/dist/CountdownToolbar-BqoYzf_6.js +0 -197
- package/dist/IssuesPanel-4ykrf1ax.js +0 -359
- package/dist/MergeTagTextarea-CPFEjJZd.js +0 -69
- package/dist/ParagraphEditor-CWXfurGh.js +0 -796
- package/dist/TemplateSettings-CS0f1Ues.js +0 -236
- package/dist/TestEmailModal-DBD0X5nV.js +0 -209
- package/dist/TitleEditor-DSqtle77.js +0 -198
- package/dist/ToggleSwitch-JykPyD_8.js +0 -36
- package/dist/Toolbar-BZPFfKrf.js +0 -3145
- package/dist/VersionPreviewBanner-DECaBwLq.js +0 -37
- package/dist/WrapperBlock-BsJv_Fiw.js +0 -44
- package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js +0 -106
- package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js.map +0 -1
- package/dist/cdn/chunks/AiAltTextReview-BGLLSKLm.js.map +0 -1
- package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js +0 -474
- package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js.map +0 -1
- package/dist/cdn/chunks/AiRewriteMenu-qf-cfEpy.js.map +0 -1
- package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +0 -34
- package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +0 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-DGBh6mqe.js +0 -142
- package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js +0 -77
- package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js.map +0 -1
- package/dist/cdn/chunks/CommentsPanel-DoJnKLXI.js +0 -18
- package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js +0 -470
- package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js +0 -199
- package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-C7LfxaAY.js.map +0 -1
- package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js +0 -1051
- package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js.map +0 -1
- package/dist/cdn/chunks/MediaEditModal-Cpcod6_U.js.map +0 -1
- package/dist/cdn/chunks/MergeTagModeToggle-BgKEVUtV.js.map +0 -1
- package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js +0 -71
- package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js +0 -631
- package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +0 -1
- package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js +0 -208
- package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js +0 -209
- package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js +0 -198
- package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +0 -1
- package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js +0 -38
- package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-CdpsvNOR.js +0 -3061
- package/dist/cdn/chunks/Toolbar-CdpsvNOR.js.map +0 -1
- package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js +0 -39
- package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js +0 -46
- package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js.map +0 -1
- package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-Cth2JCEh.js.map +0 -1
- package/dist/cdn/chunks/de-CeFJ6wbM.js.map +0 -1
- package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +0 -1
- package/dist/cdn/chunks/en-D14i5nFh.js.map +0 -1
- package/dist/cdn/chunks/en-TIqv4ag3.js +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-okSPsLOa.js.map +0 -1
- package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
- package/dist/cdn/chunks/keys-CUj6UA38.js +0 -11
- package/dist/cdn/chunks/keys-CUj6UA38.js.map +0 -1
- package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js +0 -198
- package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
- package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js +0 -72
- package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-jsTDmkbb.js +0 -2008
- package/dist/cdn/chunks/socialIcons-jsTDmkbb.js.map +0 -1
- package/dist/cdn/chunks/src-C7bkofBL.js +0 -647
- package/dist/cdn/chunks/src-C7bkofBL.js.map +0 -1
- package/dist/cdn/chunks/src-DEd87i_U.js.map +0 -1
- package/dist/cdn/chunks/src-DwWrYnUj.js +0 -1404
- package/dist/cdn/chunks/src-DwWrYnUj.js.map +0 -1
- package/dist/cdn/chunks/styleConstants-B8xVRiwX.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +0 -2582
- package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +0 -9
- package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js +0 -70
- package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js.map +0 -1
- package/dist/cdn/chunks/useScrollToBlock-vjQ0fe-L.js.map +0 -1
- package/dist/dist-CKi_npZM.js +0 -1344
- package/dist/dist-DyFArF_G.js +0 -4
- package/dist/dist-pA3ooG6N.js +0 -4
- package/dist/en-Db76vJbY.js +0 -1
- package/dist/keys-BgRERHzu.js +0 -9
- package/dist/normalizeMergeTagMarkup-CELnOlgK.js +0 -196
- package/dist/sanitizeHtml-BzfzpYJY.js +0 -942
- package/dist/socialIcons-D7MGsg0d.js +0 -2075
- package/dist/useEditorCore-BSo2sSID.js +0 -4059
- package/dist/useEditorRoot-BMcoCLBx.js +0 -7
- package/dist/usePopoverPosition-DV1PxL66.js +0 -68
- package/dist/withCurrentFont-B22FXAF5.js +0 -18
|
@@ -1,1051 +0,0 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, I as r, J as i, P as a, T as o, W as s, Y as c, Z as l, _ as u, b as d, c as f, dt as p, et as m, f as h, ft as g, g as _, h as v, l as y, m as b, n as x, p as S, r as C, st as w, u as T, ut as E, x as D } from "./draggable-Du8AUMFT.js";
|
|
2
|
-
import { c as O, i as k, s as A, u as j } from "./src-DwWrYnUj.js";
|
|
3
|
-
import { t as ee } from "./dist-BMzNabtD.js";
|
|
4
|
-
import { J as te, Y as M, Z as ne, d as re } from "./keys-CUj6UA38.js";
|
|
5
|
-
import { t as N } from "./useI18n-D8pY4LTq.js";
|
|
6
|
-
import { a as P, i as ie, n as ae, o as oe, r as se, t as ce } from "./usePopoverPosition-DSMtmu2W.js";
|
|
7
|
-
import { G as le, N as F, Vt as I, t as L } from "./icons-okSPsLOa.js";
|
|
8
|
-
import { t as R } from "./useMergeTag-B-aG--s1.js";
|
|
9
|
-
import { t as ue } from "./useLogicTag-DBJDtpKA.js";
|
|
10
|
-
import { u as de } from "./styleConstants-B8xVRiwX.js";
|
|
11
|
-
// ../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/math.js
|
|
12
|
-
var z = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, B = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n, V = (e) => me(H(e)), H = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
13
|
-
r: parseInt(e[0] + e[0], 16),
|
|
14
|
-
g: parseInt(e[1] + e[1], 16),
|
|
15
|
-
b: parseInt(e[2] + e[2], 16),
|
|
16
|
-
a: e.length === 4 ? B(parseInt(e[3] + e[3], 16) / 255, 2) : 1
|
|
17
|
-
} : {
|
|
18
|
-
r: parseInt(e.substring(0, 2), 16),
|
|
19
|
-
g: parseInt(e.substring(2, 4), 16),
|
|
20
|
-
b: parseInt(e.substring(4, 6), 16),
|
|
21
|
-
a: e.length === 8 ? B(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
22
|
-
}), fe = (e) => pe(G(e)), U = ({ h: e, s: t, v: n, a: r }) => {
|
|
23
|
-
let i = (200 - t) * n / 100;
|
|
24
|
-
return {
|
|
25
|
-
h: B(e),
|
|
26
|
-
s: B(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
27
|
-
l: B(i / 2),
|
|
28
|
-
a: B(r, 2)
|
|
29
|
-
};
|
|
30
|
-
}, W = (e) => {
|
|
31
|
-
let { h: t, s: n, l: r } = U(e);
|
|
32
|
-
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
33
|
-
}, G = ({ h: e, s: t, v: n, a: r }) => {
|
|
34
|
-
e = e / 360 * 6, t /= 100, n /= 100;
|
|
35
|
-
let i = Math.floor(e), a = n * (1 - t), o = n * (1 - (e - i) * t), s = n * (1 - (1 - e + i) * t), c = i % 6;
|
|
36
|
-
return {
|
|
37
|
-
r: B([
|
|
38
|
-
n,
|
|
39
|
-
o,
|
|
40
|
-
a,
|
|
41
|
-
a,
|
|
42
|
-
s,
|
|
43
|
-
n
|
|
44
|
-
][c] * 255),
|
|
45
|
-
g: B([
|
|
46
|
-
s,
|
|
47
|
-
n,
|
|
48
|
-
n,
|
|
49
|
-
o,
|
|
50
|
-
a,
|
|
51
|
-
a
|
|
52
|
-
][c] * 255),
|
|
53
|
-
b: B([
|
|
54
|
-
a,
|
|
55
|
-
a,
|
|
56
|
-
s,
|
|
57
|
-
n,
|
|
58
|
-
n,
|
|
59
|
-
o
|
|
60
|
-
][c] * 255),
|
|
61
|
-
a: B(r, 2)
|
|
62
|
-
};
|
|
63
|
-
}, K = (e) => {
|
|
64
|
-
let t = e.toString(16);
|
|
65
|
-
return t.length < 2 ? "0" + t : t;
|
|
66
|
-
}, pe = ({ r: e, g: t, b: n, a: r }) => {
|
|
67
|
-
let i = r < 1 ? K(B(r * 255)) : "";
|
|
68
|
-
return "#" + K(e) + K(t) + K(n) + i;
|
|
69
|
-
}, me = ({ r: e, g: t, b: n, a: r }) => {
|
|
70
|
-
let i = Math.max(e, t, n), a = i - Math.min(e, t, n), o = a ? i === e ? (t - n) / a : i === t ? 2 + (n - e) / a : 4 + (e - t) / a : 0;
|
|
71
|
-
return {
|
|
72
|
-
h: B(60 * (o < 0 ? o + 6 : o)),
|
|
73
|
-
s: B(i ? a / i * 100 : 0),
|
|
74
|
-
v: B(i / 255 * 100),
|
|
75
|
-
a: r
|
|
76
|
-
};
|
|
77
|
-
}, q = (e, t) => {
|
|
78
|
-
if (e === t) return !0;
|
|
79
|
-
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
80
|
-
return !0;
|
|
81
|
-
}, he = (e, t) => e.toLowerCase() === t.toLowerCase() || q(H(e), H(t)), ge = {}, J = (e) => {
|
|
82
|
-
let t = ge[e];
|
|
83
|
-
return t || (t = document.createElement("template"), t.innerHTML = e, ge[e] = t), t;
|
|
84
|
-
}, Y = (e, t, n) => {
|
|
85
|
-
e.dispatchEvent(new CustomEvent(t, {
|
|
86
|
-
bubbles: !0,
|
|
87
|
-
detail: n
|
|
88
|
-
}));
|
|
89
|
-
}, X = !1, Z = (e) => "touches" in e, _e = (e) => X && !Z(e) ? !1 : (X ||= Z(e), !0), ve = (e, t) => {
|
|
90
|
-
let n = Z(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
91
|
-
Y(e.el, "move", e.getMove({
|
|
92
|
-
x: z((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
93
|
-
y: z((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
94
|
-
}));
|
|
95
|
-
}, ye = (e, t) => {
|
|
96
|
-
let n = t.keyCode;
|
|
97
|
-
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), Y(e.el, "move", e.getMove({
|
|
98
|
-
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
99
|
-
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
100
|
-
}, !0)));
|
|
101
|
-
}, Q = class {
|
|
102
|
-
constructor(e, t, n, r) {
|
|
103
|
-
let i = J(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
104
|
-
e.appendChild(i.content.cloneNode(!0));
|
|
105
|
-
let a = e.querySelector(`[part=${t}]`);
|
|
106
|
-
a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
|
|
107
|
-
}
|
|
108
|
-
set dragging(e) {
|
|
109
|
-
let t = e ? document.addEventListener : document.removeEventListener;
|
|
110
|
-
t(X ? "touchmove" : "mousemove", this), t(X ? "touchend" : "mouseup", this);
|
|
111
|
-
}
|
|
112
|
-
handleEvent(e) {
|
|
113
|
-
switch (e.type) {
|
|
114
|
-
case "mousedown":
|
|
115
|
-
case "touchstart":
|
|
116
|
-
if (e.preventDefault(), !_e(e) || !X && e.button != 0) return;
|
|
117
|
-
this.el.focus(), ve(this, e), this.dragging = !0;
|
|
118
|
-
break;
|
|
119
|
-
case "mousemove":
|
|
120
|
-
case "touchmove":
|
|
121
|
-
e.preventDefault(), ve(this, e);
|
|
122
|
-
break;
|
|
123
|
-
case "mouseup":
|
|
124
|
-
case "touchend":
|
|
125
|
-
this.dragging = !1;
|
|
126
|
-
break;
|
|
127
|
-
case "keydown": ye(this, e);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
style(e) {
|
|
131
|
-
e.forEach((e, t) => {
|
|
132
|
-
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}, be = class extends Q {
|
|
136
|
-
constructor(e) {
|
|
137
|
-
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
138
|
-
}
|
|
139
|
-
update({ h: e }) {
|
|
140
|
-
this.h = e, this.style([{
|
|
141
|
-
left: `${e / 360 * 100}%`,
|
|
142
|
-
color: W({
|
|
143
|
-
h: e,
|
|
144
|
-
s: 100,
|
|
145
|
-
v: 100,
|
|
146
|
-
a: 1
|
|
147
|
-
})
|
|
148
|
-
}]), this.el.setAttribute("aria-valuenow", `${B(e)}`);
|
|
149
|
-
}
|
|
150
|
-
getMove(e, t) {
|
|
151
|
-
return { h: t ? z(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
152
|
-
}
|
|
153
|
-
}, xe = class extends Q {
|
|
154
|
-
constructor(e) {
|
|
155
|
-
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
156
|
-
}
|
|
157
|
-
update(e) {
|
|
158
|
-
this.hsva = e, this.style([{
|
|
159
|
-
top: `${100 - e.v}%`,
|
|
160
|
-
left: `${e.s}%`,
|
|
161
|
-
color: W(e)
|
|
162
|
-
}, { "background-color": W({
|
|
163
|
-
h: e.h,
|
|
164
|
-
s: 100,
|
|
165
|
-
v: 100,
|
|
166
|
-
a: 1
|
|
167
|
-
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${B(e.s)}%, Brightness ${B(e.v)}%`);
|
|
168
|
-
}
|
|
169
|
-
getMove(e, t) {
|
|
170
|
-
return {
|
|
171
|
-
s: t ? z(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
172
|
-
v: t ? z(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}, Se = ":host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}", Ce = "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", we = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", $ = Symbol("same"), Te = Symbol("color"), Ee = Symbol("hsva"), De = Symbol("update"), Oe = Symbol("parts"), ke = Symbol("css"), Ae = Symbol("sliders"), je = class extends HTMLElement {
|
|
176
|
-
static get observedAttributes() {
|
|
177
|
-
return ["color"];
|
|
178
|
-
}
|
|
179
|
-
get [ke]() {
|
|
180
|
-
return [
|
|
181
|
-
Se,
|
|
182
|
-
Ce,
|
|
183
|
-
we
|
|
184
|
-
];
|
|
185
|
-
}
|
|
186
|
-
get [Ae]() {
|
|
187
|
-
return [xe, be];
|
|
188
|
-
}
|
|
189
|
-
get color() {
|
|
190
|
-
return this[Te];
|
|
191
|
-
}
|
|
192
|
-
set color(e) {
|
|
193
|
-
if (!this[$](e)) {
|
|
194
|
-
let t = this.colorModel.toHsva(e);
|
|
195
|
-
this[De](t), this[Te] = e;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
constructor() {
|
|
199
|
-
super();
|
|
200
|
-
let e = J(`<style>${this[ke].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
201
|
-
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[Oe] = this[Ae].map((e) => new e(t));
|
|
202
|
-
}
|
|
203
|
-
connectedCallback() {
|
|
204
|
-
if (this.hasOwnProperty("color")) {
|
|
205
|
-
let e = this.color;
|
|
206
|
-
delete this.color, this.color = e;
|
|
207
|
-
} else this.color ||= this.colorModel.defaultColor;
|
|
208
|
-
}
|
|
209
|
-
attributeChangedCallback(e, t, n) {
|
|
210
|
-
let r = this.colorModel.fromAttr(n);
|
|
211
|
-
this[$](r) || (this.color = r);
|
|
212
|
-
}
|
|
213
|
-
handleEvent(e) {
|
|
214
|
-
let t = this[Ee], n = {
|
|
215
|
-
...t,
|
|
216
|
-
...e.detail
|
|
217
|
-
};
|
|
218
|
-
this[De](n);
|
|
219
|
-
let r;
|
|
220
|
-
!q(n, t) && !this[$](r = this.colorModel.fromHsva(n)) && (this[Te] = r, Y(this, "color-changed", { value: r }));
|
|
221
|
-
}
|
|
222
|
-
[$](e) {
|
|
223
|
-
return this.color && this.colorModel.equal(e, this.color);
|
|
224
|
-
}
|
|
225
|
-
[De](e) {
|
|
226
|
-
this[Ee] = e, this[Oe].forEach((t) => t.update(e));
|
|
227
|
-
}
|
|
228
|
-
}, Me = {
|
|
229
|
-
defaultColor: "#000",
|
|
230
|
-
toHsva: V,
|
|
231
|
-
fromHsva: ({ h: e, s: t, v: n }) => fe({
|
|
232
|
-
h: e,
|
|
233
|
-
s: t,
|
|
234
|
-
v: n,
|
|
235
|
-
a: 1
|
|
236
|
-
}),
|
|
237
|
-
equal: he,
|
|
238
|
-
fromAttr: (e) => e
|
|
239
|
-
}, Ne = class extends je {
|
|
240
|
-
get colorModel() {
|
|
241
|
-
return Me;
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
customElements.define("hex-color-picker", class extends Ne {});
|
|
245
|
-
// src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
246
|
-
var Pe = [
|
|
247
|
-
"disabled",
|
|
248
|
-
"aria-label",
|
|
249
|
-
"title",
|
|
250
|
-
"aria-expanded"
|
|
251
|
-
], Fe = {
|
|
252
|
-
key: 0,
|
|
253
|
-
class: "tpl:relative tpl:flex-1"
|
|
254
|
-
}, Ie = [
|
|
255
|
-
"value",
|
|
256
|
-
"placeholder",
|
|
257
|
-
"disabled",
|
|
258
|
-
"aria-label"
|
|
259
|
-
], Le = ["aria-label", "title"], Re = ["data-tpl-theme"], ze = [
|
|
260
|
-
"aria-pressed",
|
|
261
|
-
"aria-label",
|
|
262
|
-
"title"
|
|
263
|
-
], Be = ["aria-label"], Ve = [
|
|
264
|
-
"aria-label",
|
|
265
|
-
"title",
|
|
266
|
-
"aria-checked",
|
|
267
|
-
"tabindex"
|
|
268
|
-
], He = [
|
|
269
|
-
"aria-label",
|
|
270
|
-
"title",
|
|
271
|
-
"aria-checked",
|
|
272
|
-
"tabindex",
|
|
273
|
-
"onClick"
|
|
274
|
-
], Ue = ["color", "aria-label"], We = {
|
|
275
|
-
key: 3,
|
|
276
|
-
class: "tpl:relative tpl:mt-2"
|
|
277
|
-
}, Ge = [
|
|
278
|
-
"value",
|
|
279
|
-
"placeholder",
|
|
280
|
-
"disabled",
|
|
281
|
-
"aria-label"
|
|
282
|
-
], Ke = ["aria-label", "title"], qe = /* @__PURE__ */ t({
|
|
283
|
-
__name: "ColorPicker",
|
|
284
|
-
props: {
|
|
285
|
-
modelValue: {},
|
|
286
|
-
placeholder: { default: "" },
|
|
287
|
-
seedColor: { default: "#ffffff" },
|
|
288
|
-
swatchOnly: {
|
|
289
|
-
type: Boolean,
|
|
290
|
-
default: !1
|
|
291
|
-
},
|
|
292
|
-
disabled: {
|
|
293
|
-
type: Boolean,
|
|
294
|
-
default: !1
|
|
295
|
-
},
|
|
296
|
-
size: { default: "md" },
|
|
297
|
-
ariaLabel: { default: "" },
|
|
298
|
-
presets: { default: void 0 },
|
|
299
|
-
allowCustom: {
|
|
300
|
-
type: Boolean,
|
|
301
|
-
default: void 0
|
|
302
|
-
},
|
|
303
|
-
allowTransparent: {
|
|
304
|
-
type: Boolean,
|
|
305
|
-
default: !1
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
emits: ["update:modelValue"],
|
|
309
|
-
setup(e, { emit: t }) {
|
|
310
|
-
let i = e, o = t, { t: c } = N(), l = m(!1), C = m(), O = m(), k = m(!1);
|
|
311
|
-
ee(C, () => {
|
|
312
|
-
l.value = !1;
|
|
313
|
-
}, { ignore: [O] });
|
|
314
|
-
let A = S(() => !i.modelValue), j = S(() => i.modelValue.trim().toLowerCase() === "transparent"), M = S(() => ie(i.modelValue)), le = S(() => (i.modelValue ? P(i.modelValue) : null) || (P(i.seedColor) ?? "#ffffff")), F = S(() => !i.disabled && !A.value), I = n(re, oe), R = S(() => [...new Set(i.presets ?? I.presets)]), ue = S(() => i.allowCustom ?? I.allowCustom), z = S(() => R.value.length > 0), B = S(() => ue.value || !z.value), V = S(() => se(i.modelValue));
|
|
315
|
-
function H(e) {
|
|
316
|
-
return V.value !== "" && se(e) === V.value;
|
|
317
|
-
}
|
|
318
|
-
function fe(e) {
|
|
319
|
-
o("update:modelValue", e);
|
|
320
|
-
}
|
|
321
|
-
let U = S(() => z.value && !B.value);
|
|
322
|
-
function W(e) {
|
|
323
|
-
return U.value ? e + 1 : e;
|
|
324
|
-
}
|
|
325
|
-
let G = S(() => {
|
|
326
|
-
if (U.value && A.value) return 0;
|
|
327
|
-
let e = R.value.findIndex((e) => H(e));
|
|
328
|
-
return e === -1 ? 0 : W(e);
|
|
329
|
-
});
|
|
330
|
-
function K() {
|
|
331
|
-
return G.value === 0 ? 0 : -1;
|
|
332
|
-
}
|
|
333
|
-
function pe(e) {
|
|
334
|
-
return W(e) === G.value ? 0 : -1;
|
|
335
|
-
}
|
|
336
|
-
function me(e) {
|
|
337
|
-
if (![
|
|
338
|
-
"ArrowRight",
|
|
339
|
-
"ArrowDown",
|
|
340
|
-
"ArrowLeft",
|
|
341
|
-
"ArrowUp"
|
|
342
|
-
].includes(e.key)) return;
|
|
343
|
-
let t = Array.from(e.currentTarget.querySelectorAll("[role=\"radio\"]")), n = e.target.closest("[role=\"radio\"]"), r = n ? t.indexOf(n) : -1;
|
|
344
|
-
r !== -1 && (t[(r + (e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus(), e.preventDefault());
|
|
345
|
-
}
|
|
346
|
-
function q(e) {
|
|
347
|
-
k.value = !0, o("update:modelValue", e.detail.value);
|
|
348
|
-
}
|
|
349
|
-
function he() {
|
|
350
|
-
k.value = !1;
|
|
351
|
-
}
|
|
352
|
-
function ge() {
|
|
353
|
-
!k.value && A.value && o("update:modelValue", le.value);
|
|
354
|
-
}
|
|
355
|
-
function J(e) {
|
|
356
|
-
o("update:modelValue", e.target.value);
|
|
357
|
-
}
|
|
358
|
-
function Y() {
|
|
359
|
-
o("update:modelValue", "");
|
|
360
|
-
}
|
|
361
|
-
function X() {
|
|
362
|
-
o("update:modelValue", "transparent");
|
|
363
|
-
}
|
|
364
|
-
let Z = ae(), { toLocal: _e } = ce(), ve = n(te, null), ye = n(ne, null), Q = m({
|
|
365
|
-
top: 0,
|
|
366
|
-
left: 0
|
|
367
|
-
});
|
|
368
|
-
function be() {
|
|
369
|
-
if (!i.disabled) {
|
|
370
|
-
if (!l.value) {
|
|
371
|
-
let e = O.value?.getBoundingClientRect();
|
|
372
|
-
if (e) {
|
|
373
|
-
let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
|
|
374
|
-
Q.value = _e({
|
|
375
|
-
top: t,
|
|
376
|
-
left: e.left
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
l.value = !l.value;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
return (t, n) => (a(), u("div", { class: E(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", e.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
|
|
384
|
-
b("button", {
|
|
385
|
-
ref_key: "swatchRef",
|
|
386
|
-
ref: O,
|
|
387
|
-
type: "button",
|
|
388
|
-
disabled: e.disabled,
|
|
389
|
-
"aria-label": e.ariaLabel || w(c).colorPicker.pickColor,
|
|
390
|
-
title: e.ariaLabel || void 0,
|
|
391
|
-
"aria-expanded": l.value,
|
|
392
|
-
class: E([
|
|
393
|
-
"tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
394
|
-
e.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
395
|
-
l.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !e.disabled && "tpl:hover:border-[var(--tpl-text-dim)]",
|
|
396
|
-
e.size === "sm" ? "tpl:size-8" : "tpl:size-10"
|
|
397
|
-
]),
|
|
398
|
-
onClick: be
|
|
399
|
-
}, [b("span", {
|
|
400
|
-
class: E(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", {
|
|
401
|
-
"tpl-color-swatch-empty": A.value,
|
|
402
|
-
"tpl-color-swatch-transparent": j.value
|
|
403
|
-
}]),
|
|
404
|
-
style: p(A.value || j.value ? void 0 : { backgroundColor: M.value })
|
|
405
|
-
}, null, 6)], 10, Pe),
|
|
406
|
-
!e.swatchOnly && B.value ? (a(), u("div", Fe, [b("input", {
|
|
407
|
-
type: "text",
|
|
408
|
-
class: E([w(de), "tpl:w-full"]),
|
|
409
|
-
style: p(F.value ? { paddingRight: "2.25rem" } : void 0),
|
|
410
|
-
value: M.value,
|
|
411
|
-
placeholder: e.placeholder || w(c).colorPicker.notSet,
|
|
412
|
-
disabled: e.disabled,
|
|
413
|
-
"aria-label": w(c).colorPicker.hexValue,
|
|
414
|
-
onInput: J
|
|
415
|
-
}, null, 46, Ie), F.value ? (a(), u("button", {
|
|
416
|
-
key: 0,
|
|
417
|
-
type: "button",
|
|
418
|
-
"aria-label": w(c).colorPicker.clear,
|
|
419
|
-
title: w(c).colorPicker.clear,
|
|
420
|
-
class: "tpl:absolute tpl:right-2 tpl:top-1/2 tpl:flex tpl:size-6 tpl:-translate-y-1/2 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-dim)] tpl:transition-colors 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)]",
|
|
421
|
-
onClick: Y
|
|
422
|
-
}, [D(w(L), {
|
|
423
|
-
size: 14,
|
|
424
|
-
"stroke-width": 1.5
|
|
425
|
-
})], 8, Le)) : _("", !0)])) : _("", !0),
|
|
426
|
-
(a(), v(h, {
|
|
427
|
-
to: w(Z),
|
|
428
|
-
disabled: !w(Z)
|
|
429
|
-
}, [D(x, {
|
|
430
|
-
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
431
|
-
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
432
|
-
"enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
433
|
-
"leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
434
|
-
"leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
435
|
-
"leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
|
|
436
|
-
}, {
|
|
437
|
-
default: s(() => [l.value ? (a(), u("div", {
|
|
438
|
-
key: 0,
|
|
439
|
-
ref_key: "popoverRef",
|
|
440
|
-
ref: C,
|
|
441
|
-
"data-tpl-theme": w(ye),
|
|
442
|
-
class: "tpl-color-popover tpl:absolute tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3 tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
443
|
-
style: p({
|
|
444
|
-
top: `${Q.value.top}px`,
|
|
445
|
-
left: `${Q.value.left}px`,
|
|
446
|
-
...w(ve)
|
|
447
|
-
})
|
|
448
|
-
}, [
|
|
449
|
-
e.allowTransparent ? (a(), u("button", {
|
|
450
|
-
key: 0,
|
|
451
|
-
type: "button",
|
|
452
|
-
"data-testid": "color-picker-transparent",
|
|
453
|
-
"aria-pressed": j.value,
|
|
454
|
-
"aria-label": w(c).colorPicker.transparent,
|
|
455
|
-
title: w(c).colorPicker.transparent,
|
|
456
|
-
class: E(["tpl:mb-2 tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:py-1 tpl:text-left tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)]", j.value ? "tpl:ring-2 tpl:ring-[var(--tpl-primary)] tpl:ring-offset-1 tpl:ring-offset-[var(--tpl-bg-elevated)]" : "tpl:hover:border-[var(--tpl-text-dim)]"]),
|
|
457
|
-
onClick: X
|
|
458
|
-
}, [n[2] ||= b("span", { class: "tpl-color-swatch-transparent tpl:size-4 tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)]" }, null, -1), d(" " + g(w(c).colorPicker.transparent), 1)], 10, ze)) : _("", !0),
|
|
459
|
-
z.value ? (a(), u("div", {
|
|
460
|
-
key: 1,
|
|
461
|
-
role: "radiogroup",
|
|
462
|
-
"aria-label": w(c).colorPicker.presetColors,
|
|
463
|
-
class: E(["tpl:flex tpl:flex-wrap tpl:gap-1.5", B.value && "tpl:mb-2"]),
|
|
464
|
-
onKeydown: me
|
|
465
|
-
}, [U.value ? (a(), u("button", {
|
|
466
|
-
key: 0,
|
|
467
|
-
type: "button",
|
|
468
|
-
role: "radio",
|
|
469
|
-
"aria-label": w(c).colorPicker.clear,
|
|
470
|
-
title: w(c).colorPicker.clear,
|
|
471
|
-
"aria-checked": A.value,
|
|
472
|
-
tabindex: K(),
|
|
473
|
-
class: E(["tpl-color-swatch-empty tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)] tpl:focus-visible:ring-offset-1 tpl:focus-visible:ring-offset-[var(--tpl-bg-elevated)]", A.value ? "tpl:ring-2 tpl:ring-[var(--tpl-primary)] tpl:ring-offset-1 tpl:ring-offset-[var(--tpl-bg-elevated)]" : "tpl:hover:border-[var(--tpl-text-dim)]"]),
|
|
474
|
-
onClick: Y
|
|
475
|
-
}, null, 10, Ve)) : _("", !0), (a(!0), u(T, null, r(R.value, (e, t) => (a(), u("button", {
|
|
476
|
-
key: e,
|
|
477
|
-
type: "button",
|
|
478
|
-
role: "radio",
|
|
479
|
-
"aria-label": e,
|
|
480
|
-
title: e,
|
|
481
|
-
"aria-checked": H(e),
|
|
482
|
-
tabindex: pe(t),
|
|
483
|
-
style: p({ backgroundColor: e }),
|
|
484
|
-
class: E(["tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)] tpl:focus-visible:ring-offset-1 tpl:focus-visible:ring-offset-[var(--tpl-bg-elevated)]", H(e) ? "tpl:ring-2 tpl:ring-[var(--tpl-primary)] tpl:ring-offset-1 tpl:ring-offset-[var(--tpl-bg-elevated)]" : "tpl:hover:border-[var(--tpl-text-dim)]"]),
|
|
485
|
-
onClick: (t) => fe(e)
|
|
486
|
-
}, null, 14, He))), 128))], 42, Be)) : _("", !0),
|
|
487
|
-
B.value ? (a(), u("hex-color-picker", {
|
|
488
|
-
key: 2,
|
|
489
|
-
color: le.value,
|
|
490
|
-
"aria-label": w(c).colorPicker.pickColor,
|
|
491
|
-
onColorChanged: q,
|
|
492
|
-
onPointerdown: he,
|
|
493
|
-
onPointerup: ge,
|
|
494
|
-
onKeydown: n[0] ||= f((e) => l.value = !1, ["escape"])
|
|
495
|
-
}, null, 40, Ue)) : _("", !0),
|
|
496
|
-
e.swatchOnly && B.value ? (a(), u("div", We, [b("input", {
|
|
497
|
-
type: "text",
|
|
498
|
-
class: E([w(de), "tpl:w-full"]),
|
|
499
|
-
style: p(F.value ? { paddingRight: "2.25rem" } : void 0),
|
|
500
|
-
value: M.value,
|
|
501
|
-
placeholder: e.placeholder || w(c).colorPicker.notSet,
|
|
502
|
-
disabled: e.disabled,
|
|
503
|
-
"aria-label": w(c).colorPicker.hexValue,
|
|
504
|
-
onChange: J,
|
|
505
|
-
onKeydown: n[1] ||= f(y((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
506
|
-
}, null, 46, Ge), F.value ? (a(), u("button", {
|
|
507
|
-
key: 0,
|
|
508
|
-
type: "button",
|
|
509
|
-
"aria-label": w(c).colorPicker.clear,
|
|
510
|
-
title: w(c).colorPicker.clear,
|
|
511
|
-
class: "tpl:absolute tpl:right-2 tpl:top-1/2 tpl:flex tpl:size-6 tpl:-translate-y-1/2 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-dim)] tpl:transition-colors 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)]",
|
|
512
|
-
onClick: Y
|
|
513
|
-
}, [D(w(L), {
|
|
514
|
-
size: 14,
|
|
515
|
-
"stroke-width": 1.5
|
|
516
|
-
})], 8, Ke)) : _("", !0)])) : _("", !0)
|
|
517
|
-
], 12, Re)) : _("", !0)]),
|
|
518
|
-
_: 1
|
|
519
|
-
})], 8, ["to", "disabled"]))
|
|
520
|
-
], 2));
|
|
521
|
-
}
|
|
522
|
-
}), Je = ["id"], Ye = {
|
|
523
|
-
key: 0,
|
|
524
|
-
class: "tpl:px-3 tpl:py-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
525
|
-
"data-testid": "merge-tag-suggestion-empty"
|
|
526
|
-
}, Xe = [
|
|
527
|
-
"id",
|
|
528
|
-
"aria-selected",
|
|
529
|
-
"data-selected",
|
|
530
|
-
"data-merge-tag-value",
|
|
531
|
-
"onMousedown",
|
|
532
|
-
"onMousemove"
|
|
533
|
-
], Ze = { class: "tpl:font-medium" }, Qe = { class: "tpl:text-[var(--tpl-text-dim)] tpl:font-mono" }, $e = /* @__PURE__ */ t({
|
|
534
|
-
__name: "MergeTagSuggestionList",
|
|
535
|
-
props: {
|
|
536
|
-
items: {},
|
|
537
|
-
selectedIndex: {},
|
|
538
|
-
emptyText: {},
|
|
539
|
-
listId: {}
|
|
540
|
-
},
|
|
541
|
-
emits: ["select", "hover"],
|
|
542
|
-
setup(e) {
|
|
543
|
-
let t = e;
|
|
544
|
-
function n(e) {
|
|
545
|
-
return t.listId ? `${t.listId}-opt-${e}` : void 0;
|
|
546
|
-
}
|
|
547
|
-
return (t, i) => (a(), u("div", {
|
|
548
|
-
id: e.listId,
|
|
549
|
-
class: "tpl:min-w-[200px] tpl:max-w-[320px] tpl:max-h-[50vh] tpl:overflow-y-auto tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:py-1 tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
550
|
-
role: "listbox",
|
|
551
|
-
"data-testid": "merge-tag-suggestion-list"
|
|
552
|
-
}, [e.items.length === 0 ? (a(), u("div", Ye, g(e.emptyText), 1)) : _("", !0), (a(!0), u(T, null, r(e.items, (r, i) => (a(), u("button", {
|
|
553
|
-
key: r.value,
|
|
554
|
-
id: n(i),
|
|
555
|
-
type: "button",
|
|
556
|
-
role: "option",
|
|
557
|
-
"aria-selected": i === e.selectedIndex,
|
|
558
|
-
"data-selected": i === e.selectedIndex ? "true" : "false",
|
|
559
|
-
"data-merge-tag-value": r.value,
|
|
560
|
-
class: E(["tpl:flex tpl:w-full tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors", i === e.selectedIndex ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
|
|
561
|
-
onMousedown: y((e) => t.$emit("select", r), ["prevent", "stop"]),
|
|
562
|
-
onMousemove: (n) => i !== e.selectedIndex && t.$emit("hover", i)
|
|
563
|
-
}, [b("span", Ze, g(r.label), 1), b("span", Qe, g(r.value), 1)], 42, Xe))), 128))], 8, Je));
|
|
564
|
-
}
|
|
565
|
-
}), et = 10, tt = 0;
|
|
566
|
-
function nt(e, t) {
|
|
567
|
-
let n = t.trim().toLowerCase();
|
|
568
|
-
return n === "" ? e.slice(0, et) : e.filter((e) => {
|
|
569
|
-
let t = e.label.toLowerCase(), r = e.value.toLowerCase();
|
|
570
|
-
return t.includes(n) || r.includes(n);
|
|
571
|
-
}).slice(0, et);
|
|
572
|
-
}
|
|
573
|
-
function rt(e, t, n, r) {
|
|
574
|
-
return t.length === 0 ? e.key === "Enter" || e.key === "Tab" : e.key === "ArrowDown" ? (n.value = (n.value + 1) % t.length, !0) : e.key === "ArrowUp" ? (n.value = (n.value - 1 + t.length) % t.length, !0) : e.key === "Enter" || e.key === "Tab" ? (r(t[n.value]), !0) : !1;
|
|
575
|
-
}
|
|
576
|
-
function it(e, t) {
|
|
577
|
-
let n = null, r = null, i = null, a = m([]), s = m(0), c = null, l = `tpl-merge-tag-suggestion-${++tt}`, u = null, d = [], f = null;
|
|
578
|
-
function p() {
|
|
579
|
-
y(u?.() ?? null);
|
|
580
|
-
}
|
|
581
|
-
function h() {
|
|
582
|
-
p(), f !== null && cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
583
|
-
f = null, p();
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
function g(e) {
|
|
587
|
-
let t = [], n = e?.parentElement ?? null;
|
|
588
|
-
for (; n && n !== document.body && n !== document.documentElement;) {
|
|
589
|
-
let e = window.getComputedStyle(n), r = e.overflow + e.overflowX + e.overflowY;
|
|
590
|
-
/(auto|scroll|overlay)/.test(r) && t.push(n), n = n.parentElement;
|
|
591
|
-
}
|
|
592
|
-
return t;
|
|
593
|
-
}
|
|
594
|
-
function _(e) {
|
|
595
|
-
d = [window, ...g(e)];
|
|
596
|
-
for (let e of d) e.addEventListener("scroll", p, {
|
|
597
|
-
passive: !0,
|
|
598
|
-
capture: !0
|
|
599
|
-
});
|
|
600
|
-
window.addEventListener("resize", p, { passive: !0 });
|
|
601
|
-
}
|
|
602
|
-
function v() {
|
|
603
|
-
for (let e of d) e.removeEventListener("scroll", p, { capture: !0 });
|
|
604
|
-
window.removeEventListener("resize", p), d = [];
|
|
605
|
-
}
|
|
606
|
-
function y(e) {
|
|
607
|
-
if (!r || !e || e.bottom < 0 || e.top > window.innerHeight) return;
|
|
608
|
-
r.style.position = "absolute", r.style.zIndex = "9999";
|
|
609
|
-
let t = r.offsetParent?.getBoundingClientRect(), n = t?.top ?? 0;
|
|
610
|
-
r.style.left = `${e.left - (t?.left ?? 0)}px`, r.style.top = `${e.bottom - n}px`;
|
|
611
|
-
let i = r.offsetHeight;
|
|
612
|
-
if (i !== 0 && window.innerHeight - e.bottom < i) {
|
|
613
|
-
let t = Math.max(0, e.top - i);
|
|
614
|
-
r.style.top = `${t - n}px`;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
function b(e, t) {
|
|
618
|
-
let n = t?.closest("[data-tpl-theme]");
|
|
619
|
-
if (!n) return;
|
|
620
|
-
let r = n.getAttribute("data-tpl-theme");
|
|
621
|
-
r && e.setAttribute("data-tpl-theme", r);
|
|
622
|
-
let i = window.getComputedStyle(n);
|
|
623
|
-
for (let t = 0; t < i.length; t++) {
|
|
624
|
-
let n = i[t];
|
|
625
|
-
n.startsWith("--tpl-") && e.style.setProperty(n, i.getPropertyValue(n));
|
|
626
|
-
}
|
|
627
|
-
e.style.fontFamily = i.fontFamily, e.style.fontSize = i.fontSize, e.style.lineHeight = i.lineHeight;
|
|
628
|
-
}
|
|
629
|
-
function x(e) {
|
|
630
|
-
i && (e ? (i.setAttribute("role", "combobox"), i.setAttribute("aria-haspopup", "listbox"), i.setAttribute("aria-expanded", "true"), i.setAttribute("aria-controls", l)) : (i.removeAttribute("aria-expanded"), i.removeAttribute("aria-controls"), i.removeAttribute("aria-activedescendant"), i.removeAttribute("aria-haspopup"), i.removeAttribute("role")));
|
|
631
|
-
}
|
|
632
|
-
function S() {
|
|
633
|
-
i && (a.value.length === 0 ? i.removeAttribute("aria-activedescendant") : i.setAttribute("aria-activedescendant", `${l}-opt-${s.value}`));
|
|
634
|
-
}
|
|
635
|
-
function w(e) {
|
|
636
|
-
c?.(e);
|
|
637
|
-
}
|
|
638
|
-
return {
|
|
639
|
-
open: ({ items: d, getRect: f, anchorEl: p, onCommand: m }) => {
|
|
640
|
-
a.value = d, s.value = 0, c = m, r = document.createElement("div"), r.setAttribute("data-testid", "merge-tag-suggestion-popup"), i = p, b(r, p), (t?.value ?? document.body).appendChild(r), n = C({ render() {
|
|
641
|
-
return o($e, {
|
|
642
|
-
items: a.value,
|
|
643
|
-
selectedIndex: s.value,
|
|
644
|
-
emptyText: e,
|
|
645
|
-
listId: l,
|
|
646
|
-
onSelect: (e) => w(e),
|
|
647
|
-
onHover: (e) => {
|
|
648
|
-
s.value = e, S();
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
} }), n.mount(r), x(!0), S(), u = f, h(), _(p);
|
|
652
|
-
},
|
|
653
|
-
update: ({ items: e, getRect: t, onCommand: n }) => {
|
|
654
|
-
a.value = e, s.value >= e.length && (s.value = 0), c = n, S(), u = t, h();
|
|
655
|
-
},
|
|
656
|
-
handleKeyDown: (e) => {
|
|
657
|
-
let t = rt(e, a.value, s, w);
|
|
658
|
-
return t && S(), t;
|
|
659
|
-
},
|
|
660
|
-
close: () => {
|
|
661
|
-
r !== null && (f !== null && (cancelAnimationFrame(f), f = null), v(), x(!1), n?.unmount(), r.remove(), n = null, r = null, i = null, c = null, u = null);
|
|
662
|
-
},
|
|
663
|
-
isOpen: () => r !== null
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
// src/utils/mergeTagTrigger.ts
|
|
667
|
-
function at(e, t, n, r, i) {
|
|
668
|
-
if (!n) return null;
|
|
669
|
-
let a = e.slice(0, t), o = a.lastIndexOf(n);
|
|
670
|
-
if (o === -1 || i && o < ot(a, i)) return null;
|
|
671
|
-
let s = a.slice(o + n.length);
|
|
672
|
-
return /\s/.test(s) || r && s.includes(r) ? null : {
|
|
673
|
-
triggerStart: o,
|
|
674
|
-
caret: t,
|
|
675
|
-
query: s
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
function ot(e, t) {
|
|
679
|
-
let n = new RegExp(t.source, `${t.flags.replace(/[gy]/g, "")}g`), r = 0;
|
|
680
|
-
for (let t of e.matchAll(n)) r = t.index + t[0].length;
|
|
681
|
-
return r;
|
|
682
|
-
}
|
|
683
|
-
// src/utils/textFieldCaret.ts
|
|
684
|
-
var st = /* @__PURE__ */ "boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.borderStyle.paddingTop.paddingRight.paddingBottom.paddingLeft.fontStyle.fontVariant.fontWeight.fontStretch.fontSize.lineHeight.fontFamily.textAlign.textTransform.textIndent.letterSpacing.wordSpacing.tabSize.whiteSpace.wordWrap.wordBreak".split(".");
|
|
685
|
-
function ct(e, t, n) {
|
|
686
|
-
return {
|
|
687
|
-
left: e,
|
|
688
|
-
top: t,
|
|
689
|
-
bottom: n,
|
|
690
|
-
right: e,
|
|
691
|
-
width: 0,
|
|
692
|
-
height: n - t,
|
|
693
|
-
x: e,
|
|
694
|
-
y: t,
|
|
695
|
-
toJSON: () => ({})
|
|
696
|
-
};
|
|
697
|
-
}
|
|
698
|
-
function lt(e, t) {
|
|
699
|
-
let n = e.ownerDocument, r = n.defaultView;
|
|
700
|
-
if (!r) return null;
|
|
701
|
-
let i = e.tagName === "INPUT", a = r.getComputedStyle(e), o = n.createElement("div");
|
|
702
|
-
o.setAttribute("aria-hidden", "true");
|
|
703
|
-
let s = o.style;
|
|
704
|
-
s.position = "absolute", s.visibility = "hidden", s.top = "0", s.left = "0", s.overflow = "hidden", s.whiteSpace = i ? "pre" : "pre-wrap", s.wordWrap = i ? "normal" : "break-word";
|
|
705
|
-
let c = s, l = a;
|
|
706
|
-
for (let e of st) c[e] = l[e];
|
|
707
|
-
i && (s.width = "auto", s.whiteSpace = "pre");
|
|
708
|
-
let u = e.value, d = u.slice(0, t);
|
|
709
|
-
i && (d = d.replace(/\s/g, "\xA0")), o.textContent = d;
|
|
710
|
-
let f = n.createElement("span");
|
|
711
|
-
f.textContent = u.slice(t) || ".", o.appendChild(f), n.body.appendChild(o);
|
|
712
|
-
let p = f.offsetTop, m = f.offsetLeft;
|
|
713
|
-
n.body.removeChild(o);
|
|
714
|
-
let h = e.getBoundingClientRect(), g = parseFloat(a.borderTopWidth) || 0, _ = parseFloat(a.borderLeftWidth) || 0, v = parseFloat(a.lineHeight) || parseFloat(a.fontSize) || 0, y = h.left + m + _ - e.scrollLeft;
|
|
715
|
-
if (i) return ct(y, h.top, h.bottom);
|
|
716
|
-
let b = h.top + p + g - e.scrollTop;
|
|
717
|
-
return ct(y, b, b + v);
|
|
718
|
-
}
|
|
719
|
-
// src/composables/useMergeTagAutocomplete.ts
|
|
720
|
-
var ut = /* @__PURE__ */ new Set([
|
|
721
|
-
"ArrowLeft",
|
|
722
|
-
"ArrowRight",
|
|
723
|
-
"Home",
|
|
724
|
-
"End"
|
|
725
|
-
]);
|
|
726
|
-
function dt(t) {
|
|
727
|
-
let { elementRef: r, modelValue: a, emit: o, mergeTags: s, syntax: u, enabled: d, onInsert: f } = t, p = O(u), m = A(u), h = S(() => d && p !== null && s.value.length > 0), g = n(M, null), _ = it((c(g) ? g.value : g)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", ae()), v = !1;
|
|
728
|
-
i() && l(() => {
|
|
729
|
-
v = !0, _.close();
|
|
730
|
-
});
|
|
731
|
-
function y(e) {
|
|
732
|
-
let t = e.value ?? "";
|
|
733
|
-
return at(t, e.selectionStart ?? t.length, p, m, u.value);
|
|
734
|
-
}
|
|
735
|
-
function b(t, n, i) {
|
|
736
|
-
let s = t.value ?? a(), c = s.slice(n.caret), l = m && c.startsWith(m) ? m.length : 0, u = s.slice(0, n.triggerStart), d = s.slice(n.caret + l), p = u + i.value + d, h = u.length + i.value.length;
|
|
737
|
-
f?.(), o(p), _.close(), e(() => {
|
|
738
|
-
if (v) return;
|
|
739
|
-
let e = r.value;
|
|
740
|
-
e?.focus(), e?.setSelectionRange(h, h);
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
function x() {
|
|
744
|
-
if (!h.value || v) return;
|
|
745
|
-
let e = r.value;
|
|
746
|
-
if (!e) {
|
|
747
|
-
_.close();
|
|
748
|
-
return;
|
|
749
|
-
}
|
|
750
|
-
let t = y(e);
|
|
751
|
-
if (!t) {
|
|
752
|
-
_.close();
|
|
753
|
-
return;
|
|
754
|
-
}
|
|
755
|
-
let n = nt(s.value, t.query), i = () => lt(e, t.triggerStart), a = (n) => b(e, t, n);
|
|
756
|
-
_.isOpen() ? _.update({
|
|
757
|
-
items: n,
|
|
758
|
-
getRect: i,
|
|
759
|
-
onCommand: a
|
|
760
|
-
}) : _.open({
|
|
761
|
-
items: n,
|
|
762
|
-
getRect: i,
|
|
763
|
-
anchorEl: e,
|
|
764
|
-
onCommand: a
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
function C(e) {
|
|
768
|
-
return _.isOpen() ? e.key === "Escape" ? (_.close(), !0) : ut.has(e.key) ? (_.close(), !1) : _.handleKeyDown(e) : !1;
|
|
769
|
-
}
|
|
770
|
-
return {
|
|
771
|
-
available: h,
|
|
772
|
-
refresh: x,
|
|
773
|
-
handleKeydown: C,
|
|
774
|
-
close: () => _.close(),
|
|
775
|
-
isOpen: () => _.isOpen()
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
// src/composables/useMergeTagField.ts
|
|
779
|
-
function ft(t) {
|
|
780
|
-
let { modelValue: n, emit: r, elementRef: a } = t, { mergeTags: o, canRequestMergeTag: s, isRequesting: c, isMergeTagValue: u, getMergeTagDisplayLabel: d, findMergeTag: f, requestMergeTag: p, syntax: h, autocomplete: g } = R(), { canInsertLogicTag: _, isRequesting: v, requestLogicTag: y } = ue(), b = m(!1), x = !1, C = !1;
|
|
781
|
-
i() && l(() => {
|
|
782
|
-
C = !0;
|
|
783
|
-
});
|
|
784
|
-
let w = dt({
|
|
785
|
-
elementRef: a,
|
|
786
|
-
modelValue: n,
|
|
787
|
-
emit: r,
|
|
788
|
-
mergeTags: o,
|
|
789
|
-
syntax: h,
|
|
790
|
-
enabled: g,
|
|
791
|
-
onInsert: () => {
|
|
792
|
-
b.value = !0;
|
|
793
|
-
}
|
|
794
|
-
}), T = S(() => {
|
|
795
|
-
let e = n();
|
|
796
|
-
if (!e) return [];
|
|
797
|
-
let t = [], r = `(${h.value.source}|${h.logic.source})`, i = new RegExp(r, "g"), a = 0, o;
|
|
798
|
-
for (; (o = i.exec(e)) !== null;) {
|
|
799
|
-
o.index > a && t.push({
|
|
800
|
-
type: "text",
|
|
801
|
-
value: e.slice(a, o.index)
|
|
802
|
-
});
|
|
803
|
-
let n = o[0];
|
|
804
|
-
u(n) ? t.push({
|
|
805
|
-
type: "mergeTag",
|
|
806
|
-
value: n,
|
|
807
|
-
label: d(n)
|
|
808
|
-
}) : j(n, h) ? t.push({
|
|
809
|
-
type: "logicMergeTag",
|
|
810
|
-
value: n,
|
|
811
|
-
keyword: k(n, h)
|
|
812
|
-
}) : t.push({
|
|
813
|
-
type: "text",
|
|
814
|
-
value: n
|
|
815
|
-
}), a = o.index + n.length;
|
|
816
|
-
}
|
|
817
|
-
return a < e.length && t.push({
|
|
818
|
-
type: "text",
|
|
819
|
-
value: e.slice(a)
|
|
820
|
-
}), t;
|
|
821
|
-
}), E = S(() => T.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
|
|
822
|
-
function D() {
|
|
823
|
-
b.value = !0, e(() => {
|
|
824
|
-
a.value?.focus();
|
|
825
|
-
let e = n()?.length || 0;
|
|
826
|
-
a.value?.setSelectionRange(e, e);
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
function O() {
|
|
830
|
-
x || (b.value = !1);
|
|
831
|
-
}
|
|
832
|
-
function A(e) {
|
|
833
|
-
r(e.target.value), w.refresh();
|
|
834
|
-
}
|
|
835
|
-
function ee(e) {
|
|
836
|
-
return w.handleKeydown(e) ? (e.preventDefault(), !0) : (e.key === "Escape" && O(), !1);
|
|
837
|
-
}
|
|
838
|
-
function te() {
|
|
839
|
-
w.refresh();
|
|
840
|
-
}
|
|
841
|
-
function M() {
|
|
842
|
-
w.close(), O();
|
|
843
|
-
}
|
|
844
|
-
function ne() {
|
|
845
|
-
r("");
|
|
846
|
-
}
|
|
847
|
-
async function re() {
|
|
848
|
-
let t = b.value && a.value ? a.value.selectionStart ?? n().length : n().length;
|
|
849
|
-
x = !0;
|
|
850
|
-
let i;
|
|
851
|
-
try {
|
|
852
|
-
i = await p();
|
|
853
|
-
} finally {
|
|
854
|
-
x = !1;
|
|
855
|
-
}
|
|
856
|
-
if (!C && i) {
|
|
857
|
-
let o = n().slice(0, t), s = n().slice(t), c = o + i.value + s;
|
|
858
|
-
r(c), b.value = !0, e(() => {
|
|
859
|
-
if (C) return;
|
|
860
|
-
let e = t + i.value.length;
|
|
861
|
-
a.value?.focus(), a.value?.setSelectionRange(e, e);
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
async function N(e) {
|
|
866
|
-
let t = T.value, n = t[e];
|
|
867
|
-
if (n?.type !== "mergeTag") return;
|
|
868
|
-
x = !0;
|
|
869
|
-
let i;
|
|
870
|
-
try {
|
|
871
|
-
i = await p({
|
|
872
|
-
reason: "edit",
|
|
873
|
-
current: f(n.value)
|
|
874
|
-
});
|
|
875
|
-
} finally {
|
|
876
|
-
x = !1;
|
|
877
|
-
}
|
|
878
|
-
!C && i && r(t.map((t, n) => n === e ? i.value : t.value).join(""));
|
|
879
|
-
}
|
|
880
|
-
async function P() {
|
|
881
|
-
let t = a.value, i = t?.selectionStart ?? n().length, o = t?.selectionEnd ?? i;
|
|
882
|
-
x = !0;
|
|
883
|
-
let s;
|
|
884
|
-
try {
|
|
885
|
-
s = await y();
|
|
886
|
-
} finally {
|
|
887
|
-
x = !1;
|
|
888
|
-
}
|
|
889
|
-
if (C || !s) return;
|
|
890
|
-
let c = n(), l, u;
|
|
891
|
-
"before" in s ? (l = c.slice(0, i) + s.before + c.slice(i, o) + s.after + c.slice(o), u = i + s.before.length + (o - i)) : (l = c.slice(0, i) + s.value + c.slice(i), u = i + s.value.length), r(l), b.value = !0, e(() => {
|
|
892
|
-
C || (a.value?.focus(), a.value?.setSelectionRange(u, u));
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
return {
|
|
896
|
-
segments: T,
|
|
897
|
-
hasMergeTags: E,
|
|
898
|
-
canRequestMergeTag: s,
|
|
899
|
-
isRequestingMergeTag: c,
|
|
900
|
-
canInsertLogicTag: _,
|
|
901
|
-
isRequestingLogicTag: v,
|
|
902
|
-
isEditing: b,
|
|
903
|
-
startEditing: D,
|
|
904
|
-
stopEditing: O,
|
|
905
|
-
handleInput: A,
|
|
906
|
-
handleKeydown: ee,
|
|
907
|
-
handleClick: te,
|
|
908
|
-
handleBlur: M,
|
|
909
|
-
clearValue: ne,
|
|
910
|
-
insertMergeTag: re,
|
|
911
|
-
replaceMergeTagAt: N,
|
|
912
|
-
insertLogicTag: P,
|
|
913
|
-
autocompleteAvailable: w.available
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
// src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
|
|
917
|
-
var pt = ["aria-label"], mt = [
|
|
918
|
-
"data-tooltip",
|
|
919
|
-
"aria-label",
|
|
920
|
-
"onClick"
|
|
921
|
-
], ht = ["data-tooltip"], gt = ["data-tooltip"], _t = {
|
|
922
|
-
key: 3,
|
|
923
|
-
class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
|
|
924
|
-
}, vt = ["aria-label", "title"], yt = ["aria-label", "title"], bt = /* @__PURE__ */ t({
|
|
925
|
-
__name: "MergeTagSegments",
|
|
926
|
-
props: {
|
|
927
|
-
segments: {},
|
|
928
|
-
displayClass: {},
|
|
929
|
-
pulse: { type: Boolean }
|
|
930
|
-
},
|
|
931
|
-
emits: [
|
|
932
|
-
"edit",
|
|
933
|
-
"clear",
|
|
934
|
-
"repick"
|
|
935
|
-
],
|
|
936
|
-
setup(e, { emit: t }) {
|
|
937
|
-
let n = t, { t: i, format: o } = N(), { canRepickMergeTag: s, showRawValue: c } = R();
|
|
938
|
-
function l() {
|
|
939
|
-
n("edit");
|
|
940
|
-
}
|
|
941
|
-
return (t, d) => (a(), u("div", {
|
|
942
|
-
role: "group",
|
|
943
|
-
"aria-label": w(i).mergeTag.fieldGroup,
|
|
944
|
-
class: E([e.displayClass, { "tpl-pulse-fill": e.pulse }]),
|
|
945
|
-
onClick: l
|
|
946
|
-
}, [
|
|
947
|
-
(a(!0), u(T, null, r(e.segments, (e, t) => (a(), u(T, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" && w(s)(e.value) ? (a(), u("button", {
|
|
948
|
-
key: 0,
|
|
949
|
-
type: "button",
|
|
950
|
-
class: E(["tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded tpl:border-none tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium", w(c) ? "tpl-tooltip" : ""]),
|
|
951
|
-
"data-tooltip": w(c) ? e.value : void 0,
|
|
952
|
-
"aria-label": w(o)(w(i).mergeTag.changeTag, { label: e.label }),
|
|
953
|
-
"data-testid": "merge-tag-field-chip",
|
|
954
|
-
style: {
|
|
955
|
-
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
956
|
-
color: "var(--tpl-primary)"
|
|
957
|
-
},
|
|
958
|
-
onClick: y((e) => n("repick", t), ["stop"])
|
|
959
|
-
}, g(e.label), 11, mt)) : e.type === "mergeTag" ? (a(), u("span", {
|
|
960
|
-
key: 1,
|
|
961
|
-
class: E(["tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium", w(c) ? "tpl-tooltip" : ""]),
|
|
962
|
-
"data-tooltip": w(c) ? e.value : void 0,
|
|
963
|
-
style: {
|
|
964
|
-
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
965
|
-
color: "var(--tpl-primary)"
|
|
966
|
-
}
|
|
967
|
-
}, g(e.label), 11, ht)) : e.type === "logicMergeTag" ? (a(), u("span", {
|
|
968
|
-
key: 2,
|
|
969
|
-
class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase",
|
|
970
|
-
"data-tooltip": e.value,
|
|
971
|
-
style: {
|
|
972
|
-
"background-color": "transparent",
|
|
973
|
-
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
974
|
-
color: "var(--tpl-primary)"
|
|
975
|
-
}
|
|
976
|
-
}, g(e.keyword), 9, gt)) : (a(), u("span", _t, g(e.value), 1))], 64))), 128)),
|
|
977
|
-
b("button", {
|
|
978
|
-
type: "button",
|
|
979
|
-
class: "tpl:ml-auto tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all tpl:hover:text-[var(--tpl-primary)] tpl:hover:opacity-100",
|
|
980
|
-
"aria-label": w(i).mergeTag.editAsText,
|
|
981
|
-
title: w(i).mergeTag.editAsText,
|
|
982
|
-
"data-testid": "merge-tag-field-edit",
|
|
983
|
-
onClick: y(l, ["stop"])
|
|
984
|
-
}, [D(w(le), {
|
|
985
|
-
size: 12,
|
|
986
|
-
"stroke-width": 2
|
|
987
|
-
})], 8, vt),
|
|
988
|
-
b("button", {
|
|
989
|
-
type: "button",
|
|
990
|
-
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all tpl:hover:text-[var(--tpl-danger)] tpl:hover:opacity-100",
|
|
991
|
-
"aria-label": w(i).mergeTag.remove,
|
|
992
|
-
title: w(i).mergeTag.remove,
|
|
993
|
-
"data-testid": "merge-tag-field-clear",
|
|
994
|
-
onClick: d[0] ||= y((e) => n("clear"), ["stop"])
|
|
995
|
-
}, [D(w(L), {
|
|
996
|
-
size: 12,
|
|
997
|
-
"stroke-width": 2.5
|
|
998
|
-
})], 8, yt)
|
|
999
|
-
], 10, pt));
|
|
1000
|
-
}
|
|
1001
|
-
}), xt = [
|
|
1002
|
-
"aria-label",
|
|
1003
|
-
"title",
|
|
1004
|
-
"disabled"
|
|
1005
|
-
], St = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:hover:bg-[var(--tpl-primary-light)] tpl:hover:text-[var(--tpl-primary)] tpl:hover:border-[var(--tpl-primary)]", Ct = /* @__PURE__ */ t({
|
|
1006
|
-
__name: "MergeTagInsertButton",
|
|
1007
|
-
props: { disabled: { type: Boolean } },
|
|
1008
|
-
emits: ["insert"],
|
|
1009
|
-
setup(e) {
|
|
1010
|
-
let { t } = N();
|
|
1011
|
-
return (n, r) => (a(), u("button", {
|
|
1012
|
-
type: "button",
|
|
1013
|
-
class: E([St, "tpl:mt-1.5"]),
|
|
1014
|
-
"aria-label": w(t).mergeTag.insert,
|
|
1015
|
-
title: w(t).mergeTag.insert,
|
|
1016
|
-
disabled: e.disabled,
|
|
1017
|
-
onMousedown: r[0] ||= y(() => {}, ["prevent"]),
|
|
1018
|
-
onClick: r[1] ||= (e) => n.$emit("insert")
|
|
1019
|
-
}, [D(w(F), {
|
|
1020
|
-
size: 12,
|
|
1021
|
-
"stroke-width": 2
|
|
1022
|
-
}), d(" " + g(w(t).mergeTag.insertShort), 1)], 42, xt));
|
|
1023
|
-
}
|
|
1024
|
-
}), wt = [
|
|
1025
|
-
"aria-label",
|
|
1026
|
-
"title",
|
|
1027
|
-
"disabled"
|
|
1028
|
-
], Tt = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:hover:bg-[var(--tpl-primary-light)] tpl:hover:text-[var(--tpl-primary)] tpl:hover:border-[var(--tpl-primary)]", Et = /* @__PURE__ */ t({
|
|
1029
|
-
__name: "LogicTagInsertButton",
|
|
1030
|
-
props: { disabled: { type: Boolean } },
|
|
1031
|
-
emits: ["insert"],
|
|
1032
|
-
setup(e) {
|
|
1033
|
-
let { t } = N();
|
|
1034
|
-
return (n, r) => (a(), u("button", {
|
|
1035
|
-
type: "button",
|
|
1036
|
-
class: E([Tt, "tpl:mt-1.5"]),
|
|
1037
|
-
"aria-label": w(t).logicTag.insert,
|
|
1038
|
-
title: w(t).logicTag.insert,
|
|
1039
|
-
disabled: e.disabled,
|
|
1040
|
-
"data-testid": "field-insert-logic-button",
|
|
1041
|
-
onMousedown: r[0] ||= y(() => {}, ["prevent"]),
|
|
1042
|
-
onClick: r[1] ||= (e) => n.$emit("insert")
|
|
1043
|
-
}, [D(w(I), {
|
|
1044
|
-
size: 12,
|
|
1045
|
-
"stroke-width": 2
|
|
1046
|
-
}), d(" " + g(w(t).logicTag.insertShort), 1)], 42, wt));
|
|
1047
|
-
}
|
|
1048
|
-
});
|
|
1049
|
-
export { it as a, qe as c, ft as i, Ct as n, nt as o, bt as r, rt as s, Et as t };
|
|
1050
|
-
|
|
1051
|
-
//# sourceMappingURL=LogicTagInsertButton-BIi05UQu.js.map
|