@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
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
import { B as e, Ft as t, M as n, Mt as r, O as i, P as a, Pt as o, S as s, U as c, Y as l, Z as u, _ as d, a as f, c as p, ct as m, d as h, et as g, f as _, g as v, l as y, q as b, r as x, u as S, w as C, y as w } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
|
|
2
|
+
import { c as T, n as E, s as ee, t as D } from "./runtime-dom.esm-bundler-DlHp8xgy.js";
|
|
3
|
+
import { _t as O, dt as k, st as A, ut as j } from "./dist-Cdkm20M6.js";
|
|
4
|
+
import { t as M } from "./createLucideIcon-CgDE3xAR.js";
|
|
5
|
+
import { t as N } from "./pencil-BK7GrQuA.js";
|
|
6
|
+
import { t as P } from "./x-BIBStNMS.js";
|
|
7
|
+
import { et as te, it as ne, p as re, tt as F } from "./keys-BCqskl51.js";
|
|
8
|
+
import { t as I } from "./useI18n-CgtvtF4C.js";
|
|
9
|
+
import { d as ie } from "./styleConstants-CgiNKdnc.js";
|
|
10
|
+
import { t as ae } from "./dist-0alKVRc_.js";
|
|
11
|
+
import { t as L } from "./useMergeTag-C9Okr87y.js";
|
|
12
|
+
import { a as oe, c as se, n as ce, o as le, r as ue, s as de, t as fe } from "./usePopoverPosition-VDQjyX_A.js";
|
|
13
|
+
import { t as R } from "./useLogicTag-BXXXQQmi.js";
|
|
14
|
+
var z = M({
|
|
15
|
+
name: "braces",
|
|
16
|
+
size: 24,
|
|
17
|
+
node: [["path", {
|
|
18
|
+
d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",
|
|
19
|
+
key: "ezmyqa"
|
|
20
|
+
}], ["path", {
|
|
21
|
+
d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
|
|
22
|
+
key: "e1hn23"
|
|
23
|
+
}]],
|
|
24
|
+
aliases: ["curly-braces"]
|
|
25
|
+
}), B = M({
|
|
26
|
+
name: "scan-line",
|
|
27
|
+
size: 24,
|
|
28
|
+
node: [
|
|
29
|
+
["path", {
|
|
30
|
+
d: "M3 7V5a2 2 0 0 1 2-2h2",
|
|
31
|
+
key: "aa7l1z"
|
|
32
|
+
}],
|
|
33
|
+
["path", {
|
|
34
|
+
d: "M17 3h2a2 2 0 0 1 2 2v2",
|
|
35
|
+
key: "4qcy5o"
|
|
36
|
+
}],
|
|
37
|
+
["path", {
|
|
38
|
+
d: "M21 17v2a2 2 0 0 1-2 2h-2",
|
|
39
|
+
key: "6vwrx8"
|
|
40
|
+
}],
|
|
41
|
+
["path", {
|
|
42
|
+
d: "M7 21H5a2 2 0 0 1-2-2v-2",
|
|
43
|
+
key: "ioqczr"
|
|
44
|
+
}],
|
|
45
|
+
["path", {
|
|
46
|
+
d: "M7 12h10",
|
|
47
|
+
key: "b7w52i"
|
|
48
|
+
}]
|
|
49
|
+
]
|
|
50
|
+
}), V = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, H = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n, U = (e) => ge(W(e)), W = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
51
|
+
r: parseInt(e[0] + e[0], 16),
|
|
52
|
+
g: parseInt(e[1] + e[1], 16),
|
|
53
|
+
b: parseInt(e[2] + e[2], 16),
|
|
54
|
+
a: e.length === 4 ? H(parseInt(e[3] + e[3], 16) / 255, 2) : 1
|
|
55
|
+
} : {
|
|
56
|
+
r: parseInt(e.substring(0, 2), 16),
|
|
57
|
+
g: parseInt(e.substring(2, 4), 16),
|
|
58
|
+
b: parseInt(e.substring(4, 6), 16),
|
|
59
|
+
a: e.length === 8 ? H(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
60
|
+
}), G = (e) => he(me(e)), pe = ({ h: e, s: t, v: n, a: r }) => {
|
|
61
|
+
let i = (200 - t) * n / 100;
|
|
62
|
+
return {
|
|
63
|
+
h: H(e),
|
|
64
|
+
s: H(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
65
|
+
l: H(i / 2),
|
|
66
|
+
a: H(r, 2)
|
|
67
|
+
};
|
|
68
|
+
}, K = (e) => {
|
|
69
|
+
let { h: t, s: n, l: r } = pe(e);
|
|
70
|
+
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
71
|
+
}, me = ({ h: e, s: t, v: n, a: r }) => {
|
|
72
|
+
e = e / 360 * 6, t /= 100, n /= 100;
|
|
73
|
+
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;
|
|
74
|
+
return {
|
|
75
|
+
r: H([
|
|
76
|
+
n,
|
|
77
|
+
o,
|
|
78
|
+
a,
|
|
79
|
+
a,
|
|
80
|
+
s,
|
|
81
|
+
n
|
|
82
|
+
][c] * 255),
|
|
83
|
+
g: H([
|
|
84
|
+
s,
|
|
85
|
+
n,
|
|
86
|
+
n,
|
|
87
|
+
o,
|
|
88
|
+
a,
|
|
89
|
+
a
|
|
90
|
+
][c] * 255),
|
|
91
|
+
b: H([
|
|
92
|
+
a,
|
|
93
|
+
a,
|
|
94
|
+
s,
|
|
95
|
+
n,
|
|
96
|
+
n,
|
|
97
|
+
o
|
|
98
|
+
][c] * 255),
|
|
99
|
+
a: H(r, 2)
|
|
100
|
+
};
|
|
101
|
+
}, q = (e) => {
|
|
102
|
+
let t = e.toString(16);
|
|
103
|
+
return t.length < 2 ? "0" + t : t;
|
|
104
|
+
}, he = ({ r: e, g: t, b: n, a: r }) => {
|
|
105
|
+
let i = r < 1 ? q(H(r * 255)) : "";
|
|
106
|
+
return "#" + q(e) + q(t) + q(n) + i;
|
|
107
|
+
}, ge = ({ r: e, g: t, b: n, a: r }) => {
|
|
108
|
+
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;
|
|
109
|
+
return {
|
|
110
|
+
h: H(60 * (o < 0 ? o + 6 : o)),
|
|
111
|
+
s: H(i ? a / i * 100 : 0),
|
|
112
|
+
v: H(i / 255 * 100),
|
|
113
|
+
a: r
|
|
114
|
+
};
|
|
115
|
+
}, _e = (e, t) => {
|
|
116
|
+
if (e === t) return !0;
|
|
117
|
+
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
118
|
+
return !0;
|
|
119
|
+
}, ve = (e, t) => e.toLowerCase() === t.toLowerCase() || _e(W(e), W(t)), ye = {}, be = (e) => {
|
|
120
|
+
let t = ye[e];
|
|
121
|
+
return t || (t = document.createElement("template"), t.innerHTML = e, ye[e] = t), t;
|
|
122
|
+
}, J = (e, t, n) => {
|
|
123
|
+
e.dispatchEvent(new CustomEvent(t, {
|
|
124
|
+
bubbles: !0,
|
|
125
|
+
detail: n
|
|
126
|
+
}));
|
|
127
|
+
}, Y = !1, X = (e) => "touches" in e, xe = (e) => Y && !X(e) ? !1 : (Y ||= X(e), !0), Se = (e, t) => {
|
|
128
|
+
let n = X(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
129
|
+
J(e.el, "move", e.getMove({
|
|
130
|
+
x: V((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
131
|
+
y: V((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
132
|
+
}));
|
|
133
|
+
}, Ce = (e, t) => {
|
|
134
|
+
let n = t.keyCode;
|
|
135
|
+
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), J(e.el, "move", e.getMove({
|
|
136
|
+
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
137
|
+
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
138
|
+
}, !0)));
|
|
139
|
+
}, we = class {
|
|
140
|
+
constructor(e, t, n, r) {
|
|
141
|
+
let i = be(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
142
|
+
e.appendChild(i.content.cloneNode(!0));
|
|
143
|
+
let a = e.querySelector(`[part=${t}]`);
|
|
144
|
+
a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
|
|
145
|
+
}
|
|
146
|
+
set dragging(e) {
|
|
147
|
+
let t = e ? document.addEventListener : document.removeEventListener;
|
|
148
|
+
t(Y ? "touchmove" : "mousemove", this), t(Y ? "touchend" : "mouseup", this);
|
|
149
|
+
}
|
|
150
|
+
handleEvent(e) {
|
|
151
|
+
switch (e.type) {
|
|
152
|
+
case "mousedown":
|
|
153
|
+
case "touchstart":
|
|
154
|
+
if (e.preventDefault(), !xe(e) || !Y && e.button != 0) return;
|
|
155
|
+
this.el.focus(), Se(this, e), this.dragging = !0;
|
|
156
|
+
break;
|
|
157
|
+
case "mousemove":
|
|
158
|
+
case "touchmove":
|
|
159
|
+
e.preventDefault(), Se(this, e);
|
|
160
|
+
break;
|
|
161
|
+
case "mouseup":
|
|
162
|
+
case "touchend":
|
|
163
|
+
this.dragging = !1;
|
|
164
|
+
break;
|
|
165
|
+
case "keydown": Ce(this, e);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
style(e) {
|
|
169
|
+
e.forEach((e, t) => {
|
|
170
|
+
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}, Z = class extends we {
|
|
174
|
+
constructor(e) {
|
|
175
|
+
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
176
|
+
}
|
|
177
|
+
update({ h: e }) {
|
|
178
|
+
this.h = e, this.style([{
|
|
179
|
+
left: `${e / 360 * 100}%`,
|
|
180
|
+
color: K({
|
|
181
|
+
h: e,
|
|
182
|
+
s: 100,
|
|
183
|
+
v: 100,
|
|
184
|
+
a: 1
|
|
185
|
+
})
|
|
186
|
+
}]), this.el.setAttribute("aria-valuenow", `${H(e)}`);
|
|
187
|
+
}
|
|
188
|
+
getMove(e, t) {
|
|
189
|
+
return { h: t ? V(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
190
|
+
}
|
|
191
|
+
}, Te = class extends we {
|
|
192
|
+
constructor(e) {
|
|
193
|
+
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
194
|
+
}
|
|
195
|
+
update(e) {
|
|
196
|
+
this.hsva = e, this.style([{
|
|
197
|
+
top: `${100 - e.v}%`,
|
|
198
|
+
left: `${e.s}%`,
|
|
199
|
+
color: K(e)
|
|
200
|
+
}, { "background-color": K({
|
|
201
|
+
h: e.h,
|
|
202
|
+
s: 100,
|
|
203
|
+
v: 100,
|
|
204
|
+
a: 1
|
|
205
|
+
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${H(e.s)}%, Brightness ${H(e.v)}%`);
|
|
206
|
+
}
|
|
207
|
+
getMove(e, t) {
|
|
208
|
+
return {
|
|
209
|
+
s: t ? V(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
210
|
+
v: t ? V(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}, Ee = ":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)}", De = "[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}", Oe = "[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}", Q = Symbol("same"), $ = Symbol("color"), ke = Symbol("hsva"), Ae = Symbol("update"), je = Symbol("parts"), Me = Symbol("css"), Ne = Symbol("sliders"), Pe = class extends HTMLElement {
|
|
214
|
+
static get observedAttributes() {
|
|
215
|
+
return ["color"];
|
|
216
|
+
}
|
|
217
|
+
get [Me]() {
|
|
218
|
+
return [
|
|
219
|
+
Ee,
|
|
220
|
+
De,
|
|
221
|
+
Oe
|
|
222
|
+
];
|
|
223
|
+
}
|
|
224
|
+
get [Ne]() {
|
|
225
|
+
return [Te, Z];
|
|
226
|
+
}
|
|
227
|
+
get color() {
|
|
228
|
+
return this[$];
|
|
229
|
+
}
|
|
230
|
+
set color(e) {
|
|
231
|
+
if (!this[Q](e)) {
|
|
232
|
+
let t = this.colorModel.toHsva(e);
|
|
233
|
+
this[Ae](t), this[$] = e;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
constructor() {
|
|
237
|
+
super();
|
|
238
|
+
let e = be(`<style>${this[Me].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
239
|
+
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[je] = this[Ne].map((e) => new e(t));
|
|
240
|
+
}
|
|
241
|
+
connectedCallback() {
|
|
242
|
+
if (this.hasOwnProperty("color")) {
|
|
243
|
+
let e = this.color;
|
|
244
|
+
delete this.color, this.color = e;
|
|
245
|
+
} else this.color ||= this.colorModel.defaultColor;
|
|
246
|
+
}
|
|
247
|
+
attributeChangedCallback(e, t, n) {
|
|
248
|
+
let r = this.colorModel.fromAttr(n);
|
|
249
|
+
this[Q](r) || (this.color = r);
|
|
250
|
+
}
|
|
251
|
+
handleEvent(e) {
|
|
252
|
+
let t = this[ke], n = {
|
|
253
|
+
...t,
|
|
254
|
+
...e.detail
|
|
255
|
+
};
|
|
256
|
+
this[Ae](n);
|
|
257
|
+
let r;
|
|
258
|
+
!_e(n, t) && !this[Q](r = this.colorModel.fromHsva(n)) && (this[$] = r, J(this, "color-changed", { value: r }));
|
|
259
|
+
}
|
|
260
|
+
[Q](e) {
|
|
261
|
+
return this.color && this.colorModel.equal(e, this.color);
|
|
262
|
+
}
|
|
263
|
+
[Ae](e) {
|
|
264
|
+
this[ke] = e, this[je].forEach((t) => t.update(e));
|
|
265
|
+
}
|
|
266
|
+
}, Fe = {
|
|
267
|
+
defaultColor: "#000",
|
|
268
|
+
toHsva: U,
|
|
269
|
+
fromHsva: ({ h: e, s: t, v: n }) => G({
|
|
270
|
+
h: e,
|
|
271
|
+
s: t,
|
|
272
|
+
v: n,
|
|
273
|
+
a: 1
|
|
274
|
+
}),
|
|
275
|
+
equal: ve,
|
|
276
|
+
fromAttr: (e) => e
|
|
277
|
+
}, Ie = class extends Pe {
|
|
278
|
+
get colorModel() {
|
|
279
|
+
return Fe;
|
|
280
|
+
}
|
|
281
|
+
}, Le = class extends Ie {};
|
|
282
|
+
customElements.define("hex-color-picker", Le);
|
|
283
|
+
// src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
284
|
+
var Re = [
|
|
285
|
+
"disabled",
|
|
286
|
+
"aria-label",
|
|
287
|
+
"title",
|
|
288
|
+
"aria-expanded"
|
|
289
|
+
], ze = {
|
|
290
|
+
key: 0,
|
|
291
|
+
class: "tpl:relative tpl:flex-1"
|
|
292
|
+
}, Be = [
|
|
293
|
+
"value",
|
|
294
|
+
"placeholder",
|
|
295
|
+
"disabled",
|
|
296
|
+
"aria-label"
|
|
297
|
+
], Ve = ["aria-label", "title"], He = ["data-tpl-theme"], Ue = [
|
|
298
|
+
"aria-pressed",
|
|
299
|
+
"aria-label",
|
|
300
|
+
"title"
|
|
301
|
+
], We = ["aria-label"], Ge = [
|
|
302
|
+
"aria-label",
|
|
303
|
+
"title",
|
|
304
|
+
"aria-checked",
|
|
305
|
+
"tabindex"
|
|
306
|
+
], Ke = [
|
|
307
|
+
"aria-label",
|
|
308
|
+
"title",
|
|
309
|
+
"aria-checked",
|
|
310
|
+
"tabindex",
|
|
311
|
+
"onClick"
|
|
312
|
+
], qe = ["color", "aria-label"], Je = {
|
|
313
|
+
key: 3,
|
|
314
|
+
class: "tpl:relative tpl:mt-2"
|
|
315
|
+
}, Ye = [
|
|
316
|
+
"value",
|
|
317
|
+
"placeholder",
|
|
318
|
+
"disabled",
|
|
319
|
+
"aria-label"
|
|
320
|
+
], Xe = ["aria-label", "title"], Ze = /* @__PURE__ */ w({
|
|
321
|
+
__name: "ColorPicker",
|
|
322
|
+
props: {
|
|
323
|
+
modelValue: {},
|
|
324
|
+
placeholder: { default: "" },
|
|
325
|
+
seedColor: { default: "#ffffff" },
|
|
326
|
+
swatchOnly: {
|
|
327
|
+
type: Boolean,
|
|
328
|
+
default: !1
|
|
329
|
+
},
|
|
330
|
+
disabled: {
|
|
331
|
+
type: Boolean,
|
|
332
|
+
default: !1
|
|
333
|
+
},
|
|
334
|
+
size: { default: "md" },
|
|
335
|
+
ariaLabel: { default: "" },
|
|
336
|
+
presets: { default: void 0 },
|
|
337
|
+
allowCustom: {
|
|
338
|
+
type: Boolean,
|
|
339
|
+
default: void 0
|
|
340
|
+
},
|
|
341
|
+
allowTransparent: {
|
|
342
|
+
type: Boolean,
|
|
343
|
+
default: !1
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
emits: ["update:modelValue"],
|
|
347
|
+
setup(i, { emit: s }) {
|
|
348
|
+
let l = i, u = se(), b = p(() => l.disabled || !u.value), w = s, { t: E } = I(), O = g(!1);
|
|
349
|
+
e(b, (e) => {
|
|
350
|
+
e && (O.value = !1);
|
|
351
|
+
}, { flush: "sync" });
|
|
352
|
+
let k = g(), A = g(), j = g(!1);
|
|
353
|
+
ae(k, () => {
|
|
354
|
+
O.value = !1;
|
|
355
|
+
}, { ignore: [A] });
|
|
356
|
+
let M = p(() => !l.modelValue), N = p(() => l.modelValue.trim().toLowerCase() === "transparent"), F = p(() => le(l.modelValue)), L = p(() => (l.modelValue ? de(l.modelValue) : null) || (de(l.seedColor) ?? "#ffffff")), R = p(() => !b.value && !M.value), z = C(re, ue), B = p(() => [...new Set(l.presets ?? z.presets)]), V = p(() => l.allowCustom ?? z.allowCustom), H = p(() => B.value.length > 0), U = p(() => V.value || !H.value), W = p(() => oe(l.modelValue));
|
|
357
|
+
function G(e) {
|
|
358
|
+
return W.value !== "" && oe(e) === W.value;
|
|
359
|
+
}
|
|
360
|
+
function pe(e) {
|
|
361
|
+
b.value || w("update:modelValue", e);
|
|
362
|
+
}
|
|
363
|
+
let K = p(() => H.value && !U.value);
|
|
364
|
+
function me(e) {
|
|
365
|
+
return K.value ? e + 1 : e;
|
|
366
|
+
}
|
|
367
|
+
let q = p(() => {
|
|
368
|
+
if (K.value && M.value) return 0;
|
|
369
|
+
let e = B.value.findIndex((e) => G(e));
|
|
370
|
+
return e === -1 ? 0 : me(e);
|
|
371
|
+
});
|
|
372
|
+
function he() {
|
|
373
|
+
return q.value === 0 ? 0 : -1;
|
|
374
|
+
}
|
|
375
|
+
function ge(e) {
|
|
376
|
+
return me(e) === q.value ? 0 : -1;
|
|
377
|
+
}
|
|
378
|
+
function _e(e) {
|
|
379
|
+
if (![
|
|
380
|
+
"ArrowRight",
|
|
381
|
+
"ArrowDown",
|
|
382
|
+
"ArrowLeft",
|
|
383
|
+
"ArrowUp"
|
|
384
|
+
].includes(e.key)) return;
|
|
385
|
+
let t = e.currentTarget, n = Array.from(t.querySelectorAll("[role=\"radio\"]")), r = e.target.closest("[role=\"radio\"]"), i = r ? n.indexOf(r) : -1;
|
|
386
|
+
i !== -1 && (n[(i + (e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1) + n.length) % n.length]?.focus(), e.preventDefault());
|
|
387
|
+
}
|
|
388
|
+
function ve(e) {
|
|
389
|
+
b.value || (j.value = !0, w("update:modelValue", e.detail.value));
|
|
390
|
+
}
|
|
391
|
+
function ye() {
|
|
392
|
+
b.value || (j.value = !1);
|
|
393
|
+
}
|
|
394
|
+
function be() {
|
|
395
|
+
b.value || !j.value && M.value && w("update:modelValue", L.value);
|
|
396
|
+
}
|
|
397
|
+
function J(e) {
|
|
398
|
+
b.value || w("update:modelValue", e.target.value);
|
|
399
|
+
}
|
|
400
|
+
function Y() {
|
|
401
|
+
b.value || w("update:modelValue", "");
|
|
402
|
+
}
|
|
403
|
+
function X() {
|
|
404
|
+
b.value || w("update:modelValue", "transparent");
|
|
405
|
+
}
|
|
406
|
+
let xe = ce(), { toLocal: Se } = fe(), Ce = C(te, null), we = C(ne, null), Z = g({
|
|
407
|
+
top: 0,
|
|
408
|
+
left: 0
|
|
409
|
+
});
|
|
410
|
+
function Te() {
|
|
411
|
+
if (!b.value) {
|
|
412
|
+
if (!O.value) {
|
|
413
|
+
let e = A.value?.getBoundingClientRect();
|
|
414
|
+
if (e) {
|
|
415
|
+
let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
|
|
416
|
+
Z.value = Se({
|
|
417
|
+
top: t,
|
|
418
|
+
left: e.left
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
O.value = !O.value;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return (e, s) => (n(), _("div", { class: r(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", b.value && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
|
|
426
|
+
y("button", {
|
|
427
|
+
ref_key: "swatchRef",
|
|
428
|
+
ref: A,
|
|
429
|
+
type: "button",
|
|
430
|
+
disabled: b.value,
|
|
431
|
+
"aria-label": i.ariaLabel || m(E).colorPicker.pickColor,
|
|
432
|
+
title: i.ariaLabel || void 0,
|
|
433
|
+
"aria-expanded": O.value,
|
|
434
|
+
class: r([
|
|
435
|
+
"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)]",
|
|
436
|
+
b.value ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
437
|
+
O.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !b.value && "tpl:hover:border-[var(--tpl-text-dim)]",
|
|
438
|
+
i.size === "sm" ? "tpl:size-8" : "tpl:size-10"
|
|
439
|
+
]),
|
|
440
|
+
onClick: Te
|
|
441
|
+
}, [y("span", {
|
|
442
|
+
class: r(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", {
|
|
443
|
+
"tpl-color-swatch-empty": M.value,
|
|
444
|
+
"tpl-color-swatch-transparent": N.value
|
|
445
|
+
}]),
|
|
446
|
+
style: o(M.value || N.value ? void 0 : { backgroundColor: F.value })
|
|
447
|
+
}, null, 6)], 10, Re),
|
|
448
|
+
!i.swatchOnly && U.value ? (n(), _("div", ze, [y("input", {
|
|
449
|
+
type: "text",
|
|
450
|
+
class: r([m(ie), "tpl:w-full"]),
|
|
451
|
+
style: o(R.value ? { paddingRight: "2.25rem" } : void 0),
|
|
452
|
+
value: F.value,
|
|
453
|
+
placeholder: i.placeholder || m(E).colorPicker.notSet,
|
|
454
|
+
disabled: b.value,
|
|
455
|
+
"aria-label": m(E).colorPicker.hexValue,
|
|
456
|
+
onInput: J
|
|
457
|
+
}, null, 46, Be), R.value ? (n(), _("button", {
|
|
458
|
+
key: 0,
|
|
459
|
+
type: "button",
|
|
460
|
+
"aria-label": m(E).colorPicker.clear,
|
|
461
|
+
title: m(E).colorPicker.clear,
|
|
462
|
+
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)]",
|
|
463
|
+
onClick: Y
|
|
464
|
+
}, [d(m(P), {
|
|
465
|
+
size: 14,
|
|
466
|
+
"stroke-width": 1.5
|
|
467
|
+
})], 8, Ve)) : h("", !0)])) : h("", !0),
|
|
468
|
+
(n(), S(f, {
|
|
469
|
+
to: m(xe),
|
|
470
|
+
disabled: !m(xe)
|
|
471
|
+
}, [d(D, {
|
|
472
|
+
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
473
|
+
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
474
|
+
"enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
475
|
+
"leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
476
|
+
"leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
477
|
+
"leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
|
|
478
|
+
}, {
|
|
479
|
+
default: c(() => [O.value ? (n(), _("div", {
|
|
480
|
+
key: 0,
|
|
481
|
+
ref_key: "popoverRef",
|
|
482
|
+
ref: k,
|
|
483
|
+
"data-tpl-theme": m(we),
|
|
484
|
+
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)]",
|
|
485
|
+
style: o({
|
|
486
|
+
top: `${Z.value.top}px`,
|
|
487
|
+
left: `${Z.value.left}px`,
|
|
488
|
+
...m(Ce)
|
|
489
|
+
})
|
|
490
|
+
}, [
|
|
491
|
+
i.allowTransparent ? (n(), _("button", {
|
|
492
|
+
key: 0,
|
|
493
|
+
type: "button",
|
|
494
|
+
"data-testid": "color-picker-transparent",
|
|
495
|
+
"aria-pressed": N.value,
|
|
496
|
+
"aria-label": m(E).colorPicker.transparent,
|
|
497
|
+
title: m(E).colorPicker.transparent,
|
|
498
|
+
class: r(["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)]", N.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)]"]),
|
|
499
|
+
onClick: X
|
|
500
|
+
}, [s[2] ||= y("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), v(" " + t(m(E).colorPicker.transparent), 1)], 10, Ue)) : h("", !0),
|
|
501
|
+
H.value ? (n(), _("div", {
|
|
502
|
+
key: 1,
|
|
503
|
+
role: "radiogroup",
|
|
504
|
+
"aria-label": m(E).colorPicker.presetColors,
|
|
505
|
+
class: r(["tpl:flex tpl:flex-wrap tpl:gap-1.5", U.value && "tpl:mb-2"]),
|
|
506
|
+
onKeydown: _e
|
|
507
|
+
}, [K.value ? (n(), _("button", {
|
|
508
|
+
key: 0,
|
|
509
|
+
type: "button",
|
|
510
|
+
role: "radio",
|
|
511
|
+
"aria-label": m(E).colorPicker.clear,
|
|
512
|
+
title: m(E).colorPicker.clear,
|
|
513
|
+
"aria-checked": M.value,
|
|
514
|
+
tabindex: he(),
|
|
515
|
+
class: r(["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)]", M.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)]"]),
|
|
516
|
+
onClick: Y
|
|
517
|
+
}, null, 10, Ge)) : h("", !0), (n(!0), _(x, null, a(B.value, (e, t) => (n(), _("button", {
|
|
518
|
+
key: e,
|
|
519
|
+
type: "button",
|
|
520
|
+
role: "radio",
|
|
521
|
+
"aria-label": e,
|
|
522
|
+
title: e,
|
|
523
|
+
"aria-checked": G(e),
|
|
524
|
+
tabindex: ge(t),
|
|
525
|
+
style: o({ backgroundColor: e }),
|
|
526
|
+
class: r(["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)]", G(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)]"]),
|
|
527
|
+
onClick: (t) => pe(e)
|
|
528
|
+
}, null, 14, Ke))), 128))], 42, We)) : h("", !0),
|
|
529
|
+
U.value ? (n(), _("hex-color-picker", {
|
|
530
|
+
key: 2,
|
|
531
|
+
color: L.value,
|
|
532
|
+
"aria-label": m(E).colorPicker.pickColor,
|
|
533
|
+
onColorChanged: ve,
|
|
534
|
+
onPointerdown: ye,
|
|
535
|
+
onPointerup: be,
|
|
536
|
+
onKeydown: s[0] ||= ee((e) => O.value = !1, ["escape"])
|
|
537
|
+
}, null, 40, qe)) : h("", !0),
|
|
538
|
+
i.swatchOnly && U.value ? (n(), _("div", Je, [y("input", {
|
|
539
|
+
type: "text",
|
|
540
|
+
class: r([m(ie), "tpl:w-full"]),
|
|
541
|
+
style: o(R.value ? { paddingRight: "2.25rem" } : void 0),
|
|
542
|
+
value: F.value,
|
|
543
|
+
placeholder: i.placeholder || m(E).colorPicker.notSet,
|
|
544
|
+
disabled: b.value,
|
|
545
|
+
"aria-label": m(E).colorPicker.hexValue,
|
|
546
|
+
onChange: J,
|
|
547
|
+
onKeydown: s[1] ||= ee(T((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
548
|
+
}, null, 46, Ye), R.value ? (n(), _("button", {
|
|
549
|
+
key: 0,
|
|
550
|
+
type: "button",
|
|
551
|
+
"aria-label": m(E).colorPicker.clear,
|
|
552
|
+
title: m(E).colorPicker.clear,
|
|
553
|
+
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)]",
|
|
554
|
+
onClick: Y
|
|
555
|
+
}, [d(m(P), {
|
|
556
|
+
size: 14,
|
|
557
|
+
"stroke-width": 1.5
|
|
558
|
+
})], 8, Xe)) : h("", !0)])) : h("", !0)
|
|
559
|
+
], 12, He)) : h("", !0)]),
|
|
560
|
+
_: 1
|
|
561
|
+
})], 8, ["to", "disabled"]))
|
|
562
|
+
], 2));
|
|
563
|
+
}
|
|
564
|
+
}), Qe = ["id"], $e = {
|
|
565
|
+
key: 0,
|
|
566
|
+
class: "tpl:px-3 tpl:py-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
567
|
+
"data-testid": "merge-tag-suggestion-empty"
|
|
568
|
+
}, et = [
|
|
569
|
+
"id",
|
|
570
|
+
"aria-selected",
|
|
571
|
+
"data-selected",
|
|
572
|
+
"data-merge-tag-value",
|
|
573
|
+
"onMousedown",
|
|
574
|
+
"onMousemove"
|
|
575
|
+
], tt = { class: "tpl:font-medium" }, nt = { class: "tpl:text-[var(--tpl-text-dim)] tpl:font-mono" }, rt = /* @__PURE__ */ w({
|
|
576
|
+
__name: "MergeTagSuggestionList",
|
|
577
|
+
props: {
|
|
578
|
+
items: {},
|
|
579
|
+
selectedIndex: {},
|
|
580
|
+
emptyText: {},
|
|
581
|
+
listId: {}
|
|
582
|
+
},
|
|
583
|
+
emits: ["select", "hover"],
|
|
584
|
+
setup(e) {
|
|
585
|
+
let i = e;
|
|
586
|
+
function o(e) {
|
|
587
|
+
return i.listId ? `${i.listId}-opt-${e}` : void 0;
|
|
588
|
+
}
|
|
589
|
+
return (i, s) => (n(), _("div", {
|
|
590
|
+
id: e.listId,
|
|
591
|
+
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)]",
|
|
592
|
+
role: "listbox",
|
|
593
|
+
"data-testid": "merge-tag-suggestion-list"
|
|
594
|
+
}, [e.items.length === 0 ? (n(), _("div", $e, t(e.emptyText), 1)) : h("", !0), (n(!0), _(x, null, a(e.items, (a, s) => (n(), _("button", {
|
|
595
|
+
key: a.value,
|
|
596
|
+
id: o(s),
|
|
597
|
+
type: "button",
|
|
598
|
+
role: "option",
|
|
599
|
+
"aria-selected": s === e.selectedIndex,
|
|
600
|
+
"data-selected": s === e.selectedIndex ? "true" : "false",
|
|
601
|
+
"data-merge-tag-value": a.value,
|
|
602
|
+
class: r(["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", s === 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)]"]),
|
|
603
|
+
onMousedown: T((e) => i.$emit("select", a), ["prevent", "stop"]),
|
|
604
|
+
onMousemove: (t) => s !== e.selectedIndex && i.$emit("hover", s)
|
|
605
|
+
}, [y("span", tt, t(a.label), 1), y("span", nt, t(a.value), 1)], 42, et))), 128))], 8, Qe));
|
|
606
|
+
}
|
|
607
|
+
}), it = 10, at = 0;
|
|
608
|
+
function ot(e, t) {
|
|
609
|
+
let n = t.trim().toLowerCase();
|
|
610
|
+
return n === "" ? e.slice(0, it) : e.filter((e) => {
|
|
611
|
+
let t = e.label.toLowerCase(), r = e.value.toLowerCase();
|
|
612
|
+
return t.includes(n) || r.includes(n);
|
|
613
|
+
}).slice(0, it);
|
|
614
|
+
}
|
|
615
|
+
function st(e, t, n, r) {
|
|
616
|
+
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;
|
|
617
|
+
}
|
|
618
|
+
function ct(e, t) {
|
|
619
|
+
let n = null, r = null, i = null, a = g([]), o = g(0), c = null, l = `tpl-merge-tag-suggestion-${++at}`, u = null, d = [], f = null;
|
|
620
|
+
function p() {
|
|
621
|
+
y(u?.() ?? null);
|
|
622
|
+
}
|
|
623
|
+
function m() {
|
|
624
|
+
p(), f !== null && cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
625
|
+
f = null, p();
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
function h(e) {
|
|
629
|
+
let t = [], n = e?.parentElement ?? null;
|
|
630
|
+
for (; n && n !== document.body && n !== document.documentElement;) {
|
|
631
|
+
let e = window.getComputedStyle(n), r = e.overflow + e.overflowX + e.overflowY;
|
|
632
|
+
/(auto|scroll|overlay)/.test(r) && t.push(n), n = n.parentElement;
|
|
633
|
+
}
|
|
634
|
+
return t;
|
|
635
|
+
}
|
|
636
|
+
function _(e) {
|
|
637
|
+
d = [window, ...h(e)];
|
|
638
|
+
for (let e of d) e.addEventListener("scroll", p, {
|
|
639
|
+
passive: !0,
|
|
640
|
+
capture: !0
|
|
641
|
+
});
|
|
642
|
+
window.addEventListener("resize", p, { passive: !0 });
|
|
643
|
+
}
|
|
644
|
+
function v() {
|
|
645
|
+
for (let e of d) e.removeEventListener("scroll", p, { capture: !0 });
|
|
646
|
+
window.removeEventListener("resize", p), d = [];
|
|
647
|
+
}
|
|
648
|
+
function y(e) {
|
|
649
|
+
if (!r || !e || e.bottom < 0 || e.top > window.innerHeight) return;
|
|
650
|
+
r.style.position = "absolute", r.style.zIndex = "9999";
|
|
651
|
+
let t = r.offsetParent?.getBoundingClientRect(), n = t?.top ?? 0, i = t?.left ?? 0;
|
|
652
|
+
r.style.left = `${e.left - i}px`, r.style.top = `${e.bottom - n}px`;
|
|
653
|
+
let a = r.offsetHeight;
|
|
654
|
+
if (a !== 0 && window.innerHeight - e.bottom < a) {
|
|
655
|
+
let t = Math.max(0, e.top - a);
|
|
656
|
+
r.style.top = `${t - n}px`;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
function b(e, t) {
|
|
660
|
+
let n = t?.closest("[data-tpl-theme]");
|
|
661
|
+
if (!n) return;
|
|
662
|
+
let r = n.getAttribute("data-tpl-theme");
|
|
663
|
+
r && e.setAttribute("data-tpl-theme", r);
|
|
664
|
+
let i = window.getComputedStyle(n);
|
|
665
|
+
for (let t = 0; t < i.length; t++) {
|
|
666
|
+
let n = i[t];
|
|
667
|
+
n.startsWith("--tpl-") && e.style.setProperty(n, i.getPropertyValue(n));
|
|
668
|
+
}
|
|
669
|
+
e.style.fontFamily = i.fontFamily, e.style.fontSize = i.fontSize, e.style.lineHeight = i.lineHeight;
|
|
670
|
+
}
|
|
671
|
+
function x(e) {
|
|
672
|
+
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")));
|
|
673
|
+
}
|
|
674
|
+
function S() {
|
|
675
|
+
i && (a.value.length === 0 ? i.removeAttribute("aria-activedescendant") : i.setAttribute("aria-activedescendant", `${l}-opt-${o.value}`));
|
|
676
|
+
}
|
|
677
|
+
function C(e) {
|
|
678
|
+
c?.(e);
|
|
679
|
+
}
|
|
680
|
+
return {
|
|
681
|
+
open: ({ items: d, getRect: f, anchorEl: p, onCommand: h }) => {
|
|
682
|
+
a.value = d, o.value = 0, c = h, r = document.createElement("div"), r.setAttribute("data-testid", "merge-tag-suggestion-popup"), i = p, b(r, p), (t?.value ?? document.body).appendChild(r), n = E({ render() {
|
|
683
|
+
return s(rt, {
|
|
684
|
+
items: a.value,
|
|
685
|
+
selectedIndex: o.value,
|
|
686
|
+
emptyText: e,
|
|
687
|
+
listId: l,
|
|
688
|
+
onSelect: (e) => C(e),
|
|
689
|
+
onHover: (e) => {
|
|
690
|
+
o.value = e, S();
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
} }), n.mount(r), x(!0), S(), u = f, m(), _(p);
|
|
694
|
+
},
|
|
695
|
+
update: ({ items: e, getRect: t, onCommand: n }) => {
|
|
696
|
+
a.value = e, o.value >= e.length && (o.value = 0), c = n, S(), u = t, m();
|
|
697
|
+
},
|
|
698
|
+
handleKeyDown: (e) => {
|
|
699
|
+
let t = st(e, a.value, o, C);
|
|
700
|
+
return t && S(), t;
|
|
701
|
+
},
|
|
702
|
+
close: () => {
|
|
703
|
+
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);
|
|
704
|
+
},
|
|
705
|
+
isOpen: () => r !== null
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
// src/utils/mergeTagTrigger.ts
|
|
709
|
+
function lt(e, t, n, r, i) {
|
|
710
|
+
if (!n) return null;
|
|
711
|
+
let a = e.slice(0, t), o = a.lastIndexOf(n);
|
|
712
|
+
if (o === -1 || i && o < ut(a, i)) return null;
|
|
713
|
+
let s = a.slice(o + n.length);
|
|
714
|
+
return /\s/.test(s) || r && s.includes(r) ? null : {
|
|
715
|
+
triggerStart: o,
|
|
716
|
+
caret: t,
|
|
717
|
+
query: s
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function ut(e, t) {
|
|
721
|
+
let n = new RegExp(t.source, `${t.flags.replace(/[gy]/g, "")}g`), r = 0;
|
|
722
|
+
for (let t of e.matchAll(n)) r = t.index + t[0].length;
|
|
723
|
+
return r;
|
|
724
|
+
}
|
|
725
|
+
// src/utils/textFieldCaret.ts
|
|
726
|
+
var dt = /* @__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(".");
|
|
727
|
+
function ft(e, t, n) {
|
|
728
|
+
return {
|
|
729
|
+
left: e,
|
|
730
|
+
top: t,
|
|
731
|
+
bottom: n,
|
|
732
|
+
right: e,
|
|
733
|
+
width: 0,
|
|
734
|
+
height: n - t,
|
|
735
|
+
x: e,
|
|
736
|
+
y: t,
|
|
737
|
+
toJSON: () => ({})
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
function pt(e, t) {
|
|
741
|
+
let n = e.ownerDocument, r = n.defaultView;
|
|
742
|
+
if (!r) return null;
|
|
743
|
+
let i = e.tagName === "INPUT", a = r.getComputedStyle(e), o = n.createElement("div");
|
|
744
|
+
o.setAttribute("aria-hidden", "true");
|
|
745
|
+
let s = o.style;
|
|
746
|
+
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";
|
|
747
|
+
let c = s, l = a;
|
|
748
|
+
for (let e of dt) c[e] = l[e];
|
|
749
|
+
i && (s.width = "auto", s.whiteSpace = "pre");
|
|
750
|
+
let u = e.value, d = u.slice(0, t);
|
|
751
|
+
i && (d = d.replace(/\s/g, "\xA0")), o.textContent = d;
|
|
752
|
+
let f = n.createElement("span");
|
|
753
|
+
f.textContent = u.slice(t) || ".", o.appendChild(f), n.body.appendChild(o);
|
|
754
|
+
let p = f.offsetTop, m = f.offsetLeft;
|
|
755
|
+
n.body.removeChild(o);
|
|
756
|
+
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;
|
|
757
|
+
if (i) return ft(y, h.top, h.bottom);
|
|
758
|
+
let b = h.top + p + g - e.scrollTop;
|
|
759
|
+
return ft(y, b, b + v);
|
|
760
|
+
}
|
|
761
|
+
// src/composables/useMergeTagAutocomplete.ts
|
|
762
|
+
var mt = /* @__PURE__ */ new Set([
|
|
763
|
+
"ArrowLeft",
|
|
764
|
+
"ArrowRight",
|
|
765
|
+
"Home",
|
|
766
|
+
"End"
|
|
767
|
+
]);
|
|
768
|
+
function ht(t) {
|
|
769
|
+
let { elementRef: n, modelValue: r, emit: a, mergeTags: o, syntax: s, enabled: c, onInsert: d } = t, f = se(), m = k(s), h = j(s), g = p(() => f.value && c && m !== null && o.value.length > 0), _ = C(F, null), v = ct((l(_) ? _.value : _)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", ce());
|
|
770
|
+
e(f, (e) => {
|
|
771
|
+
e || v.close();
|
|
772
|
+
}, { flush: "sync" });
|
|
773
|
+
let y = !1;
|
|
774
|
+
b() && u(() => {
|
|
775
|
+
y = !0, v.close();
|
|
776
|
+
});
|
|
777
|
+
function x(e) {
|
|
778
|
+
let t = e.value ?? "";
|
|
779
|
+
return lt(t, e.selectionStart ?? t.length, m, h, s.value);
|
|
780
|
+
}
|
|
781
|
+
function S(e, t, o) {
|
|
782
|
+
if (!f.value) return;
|
|
783
|
+
let s = e.value ?? r(), c = s.slice(t.caret), l = h && c.startsWith(h) ? h.length : 0, u = s.slice(0, t.triggerStart), p = s.slice(t.caret + l), m = u + o.value + p, g = u.length + o.value.length;
|
|
784
|
+
d?.(), a(m), v.close(), i(() => {
|
|
785
|
+
if (y) return;
|
|
786
|
+
let e = n.value;
|
|
787
|
+
e?.focus(), e?.setSelectionRange(g, g);
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
function w() {
|
|
791
|
+
if (!g.value || y) return;
|
|
792
|
+
let e = n.value;
|
|
793
|
+
if (!e) {
|
|
794
|
+
v.close();
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
let t = x(e);
|
|
798
|
+
if (!t) {
|
|
799
|
+
v.close();
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
let r = ot(o.value, t.query), i = () => pt(e, t.triggerStart), a = (n) => S(e, t, n);
|
|
803
|
+
v.isOpen() ? v.update({
|
|
804
|
+
items: r,
|
|
805
|
+
getRect: i,
|
|
806
|
+
onCommand: a
|
|
807
|
+
}) : v.open({
|
|
808
|
+
items: r,
|
|
809
|
+
getRect: i,
|
|
810
|
+
anchorEl: e,
|
|
811
|
+
onCommand: a
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
function T(e) {
|
|
815
|
+
return v.isOpen() ? e.key === "Escape" ? (v.close(), !0) : mt.has(e.key) ? (v.close(), !1) : v.handleKeyDown(e) : !1;
|
|
816
|
+
}
|
|
817
|
+
return {
|
|
818
|
+
available: g,
|
|
819
|
+
refresh: w,
|
|
820
|
+
handleKeydown: T,
|
|
821
|
+
close: () => v.close(),
|
|
822
|
+
isOpen: () => v.isOpen()
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
// src/composables/useMergeTagField.ts
|
|
826
|
+
function gt(e) {
|
|
827
|
+
let { modelValue: t, emit: n, elementRef: r } = e, { mergeTags: a, canRequestMergeTag: o, isRequesting: s, isMergeTagValue: c, getMergeTagDisplayLabel: l, findMergeTag: d, requestMergeTag: f, syntax: m, autocomplete: h } = L(), { canInsertLogicTag: _, isRequesting: v, requestLogicTag: y } = R(), x = g(!1), S = !1, C = !1;
|
|
828
|
+
b() && u(() => {
|
|
829
|
+
C = !0;
|
|
830
|
+
});
|
|
831
|
+
let w = ht({
|
|
832
|
+
elementRef: r,
|
|
833
|
+
modelValue: t,
|
|
834
|
+
emit: n,
|
|
835
|
+
mergeTags: a,
|
|
836
|
+
syntax: m,
|
|
837
|
+
enabled: h,
|
|
838
|
+
onInsert: () => {
|
|
839
|
+
x.value = !0;
|
|
840
|
+
}
|
|
841
|
+
}), T = p(() => {
|
|
842
|
+
let e = t();
|
|
843
|
+
if (!e) return [];
|
|
844
|
+
let n = [], r = `(${m.value.source}|${m.logic.source})`, i = new RegExp(r, "g"), a = 0, o;
|
|
845
|
+
for (; (o = i.exec(e)) !== null;) {
|
|
846
|
+
o.index > a && n.push({
|
|
847
|
+
type: "text",
|
|
848
|
+
value: e.slice(a, o.index)
|
|
849
|
+
});
|
|
850
|
+
let t = o[0];
|
|
851
|
+
c(t) ? n.push({
|
|
852
|
+
type: "mergeTag",
|
|
853
|
+
value: t,
|
|
854
|
+
label: l(t)
|
|
855
|
+
}) : O(t, m) ? n.push({
|
|
856
|
+
type: "logicMergeTag",
|
|
857
|
+
value: t,
|
|
858
|
+
keyword: A(t, m)
|
|
859
|
+
}) : n.push({
|
|
860
|
+
type: "text",
|
|
861
|
+
value: t
|
|
862
|
+
}), a = o.index + t.length;
|
|
863
|
+
}
|
|
864
|
+
return a < e.length && n.push({
|
|
865
|
+
type: "text",
|
|
866
|
+
value: e.slice(a)
|
|
867
|
+
}), n;
|
|
868
|
+
}), E = p(() => T.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
|
|
869
|
+
function ee() {
|
|
870
|
+
x.value = !0, i(() => {
|
|
871
|
+
r.value?.focus();
|
|
872
|
+
let e = t()?.length || 0;
|
|
873
|
+
r.value?.setSelectionRange(e, e);
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
function D() {
|
|
877
|
+
S || (x.value = !1);
|
|
878
|
+
}
|
|
879
|
+
function k(e) {
|
|
880
|
+
n(e.target.value), w.refresh();
|
|
881
|
+
}
|
|
882
|
+
function j(e) {
|
|
883
|
+
return w.handleKeydown(e) ? (e.preventDefault(), !0) : (e.key === "Escape" && D(), !1);
|
|
884
|
+
}
|
|
885
|
+
function M() {
|
|
886
|
+
w.refresh();
|
|
887
|
+
}
|
|
888
|
+
function N() {
|
|
889
|
+
w.close(), D();
|
|
890
|
+
}
|
|
891
|
+
function P() {
|
|
892
|
+
n("");
|
|
893
|
+
}
|
|
894
|
+
async function te() {
|
|
895
|
+
let e = x.value && r.value ? r.value.selectionStart ?? t().length : t().length;
|
|
896
|
+
S = !0;
|
|
897
|
+
let a;
|
|
898
|
+
try {
|
|
899
|
+
a = await f();
|
|
900
|
+
} finally {
|
|
901
|
+
S = !1;
|
|
902
|
+
}
|
|
903
|
+
if (!C && a) {
|
|
904
|
+
let o = t().slice(0, e), s = t().slice(e), c = o + a.value + s;
|
|
905
|
+
n(c), x.value = !0, i(() => {
|
|
906
|
+
if (C) return;
|
|
907
|
+
let t = e + a.value.length;
|
|
908
|
+
r.value?.focus(), r.value?.setSelectionRange(t, t);
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
async function ne(e) {
|
|
913
|
+
let t = T.value, r = t[e];
|
|
914
|
+
if (r?.type !== "mergeTag") return;
|
|
915
|
+
S = !0;
|
|
916
|
+
let i;
|
|
917
|
+
try {
|
|
918
|
+
i = await f({
|
|
919
|
+
reason: "edit",
|
|
920
|
+
current: d(r.value)
|
|
921
|
+
});
|
|
922
|
+
} finally {
|
|
923
|
+
S = !1;
|
|
924
|
+
}
|
|
925
|
+
!C && i && n(t.map((t, n) => n === e ? i.value : t.value).join(""));
|
|
926
|
+
}
|
|
927
|
+
async function re() {
|
|
928
|
+
let e = r.value, a = e?.selectionStart ?? t().length, o = e?.selectionEnd ?? a;
|
|
929
|
+
S = !0;
|
|
930
|
+
let s;
|
|
931
|
+
try {
|
|
932
|
+
s = await y();
|
|
933
|
+
} finally {
|
|
934
|
+
S = !1;
|
|
935
|
+
}
|
|
936
|
+
if (C || !s) return;
|
|
937
|
+
let c = t(), l, u;
|
|
938
|
+
"before" in s ? (l = c.slice(0, a) + s.before + c.slice(a, o) + s.after + c.slice(o), u = a + s.before.length + (o - a)) : (l = c.slice(0, a) + s.value + c.slice(a), u = a + s.value.length), n(l), x.value = !0, i(() => {
|
|
939
|
+
C || (r.value?.focus(), r.value?.setSelectionRange(u, u));
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
return {
|
|
943
|
+
segments: T,
|
|
944
|
+
hasMergeTags: E,
|
|
945
|
+
canRequestMergeTag: o,
|
|
946
|
+
isRequestingMergeTag: s,
|
|
947
|
+
canInsertLogicTag: _,
|
|
948
|
+
isRequestingLogicTag: v,
|
|
949
|
+
isEditing: x,
|
|
950
|
+
startEditing: ee,
|
|
951
|
+
stopEditing: D,
|
|
952
|
+
handleInput: k,
|
|
953
|
+
handleKeydown: j,
|
|
954
|
+
handleClick: M,
|
|
955
|
+
handleBlur: N,
|
|
956
|
+
clearValue: P,
|
|
957
|
+
insertMergeTag: te,
|
|
958
|
+
replaceMergeTagAt: ne,
|
|
959
|
+
insertLogicTag: re,
|
|
960
|
+
autocompleteAvailable: w.available
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
// src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
|
|
964
|
+
var _t = ["aria-label"], vt = [
|
|
965
|
+
"data-tooltip",
|
|
966
|
+
"aria-label",
|
|
967
|
+
"onClick"
|
|
968
|
+
], yt = ["data-tooltip"], bt = ["data-tooltip"], xt = {
|
|
969
|
+
key: 3,
|
|
970
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
|
|
971
|
+
}, St = ["aria-label", "title"], Ct = ["aria-label", "title"], wt = /* @__PURE__ */ w({
|
|
972
|
+
__name: "MergeTagSegments",
|
|
973
|
+
props: {
|
|
974
|
+
segments: {},
|
|
975
|
+
displayClass: {},
|
|
976
|
+
pulse: { type: Boolean }
|
|
977
|
+
},
|
|
978
|
+
emits: [
|
|
979
|
+
"edit",
|
|
980
|
+
"clear",
|
|
981
|
+
"repick"
|
|
982
|
+
],
|
|
983
|
+
setup(e, { emit: i }) {
|
|
984
|
+
let o = i, { t: s, format: c } = I(), { canRepickMergeTag: l, showRawValue: u } = L();
|
|
985
|
+
function f() {
|
|
986
|
+
o("edit");
|
|
987
|
+
}
|
|
988
|
+
return (i, p) => (n(), _("div", {
|
|
989
|
+
role: "group",
|
|
990
|
+
"aria-label": m(s).mergeTag.fieldGroup,
|
|
991
|
+
class: r([e.displayClass, { "tpl-pulse-fill": e.pulse }]),
|
|
992
|
+
onClick: f
|
|
993
|
+
}, [
|
|
994
|
+
(n(!0), _(x, null, a(e.segments, (e, i) => (n(), _(x, { key: `${e.type}-${i}-${e.value}` }, [e.type === "mergeTag" && m(l)(e.value) ? (n(), _("button", {
|
|
995
|
+
key: 0,
|
|
996
|
+
type: "button",
|
|
997
|
+
class: r(["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", m(u) ? "tpl-tooltip" : ""]),
|
|
998
|
+
"data-tooltip": m(u) ? e.value : void 0,
|
|
999
|
+
"aria-label": m(c)(m(s).mergeTag.changeTag, { label: e.label }),
|
|
1000
|
+
"data-testid": "merge-tag-field-chip",
|
|
1001
|
+
style: {
|
|
1002
|
+
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
1003
|
+
color: "var(--tpl-primary)"
|
|
1004
|
+
},
|
|
1005
|
+
onClick: T((e) => o("repick", i), ["stop"])
|
|
1006
|
+
}, t(e.label), 11, vt)) : e.type === "mergeTag" ? (n(), _("span", {
|
|
1007
|
+
key: 1,
|
|
1008
|
+
class: r(["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", m(u) ? "tpl-tooltip" : ""]),
|
|
1009
|
+
"data-tooltip": m(u) ? e.value : void 0,
|
|
1010
|
+
style: {
|
|
1011
|
+
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
1012
|
+
color: "var(--tpl-primary)"
|
|
1013
|
+
}
|
|
1014
|
+
}, t(e.label), 11, yt)) : e.type === "logicMergeTag" ? (n(), _("span", {
|
|
1015
|
+
key: 2,
|
|
1016
|
+
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",
|
|
1017
|
+
"data-tooltip": e.value,
|
|
1018
|
+
style: {
|
|
1019
|
+
"background-color": "transparent",
|
|
1020
|
+
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
1021
|
+
color: "var(--tpl-primary)"
|
|
1022
|
+
}
|
|
1023
|
+
}, t(e.keyword), 9, bt)) : (n(), _("span", xt, t(e.value), 1))], 64))), 128)),
|
|
1024
|
+
y("button", {
|
|
1025
|
+
type: "button",
|
|
1026
|
+
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",
|
|
1027
|
+
"aria-label": m(s).mergeTag.editAsText,
|
|
1028
|
+
title: m(s).mergeTag.editAsText,
|
|
1029
|
+
"data-testid": "merge-tag-field-edit",
|
|
1030
|
+
onClick: T(f, ["stop"])
|
|
1031
|
+
}, [d(m(N), {
|
|
1032
|
+
size: 12,
|
|
1033
|
+
"stroke-width": 2
|
|
1034
|
+
})], 8, St),
|
|
1035
|
+
y("button", {
|
|
1036
|
+
type: "button",
|
|
1037
|
+
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",
|
|
1038
|
+
"aria-label": m(s).mergeTag.remove,
|
|
1039
|
+
title: m(s).mergeTag.remove,
|
|
1040
|
+
"data-testid": "merge-tag-field-clear",
|
|
1041
|
+
onClick: p[0] ||= T((e) => o("clear"), ["stop"])
|
|
1042
|
+
}, [d(m(P), {
|
|
1043
|
+
size: 12,
|
|
1044
|
+
"stroke-width": 2.5
|
|
1045
|
+
})], 8, Ct)
|
|
1046
|
+
], 10, _t));
|
|
1047
|
+
}
|
|
1048
|
+
}), Tt = [
|
|
1049
|
+
"aria-label",
|
|
1050
|
+
"title",
|
|
1051
|
+
"disabled"
|
|
1052
|
+
], Et = "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)]", Dt = /* @__PURE__ */ w({
|
|
1053
|
+
__name: "MergeTagInsertButton",
|
|
1054
|
+
props: { disabled: { type: Boolean } },
|
|
1055
|
+
emits: ["insert"],
|
|
1056
|
+
setup(e) {
|
|
1057
|
+
let { t: i } = I();
|
|
1058
|
+
return (a, o) => (n(), _("button", {
|
|
1059
|
+
type: "button",
|
|
1060
|
+
class: r([Et, "tpl:mt-1.5"]),
|
|
1061
|
+
"aria-label": m(i).mergeTag.insert,
|
|
1062
|
+
title: m(i).mergeTag.insert,
|
|
1063
|
+
disabled: e.disabled,
|
|
1064
|
+
onMousedown: o[0] ||= T(() => {}, ["prevent"]),
|
|
1065
|
+
onClick: o[1] ||= (e) => a.$emit("insert")
|
|
1066
|
+
}, [d(m(B), {
|
|
1067
|
+
size: 12,
|
|
1068
|
+
"stroke-width": 2
|
|
1069
|
+
}), v(" " + t(m(i).mergeTag.insertShort), 1)], 42, Tt));
|
|
1070
|
+
}
|
|
1071
|
+
}), Ot = [
|
|
1072
|
+
"aria-label",
|
|
1073
|
+
"title",
|
|
1074
|
+
"disabled"
|
|
1075
|
+
], kt = "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)]", At = /* @__PURE__ */ w({
|
|
1076
|
+
__name: "LogicTagInsertButton",
|
|
1077
|
+
props: { disabled: { type: Boolean } },
|
|
1078
|
+
emits: ["insert"],
|
|
1079
|
+
setup(e) {
|
|
1080
|
+
let { t: i } = I();
|
|
1081
|
+
return (a, o) => (n(), _("button", {
|
|
1082
|
+
type: "button",
|
|
1083
|
+
class: r([kt, "tpl:mt-1.5"]),
|
|
1084
|
+
"aria-label": m(i).logicTag.insert,
|
|
1085
|
+
title: m(i).logicTag.insert,
|
|
1086
|
+
disabled: e.disabled,
|
|
1087
|
+
"data-testid": "field-insert-logic-button",
|
|
1088
|
+
onMousedown: o[0] ||= T(() => {}, ["prevent"]),
|
|
1089
|
+
onClick: o[1] ||= (e) => a.$emit("insert")
|
|
1090
|
+
}, [d(m(z), {
|
|
1091
|
+
size: 12,
|
|
1092
|
+
"stroke-width": 2
|
|
1093
|
+
}), v(" " + t(m(i).logicTag.insertShort), 1)], 42, Ot));
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
export { ct as a, Ze as c, gt as i, B as l, Dt as n, ot as o, wt as r, st as s, At as t, z as u };
|