@templatical/editor 0.26.3 → 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-BGwbg9aN.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-6WN5jmXr.js → ParagraphEditor-vDU-5y6r.js} +200 -198
- 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-GMrajvfV.js → SavedBlocksBrowserModal-CefWWcdT.js} +116 -115
- package/dist/{cdn/chunks/SavedBlocksPanels-CUtYoi5Z.js → SavedBlocksPanels-DnQwO-7O.js} +9 -11
- package/dist/{SavedBlocksPickBar-Dk_IaMO9.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-B8y7JabA.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-C7wRSaT3.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-msj619wT.js → BlockPreviewCanvas-DStQFo9P.js} +42 -42
- package/dist/cdn/chunks/{BlockPreviewCanvas-msj619wT.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-G_sZDZXw.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-CZ5Z6AgG.js → ParagraphEditor-BJJ925sx.js} +234 -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-BkQXEUE2.js → SavedBlocksBrowserModal-BerMxAUt.js} +114 -113
- package/dist/cdn/chunks/SavedBlocksBrowserModal-BerMxAUt.js.map +1 -0
- package/dist/{SavedBlocksPanels-DEPmNhi6.js → cdn/chunks/SavedBlocksPanels-BUE4lzVP.js} +11 -9
- package/dist/cdn/chunks/{SavedBlocksPanels-CUtYoi5Z.js.map → SavedBlocksPanels-BUE4lzVP.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-C80qJykl.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-DubocPxf.js → cdn/chunks/TestEmailPanel-DqTDh5ri.js} +6 -4
- package/dist/cdn/chunks/{TestEmailPanel-B8y7JabA.js.map → TestEmailPanel-DqTDh5ri.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-C8WDXf4P.js → TitleEditor-nUAF7fKr.js} +83 -83
- 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/{en-DlqX2YWZ.js → cdn/chunks/en-DbBNy67B.js} +71 -6
- 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-qhcN3RMT.js → extensions-CMcVw2uu.js} +53 -53
- package/dist/cdn/chunks/{extensions-qhcN3RMT.js.map → extensions-CMcVw2uu.js.map} +1 -1
- 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-BwbnXShT.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-CcgxY-Gy.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/{cdn/chunks/en-DlqX2YWZ.js → en-DbBNy67B.js} +69 -8
- 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-Cwg9S-0f.js → extensions-CX87G4aL.js} +42 -42
- 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-P4UkhcyS.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-Cy-PVrNT.js +0 -63
- package/dist/BlockPreviewCanvas-BZKslwGI.js +0 -121
- package/dist/CloudEditor-CPRkQCRa.js +0 -1188
- package/dist/ColorPicker-ClETsjA3.js +0 -550
- package/dist/CommentsSidebar-CdRCCSDD.js +0 -435
- package/dist/SaveBlockDialog-21vDlEBS.js +0 -265
- package/dist/SnapshotHistory-Cb4WW2gf.js +0 -128
- package/dist/TestEmailModal-BHDKmd6B.js +0 -205
- package/dist/TitleEditor-Cy4B3UNe.js +0 -198
- package/dist/TplModal-Dv9zgSWI.js +0 -49
- package/dist/cdn/chunks/AiChatSidebar-CQ8KUmNB.js.map +0 -1
- package/dist/cdn/chunks/AiFeatureMenu-Cb9gaRBn.js +0 -63
- package/dist/cdn/chunks/AiFeatureMenu-Cb9gaRBn.js.map +0 -1
- package/dist/cdn/chunks/CloudEditor-DbyEsIxu.js +0 -1166
- package/dist/cdn/chunks/CloudEditor-DbyEsIxu.js.map +0 -1
- package/dist/cdn/chunks/CollaboratorBar-G_sZDZXw.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-CZ5Z6AgG.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-DtL49Jpo.js.map +0 -1
- package/dist/cdn/chunks/SaveBlockDialog-CVIVZEuy.js +0 -264
- package/dist/cdn/chunks/SaveBlockDialog-CVIVZEuy.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-BkQXEUE2.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksPickBar-C80qJykl.js.map +0 -1
- package/dist/cdn/chunks/SnapshotHistory-DFinMrg_.js +0 -121
- package/dist/cdn/chunks/SnapshotHistory-DFinMrg_.js.map +0 -1
- package/dist/cdn/chunks/TemplateScoringPanel-NucRtAP0.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-IxS-QjeH.js +0 -205
- package/dist/cdn/chunks/TestEmailModal-IxS-QjeH.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-C8WDXf4P.js.map +0 -1
- package/dist/cdn/chunks/TplModal-Ce0QuHyo.js +0 -50
- package/dist/cdn/chunks/TplModal-Ce0QuHyo.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/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-BwbnXShT.js.map +0 -1
- package/dist/cdn/chunks/src-xkGep9eN.js.map +0 -1
- package/dist/cdn/chunks/styles-DLAfU4Uf.js +0 -4140
- package/dist/cdn/chunks/styles-DLAfU4Uf.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-CcgxY-Gy.js.map +0 -1
- package/dist/styles-Dx__pP9O.js +0 -4318
- package/dist/usePopoverPosition-C0dPEF4X.js +0 -308
|
@@ -1,55 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import "./
|
|
13
|
-
import
|
|
14
|
-
import { t as
|
|
1
|
+
import { A as e, B as t, E as n, F as r, H as i, I as a, K as o, N as s, P as c, Q as l, R as u, S as d, U as f, W as p, X as m, Y as h, Z as g, at as _, b as v, c as y, ct as b, et as x, f as S, g as C, h as w, it as T, j as E, k as D, l as O, lt as k, m as A, ot as j, p as M, q as N, rt as P, s as F, t as I, u as L, ut as R, w as z, x as B, y as V } from "./draggable-BfpsXFg7.js";
|
|
2
|
+
import { A as ee, B as te, C as ne, D as re, E as ie, F as ae, H as oe, I as se, L as H, M as ce, N as le, O as ue, P as de, R as fe, S as pe, T as me, _ as he, a as ge, b as _e, d as ve, et as ye, f as be, g as xe, h as Se, i as U, j as Ce, k as we, l as Te, m as Ee, n as De, o as Oe, p as ke, r as Ae, s as je, t as W, tt as Me, u as Ne, w as Pe, z as Fe } from "./src-B_QJduQD.js";
|
|
3
|
+
import { _ as Ie, h as Le, v as Re, y as ze } from "./dist-CYLJiSiH.js";
|
|
4
|
+
import { a as G, c as Be, i as Ve, r as He } from "./dist-CM8TB0VD.js";
|
|
5
|
+
import { A as Ue, B as We, C as Ge, D as Ke, E as qe, F as Je, H as Ye, I as Xe, M as Ze, N as Qe, O as $e, P as et, S as tt, T as K, U as q, V as nt, W as rt, _ as it, a as at, b as ot, c as st, d as ct, f as lt, g as ut, h as J, j as dt, k as ft, m as pt, n as mt, o as ht, p as gt, r as _t, s as vt, u as yt, v as bt, w as xt, x as St, y as Ct, z as wt } from "./keys-CbQuRX85.js";
|
|
6
|
+
import "./timeouts-DHPZQ0G3.js";
|
|
7
|
+
import { t as Y } from "./useI18n-DVWCJJFH.js";
|
|
8
|
+
import { t as X } from "./logger-ByvdoAwq.js";
|
|
9
|
+
import { a as Tt, i as Et, o as Dt, r as Z, t as Ot } from "./usePopoverPosition-BC-HA7TK.js";
|
|
10
|
+
import { A as kt, Bt as At, Et as jt, H as Mt, Ot as Nt, Tt as Pt, X as Ft, d as It, ft as Lt, ht as Rt, it as zt, o as Bt, s as Vt, tt as Ht, u as Ut, v as Wt, vt as Gt, zt as Kt } from "./icons-C36Ha5VU.js";
|
|
11
|
+
import { t as qt } from "./LoadingTrack-Dp_QZvAK.js";
|
|
12
|
+
import { t as Jt } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
13
|
+
import "./useCloudI18n-NVa1aeY8.js";
|
|
14
|
+
import { t as Q } from "./useMergeTag-BfZBRPQp.js";
|
|
15
|
+
import { t as Yt } from "./useAliveFlag-Dtm174fG.js";
|
|
15
16
|
//#region ../core/src/editor.ts
|
|
16
|
-
function
|
|
17
|
+
function Xt(e) {
|
|
17
18
|
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
let t =
|
|
21
|
-
|
|
20
|
+
function Zt(e) {
|
|
21
|
+
let t = m({
|
|
22
|
+
template: null,
|
|
23
|
+
content: e.content ?? fe(e.defaultFontFamily, e.templateDefaults),
|
|
22
24
|
selectedBlockId: null,
|
|
23
25
|
viewport: "desktop",
|
|
24
26
|
darkMode: !1,
|
|
25
27
|
previewMode: !1,
|
|
26
28
|
isDirty: !1,
|
|
29
|
+
isSaving: !1,
|
|
30
|
+
isLoading: !1,
|
|
27
31
|
uiTheme: "auto"
|
|
28
|
-
}), n =
|
|
32
|
+
}), n = 0;
|
|
33
|
+
function r() {
|
|
34
|
+
t.isDirty = !0, n++;
|
|
35
|
+
}
|
|
36
|
+
let i = p({
|
|
29
37
|
get: () => t.content,
|
|
30
38
|
set: (e) => {
|
|
31
|
-
t.content = e,
|
|
39
|
+
t.content = e, r();
|
|
32
40
|
}
|
|
33
|
-
}),
|
|
34
|
-
function
|
|
41
|
+
}), a = p(() => t.selectedBlockId ? o(t.content.blocks, t.selectedBlockId) : null);
|
|
42
|
+
function o(e, t) {
|
|
35
43
|
for (let n of e) {
|
|
36
44
|
if (n.id === t) return n;
|
|
37
45
|
if (n.type === "section") for (let e of n.children) {
|
|
38
|
-
let n =
|
|
46
|
+
let n = o(e, t);
|
|
39
47
|
if (n) return n;
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
return null;
|
|
43
51
|
}
|
|
44
|
-
function
|
|
45
|
-
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n)
|
|
52
|
+
function s(e, t) {
|
|
53
|
+
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) s(e, t);
|
|
46
54
|
}
|
|
47
|
-
function
|
|
55
|
+
function c(e, t, n = { blocks: e }) {
|
|
48
56
|
for (let r = 0; r < e.length; r++) {
|
|
49
57
|
let i = e[r];
|
|
50
58
|
if (i.id === t) return n;
|
|
51
59
|
if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
|
|
52
|
-
let n =
|
|
60
|
+
let n = c(i.children[e], t, {
|
|
53
61
|
blocks: i.children[e],
|
|
54
62
|
sectionId: i.id,
|
|
55
63
|
columnIndex: e
|
|
@@ -59,11 +67,11 @@ function $t(e) {
|
|
|
59
67
|
}
|
|
60
68
|
return null;
|
|
61
69
|
}
|
|
62
|
-
function
|
|
70
|
+
function l(t) {
|
|
63
71
|
return e.lockedBlocks?.value.has(t) ?? !1;
|
|
64
72
|
}
|
|
65
|
-
function
|
|
66
|
-
let n =
|
|
73
|
+
function u(e) {
|
|
74
|
+
let n = c(t.content.blocks, e);
|
|
67
75
|
if (!n) return null;
|
|
68
76
|
let r = n.blocks.findIndex((t) => t.id === e);
|
|
69
77
|
return r === -1 ? null : {
|
|
@@ -72,200 +80,275 @@ function $t(e) {
|
|
|
72
80
|
index: r
|
|
73
81
|
};
|
|
74
82
|
}
|
|
75
|
-
function
|
|
76
|
-
t.content = e, n && (
|
|
83
|
+
function d(e, n = !0) {
|
|
84
|
+
t.content = e, n && r();
|
|
77
85
|
}
|
|
78
|
-
function
|
|
79
|
-
e &&
|
|
86
|
+
function f(e) {
|
|
87
|
+
e && l(e) || (t.selectedBlockId = e);
|
|
80
88
|
}
|
|
81
|
-
function
|
|
89
|
+
function h(e) {
|
|
82
90
|
t.viewport = e;
|
|
83
91
|
}
|
|
84
|
-
function
|
|
92
|
+
function _(e) {
|
|
85
93
|
t.darkMode = e;
|
|
86
94
|
}
|
|
87
|
-
function
|
|
95
|
+
function v(e) {
|
|
88
96
|
t.uiTheme = e;
|
|
89
97
|
}
|
|
90
|
-
function
|
|
98
|
+
function y(e) {
|
|
91
99
|
t.previewMode = e, e && (t.selectedBlockId = null);
|
|
92
100
|
}
|
|
93
|
-
function
|
|
94
|
-
if (
|
|
95
|
-
let
|
|
96
|
-
|
|
101
|
+
function b(e, n) {
|
|
102
|
+
if (l(e)) return;
|
|
103
|
+
let i = o(t.content.blocks, e);
|
|
104
|
+
i && (Object.assign(i, n), r());
|
|
97
105
|
}
|
|
98
|
-
function
|
|
106
|
+
function x(e) {
|
|
99
107
|
t.content.settings = {
|
|
100
108
|
...t.content.settings,
|
|
101
109
|
...e
|
|
102
|
-
},
|
|
110
|
+
}, r();
|
|
103
111
|
}
|
|
104
|
-
function
|
|
112
|
+
function S(e, n, i = 0, a) {
|
|
105
113
|
if (!(n && e.type === "section")) {
|
|
106
114
|
if (n) {
|
|
107
|
-
if (
|
|
108
|
-
let
|
|
109
|
-
if (
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
let t =
|
|
115
|
+
if (l(n)) return;
|
|
116
|
+
let r = o(t.content.blocks, n);
|
|
117
|
+
if (r && r.type === "section") {
|
|
118
|
+
if (i < 0 || i >= Xt(r.columns)) return;
|
|
119
|
+
r.children[i] = r.children[i] || [];
|
|
120
|
+
let t = r.children[i];
|
|
113
121
|
a !== void 0 && a < t.length ? t.splice(a, 0, e) : t.push(e);
|
|
114
122
|
}
|
|
115
123
|
} else a !== void 0 && a < t.content.blocks.length ? t.content.blocks.splice(a, 0, e) : t.content.blocks.push(e);
|
|
116
|
-
|
|
124
|
+
r();
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
|
-
function
|
|
120
|
-
if (
|
|
121
|
-
let n =
|
|
127
|
+
function C(e) {
|
|
128
|
+
if (l(e)) return;
|
|
129
|
+
let n = c(t.content.blocks, e);
|
|
122
130
|
if (n) {
|
|
123
|
-
let
|
|
124
|
-
if (
|
|
125
|
-
let [e] = n.blocks.splice(
|
|
131
|
+
let i = n.blocks.findIndex((t) => t.id === e);
|
|
132
|
+
if (i !== -1) {
|
|
133
|
+
let [e] = n.blocks.splice(i, 1);
|
|
126
134
|
if (t.selectedBlockId) {
|
|
127
135
|
let n = /* @__PURE__ */ new Set();
|
|
128
|
-
|
|
136
|
+
s(e, n), n.has(t.selectedBlockId) && (t.selectedBlockId = null);
|
|
129
137
|
}
|
|
130
|
-
|
|
138
|
+
r();
|
|
131
139
|
}
|
|
132
140
|
}
|
|
133
141
|
}
|
|
134
|
-
function
|
|
135
|
-
if (
|
|
136
|
-
let
|
|
137
|
-
if (!
|
|
138
|
-
let
|
|
139
|
-
if (
|
|
140
|
-
let
|
|
141
|
-
if (
|
|
142
|
-
let e =
|
|
143
|
-
if (!e || e.type !== "section" || a < 0 || a >=
|
|
144
|
-
e.children[a] = e.children[a] || [],
|
|
145
|
-
} else
|
|
146
|
-
let [
|
|
147
|
-
|
|
142
|
+
function w(e, n, i, a = 0) {
|
|
143
|
+
if (l(e) || i && l(i)) return;
|
|
144
|
+
let s = c(t.content.blocks, e);
|
|
145
|
+
if (!s) return;
|
|
146
|
+
let u = s.blocks.findIndex((t) => t.id === e);
|
|
147
|
+
if (u === -1 || i && s.blocks[u].type === "section") return;
|
|
148
|
+
let d;
|
|
149
|
+
if (i) {
|
|
150
|
+
let e = o(t.content.blocks, i);
|
|
151
|
+
if (!e || e.type !== "section" || a < 0 || a >= Xt(e.columns)) return;
|
|
152
|
+
e.children[a] = e.children[a] || [], d = e.children[a];
|
|
153
|
+
} else d = t.content.blocks;
|
|
154
|
+
let [f] = s.blocks.splice(u, 1);
|
|
155
|
+
d.splice(n, 0, f), r();
|
|
156
|
+
}
|
|
157
|
+
function T() {
|
|
158
|
+
r();
|
|
159
|
+
}
|
|
160
|
+
function E(e, t) {
|
|
161
|
+
throw new W(`[Templatical] Templates: ${e} ${t}`);
|
|
162
|
+
}
|
|
163
|
+
function D(t) {
|
|
164
|
+
let { templates: n } = e;
|
|
165
|
+
return n || E(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
166
|
+
}
|
|
167
|
+
function O(e) {
|
|
168
|
+
t.template && (t.template = {
|
|
169
|
+
...t.template,
|
|
170
|
+
name: e
|
|
171
|
+
}, r());
|
|
172
|
+
}
|
|
173
|
+
async function k(r) {
|
|
174
|
+
let { create: i } = D("create()");
|
|
175
|
+
typeof i != "function" && E("create()", "is disabled by the provider — its `create` is `false`."), t.isLoading = !0;
|
|
176
|
+
try {
|
|
177
|
+
r?.content && (t.content = r.content);
|
|
178
|
+
let e = n, a = await i(r?.name === void 0 ? { content: t.content } : {
|
|
179
|
+
name: r.name,
|
|
180
|
+
content: t.content
|
|
181
|
+
});
|
|
182
|
+
return t.template = a, n === e && (t.isDirty = !1), a;
|
|
183
|
+
} catch (t) {
|
|
184
|
+
throw e.onError?.(t), t;
|
|
185
|
+
} finally {
|
|
186
|
+
t.isLoading = !1;
|
|
187
|
+
}
|
|
148
188
|
}
|
|
149
|
-
function
|
|
150
|
-
|
|
189
|
+
async function A(n) {
|
|
190
|
+
let r = D("load()");
|
|
191
|
+
t.isLoading = !0;
|
|
192
|
+
try {
|
|
193
|
+
let e = await r.load(n);
|
|
194
|
+
return t.template = e, t.content = e.content, t.isDirty = !1, e;
|
|
195
|
+
} catch (t) {
|
|
196
|
+
throw e.onError?.(t), t;
|
|
197
|
+
} finally {
|
|
198
|
+
t.isLoading = !1;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
async function j() {
|
|
202
|
+
let { save: r } = D("save()");
|
|
203
|
+
typeof r != "function" && E("save()", "is disabled by the provider — its `save` is `false`.");
|
|
204
|
+
let i = t.template;
|
|
205
|
+
i || E("save()", "has no template loaded. Call create() or load() first.");
|
|
206
|
+
let a = i.name === void 0 ? { content: t.content } : {
|
|
207
|
+
name: i.name,
|
|
208
|
+
content: t.content
|
|
209
|
+
};
|
|
210
|
+
t.isSaving = !0;
|
|
211
|
+
try {
|
|
212
|
+
let e = n, o = await r(i.id, a);
|
|
213
|
+
if (t.template?.id === i.id) {
|
|
214
|
+
let e = t.template.name;
|
|
215
|
+
t.template = e === i.name ? o : {
|
|
216
|
+
...o,
|
|
217
|
+
name: e
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
return n === e && (t.isDirty = !1), o;
|
|
221
|
+
} catch (t) {
|
|
222
|
+
throw e.onError?.(t), t;
|
|
223
|
+
} finally {
|
|
224
|
+
t.isSaving = !1;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function M() {
|
|
228
|
+
return t.template?.id !== void 0;
|
|
151
229
|
}
|
|
152
230
|
return {
|
|
153
231
|
state: g(t),
|
|
154
|
-
content:
|
|
155
|
-
selectedBlock:
|
|
156
|
-
isBlockLocked:
|
|
157
|
-
setContent:
|
|
158
|
-
selectBlock:
|
|
159
|
-
setViewport:
|
|
160
|
-
setDarkMode:
|
|
161
|
-
setUiTheme:
|
|
162
|
-
setPreviewMode:
|
|
163
|
-
updateBlock:
|
|
164
|
-
updateSettings:
|
|
165
|
-
addBlock:
|
|
166
|
-
removeBlock:
|
|
167
|
-
moveBlock:
|
|
168
|
-
markDirty:
|
|
169
|
-
findBlockLocation:
|
|
232
|
+
content: i,
|
|
233
|
+
selectedBlock: a,
|
|
234
|
+
isBlockLocked: l,
|
|
235
|
+
setContent: d,
|
|
236
|
+
selectBlock: f,
|
|
237
|
+
setViewport: h,
|
|
238
|
+
setDarkMode: _,
|
|
239
|
+
setUiTheme: v,
|
|
240
|
+
setPreviewMode: y,
|
|
241
|
+
updateBlock: b,
|
|
242
|
+
updateSettings: x,
|
|
243
|
+
addBlock: S,
|
|
244
|
+
removeBlock: C,
|
|
245
|
+
moveBlock: w,
|
|
246
|
+
markDirty: T,
|
|
247
|
+
findBlockLocation: u,
|
|
248
|
+
setName: O,
|
|
249
|
+
create: k,
|
|
250
|
+
load: A,
|
|
251
|
+
save: j,
|
|
252
|
+
hasTemplate: M
|
|
170
253
|
};
|
|
171
254
|
}
|
|
172
255
|
//#endregion
|
|
173
256
|
//#region ../core/src/history.ts
|
|
174
|
-
var
|
|
175
|
-
function
|
|
176
|
-
let { content: t, setContent: n, isRemoteOperation: r, maxSize: i =
|
|
177
|
-
function
|
|
178
|
-
return
|
|
257
|
+
var Qt = 50, $t = 300, en = 1500;
|
|
258
|
+
function tn(e) {
|
|
259
|
+
let { content: t, setContent: n, isRemoteOperation: r, maxSize: i = Qt } = e, a = l([]), o = l([]), s = l(!1), c = null, u = null, d = p(() => a.value.length > 0), f = p(() => o.value.length > 0);
|
|
260
|
+
function m() {
|
|
261
|
+
return _e(t.value);
|
|
179
262
|
}
|
|
180
|
-
function
|
|
263
|
+
function h(e) {
|
|
181
264
|
a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
|
|
182
265
|
}
|
|
183
|
-
function h() {
|
|
184
|
-
l &&= (clearTimeout(l.timeoutId), null);
|
|
185
|
-
}
|
|
186
266
|
function g() {
|
|
187
|
-
|
|
267
|
+
u &&= (clearTimeout(u.timeoutId), null);
|
|
188
268
|
}
|
|
189
|
-
function _(
|
|
269
|
+
function _() {
|
|
270
|
+
r?.() || (g(), h(m()), o.value = []);
|
|
271
|
+
}
|
|
272
|
+
function v(e) {
|
|
190
273
|
if (!r?.()) {
|
|
191
|
-
if (
|
|
192
|
-
clearTimeout(
|
|
193
|
-
|
|
194
|
-
},
|
|
274
|
+
if (u && u.blockId === e) {
|
|
275
|
+
clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
|
|
276
|
+
u = null;
|
|
277
|
+
}, $t);
|
|
195
278
|
return;
|
|
196
279
|
}
|
|
197
|
-
|
|
280
|
+
g(), h(m()), o.value = [], u = {
|
|
198
281
|
blockId: e,
|
|
199
282
|
timeoutId: setTimeout(() => {
|
|
200
|
-
|
|
201
|
-
},
|
|
283
|
+
u = null;
|
|
284
|
+
}, $t)
|
|
202
285
|
};
|
|
203
286
|
}
|
|
204
287
|
}
|
|
205
288
|
function y() {
|
|
206
289
|
s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
|
|
207
290
|
s.value = !1, c = null;
|
|
208
|
-
},
|
|
291
|
+
}, en);
|
|
209
292
|
}
|
|
210
293
|
function b() {
|
|
211
294
|
if (a.value.length === 0) return;
|
|
212
|
-
|
|
295
|
+
g();
|
|
213
296
|
let e = a.value.pop();
|
|
214
|
-
o.value.push(
|
|
297
|
+
o.value.push(m()), n(e, !0), y();
|
|
215
298
|
}
|
|
216
299
|
function x() {
|
|
217
300
|
if (o.value.length === 0) return;
|
|
218
|
-
|
|
301
|
+
g();
|
|
219
302
|
let e = o.value.pop();
|
|
220
|
-
a.value.push(
|
|
303
|
+
a.value.push(m()), n(e, !0), y();
|
|
221
304
|
}
|
|
222
305
|
function S() {
|
|
223
|
-
a.value = [], o.value = [],
|
|
306
|
+
a.value = [], o.value = [], g();
|
|
224
307
|
}
|
|
225
308
|
function C() {
|
|
226
309
|
S(), c &&= (clearTimeout(c), null);
|
|
227
310
|
}
|
|
228
311
|
return {
|
|
229
|
-
canUndo:
|
|
230
|
-
canRedo:
|
|
312
|
+
canUndo: d,
|
|
313
|
+
canRedo: f,
|
|
231
314
|
isNavigating: s,
|
|
232
315
|
undo: b,
|
|
233
316
|
redo: x,
|
|
234
|
-
record:
|
|
235
|
-
recordDebounced:
|
|
317
|
+
record: _,
|
|
318
|
+
recordDebounced: v,
|
|
236
319
|
clear: S,
|
|
237
320
|
destroy: C
|
|
238
321
|
};
|
|
239
322
|
}
|
|
240
323
|
//#endregion
|
|
241
324
|
//#region ../core/src/block-actions.ts
|
|
242
|
-
function
|
|
325
|
+
function nn(e) {
|
|
243
326
|
e.type === "table" ? e.rows = e.rows.map((e) => ({
|
|
244
327
|
...e,
|
|
245
|
-
id:
|
|
328
|
+
id: H(),
|
|
246
329
|
cells: e.cells.map((e) => ({
|
|
247
330
|
...e,
|
|
248
|
-
id:
|
|
331
|
+
id: H()
|
|
249
332
|
}))
|
|
250
333
|
})) : e.type === "social" ? e.icons = e.icons.map((e) => ({
|
|
251
334
|
...e,
|
|
252
|
-
id:
|
|
335
|
+
id: H()
|
|
253
336
|
})) : e.type === "menu" && (e.items = e.items.map((e) => ({
|
|
254
337
|
...e,
|
|
255
|
-
id:
|
|
338
|
+
id: H()
|
|
256
339
|
})));
|
|
257
340
|
}
|
|
258
|
-
function
|
|
341
|
+
function rn(e) {
|
|
259
342
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
260
343
|
function o(n, r, a) {
|
|
261
|
-
let o =
|
|
344
|
+
let o = pe(n, e.blockDefaults);
|
|
262
345
|
return t(o, r, a), i(o.id), o;
|
|
263
346
|
}
|
|
264
347
|
function s(e, n, r) {
|
|
265
348
|
let o = JSON.parse(JSON.stringify(e));
|
|
266
|
-
if (o.id =
|
|
349
|
+
if (o.id = H(), nn(o), o.type === "section" && (o.children = o.children.map((e) => e.map((e) => {
|
|
267
350
|
let t = JSON.parse(JSON.stringify(e));
|
|
268
|
-
return t.id =
|
|
351
|
+
return t.id = H(), nn(t), t;
|
|
269
352
|
}))), n !== void 0 || r !== void 0) t(o, n, r);
|
|
270
353
|
else {
|
|
271
354
|
let i = a?.(e.id) ?? null;
|
|
@@ -288,8 +371,9 @@ function on(e) {
|
|
|
288
371
|
}
|
|
289
372
|
//#endregion
|
|
290
373
|
//#region ../core/src/auto-save.ts
|
|
291
|
-
|
|
292
|
-
|
|
374
|
+
var an = 2e3;
|
|
375
|
+
function on(e) {
|
|
376
|
+
let { content: t, isDirty: n, onChange: r, debounce: i = an, enabled: a = !0 } = e, o = null, s = !1;
|
|
293
377
|
function c() {
|
|
294
378
|
return typeof a == "function" ? a() : a;
|
|
295
379
|
}
|
|
@@ -310,7 +394,7 @@ function sn(e) {
|
|
|
310
394
|
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
311
395
|
}, i));
|
|
312
396
|
}
|
|
313
|
-
let m =
|
|
397
|
+
let m = j(t, () => {
|
|
314
398
|
p();
|
|
315
399
|
}, { deep: !0 });
|
|
316
400
|
function h() {
|
|
@@ -326,8 +410,8 @@ function sn(e) {
|
|
|
326
410
|
}
|
|
327
411
|
//#endregion
|
|
328
412
|
//#region ../core/src/condition-preview.ts
|
|
329
|
-
function
|
|
330
|
-
let t =
|
|
413
|
+
function sn(e) {
|
|
414
|
+
let t = m(/* @__PURE__ */ new Set()), n = p(() => t.size > 0);
|
|
331
415
|
function r(e) {
|
|
332
416
|
return t.has(e);
|
|
333
417
|
}
|
|
@@ -346,8 +430,8 @@ function cn(e) {
|
|
|
346
430
|
}
|
|
347
431
|
//#endregion
|
|
348
432
|
//#region ../core/src/data-source-fetch.ts
|
|
349
|
-
function
|
|
350
|
-
let t =
|
|
433
|
+
function cn(e) {
|
|
434
|
+
let t = l(!1), n = l(!1), r = p(() => !!e.definition.value?.dataSource), i = p(() => r.value && !e.block.value.dataSourceFetched);
|
|
351
435
|
async function a() {
|
|
352
436
|
let r = e.definition.value;
|
|
353
437
|
if (r?.dataSource) {
|
|
@@ -378,7 +462,7 @@ function ln(e) {
|
|
|
378
462
|
}
|
|
379
463
|
//#endregion
|
|
380
464
|
//#region ../core/src/history-interceptor.ts
|
|
381
|
-
function
|
|
465
|
+
function ln(e, t) {
|
|
382
466
|
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
383
467
|
e.addBlock = (r, i, a, o) => {
|
|
384
468
|
i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
|
|
@@ -394,25 +478,25 @@ function un(e, t) {
|
|
|
394
478
|
}
|
|
395
479
|
//#endregion
|
|
396
480
|
//#region ../core/src/saved-blocks.ts
|
|
397
|
-
function
|
|
398
|
-
let { provider: t } = e, n =
|
|
481
|
+
function un(e) {
|
|
482
|
+
let { provider: t } = e, n = l([]), r = l(!1), i = S(() => {
|
|
399
483
|
let e = /* @__PURE__ */ new Set();
|
|
400
484
|
for (let t of n.value) {
|
|
401
485
|
let n = t.category?.trim();
|
|
402
486
|
n && e.add(n);
|
|
403
487
|
}
|
|
404
488
|
return [...e].sort((e, t) => e.localeCompare(t));
|
|
405
|
-
}), a =
|
|
489
|
+
}), a = S(() => typeof t.create == "function"), o = S(() => typeof t.update == "function"), s = S(() => typeof t.delete == "function");
|
|
406
490
|
function c(e) {
|
|
407
491
|
return o.value && e.canUpdate !== !1;
|
|
408
492
|
}
|
|
409
|
-
function
|
|
493
|
+
function u(e) {
|
|
410
494
|
return s.value && e.canDelete !== !1;
|
|
411
495
|
}
|
|
412
|
-
function
|
|
413
|
-
throw new
|
|
496
|
+
function d(e, t) {
|
|
497
|
+
throw new W(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
414
498
|
}
|
|
415
|
-
async function
|
|
499
|
+
async function f(i) {
|
|
416
500
|
r.value = !0;
|
|
417
501
|
try {
|
|
418
502
|
n.value = await t.list(i);
|
|
@@ -422,9 +506,9 @@ function dn(e) {
|
|
|
422
506
|
r.value = !1;
|
|
423
507
|
}
|
|
424
508
|
}
|
|
425
|
-
async function
|
|
509
|
+
async function p(r, i, a) {
|
|
426
510
|
let { create: o } = t;
|
|
427
|
-
typeof o != "function" &&
|
|
511
|
+
typeof o != "function" && d("create", "disabled by the provider");
|
|
428
512
|
try {
|
|
429
513
|
let e = await o(a ? {
|
|
430
514
|
name: r,
|
|
@@ -439,11 +523,11 @@ function dn(e) {
|
|
|
439
523
|
throw e.onError?.(t), t;
|
|
440
524
|
}
|
|
441
525
|
}
|
|
442
|
-
async function
|
|
526
|
+
async function m(r, i) {
|
|
443
527
|
let { update: a } = t;
|
|
444
|
-
typeof a != "function" &&
|
|
528
|
+
typeof a != "function" && d("update", "disabled by the provider");
|
|
445
529
|
let o = n.value.find((e) => e.id === r);
|
|
446
|
-
o && o.canUpdate === !1 &&
|
|
530
|
+
o && o.canUpdate === !1 && d("update", `not permitted for entry "${r}"`);
|
|
447
531
|
try {
|
|
448
532
|
let e = await a(r, i);
|
|
449
533
|
return n.value = n.value.map((t) => t.id === r ? e : t), e;
|
|
@@ -451,11 +535,11 @@ function dn(e) {
|
|
|
451
535
|
throw e.onError?.(t), t;
|
|
452
536
|
}
|
|
453
537
|
}
|
|
454
|
-
async function
|
|
538
|
+
async function h(r) {
|
|
455
539
|
let { delete: i } = t;
|
|
456
|
-
typeof i != "function" &&
|
|
540
|
+
typeof i != "function" && d("delete", "disabled by the provider");
|
|
457
541
|
let a = n.value.find((e) => e.id === r);
|
|
458
|
-
a && a.canDelete === !1 &&
|
|
542
|
+
a && a.canDelete === !1 && d("delete", `not permitted for entry "${r}"`);
|
|
459
543
|
try {
|
|
460
544
|
await i(r), n.value = n.value.filter((e) => e.id !== r);
|
|
461
545
|
} catch (t) {
|
|
@@ -470,18 +554,18 @@ function dn(e) {
|
|
|
470
554
|
canUpdate: o,
|
|
471
555
|
canDelete: s,
|
|
472
556
|
canUpdateBlock: c,
|
|
473
|
-
canDeleteBlock:
|
|
474
|
-
load:
|
|
475
|
-
create:
|
|
476
|
-
update:
|
|
477
|
-
remove:
|
|
557
|
+
canDeleteBlock: u,
|
|
558
|
+
load: f,
|
|
559
|
+
create: p,
|
|
560
|
+
update: m,
|
|
561
|
+
remove: h
|
|
478
562
|
};
|
|
479
563
|
}
|
|
480
564
|
//#endregion
|
|
481
565
|
//#region ../core/src/saved-blocks-local.ts
|
|
482
|
-
var
|
|
483
|
-
function
|
|
484
|
-
let t = e.key ??
|
|
566
|
+
var dn = "templatical:saved-blocks";
|
|
567
|
+
function fn(e = {}) {
|
|
568
|
+
let t = e.key ?? dn;
|
|
485
569
|
function n() {
|
|
486
570
|
if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
|
|
487
571
|
return localStorage;
|
|
@@ -506,7 +590,7 @@ function pn(e = {}) {
|
|
|
506
590
|
},
|
|
507
591
|
async create(e) {
|
|
508
592
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
509
|
-
id:
|
|
593
|
+
id: H(),
|
|
510
594
|
name: e.name,
|
|
511
595
|
content: e.content,
|
|
512
596
|
...e.category ? { category: e.category } : {},
|
|
@@ -533,88 +617,364 @@ function pn(e = {}) {
|
|
|
533
617
|
};
|
|
534
618
|
}
|
|
535
619
|
//#endregion
|
|
620
|
+
//#region ../core/src/version-history.ts
|
|
621
|
+
function pn(e) {
|
|
622
|
+
let { provider: t, getTemplateId: n } = e, r = l([]), i = l(!1), a = l(void 0), o = l(!1), s = /* @__PURE__ */ new Map(), c = S(() => typeof t.create == "function"), u = S(() => typeof t.restore == "function");
|
|
623
|
+
function d(e) {
|
|
624
|
+
let t = n();
|
|
625
|
+
if (!t) throw new W(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
626
|
+
return t;
|
|
627
|
+
}
|
|
628
|
+
function f(e) {
|
|
629
|
+
throw new W(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
630
|
+
}
|
|
631
|
+
async function p(n) {
|
|
632
|
+
let o = d("list");
|
|
633
|
+
i.value = !0;
|
|
634
|
+
try {
|
|
635
|
+
let e = await t.list(o, n);
|
|
636
|
+
r.value = e.versions, a.value = e.nextCursor;
|
|
637
|
+
} catch (t) {
|
|
638
|
+
throw e.onError?.(t), t;
|
|
639
|
+
} finally {
|
|
640
|
+
i.value = !1;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function m(e) {
|
|
644
|
+
return e.content ?? s.get(e.id) ?? null;
|
|
645
|
+
}
|
|
646
|
+
async function h(n) {
|
|
647
|
+
let r = m(n);
|
|
648
|
+
if (r) return r;
|
|
649
|
+
let i = d("get");
|
|
650
|
+
try {
|
|
651
|
+
let e = await t.get(i, n.id);
|
|
652
|
+
return s.set(n.id, e), e;
|
|
653
|
+
} catch (t) {
|
|
654
|
+
throw e.onError?.(t), t;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
async function g(n, i) {
|
|
658
|
+
let { create: a } = t;
|
|
659
|
+
typeof a != "function" && f("create");
|
|
660
|
+
let o = d("create");
|
|
661
|
+
try {
|
|
662
|
+
let e = await a(o, n, i);
|
|
663
|
+
return r.value = [e, ...r.value], e;
|
|
664
|
+
} catch (t) {
|
|
665
|
+
throw e.onError?.(t), t;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
async function _(n) {
|
|
669
|
+
let { restore: r } = t;
|
|
670
|
+
typeof r != "function" && f("restore");
|
|
671
|
+
let i = d("restore");
|
|
672
|
+
o.value = !0;
|
|
673
|
+
try {
|
|
674
|
+
return await r(i, n);
|
|
675
|
+
} catch (t) {
|
|
676
|
+
throw e.onError?.(t), t;
|
|
677
|
+
} finally {
|
|
678
|
+
o.value = !1;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return {
|
|
682
|
+
nextCursor: a,
|
|
683
|
+
versions: r,
|
|
684
|
+
isLoading: i,
|
|
685
|
+
isRestoring: o,
|
|
686
|
+
canCreate: c,
|
|
687
|
+
canRestore: u,
|
|
688
|
+
load: p,
|
|
689
|
+
peekContent: m,
|
|
690
|
+
resolveContent: h,
|
|
691
|
+
create: g,
|
|
692
|
+
restore: _
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
//#endregion
|
|
696
|
+
//#region ../core/src/comments.ts
|
|
697
|
+
function mn(e) {
|
|
698
|
+
let { provider: t, getTemplateId: n, getUser: r } = e, i = l([]), a = l(!1), o = l(!1), s = S(() => typeof t.create == "function"), c = S(() => typeof t.update == "function"), u = S(() => typeof t.delete == "function"), d = S(() => typeof t.setResolved == "function"), f = S(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), p = S(() => i.value.filter((e) => !e.resolvedAt).length), m = S(() => {
|
|
699
|
+
let e = /* @__PURE__ */ new Map();
|
|
700
|
+
for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
|
|
701
|
+
return e;
|
|
702
|
+
});
|
|
703
|
+
function h(e) {
|
|
704
|
+
let t = n();
|
|
705
|
+
if (!t) throw new W(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
706
|
+
return t;
|
|
707
|
+
}
|
|
708
|
+
function g(e) {
|
|
709
|
+
let t = r();
|
|
710
|
+
if (!t) throw new W(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
711
|
+
return t;
|
|
712
|
+
}
|
|
713
|
+
function _(e) {
|
|
714
|
+
throw new W(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
715
|
+
}
|
|
716
|
+
function v(e) {
|
|
717
|
+
for (let t of i.value) {
|
|
718
|
+
if (t.id === e) return t;
|
|
719
|
+
for (let n of t.replies ?? []) if (n.id === e) return n;
|
|
720
|
+
}
|
|
721
|
+
return null;
|
|
722
|
+
}
|
|
723
|
+
function y(e) {
|
|
724
|
+
let t = r();
|
|
725
|
+
return t !== null && e.author.id === t.id;
|
|
726
|
+
}
|
|
727
|
+
function b(t, n) {
|
|
728
|
+
e.onComment?.({
|
|
729
|
+
type: t,
|
|
730
|
+
comment: n
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
function x(t) {
|
|
734
|
+
let n = t instanceof Error ? t : Error(String(t), { cause: t });
|
|
735
|
+
throw e.onError?.(n), n;
|
|
736
|
+
}
|
|
737
|
+
function C(e, t, n) {
|
|
738
|
+
return [
|
|
739
|
+
...e.slice(0, t),
|
|
740
|
+
n,
|
|
741
|
+
...e.slice(t + 1)
|
|
742
|
+
];
|
|
743
|
+
}
|
|
744
|
+
function w(e) {
|
|
745
|
+
if (e.parentId) {
|
|
746
|
+
i.value = i.value.map((t) => {
|
|
747
|
+
if (t.id !== e.parentId) return t;
|
|
748
|
+
let n = t.replies ?? [], r = n.findIndex((t) => t.id === e.id);
|
|
749
|
+
return {
|
|
750
|
+
...t,
|
|
751
|
+
replies: r === -1 ? [...n, e] : C(n, r, e)
|
|
752
|
+
};
|
|
753
|
+
});
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
let t = i.value.findIndex((t) => t.id === e.id);
|
|
757
|
+
if (t === -1) {
|
|
758
|
+
i.value = [...i.value, e];
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
i.value = C(i.value, t, {
|
|
762
|
+
...e,
|
|
763
|
+
replies: e.replies ?? i.value[t].replies
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
function T(e, t) {
|
|
767
|
+
let n = v(e), r = t ?? n?.parentId ?? null;
|
|
768
|
+
return r ? i.value = i.value.map((t) => t.id === r ? {
|
|
769
|
+
...t,
|
|
770
|
+
replies: (t.replies ?? []).filter((t) => t.id !== e)
|
|
771
|
+
} : t) : i.value = i.value.filter((t) => t.id !== e), n;
|
|
772
|
+
}
|
|
773
|
+
async function E(e) {
|
|
774
|
+
let n = h("list");
|
|
775
|
+
a.value = !0;
|
|
776
|
+
try {
|
|
777
|
+
i.value = await t.list(n, e);
|
|
778
|
+
} catch (e) {
|
|
779
|
+
x(e);
|
|
780
|
+
} finally {
|
|
781
|
+
a.value = !1;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
async function D(e) {
|
|
785
|
+
let { create: n } = t;
|
|
786
|
+
typeof n != "function" && _("create");
|
|
787
|
+
let r = h("create");
|
|
788
|
+
g("create"), o.value = !0;
|
|
789
|
+
try {
|
|
790
|
+
let t = await n(r, e);
|
|
791
|
+
return w(t), b("created", t), t;
|
|
792
|
+
} catch (e) {
|
|
793
|
+
x(e);
|
|
794
|
+
} finally {
|
|
795
|
+
o.value = !1;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
async function O(e, n) {
|
|
799
|
+
let { update: r } = t;
|
|
800
|
+
typeof r != "function" && _("update");
|
|
801
|
+
let i = h("update");
|
|
802
|
+
g("update"), o.value = !0;
|
|
803
|
+
try {
|
|
804
|
+
let t = await r(i, e, n);
|
|
805
|
+
return w(t), b("updated", t), t;
|
|
806
|
+
} catch (e) {
|
|
807
|
+
x(e);
|
|
808
|
+
} finally {
|
|
809
|
+
o.value = !1;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
async function k(e) {
|
|
813
|
+
let { delete: n } = t;
|
|
814
|
+
typeof n != "function" && _("delete");
|
|
815
|
+
let r = h("delete");
|
|
816
|
+
g("delete");
|
|
817
|
+
let i = v(e);
|
|
818
|
+
o.value = !0;
|
|
819
|
+
try {
|
|
820
|
+
await n(r, e), T(e), i && b("deleted", i);
|
|
821
|
+
} catch (e) {
|
|
822
|
+
x(e);
|
|
823
|
+
} finally {
|
|
824
|
+
o.value = !1;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
async function A(e, n) {
|
|
828
|
+
let { setResolved: r } = t;
|
|
829
|
+
typeof r != "function" && _("setResolved");
|
|
830
|
+
let i = h("setResolved");
|
|
831
|
+
g("setResolved"), o.value = !0;
|
|
832
|
+
try {
|
|
833
|
+
let t = await r(i, e, n);
|
|
834
|
+
return w(t), b(t.resolvedAt ? "resolved" : "unresolved", t), t;
|
|
835
|
+
} catch (e) {
|
|
836
|
+
x(e);
|
|
837
|
+
} finally {
|
|
838
|
+
o.value = !1;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
function j(e) {
|
|
842
|
+
w(e), b("created", e);
|
|
843
|
+
}
|
|
844
|
+
function M(e) {
|
|
845
|
+
w(e), b(e.resolvedAt ? "resolved" : "updated", e);
|
|
846
|
+
}
|
|
847
|
+
function N(e, t) {
|
|
848
|
+
let n = T(e, t);
|
|
849
|
+
n && b("deleted", n);
|
|
850
|
+
}
|
|
851
|
+
return {
|
|
852
|
+
comments: i,
|
|
853
|
+
isLoading: a,
|
|
854
|
+
isSubmitting: o,
|
|
855
|
+
canCreate: s,
|
|
856
|
+
canUpdate: c,
|
|
857
|
+
canDelete: u,
|
|
858
|
+
canResolve: d,
|
|
859
|
+
totalCount: f,
|
|
860
|
+
unresolvedCount: p,
|
|
861
|
+
commentCountByBlock: m,
|
|
862
|
+
load: E,
|
|
863
|
+
create: D,
|
|
864
|
+
update: O,
|
|
865
|
+
remove: k,
|
|
866
|
+
setResolved: A,
|
|
867
|
+
find: v,
|
|
868
|
+
isOwn: y,
|
|
869
|
+
applyRemoteCreate: j,
|
|
870
|
+
applyRemoteUpdate: M,
|
|
871
|
+
applyRemoteDelete: N
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
function hn(e) {
|
|
875
|
+
let { comments: n, provider: r, getTemplateId: i } = e, { subscribe: a } = r;
|
|
876
|
+
if (typeof a != "function") return;
|
|
877
|
+
let o = null;
|
|
878
|
+
function s() {
|
|
879
|
+
o?.(), o = null;
|
|
880
|
+
}
|
|
881
|
+
t(() => i(), (e) => {
|
|
882
|
+
s(), e && (o = a(e, (e) => {
|
|
883
|
+
switch (e.type) {
|
|
884
|
+
case "created":
|
|
885
|
+
n.applyRemoteCreate(e.comment);
|
|
886
|
+
break;
|
|
887
|
+
case "updated":
|
|
888
|
+
n.applyRemoteUpdate(e.comment);
|
|
889
|
+
break;
|
|
890
|
+
case "deleted": n.applyRemoteDelete(e.commentId, e.parentId);
|
|
891
|
+
}
|
|
892
|
+
}));
|
|
893
|
+
}, { immediate: !0 }), h(s);
|
|
894
|
+
}
|
|
895
|
+
//#endregion
|
|
536
896
|
//#region src/utils/activeEditorTracker.ts
|
|
537
|
-
var
|
|
538
|
-
function
|
|
539
|
-
let e = ++
|
|
540
|
-
return
|
|
897
|
+
var gn = /* @__PURE__ */ new Set(), $ = 0, _n = 0;
|
|
898
|
+
function vn() {
|
|
899
|
+
let e = ++_n;
|
|
900
|
+
return gn.add(e), $ === 0 && ($ = e), {
|
|
541
901
|
id: e,
|
|
542
|
-
isActive: () =>
|
|
902
|
+
isActive: () => gn.size <= 1 || $ === e,
|
|
543
903
|
claim: () => {
|
|
544
|
-
|
|
904
|
+
$ = e;
|
|
545
905
|
},
|
|
546
906
|
dispose: () => {
|
|
547
|
-
if (
|
|
548
|
-
let e = Array.from(
|
|
549
|
-
|
|
907
|
+
if (gn.delete(e), $ === e) {
|
|
908
|
+
let e = Array.from(gn);
|
|
909
|
+
$ = e[e.length - 1] ?? 0;
|
|
550
910
|
}
|
|
551
911
|
}
|
|
552
912
|
};
|
|
553
913
|
}
|
|
554
914
|
//#endregion
|
|
555
915
|
//#region src/composables/usePreviewResolution.ts
|
|
556
|
-
var
|
|
557
|
-
function
|
|
558
|
-
let
|
|
916
|
+
var yn = 500;
|
|
917
|
+
function bn(e) {
|
|
918
|
+
let n = typeof e.resolvePreview == "function", r = l(null), i = l(!1), a = l(!1), o = 0, s = null;
|
|
559
919
|
function c() {
|
|
560
920
|
s !== null && (clearTimeout(s), s = null);
|
|
561
921
|
}
|
|
562
|
-
async function
|
|
922
|
+
async function u() {
|
|
563
923
|
let t = e.resolvePreview;
|
|
564
924
|
if (!t) return;
|
|
565
|
-
let
|
|
566
|
-
|
|
925
|
+
let n = ++o;
|
|
926
|
+
i.value = !0;
|
|
567
927
|
let s = {
|
|
568
|
-
content:
|
|
928
|
+
content: _e(e.getContent()),
|
|
569
929
|
...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
|
|
570
930
|
};
|
|
571
931
|
try {
|
|
572
932
|
let e = await t(s);
|
|
573
|
-
if (
|
|
574
|
-
if (!
|
|
575
|
-
|
|
933
|
+
if (n !== o) return;
|
|
934
|
+
if (!De(e)) {
|
|
935
|
+
a.value = !0;
|
|
576
936
|
return;
|
|
577
937
|
}
|
|
578
|
-
|
|
938
|
+
r.value = e, a.value = !1;
|
|
579
939
|
} catch {
|
|
580
|
-
if (
|
|
581
|
-
|
|
940
|
+
if (n !== o) return;
|
|
941
|
+
a.value = !0;
|
|
582
942
|
} finally {
|
|
583
|
-
|
|
943
|
+
n === o && (i.value = !1);
|
|
584
944
|
}
|
|
585
945
|
}
|
|
586
|
-
function
|
|
587
|
-
if (
|
|
588
|
-
if (c(),
|
|
589
|
-
|
|
946
|
+
function d() {
|
|
947
|
+
if (n) {
|
|
948
|
+
if (c(), r.value === null) {
|
|
949
|
+
u();
|
|
590
950
|
return;
|
|
591
951
|
}
|
|
592
952
|
s = setTimeout(() => {
|
|
593
|
-
s = null,
|
|
594
|
-
},
|
|
953
|
+
s = null, u();
|
|
954
|
+
}, yn);
|
|
595
955
|
}
|
|
596
956
|
}
|
|
597
|
-
return
|
|
957
|
+
return t(() => [e.isActive(), e.getRecipient?.()], ([e]) => {
|
|
598
958
|
if (!e) {
|
|
599
|
-
c(),
|
|
959
|
+
c(), o++, i.value = !1, r.value = null, a.value = !1;
|
|
600
960
|
return;
|
|
601
961
|
}
|
|
602
|
-
|
|
603
|
-
}, { immediate: !0 }),
|
|
604
|
-
c(),
|
|
962
|
+
d();
|
|
963
|
+
}, { immediate: !0 }), h(() => {
|
|
964
|
+
c(), o++;
|
|
605
965
|
}), {
|
|
606
|
-
isConfigured:
|
|
607
|
-
content:
|
|
608
|
-
isResolving:
|
|
609
|
-
isInitialResolve:
|
|
610
|
-
hasFailed:
|
|
611
|
-
supersedesSamples:
|
|
966
|
+
isConfigured: n,
|
|
967
|
+
content: S(() => r.value ?? e.getContent()),
|
|
968
|
+
isResolving: i,
|
|
969
|
+
isInitialResolve: S(() => i.value && r.value === null),
|
|
970
|
+
hasFailed: a,
|
|
971
|
+
supersedesSamples: S(() => n)
|
|
612
972
|
};
|
|
613
973
|
}
|
|
614
974
|
//#endregion
|
|
615
975
|
//#region src/composables/useImageUrlResolver.ts
|
|
616
|
-
function
|
|
617
|
-
let t =
|
|
976
|
+
function xn(e) {
|
|
977
|
+
let t = m(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
618
978
|
function r(e) {
|
|
619
979
|
return t.get(e);
|
|
620
980
|
}
|
|
@@ -646,38 +1006,38 @@ function vn(e) {
|
|
|
646
1006
|
lookup: a
|
|
647
1007
|
};
|
|
648
1008
|
}
|
|
649
|
-
function
|
|
650
|
-
let
|
|
651
|
-
if (!
|
|
652
|
-
let
|
|
653
|
-
function
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
let
|
|
658
|
-
return
|
|
659
|
-
|
|
660
|
-
let
|
|
661
|
-
if (
|
|
662
|
-
if (
|
|
663
|
-
|
|
1009
|
+
function Sn(e) {
|
|
1010
|
+
let r = n(ot, null), i = S(e);
|
|
1011
|
+
if (!r) return i;
|
|
1012
|
+
let a;
|
|
1013
|
+
function s() {
|
|
1014
|
+
a !== void 0 && (clearTimeout(a), a = void 0);
|
|
1015
|
+
}
|
|
1016
|
+
o() && h(s);
|
|
1017
|
+
let c = !0;
|
|
1018
|
+
return t(i, (e) => {
|
|
1019
|
+
s();
|
|
1020
|
+
let t = c;
|
|
1021
|
+
if (c = !1, !(!e || r.has(e))) {
|
|
1022
|
+
if (t) {
|
|
1023
|
+
r.lookup(e);
|
|
664
1024
|
return;
|
|
665
1025
|
}
|
|
666
|
-
|
|
667
|
-
|
|
1026
|
+
a = setTimeout(() => {
|
|
1027
|
+
a = void 0, r.lookup(e);
|
|
668
1028
|
}, 300);
|
|
669
1029
|
}
|
|
670
|
-
}, { immediate: !0 }),
|
|
671
|
-
let e =
|
|
1030
|
+
}, { immediate: !0 }), S(() => {
|
|
1031
|
+
let e = i.value;
|
|
672
1032
|
if (!e) return e;
|
|
673
|
-
let
|
|
674
|
-
return typeof
|
|
1033
|
+
let t = r.get(e);
|
|
1034
|
+
return typeof t == "string" && t.length > 0 ? t : e;
|
|
675
1035
|
});
|
|
676
1036
|
}
|
|
677
1037
|
//#endregion
|
|
678
1038
|
//#region src/composables/useMergeTagPicker.ts
|
|
679
|
-
function
|
|
680
|
-
let e =
|
|
1039
|
+
function Cn() {
|
|
1040
|
+
let e = l(!1), t = l([]), n = null;
|
|
681
1041
|
function r(r) {
|
|
682
1042
|
if (n) {
|
|
683
1043
|
let e = n;
|
|
@@ -687,11 +1047,11 @@ function yn() {
|
|
|
687
1047
|
n = e;
|
|
688
1048
|
});
|
|
689
1049
|
}
|
|
690
|
-
function
|
|
1050
|
+
function i(r) {
|
|
691
1051
|
let i = n;
|
|
692
1052
|
n = null, e.value = !1, t.value = [], i && i(r);
|
|
693
1053
|
}
|
|
694
|
-
return
|
|
1054
|
+
return o() && h(() => {
|
|
695
1055
|
if (n) {
|
|
696
1056
|
let e = n;
|
|
697
1057
|
n = null, e(null);
|
|
@@ -701,14 +1061,14 @@ function yn() {
|
|
|
701
1061
|
isOpen: e,
|
|
702
1062
|
tags: t,
|
|
703
1063
|
open: r,
|
|
704
|
-
resolve:
|
|
1064
|
+
resolve: i
|
|
705
1065
|
};
|
|
706
1066
|
}
|
|
707
1067
|
//#endregion
|
|
708
1068
|
//#region src/composables/useLogicTagPicker.ts
|
|
709
|
-
function
|
|
710
|
-
let e =
|
|
711
|
-
function
|
|
1069
|
+
function wn() {
|
|
1070
|
+
let e = l(!1), t = l([]), n = l([]), r = null;
|
|
1071
|
+
function i(i, a) {
|
|
712
1072
|
if (r) {
|
|
713
1073
|
let e = r;
|
|
714
1074
|
r = null, e(null);
|
|
@@ -717,11 +1077,11 @@ function bn() {
|
|
|
717
1077
|
r = e;
|
|
718
1078
|
});
|
|
719
1079
|
}
|
|
720
|
-
function
|
|
1080
|
+
function a(i) {
|
|
721
1081
|
let a = r;
|
|
722
1082
|
r = null, e.value = !1, t.value = [], n.value = [], a && a(i);
|
|
723
1083
|
}
|
|
724
|
-
return
|
|
1084
|
+
return o() && h(() => {
|
|
725
1085
|
if (r) {
|
|
726
1086
|
let e = r;
|
|
727
1087
|
r = null, e(null);
|
|
@@ -731,24 +1091,24 @@ function bn() {
|
|
|
731
1091
|
isOpen: e,
|
|
732
1092
|
tags: t,
|
|
733
1093
|
pairs: n,
|
|
734
|
-
open:
|
|
735
|
-
resolve:
|
|
1094
|
+
open: i,
|
|
1095
|
+
resolve: a
|
|
736
1096
|
};
|
|
737
1097
|
}
|
|
738
1098
|
//#endregion
|
|
739
1099
|
//#region src/composables/useTemplateLint.ts
|
|
740
|
-
function
|
|
1100
|
+
function Tn(e) {
|
|
741
1101
|
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
|
|
742
1102
|
}
|
|
743
|
-
function
|
|
744
|
-
let n =
|
|
745
|
-
o ||
|
|
746
|
-
async function
|
|
1103
|
+
function En(e) {
|
|
1104
|
+
let n = l([]), r = l(!1), i = l(!1), a = x(null), o = Tn(e.options), s = null, c = !1;
|
|
1105
|
+
o || u();
|
|
1106
|
+
async function u() {
|
|
747
1107
|
try {
|
|
748
|
-
let
|
|
1108
|
+
let t = await import("./src-Cx70q30o.js");
|
|
749
1109
|
if (c) return;
|
|
750
|
-
a.value = { lintTemplate:
|
|
751
|
-
debounce:
|
|
1110
|
+
a.value = { lintTemplate: t.lintTemplate }, r.value = !0, d(), s = ze(e.content, d, {
|
|
1111
|
+
debounce: e.debounce ?? 500,
|
|
752
1112
|
deep: !0
|
|
753
1113
|
});
|
|
754
1114
|
} catch {
|
|
@@ -756,44 +1116,44 @@ function Sn(t) {
|
|
|
756
1116
|
i.value = !0;
|
|
757
1117
|
}
|
|
758
1118
|
}
|
|
759
|
-
function
|
|
760
|
-
a.value && (n.value = a.value.lintTemplate(
|
|
1119
|
+
function d() {
|
|
1120
|
+
a.value && (n.value = a.value.lintTemplate(e.content.value, e.options));
|
|
761
1121
|
}
|
|
762
|
-
let
|
|
763
|
-
a.value &&
|
|
1122
|
+
let f = t(() => e.options, () => {
|
|
1123
|
+
a.value && d();
|
|
764
1124
|
}, { deep: !0 });
|
|
765
|
-
function
|
|
766
|
-
|
|
767
|
-
updateBlock:
|
|
768
|
-
updateSettings:
|
|
769
|
-
removeBlock:
|
|
1125
|
+
function p(t) {
|
|
1126
|
+
t.fix && t.fix.apply({
|
|
1127
|
+
updateBlock: e.updateBlock,
|
|
1128
|
+
updateSettings: e.updateSettings,
|
|
1129
|
+
removeBlock: e.removeBlock
|
|
770
1130
|
});
|
|
771
1131
|
}
|
|
772
|
-
function
|
|
773
|
-
c = !0, s?.(),
|
|
1132
|
+
function m() {
|
|
1133
|
+
c = !0, s?.(), f();
|
|
774
1134
|
}
|
|
775
1135
|
return {
|
|
776
1136
|
issues: n,
|
|
777
1137
|
ready: r,
|
|
778
1138
|
unavailable: i,
|
|
779
|
-
applyFix:
|
|
780
|
-
destroy:
|
|
1139
|
+
applyFix: p,
|
|
1140
|
+
destroy: m
|
|
781
1141
|
};
|
|
782
1142
|
}
|
|
783
1143
|
//#endregion
|
|
784
1144
|
//#region src/utils/blockTypeLabels.ts
|
|
785
|
-
function
|
|
1145
|
+
function Dn(e, t) {
|
|
786
1146
|
return t.blocks[e] ?? e;
|
|
787
1147
|
}
|
|
788
|
-
function
|
|
789
|
-
if (e.type !== "custom") return
|
|
1148
|
+
function On(e, t, n = []) {
|
|
1149
|
+
if (e.type !== "custom") return Dn(e.type, t);
|
|
790
1150
|
let { customType: r } = e;
|
|
791
1151
|
return n.find((e) => e.type === r)?.name ?? r;
|
|
792
1152
|
}
|
|
793
1153
|
//#endregion
|
|
794
1154
|
//#region src/composables/useKeyboardReorder.ts
|
|
795
|
-
function
|
|
796
|
-
let r =
|
|
1155
|
+
function kn(e, t, n = []) {
|
|
1156
|
+
let r = l(null), i = l(""), a = null;
|
|
797
1157
|
function o(t) {
|
|
798
1158
|
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
799
1159
|
if (r !== -1) return {
|
|
@@ -819,56 +1179,56 @@ function Tn(e, t, n = []) {
|
|
|
819
1179
|
let i = o(r);
|
|
820
1180
|
if (!i) return "";
|
|
821
1181
|
let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
|
|
822
|
-
return a ?
|
|
1182
|
+
return a ? On(a, t.t, n) : "";
|
|
823
1183
|
}
|
|
824
1184
|
function c(t, n) {
|
|
825
1185
|
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
826
1186
|
}
|
|
827
|
-
function
|
|
1187
|
+
function u(e) {
|
|
828
1188
|
i.value = "", queueMicrotask(() => {
|
|
829
1189
|
i.value = e;
|
|
830
1190
|
});
|
|
831
1191
|
}
|
|
832
|
-
function
|
|
1192
|
+
function d(e) {
|
|
833
1193
|
return r.value === e;
|
|
834
1194
|
}
|
|
835
|
-
function
|
|
1195
|
+
function f(e) {
|
|
836
1196
|
let n = o(e);
|
|
837
|
-
n && (r.value = e, a = n,
|
|
1197
|
+
n && (r.value = e, a = n, u(t.format(t.t.blockActions.lifted, {
|
|
838
1198
|
block: s(e),
|
|
839
1199
|
position: String(n.index + 1),
|
|
840
1200
|
total: String(n.total)
|
|
841
1201
|
})));
|
|
842
1202
|
}
|
|
843
|
-
function
|
|
1203
|
+
function p(n, r) {
|
|
844
1204
|
let i = o(n);
|
|
845
1205
|
if (!i) return;
|
|
846
1206
|
let a = i.index + r;
|
|
847
|
-
a < 0 || a >= i.total || (e.moveBlock(n, a, i.sectionId, i.columnIndex),
|
|
1207
|
+
a < 0 || a >= i.total || (e.moveBlock(n, a, i.sectionId, i.columnIndex), u(t.format(t.t.blockActions.moved, {
|
|
848
1208
|
block: s(n),
|
|
849
1209
|
position: String(a + 1),
|
|
850
1210
|
total: String(i.total)
|
|
851
1211
|
})));
|
|
852
1212
|
}
|
|
853
|
-
function p(e) {
|
|
854
|
-
f(e, -1);
|
|
855
|
-
}
|
|
856
1213
|
function m(e) {
|
|
857
|
-
|
|
1214
|
+
p(e, -1);
|
|
858
1215
|
}
|
|
859
1216
|
function h(e) {
|
|
1217
|
+
p(e, 1);
|
|
1218
|
+
}
|
|
1219
|
+
function g(e) {
|
|
860
1220
|
let n = o(e);
|
|
861
|
-
n &&
|
|
1221
|
+
n && u(t.format(t.t.blockActions.dropped, {
|
|
862
1222
|
block: s(e),
|
|
863
1223
|
position: String(n.index + 1),
|
|
864
1224
|
total: String(n.total)
|
|
865
1225
|
})), r.value = null, a = null;
|
|
866
1226
|
}
|
|
867
|
-
function
|
|
1227
|
+
function _() {
|
|
868
1228
|
let n = r.value;
|
|
869
1229
|
if (n && a) {
|
|
870
1230
|
let r = o(n);
|
|
871
|
-
r && (r && (r.sectionId !== a.sectionId || r.columnIndex !== a.columnIndex) || r && r.index !== a.index) && e.moveBlock(n, a.index, a.sectionId, a.columnIndex),
|
|
1231
|
+
r && (r && (r.sectionId !== a.sectionId || r.columnIndex !== a.columnIndex) || r && r.index !== a.index) && e.moveBlock(n, a.index, a.sectionId, a.columnIndex), u(t.format(t.t.blockActions.cancelled, {
|
|
872
1232
|
block: s(n),
|
|
873
1233
|
position: String(a.index + 1)
|
|
874
1234
|
}));
|
|
@@ -878,23 +1238,23 @@ function Tn(e, t, n = []) {
|
|
|
878
1238
|
return {
|
|
879
1239
|
liftedBlockId: r,
|
|
880
1240
|
announcement: i,
|
|
881
|
-
isLifted:
|
|
882
|
-
lift:
|
|
883
|
-
cancel:
|
|
884
|
-
moveUp:
|
|
885
|
-
moveDown:
|
|
886
|
-
drop:
|
|
1241
|
+
isLifted: d,
|
|
1242
|
+
lift: f,
|
|
1243
|
+
cancel: _,
|
|
1244
|
+
moveUp: m,
|
|
1245
|
+
moveDown: h,
|
|
1246
|
+
drop: g
|
|
887
1247
|
};
|
|
888
1248
|
}
|
|
889
1249
|
//#endregion
|
|
890
1250
|
//#region src/composables/useUiTheme.ts
|
|
891
|
-
function
|
|
892
|
-
let t =
|
|
893
|
-
return { resolvedTheme:
|
|
1251
|
+
function An(e) {
|
|
1252
|
+
let t = Be("(prefers-color-scheme: dark)");
|
|
1253
|
+
return { resolvedTheme: S(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
894
1254
|
}
|
|
895
1255
|
//#endregion
|
|
896
1256
|
//#region src/composables/useThemeStyles.ts
|
|
897
|
-
var
|
|
1257
|
+
var jn = {
|
|
898
1258
|
bg: "--tpl-bg",
|
|
899
1259
|
bgElevated: "--tpl-bg-elevated",
|
|
900
1260
|
bgHover: "--tpl-bg-hover",
|
|
@@ -918,10 +1278,10 @@ var Dn = {
|
|
|
918
1278
|
dangerLight: "--tpl-danger-light",
|
|
919
1279
|
canvasBg: "--tpl-canvas-bg"
|
|
920
1280
|
};
|
|
921
|
-
function
|
|
922
|
-
return { themeStyles:
|
|
1281
|
+
function Mn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
1282
|
+
return { themeStyles: S(() => {
|
|
923
1283
|
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
924
|
-
if (a) for (let [e, t] of Object.entries(
|
|
1284
|
+
if (a) for (let [e, t] of Object.entries(jn)) {
|
|
925
1285
|
let n = a[e];
|
|
926
1286
|
n && (r[t] = n);
|
|
927
1287
|
}
|
|
@@ -929,60 +1289,40 @@ function On({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
|
929
1289
|
}) };
|
|
930
1290
|
}
|
|
931
1291
|
//#endregion
|
|
932
|
-
//#region src/utils/logger.ts
|
|
933
|
-
var kn = "[Templatical]";
|
|
934
|
-
function An() {
|
|
935
|
-
return typeof process < "u" && !0;
|
|
936
|
-
}
|
|
937
|
-
var $ = {
|
|
938
|
-
warn(...e) {
|
|
939
|
-
console.warn(kn, ...e);
|
|
940
|
-
},
|
|
941
|
-
error(...e) {
|
|
942
|
-
console.error(kn, ...e);
|
|
943
|
-
},
|
|
944
|
-
debug(...e) {
|
|
945
|
-
An() || console.debug(kn, ...e);
|
|
946
|
-
},
|
|
947
|
-
info(...e) {
|
|
948
|
-
An() || console.info(kn, ...e);
|
|
949
|
-
}
|
|
950
|
-
};
|
|
951
|
-
//#endregion
|
|
952
1292
|
//#region src/composables/useBlockRegistry.ts
|
|
953
|
-
function
|
|
954
|
-
let
|
|
955
|
-
function
|
|
956
|
-
|
|
957
|
-
}
|
|
958
|
-
function
|
|
959
|
-
let r = `custom:${
|
|
960
|
-
|
|
1293
|
+
function Nn() {
|
|
1294
|
+
let e = x(/* @__PURE__ */ new Map());
|
|
1295
|
+
function t(t, n) {
|
|
1296
|
+
e.value.set(t, n), T(e);
|
|
1297
|
+
}
|
|
1298
|
+
function n(t, n) {
|
|
1299
|
+
let r = `custom:${t.type}`;
|
|
1300
|
+
e.value.set(r, {
|
|
961
1301
|
component: n,
|
|
962
|
-
createBlock: () =>
|
|
963
|
-
definition:
|
|
964
|
-
}),
|
|
1302
|
+
createBlock: () => me(t),
|
|
1303
|
+
definition: t
|
|
1304
|
+
}), T(e);
|
|
965
1305
|
}
|
|
966
|
-
function
|
|
967
|
-
if (
|
|
968
|
-
let n = `custom:${
|
|
969
|
-
return
|
|
1306
|
+
function r(t) {
|
|
1307
|
+
if (t.type === "custom") {
|
|
1308
|
+
let n = `custom:${t.customType}`;
|
|
1309
|
+
return e.value.get(n)?.component;
|
|
970
1310
|
}
|
|
971
|
-
return
|
|
1311
|
+
return e.value.get(t.type)?.component;
|
|
972
1312
|
}
|
|
973
|
-
function
|
|
974
|
-
return
|
|
1313
|
+
function i(t) {
|
|
1314
|
+
return e.value.get(t)?.createBlock();
|
|
975
1315
|
}
|
|
976
|
-
function
|
|
977
|
-
let n = `custom:${
|
|
978
|
-
return
|
|
1316
|
+
function a(t) {
|
|
1317
|
+
let n = `custom:${t}`;
|
|
1318
|
+
return e.value.get(n)?.definition;
|
|
979
1319
|
}
|
|
980
|
-
function
|
|
1320
|
+
function o(e) {
|
|
981
1321
|
return `<div style="color: var(--tpl-text-muted); padding: 16px; text-align: center; border: 1px dashed var(--tpl-border); border-radius: var(--tpl-radius-sm); font-family: var(--tpl-font-family); font-size: 14px;">${e}</div>`;
|
|
982
1322
|
}
|
|
983
|
-
async function
|
|
984
|
-
let t =
|
|
985
|
-
if (!t) return
|
|
1323
|
+
async function s(e) {
|
|
1324
|
+
let t = a(e.customType);
|
|
1325
|
+
if (!t) return o("Block definition not found");
|
|
986
1326
|
try {
|
|
987
1327
|
let { Liquid: n } = await import("./liquid.browser-UlAOKBjI.js");
|
|
988
1328
|
return await new n({
|
|
@@ -990,27 +1330,27 @@ function jn() {
|
|
|
990
1330
|
strictFilters: !1
|
|
991
1331
|
}).parseAndRender(t.template, e.fieldValues);
|
|
992
1332
|
} catch (t) {
|
|
993
|
-
return
|
|
1333
|
+
return X.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
|
|
994
1334
|
}
|
|
995
1335
|
}
|
|
996
|
-
function
|
|
997
|
-
return
|
|
1336
|
+
function c(t) {
|
|
1337
|
+
return e.value.has(t);
|
|
998
1338
|
}
|
|
999
1339
|
return {
|
|
1000
|
-
registerBuiltIn:
|
|
1001
|
-
registerCustom:
|
|
1002
|
-
getComponent:
|
|
1003
|
-
createBlock:
|
|
1004
|
-
getDefinition:
|
|
1005
|
-
renderCustomBlock:
|
|
1006
|
-
isRegistered:
|
|
1340
|
+
registerBuiltIn: t,
|
|
1341
|
+
registerCustom: n,
|
|
1342
|
+
getComponent: r,
|
|
1343
|
+
createBlock: i,
|
|
1344
|
+
getDefinition: a,
|
|
1345
|
+
renderCustomBlock: s,
|
|
1346
|
+
isRegistered: c
|
|
1007
1347
|
};
|
|
1008
1348
|
}
|
|
1009
1349
|
//#endregion
|
|
1010
1350
|
//#region src/composables/useCustomBlockStylesheets.ts
|
|
1011
|
-
function
|
|
1012
|
-
return
|
|
1013
|
-
let n =
|
|
1351
|
+
function Pn(e, t) {
|
|
1352
|
+
return S(() => {
|
|
1353
|
+
let n = Fn(e.value.blocks);
|
|
1014
1354
|
if (n.size === 0) return [];
|
|
1015
1355
|
let r = /* @__PURE__ */ new Set(), i = [];
|
|
1016
1356
|
for (let e of n) {
|
|
@@ -1022,81 +1362,81 @@ function Mn(e, t) {
|
|
|
1022
1362
|
return i;
|
|
1023
1363
|
});
|
|
1024
1364
|
}
|
|
1025
|
-
function
|
|
1365
|
+
function Fn(e) {
|
|
1026
1366
|
let t = /* @__PURE__ */ new Set();
|
|
1027
|
-
return
|
|
1367
|
+
return In(e, t), t;
|
|
1028
1368
|
}
|
|
1029
|
-
function
|
|
1369
|
+
function In(e, t) {
|
|
1030
1370
|
for (let n of e) {
|
|
1031
|
-
if (
|
|
1371
|
+
if (oe(n)) {
|
|
1032
1372
|
t.add(n.customType);
|
|
1033
1373
|
continue;
|
|
1034
1374
|
}
|
|
1035
1375
|
if (n.type === "section") {
|
|
1036
1376
|
let e = n.children;
|
|
1037
1377
|
if (!e) continue;
|
|
1038
|
-
for (let n of e)
|
|
1378
|
+
for (let n of e) In(n, t);
|
|
1039
1379
|
}
|
|
1040
1380
|
}
|
|
1041
1381
|
}
|
|
1042
1382
|
//#endregion
|
|
1043
1383
|
//#region src/utils/registerBuiltInBlocks.ts
|
|
1044
|
-
var
|
|
1384
|
+
var Ln = [
|
|
1045
1385
|
{
|
|
1046
1386
|
type: "section",
|
|
1047
|
-
createBlock:
|
|
1387
|
+
createBlock: Ce
|
|
1048
1388
|
},
|
|
1049
1389
|
{
|
|
1050
1390
|
type: "title",
|
|
1051
|
-
createBlock:
|
|
1391
|
+
createBlock: ae
|
|
1052
1392
|
},
|
|
1053
1393
|
{
|
|
1054
1394
|
type: "paragraph",
|
|
1055
|
-
createBlock:
|
|
1395
|
+
createBlock: ee
|
|
1056
1396
|
},
|
|
1057
1397
|
{
|
|
1058
1398
|
type: "image",
|
|
1059
|
-
createBlock:
|
|
1399
|
+
createBlock: ue
|
|
1060
1400
|
},
|
|
1061
1401
|
{
|
|
1062
1402
|
type: "button",
|
|
1063
|
-
createBlock:
|
|
1403
|
+
createBlock: ne
|
|
1064
1404
|
},
|
|
1065
1405
|
{
|
|
1066
1406
|
type: "divider",
|
|
1067
|
-
createBlock:
|
|
1407
|
+
createBlock: ie
|
|
1068
1408
|
},
|
|
1069
1409
|
{
|
|
1070
1410
|
type: "video",
|
|
1071
|
-
createBlock:
|
|
1411
|
+
createBlock: se
|
|
1072
1412
|
},
|
|
1073
1413
|
{
|
|
1074
1414
|
type: "social",
|
|
1075
|
-
createBlock:
|
|
1415
|
+
createBlock: ce
|
|
1076
1416
|
},
|
|
1077
1417
|
{
|
|
1078
1418
|
type: "menu",
|
|
1079
|
-
createBlock:
|
|
1419
|
+
createBlock: we
|
|
1080
1420
|
},
|
|
1081
1421
|
{
|
|
1082
1422
|
type: "table",
|
|
1083
|
-
createBlock:
|
|
1423
|
+
createBlock: de
|
|
1084
1424
|
},
|
|
1085
1425
|
{
|
|
1086
1426
|
type: "spacer",
|
|
1087
|
-
createBlock:
|
|
1427
|
+
createBlock: le
|
|
1088
1428
|
},
|
|
1089
1429
|
{
|
|
1090
1430
|
type: "html",
|
|
1091
|
-
createBlock:
|
|
1431
|
+
createBlock: re
|
|
1092
1432
|
},
|
|
1093
1433
|
{
|
|
1094
1434
|
type: "countdown",
|
|
1095
|
-
createBlock:
|
|
1435
|
+
createBlock: Pe
|
|
1096
1436
|
}
|
|
1097
1437
|
];
|
|
1098
|
-
function
|
|
1099
|
-
for (let n of
|
|
1438
|
+
function Rn(e, t) {
|
|
1439
|
+
for (let n of Ln) {
|
|
1100
1440
|
let r = t[n.type];
|
|
1101
1441
|
r && e.registerBuiltIn(n.type, {
|
|
1102
1442
|
component: r,
|
|
@@ -1106,34 +1446,34 @@ function In(e, t) {
|
|
|
1106
1446
|
}
|
|
1107
1447
|
//#endregion
|
|
1108
1448
|
//#region src/utils/resolveHtmlBlockPreview.ts
|
|
1109
|
-
function
|
|
1449
|
+
function zn(e) {
|
|
1110
1450
|
return typeof e == "boolean" ? e : e?.enabled ?? !1;
|
|
1111
1451
|
}
|
|
1112
1452
|
//#endregion
|
|
1113
1453
|
//#region src/utils/collectOffPaletteDefaults.ts
|
|
1114
|
-
function
|
|
1454
|
+
function Bn(e) {
|
|
1115
1455
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1116
1456
|
}
|
|
1117
|
-
function
|
|
1118
|
-
let r = new Set(e.map((e) =>
|
|
1119
|
-
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(
|
|
1457
|
+
function Vn(e, t, n) {
|
|
1458
|
+
let r = new Set(e.map((e) => Z(e))), i = [], a = (e, t) => {
|
|
1459
|
+
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(Z(o)) && i.push(`${t}.${n}: ${o}`) : Bn(o) && a(o, `${t}.${n}`);
|
|
1120
1460
|
}, o = t;
|
|
1121
|
-
for (let [e, t] of Object.entries(
|
|
1461
|
+
for (let [e, t] of Object.entries(Fe)) {
|
|
1122
1462
|
let n = o?.[e];
|
|
1123
1463
|
a({
|
|
1124
1464
|
...t,
|
|
1125
|
-
...
|
|
1465
|
+
...Bn(n) ? n : {}
|
|
1126
1466
|
}, e);
|
|
1127
1467
|
}
|
|
1128
1468
|
return a({
|
|
1129
|
-
...
|
|
1469
|
+
...te,
|
|
1130
1470
|
...n ?? {}
|
|
1131
1471
|
}, "template"), i;
|
|
1132
1472
|
}
|
|
1133
1473
|
//#endregion
|
|
1134
1474
|
//#region src/utils/resolveFieldColors.ts
|
|
1135
|
-
function
|
|
1136
|
-
let n =
|
|
1475
|
+
function Hn(e, t) {
|
|
1476
|
+
let n = Dt({ presets: e.presets }, Tt), r = n.presets.length === 0;
|
|
1137
1477
|
return {
|
|
1138
1478
|
presets: r ? t.presets : n.presets,
|
|
1139
1479
|
allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
|
|
@@ -1145,9 +1485,9 @@ function Bn(e, t) {
|
|
|
1145
1485
|
}
|
|
1146
1486
|
//#endregion
|
|
1147
1487
|
//#region src/utils/collectColorFieldIssues.ts
|
|
1148
|
-
function
|
|
1488
|
+
function Un(e, t) {
|
|
1149
1489
|
let n = [], r = (r, i) => {
|
|
1150
|
-
let a =
|
|
1490
|
+
let a = Hn(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
1151
1491
|
if (a.invalidPresets.length > 0 && n.push({
|
|
1152
1492
|
id: s("invalid-presets"),
|
|
1153
1493
|
message: `${o}: presets skipped invalid entries: ${a.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).` + (a.presetsInherited ? " No valid entries are left, so the field inherits colors.presets." : "")
|
|
@@ -1158,8 +1498,8 @@ function Vn(e, t) {
|
|
|
1158
1498
|
id: s("allow-custom-ignored"),
|
|
1159
1499
|
message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
|
|
1160
1500
|
}), !a.allowCustom && a.presets.length > 0) {
|
|
1161
|
-
let e = r.default ?? "", t = new Set(a.presets.map((e) =>
|
|
1162
|
-
e !== "" && !t.has(
|
|
1501
|
+
let e = r.default ?? "", t = new Set(a.presets.map((e) => Z(e)));
|
|
1502
|
+
e !== "" && !t.has(Z(e)) && n.push({
|
|
1163
1503
|
id: s("off-palette-default"),
|
|
1164
1504
|
message: `${o} locks custom colours, but its default ${e} falls outside the field's presets: ${a.presets.join(", ")}. New blocks start on a colour the picker can't reselect — set the default from the same palette.`
|
|
1165
1505
|
});
|
|
@@ -1171,7 +1511,7 @@ function Vn(e, t) {
|
|
|
1171
1511
|
}
|
|
1172
1512
|
//#endregion
|
|
1173
1513
|
//#region src/utils/keyboardShortcuts.ts
|
|
1174
|
-
function
|
|
1514
|
+
function Wn(e) {
|
|
1175
1515
|
for (let t of e.composedPath()) {
|
|
1176
1516
|
if (!(t instanceof HTMLElement)) continue;
|
|
1177
1517
|
if (t.isContentEditable) return !0;
|
|
@@ -1180,18 +1520,18 @@ function Hn(e) {
|
|
|
1180
1520
|
}
|
|
1181
1521
|
return !1;
|
|
1182
1522
|
}
|
|
1183
|
-
function
|
|
1523
|
+
function Gn(e, t) {
|
|
1184
1524
|
let n = e.metaKey || e.ctrlKey;
|
|
1185
1525
|
if (n && e.key.toLowerCase() === "s") {
|
|
1186
1526
|
e.preventDefault(), t.onSave?.();
|
|
1187
1527
|
return;
|
|
1188
1528
|
}
|
|
1189
1529
|
if (n && e.key.toLowerCase() === "z") {
|
|
1190
|
-
if (
|
|
1530
|
+
if (Wn(e)) return;
|
|
1191
1531
|
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
1192
1532
|
return;
|
|
1193
1533
|
}
|
|
1194
|
-
if (t.isPicking?.() && !
|
|
1534
|
+
if (t.isPicking?.() && !Wn(e)) {
|
|
1195
1535
|
if (e.key === "Escape") {
|
|
1196
1536
|
e.preventDefault(), t.onCancelPick?.();
|
|
1197
1537
|
return;
|
|
@@ -1209,11 +1549,11 @@ function Un(e, t) {
|
|
|
1209
1549
|
t.selectBlock(null);
|
|
1210
1550
|
return;
|
|
1211
1551
|
}
|
|
1212
|
-
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !
|
|
1552
|
+
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !Wn(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
1213
1553
|
}
|
|
1214
1554
|
//#endregion
|
|
1215
1555
|
//#region src/utils/mergeTagLabelSegments.ts
|
|
1216
|
-
function
|
|
1556
|
+
function Kn(e, t, n, r = !1) {
|
|
1217
1557
|
if (!e) return [];
|
|
1218
1558
|
let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
|
|
1219
1559
|
for (; (s = i.exec(e)) !== null;) {
|
|
@@ -1222,18 +1562,18 @@ function Wn(e, t, n, r = !1) {
|
|
|
1222
1562
|
value: e.slice(o, s.index)
|
|
1223
1563
|
});
|
|
1224
1564
|
let i = s[0];
|
|
1225
|
-
if (
|
|
1226
|
-
let e = r ?
|
|
1565
|
+
if (be(i, n)) {
|
|
1566
|
+
let e = r ? je(i, t) : void 0;
|
|
1227
1567
|
a.push(e === void 0 ? {
|
|
1228
1568
|
type: "tag",
|
|
1229
|
-
value:
|
|
1569
|
+
value: Oe(i, t)
|
|
1230
1570
|
} : {
|
|
1231
1571
|
type: "text",
|
|
1232
1572
|
value: e
|
|
1233
1573
|
});
|
|
1234
|
-
} else
|
|
1574
|
+
} else ve(i, n) ? a.push({
|
|
1235
1575
|
type: "tag",
|
|
1236
|
-
value:
|
|
1576
|
+
value: ge(i, n)
|
|
1237
1577
|
}) : a.push({
|
|
1238
1578
|
type: "text",
|
|
1239
1579
|
value: i
|
|
@@ -1247,27 +1587,27 @@ function Wn(e, t, n, r = !1) {
|
|
|
1247
1587
|
}
|
|
1248
1588
|
//#endregion
|
|
1249
1589
|
//#region src/components/MergeTagPreviewText.vue
|
|
1250
|
-
var
|
|
1590
|
+
var qn = d({
|
|
1251
1591
|
name: "MergeTagPreviewText",
|
|
1252
1592
|
props: { text: {
|
|
1253
1593
|
type: String,
|
|
1254
1594
|
required: !0
|
|
1255
1595
|
} },
|
|
1256
1596
|
setup(e) {
|
|
1257
|
-
let t =
|
|
1258
|
-
return () => a.value.map((e, t) => e.type === "tag" ?
|
|
1597
|
+
let t = n(K, []), r = n(ft, Ae.liquid), i = n(q, null), a = S(() => Kn(e.text, t, r, i?.value ?? !1));
|
|
1598
|
+
return () => a.value.map((e, t) => e.type === "tag" ? z("span", {
|
|
1259
1599
|
key: t,
|
|
1260
1600
|
class: "tpl-merge-tag-label"
|
|
1261
1601
|
}, e.value) : e.value);
|
|
1262
1602
|
}
|
|
1263
|
-
}),
|
|
1603
|
+
}), Jn = ["href"], Yn = /* @__PURE__ */ d({
|
|
1264
1604
|
__name: "ButtonBlock",
|
|
1265
1605
|
props: {
|
|
1266
1606
|
block: {},
|
|
1267
1607
|
viewport: {}
|
|
1268
1608
|
},
|
|
1269
1609
|
setup(e) {
|
|
1270
|
-
let t = e, n =
|
|
1610
|
+
let t = e, n = S(() => {
|
|
1271
1611
|
let e = {
|
|
1272
1612
|
display: "inline-block",
|
|
1273
1613
|
padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
|
|
@@ -1280,42 +1620,42 @@ var Gn = R({
|
|
|
1280
1620
|
textAlign: "center"
|
|
1281
1621
|
};
|
|
1282
1622
|
return t.block.fontFamily && (e.fontFamily = t.block.fontFamily), t.block.width === "full" ? (e.display = "block", e.width = "100%", e.boxSizing = "border-box") : typeof t.block.width == "number" && (e.width = `${t.block.width}px`, e.boxSizing = "border-box"), e;
|
|
1283
|
-
}), r =
|
|
1284
|
-
return (t, i) => (
|
|
1623
|
+
}), r = S(() => ({ textAlign: t.block.align ?? "center" }));
|
|
1624
|
+
return (t, i) => (s(), C("div", { style: k(r.value) }, [M("a", {
|
|
1285
1625
|
href: e.block.url || "#",
|
|
1286
|
-
style:
|
|
1626
|
+
style: k(n.value),
|
|
1287
1627
|
class: "tpl:cursor-default",
|
|
1288
1628
|
onClick: i[0] ||= O(() => {}, ["prevent"])
|
|
1289
|
-
}, [
|
|
1629
|
+
}, [v(qn, { text: e.block.text }, null, 8, ["text"])], 12, Jn)], 4));
|
|
1290
1630
|
}
|
|
1291
|
-
}),
|
|
1631
|
+
}), Xn = ["innerHTML"], Zn = [
|
|
1292
1632
|
"src",
|
|
1293
1633
|
"width",
|
|
1294
1634
|
"height"
|
|
1295
|
-
],
|
|
1635
|
+
], Qn = /* @__PURE__ */ d({
|
|
1296
1636
|
__name: "CustomBlockIcon",
|
|
1297
1637
|
props: {
|
|
1298
1638
|
icon: {},
|
|
1299
1639
|
size: {}
|
|
1300
1640
|
},
|
|
1301
1641
|
setup(e) {
|
|
1302
|
-
let t = e, n =
|
|
1303
|
-
return (t, a) => r.value ? (
|
|
1642
|
+
let t = e, n = S(() => t.size ?? 20), r = S(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), i = S(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/")));
|
|
1643
|
+
return (t, a) => r.value ? (s(), C("span", {
|
|
1304
1644
|
key: 0,
|
|
1305
1645
|
class: "tpl:inline-flex tpl:items-center tpl:justify-center",
|
|
1306
|
-
style:
|
|
1646
|
+
style: k({
|
|
1307
1647
|
width: `${n.value}px`,
|
|
1308
1648
|
height: `${n.value}px`
|
|
1309
1649
|
}),
|
|
1310
1650
|
innerHTML: e.icon
|
|
1311
|
-
}, null, 12,
|
|
1651
|
+
}, null, 12, Xn)) : i.value ? (s(), C("img", {
|
|
1312
1652
|
key: 1,
|
|
1313
1653
|
src: e.icon,
|
|
1314
1654
|
width: n.value,
|
|
1315
1655
|
height: n.value,
|
|
1316
1656
|
class: "tpl:inline-block",
|
|
1317
1657
|
alt: ""
|
|
1318
|
-
}, null, 8,
|
|
1658
|
+
}, null, 8, Zn)) : (s(), A(_(Kt), {
|
|
1319
1659
|
key: 2,
|
|
1320
1660
|
size: n.value,
|
|
1321
1661
|
"stroke-width": 1.5
|
|
@@ -1324,50 +1664,50 @@ var Gn = R({
|
|
|
1324
1664
|
});
|
|
1325
1665
|
//#endregion
|
|
1326
1666
|
//#region src/composables/useEditorRoot.ts
|
|
1327
|
-
function
|
|
1328
|
-
return
|
|
1667
|
+
function $n() {
|
|
1668
|
+
return n(ut, document) ?? document;
|
|
1329
1669
|
}
|
|
1330
1670
|
//#endregion
|
|
1331
1671
|
//#region src/composables/useFocusTrap.ts
|
|
1332
|
-
var
|
|
1333
|
-
function
|
|
1334
|
-
let
|
|
1672
|
+
var er = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
1673
|
+
function tr(e, n) {
|
|
1674
|
+
let r = $n(), i = null, a = null, o = null;
|
|
1335
1675
|
function s() {
|
|
1336
|
-
return e.value ? Array.from(e.value.querySelectorAll(
|
|
1676
|
+
return e.value ? Array.from(e.value.querySelectorAll(er)).filter((e) => e.offsetParent !== null) : [];
|
|
1337
1677
|
}
|
|
1338
1678
|
function c(e) {
|
|
1339
1679
|
if (e.key !== "Tab") return;
|
|
1340
1680
|
let t = s();
|
|
1341
1681
|
if (t.length === 0) return;
|
|
1342
|
-
let
|
|
1343
|
-
e.shiftKey ?
|
|
1682
|
+
let n = t[0], i = t[t.length - 1];
|
|
1683
|
+
e.shiftKey ? r.activeElement === n && (e.preventDefault(), i.focus()) : r.activeElement === i && (e.preventDefault(), n.focus());
|
|
1344
1684
|
}
|
|
1345
1685
|
function l() {
|
|
1346
|
-
let t =
|
|
1347
|
-
t && u({ restoreFocus: !1 }), t || (
|
|
1348
|
-
|
|
1686
|
+
let t = a !== null || o !== null;
|
|
1687
|
+
t && u({ restoreFocus: !1 }), t || (i = r.activeElement), o = requestAnimationFrame(() => {
|
|
1688
|
+
o = null;
|
|
1349
1689
|
let t = s();
|
|
1350
1690
|
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
1351
|
-
}),
|
|
1691
|
+
}), a = G(e, "keydown", c);
|
|
1352
1692
|
}
|
|
1353
1693
|
function u(e = {}) {
|
|
1354
1694
|
let t = e.restoreFocus !== !1;
|
|
1355
|
-
|
|
1695
|
+
o !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(o), o = null), a?.(), a = null, t && i && i.focus && (i.focus(), i = null);
|
|
1356
1696
|
}
|
|
1357
|
-
let d =
|
|
1697
|
+
let d = t([n, e], ([e, t]) => {
|
|
1358
1698
|
e && t ? l() : u();
|
|
1359
1699
|
}, { flush: "post" });
|
|
1360
|
-
|
|
1700
|
+
h(() => {
|
|
1361
1701
|
d(), u();
|
|
1362
1702
|
});
|
|
1363
1703
|
}
|
|
1364
1704
|
//#endregion
|
|
1365
1705
|
//#region src/composables/useEmoji.ts
|
|
1366
|
-
function
|
|
1367
|
-
let [
|
|
1368
|
-
|
|
1706
|
+
function nr() {
|
|
1707
|
+
let [e, n] = Re(!1), r = x([]), i = !1;
|
|
1708
|
+
h(() => {
|
|
1369
1709
|
i = !0;
|
|
1370
|
-
}),
|
|
1710
|
+
}), t(e, async (e) => {
|
|
1371
1711
|
if (e && r.value.length === 0) {
|
|
1372
1712
|
let { emojiCategories: e } = await import("./emojiData-6m0DBh7O.js");
|
|
1373
1713
|
if (i) return;
|
|
@@ -1377,69 +1717,19 @@ function er() {
|
|
|
1377
1717
|
function a() {
|
|
1378
1718
|
n();
|
|
1379
1719
|
}
|
|
1380
|
-
function
|
|
1381
|
-
|
|
1720
|
+
function o() {
|
|
1721
|
+
e.value = !1;
|
|
1382
1722
|
}
|
|
1383
1723
|
return {
|
|
1384
1724
|
categories: r,
|
|
1385
|
-
isOpen:
|
|
1725
|
+
isOpen: e,
|
|
1386
1726
|
toggle: a,
|
|
1387
|
-
close:
|
|
1388
|
-
};
|
|
1389
|
-
}
|
|
1390
|
-
//#endregion
|
|
1391
|
-
//#region src/composables/useDragDrop.ts
|
|
1392
|
-
function tr(e) {
|
|
1393
|
-
let { onBlockMove: t, onBlockAdd: n } = e, r = v(!1), i = v(null), a = v(null);
|
|
1394
|
-
function o(e) {
|
|
1395
|
-
r.value = !0, i.value = e;
|
|
1396
|
-
}
|
|
1397
|
-
function s() {
|
|
1398
|
-
r.value = !1, i.value = null, a.value = null;
|
|
1399
|
-
}
|
|
1400
|
-
function c(e) {
|
|
1401
|
-
a.value = e;
|
|
1402
|
-
}
|
|
1403
|
-
function l(e, r, a, o) {
|
|
1404
|
-
i.value && (e.findIndex((e) => e.id === i.value.id) === -1 ? n(i.value, a, o) : t(i.value.id, r, a, o), s());
|
|
1405
|
-
}
|
|
1406
|
-
function u(e, n, i) {
|
|
1407
|
-
return {
|
|
1408
|
-
group: e,
|
|
1409
|
-
animation: 150,
|
|
1410
|
-
ghostClass: "tpl-ghost",
|
|
1411
|
-
dragClass: "tpl-drag",
|
|
1412
|
-
handle: ".tpl-drag-handle",
|
|
1413
|
-
onStart: (e) => {
|
|
1414
|
-
e.item.dataset.blockId && (r.value = !0);
|
|
1415
|
-
},
|
|
1416
|
-
onEnd: () => {
|
|
1417
|
-
s();
|
|
1418
|
-
},
|
|
1419
|
-
onAdd: (e) => {
|
|
1420
|
-
let r = e.item.dataset.blockId;
|
|
1421
|
-
r && t(r, e.newIndex, n, i);
|
|
1422
|
-
},
|
|
1423
|
-
onUpdate: (e) => {
|
|
1424
|
-
let r = e.item.dataset.blockId;
|
|
1425
|
-
r && t(r, e.newIndex, n, i);
|
|
1426
|
-
}
|
|
1427
|
-
};
|
|
1428
|
-
}
|
|
1429
|
-
return {
|
|
1430
|
-
isDragging: r,
|
|
1431
|
-
draggedBlock: i,
|
|
1432
|
-
dropTargetId: a,
|
|
1433
|
-
startDrag: o,
|
|
1434
|
-
endDrag: s,
|
|
1435
|
-
setDropTarget: c,
|
|
1436
|
-
handleDrop: l,
|
|
1437
|
-
getSortableOptions: u
|
|
1727
|
+
close: o
|
|
1438
1728
|
};
|
|
1439
1729
|
}
|
|
1440
1730
|
//#endregion
|
|
1441
1731
|
//#region src/composables/useFonts.ts
|
|
1442
|
-
var
|
|
1732
|
+
var rr = [
|
|
1443
1733
|
{
|
|
1444
1734
|
value: "Arial",
|
|
1445
1735
|
label: "Arial"
|
|
@@ -1468,7 +1758,7 @@ var nr = [
|
|
|
1468
1758
|
value: "Courier New",
|
|
1469
1759
|
label: "Courier New"
|
|
1470
1760
|
}
|
|
1471
|
-
],
|
|
1761
|
+
], ir = {
|
|
1472
1762
|
arial: "Arial, sans-serif",
|
|
1473
1763
|
helvetica: "Helvetica, sans-serif",
|
|
1474
1764
|
georgia: "Georgia, serif",
|
|
@@ -1476,118 +1766,104 @@ var nr = [
|
|
|
1476
1766
|
verdana: "Verdana, sans-serif",
|
|
1477
1767
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1478
1768
|
"courier new": "'Courier New', monospace"
|
|
1479
|
-
},
|
|
1480
|
-
function
|
|
1481
|
-
if (e === void 0 || e === !0) return [...
|
|
1769
|
+
}, ar = "Arial, sans-serif";
|
|
1770
|
+
function or(e) {
|
|
1771
|
+
if (e === void 0 || e === !0) return [...rr];
|
|
1482
1772
|
if (e === !1) return [];
|
|
1483
1773
|
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1484
1774
|
for (let i of e) {
|
|
1485
|
-
let e = i.toLowerCase(), a =
|
|
1775
|
+
let e = i.toLowerCase(), a = rr.find((t) => t.value.toLowerCase() === e);
|
|
1486
1776
|
if (!a) {
|
|
1487
|
-
r.has(e) || (r.add(e),
|
|
1777
|
+
r.has(e) || (r.add(e), X.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${rr.map((e) => e.value).join(", ")}.`));
|
|
1488
1778
|
continue;
|
|
1489
1779
|
}
|
|
1490
1780
|
n.has(a.value) || (n.add(a.value), t.push(a));
|
|
1491
1781
|
}
|
|
1492
1782
|
return t;
|
|
1493
1783
|
}
|
|
1494
|
-
function
|
|
1495
|
-
let t =
|
|
1496
|
-
|
|
1497
|
-
n.value = e;
|
|
1498
|
-
}
|
|
1499
|
-
let l = C(() => {
|
|
1500
|
-
let e = [...a];
|
|
1501
|
-
if (!n.value) return e.sort((e, t) => e.label.localeCompare(t.label));
|
|
1502
|
-
let r = t.value.map((e) => ({
|
|
1784
|
+
function sr(e) {
|
|
1785
|
+
let t = l(e?.customFonts ?? []), n = l(!1), r = or(e?.builtIns), i = S(() => e?.defaultFallback ?? ar), a = S(() => {
|
|
1786
|
+
let e = [...r], n = t.value.map((e) => ({
|
|
1503
1787
|
value: e.name,
|
|
1504
1788
|
label: e.name,
|
|
1505
1789
|
isCustom: !0
|
|
1506
|
-
})), i = [...e, ...
|
|
1790
|
+
})), i = [...e, ...n];
|
|
1507
1791
|
return i.sort((e, t) => e.label.localeCompare(t.label)), i;
|
|
1508
1792
|
});
|
|
1509
|
-
function
|
|
1510
|
-
return
|
|
1511
|
-
}
|
|
1512
|
-
let d = e?.defaultFont ?? ir.split(",")[0].trim();
|
|
1513
|
-
u(d) || $.warn(`config.fonts: new templates seed "${d}", which the font picker doesn't offer — authors can't reselect it. Either add it to fonts.builtIns, or set fonts.defaultFont to an offered font.`);
|
|
1514
|
-
function f(e) {
|
|
1515
|
-
return nr.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1793
|
+
function s(e) {
|
|
1794
|
+
return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1516
1795
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
}
|
|
1796
|
+
let c = e?.defaultFont ?? ar.split(",")[0].trim();
|
|
1797
|
+
s(c) || X.warn(`config.fonts: new templates seed "${c}", which the font picker doesn't offer — authors can't reselect it. Either add it to fonts.builtIns, or set fonts.defaultFont to an offered font.`);
|
|
1798
|
+
function u() {
|
|
1799
|
+
if (e?.defaultFont && s(e.defaultFont)) {
|
|
1800
|
+
let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1801
|
+
if (t) return t.value;
|
|
1524
1802
|
}
|
|
1525
|
-
return
|
|
1803
|
+
return ar;
|
|
1526
1804
|
}
|
|
1527
|
-
let
|
|
1528
|
-
function
|
|
1529
|
-
if (!e) return
|
|
1805
|
+
let d = S(() => u());
|
|
1806
|
+
function f(e) {
|
|
1807
|
+
if (!e) return i.value;
|
|
1530
1808
|
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1531
|
-
return n ? `'${n.name}', ${n.fallback ??
|
|
1809
|
+
return n ? `'${n.name}', ${n.fallback ?? i.value}` : ir[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${i.value}`);
|
|
1532
1810
|
}
|
|
1533
|
-
let
|
|
1534
|
-
async function
|
|
1811
|
+
let p = [], m = !1;
|
|
1812
|
+
async function g() {
|
|
1535
1813
|
if (t.value.length === 0) {
|
|
1536
|
-
|
|
1814
|
+
m || (n.value = !0);
|
|
1537
1815
|
return;
|
|
1538
1816
|
}
|
|
1539
1817
|
let e = t.value.map(async (e) => {
|
|
1540
1818
|
try {
|
|
1541
1819
|
if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
|
|
1542
1820
|
let t = document.createElement("link");
|
|
1543
|
-
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name),
|
|
1821
|
+
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), p.push(t), await new Promise((n, r) => {
|
|
1544
1822
|
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
1545
1823
|
});
|
|
1546
1824
|
} catch (t) {
|
|
1547
|
-
|
|
1825
|
+
X.warn(`Failed to load custom font "${e.name}":`, t);
|
|
1548
1826
|
}
|
|
1549
1827
|
});
|
|
1550
|
-
await Promise.allSettled(e), !
|
|
1828
|
+
await Promise.allSettled(e), !m && (n.value = !0);
|
|
1551
1829
|
}
|
|
1552
|
-
function
|
|
1553
|
-
for (let e of
|
|
1554
|
-
|
|
1830
|
+
function _() {
|
|
1831
|
+
for (let e of p) e.remove();
|
|
1832
|
+
p.length = 0;
|
|
1555
1833
|
}
|
|
1556
|
-
return
|
|
1557
|
-
|
|
1834
|
+
return o() && h(() => {
|
|
1835
|
+
m = !0, _();
|
|
1558
1836
|
}), {
|
|
1559
|
-
fonts:
|
|
1560
|
-
defaultFont:
|
|
1561
|
-
defaultFallback:
|
|
1837
|
+
fonts: a,
|
|
1838
|
+
defaultFont: d,
|
|
1839
|
+
defaultFallback: i,
|
|
1562
1840
|
customFonts: t,
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
getFontWithFallback: h,
|
|
1569
|
-
getDefaultFont: p
|
|
1841
|
+
isLoaded: n,
|
|
1842
|
+
loadCustomFonts: g,
|
|
1843
|
+
cleanupFontLinks: _,
|
|
1844
|
+
getFontWithFallback: f,
|
|
1845
|
+
getDefaultFont: u
|
|
1570
1846
|
};
|
|
1571
1847
|
}
|
|
1572
1848
|
//#endregion
|
|
1573
1849
|
//#region src/composables/useLogicTag.ts
|
|
1574
|
-
function
|
|
1575
|
-
let e =
|
|
1576
|
-
async function
|
|
1577
|
-
if (
|
|
1578
|
-
|
|
1850
|
+
function cr() {
|
|
1851
|
+
let e = n(Ge, []), t = n(tt, []), r = n(ft, Ae.liquid), i = n(Ue, null), a = n(xt, null), o = l(!1), s = !!i || e.length > 0 || t.length > 0, c = e.length > 0 || t.length > 0;
|
|
1852
|
+
async function u() {
|
|
1853
|
+
if (i) {
|
|
1854
|
+
o.value = !0;
|
|
1579
1855
|
try {
|
|
1580
|
-
return await
|
|
1856
|
+
return await i();
|
|
1581
1857
|
} finally {
|
|
1582
|
-
|
|
1858
|
+
o.value = !1;
|
|
1583
1859
|
}
|
|
1584
1860
|
}
|
|
1585
|
-
if (
|
|
1586
|
-
|
|
1861
|
+
if (a && c) {
|
|
1862
|
+
o.value = !0;
|
|
1587
1863
|
try {
|
|
1588
|
-
return await
|
|
1864
|
+
return await a.open(e, t);
|
|
1589
1865
|
} finally {
|
|
1590
|
-
|
|
1866
|
+
o.value = !1;
|
|
1591
1867
|
}
|
|
1592
1868
|
}
|
|
1593
1869
|
return null;
|
|
@@ -1595,20 +1871,20 @@ function sr() {
|
|
|
1595
1871
|
return {
|
|
1596
1872
|
logicTags: e,
|
|
1597
1873
|
logicPairs: t,
|
|
1598
|
-
syntax:
|
|
1599
|
-
canInsertLogicTag:
|
|
1600
|
-
isRequesting:
|
|
1601
|
-
requestLogicTag:
|
|
1874
|
+
syntax: r,
|
|
1875
|
+
canInsertLogicTag: s,
|
|
1876
|
+
isRequesting: o,
|
|
1877
|
+
requestLogicTag: u
|
|
1602
1878
|
};
|
|
1603
1879
|
}
|
|
1604
1880
|
//#endregion
|
|
1605
1881
|
//#region src/utils/mergeTagNodeSpec.ts
|
|
1606
|
-
function
|
|
1607
|
-
return
|
|
1882
|
+
function lr(e, t, n) {
|
|
1883
|
+
return ve(e, n) ? {
|
|
1608
1884
|
type: "logicMergeTagNode",
|
|
1609
1885
|
attrs: {
|
|
1610
1886
|
value: e,
|
|
1611
|
-
keyword:
|
|
1887
|
+
keyword: ge(e, n)
|
|
1612
1888
|
}
|
|
1613
1889
|
} : {
|
|
1614
1890
|
type: "mergeTagNode",
|
|
@@ -1620,15 +1896,15 @@ function cr(e, t, n) {
|
|
|
1620
1896
|
}
|
|
1621
1897
|
//#endregion
|
|
1622
1898
|
//#region src/utils/insertLogicTag.ts
|
|
1623
|
-
function
|
|
1899
|
+
function ur(e) {
|
|
1624
1900
|
return "before" in e && "after" in e;
|
|
1625
1901
|
}
|
|
1626
|
-
function
|
|
1627
|
-
if (!
|
|
1628
|
-
e.chain().focus().insertContent(
|
|
1902
|
+
function dr(e, t, n) {
|
|
1903
|
+
if (!ur(t)) {
|
|
1904
|
+
e.chain().focus().insertContent(lr(t.value, t.label, n)).run();
|
|
1629
1905
|
return;
|
|
1630
1906
|
}
|
|
1631
|
-
let r =
|
|
1907
|
+
let r = lr(t.before, t.label, n), i = lr(t.after, t.label, n), { from: a, to: o } = e.state.selection;
|
|
1632
1908
|
if (a !== o) {
|
|
1633
1909
|
e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
1634
1910
|
return;
|
|
@@ -1637,20 +1913,20 @@ function ur(e, t, n) {
|
|
|
1637
1913
|
}
|
|
1638
1914
|
//#endregion
|
|
1639
1915
|
//#region src/utils/linkColorExtension.ts
|
|
1640
|
-
function
|
|
1916
|
+
function fr(e) {
|
|
1641
1917
|
if (!e) return null;
|
|
1642
1918
|
let t = e.trim();
|
|
1643
1919
|
return /^#[0-9a-f]{3,8}$/i.test(t) || /^(rgb|rgba|hsl|hsla)\(\s*[0-9.,%/\s]+\)$/i.test(t) || /^[a-z]+$/i.test(t) ? t : null;
|
|
1644
1920
|
}
|
|
1645
|
-
function
|
|
1921
|
+
function pr(e) {
|
|
1646
1922
|
return e.extend({ addAttributes() {
|
|
1647
1923
|
return {
|
|
1648
1924
|
...this.parent?.(),
|
|
1649
1925
|
color: {
|
|
1650
1926
|
default: null,
|
|
1651
|
-
parseHTML: (e) =>
|
|
1927
|
+
parseHTML: (e) => fr(Et(e.style.color)),
|
|
1652
1928
|
renderHTML: (e) => {
|
|
1653
|
-
let t =
|
|
1929
|
+
let t = fr(e.color);
|
|
1654
1930
|
return t ? { style: `color: ${t}` } : {};
|
|
1655
1931
|
}
|
|
1656
1932
|
}
|
|
@@ -1659,9 +1935,9 @@ function fr(e) {
|
|
|
1659
1935
|
}
|
|
1660
1936
|
//#endregion
|
|
1661
1937
|
//#region src/composables/useRichTextLinkDialog.ts
|
|
1662
|
-
function
|
|
1663
|
-
let t =
|
|
1664
|
-
|
|
1938
|
+
function mr(e) {
|
|
1939
|
+
let t = l(!1), n = l(""), r = l(""), i = l(null);
|
|
1940
|
+
tr(i, t);
|
|
1665
1941
|
function a() {
|
|
1666
1942
|
let i = e.value?.getAttributes("link") ?? {};
|
|
1667
1943
|
n.value = i.href || "", r.value = i.color || "", t.value = !0;
|
|
@@ -1670,11 +1946,11 @@ function pr(e) {
|
|
|
1670
1946
|
if (n.value) {
|
|
1671
1947
|
let t = c(n.value);
|
|
1672
1948
|
if (t !== null) {
|
|
1673
|
-
let n =
|
|
1949
|
+
let n = fr(r.value), i = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
|
|
1674
1950
|
n && typeof e.value?.commands.unsetColor == "function" && i?.unsetColor(), i?.run();
|
|
1675
1951
|
}
|
|
1676
1952
|
}
|
|
1677
|
-
|
|
1953
|
+
d();
|
|
1678
1954
|
}
|
|
1679
1955
|
let s = /* @__PURE__ */ new Set([
|
|
1680
1956
|
"http",
|
|
@@ -1694,14 +1970,14 @@ function pr(e) {
|
|
|
1694
1970
|
let n = /^([a-z][a-z0-9+.-]*):/i.exec(t);
|
|
1695
1971
|
return n ? s.has(n[1].toLowerCase()) ? t : null : `https://${t}`;
|
|
1696
1972
|
}
|
|
1697
|
-
function l() {
|
|
1698
|
-
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), u();
|
|
1699
|
-
}
|
|
1700
1973
|
function u() {
|
|
1974
|
+
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), d();
|
|
1975
|
+
}
|
|
1976
|
+
function d() {
|
|
1701
1977
|
t.value = !1, n.value = "", r.value = "";
|
|
1702
1978
|
}
|
|
1703
|
-
function
|
|
1704
|
-
e.key === "Enter" ? (e.preventDefault(), o()) : e.key === "Escape" &&
|
|
1979
|
+
function f(e) {
|
|
1980
|
+
e.key === "Enter" ? (e.preventDefault(), o()) : e.key === "Escape" && d();
|
|
1705
1981
|
}
|
|
1706
1982
|
return {
|
|
1707
1983
|
showLinkDialog: t,
|
|
@@ -1710,277 +1986,277 @@ function pr(e) {
|
|
|
1710
1986
|
linkDialogRef: i,
|
|
1711
1987
|
openLinkDialog: a,
|
|
1712
1988
|
insertLink: o,
|
|
1713
|
-
removeLink:
|
|
1714
|
-
closeLinkDialog:
|
|
1715
|
-
handleLinkKeydown:
|
|
1989
|
+
removeLink: u,
|
|
1990
|
+
closeLinkDialog: d,
|
|
1991
|
+
handleLinkKeydown: f
|
|
1716
1992
|
};
|
|
1717
1993
|
}
|
|
1718
1994
|
//#endregion
|
|
1719
1995
|
//#region src/composables/useRichTextEditor.ts
|
|
1720
|
-
function
|
|
1721
|
-
let
|
|
1722
|
-
async function
|
|
1723
|
-
|
|
1996
|
+
function hr(r) {
|
|
1997
|
+
let i = n(J, null), { mergeTags: a, canRequestMergeTag: o, isRequesting: s, requestMergeTag: c, syntax: u, autocomplete: d } = Q(), { canInsertLogicTag: f, isRequesting: p, requestLogicTag: m } = cr(), h = n(nt, null), g = (N(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = Te(u), v = x(null), { showLinkDialog: y, linkUrl: b, linkColor: S, linkDialogRef: C, openLinkDialog: w, insertLink: T, removeLink: E, closeLinkDialog: D, handleLinkKeydown: O } = mr(v), { start: k, stop: A } = Ie(() => v.value?.commands.focus("end"), 0, { immediate: !1 }), j = x(null), M = l(!0), P = l(null), F = !1;
|
|
1998
|
+
async function I() {
|
|
1999
|
+
P.value = null, M.value = !0;
|
|
1724
2000
|
try {
|
|
1725
|
-
let { TiptapEditor: e, EC:
|
|
1726
|
-
mergeTags:
|
|
1727
|
-
syntax:
|
|
1728
|
-
triggerChar:
|
|
1729
|
-
autocompleteEnabled:
|
|
1730
|
-
suggestionEmptyText:
|
|
2001
|
+
let { TiptapEditor: e, EC: t, extensions: n } = await r.loadExtensions({
|
|
2002
|
+
mergeTags: a,
|
|
2003
|
+
syntax: u,
|
|
2004
|
+
triggerChar: _,
|
|
2005
|
+
autocompleteEnabled: d,
|
|
2006
|
+
suggestionEmptyText: g
|
|
1731
2007
|
});
|
|
1732
|
-
if (
|
|
1733
|
-
j.value =
|
|
2008
|
+
if (F) return;
|
|
2009
|
+
j.value = t;
|
|
1734
2010
|
let o = /* @__PURE__ */ new Map();
|
|
1735
|
-
|
|
2011
|
+
n.forEach((e, t) => o.set(e.name, t));
|
|
1736
2012
|
let s = new e({
|
|
1737
|
-
extensions:
|
|
1738
|
-
content:
|
|
2013
|
+
extensions: n.filter((e, t) => o.get(e.name) === t),
|
|
2014
|
+
content: r.blockContent(),
|
|
1739
2015
|
editable: !0,
|
|
1740
2016
|
onUpdate: ({ editor: e }) => {
|
|
1741
|
-
|
|
2017
|
+
F || i && i.updateBlock(r.blockId(), { content: e.getHTML() });
|
|
1742
2018
|
}
|
|
1743
2019
|
});
|
|
1744
|
-
if (
|
|
2020
|
+
if (F) {
|
|
1745
2021
|
s.destroy();
|
|
1746
2022
|
return;
|
|
1747
2023
|
}
|
|
1748
|
-
|
|
2024
|
+
v.value = s, M.value = !1, k();
|
|
1749
2025
|
} catch (e) {
|
|
1750
|
-
if (
|
|
1751
|
-
|
|
2026
|
+
if (F) return;
|
|
2027
|
+
X.error(`[${r.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, e), P.value = e instanceof Error ? e.message : "Failed to load editor", M.value = !1;
|
|
1752
2028
|
}
|
|
1753
2029
|
}
|
|
1754
|
-
function
|
|
1755
|
-
|
|
2030
|
+
function L() {
|
|
2031
|
+
v.value?.destroy(), v.value = null, I();
|
|
1756
2032
|
}
|
|
1757
|
-
|
|
1758
|
-
let
|
|
1759
|
-
|
|
2033
|
+
I();
|
|
2034
|
+
let R = t(() => r.blockContent(), (e) => {
|
|
2035
|
+
v.value && v.value.getHTML() !== e && v.value.commands.setContent(e, { emitUpdate: !1 });
|
|
1760
2036
|
});
|
|
1761
|
-
function
|
|
1762
|
-
if (
|
|
1763
|
-
let
|
|
1764
|
-
if (!
|
|
1765
|
-
|
|
1766
|
-
let i =
|
|
1767
|
-
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
|
|
2037
|
+
function z(e) {
|
|
2038
|
+
if (s.value || p.value) return;
|
|
2039
|
+
let t = e.composedPath(), n = t.find((e) => e instanceof HTMLElement);
|
|
2040
|
+
if (!n) return;
|
|
2041
|
+
r.onClickOutsideSideEffect?.(n);
|
|
2042
|
+
let i = t.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
|
|
2043
|
+
n.closest(".tpl-text-editor-wrapper") || n.closest(".tpl-text-toolbar") || n.closest(".tpl-link-dialog") || i || r.onDone();
|
|
2044
|
+
}
|
|
2045
|
+
G(document, "mousedown", z), e(() => {
|
|
2046
|
+
F = !0, R(), A(), v.value?.destroy();
|
|
1771
2047
|
});
|
|
1772
|
-
async function
|
|
1773
|
-
let e = await
|
|
1774
|
-
|
|
2048
|
+
async function B() {
|
|
2049
|
+
let e = await c();
|
|
2050
|
+
F || (e && v.value ? v.value.chain().focus().insertMergeTag({
|
|
1775
2051
|
label: e.label,
|
|
1776
2052
|
value: e.value
|
|
1777
|
-
}).run() :
|
|
2053
|
+
}).run() : v.value?.commands.focus());
|
|
1778
2054
|
}
|
|
1779
|
-
async function
|
|
1780
|
-
let e = await
|
|
1781
|
-
|
|
2055
|
+
async function V() {
|
|
2056
|
+
let e = await m();
|
|
2057
|
+
F || (e && v.value ? dr(v.value, e, u) : v.value?.commands.focus());
|
|
1782
2058
|
}
|
|
1783
2059
|
return {
|
|
1784
|
-
editor:
|
|
2060
|
+
editor: v,
|
|
1785
2061
|
EditorContent: j,
|
|
1786
2062
|
isLoading: M,
|
|
1787
|
-
initError:
|
|
1788
|
-
retry:
|
|
2063
|
+
initError: P,
|
|
2064
|
+
retry: L,
|
|
1789
2065
|
showLinkDialog: y,
|
|
1790
2066
|
linkUrl: b,
|
|
1791
|
-
linkColor:
|
|
1792
|
-
linkDialogRef:
|
|
1793
|
-
mergeTags:
|
|
1794
|
-
canRequestMergeTag:
|
|
1795
|
-
isRequestingMergeTag:
|
|
1796
|
-
syntax:
|
|
1797
|
-
canInsertLogicTag:
|
|
1798
|
-
isRequestingLogicTag:
|
|
1799
|
-
openLinkDialog:
|
|
1800
|
-
insertLink:
|
|
1801
|
-
removeLink:
|
|
1802
|
-
closeLinkDialog:
|
|
2067
|
+
linkColor: S,
|
|
2068
|
+
linkDialogRef: C,
|
|
2069
|
+
mergeTags: a,
|
|
2070
|
+
canRequestMergeTag: o,
|
|
2071
|
+
isRequestingMergeTag: s,
|
|
2072
|
+
syntax: u,
|
|
2073
|
+
canInsertLogicTag: f,
|
|
2074
|
+
isRequestingLogicTag: p,
|
|
2075
|
+
openLinkDialog: w,
|
|
2076
|
+
insertLink: T,
|
|
2077
|
+
removeLink: E,
|
|
2078
|
+
closeLinkDialog: D,
|
|
1803
2079
|
handleLinkKeydown: O,
|
|
1804
|
-
handleAddMergeTag:
|
|
1805
|
-
handleAddLogicTag:
|
|
2080
|
+
handleAddMergeTag: B,
|
|
2081
|
+
handleAddLogicTag: V
|
|
1806
2082
|
};
|
|
1807
2083
|
}
|
|
1808
2084
|
//#endregion
|
|
1809
2085
|
//#region src/composables/useSmallScreenNotice.ts
|
|
1810
|
-
var
|
|
1811
|
-
function
|
|
1812
|
-
let t =
|
|
2086
|
+
var gr = "(max-width: 767px)";
|
|
2087
|
+
function _r(e) {
|
|
2088
|
+
let t = Be(gr);
|
|
1813
2089
|
return {
|
|
1814
2090
|
isSmallScreen: t,
|
|
1815
|
-
showNotice:
|
|
2091
|
+
showNotice: S(() => (P(e) ?? !0) && t.value)
|
|
1816
2092
|
};
|
|
1817
2093
|
}
|
|
1818
2094
|
//#endregion
|
|
1819
2095
|
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1820
|
-
var
|
|
2096
|
+
var vr = { class: "tpl:w-full" }, yr = {
|
|
1821
2097
|
key: 0,
|
|
1822
2098
|
class: "tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-warning)] tpl:bg-[var(--tpl-warning-light)]"
|
|
1823
|
-
},
|
|
2099
|
+
}, br = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, xr = {
|
|
1824
2100
|
key: 1,
|
|
1825
2101
|
class: "tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-danger-light)]"
|
|
1826
|
-
},
|
|
2102
|
+
}, Sr = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Cr = {
|
|
1827
2103
|
key: 2,
|
|
1828
2104
|
class: "tpl:relative"
|
|
1829
|
-
},
|
|
2105
|
+
}, wr = ["innerHTML"], Tr = {
|
|
1830
2106
|
key: 0,
|
|
1831
2107
|
class: "tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:rounded tpl:backdrop-blur-[2px]",
|
|
1832
2108
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
1833
|
-
},
|
|
2109
|
+
}, Er = /* @__PURE__ */ d({
|
|
1834
2110
|
__name: "CustomBlock",
|
|
1835
2111
|
props: {
|
|
1836
2112
|
block: {},
|
|
1837
2113
|
viewport: {}
|
|
1838
2114
|
},
|
|
1839
2115
|
emits: ["fetchData"],
|
|
1840
|
-
setup(e, { emit:
|
|
1841
|
-
let
|
|
1842
|
-
definition:
|
|
1843
|
-
block:
|
|
2116
|
+
setup(e, { emit: r }) {
|
|
2117
|
+
let i = e, a = r, { t: o } = Y(), c = n(vt, null), u = l(""), d = l(!1), f = S(() => c?.getDefinition(i.block.customType)), p = S(() => !!f.value), { isFetching: m, fetch: h, needsFetch: g, hasDataSource: y } = cn({
|
|
2118
|
+
definition: f,
|
|
2119
|
+
block: S(() => i.block),
|
|
1844
2120
|
onUpdate: (e, t) => {
|
|
1845
|
-
|
|
2121
|
+
a("fetchData", {
|
|
1846
2122
|
fieldValues: e,
|
|
1847
2123
|
dataSourceFetched: t
|
|
1848
2124
|
});
|
|
1849
2125
|
}
|
|
1850
|
-
}),
|
|
1851
|
-
if (!
|
|
2126
|
+
}), b = n(K, []), x = n(q, null), T = S(() => {
|
|
2127
|
+
if (!x?.value) return i.block;
|
|
1852
2128
|
let e = {};
|
|
1853
|
-
for (let [t, n] of Object.entries(
|
|
2129
|
+
for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ? he(n, b) : n;
|
|
1854
2130
|
return {
|
|
1855
|
-
...
|
|
2131
|
+
...i.block,
|
|
1856
2132
|
fieldValues: e
|
|
1857
2133
|
};
|
|
1858
2134
|
});
|
|
1859
|
-
async function
|
|
1860
|
-
if (
|
|
1861
|
-
|
|
2135
|
+
async function D() {
|
|
2136
|
+
if (c) {
|
|
2137
|
+
d.value = !1;
|
|
1862
2138
|
try {
|
|
1863
|
-
let e = await
|
|
1864
|
-
e.includes("Template render error:") && (
|
|
2139
|
+
let e = await c.renderCustomBlock(T.value);
|
|
2140
|
+
e.includes("Template render error:") && (d.value = !0), u.value = e;
|
|
1865
2141
|
} catch {
|
|
1866
|
-
|
|
2142
|
+
d.value = !0, u.value = "";
|
|
1867
2143
|
}
|
|
1868
2144
|
}
|
|
1869
2145
|
}
|
|
1870
|
-
let
|
|
1871
|
-
return
|
|
1872
|
-
|
|
1873
|
-
}),
|
|
1874
|
-
|
|
1875
|
-
}, { deep: !0 }),
|
|
1876
|
-
|
|
1877
|
-
}), (e, t) => (
|
|
2146
|
+
let k = Le(D, 150);
|
|
2147
|
+
return E(() => {
|
|
2148
|
+
D();
|
|
2149
|
+
}), t(() => i.block.fieldValues, () => {
|
|
2150
|
+
k();
|
|
2151
|
+
}, { deep: !0 }), t(() => x?.value, () => {
|
|
2152
|
+
k();
|
|
2153
|
+
}), (e, t) => (s(), C("div", vr, [p.value ? d.value ? (s(), C("div", xr, [v(_(Ut), {
|
|
1878
2154
|
size: 24,
|
|
1879
2155
|
class: "tpl:text-[var(--tpl-danger)]"
|
|
1880
|
-
}), M("span",
|
|
2156
|
+
}), M("span", Sr, R(_(o).customBlocks.renderError), 1)])) : (s(), C("div", Cr, [M("div", { innerHTML: u.value }, null, 8, wr), _(y) && _(g) ? (s(), C("div", Tr, [_(m) ? (s(), A(qt, {
|
|
1881
2157
|
key: 1,
|
|
1882
2158
|
class: "tpl:w-48"
|
|
1883
|
-
})) : (
|
|
2159
|
+
})) : (s(), C("button", {
|
|
1884
2160
|
key: 0,
|
|
1885
2161
|
type: "button",
|
|
1886
|
-
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-
|
|
1887
|
-
onClick: t[0] ||= O((...e) =>
|
|
1888
|
-
}, [
|
|
2162
|
+
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-[var(--tpl-shadow)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:shadow-[var(--tpl-shadow-md)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
|
|
2163
|
+
onClick: t[0] ||= O((...e) => _(h) && _(h)(...e), ["stop"])
|
|
2164
|
+
}, [f.value?.icon ? (s(), A(Qn, {
|
|
1889
2165
|
key: 0,
|
|
1890
|
-
icon:
|
|
2166
|
+
icon: f.value.icon,
|
|
1891
2167
|
size: 16
|
|
1892
|
-
}, null, 8, ["icon"])) :
|
|
2168
|
+
}, null, 8, ["icon"])) : w("", !0), V(" " + R(f.value?.dataSource?.label || _(o).customBlocks.dataSource.fetchButton), 1)]))])) : w("", !0)])) : (s(), C("div", yr, [v(_(Mt), {
|
|
1893
2169
|
size: 24,
|
|
1894
2170
|
class: "tpl:text-[var(--tpl-warning)]"
|
|
1895
|
-
}), M("span",
|
|
2171
|
+
}), M("span", br, R(_(o).customBlocks.definitionNotFound), 1)]))]));
|
|
1896
2172
|
}
|
|
1897
|
-
}),
|
|
2173
|
+
}), Dr = { class: "tpl:w-full" }, Or = /* @__PURE__ */ d({
|
|
1898
2174
|
__name: "DividerBlock",
|
|
1899
2175
|
props: {
|
|
1900
2176
|
block: {},
|
|
1901
2177
|
viewport: {}
|
|
1902
2178
|
},
|
|
1903
2179
|
setup(e) {
|
|
1904
|
-
let t = e, n =
|
|
2180
|
+
let t = e, n = S(() => ({
|
|
1905
2181
|
borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
|
|
1906
2182
|
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
1907
2183
|
margin: t.block.width === "full" ? "0" : "0 auto"
|
|
1908
2184
|
}));
|
|
1909
|
-
return (e, t) => (
|
|
2185
|
+
return (e, t) => (s(), C("div", Dr, [M("hr", {
|
|
1910
2186
|
class: "tpl:m-0 tpl:border-none",
|
|
1911
|
-
style:
|
|
2187
|
+
style: k(n.value)
|
|
1912
2188
|
}, null, 4)]));
|
|
1913
2189
|
}
|
|
1914
|
-
}),
|
|
2190
|
+
}), kr = { class: "tpl:w-full" }, Ar = ["srcdoc", "title"], jr = {
|
|
1915
2191
|
key: 1,
|
|
1916
2192
|
class: "tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
|
|
1917
|
-
},
|
|
2193
|
+
}, Mr = {
|
|
1918
2194
|
key: 0,
|
|
1919
2195
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
1920
|
-
},
|
|
2196
|
+
}, Nr = {
|
|
1921
2197
|
key: 1,
|
|
1922
2198
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
1923
|
-
},
|
|
2199
|
+
}, Pr = /* @__PURE__ */ d({
|
|
1924
2200
|
__name: "HtmlBlock",
|
|
1925
2201
|
props: {
|
|
1926
2202
|
block: {},
|
|
1927
2203
|
viewport: {}
|
|
1928
2204
|
},
|
|
1929
|
-
setup(
|
|
1930
|
-
let
|
|
1931
|
-
function
|
|
1932
|
-
let e =
|
|
1933
|
-
e && (
|
|
1934
|
-
}
|
|
1935
|
-
function
|
|
1936
|
-
|
|
1937
|
-
let e =
|
|
1938
|
-
e && typeof ResizeObserver < "u" && (
|
|
1939
|
-
}
|
|
1940
|
-
return
|
|
1941
|
-
e || (
|
|
1942
|
-
}),
|
|
1943
|
-
|
|
1944
|
-
}), (e, t) => (
|
|
2205
|
+
setup(r) {
|
|
2206
|
+
let i = r, { t: a } = Y(), o = n(Ct, !1), c = S(() => i.block.content.trim().length > 0), u = S(() => o && c.value), d = n(K, []), f = n(q, null), p = S(() => f?.value ? he(i.block.content, d) : i.block.content), m = l(null), h = l(60), g = null;
|
|
2207
|
+
function y() {
|
|
2208
|
+
let e = m.value?.contentDocument;
|
|
2209
|
+
e && (h.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
|
|
2210
|
+
}
|
|
2211
|
+
function b() {
|
|
2212
|
+
g?.disconnect(), g = null, y();
|
|
2213
|
+
let e = m.value?.contentDocument?.documentElement;
|
|
2214
|
+
e && typeof ResizeObserver < "u" && (g = new ResizeObserver(() => y()), g.observe(e));
|
|
2215
|
+
}
|
|
2216
|
+
return t(u, (e) => {
|
|
2217
|
+
e || (g?.disconnect(), g = null);
|
|
2218
|
+
}), e(() => {
|
|
2219
|
+
g?.disconnect(), g = null;
|
|
2220
|
+
}), (e, t) => (s(), C("div", kr, [u.value ? (s(), C("iframe", {
|
|
1945
2221
|
key: 0,
|
|
1946
2222
|
ref_key: "iframeRef",
|
|
1947
|
-
ref:
|
|
1948
|
-
srcdoc:
|
|
2223
|
+
ref: m,
|
|
2224
|
+
srcdoc: p.value,
|
|
1949
2225
|
sandbox: "allow-same-origin",
|
|
1950
|
-
title:
|
|
2226
|
+
title: _(a).html.preview,
|
|
1951
2227
|
class: "tpl:block tpl:w-full tpl:border-0",
|
|
1952
|
-
style:
|
|
1953
|
-
onLoad:
|
|
1954
|
-
}, null, 44,
|
|
2228
|
+
style: k({ height: `${h.value}px` }),
|
|
2229
|
+
onLoad: b
|
|
2230
|
+
}, null, 44, Ar)) : (s(), C("div", jr, [v(_(Nt), {
|
|
1955
2231
|
size: 24,
|
|
1956
2232
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
1957
|
-
}),
|
|
2233
|
+
}), c.value ? (s(), C("span", Mr, R(_(a).html.preview), 1)) : (s(), C("span", Nr, R(_(a).html.empty), 1))]))]));
|
|
1958
2234
|
}
|
|
1959
|
-
}),
|
|
1960
|
-
function
|
|
1961
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 ||
|
|
2235
|
+
}), Fr = "image/";
|
|
2236
|
+
function Ir(e) {
|
|
2237
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || P(r), { isOverDropZone: a } = He(t, {
|
|
1962
2238
|
preventDefaultForUnhandled: !0,
|
|
1963
2239
|
onDrop: (e) => {
|
|
1964
2240
|
if (!i()) return;
|
|
1965
|
-
let t = (e ?? []).filter((e) => e.type.startsWith(
|
|
2241
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(Fr));
|
|
1966
2242
|
t.length > 0 && n([t[0]]);
|
|
1967
2243
|
}
|
|
1968
2244
|
});
|
|
1969
|
-
return { isOver:
|
|
2245
|
+
return { isOver: S(() => i() && a.value) };
|
|
1970
2246
|
}
|
|
1971
2247
|
//#endregion
|
|
1972
2248
|
//#region src/components/blocks/ImageBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1973
|
-
var
|
|
2249
|
+
var Lr = {
|
|
1974
2250
|
key: 0,
|
|
1975
2251
|
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-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
|
|
1976
2252
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 85%, transparent)" }
|
|
1977
|
-
},
|
|
2253
|
+
}, Rr = ["href"], zr = ["src", "alt"], Br = ["src", "alt"], Vr = {
|
|
1978
2254
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
1979
2255
|
style: { opacity: "0.7" }
|
|
1980
|
-
},
|
|
2256
|
+
}, Hr = ["href"], Ur = ["src", "alt"], Wr = ["src", "alt"], Gr = {
|
|
1981
2257
|
key: 4,
|
|
1982
2258
|
class: "tpl:flex tpl:min-h-[100px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
|
|
1983
|
-
},
|
|
2259
|
+
}, Kr = ["aria-label"], qr = { key: 1 }, Jr = /* @__PURE__ */ d({
|
|
1984
2260
|
__name: "ImageBlock",
|
|
1985
2261
|
props: {
|
|
1986
2262
|
block: {},
|
|
@@ -1988,61 +2264,61 @@ var Ir = {
|
|
|
1988
2264
|
},
|
|
1989
2265
|
emits: ["update"],
|
|
1990
2266
|
setup(e, { emit: t }) {
|
|
1991
|
-
let
|
|
1992
|
-
async function
|
|
1993
|
-
let e = await
|
|
1994
|
-
if (
|
|
2267
|
+
let r = e, i = t, { t: a } = Y(), { syntax: o } = Q(), c = n(dt, null), u = S(() => !!c), d = Yt();
|
|
2268
|
+
async function f() {
|
|
2269
|
+
let e = await c?.({ accept: ["images"] });
|
|
2270
|
+
if (d.alive && e) {
|
|
1995
2271
|
let t = { src: e.url };
|
|
1996
|
-
e.alt && (t.alt = e.alt),
|
|
2272
|
+
e.alt && (t.alt = e.alt), i("update", t);
|
|
1997
2273
|
}
|
|
1998
2274
|
}
|
|
1999
|
-
let
|
|
2000
|
-
async function
|
|
2001
|
-
if (
|
|
2002
|
-
|
|
2275
|
+
let p = l(), m = l(!1), h = S(() => u.value && !m.value && !T.value);
|
|
2276
|
+
async function g(e) {
|
|
2277
|
+
if (c) {
|
|
2278
|
+
m.value = !0;
|
|
2003
2279
|
try {
|
|
2004
|
-
let t = await
|
|
2280
|
+
let t = await c({
|
|
2005
2281
|
accept: ["images"],
|
|
2006
2282
|
files: e
|
|
2007
2283
|
});
|
|
2008
|
-
if (!
|
|
2284
|
+
if (!d.alive) return;
|
|
2009
2285
|
if (t) {
|
|
2010
2286
|
let e = { src: t.url };
|
|
2011
|
-
t.alt && (e.alt = t.alt),
|
|
2287
|
+
t.alt && (e.alt = t.alt), i("update", e);
|
|
2012
2288
|
}
|
|
2013
2289
|
} finally {
|
|
2014
|
-
|
|
2290
|
+
d.alive && (m.value = !1);
|
|
2015
2291
|
}
|
|
2016
2292
|
}
|
|
2017
2293
|
}
|
|
2018
|
-
let { isOver:
|
|
2019
|
-
target:
|
|
2020
|
-
enabled:
|
|
2021
|
-
onFiles:
|
|
2022
|
-
}),
|
|
2023
|
-
let e =
|
|
2294
|
+
let { isOver: y } = Ir({
|
|
2295
|
+
target: p,
|
|
2296
|
+
enabled: h,
|
|
2297
|
+
onFiles: g
|
|
2298
|
+
}), b = S(() => ({ textAlign: r.block.align })), x = S(() => {
|
|
2299
|
+
let e = r.block.align;
|
|
2024
2300
|
return {
|
|
2025
2301
|
maxWidth: "100%",
|
|
2026
|
-
width:
|
|
2302
|
+
width: r.block.width === "full" ? "100%" : `${r.block.width}px`,
|
|
2027
2303
|
display: "block",
|
|
2028
2304
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
2029
2305
|
marginRight: e === "center" ? "auto" : void 0
|
|
2030
2306
|
};
|
|
2031
|
-
}),
|
|
2032
|
-
return (t, n) => (
|
|
2307
|
+
}), T = S(() => U(r.block.src, o)), E = Sn(() => T.value ? void 0 : r.block.src), D = Sn(() => T.value ? r.block.placeholderUrl : void 0);
|
|
2308
|
+
return (t, n) => (s(), C("div", {
|
|
2033
2309
|
ref_key: "dropZoneRef",
|
|
2034
|
-
ref:
|
|
2310
|
+
ref: p,
|
|
2035
2311
|
"data-testid": "image-drop-zone",
|
|
2036
2312
|
class: "tpl:relative tpl:w-full",
|
|
2037
|
-
style:
|
|
2038
|
-
}, [
|
|
2313
|
+
style: k(b.value)
|
|
2314
|
+
}, [h.value && (_(y) || m.value) ? (s(), C("div", Lr, [m.value ? (s(), C(L, { key: 0 }, [v(_(zt), {
|
|
2039
2315
|
class: "tpl-spinner",
|
|
2040
2316
|
size: 20,
|
|
2041
2317
|
"stroke-width": 2
|
|
2042
|
-
}),
|
|
2318
|
+
}), V(" " + R(_(a).image.uploading), 1)], 64)) : (s(), C(L, { key: 1 }, [v(_(Vt), {
|
|
2043
2319
|
size: 20,
|
|
2044
2320
|
"stroke-width": 1.5
|
|
2045
|
-
}),
|
|
2321
|
+
}), V(" " + R(_(a).image.dropToUpload), 1)], 64))])) : w("", !0), e.block.src && T.value && e.block.placeholderUrl ? (s(), C(L, { key: 1 }, [e.block.linkUrl ? (s(), C("a", {
|
|
2046
2322
|
key: 0,
|
|
2047
2323
|
href: e.block.linkUrl,
|
|
2048
2324
|
target: "_blank",
|
|
@@ -2051,25 +2327,25 @@ var Ir = {
|
|
|
2051
2327
|
}, [M("img", {
|
|
2052
2328
|
class: "tpl:border-0",
|
|
2053
2329
|
loading: "lazy",
|
|
2054
|
-
src:
|
|
2055
|
-
alt: e.block.alt ||
|
|
2056
|
-
style:
|
|
2057
|
-
}, null, 12,
|
|
2330
|
+
src: _(D),
|
|
2331
|
+
alt: e.block.alt || _(a).image.altTextPlaceholder,
|
|
2332
|
+
style: k(x.value)
|
|
2333
|
+
}, null, 12, zr)], 8, Rr)) : (s(), C("img", {
|
|
2058
2334
|
key: 1,
|
|
2059
2335
|
class: "tpl:border-0",
|
|
2060
|
-
src:
|
|
2336
|
+
src: _(D),
|
|
2061
2337
|
alt: e.block.alt,
|
|
2062
|
-
style:
|
|
2063
|
-
}, null, 12,
|
|
2338
|
+
style: k(x.value)
|
|
2339
|
+
}, null, 12, Br))], 64)) : e.block.src && T.value ? (s(), C("div", {
|
|
2064
2340
|
key: 2,
|
|
2065
2341
|
class: "tpl:!flex tpl:min-h-[120px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
|
|
2066
|
-
style:
|
|
2067
|
-
}, [
|
|
2342
|
+
style: k([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, x.value])
|
|
2343
|
+
}, [v(_(Lt), {
|
|
2068
2344
|
size: 32,
|
|
2069
2345
|
"stroke-width": 1.5,
|
|
2070
2346
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
2071
2347
|
style: { opacity: "0.5" }
|
|
2072
|
-
}), M("span",
|
|
2348
|
+
}), M("span", Vr, [v(qn, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (s(), C(L, { key: 3 }, [e.block.linkUrl ? (s(), C("a", {
|
|
2073
2349
|
key: 0,
|
|
2074
2350
|
href: e.block.linkUrl,
|
|
2075
2351
|
target: "_blank",
|
|
@@ -2078,36 +2354,36 @@ var Ir = {
|
|
|
2078
2354
|
}, [M("img", {
|
|
2079
2355
|
class: "tpl:border-0",
|
|
2080
2356
|
loading: "lazy",
|
|
2081
|
-
src: E
|
|
2082
|
-
alt: e.block.alt ||
|
|
2083
|
-
style:
|
|
2084
|
-
}, null, 12,
|
|
2357
|
+
src: _(E),
|
|
2358
|
+
alt: e.block.alt || _(a).image.altTextPlaceholder,
|
|
2359
|
+
style: k(x.value)
|
|
2360
|
+
}, null, 12, Ur)], 8, Hr)) : (s(), C("img", {
|
|
2085
2361
|
key: 1,
|
|
2086
2362
|
class: "tpl:border-0",
|
|
2087
|
-
src: E
|
|
2363
|
+
src: _(E),
|
|
2088
2364
|
alt: e.block.alt,
|
|
2089
|
-
style:
|
|
2090
|
-
}, null, 12,
|
|
2365
|
+
style: k(x.value)
|
|
2366
|
+
}, null, 12, Wr))], 64)) : (s(), C("div", Gr, [u.value ? (s(), C("button", {
|
|
2091
2367
|
key: 0,
|
|
2092
|
-
"aria-label":
|
|
2093
|
-
class: "tpl:flex tpl:items-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:
|
|
2094
|
-
onClick: O(
|
|
2095
|
-
}, [
|
|
2368
|
+
"aria-label": _(a).image.browseMedia,
|
|
2369
|
+
class: "tpl:flex tpl:items-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:cursor-pointer tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
|
|
2370
|
+
onClick: O(f, ["stop"])
|
|
2371
|
+
}, [v(_(Lt), {
|
|
2096
2372
|
size: 14,
|
|
2097
2373
|
"stroke-width": 1.5
|
|
2098
|
-
}),
|
|
2374
|
+
}), V(" " + R(_(a).image.browseMedia), 1)], 8, Kr)) : (s(), C("span", qr, R(_(a).image.clickToAdd), 1))]))], 4));
|
|
2099
2375
|
}
|
|
2100
|
-
}),
|
|
2376
|
+
}), Yr = { class: "tpl:w-full" }, Xr = ["href"], Zr = {
|
|
2101
2377
|
key: 1,
|
|
2102
2378
|
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
2103
|
-
},
|
|
2379
|
+
}, Qr = /* @__PURE__ */ d({
|
|
2104
2380
|
__name: "MenuBlock",
|
|
2105
2381
|
props: {
|
|
2106
2382
|
block: {},
|
|
2107
2383
|
viewport: {}
|
|
2108
2384
|
},
|
|
2109
2385
|
setup(e) {
|
|
2110
|
-
let t = e, { t: n } =
|
|
2386
|
+
let t = e, { t: n } = Y(), i = S(() => ({
|
|
2111
2387
|
display: "flex",
|
|
2112
2388
|
flexWrap: "wrap",
|
|
2113
2389
|
gap: `0 ${t.block.spacing}px`,
|
|
@@ -2115,31 +2391,31 @@ var Ir = {
|
|
|
2115
2391
|
fontSize: `${t.block.fontSize}px`,
|
|
2116
2392
|
fontFamily: t.block.fontFamily || "inherit",
|
|
2117
2393
|
alignItems: "center"
|
|
2118
|
-
})),
|
|
2119
|
-
function
|
|
2394
|
+
})), a = S(() => t.block.items.length > 0);
|
|
2395
|
+
function o(e) {
|
|
2120
2396
|
return e || t.block.linkColor || t.block.color;
|
|
2121
2397
|
}
|
|
2122
|
-
return (t,
|
|
2398
|
+
return (t, c) => (s(), C("div", Yr, [a.value ? (s(), C("div", {
|
|
2123
2399
|
key: 0,
|
|
2124
|
-
style:
|
|
2125
|
-
}, [(
|
|
2400
|
+
style: k(i.value)
|
|
2401
|
+
}, [(s(!0), C(L, null, r(e.block.items, (t, n) => (s(), C(L, { key: t.id }, [M("a", {
|
|
2126
2402
|
href: t.url || "#",
|
|
2127
2403
|
class: "tpl:cursor-default tpl:no-underline",
|
|
2128
|
-
style:
|
|
2129
|
-
color:
|
|
2404
|
+
style: k({
|
|
2405
|
+
color: o(t.color),
|
|
2130
2406
|
fontWeight: t.bold ? "bold" : "normal",
|
|
2131
2407
|
textDecoration: t.underline ? "underline" : "none"
|
|
2132
2408
|
}),
|
|
2133
|
-
onClick:
|
|
2134
|
-
}, [
|
|
2409
|
+
onClick: c[0] ||= O(() => {}, ["prevent"])
|
|
2410
|
+
}, [v(qn, { text: t.text || "..." }, null, 8, ["text"])], 12, Xr), n < e.block.items.length - 1 ? (s(), C("span", {
|
|
2135
2411
|
key: 0,
|
|
2136
|
-
style:
|
|
2412
|
+
style: k({
|
|
2137
2413
|
color: e.block.separatorColor,
|
|
2138
2414
|
padding: `0 ${e.block.spacing}px`
|
|
2139
2415
|
})
|
|
2140
|
-
},
|
|
2416
|
+
}, R(e.block.separator), 5)) : w("", !0)], 64))), 128))], 4)) : (s(), C("div", Zr, [v(_(Ft), { size: 16 }), M("span", null, R(_(n).menu.addLinks), 1)]))]));
|
|
2141
2417
|
}
|
|
2142
|
-
}),
|
|
2418
|
+
}), $r = /* @__PURE__ */ new Set([
|
|
2143
2419
|
"http",
|
|
2144
2420
|
"https",
|
|
2145
2421
|
"mailto",
|
|
@@ -2149,7 +2425,7 @@ var Ir = {
|
|
|
2149
2425
|
"sms",
|
|
2150
2426
|
"xmpp",
|
|
2151
2427
|
"cid"
|
|
2152
|
-
]),
|
|
2428
|
+
]), ei = /* @__PURE__ */ new Set([
|
|
2153
2429
|
"SCRIPT",
|
|
2154
2430
|
"STYLE",
|
|
2155
2431
|
"IFRAME",
|
|
@@ -2159,7 +2435,7 @@ var Ir = {
|
|
|
2159
2435
|
"META",
|
|
2160
2436
|
"BASE",
|
|
2161
2437
|
"FORM"
|
|
2162
|
-
]),
|
|
2438
|
+
]), ti = /* @__PURE__ */ new Set([
|
|
2163
2439
|
"href",
|
|
2164
2440
|
"xlink:href",
|
|
2165
2441
|
"formaction",
|
|
@@ -2168,16 +2444,16 @@ var Ir = {
|
|
|
2168
2444
|
"background",
|
|
2169
2445
|
"poster"
|
|
2170
2446
|
]);
|
|
2171
|
-
function
|
|
2447
|
+
function ni(e, t) {
|
|
2172
2448
|
let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2173
2449
|
if (!n || n.startsWith("#")) return !0;
|
|
2174
2450
|
let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
|
|
2175
2451
|
if (!r) return !0;
|
|
2176
2452
|
let i = r[1].toLowerCase();
|
|
2177
|
-
return
|
|
2453
|
+
return $r.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
|
|
2178
2454
|
}
|
|
2179
|
-
function
|
|
2180
|
-
if (
|
|
2455
|
+
function ri(e) {
|
|
2456
|
+
if (ei.has(e.tagName)) {
|
|
2181
2457
|
e.remove();
|
|
2182
2458
|
return;
|
|
2183
2459
|
}
|
|
@@ -2189,123 +2465,123 @@ function ni(e) {
|
|
|
2189
2465
|
e.removeAttribute(n);
|
|
2190
2466
|
continue;
|
|
2191
2467
|
}
|
|
2192
|
-
if (
|
|
2193
|
-
|
|
2468
|
+
if (ti.has(t)) {
|
|
2469
|
+
ni(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n);
|
|
2194
2470
|
continue;
|
|
2195
2471
|
}
|
|
2196
2472
|
if (t === "src") {
|
|
2197
|
-
|
|
2473
|
+
ni(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n);
|
|
2198
2474
|
continue;
|
|
2199
2475
|
}
|
|
2200
2476
|
t === "srcdoc" && e.removeAttribute(n);
|
|
2201
2477
|
}
|
|
2202
2478
|
let n = Array.from(e.children);
|
|
2203
|
-
for (let e of n)
|
|
2479
|
+
for (let e of n) ri(e);
|
|
2204
2480
|
}
|
|
2205
|
-
function
|
|
2481
|
+
function ii(e) {
|
|
2206
2482
|
if (typeof DOMParser > "u") return e;
|
|
2207
2483
|
let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
|
|
2208
|
-
for (let e of n)
|
|
2484
|
+
for (let e of n) ri(e);
|
|
2209
2485
|
return t.innerHTML;
|
|
2210
2486
|
}
|
|
2211
2487
|
//#endregion
|
|
2212
2488
|
//#region src/composables/useEditableTextBlock.ts
|
|
2213
|
-
function
|
|
2214
|
-
let t =
|
|
2215
|
-
top:
|
|
2216
|
-
left:
|
|
2489
|
+
function ai(e) {
|
|
2490
|
+
let t = n(K, []), r = n(q, null), { syntax: i } = Q(), a = S(() => r?.value ? xe(e(), t) : Ee(e(), t)), o = S(() => ii(ke(a.value, i))), s = l(!1), c = l(null), { top: u, left: d } = Ve(c), { toLocal: f } = Ot(), p = S(() => f({
|
|
2491
|
+
top: u.value - 8,
|
|
2492
|
+
left: d.value
|
|
2217
2493
|
}));
|
|
2218
|
-
function f() {
|
|
2219
|
-
o.value = !0;
|
|
2220
|
-
}
|
|
2221
2494
|
function m() {
|
|
2222
|
-
|
|
2495
|
+
s.value = !0;
|
|
2496
|
+
}
|
|
2497
|
+
function h() {
|
|
2498
|
+
s.value = !1;
|
|
2223
2499
|
}
|
|
2224
2500
|
return {
|
|
2225
|
-
isEditing:
|
|
2226
|
-
blockRef:
|
|
2227
|
-
toolbarPosition:
|
|
2228
|
-
resolvedContent:
|
|
2229
|
-
handleDoubleClick:
|
|
2230
|
-
handleEditorDone:
|
|
2501
|
+
isEditing: s,
|
|
2502
|
+
blockRef: c,
|
|
2503
|
+
toolbarPosition: p,
|
|
2504
|
+
resolvedContent: o,
|
|
2505
|
+
handleDoubleClick: m,
|
|
2506
|
+
handleEditorDone: h
|
|
2231
2507
|
};
|
|
2232
2508
|
}
|
|
2233
2509
|
//#endregion
|
|
2234
2510
|
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2235
|
-
var
|
|
2511
|
+
var oi = ["innerHTML"], si = /* @__PURE__ */ d({
|
|
2236
2512
|
__name: "ParagraphBlock",
|
|
2237
2513
|
props: {
|
|
2238
2514
|
block: {},
|
|
2239
2515
|
viewport: {}
|
|
2240
2516
|
},
|
|
2241
2517
|
setup(e) {
|
|
2242
|
-
let t = e, n =
|
|
2243
|
-
return (t, u) => (
|
|
2518
|
+
let t = e, n = B(() => import("./ParagraphEditor-BJJ925sx.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = ai(() => t.block.content);
|
|
2519
|
+
return (t, u) => (s(), C("div", {
|
|
2244
2520
|
ref_key: "blockRef",
|
|
2245
2521
|
ref: i,
|
|
2246
2522
|
class: "tpl:min-h-[1em] tpl:w-full",
|
|
2247
|
-
onDblclick: u[0] ||= (...e) =>
|
|
2248
|
-
}, [
|
|
2523
|
+
onDblclick: u[0] ||= (...e) => _(c) && _(c)(...e)
|
|
2524
|
+
}, [_(r) ? (s(), A(_(n), {
|
|
2249
2525
|
key: 0,
|
|
2250
2526
|
block: e.block,
|
|
2251
|
-
"toolbar-position":
|
|
2252
|
-
onDone:
|
|
2527
|
+
"toolbar-position": _(a),
|
|
2528
|
+
onDone: _(l)
|
|
2253
2529
|
}, null, 8, [
|
|
2254
2530
|
"block",
|
|
2255
2531
|
"toolbar-position",
|
|
2256
2532
|
"onDone"
|
|
2257
|
-
])) : (
|
|
2533
|
+
])) : (s(), C("div", {
|
|
2258
2534
|
key: 1,
|
|
2259
2535
|
class: "tpl-text-content tpl:outline-none [&_a]:tpl:underline [&_li]:tpl:my-1 [&_ol]:tpl:my-2 [&_ol]:tpl:pl-6 [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0 [&_s]:tpl:line-through [&_sub]:tpl:align-sub [&_sub]:tpl:text-[0.75em] [&_sup]:tpl:align-super [&_sup]:tpl:text-[0.75em] [&_ul]:tpl:my-2 [&_ul]:tpl:pl-6",
|
|
2260
|
-
innerHTML:
|
|
2261
|
-
}, null, 8,
|
|
2536
|
+
innerHTML: _(o)
|
|
2537
|
+
}, null, 8, oi))], 544));
|
|
2262
2538
|
}
|
|
2263
2539
|
});
|
|
2264
2540
|
//#endregion
|
|
2265
2541
|
//#region src/utils/blockComponentResolver.ts
|
|
2266
|
-
function
|
|
2542
|
+
function ci(e) {
|
|
2267
2543
|
let t = { fontFamily: e.fontFamily };
|
|
2268
2544
|
return e.textColor && (t.color = e.textColor), e.linkColor && (t["--tpl-doc-link-color"] = e.linkColor), e.linkUnderline && (t["--tpl-doc-link-underline"] = "underline"), t;
|
|
2269
2545
|
}
|
|
2270
|
-
function
|
|
2546
|
+
function li(e, t, n) {
|
|
2271
2547
|
if (t) {
|
|
2272
2548
|
let n = t.getComponent(e);
|
|
2273
2549
|
if (n) return n;
|
|
2274
2550
|
}
|
|
2275
2551
|
return n[e.type] ?? null;
|
|
2276
2552
|
}
|
|
2277
|
-
function
|
|
2553
|
+
function ui(e) {
|
|
2278
2554
|
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
2279
2555
|
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
2280
2556
|
backgroundColor: n || "transparent"
|
|
2281
2557
|
};
|
|
2282
2558
|
return e.type === "section" && e.borderRadius && e.borderRadius > 0 && (r.borderRadius = `${e.borderRadius}px`), r;
|
|
2283
2559
|
}
|
|
2284
|
-
function
|
|
2560
|
+
function di(e) {
|
|
2285
2561
|
if (e.type !== "section" || !e.wrapper) return null;
|
|
2286
2562
|
let t = e.wrapper, n = {};
|
|
2287
2563
|
return t.backgroundColor && (n.backgroundColor = t.backgroundColor), t.padding && (n.padding = `${t.padding.top}px ${t.padding.right}px ${t.padding.bottom}px ${t.padding.left}px`), t.borderRadius && t.borderRadius > 0 && (n.borderRadius = `${t.borderRadius}px`), n;
|
|
2288
2564
|
}
|
|
2289
2565
|
//#endregion
|
|
2290
2566
|
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
2291
|
-
var
|
|
2567
|
+
var fi = [
|
|
2292
2568
|
"data-block-id",
|
|
2293
2569
|
"data-block-type",
|
|
2294
2570
|
"data-tpl-picked"
|
|
2295
|
-
],
|
|
2571
|
+
], pi = ["aria-label"], mi = [
|
|
2296
2572
|
"aria-label",
|
|
2297
2573
|
"aria-pressed",
|
|
2298
2574
|
"title"
|
|
2299
|
-
],
|
|
2575
|
+
], hi = ["aria-label", "title"], gi = ["aria-label", "title"], _i = ["aria-label", "title"], vi = {
|
|
2300
2576
|
key: 1,
|
|
2301
2577
|
class: "tpl-block-hidden-overlay tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[5] tpl:flex tpl:items-center tpl:justify-center tpl:rounded-sm"
|
|
2302
|
-
},
|
|
2578
|
+
}, yi = { class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]" }, bi = {
|
|
2303
2579
|
key: 2,
|
|
2304
2580
|
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
2305
|
-
},
|
|
2581
|
+
}, xi = ["aria-label", "title"], Si = {
|
|
2306
2582
|
key: 3,
|
|
2307
2583
|
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
2308
|
-
},
|
|
2584
|
+
}, Ci = ["aria-label"], wi = /*#__PURE__*/ Jt(/* @__PURE__ */ d({
|
|
2309
2585
|
__name: "BlockWrapper",
|
|
2310
2586
|
props: {
|
|
2311
2587
|
block: {},
|
|
@@ -2317,191 +2593,191 @@ var di = [
|
|
|
2317
2593
|
},
|
|
2318
2594
|
emits: ["select"],
|
|
2319
2595
|
setup(e, { emit: t }) {
|
|
2320
|
-
let
|
|
2596
|
+
let r = B(() => import("./BlockIssueBadge-UzSSOM_2.js")), i = e, o = t, { t: c, format: u } = Y(), d = n(St, null), f = l(null), p = S(() => d?.liftedBlockId.value === i.block.id), m = S(() => p.value ? u(c.blockActions.dragLifted, { block: i.block.type }) : c.blockActions.drag);
|
|
2321
2597
|
async function h() {
|
|
2322
|
-
await
|
|
2598
|
+
await D(), f.value?.focus();
|
|
2323
2599
|
}
|
|
2324
2600
|
function g(e) {
|
|
2325
|
-
if (
|
|
2601
|
+
if (d) {
|
|
2326
2602
|
if (e.key === " " || e.key === "Enter") {
|
|
2327
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2603
|
+
e.preventDefault(), e.stopPropagation(), p.value ? d.drop(i.block.id) : d.lift(i.block.id);
|
|
2328
2604
|
return;
|
|
2329
2605
|
}
|
|
2330
|
-
if (
|
|
2606
|
+
if (p.value) {
|
|
2331
2607
|
if (e.key === "Escape") {
|
|
2332
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2608
|
+
e.preventDefault(), e.stopPropagation(), d.cancel(), h();
|
|
2333
2609
|
return;
|
|
2334
2610
|
}
|
|
2335
2611
|
if (e.key === "ArrowUp") {
|
|
2336
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2612
|
+
e.preventDefault(), e.stopPropagation(), d.moveUp(i.block.id), h();
|
|
2337
2613
|
return;
|
|
2338
2614
|
}
|
|
2339
|
-
e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(),
|
|
2615
|
+
e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), d.moveDown(i.block.id), h());
|
|
2340
2616
|
}
|
|
2341
2617
|
}
|
|
2342
2618
|
}
|
|
2343
|
-
let
|
|
2344
|
-
desktop:
|
|
2345
|
-
mobile:
|
|
2346
|
-
}[i.viewport] ?? i.viewport : ""),
|
|
2347
|
-
let e =
|
|
2619
|
+
let y = S(() => !i.viewport || !i.block.visibility ? !1 : i.block.visibility[i.viewport] === !1), x = S(() => i.previewMode === !0 && y.value), T = S(() => i.viewport ? {
|
|
2620
|
+
desktop: c.viewport.desktop,
|
|
2621
|
+
mobile: c.viewport.mobile
|
|
2622
|
+
}[i.viewport] ?? i.viewport : ""), E = S(() => !!i.block.displayCondition), A = n(at, null), j = n(ct, null), N = n(st, {}), P = S(() => N.savedBlocks?.isPicking.value === !0), F = S(() => !i.nested && N.savedBlocks?.isAvailable.value === !0 && N.savedBlocks?.canCreate.value === !0), I = S(() => i.isSelected && !P.value), L = S(() => N.comments?.getBlockCount(i.block.id) ?? 0), z = S(() => {
|
|
2623
|
+
let e = ui(i.block), t = {
|
|
2348
2624
|
padding: e.padding,
|
|
2349
2625
|
backgroundColor: e.backgroundColor
|
|
2350
2626
|
};
|
|
2351
2627
|
return e.borderRadius && (t.borderRadius = e.borderRadius), t;
|
|
2352
|
-
}),
|
|
2353
|
-
function
|
|
2354
|
-
i.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(),
|
|
2628
|
+
}), ee = S(() => di(i.block));
|
|
2629
|
+
function te(e) {
|
|
2630
|
+
i.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), o("select"));
|
|
2355
2631
|
}
|
|
2356
|
-
function
|
|
2632
|
+
function ne() {
|
|
2357
2633
|
A?.deleteBlock(i.block.id);
|
|
2358
2634
|
}
|
|
2359
|
-
function
|
|
2635
|
+
function re() {
|
|
2360
2636
|
A?.duplicateBlock(i.block);
|
|
2361
2637
|
}
|
|
2362
|
-
function
|
|
2638
|
+
function ie() {
|
|
2363
2639
|
N.savedBlocks?.startPicking(i.block.id);
|
|
2364
2640
|
}
|
|
2365
|
-
function
|
|
2641
|
+
function ae() {
|
|
2366
2642
|
j?.toggleBlock(i.block.id);
|
|
2367
2643
|
}
|
|
2368
|
-
return (t,
|
|
2644
|
+
return (t, n) => x.value ? w("", !0) : (s(), C("div", {
|
|
2369
2645
|
key: 0,
|
|
2370
|
-
class:
|
|
2646
|
+
class: b(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
|
|
2371
2647
|
"tpl-block--selected": e.isSelected,
|
|
2372
2648
|
"tpl-block--picked": e.picked,
|
|
2373
2649
|
"tpl-block--idle": !e.isSelected && !e.picked,
|
|
2374
|
-
"tpl-block--lifted":
|
|
2650
|
+
"tpl-block--lifted": p.value
|
|
2375
2651
|
}]),
|
|
2376
2652
|
"data-block-id": e.block.id,
|
|
2377
2653
|
"data-block-type": e.block.type,
|
|
2378
2654
|
"data-tpl-picked": e.picked || void 0,
|
|
2379
|
-
onClick:
|
|
2655
|
+
onClick: te
|
|
2380
2656
|
}, [
|
|
2381
|
-
|
|
2382
|
-
I.value ? (
|
|
2657
|
+
v(_(r), { "block-id": e.block.id }, null, 8, ["block-id"]),
|
|
2658
|
+
I.value ? (s(), C("div", {
|
|
2383
2659
|
key: 0,
|
|
2384
2660
|
role: "toolbar",
|
|
2385
|
-
"aria-label":
|
|
2661
|
+
"aria-label": _(c).blockActions.drag,
|
|
2386
2662
|
class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:-right-2 tpl:top-1/2 tpl:z-10 tpl:flex tpl:-translate-y-1/2 tpl:translate-x-full tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:shadow-[var(--tpl-shadow-md)] tpl:border tpl:border-[var(--tpl-border)]"
|
|
2387
2663
|
}, [
|
|
2388
2664
|
M("button", {
|
|
2389
2665
|
ref_key: "dragButtonRef",
|
|
2390
|
-
ref:
|
|
2391
|
-
class: "tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:
|
|
2666
|
+
ref: f,
|
|
2667
|
+
class: "tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:active:cursor-grabbing",
|
|
2392
2668
|
"aria-label": m.value,
|
|
2393
|
-
"aria-pressed":
|
|
2669
|
+
"aria-pressed": p.value,
|
|
2394
2670
|
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
2395
|
-
title:
|
|
2671
|
+
title: _(c).blockActions.drag,
|
|
2396
2672
|
onKeydown: g
|
|
2397
|
-
}, [
|
|
2673
|
+
}, [v(_(Rt), {
|
|
2398
2674
|
size: 14,
|
|
2399
2675
|
"stroke-width": 1.5
|
|
2400
|
-
})], 40,
|
|
2676
|
+
})], 40, mi),
|
|
2401
2677
|
M("button", {
|
|
2402
|
-
class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors
|
|
2403
|
-
"aria-label":
|
|
2404
|
-
title:
|
|
2405
|
-
onClick: O(
|
|
2406
|
-
}, [
|
|
2678
|
+
class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
|
|
2679
|
+
"aria-label": _(c).blockActions.duplicate,
|
|
2680
|
+
title: _(c).blockActions.duplicate,
|
|
2681
|
+
onClick: O(re, ["stop"])
|
|
2682
|
+
}, [v(_(jt), {
|
|
2407
2683
|
size: 14,
|
|
2408
2684
|
"stroke-width": 1.5
|
|
2409
|
-
})], 8,
|
|
2410
|
-
|
|
2685
|
+
})], 8, hi),
|
|
2686
|
+
F.value ? (s(), C("button", {
|
|
2411
2687
|
key: 0,
|
|
2412
|
-
class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors
|
|
2413
|
-
"aria-label":
|
|
2414
|
-
title:
|
|
2415
|
-
onClick: O(
|
|
2416
|
-
}, [
|
|
2688
|
+
class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
|
|
2689
|
+
"aria-label": _(c).blockActions.saveAsBlock,
|
|
2690
|
+
title: _(c).blockActions.saveAsBlock,
|
|
2691
|
+
onClick: O(ie, ["stop"])
|
|
2692
|
+
}, [v(_(At), {
|
|
2417
2693
|
size: 14,
|
|
2418
2694
|
"stroke-width": 1.5
|
|
2419
|
-
})], 8,
|
|
2695
|
+
})], 8, gi)) : w("", !0),
|
|
2420
2696
|
M("button", {
|
|
2421
|
-
class: "tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors
|
|
2422
|
-
"aria-label":
|
|
2423
|
-
title:
|
|
2424
|
-
onClick: O(
|
|
2425
|
-
}, [
|
|
2697
|
+
class: "tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
|
|
2698
|
+
"aria-label": _(c).blockActions.delete,
|
|
2699
|
+
title: _(c).blockActions.delete,
|
|
2700
|
+
onClick: O(ne, ["stop"])
|
|
2701
|
+
}, [v(_(It), {
|
|
2426
2702
|
size: 14,
|
|
2427
2703
|
"stroke-width": 1.5
|
|
2428
|
-
})], 8,
|
|
2429
|
-
], 8,
|
|
2430
|
-
|
|
2704
|
+
})], 8, _i)
|
|
2705
|
+
], 8, pi)) : w("", !0),
|
|
2706
|
+
y.value ? (s(), C("div", vi, [M("span", yi, [v(_(Pt), {
|
|
2431
2707
|
size: 12,
|
|
2432
2708
|
"stroke-width": 1.5
|
|
2433
|
-
}),
|
|
2434
|
-
|
|
2709
|
+
}), V(" " + R(_(u)(_(c).blockActions.hiddenOnViewport, { viewport: T.value })), 1)])])) : w("", !0),
|
|
2710
|
+
E.value && !y.value ? (s(), C("div", bi, [M("button", {
|
|
2435
2711
|
"data-testid": "condition-toggle",
|
|
2436
|
-
class: "tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:
|
|
2437
|
-
"aria-label":
|
|
2712
|
+
class: "tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-primary)] tpl:border tpl:border-[var(--tpl-border)]",
|
|
2713
|
+
"aria-label": _(c).blockActions.conditionToggle,
|
|
2438
2714
|
title: e.block.displayCondition?.label,
|
|
2439
|
-
onClick: O(
|
|
2440
|
-
}, [
|
|
2715
|
+
onClick: O(ae, ["stop"])
|
|
2716
|
+
}, [v(_(Gt), {
|
|
2441
2717
|
size: 12,
|
|
2442
2718
|
"stroke-width": 2
|
|
2443
|
-
})], 8,
|
|
2444
|
-
|
|
2445
|
-
class: "tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:
|
|
2446
|
-
"aria-label":
|
|
2447
|
-
onClick:
|
|
2448
|
-
}, [
|
|
2719
|
+
})], 8, xi)])) : w("", !0),
|
|
2720
|
+
L.value > 0 && !y.value ? (s(), C("div", Si, [M("button", {
|
|
2721
|
+
class: "tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:bg-[var(--tpl-chrome-primary-light)] tpl:text-[var(--tpl-primary)]",
|
|
2722
|
+
"aria-label": _(u)(_(c).blockActions.comments, { count: String(L.value) }),
|
|
2723
|
+
onClick: n[0] ||= O((t) => _(N).comments?.openForBlock(e.block.id), ["stop"])
|
|
2724
|
+
}, [v(_(Ht), {
|
|
2449
2725
|
size: 12,
|
|
2450
2726
|
"stroke-width": 2.5
|
|
2451
|
-
}),
|
|
2452
|
-
|
|
2727
|
+
}), V(" " + R(L.value), 1)], 8, Ci)])) : w("", !0),
|
|
2728
|
+
ee.value ? (s(), C("div", {
|
|
2453
2729
|
key: 4,
|
|
2454
2730
|
class: "tpl-section-wrapper",
|
|
2455
|
-
style:
|
|
2731
|
+
style: k(ee.value)
|
|
2456
2732
|
}, [M("div", {
|
|
2457
2733
|
class: "tpl-block-content",
|
|
2458
|
-
style:
|
|
2459
|
-
}, [
|
|
2734
|
+
style: k(z.value)
|
|
2735
|
+
}, [a(t.$slots, "default", {}, void 0, !0)], 4)], 4)) : (s(), C("div", {
|
|
2460
2736
|
key: 5,
|
|
2461
2737
|
class: "tpl-block-content",
|
|
2462
|
-
style:
|
|
2463
|
-
}, [
|
|
2464
|
-
], 10,
|
|
2738
|
+
style: k(z.value)
|
|
2739
|
+
}, [a(t.$slots, "default", {}, void 0, !0)], 4))
|
|
2740
|
+
], 10, fi));
|
|
2465
2741
|
}
|
|
2466
|
-
}), [["__scopeId", "data-v-
|
|
2742
|
+
}), [["__scopeId", "data-v-096f1d37"]]);
|
|
2467
2743
|
//#endregion
|
|
2468
2744
|
//#region src/utils/unwrapParagraph.ts
|
|
2469
|
-
function
|
|
2745
|
+
function Ti(e) {
|
|
2470
2746
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
2471
2747
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
2472
2748
|
}
|
|
2473
2749
|
//#endregion
|
|
2474
2750
|
//#region src/components/blocks/TitleBlock.vue
|
|
2475
|
-
var
|
|
2751
|
+
var Ei = /* @__PURE__ */ d({
|
|
2476
2752
|
__name: "TitleBlock",
|
|
2477
2753
|
props: {
|
|
2478
2754
|
block: {},
|
|
2479
2755
|
viewport: {}
|
|
2480
2756
|
},
|
|
2481
2757
|
setup(e) {
|
|
2482
|
-
let t = e, n =
|
|
2758
|
+
let t = e, n = B(() => import("./TitleEditor-nUAF7fKr.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = ai(() => t.block.content), d = S(() => {
|
|
2483
2759
|
let e = {
|
|
2484
|
-
fontSize: `${
|
|
2760
|
+
fontSize: `${Me[t.block.level]}px`,
|
|
2485
2761
|
textAlign: t.block.textAlign
|
|
2486
2762
|
};
|
|
2487
2763
|
return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = t.block.fontFamily), e;
|
|
2488
|
-
}), f =
|
|
2489
|
-
return (t, o) => (
|
|
2764
|
+
}), f = S(() => `h${t.block.level}`), p = S(() => Ti(o.value));
|
|
2765
|
+
return (t, o) => (s(), C("div", {
|
|
2490
2766
|
ref_key: "blockRef",
|
|
2491
2767
|
ref: i,
|
|
2492
2768
|
class: "tpl:min-h-[1em] tpl:w-full",
|
|
2493
|
-
style:
|
|
2494
|
-
onDblclick: o[0] ||= (...e) =>
|
|
2495
|
-
}, [
|
|
2769
|
+
style: k(d.value),
|
|
2770
|
+
onDblclick: o[0] ||= (...e) => _(c) && _(c)(...e)
|
|
2771
|
+
}, [_(r) ? (s(), A(_(n), {
|
|
2496
2772
|
key: 0,
|
|
2497
2773
|
block: e.block,
|
|
2498
|
-
"toolbar-position":
|
|
2499
|
-
onDone:
|
|
2774
|
+
"toolbar-position": _(a),
|
|
2775
|
+
onDone: _(l)
|
|
2500
2776
|
}, null, 8, [
|
|
2501
2777
|
"block",
|
|
2502
2778
|
"toolbar-position",
|
|
2503
2779
|
"onDone"
|
|
2504
|
-
])) : (
|
|
2780
|
+
])) : (s(), A(u(f.value), {
|
|
2505
2781
|
key: 1,
|
|
2506
2782
|
class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-tight tpl:outline-none [&_a]:tpl:underline [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0",
|
|
2507
2783
|
style: { color: "inherit" },
|
|
@@ -2511,16 +2787,16 @@ var Ti = /* @__PURE__ */ R({
|
|
|
2511
2787
|
});
|
|
2512
2788
|
//#endregion
|
|
2513
2789
|
//#region src/utils/sectionColumnDrop.ts
|
|
2514
|
-
function
|
|
2790
|
+
function Di(e) {
|
|
2515
2791
|
return e.dataset.blockType !== "section" && e.dataset.paletteType !== "section";
|
|
2516
2792
|
}
|
|
2517
2793
|
//#endregion
|
|
2518
2794
|
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2519
|
-
var
|
|
2795
|
+
var Oi = { class: "tpl:w-full" }, ki = {
|
|
2520
2796
|
key: 0,
|
|
2521
2797
|
"data-testid": "section-drop-hint",
|
|
2522
2798
|
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
|
|
2523
|
-
},
|
|
2799
|
+
}, Ai = /* @__PURE__ */ d({
|
|
2524
2800
|
__name: "SectionBlock",
|
|
2525
2801
|
props: {
|
|
2526
2802
|
block: {},
|
|
@@ -2528,23 +2804,23 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2528
2804
|
},
|
|
2529
2805
|
setup(e) {
|
|
2530
2806
|
let t = {
|
|
2531
|
-
title:
|
|
2532
|
-
paragraph:
|
|
2533
|
-
image:
|
|
2534
|
-
button:
|
|
2535
|
-
divider:
|
|
2536
|
-
custom:
|
|
2537
|
-
},
|
|
2538
|
-
function
|
|
2539
|
-
let t =
|
|
2807
|
+
title: Ei,
|
|
2808
|
+
paragraph: si,
|
|
2809
|
+
image: Jr,
|
|
2810
|
+
button: Yn,
|
|
2811
|
+
divider: Or,
|
|
2812
|
+
custom: Er
|
|
2813
|
+
}, a = e, { t: o } = Y(), c = rt(J, "SectionBlock"), l = n(ct, null), d = n(vt, null), p = n(st, {}), m = n(_t, null);
|
|
2814
|
+
function h(e) {
|
|
2815
|
+
let t = p.savedBlocks;
|
|
2540
2816
|
if (t?.isPicking.value) {
|
|
2541
|
-
t.togglePick(
|
|
2817
|
+
t.togglePick(a.block.id);
|
|
2542
2818
|
return;
|
|
2543
2819
|
}
|
|
2544
|
-
|
|
2820
|
+
c.selectBlock(e);
|
|
2545
2821
|
}
|
|
2546
|
-
let g =
|
|
2547
|
-
switch (
|
|
2822
|
+
let g = S(() => {
|
|
2823
|
+
switch (a.block.columns) {
|
|
2548
2824
|
case "2": return ["50%", "50%"];
|
|
2549
2825
|
case "3": return [
|
|
2550
2826
|
"33.33%",
|
|
@@ -2555,38 +2831,38 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2555
2831
|
case "2-1": return ["66.67%", "33.33%"];
|
|
2556
2832
|
default: return ["100%"];
|
|
2557
2833
|
}
|
|
2558
|
-
}),
|
|
2559
|
-
let e = g.value.length, t = [...
|
|
2834
|
+
}), y = S(() => {
|
|
2835
|
+
let e = g.value.length, t = [...a.block.children];
|
|
2560
2836
|
for (; t.length < e;) t.push([]);
|
|
2561
2837
|
return t.slice(0, e);
|
|
2562
|
-
}),
|
|
2563
|
-
function
|
|
2564
|
-
return
|
|
2838
|
+
}), x = S(() => a.viewport === "mobile" && a.block.stackOnMobile !== !1);
|
|
2839
|
+
function T(e) {
|
|
2840
|
+
return y.value[e] || [];
|
|
2565
2841
|
}
|
|
2566
|
-
function
|
|
2567
|
-
let
|
|
2568
|
-
for (;
|
|
2569
|
-
|
|
2842
|
+
function E(e, t) {
|
|
2843
|
+
let n = t.map((e) => JSON.parse(JSON.stringify(e))), r = [...a.block.children];
|
|
2844
|
+
for (; r.length <= e;) r.push([]);
|
|
2845
|
+
r[e] = n, c.updateBlock(a.block.id, { children: r });
|
|
2570
2846
|
}
|
|
2571
|
-
function
|
|
2572
|
-
return
|
|
2847
|
+
function D(e) {
|
|
2848
|
+
return li(e, d, t);
|
|
2573
2849
|
}
|
|
2574
|
-
function
|
|
2575
|
-
e.type === "custom" &&
|
|
2850
|
+
function O(e, t) {
|
|
2851
|
+
e.type === "custom" && c.updateBlock(e.id, {
|
|
2576
2852
|
fieldValues: t.fieldValues,
|
|
2577
2853
|
dataSourceFetched: t.dataSourceFetched
|
|
2578
2854
|
});
|
|
2579
2855
|
}
|
|
2580
|
-
return (t, n) => (
|
|
2856
|
+
return (t, n) => (s(), C("div", Oi, [M("div", { class: b(["tpl:flex tpl:gap-0", { "tpl:flex-col": x.value }]) }, [(s(!0), C(L, null, r(y.value, (t, n) => (s(), C("div", {
|
|
2581
2857
|
key: n,
|
|
2582
|
-
class:
|
|
2583
|
-
style:
|
|
2584
|
-
}, [
|
|
2585
|
-
"model-value":
|
|
2858
|
+
class: b(["tpl:relative tpl:min-h-[60px] tpl:rounded", T(n).length === 0 ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
2859
|
+
style: k({ width: x.value ? "100%" : g.value[n] })
|
|
2860
|
+
}, [v(_(I), {
|
|
2861
|
+
"model-value": T(n),
|
|
2586
2862
|
group: {
|
|
2587
2863
|
name: "blocks",
|
|
2588
2864
|
pull: !0,
|
|
2589
|
-
put: (e, t, n) =>
|
|
2865
|
+
put: (e, t, n) => _(Di)(n)
|
|
2590
2866
|
},
|
|
2591
2867
|
animation: 150,
|
|
2592
2868
|
"ghost-class": "tpl-ghost",
|
|
@@ -2597,21 +2873,21 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2597
2873
|
"empty-insert-threshold": 20,
|
|
2598
2874
|
"force-fallback": !0,
|
|
2599
2875
|
class: "tpl:min-h-[60px]",
|
|
2600
|
-
"onUpdate:modelValue": (e) =>
|
|
2876
|
+
"onUpdate:modelValue": (e) => E(n, e)
|
|
2601
2877
|
}, {
|
|
2602
|
-
default:
|
|
2878
|
+
default: i(() => [(s(!0), C(L, null, r(T(n), (t) => f((s(), C("div", { key: t.id }, [v(wi, {
|
|
2603
2879
|
block: t,
|
|
2604
|
-
"is-selected":
|
|
2880
|
+
"is-selected": _(c).state.selectedBlockId === t.id,
|
|
2605
2881
|
viewport: e.viewport,
|
|
2606
|
-
"preview-mode":
|
|
2882
|
+
"preview-mode": _(c).state.previewMode,
|
|
2607
2883
|
nested: "",
|
|
2608
|
-
onSelect: (e) =>
|
|
2884
|
+
onSelect: (e) => h(t.id)
|
|
2609
2885
|
}, {
|
|
2610
|
-
default:
|
|
2886
|
+
default: i(() => [(s(), A(u(D(t)), {
|
|
2611
2887
|
block: t,
|
|
2612
2888
|
viewport: e.viewport,
|
|
2613
|
-
onFetchData: (e) =>
|
|
2614
|
-
onUpdate: (e) =>
|
|
2889
|
+
onFetchData: (e) => O(t, e),
|
|
2890
|
+
onUpdate: (e) => _(c).updateBlock(t.id, e)
|
|
2615
2891
|
}, null, 40, [
|
|
2616
2892
|
"block",
|
|
2617
2893
|
"viewport",
|
|
@@ -2625,19 +2901,19 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2625
2901
|
"viewport",
|
|
2626
2902
|
"preview-mode",
|
|
2627
2903
|
"onSelect"
|
|
2628
|
-
])])), [[
|
|
2904
|
+
])])), [[F, _(m) === !1 || !_(l)?.isHidden(t.id)]])), 128))]),
|
|
2629
2905
|
_: 2
|
|
2630
2906
|
}, 1032, [
|
|
2631
2907
|
"model-value",
|
|
2632
2908
|
"group",
|
|
2633
2909
|
"onUpdate:modelValue"
|
|
2634
|
-
]),
|
|
2910
|
+
]), T(n).length === 0 ? (s(), C("div", ki, [M("span", null, R(_(o).section.dropHere), 1)])) : w("", !0)], 6))), 128))], 2)]));
|
|
2635
2911
|
}
|
|
2636
|
-
}),
|
|
2912
|
+
}), ji = ye, Mi = {
|
|
2637
2913
|
small: 24,
|
|
2638
2914
|
medium: 32,
|
|
2639
2915
|
large: 48
|
|
2640
|
-
},
|
|
2916
|
+
}, Ni = [
|
|
2641
2917
|
"facebook",
|
|
2642
2918
|
"twitter",
|
|
2643
2919
|
"instagram",
|
|
@@ -2655,11 +2931,11 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2655
2931
|
"github",
|
|
2656
2932
|
"dribbble",
|
|
2657
2933
|
"behance"
|
|
2658
|
-
],
|
|
2934
|
+
], Pi = [
|
|
2659
2935
|
"width",
|
|
2660
2936
|
"height",
|
|
2661
2937
|
"fill"
|
|
2662
|
-
],
|
|
2938
|
+
], Fi = ["d"], Ii = /* @__PURE__ */ d({
|
|
2663
2939
|
__name: "SocialIconSvg",
|
|
2664
2940
|
props: {
|
|
2665
2941
|
platform: {},
|
|
@@ -2667,7 +2943,7 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2667
2943
|
iconSize: {}
|
|
2668
2944
|
},
|
|
2669
2945
|
setup(e) {
|
|
2670
|
-
let t = e, n =
|
|
2946
|
+
let t = e, n = S(() => ji[t.platform]), r = S(() => Mi[t.iconSize]), i = S(() => {
|
|
2671
2947
|
let e = {
|
|
2672
2948
|
display: "inline-flex",
|
|
2673
2949
|
alignItems: "center",
|
|
@@ -2704,40 +2980,40 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2704
2980
|
};
|
|
2705
2981
|
default: return e;
|
|
2706
2982
|
}
|
|
2707
|
-
}), a =
|
|
2708
|
-
return (e, t) => (
|
|
2983
|
+
}), a = S(() => Math.floor(r.value * .6)), o = S(() => t.iconStyle === "outlined" ? n.value.color : "#ffffff");
|
|
2984
|
+
return (e, t) => (s(), C("span", { style: k(i.value) }, [(s(), C("svg", {
|
|
2709
2985
|
width: a.value,
|
|
2710
2986
|
height: a.value,
|
|
2711
2987
|
viewBox: "0 0 24 24",
|
|
2712
2988
|
fill: o.value,
|
|
2713
2989
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2714
|
-
}, [M("path", { d: n.value.path }, null, 8,
|
|
2990
|
+
}, [M("path", { d: n.value.path }, null, 8, Fi)], 8, Pi))], 4));
|
|
2715
2991
|
}
|
|
2716
|
-
}),
|
|
2992
|
+
}), Li = { class: "tpl:w-full" }, Ri = ["href"], zi = {
|
|
2717
2993
|
key: 1,
|
|
2718
2994
|
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
2719
|
-
},
|
|
2995
|
+
}, Bi = /* @__PURE__ */ d({
|
|
2720
2996
|
__name: "SocialIconsBlock",
|
|
2721
2997
|
props: {
|
|
2722
2998
|
block: {},
|
|
2723
2999
|
viewport: {}
|
|
2724
3000
|
},
|
|
2725
3001
|
setup(e) {
|
|
2726
|
-
let t = e, { t: n } =
|
|
3002
|
+
let t = e, { t: n } = Y(), i = S(() => ({
|
|
2727
3003
|
display: "flex",
|
|
2728
3004
|
flexWrap: "wrap",
|
|
2729
3005
|
gap: `${t.block.spacing}px`,
|
|
2730
3006
|
justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
|
|
2731
|
-
})),
|
|
2732
|
-
return (t,
|
|
3007
|
+
})), a = S(() => t.block.icons.length > 0);
|
|
3008
|
+
return (t, o) => (s(), C("div", Li, [a.value ? (s(), C("div", {
|
|
2733
3009
|
key: 0,
|
|
2734
|
-
style:
|
|
2735
|
-
}, [(
|
|
3010
|
+
style: k(i.value)
|
|
3011
|
+
}, [(s(!0), C(L, null, r(e.block.icons, (t) => (s(), C("a", {
|
|
2736
3012
|
key: t.id,
|
|
2737
3013
|
href: t.url || "#",
|
|
2738
3014
|
class: "tpl:cursor-default",
|
|
2739
|
-
onClick:
|
|
2740
|
-
}, [
|
|
3015
|
+
onClick: o[0] ||= O(() => {}, ["prevent"])
|
|
3016
|
+
}, [v(Ii, {
|
|
2741
3017
|
platform: t.platform,
|
|
2742
3018
|
"icon-style": e.block.iconStyle,
|
|
2743
3019
|
"icon-size": e.block.iconSize
|
|
@@ -2745,44 +3021,44 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2745
3021
|
"platform",
|
|
2746
3022
|
"icon-style",
|
|
2747
3023
|
"icon-size"
|
|
2748
|
-
])], 8,
|
|
3024
|
+
])], 8, Ri))), 128))], 4)) : (s(), C("div", zi, [v(_(kt), { size: 16 }), M("span", null, R(_(n).social.addIcons), 1)]))]));
|
|
2749
3025
|
}
|
|
2750
|
-
}),
|
|
3026
|
+
}), Vi = { class: "tpl:w-full" }, Hi = {
|
|
2751
3027
|
key: 0,
|
|
2752
3028
|
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
2753
3029
|
style: {
|
|
2754
3030
|
"background-color": "var(--tpl-bg-hover)",
|
|
2755
3031
|
color: "var(--tpl-text-dim)"
|
|
2756
3032
|
}
|
|
2757
|
-
},
|
|
3033
|
+
}, Ui = /* @__PURE__ */ d({
|
|
2758
3034
|
__name: "SpacerBlock",
|
|
2759
3035
|
props: {
|
|
2760
3036
|
block: {},
|
|
2761
3037
|
viewport: {}
|
|
2762
3038
|
},
|
|
2763
3039
|
setup(e) {
|
|
2764
|
-
let t = e, n =
|
|
3040
|
+
let t = e, n = rt(J, "SpacerBlock"), r = S(() => ({
|
|
2765
3041
|
height: `${t.block.height}px`,
|
|
2766
3042
|
minHeight: `${t.block.height}px`,
|
|
2767
3043
|
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
2768
3044
|
}));
|
|
2769
|
-
return (t, i) => (
|
|
2770
|
-
style:
|
|
2771
|
-
class:
|
|
2772
|
-
}, [
|
|
3045
|
+
return (t, i) => (s(), C("div", Vi, [M("div", {
|
|
3046
|
+
style: k(r.value),
|
|
3047
|
+
class: b(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !_(n).state.previewMode }])
|
|
3048
|
+
}, [_(n).state.previewMode ? w("", !0) : (s(), C("span", Hi, R(e.block.height) + "px ", 1))], 6)]));
|
|
2773
3049
|
}
|
|
2774
|
-
}),
|
|
3050
|
+
}), Wi = { class: "tpl:w-full" }, Gi = { key: 0 }, Ki = [
|
|
2775
3051
|
"aria-label",
|
|
2776
3052
|
"data-placeholder",
|
|
2777
3053
|
"onBlur"
|
|
2778
|
-
],
|
|
3054
|
+
], qi = [
|
|
2779
3055
|
"aria-label",
|
|
2780
3056
|
"data-placeholder",
|
|
2781
3057
|
"onBlur"
|
|
2782
|
-
],
|
|
3058
|
+
], Ji = {
|
|
2783
3059
|
key: 1,
|
|
2784
3060
|
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
2785
|
-
},
|
|
3061
|
+
}, Yi = /*#__PURE__*/ Jt(/* @__PURE__ */ d({
|
|
2786
3062
|
__name: "TableBlock",
|
|
2787
3063
|
props: {
|
|
2788
3064
|
block: {},
|
|
@@ -2796,7 +3072,7 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2796
3072
|
updated(e, t) {
|
|
2797
3073
|
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
2798
3074
|
}
|
|
2799
|
-
}, n = e, { t:
|
|
3075
|
+
}, n = e, { t: i } = Y(), a = rt(J, "TableBlock"), o = S(() => n.block.rows.length > 0), c = S(() => {
|
|
2800
3076
|
let e = {
|
|
2801
3077
|
width: "100%",
|
|
2802
3078
|
borderCollapse: "collapse",
|
|
@@ -2805,60 +3081,60 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2805
3081
|
fontFamily: n.block.fontFamily || "inherit"
|
|
2806
3082
|
};
|
|
2807
3083
|
return n.block.color && (e.color = n.block.color), e;
|
|
2808
|
-
}),
|
|
3084
|
+
}), l = S(() => ({
|
|
2809
3085
|
border: `${n.block.borderWidth}px solid ${n.block.borderColor}`,
|
|
2810
3086
|
padding: `${n.block.cellPadding}px`,
|
|
2811
3087
|
textAlign: n.block.textAlign
|
|
2812
|
-
})), u =
|
|
2813
|
-
...
|
|
3088
|
+
})), u = S(() => ({
|
|
3089
|
+
...l.value,
|
|
2814
3090
|
fontWeight: "bold",
|
|
2815
3091
|
backgroundColor: n.block.headerBackgroundColor || "transparent"
|
|
2816
|
-
})), d =
|
|
3092
|
+
})), d = S(() => n.block.hasHeaderRow && n.block.rows.length > 0 ? n.block.rows[0] : null), p = S(() => n.block.hasHeaderRow ? n.block.rows.slice(1) : n.block.rows);
|
|
2817
3093
|
function m() {
|
|
2818
|
-
|
|
3094
|
+
a.selectBlock(n.block.id);
|
|
2819
3095
|
}
|
|
2820
3096
|
function h(e, t, r) {
|
|
2821
|
-
let
|
|
3097
|
+
let i = r.target.innerText.trim(), o = n.block.rows.map((n) => n.id === e ? {
|
|
2822
3098
|
...n,
|
|
2823
3099
|
cells: n.cells.map((e) => e.id === t ? {
|
|
2824
3100
|
...e,
|
|
2825
|
-
content:
|
|
3101
|
+
content: i
|
|
2826
3102
|
} : e)
|
|
2827
3103
|
} : n);
|
|
2828
|
-
|
|
3104
|
+
a.updateBlock(n.block.id, { rows: o });
|
|
2829
3105
|
}
|
|
2830
|
-
return (e, n) => (
|
|
3106
|
+
return (e, n) => (s(), C("div", Wi, [o.value ? (s(), C("table", {
|
|
2831
3107
|
key: 0,
|
|
2832
|
-
style:
|
|
3108
|
+
style: k(c.value),
|
|
2833
3109
|
class: "tpl-table-editable"
|
|
2834
|
-
}, [d.value ? (
|
|
3110
|
+
}, [d.value ? (s(), C("thead", Gi, [M("tr", null, [(s(!0), C(L, null, r(d.value.cells, (e) => f((s(), C("th", {
|
|
2835
3111
|
key: e.id,
|
|
2836
|
-
style:
|
|
2837
|
-
"aria-label":
|
|
3112
|
+
style: k(u.value),
|
|
3113
|
+
"aria-label": _(i).table.cellPlaceholder,
|
|
2838
3114
|
contenteditable: "true",
|
|
2839
|
-
"data-placeholder":
|
|
3115
|
+
"data-placeholder": _(i).table.cellPlaceholder,
|
|
2840
3116
|
onBlur: (t) => h(d.value.id, e.id, t),
|
|
2841
|
-
onKeydown: n[0] ||=
|
|
3117
|
+
onKeydown: n[0] ||= y(O((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
2842
3118
|
onClick: O(m, ["stop"])
|
|
2843
|
-
}, null, 44,
|
|
2844
|
-
key:
|
|
2845
|
-
style:
|
|
2846
|
-
"aria-label":
|
|
3119
|
+
}, null, 44, Ki)), [[t, e.content]])), 128))])])) : w("", !0), M("tbody", null, [(s(!0), C(L, null, r(p.value, (e) => (s(), C("tr", { key: e.id }, [(s(!0), C(L, null, r(e.cells, (r) => f((s(), C("td", {
|
|
3120
|
+
key: r.id,
|
|
3121
|
+
style: k(l.value),
|
|
3122
|
+
"aria-label": _(i).table.cellPlaceholder,
|
|
2847
3123
|
contenteditable: "true",
|
|
2848
|
-
"data-placeholder":
|
|
2849
|
-
onBlur: (t) => h(e.id,
|
|
2850
|
-
onKeydown: n[1] ||=
|
|
3124
|
+
"data-placeholder": _(i).table.cellPlaceholder,
|
|
3125
|
+
onBlur: (t) => h(e.id, r.id, t),
|
|
3126
|
+
onKeydown: n[1] ||= y(O((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
2851
3127
|
onClick: O(m, ["stop"])
|
|
2852
|
-
}, null, 44,
|
|
3128
|
+
}, null, 44, qi)), [[t, r.content]])), 128))]))), 128))])], 4)) : (s(), C("div", Ji, [v(_(Wt), { size: 16 }), M("span", null, R(_(i).table.empty), 1)]))]));
|
|
2853
3129
|
}
|
|
2854
|
-
}), [["__scopeId", "data-v-963ac422"]]),
|
|
3130
|
+
}), [["__scopeId", "data-v-963ac422"]]), Xi = /* @__PURE__ */ d({
|
|
2855
3131
|
__name: "VideoPlayButton",
|
|
2856
3132
|
props: { hoverEffect: {
|
|
2857
3133
|
type: Boolean,
|
|
2858
3134
|
default: !1
|
|
2859
3135
|
} },
|
|
2860
3136
|
setup(e) {
|
|
2861
|
-
return (t, n) => (
|
|
3137
|
+
return (t, n) => (s(), C("div", { class: b(["tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30", e.hoverEffect && "tpl:transition-opacity tpl:group-hover:bg-black/40"]) }, [...n[0] ||= [M("div", { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[color-mix(in_srgb,var(--tpl-bg)_90%,transparent)] tpl:shadow-[var(--tpl-shadow-lg)]" }, [M("svg", {
|
|
2862
3138
|
class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
|
|
2863
3139
|
width: "28",
|
|
2864
3140
|
height: "28",
|
|
@@ -2869,7 +3145,7 @@ var Di = { class: "tpl:w-full" }, Oi = {
|
|
|
2869
3145
|
});
|
|
2870
3146
|
//#endregion
|
|
2871
3147
|
//#region src/utils/videoThumbnail.ts
|
|
2872
|
-
function
|
|
3148
|
+
function Zi(e) {
|
|
2873
3149
|
if (!e) return {
|
|
2874
3150
|
platform: "unknown",
|
|
2875
3151
|
videoId: null,
|
|
@@ -2901,25 +3177,25 @@ function Xi(e) {
|
|
|
2901
3177
|
thumbnailUrl: null
|
|
2902
3178
|
};
|
|
2903
3179
|
}
|
|
2904
|
-
function
|
|
2905
|
-
return t ||
|
|
3180
|
+
function Qi(e, t) {
|
|
3181
|
+
return t || Zi(e).thumbnailUrl;
|
|
2906
3182
|
}
|
|
2907
3183
|
//#endregion
|
|
2908
3184
|
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2909
|
-
var
|
|
3185
|
+
var $i = ["src", "alt"], ea = {
|
|
2910
3186
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
2911
3187
|
style: { opacity: "0.7" }
|
|
2912
|
-
},
|
|
3188
|
+
}, ta = ["href"], na = ["src", "alt"], ra = ["src", "alt"], ia = {
|
|
2913
3189
|
key: 3,
|
|
2914
3190
|
class: "tpl:flex tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
|
|
2915
|
-
},
|
|
3191
|
+
}, aa = /* @__PURE__ */ d({
|
|
2916
3192
|
__name: "VideoBlock",
|
|
2917
3193
|
props: {
|
|
2918
3194
|
block: {},
|
|
2919
3195
|
viewport: {}
|
|
2920
3196
|
},
|
|
2921
3197
|
setup(e) {
|
|
2922
|
-
let t = e, { t: n } =
|
|
3198
|
+
let t = e, { t: n } = Y(), { syntax: r } = Q(), i = S(() => U(t.block.url, r) || U(t.block.thumbnailUrl, r)), a = Sn(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = Sn(() => i.value ? t.block.placeholderUrl : void 0), c = S(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : Qi(t.block.url)), l = S(() => ({ textAlign: t.block.align })), u = S(() => {
|
|
2923
3199
|
let e = t.block.align;
|
|
2924
3200
|
return {
|
|
2925
3201
|
maxWidth: "100%",
|
|
@@ -2928,185 +3204,196 @@ var Qi = ["src", "alt"], $i = {
|
|
|
2928
3204
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
2929
3205
|
marginRight: e === "center" ? "auto" : void 0
|
|
2930
3206
|
};
|
|
2931
|
-
}), d =
|
|
2932
|
-
return (t, r) => (
|
|
3207
|
+
}), d = S(() => U(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
|
|
3208
|
+
return (t, r) => (s(), C("div", {
|
|
2933
3209
|
class: "tpl:w-full",
|
|
2934
|
-
style:
|
|
2935
|
-
}, [i.value && e.block.placeholderUrl ? (
|
|
3210
|
+
style: k(l.value)
|
|
3211
|
+
}, [i.value && e.block.placeholderUrl ? (s(), C("div", {
|
|
2936
3212
|
key: 0,
|
|
2937
3213
|
class: "tpl:relative tpl:inline-block",
|
|
2938
|
-
style:
|
|
3214
|
+
style: k(u.value)
|
|
2939
3215
|
}, [M("img", {
|
|
2940
3216
|
class: "tpl:w-full tpl:border-0",
|
|
2941
|
-
src:
|
|
3217
|
+
src: _(o),
|
|
2942
3218
|
alt: e.block.alt
|
|
2943
|
-
}, null, 8,
|
|
3219
|
+
}, null, 8, $i), v(Xi)], 4)) : i.value ? (s(), C("div", {
|
|
2944
3220
|
key: 1,
|
|
2945
3221
|
class: "tpl:relative tpl:!flex tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
|
|
2946
|
-
style:
|
|
2947
|
-
}, [
|
|
3222
|
+
style: k([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
|
|
3223
|
+
}, [v(_(Bt), {
|
|
2948
3224
|
size: 36,
|
|
2949
3225
|
"stroke-width": 1.5,
|
|
2950
3226
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
2951
3227
|
style: { opacity: "0.5" }
|
|
2952
|
-
}), M("span",
|
|
3228
|
+
}), M("span", ea, [v(qn, { text: d.value }, null, 8, ["text"])])], 4)) : c.value ? (s(), C(L, { key: 2 }, [e.block.url ? (s(), C("a", {
|
|
2953
3229
|
key: 0,
|
|
2954
3230
|
href: e.block.url,
|
|
2955
3231
|
target: "_blank",
|
|
2956
3232
|
rel: "noopener noreferrer",
|
|
2957
3233
|
class: "tpl:group tpl:relative tpl:inline-block",
|
|
2958
|
-
style:
|
|
3234
|
+
style: k(u.value),
|
|
2959
3235
|
onClick: r[0] ||= O(() => {}, ["prevent"])
|
|
2960
3236
|
}, [M("img", {
|
|
2961
3237
|
class: "tpl:w-full tpl:border-0",
|
|
2962
|
-
src:
|
|
3238
|
+
src: c.value,
|
|
2963
3239
|
alt: e.block.alt
|
|
2964
|
-
}, null, 8,
|
|
3240
|
+
}, null, 8, na), v(Xi, { "hover-effect": "" })], 12, ta)) : (s(), C("div", {
|
|
2965
3241
|
key: 1,
|
|
2966
3242
|
class: "tpl:relative tpl:inline-block",
|
|
2967
|
-
style:
|
|
3243
|
+
style: k(u.value)
|
|
2968
3244
|
}, [M("img", {
|
|
2969
3245
|
class: "tpl:w-full tpl:border-0",
|
|
2970
|
-
src:
|
|
3246
|
+
src: c.value,
|
|
2971
3247
|
alt: e.block.alt
|
|
2972
|
-
}, null, 8,
|
|
3248
|
+
}, null, 8, ra), v(Xi)], 4))], 64)) : (s(), C("div", ia, [v(_(Bt), {
|
|
2973
3249
|
size: 40,
|
|
2974
3250
|
"stroke-width": 1.5,
|
|
2975
3251
|
class: "tpl:text-[var(--tpl-border-light)]"
|
|
2976
|
-
}), M("span", null,
|
|
2977
|
-
}
|
|
2978
|
-
}),
|
|
2979
|
-
section:
|
|
2980
|
-
title:
|
|
2981
|
-
paragraph:
|
|
2982
|
-
image:
|
|
2983
|
-
button:
|
|
2984
|
-
divider:
|
|
2985
|
-
video:
|
|
2986
|
-
social:
|
|
2987
|
-
menu:
|
|
2988
|
-
table:
|
|
2989
|
-
spacer:
|
|
2990
|
-
html:
|
|
2991
|
-
countdown:
|
|
3252
|
+
}), M("span", null, R(_(n).video.addVideo), 1)]))], 4));
|
|
3253
|
+
}
|
|
3254
|
+
}), oa = {
|
|
3255
|
+
section: Ai,
|
|
3256
|
+
title: Ei,
|
|
3257
|
+
paragraph: si,
|
|
3258
|
+
image: Jr,
|
|
3259
|
+
button: Yn,
|
|
3260
|
+
divider: Or,
|
|
3261
|
+
video: aa,
|
|
3262
|
+
social: Bi,
|
|
3263
|
+
menu: Qr,
|
|
3264
|
+
table: Yi,
|
|
3265
|
+
spacer: Ui,
|
|
3266
|
+
html: Pr,
|
|
3267
|
+
countdown: B(() => import("./CountdownBlock-BYSrJWxg.js"))
|
|
2992
3268
|
};
|
|
2993
|
-
function
|
|
2994
|
-
let { editor:
|
|
2995
|
-
|
|
2996
|
-
let { resolvedTheme:
|
|
2997
|
-
themeOverrides:
|
|
2998
|
-
resolvedTheme:
|
|
2999
|
-
extraStyles:
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3269
|
+
function sa(e) {
|
|
3270
|
+
let { editor: n, config: r, translations: i, fontsManager: a } = e, { t: s, format: u } = Y(i);
|
|
3271
|
+
n.setUiTheme(r.uiTheme ?? "auto");
|
|
3272
|
+
let { resolvedTheme: d } = An(S(() => n.state.uiTheme)), f = l(r.theme ?? {}), { themeStyles: p } = Mn({
|
|
3273
|
+
themeOverrides: f,
|
|
3274
|
+
resolvedTheme: d,
|
|
3275
|
+
extraStyles: () => ({
|
|
3276
|
+
"--tpl-drop-text": `"${i.canvas.dropHere}"`,
|
|
3277
|
+
...e.themeExtraStyles?.()
|
|
3278
|
+
})
|
|
3279
|
+
}), m = tn({
|
|
3280
|
+
content: n.content,
|
|
3281
|
+
setContent: (e, t) => n.setContent(e, t),
|
|
3003
3282
|
...e.historyOptions
|
|
3004
3283
|
});
|
|
3005
|
-
|
|
3006
|
-
let
|
|
3007
|
-
addBlock:
|
|
3008
|
-
removeBlock:
|
|
3009
|
-
updateBlock:
|
|
3010
|
-
selectBlock:
|
|
3011
|
-
findBlockLocation:
|
|
3012
|
-
blockDefaults:
|
|
3013
|
-
}),
|
|
3014
|
-
content:
|
|
3015
|
-
isDirty: () =>
|
|
3284
|
+
ln(n, m);
|
|
3285
|
+
let g = rn({
|
|
3286
|
+
addBlock: n.addBlock,
|
|
3287
|
+
removeBlock: n.removeBlock,
|
|
3288
|
+
updateBlock: n.updateBlock,
|
|
3289
|
+
selectBlock: n.selectBlock,
|
|
3290
|
+
findBlockLocation: n.findBlockLocation,
|
|
3291
|
+
blockDefaults: r.blockDefaults
|
|
3292
|
+
}), _ = sn(n), v = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? on({
|
|
3293
|
+
content: n.content,
|
|
3294
|
+
isDirty: () => n.state.isDirty,
|
|
3016
3295
|
...e.autoSaveOptions
|
|
3017
|
-
}) : null,
|
|
3018
|
-
|
|
3019
|
-
e ?
|
|
3296
|
+
}) : null, y = null;
|
|
3297
|
+
v && (y = t(m.isNavigating, (e) => {
|
|
3298
|
+
e ? v.pause() : v.resume();
|
|
3020
3299
|
}));
|
|
3021
|
-
let
|
|
3300
|
+
let b = kn(n, {
|
|
3022
3301
|
t: s,
|
|
3023
|
-
format:
|
|
3024
|
-
},
|
|
3025
|
-
if (
|
|
3026
|
-
let e =
|
|
3027
|
-
e.length > 0 &&
|
|
3028
|
-
}
|
|
3029
|
-
let
|
|
3030
|
-
|
|
3031
|
-
let
|
|
3032
|
-
function
|
|
3302
|
+
format: u
|
|
3303
|
+
}, r.customBlocks ?? []), x = Dt(r.colors);
|
|
3304
|
+
if (x.allowCustomIgnored && X.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), x.invalidPresets.length > 0 && X.warn(`config.colors.presets skipped invalid entries: ${x.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), x.allowCustom === !1) {
|
|
3305
|
+
let e = Vn(x.presets, r.blockDefaults, r.templateDefaults);
|
|
3306
|
+
e.length > 0 && X.warn(`config.colors locks custom colours, but these block/template default colours fall outside colors.presets: ${e.join(", ")}. New blocks start on a colour the palette can't reselect — set blockDefaults / templateDefaults from the same palette.`);
|
|
3307
|
+
}
|
|
3308
|
+
let C = Nn();
|
|
3309
|
+
Rn(C, oa);
|
|
3310
|
+
let w = /* @__PURE__ */ new Set();
|
|
3311
|
+
function T(e) {
|
|
3033
3312
|
for (let t of e) {
|
|
3034
|
-
|
|
3035
|
-
for (let e of
|
|
3313
|
+
C.registerCustom(t, Er);
|
|
3314
|
+
for (let e of Un(t, x)) w.has(e.id) || (w.add(e.id), X.warn(e.message));
|
|
3036
3315
|
}
|
|
3037
3316
|
}
|
|
3038
|
-
|
|
3039
|
-
let
|
|
3040
|
-
if (
|
|
3317
|
+
r.customBlocks?.length && T(r.customBlocks);
|
|
3318
|
+
let E = vn();
|
|
3319
|
+
if (o() && h(E.dispose), e.containerEl) {
|
|
3041
3320
|
let t = e.containerEl;
|
|
3042
|
-
|
|
3321
|
+
G(document, "pointerdown", (e) => {
|
|
3043
3322
|
let n = t.value;
|
|
3044
|
-
n && (e.composedPath?.() ?? []).includes(n) &&
|
|
3323
|
+
n && (e.composedPath?.() ?? []).includes(n) && E.claim();
|
|
3045
3324
|
}, { capture: !0 });
|
|
3046
3325
|
}
|
|
3047
|
-
function
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3326
|
+
function D() {
|
|
3327
|
+
let t = e.capabilities?.templates;
|
|
3328
|
+
if (t) {
|
|
3329
|
+
t.save();
|
|
3330
|
+
return;
|
|
3331
|
+
}
|
|
3332
|
+
v?.flush();
|
|
3333
|
+
}
|
|
3334
|
+
function O(t) {
|
|
3335
|
+
E.isActive() && Gn(t, {
|
|
3336
|
+
history: m,
|
|
3337
|
+
selectBlock: (e) => n.selectBlock(e),
|
|
3338
|
+
getSelectedBlockId: () => n.state.selectedBlockId,
|
|
3339
|
+
removeBlock: (e) => n.removeBlock(e),
|
|
3340
|
+
onSave: D,
|
|
3054
3341
|
onBeforeUndo: e.keyboardOptions?.onBeforeUndo,
|
|
3055
3342
|
isPicking: () => e.capabilities?.savedBlocks?.isPicking.value === !0,
|
|
3056
3343
|
onConfirmPick: () => e.capabilities?.savedBlocks?.confirmPicking(),
|
|
3057
3344
|
onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
|
|
3058
3345
|
});
|
|
3059
3346
|
}
|
|
3060
|
-
|
|
3061
|
-
let
|
|
3062
|
-
|
|
3063
|
-
let
|
|
3064
|
-
|
|
3065
|
-
let
|
|
3066
|
-
|
|
3067
|
-
let
|
|
3068
|
-
resolvePreview:
|
|
3069
|
-
getContent: () =>
|
|
3070
|
-
isActive: () =>
|
|
3347
|
+
G(document, "keydown", O);
|
|
3348
|
+
let k = l(null);
|
|
3349
|
+
c(ut, e.editorRoot ?? document), c(et, k), c(nt, i), c(J, n), c(bt, m), c(at, g), c(ct, _), c(it, a), c(We, p), c(Ye, d), c(ht, r.blockDefaults), c(vt, C), c(lt, r.customBlocks ?? []), c(Qe, r.paletteBlocks), c(Ct, zn(r.htmlBlockPreview)), c(yt, x), c(gt, Pn(n.content, C));
|
|
3350
|
+
let A = Se(r.mergeTags?.syntax);
|
|
3351
|
+
c(K, r.mergeTags?.tags ?? []), c(ft, A), c(Ze, r.mergeTags?.onRequest ?? null), c(qe, r.mergeTags?.autocomplete !== !1);
|
|
3352
|
+
let j = l(Ne(r.mergeTags?.tags ?? []));
|
|
3353
|
+
c($e, j);
|
|
3354
|
+
let M = bn({
|
|
3355
|
+
resolvePreview: r.resolvePreview,
|
|
3356
|
+
getContent: () => n.content.value,
|
|
3357
|
+
isActive: () => n.state.previewMode
|
|
3071
3358
|
});
|
|
3072
|
-
|
|
3073
|
-
let
|
|
3074
|
-
|
|
3075
|
-
let
|
|
3076
|
-
|
|
3077
|
-
let
|
|
3078
|
-
content:
|
|
3079
|
-
options:
|
|
3080
|
-
updateBlock:
|
|
3081
|
-
updateSettings:
|
|
3082
|
-
removeBlock:
|
|
3359
|
+
c(Je, M), c(Xe, r.resolvePreview);
|
|
3360
|
+
let N = S(() => !(n.state.previewMode && M.isConfigured));
|
|
3361
|
+
c(_t, N);
|
|
3362
|
+
let P = Cn();
|
|
3363
|
+
c(Ke, P), c(Ge, r.logicTags?.tags ?? []), c(tt, r.logicTags?.pairs ?? []), c(Ue, r.logicTags?.onRequest ?? null), c(xt, wn()), c(dt, r.onRequestMedia ?? null), c(ot, r.resolveImageUrl ? xn(r.resolveImageUrl) : null), c(pt, r.displayConditions?.conditions ?? []), c(mt, r.displayConditions?.allowCustom ?? !1), c(st, e.capabilities ?? {}), c(St, b);
|
|
3364
|
+
let F = Tn(r.lint) ? null : En({
|
|
3365
|
+
content: n.content,
|
|
3366
|
+
options: r.lint ?? {},
|
|
3367
|
+
updateBlock: n.updateBlock,
|
|
3368
|
+
updateSettings: n.updateSettings,
|
|
3369
|
+
removeBlock: n.removeBlock
|
|
3083
3370
|
});
|
|
3084
|
-
|
|
3085
|
-
function
|
|
3086
|
-
|
|
3371
|
+
c(wt, F);
|
|
3372
|
+
function I() {
|
|
3373
|
+
y?.(), F?.destroy(), v?.destroy(), m.destroy();
|
|
3087
3374
|
}
|
|
3088
3375
|
return {
|
|
3089
3376
|
t: s,
|
|
3090
|
-
format:
|
|
3091
|
-
history:
|
|
3092
|
-
blockActions:
|
|
3093
|
-
conditionPreview:
|
|
3094
|
-
autoSave:
|
|
3095
|
-
resolvedTheme:
|
|
3096
|
-
themeStyles:
|
|
3097
|
-
themeOverrides:
|
|
3098
|
-
registry:
|
|
3099
|
-
keyboardReorder:
|
|
3100
|
-
templateLint:
|
|
3101
|
-
popoverRoot:
|
|
3102
|
-
mergeTagSampleMode:
|
|
3103
|
-
previewResolution:
|
|
3104
|
-
appliesConditionFilter:
|
|
3105
|
-
registerCustomBlocks:
|
|
3106
|
-
destroy:
|
|
3377
|
+
format: u,
|
|
3378
|
+
history: m,
|
|
3379
|
+
blockActions: g,
|
|
3380
|
+
conditionPreview: _,
|
|
3381
|
+
autoSave: v,
|
|
3382
|
+
resolvedTheme: d,
|
|
3383
|
+
themeStyles: p,
|
|
3384
|
+
themeOverrides: f,
|
|
3385
|
+
registry: C,
|
|
3386
|
+
keyboardReorder: b,
|
|
3387
|
+
templateLint: F,
|
|
3388
|
+
popoverRoot: k,
|
|
3389
|
+
mergeTagSampleMode: j,
|
|
3390
|
+
previewResolution: M,
|
|
3391
|
+
appliesConditionFilter: N,
|
|
3392
|
+
registerCustomBlocks: T,
|
|
3393
|
+
destroy: I
|
|
3107
3394
|
};
|
|
3108
3395
|
}
|
|
3109
3396
|
//#endregion
|
|
3110
|
-
export {
|
|
3397
|
+
export { On as A, Zt as B, cr as C, Qn as D, tr as E, pn as F, fn as I, un as L, bn as M, hn as N, Yn as O, mn as P, cn as R, pr as S, nr as T, Pr as _, Bi as a, _r as b, Ei as c, ci as d, li as f, Ir as g, Jr as h, Ui as i, Dn as j, Hn as k, wi as l, Qr as m, aa as n, Ni as o, si as p, Yi as r, Ai as s, sa as t, ui as u, Or as v, sr as w, hr as x, Er as y, an as z };
|
|
3111
3398
|
|
|
3112
|
-
//# sourceMappingURL=useEditorCore-
|
|
3399
|
+
//# sourceMappingURL=useEditorCore-CTu_qZ3W.js.map
|