@templatical/editor 0.6.3 → 0.6.5
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/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-B2MT0M58.js} +34 -34
- package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-w5ek3Z76.js} +62 -62
- package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-uXTxJh06.js} +20 -20
- package/dist/{cdn/chunks/BlockA11yBadge-DcEZftf6.js → BlockA11yBadge-C0S6kPC4.js} +10 -9
- package/dist/{CloudEditor-BCz1ZTYC.js → CloudEditor-_GaYluN7.js} +446 -440
- package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-C4eXJkXW.js} +20 -20
- package/dist/CommentsSidebar-BQROg36f.js +441 -0
- package/dist/{cdn/chunks/CountdownBlock-5YdT1uUu.js → CountdownBlock-Bxqe7zwL.js} +21 -22
- package/dist/CountdownToolbar-CpFAnjSo.js +210 -0
- package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-CfqpcWX6.js} +52 -52
- package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-CFkDkjBb.js} +1 -1
- package/dist/{ModuleBrowserModal-DrUFMTDx.js → ModuleBrowserModal-EDKHLJtb.js} +79 -79
- package/dist/{ModulePreviewCanvas-CHdOwV_4.js → ModulePreviewCanvas-MQxat34K.js} +29 -29
- package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-Dw8dN1Pt.js} +88 -88
- package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-C8IP9HOZ.js} +218 -218
- package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-CK3Om7ES.js} +38 -38
- package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-Bgu0FVr6.js} +34 -34
- package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-aSULEKUJ.js} +33 -33
- package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-BIAeCAEP.js} +82 -82
- package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-wcbmmWCs.js} +30 -30
- package/dist/{TitleEditor-fStSADI-.js → TitleEditor-21D8_OUQ.js} +67 -67
- package/dist/{TplModal-BwSfxIHf.js → TplModal-CINtyB6Y.js} +14 -14
- package/dist/{accessibility-e8JYu_zd.js → accessibility-BgUEA-Ai.js} +1 -1
- package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-DKetBdJx.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js → AccessibilityPanel-BMSGhaNU.js} +34 -34
- package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js.map → AccessibilityPanel-BMSGhaNU.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js → AiFeatureMenu-hNba-JqQ.js} +16 -16
- package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js.map → AiFeatureMenu-hNba-JqQ.js.map} +1 -1
- package/dist/{BlockA11yBadge-CXDLqkcJ.js → cdn/chunks/BlockA11yBadge-BIR88CvN.js} +11 -12
- package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js.map → BlockA11yBadge-BIR88CvN.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-D2GsEC_n.js → CloudEditor-D2G2nNpQ.js} +429 -423
- package/dist/cdn/chunks/{CloudEditor-D2GsEC_n.js.map → CloudEditor-D2G2nNpQ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js → CollaboratorBar-Btzom8dY.js} +20 -20
- package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js.map → CollaboratorBar-Btzom8dY.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-BJSAJlJ1.js +93 -0
- package/dist/cdn/chunks/{CountdownBlock-5YdT1uUu.js.map → CountdownBlock-BJSAJlJ1.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-DbknNrIi.js +212 -0
- package/dist/cdn/chunks/{CountdownToolbar-DXPXrbAA.js.map → CountdownToolbar-DbknNrIi.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-DxoPp81s.js → ModuleBrowserModal-BvAuW8O5.js} +43 -43
- package/dist/cdn/chunks/{ModuleBrowserModal-DxoPp81s.js.map → ModuleBrowserModal-BvAuW8O5.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-CoLdb4ar.js → ModulePreviewCanvas-CYtt0boo.js} +23 -23
- package/dist/cdn/chunks/{ModulePreviewCanvas-CoLdb4ar.js.map → ModulePreviewCanvas-CYtt0boo.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js → NumberWithSuffix-CVfo9ztG.js} +108 -108
- package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js.map → NumberWithSuffix-CVfo9ztG.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js → ParagraphEditor-DCo58JP8.js} +187 -187
- package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js.map → ParagraphEditor-DCo58JP8.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js → RichTextEditorContent-BzCThv84.js} +33 -33
- package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js.map → RichTextEditorContent-BzCThv84.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js → SaveModuleDialog-S2Lix1LD.js} +27 -27
- package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js.map → SaveModuleDialog-S2Lix1LD.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js → TitleEditor-CYzAMuUW.js} +66 -66
- package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js.map → TitleEditor-CYzAMuUW.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BzzY9_kA.js → blockTypeIcons-DOzUHoor.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-BzzY9_kA.js.map → blockTypeIcons-DOzUHoor.js.map} +1 -1
- package/dist/cdn/chunks/draggable-CNhyCGIO.js +4804 -0
- package/dist/cdn/chunks/draggable-CNhyCGIO.js.map +1 -0
- package/dist/cdn/chunks/{extensions-DIxF31tA.js → extensions-wafZZ0-_.js} +95 -95
- package/dist/cdn/chunks/{extensions-DIxF31tA.js.map → extensions-wafZZ0-_.js.map} +1 -1
- package/dist/cdn/chunks/{features-DEMb13KS.js → features-B4tNvoi4.js} +2260 -2267
- package/dist/cdn/chunks/features-B4tNvoi4.js.map +1 -0
- package/dist/cdn/chunks/{icons-CsLTcirh.js → icons-B5nBFtvb.js} +2 -2
- package/dist/cdn/chunks/{icons-CsLTcirh.js.map → icons-B5nBFtvb.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-CVaNvhpM.js → media-library-BLaoBxHe.js} +1397 -1397
- package/dist/cdn/chunks/{media-library-CVaNvhpM.js.map → media-library-BLaoBxHe.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-CDbNlZBE.js → pusher-bjpcqCZG.js} +2 -2
- package/dist/cdn/chunks/{pusher-CDbNlZBE.js.map → pusher-bjpcqCZG.js.map} +1 -1
- package/dist/cdn/chunks/{quality-BaBfc54_.js → quality-D920ZxXf.js} +3 -3
- package/dist/cdn/chunks/{quality-BaBfc54_.js.map → quality-D920ZxXf.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-CUxvx7ro.js → renderer-Yk30CckU.js} +3 -3
- package/dist/cdn/chunks/{renderer-CUxvx7ro.js.map → renderer-Yk30CckU.js.map} +1 -1
- package/dist/{rolldown-runtime-BZGGJVDF.js → cdn/chunks/rolldown-runtime-C266TIVP.js} +5 -5
- package/dist/cdn/chunks/{src-CRaqN-p8.js → src-kLJg7Y0m.js} +171 -171
- package/dist/cdn/chunks/{src-CRaqN-p8.js.map → src-kLJg7Y0m.js.map} +1 -1
- package/dist/cdn/chunks/styles-DrVLif14.js +2944 -0
- package/dist/cdn/chunks/styles-DrVLif14.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js → tiptap-IyIsncxY.js} +45 -46
- package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js.map → tiptap-IyIsncxY.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +122 -122
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-Da05j8yl.js → check-Bg5yrRmX.js} +1 -1
- package/dist/{chevron-down-R2uY34iD.js → chevron-down-tee-ghFi.js} +1 -1
- package/dist/{circle-alert-DZuGWPX-.js → circle-alert-C0L9pUQ4.js} +1 -1
- package/dist/{clock-CRp2sIub.js → clock-CDlEdqiP.js} +1 -1
- package/dist/{cloud-DEk_b4CR.js → cloud-a3VovHva.js} +145 -145
- package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-Di4mqmGn.js} +9 -9
- package/dist/{dist-B1IR0bpH.js → dist-BzRLLpfq.js} +107 -107
- package/dist/{dist-BFawx6IS.js → dist-Pk4MhWMP.js} +35 -35
- package/dist/{extensions-CUcl9Ok4.js → extensions-BF39Siqk.js} +103 -103
- package/dist/{image-up-MBZKKg9p.js → image-up-1D_3XDdO.js} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/{info-CJEC7piy.js → info-DTGrc0Bx.js} +1 -1
- package/dist/{keys-ciNfSSGj.js → keys-Bqs_0du9.js} +1 -1
- package/dist/{loader-circle-DsY5Yg33.js → loader-circle-_9bP23op.js} +1 -1
- package/dist/{message-circle-yElBbR2C.js → message-circle-gzy2ZGJ3.js} +1 -1
- package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-BNAhAmtL.js} +1 -1
- package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
- package/dist/{scan-line-D0vcUekt.js → scan-line-DUEg6DoT.js} +1 -1
- package/dist/{send-DH4oDQqC.js → send-BatIZC9a.js} +1 -1
- package/dist/{shield-check-CfJgs2Hd.js → shield-check-C5Gv2cM1.js} +1 -1
- package/dist/{sparkles-CvRXGqFs.js → sparkles-D1IGi_cC.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styles-CwJQsnSp.js +3173 -0
- package/dist/templatical-editor.js +99 -99
- package/dist/{text-align-start-BT9VUDxK.js → text-align-start-DG3aAH7Y.js} +1 -1
- package/dist/{trash-2-DbP2Y6t2.js → trash-2-424iqbpN.js} +1 -1
- package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-DWQySIE2.js} +1 -1
- package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-CL_AwWwi.js} +4 -4
- package/dist/useEditorCore-DLd-5qMg.js +3784 -0
- package/dist/{useI18n-lb2DHDiu.js → useI18n-CgmQftNf.js} +4 -4
- package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-vpwrZ9eQ.js} +3 -3
- package/dist/vue.runtime.esm-bundler-Bxqkjqhc.js +4300 -0
- package/dist/{x-u2oVmjN_.js → x-Dlaenqta.js} +1 -1
- package/package.json +8 -8
- package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
- package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
- package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
- package/dist/cdn/chunks/draggable-Bcb86AsV.js +0 -11572
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +0 -1
- package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +0 -20
- package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
- package/dist/styles-DEXEkBvg.js +0 -3176
- package/dist/useEditorCore-C6ost42Q.js +0 -9342
- package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +0 -5775
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./useEditorCore-
|
|
3
|
-
import { t as f } from "./createLucideIcon-
|
|
4
|
-
import { n as p } from "./useCloudI18n-
|
|
1
|
+
import { A as e, M as t, b as n, d as r, f as i, h as a, l as o, m as s, ot as c, p as l, rt as u, st as d } from "./vue.runtime.esm-bundler-Bxqkjqhc.js";
|
|
2
|
+
import "./useEditorCore-DLd-5qMg.js";
|
|
3
|
+
import { t as f } from "./createLucideIcon-Di4mqmGn.js";
|
|
4
|
+
import { n as p } from "./useCloudI18n-CL_AwWwi.js";
|
|
5
5
|
import { t as m } from "./readableTextColor-CY3SiRnt.js";
|
|
6
6
|
var h = f("wifi-off", [
|
|
7
7
|
["path", {
|
|
@@ -52,43 +52,43 @@ var h = f("wifi-off", [
|
|
|
52
52
|
]), _ = { class: "tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2" }, v = ["title"], y = {
|
|
53
53
|
key: 0,
|
|
54
54
|
class: "tpl:flex tpl:items-center tpl:-space-x-1.5"
|
|
55
|
-
}, b = ["title"], x = ["title"], S = 3, C = /* @__PURE__ */
|
|
55
|
+
}, b = ["title"], x = ["title"], S = 3, C = /* @__PURE__ */ n({
|
|
56
56
|
__name: "CollaboratorBar",
|
|
57
57
|
props: {
|
|
58
58
|
collaborators: {},
|
|
59
59
|
isConnected: { type: Boolean }
|
|
60
60
|
},
|
|
61
|
-
setup(
|
|
62
|
-
let f =
|
|
61
|
+
setup(n) {
|
|
62
|
+
let f = n, { t: C } = p(), w = r(() => f.collaborators.slice(0, S)), T = r(() => f.collaborators.slice(S)), E = r(() => T.value.length), D = r(() => T.value.map((e) => e.name).join("\n"));
|
|
63
63
|
function O(e) {
|
|
64
64
|
let t = e.trim().split(/\s+/);
|
|
65
65
|
return t.length >= 2 ? (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase() : e.charAt(0).toUpperCase();
|
|
66
66
|
}
|
|
67
|
-
return (
|
|
67
|
+
return (r, f) => (e(), a("div", _, [i("div", {
|
|
68
68
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",
|
|
69
|
-
style:
|
|
70
|
-
title:
|
|
71
|
-
}, [
|
|
69
|
+
style: c({ color: n.isConnected ? "var(--tpl-success)" : "var(--tpl-text-muted)" }),
|
|
70
|
+
title: n.isConnected ? u(C).collaboration.connected : u(C).collaboration.disconnected
|
|
71
|
+
}, [n.isConnected ? (e(), l(u(g), {
|
|
72
72
|
key: 0,
|
|
73
73
|
size: 12,
|
|
74
74
|
"stroke-width": 2
|
|
75
|
-
})) : (e(),
|
|
75
|
+
})) : (e(), l(u(h), {
|
|
76
76
|
key: 1,
|
|
77
77
|
size: 12,
|
|
78
78
|
"stroke-width": 2
|
|
79
|
-
}))], 12, v),
|
|
80
|
-
key:
|
|
79
|
+
}))], 12, v), n.collaborators.length > 0 ? (e(), a("div", y, [(e(!0), a(o, null, t(w.value, (t) => (e(), a("div", {
|
|
80
|
+
key: t.id,
|
|
81
81
|
class: "tpl-collaborator-avatar tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[10px] tpl:font-bold tpl:transition-transform tpl:duration-150 tpl:hover:z-10 tpl:hover:scale-110 tpl:border-[var(--tpl-bg)]",
|
|
82
|
-
style:
|
|
83
|
-
backgroundColor:
|
|
84
|
-
color:
|
|
82
|
+
style: c({
|
|
83
|
+
backgroundColor: t.color,
|
|
84
|
+
color: u(m)(t.color)
|
|
85
85
|
}),
|
|
86
|
-
title:
|
|
87
|
-
},
|
|
86
|
+
title: t.name
|
|
87
|
+
}, d(O(t.name)), 13, b))), 128)), E.value > 0 ? (e(), a("div", {
|
|
88
88
|
key: 0,
|
|
89
89
|
class: "tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[9px] tpl:font-bold tpl:border-[var(--tpl-bg)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]",
|
|
90
90
|
title: D.value
|
|
91
|
-
}, " +" +
|
|
91
|
+
}, " +" + d(E.value), 9, x)) : s("", !0)])) : s("", !0)]));
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
//#endregion
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import { A as e, B as t, E as n, L as r, M as i, X as a, _ as ee, a as o, at as s, b as c, d as l, f as u, h as d, l as f, m as p, ot as te, p as m, rt as h, st as g, t as _, v, z as y } from "./vue.runtime.esm-bundler-Bxqkjqhc.js";
|
|
2
|
+
import { O as b, i as ne, m as re, u as ie } from "./keys-Bqs_0du9.js";
|
|
3
|
+
import { t as ae } from "./useI18n-CgmQftNf.js";
|
|
4
|
+
import { t as x } from "./createLucideIcon-Di4mqmGn.js";
|
|
5
|
+
import { t as oe } from "./check-Bg5yrRmX.js";
|
|
6
|
+
import { t as se } from "./chevron-down-tee-ghFi.js";
|
|
7
|
+
import { t as S } from "./loader-circle-_9bP23op.js";
|
|
8
|
+
import { t as C } from "./message-circle-gzy2ZGJ3.js";
|
|
9
|
+
import { t as w } from "./send-BatIZC9a.js";
|
|
10
|
+
import { t as T } from "./trash-2-424iqbpN.js";
|
|
11
|
+
import { t as E } from "./x-Dlaenqta.js";
|
|
12
|
+
import { t as D } from "./_plugin-vue_export-helper-B0hnzhyu.js";
|
|
13
|
+
import { n as ce } from "./useCloudI18n-CL_AwWwi.js";
|
|
14
|
+
import { t as le } from "./formatRelativeTime-BOEf47hq.js";
|
|
15
|
+
var ue = x("chevron-up", [["path", {
|
|
16
|
+
d: "m18 15-6-6-6 6",
|
|
17
|
+
key: "153udz"
|
|
18
|
+
}]]), de = x("circle-check", [["circle", {
|
|
19
|
+
cx: "12",
|
|
20
|
+
cy: "12",
|
|
21
|
+
r: "10",
|
|
22
|
+
key: "1mglay"
|
|
23
|
+
}], ["path", {
|
|
24
|
+
d: "m9 12 2 2 4-4",
|
|
25
|
+
key: "dzmm74"
|
|
26
|
+
}]]), O = x("pencil", [["path", {
|
|
27
|
+
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
28
|
+
key: "1a8usu"
|
|
29
|
+
}], ["path", {
|
|
30
|
+
d: "m15 5 4 4",
|
|
31
|
+
key: "1mk7zo"
|
|
32
|
+
}]]), fe = x("reply", [["path", {
|
|
33
|
+
d: "M20 18v-2a4 4 0 0 0-4-4H4",
|
|
34
|
+
key: "5vmcpk"
|
|
35
|
+
}], ["path", {
|
|
36
|
+
d: "m9 17-5-5 5-5",
|
|
37
|
+
key: "nvlc11"
|
|
38
|
+
}]]), pe = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "tpl-comments-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"
|
|
41
|
+
}, me = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, he = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]" }, ge = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "tpl:ml-1 tpl:inline-flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]"
|
|
44
|
+
}, _e = { class: "tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2" }, ve = { class: "tpl:flex-1 tpl:overflow-y-auto" }, ye = {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "tpl:flex tpl:h-full tpl:items-center tpl:justify-center"
|
|
47
|
+
}, be = {
|
|
48
|
+
key: 1,
|
|
49
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:px-6 tpl:text-center"
|
|
50
|
+
}, xe = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Se = {
|
|
51
|
+
key: 2,
|
|
52
|
+
class: "tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3"
|
|
53
|
+
}, Ce = { class: "tpl-comment-card tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-3" }, we = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, Te = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Ee = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, De = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, Oe = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
|
|
56
|
+
}, ke = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, Ae = ["title", "onClick"], je = ["title", "onClick"], Me = ["title", "onClick"], Ne = {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:text-[10px] tpl:text-[var(--tpl-primary)]"
|
|
59
|
+
}, Pe = {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)]"
|
|
62
|
+
}, Fe = ["onClick"], Ie = {
|
|
63
|
+
key: 2,
|
|
64
|
+
class: "tpl:mt-2"
|
|
65
|
+
}, Le = ["onKeydown"], Re = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, ze = ["disabled", "onClick"], Be = {
|
|
66
|
+
key: 3,
|
|
67
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
|
|
68
|
+
}, Ve = {
|
|
69
|
+
key: 4,
|
|
70
|
+
class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]"
|
|
71
|
+
}, He = { class: "tpl:flex-1" }, Ue = ["onClick"], We = {
|
|
72
|
+
key: 5,
|
|
73
|
+
class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2"
|
|
74
|
+
}, Ge = ["title", "onClick"], Ke = ["onClick"], qe = {
|
|
75
|
+
key: 0,
|
|
76
|
+
class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
|
|
77
|
+
}, Je = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, Ye = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Xe = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ze = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, Qe = {
|
|
78
|
+
key: 0,
|
|
79
|
+
class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
|
|
80
|
+
}, $e = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, et = ["title", "onClick"], tt = ["title", "onClick"], nt = {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "tpl:mt-1.5"
|
|
83
|
+
}, rt = ["onKeydown"], it = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, at = ["disabled", "onClick"], ot = {
|
|
84
|
+
key: 1,
|
|
85
|
+
class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
|
|
86
|
+
}, st = {
|
|
87
|
+
key: 2,
|
|
88
|
+
class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]"
|
|
89
|
+
}, ct = { class: "tpl:flex-1" }, lt = ["onClick"], ut = {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
|
|
92
|
+
}, dt = { class: "tpl:flex tpl:items-end tpl:gap-2" }, ft = ["placeholder", "onKeydown"], pt = { class: "tpl:flex tpl:shrink-0 tpl:flex-col tpl:gap-1" }, mt = ["disabled", "onClick"], ht = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, gt = {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: "tpl:flex tpl:min-h-[68px] tpl:items-center tpl:rounded-md tpl:px-3 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)]"
|
|
95
|
+
}, _t = {
|
|
96
|
+
key: 1,
|
|
97
|
+
class: "tpl-comments-input-wrapper tpl:flex tpl:min-h-[68px] tpl:items-end tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]"
|
|
98
|
+
}, vt = ["placeholder", "disabled"], yt = ["disabled"], k = /* @__PURE__ */ D(/* @__PURE__ */ c({
|
|
99
|
+
__name: "CommentsSidebar",
|
|
100
|
+
props: { visible: { type: Boolean } },
|
|
101
|
+
emits: ["close", "filterBlock"],
|
|
102
|
+
setup(c, { expose: x, emit: D }) {
|
|
103
|
+
let k = c, A = D, { format: j } = ae(), { t: M } = ce(), N = b(re, "CommentsSidebar"), bt = b(ne, "CommentsSidebar"), P = b(ie, "CommentsSidebar"), F = a("unresolved"), I = a(null), L = a(""), R = a(null), z = a(""), B = a(null), V = a(""), H = a(/* @__PURE__ */ new Set()), U = a(null), W = a(null), xt = l(() => bt.userConfig?.id ?? null), St = l(() => {
|
|
104
|
+
let e = /* @__PURE__ */ new Set();
|
|
105
|
+
for (let t of N.content.value.blocks) if (e.add(t.id), t.type === "section") for (let n of t.children) for (let t of n) e.add(t.id);
|
|
106
|
+
return e;
|
|
107
|
+
});
|
|
108
|
+
function Ct(e) {
|
|
109
|
+
return e ? !St.value.has(e) : !1;
|
|
110
|
+
}
|
|
111
|
+
let wt = l(() => F.value !== "block" || !I.value ? !1 : !(N.savedBlockIds?.value.has(I.value) ?? !0)), G = l(() => {
|
|
112
|
+
let e = P.comments.value;
|
|
113
|
+
return F.value === "unresolved" ? e = e.filter((e) => !e.resolved_at) : F.value === "block" && I.value && (e = e.filter((e) => e.block_id === I.value)), e;
|
|
114
|
+
});
|
|
115
|
+
r(() => k.visible, (e) => {
|
|
116
|
+
e && P.loadComments();
|
|
117
|
+
}), r(() => N.state.selectedBlockId, (e) => {
|
|
118
|
+
F.value === "block" && e && (I.value = e);
|
|
119
|
+
});
|
|
120
|
+
function K(e, t) {
|
|
121
|
+
F.value = e, I.value = e === "block" ? t ?? null : null;
|
|
122
|
+
}
|
|
123
|
+
function Tt(e) {
|
|
124
|
+
K("block", e), A("filterBlock", e);
|
|
125
|
+
}
|
|
126
|
+
function Et(e) {
|
|
127
|
+
H.value.has(e) ? H.value.delete(e) : H.value.add(e);
|
|
128
|
+
}
|
|
129
|
+
function Dt(e) {
|
|
130
|
+
R.value = e, z.value = "", B.value = null, H.value.has(e) || H.value.add(e);
|
|
131
|
+
}
|
|
132
|
+
function Ot() {
|
|
133
|
+
R.value = null, z.value = "";
|
|
134
|
+
}
|
|
135
|
+
function q(e) {
|
|
136
|
+
B.value = e.id, V.value = e.body, R.value = null;
|
|
137
|
+
}
|
|
138
|
+
function J() {
|
|
139
|
+
B.value = null, V.value = "";
|
|
140
|
+
}
|
|
141
|
+
function Y(e) {
|
|
142
|
+
U.value = e;
|
|
143
|
+
}
|
|
144
|
+
function X() {
|
|
145
|
+
U.value = null;
|
|
146
|
+
}
|
|
147
|
+
async function Z() {
|
|
148
|
+
let e = L.value.trim();
|
|
149
|
+
if (!e) return;
|
|
150
|
+
let t = F.value === "block" ? I.value : void 0;
|
|
151
|
+
await P.addComment(e, t ?? void 0), L.value = "";
|
|
152
|
+
}
|
|
153
|
+
async function kt(e) {
|
|
154
|
+
let t = z.value.trim();
|
|
155
|
+
if (!t) return;
|
|
156
|
+
let n = P.comments.value.find((t) => t.id === e);
|
|
157
|
+
await P.addComment(t, n?.block_id ?? void 0, e), R.value = null, z.value = "";
|
|
158
|
+
}
|
|
159
|
+
async function Q(e) {
|
|
160
|
+
let t = V.value.trim();
|
|
161
|
+
t && (await P.editComment(e, t), B.value = null, V.value = "");
|
|
162
|
+
}
|
|
163
|
+
async function At(e) {
|
|
164
|
+
await P.removeComment(e), U.value = null;
|
|
165
|
+
}
|
|
166
|
+
async function jt(e) {
|
|
167
|
+
await P.toggleResolve(e);
|
|
168
|
+
}
|
|
169
|
+
function $(e) {
|
|
170
|
+
return e.author_identifier === xt.value;
|
|
171
|
+
}
|
|
172
|
+
function Mt(e) {
|
|
173
|
+
return le(e, M.snapshotHistory) ?? e;
|
|
174
|
+
}
|
|
175
|
+
function Nt(e) {
|
|
176
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Z());
|
|
177
|
+
}
|
|
178
|
+
function Pt(e, t) {
|
|
179
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), kt(t));
|
|
180
|
+
}
|
|
181
|
+
function Ft(e, t) {
|
|
182
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q(t)), e.key === "Escape" && J();
|
|
183
|
+
}
|
|
184
|
+
function It() {
|
|
185
|
+
n(() => {
|
|
186
|
+
W.value?.focus();
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return x({
|
|
190
|
+
filterByBlock: Tt,
|
|
191
|
+
focusNewComment: It
|
|
192
|
+
}), (n, r) => (e(), m(_, {
|
|
193
|
+
"enter-active-class": "tpl-comments-slide-enter-active",
|
|
194
|
+
"enter-from-class": "tpl:translate-x-full",
|
|
195
|
+
"enter-to-class": "tpl:translate-x-0",
|
|
196
|
+
"leave-active-class": "tpl-comments-slide-leave-active",
|
|
197
|
+
"leave-from-class": "tpl:translate-x-0",
|
|
198
|
+
"leave-to-class": "tpl:translate-x-full"
|
|
199
|
+
}, {
|
|
200
|
+
default: y(() => [c.visible ? (e(), d("div", pe, [
|
|
201
|
+
u("div", me, [u("div", he, [
|
|
202
|
+
v(h(C), {
|
|
203
|
+
size: 13,
|
|
204
|
+
"stroke-width": 2
|
|
205
|
+
}),
|
|
206
|
+
u("span", null, g(h(M).comments.title), 1),
|
|
207
|
+
h(P).unresolvedCount.value > 0 ? (e(), d("span", ge, g(h(P).unresolvedCount.value), 1)) : p("", !0)
|
|
208
|
+
]), u("button", {
|
|
209
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
210
|
+
onClick: r[0] ||= (e) => A("close")
|
|
211
|
+
}, [v(h(E), {
|
|
212
|
+
size: 14,
|
|
213
|
+
"stroke-width": 2
|
|
214
|
+
})])]),
|
|
215
|
+
u("div", _e, [
|
|
216
|
+
u("button", {
|
|
217
|
+
class: s(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", F.value === "unresolved" ? "tpl-comment-filter--active" : ""]),
|
|
218
|
+
onClick: r[1] ||= (e) => K("unresolved")
|
|
219
|
+
}, g(h(M).comments.filterUnresolved), 3),
|
|
220
|
+
u("button", {
|
|
221
|
+
class: s(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", F.value === "all" ? "tpl-comment-filter--active" : ""]),
|
|
222
|
+
onClick: r[2] ||= (e) => K("all")
|
|
223
|
+
}, g(h(M).comments.filterAll), 3),
|
|
224
|
+
h(N).state.selectedBlockId ? (e(), d("button", {
|
|
225
|
+
key: 0,
|
|
226
|
+
class: s(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", F.value === "block" ? "tpl-comment-filter--active" : ""]),
|
|
227
|
+
onClick: r[3] ||= (e) => K("block", h(N).state.selectedBlockId ?? void 0)
|
|
228
|
+
}, g(h(M).comments.filterBlock), 3)) : p("", !0)
|
|
229
|
+
]),
|
|
230
|
+
u("div", ve, [h(P).isLoading.value ? (e(), d("div", ye, [v(h(S), {
|
|
231
|
+
class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
|
|
232
|
+
size: 24,
|
|
233
|
+
"stroke-width": 2
|
|
234
|
+
})])) : G.value.length === 0 ? (e(), d("div", be, [v(h(C), {
|
|
235
|
+
size: 32,
|
|
236
|
+
"stroke-width": 1.5,
|
|
237
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
238
|
+
}), u("p", xe, g(F.value === "all" ? h(M).comments.noCommentsHint : h(M).comments.noComments), 1)])) : (e(), d("div", Se, [(e(!0), d(f, null, i(G.value, (n) => (e(), d("div", {
|
|
239
|
+
key: n.id,
|
|
240
|
+
class: "tpl-comment-thread"
|
|
241
|
+
}, [
|
|
242
|
+
u("div", Ce, [
|
|
243
|
+
u("div", we, [u("div", Te, [
|
|
244
|
+
u("span", Ee, g($(n) ? h(M).comments.ownedByYou : n.author_name), 1),
|
|
245
|
+
u("span", De, g(Mt(n.created_at)), 1),
|
|
246
|
+
n.updated_at === n.created_at ? p("", !0) : (e(), d("span", Oe, " (" + g(h(M).comments.edited) + ") ", 1))
|
|
247
|
+
]), u("div", ke, [
|
|
248
|
+
u("button", {
|
|
249
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
250
|
+
title: n.resolved_at ? h(M).comments.unresolve : h(M).comments.resolve,
|
|
251
|
+
onClick: (e) => jt(n.id)
|
|
252
|
+
}, [v(h(de), {
|
|
253
|
+
size: 13,
|
|
254
|
+
"stroke-width": 2,
|
|
255
|
+
class: "tpl-resolve-icon",
|
|
256
|
+
style: te({ color: n.resolved_at ? "var(--tpl-primary)" : void 0 })
|
|
257
|
+
}, null, 8, ["style"])], 8, Ae),
|
|
258
|
+
$(n) ? (e(), d("button", {
|
|
259
|
+
key: 0,
|
|
260
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
261
|
+
title: h(M).comments.edit,
|
|
262
|
+
onClick: (e) => q(n)
|
|
263
|
+
}, [v(h(O), {
|
|
264
|
+
size: 12,
|
|
265
|
+
"stroke-width": 2
|
|
266
|
+
})], 8, je)) : p("", !0),
|
|
267
|
+
$(n) ? (e(), d("button", {
|
|
268
|
+
key: 1,
|
|
269
|
+
class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
270
|
+
title: h(M).comments.delete,
|
|
271
|
+
onClick: (e) => Y(n.id)
|
|
272
|
+
}, [v(h(T), {
|
|
273
|
+
size: 12,
|
|
274
|
+
"stroke-width": 2
|
|
275
|
+
})], 8, Me)) : p("", !0)
|
|
276
|
+
])]),
|
|
277
|
+
v(_, { name: "tpl-resolve" }, {
|
|
278
|
+
default: y(() => [n.resolved_at ? (e(), d("div", Ne, [v(h(oe), {
|
|
279
|
+
size: 10,
|
|
280
|
+
"stroke-width": 2.5
|
|
281
|
+
}), u("span", null, g(h(j)(h(M).comments.resolvedBy, { name: n.resolved_by_name ?? "" })), 1)])) : p("", !0)]),
|
|
282
|
+
_: 2
|
|
283
|
+
}, 1024),
|
|
284
|
+
n.block_id && Ct(n.block_id) ? (e(), d("span", Pe, g(h(M).comments.missingBlock), 1)) : n.block_id ? (e(), d("button", {
|
|
285
|
+
key: 1,
|
|
286
|
+
class: "tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]",
|
|
287
|
+
onClick: (e) => h(N).selectBlock(n.block_id ?? "")
|
|
288
|
+
}, " Block ", 8, Fe)) : p("", !0),
|
|
289
|
+
B.value === n.id ? (e(), d("div", Ie, [t(u("textarea", {
|
|
290
|
+
"onUpdate:modelValue": r[4] ||= (e) => V.value = e,
|
|
291
|
+
class: "tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
292
|
+
rows: "3",
|
|
293
|
+
onKeydown: (e) => Ft(e, n.id)
|
|
294
|
+
}, null, 40, Le), [[o, V.value]]), u("div", Re, [u("button", {
|
|
295
|
+
class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
296
|
+
disabled: !V.value.trim() || h(P).isSubmitting.value,
|
|
297
|
+
onClick: (e) => Q(n.id)
|
|
298
|
+
}, g(h(M).comments.save), 9, ze), u("button", {
|
|
299
|
+
class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
300
|
+
onClick: r[5] ||= (e) => J()
|
|
301
|
+
}, g(h(M).comments.cancel), 1)])])) : (e(), d("p", Be, g(n.body), 1)),
|
|
302
|
+
U.value === n.id ? (e(), d("div", Ve, [
|
|
303
|
+
u("span", He, g(h(M).comments.deleteConfirm), 1),
|
|
304
|
+
u("button", {
|
|
305
|
+
class: "tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-danger)] tpl:text-[var(--tpl-bg)]",
|
|
306
|
+
onClick: (e) => At(n.id)
|
|
307
|
+
}, g(h(M).comments.delete), 9, Ue),
|
|
308
|
+
u("button", {
|
|
309
|
+
class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
310
|
+
onClick: r[6] ||= (e) => X()
|
|
311
|
+
}, g(h(M).comments.cancel), 1)
|
|
312
|
+
])) : p("", !0),
|
|
313
|
+
B.value !== n.id && U.value !== n.id ? (e(), d("div", We, [u("button", {
|
|
314
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
315
|
+
title: h(M).comments.reply,
|
|
316
|
+
onClick: (e) => Dt(n.id)
|
|
317
|
+
}, [v(h(fe), {
|
|
318
|
+
size: 13,
|
|
319
|
+
"stroke-width": 2,
|
|
320
|
+
class: "tpl:text-[var(--tpl-primary)]"
|
|
321
|
+
})], 8, Ge), (n.replies?.length ?? 0) > 0 ? (e(), d("button", {
|
|
322
|
+
key: 0,
|
|
323
|
+
class: "tpl:flex tpl:items-center tpl:gap-0.5 tpl:text-[11px] tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
324
|
+
onClick: (e) => Et(n.id)
|
|
325
|
+
}, [H.value.has(n.id) ? (e(), m(h(ue), {
|
|
326
|
+
key: 0,
|
|
327
|
+
size: 11,
|
|
328
|
+
"stroke-width": 2
|
|
329
|
+
})) : (e(), m(h(se), {
|
|
330
|
+
key: 1,
|
|
331
|
+
size: 11,
|
|
332
|
+
"stroke-width": 2
|
|
333
|
+
})), ee(" " + g((n.replies?.length ?? 0) === 1 ? h(j)(h(M).comments.replyOne, { count: String(n.replies?.length ?? 0) }) : h(j)(h(M).comments.replyMany, { count: String(n.replies?.length ?? 0) })), 1)], 8, Ke)) : p("", !0)])) : p("", !0)
|
|
334
|
+
]),
|
|
335
|
+
v(_, { name: "tpl-replies" }, {
|
|
336
|
+
default: y(() => [H.value.has(n.id) && (n.replies?.length ?? 0) > 0 ? (e(), d("div", qe, [(e(!0), d(f, null, i(n.replies, (i, a) => (e(), d("div", {
|
|
337
|
+
key: i.id,
|
|
338
|
+
class: s(["tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5", a < (n.replies?.length ?? 0) - 1 ? "tpl:mb-2" : ""])
|
|
339
|
+
}, [
|
|
340
|
+
u("div", Je, [u("div", Ye, [
|
|
341
|
+
u("span", Xe, g($(i) ? h(M).comments.ownedByYou : i.author_name), 1),
|
|
342
|
+
u("span", Ze, g(Mt(i.created_at)), 1),
|
|
343
|
+
i.updated_at === i.created_at ? p("", !0) : (e(), d("span", Qe, " (" + g(h(M).comments.edited) + ") ", 1))
|
|
344
|
+
]), u("div", $e, [$(i) ? (e(), d("button", {
|
|
345
|
+
key: 0,
|
|
346
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
347
|
+
title: h(M).comments.edit,
|
|
348
|
+
onClick: (e) => q(i)
|
|
349
|
+
}, [v(h(O), {
|
|
350
|
+
size: 11,
|
|
351
|
+
"stroke-width": 2
|
|
352
|
+
})], 8, et)) : p("", !0), $(i) ? (e(), d("button", {
|
|
353
|
+
key: 1,
|
|
354
|
+
class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
355
|
+
title: h(M).comments.delete,
|
|
356
|
+
onClick: (e) => Y(i.id)
|
|
357
|
+
}, [v(h(T), {
|
|
358
|
+
size: 11,
|
|
359
|
+
"stroke-width": 2
|
|
360
|
+
})], 8, tt)) : p("", !0)])]),
|
|
361
|
+
B.value === i.id ? (e(), d("div", nt, [t(u("textarea", {
|
|
362
|
+
"onUpdate:modelValue": r[7] ||= (e) => V.value = e,
|
|
363
|
+
class: "tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
364
|
+
rows: "2",
|
|
365
|
+
onKeydown: (e) => Ft(e, i.id)
|
|
366
|
+
}, null, 40, rt), [[o, V.value]]), u("div", it, [u("button", {
|
|
367
|
+
class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
368
|
+
disabled: !V.value.trim() || h(P).isSubmitting.value,
|
|
369
|
+
onClick: (e) => Q(i.id)
|
|
370
|
+
}, g(h(M).comments.save), 9, at), u("button", {
|
|
371
|
+
class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
372
|
+
onClick: r[8] ||= (e) => J()
|
|
373
|
+
}, g(h(M).comments.cancel), 1)])])) : (e(), d("p", ot, g(i.body), 1)),
|
|
374
|
+
U.value === i.id ? (e(), d("div", st, [
|
|
375
|
+
u("span", ct, g(h(M).comments.deleteConfirm), 1),
|
|
376
|
+
u("button", {
|
|
377
|
+
class: "tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-danger)] tpl:text-[var(--tpl-bg)]",
|
|
378
|
+
onClick: (e) => At(i.id)
|
|
379
|
+
}, g(h(M).comments.delete), 9, lt),
|
|
380
|
+
u("button", {
|
|
381
|
+
class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
382
|
+
onClick: r[9] ||= (e) => X()
|
|
383
|
+
}, g(h(M).comments.cancel), 1)
|
|
384
|
+
])) : p("", !0)
|
|
385
|
+
], 2))), 128))])) : p("", !0)]),
|
|
386
|
+
_: 2
|
|
387
|
+
}, 1024),
|
|
388
|
+
v(_, { name: "tpl-replies" }, {
|
|
389
|
+
default: y(() => [R.value === n.id ? (e(), d("div", ut, [u("div", dt, [t(u("textarea", {
|
|
390
|
+
"onUpdate:modelValue": r[10] ||= (e) => z.value = e,
|
|
391
|
+
class: "tpl:flex-1 tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
392
|
+
placeholder: h(M).comments.replyPlaceholder,
|
|
393
|
+
rows: "2",
|
|
394
|
+
onKeydown: (e) => Pt(e, n.id)
|
|
395
|
+
}, null, 40, ft), [[o, z.value]]), u("div", pt, [u("button", {
|
|
396
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150 tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]",
|
|
397
|
+
disabled: !z.value.trim() || h(P).isSubmitting.value,
|
|
398
|
+
onClick: (e) => kt(n.id)
|
|
399
|
+
}, [v(h(w), {
|
|
400
|
+
size: 14,
|
|
401
|
+
"stroke-width": 2
|
|
402
|
+
})], 8, mt), u("button", {
|
|
403
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
404
|
+
onClick: r[11] ||= (e) => Ot()
|
|
405
|
+
}, [v(h(E), {
|
|
406
|
+
size: 14,
|
|
407
|
+
"stroke-width": 2
|
|
408
|
+
})])])])])) : p("", !0)]),
|
|
409
|
+
_: 2
|
|
410
|
+
}, 1024)
|
|
411
|
+
]))), 128))]))]),
|
|
412
|
+
u("div", ht, [wt.value ? (e(), d("div", gt, g(h(M).comments.saveTemplateFirst), 1)) : (e(), d("div", _t, [t(u("textarea", {
|
|
413
|
+
ref_key: "newCommentInput",
|
|
414
|
+
ref: W,
|
|
415
|
+
"onUpdate:modelValue": r[12] ||= (e) => L.value = e,
|
|
416
|
+
class: "tpl:max-h-24 tpl:min-h-[48px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-xs tpl:outline-none tpl:text-[var(--tpl-text)]",
|
|
417
|
+
placeholder: h(M).comments.placeholder,
|
|
418
|
+
disabled: h(P).isSubmitting.value,
|
|
419
|
+
rows: "2",
|
|
420
|
+
onKeydown: Nt
|
|
421
|
+
}, null, 40, vt), [[o, L.value]]), u("button", {
|
|
422
|
+
class: "tpl-comments-send-btn tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:duration-150 tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]",
|
|
423
|
+
disabled: !L.value.trim() || h(P).isSubmitting.value,
|
|
424
|
+
onClick: Z
|
|
425
|
+
}, [h(P).isSubmitting.value ? (e(), m(h(S), {
|
|
426
|
+
key: 0,
|
|
427
|
+
class: "tpl-spinner",
|
|
428
|
+
size: 16,
|
|
429
|
+
"stroke-width": 2
|
|
430
|
+
})) : (e(), m(h(w), {
|
|
431
|
+
key: 1,
|
|
432
|
+
size: 16,
|
|
433
|
+
"stroke-width": 2
|
|
434
|
+
}))], 8, yt)]))])
|
|
435
|
+
])) : p("", !0)]),
|
|
436
|
+
_: 1
|
|
437
|
+
}));
|
|
438
|
+
}
|
|
439
|
+
}), [["__scopeId", "data-v-d204f573"]]);
|
|
440
|
+
//#endregion
|
|
441
|
+
export { k as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
2
|
+
import { A as t, M as n, X as r, b as i, d as a, f as o, h as s, l as c, m as l, ot as u, rt as d, st as f } from "./vue.runtime.esm-bundler-Bxqkjqhc.js";
|
|
3
|
+
import { o as p } from "./dist-BzRLLpfq.js";
|
|
4
|
+
import { t as m } from "./useI18n-CgmQftNf.js";
|
|
4
5
|
//#region src/components/blocks/CountdownBlock.vue?vue&type=script&setup=true&lang.ts
|
|
5
6
|
var h = {
|
|
6
7
|
key: 0,
|
|
@@ -15,15 +16,15 @@ var h = {
|
|
|
15
16
|
viewport: {}
|
|
16
17
|
},
|
|
17
18
|
setup(e) {
|
|
18
|
-
let i = e, { t: v } =
|
|
19
|
-
|
|
19
|
+
let i = e, { t: v } = m(), y = r(Date.now());
|
|
20
|
+
p(() => {
|
|
20
21
|
y.value = Date.now();
|
|
21
22
|
}, 1e3);
|
|
22
|
-
let b =
|
|
23
|
+
let b = a(() => {
|
|
23
24
|
if (!i.block.targetDate) return null;
|
|
24
25
|
let e = new Date(i.block.targetDate);
|
|
25
26
|
return isNaN(e.getTime()) ? null : e.getTime();
|
|
26
|
-
}), x =
|
|
27
|
+
}), x = a(() => b.value ? y.value >= b.value : !1), S = a(() => {
|
|
27
28
|
if (!b.value || x.value) return {
|
|
28
29
|
days: 0,
|
|
29
30
|
hours: 0,
|
|
@@ -37,7 +38,7 @@ var h = {
|
|
|
37
38
|
minutes: Math.floor(t % 3600 / 60),
|
|
38
39
|
seconds: t % 60
|
|
39
40
|
};
|
|
40
|
-
}), C =
|
|
41
|
+
}), C = a(() => {
|
|
41
42
|
let e = [];
|
|
42
43
|
return i.block.showDays && e.push({
|
|
43
44
|
value: String(S.value.days).padStart(2, "0"),
|
|
@@ -52,42 +53,40 @@ var h = {
|
|
|
52
53
|
value: String(S.value.seconds).padStart(2, "0"),
|
|
53
54
|
label: i.block.labelSeconds
|
|
54
55
|
}), e;
|
|
55
|
-
}), w =
|
|
56
|
+
}), w = a(() => ({
|
|
56
57
|
backgroundColor: i.block.backgroundColor,
|
|
57
58
|
fontFamily: i.block.fontFamily || "inherit"
|
|
58
|
-
})), T =
|
|
59
|
+
})), T = a(() => ({
|
|
59
60
|
fontSize: `${i.block.digitFontSize}px`,
|
|
60
61
|
fontWeight: "bold",
|
|
61
62
|
color: i.block.digitColor,
|
|
62
63
|
lineHeight: "1.2"
|
|
63
|
-
})), E =
|
|
64
|
+
})), E = a(() => ({
|
|
64
65
|
fontSize: `${i.block.labelFontSize}px`,
|
|
65
66
|
color: i.block.labelColor,
|
|
66
67
|
marginTop: "4px"
|
|
67
|
-
})), D =
|
|
68
|
+
})), D = a(() => ({
|
|
68
69
|
fontSize: `${i.block.digitFontSize}px`,
|
|
69
70
|
color: i.block.digitColor,
|
|
70
71
|
fontFamily: i.block.fontFamily || "inherit"
|
|
71
72
|
}));
|
|
72
|
-
return (
|
|
73
|
+
return (r, i) => e.block.targetDate ? x.value && e.block.hideOnExpiry ? (t(), s("div", g, f(d(v).countdown.hidden), 1)) : x.value ? (t(), s("div", {
|
|
73
74
|
key: 2,
|
|
74
|
-
style:
|
|
75
|
+
style: u(w.value),
|
|
75
76
|
class: "tpl:py-4 tpl:text-center"
|
|
76
|
-
}, [
|
|
77
|
+
}, [o("span", { style: u({
|
|
77
78
|
fontSize: `${e.block.digitFontSize}px`,
|
|
78
79
|
color: e.block.digitColor
|
|
79
|
-
}) },
|
|
80
|
+
}) }, f(e.block.expiredMessage), 5)], 4)) : (t(), s("div", {
|
|
80
81
|
key: 3,
|
|
81
|
-
style:
|
|
82
|
+
style: u(w.value),
|
|
82
83
|
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:py-4"
|
|
83
|
-
}, [(
|
|
84
|
+
}, [(t(!0), s(c, null, n(C.value, (n, r) => (t(), s(c, { key: n.label }, [r > 0 ? (t(), s("span", {
|
|
84
85
|
key: 0,
|
|
85
|
-
style:
|
|
86
|
+
style: u(D.value),
|
|
86
87
|
class: "tpl:self-start"
|
|
87
|
-
},
|
|
88
|
+
}, f(e.block.separator), 5)) : l("", !0), o("div", _, [o("div", { style: u(T.value) }, f(n.value), 5), o("div", { style: u(E.value) }, f(n.label), 5)])], 64))), 128))], 4)) : (t(), s("div", h, f(d(v).countdown.setDate), 1));
|
|
88
89
|
}
|
|
89
90
|
}), y = /* @__PURE__ */ e({ default: () => b }), b = v;
|
|
90
91
|
//#endregion
|
|
91
92
|
export { y as n, b as t };
|
|
92
|
-
|
|
93
|
-
//# sourceMappingURL=CountdownBlock-5YdT1uUu.js.map
|