@templatical/editor 0.26.2 → 0.27.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 +3 -1
- package/dist/{AiChatSidebar-CMBz6Wix.js → AiChatSidebar-iVJDzqjr.js} +60 -60
- package/dist/AiFeatureMenu-DvrK-dzj.js +57 -0
- package/dist/{BlockIssueBadge-Buk3_6QF.js → BlockIssueBadge-BHysq7XQ.js} +11 -11
- package/dist/BlockPreviewCanvas-GZbr0ph5.js +121 -0
- package/dist/CloudHeaderExtras-Cx8gFWu2.js +59 -0
- package/dist/CloudPanels-D0X449DD.js +227 -0
- package/dist/{CollaboratorBar-zvfvE7f-.js → CollaboratorBar-DMSWCrX3.js} +21 -21
- package/dist/ColorPicker-DCjFQCAg.js +501 -0
- package/dist/CommentsPanel-D5wQB1Kf.js +18 -0
- package/dist/CommentsSidebar-BoTIxpLE.js +481 -0
- package/dist/{cdn/chunks/CountdownBlock-vLTkTI9e.js → CountdownBlock-BFX8iU90.js} +19 -21
- package/dist/{cdn/chunks/CountdownToolbar-DPjcgcVR.js → CountdownToolbar-CSftc9Ma.js} +52 -53
- package/dist/{DesignReferenceSidebar-Bx96XFmK.js → DesignReferenceSidebar-DKsx2TiL.js} +72 -71
- package/dist/{IssuesPanel-Do7RLXsP.js → IssuesPanel-flKKwKpM.js} +38 -38
- package/dist/{LoadingTrack-BexpNuTV.js → LoadingTrack-C2T8ixEL.js} +3 -3
- package/dist/{MergeTagModeToggle-P-UguQHc.js → MergeTagModeToggle-PKCoKAoF.js} +43 -43
- package/dist/{MergeTagSuggestion-BJ43ihWR.js → MergeTagSuggestion-DGha0WRp.js} +46 -46
- package/dist/{cdn/chunks/NumberWithSuffix-BXrRdfq1.js → NumberWithSuffix-DdPCXfKf.js} +42 -44
- package/dist/{ParagraphEditor-CLvv5Ija.js → ParagraphEditor-vDU-5y6r.js} +202 -199
- package/dist/RestoreVersionDialog-DIn1muFD.js +86 -0
- package/dist/{RichTextEditorContent-fbYJXAio.js → RichTextEditorContent-I83k5DtQ.js} +44 -44
- package/dist/SaveBlockDialog-C_QvYAeL.js +266 -0
- package/dist/{SavedBlocksBrowserModal-KWlaiLlr.js → SavedBlocksBrowserModal-CefWWcdT.js} +116 -115
- package/dist/{cdn/chunks/SavedBlocksPanels-e4HyTZ8v.js → SavedBlocksPanels-DnQwO-7O.js} +9 -11
- package/dist/{SavedBlocksPickBar-C3h8oL3r.js → SavedBlocksPickBar-BsFubArH.js} +17 -17
- package/dist/{TemplateScoringPanel-BZUsb3FD.js → TemplateScoringPanel-Bv_bBsJi.js} +87 -87
- package/dist/TestEmailModal-STPWDP79.js +206 -0
- package/dist/{cdn/chunks/TestEmailPanel-CZAG1gQE.js → TestEmailPanel-HYVjApKZ.js} +4 -6
- package/dist/TitleEditor-DnB0EJ_g.js +198 -0
- package/dist/TplModal-chvLhXmC.js +49 -0
- package/dist/VersionHistoryMenu-Cq4rH56t.js +155 -0
- package/dist/VersionHistoryPanels-D7k_F7-9.js +46 -0
- package/dist/VersionPreviewBanner-DthyHe6C.js +38 -0
- package/dist/{blockTypeIcons-2_85L_CL.js → blockTypeIcons-B8r4jMBn.js} +6 -6
- package/dist/bundle-stats.json +8 -8
- package/dist/{ca-D1zgI9fQ.js → ca-Cqg9O8mx.js} +69 -6
- package/dist/cdn/chunks/{AiChatSidebar-CQ8KUmNB.js → AiChatSidebar-DTUoBH5a.js} +54 -54
- package/dist/cdn/chunks/AiChatSidebar-DTUoBH5a.js.map +1 -0
- package/dist/cdn/chunks/AiFeatureMenu-Dyh7mUMB.js +57 -0
- package/dist/cdn/chunks/AiFeatureMenu-Dyh7mUMB.js.map +1 -0
- package/dist/cdn/chunks/{BlockIssueBadge-BEEY9o2o.js → BlockIssueBadge-UzSSOM_2.js} +13 -13
- package/dist/cdn/chunks/{BlockIssueBadge-BEEY9o2o.js.map → BlockIssueBadge-UzSSOM_2.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-DPtiMsVz.js → BlockPreviewCanvas-DStQFo9P.js} +42 -42
- package/dist/cdn/chunks/{BlockPreviewCanvas-DPtiMsVz.js.map → BlockPreviewCanvas-DStQFo9P.js.map} +1 -1
- package/dist/cdn/chunks/CloudHeaderExtras-BZVu7dnO.js +60 -0
- package/dist/cdn/chunks/CloudHeaderExtras-BZVu7dnO.js.map +1 -0
- package/dist/cdn/chunks/CloudPanels-CXbaBKHQ.js +227 -0
- package/dist/cdn/chunks/CloudPanels-CXbaBKHQ.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-BF469_AN.js → CollaboratorBar-BH_lZlat.js} +22 -22
- package/dist/cdn/chunks/CollaboratorBar-BH_lZlat.js.map +1 -0
- package/dist/cdn/chunks/ColorPicker-CStXen0Y.js +502 -0
- package/dist/cdn/chunks/ColorPicker-CStXen0Y.js.map +1 -0
- package/dist/cdn/chunks/CommentsPanel-jzZ2X0P4.js +20 -0
- package/dist/cdn/chunks/CommentsPanel-jzZ2X0P4.js.map +1 -0
- package/dist/cdn/chunks/CommentsSidebar-Dxke-vUP.js +460 -0
- package/dist/cdn/chunks/CommentsSidebar-Dxke-vUP.js.map +1 -0
- package/dist/{CountdownBlock-DuyvGcr8.js → cdn/chunks/CountdownBlock-BYSrJWxg.js} +25 -23
- package/dist/cdn/chunks/{CountdownBlock-vLTkTI9e.js.map → CountdownBlock-BYSrJWxg.js.map} +1 -1
- package/dist/{CountdownToolbar-CBE9wRaV.js → cdn/chunks/CountdownToolbar-CZPtQIb8.js} +66 -63
- package/dist/cdn/chunks/{CountdownToolbar-DPjcgcVR.js.map → CountdownToolbar-CZPtQIb8.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-B-HFXV0W.js → DesignReferenceSidebar-sZWciECR.js} +64 -64
- package/dist/cdn/chunks/DesignReferenceSidebar-sZWciECR.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-DKTS4QVb.js → IssuesPanel-CHtetM9i.js} +36 -36
- package/dist/cdn/chunks/IssuesPanel-CHtetM9i.js.map +1 -0
- package/dist/cdn/chunks/{LoadingTrack-C52ZGL5q.js → LoadingTrack-Dp_QZvAK.js} +3 -3
- package/dist/cdn/chunks/{LoadingTrack-C52ZGL5q.js.map → LoadingTrack-Dp_QZvAK.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-DQ79SqQc.js → MergeTagModeToggle-ZwW-5EeN.js} +39 -39
- package/dist/cdn/chunks/{MergeTagModeToggle-DQ79SqQc.js.map → MergeTagModeToggle-ZwW-5EeN.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-Dn8dExNa.js → MergeTagSuggestion-DhllqTA3.js} +47 -47
- package/dist/cdn/chunks/MergeTagSuggestion-DhllqTA3.js.map +1 -0
- package/dist/{NumberWithSuffix-D37ZWiZh.js → cdn/chunks/NumberWithSuffix-yeQLcCyH.js} +37 -35
- package/dist/cdn/chunks/NumberWithSuffix-yeQLcCyH.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-Bzcma_Lm.js → ParagraphEditor-BJJ925sx.js} +235 -233
- package/dist/cdn/chunks/ParagraphEditor-BJJ925sx.js.map +1 -0
- package/dist/cdn/chunks/RestoreVersionDialog-B0Jadu6F.js +87 -0
- package/dist/cdn/chunks/RestoreVersionDialog-B0Jadu6F.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-DtL49Jpo.js → RichTextEditorContent-CfSq2wPR.js} +44 -44
- package/dist/cdn/chunks/RichTextEditorContent-CfSq2wPR.js.map +1 -0
- package/dist/cdn/chunks/SaveBlockDialog-C1DXh6P9.js +265 -0
- package/dist/cdn/chunks/SaveBlockDialog-C1DXh6P9.js.map +1 -0
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-C59D4G5C.js → SavedBlocksBrowserModal-BerMxAUt.js} +114 -113
- package/dist/cdn/chunks/SavedBlocksBrowserModal-BerMxAUt.js.map +1 -0
- package/dist/{SavedBlocksPanels-CQsZvWO_.js → cdn/chunks/SavedBlocksPanels-BUE4lzVP.js} +11 -9
- package/dist/cdn/chunks/{SavedBlocksPanels-e4HyTZ8v.js.map → SavedBlocksPanels-BUE4lzVP.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-DMHxPCM4.js → SavedBlocksPickBar-4HrqQfvl.js} +17 -17
- package/dist/cdn/chunks/SavedBlocksPickBar-4HrqQfvl.js.map +1 -0
- package/dist/cdn/chunks/{TemplateScoringPanel-NucRtAP0.js → TemplateScoringPanel-Xdkp2EMY.js} +81 -81
- package/dist/cdn/chunks/TemplateScoringPanel-Xdkp2EMY.js.map +1 -0
- package/dist/cdn/chunks/TestEmailModal-yfmFiavR.js +206 -0
- package/dist/cdn/chunks/TestEmailModal-yfmFiavR.js.map +1 -0
- package/dist/{TestEmailPanel-B6goIAxT.js → cdn/chunks/TestEmailPanel-DqTDh5ri.js} +6 -4
- package/dist/cdn/chunks/{TestEmailPanel-CZAG1gQE.js.map → TestEmailPanel-DqTDh5ri.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-D0_LY2Ex.js → TitleEditor-nUAF7fKr.js} +85 -84
- package/dist/cdn/chunks/TitleEditor-nUAF7fKr.js.map +1 -0
- package/dist/cdn/chunks/TplModal-C0IqikoV.js +50 -0
- package/dist/cdn/chunks/TplModal-C0IqikoV.js.map +1 -0
- package/dist/cdn/chunks/VersionHistoryMenu-_MAj3qZj.js +148 -0
- package/dist/cdn/chunks/VersionHistoryMenu-_MAj3qZj.js.map +1 -0
- package/dist/cdn/chunks/VersionHistoryPanels-6Hz9w20W.js +48 -0
- package/dist/cdn/chunks/VersionHistoryPanels-6Hz9w20W.js.map +1 -0
- package/dist/cdn/chunks/VersionPreviewBanner-D098_6_I.js +40 -0
- package/dist/cdn/chunks/VersionPreviewBanner-D098_6_I.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-FXlMM3PL.js → blockTypeIcons-hX_W4dqo.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-FXlMM3PL.js.map → blockTypeIcons-hX_W4dqo.js.map} +1 -1
- package/dist/cdn/chunks/{ca-D1zgI9fQ.js → ca-Cqg9O8mx.js} +70 -7
- package/dist/cdn/chunks/ca-Cqg9O8mx.js.map +1 -0
- package/dist/{cloud-qINCmQbn.js → cdn/chunks/cloud-BA0OpRh-.js} +400 -609
- package/dist/cdn/chunks/cloud-BA0OpRh-.js.map +1 -0
- package/dist/cdn/chunks/createCloudRuntime-DmzV7OnU.js +344 -0
- package/dist/cdn/chunks/createCloudRuntime-DmzV7OnU.js.map +1 -0
- package/dist/{de-DHra3lvx.js → cdn/chunks/de-BXmeeFbX.js} +71 -6
- package/dist/cdn/chunks/de-BXmeeFbX.js.map +1 -0
- package/dist/{de-uVoSP1xF.js → cdn/chunks/de-Dbwm2cON.js} +3 -54
- package/dist/cdn/chunks/de-Dbwm2cON.js.map +1 -0
- package/dist/cdn/chunks/{dist-B2HKGHnc.js → dist-CM8TB0VD.js} +136 -136
- package/dist/cdn/chunks/{dist-B2HKGHnc.js.map → dist-CM8TB0VD.js.map} +1 -1
- package/dist/cdn/chunks/{dist-C6z8AjBC.js → dist-CYLJiSiH.js} +63 -63
- package/dist/cdn/chunks/{dist-C6z8AjBC.js.map → dist-CYLJiSiH.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-DCs9qL-b.js → draggable-BfpsXFg7.js} +916 -905
- package/dist/cdn/chunks/{draggable-DCs9qL-b.js.map → draggable-BfpsXFg7.js.map} +1 -1
- package/dist/cdn/chunks/{en-DlqX2YWZ.js → en-DbBNy67B.js} +70 -7
- package/dist/cdn/chunks/en-DbBNy67B.js.map +1 -0
- package/dist/{en-CjhsJxb-.js → cdn/chunks/en-Dzw4EqNI.js} +3 -54
- package/dist/cdn/chunks/en-Dzw4EqNI.js.map +1 -0
- package/dist/cdn/chunks/{es-Cuss2snv.js → es-JUsAjxWu.js} +70 -7
- package/dist/cdn/chunks/es-JUsAjxWu.js.map +1 -0
- package/dist/cdn/chunks/{extensions-C7h52yuk.js → extensions-CMcVw2uu.js} +81 -67
- package/dist/cdn/chunks/extensions-CMcVw2uu.js.map +1 -0
- package/dist/{fr-Cm85vB2g.js → cdn/chunks/fr-J3qgXH4h.js} +71 -6
- package/dist/cdn/chunks/fr-J3qgXH4h.js.map +1 -0
- package/dist/cdn/chunks/{icons-CvYN6zrM.js → icons-C36Ha5VU.js} +11 -11
- package/dist/cdn/chunks/{icons-CvYN6zrM.js.map → icons-C36Ha5VU.js.map} +1 -1
- package/dist/{keys-fwF3qZax.js → cdn/chunks/keys-CbQuRX85.js} +6 -4
- package/dist/cdn/chunks/keys-CbQuRX85.js.map +1 -0
- package/dist/cdn/chunks/logger-ByvdoAwq.js +23 -0
- package/dist/cdn/chunks/logger-ByvdoAwq.js.map +1 -0
- package/dist/cdn/chunks/{nl-dmiIX7oT.js → nl-D_4DkqOi.js} +70 -7
- package/dist/cdn/chunks/nl-D_4DkqOi.js.map +1 -0
- package/dist/cdn/chunks/preRenderCustomBlocks-CbA3RcAy.js +23 -0
- package/dist/cdn/chunks/preRenderCustomBlocks-CbA3RcAy.js.map +1 -0
- package/dist/{pt-BR-CTzHTqJD.js → cdn/chunks/pt-BR-BxzQzWGJ.js} +3 -54
- package/dist/cdn/chunks/pt-BR-BxzQzWGJ.js.map +1 -0
- package/dist/cdn/chunks/{pt-BR-CaIG-7EM.js → pt-BR-KGURyEEQ.js} +70 -7
- package/dist/cdn/chunks/pt-BR-KGURyEEQ.js.map +1 -0
- package/dist/cdn/chunks/{src-CUKUsRzX.js → src-BOjFLNf7.js} +148 -134
- package/dist/cdn/chunks/src-BOjFLNf7.js.map +1 -0
- package/dist/cdn/chunks/{src-xkGep9eN.js → src-Dq3fgSIx.js} +1448 -1458
- package/dist/cdn/chunks/src-Dq3fgSIx.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-ByDqaYj_.js +61 -0
- package/dist/cdn/chunks/styleConstants-ByDqaYj_.js.map +1 -0
- package/dist/cdn/chunks/timeouts-DHPZQ0G3.js +6 -0
- package/dist/cdn/chunks/timeouts-DHPZQ0G3.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C44S1Cmh.js → tiptap-DmpGap5g.js} +40 -40
- package/dist/cdn/chunks/{tiptap-C44S1Cmh.js.map → tiptap-DmpGap5g.js.map} +1 -1
- package/dist/cdn/chunks/{useAliveFlag-Dxwgo6P4.js → useAliveFlag-Dtm174fG.js} +2 -2
- package/dist/cdn/chunks/{useAliveFlag-Dxwgo6P4.js.map → useAliveFlag-Dtm174fG.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-8wkJtuJD.js → useCloudI18n-NVa1aeY8.js} +5 -5
- package/dist/cdn/chunks/{useCloudI18n-8wkJtuJD.js.map → useCloudI18n-NVa1aeY8.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-CKQ9gmoo.js → useEditorCore-CTu_qZ3W.js} +1434 -1147
- package/dist/cdn/chunks/useEditorCore-CTu_qZ3W.js.map +1 -0
- package/dist/cdn/chunks/{useI18n-UMs0F71x.js → useI18n-DVWCJJFH.js} +5 -5
- package/dist/cdn/chunks/{useI18n-UMs0F71x.js.map → useI18n-DVWCJJFH.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-JmXOtpln.js → useMergeTag-BfZBRPQp.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-JmXOtpln.js.map → useMergeTag-BfZBRPQp.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-cf8Y-ynK.js → usePopoverPosition-BC-HA7TK.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-cf8Y-ynK.js.map → usePopoverPosition-BC-HA7TK.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +5103 -284
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-On4TSac-.js → check-DZbmkMQe.js} +1 -1
- package/dist/{chevron-down-69EiBGoB.js → chevron-down-nYScOLeZ.js} +1 -1
- package/dist/{chevron-up-Dh3MG1Dw.js → chevron-up-CpYpDLnc.js} +1 -1
- package/dist/{circle-alert-cilwzafX.js → circle-alert-CuuK6thq.js} +1 -1
- package/dist/{clock-Dt0APH92.js → clock-DxkrtqOr.js} +1 -1
- package/dist/cloud-BAefVBb_.js +1444 -0
- package/dist/createCloudRuntime-Bt8W-ajI.js +342 -0
- package/dist/{createLucideIcon-C8WzBYCv.js → createLucideIcon-L-wQXW_R.js} +9 -9
- package/dist/{cdn/chunks/de-DHra3lvx.js → de-BXmeeFbX.js} +69 -8
- package/dist/{cdn/chunks/de-uVoSP1xF.js → de-Dbwm2cON.js} +1 -56
- package/dist/dist-B5iReTtK.js +251 -0
- package/dist/{dist-Cl8J0IES.js → dist-Ck9roB6K.js} +42 -42
- package/dist/{dist-BpKxrUi2.js → dist-CqcGTIiX.js} +46 -46
- package/dist/{en-DlqX2YWZ.js → en-DbBNy67B.js} +69 -6
- package/dist/{cdn/chunks/en-CjhsJxb-.js → en-Dzw4EqNI.js} +1 -56
- package/dist/{es-Cuss2snv.js → es-JUsAjxWu.js} +69 -6
- package/dist/{extensions-DzKNPITR.js → extensions-CX87G4aL.js} +71 -57
- package/dist/{cdn/chunks/fr-Cm85vB2g.js → fr-J3qgXH4h.js} +69 -8
- package/dist/{image-up-Ceggh_R3.js → image-up-DouZRGVt.js} +1 -1
- package/dist/index.d.ts +499 -23
- package/dist/{info-DO5odBcZ.js → info-puX5V6Iq.js} +1 -1
- package/dist/{cdn/chunks/keys-Cmc2Yl3D.js → keys-BxixS0TN.js} +4 -6
- package/dist/{list-checks-BSkPKbuI.js → list-checks-jw-ZlvWY.js} +1 -1
- package/dist/{loader-circle-bO7o7_HD.js → loader-circle-DqTxB7Kr.js} +1 -1
- package/dist/logger-BBlvSn6q.js +21 -0
- package/dist/{message-circle-BEkAk65X.js → message-circle-BZ7YpB22.js} +1 -1
- package/dist/{nl-dmiIX7oT.js → nl-D_4DkqOi.js} +69 -6
- package/dist/{pencil-t6m0EtKL.js → pencil-DmbRhTJu.js} +1 -1
- package/dist/preRenderCustomBlocks-BebjKtmw.js +21 -0
- package/dist/{cdn/chunks/pt-BR-CTzHTqJD.js → pt-BR-BxzQzWGJ.js} +1 -56
- package/dist/{pt-BR-CaIG-7EM.js → pt-BR-KGURyEEQ.js} +69 -6
- package/dist/{refresh-cw-CkOYVzK5.js → refresh-cw-OK_O-cL0.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-CepEmvwF.js → runtime-dom.esm-bundler-BgKXIPLV.js} +144 -144
- package/dist/{scan-line-DwSVj25O.js → scan-line-DyaSTsJ5.js} +1 -1
- package/dist/{send-CWsWN8PQ.js → send-B-wasJJC.js} +1 -1
- package/dist/{shield-check-qje8Kufw.js → shield-check-DUIyRrTo.js} +1 -1
- package/dist/{sparkles-DumaWRW-.js → sparkles-DYEMATWC.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styleConstants-ByDqaYj_.js +59 -0
- package/dist/templatical-editor.js +5303 -289
- package/dist/{text-align-start-Ir8Ah4mT.js → text-align-start-CzjLeBLe.js} +1 -1
- package/dist/timeouts-DHPZQ0G3.js +4 -0
- package/dist/{trash-2-CklAFCmO.js → trash-2-C0shEPry.js} +1 -1
- package/dist/{triangle-alert-BBi4n93g.js → triangle-alert-Fw0ce8oQ.js} +1 -1
- package/dist/{upload-sVqqppuv.js → upload-D69C2CBx.js} +3 -4
- package/dist/{useAliveFlag-cvyBxHp7.js → useAliveFlag-BGIAZii_.js} +1 -1
- package/dist/{useCloudI18n-DKVm6PCa.js → useCloudI18n-CAZTZ9_a.js} +2 -2
- package/dist/{useEditorCore-idmPLUeb.js → useEditorCore-B-kONNRw.js} +1604 -1320
- package/dist/{useI18n-DoVKdCTH.js → useI18n-BfXff_Sy.js} +2 -2
- package/dist/{useMergeTag-CYZk7dZD.js → useMergeTag-Dd4I7kge.js} +3 -3
- package/dist/usePopoverPosition-CxhCX3SQ.js +59 -0
- package/dist/{vue.runtime.esm-bundler-D1diBMsm.js → vue.runtime.esm-bundler-DzEsDRtY.js} +447 -436
- package/dist/{x-Mby7KlhS.js → x-BjTlFqRv.js} +1 -1
- package/package.json +7 -7
- package/dist/AiFeatureMenu-BY6mubnR.js +0 -63
- package/dist/BlockPreviewCanvas-DbNOqSI1.js +0 -121
- package/dist/CloudEditor-DEnMNMbm.js +0 -1188
- package/dist/ColorPicker-ClETsjA3.js +0 -550
- package/dist/CommentsSidebar-CdRCCSDD.js +0 -435
- package/dist/SaveBlockDialog-fVp_PwZi.js +0 -265
- package/dist/SnapshotHistory-DjA3Ej_i.js +0 -128
- package/dist/TestEmailModal-EM0RP_9L.js +0 -205
- package/dist/TitleEditor-JEaP9jVF.js +0 -197
- package/dist/TplModal-DoneXIj_.js +0 -49
- package/dist/cdn/chunks/AiChatSidebar-CQ8KUmNB.js.map +0 -1
- package/dist/cdn/chunks/AiFeatureMenu-Cwj8afsi.js +0 -63
- package/dist/cdn/chunks/AiFeatureMenu-Cwj8afsi.js.map +0 -1
- package/dist/cdn/chunks/CloudEditor-CQ830jJt.js +0 -1166
- package/dist/cdn/chunks/CloudEditor-CQ830jJt.js.map +0 -1
- package/dist/cdn/chunks/CollaboratorBar-BF469_AN.js.map +0 -1
- package/dist/cdn/chunks/ColorPicker-W_UyiVGc.js +0 -552
- package/dist/cdn/chunks/ColorPicker-W_UyiVGc.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-BLRZRSSC.js +0 -412
- package/dist/cdn/chunks/CommentsSidebar-BLRZRSSC.js.map +0 -1
- package/dist/cdn/chunks/DesignReferenceSidebar-B-HFXV0W.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-DKTS4QVb.js.map +0 -1
- package/dist/cdn/chunks/MergeTagSuggestion-Dn8dExNa.js.map +0 -1
- package/dist/cdn/chunks/NumberWithSuffix-BXrRdfq1.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-Bzcma_Lm.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-DtL49Jpo.js.map +0 -1
- package/dist/cdn/chunks/SaveBlockDialog-BfNVeXXV.js +0 -264
- package/dist/cdn/chunks/SaveBlockDialog-BfNVeXXV.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-C59D4G5C.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksPickBar-DMHxPCM4.js.map +0 -1
- package/dist/cdn/chunks/SnapshotHistory-80tAU_VX.js +0 -121
- package/dist/cdn/chunks/SnapshotHistory-80tAU_VX.js.map +0 -1
- package/dist/cdn/chunks/TemplateScoringPanel-NucRtAP0.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-DdWfAGNe.js +0 -205
- package/dist/cdn/chunks/TestEmailModal-DdWfAGNe.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-D0_LY2Ex.js.map +0 -1
- package/dist/cdn/chunks/TplModal-iCmoKB2k.js +0 -50
- package/dist/cdn/chunks/TplModal-iCmoKB2k.js.map +0 -1
- package/dist/cdn/chunks/ca-D1zgI9fQ.js.map +0 -1
- package/dist/cdn/chunks/cloud-DcC8bPwn.js +0 -1787
- package/dist/cdn/chunks/cloud-DcC8bPwn.js.map +0 -1
- package/dist/cdn/chunks/de-DHra3lvx.js.map +0 -1
- package/dist/cdn/chunks/de-uVoSP1xF.js.map +0 -1
- package/dist/cdn/chunks/en-CjhsJxb-.js.map +0 -1
- package/dist/cdn/chunks/en-DlqX2YWZ.js.map +0 -1
- package/dist/cdn/chunks/es-Cuss2snv.js.map +0 -1
- package/dist/cdn/chunks/extensions-C7h52yuk.js.map +0 -1
- package/dist/cdn/chunks/fr-Cm85vB2g.js.map +0 -1
- package/dist/cdn/chunks/keys-Cmc2Yl3D.js.map +0 -1
- package/dist/cdn/chunks/nl-dmiIX7oT.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CTzHTqJD.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CaIG-7EM.js.map +0 -1
- package/dist/cdn/chunks/src-CUKUsRzX.js.map +0 -1
- package/dist/cdn/chunks/src-xkGep9eN.js.map +0 -1
- package/dist/cdn/chunks/styles-CND3ey2g.js +0 -4140
- package/dist/cdn/chunks/styles-CND3ey2g.js.map +0 -1
- package/dist/cdn/chunks/timeouts-SsLMC4a3.js +0 -6
- package/dist/cdn/chunks/timeouts-SsLMC4a3.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-CKQ9gmoo.js.map +0 -1
- package/dist/styles-BK36D1sy.js +0 -4318
- package/dist/usePopoverPosition-C0dPEF4X.js +0 -308
package/dist/styles-BK36D1sy.js
DELETED
|
@@ -1,4318 +0,0 @@
|
|
|
1
|
-
import { A as e, Dt as t, Et as n, H as r, I as i, K as a, N as o, O as s, Ot as c, R as l, W as u, Y as d, _ as f, c as p, d as m, g as h, h as g, j as _, k as v, l as y, m as b, nt as x, q as S, r as C, s as w, u as T, w as E, x as D, y as O, z as k } from "./vue.runtime.esm-bundler-D1diBMsm.js";
|
|
2
|
-
import { a as A, c as j, o as M, s as N, t as P } from "./runtime-dom.esm-bundler-CepEmvwF.js";
|
|
3
|
-
import { t as F } from "./upload-sVqqppuv.js";
|
|
4
|
-
import { A as ee, E as I, M as L, N as R, T as z, a as B, c as V, f as te, k as ne, l as re, s as ie } from "./dist-B1kLn1rs.js";
|
|
5
|
-
import { B as ae, F as oe, I as H, J as se, K as ce, L as le, N as ue, U as de, V as fe, _ as pe, a as me, b as he, c as ge, f as _e, g as ve, h as ye, i as be, k as xe, l as Se, m as Ce, n as we, o as Te, p as Ee, r as De, s as Oe, u as ke, v as Ae, w as je, y as Me, z as Ne } from "./useEditorCore-idmPLUeb.js";
|
|
6
|
-
import { c as Pe, m as Fe } from "./dist-BpKxrUi2.js";
|
|
7
|
-
import { a as Ie, n as Le } from "./usePopoverPosition-C0dPEF4X.js";
|
|
8
|
-
import { A as Re, B as ze, G as Be, H as Ve, I as He, M as Ue, O as We, P as Ge, R as Ke, T as qe, U as Je, V as Ye, W as Xe, c as Ze, f as Qe, g as $e, h as et, k as tt, m as nt, n as rt, o as it, p as at, r as ot, s as st, u as ct, v as lt } from "./keys-fwF3qZax.js";
|
|
9
|
-
import { t as U } from "./useI18n-DoVKdCTH.js";
|
|
10
|
-
import { t as W } from "./createLucideIcon-C8WzBYCv.js";
|
|
11
|
-
import { n as ut, t as dt } from "./scan-line-DwSVj25O.js";
|
|
12
|
-
import { t as ft } from "./chevron-down-69EiBGoB.js";
|
|
13
|
-
import { t as pt } from "./circle-alert-cilwzafX.js";
|
|
14
|
-
import { i as mt, n as ht, r as gt, t as _t } from "./blockTypeIcons-2_85L_CL.js";
|
|
15
|
-
import { n as vt, t as yt } from "./refresh-cw-CkOYVzK5.js";
|
|
16
|
-
import { t as bt } from "./image-up-Ceggh_R3.js";
|
|
17
|
-
import { t as xt } from "./info-DO5odBcZ.js";
|
|
18
|
-
import { t as St } from "./list-checks-BSkPKbuI.js";
|
|
19
|
-
import { t as Ct } from "./loader-circle-bO7o7_HD.js";
|
|
20
|
-
import { i as wt, r as Tt } from "./MergeTagModeToggle-P-UguQHc.js";
|
|
21
|
-
import { t as Et } from "./sparkles-DumaWRW-.js";
|
|
22
|
-
import { n as Dt, r as Ot, t as kt } from "./text-align-start-Ir8Ah4mT.js";
|
|
23
|
-
import { t as At } from "./trash-2-CklAFCmO.js";
|
|
24
|
-
import { t as jt } from "./x-Mby7KlhS.js";
|
|
25
|
-
import { t as Mt } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
26
|
-
import { t as Nt } from "./useCloudI18n-DKVm6PCa.js";
|
|
27
|
-
import { t as Pt } from "./useMergeTag-CYZk7dZD.js";
|
|
28
|
-
import { t as Ft } from "./useAliveFlag-cvyBxHp7.js";
|
|
29
|
-
import { n as It, t as Lt } from "./emailFrameWidth-BmFCN2dp.js";
|
|
30
|
-
import { t as Rt } from "./readableTextColor-f8Kykfnh.js";
|
|
31
|
-
import { _ as zt, f as G, g as Bt, h as K, i as Vt, l as Ht, m as q, n as Ut, p as J, t as Y, u as Wt } from "./ColorPicker-ClETsjA3.js";
|
|
32
|
-
import { n as Gt, r as Kt } from "./MergeTagSuggestion-BJ43ihWR.js";
|
|
33
|
-
import { i as X, n as Z, r as Q, t as qt } from "./NumberWithSuffix-D37ZWiZh.js";
|
|
34
|
-
import { t as Jt } from "./TplModal-DoneXIj_.js";
|
|
35
|
-
var Yt = W("circle", [["circle", {
|
|
36
|
-
cx: "12",
|
|
37
|
-
cy: "12",
|
|
38
|
-
r: "10",
|
|
39
|
-
key: "1mglay"
|
|
40
|
-
}]]), Xt = W("globe", [
|
|
41
|
-
["circle", {
|
|
42
|
-
cx: "12",
|
|
43
|
-
cy: "12",
|
|
44
|
-
r: "10",
|
|
45
|
-
key: "1mglay"
|
|
46
|
-
}],
|
|
47
|
-
["path", {
|
|
48
|
-
d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",
|
|
49
|
-
key: "13o1zl"
|
|
50
|
-
}],
|
|
51
|
-
["path", {
|
|
52
|
-
d: "M2 12h20",
|
|
53
|
-
key: "9i4pu4"
|
|
54
|
-
}]
|
|
55
|
-
]), Zt = W("layout-template", [
|
|
56
|
-
["rect", {
|
|
57
|
-
width: "18",
|
|
58
|
-
height: "7",
|
|
59
|
-
x: "3",
|
|
60
|
-
y: "3",
|
|
61
|
-
rx: "1",
|
|
62
|
-
key: "f1a2em"
|
|
63
|
-
}],
|
|
64
|
-
["rect", {
|
|
65
|
-
width: "9",
|
|
66
|
-
height: "7",
|
|
67
|
-
x: "3",
|
|
68
|
-
y: "14",
|
|
69
|
-
rx: "1",
|
|
70
|
-
key: "jqznyg"
|
|
71
|
-
}],
|
|
72
|
-
["rect", {
|
|
73
|
-
width: "5",
|
|
74
|
-
height: "7",
|
|
75
|
-
x: "16",
|
|
76
|
-
y: "14",
|
|
77
|
-
rx: "1",
|
|
78
|
-
key: "q5h2i8"
|
|
79
|
-
}]
|
|
80
|
-
]), Qt = W("lock-open", [["rect", {
|
|
81
|
-
width: "18",
|
|
82
|
-
height: "11",
|
|
83
|
-
x: "3",
|
|
84
|
-
y: "11",
|
|
85
|
-
rx: "2",
|
|
86
|
-
ry: "2",
|
|
87
|
-
key: "1w4ew1"
|
|
88
|
-
}], ["path", {
|
|
89
|
-
d: "M7 11V7a5 5 0 0 1 9.9-1",
|
|
90
|
-
key: "1mm8w8"
|
|
91
|
-
}]]), $t = W("lock", [["rect", {
|
|
92
|
-
width: "18",
|
|
93
|
-
height: "11",
|
|
94
|
-
x: "3",
|
|
95
|
-
y: "11",
|
|
96
|
-
rx: "2",
|
|
97
|
-
ry: "2",
|
|
98
|
-
key: "1w4ew1"
|
|
99
|
-
}], ["path", {
|
|
100
|
-
d: "M7 11V7a5 5 0 0 1 10 0v4",
|
|
101
|
-
key: "fwvmzm"
|
|
102
|
-
}]]), en = W("moon", [["path", {
|
|
103
|
-
d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
|
|
104
|
-
key: "kfwtm"
|
|
105
|
-
}]]), tn = W("panel-top", [["rect", {
|
|
106
|
-
width: "18",
|
|
107
|
-
height: "18",
|
|
108
|
-
x: "3",
|
|
109
|
-
y: "3",
|
|
110
|
-
rx: "2",
|
|
111
|
-
key: "afitv7"
|
|
112
|
-
}], ["path", {
|
|
113
|
-
d: "M3 9h18",
|
|
114
|
-
key: "1pudct"
|
|
115
|
-
}]]), nn = W("plus", [["path", {
|
|
116
|
-
d: "M5 12h14",
|
|
117
|
-
key: "1ays0h"
|
|
118
|
-
}], ["path", {
|
|
119
|
-
d: "M12 5v14",
|
|
120
|
-
key: "s699le"
|
|
121
|
-
}]]), rn = W("rotate-ccw", [["path", {
|
|
122
|
-
d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
|
|
123
|
-
key: "1357e3"
|
|
124
|
-
}], ["path", {
|
|
125
|
-
d: "M3 3v5h5",
|
|
126
|
-
key: "1xhq8a"
|
|
127
|
-
}]]), an = W("settings", [["path", {
|
|
128
|
-
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
129
|
-
key: "1i5ecw"
|
|
130
|
-
}], ["circle", {
|
|
131
|
-
cx: "12",
|
|
132
|
-
cy: "12",
|
|
133
|
-
r: "3",
|
|
134
|
-
key: "1v7zrd"
|
|
135
|
-
}]]), on = W("square-plus", [
|
|
136
|
-
["rect", {
|
|
137
|
-
width: "18",
|
|
138
|
-
height: "18",
|
|
139
|
-
x: "3",
|
|
140
|
-
y: "3",
|
|
141
|
-
rx: "2",
|
|
142
|
-
key: "afitv7"
|
|
143
|
-
}],
|
|
144
|
-
["path", {
|
|
145
|
-
d: "M8 12h8",
|
|
146
|
-
key: "1wcyev"
|
|
147
|
-
}],
|
|
148
|
-
["path", {
|
|
149
|
-
d: "M12 8v8",
|
|
150
|
-
key: "napkw2"
|
|
151
|
-
}]
|
|
152
|
-
]), sn = W("square", [["rect", {
|
|
153
|
-
width: "18",
|
|
154
|
-
height: "18",
|
|
155
|
-
x: "3",
|
|
156
|
-
y: "3",
|
|
157
|
-
rx: "2",
|
|
158
|
-
key: "afitv7"
|
|
159
|
-
}]]), cn = W("sun", [
|
|
160
|
-
["circle", {
|
|
161
|
-
cx: "12",
|
|
162
|
-
cy: "12",
|
|
163
|
-
r: "4",
|
|
164
|
-
key: "4exip2"
|
|
165
|
-
}],
|
|
166
|
-
["path", {
|
|
167
|
-
d: "M12 2v2",
|
|
168
|
-
key: "tus03m"
|
|
169
|
-
}],
|
|
170
|
-
["path", {
|
|
171
|
-
d: "M12 20v2",
|
|
172
|
-
key: "1lh1kg"
|
|
173
|
-
}],
|
|
174
|
-
["path", {
|
|
175
|
-
d: "m4.93 4.93 1.41 1.41",
|
|
176
|
-
key: "149t6j"
|
|
177
|
-
}],
|
|
178
|
-
["path", {
|
|
179
|
-
d: "m17.66 17.66 1.41 1.41",
|
|
180
|
-
key: "ptbguv"
|
|
181
|
-
}],
|
|
182
|
-
["path", {
|
|
183
|
-
d: "M2 12h2",
|
|
184
|
-
key: "1t8f8n"
|
|
185
|
-
}],
|
|
186
|
-
["path", {
|
|
187
|
-
d: "M20 12h2",
|
|
188
|
-
key: "1q8mjw"
|
|
189
|
-
}],
|
|
190
|
-
["path", {
|
|
191
|
-
d: "m6.34 17.66-1.41 1.41",
|
|
192
|
-
key: "1m8zz5"
|
|
193
|
-
}],
|
|
194
|
-
["path", {
|
|
195
|
-
d: "m19.07 4.93-1.41 1.41",
|
|
196
|
-
key: "1shlcs"
|
|
197
|
-
}]
|
|
198
|
-
]);
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/composables/useSavedBlocksFeature.ts
|
|
201
|
-
function ln(e) {
|
|
202
|
-
let { provider: t, editor: n } = e, r = se({
|
|
203
|
-
provider: t,
|
|
204
|
-
onError: e.onError
|
|
205
|
-
}), a = d(!1), o = d(!1), s = d(!1), c = d(/* @__PURE__ */ new Set()), l = w(() => s.value), u = w(() => c.value.size);
|
|
206
|
-
function f(e) {
|
|
207
|
-
r.canCreate.value && (n.state.previewMode || (c.value = /* @__PURE__ */ new Set([e]), s.value = !0));
|
|
208
|
-
}
|
|
209
|
-
function p(e) {
|
|
210
|
-
if (!s.value) return;
|
|
211
|
-
let t = new Set(c.value);
|
|
212
|
-
t.has(e) ? t.delete(e) : t.add(e), c.value = t;
|
|
213
|
-
}
|
|
214
|
-
function m(e) {
|
|
215
|
-
return c.value.has(e);
|
|
216
|
-
}
|
|
217
|
-
function h() {
|
|
218
|
-
s.value = !1, c.value = /* @__PURE__ */ new Set();
|
|
219
|
-
}
|
|
220
|
-
function g() {
|
|
221
|
-
u.value !== 0 && (s.value = !1, a.value = !0, S());
|
|
222
|
-
}
|
|
223
|
-
function _() {
|
|
224
|
-
a.value = !1, c.value = /* @__PURE__ */ new Set();
|
|
225
|
-
}
|
|
226
|
-
i(() => n.state.previewMode, (e) => {
|
|
227
|
-
e && s.value && h();
|
|
228
|
-
});
|
|
229
|
-
function y() {
|
|
230
|
-
o.value = !0, S();
|
|
231
|
-
}
|
|
232
|
-
function b() {
|
|
233
|
-
o.value = !1;
|
|
234
|
-
}
|
|
235
|
-
function x(e, t) {
|
|
236
|
-
for (let r = 0; r < e.content.length; r++) {
|
|
237
|
-
let i = ie(e.content[r]), a = t === void 0 ? void 0 : t + r;
|
|
238
|
-
n.addBlock(i, void 0, void 0, a);
|
|
239
|
-
}
|
|
240
|
-
o.value = !1;
|
|
241
|
-
}
|
|
242
|
-
function S() {
|
|
243
|
-
r.load().catch(() => {});
|
|
244
|
-
}
|
|
245
|
-
let C = w(() => r.savedBlocks.value.length), T = w(() => e.isAvailable?.() ?? !0);
|
|
246
|
-
return v(Ke, r), {
|
|
247
|
-
headless: r,
|
|
248
|
-
isPicking: l,
|
|
249
|
-
pickedIds: c,
|
|
250
|
-
pickedCount: u,
|
|
251
|
-
startPicking: f,
|
|
252
|
-
togglePick: p,
|
|
253
|
-
isPicked: m,
|
|
254
|
-
confirmPicking: g,
|
|
255
|
-
cancelPicking: h,
|
|
256
|
-
isSaveDialogOpen: a,
|
|
257
|
-
closeSaveDialog: _,
|
|
258
|
-
isBrowserOpen: o,
|
|
259
|
-
openBrowser: y,
|
|
260
|
-
closeBrowser: b,
|
|
261
|
-
insert: x,
|
|
262
|
-
refresh: S,
|
|
263
|
-
capability: {
|
|
264
|
-
startPicking: f,
|
|
265
|
-
togglePick: p,
|
|
266
|
-
isPicked: m,
|
|
267
|
-
isPicking: l,
|
|
268
|
-
confirmPicking: g,
|
|
269
|
-
cancelPicking: h,
|
|
270
|
-
openBrowser: y,
|
|
271
|
-
count: C,
|
|
272
|
-
isAvailable: T,
|
|
273
|
-
canCreate: r.canCreate,
|
|
274
|
-
canUpdate: r.canUpdate,
|
|
275
|
-
canDelete: r.canDelete
|
|
276
|
-
},
|
|
277
|
-
count: C,
|
|
278
|
-
isAvailable: T
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
//#endregion
|
|
282
|
-
//#region src/utils/toMjml.ts
|
|
283
|
-
async function un() {
|
|
284
|
-
try {
|
|
285
|
-
return await import("@templatical/renderer");
|
|
286
|
-
} catch {
|
|
287
|
-
return null;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
async function dn(e) {
|
|
291
|
-
let t = await un();
|
|
292
|
-
if (!t) throw Error("[Templatical] toMjml() requires the @templatical/renderer package. Please install it.");
|
|
293
|
-
let n = e.getCustomBlockStylesheet;
|
|
294
|
-
return t.renderToMjml(e.getContent(), {
|
|
295
|
-
renderCustomBlock: e.renderCustomBlock,
|
|
296
|
-
...n ? { getCustomBlockStylesheet: (e) => n(e) } : {}
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region src/composables/useTestEmailFeature.ts
|
|
301
|
-
var fn = 1200;
|
|
302
|
-
function pn(e) {
|
|
303
|
-
let { provider: t } = e, n = d(!1), r = d(!1), i = d(!1), o = d(null), s = null, c = !1;
|
|
304
|
-
function l() {
|
|
305
|
-
s !== null && (clearTimeout(s), s = null);
|
|
306
|
-
}
|
|
307
|
-
a(l);
|
|
308
|
-
let u = w(() => t.allowedRecipients), f = w(() => {
|
|
309
|
-
let e = t.defaultRecipient;
|
|
310
|
-
if (e === void 0) return;
|
|
311
|
-
let n = u.value;
|
|
312
|
-
if (!(n && !n.includes(e))) return e;
|
|
313
|
-
}), p = w(() => u.value?.length === 0 ? !1 : e.isAvailable?.() ?? !0);
|
|
314
|
-
function m() {
|
|
315
|
-
p.value && (o.value = null, i.value = !1, l(), n.value = !0);
|
|
316
|
-
}
|
|
317
|
-
function h() {
|
|
318
|
-
l(), n.value = !1, i.value = !1;
|
|
319
|
-
}
|
|
320
|
-
async function g() {
|
|
321
|
-
if (!(!t.includeMjml || !e.renderMjml)) try {
|
|
322
|
-
return await e.renderMjml();
|
|
323
|
-
} catch (e) {
|
|
324
|
-
if (await un() === null) {
|
|
325
|
-
c || (c = !0, fe.warn("testEmail.includeMjml is set but @templatical/renderer is not installed — sending the template as JSON only. Install it to receive `payload.mjml`."));
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
throw e;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
async function _(n) {
|
|
332
|
-
if (r.value) return;
|
|
333
|
-
let a = u.value;
|
|
334
|
-
if (a && !a.includes(n)) {
|
|
335
|
-
o.value = { kind: "recipientNotAllowed" };
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
r.value = !0, o.value = null;
|
|
339
|
-
try {
|
|
340
|
-
let r = await g();
|
|
341
|
-
await t.send({
|
|
342
|
-
recipient: n,
|
|
343
|
-
content: e.getContent(),
|
|
344
|
-
...r === void 0 ? {} : { mjml: r },
|
|
345
|
-
...a === void 0 ? {} : { allowedRecipients: a }
|
|
346
|
-
}), i.value = !0, s = setTimeout(h, fn);
|
|
347
|
-
} catch (t) {
|
|
348
|
-
let n = t instanceof Error ? t : Error(String(t));
|
|
349
|
-
o.value = {
|
|
350
|
-
kind: "provider",
|
|
351
|
-
message: n.message
|
|
352
|
-
}, e.onError?.(n);
|
|
353
|
-
} finally {
|
|
354
|
-
r.value = !1;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return {
|
|
358
|
-
isModalOpen: n,
|
|
359
|
-
open: m,
|
|
360
|
-
close: h,
|
|
361
|
-
isSending: r,
|
|
362
|
-
justSent: i,
|
|
363
|
-
error: o,
|
|
364
|
-
send: _,
|
|
365
|
-
allowedRecipients: u,
|
|
366
|
-
defaultRecipient: f,
|
|
367
|
-
isAvailable: p,
|
|
368
|
-
capability: {
|
|
369
|
-
open: m,
|
|
370
|
-
isAvailable: p
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
//#endregion
|
|
375
|
-
//#region src/utils/resolveLintOptions.ts
|
|
376
|
-
function mn(e) {
|
|
377
|
-
return {
|
|
378
|
-
...e.lint,
|
|
379
|
-
locale: e.locale
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
//#endregion
|
|
383
|
-
//#region src/components/Canvas.vue?vue&type=script&setup=true&lang.ts
|
|
384
|
-
var hn = ["aria-label"], gn = {
|
|
385
|
-
key: 0,
|
|
386
|
-
role: "status",
|
|
387
|
-
"aria-busy": "true",
|
|
388
|
-
"data-testid": "preview-resolution-loading",
|
|
389
|
-
class: "tpl:flex tpl:flex-col tpl:gap-3 tpl:p-6"
|
|
390
|
-
}, _n = { class: "tpl:sr-only" }, vn = {
|
|
391
|
-
key: 1,
|
|
392
|
-
role: "status",
|
|
393
|
-
"data-testid": "preview-resolution-failed",
|
|
394
|
-
class: "tpl:mx-6 tpl:mt-4 tpl:rounded-md tpl:px-3 tpl:py-2 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg-hover)]"
|
|
395
|
-
}, yn = {
|
|
396
|
-
key: 0,
|
|
397
|
-
class: "tpl-canvas-empty-content tpl:flex tpl:flex-col tpl:items-center"
|
|
398
|
-
}, bn = { class: "tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]" }, xn = { class: "tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]" }, Sn = { class: "tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]" }, Cn = {
|
|
399
|
-
key: 0,
|
|
400
|
-
class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
401
|
-
}, wn = {
|
|
402
|
-
key: 1,
|
|
403
|
-
class: "tpl:m-0 tpl:mt-4 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
404
|
-
}, Tn = { class: "tpl:relative" }, En = {
|
|
405
|
-
class: "tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",
|
|
406
|
-
style: { "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 30%,\n transparent\n )" }
|
|
407
|
-
}, Dn = /*#__PURE__*/ Mt(/* @__PURE__ */ f({
|
|
408
|
-
__name: "Canvas",
|
|
409
|
-
props: {
|
|
410
|
-
viewport: {},
|
|
411
|
-
content: {},
|
|
412
|
-
selectedBlockId: {},
|
|
413
|
-
darkMode: { type: Boolean },
|
|
414
|
-
previewMode: { type: Boolean },
|
|
415
|
-
lockedBlocks: {}
|
|
416
|
-
},
|
|
417
|
-
emits: [
|
|
418
|
-
"select-block",
|
|
419
|
-
"open-ai-chat",
|
|
420
|
-
"open-design-reference"
|
|
421
|
-
],
|
|
422
|
-
setup(r, { emit: i }) {
|
|
423
|
-
let a = {
|
|
424
|
-
section: Oe,
|
|
425
|
-
title: Se,
|
|
426
|
-
paragraph: Ce,
|
|
427
|
-
image: ve,
|
|
428
|
-
button: Ne,
|
|
429
|
-
divider: Me,
|
|
430
|
-
spacer: be,
|
|
431
|
-
html: Ae,
|
|
432
|
-
social: me,
|
|
433
|
-
menu: ye,
|
|
434
|
-
table: De,
|
|
435
|
-
video: we,
|
|
436
|
-
custom: he
|
|
437
|
-
}, u = r, f = i, { t: h } = U(), { t: _ } = Nt(), S = Be($e, "Canvas"), E = D(Qe, null), O = D(st, null), A = D(Ze, {}), j = D(tt, null), N = D(He, null);
|
|
438
|
-
v(Xe, w(() => u.previewMode && (j?.value ?? !1) && !N?.isConfigured));
|
|
439
|
-
let P = w(() => (A.plan?.hasFeature("ai_generation") ?? !1) && (A.ai?.isFeatureEnabled("chat") ?? !1)), F = w(() => (A.plan?.hasFeature("ai_generation") ?? !1) && (A.ai?.isFeatureEnabled("designToTemplate") ?? !1)), ee = D(ot, null), I = w({
|
|
440
|
-
get: () => u.content.blocks,
|
|
441
|
-
set: (e) => {
|
|
442
|
-
S.setContent({
|
|
443
|
-
...u.content,
|
|
444
|
-
blocks: e
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
}), L = w(() => It(u.content.settings, u.viewport)), R = w(() => L.value + 192), z = w(() => _e(u.content.settings)), B = w(() => I.value.length === 0 && !u.previewMode), V = d(0), te = w(() => B.value && V.value > 0);
|
|
448
|
-
function ne() {
|
|
449
|
-
B.value && (V.value += 1);
|
|
450
|
-
}
|
|
451
|
-
function re() {
|
|
452
|
-
B.value && (V.value = Math.max(0, V.value - 1));
|
|
453
|
-
}
|
|
454
|
-
function ie() {
|
|
455
|
-
V.value = 0;
|
|
456
|
-
}
|
|
457
|
-
function ae(e) {
|
|
458
|
-
u.previewMode || A.savedBlocks?.isPicking.value || e.target === e.currentTarget && f("select-block", null);
|
|
459
|
-
}
|
|
460
|
-
function oe(e) {
|
|
461
|
-
return Ee(e, O, a);
|
|
462
|
-
}
|
|
463
|
-
function H(e) {
|
|
464
|
-
return u.lockedBlocks?.get(e) ?? null;
|
|
465
|
-
}
|
|
466
|
-
function se(e) {
|
|
467
|
-
if (u.previewMode || H(e)) return;
|
|
468
|
-
let t = A.savedBlocks;
|
|
469
|
-
if (t?.isPicking.value) {
|
|
470
|
-
t.togglePick(e);
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
f("select-block", e);
|
|
474
|
-
}
|
|
475
|
-
function ce(e) {
|
|
476
|
-
return A.savedBlocks?.isPicked(e) ?? !1;
|
|
477
|
-
}
|
|
478
|
-
let le = w(() => A.savedBlocks?.isPicking.value === !0);
|
|
479
|
-
function ue(e, t) {
|
|
480
|
-
e.type === "custom" && S.updateBlock(e.id, {
|
|
481
|
-
fieldValues: t.fieldValues,
|
|
482
|
-
dataSourceFetched: t.dataSourceFetched
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
return (i, a) => (s(), m("div", {
|
|
486
|
-
class: "tpl-canvas-stage tpl:relative tpl:flex tpl:justify-center tpl:rounded-lg",
|
|
487
|
-
style: t({
|
|
488
|
-
width: `${R.value}px`,
|
|
489
|
-
boxShadow: r.darkMode ? "none" : "var(--tpl-shadow-xl)",
|
|
490
|
-
transition: x(Lt)
|
|
491
|
-
})
|
|
492
|
-
}, [p("div", {
|
|
493
|
-
class: "tpl-canvas-bg tpl:absolute tpl:inset-0 tpl:rounded-lg tpl:pointer-events-none",
|
|
494
|
-
style: t({
|
|
495
|
-
backgroundColor: r.content.settings.backgroundColor,
|
|
496
|
-
...r.darkMode ? { filter: "invert(1) hue-rotate(180deg)" } : {},
|
|
497
|
-
transition: "filter 300ms ease"
|
|
498
|
-
})
|
|
499
|
-
}, null, 4), p("div", {
|
|
500
|
-
"data-testid": "canvas-wrapper",
|
|
501
|
-
role: "region",
|
|
502
|
-
"aria-label": x(h).landmarks.canvas,
|
|
503
|
-
class: "tpl-canvas-wrapper tpl:relative",
|
|
504
|
-
style: t({
|
|
505
|
-
width: `${L.value}px`,
|
|
506
|
-
transition: x(Lt)
|
|
507
|
-
})
|
|
508
|
-
}, [p("div", {
|
|
509
|
-
class: n(["tpl-canvas tpl:relative tpl:rounded-lg", {
|
|
510
|
-
"tpl-canvas--dark-mode": r.darkMode,
|
|
511
|
-
"tpl-preview-mode": r.previewMode
|
|
512
|
-
}]),
|
|
513
|
-
style: t(z.value),
|
|
514
|
-
onClick: ae
|
|
515
|
-
}, [x(N)?.isInitialResolve.value ? (s(), m("div", gn, [p("span", _n, c(x(h).previewResolution.resolving), 1), (s(), m(C, null, e(3, (e) => p("div", {
|
|
516
|
-
key: e,
|
|
517
|
-
"aria-hidden": "true",
|
|
518
|
-
class: "tpl-pulse tpl:h-16 tpl:rounded-md tpl:bg-[var(--tpl-bg-hover)]"
|
|
519
|
-
})), 64))])) : x(N)?.hasFailed.value ? (s(), m("p", vn, c(x(h).previewResolution.failed), 1)) : T("", !0), k(g(x(ge), {
|
|
520
|
-
modelValue: I.value,
|
|
521
|
-
"onUpdate:modelValue": a[2] ||= (e) => I.value = e,
|
|
522
|
-
group: "blocks",
|
|
523
|
-
animation: 150,
|
|
524
|
-
"ghost-class": "tpl-ghost",
|
|
525
|
-
"drag-class": "tpl-dragging",
|
|
526
|
-
handle: ".tpl-block-btn",
|
|
527
|
-
"invert-swap": !0,
|
|
528
|
-
"inverted-swap-threshold": .65,
|
|
529
|
-
disabled: r.previewMode,
|
|
530
|
-
draggable: ".tpl-block-item",
|
|
531
|
-
"force-fallback": !0,
|
|
532
|
-
class: n([
|
|
533
|
-
"tpl-canvas-blocks",
|
|
534
|
-
B.value ? "tpl-canvas-empty tpl:m-6 tpl:flex tpl:min-h-[400px] tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-xl tpl:border-2 tpl:border-dashed tpl:px-10 tpl:py-12 tpl:text-center tpl:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)] tpl:transition-colors tpl:duration-150" : "",
|
|
535
|
-
B.value && te.value ? "tpl-canvas-empty--drag-over tpl:border-[var(--tpl-primary-hover)] tpl:bg-[var(--tpl-primary-light)]" : "",
|
|
536
|
-
B.value && !te.value ? "tpl:border-[var(--tpl-primary)]" : ""
|
|
537
|
-
]),
|
|
538
|
-
onDragenter: ne,
|
|
539
|
-
onDragleave: re,
|
|
540
|
-
onDrop: ie
|
|
541
|
-
}, {
|
|
542
|
-
default: l(() => [B.value ? (s(), m("div", yn, [
|
|
543
|
-
p("div", bn, [g(x(on), {
|
|
544
|
-
size: 48,
|
|
545
|
-
"stroke-width": 1
|
|
546
|
-
})]),
|
|
547
|
-
p("p", xn, c(x(h).canvas.noBlocks), 1),
|
|
548
|
-
p("p", Sn, c(x(h).canvas.dragHint), 1),
|
|
549
|
-
P.value && x(_) ? (s(), m("p", Cn, [
|
|
550
|
-
b(c(x(h).canvas.aiHintChat) + " ", 1),
|
|
551
|
-
p("button", {
|
|
552
|
-
class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
|
|
553
|
-
onClick: a[0] ||= (e) => f("open-ai-chat")
|
|
554
|
-
}, [g(x(Et), {
|
|
555
|
-
size: 14,
|
|
556
|
-
"stroke-width": 2
|
|
557
|
-
}), b(" " + c(x(_).aiMenu.aiAssistant), 1)]),
|
|
558
|
-
b(" " + c(x(h).canvas.aiHintChatSuffix), 1)
|
|
559
|
-
])) : T("", !0),
|
|
560
|
-
F.value && x(_) ? (s(), m("p", wn, [
|
|
561
|
-
b(c(x(h).canvas.aiHintDesign) + " ", 1),
|
|
562
|
-
p("button", {
|
|
563
|
-
class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
|
|
564
|
-
onClick: a[1] ||= (e) => f("open-design-reference")
|
|
565
|
-
}, [g(x(bt), {
|
|
566
|
-
size: 14,
|
|
567
|
-
"stroke-width": 2
|
|
568
|
-
}), b(" " + c(x(_).aiMenu.designToTemplate), 1)]),
|
|
569
|
-
b(" " + c(x(h).canvas.aiHintDesignSuffix), 1)
|
|
570
|
-
])) : T("", !0)
|
|
571
|
-
])) : T("", !0), (s(!0), m(C, null, e(I.value, (e) => k((s(), m("div", {
|
|
572
|
-
key: e.id,
|
|
573
|
-
class: "tpl-block-item"
|
|
574
|
-
}, [p("div", Tn, [H(e.id) ? (s(), m("div", {
|
|
575
|
-
key: 0,
|
|
576
|
-
class: "tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
|
|
577
|
-
style: t({
|
|
578
|
-
outline: `2px solid ${H(e.id).color}`,
|
|
579
|
-
outlineOffset: "-1px"
|
|
580
|
-
})
|
|
581
|
-
}, [p("span", {
|
|
582
|
-
class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:flex tpl:-translate-x-1/2 tpl:-translate-y-full tpl:items-center tpl:gap-1 tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
|
|
583
|
-
style: t({
|
|
584
|
-
backgroundColor: H(e.id).color,
|
|
585
|
-
color: x(Rt)(H(e.id).color)
|
|
586
|
-
})
|
|
587
|
-
}, [p("span", En, c(H(e.id).name.charAt(0)), 1), b(" " + c(H(e.id).name), 1)], 4)], 4)) : T("", !0), g(ke, {
|
|
588
|
-
block: e,
|
|
589
|
-
"is-selected": !r.previewMode && !le.value && r.selectedBlockId === e.id && !H(e.id),
|
|
590
|
-
picked: ce(e.id),
|
|
591
|
-
viewport: r.viewport,
|
|
592
|
-
"preview-mode": r.previewMode,
|
|
593
|
-
onSelect: (t) => se(e.id)
|
|
594
|
-
}, {
|
|
595
|
-
default: l(() => [(s(), y(o(oe(e)), {
|
|
596
|
-
block: e,
|
|
597
|
-
viewport: r.viewport,
|
|
598
|
-
onFetchData: (t) => ue(e, t),
|
|
599
|
-
onUpdate: (t) => x(S).updateBlock(e.id, t)
|
|
600
|
-
}, null, 40, [
|
|
601
|
-
"block",
|
|
602
|
-
"viewport",
|
|
603
|
-
"onFetchData",
|
|
604
|
-
"onUpdate"
|
|
605
|
-
]))]),
|
|
606
|
-
_: 2
|
|
607
|
-
}, 1032, [
|
|
608
|
-
"block",
|
|
609
|
-
"is-selected",
|
|
610
|
-
"picked",
|
|
611
|
-
"viewport",
|
|
612
|
-
"preview-mode",
|
|
613
|
-
"onSelect"
|
|
614
|
-
])])])), [[M, x(ee) === !1 || !x(E)?.isHidden(e.id)]])), 128))]),
|
|
615
|
-
_: 1
|
|
616
|
-
}, 8, [
|
|
617
|
-
"modelValue",
|
|
618
|
-
"disabled",
|
|
619
|
-
"class"
|
|
620
|
-
]), [[M, !x(N)?.isInitialResolve.value]])], 6)], 12, hn)], 4));
|
|
621
|
-
}
|
|
622
|
-
}), [["__scopeId", "data-v-0af1c100"]]), On = f({
|
|
623
|
-
name: "CustomBlockStylesheets",
|
|
624
|
-
setup() {
|
|
625
|
-
let e = D(nt, null);
|
|
626
|
-
return () => e ? e.value.map((e, t) => O("style", {
|
|
627
|
-
key: t,
|
|
628
|
-
"data-tpl-custom-block-stylesheet": "",
|
|
629
|
-
innerHTML: e
|
|
630
|
-
})) : null;
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/utils/resolvePaletteBlocks.ts
|
|
635
|
-
function kn(e, t) {
|
|
636
|
-
if (!t || t.length === 0) return {
|
|
637
|
-
items: e,
|
|
638
|
-
unknown: []
|
|
639
|
-
};
|
|
640
|
-
let n = new Map(e.map((e) => [e.type, e])), r = [], i = [], a = /* @__PURE__ */ new Set();
|
|
641
|
-
for (let e of t) {
|
|
642
|
-
if (a.has(e)) continue;
|
|
643
|
-
a.add(e);
|
|
644
|
-
let t = n.get(e);
|
|
645
|
-
t ? r.push(t) : i.push(e);
|
|
646
|
-
}
|
|
647
|
-
return {
|
|
648
|
-
items: r,
|
|
649
|
-
unknown: i
|
|
650
|
-
};
|
|
651
|
-
}
|
|
652
|
-
//#endregion
|
|
653
|
-
//#region src/components/Sidebar.vue?vue&type=script&setup=true&lang.ts
|
|
654
|
-
var An = ["aria-label"], jn = {
|
|
655
|
-
key: 0,
|
|
656
|
-
class: "tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]"
|
|
657
|
-
}, Mn = ["aria-label"], Nn = {
|
|
658
|
-
key: 0,
|
|
659
|
-
class: "tpl:truncate tpl:text-sm tpl:font-medium"
|
|
660
|
-
}, Pn = [
|
|
661
|
-
"data-palette-type",
|
|
662
|
-
"aria-label",
|
|
663
|
-
"onClick",
|
|
664
|
-
"onKeydown"
|
|
665
|
-
], Fn = { class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:scale-105" }, In = {
|
|
666
|
-
key: 0,
|
|
667
|
-
class: "tpl:truncate tpl:text-sm tpl:font-medium"
|
|
668
|
-
}, Ln = /* @__PURE__ */ f({
|
|
669
|
-
__name: "Sidebar",
|
|
670
|
-
setup(n) {
|
|
671
|
-
let { t: r, format: a } = U(), u = D(at, []), f = D(Ge, void 0), h = D(it, void 0), _ = D($e, null), v = D(Ze, {}), b = w(() => v.savedBlocks?.isAvailable.value === !0), S = d(!1), E = d(!1);
|
|
672
|
-
function O() {
|
|
673
|
-
E.value || (S.value = !1);
|
|
674
|
-
}
|
|
675
|
-
function k() {
|
|
676
|
-
E.value = !0;
|
|
677
|
-
}
|
|
678
|
-
function A() {
|
|
679
|
-
E.value = !1, S.value = !1;
|
|
680
|
-
}
|
|
681
|
-
let j = [
|
|
682
|
-
"section",
|
|
683
|
-
"image",
|
|
684
|
-
"title",
|
|
685
|
-
"paragraph",
|
|
686
|
-
"button",
|
|
687
|
-
"divider",
|
|
688
|
-
"video",
|
|
689
|
-
"social",
|
|
690
|
-
"menu",
|
|
691
|
-
"table",
|
|
692
|
-
"spacer",
|
|
693
|
-
"html"
|
|
694
|
-
], M = w(() => {
|
|
695
|
-
let e = j.map((e) => ({
|
|
696
|
-
type: e,
|
|
697
|
-
label: de(e, r)
|
|
698
|
-
}));
|
|
699
|
-
return v.plan && e.splice(-1, 0, {
|
|
700
|
-
type: "countdown",
|
|
701
|
-
label: de("countdown", r)
|
|
702
|
-
}), e;
|
|
703
|
-
}), N = w(() => u.map((e) => ({
|
|
704
|
-
type: `custom:${e.type}`,
|
|
705
|
-
label: e.name,
|
|
706
|
-
isCustom: !0,
|
|
707
|
-
icon: e.icon
|
|
708
|
-
}))), P = w(() => [...M.value, ...N.value]), F = w(() => kn(P.value, f)), ee = w(() => F.value.items), I = /* @__PURE__ */ new Set();
|
|
709
|
-
i(() => F.value.unknown, (e) => {
|
|
710
|
-
for (let t of e) I.has(t) || (I.add(t), fe.warn(`config.paletteBlocks: "${t}" is not a built-in or registered custom block (use the "custom:" prefix for custom blocks) — skipping it in the palette.`));
|
|
711
|
-
}, { immediate: !0 });
|
|
712
|
-
function L(e) {
|
|
713
|
-
if (e.isCustom) {
|
|
714
|
-
let t = e.type.replace("custom:", ""), n = u.find((e) => e.type === t);
|
|
715
|
-
if (n) return te(n);
|
|
716
|
-
}
|
|
717
|
-
return re(e.type, h);
|
|
718
|
-
}
|
|
719
|
-
function R(e) {
|
|
720
|
-
if (!_) return;
|
|
721
|
-
let t = L(e);
|
|
722
|
-
_.addBlock(t), _.selectBlock(t.id);
|
|
723
|
-
}
|
|
724
|
-
function z(e, t) {
|
|
725
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), R(t));
|
|
726
|
-
}
|
|
727
|
-
return (n, i) => (s(), m("aside", {
|
|
728
|
-
"aria-label": x(r).sidebarNav.palette,
|
|
729
|
-
class: "tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:flex tpl:flex-col tpl:overflow-hidden",
|
|
730
|
-
style: t({
|
|
731
|
-
width: S.value ? "200px" : "48px",
|
|
732
|
-
backgroundColor: "var(--tpl-bg-elevated)",
|
|
733
|
-
borderRight: "1px solid var(--tpl-border)",
|
|
734
|
-
boxShadow: S.value ? "var(--tpl-shadow-lg)" : "none",
|
|
735
|
-
transition: "width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
736
|
-
}),
|
|
737
|
-
onMouseenter: i[1] ||= (e) => S.value = !0,
|
|
738
|
-
onMouseleave: O,
|
|
739
|
-
onFocusin: i[2] ||= (e) => S.value = !0,
|
|
740
|
-
onFocusout: i[3] ||= (e) => S.value = !1
|
|
741
|
-
}, [b.value ? (s(), m("div", jn, [p("button", {
|
|
742
|
-
type: "button",
|
|
743
|
-
"aria-label": x(r).sidebarNav.browseSavedBlocks,
|
|
744
|
-
class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)]",
|
|
745
|
-
style: t({ justifyContent: S.value ? "flex-start" : "center" }),
|
|
746
|
-
onClick: i[0] ||= (e) => x(v).savedBlocks?.openBrowser()
|
|
747
|
-
}, [g(x(gt), {
|
|
748
|
-
size: 20,
|
|
749
|
-
"stroke-width": 1.5,
|
|
750
|
-
class: "tpl:shrink-0"
|
|
751
|
-
}), S.value ? (s(), m("span", Nn, c(x(r).savedBlocks.title), 1)) : T("", !0)], 12, Mn)])) : T("", !0), g(x(ge), {
|
|
752
|
-
"model-value": ee.value,
|
|
753
|
-
group: {
|
|
754
|
-
name: "blocks",
|
|
755
|
-
pull: "clone",
|
|
756
|
-
put: !1
|
|
757
|
-
},
|
|
758
|
-
clone: L,
|
|
759
|
-
sort: !1,
|
|
760
|
-
animation: 150,
|
|
761
|
-
"force-fallback": !0,
|
|
762
|
-
class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-0.5 tpl:overflow-y-auto tpl:p-1",
|
|
763
|
-
onChoose: k,
|
|
764
|
-
onEnd: A
|
|
765
|
-
}, {
|
|
766
|
-
default: l(() => [(s(!0), m(C, null, e(ee.value, (e) => (s(), m("button", {
|
|
767
|
-
key: e.type,
|
|
768
|
-
type: "button",
|
|
769
|
-
"data-palette-type": e.type,
|
|
770
|
-
"aria-label": x(a)(x(r).sidebarNav.insertBlock, { block: e.label }),
|
|
771
|
-
class: "tpl:flex tpl:h-10 tpl:w-full tpl:shrink-0 tpl:cursor-grab tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] active:tpl:cursor-grabbing",
|
|
772
|
-
style: t({ justifyContent: S.value ? "flex-start" : "center" }),
|
|
773
|
-
onClick: (t) => R(e),
|
|
774
|
-
onKeydown: (t) => z(t, e)
|
|
775
|
-
}, [p("div", Fn, [x(_t)[e.type] ? (s(), y(o(x(_t)[e.type]), {
|
|
776
|
-
key: 0,
|
|
777
|
-
size: 20,
|
|
778
|
-
"stroke-width": 1.5
|
|
779
|
-
})) : e.isCustom ? (s(), y(xe, {
|
|
780
|
-
key: 1,
|
|
781
|
-
icon: e.icon,
|
|
782
|
-
size: 20
|
|
783
|
-
}, null, 8, ["icon"])) : T("", !0)]), S.value ? (s(), m("span", In, c(e.label), 1)) : T("", !0)], 44, Pn))), 128))]),
|
|
784
|
-
_: 1
|
|
785
|
-
}, 8, ["model-value"])], 44, An));
|
|
786
|
-
}
|
|
787
|
-
});
|
|
788
|
-
//#endregion
|
|
789
|
-
//#region src/utils/mergeTagTrigger.ts
|
|
790
|
-
function Rn(e, t, n, r) {
|
|
791
|
-
if (!n) return null;
|
|
792
|
-
let i = e.slice(0, t), a = i.lastIndexOf(n);
|
|
793
|
-
if (a === -1) return null;
|
|
794
|
-
let o = i.slice(a + n.length);
|
|
795
|
-
return /\s/.test(o) || r && o.includes(r) ? null : {
|
|
796
|
-
triggerStart: a,
|
|
797
|
-
caret: t,
|
|
798
|
-
query: o
|
|
799
|
-
};
|
|
800
|
-
}
|
|
801
|
-
//#endregion
|
|
802
|
-
//#region src/utils/textFieldCaret.ts
|
|
803
|
-
var zn = /* @__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(".");
|
|
804
|
-
function Bn(e, t, n) {
|
|
805
|
-
return {
|
|
806
|
-
left: e,
|
|
807
|
-
top: t,
|
|
808
|
-
bottom: n,
|
|
809
|
-
right: e,
|
|
810
|
-
width: 0,
|
|
811
|
-
height: n - t,
|
|
812
|
-
x: e,
|
|
813
|
-
y: t,
|
|
814
|
-
toJSON: () => ({})
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
function Vn(e, t) {
|
|
818
|
-
let n = e.ownerDocument, r = n.defaultView;
|
|
819
|
-
if (!r) return null;
|
|
820
|
-
let i = e.tagName === "INPUT", a = r.getComputedStyle(e), o = n.createElement("div");
|
|
821
|
-
o.setAttribute("aria-hidden", "true");
|
|
822
|
-
let s = o.style;
|
|
823
|
-
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";
|
|
824
|
-
let c = s, l = a;
|
|
825
|
-
for (let e of zn) c[e] = l[e];
|
|
826
|
-
i && (s.width = "auto", s.whiteSpace = "pre");
|
|
827
|
-
let u = e.value, d = u.slice(0, t);
|
|
828
|
-
i && (d = d.replace(/\s/g, "\xA0")), o.textContent = d;
|
|
829
|
-
let f = n.createElement("span");
|
|
830
|
-
f.textContent = u.slice(t) || ".", o.appendChild(f), n.body.appendChild(o);
|
|
831
|
-
let p = f.offsetTop, m = f.offsetLeft;
|
|
832
|
-
n.body.removeChild(o);
|
|
833
|
-
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;
|
|
834
|
-
if (i) return Bn(y, h.top, h.bottom);
|
|
835
|
-
let b = h.top + p + g - e.scrollTop;
|
|
836
|
-
return Bn(y, b, b + v);
|
|
837
|
-
}
|
|
838
|
-
//#endregion
|
|
839
|
-
//#region src/composables/useMergeTagAutocomplete.ts
|
|
840
|
-
var Hn = /* @__PURE__ */ new Set([
|
|
841
|
-
"ArrowLeft",
|
|
842
|
-
"ArrowRight",
|
|
843
|
-
"Home",
|
|
844
|
-
"End"
|
|
845
|
-
]);
|
|
846
|
-
function Un(e) {
|
|
847
|
-
let { elementRef: t, modelValue: n, emit: i, mergeTags: o, syntax: s, enabled: c, onInsert: l } = e, d = ee(s), f = ne(s), p = c && d !== null && o.length > 0, m = D(Ve, null), h = (u(m) ? m.value : m)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", g = Le(), _ = Gt(h, g), v = !1;
|
|
848
|
-
r() && a(() => {
|
|
849
|
-
v = !0, _.close();
|
|
850
|
-
});
|
|
851
|
-
function y(e) {
|
|
852
|
-
let t = e.value ?? "";
|
|
853
|
-
return Rn(t, e.selectionStart ?? t.length, d, f);
|
|
854
|
-
}
|
|
855
|
-
function b(e, r, a) {
|
|
856
|
-
let o = e.value ?? n(), s = o.slice(r.caret), c = f && s.startsWith(f) ? f.length : 0, u = o.slice(0, r.triggerStart), d = o.slice(r.caret + c), p = u + a.value + d, m = u.length + a.value.length;
|
|
857
|
-
l?.(), i(p), _.close(), E(() => {
|
|
858
|
-
if (v) return;
|
|
859
|
-
let e = t.value;
|
|
860
|
-
e?.focus(), e?.setSelectionRange(m, m);
|
|
861
|
-
});
|
|
862
|
-
}
|
|
863
|
-
function x() {
|
|
864
|
-
if (!p || v) return;
|
|
865
|
-
let e = t.value;
|
|
866
|
-
if (!e) {
|
|
867
|
-
_.close();
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
let n = y(e);
|
|
871
|
-
if (!n) {
|
|
872
|
-
_.close();
|
|
873
|
-
return;
|
|
874
|
-
}
|
|
875
|
-
let r = Kt(o, n.query), i = () => Vn(e, n.triggerStart), a = (t) => b(e, n, t);
|
|
876
|
-
_.isOpen() ? _.update({
|
|
877
|
-
items: r,
|
|
878
|
-
getRect: i,
|
|
879
|
-
onCommand: a
|
|
880
|
-
}) : _.open({
|
|
881
|
-
items: r,
|
|
882
|
-
getRect: i,
|
|
883
|
-
anchorEl: e,
|
|
884
|
-
onCommand: a
|
|
885
|
-
});
|
|
886
|
-
}
|
|
887
|
-
function S(e) {
|
|
888
|
-
return _.isOpen() ? e.key === "Escape" ? (_.close(), !0) : Hn.has(e.key) ? (_.close(), !1) : _.handleKeyDown(e) : !1;
|
|
889
|
-
}
|
|
890
|
-
return {
|
|
891
|
-
available: p,
|
|
892
|
-
refresh: x,
|
|
893
|
-
handleKeydown: S,
|
|
894
|
-
close: () => _.close(),
|
|
895
|
-
isOpen: () => _.isOpen()
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
//#endregion
|
|
899
|
-
//#region src/composables/useMergeTagField.ts
|
|
900
|
-
function Wn(e) {
|
|
901
|
-
let { modelValue: t, emit: n, elementRef: i } = e, { mergeTags: o, canRequestMergeTag: s, isRequesting: c, isMergeTagValue: l, getMergeTagLabel: u, requestMergeTag: f, syntax: p, autocomplete: m } = Pt(), { canInsertLogicTag: h, isRequesting: g, requestLogicTag: _ } = je(), v = d(!1), y = !1, b = !1;
|
|
902
|
-
r() && a(() => {
|
|
903
|
-
b = !0;
|
|
904
|
-
});
|
|
905
|
-
let x = Un({
|
|
906
|
-
elementRef: i,
|
|
907
|
-
modelValue: t,
|
|
908
|
-
emit: n,
|
|
909
|
-
mergeTags: o,
|
|
910
|
-
syntax: p,
|
|
911
|
-
enabled: m,
|
|
912
|
-
onInsert: () => {
|
|
913
|
-
v.value = !0;
|
|
914
|
-
}
|
|
915
|
-
}), S = w(() => {
|
|
916
|
-
let e = t();
|
|
917
|
-
if (!e) return [];
|
|
918
|
-
let n = [], r = `(${p.value.source}|${p.logic.source})`, i = new RegExp(r, "g"), a = 0, o;
|
|
919
|
-
for (; (o = i.exec(e)) !== null;) {
|
|
920
|
-
o.index > a && n.push({
|
|
921
|
-
type: "text",
|
|
922
|
-
value: e.slice(a, o.index)
|
|
923
|
-
});
|
|
924
|
-
let t = o[0];
|
|
925
|
-
l(t) ? n.push({
|
|
926
|
-
type: "mergeTag",
|
|
927
|
-
value: t,
|
|
928
|
-
label: u(t)
|
|
929
|
-
}) : R(t, p) ? n.push({
|
|
930
|
-
type: "logicMergeTag",
|
|
931
|
-
value: t,
|
|
932
|
-
keyword: I(t, p)
|
|
933
|
-
}) : n.push({
|
|
934
|
-
type: "text",
|
|
935
|
-
value: t
|
|
936
|
-
}), a = o.index + t.length;
|
|
937
|
-
}
|
|
938
|
-
return a < e.length && n.push({
|
|
939
|
-
type: "text",
|
|
940
|
-
value: e.slice(a)
|
|
941
|
-
}), n;
|
|
942
|
-
}), C = w(() => S.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
|
|
943
|
-
function T() {
|
|
944
|
-
v.value = !0, E(() => {
|
|
945
|
-
i.value?.focus();
|
|
946
|
-
let e = t()?.length || 0;
|
|
947
|
-
i.value?.setSelectionRange(e, e);
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
function D() {
|
|
951
|
-
y || (v.value = !1);
|
|
952
|
-
}
|
|
953
|
-
function O(e) {
|
|
954
|
-
n(e.target.value), x.refresh();
|
|
955
|
-
}
|
|
956
|
-
function k(e) {
|
|
957
|
-
if (x.handleKeydown(e)) {
|
|
958
|
-
e.preventDefault();
|
|
959
|
-
return;
|
|
960
|
-
}
|
|
961
|
-
e.key === "Escape" && D();
|
|
962
|
-
}
|
|
963
|
-
function A() {
|
|
964
|
-
x.refresh();
|
|
965
|
-
}
|
|
966
|
-
function j() {
|
|
967
|
-
x.close(), D();
|
|
968
|
-
}
|
|
969
|
-
function M() {
|
|
970
|
-
n("");
|
|
971
|
-
}
|
|
972
|
-
async function N() {
|
|
973
|
-
let e = v.value && i.value ? i.value.selectionStart ?? t().length : t().length;
|
|
974
|
-
y = !0;
|
|
975
|
-
let r;
|
|
976
|
-
try {
|
|
977
|
-
r = await f();
|
|
978
|
-
} finally {
|
|
979
|
-
y = !1;
|
|
980
|
-
}
|
|
981
|
-
if (!b && r) {
|
|
982
|
-
let a = t().slice(0, e), o = t().slice(e), s = a + r.value + o;
|
|
983
|
-
n(s), v.value = !0, E(() => {
|
|
984
|
-
if (b) return;
|
|
985
|
-
let t = e + r.value.length;
|
|
986
|
-
i.value?.focus(), i.value?.setSelectionRange(t, t);
|
|
987
|
-
});
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
async function P() {
|
|
991
|
-
let e = i.value, r = e?.selectionStart ?? t().length, a = e?.selectionEnd ?? r;
|
|
992
|
-
y = !0;
|
|
993
|
-
let o;
|
|
994
|
-
try {
|
|
995
|
-
o = await _();
|
|
996
|
-
} finally {
|
|
997
|
-
y = !1;
|
|
998
|
-
}
|
|
999
|
-
if (b || !o) return;
|
|
1000
|
-
let s = t(), c, l;
|
|
1001
|
-
"before" in o ? (c = s.slice(0, r) + o.before + s.slice(r, a) + o.after + s.slice(a), l = r + o.before.length + (a - r)) : (c = s.slice(0, r) + o.value + s.slice(r), l = r + o.value.length), n(c), v.value = !0, E(() => {
|
|
1002
|
-
b || (i.value?.focus(), i.value?.setSelectionRange(l, l));
|
|
1003
|
-
});
|
|
1004
|
-
}
|
|
1005
|
-
return {
|
|
1006
|
-
segments: S,
|
|
1007
|
-
hasMergeTags: C,
|
|
1008
|
-
canRequestMergeTag: s,
|
|
1009
|
-
isRequestingMergeTag: c,
|
|
1010
|
-
canInsertLogicTag: h,
|
|
1011
|
-
isRequestingLogicTag: g,
|
|
1012
|
-
isEditing: v,
|
|
1013
|
-
startEditing: T,
|
|
1014
|
-
stopEditing: D,
|
|
1015
|
-
handleInput: O,
|
|
1016
|
-
handleKeydown: k,
|
|
1017
|
-
handleClick: A,
|
|
1018
|
-
handleBlur: j,
|
|
1019
|
-
clearValue: M,
|
|
1020
|
-
insertMergeTag: N,
|
|
1021
|
-
insertLogicTag: P,
|
|
1022
|
-
autocompleteAvailable: x.available
|
|
1023
|
-
};
|
|
1024
|
-
}
|
|
1025
|
-
//#endregion
|
|
1026
|
-
//#region src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
|
|
1027
|
-
var Gn = ["aria-label", "onKeydown"], Kn = ["data-tooltip"], qn = ["data-tooltip"], Jn = {
|
|
1028
|
-
key: 2,
|
|
1029
|
-
class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
|
|
1030
|
-
}, Yn = ["aria-label", "title"], Xn = /* @__PURE__ */ f({
|
|
1031
|
-
__name: "MergeTagSegments",
|
|
1032
|
-
props: {
|
|
1033
|
-
segments: {},
|
|
1034
|
-
displayClass: {},
|
|
1035
|
-
pulse: { type: Boolean }
|
|
1036
|
-
},
|
|
1037
|
-
emits: ["edit", "clear"],
|
|
1038
|
-
setup(t, { emit: r }) {
|
|
1039
|
-
let i = r, { t: a } = U();
|
|
1040
|
-
function o() {
|
|
1041
|
-
i("edit");
|
|
1042
|
-
}
|
|
1043
|
-
return (r, l) => (s(), m("div", {
|
|
1044
|
-
role: "button",
|
|
1045
|
-
tabindex: "0",
|
|
1046
|
-
"aria-label": x(a).mergeTag.clickToEdit,
|
|
1047
|
-
class: n([t.displayClass, { "tpl-pulse-fill": t.pulse }]),
|
|
1048
|
-
onClick: o,
|
|
1049
|
-
onKeydown: [N(o, ["enter"]), N(j(o, ["prevent"]), ["space"])]
|
|
1050
|
-
}, [(s(!0), m(C, null, e(t.segments, (e, t) => (s(), m(C, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (s(), m("span", {
|
|
1051
|
-
key: 0,
|
|
1052
|
-
class: "tpl-tooltip 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",
|
|
1053
|
-
"data-tooltip": e.value,
|
|
1054
|
-
style: {
|
|
1055
|
-
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
1056
|
-
color: "var(--tpl-primary)"
|
|
1057
|
-
}
|
|
1058
|
-
}, c(e.label), 9, Kn)) : e.type === "logicMergeTag" ? (s(), m("span", {
|
|
1059
|
-
key: 1,
|
|
1060
|
-
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",
|
|
1061
|
-
"data-tooltip": e.value,
|
|
1062
|
-
style: {
|
|
1063
|
-
"background-color": "transparent",
|
|
1064
|
-
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
1065
|
-
color: "var(--tpl-primary)"
|
|
1066
|
-
}
|
|
1067
|
-
}, c(e.keyword), 9, qn)) : (s(), m("span", Jn, c(e.value), 1))], 64))), 128)), p("button", {
|
|
1068
|
-
type: "button",
|
|
1069
|
-
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 hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100",
|
|
1070
|
-
"aria-label": x(a).mergeTag.remove,
|
|
1071
|
-
title: x(a).mergeTag.remove,
|
|
1072
|
-
onClick: l[0] ||= j((e) => i("clear"), ["stop"])
|
|
1073
|
-
}, [g(x(jt), {
|
|
1074
|
-
size: 12,
|
|
1075
|
-
"stroke-width": 2.5
|
|
1076
|
-
})], 8, Yn)], 42, Gn));
|
|
1077
|
-
}
|
|
1078
|
-
}), Zn = [
|
|
1079
|
-
"aria-label",
|
|
1080
|
-
"title",
|
|
1081
|
-
"disabled"
|
|
1082
|
-
], Qn = "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] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]", $n = /* @__PURE__ */ f({
|
|
1083
|
-
__name: "MergeTagInsertButton",
|
|
1084
|
-
props: { disabled: { type: Boolean } },
|
|
1085
|
-
emits: ["insert"],
|
|
1086
|
-
setup(e) {
|
|
1087
|
-
let { t } = U();
|
|
1088
|
-
return (r, i) => (s(), m("button", {
|
|
1089
|
-
type: "button",
|
|
1090
|
-
class: n([Qn, "tpl:mt-1.5"]),
|
|
1091
|
-
"aria-label": x(t).mergeTag.insert,
|
|
1092
|
-
title: x(t).mergeTag.insert,
|
|
1093
|
-
disabled: e.disabled,
|
|
1094
|
-
onMousedown: i[0] ||= j(() => {}, ["prevent"]),
|
|
1095
|
-
onClick: i[1] ||= (e) => r.$emit("insert")
|
|
1096
|
-
}, [g(x(dt), {
|
|
1097
|
-
size: 12,
|
|
1098
|
-
"stroke-width": 2
|
|
1099
|
-
}), b(" " + c(x(t).mergeTag.insertShort), 1)], 42, Zn));
|
|
1100
|
-
}
|
|
1101
|
-
}), er = [
|
|
1102
|
-
"aria-label",
|
|
1103
|
-
"title",
|
|
1104
|
-
"disabled"
|
|
1105
|
-
], tr = "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] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]", nr = /* @__PURE__ */ f({
|
|
1106
|
-
__name: "LogicTagInsertButton",
|
|
1107
|
-
props: { disabled: { type: Boolean } },
|
|
1108
|
-
emits: ["insert"],
|
|
1109
|
-
setup(e) {
|
|
1110
|
-
let { t } = U();
|
|
1111
|
-
return (r, i) => (s(), m("button", {
|
|
1112
|
-
type: "button",
|
|
1113
|
-
class: n([tr, "tpl:mt-1.5"]),
|
|
1114
|
-
"aria-label": x(t).logicTag.insert,
|
|
1115
|
-
title: x(t).logicTag.insert,
|
|
1116
|
-
disabled: e.disabled,
|
|
1117
|
-
"data-testid": "field-insert-logic-button",
|
|
1118
|
-
onMousedown: i[0] ||= j(() => {}, ["prevent"]),
|
|
1119
|
-
onClick: i[1] ||= (e) => r.$emit("insert")
|
|
1120
|
-
}, [g(x(ut), {
|
|
1121
|
-
size: 12,
|
|
1122
|
-
"stroke-width": 2
|
|
1123
|
-
}), b(" " + c(x(t).logicTag.insertShort), 1)], 42, er));
|
|
1124
|
-
}
|
|
1125
|
-
}), rr = { key: 0 }, ir = {
|
|
1126
|
-
key: 0,
|
|
1127
|
-
class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
|
|
1128
|
-
}, ar = { key: 1 }, or = [
|
|
1129
|
-
"value",
|
|
1130
|
-
"placeholder",
|
|
1131
|
-
"rows"
|
|
1132
|
-
], sr = {
|
|
1133
|
-
key: 0,
|
|
1134
|
-
class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
|
|
1135
|
-
}, cr = "tpl:w-full tpl:resize-y tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]", lr = "tpl:flex tpl:w-full tpl:min-h-20 tpl:cursor-pointer tpl:items-start tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", ur = /* @__PURE__ */ f({
|
|
1136
|
-
__name: "MergeTagTextarea",
|
|
1137
|
-
props: {
|
|
1138
|
-
modelValue: {},
|
|
1139
|
-
placeholder: { default: "" },
|
|
1140
|
-
rows: { default: 3 }
|
|
1141
|
-
},
|
|
1142
|
-
emits: ["update:modelValue"],
|
|
1143
|
-
setup(e, { emit: t }) {
|
|
1144
|
-
let r = e, i = t, a = d(null), { segments: o, hasMergeTags: c, canRequestMergeTag: l, isRequestingMergeTag: u, canInsertLogicTag: f, isRequestingLogicTag: h, isEditing: _, startEditing: v, handleInput: b, handleKeydown: S, handleClick: C, handleBlur: w, clearValue: E, insertMergeTag: D, insertLogicTag: O } = Wn({
|
|
1145
|
-
modelValue: () => r.modelValue,
|
|
1146
|
-
emit: (e) => i("update:modelValue", e),
|
|
1147
|
-
elementRef: a
|
|
1148
|
-
});
|
|
1149
|
-
return (t, r) => x(c) && !x(_) ? (s(), m("div", rr, [g(Xn, {
|
|
1150
|
-
segments: x(o),
|
|
1151
|
-
"display-class": lr,
|
|
1152
|
-
onEdit: x(v),
|
|
1153
|
-
onClear: x(E)
|
|
1154
|
-
}, null, 8, [
|
|
1155
|
-
"segments",
|
|
1156
|
-
"onEdit",
|
|
1157
|
-
"onClear"
|
|
1158
|
-
]), x(l) || x(f) ? (s(), m("div", ir, [x(l) ? (s(), y($n, {
|
|
1159
|
-
key: 0,
|
|
1160
|
-
disabled: x(u),
|
|
1161
|
-
onInsert: x(D)
|
|
1162
|
-
}, null, 8, ["disabled", "onInsert"])) : T("", !0), x(f) ? (s(), y(nr, {
|
|
1163
|
-
key: 1,
|
|
1164
|
-
disabled: x(h),
|
|
1165
|
-
onInsert: x(O)
|
|
1166
|
-
}, null, 8, ["disabled", "onInsert"])) : T("", !0)])) : T("", !0)])) : (s(), m("div", ar, [p("textarea", {
|
|
1167
|
-
ref_key: "textareaRef",
|
|
1168
|
-
ref: a,
|
|
1169
|
-
class: n(cr),
|
|
1170
|
-
value: e.modelValue,
|
|
1171
|
-
placeholder: e.placeholder,
|
|
1172
|
-
rows: e.rows,
|
|
1173
|
-
onInput: r[0] ||= (...e) => x(b) && x(b)(...e),
|
|
1174
|
-
onKeydown: r[1] ||= (...e) => x(S) && x(S)(...e),
|
|
1175
|
-
onClick: r[2] ||= (...e) => x(C) && x(C)(...e),
|
|
1176
|
-
onBlur: r[3] ||= (...e) => x(w) && x(w)(...e)
|
|
1177
|
-
}, null, 40, or), x(l) || x(f) ? (s(), m("div", sr, [x(l) ? (s(), y($n, {
|
|
1178
|
-
key: 0,
|
|
1179
|
-
disabled: x(u),
|
|
1180
|
-
onInsert: x(D)
|
|
1181
|
-
}, null, 8, ["disabled", "onInsert"])) : T("", !0), x(f) ? (s(), y(nr, {
|
|
1182
|
-
key: 1,
|
|
1183
|
-
disabled: x(h),
|
|
1184
|
-
onInsert: x(O)
|
|
1185
|
-
}, null, 8, ["disabled", "onInsert"])) : T("", !0)])) : T("", !0)]));
|
|
1186
|
-
}
|
|
1187
|
-
}), dr = { class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]" }, fr = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4" }, pr = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, mr = { class: "tpl:mb-3.5" }, hr = { class: "tpl:grid tpl:grid-cols-4 tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]" }, gr = ["onClick"], _r = { class: "tpl:flex tpl:items-stretch" }, vr = ["value"], yr = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, br = { class: "tpl:mb-3.5" }, xr = { class: "tpl:mb-3.5" }, Sr = { class: "tpl:mb-3.5" }, Cr = { class: "tpl:mb-3.5" }, wr = ["value"], Tr = ["value"], Er = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Dr = ["value"], Or = { class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, kr = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ar = { class: "tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, jr = { class: "tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, Mr = { class: "tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]" }, Nr = { class: "tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3" }, Pr = { class: "tpl:mb-2.5 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text-muted)]" }, Fr = { class: "tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, Ir = { class: "tpl:mb-1 tpl:last:mb-0" }, Lr = { class: "tpl:mb-1 tpl:last:mb-0" }, Rr = { class: "tpl:mb-1 tpl:last:mb-0" }, zr = 150, Br = /* @__PURE__ */ f({
|
|
1188
|
-
__name: "TemplateSettings",
|
|
1189
|
-
props: { settings: {} },
|
|
1190
|
-
emits: ["update"],
|
|
1191
|
-
setup(r, { emit: i }) {
|
|
1192
|
-
let a = r, o = i, { t: l } = U(), u = Be(lt, "TemplateSettings"), d = w(() => u.fonts.value), f = w(() => d.value.some((e) => e.value === a.settings.fontFamily) ? a.settings.fontFamily : u.defaultFont.value), h = [
|
|
1193
|
-
{
|
|
1194
|
-
value: 480,
|
|
1195
|
-
label: "480px"
|
|
1196
|
-
},
|
|
1197
|
-
{
|
|
1198
|
-
value: 600,
|
|
1199
|
-
label: "600px"
|
|
1200
|
-
},
|
|
1201
|
-
{
|
|
1202
|
-
value: 700,
|
|
1203
|
-
label: "700px"
|
|
1204
|
-
},
|
|
1205
|
-
{
|
|
1206
|
-
value: 800,
|
|
1207
|
-
label: "800px"
|
|
1208
|
-
}
|
|
1209
|
-
];
|
|
1210
|
-
return (i, a) => (s(), m("aside", dr, [p("div", fr, [
|
|
1211
|
-
p("div", { class: n(x(Wt)) }, [
|
|
1212
|
-
p("div", pr, [g(x(sn), {
|
|
1213
|
-
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
1214
|
-
size: 14,
|
|
1215
|
-
"stroke-width": 2
|
|
1216
|
-
}), p("span", null, c(x(l).templateSettings.layout), 1)]),
|
|
1217
|
-
p("div", mr, [p("label", { class: n(x(K)) }, c(x(l).templateSettings.widthPreset), 3), p("div", hr, [(s(), m(C, null, e(h, (e) => p("button", {
|
|
1218
|
-
key: e.value,
|
|
1219
|
-
class: "tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
1220
|
-
style: t({
|
|
1221
|
-
backgroundColor: r.settings.width === e.value ? "var(--tpl-bg)" : "transparent",
|
|
1222
|
-
color: r.settings.width === e.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
1223
|
-
boxShadow: r.settings.width === e.value ? "var(--tpl-shadow)" : "none"
|
|
1224
|
-
}),
|
|
1225
|
-
onClick: (t) => o("update", { width: e.value })
|
|
1226
|
-
}, c(e.label), 13, gr)), 64))])]),
|
|
1227
|
-
p("div", null, [p("label", { class: n(x(K)) }, c(x(l).templateSettings.customWidth), 3), p("div", _r, [p("input", {
|
|
1228
|
-
type: "number",
|
|
1229
|
-
class: n(x(J)),
|
|
1230
|
-
value: r.settings.width,
|
|
1231
|
-
min: "300",
|
|
1232
|
-
max: "900",
|
|
1233
|
-
onInput: a[0] ||= (e) => o("update", { width: Number(e.target.value) })
|
|
1234
|
-
}, null, 42, vr), p("span", { class: n(x(q)) }, "px", 2)])])
|
|
1235
|
-
], 2),
|
|
1236
|
-
p("div", { class: n(x(Wt)) }, [
|
|
1237
|
-
p("div", yr, [g(x(Yt), {
|
|
1238
|
-
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
1239
|
-
size: 14,
|
|
1240
|
-
"stroke-width": 2
|
|
1241
|
-
}), p("span", null, c(x(l).templateSettings.appearance), 1)]),
|
|
1242
|
-
p("div", br, [p("label", { class: n(x(K)) }, c(x(l).templateSettings.backgroundColor), 3), g(Y, {
|
|
1243
|
-
"model-value": r.settings.backgroundColor,
|
|
1244
|
-
placeholder: x(Ut),
|
|
1245
|
-
"onUpdate:modelValue": a[1] ||= (e) => o("update", { backgroundColor: e })
|
|
1246
|
-
}, null, 8, ["model-value", "placeholder"])]),
|
|
1247
|
-
p("div", xr, [p("label", { class: n(x(K)) }, c(x(l).templateSettings.textColor), 3), g(Y, {
|
|
1248
|
-
"model-value": r.settings.textColor ?? "",
|
|
1249
|
-
"seed-color": "#1a1a1a",
|
|
1250
|
-
"onUpdate:modelValue": a[2] ||= (e) => o("update", { textColor: e })
|
|
1251
|
-
}, null, 8, ["model-value"])]),
|
|
1252
|
-
p("div", Sr, [p("label", { class: n(x(K)) }, c(x(l).templateSettings.linkColor), 3), g(Y, {
|
|
1253
|
-
"model-value": r.settings.linkColor ?? "",
|
|
1254
|
-
"seed-color": "#0066cc",
|
|
1255
|
-
"onUpdate:modelValue": a[3] ||= (e) => o("update", { linkColor: e || void 0 })
|
|
1256
|
-
}, null, 8, ["model-value"])]),
|
|
1257
|
-
p("div", Cr, [g(X, {
|
|
1258
|
-
class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
1259
|
-
"model-value": r.settings.linkUnderline,
|
|
1260
|
-
label: x(l).templateSettings.linkUnderline,
|
|
1261
|
-
"onUpdate:modelValue": a[4] ||= (e) => o("update", { linkUnderline: e })
|
|
1262
|
-
}, null, 8, ["model-value", "label"])]),
|
|
1263
|
-
p("div", null, [p("label", { class: n(x(K)) }, c(x(l).templateSettings.fontFamily), 3), p("select", {
|
|
1264
|
-
class: n(x(G)),
|
|
1265
|
-
value: f.value,
|
|
1266
|
-
onChange: a[5] ||= (e) => o("update", { fontFamily: e.target.value })
|
|
1267
|
-
}, [(s(!0), m(C, null, e(d.value, (e) => (s(), m("option", {
|
|
1268
|
-
key: e.value,
|
|
1269
|
-
value: e.value
|
|
1270
|
-
}, c(e.label), 9, Tr))), 128))], 42, wr)])
|
|
1271
|
-
], 2),
|
|
1272
|
-
p("div", { class: n(x(Wt)) }, [p("div", Er, [g(x(Xt), {
|
|
1273
|
-
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
1274
|
-
size: 14,
|
|
1275
|
-
"stroke-width": 2
|
|
1276
|
-
}), p("span", null, c(x(l).templateSettings.language), 1)]), p("div", null, [
|
|
1277
|
-
p("label", { class: n(x(K)) }, c(x(l).templateSettings.contentLocale), 3),
|
|
1278
|
-
p("input", {
|
|
1279
|
-
type: "text",
|
|
1280
|
-
class: n(x(G)),
|
|
1281
|
-
value: r.settings.locale ?? "",
|
|
1282
|
-
placeholder: "en",
|
|
1283
|
-
spellcheck: "false",
|
|
1284
|
-
autocapitalize: "off",
|
|
1285
|
-
autocomplete: "off",
|
|
1286
|
-
onInput: a[6] ||= (e) => o("update", { locale: e.target.value.trim() || void 0 })
|
|
1287
|
-
}, null, 42, Dr),
|
|
1288
|
-
p("p", Or, c(x(l).templateSettings.contentLocaleHint), 1)
|
|
1289
|
-
])], 2),
|
|
1290
|
-
p("div", { class: n(x(Wt)) }, [p("div", kr, [g(x(vt), {
|
|
1291
|
-
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
1292
|
-
size: 14,
|
|
1293
|
-
"stroke-width": 2
|
|
1294
|
-
}), p("span", null, c(x(l).templateSettings.preheaderText), 1)]), p("div", null, [g(ur, {
|
|
1295
|
-
"model-value": r.settings.preheaderText ?? "",
|
|
1296
|
-
placeholder: x(l).templateSettings.preheaderTextPlaceholder,
|
|
1297
|
-
rows: 2,
|
|
1298
|
-
"onUpdate:modelValue": a[7] ||= (e) => o("update", { preheaderText: e.replace(/[\r\n]/g, " ") || void 0 })
|
|
1299
|
-
}, null, 8, ["model-value", "placeholder"]), p("div", Ar, [p("span", jr, c(x(l).templateSettings.preheaderTextHint), 1), p("span", Mr, c((r.settings.preheaderText ?? "").length) + "/" + c(zr), 1)])])], 2),
|
|
1300
|
-
p("div", Nr, [p("div", Pr, [g(x(xt), {
|
|
1301
|
-
size: 14,
|
|
1302
|
-
"stroke-width": 2
|
|
1303
|
-
}), p("span", null, c(x(l).templateSettings.tips), 1)]), p("ul", Fr, [
|
|
1304
|
-
p("li", Ir, c(x(l).templateSettings.tip1), 1),
|
|
1305
|
-
p("li", Lr, c(x(l).templateSettings.tip2), 1),
|
|
1306
|
-
p("li", Rr, c(x(l).templateSettings.tip3), 1)
|
|
1307
|
-
])])
|
|
1308
|
-
])]));
|
|
1309
|
-
}
|
|
1310
|
-
}), Vr = { key: 0 }, Hr = {
|
|
1311
|
-
key: 0,
|
|
1312
|
-
class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
|
|
1313
|
-
}, Ur = { key: 1 }, Wr = [
|
|
1314
|
-
"type",
|
|
1315
|
-
"value",
|
|
1316
|
-
"placeholder"
|
|
1317
|
-
], Gr = {
|
|
1318
|
-
key: 0,
|
|
1319
|
-
class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
|
|
1320
|
-
}, Kr = "tpl:flex tpl:w-full tpl:min-h-10 tpl:cursor-pointer tpl:items-center tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3.5 tpl:py-1.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", $ = /*#__PURE__*/ Mt(/* @__PURE__ */ f({
|
|
1321
|
-
__name: "MergeTagInput",
|
|
1322
|
-
props: {
|
|
1323
|
-
modelValue: {},
|
|
1324
|
-
type: { default: "text" },
|
|
1325
|
-
placeholder: { default: "" },
|
|
1326
|
-
pulse: {
|
|
1327
|
-
type: Boolean,
|
|
1328
|
-
default: !1
|
|
1329
|
-
}
|
|
1330
|
-
},
|
|
1331
|
-
emits: ["update:modelValue"],
|
|
1332
|
-
setup(e, { emit: t }) {
|
|
1333
|
-
let r = e, i = t, a = d(null), { segments: o, hasMergeTags: c, canRequestMergeTag: l, isRequestingMergeTag: u, canInsertLogicTag: f, isRequestingLogicTag: h, isEditing: _, startEditing: v, handleInput: b, handleKeydown: S, handleClick: C, handleBlur: w, clearValue: E, insertMergeTag: D, insertLogicTag: O } = Wn({
|
|
1334
|
-
modelValue: () => r.modelValue,
|
|
1335
|
-
emit: (e) => i("update:modelValue", e),
|
|
1336
|
-
elementRef: a
|
|
1337
|
-
});
|
|
1338
|
-
return (t, r) => x(c) && !x(_) ? (s(), m("div", Vr, [g(Xn, {
|
|
1339
|
-
segments: x(o),
|
|
1340
|
-
"display-class": Kr,
|
|
1341
|
-
pulse: e.pulse,
|
|
1342
|
-
onEdit: x(v),
|
|
1343
|
-
onClear: x(E)
|
|
1344
|
-
}, null, 8, [
|
|
1345
|
-
"segments",
|
|
1346
|
-
"pulse",
|
|
1347
|
-
"onEdit",
|
|
1348
|
-
"onClear"
|
|
1349
|
-
]), x(l) || x(f) ? (s(), m("div", Hr, [x(l) ? (s(), y($n, {
|
|
1350
|
-
key: 0,
|
|
1351
|
-
disabled: x(u),
|
|
1352
|
-
onInsert: x(D)
|
|
1353
|
-
}, null, 8, ["disabled", "onInsert"])) : T("", !0), x(f) ? (s(), y(nr, {
|
|
1354
|
-
key: 1,
|
|
1355
|
-
disabled: x(h),
|
|
1356
|
-
onInsert: x(O)
|
|
1357
|
-
}, null, 8, ["disabled", "onInsert"])) : T("", !0)])) : T("", !0)])) : (s(), m("div", Ur, [p("input", {
|
|
1358
|
-
ref_key: "inputRef",
|
|
1359
|
-
ref: a,
|
|
1360
|
-
type: e.type,
|
|
1361
|
-
class: n([x(G), { "tpl-pulse-fill": e.pulse }]),
|
|
1362
|
-
value: e.modelValue,
|
|
1363
|
-
placeholder: e.placeholder,
|
|
1364
|
-
onInput: r[0] ||= (...e) => x(b) && x(b)(...e),
|
|
1365
|
-
onKeydown: r[1] ||= (...e) => x(S) && x(S)(...e),
|
|
1366
|
-
onClick: r[2] ||= (...e) => x(C) && x(C)(...e),
|
|
1367
|
-
onBlur: r[3] ||= (...e) => x(w) && x(w)(...e)
|
|
1368
|
-
}, null, 42, Wr), x(l) || x(f) ? (s(), m("div", Gr, [x(l) ? (s(), y($n, {
|
|
1369
|
-
key: 0,
|
|
1370
|
-
disabled: x(u),
|
|
1371
|
-
onInsert: x(D)
|
|
1372
|
-
}, null, 8, ["disabled", "onInsert"])) : T("", !0), x(f) ? (s(), y(nr, {
|
|
1373
|
-
key: 1,
|
|
1374
|
-
disabled: x(h),
|
|
1375
|
-
onInsert: x(O)
|
|
1376
|
-
}, null, 8, ["disabled", "onInsert"])) : T("", !0)])) : T("", !0)]));
|
|
1377
|
-
}
|
|
1378
|
-
}), [["__scopeId", "data-v-d6563be6"]]), qr = { class: "tpl:mb-3.5" }, Jr = ["value"], Yr = { value: "" }, Xr = ["value"], Zr = { class: "tpl:mb-3.5" }, Qr = { class: "tpl:mb-3.5" }, $r = { class: "tpl:mb-3.5" }, ei = { class: "tpl:mb-3.5" }, ti = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, ni = { class: "tpl:mb-3.5" }, ri = { class: "tpl:flex tpl:items-stretch" }, ii = ["value"], ai = { class: "tpl:mb-3.5" }, oi = { class: "tpl:flex tpl:items-stretch" }, si = ["value"], ci = { class: "tpl:mb-3.5" }, li = ["value"], ui = { value: "auto" }, di = { value: "full" }, fi = { value: "custom" }, pi = {
|
|
1379
|
-
key: 0,
|
|
1380
|
-
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
1381
|
-
}, mi = ["value"], hi = { class: "tpl:mb-3.5" }, gi = 200, _i = /* @__PURE__ */ f({
|
|
1382
|
-
__name: "ButtonToolbar",
|
|
1383
|
-
props: {
|
|
1384
|
-
block: {},
|
|
1385
|
-
fontFamilies: {}
|
|
1386
|
-
},
|
|
1387
|
-
emits: ["update"],
|
|
1388
|
-
setup(t, { emit: r }) {
|
|
1389
|
-
let i = t, a = r, { t: o } = U(), l = w(() => i.block.width === "full" ? "full" : typeof i.block.width == "number" ? "custom" : "auto");
|
|
1390
|
-
function u(e, t) {
|
|
1391
|
-
a("update", { [e]: t });
|
|
1392
|
-
}
|
|
1393
|
-
function d(e) {
|
|
1394
|
-
if (e === "full") {
|
|
1395
|
-
u("width", "full");
|
|
1396
|
-
return;
|
|
1397
|
-
}
|
|
1398
|
-
if (e === "custom") {
|
|
1399
|
-
u("width", typeof i.block.width == "number" ? i.block.width : gi);
|
|
1400
|
-
return;
|
|
1401
|
-
}
|
|
1402
|
-
u("width", void 0);
|
|
1403
|
-
}
|
|
1404
|
-
function f(e) {
|
|
1405
|
-
let t = Number(e);
|
|
1406
|
-
!Number.isFinite(t) || t <= 0 || u("width", t);
|
|
1407
|
-
}
|
|
1408
|
-
return (r, i) => (s(), m(C, null, [
|
|
1409
|
-
p("div", qr, [p("label", { class: n(x(K)) }, c(x(o).button.fontFamily), 3), p("select", {
|
|
1410
|
-
class: n(x(G)),
|
|
1411
|
-
value: t.block.fontFamily || "",
|
|
1412
|
-
onChange: i[0] ||= (e) => u("fontFamily", e.target.value || void 0)
|
|
1413
|
-
}, [p("option", Yr, c(x(o).button.inheritFont), 1), (s(!0), m(C, null, e(t.fontFamilies, (e) => (s(), m("option", {
|
|
1414
|
-
key: e.value,
|
|
1415
|
-
value: e.value
|
|
1416
|
-
}, c(e.label), 9, Xr))), 128))], 42, Jr)]),
|
|
1417
|
-
p("div", Zr, [p("label", { class: n(x(K)) }, c(x(o).button.text), 3), g($, {
|
|
1418
|
-
"model-value": t.block.text,
|
|
1419
|
-
type: "text",
|
|
1420
|
-
"onUpdate:modelValue": i[1] ||= (e) => u("text", e)
|
|
1421
|
-
}, null, 8, ["model-value"])]),
|
|
1422
|
-
p("div", Qr, [
|
|
1423
|
-
p("label", { class: n(x(K)) }, c(x(o).button.url), 3),
|
|
1424
|
-
g($, {
|
|
1425
|
-
"model-value": t.block.url,
|
|
1426
|
-
type: "url",
|
|
1427
|
-
placeholder: x(o).button.urlPlaceholder,
|
|
1428
|
-
"onUpdate:modelValue": i[2] ||= (e) => u("url", e)
|
|
1429
|
-
}, null, 8, ["model-value", "placeholder"]),
|
|
1430
|
-
t.block.url ? (s(), y(X, {
|
|
1431
|
-
key: 0,
|
|
1432
|
-
class: "tpl:mt-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]",
|
|
1433
|
-
"model-value": t.block.openInNewTab ?? !1,
|
|
1434
|
-
label: x(o).button.openInNewTab,
|
|
1435
|
-
"onUpdate:modelValue": i[3] ||= (e) => u("openInNewTab", e)
|
|
1436
|
-
}, null, 8, ["model-value", "label"])) : T("", !0)
|
|
1437
|
-
]),
|
|
1438
|
-
p("div", $r, [p("label", { class: n(x(K)) }, c(x(o).button.background), 3), g(Y, {
|
|
1439
|
-
"model-value": t.block.backgroundColor,
|
|
1440
|
-
"onUpdate:modelValue": i[4] ||= (e) => u("backgroundColor", e)
|
|
1441
|
-
}, null, 8, ["model-value"])]),
|
|
1442
|
-
p("div", ei, [p("label", { class: n(x(K)) }, c(x(o).button.textColor), 3), g(Y, {
|
|
1443
|
-
"model-value": t.block.textColor,
|
|
1444
|
-
"onUpdate:modelValue": i[5] ||= (e) => u("textColor", e)
|
|
1445
|
-
}, null, 8, ["model-value"])]),
|
|
1446
|
-
p("div", ti, [p("div", ni, [p("label", { class: n(x(K)) }, c(x(o).button.borderRadius), 3), p("div", ri, [p("input", {
|
|
1447
|
-
type: "number",
|
|
1448
|
-
class: n(x(J)),
|
|
1449
|
-
value: t.block.borderRadius,
|
|
1450
|
-
min: "0",
|
|
1451
|
-
max: "50",
|
|
1452
|
-
onInput: i[6] ||= (e) => u("borderRadius", Number(e.target.value))
|
|
1453
|
-
}, null, 42, ii), p("span", { class: n(x(q)) }, "px", 2)])]), p("div", ai, [p("label", { class: n(x(K)) }, c(x(o).button.fontSize), 3), p("div", oi, [p("input", {
|
|
1454
|
-
type: "number",
|
|
1455
|
-
class: n(x(J)),
|
|
1456
|
-
value: t.block.fontSize,
|
|
1457
|
-
min: "10",
|
|
1458
|
-
max: "36",
|
|
1459
|
-
onInput: i[7] ||= (e) => u("fontSize", Number(e.target.value))
|
|
1460
|
-
}, null, 42, si), p("span", { class: n(x(q)) }, "px", 2)])])]),
|
|
1461
|
-
p("div", ci, [
|
|
1462
|
-
p("label", { class: n(x(K)) }, c(x(o).button.width), 3),
|
|
1463
|
-
p("select", {
|
|
1464
|
-
class: n(x(G)),
|
|
1465
|
-
value: l.value,
|
|
1466
|
-
onChange: i[8] ||= (e) => d(e.target.value)
|
|
1467
|
-
}, [
|
|
1468
|
-
p("option", ui, c(x(o).button.widthAuto), 1),
|
|
1469
|
-
p("option", di, c(x(o).button.fullWidth), 1),
|
|
1470
|
-
p("option", fi, c(x(o).button.widthCustom), 1)
|
|
1471
|
-
], 42, li),
|
|
1472
|
-
l.value === "custom" ? (s(), m("div", pi, [p("input", {
|
|
1473
|
-
type: "number",
|
|
1474
|
-
class: n(x(J)),
|
|
1475
|
-
value: typeof t.block.width == "number" ? t.block.width : gi,
|
|
1476
|
-
min: "20",
|
|
1477
|
-
onInput: i[9] ||= (e) => f(e.target.value)
|
|
1478
|
-
}, null, 42, mi), p("span", { class: n(x(q)) }, "px", 2)])) : T("", !0)
|
|
1479
|
-
]),
|
|
1480
|
-
p("div", hi, [p("label", { class: n(x(K)) }, c(x(o).title.align), 3), g(Q, {
|
|
1481
|
-
options: [
|
|
1482
|
-
{
|
|
1483
|
-
value: "left",
|
|
1484
|
-
label: x(o).title.alignLeft
|
|
1485
|
-
},
|
|
1486
|
-
{
|
|
1487
|
-
value: "center",
|
|
1488
|
-
label: x(o).title.alignCenter
|
|
1489
|
-
},
|
|
1490
|
-
{
|
|
1491
|
-
value: "right",
|
|
1492
|
-
label: x(o).title.alignRight
|
|
1493
|
-
}
|
|
1494
|
-
],
|
|
1495
|
-
"model-value": t.block.align ?? "center",
|
|
1496
|
-
"onUpdate:modelValue": i[10] ||= (e) => u("align", e)
|
|
1497
|
-
}, null, 8, ["options", "model-value"])])
|
|
1498
|
-
], 64));
|
|
1499
|
-
}
|
|
1500
|
-
}), vi = { class: "spacing-control" }, yi = { class: "tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, bi = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, xi = { class: "tpl:flex tpl:items-center" }, Si = ["aria-label"], Ci = ["value", "aria-label"], wi = ["aria-label"], Ti = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ei = { class: "tpl:flex tpl:items-center" }, Di = ["aria-label"], Oi = ["value", "aria-label"], ki = ["aria-label"], Ai = ["aria-label", "title"], ji = { class: "tpl:flex tpl:items-center" }, Mi = ["aria-label"], Ni = ["value", "aria-label"], Pi = ["aria-label"], Fi = { class: "tpl:flex tpl:items-center" }, Ii = ["aria-label"], Li = ["value", "aria-label"], Ri = ["aria-label"], zi = "tpl:flex tpl:items-center tpl:justify-center tpl:w-8 tpl:h-8 tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg)] tpl:border tpl:border-[var(--tpl-border)] tpl:cursor-pointer tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)] active:tpl:bg-[var(--tpl-bg-active)]", Bi = "tpl:w-10 tpl:h-8 tpl:text-center tpl:text-xs tpl:font-medium tpl:border-y tpl:border-x-0 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]", Vi = /*#__PURE__*/ Mt(/* @__PURE__ */ f({
|
|
1501
|
-
__name: "SpacingControl",
|
|
1502
|
-
props: {
|
|
1503
|
-
modelValue: {},
|
|
1504
|
-
label: {}
|
|
1505
|
-
},
|
|
1506
|
-
emits: ["update:modelValue"],
|
|
1507
|
-
setup(e, { emit: t }) {
|
|
1508
|
-
let r = e, a = t, { t: o } = U(), l = w(() => r.modelValue.top === r.modelValue.right && r.modelValue.right === r.modelValue.bottom && r.modelValue.bottom === r.modelValue.left), u = d(l.value);
|
|
1509
|
-
i(l, (e) => {
|
|
1510
|
-
!e && u.value && (u.value = !1);
|
|
1511
|
-
});
|
|
1512
|
-
function f(e, t) {
|
|
1513
|
-
let n = r.modelValue[e], i = Math.max(0, n + t);
|
|
1514
|
-
u.value ? a("update:modelValue", {
|
|
1515
|
-
top: i,
|
|
1516
|
-
right: i,
|
|
1517
|
-
bottom: i,
|
|
1518
|
-
left: i
|
|
1519
|
-
}) : a("update:modelValue", {
|
|
1520
|
-
...r.modelValue,
|
|
1521
|
-
[e]: i
|
|
1522
|
-
});
|
|
1523
|
-
}
|
|
1524
|
-
function h(e, t) {
|
|
1525
|
-
let n = Math.max(0, t);
|
|
1526
|
-
u.value ? a("update:modelValue", {
|
|
1527
|
-
top: n,
|
|
1528
|
-
right: n,
|
|
1529
|
-
bottom: n,
|
|
1530
|
-
left: n
|
|
1531
|
-
}) : a("update:modelValue", {
|
|
1532
|
-
...r.modelValue,
|
|
1533
|
-
[e]: n
|
|
1534
|
-
});
|
|
1535
|
-
}
|
|
1536
|
-
function _() {
|
|
1537
|
-
if (u.value = !u.value, u.value) {
|
|
1538
|
-
let e = r.modelValue.top;
|
|
1539
|
-
a("update:modelValue", {
|
|
1540
|
-
top: e,
|
|
1541
|
-
right: e,
|
|
1542
|
-
bottom: e,
|
|
1543
|
-
left: e
|
|
1544
|
-
});
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
return (t, r) => (s(), m("div", vi, [p("label", yi, c(e.label), 1), p("div", bi, [
|
|
1548
|
-
p("div", xi, [
|
|
1549
|
-
p("button", {
|
|
1550
|
-
"aria-label": x(o).spacingControl.decreaseTop,
|
|
1551
|
-
class: n([zi, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1552
|
-
onClick: r[0] ||= (e) => f("top", -1)
|
|
1553
|
-
}, [g(x(mt), {
|
|
1554
|
-
size: 12,
|
|
1555
|
-
"stroke-width": 2
|
|
1556
|
-
})], 10, Si),
|
|
1557
|
-
p("input", {
|
|
1558
|
-
type: "number",
|
|
1559
|
-
class: n(Bi),
|
|
1560
|
-
value: e.modelValue.top,
|
|
1561
|
-
"aria-label": x(o).spacingControl.top,
|
|
1562
|
-
min: "0",
|
|
1563
|
-
onInput: r[1] ||= (e) => h("top", Number(e.target.value))
|
|
1564
|
-
}, null, 40, Ci),
|
|
1565
|
-
p("button", {
|
|
1566
|
-
"aria-label": x(o).spacingControl.increaseTop,
|
|
1567
|
-
class: n([zi, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1568
|
-
onClick: r[2] ||= (e) => f("top", 1)
|
|
1569
|
-
}, [g(x(nn), {
|
|
1570
|
-
size: 12,
|
|
1571
|
-
"stroke-width": 2
|
|
1572
|
-
})], 10, wi)
|
|
1573
|
-
]),
|
|
1574
|
-
p("div", Ti, [
|
|
1575
|
-
p("div", Ei, [
|
|
1576
|
-
p("button", {
|
|
1577
|
-
"aria-label": x(o).spacingControl.decreaseLeft,
|
|
1578
|
-
class: n([zi, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1579
|
-
onClick: r[3] ||= (e) => f("left", -1)
|
|
1580
|
-
}, [g(x(mt), {
|
|
1581
|
-
size: 12,
|
|
1582
|
-
"stroke-width": 2
|
|
1583
|
-
})], 10, Di),
|
|
1584
|
-
p("input", {
|
|
1585
|
-
type: "number",
|
|
1586
|
-
class: n(Bi),
|
|
1587
|
-
value: e.modelValue.left,
|
|
1588
|
-
"aria-label": x(o).spacingControl.left,
|
|
1589
|
-
min: "0",
|
|
1590
|
-
onInput: r[4] ||= (e) => h("left", Number(e.target.value))
|
|
1591
|
-
}, null, 40, Oi),
|
|
1592
|
-
p("button", {
|
|
1593
|
-
"aria-label": x(o).spacingControl.increaseLeft,
|
|
1594
|
-
class: n([zi, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1595
|
-
onClick: r[5] ||= (e) => f("left", 1)
|
|
1596
|
-
}, [g(x(nn), {
|
|
1597
|
-
size: 12,
|
|
1598
|
-
"stroke-width": 2
|
|
1599
|
-
})], 10, ki)
|
|
1600
|
-
]),
|
|
1601
|
-
p("button", {
|
|
1602
|
-
class: n(["tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", u.value ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),
|
|
1603
|
-
"aria-label": u.value ? x(o).spacingControl.unlock : x(o).spacingControl.lockAll,
|
|
1604
|
-
title: u.value ? x(o).spacingControl.unlock : x(o).spacingControl.lockAll,
|
|
1605
|
-
onClick: _
|
|
1606
|
-
}, [u.value ? (s(), y(x($t), {
|
|
1607
|
-
key: 0,
|
|
1608
|
-
size: 14,
|
|
1609
|
-
"stroke-width": 2
|
|
1610
|
-
})) : (s(), y(x(Qt), {
|
|
1611
|
-
key: 1,
|
|
1612
|
-
size: 14,
|
|
1613
|
-
"stroke-width": 2
|
|
1614
|
-
}))], 10, Ai),
|
|
1615
|
-
p("div", ji, [
|
|
1616
|
-
p("button", {
|
|
1617
|
-
"aria-label": x(o).spacingControl.decreaseRight,
|
|
1618
|
-
class: n([zi, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1619
|
-
onClick: r[6] ||= (e) => f("right", -1)
|
|
1620
|
-
}, [g(x(mt), {
|
|
1621
|
-
size: 12,
|
|
1622
|
-
"stroke-width": 2
|
|
1623
|
-
})], 10, Mi),
|
|
1624
|
-
p("input", {
|
|
1625
|
-
type: "number",
|
|
1626
|
-
class: n(Bi),
|
|
1627
|
-
value: e.modelValue.right,
|
|
1628
|
-
"aria-label": x(o).spacingControl.right,
|
|
1629
|
-
min: "0",
|
|
1630
|
-
onInput: r[7] ||= (e) => h("right", Number(e.target.value))
|
|
1631
|
-
}, null, 40, Ni),
|
|
1632
|
-
p("button", {
|
|
1633
|
-
"aria-label": x(o).spacingControl.increaseRight,
|
|
1634
|
-
class: n([zi, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1635
|
-
onClick: r[8] ||= (e) => f("right", 1)
|
|
1636
|
-
}, [g(x(nn), {
|
|
1637
|
-
size: 12,
|
|
1638
|
-
"stroke-width": 2
|
|
1639
|
-
})], 10, Pi)
|
|
1640
|
-
])
|
|
1641
|
-
]),
|
|
1642
|
-
p("div", Fi, [
|
|
1643
|
-
p("button", {
|
|
1644
|
-
"aria-label": x(o).spacingControl.decreaseBottom,
|
|
1645
|
-
class: n([zi, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1646
|
-
onClick: r[9] ||= (e) => f("bottom", -1)
|
|
1647
|
-
}, [g(x(mt), {
|
|
1648
|
-
size: 12,
|
|
1649
|
-
"stroke-width": 2
|
|
1650
|
-
})], 10, Ii),
|
|
1651
|
-
p("input", {
|
|
1652
|
-
type: "number",
|
|
1653
|
-
class: n(Bi),
|
|
1654
|
-
value: e.modelValue.bottom,
|
|
1655
|
-
"aria-label": x(o).spacingControl.bottom,
|
|
1656
|
-
min: "0",
|
|
1657
|
-
onInput: r[10] ||= (e) => h("bottom", Number(e.target.value))
|
|
1658
|
-
}, null, 40, Li),
|
|
1659
|
-
p("button", {
|
|
1660
|
-
"aria-label": x(o).spacingControl.increaseBottom,
|
|
1661
|
-
class: n([zi, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1662
|
-
onClick: r[11] ||= (e) => f("bottom", 1)
|
|
1663
|
-
}, [g(x(nn), {
|
|
1664
|
-
size: 12,
|
|
1665
|
-
"stroke-width": 2
|
|
1666
|
-
})], 10, Ri)
|
|
1667
|
-
])
|
|
1668
|
-
])]));
|
|
1669
|
-
}
|
|
1670
|
-
}), [["__scopeId", "data-v-9a9c8a07"]]), Hi = ["data-testid"], Ui = { class: "tpl:mt-3" }, Wi = /* @__PURE__ */ f({
|
|
1671
|
-
__name: "CollapsibleSection",
|
|
1672
|
-
props: {
|
|
1673
|
-
title: {},
|
|
1674
|
-
open: { type: Boolean },
|
|
1675
|
-
noBorder: { type: Boolean },
|
|
1676
|
-
headerTestId: {}
|
|
1677
|
-
},
|
|
1678
|
-
emits: ["toggle"],
|
|
1679
|
-
setup(e) {
|
|
1680
|
-
return (t, r) => (s(), m("div", { class: n(["tpl:py-3", e.noBorder ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [p("button", {
|
|
1681
|
-
type: "button",
|
|
1682
|
-
"data-testid": e.headerTestId,
|
|
1683
|
-
class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
1684
|
-
onClick: r[0] ||= (e) => t.$emit("toggle")
|
|
1685
|
-
}, [g(x(ft), {
|
|
1686
|
-
class: n(["tpl:transition-transform tpl:duration-200", e.open ? "tpl:rotate-0" : "tpl:-rotate-90"]),
|
|
1687
|
-
size: 12,
|
|
1688
|
-
"stroke-width": 2
|
|
1689
|
-
}, null, 8, ["class"]), p("span", null, c(e.title), 1)], 8, Hi), k(p("div", Ui, [_(t.$slots, "default")], 512), [[M, e.open]])], 2));
|
|
1690
|
-
}
|
|
1691
|
-
}), Gi = { class: "tpl:space-y-2" }, Ki = { class: "tpl:flex tpl:items-center tpl:gap-2" }, qi = { class: "tpl:space-y-2" }, Ji = ["value"], Yi = { value: "" }, Xi = ["label"], Zi = ["value"], Qi = ["value"], $i = {
|
|
1692
|
-
key: 0,
|
|
1693
|
-
value: "__custom__"
|
|
1694
|
-
}, ea = {
|
|
1695
|
-
key: 0,
|
|
1696
|
-
class: "tpl:space-y-2"
|
|
1697
|
-
}, ta = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, na = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, ra = { class: "tpl:flex tpl:justify-end" }, ia = ["disabled"], aa = {
|
|
1698
|
-
key: 0,
|
|
1699
|
-
class: "tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"
|
|
1700
|
-
}, oa = { class: "tpl:space-y-1" }, sa = { class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]" }, ca = {
|
|
1701
|
-
key: 0,
|
|
1702
|
-
class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"
|
|
1703
|
-
}, la = /* @__PURE__ */ f({
|
|
1704
|
-
__name: "CommonBlockSettings",
|
|
1705
|
-
props: {
|
|
1706
|
-
block: {},
|
|
1707
|
-
isFirstSection: { type: Boolean }
|
|
1708
|
-
},
|
|
1709
|
-
emits: ["update"],
|
|
1710
|
-
setup(t, { emit: r }) {
|
|
1711
|
-
let a = t, u = r, { t: f } = U(), h = D(et, []), _ = D(rt, !1), v = S(/* @__PURE__ */ new Set()), E = d(!1), O = d(""), j = d(""), M = [{
|
|
1712
|
-
key: "desktop",
|
|
1713
|
-
icon: wt,
|
|
1714
|
-
labelKey: "showOnDesktop"
|
|
1715
|
-
}, {
|
|
1716
|
-
key: "mobile",
|
|
1717
|
-
icon: Tt,
|
|
1718
|
-
labelKey: "showOnMobile"
|
|
1719
|
-
}];
|
|
1720
|
-
function N(e) {
|
|
1721
|
-
v.has(e) ? v.delete(e) : v.add(e);
|
|
1722
|
-
}
|
|
1723
|
-
let P = w(() => h.length > 0 || _), F = w(() => a.block.displayCondition ? !h.some((e) => e.label === a.block.displayCondition?.label) : !1);
|
|
1724
|
-
function ee() {
|
|
1725
|
-
E.value = !0, F.value && a.block.displayCondition ? (O.value = a.block.displayCondition.before, j.value = a.block.displayCondition.after ?? "") : (O.value = "", j.value = "");
|
|
1726
|
-
}
|
|
1727
|
-
function I() {
|
|
1728
|
-
O.value.trim() && (u("update", { displayCondition: {
|
|
1729
|
-
label: f.blockSettings.customCondition,
|
|
1730
|
-
before: O.value.trim(),
|
|
1731
|
-
after: j.value.trim()
|
|
1732
|
-
} }), E.value = !1, O.value = "", j.value = "");
|
|
1733
|
-
}
|
|
1734
|
-
i(() => a.block.displayCondition, (e) => {
|
|
1735
|
-
if (!e) {
|
|
1736
|
-
E.value = !1, O.value = "", j.value = "";
|
|
1737
|
-
return;
|
|
1738
|
-
}
|
|
1739
|
-
F.value && (O.value = e.before, j.value = e.after ?? "");
|
|
1740
|
-
}, { immediate: !0 });
|
|
1741
|
-
let L = w(() => {
|
|
1742
|
-
let e = {};
|
|
1743
|
-
for (let t of h) {
|
|
1744
|
-
let n = t.group ?? "";
|
|
1745
|
-
e[n] || (e[n] = []), e[n].push(t);
|
|
1746
|
-
}
|
|
1747
|
-
return e;
|
|
1748
|
-
});
|
|
1749
|
-
function R(e, t) {
|
|
1750
|
-
u("update", { styles: {
|
|
1751
|
-
...a.block.styles,
|
|
1752
|
-
[e]: t
|
|
1753
|
-
} });
|
|
1754
|
-
}
|
|
1755
|
-
function z(e) {
|
|
1756
|
-
return a.block.visibility?.[e] !== !1;
|
|
1757
|
-
}
|
|
1758
|
-
function B(e) {
|
|
1759
|
-
let t = {
|
|
1760
|
-
desktop: z("desktop"),
|
|
1761
|
-
mobile: z("mobile")
|
|
1762
|
-
};
|
|
1763
|
-
t[e] = !t[e], u("update", { visibility: t });
|
|
1764
|
-
}
|
|
1765
|
-
return (r, i) => (s(), m("div", { class: n(["tpl:flex tpl:flex-col", t.isFirstSection ? "" : "tpl:mt-4"]) }, [
|
|
1766
|
-
g(Wi, {
|
|
1767
|
-
title: x(f).blockSettings.spacing,
|
|
1768
|
-
open: v.has("spacing"),
|
|
1769
|
-
"no-border": t.isFirstSection,
|
|
1770
|
-
onToggle: i[1] ||= (e) => N("spacing")
|
|
1771
|
-
}, {
|
|
1772
|
-
default: l(() => [g(Vi, {
|
|
1773
|
-
label: x(f).blockSettings.padding,
|
|
1774
|
-
"model-value": t.block.styles.padding,
|
|
1775
|
-
"onUpdate:modelValue": i[0] ||= (e) => R("padding", e)
|
|
1776
|
-
}, null, 8, ["label", "model-value"])]),
|
|
1777
|
-
_: 1
|
|
1778
|
-
}, 8, [
|
|
1779
|
-
"title",
|
|
1780
|
-
"open",
|
|
1781
|
-
"no-border"
|
|
1782
|
-
]),
|
|
1783
|
-
g(Wi, {
|
|
1784
|
-
title: x(f).blockSettings.background,
|
|
1785
|
-
open: v.has("bg"),
|
|
1786
|
-
onToggle: i[3] ||= (e) => N("bg")
|
|
1787
|
-
}, {
|
|
1788
|
-
default: l(() => [p("label", { class: n(x(K)) }, c(x(f).blockSettings.color), 3), g(Y, {
|
|
1789
|
-
"model-value": t.block.styles.backgroundColor ?? "",
|
|
1790
|
-
"onUpdate:modelValue": i[2] ||= (e) => R("backgroundColor", e)
|
|
1791
|
-
}, null, 8, ["model-value"])]),
|
|
1792
|
-
_: 1
|
|
1793
|
-
}, 8, ["title", "open"]),
|
|
1794
|
-
g(Wi, {
|
|
1795
|
-
title: x(f).blockSettings.display,
|
|
1796
|
-
open: v.has("display"),
|
|
1797
|
-
onToggle: i[4] ||= (e) => N("display")
|
|
1798
|
-
}, {
|
|
1799
|
-
default: l(() => [p("div", Gi, [(s(), m(C, null, e(M, (e) => g(X, {
|
|
1800
|
-
key: e.key,
|
|
1801
|
-
class: "tpl:text-xs tpl:text-[var(--tpl-text)]",
|
|
1802
|
-
"model-value": z(e.key),
|
|
1803
|
-
label: x(f).blockSettings[e.labelKey],
|
|
1804
|
-
"onUpdate:modelValue": (t) => B(e.key)
|
|
1805
|
-
}, {
|
|
1806
|
-
default: l(() => [p("span", Ki, [(s(), y(o(e.icon), {
|
|
1807
|
-
size: 14,
|
|
1808
|
-
"stroke-width": 1.5
|
|
1809
|
-
})), b(" " + c(x(f).blockSettings[e.labelKey]), 1)])]),
|
|
1810
|
-
_: 2
|
|
1811
|
-
}, 1032, [
|
|
1812
|
-
"model-value",
|
|
1813
|
-
"label",
|
|
1814
|
-
"onUpdate:modelValue"
|
|
1815
|
-
])), 64))])]),
|
|
1816
|
-
_: 1
|
|
1817
|
-
}, 8, ["title", "open"]),
|
|
1818
|
-
P.value ? (s(), y(Wi, {
|
|
1819
|
-
key: 0,
|
|
1820
|
-
"header-test-id": "display-condition-section",
|
|
1821
|
-
title: x(f).blockSettings.displayCondition,
|
|
1822
|
-
open: v.has("condition"),
|
|
1823
|
-
onToggle: i[8] ||= (e) => N("condition")
|
|
1824
|
-
}, {
|
|
1825
|
-
default: l(() => [p("div", qi, [p("select", {
|
|
1826
|
-
"data-testid": "display-condition-select",
|
|
1827
|
-
class: n(["tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:duration-150 tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", t.block.displayCondition ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"]),
|
|
1828
|
-
value: E.value || F.value ? "__custom__" : t.block.displayCondition?.label ?? "",
|
|
1829
|
-
onChange: i[5] ||= (e) => {
|
|
1830
|
-
let t = e.target.value;
|
|
1831
|
-
if (t === "__custom__") {
|
|
1832
|
-
ee();
|
|
1833
|
-
return;
|
|
1834
|
-
}
|
|
1835
|
-
if (E.value = !1, !t) {
|
|
1836
|
-
u("update", { displayCondition: void 0 });
|
|
1837
|
-
return;
|
|
1838
|
-
}
|
|
1839
|
-
let n = x(h).find((e) => e.label === t);
|
|
1840
|
-
n && u("update", { displayCondition: n });
|
|
1841
|
-
}
|
|
1842
|
-
}, [
|
|
1843
|
-
p("option", Yi, c(x(f).blockSettings.noCondition), 1),
|
|
1844
|
-
(s(!0), m(C, null, e(L.value, (t, n) => (s(), m(C, { key: n }, [n ? (s(), m("optgroup", {
|
|
1845
|
-
key: 0,
|
|
1846
|
-
label: String(n)
|
|
1847
|
-
}, [(s(!0), m(C, null, e(t, (e) => (s(), m("option", {
|
|
1848
|
-
key: e.label,
|
|
1849
|
-
value: e.label
|
|
1850
|
-
}, c(e.label), 9, Zi))), 128))], 8, Xi)) : (s(!0), m(C, { key: 1 }, e(t, (e) => (s(), m("option", {
|
|
1851
|
-
key: e.label,
|
|
1852
|
-
value: e.label
|
|
1853
|
-
}, c(e.label), 9, Qi))), 128))], 64))), 128)),
|
|
1854
|
-
x(_) ? (s(), m("option", $i, c(x(f).blockSettings.customCondition), 1)) : T("", !0)
|
|
1855
|
-
], 42, Ji), E.value || F.value ? (s(), m("div", ea, [
|
|
1856
|
-
p("div", null, [p("label", ta, c(x(f).blockSettings.customConditionBefore), 1), k(p("textarea", {
|
|
1857
|
-
"onUpdate:modelValue": i[6] ||= (e) => O.value = e,
|
|
1858
|
-
rows: "2",
|
|
1859
|
-
class: n(x(Bt))
|
|
1860
|
-
}, null, 2), [[A, O.value]])]),
|
|
1861
|
-
p("div", null, [p("label", na, c(x(f).blockSettings.customConditionAfter), 1), k(p("textarea", {
|
|
1862
|
-
"onUpdate:modelValue": i[7] ||= (e) => j.value = e,
|
|
1863
|
-
rows: "2",
|
|
1864
|
-
class: n(x(Bt))
|
|
1865
|
-
}, null, 2), [[A, j.value]])]),
|
|
1866
|
-
p("div", ra, [p("button", {
|
|
1867
|
-
type: "button",
|
|
1868
|
-
class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:opacity-50",
|
|
1869
|
-
disabled: !O.value.trim(),
|
|
1870
|
-
onClick: I
|
|
1871
|
-
}, c(x(f).blockSettings.applyCondition), 9, ia)])
|
|
1872
|
-
])) : t.block.displayCondition && !F.value ? (s(), m(C, { key: 1 }, [t.block.displayCondition.description ? (s(), m("p", aa, c(t.block.displayCondition.description), 1)) : T("", !0), p("div", oa, [p("pre", sa, c(t.block.displayCondition.before), 1), t.block.displayCondition.after ? (s(), m("pre", ca, c(t.block.displayCondition.after), 1)) : T("", !0)])], 64)) : T("", !0)])]),
|
|
1873
|
-
_: 1
|
|
1874
|
-
}, 8, ["title", "open"])) : T("", !0)
|
|
1875
|
-
], 2));
|
|
1876
|
-
}
|
|
1877
|
-
}), ua = ["title"], da = /* @__PURE__ */ f({
|
|
1878
|
-
__name: "BooleanField",
|
|
1879
|
-
props: {
|
|
1880
|
-
field: {},
|
|
1881
|
-
modelValue: { type: Boolean },
|
|
1882
|
-
readOnly: { type: Boolean }
|
|
1883
|
-
},
|
|
1884
|
-
emits: ["update:modelValue"],
|
|
1885
|
-
setup(e, { emit: t }) {
|
|
1886
|
-
let n = t, { t: r } = U();
|
|
1887
|
-
return (t, i) => (s(), m("div", {
|
|
1888
|
-
class: "tpl:mb-3.5",
|
|
1889
|
-
title: e.readOnly ? x(r).customBlocks.dataSource.readOnlyTooltip : void 0
|
|
1890
|
-
}, [g(X, {
|
|
1891
|
-
class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
1892
|
-
"model-value": e.modelValue,
|
|
1893
|
-
label: e.field.label,
|
|
1894
|
-
required: e.field.required,
|
|
1895
|
-
disabled: e.readOnly,
|
|
1896
|
-
"onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
|
|
1897
|
-
}, {
|
|
1898
|
-
default: l(() => [b(c(e.field.label) + " ", 1), e.readOnly ? (s(), y(x($t), {
|
|
1899
|
-
key: 0,
|
|
1900
|
-
size: 12,
|
|
1901
|
-
class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
|
|
1902
|
-
})) : T("", !0)]),
|
|
1903
|
-
_: 1
|
|
1904
|
-
}, 8, [
|
|
1905
|
-
"model-value",
|
|
1906
|
-
"label",
|
|
1907
|
-
"required",
|
|
1908
|
-
"disabled"
|
|
1909
|
-
])], 8, ua));
|
|
1910
|
-
}
|
|
1911
|
-
}), fa = { class: "tpl:mb-3.5" }, pa = {
|
|
1912
|
-
key: 1,
|
|
1913
|
-
class: "tpl:text-[var(--tpl-danger)]"
|
|
1914
|
-
}, ma = /* @__PURE__ */ f({
|
|
1915
|
-
__name: "FieldWrapper",
|
|
1916
|
-
props: {
|
|
1917
|
-
label: {},
|
|
1918
|
-
required: { type: Boolean },
|
|
1919
|
-
readOnly: { type: Boolean }
|
|
1920
|
-
},
|
|
1921
|
-
setup(e) {
|
|
1922
|
-
return (t, r) => (s(), m("div", fa, [p("label", { class: n(x(K)) }, [
|
|
1923
|
-
b(c(e.label) + " ", 1),
|
|
1924
|
-
e.readOnly ? (s(), y(x($t), {
|
|
1925
|
-
key: 0,
|
|
1926
|
-
size: 12,
|
|
1927
|
-
class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
|
|
1928
|
-
})) : T("", !0),
|
|
1929
|
-
e.required ? (s(), m("span", pa, "*")) : T("", !0)
|
|
1930
|
-
], 2), _(t.$slots, "default")]));
|
|
1931
|
-
}
|
|
1932
|
-
}), ha = /* @__PURE__ */ f({
|
|
1933
|
-
__name: "ColorField",
|
|
1934
|
-
props: {
|
|
1935
|
-
field: {},
|
|
1936
|
-
modelValue: {},
|
|
1937
|
-
readOnly: { type: Boolean }
|
|
1938
|
-
},
|
|
1939
|
-
emits: ["update:modelValue"],
|
|
1940
|
-
setup(e, { emit: t }) {
|
|
1941
|
-
let n = e, r = t, { t: i } = U(), a = D(ct, Ie), o = w(() => ae(n.field, a));
|
|
1942
|
-
return (t, n) => (s(), y(ma, {
|
|
1943
|
-
label: e.field.label,
|
|
1944
|
-
required: e.field.required,
|
|
1945
|
-
"read-only": e.readOnly
|
|
1946
|
-
}, {
|
|
1947
|
-
default: l(() => [g(Y, {
|
|
1948
|
-
"model-value": e.modelValue,
|
|
1949
|
-
placeholder: e.field.placeholder,
|
|
1950
|
-
disabled: e.readOnly,
|
|
1951
|
-
presets: o.value.presets,
|
|
1952
|
-
"allow-custom": o.value.allowCustom,
|
|
1953
|
-
title: e.readOnly ? x(i).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1954
|
-
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", e)
|
|
1955
|
-
}, null, 8, [
|
|
1956
|
-
"model-value",
|
|
1957
|
-
"placeholder",
|
|
1958
|
-
"disabled",
|
|
1959
|
-
"presets",
|
|
1960
|
-
"allow-custom",
|
|
1961
|
-
"title"
|
|
1962
|
-
])]),
|
|
1963
|
-
_: 1
|
|
1964
|
-
}, 8, [
|
|
1965
|
-
"label",
|
|
1966
|
-
"required",
|
|
1967
|
-
"read-only"
|
|
1968
|
-
]));
|
|
1969
|
-
}
|
|
1970
|
-
}), ga = {
|
|
1971
|
-
key: 0,
|
|
1972
|
-
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
|
|
1973
|
-
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 90%, transparent)" }
|
|
1974
|
-
}, _a = [
|
|
1975
|
-
"value",
|
|
1976
|
-
"placeholder",
|
|
1977
|
-
"title"
|
|
1978
|
-
], va = ["value", "placeholder"], ya = /* @__PURE__ */ f({
|
|
1979
|
-
__name: "ImageField",
|
|
1980
|
-
props: {
|
|
1981
|
-
field: {},
|
|
1982
|
-
modelValue: {},
|
|
1983
|
-
readOnly: { type: Boolean }
|
|
1984
|
-
},
|
|
1985
|
-
emits: ["update:modelValue"],
|
|
1986
|
-
setup(e, { emit: t }) {
|
|
1987
|
-
let r = e, i = t, { t: a } = U(), o = D(Ue, null), u = Ft(), f = w(() => !!o);
|
|
1988
|
-
async function h() {
|
|
1989
|
-
let e = await o?.({ accept: ["images"] });
|
|
1990
|
-
u.alive && e && i("update:modelValue", e.url);
|
|
1991
|
-
}
|
|
1992
|
-
let _ = d(), v = d(!1), S = w(() => f.value && !v.value && !r.readOnly);
|
|
1993
|
-
async function E(e) {
|
|
1994
|
-
if (o) {
|
|
1995
|
-
v.value = !0;
|
|
1996
|
-
try {
|
|
1997
|
-
let t = await o({
|
|
1998
|
-
accept: ["images"],
|
|
1999
|
-
files: e
|
|
2000
|
-
});
|
|
2001
|
-
if (!u.alive) return;
|
|
2002
|
-
t && i("update:modelValue", t.url);
|
|
2003
|
-
} finally {
|
|
2004
|
-
u.alive && (v.value = !1);
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
}
|
|
2008
|
-
let { isOver: O } = pe({
|
|
2009
|
-
target: _,
|
|
2010
|
-
enabled: S,
|
|
2011
|
-
onFiles: E
|
|
2012
|
-
});
|
|
2013
|
-
return (t, r) => (s(), y(ma, {
|
|
2014
|
-
label: e.field.label,
|
|
2015
|
-
required: e.field.required,
|
|
2016
|
-
"read-only": e.readOnly
|
|
2017
|
-
}, {
|
|
2018
|
-
default: l(() => [p("div", {
|
|
2019
|
-
ref_key: "dropZoneRef",
|
|
2020
|
-
ref: _,
|
|
2021
|
-
class: "tpl:relative"
|
|
2022
|
-
}, [
|
|
2023
|
-
S.value && (x(O) || v.value) ? (s(), m("div", ga, [v.value ? (s(), m(C, { key: 0 }, [g(x(Ct), {
|
|
2024
|
-
class: "tpl-spinner",
|
|
2025
|
-
size: 18,
|
|
2026
|
-
"stroke-width": 2
|
|
2027
|
-
}), b(" " + c(x(a).image.uploading), 1)], 64)) : (s(), m(C, { key: 1 }, [g(x(F), {
|
|
2028
|
-
size: 18,
|
|
2029
|
-
"stroke-width": 1.5
|
|
2030
|
-
}), b(" " + c(x(a).image.dropToUpload), 1)], 64))])) : T("", !0),
|
|
2031
|
-
e.readOnly ? (s(), m("input", {
|
|
2032
|
-
key: 1,
|
|
2033
|
-
type: "url",
|
|
2034
|
-
class: n([x(G), "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
2035
|
-
value: e.modelValue,
|
|
2036
|
-
placeholder: e.field.placeholder || "https://...",
|
|
2037
|
-
disabled: "",
|
|
2038
|
-
title: x(a).customBlocks.dataSource.readOnlyTooltip
|
|
2039
|
-
}, null, 10, _a)) : (s(), m("input", {
|
|
2040
|
-
key: 2,
|
|
2041
|
-
type: "url",
|
|
2042
|
-
class: n(x(G)),
|
|
2043
|
-
value: e.modelValue,
|
|
2044
|
-
placeholder: e.field.placeholder || "https://...",
|
|
2045
|
-
onInput: r[0] ||= (e) => i("update:modelValue", e.target.value)
|
|
2046
|
-
}, null, 42, va)),
|
|
2047
|
-
f.value && !e.readOnly ? (s(), m("button", {
|
|
2048
|
-
key: 3,
|
|
2049
|
-
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
|
|
2050
|
-
onClick: r[1] ||= (e) => h()
|
|
2051
|
-
}, [g(x(ue), {
|
|
2052
|
-
size: 14,
|
|
2053
|
-
"stroke-width": 1.5
|
|
2054
|
-
}), b(" " + c(x(a).image.browseMedia), 1)])) : T("", !0)
|
|
2055
|
-
], 512)]),
|
|
2056
|
-
_: 1
|
|
2057
|
-
}, 8, [
|
|
2058
|
-
"label",
|
|
2059
|
-
"required",
|
|
2060
|
-
"read-only"
|
|
2061
|
-
]));
|
|
2062
|
-
}
|
|
2063
|
-
}), ba = [
|
|
2064
|
-
"value",
|
|
2065
|
-
"placeholder",
|
|
2066
|
-
"min",
|
|
2067
|
-
"max",
|
|
2068
|
-
"step",
|
|
2069
|
-
"disabled",
|
|
2070
|
-
"title"
|
|
2071
|
-
], xa = /* @__PURE__ */ f({
|
|
2072
|
-
__name: "NumberField",
|
|
2073
|
-
props: {
|
|
2074
|
-
field: {},
|
|
2075
|
-
modelValue: {},
|
|
2076
|
-
readOnly: { type: Boolean }
|
|
2077
|
-
},
|
|
2078
|
-
emits: ["update:modelValue"],
|
|
2079
|
-
setup(e, { emit: t }) {
|
|
2080
|
-
let r = t, { t: i } = U();
|
|
2081
|
-
return (t, a) => (s(), y(ma, {
|
|
2082
|
-
label: e.field.label,
|
|
2083
|
-
required: e.field.required,
|
|
2084
|
-
"read-only": e.readOnly
|
|
2085
|
-
}, {
|
|
2086
|
-
default: l(() => [p("input", {
|
|
2087
|
-
type: "number",
|
|
2088
|
-
class: n([x(G), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
2089
|
-
value: e.modelValue,
|
|
2090
|
-
placeholder: e.field.placeholder,
|
|
2091
|
-
min: e.field.min,
|
|
2092
|
-
max: e.field.max,
|
|
2093
|
-
step: e.field.step,
|
|
2094
|
-
disabled: e.readOnly,
|
|
2095
|
-
title: e.readOnly ? x(i).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
2096
|
-
onInput: a[0] ||= (t) => !e.readOnly && r("update:modelValue", Number(t.target.value))
|
|
2097
|
-
}, null, 42, ba)]),
|
|
2098
|
-
_: 1
|
|
2099
|
-
}, 8, [
|
|
2100
|
-
"label",
|
|
2101
|
-
"required",
|
|
2102
|
-
"read-only"
|
|
2103
|
-
]));
|
|
2104
|
-
}
|
|
2105
|
-
}), Sa = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Ca = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, wa = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, Ta = ["title", "onClick"], Ea = {
|
|
2106
|
-
key: 1,
|
|
2107
|
-
class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
2108
|
-
}, Da = /* @__PURE__ */ f({
|
|
2109
|
-
__name: "RepeatableField",
|
|
2110
|
-
props: {
|
|
2111
|
-
field: {},
|
|
2112
|
-
modelValue: {},
|
|
2113
|
-
readOnly: { type: Boolean }
|
|
2114
|
-
},
|
|
2115
|
-
emits: ["update:modelValue"],
|
|
2116
|
-
setup(t, { emit: r }) {
|
|
2117
|
-
let i = t, a = r, { t: u } = U(), d = w(() => i.modelValue || []), f = w(() => !i.field.maxItems || d.value.length < i.field.maxItems), h = w(() => !i.field.minItems || d.value.length > i.field.minItems);
|
|
2118
|
-
function _() {
|
|
2119
|
-
if (!f.value || i.readOnly) return;
|
|
2120
|
-
let e = {};
|
|
2121
|
-
for (let t of i.field.fields) e[t.key] = t.default ?? "";
|
|
2122
|
-
a("update:modelValue", [...d.value, e]);
|
|
2123
|
-
}
|
|
2124
|
-
function v(e) {
|
|
2125
|
-
if (!h.value || i.readOnly) return;
|
|
2126
|
-
let t = [...d.value];
|
|
2127
|
-
t.splice(e, 1), a("update:modelValue", t);
|
|
2128
|
-
}
|
|
2129
|
-
function S(e, t, n) {
|
|
2130
|
-
let r = d.value.map((r, i) => i === e ? {
|
|
2131
|
-
...r,
|
|
2132
|
-
[t]: n
|
|
2133
|
-
} : r);
|
|
2134
|
-
a("update:modelValue", r);
|
|
2135
|
-
}
|
|
2136
|
-
return (r, i) => (s(), y(ma, {
|
|
2137
|
-
label: t.field.label,
|
|
2138
|
-
required: t.field.required,
|
|
2139
|
-
"read-only": t.readOnly
|
|
2140
|
-
}, {
|
|
2141
|
-
default: l(() => [p("div", Sa, [
|
|
2142
|
-
(s(!0), m(C, null, e(d.value, (n, r) => (s(), m("div", {
|
|
2143
|
-
key: `${t.field.key}-${r}`,
|
|
2144
|
-
class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
|
|
2145
|
-
}, [p("div", Ca, [p("span", wa, " #" + c(r + 1), 1), h.value && !t.readOnly ? (s(), m("button", {
|
|
2146
|
-
key: 0,
|
|
2147
|
-
type: "button",
|
|
2148
|
-
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
|
|
2149
|
-
title: x(u).customBlocks.fields.removeItem,
|
|
2150
|
-
onClick: (e) => v(r)
|
|
2151
|
-
}, [g(x(At), {
|
|
2152
|
-
size: 12,
|
|
2153
|
-
"stroke-width": 2
|
|
2154
|
-
})], 8, Ta)) : T("", !0)]), (s(!0), m(C, null, e(t.field.fields, (e) => (s(), y(o(x(Ia)(e.type)), {
|
|
2155
|
-
key: e.key,
|
|
2156
|
-
field: e,
|
|
2157
|
-
"model-value": n[e.key],
|
|
2158
|
-
"read-only": t.readOnly,
|
|
2159
|
-
"onUpdate:modelValue": (t) => S(r, e.key, t)
|
|
2160
|
-
}, null, 8, [
|
|
2161
|
-
"field",
|
|
2162
|
-
"model-value",
|
|
2163
|
-
"read-only",
|
|
2164
|
-
"onUpdate:modelValue"
|
|
2165
|
-
]))), 128))]))), 128)),
|
|
2166
|
-
f.value && !t.readOnly ? (s(), m("button", {
|
|
2167
|
-
key: 0,
|
|
2168
|
-
type: "button",
|
|
2169
|
-
class: n(x(Ht)),
|
|
2170
|
-
onClick: _
|
|
2171
|
-
}, [g(x(nn), {
|
|
2172
|
-
size: 14,
|
|
2173
|
-
"stroke-width": 2
|
|
2174
|
-
}), b(" " + c(x(u).customBlocks.fields.addItem), 1)], 2)) : T("", !0),
|
|
2175
|
-
!f.value && !t.readOnly ? (s(), m("p", Ea, c(x(u).customBlocks.fields.maxItemsReached), 1)) : T("", !0)
|
|
2176
|
-
])]),
|
|
2177
|
-
_: 1
|
|
2178
|
-
}, 8, [
|
|
2179
|
-
"label",
|
|
2180
|
-
"required",
|
|
2181
|
-
"read-only"
|
|
2182
|
-
]));
|
|
2183
|
-
}
|
|
2184
|
-
}), Oa = [
|
|
2185
|
-
"value",
|
|
2186
|
-
"disabled",
|
|
2187
|
-
"title"
|
|
2188
|
-
], ka = ["value"], Aa = /* @__PURE__ */ f({
|
|
2189
|
-
__name: "SelectField",
|
|
2190
|
-
props: {
|
|
2191
|
-
field: {},
|
|
2192
|
-
modelValue: {},
|
|
2193
|
-
readOnly: { type: Boolean }
|
|
2194
|
-
},
|
|
2195
|
-
emits: ["update:modelValue"],
|
|
2196
|
-
setup(t, { emit: r }) {
|
|
2197
|
-
let i = r, { t: a } = U();
|
|
2198
|
-
return (r, o) => (s(), y(ma, {
|
|
2199
|
-
label: t.field.label,
|
|
2200
|
-
required: t.field.required,
|
|
2201
|
-
"read-only": t.readOnly
|
|
2202
|
-
}, {
|
|
2203
|
-
default: l(() => [p("select", {
|
|
2204
|
-
class: n([x(G), t.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
2205
|
-
value: t.modelValue,
|
|
2206
|
-
disabled: t.readOnly,
|
|
2207
|
-
title: t.readOnly ? x(a).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
2208
|
-
onChange: o[0] ||= (e) => !t.readOnly && i("update:modelValue", e.target.value)
|
|
2209
|
-
}, [(s(!0), m(C, null, e(t.field.options, (e) => (s(), m("option", {
|
|
2210
|
-
key: e.value,
|
|
2211
|
-
value: e.value
|
|
2212
|
-
}, c(e.label), 9, ka))), 128))], 42, Oa)]),
|
|
2213
|
-
_: 1
|
|
2214
|
-
}, 8, [
|
|
2215
|
-
"label",
|
|
2216
|
-
"required",
|
|
2217
|
-
"read-only"
|
|
2218
|
-
]));
|
|
2219
|
-
}
|
|
2220
|
-
}), ja = [
|
|
2221
|
-
"value",
|
|
2222
|
-
"placeholder",
|
|
2223
|
-
"title"
|
|
2224
|
-
], Ma = /* @__PURE__ */ f({
|
|
2225
|
-
__name: "TextField",
|
|
2226
|
-
props: {
|
|
2227
|
-
field: {},
|
|
2228
|
-
modelValue: {},
|
|
2229
|
-
readOnly: { type: Boolean }
|
|
2230
|
-
},
|
|
2231
|
-
emits: ["update:modelValue"],
|
|
2232
|
-
setup(e, { emit: t }) {
|
|
2233
|
-
let r = t, { t: i } = U();
|
|
2234
|
-
return (t, a) => (s(), y(ma, {
|
|
2235
|
-
label: e.field.label,
|
|
2236
|
-
required: e.field.required,
|
|
2237
|
-
"read-only": e.readOnly
|
|
2238
|
-
}, {
|
|
2239
|
-
default: l(() => [e.readOnly ? (s(), m("input", {
|
|
2240
|
-
key: 0,
|
|
2241
|
-
type: "text",
|
|
2242
|
-
class: n([x(G), "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
2243
|
-
value: e.modelValue,
|
|
2244
|
-
placeholder: e.field.placeholder,
|
|
2245
|
-
disabled: "",
|
|
2246
|
-
title: x(i).customBlocks.dataSource.readOnlyTooltip
|
|
2247
|
-
}, null, 10, ja)) : (s(), y($, {
|
|
2248
|
-
key: 1,
|
|
2249
|
-
"model-value": e.modelValue,
|
|
2250
|
-
placeholder: e.field.placeholder,
|
|
2251
|
-
"onUpdate:modelValue": a[0] ||= (e) => r("update:modelValue", e)
|
|
2252
|
-
}, null, 8, ["model-value", "placeholder"]))]),
|
|
2253
|
-
_: 1
|
|
2254
|
-
}, 8, [
|
|
2255
|
-
"label",
|
|
2256
|
-
"required",
|
|
2257
|
-
"read-only"
|
|
2258
|
-
]));
|
|
2259
|
-
}
|
|
2260
|
-
}), Na = [
|
|
2261
|
-
"value",
|
|
2262
|
-
"placeholder",
|
|
2263
|
-
"title"
|
|
2264
|
-
], Pa = "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:opacity-60 tpl:cursor-not-allowed", Fa = {
|
|
2265
|
-
text: Ma,
|
|
2266
|
-
textarea: /* @__PURE__ */ f({
|
|
2267
|
-
__name: "TextareaField",
|
|
2268
|
-
props: {
|
|
2269
|
-
field: {},
|
|
2270
|
-
modelValue: {},
|
|
2271
|
-
readOnly: { type: Boolean }
|
|
2272
|
-
},
|
|
2273
|
-
emits: ["update:modelValue"],
|
|
2274
|
-
setup(e, { emit: t }) {
|
|
2275
|
-
let r = t, { t: i } = U();
|
|
2276
|
-
return (t, a) => (s(), y(ma, {
|
|
2277
|
-
label: e.field.label,
|
|
2278
|
-
required: e.field.required,
|
|
2279
|
-
"read-only": e.readOnly
|
|
2280
|
-
}, {
|
|
2281
|
-
default: l(() => [e.readOnly ? (s(), m("textarea", {
|
|
2282
|
-
key: 0,
|
|
2283
|
-
value: e.modelValue,
|
|
2284
|
-
placeholder: e.field.placeholder,
|
|
2285
|
-
rows: "3",
|
|
2286
|
-
disabled: "",
|
|
2287
|
-
title: x(i).customBlocks.dataSource.readOnlyTooltip,
|
|
2288
|
-
class: n(Pa)
|
|
2289
|
-
}, null, 8, Na)) : (s(), y(ur, {
|
|
2290
|
-
key: 1,
|
|
2291
|
-
"model-value": e.modelValue,
|
|
2292
|
-
placeholder: e.field.placeholder,
|
|
2293
|
-
"onUpdate:modelValue": a[0] ||= (e) => r("update:modelValue", e)
|
|
2294
|
-
}, null, 8, ["model-value", "placeholder"]))]),
|
|
2295
|
-
_: 1
|
|
2296
|
-
}, 8, [
|
|
2297
|
-
"label",
|
|
2298
|
-
"required",
|
|
2299
|
-
"read-only"
|
|
2300
|
-
]));
|
|
2301
|
-
}
|
|
2302
|
-
}),
|
|
2303
|
-
image: ya,
|
|
2304
|
-
color: ha,
|
|
2305
|
-
number: xa,
|
|
2306
|
-
select: Aa,
|
|
2307
|
-
boolean: da,
|
|
2308
|
-
repeatable: Da
|
|
2309
|
-
};
|
|
2310
|
-
function Ia(e) {
|
|
2311
|
-
return Fa[e] ?? Ma;
|
|
2312
|
-
}
|
|
2313
|
-
//#endregion
|
|
2314
|
-
//#region src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
2315
|
-
var La = {
|
|
2316
|
-
key: 0,
|
|
2317
|
-
class: "tpl:p-4"
|
|
2318
|
-
}, Ra = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, za = { key: 1 }, Ba = {
|
|
2319
|
-
key: 0,
|
|
2320
|
-
class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
2321
|
-
}, Va = {
|
|
2322
|
-
key: 1,
|
|
2323
|
-
class: "tpl:mb-4"
|
|
2324
|
-
}, Ha = {
|
|
2325
|
-
key: 1,
|
|
2326
|
-
class: "tpl:flex tpl:h-[32px] tpl:items-center"
|
|
2327
|
-
}, Ua = {
|
|
2328
|
-
key: 0,
|
|
2329
|
-
class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
2330
|
-
}, Wa = {
|
|
2331
|
-
key: 2,
|
|
2332
|
-
class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
|
|
2333
|
-
}, Ga = /* @__PURE__ */ f({
|
|
2334
|
-
__name: "CustomBlockToolbar",
|
|
2335
|
-
props: { block: {} },
|
|
2336
|
-
emits: ["updateFieldValues", "updateDataSourceFetched"],
|
|
2337
|
-
setup(t, { emit: n }) {
|
|
2338
|
-
let r = t, i = n, { t: a } = U(), l = D(at, []), u = w(() => l.find((e) => e.type === r.block.customType)), d = w(() => r.block), { isFetching: f, fetchError: h, fetch: _, hasDataSource: v, needsFetch: S } = ce({
|
|
2339
|
-
definition: u,
|
|
2340
|
-
block: d,
|
|
2341
|
-
onUpdate: (e, t) => {
|
|
2342
|
-
i("updateFieldValues", e), i("updateDataSourceFetched", t);
|
|
2343
|
-
}
|
|
2344
|
-
});
|
|
2345
|
-
function E(e) {
|
|
2346
|
-
return e.readOnly === !0 && v.value && !!r.block.dataSourceFetched;
|
|
2347
|
-
}
|
|
2348
|
-
function O(e, t) {
|
|
2349
|
-
i("updateFieldValues", {
|
|
2350
|
-
...r.block.fieldValues,
|
|
2351
|
-
[e]: t
|
|
2352
|
-
});
|
|
2353
|
-
}
|
|
2354
|
-
return (n, r) => u.value ? (s(), m("div", za, [
|
|
2355
|
-
u.value.description ? (s(), m("p", Ba, c(u.value.description), 1)) : T("", !0),
|
|
2356
|
-
x(v) ? (s(), m("div", Va, [x(S) && !x(f) ? (s(), m("button", {
|
|
2357
|
-
key: 0,
|
|
2358
|
-
type: "button",
|
|
2359
|
-
class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-md tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:bg-[var(--tpl-primary)]",
|
|
2360
|
-
onClick: r[0] ||= (...e) => x(_) && x(_)(...e)
|
|
2361
|
-
}, c(u.value?.dataSource?.label || x(a).customBlocks.dataSource.fetchButton), 1)) : (s(), m("div", Ha, [x(f) ? (s(), m("div", Ua, c(x(a).customBlocks.dataSource.fetching), 1)) : (s(), m("button", {
|
|
2362
|
-
key: 1,
|
|
2363
|
-
type: "button",
|
|
2364
|
-
class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
|
|
2365
|
-
onClick: r[1] ||= (...e) => x(_) && x(_)(...e)
|
|
2366
|
-
}, [g(x(yt), { size: 12 }), b(" " + c(x(a).customBlocks.dataSource.changeButton), 1)]))])), x(h) ? (s(), m("p", Wa, [g(x(pt), {
|
|
2367
|
-
size: 14,
|
|
2368
|
-
class: "tpl:shrink-0"
|
|
2369
|
-
}), b(" " + c(x(a).customBlocks.dataSource.fetchError), 1)])) : T("", !0)])) : T("", !0),
|
|
2370
|
-
(s(!0), m(C, null, e(u.value.fields, (e) => (s(), y(o(x(Ia)(e.type)), {
|
|
2371
|
-
key: e.key,
|
|
2372
|
-
field: e,
|
|
2373
|
-
"model-value": t.block.fieldValues[e.key],
|
|
2374
|
-
"read-only": E(e),
|
|
2375
|
-
"onUpdate:modelValue": (t) => O(e.key, t)
|
|
2376
|
-
}, null, 8, [
|
|
2377
|
-
"field",
|
|
2378
|
-
"model-value",
|
|
2379
|
-
"read-only",
|
|
2380
|
-
"onUpdate:modelValue"
|
|
2381
|
-
]))), 128))
|
|
2382
|
-
])) : (s(), m("div", La, [p("p", Ra, c(x(a).customBlocks.toolbar.noDefinition), 1)]));
|
|
2383
|
-
}
|
|
2384
|
-
}), Ka = { class: "tpl:mb-3.5" }, qa = { class: "tpl:mb-3.5" }, Ja = { class: "tpl:mb-3.5" }, Ya = { class: "tpl:flex tpl:items-stretch" }, Xa = ["value"], Za = /* @__PURE__ */ f({
|
|
2385
|
-
__name: "DividerToolbar",
|
|
2386
|
-
props: { block: {} },
|
|
2387
|
-
emits: ["update"],
|
|
2388
|
-
setup(e, { emit: t }) {
|
|
2389
|
-
let r = t, { t: i } = U();
|
|
2390
|
-
function a(e, t) {
|
|
2391
|
-
r("update", { [e]: t });
|
|
2392
|
-
}
|
|
2393
|
-
return (t, r) => (s(), m(C, null, [
|
|
2394
|
-
p("div", Ka, [p("label", { class: n(x(K)) }, c(x(i).divider.style), 3), g(Q, {
|
|
2395
|
-
options: [
|
|
2396
|
-
{
|
|
2397
|
-
value: "solid",
|
|
2398
|
-
label: x(i).divider.solid
|
|
2399
|
-
},
|
|
2400
|
-
{
|
|
2401
|
-
value: "dashed",
|
|
2402
|
-
label: x(i).divider.dashed
|
|
2403
|
-
},
|
|
2404
|
-
{
|
|
2405
|
-
value: "dotted",
|
|
2406
|
-
label: x(i).divider.dotted
|
|
2407
|
-
}
|
|
2408
|
-
],
|
|
2409
|
-
"model-value": e.block.lineStyle,
|
|
2410
|
-
"onUpdate:modelValue": r[0] ||= (e) => a("lineStyle", e)
|
|
2411
|
-
}, null, 8, ["options", "model-value"])]),
|
|
2412
|
-
p("div", qa, [p("label", { class: n(x(K)) }, c(x(i).divider.color), 3), g(Y, {
|
|
2413
|
-
"model-value": e.block.color,
|
|
2414
|
-
"onUpdate:modelValue": r[1] ||= (e) => a("color", e)
|
|
2415
|
-
}, null, 8, ["model-value"])]),
|
|
2416
|
-
p("div", Ja, [p("label", { class: n(x(K)) }, c(x(i).divider.thickness), 3), p("div", Ya, [p("input", {
|
|
2417
|
-
type: "number",
|
|
2418
|
-
class: n(x(J)),
|
|
2419
|
-
value: e.block.thickness,
|
|
2420
|
-
min: "1",
|
|
2421
|
-
max: "10",
|
|
2422
|
-
onInput: r[2] ||= (e) => a("thickness", Number(e.target.value))
|
|
2423
|
-
}, null, 42, Xa), p("span", { class: n(x(q)) }, "px", 2)])])
|
|
2424
|
-
], 64));
|
|
2425
|
-
}
|
|
2426
|
-
}), Qa = { class: "tpl:mb-3.5" }, $a = ["value"], eo = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, to = /* @__PURE__ */ f({
|
|
2427
|
-
__name: "HtmlToolbar",
|
|
2428
|
-
props: { block: {} },
|
|
2429
|
-
emits: ["update"],
|
|
2430
|
-
setup(e, { emit: t }) {
|
|
2431
|
-
let r = t, { t: i } = U();
|
|
2432
|
-
return (t, a) => (s(), m("div", Qa, [
|
|
2433
|
-
p("label", { class: n(x(K)) }, c(x(i).html.content), 3),
|
|
2434
|
-
p("textarea", {
|
|
2435
|
-
value: e.block.content,
|
|
2436
|
-
placeholder: "<div>...</div>",
|
|
2437
|
-
rows: "10",
|
|
2438
|
-
class: n(x(Bt)),
|
|
2439
|
-
onInput: a[0] ||= (e) => r("update", { content: e.target.value })
|
|
2440
|
-
}, null, 42, $a),
|
|
2441
|
-
p("p", eo, [g(x(xt), {
|
|
2442
|
-
size: 12,
|
|
2443
|
-
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
2444
|
-
}), b(" " + c(x(i).html.sanitizationHint), 1)])
|
|
2445
|
-
]));
|
|
2446
|
-
}
|
|
2447
|
-
}), no = { class: "tpl:mb-3.5" }, ro = {
|
|
2448
|
-
key: 0,
|
|
2449
|
-
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
|
|
2450
|
-
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 90%, transparent)" }
|
|
2451
|
-
}, io = {
|
|
2452
|
-
key: 0,
|
|
2453
|
-
class: "tpl:mb-3.5"
|
|
2454
|
-
}, ao = ["value", "placeholder"], oo = { class: "tpl:mb-3.5" }, so = { class: "tpl:block tpl:text-[var(--tpl-text-dim)]" }, co = { class: "tpl:mb-3.5" }, lo = ["value"], uo = { value: "full" }, fo = { value: "custom" }, po = {
|
|
2455
|
-
key: 0,
|
|
2456
|
-
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
2457
|
-
}, mo = ["value"], ho = { class: "tpl:mb-3.5" }, go = { class: "tpl:mb-3.5" }, _o = 350, vo = /* @__PURE__ */ f({
|
|
2458
|
-
__name: "ImageToolbar",
|
|
2459
|
-
props: { block: {} },
|
|
2460
|
-
emits: ["update"],
|
|
2461
|
-
setup(e, { emit: t }) {
|
|
2462
|
-
let r = e, i = t, { t: a } = U(), o = D(Ue, null), u = D(Re, B.liquid), f = Ft(), h = w(() => !!o), _ = d(!1), v = d(!1), { start: S } = Fe(() => {
|
|
2463
|
-
_.value = !1;
|
|
2464
|
-
}, 1e3, { immediate: !1 }), E = [
|
|
2465
|
-
300,
|
|
2466
|
-
400,
|
|
2467
|
-
500
|
|
2468
|
-
], O = w(() => {
|
|
2469
|
-
let e = r.block.width;
|
|
2470
|
-
return e === "full" ? "full" : E.includes(e) ? String(e) : "custom";
|
|
2471
|
-
});
|
|
2472
|
-
function k(e, t) {
|
|
2473
|
-
i("update", { [e]: t });
|
|
2474
|
-
}
|
|
2475
|
-
function A(e) {
|
|
2476
|
-
if (e === "custom") {
|
|
2477
|
-
let e = r.block.width;
|
|
2478
|
-
(typeof e != "number" || E.includes(e)) && k("width", _o);
|
|
2479
|
-
return;
|
|
2480
|
-
}
|
|
2481
|
-
k("width", e === "full" ? "full" : Number(e));
|
|
2482
|
-
}
|
|
2483
|
-
function j(e) {
|
|
2484
|
-
let t = Number(e);
|
|
2485
|
-
!Number.isFinite(t) || t <= 0 || k("width", t);
|
|
2486
|
-
}
|
|
2487
|
-
async function M() {
|
|
2488
|
-
let e = await o?.({ accept: ["images"] });
|
|
2489
|
-
f.alive && e && (k("src", e.url), e.alt && (k("alt", e.alt), v.value = !0), _.value = !0, S());
|
|
2490
|
-
}
|
|
2491
|
-
let N = d(), P = d(!1), ee = w(() => V(r.block.src, u)), I = w(() => h.value && !P.value && !ee.value);
|
|
2492
|
-
async function L(e) {
|
|
2493
|
-
if (o) {
|
|
2494
|
-
P.value = !0;
|
|
2495
|
-
try {
|
|
2496
|
-
let t = await o({
|
|
2497
|
-
accept: ["images"],
|
|
2498
|
-
files: e
|
|
2499
|
-
});
|
|
2500
|
-
if (!f.alive) return;
|
|
2501
|
-
t && (k("src", t.url), t.alt && (k("alt", t.alt), v.value = !0), _.value = !0, S());
|
|
2502
|
-
} finally {
|
|
2503
|
-
f.alive && (P.value = !1);
|
|
2504
|
-
}
|
|
2505
|
-
}
|
|
2506
|
-
}
|
|
2507
|
-
let { isOver: R } = pe({
|
|
2508
|
-
target: N,
|
|
2509
|
-
enabled: I,
|
|
2510
|
-
onFiles: L
|
|
2511
|
-
});
|
|
2512
|
-
return (t, r) => (s(), m(C, null, [
|
|
2513
|
-
p("div", no, [p("label", { class: n(x(K)) }, c(x(a).image.imageUrl), 3), p("div", {
|
|
2514
|
-
ref_key: "dropZoneRef",
|
|
2515
|
-
ref: N,
|
|
2516
|
-
class: "tpl:relative"
|
|
2517
|
-
}, [
|
|
2518
|
-
I.value && (x(R) || P.value) ? (s(), m("div", ro, [P.value ? (s(), m(C, { key: 0 }, [g(x(Ct), {
|
|
2519
|
-
class: "tpl-spinner",
|
|
2520
|
-
size: 18,
|
|
2521
|
-
"stroke-width": 2
|
|
2522
|
-
}), b(" " + c(x(a).image.uploading), 1)], 64)) : (s(), m(C, { key: 1 }, [g(x(F), {
|
|
2523
|
-
size: 18,
|
|
2524
|
-
"stroke-width": 1.5
|
|
2525
|
-
}), b(" " + c(x(a).image.dropToUpload), 1)], 64))])) : T("", !0),
|
|
2526
|
-
g($, {
|
|
2527
|
-
"model-value": e.block.src,
|
|
2528
|
-
type: "url",
|
|
2529
|
-
placeholder: x(a).image.imageUrlPlaceholder,
|
|
2530
|
-
pulse: _.value,
|
|
2531
|
-
"onUpdate:modelValue": r[0] ||= (e) => k("src", e)
|
|
2532
|
-
}, null, 8, [
|
|
2533
|
-
"model-value",
|
|
2534
|
-
"placeholder",
|
|
2535
|
-
"pulse"
|
|
2536
|
-
]),
|
|
2537
|
-
h.value ? (s(), m("button", {
|
|
2538
|
-
key: 1,
|
|
2539
|
-
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2540
|
-
style: {
|
|
2541
|
-
"border-color": "var(--tpl-border)",
|
|
2542
|
-
color: "var(--tpl-primary)",
|
|
2543
|
-
"background-color": "var(--tpl-bg)"
|
|
2544
|
-
},
|
|
2545
|
-
onClick: M
|
|
2546
|
-
}, [g(x(ue), {
|
|
2547
|
-
size: 14,
|
|
2548
|
-
"stroke-width": 1.5
|
|
2549
|
-
}), b(" " + c(x(a).image.browseMedia), 1)])) : T("", !0)
|
|
2550
|
-
], 512)]),
|
|
2551
|
-
x(V)(e.block.src, x(u)) ? (s(), m("div", io, [p("label", { class: n(x(K)) }, [b(c(x(a).image.placeholderUrl) + " ", 1), r[9] ||= p("span", { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, c("(optional)"), -1)], 2), p("input", {
|
|
2552
|
-
type: "url",
|
|
2553
|
-
class: n(x(G)),
|
|
2554
|
-
value: e.block.placeholderUrl || "",
|
|
2555
|
-
placeholder: x(a).image.placeholderUrlPlaceholder,
|
|
2556
|
-
onInput: r[1] ||= (e) => k("placeholderUrl", e.target.value)
|
|
2557
|
-
}, null, 42, ao)])) : T("", !0),
|
|
2558
|
-
p("div", oo, [
|
|
2559
|
-
p("label", { class: n(x(K)) }, c(x(a).image.altText), 3),
|
|
2560
|
-
g($, {
|
|
2561
|
-
"model-value": e.block.alt,
|
|
2562
|
-
type: "text",
|
|
2563
|
-
placeholder: x(a).image.altTextPlaceholder,
|
|
2564
|
-
pulse: v.value,
|
|
2565
|
-
disabled: e.block.decorative === !0,
|
|
2566
|
-
"onUpdate:modelValue": r[2] ||= (e) => k("alt", e)
|
|
2567
|
-
}, null, 8, [
|
|
2568
|
-
"model-value",
|
|
2569
|
-
"placeholder",
|
|
2570
|
-
"pulse",
|
|
2571
|
-
"disabled"
|
|
2572
|
-
]),
|
|
2573
|
-
g(X, {
|
|
2574
|
-
class: "tpl:mt-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]",
|
|
2575
|
-
"model-value": e.block.decorative === !0,
|
|
2576
|
-
label: x(a).image.decorative,
|
|
2577
|
-
"onUpdate:modelValue": r[3] ||= (e) => k("decorative", e)
|
|
2578
|
-
}, {
|
|
2579
|
-
default: l(() => [p("span", null, [b(c(x(a).image.decorative) + " ", 1), p("span", so, c(x(a).image.decorativeHint), 1)])]),
|
|
2580
|
-
_: 1
|
|
2581
|
-
}, 8, ["model-value", "label"])
|
|
2582
|
-
]),
|
|
2583
|
-
p("div", co, [
|
|
2584
|
-
p("label", { class: n(x(K)) }, c(x(a).image.width), 3),
|
|
2585
|
-
p("select", {
|
|
2586
|
-
class: n(x(G)),
|
|
2587
|
-
value: O.value,
|
|
2588
|
-
onChange: r[4] ||= (e) => A(e.target.value)
|
|
2589
|
-
}, [
|
|
2590
|
-
p("option", uo, c(x(a).image.fullWidth), 1),
|
|
2591
|
-
r[10] ||= p("option", { value: "300" }, "300px", -1),
|
|
2592
|
-
r[11] ||= p("option", { value: "400" }, "400px", -1),
|
|
2593
|
-
r[12] ||= p("option", { value: "500" }, "500px", -1),
|
|
2594
|
-
p("option", fo, c(x(a).image.widthCustom), 1)
|
|
2595
|
-
], 42, lo),
|
|
2596
|
-
O.value === "custom" ? (s(), m("div", po, [p("input", {
|
|
2597
|
-
type: "number",
|
|
2598
|
-
class: n(x(J)),
|
|
2599
|
-
value: typeof e.block.width == "number" ? e.block.width : _o,
|
|
2600
|
-
min: "20",
|
|
2601
|
-
onInput: r[5] ||= (e) => j(e.target.value)
|
|
2602
|
-
}, null, 42, mo), p("span", { class: n(x(q)) }, "px", 2)])) : T("", !0)
|
|
2603
|
-
]),
|
|
2604
|
-
p("div", ho, [p("label", { class: n(x(K)) }, c(x(a).title.align), 3), g(Q, {
|
|
2605
|
-
options: [
|
|
2606
|
-
{
|
|
2607
|
-
value: "left",
|
|
2608
|
-
label: x(a).title.alignLeft
|
|
2609
|
-
},
|
|
2610
|
-
{
|
|
2611
|
-
value: "center",
|
|
2612
|
-
label: x(a).title.alignCenter
|
|
2613
|
-
},
|
|
2614
|
-
{
|
|
2615
|
-
value: "right",
|
|
2616
|
-
label: x(a).title.alignRight
|
|
2617
|
-
}
|
|
2618
|
-
],
|
|
2619
|
-
"model-value": e.block.align,
|
|
2620
|
-
"onUpdate:modelValue": r[6] ||= (e) => k("align", e)
|
|
2621
|
-
}, null, 8, ["options", "model-value"])]),
|
|
2622
|
-
p("div", go, [
|
|
2623
|
-
p("label", { class: n(x(K)) }, c(x(a).image.linkUrl), 3),
|
|
2624
|
-
g($, {
|
|
2625
|
-
"model-value": e.block.linkUrl || "",
|
|
2626
|
-
type: "url",
|
|
2627
|
-
placeholder: x(a).image.imageUrlPlaceholder,
|
|
2628
|
-
"onUpdate:modelValue": r[7] ||= (e) => k("linkUrl", e)
|
|
2629
|
-
}, null, 8, ["model-value", "placeholder"]),
|
|
2630
|
-
e.block.linkUrl ? (s(), y(X, {
|
|
2631
|
-
key: 0,
|
|
2632
|
-
class: "tpl:mt-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]",
|
|
2633
|
-
"model-value": e.block.linkOpenInNewTab ?? !1,
|
|
2634
|
-
label: x(a).image.openInNewTab,
|
|
2635
|
-
"onUpdate:modelValue": r[8] ||= (e) => k("linkOpenInNewTab", e)
|
|
2636
|
-
}, null, 8, ["model-value", "label"])) : T("", !0)
|
|
2637
|
-
])
|
|
2638
|
-
], 64));
|
|
2639
|
-
}
|
|
2640
|
-
}), yo = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, bo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, xo = [
|
|
2641
|
-
"value",
|
|
2642
|
-
"placeholder",
|
|
2643
|
-
"onInput"
|
|
2644
|
-
], So = ["title", "onClick"], Co = { class: "tpl:flex tpl:flex-wrap tpl:items-center tpl:gap-x-3 tpl:gap-y-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, wo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, To = ["value"], Eo = { value: "" }, Do = ["value"], Oo = ["value"], ko = /* @__PURE__ */ f({
|
|
2645
|
-
__name: "MenuToolbar",
|
|
2646
|
-
props: {
|
|
2647
|
-
block: {},
|
|
2648
|
-
fontFamilies: {}
|
|
2649
|
-
},
|
|
2650
|
-
emits: ["update"],
|
|
2651
|
-
setup(t, { emit: r }) {
|
|
2652
|
-
let i = t, a = r, { t: o } = U(), u = w(() => [
|
|
2653
|
-
{
|
|
2654
|
-
key: "openInNewTab",
|
|
2655
|
-
label: o.menu.openInNewTab
|
|
2656
|
-
},
|
|
2657
|
-
{
|
|
2658
|
-
key: "bold",
|
|
2659
|
-
label: o.menu.bold
|
|
2660
|
-
},
|
|
2661
|
-
{
|
|
2662
|
-
key: "underline",
|
|
2663
|
-
label: o.menu.underline
|
|
2664
|
-
}
|
|
2665
|
-
]), d = w(() => [
|
|
2666
|
-
{
|
|
2667
|
-
value: "left",
|
|
2668
|
-
label: o.title.alignLeft,
|
|
2669
|
-
icon: kt
|
|
2670
|
-
},
|
|
2671
|
-
{
|
|
2672
|
-
value: "center",
|
|
2673
|
-
label: o.title.alignCenter,
|
|
2674
|
-
icon: Ot
|
|
2675
|
-
},
|
|
2676
|
-
{
|
|
2677
|
-
value: "right",
|
|
2678
|
-
label: o.title.alignRight,
|
|
2679
|
-
icon: Dt
|
|
2680
|
-
}
|
|
2681
|
-
]);
|
|
2682
|
-
function f(e, t) {
|
|
2683
|
-
a("update", { [e]: t });
|
|
2684
|
-
}
|
|
2685
|
-
function h() {
|
|
2686
|
-
let e = {
|
|
2687
|
-
id: z(),
|
|
2688
|
-
text: "",
|
|
2689
|
-
url: "",
|
|
2690
|
-
openInNewTab: !1,
|
|
2691
|
-
bold: !1,
|
|
2692
|
-
underline: !1
|
|
2693
|
-
};
|
|
2694
|
-
a("update", { items: [...i.block.items, e] });
|
|
2695
|
-
}
|
|
2696
|
-
function _(e, t, n) {
|
|
2697
|
-
let r = i.block.items.map((r) => r.id === e ? {
|
|
2698
|
-
...r,
|
|
2699
|
-
[t]: n
|
|
2700
|
-
} : r);
|
|
2701
|
-
a("update", { items: r });
|
|
2702
|
-
}
|
|
2703
|
-
function v(e) {
|
|
2704
|
-
a("update", { items: i.block.items.filter((t) => t.id !== e) });
|
|
2705
|
-
}
|
|
2706
|
-
return (r, i) => (s(), m(C, null, [
|
|
2707
|
-
g(Z, { label: x(o).menu.items }, {
|
|
2708
|
-
default: l(() => [p("div", yo, [(s(!0), m(C, null, e(t.block.items, (r) => (s(), m("div", {
|
|
2709
|
-
key: r.id,
|
|
2710
|
-
class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
|
|
2711
|
-
}, [
|
|
2712
|
-
p("div", bo, [p("input", {
|
|
2713
|
-
type: "text",
|
|
2714
|
-
class: n([x(G), "tpl:flex-1"]),
|
|
2715
|
-
value: r.text,
|
|
2716
|
-
placeholder: x(o).menu.text,
|
|
2717
|
-
onInput: (e) => _(r.id, "text", e.target.value)
|
|
2718
|
-
}, null, 42, xo), p("button", {
|
|
2719
|
-
class: n(x(zt)),
|
|
2720
|
-
title: x(o).menu.removeItem,
|
|
2721
|
-
onClick: (e) => v(r.id)
|
|
2722
|
-
}, [g(x(jt), {
|
|
2723
|
-
size: 14,
|
|
2724
|
-
"stroke-width": 2
|
|
2725
|
-
})], 10, So)]),
|
|
2726
|
-
g($, {
|
|
2727
|
-
"model-value": r.url,
|
|
2728
|
-
type: "url",
|
|
2729
|
-
placeholder: x(o).menu.urlPlaceholder,
|
|
2730
|
-
"onUpdate:modelValue": (e) => _(r.id, "url", e)
|
|
2731
|
-
}, null, 8, [
|
|
2732
|
-
"model-value",
|
|
2733
|
-
"placeholder",
|
|
2734
|
-
"onUpdate:modelValue"
|
|
2735
|
-
]),
|
|
2736
|
-
p("div", Co, [(s(!0), m(C, null, e(u.value, (e) => (s(), y(X, {
|
|
2737
|
-
key: e.key,
|
|
2738
|
-
"model-value": r[e.key],
|
|
2739
|
-
label: e.label,
|
|
2740
|
-
"onUpdate:modelValue": (t) => _(r.id, e.key, t)
|
|
2741
|
-
}, null, 8, [
|
|
2742
|
-
"model-value",
|
|
2743
|
-
"label",
|
|
2744
|
-
"onUpdate:modelValue"
|
|
2745
|
-
]))), 128))]),
|
|
2746
|
-
p("div", wo, [p("label", { class: n([x(K), "tpl:!mb-0"]) }, c(x(o).menu.color), 3), g(Y, {
|
|
2747
|
-
"swatch-only": "",
|
|
2748
|
-
"model-value": r.color || t.block.linkColor || t.block.color || "",
|
|
2749
|
-
"onUpdate:modelValue": (e) => _(r.id, "color", e)
|
|
2750
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])])
|
|
2751
|
-
]))), 128)), p("button", {
|
|
2752
|
-
class: n(x(Ht)),
|
|
2753
|
-
onClick: h
|
|
2754
|
-
}, [g(x(nn), {
|
|
2755
|
-
size: 14,
|
|
2756
|
-
"stroke-width": 2
|
|
2757
|
-
}), b(" " + c(x(o).menu.addItem), 1)], 2)])]),
|
|
2758
|
-
_: 1
|
|
2759
|
-
}, 8, ["label"]),
|
|
2760
|
-
g(Z, { label: x(o).menu.fontFamily }, {
|
|
2761
|
-
default: l(() => [p("select", {
|
|
2762
|
-
class: n(x(G)),
|
|
2763
|
-
value: t.block.fontFamily || "",
|
|
2764
|
-
onChange: i[0] ||= (e) => f("fontFamily", e.target.value || void 0)
|
|
2765
|
-
}, [p("option", Eo, c(x(o).title.inheritFont), 1), (s(!0), m(C, null, e(t.fontFamilies, (e) => (s(), m("option", {
|
|
2766
|
-
key: e.value,
|
|
2767
|
-
value: e.value
|
|
2768
|
-
}, c(e.label), 9, Do))), 128))], 42, To)]),
|
|
2769
|
-
_: 1
|
|
2770
|
-
}, 8, ["label"]),
|
|
2771
|
-
g(Z, { label: x(o).menu.fontSize }, {
|
|
2772
|
-
default: l(() => [g(qt, {
|
|
2773
|
-
"model-value": t.block.fontSize,
|
|
2774
|
-
min: 8,
|
|
2775
|
-
max: 48,
|
|
2776
|
-
suffix: "px",
|
|
2777
|
-
"onUpdate:modelValue": i[1] ||= (e) => f("fontSize", e)
|
|
2778
|
-
}, null, 8, ["model-value"])]),
|
|
2779
|
-
_: 1
|
|
2780
|
-
}, 8, ["label"]),
|
|
2781
|
-
g(Z, { label: x(o).menu.color }, {
|
|
2782
|
-
default: l(() => [g(Y, {
|
|
2783
|
-
"model-value": t.block.color ?? "",
|
|
2784
|
-
"onUpdate:modelValue": i[2] ||= (e) => f("color", e || void 0)
|
|
2785
|
-
}, null, 8, ["model-value"])]),
|
|
2786
|
-
_: 1
|
|
2787
|
-
}, 8, ["label"]),
|
|
2788
|
-
g(Z, { label: x(o).menu.linkColor }, {
|
|
2789
|
-
default: l(() => [g(Y, {
|
|
2790
|
-
"model-value": t.block.linkColor || t.block.color || "",
|
|
2791
|
-
"onUpdate:modelValue": i[3] ||= (e) => f("linkColor", e || void 0)
|
|
2792
|
-
}, null, 8, ["model-value"])]),
|
|
2793
|
-
_: 1
|
|
2794
|
-
}, 8, ["label"]),
|
|
2795
|
-
g(Z, { label: x(o).menu.textAlign }, {
|
|
2796
|
-
default: l(() => [g(Q, {
|
|
2797
|
-
options: d.value,
|
|
2798
|
-
"model-value": t.block.textAlign,
|
|
2799
|
-
"onUpdate:modelValue": i[4] ||= (e) => f("textAlign", e)
|
|
2800
|
-
}, null, 8, ["options", "model-value"])]),
|
|
2801
|
-
_: 1
|
|
2802
|
-
}, 8, ["label"]),
|
|
2803
|
-
g(Z, { label: x(o).menu.separator }, {
|
|
2804
|
-
default: l(() => [p("input", {
|
|
2805
|
-
type: "text",
|
|
2806
|
-
class: n(x(G)),
|
|
2807
|
-
value: t.block.separator,
|
|
2808
|
-
onInput: i[5] ||= (e) => f("separator", e.target.value)
|
|
2809
|
-
}, null, 42, Oo)]),
|
|
2810
|
-
_: 1
|
|
2811
|
-
}, 8, ["label"]),
|
|
2812
|
-
g(Z, { label: x(o).menu.separatorColor }, {
|
|
2813
|
-
default: l(() => [g(Y, {
|
|
2814
|
-
"model-value": t.block.separatorColor,
|
|
2815
|
-
"onUpdate:modelValue": i[6] ||= (e) => f("separatorColor", e)
|
|
2816
|
-
}, null, 8, ["model-value"])]),
|
|
2817
|
-
_: 1
|
|
2818
|
-
}, 8, ["label"]),
|
|
2819
|
-
g(Z, { label: x(o).menu.spacing }, {
|
|
2820
|
-
default: l(() => [g(qt, {
|
|
2821
|
-
"model-value": t.block.spacing,
|
|
2822
|
-
min: 0,
|
|
2823
|
-
max: 50,
|
|
2824
|
-
suffix: "px",
|
|
2825
|
-
"onUpdate:modelValue": i[7] ||= (e) => f("spacing", e)
|
|
2826
|
-
}, null, 8, ["model-value"])]),
|
|
2827
|
-
_: 1
|
|
2828
|
-
}, 8, ["label"])
|
|
2829
|
-
], 64));
|
|
2830
|
-
}
|
|
2831
|
-
});
|
|
2832
|
-
//#endregion
|
|
2833
|
-
//#region src/utils/rebalanceColumnChildren.ts
|
|
2834
|
-
function Ao(e) {
|
|
2835
|
-
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
2836
|
-
}
|
|
2837
|
-
function jo(e, t) {
|
|
2838
|
-
let n = Ao(t);
|
|
2839
|
-
if (e.length === n) return e;
|
|
2840
|
-
if (e.length < n) {
|
|
2841
|
-
let t = Array.from({ length: n - e.length }, () => []);
|
|
2842
|
-
return [...e, ...t];
|
|
2843
|
-
}
|
|
2844
|
-
let r = e.slice(0, n), i = e.slice(n).flat(), a = [...r[n - 1], ...i];
|
|
2845
|
-
return [...r.slice(0, n - 1), a];
|
|
2846
|
-
}
|
|
2847
|
-
//#endregion
|
|
2848
|
-
//#region src/components/toolbar/SectionToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
2849
|
-
var Mo = { class: "tpl:mb-3.5" }, No = ["value"], Po = ["value"], Fo = {
|
|
2850
|
-
key: 0,
|
|
2851
|
-
class: "tpl:mb-3.5"
|
|
2852
|
-
}, Io = { class: "tpl:mb-3.5" }, Lo = { class: "tpl:flex tpl:items-stretch" }, Ro = ["value"], zo = { class: "tpl:mb-3.5" }, Bo = {
|
|
2853
|
-
key: 0,
|
|
2854
|
-
class: "tpl:mt-3 tpl:ml-0.5 tpl:space-y-3 tpl:border-l tpl:border-[var(--tpl-border)] tpl:pl-3"
|
|
2855
|
-
}, Vo = { class: "tpl:flex tpl:items-stretch" }, Ho = ["value"], Uo = /* @__PURE__ */ f({
|
|
2856
|
-
__name: "SectionToolbar",
|
|
2857
|
-
props: { block: {} },
|
|
2858
|
-
emits: ["update"],
|
|
2859
|
-
setup(t, { emit: r }) {
|
|
2860
|
-
let i = t, a = r, { t: o } = U(), l = w(() => [
|
|
2861
|
-
{
|
|
2862
|
-
value: "1",
|
|
2863
|
-
label: o.section.column1
|
|
2864
|
-
},
|
|
2865
|
-
{
|
|
2866
|
-
value: "2",
|
|
2867
|
-
label: o.section.column2
|
|
2868
|
-
},
|
|
2869
|
-
{
|
|
2870
|
-
value: "3",
|
|
2871
|
-
label: o.section.column3
|
|
2872
|
-
},
|
|
2873
|
-
{
|
|
2874
|
-
value: "1-2",
|
|
2875
|
-
label: o.section.ratio12
|
|
2876
|
-
},
|
|
2877
|
-
{
|
|
2878
|
-
value: "2-1",
|
|
2879
|
-
label: o.section.ratio21
|
|
2880
|
-
}
|
|
2881
|
-
]);
|
|
2882
|
-
function u(e) {
|
|
2883
|
-
let t = e.target.value, n = jo(i.block.children, t);
|
|
2884
|
-
a("update", {
|
|
2885
|
-
columns: t,
|
|
2886
|
-
children: n
|
|
2887
|
-
});
|
|
2888
|
-
}
|
|
2889
|
-
function d(e) {
|
|
2890
|
-
a("update", { stackOnMobile: e });
|
|
2891
|
-
}
|
|
2892
|
-
function f(e) {
|
|
2893
|
-
let t = Number(e.target.value);
|
|
2894
|
-
a("update", { borderRadius: t });
|
|
2895
|
-
}
|
|
2896
|
-
function h(e) {
|
|
2897
|
-
a("update", { wrapper: e ? { padding: {
|
|
2898
|
-
top: 20,
|
|
2899
|
-
right: 20,
|
|
2900
|
-
bottom: 20,
|
|
2901
|
-
left: 20
|
|
2902
|
-
} } : void 0 });
|
|
2903
|
-
}
|
|
2904
|
-
function _(e) {
|
|
2905
|
-
a("update", { wrapper: {
|
|
2906
|
-
...i.block.wrapper,
|
|
2907
|
-
...e
|
|
2908
|
-
} });
|
|
2909
|
-
}
|
|
2910
|
-
function v(e) {
|
|
2911
|
-
_({ padding: e });
|
|
2912
|
-
}
|
|
2913
|
-
function y(e) {
|
|
2914
|
-
_({ borderRadius: Number(e.target.value) });
|
|
2915
|
-
}
|
|
2916
|
-
return (r, i) => (s(), m(C, null, [
|
|
2917
|
-
p("div", Mo, [p("label", { class: n(x(K)) }, c(x(o).section.columns), 3), p("select", {
|
|
2918
|
-
class: n(x(G)),
|
|
2919
|
-
value: t.block.columns,
|
|
2920
|
-
onChange: u
|
|
2921
|
-
}, [(s(!0), m(C, null, e(l.value, (e) => (s(), m("option", {
|
|
2922
|
-
key: e.value,
|
|
2923
|
-
value: e.value
|
|
2924
|
-
}, c(e.label), 9, Po))), 128))], 42, No)]),
|
|
2925
|
-
t.block.columns === "1" ? T("", !0) : (s(), m("div", Fo, [g(X, {
|
|
2926
|
-
class: "tpl:text-xs tpl:text-[var(--tpl-text)]",
|
|
2927
|
-
"model-value": t.block.stackOnMobile !== !1,
|
|
2928
|
-
label: x(o).section.stackOnMobile,
|
|
2929
|
-
"onUpdate:modelValue": i[0] ||= (e) => d(e)
|
|
2930
|
-
}, null, 8, ["model-value", "label"])])),
|
|
2931
|
-
p("div", Io, [p("label", { class: n(x(K)) }, c(x(o).section.borderRadius), 3), p("div", Lo, [p("input", {
|
|
2932
|
-
type: "number",
|
|
2933
|
-
class: n(x(J)),
|
|
2934
|
-
value: t.block.borderRadius ?? 0,
|
|
2935
|
-
min: "0",
|
|
2936
|
-
max: "50",
|
|
2937
|
-
onInput: f
|
|
2938
|
-
}, null, 42, Ro), p("span", { class: n(x(q)) }, "px", 2)])]),
|
|
2939
|
-
p("div", zo, [g(X, {
|
|
2940
|
-
class: "tpl:text-xs tpl:text-[var(--tpl-text)]",
|
|
2941
|
-
"model-value": !!t.block.wrapper,
|
|
2942
|
-
label: x(o).section.wrapperEnable,
|
|
2943
|
-
"onUpdate:modelValue": i[1] ||= (e) => h(e)
|
|
2944
|
-
}, null, 8, ["model-value", "label"]), t.block.wrapper ? (s(), m("div", Bo, [
|
|
2945
|
-
p("div", null, [p("label", { class: n(x(K)) }, c(x(o).blockSettings.color), 3), g(Y, {
|
|
2946
|
-
"model-value": t.block.wrapper.backgroundColor ?? "",
|
|
2947
|
-
"onUpdate:modelValue": i[2] ||= (e) => _({ backgroundColor: e })
|
|
2948
|
-
}, null, 8, ["model-value"])]),
|
|
2949
|
-
g(Vi, {
|
|
2950
|
-
label: x(o).blockSettings.padding,
|
|
2951
|
-
"model-value": t.block.wrapper.padding ?? {
|
|
2952
|
-
top: 0,
|
|
2953
|
-
right: 0,
|
|
2954
|
-
bottom: 0,
|
|
2955
|
-
left: 0
|
|
2956
|
-
},
|
|
2957
|
-
"onUpdate:modelValue": v
|
|
2958
|
-
}, null, 8, ["label", "model-value"]),
|
|
2959
|
-
p("div", null, [p("label", { class: n(x(K)) }, c(x(o).section.borderRadius), 3), p("div", Vo, [p("input", {
|
|
2960
|
-
type: "number",
|
|
2961
|
-
class: n(x(J)),
|
|
2962
|
-
value: t.block.wrapper.borderRadius ?? 0,
|
|
2963
|
-
min: "0",
|
|
2964
|
-
max: "50",
|
|
2965
|
-
onInput: y
|
|
2966
|
-
}, null, 42, Ho), p("span", { class: n(x(q)) }, "px", 2)])])
|
|
2967
|
-
])) : T("", !0)])
|
|
2968
|
-
], 64));
|
|
2969
|
-
}
|
|
2970
|
-
}), Wo = { class: "tpl:mb-3.5" }, Go = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Ko = { class: "tpl:flex tpl:items-center tpl:gap-2" }, qo = ["value", "onChange"], Jo = ["value"], Yo = ["title", "onClick"], Xo = { class: "tpl:mb-3.5" }, Zo = ["value"], Qo = { value: "solid" }, $o = { value: "outlined" }, es = { value: "rounded" }, ts = { value: "square" }, ns = { value: "circle" }, rs = { class: "tpl:mb-3.5" }, is = { class: "tpl:mb-3.5" }, as = { class: "tpl:flex tpl:items-stretch" }, os = ["value"], ss = { class: "tpl:mb-3.5" }, cs = /* @__PURE__ */ f({
|
|
2971
|
-
__name: "SocialToolbar",
|
|
2972
|
-
props: { block: {} },
|
|
2973
|
-
emits: ["update"],
|
|
2974
|
-
setup(t, { emit: r }) {
|
|
2975
|
-
let i = t, a = r, { t: o } = U();
|
|
2976
|
-
function l(e, t) {
|
|
2977
|
-
a("update", { [e]: t });
|
|
2978
|
-
}
|
|
2979
|
-
function u() {
|
|
2980
|
-
let e = {
|
|
2981
|
-
id: z(),
|
|
2982
|
-
platform: "facebook",
|
|
2983
|
-
url: ""
|
|
2984
|
-
};
|
|
2985
|
-
a("update", { icons: [...i.block.icons, e] });
|
|
2986
|
-
}
|
|
2987
|
-
function d(e, t, n) {
|
|
2988
|
-
let r = i.block.icons.map((r) => r.id === e ? {
|
|
2989
|
-
...r,
|
|
2990
|
-
[t]: n
|
|
2991
|
-
} : r);
|
|
2992
|
-
a("update", { icons: r });
|
|
2993
|
-
}
|
|
2994
|
-
function f(e) {
|
|
2995
|
-
a("update", { icons: i.block.icons.filter((t) => t.id !== e) });
|
|
2996
|
-
}
|
|
2997
|
-
return (r, i) => (s(), m(C, null, [
|
|
2998
|
-
p("div", Wo, [p("label", { class: n(x(K)) }, c(x(o).social.icons), 3), p("div", Go, [(s(!0), m(C, null, e(t.block.icons, (t) => (s(), m("div", {
|
|
2999
|
-
key: t.id,
|
|
3000
|
-
class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
|
|
3001
|
-
}, [p("div", Ko, [p("select", {
|
|
3002
|
-
"data-testid": "social-platform-select",
|
|
3003
|
-
class: n([x(G), "tpl:flex-1"]),
|
|
3004
|
-
value: t.platform,
|
|
3005
|
-
onChange: (e) => d(t.id, "platform", e.target.value)
|
|
3006
|
-
}, [(s(!0), m(C, null, e(x(Te), (e) => (s(), m("option", {
|
|
3007
|
-
key: e,
|
|
3008
|
-
value: e
|
|
3009
|
-
}, c(x(o).social.platforms[e]), 9, Jo))), 128))], 42, qo), p("button", {
|
|
3010
|
-
class: n(x(zt)),
|
|
3011
|
-
title: x(o).social.removeIcon,
|
|
3012
|
-
onClick: (e) => f(t.id)
|
|
3013
|
-
}, [g(x(jt), {
|
|
3014
|
-
size: 14,
|
|
3015
|
-
"stroke-width": 2
|
|
3016
|
-
})], 10, Yo)]), g($, {
|
|
3017
|
-
"model-value": t.url,
|
|
3018
|
-
type: "url",
|
|
3019
|
-
placeholder: x(o).social.urlPlaceholder,
|
|
3020
|
-
"onUpdate:modelValue": (e) => d(t.id, "url", e)
|
|
3021
|
-
}, null, 8, [
|
|
3022
|
-
"model-value",
|
|
3023
|
-
"placeholder",
|
|
3024
|
-
"onUpdate:modelValue"
|
|
3025
|
-
])]))), 128)), p("button", {
|
|
3026
|
-
class: n(x(Ht)),
|
|
3027
|
-
onClick: u
|
|
3028
|
-
}, [g(x(nn), {
|
|
3029
|
-
size: 14,
|
|
3030
|
-
"stroke-width": 2
|
|
3031
|
-
}), b(" " + c(x(o).social.addIcon), 1)], 2)])]),
|
|
3032
|
-
p("div", Xo, [p("label", { class: n(x(K)) }, c(x(o).social.style), 3), p("select", {
|
|
3033
|
-
class: n(x(G)),
|
|
3034
|
-
value: t.block.iconStyle,
|
|
3035
|
-
onChange: i[0] ||= (e) => l("iconStyle", e.target.value)
|
|
3036
|
-
}, [
|
|
3037
|
-
p("option", Qo, c(x(o).social.styleSolid), 1),
|
|
3038
|
-
p("option", $o, c(x(o).social.styleOutlined), 1),
|
|
3039
|
-
p("option", es, c(x(o).social.styleRounded), 1),
|
|
3040
|
-
p("option", ts, c(x(o).social.styleSquare), 1),
|
|
3041
|
-
p("option", ns, c(x(o).social.styleCircle), 1)
|
|
3042
|
-
], 42, Zo)]),
|
|
3043
|
-
p("div", rs, [p("label", { class: n(x(K)) }, c(x(o).social.size), 3), g(Q, {
|
|
3044
|
-
options: [
|
|
3045
|
-
{
|
|
3046
|
-
value: "small",
|
|
3047
|
-
label: x(o).social.sizeSmall
|
|
3048
|
-
},
|
|
3049
|
-
{
|
|
3050
|
-
value: "medium",
|
|
3051
|
-
label: x(o).social.sizeMedium
|
|
3052
|
-
},
|
|
3053
|
-
{
|
|
3054
|
-
value: "large",
|
|
3055
|
-
label: x(o).social.sizeLarge
|
|
3056
|
-
}
|
|
3057
|
-
],
|
|
3058
|
-
"model-value": t.block.iconSize,
|
|
3059
|
-
"onUpdate:modelValue": i[1] ||= (e) => l("iconSize", e)
|
|
3060
|
-
}, null, 8, ["options", "model-value"])]),
|
|
3061
|
-
p("div", is, [p("label", { class: n(x(K)) }, c(x(o).social.spacing), 3), p("div", as, [p("input", {
|
|
3062
|
-
type: "number",
|
|
3063
|
-
class: n(x(J)),
|
|
3064
|
-
value: t.block.spacing,
|
|
3065
|
-
min: "0",
|
|
3066
|
-
max: "50",
|
|
3067
|
-
onInput: i[2] ||= (e) => l("spacing", Number(e.target.value))
|
|
3068
|
-
}, null, 42, os), p("span", { class: n(x(q)) }, "px", 2)])]),
|
|
3069
|
-
p("div", ss, [p("label", { class: n(x(K)) }, c(x(o).social.align), 3), g(Q, {
|
|
3070
|
-
options: [
|
|
3071
|
-
{
|
|
3072
|
-
value: "left",
|
|
3073
|
-
label: x(o).title.alignLeft,
|
|
3074
|
-
icon: x(kt)
|
|
3075
|
-
},
|
|
3076
|
-
{
|
|
3077
|
-
value: "center",
|
|
3078
|
-
label: x(o).title.alignCenter,
|
|
3079
|
-
icon: x(Ot)
|
|
3080
|
-
},
|
|
3081
|
-
{
|
|
3082
|
-
value: "right",
|
|
3083
|
-
label: x(o).title.alignRight,
|
|
3084
|
-
icon: x(Dt)
|
|
3085
|
-
}
|
|
3086
|
-
],
|
|
3087
|
-
"model-value": t.block.align,
|
|
3088
|
-
"onUpdate:modelValue": i[3] ||= (e) => l("align", e)
|
|
3089
|
-
}, null, 8, ["options", "model-value"])])
|
|
3090
|
-
], 64));
|
|
3091
|
-
}
|
|
3092
|
-
}), ls = { class: "tpl:mb-3.5" }, us = { class: "tpl:flex tpl:items-stretch" }, ds = ["value"], fs = ["value"], ps = /* @__PURE__ */ f({
|
|
3093
|
-
__name: "SpacerToolbar",
|
|
3094
|
-
props: { block: {} },
|
|
3095
|
-
emits: ["update"],
|
|
3096
|
-
setup(e, { emit: t }) {
|
|
3097
|
-
let r = t, { t: i } = U();
|
|
3098
|
-
return (t, a) => (s(), m("div", ls, [
|
|
3099
|
-
p("label", { class: n(x(K)) }, c(x(i).spacer.height), 3),
|
|
3100
|
-
p("div", us, [p("input", {
|
|
3101
|
-
type: "number",
|
|
3102
|
-
class: n(x(J)),
|
|
3103
|
-
value: e.block.height,
|
|
3104
|
-
min: "10",
|
|
3105
|
-
max: "100",
|
|
3106
|
-
onInput: a[0] ||= (e) => r("update", { height: Number(e.target.value) })
|
|
3107
|
-
}, null, 42, ds), p("span", { class: n(x(q)) }, "px", 2)]),
|
|
3108
|
-
p("input", {
|
|
3109
|
-
type: "range",
|
|
3110
|
-
class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
|
|
3111
|
-
value: e.block.height,
|
|
3112
|
-
min: "10",
|
|
3113
|
-
max: "100",
|
|
3114
|
-
onInput: a[1] ||= (e) => r("update", { height: Number(e.target.value) })
|
|
3115
|
-
}, null, 40, fs)
|
|
3116
|
-
]));
|
|
3117
|
-
}
|
|
3118
|
-
}), ms = { class: "tpl:mb-3.5" }, hs = { class: "tpl:flex tpl:items-center tpl:gap-3" }, gs = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, _s = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, vs = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, ys = ["disabled"], bs = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, xs = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Ss = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Cs = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, ws = ["disabled"], Ts = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Es = { class: "tpl:mb-3.5" }, Ds = {
|
|
3119
|
-
key: 0,
|
|
3120
|
-
class: "tpl:mb-3.5"
|
|
3121
|
-
}, Os = { class: "tpl:mb-3.5" }, ks = { class: "tpl:mb-3.5" }, As = { class: "tpl:flex tpl:items-stretch" }, js = ["value"], Ms = { class: "tpl:mb-3.5" }, Ns = { class: "tpl:flex tpl:items-stretch" }, Ps = ["value"], Fs = { class: "tpl:mb-3.5" }, Is = ["value"], Ls = { value: "" }, Rs = ["value"], zs = { class: "tpl:mb-3.5" }, Bs = { class: "tpl:flex tpl:items-stretch" }, Vs = ["value"], Hs = { class: "tpl:mb-3.5" }, Us = { class: "tpl:mb-3.5" }, Ws = /* @__PURE__ */ f({
|
|
3122
|
-
__name: "TableToolbar",
|
|
3123
|
-
props: {
|
|
3124
|
-
block: {},
|
|
3125
|
-
fontFamilies: {}
|
|
3126
|
-
},
|
|
3127
|
-
emits: ["update"],
|
|
3128
|
-
setup(t, { emit: r }) {
|
|
3129
|
-
let i = t, a = r, { t: o } = U(), l = w(() => i.block.rows.length > 0 ? i.block.rows[0].cells.length : 0);
|
|
3130
|
-
function u(e, t) {
|
|
3131
|
-
a("update", { [e]: t });
|
|
3132
|
-
}
|
|
3133
|
-
function d() {
|
|
3134
|
-
let e = i.block.rows.length > 0 ? i.block.rows[0].cells.length : 3, t = {
|
|
3135
|
-
id: z(),
|
|
3136
|
-
cells: Array.from({ length: e }, () => ({
|
|
3137
|
-
id: z(),
|
|
3138
|
-
content: ""
|
|
3139
|
-
}))
|
|
3140
|
-
};
|
|
3141
|
-
a("update", { rows: [...i.block.rows, t] });
|
|
3142
|
-
}
|
|
3143
|
-
function f(e) {
|
|
3144
|
-
a("update", { rows: i.block.rows.filter((t) => t.id !== e) });
|
|
3145
|
-
}
|
|
3146
|
-
function h() {
|
|
3147
|
-
let e = i.block.rows.map((e) => ({
|
|
3148
|
-
...e,
|
|
3149
|
-
cells: [...e.cells, {
|
|
3150
|
-
id: z(),
|
|
3151
|
-
content: ""
|
|
3152
|
-
}]
|
|
3153
|
-
}));
|
|
3154
|
-
a("update", { rows: e });
|
|
3155
|
-
}
|
|
3156
|
-
function _(e) {
|
|
3157
|
-
let t = i.block.rows.map((t) => ({
|
|
3158
|
-
...t,
|
|
3159
|
-
cells: t.cells.filter((t, n) => n !== e)
|
|
3160
|
-
}));
|
|
3161
|
-
a("update", { rows: t });
|
|
3162
|
-
}
|
|
3163
|
-
return (r, i) => (s(), m(C, null, [
|
|
3164
|
-
p("div", ms, [p("label", { class: n(x(K)) }, c(x(o).table.dimensions), 3), p("div", hs, [p("div", gs, [p("span", _s, c(x(o).table.rows), 1), p("div", vs, [
|
|
3165
|
-
p("button", {
|
|
3166
|
-
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
|
|
3167
|
-
disabled: t.block.rows.length <= 1,
|
|
3168
|
-
onClick: i[0] ||= (e) => f(t.block.rows[t.block.rows.length - 1].id)
|
|
3169
|
-
}, [g(x(mt), {
|
|
3170
|
-
size: 12,
|
|
3171
|
-
"stroke-width": 2
|
|
3172
|
-
})], 8, ys),
|
|
3173
|
-
p("span", bs, c(t.block.rows.length), 1),
|
|
3174
|
-
p("button", {
|
|
3175
|
-
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
|
|
3176
|
-
onClick: d
|
|
3177
|
-
}, [g(x(nn), {
|
|
3178
|
-
size: 12,
|
|
3179
|
-
"stroke-width": 2
|
|
3180
|
-
})])
|
|
3181
|
-
])]), p("div", xs, [p("span", Ss, c(x(o).table.columns), 1), p("div", Cs, [
|
|
3182
|
-
p("button", {
|
|
3183
|
-
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
|
|
3184
|
-
disabled: l.value <= 1,
|
|
3185
|
-
onClick: i[1] ||= (e) => _(l.value - 1)
|
|
3186
|
-
}, [g(x(mt), {
|
|
3187
|
-
size: 12,
|
|
3188
|
-
"stroke-width": 2
|
|
3189
|
-
})], 8, ws),
|
|
3190
|
-
p("span", Ts, c(l.value), 1),
|
|
3191
|
-
p("button", {
|
|
3192
|
-
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
|
|
3193
|
-
onClick: h
|
|
3194
|
-
}, [g(x(nn), {
|
|
3195
|
-
size: 12,
|
|
3196
|
-
"stroke-width": 2
|
|
3197
|
-
})])
|
|
3198
|
-
])])])]),
|
|
3199
|
-
p("div", Es, [g(X, {
|
|
3200
|
-
class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
3201
|
-
"model-value": t.block.hasHeaderRow,
|
|
3202
|
-
label: x(o).table.hasHeaderRow,
|
|
3203
|
-
"onUpdate:modelValue": i[2] ||= (e) => u("hasHeaderRow", e)
|
|
3204
|
-
}, null, 8, ["model-value", "label"])]),
|
|
3205
|
-
t.block.hasHeaderRow ? (s(), m("div", Ds, [p("label", { class: n(x(K)) }, c(x(o).table.headerBackgroundColor), 3), g(Y, {
|
|
3206
|
-
"model-value": t.block.headerBackgroundColor ?? "",
|
|
3207
|
-
"seed-color": x(Vt),
|
|
3208
|
-
placeholder: x(o).table.noHeaderBg,
|
|
3209
|
-
"onUpdate:modelValue": i[3] ||= (e) => u("headerBackgroundColor", e || null)
|
|
3210
|
-
}, null, 8, [
|
|
3211
|
-
"model-value",
|
|
3212
|
-
"seed-color",
|
|
3213
|
-
"placeholder"
|
|
3214
|
-
])])) : T("", !0),
|
|
3215
|
-
p("div", Os, [p("label", { class: n(x(K)) }, c(x(o).table.borderColor), 3), g(Y, {
|
|
3216
|
-
"model-value": t.block.borderColor,
|
|
3217
|
-
"onUpdate:modelValue": i[4] ||= (e) => u("borderColor", e)
|
|
3218
|
-
}, null, 8, ["model-value"])]),
|
|
3219
|
-
p("div", ks, [p("label", { class: n(x(K)) }, c(x(o).table.borderWidth), 3), p("div", As, [p("input", {
|
|
3220
|
-
type: "number",
|
|
3221
|
-
class: n(x(J)),
|
|
3222
|
-
value: t.block.borderWidth,
|
|
3223
|
-
min: "0",
|
|
3224
|
-
max: "10",
|
|
3225
|
-
onInput: i[5] ||= (e) => u("borderWidth", Number(e.target.value))
|
|
3226
|
-
}, null, 42, js), p("span", { class: n(x(q)) }, "px", 2)])]),
|
|
3227
|
-
p("div", Ms, [p("label", { class: n(x(K)) }, c(x(o).table.cellPadding), 3), p("div", Ns, [p("input", {
|
|
3228
|
-
type: "number",
|
|
3229
|
-
class: n(x(J)),
|
|
3230
|
-
value: t.block.cellPadding,
|
|
3231
|
-
min: "0",
|
|
3232
|
-
max: "30",
|
|
3233
|
-
onInput: i[6] ||= (e) => u("cellPadding", Number(e.target.value))
|
|
3234
|
-
}, null, 42, Ps), p("span", { class: n(x(q)) }, "px", 2)])]),
|
|
3235
|
-
p("div", Fs, [p("label", { class: n(x(K)) }, c(x(o).table.fontFamily), 3), p("select", {
|
|
3236
|
-
class: n(x(G)),
|
|
3237
|
-
value: t.block.fontFamily || "",
|
|
3238
|
-
onChange: i[7] ||= (e) => u("fontFamily", e.target.value || void 0)
|
|
3239
|
-
}, [p("option", Ls, c(x(o).title.inheritFont), 1), (s(!0), m(C, null, e(t.fontFamilies, (e) => (s(), m("option", {
|
|
3240
|
-
key: e.value,
|
|
3241
|
-
value: e.value
|
|
3242
|
-
}, c(e.label), 9, Rs))), 128))], 42, Is)]),
|
|
3243
|
-
p("div", zs, [p("label", { class: n(x(K)) }, c(x(o).table.fontSize), 3), p("div", Bs, [p("input", {
|
|
3244
|
-
type: "number",
|
|
3245
|
-
class: n(x(J)),
|
|
3246
|
-
value: t.block.fontSize,
|
|
3247
|
-
min: "10",
|
|
3248
|
-
max: "32",
|
|
3249
|
-
onInput: i[8] ||= (e) => u("fontSize", Number(e.target.value))
|
|
3250
|
-
}, null, 42, Vs), p("span", { class: n(x(q)) }, "px", 2)])]),
|
|
3251
|
-
p("div", Hs, [p("label", { class: n(x(K)) }, c(x(o).table.color), 3), g(Y, {
|
|
3252
|
-
"model-value": t.block.color ?? "",
|
|
3253
|
-
"onUpdate:modelValue": i[9] ||= (e) => u("color", e || void 0)
|
|
3254
|
-
}, null, 8, ["model-value"])]),
|
|
3255
|
-
p("div", Us, [p("label", { class: n(x(K)) }, c(x(o).table.textAlign), 3), g(Q, {
|
|
3256
|
-
options: [
|
|
3257
|
-
{
|
|
3258
|
-
value: "left",
|
|
3259
|
-
label: x(o).title.alignLeft,
|
|
3260
|
-
icon: x(kt)
|
|
3261
|
-
},
|
|
3262
|
-
{
|
|
3263
|
-
value: "center",
|
|
3264
|
-
label: x(o).title.alignCenter,
|
|
3265
|
-
icon: x(Ot)
|
|
3266
|
-
},
|
|
3267
|
-
{
|
|
3268
|
-
value: "right",
|
|
3269
|
-
label: x(o).title.alignRight,
|
|
3270
|
-
icon: x(Dt)
|
|
3271
|
-
}
|
|
3272
|
-
],
|
|
3273
|
-
"model-value": t.block.textAlign,
|
|
3274
|
-
"onUpdate:modelValue": i[10] ||= (e) => u("textAlign", e)
|
|
3275
|
-
}, null, 8, ["options", "model-value"])])
|
|
3276
|
-
], 64));
|
|
3277
|
-
}
|
|
3278
|
-
}), Gs = { class: "tpl:mb-3.5" }, Ks = ["value"], qs = { value: 1 }, Js = { value: 2 }, Ys = { value: 3 }, Xs = { value: 4 }, Zs = { class: "tpl:mb-3.5" }, Qs = ["value"], $s = { value: "" }, ec = ["value"], tc = { class: "tpl:mb-3.5" }, nc = { class: "tpl:mb-3.5" }, rc = /* @__PURE__ */ f({
|
|
3279
|
-
__name: "TitleToolbar",
|
|
3280
|
-
props: {
|
|
3281
|
-
block: {},
|
|
3282
|
-
fontFamilies: {}
|
|
3283
|
-
},
|
|
3284
|
-
emits: ["update"],
|
|
3285
|
-
setup(t, { emit: r }) {
|
|
3286
|
-
let i = r, { t: a } = U();
|
|
3287
|
-
function o(e, t) {
|
|
3288
|
-
i("update", { [e]: t });
|
|
3289
|
-
}
|
|
3290
|
-
return (r, i) => (s(), m(C, null, [
|
|
3291
|
-
p("div", Gs, [p("label", { class: n(x(K)) }, c(x(a).title.level), 3), p("select", {
|
|
3292
|
-
class: n(x(G)),
|
|
3293
|
-
value: t.block.level,
|
|
3294
|
-
onChange: i[0] ||= (e) => o("level", Number(e.target.value))
|
|
3295
|
-
}, [
|
|
3296
|
-
p("option", qs, c(x(a).title.heading1), 1),
|
|
3297
|
-
p("option", Js, c(x(a).title.heading2), 1),
|
|
3298
|
-
p("option", Ys, c(x(a).title.heading3), 1),
|
|
3299
|
-
p("option", Xs, c(x(a).title.heading4), 1)
|
|
3300
|
-
], 42, Ks)]),
|
|
3301
|
-
p("div", Zs, [p("label", { class: n(x(K)) }, c(x(a).title.fontFamily), 3), p("select", {
|
|
3302
|
-
class: n(x(G)),
|
|
3303
|
-
value: t.block.fontFamily || "",
|
|
3304
|
-
onChange: i[1] ||= (e) => o("fontFamily", e.target.value || void 0)
|
|
3305
|
-
}, [p("option", $s, c(x(a).title.inheritFont), 1), (s(!0), m(C, null, e(t.fontFamilies, (e) => (s(), m("option", {
|
|
3306
|
-
key: e.value,
|
|
3307
|
-
value: e.value
|
|
3308
|
-
}, c(e.label), 9, ec))), 128))], 42, Qs)]),
|
|
3309
|
-
p("div", tc, [p("label", { class: n(x(K)) }, c(x(a).title.color), 3), g(Y, {
|
|
3310
|
-
"model-value": t.block.color ?? "",
|
|
3311
|
-
"onUpdate:modelValue": i[2] ||= (e) => o("color", e || void 0)
|
|
3312
|
-
}, null, 8, ["model-value"])]),
|
|
3313
|
-
p("div", nc, [p("label", { class: n(x(K)) }, c(x(a).title.align), 3), g(Q, {
|
|
3314
|
-
options: [
|
|
3315
|
-
{
|
|
3316
|
-
value: "left",
|
|
3317
|
-
label: x(a).title.alignLeft,
|
|
3318
|
-
icon: x(kt)
|
|
3319
|
-
},
|
|
3320
|
-
{
|
|
3321
|
-
value: "center",
|
|
3322
|
-
label: x(a).title.alignCenter,
|
|
3323
|
-
icon: x(Ot)
|
|
3324
|
-
},
|
|
3325
|
-
{
|
|
3326
|
-
value: "right",
|
|
3327
|
-
label: x(a).title.alignRight,
|
|
3328
|
-
icon: x(Dt)
|
|
3329
|
-
}
|
|
3330
|
-
],
|
|
3331
|
-
"model-value": t.block.textAlign,
|
|
3332
|
-
"onUpdate:modelValue": i[3] ||= (e) => o("textAlign", e)
|
|
3333
|
-
}, null, 8, ["options", "model-value"])])
|
|
3334
|
-
], 64));
|
|
3335
|
-
}
|
|
3336
|
-
}), ic = { class: "tpl:mb-3.5" }, ac = {
|
|
3337
|
-
key: 0,
|
|
3338
|
-
class: "tpl:mb-3.5"
|
|
3339
|
-
}, oc = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, sc = [
|
|
3340
|
-
"value",
|
|
3341
|
-
"placeholder",
|
|
3342
|
-
"title"
|
|
3343
|
-
], cc = { class: "tpl:mb-3.5" }, lc = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, uc = { class: "tpl:mb-3.5" }, dc = { class: "tpl:mb-3.5" }, fc = ["value"], pc = { value: "full" }, mc = { class: "tpl:mb-3.5" }, hc = /* @__PURE__ */ f({
|
|
3344
|
-
__name: "VideoToolbar",
|
|
3345
|
-
props: { block: {} },
|
|
3346
|
-
emits: ["update"],
|
|
3347
|
-
setup(e, { emit: t }) {
|
|
3348
|
-
let r = e, i = t, { t: a } = U(), o = D(Ue, null), l = D(Re, B.liquid), u = Ft(), f = w(() => !!o), h = w(() => V(r.block.url, l)), _ = d(!1), { start: v } = Fe(() => {
|
|
3349
|
-
_.value = !1;
|
|
3350
|
-
}, 1e3, { immediate: !1 });
|
|
3351
|
-
function S(e, t) {
|
|
3352
|
-
i("update", { [e]: t });
|
|
3353
|
-
}
|
|
3354
|
-
async function E() {
|
|
3355
|
-
let e = await o?.({ accept: ["images"] });
|
|
3356
|
-
u.alive && e && (S("thumbnailUrl", e.url), _.value = !0, v());
|
|
3357
|
-
}
|
|
3358
|
-
return (t, r) => (s(), m(C, null, [
|
|
3359
|
-
p("div", ic, [
|
|
3360
|
-
p("label", { class: n(x(K)) }, c(x(a).video.videoUrl), 3),
|
|
3361
|
-
g($, {
|
|
3362
|
-
"model-value": e.block.url,
|
|
3363
|
-
type: "url",
|
|
3364
|
-
placeholder: x(a).video.videoUrlPlaceholder,
|
|
3365
|
-
"onUpdate:modelValue": r[0] ||= (e) => S("url", e)
|
|
3366
|
-
}, null, 8, ["model-value", "placeholder"]),
|
|
3367
|
-
e.block.url ? (s(), y(X, {
|
|
3368
|
-
key: 0,
|
|
3369
|
-
class: "tpl:mt-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]",
|
|
3370
|
-
"model-value": e.block.openInNewTab ?? !1,
|
|
3371
|
-
label: x(a).video.openInNewTab,
|
|
3372
|
-
"onUpdate:modelValue": r[1] ||= (e) => S("openInNewTab", e)
|
|
3373
|
-
}, null, 8, ["model-value", "label"])) : T("", !0)
|
|
3374
|
-
]),
|
|
3375
|
-
h.value ? (s(), m("div", ac, [p("label", { class: n(x(K)) }, [b(c(x(a).video.placeholderUrl) + " ", 1), p("span", oc, c(x(a).video.optional), 1)], 2), p("input", {
|
|
3376
|
-
type: "url",
|
|
3377
|
-
class: n(x(G)),
|
|
3378
|
-
value: e.block.placeholderUrl || "",
|
|
3379
|
-
placeholder: x(a).video.placeholderUrlPlaceholder,
|
|
3380
|
-
title: x(a).video.placeholderUrlTooltip,
|
|
3381
|
-
onInput: r[2] ||= (e) => S("placeholderUrl", e.target.value)
|
|
3382
|
-
}, null, 42, sc)])) : T("", !0),
|
|
3383
|
-
p("div", cc, [
|
|
3384
|
-
p("label", { class: n(x(K)) }, [b(c(x(a).video.customThumbnail) + " ", 1), p("span", lc, c(x(a).video.optional), 1)], 2),
|
|
3385
|
-
g($, {
|
|
3386
|
-
"model-value": e.block.thumbnailUrl,
|
|
3387
|
-
type: "url",
|
|
3388
|
-
placeholder: x(a).video.thumbnailPlaceholder,
|
|
3389
|
-
pulse: _.value,
|
|
3390
|
-
"onUpdate:modelValue": r[3] ||= (e) => S("thumbnailUrl", e)
|
|
3391
|
-
}, null, 8, [
|
|
3392
|
-
"model-value",
|
|
3393
|
-
"placeholder",
|
|
3394
|
-
"pulse"
|
|
3395
|
-
]),
|
|
3396
|
-
f.value ? (s(), m("button", {
|
|
3397
|
-
key: 0,
|
|
3398
|
-
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
3399
|
-
style: {
|
|
3400
|
-
"border-color": "var(--tpl-border)",
|
|
3401
|
-
color: "var(--tpl-primary)",
|
|
3402
|
-
"background-color": "var(--tpl-bg)"
|
|
3403
|
-
},
|
|
3404
|
-
onClick: E
|
|
3405
|
-
}, [g(x(ue), {
|
|
3406
|
-
size: 14,
|
|
3407
|
-
"stroke-width": 1.5
|
|
3408
|
-
}), b(" " + c(x(a).image.browseMedia), 1)])) : T("", !0)
|
|
3409
|
-
]),
|
|
3410
|
-
p("div", uc, [p("label", { class: n(x(K)) }, c(x(a).video.altText), 3), g($, {
|
|
3411
|
-
"model-value": e.block.alt,
|
|
3412
|
-
type: "text",
|
|
3413
|
-
placeholder: x(a).video.altTextPlaceholder,
|
|
3414
|
-
"onUpdate:modelValue": r[4] ||= (e) => S("alt", e)
|
|
3415
|
-
}, null, 8, ["model-value", "placeholder"])]),
|
|
3416
|
-
p("div", dc, [p("label", { class: n(x(K)) }, c(x(a).video.width), 3), p("select", {
|
|
3417
|
-
class: n(x(G)),
|
|
3418
|
-
value: e.block.width,
|
|
3419
|
-
onChange: r[5] ||= (e) => S("width", e.target.value === "full" ? "full" : Number(e.target.value))
|
|
3420
|
-
}, [
|
|
3421
|
-
p("option", pc, c(x(a).video.fullWidth), 1),
|
|
3422
|
-
r[7] ||= p("option", { value: "300" }, "300px", -1),
|
|
3423
|
-
r[8] ||= p("option", { value: "400" }, "400px", -1),
|
|
3424
|
-
r[9] ||= p("option", { value: "500" }, "500px", -1)
|
|
3425
|
-
], 42, fc)]),
|
|
3426
|
-
p("div", mc, [p("label", { class: n(x(K)) }, c(x(a).title.align), 3), g(Q, {
|
|
3427
|
-
options: [
|
|
3428
|
-
{
|
|
3429
|
-
value: "left",
|
|
3430
|
-
label: x(a).title.alignLeft
|
|
3431
|
-
},
|
|
3432
|
-
{
|
|
3433
|
-
value: "center",
|
|
3434
|
-
label: x(a).title.alignCenter
|
|
3435
|
-
},
|
|
3436
|
-
{
|
|
3437
|
-
value: "right",
|
|
3438
|
-
label: x(a).title.alignRight
|
|
3439
|
-
}
|
|
3440
|
-
],
|
|
3441
|
-
"model-value": e.block.align,
|
|
3442
|
-
"onUpdate:modelValue": r[6] ||= (e) => S("align", e)
|
|
3443
|
-
}, null, 8, ["options", "model-value"])])
|
|
3444
|
-
], 64));
|
|
3445
|
-
}
|
|
3446
|
-
}), gc = ["aria-label"], _c = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, vc = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, yc = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, bc = { class: "tpl:flex tpl:gap-1" }, xc = ["title"], Sc = ["title"], Cc = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, wc = /*#__PURE__*/ Mt(/* @__PURE__ */ f({
|
|
3447
|
-
__name: "Toolbar",
|
|
3448
|
-
props: { block: {} },
|
|
3449
|
-
emits: [
|
|
3450
|
-
"update",
|
|
3451
|
-
"delete",
|
|
3452
|
-
"duplicate"
|
|
3453
|
-
],
|
|
3454
|
-
setup(e, { emit: t }) {
|
|
3455
|
-
let n = h(() => import("./CountdownToolbar-CBE9wRaV.js")), r = e, i = t, { t: a } = U(), l = Be(lt, "Toolbar"), u = D(at, []), d = w(() => r.block.type), f = w(() => L(r.block)), _ = w(() => {
|
|
3456
|
-
if (f.value) return u.find((e) => e.type === r.block.customType);
|
|
3457
|
-
}), v = w(() => f.value ? _.value?.name ?? r.block.customType : de(d.value, a)), b = l.fonts;
|
|
3458
|
-
function S(e) {
|
|
3459
|
-
i("update", e);
|
|
3460
|
-
}
|
|
3461
|
-
return (t, r) => (s(), m("aside", {
|
|
3462
|
-
"aria-label": x(a).landmarks.blockToolbar,
|
|
3463
|
-
class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
|
|
3464
|
-
}, [p("div", _c, [p("div", vc, [x(_t)[d.value] ? (s(), y(o(x(_t)[d.value]), {
|
|
3465
|
-
key: 0,
|
|
3466
|
-
size: 16,
|
|
3467
|
-
"stroke-width": 1.5
|
|
3468
|
-
})) : f.value ? (s(), y(x(le), {
|
|
3469
|
-
key: 1,
|
|
3470
|
-
size: 16,
|
|
3471
|
-
"stroke-width": 1.5
|
|
3472
|
-
})) : T("", !0), p("h3", yc, c(v.value), 1)]), p("div", bc, [p("button", {
|
|
3473
|
-
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)] tpl:hover:text-[var(--tpl-text)]",
|
|
3474
|
-
title: x(a).toolbar.duplicate,
|
|
3475
|
-
onClick: r[0] ||= (e) => i("duplicate")
|
|
3476
|
-
}, [g(x(H), {
|
|
3477
|
-
size: 14,
|
|
3478
|
-
"stroke-width": 2
|
|
3479
|
-
})], 8, xc), p("button", {
|
|
3480
|
-
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
|
|
3481
|
-
title: x(a).toolbar.delete,
|
|
3482
|
-
onClick: r[1] ||= (e) => i("delete")
|
|
3483
|
-
}, [g(x(At), {
|
|
3484
|
-
size: 14,
|
|
3485
|
-
"stroke-width": 2
|
|
3486
|
-
})], 8, Sc)])]), p("div", Cc, [f.value ? (s(), y(Ga, {
|
|
3487
|
-
key: 0,
|
|
3488
|
-
block: e.block,
|
|
3489
|
-
onUpdateFieldValues: r[2] ||= (e) => i("update", { fieldValues: e }),
|
|
3490
|
-
onUpdateDataSourceFetched: r[3] ||= (e) => i("update", { dataSourceFetched: e })
|
|
3491
|
-
}, null, 8, ["block"])) : d.value === "section" ? (s(), y(Uo, {
|
|
3492
|
-
key: 1,
|
|
3493
|
-
block: e.block,
|
|
3494
|
-
onUpdate: S
|
|
3495
|
-
}, null, 8, ["block"])) : d.value === "title" ? (s(), y(rc, {
|
|
3496
|
-
key: 2,
|
|
3497
|
-
block: e.block,
|
|
3498
|
-
"font-families": x(b),
|
|
3499
|
-
onUpdate: S
|
|
3500
|
-
}, null, 8, ["block", "font-families"])) : d.value === "paragraph" ? (s(), m(C, { key: 3 }, [], 64)) : d.value === "image" ? (s(), y(vo, {
|
|
3501
|
-
key: 4,
|
|
3502
|
-
block: e.block,
|
|
3503
|
-
onUpdate: S
|
|
3504
|
-
}, null, 8, ["block"])) : d.value === "video" ? (s(), y(hc, {
|
|
3505
|
-
key: 5,
|
|
3506
|
-
block: e.block,
|
|
3507
|
-
onUpdate: S
|
|
3508
|
-
}, null, 8, ["block"])) : d.value === "button" ? (s(), y(_i, {
|
|
3509
|
-
key: 6,
|
|
3510
|
-
block: e.block,
|
|
3511
|
-
"font-families": x(b),
|
|
3512
|
-
onUpdate: S
|
|
3513
|
-
}, null, 8, ["block", "font-families"])) : d.value === "divider" ? (s(), y(Za, {
|
|
3514
|
-
key: 7,
|
|
3515
|
-
block: e.block,
|
|
3516
|
-
onUpdate: S
|
|
3517
|
-
}, null, 8, ["block"])) : d.value === "social" ? (s(), y(cs, {
|
|
3518
|
-
key: 8,
|
|
3519
|
-
block: e.block,
|
|
3520
|
-
onUpdate: S
|
|
3521
|
-
}, null, 8, ["block"])) : d.value === "menu" ? (s(), y(ko, {
|
|
3522
|
-
key: 9,
|
|
3523
|
-
block: e.block,
|
|
3524
|
-
"font-families": x(b),
|
|
3525
|
-
onUpdate: S
|
|
3526
|
-
}, null, 8, ["block", "font-families"])) : d.value === "table" ? (s(), y(Ws, {
|
|
3527
|
-
key: 10,
|
|
3528
|
-
block: e.block,
|
|
3529
|
-
"font-families": x(b),
|
|
3530
|
-
onUpdate: S
|
|
3531
|
-
}, null, 8, ["block", "font-families"])) : d.value === "spacer" ? (s(), y(ps, {
|
|
3532
|
-
key: 11,
|
|
3533
|
-
block: e.block,
|
|
3534
|
-
onUpdate: S
|
|
3535
|
-
}, null, 8, ["block"])) : d.value === "html" ? (s(), y(to, {
|
|
3536
|
-
key: 12,
|
|
3537
|
-
block: e.block,
|
|
3538
|
-
onUpdate: S
|
|
3539
|
-
}, null, 8, ["block"])) : d.value === "countdown" ? (s(), y(x(n), {
|
|
3540
|
-
key: 13,
|
|
3541
|
-
block: e.block,
|
|
3542
|
-
"font-families": x(b),
|
|
3543
|
-
onUpdate: S
|
|
3544
|
-
}, null, 8, ["block", "font-families"])) : T("", !0), g(la, {
|
|
3545
|
-
block: e.block,
|
|
3546
|
-
"is-first-section": d.value === "paragraph",
|
|
3547
|
-
onUpdate: S
|
|
3548
|
-
}, null, 8, ["block", "is-first-section"])])], 8, gc));
|
|
3549
|
-
}
|
|
3550
|
-
}), [["__scopeId", "data-v-2ac88283"]]), Tc = ["aria-label"], Ec = {
|
|
3551
|
-
role: "tablist",
|
|
3552
|
-
class: "tpl:relative tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-active)] tpl:p-1.5"
|
|
3553
|
-
}, Dc = [
|
|
3554
|
-
"aria-selected",
|
|
3555
|
-
"aria-label",
|
|
3556
|
-
"title"
|
|
3557
|
-
], Oc = { key: 0 }, kc = [
|
|
3558
|
-
"aria-selected",
|
|
3559
|
-
"aria-label",
|
|
3560
|
-
"title"
|
|
3561
|
-
], Ac = { key: 0 }, jc = [
|
|
3562
|
-
"aria-selected",
|
|
3563
|
-
"aria-label",
|
|
3564
|
-
"title"
|
|
3565
|
-
], Mc = { key: 0 }, Nc = {
|
|
3566
|
-
key: 1,
|
|
3567
|
-
class: "tpl:ml-1 tpl:rounded-full tpl:bg-[var(--tpl-bg-hover)] tpl:px-1.5 tpl:text-[10px]"
|
|
3568
|
-
}, Pc = {
|
|
3569
|
-
key: 0,
|
|
3570
|
-
id: "tpl-tabpanel-content",
|
|
3571
|
-
role: "tabpanel",
|
|
3572
|
-
"aria-labelledby": "tpl-tab-content",
|
|
3573
|
-
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
|
|
3574
|
-
}, Fc = {
|
|
3575
|
-
key: 1,
|
|
3576
|
-
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:px-6 tpl:py-10 tpl:text-center tpl:text-[var(--tpl-text-muted)]"
|
|
3577
|
-
}, Ic = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, Lc = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Rc = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, zc = {
|
|
3578
|
-
key: 1,
|
|
3579
|
-
id: "tpl-tabpanel-settings",
|
|
3580
|
-
role: "tabpanel",
|
|
3581
|
-
"aria-labelledby": "tpl-tab-settings",
|
|
3582
|
-
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
|
|
3583
|
-
}, Bc = {
|
|
3584
|
-
key: 2,
|
|
3585
|
-
id: "tpl-tabpanel-issues",
|
|
3586
|
-
role: "tabpanel",
|
|
3587
|
-
"aria-labelledby": "tpl-tab-issues",
|
|
3588
|
-
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
|
|
3589
|
-
}, Vc = /* @__PURE__ */ f({
|
|
3590
|
-
__name: "RightSidebar",
|
|
3591
|
-
props: {
|
|
3592
|
-
selectedBlock: {},
|
|
3593
|
-
settings: {},
|
|
3594
|
-
shiftedLeft: { type: Boolean }
|
|
3595
|
-
},
|
|
3596
|
-
emits: [
|
|
3597
|
-
"update-block",
|
|
3598
|
-
"delete-block",
|
|
3599
|
-
"duplicate-block",
|
|
3600
|
-
"update-settings"
|
|
3601
|
-
],
|
|
3602
|
-
setup(e, { emit: r }) {
|
|
3603
|
-
let a = h(() => import("./IssuesPanel-Do7RLXsP.js")), o = e, l = r, { t: u } = U(), f = d("content"), _ = D(ze, null), v = w(() => _ !== null), b = w(() => _?.issues.value.length ?? 0);
|
|
3604
|
-
function S(e) {
|
|
3605
|
-
return f.value === e ? "tpl:flex-1 tpl:text-[var(--tpl-primary)]" : "tpl:shrink-0 tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]";
|
|
3606
|
-
}
|
|
3607
|
-
function C(e) {
|
|
3608
|
-
return f.value === e ? {
|
|
3609
|
-
backgroundColor: "var(--tpl-bg)",
|
|
3610
|
-
boxShadow: "var(--tpl-shadow-md)"
|
|
3611
|
-
} : { backgroundColor: "transparent" };
|
|
3612
|
-
}
|
|
3613
|
-
return i(() => o.selectedBlock, (e) => {
|
|
3614
|
-
e && (f.value = "content");
|
|
3615
|
-
}), (r, i) => (s(), m("aside", {
|
|
3616
|
-
"aria-label": x(u).landmarks.rightSidebar,
|
|
3617
|
-
class: n(["tpl-right-sidebar tpl:absolute tpl:top-14 tpl:bottom-0 tpl:z-40 tpl:flex tpl:w-[320px] tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)] tpl:transition-all tpl:duration-200 tpl:border-l tpl:border-[var(--tpl-border)]", e.shiftedLeft ? "tpl:right-[360px]" : "tpl:right-0"])
|
|
3618
|
-
}, [
|
|
3619
|
-
p("div", Ec, [
|
|
3620
|
-
p("button", {
|
|
3621
|
-
id: "tpl-tab-content",
|
|
3622
|
-
role: "tab",
|
|
3623
|
-
"aria-selected": f.value === "content",
|
|
3624
|
-
"aria-controls": "tpl-tabpanel-content",
|
|
3625
|
-
"aria-label": x(u).sidebar.content,
|
|
3626
|
-
title: x(u).sidebar.content,
|
|
3627
|
-
class: n(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", S("content")]),
|
|
3628
|
-
style: t(C("content")),
|
|
3629
|
-
onClick: i[0] ||= (e) => f.value = "content"
|
|
3630
|
-
}, [g(x(tn), {
|
|
3631
|
-
size: 14,
|
|
3632
|
-
"stroke-width": 2
|
|
3633
|
-
}), f.value === "content" ? (s(), m("span", Oc, c(x(u).sidebar.content), 1)) : T("", !0)], 14, Dc),
|
|
3634
|
-
p("button", {
|
|
3635
|
-
id: "tpl-tab-settings",
|
|
3636
|
-
role: "tab",
|
|
3637
|
-
"aria-selected": f.value === "settings",
|
|
3638
|
-
"aria-controls": "tpl-tabpanel-settings",
|
|
3639
|
-
"aria-label": x(u).sidebar.settings,
|
|
3640
|
-
title: x(u).sidebar.settings,
|
|
3641
|
-
class: n(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", S("settings")]),
|
|
3642
|
-
style: t(C("settings")),
|
|
3643
|
-
onClick: i[1] ||= (e) => f.value = "settings"
|
|
3644
|
-
}, [g(x(an), {
|
|
3645
|
-
size: 14,
|
|
3646
|
-
"stroke-width": 1.5
|
|
3647
|
-
}), f.value === "settings" ? (s(), m("span", Ac, c(x(u).sidebar.settings), 1)) : T("", !0)], 14, kc),
|
|
3648
|
-
v.value ? (s(), m("button", {
|
|
3649
|
-
key: 0,
|
|
3650
|
-
id: "tpl-tab-issues",
|
|
3651
|
-
role: "tab",
|
|
3652
|
-
"aria-selected": f.value === "issues",
|
|
3653
|
-
"aria-controls": "tpl-tabpanel-issues",
|
|
3654
|
-
"aria-label": x(u).issues.panelTabLabel,
|
|
3655
|
-
title: x(u).issues.panelTabLabel,
|
|
3656
|
-
class: n(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", S("issues")]),
|
|
3657
|
-
style: t(C("issues")),
|
|
3658
|
-
onClick: i[2] ||= (e) => f.value = "issues"
|
|
3659
|
-
}, [
|
|
3660
|
-
g(x(St), {
|
|
3661
|
-
size: 14,
|
|
3662
|
-
"stroke-width": 1.5
|
|
3663
|
-
}),
|
|
3664
|
-
f.value === "issues" ? (s(), m("span", Mc, c(x(u).issues.panelTabLabel), 1)) : T("", !0),
|
|
3665
|
-
b.value > 0 ? (s(), m("span", Nc, c(b.value), 1)) : T("", !0)
|
|
3666
|
-
], 14, jc)) : T("", !0)
|
|
3667
|
-
]),
|
|
3668
|
-
f.value === "content" ? (s(), m("div", Pc, [e.selectedBlock ? (s(), y(wc, {
|
|
3669
|
-
key: 0,
|
|
3670
|
-
block: e.selectedBlock,
|
|
3671
|
-
onUpdate: i[3] ||= (e) => l("update-block", e),
|
|
3672
|
-
onDelete: i[4] ||= (e) => l("delete-block"),
|
|
3673
|
-
onDuplicate: i[5] ||= (e) => l("duplicate-block")
|
|
3674
|
-
}, null, 8, ["block"])) : (s(), m("div", Fc, [
|
|
3675
|
-
p("div", Ic, [g(x(Zt), {
|
|
3676
|
-
size: 40,
|
|
3677
|
-
"stroke-width": 1.5
|
|
3678
|
-
})]),
|
|
3679
|
-
p("h3", Lc, c(x(u).sidebar.noSelection), 1),
|
|
3680
|
-
p("p", Rc, c(x(u).sidebar.noSelectionHint), 1)
|
|
3681
|
-
]))])) : T("", !0),
|
|
3682
|
-
f.value === "settings" ? (s(), m("div", zc, [g(Br, {
|
|
3683
|
-
settings: e.settings,
|
|
3684
|
-
onUpdate: i[6] ||= (e) => l("update-settings", e)
|
|
3685
|
-
}, null, 8, ["settings"])])) : T("", !0),
|
|
3686
|
-
f.value === "issues" && v.value ? (s(), m("div", Bc, [g(x(a))])) : T("", !0)
|
|
3687
|
-
], 10, Tc));
|
|
3688
|
-
}
|
|
3689
|
-
}), Hc = {
|
|
3690
|
-
class: "tpl-small-screen-notice tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-6 tpl:py-10 tpl:text-center tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)]",
|
|
3691
|
-
style: { "z-index": "10001" },
|
|
3692
|
-
role: "status",
|
|
3693
|
-
"data-testid": "small-screen-notice"
|
|
3694
|
-
}, Uc = { class: "tpl:text-[var(--tpl-text-dim)]" }, Wc = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Gc = { class: "tpl:m-0 tpl:max-w-sm tpl:text-sm tpl:leading-normal" }, Kc = /* @__PURE__ */ f({
|
|
3695
|
-
__name: "SmallScreenNotice",
|
|
3696
|
-
setup(e) {
|
|
3697
|
-
let { t } = U();
|
|
3698
|
-
return (e, n) => (s(), m("div", Hc, [
|
|
3699
|
-
p("div", Uc, [g(x(wt), {
|
|
3700
|
-
size: 48,
|
|
3701
|
-
"stroke-width": 1.5
|
|
3702
|
-
})]),
|
|
3703
|
-
p("h2", Wc, c(x(t).smallScreen.title), 1),
|
|
3704
|
-
p("p", Gc, c(x(t).smallScreen.message), 1)
|
|
3705
|
-
]));
|
|
3706
|
-
}
|
|
3707
|
-
}), qc = [
|
|
3708
|
-
"aria-label",
|
|
3709
|
-
"title",
|
|
3710
|
-
"aria-pressed"
|
|
3711
|
-
], Jc = /*#__PURE__*/ Mt(/* @__PURE__ */ f({
|
|
3712
|
-
__name: "PreviewToggle",
|
|
3713
|
-
props: { previewMode: { type: Boolean } },
|
|
3714
|
-
emits: ["change"],
|
|
3715
|
-
setup(e, { emit: n }) {
|
|
3716
|
-
let r = n, { t: i } = U();
|
|
3717
|
-
return (n, a) => (s(), m("button", {
|
|
3718
|
-
class: "tpl-preview-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
|
|
3719
|
-
style: t({
|
|
3720
|
-
color: e.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
3721
|
-
backgroundColor: e.previewMode ? "var(--tpl-primary-light)" : "transparent"
|
|
3722
|
-
}),
|
|
3723
|
-
"aria-label": e.previewMode ? x(i).previewMode.disable : x(i).previewMode.enable,
|
|
3724
|
-
title: e.previewMode ? x(i).previewMode.disable : x(i).previewMode.enable,
|
|
3725
|
-
"aria-pressed": e.previewMode,
|
|
3726
|
-
onClick: a[0] ||= (t) => r("change", !e.previewMode)
|
|
3727
|
-
}, [g(P, {
|
|
3728
|
-
"enter-active-class": "tpl-icon-enter-active",
|
|
3729
|
-
"leave-active-class": "tpl-icon-leave-active",
|
|
3730
|
-
"enter-from-class": "tpl-icon-enter-from",
|
|
3731
|
-
"leave-to-class": "tpl-icon-leave-to",
|
|
3732
|
-
mode: "out-in"
|
|
3733
|
-
}, {
|
|
3734
|
-
default: l(() => [e.previewMode ? (s(), y(x(vt), {
|
|
3735
|
-
key: "eye",
|
|
3736
|
-
size: 18,
|
|
3737
|
-
"stroke-width": 1.5
|
|
3738
|
-
})) : (s(), y(x(oe), {
|
|
3739
|
-
key: "eye-off",
|
|
3740
|
-
size: 18,
|
|
3741
|
-
"stroke-width": 1.5
|
|
3742
|
-
}))]),
|
|
3743
|
-
_: 1
|
|
3744
|
-
})], 12, qc));
|
|
3745
|
-
}
|
|
3746
|
-
}), [["__scopeId", "data-v-af87d02a"]]), Yc = [
|
|
3747
|
-
"aria-label",
|
|
3748
|
-
"title",
|
|
3749
|
-
"aria-pressed"
|
|
3750
|
-
], Xc = /*#__PURE__*/ Mt(/* @__PURE__ */ f({
|
|
3751
|
-
__name: "DarkModeToggle",
|
|
3752
|
-
props: { darkMode: { type: Boolean } },
|
|
3753
|
-
emits: ["change"],
|
|
3754
|
-
setup(e, { emit: n }) {
|
|
3755
|
-
let r = n, { t: i } = U();
|
|
3756
|
-
return (n, a) => (s(), m("button", {
|
|
3757
|
-
class: "tpl-dark-mode-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
|
|
3758
|
-
style: t({
|
|
3759
|
-
color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
3760
|
-
backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
|
|
3761
|
-
}),
|
|
3762
|
-
"aria-label": e.darkMode ? x(i).darkMode.disable : x(i).darkMode.enable,
|
|
3763
|
-
title: e.darkMode ? x(i).darkMode.disable : x(i).darkMode.enable,
|
|
3764
|
-
"aria-pressed": e.darkMode,
|
|
3765
|
-
onClick: a[0] ||= (t) => r("change", !e.darkMode)
|
|
3766
|
-
}, [g(P, {
|
|
3767
|
-
"enter-active-class": "tpl-icon-enter-active",
|
|
3768
|
-
"leave-active-class": "tpl-icon-leave-active",
|
|
3769
|
-
"enter-from-class": "tpl-icon-enter-from",
|
|
3770
|
-
"leave-to-class": "tpl-icon-leave-to",
|
|
3771
|
-
mode: "out-in"
|
|
3772
|
-
}, {
|
|
3773
|
-
default: l(() => [e.darkMode ? (s(), y(x(en), {
|
|
3774
|
-
key: "moon",
|
|
3775
|
-
size: 18,
|
|
3776
|
-
"stroke-width": 1.5
|
|
3777
|
-
})) : (s(), y(x(cn), {
|
|
3778
|
-
key: "sun",
|
|
3779
|
-
size: 18,
|
|
3780
|
-
"stroke-width": 1.5
|
|
3781
|
-
}))]),
|
|
3782
|
-
_: 1
|
|
3783
|
-
})], 12, Yc));
|
|
3784
|
-
}
|
|
3785
|
-
}), [["__scopeId", "data-v-f8694f76"]]), Zc = {
|
|
3786
|
-
class: "tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",
|
|
3787
|
-
style: {
|
|
3788
|
-
"background-color": "color-mix(\n in srgb,\n var(--tpl-canvas-bg) 85%,\n transparent\n )",
|
|
3789
|
-
"backdrop-filter": "blur(8px)",
|
|
3790
|
-
"-webkit-backdrop-filter": "blur(8px)"
|
|
3791
|
-
}
|
|
3792
|
-
}, Qc = {
|
|
3793
|
-
href: "https://github.com/templatical/sdk",
|
|
3794
|
-
target: "_blank",
|
|
3795
|
-
rel: "noopener noreferrer",
|
|
3796
|
-
class: "tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]",
|
|
3797
|
-
style: { "text-decoration": "none" }
|
|
3798
|
-
}, $c = /* @__PURE__ */ f({
|
|
3799
|
-
__name: "EditorFooter",
|
|
3800
|
-
props: { positionClass: {} },
|
|
3801
|
-
setup(e) {
|
|
3802
|
-
let { t } = U();
|
|
3803
|
-
return (r, i) => (s(), m("footer", { class: n(["tpl:pointer-events-none tpl:absolute tpl:bottom-0 tpl:z-50 tpl:flex tpl:h-8 tpl:items-center tpl:justify-end tpl:pr-4 tpl:text-[9px] tpl:opacity-90 tpl:transition-all tpl:duration-300 tpl:text-[var(--tpl-text-dim)]", e.positionClass]) }, [p("div", Zc, [
|
|
3804
|
-
p("span", null, c(x(t).footer.poweredBy), 1),
|
|
3805
|
-
i[0] ||= p("a", {
|
|
3806
|
-
href: "https://templatical.com",
|
|
3807
|
-
target: "_blank",
|
|
3808
|
-
rel: "noopener noreferrer",
|
|
3809
|
-
class: "tpl:inline-flex tpl:items-center tpl:gap-1 tpl:font-medium tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-muted)]",
|
|
3810
|
-
style: { "text-decoration": "none" }
|
|
3811
|
-
}, [p("img", {
|
|
3812
|
-
width: "14",
|
|
3813
|
-
height: "14",
|
|
3814
|
-
src: "https://templatical.com/logo.svg",
|
|
3815
|
-
alt: ""
|
|
3816
|
-
}), b(" Templatical ")], -1),
|
|
3817
|
-
i[1] ||= p("span", { class: "tpl:text-[var(--tpl-border)]" }, "·", -1),
|
|
3818
|
-
p("a", Qc, c(x(t).footer.openSource), 1)
|
|
3819
|
-
])], 2));
|
|
3820
|
-
}
|
|
3821
|
-
}), el = ["aria-labelledby", "data-tpl-theme"], tl = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:gap-3 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, nl = ["id"], rl = ["aria-label"], il = { class: "tpl:relative tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, al = [
|
|
3822
|
-
"id",
|
|
3823
|
-
"placeholder",
|
|
3824
|
-
"aria-label",
|
|
3825
|
-
"aria-activedescendant"
|
|
3826
|
-
], ol = {
|
|
3827
|
-
key: 0,
|
|
3828
|
-
class: "tpl:flex tpl:gap-1.5 tpl:overflow-x-auto tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2",
|
|
3829
|
-
"data-testid": "merge-tag-picker-group-pills"
|
|
3830
|
-
}, sl = ["data-group-name", "onClick"], cl = ["aria-label"], ll = {
|
|
3831
|
-
key: 0,
|
|
3832
|
-
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
3833
|
-
"data-testid": "merge-tag-picker-empty"
|
|
3834
|
-
}, ul = {
|
|
3835
|
-
key: 1,
|
|
3836
|
-
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
3837
|
-
"data-testid": "merge-tag-picker-empty"
|
|
3838
|
-
}, dl = [
|
|
3839
|
-
"aria-expanded",
|
|
3840
|
-
"data-group-name",
|
|
3841
|
-
"data-group-collapsed",
|
|
3842
|
-
"onClick"
|
|
3843
|
-
], fl = { class: "tpl:ml-1 tpl:font-normal" }, pl = [
|
|
3844
|
-
"id",
|
|
3845
|
-
"aria-selected",
|
|
3846
|
-
"data-selected",
|
|
3847
|
-
"data-merge-tag-index",
|
|
3848
|
-
"data-merge-tag-value",
|
|
3849
|
-
"title",
|
|
3850
|
-
"onMousemove",
|
|
3851
|
-
"onClick"
|
|
3852
|
-
], ml = { class: "tpl:text-sm tpl:font-medium" }, hl = { class: "tpl:line-clamp-2 tpl:font-mono tpl:text-xs tpl:text-ellipsis tpl:break-all tpl:text-[var(--tpl-text-dim)]" }, gl = {
|
|
3853
|
-
key: 0,
|
|
3854
|
-
class: "tpl:line-clamp-2 tpl:text-xs tpl:text-ellipsis tpl:text-[var(--tpl-text-dim)]"
|
|
3855
|
-
}, _l = {
|
|
3856
|
-
key: 1,
|
|
3857
|
-
"data-testid": "merge-tag-picker-sample",
|
|
3858
|
-
class: "tpl:line-clamp-1 tpl:text-xs tpl:text-ellipsis tpl:text-[var(--tpl-text-dim)]"
|
|
3859
|
-
}, vl = "tpl-merge-tag-picker-list", yl = /* @__PURE__ */ f({
|
|
3860
|
-
__name: "MergeTagPickerModal",
|
|
3861
|
-
setup(r) {
|
|
3862
|
-
let a = Be(We, "MergeTagPickerModal"), { t: o, format: u } = U(), f = D(Ye, null), h = D(Je, null), _ = d(""), v = Pe(_, 200), b = d(null), S = w(() => v.value.trim().length > 0), O = d(0), M = w(() => a.tags.value.some((e) => !!e.group)), P = d(/* @__PURE__ */ new Set());
|
|
3863
|
-
function F(e) {
|
|
3864
|
-
return P.value.has(e);
|
|
3865
|
-
}
|
|
3866
|
-
function ee(e) {
|
|
3867
|
-
let t = new Set(P.value);
|
|
3868
|
-
t.has(e) ? t.delete(e) : t.add(e), P.value = t, O.value = 0;
|
|
3869
|
-
}
|
|
3870
|
-
let I = w(() => {
|
|
3871
|
-
let e = v.value.trim().toLowerCase();
|
|
3872
|
-
return e ? a.tags.value.filter((t) => [
|
|
3873
|
-
t.label,
|
|
3874
|
-
t.value,
|
|
3875
|
-
t.description ?? ""
|
|
3876
|
-
].join(" ").toLowerCase().includes(e)) : a.tags.value;
|
|
3877
|
-
}), L = w(() => {
|
|
3878
|
-
if (!M.value) return [];
|
|
3879
|
-
let e = o.mergeTag.picker.otherGroup, t = /* @__PURE__ */ new Set(), n = [];
|
|
3880
|
-
for (let r of a.tags.value) {
|
|
3881
|
-
let i = r.group ?? e;
|
|
3882
|
-
t.has(i) || (t.add(i), n.push(i));
|
|
3883
|
-
}
|
|
3884
|
-
return n;
|
|
3885
|
-
}), R = w(() => {
|
|
3886
|
-
let e = I.value;
|
|
3887
|
-
if (!M.value || S.value) return e.map((e, t) => ({
|
|
3888
|
-
kind: "tag",
|
|
3889
|
-
tag: e,
|
|
3890
|
-
index: t
|
|
3891
|
-
}));
|
|
3892
|
-
let t = o.mergeTag.picker.otherGroup, n = /* @__PURE__ */ new Map(), r = [];
|
|
3893
|
-
for (let i of e) {
|
|
3894
|
-
let e = i.group ?? t;
|
|
3895
|
-
n.has(e) || (n.set(e, []), r.push(e)), n.get(e).push(i);
|
|
3896
|
-
}
|
|
3897
|
-
let i = [], a = 0;
|
|
3898
|
-
for (let e of r) {
|
|
3899
|
-
let t = n.get(e);
|
|
3900
|
-
if (i.push({
|
|
3901
|
-
kind: "header",
|
|
3902
|
-
group: e,
|
|
3903
|
-
count: t.length
|
|
3904
|
-
}), !P.value.has(e)) for (let e of t) i.push({
|
|
3905
|
-
kind: "tag",
|
|
3906
|
-
tag: e,
|
|
3907
|
-
index: a
|
|
3908
|
-
}), a++;
|
|
3909
|
-
}
|
|
3910
|
-
return i;
|
|
3911
|
-
}), z = w(() => R.value.flatMap((e) => e.kind === "tag" ? [e.tag] : []));
|
|
3912
|
-
i(() => a.isOpen.value, (e) => {
|
|
3913
|
-
e && (_.value = "", O.value = 0, P.value = /* @__PURE__ */ new Set(), E(() => {
|
|
3914
|
-
b.value?.focus();
|
|
3915
|
-
}));
|
|
3916
|
-
}), i(z, (e) => {
|
|
3917
|
-
O.value >= e.length && (O.value = Math.max(0, e.length - 1));
|
|
3918
|
-
});
|
|
3919
|
-
function B(e) {
|
|
3920
|
-
a.resolve(e);
|
|
3921
|
-
}
|
|
3922
|
-
function V() {
|
|
3923
|
-
a.resolve(null);
|
|
3924
|
-
}
|
|
3925
|
-
function te(e) {
|
|
3926
|
-
if (z.value.length === 0) return;
|
|
3927
|
-
let t = O.value + e;
|
|
3928
|
-
O.value = Math.max(0, Math.min(z.value.length - 1, t)), ae();
|
|
3929
|
-
}
|
|
3930
|
-
let ne = d(null), re = d({});
|
|
3931
|
-
function ie(e, t) {
|
|
3932
|
-
re.value[e] = t ?? null;
|
|
3933
|
-
}
|
|
3934
|
-
function ae() {
|
|
3935
|
-
E(() => {
|
|
3936
|
-
let e = ne.value;
|
|
3937
|
-
e && e.querySelector(`[data-merge-tag-index="${O.value}"]`)?.scrollIntoView({ block: "nearest" });
|
|
3938
|
-
});
|
|
3939
|
-
}
|
|
3940
|
-
function oe(e) {
|
|
3941
|
-
if (P.value.has(e)) {
|
|
3942
|
-
let t = new Set(P.value);
|
|
3943
|
-
t.delete(e), P.value = t;
|
|
3944
|
-
}
|
|
3945
|
-
E(() => {
|
|
3946
|
-
let t = ne.value;
|
|
3947
|
-
if (!t) return;
|
|
3948
|
-
let n = 0, r = !1;
|
|
3949
|
-
for (let i of Array.from(t.children)) {
|
|
3950
|
-
if (i.dataset.testid === "merge-tag-picker-group-header" && i.dataset.groupName === e) {
|
|
3951
|
-
r = !0;
|
|
3952
|
-
break;
|
|
3953
|
-
}
|
|
3954
|
-
n += i.offsetHeight;
|
|
3955
|
-
}
|
|
3956
|
-
r && t.scrollTo({
|
|
3957
|
-
top: n,
|
|
3958
|
-
behavior: "smooth"
|
|
3959
|
-
});
|
|
3960
|
-
});
|
|
3961
|
-
}
|
|
3962
|
-
function H(e) {
|
|
3963
|
-
if (e.key === "ArrowDown") e.preventDefault(), te(1);
|
|
3964
|
-
else if (e.key === "ArrowUp") e.preventDefault(), te(-1);
|
|
3965
|
-
else if (e.key === "Enter") {
|
|
3966
|
-
e.preventDefault();
|
|
3967
|
-
let t = z.value[O.value];
|
|
3968
|
-
t && B(t);
|
|
3969
|
-
}
|
|
3970
|
-
}
|
|
3971
|
-
function se() {
|
|
3972
|
-
if (z.value.length !== 0) return `${vl}-opt-${O.value}`;
|
|
3973
|
-
}
|
|
3974
|
-
function ce(e) {
|
|
3975
|
-
return `${vl}-opt-${e}`;
|
|
3976
|
-
}
|
|
3977
|
-
let le = w(() => a.tags.value.length === 0), ue = w(() => !le.value && I.value.length === 0), de = w(() => M.value && L.value.length > 1 && !S.value);
|
|
3978
|
-
return (r, i) => (s(), y(Jt, {
|
|
3979
|
-
visible: x(a).isOpen.value,
|
|
3980
|
-
onClose: V,
|
|
3981
|
-
onKeydown: H
|
|
3982
|
-
}, {
|
|
3983
|
-
default: l(() => [p("div", {
|
|
3984
|
-
role: "dialog",
|
|
3985
|
-
"aria-modal": "true",
|
|
3986
|
-
"aria-labelledby": `${vl}-title`,
|
|
3987
|
-
"data-tpl-theme": x(h),
|
|
3988
|
-
"data-testid": "merge-tag-picker-modal",
|
|
3989
|
-
class: "tpl tpl:flex tpl:max-h-[80vh] tpl:w-[min(420px,92vw)] tpl:flex-col tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
3990
|
-
style: t(x(f))
|
|
3991
|
-
}, [
|
|
3992
|
-
p("header", tl, [p("h2", {
|
|
3993
|
-
id: `${vl}-title`,
|
|
3994
|
-
class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
3995
|
-
}, c(x(o).mergeTag.picker.title), 9, nl), p("button", {
|
|
3996
|
-
type: "button",
|
|
3997
|
-
class: "tpl:flex tpl:h-7 tpl:w-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
3998
|
-
"aria-label": x(o).mergeTag.picker.close,
|
|
3999
|
-
"data-testid": "merge-tag-picker-close",
|
|
4000
|
-
onClick: V
|
|
4001
|
-
}, [g(x(jt), {
|
|
4002
|
-
size: 16,
|
|
4003
|
-
"stroke-width": 2
|
|
4004
|
-
})], 8, rl)]),
|
|
4005
|
-
p("div", il, [g(x(ht), {
|
|
4006
|
-
class: "tpl:pointer-events-none tpl:absolute tpl:top-1/2 tpl:left-5 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]",
|
|
4007
|
-
size: 14,
|
|
4008
|
-
"stroke-width": 2
|
|
4009
|
-
}), k(p("input", {
|
|
4010
|
-
id: `${vl}-search`,
|
|
4011
|
-
ref_key: "searchInputRef",
|
|
4012
|
-
ref: b,
|
|
4013
|
-
"onUpdate:modelValue": i[0] ||= (e) => _.value = e,
|
|
4014
|
-
type: "text",
|
|
4015
|
-
class: "tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)]",
|
|
4016
|
-
placeholder: x(o).mergeTag.picker.searchPlaceholder,
|
|
4017
|
-
"aria-label": x(o).mergeTag.picker.searchAriaLabel,
|
|
4018
|
-
"aria-controls": vl,
|
|
4019
|
-
"aria-activedescendant": se(),
|
|
4020
|
-
"data-testid": "merge-tag-picker-search",
|
|
4021
|
-
onKeydown: i[1] ||= N(j(() => {}, ["prevent"]), ["enter"])
|
|
4022
|
-
}, null, 40, al), [[A, _.value]])]),
|
|
4023
|
-
de.value ? (s(), m("div", ol, [(s(!0), m(C, null, e(L.value, (e) => (s(), m("button", {
|
|
4024
|
-
key: e,
|
|
4025
|
-
type: "button",
|
|
4026
|
-
class: "tpl:flex tpl:flex-shrink-0 tpl:cursor-pointer tpl:items-center tpl:rounded-full tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-2.5 tpl:py-0.5 tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
4027
|
-
"data-testid": "merge-tag-picker-group-pill",
|
|
4028
|
-
"data-group-name": e,
|
|
4029
|
-
onClick: (t) => oe(e)
|
|
4030
|
-
}, c(e), 9, sl))), 128))])) : T("", !0),
|
|
4031
|
-
p("div", {
|
|
4032
|
-
id: vl,
|
|
4033
|
-
ref_key: "listRef",
|
|
4034
|
-
ref: ne,
|
|
4035
|
-
class: "tpl:relative tpl:max-h-[60vh] tpl:flex-1 tpl:overflow-y-auto",
|
|
4036
|
-
role: "listbox",
|
|
4037
|
-
"aria-label": x(o).mergeTag.picker.title,
|
|
4038
|
-
"data-testid": "merge-tag-picker-list"
|
|
4039
|
-
}, [le.value ? (s(), m("div", ll, c(x(o).mergeTag.picker.empty), 1)) : ue.value ? (s(), m("div", ul, c(x(o).mergeTag.picker.noResults), 1)) : (s(!0), m(C, { key: 2 }, e(R.value, (e, t) => (s(), m(C, { key: t }, [e.kind === "header" ? (s(), m("button", {
|
|
4040
|
-
key: 0,
|
|
4041
|
-
ref_for: !0,
|
|
4042
|
-
ref: (t) => ie(e.group, t),
|
|
4043
|
-
type: "button",
|
|
4044
|
-
"aria-expanded": !F(e.group),
|
|
4045
|
-
"aria-controls": vl,
|
|
4046
|
-
class: "tpl:sticky tpl:top-0 tpl:z-10 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-[var(--tpl-bg-elevated)] tpl:px-3 tpl:pt-2.5 tpl:pb-1 tpl:text-left tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)]",
|
|
4047
|
-
"data-testid": "merge-tag-picker-group-header",
|
|
4048
|
-
"data-group-name": e.group,
|
|
4049
|
-
"data-group-collapsed": F(e.group) ? "true" : "false",
|
|
4050
|
-
onClick: (t) => ee(e.group)
|
|
4051
|
-
}, [
|
|
4052
|
-
g(x(ft), {
|
|
4053
|
-
size: 12,
|
|
4054
|
-
"stroke-width": 2,
|
|
4055
|
-
class: n(["tpl:transition-transform", F(e.group) ? "tpl:-rotate-90" : ""])
|
|
4056
|
-
}, null, 8, ["class"]),
|
|
4057
|
-
p("span", null, c(e.group), 1),
|
|
4058
|
-
p("span", fl, " (" + c(x(u)(x(o).mergeTag.picker.groupCount, { count: e.count })) + ") ", 1)
|
|
4059
|
-
], 8, dl)) : (s(), m("button", {
|
|
4060
|
-
key: 1,
|
|
4061
|
-
id: ce(e.index),
|
|
4062
|
-
type: "button",
|
|
4063
|
-
role: "option",
|
|
4064
|
-
"aria-selected": e.index === O.value,
|
|
4065
|
-
"data-selected": e.index === O.value ? "true" : "false",
|
|
4066
|
-
"data-merge-tag-index": e.index,
|
|
4067
|
-
"data-merge-tag-value": e.tag.value,
|
|
4068
|
-
title: e.tag.description ? `${e.tag.value} — ${e.tag.description}` : e.tag.value,
|
|
4069
|
-
class: n(["tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:border-none tpl:px-3 tpl:py-1.5 tpl:text-left tpl:transition-colors", e.index === O.value ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:bg-transparent tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
|
|
4070
|
-
"data-testid": "merge-tag-picker-item",
|
|
4071
|
-
onMousemove: (t) => O.value = e.index,
|
|
4072
|
-
onClick: (t) => B(e.tag)
|
|
4073
|
-
}, [
|
|
4074
|
-
p("span", ml, c(e.tag.label), 1),
|
|
4075
|
-
p("span", hl, c(e.tag.value), 1),
|
|
4076
|
-
e.tag.description ? (s(), m("span", gl, c(e.tag.description), 1)) : T("", !0),
|
|
4077
|
-
e.tag.sample === void 0 ? T("", !0) : (s(), m("span", _l, c(x(u)(x(o).mergeTag.picker.sample, { sample: e.tag.sample })), 1))
|
|
4078
|
-
], 42, pl))], 64))), 128))], 8, cl)
|
|
4079
|
-
], 12, el)]),
|
|
4080
|
-
_: 1
|
|
4081
|
-
}, 8, ["visible"]));
|
|
4082
|
-
}
|
|
4083
|
-
}), bl = ["data-logic-keyword"], xl = /* @__PURE__ */ f({
|
|
4084
|
-
__name: "LogicTagBadge",
|
|
4085
|
-
props: {
|
|
4086
|
-
value: {},
|
|
4087
|
-
syntax: {}
|
|
4088
|
-
},
|
|
4089
|
-
setup(e) {
|
|
4090
|
-
let t = e, n = w(() => R(t.value, t.syntax)), r = w(() => I(t.value, t.syntax));
|
|
4091
|
-
return (e, t) => n.value ? (s(), m("span", {
|
|
4092
|
-
key: 0,
|
|
4093
|
-
class: "tpl:inline-flex tpl:flex-shrink-0 tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:leading-none tpl:font-bold tpl:tracking-wide tpl:uppercase",
|
|
4094
|
-
style: {
|
|
4095
|
-
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
4096
|
-
color: "var(--tpl-primary)"
|
|
4097
|
-
},
|
|
4098
|
-
"data-testid": "merge-tag-logic-badge",
|
|
4099
|
-
"data-logic-keyword": r.value
|
|
4100
|
-
}, c(r.value), 9, bl)) : T("", !0);
|
|
4101
|
-
}
|
|
4102
|
-
}), Sl = ["aria-labelledby", "data-tpl-theme"], Cl = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:gap-3 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, wl = ["id"], Tl = ["aria-label"], El = { class: "tpl:relative tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, Dl = [
|
|
4103
|
-
"id",
|
|
4104
|
-
"placeholder",
|
|
4105
|
-
"aria-label",
|
|
4106
|
-
"aria-activedescendant"
|
|
4107
|
-
], Ol = ["aria-label"], kl = {
|
|
4108
|
-
key: 0,
|
|
4109
|
-
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
4110
|
-
"data-testid": "logic-picker-empty"
|
|
4111
|
-
}, Al = {
|
|
4112
|
-
key: 1,
|
|
4113
|
-
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
4114
|
-
"data-testid": "logic-picker-empty"
|
|
4115
|
-
}, jl = ["data-group-name"], Ml = [
|
|
4116
|
-
"id",
|
|
4117
|
-
"aria-selected",
|
|
4118
|
-
"data-selected",
|
|
4119
|
-
"data-logic-index",
|
|
4120
|
-
"data-logic-kind",
|
|
4121
|
-
"onMousemove",
|
|
4122
|
-
"onClick"
|
|
4123
|
-
], Nl = { class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-between tpl:gap-2" }, Pl = { class: "tpl:text-sm tpl:font-medium" }, Fl = {
|
|
4124
|
-
key: 0,
|
|
4125
|
-
class: "tpl:flex tpl:items-center"
|
|
4126
|
-
}, Il = {
|
|
4127
|
-
key: 1,
|
|
4128
|
-
class: "tpl:flex tpl:items-center tpl:gap-1"
|
|
4129
|
-
}, Ll = { class: "tpl:line-clamp-2 tpl:font-mono tpl:text-xs tpl:text-ellipsis tpl:break-all tpl:text-[var(--tpl-text-dim)]" }, Rl = {
|
|
4130
|
-
key: 0,
|
|
4131
|
-
class: "tpl:line-clamp-2 tpl:text-xs tpl:text-ellipsis tpl:text-[var(--tpl-text-dim)]"
|
|
4132
|
-
}, zl = "tpl-logic-picker-list", Bl = /* @__PURE__ */ f({
|
|
4133
|
-
__name: "LogicTagPickerModal",
|
|
4134
|
-
setup(r) {
|
|
4135
|
-
let a = Be(qe, "LogicTagPickerModal"), { t: o } = U(), u = D(Re, B.liquid), f = D(Ye, null), h = D(Je, null), _ = d(""), v = Pe(_, 200), b = d(null), S = w(() => v.value.trim().length > 0), O = d(0);
|
|
4136
|
-
function M(e) {
|
|
4137
|
-
let t = v.value.trim().toLowerCase();
|
|
4138
|
-
return !t || e.filter(Boolean).join(" ").toLowerCase().includes(t);
|
|
4139
|
-
}
|
|
4140
|
-
let P = w(() => a.tags.value.filter((e) => M([
|
|
4141
|
-
e.label,
|
|
4142
|
-
e.value,
|
|
4143
|
-
e.description
|
|
4144
|
-
]))), F = w(() => a.pairs.value.filter((e) => M([
|
|
4145
|
-
e.label,
|
|
4146
|
-
e.before,
|
|
4147
|
-
e.after,
|
|
4148
|
-
e.description
|
|
4149
|
-
]))), ee = w(() => [...F.value.map((e) => ({
|
|
4150
|
-
kind: "pair",
|
|
4151
|
-
pair: e,
|
|
4152
|
-
group: e.group
|
|
4153
|
-
})), ...P.value.map((e) => ({
|
|
4154
|
-
kind: "tag",
|
|
4155
|
-
tag: e,
|
|
4156
|
-
group: e.group
|
|
4157
|
-
}))]), I = w(() => a.tags.value.some((e) => !!e.group) || a.pairs.value.some((e) => !!e.group));
|
|
4158
|
-
function L(e) {
|
|
4159
|
-
let t = o.logicTag.picker.otherGroup, n = /* @__PURE__ */ new Map(), r = [];
|
|
4160
|
-
for (let i of e) {
|
|
4161
|
-
let e = i.group ?? t;
|
|
4162
|
-
n.has(e) || (n.set(e, []), r.push(e)), n.get(e).push(i);
|
|
4163
|
-
}
|
|
4164
|
-
return r.map((e) => [e, n.get(e)]);
|
|
4165
|
-
}
|
|
4166
|
-
let R = w(() => {
|
|
4167
|
-
let e = [], t = [], n = 0, r = (r) => {
|
|
4168
|
-
r.kind === "tag" ? (e.push({
|
|
4169
|
-
kind: "tag",
|
|
4170
|
-
tag: r.tag,
|
|
4171
|
-
index: n
|
|
4172
|
-
}), t.push(r.tag)) : (e.push({
|
|
4173
|
-
kind: "pair",
|
|
4174
|
-
pair: r.pair,
|
|
4175
|
-
index: n
|
|
4176
|
-
}), t.push(r.pair)), n++;
|
|
4177
|
-
}, i = ee.value;
|
|
4178
|
-
if (S.value || !I.value) for (let e of i) r(e);
|
|
4179
|
-
else for (let [t, n] of L(i)) {
|
|
4180
|
-
e.push({
|
|
4181
|
-
kind: "header",
|
|
4182
|
-
label: t
|
|
4183
|
-
});
|
|
4184
|
-
for (let e of n) r(e);
|
|
4185
|
-
}
|
|
4186
|
-
return {
|
|
4187
|
-
rows: e,
|
|
4188
|
-
items: t
|
|
4189
|
-
};
|
|
4190
|
-
}), z = w(() => R.value.items), V = w(() => a.tags.value.length === 0 && a.pairs.value.length === 0), te = w(() => !V.value && z.value.length === 0);
|
|
4191
|
-
i(() => a.isOpen.value, (e) => {
|
|
4192
|
-
e && (_.value = "", O.value = 0, E(() => b.value?.focus()));
|
|
4193
|
-
}), i(z, (e) => {
|
|
4194
|
-
O.value >= e.length && (O.value = Math.max(0, e.length - 1));
|
|
4195
|
-
});
|
|
4196
|
-
let ne = d(null);
|
|
4197
|
-
function re(e) {
|
|
4198
|
-
a.resolve(e);
|
|
4199
|
-
}
|
|
4200
|
-
function ie() {
|
|
4201
|
-
a.resolve(null);
|
|
4202
|
-
}
|
|
4203
|
-
function ae(e) {
|
|
4204
|
-
z.value.length !== 0 && (O.value = Math.max(0, Math.min(z.value.length - 1, O.value + e)), E(() => {
|
|
4205
|
-
ne.value?.querySelector(`[data-logic-index="${O.value}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4206
|
-
}));
|
|
4207
|
-
}
|
|
4208
|
-
function oe(e) {
|
|
4209
|
-
if (e.key === "ArrowDown") e.preventDefault(), ae(1);
|
|
4210
|
-
else if (e.key === "ArrowUp") e.preventDefault(), ae(-1);
|
|
4211
|
-
else if (e.key === "Enter") {
|
|
4212
|
-
e.preventDefault();
|
|
4213
|
-
let t = z.value[O.value];
|
|
4214
|
-
t && re(t);
|
|
4215
|
-
}
|
|
4216
|
-
}
|
|
4217
|
-
function H(e) {
|
|
4218
|
-
return `${zl}-opt-${e}`;
|
|
4219
|
-
}
|
|
4220
|
-
function se() {
|
|
4221
|
-
return z.value.length === 0 ? void 0 : `${zl}-opt-${O.value}`;
|
|
4222
|
-
}
|
|
4223
|
-
return (r, i) => (s(), y(Jt, {
|
|
4224
|
-
visible: x(a).isOpen.value,
|
|
4225
|
-
onClose: ie,
|
|
4226
|
-
onKeydown: oe
|
|
4227
|
-
}, {
|
|
4228
|
-
default: l(() => [p("div", {
|
|
4229
|
-
role: "dialog",
|
|
4230
|
-
"aria-modal": "true",
|
|
4231
|
-
"aria-labelledby": `${zl}-title`,
|
|
4232
|
-
"data-tpl-theme": x(h),
|
|
4233
|
-
"data-testid": "logic-picker-modal",
|
|
4234
|
-
class: "tpl tpl:flex tpl:max-h-[80vh] tpl:w-[min(420px,92vw)] tpl:flex-col tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
4235
|
-
style: t(x(f))
|
|
4236
|
-
}, [
|
|
4237
|
-
p("header", Cl, [p("h2", {
|
|
4238
|
-
id: `${zl}-title`,
|
|
4239
|
-
class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
4240
|
-
}, c(x(o).logicTag.picker.title), 9, wl), p("button", {
|
|
4241
|
-
type: "button",
|
|
4242
|
-
class: "tpl:flex tpl:h-7 tpl:w-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
4243
|
-
"aria-label": x(o).logicTag.picker.close,
|
|
4244
|
-
"data-testid": "logic-picker-close",
|
|
4245
|
-
onClick: ie
|
|
4246
|
-
}, [g(x(jt), {
|
|
4247
|
-
size: 16,
|
|
4248
|
-
"stroke-width": 2
|
|
4249
|
-
})], 8, Tl)]),
|
|
4250
|
-
p("div", El, [g(x(ht), {
|
|
4251
|
-
class: "tpl:pointer-events-none tpl:absolute tpl:top-1/2 tpl:left-5 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]",
|
|
4252
|
-
size: 14,
|
|
4253
|
-
"stroke-width": 2
|
|
4254
|
-
}), k(p("input", {
|
|
4255
|
-
id: `${zl}-search`,
|
|
4256
|
-
ref_key: "searchInputRef",
|
|
4257
|
-
ref: b,
|
|
4258
|
-
"onUpdate:modelValue": i[0] ||= (e) => _.value = e,
|
|
4259
|
-
type: "text",
|
|
4260
|
-
class: "tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)]",
|
|
4261
|
-
placeholder: x(o).logicTag.picker.searchPlaceholder,
|
|
4262
|
-
"aria-label": x(o).logicTag.picker.searchAriaLabel,
|
|
4263
|
-
"aria-controls": zl,
|
|
4264
|
-
"aria-activedescendant": se(),
|
|
4265
|
-
"data-testid": "logic-picker-search",
|
|
4266
|
-
onKeydown: i[1] ||= N(j(() => {}, ["prevent"]), ["enter"])
|
|
4267
|
-
}, null, 40, Dl), [[A, _.value]])]),
|
|
4268
|
-
p("div", {
|
|
4269
|
-
id: zl,
|
|
4270
|
-
ref_key: "listRef",
|
|
4271
|
-
ref: ne,
|
|
4272
|
-
class: "tpl:relative tpl:max-h-[60vh] tpl:flex-1 tpl:overflow-y-auto",
|
|
4273
|
-
role: "listbox",
|
|
4274
|
-
"aria-label": x(o).logicTag.picker.title,
|
|
4275
|
-
"data-testid": "logic-picker-list"
|
|
4276
|
-
}, [V.value ? (s(), m("div", kl, c(x(o).logicTag.picker.empty), 1)) : te.value ? (s(), m("div", Al, c(x(o).logicTag.picker.noResults), 1)) : (s(!0), m(C, { key: 2 }, e(R.value.rows, (e, t) => (s(), m(C, { key: t }, [e.kind === "header" ? (s(), m("div", {
|
|
4277
|
-
key: 0,
|
|
4278
|
-
class: "tpl:px-3 tpl:pt-2.5 tpl:pb-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]",
|
|
4279
|
-
"data-testid": "logic-picker-header",
|
|
4280
|
-
"data-group-name": e.label
|
|
4281
|
-
}, c(e.label), 9, jl)) : (s(), m("button", {
|
|
4282
|
-
key: 1,
|
|
4283
|
-
id: H(e.index),
|
|
4284
|
-
type: "button",
|
|
4285
|
-
role: "option",
|
|
4286
|
-
"aria-selected": e.index === O.value,
|
|
4287
|
-
"data-selected": e.index === O.value ? "true" : "false",
|
|
4288
|
-
"data-logic-index": e.index,
|
|
4289
|
-
"data-logic-kind": e.kind,
|
|
4290
|
-
class: n(["tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:border-none tpl:px-3 tpl:py-1.5 tpl:text-left tpl:transition-colors", e.index === O.value ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:bg-transparent tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
|
|
4291
|
-
"data-testid": "logic-picker-item",
|
|
4292
|
-
onMousemove: (t) => O.value = e.index,
|
|
4293
|
-
onClick: (t) => re(e.kind === "tag" ? e.tag : e.pair)
|
|
4294
|
-
}, [
|
|
4295
|
-
p("span", Nl, [p("span", Pl, c(e.kind === "tag" ? e.tag.label : e.pair.label), 1), e.kind === "tag" ? (s(), m("span", Fl, [g(xl, {
|
|
4296
|
-
value: e.tag.value,
|
|
4297
|
-
syntax: x(u)
|
|
4298
|
-
}, null, 8, ["value", "syntax"])])) : (s(), m("span", Il, [
|
|
4299
|
-
g(xl, {
|
|
4300
|
-
value: e.pair.before,
|
|
4301
|
-
syntax: x(u)
|
|
4302
|
-
}, null, 8, ["value", "syntax"]),
|
|
4303
|
-
i[2] ||= p("span", { class: "tpl:text-[var(--tpl-text-dim)]" }, "…", -1),
|
|
4304
|
-
g(xl, {
|
|
4305
|
-
value: e.pair.after,
|
|
4306
|
-
syntax: x(u)
|
|
4307
|
-
}, null, 8, ["value", "syntax"])
|
|
4308
|
-
]))]),
|
|
4309
|
-
p("span", Ll, c(e.kind === "tag" ? e.tag.value : `${e.pair.before} … ${e.pair.after}`), 1),
|
|
4310
|
-
(e.kind === "tag" ? e.tag.description : e.pair.description) ? (s(), m("span", Rl, c(e.kind === "tag" ? e.tag.description : e.pair.description), 1)) : T("", !0)
|
|
4311
|
-
], 42, Ml))], 64))), 128))], 8, Ol)
|
|
4312
|
-
], 12, Sl)]),
|
|
4313
|
-
_: 1
|
|
4314
|
-
}, 8, ["visible"]));
|
|
4315
|
-
}
|
|
4316
|
-
});
|
|
4317
|
-
//#endregion
|
|
4318
|
-
export { Jc as a, Ln as c, mn as d, pn as f, rn as h, Xc as i, On as l, ln as m, yl as n, Kc as o, dn as p, $c as r, Vc as s, Bl as t, Dn as u };
|