@templatical/editor 0.0.6 → 0.1.1
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/LICENSE +56 -0
- package/README.md +69 -0
- package/dist/{AiChatSidebar-CNhSl_ty.js → AiChatSidebar-DgAjDWO1.js} +68 -68
- package/dist/{AiFeatureMenu-BFVsjUJY.js → AiFeatureMenu-j6oaiRVi.js} +25 -25
- package/dist/{CloudEditor-Bz5Xkxej.js → CloudEditor-yCOkIkZ-.js} +428 -437
- package/dist/{CollaboratorBar-D2Gu5Xj2.js → CollaboratorBar-CWVdp2Y6.js} +23 -23
- package/dist/CommentsSidebar-CSPHhbQH.js +439 -0
- package/dist/CountdownBlock-DK6P_RaQ.js +92 -0
- package/dist/CountdownToolbar-Dv-Sz4ui.js +210 -0
- package/dist/{DesignReferenceSidebar-u2tKSQK0.js → DesignReferenceSidebar-D7zfvux6.js} +58 -58
- package/dist/LoadingTrack-Cdz2SSq9.js +10 -0
- package/dist/ModuleBrowserModal-BLYuCZht.js +205 -0
- package/dist/ModulePreviewCanvas-CHYqP6K3.js +106 -0
- package/dist/NumberWithSuffix-D-5-AZc3.js +424 -0
- package/dist/{ParagraphEditor-CYrzYJO5.js → ParagraphEditor-DivLBNWv.js} +237 -236
- package/dist/{RichTextEditorContent-BeqlWlWB.js → RichTextEditorContent-G1lXgVJR.js} +42 -42
- package/dist/{SaveModuleDialog-Kde6X13X.js → SaveModuleDialog-DGVfiOmE.js} +29 -29
- package/dist/{SnapshotHistory-B3EfIcLW.js → SnapshotHistory-DM__MqSu.js} +38 -38
- package/dist/{TemplateScoringPanel-D2vCRGgx.js → TemplateScoringPanel-CW13Tlol.js} +80 -80
- package/dist/{TestEmailModal-Egk0DFDf.js → TestEmailModal-B8bYqWCY.js} +28 -28
- package/dist/TitleEditor-4Jrp3C4m.js +167 -0
- package/dist/{TplModal-BCruYWks.js → TplModal-BkoIz0oz.js} +14 -14
- package/dist/{_plugin-vue_export-helper-5TQrnOhO.js → _plugin-vue_export-helper-OO6pH1Dh.js} +11 -11
- package/dist/{blockTypeIcons-rW4BUUNC.js → blockTypeIcons-4AS3CvXn.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-Dcbshcfu.js → AiFeatureMenu-BcHyzTQy.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-Dcbshcfu.js.map → AiFeatureMenu-BcHyzTQy.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Bca3RyBW.js → CloudEditor-TaEZq-YW.js} +179 -188
- package/dist/cdn/chunks/CloudEditor-TaEZq-YW.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-sToKJfHi.js → CollaboratorBar-DbC5-3If.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-sToKJfHi.js.map → CollaboratorBar-DbC5-3If.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-CfPmCQ7j.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-CfPmCQ7j.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-CB0EVxwN.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-CB0EVxwN.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-BNhwXbWw.js → ModuleBrowserModal-Df2fp9dj.js} +7 -7
- package/dist/cdn/chunks/{ModuleBrowserModal-BNhwXbWw.js.map → ModuleBrowserModal-Df2fp9dj.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DylUylPU.js → ModulePreviewCanvas-Dw1OCpvV.js} +19 -19
- package/dist/cdn/chunks/{ModulePreviewCanvas-DylUylPU.js.map → ModulePreviewCanvas-Dw1OCpvV.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-BU6ycXyG.js +425 -0
- package/dist/cdn/chunks/NumberWithSuffix-BU6ycXyG.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-BBw90y_p.js → ParagraphEditor-BMRNg_BX.js} +37 -37
- package/dist/cdn/chunks/{ParagraphEditor-BBw90y_p.js.map → ParagraphEditor-BMRNg_BX.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DvyIO3nR.js → RichTextEditorContent-BKYY1YMZ.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-DvyIO3nR.js.map → RichTextEditorContent-BKYY1YMZ.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DvbSHvhF.js → SaveModuleDialog-D977Tg7t.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-DvbSHvhF.js.map → SaveModuleDialog-D977Tg7t.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-tS3mgoVr.js → TitleEditor-q9IzNy38.js} +11 -11
- package/dist/cdn/chunks/{TitleEditor-tS3mgoVr.js.map → TitleEditor-q9IzNy38.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-DbnbyEQE.js → blockTypeIcons-L0fRc3qs.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-DbnbyEQE.js.map → blockTypeIcons-L0fRc3qs.js.map} +1 -1
- package/dist/cdn/chunks/{de-CgUR_S5I.js → de-3exf7MYE.js} +1 -1
- package/dist/cdn/chunks/{de-CgUR_S5I.js.map → de-3exf7MYE.js.map} +1 -1
- package/dist/cdn/chunks/{de-D8oDPhBD.js → de-C8LxVUsb.js} +1 -1
- package/dist/cdn/chunks/{de-D8oDPhBD.js.map → de-C8LxVUsb.js.map} +1 -1
- package/dist/cdn/chunks/{dist-BUmN5e4r.js → dist-D5g00M8N.js} +6 -2
- package/dist/cdn/chunks/dist-D5g00M8N.js.map +1 -0
- package/dist/cdn/chunks/{draggable-m78lz0gI.js → draggable-Bcb86AsV.js} +5 -5
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/{emojiData-CNNgvDqx.js → emojiData-DUHzsh4j.js} +1 -1
- package/dist/cdn/chunks/{emojiData-CNNgvDqx.js.map → emojiData-DUHzsh4j.js.map} +1 -1
- package/dist/cdn/chunks/{en-HseRPPeK.js → en-BoEycuqw.js} +1 -1
- package/dist/cdn/chunks/{en-HseRPPeK.js.map → en-BoEycuqw.js.map} +1 -1
- package/dist/cdn/chunks/{en-BBmfBDqY.js → en-KNPUKxYp.js} +1 -1
- package/dist/cdn/chunks/{en-BBmfBDqY.js.map → en-KNPUKxYp.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-ClpY3m0W.js → extensions-BZ1POyiv.js} +11 -11
- package/dist/cdn/chunks/{extensions-ClpY3m0W.js.map → extensions-BZ1POyiv.js.map} +1 -1
- package/dist/cdn/chunks/{features-B5dGxWLi.js → features-Ccqmm6-M.js} +549 -627
- package/dist/cdn/chunks/features-Ccqmm6-M.js.map +1 -0
- package/dist/cdn/chunks/{icons-hflTyPmb.js → icons-x53__2GC.js} +8 -8
- package/dist/cdn/chunks/icons-x53__2GC.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-BxyRVCKv.js → liquid.browser-CEMn-ZqL.js} +2 -2
- package/dist/cdn/chunks/liquid.browser-CEMn-ZqL.js.map +1 -0
- package/dist/cdn/chunks/{media-library-Dgy-V-JA.js → media-library-DUoQk-w7.js} +97 -97
- package/dist/cdn/chunks/media-library-DUoQk-w7.js.map +1 -0
- package/dist/cdn/chunks/{pusher-D-m2WSdL.js → pusher-DwSQn6BA.js} +2 -2
- package/dist/cdn/chunks/pusher-DwSQn6BA.js.map +1 -0
- package/dist/cdn/chunks/{src-TDwMmqm0.js → src-DskCIAr8.js} +8 -8
- package/dist/cdn/chunks/{src-TDwMmqm0.js.map → src-DskCIAr8.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js → styleConstants-DP1VOca8.js} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js.map → styleConstants-DP1VOca8.js.map} +1 -1
- package/dist/cdn/chunks/{styles-hCOCOR6K.js → styles-BIlpNe52.js} +622 -1238
- package/dist/cdn/chunks/styles-BIlpNe52.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C28NLMX8.js → tiptap-hPC_BgDO.js} +850 -826
- package/dist/cdn/chunks/tiptap-hPC_BgDO.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +92 -97
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B5S-C0bz.js → check-Bff5NzCh.js} +1 -1
- package/dist/{chevron-down-CjsV1T0W.js → chevron-down-Bbv4SJwx.js} +1 -1
- package/dist/{circle-alert-CVTmJHKW.js → circle-alert-Dpr8MgkR.js} +1 -1
- package/dist/{clock-CAjdSHBy.js → clock-raVPKfl4.js} +1 -1
- package/dist/{dist-DJrDTuRr.js → dist-BHgEdO-M.js} +1001 -983
- package/dist/dist-BibwE8Y0.js +5 -0
- package/dist/{dist-DPM-DFvh.js → dist-BnlZ_HwX.js} +340 -340
- package/dist/{dist-BTtKPcd2.js → dist-C9yhcxsf.js} +2 -2
- package/dist/{dist-COguaIvm.js → dist-CGffNO8z.js} +2 -2
- package/dist/dist-CfGpCUSx.js +5 -0
- package/dist/{dist-COOFiBFV.js → dist-Chd-H2S3.js} +5 -5
- package/dist/{dist-DfqLGwSF.js → dist-Cq0OFLMj.js} +2 -2
- package/dist/{dist-B4LTlrAn.js → dist-D42og5Sc.js} +191 -185
- package/dist/{dist-CBr-qhie.js → dist-Owxo48fF.js} +2 -2
- package/dist/{dist-Crqkuf-w.js → dist-UZ8UzVZ-.js} +15 -15
- package/dist/dist-n0PkFNGl.js +314 -0
- package/dist/{dist-DHYuVJ_7.js → dist-skgH9dyo.js} +2 -2
- package/dist/{extensions-C6xp_B7K.js → extensions-DQKaICBH.js} +81 -81
- package/dist/{image-up-vZa1Txr-.js → image-up-B1AEiHCh.js} +1 -1
- package/dist/index.d.ts +17 -6
- package/dist/{keys-C0MQRs8d.js → keys-CIw9mUI2.js} +1 -1
- package/dist/{liquid.browser-C02owkex.js → liquid.browser-Bm53dnK1.js} +1 -1
- package/dist/{loader-circle-DilFjHSk.js → loader-circle-BYeKJ3to.js} +1 -1
- package/dist/{message-circle-Dpcnc2oa.js → message-circle-PhNlI7e7.js} +1 -1
- package/dist/{refresh-cw-4r7rkHHX.js → refresh-cw-DhDYRBDd.js} +1 -1
- package/dist/{rolldown-runtime-gEudmnaM.js → rolldown-runtime-BZGGJVDF.js} +2 -5
- package/dist/{scan-line-684IxPQ0.js → scan-line-Bw8bauvt.js} +1 -1
- package/dist/{send-ChDw64yL.js → send-CJPSzbLO.js} +1 -1
- package/dist/{shield-check-9dhLdyST.js → shield-check-DdEvVYMH.js} +1 -1
- package/dist/{sparkles-Co9fkDcv.js → sparkles-DT_27AYs.js} +1 -1
- package/dist/style.css +2 -0
- package/dist/{styleConstants-RV3eYwkD.js → styleConstants-Dqz9z3aa.js} +6 -45
- package/dist/styles-tcwlvlEB.js +2942 -0
- package/dist/templatical-editor.js +114 -119
- package/dist/text-align-start-4Hx15GUf.js +43 -0
- package/dist/{trash-2-CZkMtjeC.js → trash-2-BY-xp5hg.js} +1 -1
- package/dist/{triangle-alert-Dvt51agD.js → triangle-alert-DG72vdb2.js} +1 -1
- package/dist/useEditorCore-DMH2QpUL.js +8946 -0
- package/dist/{useI18n-D6m7ZUgY.js → useI18n-B8CN2iWs.js} +4 -4
- package/dist/{useMergeTag-CSXcnFBc.js → useMergeTag-Dz_Dx2Jz.js} +3 -3
- package/dist/vue.runtime.esm-bundler-DryoQb-v.js +5775 -0
- package/dist/{x-CU2XZOkQ.js → x-D-7GkO6Z.js} +1 -1
- package/package.json +31 -15
- package/dist/CommentsSidebar-CTeEAZTj.js +0 -439
- package/dist/LoadingTrack--aUassFH.js +0 -10
- package/dist/ModuleBrowserModal-DNxODPlX.js +0 -205
- package/dist/ModulePreviewCanvas-DnGe1Y-2.js +0 -106
- package/dist/TitleEditor-DwUpo4gF.js +0 -167
- package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js.map +0 -1
- package/dist/cdn/chunks/dist-BUmN5e4r.js.map +0 -1
- package/dist/cdn/chunks/draggable-m78lz0gI.js.map +0 -1
- package/dist/cdn/chunks/features-B5dGxWLi.js.map +0 -1
- package/dist/cdn/chunks/icons-hflTyPmb.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-BxyRVCKv.js.map +0 -1
- package/dist/cdn/chunks/media-library-Dgy-V-JA.js.map +0 -1
- package/dist/cdn/chunks/pusher-D-m2WSdL.js.map +0 -1
- package/dist/cdn/chunks/styles-hCOCOR6K.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C28NLMX8.js.map +0 -1
- package/dist/dist-Ac4o1O4a.js +0 -314
- package/dist/dist-DEJZ9iAU.js +0 -5
- package/dist/dist-DmVOCJjI.js +0 -5
- package/dist/styles-nvxFh6L6.js +0 -3557
- package/dist/templatical-editor.css +0 -2
- package/dist/templatical-editor.umd.cjs +0 -178
- package/dist/useEditorCore-ColJh1ST.js +0 -5695
- /package/dist/cdn/chunks/{_rolldown_dynamic_import_helper-DMEI4TQ3.js → _rolldown_dynamic_import_helper-BRcA6nWq.js} +0 -0
- /package/dist/{de-Dh8ON-dm.js → de-CN0xu_Tp.js} +0 -0
- /package/dist/{emojiData-Qc8mH_zW.js → emojiData-CwKEDxVf.js} +0 -0
- /package/dist/{en-C7IShRSD.js → en-DXvHkaUF.js} +0 -0
- /package/dist/{formatRelativeTime-D8f6NR7i.js → formatRelativeTime-BSpx5DHC.js} +0 -0
- /package/dist/{readableTextColor-B809bF5J.js → readableTextColor-CYCxm1jQ.js} +0 -0
- /package/dist/{timeouts-CmBrLeZA.js → timeouts-BSGxjuUF.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
var h =
|
|
1
|
+
import { M as e, Ot as t, P as n, S as r, _ as i, d as a, g as o, h as s, m as c, p as l, tt as u, wt as d } from "./vue.runtime.esm-bundler-DryoQb-v.js";
|
|
2
|
+
import { t as f } from "./useI18n-B8CN2iWs.js";
|
|
3
|
+
import "./useEditorCore-DMH2QpUL.js";
|
|
4
|
+
import { n as p } from "./_plugin-vue_export-helper-OO6pH1Dh.js";
|
|
5
|
+
import { t as m } from "./readableTextColor-CYCxm1jQ.js";
|
|
6
|
+
var h = p("wifi-off", [
|
|
7
7
|
["path", {
|
|
8
8
|
d: "M12 20h.01",
|
|
9
9
|
key: "zekei9"
|
|
@@ -32,7 +32,7 @@ var h = t("wifi-off", [
|
|
|
32
32
|
d: "m2 2 20 20",
|
|
33
33
|
key: "1ooewy"
|
|
34
34
|
}]
|
|
35
|
-
]), g =
|
|
35
|
+
]), g = p("wifi", [
|
|
36
36
|
["path", {
|
|
37
37
|
d: "M12 20h.01",
|
|
38
38
|
key: "zekei9"
|
|
@@ -52,43 +52,43 @@ var h = t("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__ */ r({
|
|
56
56
|
__name: "CollaboratorBar",
|
|
57
57
|
props: {
|
|
58
58
|
collaborators: {},
|
|
59
59
|
isConnected: { type: Boolean }
|
|
60
60
|
},
|
|
61
|
-
setup(
|
|
62
|
-
let
|
|
61
|
+
setup(r) {
|
|
62
|
+
let p = r, { t: C } = f(), w = l(() => p.collaborators.slice(0, S)), T = l(() => p.collaborators.slice(S)), E = l(() => T.value.length), D = l(() => 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 (l, f) => (e(), i("div", _, [c("div", {
|
|
68
68
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",
|
|
69
|
-
style:
|
|
70
|
-
title:
|
|
71
|
-
}, [
|
|
69
|
+
style: d({ color: r.isConnected ? "var(--tpl-success)" : "var(--tpl-text-muted)" }),
|
|
70
|
+
title: r.isConnected ? u(C).collaboration.connected : u(C).collaboration.disconnected
|
|
71
|
+
}, [r.isConnected ? (e(), s(u(g), {
|
|
72
72
|
key: 0,
|
|
73
73
|
size: 12,
|
|
74
74
|
"stroke-width": 2
|
|
75
|
-
})) : (
|
|
75
|
+
})) : (e(), s(u(h), {
|
|
76
76
|
key: 1,
|
|
77
77
|
size: 12,
|
|
78
78
|
"stroke-width": 2
|
|
79
|
-
}))], 12, v),
|
|
80
|
-
key:
|
|
79
|
+
}))], 12, v), r.collaborators.length > 0 ? (e(), i("div", y, [(e(!0), i(a, null, n(w.value, (n) => (e(), i("div", {
|
|
80
|
+
key: n.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: m(n
|
|
82
|
+
style: d({
|
|
83
|
+
backgroundColor: n.color,
|
|
84
|
+
color: u(m)(n.color)
|
|
85
85
|
}),
|
|
86
|
-
title:
|
|
87
|
-
},
|
|
86
|
+
title: n.name
|
|
87
|
+
}, t(O(n.name)), 13, b))), 128)), E.value > 0 ? (e(), i("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
|
+
}, " +" + t(E.value), 9, x)) : o("", !0)])) : o("", !0)]));
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
//#endregion
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import { Ct as e, H as t, M as n, O as r, Ot as i, P as a, S as o, V as s, Y as c, _ as l, b as u, d, g as f, h as p, m, p as h, s as g, t as _, tt as v, wt as ee, y as te, z as y } from "./vue.runtime.esm-bundler-DryoQb-v.js";
|
|
2
|
+
import { T as b, c as ne, f as re, r as ie } from "./keys-CIw9mUI2.js";
|
|
3
|
+
import { t as ae } from "./useI18n-B8CN2iWs.js";
|
|
4
|
+
import { n as x, t as S } from "./_plugin-vue_export-helper-OO6pH1Dh.js";
|
|
5
|
+
import { t as oe } from "./check-Bff5NzCh.js";
|
|
6
|
+
import { t as se } from "./chevron-down-Bbv4SJwx.js";
|
|
7
|
+
import { t as C } from "./loader-circle-BYeKJ3to.js";
|
|
8
|
+
import { t as w } from "./message-circle-PhNlI7e7.js";
|
|
9
|
+
import { t as T } from "./send-CJPSzbLO.js";
|
|
10
|
+
import { t as ce } from "./trash-2-BY-xp5hg.js";
|
|
11
|
+
import { t as le } from "./x-D-7GkO6Z.js";
|
|
12
|
+
import { t as ue } from "./formatRelativeTime-BSpx5DHC.js";
|
|
13
|
+
var de = x("chevron-up", [["path", {
|
|
14
|
+
d: "m18 15-6-6-6 6",
|
|
15
|
+
key: "153udz"
|
|
16
|
+
}]]), fe = x("circle-check", [["circle", {
|
|
17
|
+
cx: "12",
|
|
18
|
+
cy: "12",
|
|
19
|
+
r: "10",
|
|
20
|
+
key: "1mglay"
|
|
21
|
+
}], ["path", {
|
|
22
|
+
d: "m9 12 2 2 4-4",
|
|
23
|
+
key: "dzmm74"
|
|
24
|
+
}]]), E = x("pencil", [["path", {
|
|
25
|
+
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",
|
|
26
|
+
key: "1a8usu"
|
|
27
|
+
}], ["path", {
|
|
28
|
+
d: "m15 5 4 4",
|
|
29
|
+
key: "1mk7zo"
|
|
30
|
+
}]]), pe = x("reply", [["path", {
|
|
31
|
+
d: "M20 18v-2a4 4 0 0 0-4-4H4",
|
|
32
|
+
key: "5vmcpk"
|
|
33
|
+
}], ["path", {
|
|
34
|
+
d: "m9 17-5-5 5-5",
|
|
35
|
+
key: "nvlc11"
|
|
36
|
+
}]]), me = {
|
|
37
|
+
key: 0,
|
|
38
|
+
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)]"
|
|
39
|
+
}, he = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, ge = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]" }, _e = {
|
|
40
|
+
key: 0,
|
|
41
|
+
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)]"
|
|
42
|
+
}, ve = { class: "tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2" }, ye = { class: "tpl:flex-1 tpl:overflow-y-auto" }, be = {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "tpl:flex tpl:h-full tpl:items-center tpl:justify-center"
|
|
45
|
+
}, xe = {
|
|
46
|
+
key: 1,
|
|
47
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:px-6 tpl:text-center"
|
|
48
|
+
}, Se = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Ce = {
|
|
49
|
+
key: 2,
|
|
50
|
+
class: "tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3"
|
|
51
|
+
}, we = { class: "tpl-comment-card tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-3" }, Te = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, Ee = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, De = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Oe = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, ke = {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
|
|
54
|
+
}, Ae = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, je = ["title", "onClick"], Me = ["title", "onClick"], Ne = ["title", "onClick"], Pe = {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:text-[10px] tpl:text-[var(--tpl-primary)]"
|
|
57
|
+
}, Fe = {
|
|
58
|
+
key: 0,
|
|
59
|
+
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)]"
|
|
60
|
+
}, Ie = ["onClick"], Le = {
|
|
61
|
+
key: 2,
|
|
62
|
+
class: "tpl:mt-2"
|
|
63
|
+
}, Re = ["onKeydown"], ze = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, Be = ["disabled", "onClick"], Ve = {
|
|
64
|
+
key: 3,
|
|
65
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
|
|
66
|
+
}, He = {
|
|
67
|
+
key: 4,
|
|
68
|
+
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)]"
|
|
69
|
+
}, Ue = { class: "tpl:flex-1" }, We = ["onClick"], Ge = {
|
|
70
|
+
key: 5,
|
|
71
|
+
class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2"
|
|
72
|
+
}, Ke = ["title", "onClick"], qe = ["onClick"], Je = {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
|
|
75
|
+
}, Ye = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, Xe = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Ze = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Qe = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, $e = {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
|
|
78
|
+
}, et = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, tt = ["title", "onClick"], nt = ["title", "onClick"], rt = {
|
|
79
|
+
key: 0,
|
|
80
|
+
class: "tpl:mt-1.5"
|
|
81
|
+
}, it = ["onKeydown"], at = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, ot = ["disabled", "onClick"], st = {
|
|
82
|
+
key: 1,
|
|
83
|
+
class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
|
|
84
|
+
}, ct = {
|
|
85
|
+
key: 2,
|
|
86
|
+
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)]"
|
|
87
|
+
}, lt = { class: "tpl:flex-1" }, ut = ["onClick"], dt = {
|
|
88
|
+
key: 0,
|
|
89
|
+
class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
|
|
90
|
+
}, ft = { class: "tpl:flex tpl:items-end tpl:gap-2" }, pt = ["placeholder", "onKeydown"], mt = { class: "tpl:flex tpl:shrink-0 tpl:flex-col tpl:gap-1" }, ht = ["disabled", "onClick"], gt = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, _t = {
|
|
91
|
+
key: 0,
|
|
92
|
+
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)]"
|
|
93
|
+
}, vt = {
|
|
94
|
+
key: 1,
|
|
95
|
+
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)]"
|
|
96
|
+
}, yt = ["placeholder", "disabled"], bt = ["disabled"], D = /* @__PURE__ */ S(/* @__PURE__ */ o({
|
|
97
|
+
__name: "CommentsSidebar",
|
|
98
|
+
props: { visible: { type: Boolean } },
|
|
99
|
+
emits: ["close", "filterBlock"],
|
|
100
|
+
setup(o, { expose: x, emit: S }) {
|
|
101
|
+
let D = o, O = S, { t: k, format: A } = ae(), j = b(re, "CommentsSidebar"), xt = b(ie, "CommentsSidebar"), M = b(ne, "CommentsSidebar"), N = c("unresolved"), P = c(null), F = c(""), I = c(null), L = c(""), R = c(null), z = c(""), B = c(/* @__PURE__ */ new Set()), V = c(null), H = c(null), St = h(() => xt.userConfig?.id ?? null), Ct = h(() => {
|
|
102
|
+
let e = /* @__PURE__ */ new Set();
|
|
103
|
+
for (let t of j.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);
|
|
104
|
+
return e;
|
|
105
|
+
});
|
|
106
|
+
function wt(e) {
|
|
107
|
+
return e ? !Ct.value.has(e) : !1;
|
|
108
|
+
}
|
|
109
|
+
let Tt = h(() => N.value !== "block" || !P.value ? !1 : !(j.savedBlockIds?.value.has(P.value) ?? !0)), U = h(() => {
|
|
110
|
+
let e = M.comments.value;
|
|
111
|
+
return N.value === "unresolved" ? e = e.filter((e) => !e.resolved_at) : N.value === "block" && P.value && (e = e.filter((e) => e.block_id === P.value)), e;
|
|
112
|
+
});
|
|
113
|
+
y(() => D.visible, (e) => {
|
|
114
|
+
e && M.loadComments();
|
|
115
|
+
}), y(() => j.state.selectedBlockId, (e) => {
|
|
116
|
+
N.value === "block" && e && (P.value = e);
|
|
117
|
+
});
|
|
118
|
+
function W(e, t) {
|
|
119
|
+
N.value = e, P.value = e === "block" ? t ?? null : null;
|
|
120
|
+
}
|
|
121
|
+
function Et(e) {
|
|
122
|
+
W("block", e), O("filterBlock", e);
|
|
123
|
+
}
|
|
124
|
+
function Dt(e) {
|
|
125
|
+
B.value.has(e) ? B.value.delete(e) : B.value.add(e);
|
|
126
|
+
}
|
|
127
|
+
function Ot(e) {
|
|
128
|
+
I.value = e, L.value = "", R.value = null, B.value.has(e) || B.value.add(e);
|
|
129
|
+
}
|
|
130
|
+
function kt() {
|
|
131
|
+
I.value = null, L.value = "";
|
|
132
|
+
}
|
|
133
|
+
function G(e) {
|
|
134
|
+
R.value = e.id, z.value = e.body, I.value = null;
|
|
135
|
+
}
|
|
136
|
+
function K() {
|
|
137
|
+
R.value = null, z.value = "";
|
|
138
|
+
}
|
|
139
|
+
function q(e) {
|
|
140
|
+
V.value = e;
|
|
141
|
+
}
|
|
142
|
+
function J() {
|
|
143
|
+
V.value = null;
|
|
144
|
+
}
|
|
145
|
+
async function Y() {
|
|
146
|
+
let e = F.value.trim();
|
|
147
|
+
if (!e) return;
|
|
148
|
+
let t = N.value === "block" ? P.value : void 0;
|
|
149
|
+
await M.addComment(e, t ?? void 0), F.value = "";
|
|
150
|
+
}
|
|
151
|
+
async function X(e) {
|
|
152
|
+
let t = L.value.trim();
|
|
153
|
+
if (!t) return;
|
|
154
|
+
let n = M.comments.value.find((t) => t.id === e);
|
|
155
|
+
await M.addComment(t, n?.block_id ?? void 0, e), I.value = null, L.value = "";
|
|
156
|
+
}
|
|
157
|
+
async function Z(e) {
|
|
158
|
+
let t = z.value.trim();
|
|
159
|
+
t && (await M.editComment(e, t), R.value = null, z.value = "");
|
|
160
|
+
}
|
|
161
|
+
async function Q(e) {
|
|
162
|
+
await M.removeComment(e), V.value = null;
|
|
163
|
+
}
|
|
164
|
+
async function At(e) {
|
|
165
|
+
await M.toggleResolve(e);
|
|
166
|
+
}
|
|
167
|
+
function $(e) {
|
|
168
|
+
return e.author_identifier === St.value;
|
|
169
|
+
}
|
|
170
|
+
function jt(e) {
|
|
171
|
+
return ue(e, k.snapshotHistory) ?? e;
|
|
172
|
+
}
|
|
173
|
+
function Mt(e) {
|
|
174
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Y());
|
|
175
|
+
}
|
|
176
|
+
function Nt(e, t) {
|
|
177
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), X(t));
|
|
178
|
+
}
|
|
179
|
+
function Pt(e, t) {
|
|
180
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Z(t)), e.key === "Escape" && K();
|
|
181
|
+
}
|
|
182
|
+
function Ft() {
|
|
183
|
+
r(() => {
|
|
184
|
+
H.value?.focus();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
return x({
|
|
188
|
+
filterByBlock: Et,
|
|
189
|
+
focusNewComment: Ft
|
|
190
|
+
}), (r, c) => (n(), p(_, {
|
|
191
|
+
"enter-active-class": "tpl-comments-slide-enter-active",
|
|
192
|
+
"enter-from-class": "tpl:translate-x-full",
|
|
193
|
+
"enter-to-class": "tpl:translate-x-0",
|
|
194
|
+
"leave-active-class": "tpl-comments-slide-leave-active",
|
|
195
|
+
"leave-from-class": "tpl:translate-x-0",
|
|
196
|
+
"leave-to-class": "tpl:translate-x-full"
|
|
197
|
+
}, {
|
|
198
|
+
default: s(() => [o.visible ? (n(), l("div", me, [
|
|
199
|
+
m("div", he, [m("div", ge, [
|
|
200
|
+
u(v(w), {
|
|
201
|
+
size: 13,
|
|
202
|
+
"stroke-width": 2
|
|
203
|
+
}),
|
|
204
|
+
m("span", null, i(v(k).comments.title), 1),
|
|
205
|
+
v(M).unresolvedCount.value > 0 ? (n(), l("span", _e, i(v(M).unresolvedCount.value), 1)) : f("", !0)
|
|
206
|
+
]), m("button", {
|
|
207
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
208
|
+
onClick: c[0] ||= (e) => O("close")
|
|
209
|
+
}, [u(v(le), {
|
|
210
|
+
size: 14,
|
|
211
|
+
"stroke-width": 2
|
|
212
|
+
})])]),
|
|
213
|
+
m("div", ve, [
|
|
214
|
+
m("button", {
|
|
215
|
+
class: e(["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", N.value === "unresolved" ? "tpl-comment-filter--active" : ""]),
|
|
216
|
+
onClick: c[1] ||= (e) => W("unresolved")
|
|
217
|
+
}, i(v(k).comments.filterUnresolved), 3),
|
|
218
|
+
m("button", {
|
|
219
|
+
class: e(["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", N.value === "all" ? "tpl-comment-filter--active" : ""]),
|
|
220
|
+
onClick: c[2] ||= (e) => W("all")
|
|
221
|
+
}, i(v(k).comments.filterAll), 3),
|
|
222
|
+
v(j).state.selectedBlockId ? (n(), l("button", {
|
|
223
|
+
key: 0,
|
|
224
|
+
class: e(["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", N.value === "block" ? "tpl-comment-filter--active" : ""]),
|
|
225
|
+
onClick: c[3] ||= (e) => W("block", v(j).state.selectedBlockId ?? void 0)
|
|
226
|
+
}, i(v(k).comments.filterBlock), 3)) : f("", !0)
|
|
227
|
+
]),
|
|
228
|
+
m("div", ye, [v(M).isLoading.value ? (n(), l("div", be, [u(v(C), {
|
|
229
|
+
class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
|
|
230
|
+
size: 24,
|
|
231
|
+
"stroke-width": 2
|
|
232
|
+
})])) : U.value.length === 0 ? (n(), l("div", xe, [u(v(w), {
|
|
233
|
+
size: 32,
|
|
234
|
+
"stroke-width": 1.5,
|
|
235
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
236
|
+
}), m("p", Se, i(N.value === "all" ? v(k).comments.noCommentsHint : v(k).comments.noComments), 1)])) : (n(), l("div", Ce, [(n(!0), l(d, null, a(U.value, (r) => (n(), l("div", {
|
|
237
|
+
key: r.id,
|
|
238
|
+
class: "tpl-comment-thread"
|
|
239
|
+
}, [
|
|
240
|
+
m("div", we, [
|
|
241
|
+
m("div", Te, [m("div", Ee, [
|
|
242
|
+
m("span", De, i($(r) ? v(k).comments.ownedByYou : r.author_name), 1),
|
|
243
|
+
m("span", Oe, i(jt(r.created_at)), 1),
|
|
244
|
+
r.updated_at === r.created_at ? f("", !0) : (n(), l("span", ke, " (" + i(v(k).comments.edited) + ") ", 1))
|
|
245
|
+
]), m("div", Ae, [
|
|
246
|
+
m("button", {
|
|
247
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
248
|
+
title: r.resolved_at ? v(k).comments.unresolve : v(k).comments.resolve,
|
|
249
|
+
onClick: (e) => At(r.id)
|
|
250
|
+
}, [u(v(fe), {
|
|
251
|
+
size: 13,
|
|
252
|
+
"stroke-width": 2,
|
|
253
|
+
class: "tpl-resolve-icon",
|
|
254
|
+
style: ee({ color: r.resolved_at ? "var(--tpl-primary)" : void 0 })
|
|
255
|
+
}, null, 8, ["style"])], 8, je),
|
|
256
|
+
$(r) ? (n(), l("button", {
|
|
257
|
+
key: 0,
|
|
258
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
259
|
+
title: v(k).comments.edit,
|
|
260
|
+
onClick: (e) => G(r)
|
|
261
|
+
}, [u(v(E), {
|
|
262
|
+
size: 12,
|
|
263
|
+
"stroke-width": 2
|
|
264
|
+
})], 8, Me)) : f("", !0),
|
|
265
|
+
$(r) ? (n(), l("button", {
|
|
266
|
+
key: 1,
|
|
267
|
+
class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
268
|
+
title: v(k).comments.delete,
|
|
269
|
+
onClick: (e) => q(r.id)
|
|
270
|
+
}, [u(v(ce), {
|
|
271
|
+
size: 12,
|
|
272
|
+
"stroke-width": 2
|
|
273
|
+
})], 8, Ne)) : f("", !0)
|
|
274
|
+
])]),
|
|
275
|
+
u(_, { name: "tpl-resolve" }, {
|
|
276
|
+
default: s(() => [r.resolved_at ? (n(), l("div", Pe, [u(v(oe), {
|
|
277
|
+
size: 10,
|
|
278
|
+
"stroke-width": 2.5
|
|
279
|
+
}), m("span", null, i(v(A)(v(k).comments.resolvedBy, { name: r.resolved_by_name ?? "" })), 1)])) : f("", !0)]),
|
|
280
|
+
_: 2
|
|
281
|
+
}, 1024),
|
|
282
|
+
r.block_id && wt(r.block_id) ? (n(), l("span", Fe, i(v(k).comments.missingBlock), 1)) : r.block_id ? (n(), l("button", {
|
|
283
|
+
key: 1,
|
|
284
|
+
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)]",
|
|
285
|
+
onClick: (e) => v(j).selectBlock(r.block_id ?? "")
|
|
286
|
+
}, " Block ", 8, Ie)) : f("", !0),
|
|
287
|
+
R.value === r.id ? (n(), l("div", Le, [t(m("textarea", {
|
|
288
|
+
"onUpdate:modelValue": c[4] ||= (e) => z.value = e,
|
|
289
|
+
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)]",
|
|
290
|
+
rows: "3",
|
|
291
|
+
onKeydown: (e) => Pt(e, r.id)
|
|
292
|
+
}, null, 40, Re), [[g, z.value]]), m("div", ze, [m("button", {
|
|
293
|
+
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)]",
|
|
294
|
+
disabled: !z.value.trim() || v(M).isSubmitting.value,
|
|
295
|
+
onClick: (e) => Z(r.id)
|
|
296
|
+
}, i(v(k).comments.save), 9, Be), m("button", {
|
|
297
|
+
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)]",
|
|
298
|
+
onClick: c[5] ||= (e) => K()
|
|
299
|
+
}, i(v(k).comments.cancel), 1)])])) : (n(), l("p", Ve, i(r.body), 1)),
|
|
300
|
+
V.value === r.id ? (n(), l("div", He, [
|
|
301
|
+
m("span", Ue, i(v(k).comments.deleteConfirm), 1),
|
|
302
|
+
m("button", {
|
|
303
|
+
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)]",
|
|
304
|
+
onClick: (e) => Q(r.id)
|
|
305
|
+
}, i(v(k).comments.delete), 9, We),
|
|
306
|
+
m("button", {
|
|
307
|
+
class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
308
|
+
onClick: c[6] ||= (e) => J()
|
|
309
|
+
}, i(v(k).comments.cancel), 1)
|
|
310
|
+
])) : f("", !0),
|
|
311
|
+
R.value !== r.id && V.value !== r.id ? (n(), l("div", Ge, [m("button", {
|
|
312
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
313
|
+
title: v(k).comments.reply,
|
|
314
|
+
onClick: (e) => Ot(r.id)
|
|
315
|
+
}, [u(v(pe), {
|
|
316
|
+
size: 13,
|
|
317
|
+
"stroke-width": 2,
|
|
318
|
+
class: "tpl:text-[var(--tpl-primary)]"
|
|
319
|
+
})], 8, Ke), (r.replies?.length ?? 0) > 0 ? (n(), l("button", {
|
|
320
|
+
key: 0,
|
|
321
|
+
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)]",
|
|
322
|
+
onClick: (e) => Dt(r.id)
|
|
323
|
+
}, [B.value.has(r.id) ? (n(), p(v(de), {
|
|
324
|
+
key: 0,
|
|
325
|
+
size: 11,
|
|
326
|
+
"stroke-width": 2
|
|
327
|
+
})) : (n(), p(v(se), {
|
|
328
|
+
key: 1,
|
|
329
|
+
size: 11,
|
|
330
|
+
"stroke-width": 2
|
|
331
|
+
})), te(" " + i((r.replies?.length ?? 0) === 1 ? v(A)(v(k).comments.replyOne, { count: String(r.replies?.length ?? 0) }) : v(A)(v(k).comments.replyMany, { count: String(r.replies?.length ?? 0) })), 1)], 8, qe)) : f("", !0)])) : f("", !0)
|
|
332
|
+
]),
|
|
333
|
+
u(_, { name: "tpl-replies" }, {
|
|
334
|
+
default: s(() => [B.value.has(r.id) && (r.replies?.length ?? 0) > 0 ? (n(), l("div", Je, [(n(!0), l(d, null, a(r.replies, (a, o) => (n(), l("div", {
|
|
335
|
+
key: a.id,
|
|
336
|
+
class: e(["tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5", o < (r.replies?.length ?? 0) - 1 ? "tpl:mb-2" : ""])
|
|
337
|
+
}, [
|
|
338
|
+
m("div", Ye, [m("div", Xe, [
|
|
339
|
+
m("span", Ze, i($(a) ? v(k).comments.ownedByYou : a.author_name), 1),
|
|
340
|
+
m("span", Qe, i(jt(a.created_at)), 1),
|
|
341
|
+
a.updated_at === a.created_at ? f("", !0) : (n(), l("span", $e, " (" + i(v(k).comments.edited) + ") ", 1))
|
|
342
|
+
]), m("div", et, [$(a) ? (n(), l("button", {
|
|
343
|
+
key: 0,
|
|
344
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
345
|
+
title: v(k).comments.edit,
|
|
346
|
+
onClick: (e) => G(a)
|
|
347
|
+
}, [u(v(E), {
|
|
348
|
+
size: 11,
|
|
349
|
+
"stroke-width": 2
|
|
350
|
+
})], 8, tt)) : f("", !0), $(a) ? (n(), l("button", {
|
|
351
|
+
key: 1,
|
|
352
|
+
class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
353
|
+
title: v(k).comments.delete,
|
|
354
|
+
onClick: (e) => q(a.id)
|
|
355
|
+
}, [u(v(ce), {
|
|
356
|
+
size: 11,
|
|
357
|
+
"stroke-width": 2
|
|
358
|
+
})], 8, nt)) : f("", !0)])]),
|
|
359
|
+
R.value === a.id ? (n(), l("div", rt, [t(m("textarea", {
|
|
360
|
+
"onUpdate:modelValue": c[7] ||= (e) => z.value = e,
|
|
361
|
+
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)]",
|
|
362
|
+
rows: "2",
|
|
363
|
+
onKeydown: (e) => Pt(e, a.id)
|
|
364
|
+
}, null, 40, it), [[g, z.value]]), m("div", at, [m("button", {
|
|
365
|
+
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)]",
|
|
366
|
+
disabled: !z.value.trim() || v(M).isSubmitting.value,
|
|
367
|
+
onClick: (e) => Z(a.id)
|
|
368
|
+
}, i(v(k).comments.save), 9, ot), m("button", {
|
|
369
|
+
class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
370
|
+
onClick: c[8] ||= (e) => K()
|
|
371
|
+
}, i(v(k).comments.cancel), 1)])])) : (n(), l("p", st, i(a.body), 1)),
|
|
372
|
+
V.value === a.id ? (n(), l("div", ct, [
|
|
373
|
+
m("span", lt, i(v(k).comments.deleteConfirm), 1),
|
|
374
|
+
m("button", {
|
|
375
|
+
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)]",
|
|
376
|
+
onClick: (e) => Q(a.id)
|
|
377
|
+
}, i(v(k).comments.delete), 9, ut),
|
|
378
|
+
m("button", {
|
|
379
|
+
class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
380
|
+
onClick: c[9] ||= (e) => J()
|
|
381
|
+
}, i(v(k).comments.cancel), 1)
|
|
382
|
+
])) : f("", !0)
|
|
383
|
+
], 2))), 128))])) : f("", !0)]),
|
|
384
|
+
_: 2
|
|
385
|
+
}, 1024),
|
|
386
|
+
u(_, { name: "tpl-replies" }, {
|
|
387
|
+
default: s(() => [I.value === r.id ? (n(), l("div", dt, [m("div", ft, [t(m("textarea", {
|
|
388
|
+
"onUpdate:modelValue": c[10] ||= (e) => L.value = e,
|
|
389
|
+
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)]",
|
|
390
|
+
placeholder: v(k).comments.replyPlaceholder,
|
|
391
|
+
rows: "2",
|
|
392
|
+
onKeydown: (e) => Nt(e, r.id)
|
|
393
|
+
}, null, 40, pt), [[g, L.value]]), m("div", mt, [m("button", {
|
|
394
|
+
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)]",
|
|
395
|
+
disabled: !L.value.trim() || v(M).isSubmitting.value,
|
|
396
|
+
onClick: (e) => X(r.id)
|
|
397
|
+
}, [u(v(T), {
|
|
398
|
+
size: 14,
|
|
399
|
+
"stroke-width": 2
|
|
400
|
+
})], 8, ht), m("button", {
|
|
401
|
+
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)]",
|
|
402
|
+
onClick: c[11] ||= (e) => kt()
|
|
403
|
+
}, [u(v(le), {
|
|
404
|
+
size: 14,
|
|
405
|
+
"stroke-width": 2
|
|
406
|
+
})])])])])) : f("", !0)]),
|
|
407
|
+
_: 2
|
|
408
|
+
}, 1024)
|
|
409
|
+
]))), 128))]))]),
|
|
410
|
+
m("div", gt, [Tt.value ? (n(), l("div", _t, i(v(k).comments.saveTemplateFirst), 1)) : (n(), l("div", vt, [t(m("textarea", {
|
|
411
|
+
ref_key: "newCommentInput",
|
|
412
|
+
ref: H,
|
|
413
|
+
"onUpdate:modelValue": c[12] ||= (e) => F.value = e,
|
|
414
|
+
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)]",
|
|
415
|
+
placeholder: v(k).comments.placeholder,
|
|
416
|
+
disabled: v(M).isSubmitting.value,
|
|
417
|
+
rows: "2",
|
|
418
|
+
onKeydown: Mt
|
|
419
|
+
}, null, 40, yt), [[g, F.value]]), m("button", {
|
|
420
|
+
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)]",
|
|
421
|
+
disabled: !F.value.trim() || v(M).isSubmitting.value,
|
|
422
|
+
onClick: Y
|
|
423
|
+
}, [v(M).isSubmitting.value ? (n(), p(v(C), {
|
|
424
|
+
key: 0,
|
|
425
|
+
class: "tpl-spinner",
|
|
426
|
+
size: 16,
|
|
427
|
+
"stroke-width": 2
|
|
428
|
+
})) : (n(), p(v(T), {
|
|
429
|
+
key: 1,
|
|
430
|
+
size: 16,
|
|
431
|
+
"stroke-width": 2
|
|
432
|
+
}))], 8, bt)]))])
|
|
433
|
+
])) : f("", !0)]),
|
|
434
|
+
_: 1
|
|
435
|
+
}));
|
|
436
|
+
}
|
|
437
|
+
}), [["__scopeId", "data-v-5e7fbab3"]]);
|
|
438
|
+
//#endregion
|
|
439
|
+
export { D as default };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { r as e } from "./rolldown-runtime-BZGGJVDF.js";
|
|
2
|
+
import { M as t, Ot as n, P as r, S as i, Y as a, _ as o, d as s, g as c, m as l, p as u, tt as d, wt as f } from "./vue.runtime.esm-bundler-DryoQb-v.js";
|
|
3
|
+
import { o as p } from "./dist-n0PkFNGl.js";
|
|
4
|
+
import { t as m } from "./useI18n-B8CN2iWs.js";
|
|
5
|
+
//#region src/components/blocks/CountdownBlock.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var h = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:py-8 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
9
|
+
}, g = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:py-4 tpl:text-xs tpl:text-[var(--tpl-text-dim)] tpl:opacity-50"
|
|
12
|
+
}, _ = { class: "tpl:text-center" }, v = /* @__PURE__ */ i({
|
|
13
|
+
__name: "CountdownBlock",
|
|
14
|
+
props: {
|
|
15
|
+
block: {},
|
|
16
|
+
viewport: {}
|
|
17
|
+
},
|
|
18
|
+
setup(e) {
|
|
19
|
+
let i = e, { t: v } = m(), y = a(Date.now());
|
|
20
|
+
p(() => {
|
|
21
|
+
y.value = Date.now();
|
|
22
|
+
}, 1e3);
|
|
23
|
+
let b = u(() => {
|
|
24
|
+
if (!i.block.targetDate) return null;
|
|
25
|
+
let e = new Date(i.block.targetDate);
|
|
26
|
+
return isNaN(e.getTime()) ? null : e.getTime();
|
|
27
|
+
}), x = u(() => b.value ? y.value >= b.value : !1), S = u(() => {
|
|
28
|
+
if (!b.value || x.value) return {
|
|
29
|
+
days: 0,
|
|
30
|
+
hours: 0,
|
|
31
|
+
minutes: 0,
|
|
32
|
+
seconds: 0
|
|
33
|
+
};
|
|
34
|
+
let e = b.value - y.value, t = Math.floor(e / 1e3);
|
|
35
|
+
return {
|
|
36
|
+
days: Math.floor(t / 86400),
|
|
37
|
+
hours: Math.floor(t % 86400 / 3600),
|
|
38
|
+
minutes: Math.floor(t % 3600 / 60),
|
|
39
|
+
seconds: t % 60
|
|
40
|
+
};
|
|
41
|
+
}), C = u(() => {
|
|
42
|
+
let e = [];
|
|
43
|
+
return i.block.showDays && e.push({
|
|
44
|
+
value: String(S.value.days).padStart(2, "0"),
|
|
45
|
+
label: i.block.labelDays
|
|
46
|
+
}), i.block.showHours && e.push({
|
|
47
|
+
value: String(S.value.hours).padStart(2, "0"),
|
|
48
|
+
label: i.block.labelHours
|
|
49
|
+
}), i.block.showMinutes && e.push({
|
|
50
|
+
value: String(S.value.minutes).padStart(2, "0"),
|
|
51
|
+
label: i.block.labelMinutes
|
|
52
|
+
}), i.block.showSeconds && e.push({
|
|
53
|
+
value: String(S.value.seconds).padStart(2, "0"),
|
|
54
|
+
label: i.block.labelSeconds
|
|
55
|
+
}), e;
|
|
56
|
+
}), w = u(() => ({
|
|
57
|
+
backgroundColor: i.block.backgroundColor,
|
|
58
|
+
fontFamily: i.block.fontFamily || "inherit"
|
|
59
|
+
})), T = u(() => ({
|
|
60
|
+
fontSize: `${i.block.digitFontSize}px`,
|
|
61
|
+
fontWeight: "bold",
|
|
62
|
+
color: i.block.digitColor,
|
|
63
|
+
lineHeight: "1.2"
|
|
64
|
+
})), E = u(() => ({
|
|
65
|
+
fontSize: `${i.block.labelFontSize}px`,
|
|
66
|
+
color: i.block.labelColor,
|
|
67
|
+
marginTop: "4px"
|
|
68
|
+
})), D = u(() => ({
|
|
69
|
+
fontSize: `${i.block.digitFontSize}px`,
|
|
70
|
+
color: i.block.digitColor,
|
|
71
|
+
fontFamily: i.block.fontFamily || "inherit"
|
|
72
|
+
}));
|
|
73
|
+
return (i, a) => e.block.targetDate ? x.value && e.block.hideOnExpiry ? (t(), o("div", g, n(d(v).countdown.hidden), 1)) : x.value ? (t(), o("div", {
|
|
74
|
+
key: 2,
|
|
75
|
+
style: f(w.value),
|
|
76
|
+
class: "tpl:py-4 tpl:text-center"
|
|
77
|
+
}, [l("span", { style: f({
|
|
78
|
+
fontSize: `${e.block.digitFontSize}px`,
|
|
79
|
+
color: e.block.digitColor
|
|
80
|
+
}) }, n(e.block.expiredMessage), 5)], 4)) : (t(), o("div", {
|
|
81
|
+
key: 3,
|
|
82
|
+
style: f(w.value),
|
|
83
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:py-4"
|
|
84
|
+
}, [(t(!0), o(s, null, r(C.value, (r, i) => (t(), o(s, { key: r.label }, [i > 0 ? (t(), o("span", {
|
|
85
|
+
key: 0,
|
|
86
|
+
style: f(D.value),
|
|
87
|
+
class: "tpl:self-start"
|
|
88
|
+
}, n(e.block.separator), 5)) : c("", !0), l("div", _, [l("div", { style: f(T.value) }, n(r.value), 5), l("div", { style: f(E.value) }, n(r.label), 5)])], 64))), 128))], 4)) : (t(), o("div", h, n(d(v).countdown.setDate), 1));
|
|
89
|
+
}
|
|
90
|
+
}), y = /* @__PURE__ */ e({ default: () => b }), b = v;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { y as n, b as t };
|