@aswin.dev/editor 0.7.0 → 0.7.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/README.md +3 -3
- package/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-COL6Wm7p.js} +37 -37
- package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-DWGPVtvC.js} +68 -68
- package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-duUFSfDf.js} +22 -22
- package/dist/{BlockA11yBadge-CXDLqkcJ.js → BlockA11yBadge-Qs6HtXid.js} +12 -12
- package/dist/CloudEditor-CFldoCOb.js +1207 -0
- package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-Bw-lbt61.js} +21 -21
- package/dist/CommentsSidebar-BaD5F53-.js +436 -0
- package/dist/CountdownBlock-DaYGxKqo.js +92 -0
- package/dist/CountdownToolbar-Dg4F8MTk.js +210 -0
- package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-BSH7uNP_.js} +58 -58
- package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-Ba2pfF57.js} +2 -2
- package/dist/{ModuleBrowserModal-DrUFMTDx.js → ModuleBrowserModal-6phxZSKI.js} +80 -80
- package/dist/ModulePreviewCanvas-BW8L3eQX.js +108 -0
- package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-BpUzQOJt.js} +87 -87
- package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-DNSzAB-I.js} +182 -182
- package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-CrqPQdnk.js} +38 -38
- package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-zMQTpez7.js} +28 -28
- package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-Do-A5rYU.js} +45 -50
- package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-CS7o62zS.js} +75 -75
- package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-DGj_9V1u.js} +28 -28
- package/dist/{TitleEditor-fStSADI-.js → TitleEditor-C7IDnAoS.js} +68 -68
- package/dist/{TplModal-BwSfxIHf.js → TplModal-BAsVzcTb.js} +14 -14
- package/dist/{accessibility-e8JYu_zd.js → accessibility-BU09xZrQ.js} +1 -1
- package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-C6LDKvmd.js} +19 -5
- package/dist/bundle-stats.json +7 -7
- package/dist/{check-Da05j8yl.js → check-DJrpDKO_.js} +1 -1
- package/dist/{chevron-down-R2uY34iD.js → chevron-down-C5oBUhT8.js} +1 -1
- package/dist/chevron-right-BqCptpdp.js +10 -0
- package/dist/{circle-alert-DZuGWPX-.js → circle-alert-ZQQc98HC.js} +1 -1
- package/dist/{clock-CRp2sIub.js → clock-ik2pRJKG.js} +1 -1
- package/dist/{cloud-DEk_b4CR.js → cloud-6ZmAvF0j.js} +485 -427
- package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-ClREiSx3.js} +6 -6
- package/dist/{de-Brqvgr43.js → de-DWcgp-7T.js} +209 -1
- package/dist/{dist-BaQIYPsn.js → dist-BUzw1buG.js} +1 -1
- package/dist/{dist-DjviJBCi.js → dist-BZyY-SS4.js} +1 -1
- package/dist/{dist-D6uC2xhi.js → dist-BadNx4qo.js} +1 -1
- package/dist/{dist-aRzjfSRN.js → dist-BesOh2mk.js} +1 -1
- package/dist/{dist-D90y8dvT.js → dist-Bz3M4RXG.js} +3 -3
- package/dist/dist-C04s_fLA.js +563 -0
- package/dist/{dist-DDJIWTRY.js → dist-C3T2AKtB.js} +1 -1
- package/dist/{dist-BFawx6IS.js → dist-C9ckKEZL.js} +51 -51
- package/dist/{dist-us-RpCWN.js → dist-CBItRG-Z.js} +1 -1
- package/dist/{dist-wzMIGj-D.js → dist-COSzWQUs.js} +1 -1
- package/dist/dist-CivF9P8b.js +382 -0
- package/dist/{dist-Cp0zXPAD.js → dist-DtiDUrX-.js} +1 -1
- package/dist/{dist-KoBJjK1G.js → dist-Dzt5foyL.js} +1 -1
- package/dist/{en-WDVp87TE.js → en-Cxd4fhNm.js} +209 -1
- package/dist/{extensions-CUcl9Ok4.js → extensions-D__hOlV1.js} +106 -106
- package/dist/{image-up-MBZKKg9p.js → image-up-DT7gcJLN.js} +1 -1
- package/dist/index.d.ts +88 -11
- package/dist/{info-CJEC7piy.js → info-BSPGcsSM.js} +1 -1
- package/dist/keys-CvX8D-8C.js +10 -0
- package/dist/{loader-circle-DsY5Yg33.js → loader-circle-Balo8p3d.js} +1 -1
- package/dist/{message-circle-yElBbR2C.js → message-circle-B39qAHxs.js} +1 -1
- package/dist/pencil-BZJPNYWR.js +10 -0
- package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-DwDqGUM0.js} +1 -1
- package/dist/{scan-line-D0vcUekt.js → scan-line-CzfFJO1o.js} +1 -1
- package/dist/{send-DH4oDQqC.js → send-D2eSo4GH.js} +1 -1
- package/dist/{shield-check-CfJgs2Hd.js → shield-check-jkpgcC0-.js} +1 -1
- package/dist/{sparkles-CvRXGqFs.js → sparkles-Chm5CZfb.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styleConstants-34eUKPOZ.js +55 -0
- package/dist/styles-B4tjX5SP.js +5224 -0
- package/dist/templatical-editor.js +189 -126
- package/dist/{text-align-start-BT9VUDxK.js → text-align-start-CzBnJsW8.js} +1 -1
- package/dist/{trash-2-DbP2Y6t2.js → trash-2-CtK2apEH.js} +1 -1
- package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-KpDVNbpn.js} +1 -1
- package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-DOKSZql1.js} +2 -2
- package/dist/{useEditorCore-C6ost42Q.js → useEditorCore-wslttMH-.js} +2425 -2250
- package/dist/{useI18n-lb2DHDiu.js → useI18n-C2xQZ6K9.js} +2 -2
- package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-DX0XG5V9.js} +5 -5
- package/dist/{vue.runtime.esm-bundler-DpvJL-nX.js → vue.runtime.esm-bundler-CjauPXjj.js} +1 -1
- package/dist/{x-u2oVmjN_.js → x-BkaOMosX.js} +1 -1
- package/package.json +10 -10
- package/dist/CloudEditor-BCz1ZTYC.js +0 -1172
- package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
- package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
- package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
- package/dist/ModulePreviewCanvas-CHdOwV_4.js +0 -106
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +0 -97
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +0 -1
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +0 -59
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +0 -1
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +0 -33
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +0 -1
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +0 -1143
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +0 -1
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +0 -51
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +0 -1
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +0 -93
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +0 -1
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +0 -195
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +0 -1
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +0 -107
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +0 -1
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +0 -423
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +0 -544
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +0 -106
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +0 -119
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +0 -171
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +0 -22
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +0 -1
- package/dist/cdn/chunks/de-Ce-LbJ2J.js +0 -89
- package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +0 -1
- package/dist/cdn/chunks/de-D8CnZxV9.js +0 -523
- package/dist/cdn/chunks/de-D8CnZxV9.js.map +0 -1
- package/dist/cdn/chunks/de-RQrZR56a.js +0 -209
- package/dist/cdn/chunks/de-RQrZR56a.js.map +0 -1
- package/dist/cdn/chunks/draggable-Bcb86AsV.js +0 -11572
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +0 -1
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +0 -19
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +0 -1
- package/dist/cdn/chunks/en-8FHaQv4V.js +0 -523
- package/dist/cdn/chunks/en-8FHaQv4V.js.map +0 -1
- package/dist/cdn/chunks/en-Bl1ecfRF.js +0 -209
- package/dist/cdn/chunks/en-Bl1ecfRF.js.map +0 -1
- package/dist/cdn/chunks/en-DiCWK5fG.js +0 -89
- package/dist/cdn/chunks/en-DiCWK5fG.js.map +0 -1
- package/dist/cdn/chunks/extensions-DIxF31tA.js +0 -598
- package/dist/cdn/chunks/extensions-DIxF31tA.js.map +0 -1
- package/dist/cdn/chunks/features-DEMb13KS.js +0 -6814
- package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
- package/dist/cdn/chunks/icons-CsLTcirh.js +0 -700
- package/dist/cdn/chunks/icons-CsLTcirh.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +0 -3279
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +0 -1
- package/dist/cdn/chunks/media-library-CVaNvhpM.js +0 -6014
- package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +0 -1
- package/dist/cdn/chunks/pusher-CDbNlZBE.js +0 -2508
- package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +0 -1
- package/dist/cdn/chunks/quality-BaBfc54_.js +0 -1456
- package/dist/cdn/chunks/quality-BaBfc54_.js.map +0 -1
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +0 -32
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +0 -1
- package/dist/cdn/chunks/renderer-CUxvx7ro.js +0 -548
- package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +0 -1
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +0 -20
- package/dist/cdn/chunks/src-CRaqN-p8.js +0 -497
- package/dist/cdn/chunks/src-CRaqN-p8.js.map +0 -1
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js +0 -57
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +0 -1
- package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +0 -14654
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +0 -1
- package/dist/cdn/editor.css +0 -2
- package/dist/cdn/editor.js +0 -250
- package/dist/cdn/editor.js.map +0 -1
- package/dist/dist-B1IR0bpH.js +0 -326
- package/dist/dist-DJmnUmW9.js +0 -362
- package/dist/keys-ciNfSSGj.js +0 -10
- package/dist/styleConstants-fWzlIIwN.js +0 -55
- package/dist/styles-DEXEkBvg.js +0 -3176
- /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-BVAJ4lgT.js} +0 -0
- /package/dist/{de-DCaaCE5s.js → de-GOtR9DwW.js} +0 -0
- /package/dist/{dist-iLBdeBDR.js → dist-DXa1uAMh.js} +0 -0
- /package/dist/{emojiData-PQyVa4bU.js → emojiData-DrBuvEoP.js} +0 -0
- /package/dist/{en-DXCyK4-X.js → en-dFFQVzNn.js} +0 -0
- /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-BhhO8yCl.js} +0 -0
- /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-BvCyLQII.js} +0 -0
- /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-DVuzNX1y.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./useEditorCore-
|
|
3
|
-
import { t as f } from "./createLucideIcon-
|
|
4
|
-
import { n as p } from "./useCloudI18n-
|
|
5
|
-
import { t as m } from "./readableTextColor-
|
|
1
|
+
import { C as e, F as t, Ft as n, N as r, _ as i, f as a, g as o, h as s, jt as c, m as l, st as u, v as d } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import "./useEditorCore-wslttMH-.js";
|
|
3
|
+
import { t as f } from "./createLucideIcon-ClREiSx3.js";
|
|
4
|
+
import { n as p } from "./useCloudI18n-DOKSZql1.js";
|
|
5
|
+
import { t as m } from "./readableTextColor-DVuzNX1y.js";
|
|
6
6
|
var h = f("wifi-off", [
|
|
7
7
|
["path", {
|
|
8
8
|
d: "M12 20h.01",
|
|
@@ -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__ */ e({
|
|
56
56
|
__name: "CollaboratorBar",
|
|
57
57
|
props: {
|
|
58
58
|
collaborators: {},
|
|
59
59
|
isConnected: { type: Boolean }
|
|
60
60
|
},
|
|
61
|
-
setup(
|
|
62
|
-
let f =
|
|
61
|
+
setup(e) {
|
|
62
|
+
let f = e, { t: C } = p(), w = l(() => f.collaborators.slice(0, S)), T = l(() => f.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) => (r(), d("div", _, [s("div", {
|
|
68
68
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",
|
|
69
|
-
style:
|
|
70
|
-
title:
|
|
71
|
-
}, [
|
|
69
|
+
style: c({ color: e.isConnected ? "var(--tpl-success)" : "var(--tpl-text-muted)" }),
|
|
70
|
+
title: e.isConnected ? u(C).collaboration.connected : u(C).collaboration.disconnected
|
|
71
|
+
}, [e.isConnected ? (r(), o(u(g), {
|
|
72
72
|
key: 0,
|
|
73
73
|
size: 12,
|
|
74
74
|
"stroke-width": 2
|
|
75
|
-
})) : (
|
|
75
|
+
})) : (r(), o(u(h), {
|
|
76
76
|
key: 1,
|
|
77
77
|
size: 12,
|
|
78
78
|
"stroke-width": 2
|
|
79
|
-
}))], 12, v),
|
|
80
|
-
key:
|
|
79
|
+
}))], 12, v), e.collaborators.length > 0 ? (r(), d("div", y, [(r(!0), d(a, null, t(w.value, (e) => (r(), d("div", {
|
|
80
|
+
key: e.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: e.color,
|
|
84
|
+
color: u(m)(e.color)
|
|
85
85
|
}),
|
|
86
|
-
title:
|
|
87
|
-
},
|
|
86
|
+
title: e.name
|
|
87
|
+
}, n(O(e.name)), 13, b))), 128)), E.value > 0 ? (r(), d("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
|
+
}, " +" + n(E.value), 9, x)) : i("", !0)])) : i("", !0)]));
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
//#endregion
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import { At as e, C as t, F as n, Ft as r, N as i, U as a, V as o, W as s, _ as c, b as ee, c as l, et as u, f as d, g as f, h as p, jt as te, k as ne, m, st as h, t as g, v as _, x as v } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { A as y, i as re, m as ie, u as ae } from "./keys-CvX8D-8C.js";
|
|
3
|
+
import { t as oe } from "./useI18n-C2xQZ6K9.js";
|
|
4
|
+
import { t as b } from "./createLucideIcon-ClREiSx3.js";
|
|
5
|
+
import { t as se } from "./check-DJrpDKO_.js";
|
|
6
|
+
import { t as ce } from "./chevron-down-C5oBUhT8.js";
|
|
7
|
+
import { t as x } from "./loader-circle-Balo8p3d.js";
|
|
8
|
+
import { t as S } from "./message-circle-B39qAHxs.js";
|
|
9
|
+
import { t as C } from "./pencil-BZJPNYWR.js";
|
|
10
|
+
import { t as w } from "./send-D2eSo4GH.js";
|
|
11
|
+
import { t as T } from "./trash-2-CtK2apEH.js";
|
|
12
|
+
import { t as E } from "./x-BkaOMosX.js";
|
|
13
|
+
import { t as le } from "./_plugin-vue_export-helper-BVAJ4lgT.js";
|
|
14
|
+
import { n as ue } from "./useCloudI18n-DOKSZql1.js";
|
|
15
|
+
import { t as de } from "./formatRelativeTime-BhhO8yCl.js";
|
|
16
|
+
var fe = b("chevron-up", [["path", {
|
|
17
|
+
d: "m18 15-6-6-6 6",
|
|
18
|
+
key: "153udz"
|
|
19
|
+
}]]), pe = b("circle-check", [["circle", {
|
|
20
|
+
cx: "12",
|
|
21
|
+
cy: "12",
|
|
22
|
+
r: "10",
|
|
23
|
+
key: "1mglay"
|
|
24
|
+
}], ["path", {
|
|
25
|
+
d: "m9 12 2 2 4-4",
|
|
26
|
+
key: "dzmm74"
|
|
27
|
+
}]]), me = b("reply", [["path", {
|
|
28
|
+
d: "M20 18v-2a4 4 0 0 0-4-4H4",
|
|
29
|
+
key: "5vmcpk"
|
|
30
|
+
}], ["path", {
|
|
31
|
+
d: "m9 17-5-5 5-5",
|
|
32
|
+
key: "nvlc11"
|
|
33
|
+
}]]), he = {
|
|
34
|
+
key: 0,
|
|
35
|
+
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)]"
|
|
36
|
+
}, ge = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, _e = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]" }, ve = {
|
|
37
|
+
key: 0,
|
|
38
|
+
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)]"
|
|
39
|
+
}, ye = { class: "tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2" }, be = { class: "tpl:flex-1 tpl:overflow-y-auto" }, xe = {
|
|
40
|
+
key: 0,
|
|
41
|
+
class: "tpl:flex tpl:h-full tpl:items-center tpl:justify-center"
|
|
42
|
+
}, Se = {
|
|
43
|
+
key: 1,
|
|
44
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:px-6 tpl:text-center"
|
|
45
|
+
}, Ce = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, we = {
|
|
46
|
+
key: 2,
|
|
47
|
+
class: "tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3"
|
|
48
|
+
}, Te = { class: "tpl-comment-card tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-3" }, Ee = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, De = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Oe = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, ke = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, Ae = {
|
|
49
|
+
key: 0,
|
|
50
|
+
class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
|
|
51
|
+
}, je = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, Me = ["title", "onClick"], Ne = ["title", "onClick"], Pe = ["title", "onClick"], Fe = {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:text-[10px] tpl:text-[var(--tpl-primary)]"
|
|
54
|
+
}, Ie = {
|
|
55
|
+
key: 0,
|
|
56
|
+
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)]"
|
|
57
|
+
}, Le = ["onClick"], Re = {
|
|
58
|
+
key: 2,
|
|
59
|
+
class: "tpl:mt-2"
|
|
60
|
+
}, ze = ["onKeydown"], Be = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, Ve = ["disabled", "onClick"], He = {
|
|
61
|
+
key: 3,
|
|
62
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
|
|
63
|
+
}, Ue = {
|
|
64
|
+
key: 4,
|
|
65
|
+
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)]"
|
|
66
|
+
}, We = { class: "tpl:flex-1" }, Ge = ["onClick"], Ke = {
|
|
67
|
+
key: 5,
|
|
68
|
+
class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2"
|
|
69
|
+
}, qe = ["title", "onClick"], Je = ["onClick"], Ye = {
|
|
70
|
+
key: 0,
|
|
71
|
+
class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
|
|
72
|
+
}, Xe = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, Ze = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Qe = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, $e = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, et = {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
|
|
75
|
+
}, tt = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, nt = ["title", "onClick"], rt = ["title", "onClick"], it = {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: "tpl:mt-1.5"
|
|
78
|
+
}, at = ["onKeydown"], ot = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, st = ["disabled", "onClick"], ct = {
|
|
79
|
+
key: 1,
|
|
80
|
+
class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
|
|
81
|
+
}, lt = {
|
|
82
|
+
key: 2,
|
|
83
|
+
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)]"
|
|
84
|
+
}, ut = { class: "tpl:flex-1" }, dt = ["onClick"], ft = {
|
|
85
|
+
key: 0,
|
|
86
|
+
class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
|
|
87
|
+
}, pt = { class: "tpl:flex tpl:items-end tpl:gap-2" }, mt = ["placeholder", "onKeydown"], ht = { class: "tpl:flex tpl:shrink-0 tpl:flex-col tpl:gap-1" }, gt = ["disabled", "onClick"], _t = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, vt = {
|
|
88
|
+
key: 0,
|
|
89
|
+
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)]"
|
|
90
|
+
}, yt = {
|
|
91
|
+
key: 1,
|
|
92
|
+
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)]"
|
|
93
|
+
}, bt = ["placeholder", "disabled"], xt = ["disabled"], D = /* @__PURE__ */ le(/* @__PURE__ */ t({
|
|
94
|
+
__name: "CommentsSidebar",
|
|
95
|
+
props: { visible: { type: Boolean } },
|
|
96
|
+
emits: ["close", "filterBlock"],
|
|
97
|
+
setup(t, { expose: b, emit: le }) {
|
|
98
|
+
let D = t, O = le, { format: k } = oe(), { t: A } = ue(), j = y(ie, "CommentsSidebar"), St = y(re, "CommentsSidebar"), M = y(ae, "CommentsSidebar"), N = u("unresolved"), P = u(null), F = u(""), I = u(null), L = u(""), R = u(null), z = u(""), B = u(/* @__PURE__ */ new Set()), V = u(null), H = u(null), Ct = m(() => St.userConfig?.id ?? null), wt = m(() => {
|
|
99
|
+
let e = /* @__PURE__ */ new Set();
|
|
100
|
+
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);
|
|
101
|
+
return e;
|
|
102
|
+
});
|
|
103
|
+
function Tt(e) {
|
|
104
|
+
return e ? !wt.value.has(e) : !1;
|
|
105
|
+
}
|
|
106
|
+
let Et = m(() => N.value !== "block" || !P.value ? !1 : !(j.savedBlockIds?.value.has(P.value) ?? !0)), U = m(() => {
|
|
107
|
+
let e = M.comments.value;
|
|
108
|
+
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;
|
|
109
|
+
});
|
|
110
|
+
o(() => D.visible, (e) => {
|
|
111
|
+
e && M.loadComments();
|
|
112
|
+
}), o(() => j.state.selectedBlockId, (e) => {
|
|
113
|
+
N.value === "block" && e && (P.value = e);
|
|
114
|
+
});
|
|
115
|
+
function W(e, t) {
|
|
116
|
+
N.value = e, P.value = e === "block" ? t ?? null : null;
|
|
117
|
+
}
|
|
118
|
+
function Dt(e) {
|
|
119
|
+
W("block", e), O("filterBlock", e);
|
|
120
|
+
}
|
|
121
|
+
function Ot(e) {
|
|
122
|
+
B.value.has(e) ? B.value.delete(e) : B.value.add(e);
|
|
123
|
+
}
|
|
124
|
+
function kt(e) {
|
|
125
|
+
I.value = e, L.value = "", R.value = null, B.value.has(e) || B.value.add(e);
|
|
126
|
+
}
|
|
127
|
+
function At() {
|
|
128
|
+
I.value = null, L.value = "";
|
|
129
|
+
}
|
|
130
|
+
function G(e) {
|
|
131
|
+
R.value = e.id, z.value = e.body, I.value = null;
|
|
132
|
+
}
|
|
133
|
+
function K() {
|
|
134
|
+
R.value = null, z.value = "";
|
|
135
|
+
}
|
|
136
|
+
function q(e) {
|
|
137
|
+
V.value = e;
|
|
138
|
+
}
|
|
139
|
+
function J() {
|
|
140
|
+
V.value = null;
|
|
141
|
+
}
|
|
142
|
+
async function Y() {
|
|
143
|
+
let e = F.value.trim();
|
|
144
|
+
if (!e) return;
|
|
145
|
+
let t = N.value === "block" ? P.value : void 0;
|
|
146
|
+
await M.addComment(e, t ?? void 0), F.value = "";
|
|
147
|
+
}
|
|
148
|
+
async function X(e) {
|
|
149
|
+
let t = L.value.trim();
|
|
150
|
+
if (!t) return;
|
|
151
|
+
let n = M.comments.value.find((t) => t.id === e);
|
|
152
|
+
await M.addComment(t, n?.block_id ?? void 0, e), I.value = null, L.value = "";
|
|
153
|
+
}
|
|
154
|
+
async function Z(e) {
|
|
155
|
+
let t = z.value.trim();
|
|
156
|
+
t && (await M.editComment(e, t), R.value = null, z.value = "");
|
|
157
|
+
}
|
|
158
|
+
async function jt(e) {
|
|
159
|
+
await M.removeComment(e), V.value = null;
|
|
160
|
+
}
|
|
161
|
+
async function Mt(e) {
|
|
162
|
+
await M.toggleResolve(e);
|
|
163
|
+
}
|
|
164
|
+
function Q(e) {
|
|
165
|
+
return e.author_identifier === Ct.value;
|
|
166
|
+
}
|
|
167
|
+
function Nt(e) {
|
|
168
|
+
return de(e, A.snapshotHistory) ?? e;
|
|
169
|
+
}
|
|
170
|
+
function Pt(e) {
|
|
171
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Y());
|
|
172
|
+
}
|
|
173
|
+
function Ft(e, t) {
|
|
174
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), X(t));
|
|
175
|
+
}
|
|
176
|
+
function $(e, t) {
|
|
177
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Z(t)), e.key === "Escape" && K();
|
|
178
|
+
}
|
|
179
|
+
function It() {
|
|
180
|
+
ne(() => {
|
|
181
|
+
H.value?.focus();
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return b({
|
|
185
|
+
filterByBlock: Dt,
|
|
186
|
+
focusNewComment: It
|
|
187
|
+
}), (o, u) => (i(), f(g, {
|
|
188
|
+
"enter-active-class": "tpl-comments-slide-enter-active",
|
|
189
|
+
"enter-from-class": "tpl:translate-x-full",
|
|
190
|
+
"enter-to-class": "tpl:translate-x-0",
|
|
191
|
+
"leave-active-class": "tpl-comments-slide-leave-active",
|
|
192
|
+
"leave-from-class": "tpl:translate-x-0",
|
|
193
|
+
"leave-to-class": "tpl:translate-x-full"
|
|
194
|
+
}, {
|
|
195
|
+
default: a(() => [t.visible ? (i(), _("div", he, [
|
|
196
|
+
p("div", ge, [p("div", _e, [
|
|
197
|
+
v(h(S), {
|
|
198
|
+
size: 13,
|
|
199
|
+
"stroke-width": 2
|
|
200
|
+
}),
|
|
201
|
+
p("span", null, r(h(A).comments.title), 1),
|
|
202
|
+
h(M).unresolvedCount.value > 0 ? (i(), _("span", ve, r(h(M).unresolvedCount.value), 1)) : c("", !0)
|
|
203
|
+
]), p("button", {
|
|
204
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
205
|
+
onClick: u[0] ||= (e) => O("close")
|
|
206
|
+
}, [v(h(E), {
|
|
207
|
+
size: 14,
|
|
208
|
+
"stroke-width": 2
|
|
209
|
+
})])]),
|
|
210
|
+
p("div", ye, [
|
|
211
|
+
p("button", {
|
|
212
|
+
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" : ""]),
|
|
213
|
+
onClick: u[1] ||= (e) => W("unresolved")
|
|
214
|
+
}, r(h(A).comments.filterUnresolved), 3),
|
|
215
|
+
p("button", {
|
|
216
|
+
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" : ""]),
|
|
217
|
+
onClick: u[2] ||= (e) => W("all")
|
|
218
|
+
}, r(h(A).comments.filterAll), 3),
|
|
219
|
+
h(j).state.selectedBlockId ? (i(), _("button", {
|
|
220
|
+
key: 0,
|
|
221
|
+
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" : ""]),
|
|
222
|
+
onClick: u[3] ||= (e) => W("block", h(j).state.selectedBlockId ?? void 0)
|
|
223
|
+
}, r(h(A).comments.filterBlock), 3)) : c("", !0)
|
|
224
|
+
]),
|
|
225
|
+
p("div", be, [h(M).isLoading.value ? (i(), _("div", xe, [v(h(x), {
|
|
226
|
+
class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
|
|
227
|
+
size: 24,
|
|
228
|
+
"stroke-width": 2
|
|
229
|
+
})])) : U.value.length === 0 ? (i(), _("div", Se, [v(h(S), {
|
|
230
|
+
size: 32,
|
|
231
|
+
"stroke-width": 1.5,
|
|
232
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
233
|
+
}), p("p", Ce, r(N.value === "all" ? h(A).comments.noCommentsHint : h(A).comments.noComments), 1)])) : (i(), _("div", we, [(i(!0), _(d, null, n(U.value, (t) => (i(), _("div", {
|
|
234
|
+
key: t.id,
|
|
235
|
+
class: "tpl-comment-thread"
|
|
236
|
+
}, [
|
|
237
|
+
p("div", Te, [
|
|
238
|
+
p("div", Ee, [p("div", De, [
|
|
239
|
+
p("span", Oe, r(Q(t) ? h(A).comments.ownedByYou : t.author_name), 1),
|
|
240
|
+
p("span", ke, r(Nt(t.created_at)), 1),
|
|
241
|
+
t.updated_at === t.created_at ? c("", !0) : (i(), _("span", Ae, " (" + r(h(A).comments.edited) + ") ", 1))
|
|
242
|
+
]), p("div", je, [
|
|
243
|
+
p("button", {
|
|
244
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
245
|
+
title: t.resolved_at ? h(A).comments.unresolve : h(A).comments.resolve,
|
|
246
|
+
onClick: (e) => Mt(t.id)
|
|
247
|
+
}, [v(h(pe), {
|
|
248
|
+
size: 13,
|
|
249
|
+
"stroke-width": 2,
|
|
250
|
+
class: "tpl-resolve-icon",
|
|
251
|
+
style: te({ color: t.resolved_at ? "var(--tpl-primary)" : void 0 })
|
|
252
|
+
}, null, 8, ["style"])], 8, Me),
|
|
253
|
+
Q(t) ? (i(), _("button", {
|
|
254
|
+
key: 0,
|
|
255
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
256
|
+
title: h(A).comments.edit,
|
|
257
|
+
onClick: (e) => G(t)
|
|
258
|
+
}, [v(h(C), {
|
|
259
|
+
size: 12,
|
|
260
|
+
"stroke-width": 2
|
|
261
|
+
})], 8, Ne)) : c("", !0),
|
|
262
|
+
Q(t) ? (i(), _("button", {
|
|
263
|
+
key: 1,
|
|
264
|
+
class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
265
|
+
title: h(A).comments.delete,
|
|
266
|
+
onClick: (e) => q(t.id)
|
|
267
|
+
}, [v(h(T), {
|
|
268
|
+
size: 12,
|
|
269
|
+
"stroke-width": 2
|
|
270
|
+
})], 8, Pe)) : c("", !0)
|
|
271
|
+
])]),
|
|
272
|
+
v(g, { name: "tpl-resolve" }, {
|
|
273
|
+
default: a(() => [t.resolved_at ? (i(), _("div", Fe, [v(h(se), {
|
|
274
|
+
size: 10,
|
|
275
|
+
"stroke-width": 2.5
|
|
276
|
+
}), p("span", null, r(h(k)(h(A).comments.resolvedBy, { name: t.resolved_by_name ?? "" })), 1)])) : c("", !0)]),
|
|
277
|
+
_: 2
|
|
278
|
+
}, 1024),
|
|
279
|
+
t.block_id && Tt(t.block_id) ? (i(), _("span", Ie, r(h(A).comments.missingBlock), 1)) : t.block_id ? (i(), _("button", {
|
|
280
|
+
key: 1,
|
|
281
|
+
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)]",
|
|
282
|
+
onClick: (e) => h(j).selectBlock(t.block_id ?? "")
|
|
283
|
+
}, " Block ", 8, Le)) : c("", !0),
|
|
284
|
+
R.value === t.id ? (i(), _("div", Re, [s(p("textarea", {
|
|
285
|
+
"onUpdate:modelValue": u[4] ||= (e) => z.value = e,
|
|
286
|
+
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)]",
|
|
287
|
+
rows: "3",
|
|
288
|
+
onKeydown: (e) => $(e, t.id)
|
|
289
|
+
}, null, 40, ze), [[l, z.value]]), p("div", Be, [p("button", {
|
|
290
|
+
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)]",
|
|
291
|
+
disabled: !z.value.trim() || h(M).isSubmitting.value,
|
|
292
|
+
onClick: (e) => Z(t.id)
|
|
293
|
+
}, r(h(A).comments.save), 9, Ve), p("button", {
|
|
294
|
+
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)]",
|
|
295
|
+
onClick: u[5] ||= (e) => K()
|
|
296
|
+
}, r(h(A).comments.cancel), 1)])])) : (i(), _("p", He, r(t.body), 1)),
|
|
297
|
+
V.value === t.id ? (i(), _("div", Ue, [
|
|
298
|
+
p("span", We, r(h(A).comments.deleteConfirm), 1),
|
|
299
|
+
p("button", {
|
|
300
|
+
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)]",
|
|
301
|
+
onClick: (e) => jt(t.id)
|
|
302
|
+
}, r(h(A).comments.delete), 9, Ge),
|
|
303
|
+
p("button", {
|
|
304
|
+
class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
305
|
+
onClick: u[6] ||= (e) => J()
|
|
306
|
+
}, r(h(A).comments.cancel), 1)
|
|
307
|
+
])) : c("", !0),
|
|
308
|
+
R.value !== t.id && V.value !== t.id ? (i(), _("div", Ke, [p("button", {
|
|
309
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
310
|
+
title: h(A).comments.reply,
|
|
311
|
+
onClick: (e) => kt(t.id)
|
|
312
|
+
}, [v(h(me), {
|
|
313
|
+
size: 13,
|
|
314
|
+
"stroke-width": 2,
|
|
315
|
+
class: "tpl:text-[var(--tpl-primary)]"
|
|
316
|
+
})], 8, qe), (t.replies?.length ?? 0) > 0 ? (i(), _("button", {
|
|
317
|
+
key: 0,
|
|
318
|
+
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)]",
|
|
319
|
+
onClick: (e) => Ot(t.id)
|
|
320
|
+
}, [B.value.has(t.id) ? (i(), f(h(fe), {
|
|
321
|
+
key: 0,
|
|
322
|
+
size: 11,
|
|
323
|
+
"stroke-width": 2
|
|
324
|
+
})) : (i(), f(h(ce), {
|
|
325
|
+
key: 1,
|
|
326
|
+
size: 11,
|
|
327
|
+
"stroke-width": 2
|
|
328
|
+
})), ee(" " + r((t.replies?.length ?? 0) === 1 ? h(k)(h(A).comments.replyOne, { count: String(t.replies?.length ?? 0) }) : h(k)(h(A).comments.replyMany, { count: String(t.replies?.length ?? 0) })), 1)], 8, Je)) : c("", !0)])) : c("", !0)
|
|
329
|
+
]),
|
|
330
|
+
v(g, { name: "tpl-replies" }, {
|
|
331
|
+
default: a(() => [B.value.has(t.id) && (t.replies?.length ?? 0) > 0 ? (i(), _("div", Ye, [(i(!0), _(d, null, n(t.replies, (n, a) => (i(), _("div", {
|
|
332
|
+
key: n.id,
|
|
333
|
+
class: e(["tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5", a < (t.replies?.length ?? 0) - 1 ? "tpl:mb-2" : ""])
|
|
334
|
+
}, [
|
|
335
|
+
p("div", Xe, [p("div", Ze, [
|
|
336
|
+
p("span", Qe, r(Q(n) ? h(A).comments.ownedByYou : n.author_name), 1),
|
|
337
|
+
p("span", $e, r(Nt(n.created_at)), 1),
|
|
338
|
+
n.updated_at === n.created_at ? c("", !0) : (i(), _("span", et, " (" + r(h(A).comments.edited) + ") ", 1))
|
|
339
|
+
]), p("div", tt, [Q(n) ? (i(), _("button", {
|
|
340
|
+
key: 0,
|
|
341
|
+
class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
342
|
+
title: h(A).comments.edit,
|
|
343
|
+
onClick: (e) => G(n)
|
|
344
|
+
}, [v(h(C), {
|
|
345
|
+
size: 11,
|
|
346
|
+
"stroke-width": 2
|
|
347
|
+
})], 8, nt)) : c("", !0), Q(n) ? (i(), _("button", {
|
|
348
|
+
key: 1,
|
|
349
|
+
class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
350
|
+
title: h(A).comments.delete,
|
|
351
|
+
onClick: (e) => q(n.id)
|
|
352
|
+
}, [v(h(T), {
|
|
353
|
+
size: 11,
|
|
354
|
+
"stroke-width": 2
|
|
355
|
+
})], 8, rt)) : c("", !0)])]),
|
|
356
|
+
R.value === n.id ? (i(), _("div", it, [s(p("textarea", {
|
|
357
|
+
"onUpdate:modelValue": u[7] ||= (e) => z.value = e,
|
|
358
|
+
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)]",
|
|
359
|
+
rows: "2",
|
|
360
|
+
onKeydown: (e) => $(e, n.id)
|
|
361
|
+
}, null, 40, at), [[l, z.value]]), p("div", ot, [p("button", {
|
|
362
|
+
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)]",
|
|
363
|
+
disabled: !z.value.trim() || h(M).isSubmitting.value,
|
|
364
|
+
onClick: (e) => Z(n.id)
|
|
365
|
+
}, r(h(A).comments.save), 9, st), p("button", {
|
|
366
|
+
class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
367
|
+
onClick: u[8] ||= (e) => K()
|
|
368
|
+
}, r(h(A).comments.cancel), 1)])])) : (i(), _("p", ct, r(n.body), 1)),
|
|
369
|
+
V.value === n.id ? (i(), _("div", lt, [
|
|
370
|
+
p("span", ut, r(h(A).comments.deleteConfirm), 1),
|
|
371
|
+
p("button", {
|
|
372
|
+
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)]",
|
|
373
|
+
onClick: (e) => jt(n.id)
|
|
374
|
+
}, r(h(A).comments.delete), 9, dt),
|
|
375
|
+
p("button", {
|
|
376
|
+
class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
377
|
+
onClick: u[9] ||= (e) => J()
|
|
378
|
+
}, r(h(A).comments.cancel), 1)
|
|
379
|
+
])) : c("", !0)
|
|
380
|
+
], 2))), 128))])) : c("", !0)]),
|
|
381
|
+
_: 2
|
|
382
|
+
}, 1024),
|
|
383
|
+
v(g, { name: "tpl-replies" }, {
|
|
384
|
+
default: a(() => [I.value === t.id ? (i(), _("div", ft, [p("div", pt, [s(p("textarea", {
|
|
385
|
+
"onUpdate:modelValue": u[10] ||= (e) => L.value = e,
|
|
386
|
+
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)]",
|
|
387
|
+
placeholder: h(A).comments.replyPlaceholder,
|
|
388
|
+
rows: "2",
|
|
389
|
+
onKeydown: (e) => Ft(e, t.id)
|
|
390
|
+
}, null, 40, mt), [[l, L.value]]), p("div", ht, [p("button", {
|
|
391
|
+
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)]",
|
|
392
|
+
disabled: !L.value.trim() || h(M).isSubmitting.value,
|
|
393
|
+
onClick: (e) => X(t.id)
|
|
394
|
+
}, [v(h(w), {
|
|
395
|
+
size: 14,
|
|
396
|
+
"stroke-width": 2
|
|
397
|
+
})], 8, gt), p("button", {
|
|
398
|
+
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)]",
|
|
399
|
+
onClick: u[11] ||= (e) => At()
|
|
400
|
+
}, [v(h(E), {
|
|
401
|
+
size: 14,
|
|
402
|
+
"stroke-width": 2
|
|
403
|
+
})])])])])) : c("", !0)]),
|
|
404
|
+
_: 2
|
|
405
|
+
}, 1024)
|
|
406
|
+
]))), 128))]))]),
|
|
407
|
+
p("div", _t, [Et.value ? (i(), _("div", vt, r(h(A).comments.saveTemplateFirst), 1)) : (i(), _("div", yt, [s(p("textarea", {
|
|
408
|
+
ref_key: "newCommentInput",
|
|
409
|
+
ref: H,
|
|
410
|
+
"onUpdate:modelValue": u[12] ||= (e) => F.value = e,
|
|
411
|
+
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)]",
|
|
412
|
+
placeholder: h(A).comments.placeholder,
|
|
413
|
+
disabled: h(M).isSubmitting.value,
|
|
414
|
+
rows: "2",
|
|
415
|
+
onKeydown: Pt
|
|
416
|
+
}, null, 40, bt), [[l, F.value]]), p("button", {
|
|
417
|
+
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)]",
|
|
418
|
+
disabled: !F.value.trim() || h(M).isSubmitting.value,
|
|
419
|
+
onClick: Y
|
|
420
|
+
}, [h(M).isSubmitting.value ? (i(), f(h(x), {
|
|
421
|
+
key: 0,
|
|
422
|
+
class: "tpl-spinner",
|
|
423
|
+
size: 16,
|
|
424
|
+
"stroke-width": 2
|
|
425
|
+
})) : (i(), f(h(w), {
|
|
426
|
+
key: 1,
|
|
427
|
+
size: 16,
|
|
428
|
+
"stroke-width": 2
|
|
429
|
+
}))], 8, xt)]))])
|
|
430
|
+
])) : c("", !0)]),
|
|
431
|
+
_: 1
|
|
432
|
+
}));
|
|
433
|
+
}
|
|
434
|
+
}), [["__scopeId", "data-v-5f25dfd0"]]);
|
|
435
|
+
//#endregion
|
|
436
|
+
export { D as default };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { r as e } from "./rolldown-runtime-BZGGJVDF.js";
|
|
2
|
+
import { C as t, F as n, Ft as r, N as i, _ as a, et as o, f as s, h as c, jt as l, m as u, st as d, v as f } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
3
|
+
import { c as p } from "./dist-CivF9P8b.js";
|
|
4
|
+
import { t as m } from "./useI18n-C2xQZ6K9.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__ */ t({
|
|
13
|
+
__name: "CountdownBlock",
|
|
14
|
+
props: {
|
|
15
|
+
block: {},
|
|
16
|
+
viewport: {}
|
|
17
|
+
},
|
|
18
|
+
setup(e) {
|
|
19
|
+
let t = e, { t: v } = m(), y = o(Date.now());
|
|
20
|
+
p(() => {
|
|
21
|
+
y.value = Date.now();
|
|
22
|
+
}, 1e3);
|
|
23
|
+
let b = u(() => {
|
|
24
|
+
if (!t.block.targetDate) return null;
|
|
25
|
+
let e = new Date(t.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 t.block.showDays && e.push({
|
|
44
|
+
value: String(S.value.days).padStart(2, "0"),
|
|
45
|
+
label: t.block.labelDays
|
|
46
|
+
}), t.block.showHours && e.push({
|
|
47
|
+
value: String(S.value.hours).padStart(2, "0"),
|
|
48
|
+
label: t.block.labelHours
|
|
49
|
+
}), t.block.showMinutes && e.push({
|
|
50
|
+
value: String(S.value.minutes).padStart(2, "0"),
|
|
51
|
+
label: t.block.labelMinutes
|
|
52
|
+
}), t.block.showSeconds && e.push({
|
|
53
|
+
value: String(S.value.seconds).padStart(2, "0"),
|
|
54
|
+
label: t.block.labelSeconds
|
|
55
|
+
}), e;
|
|
56
|
+
}), w = u(() => ({
|
|
57
|
+
backgroundColor: t.block.backgroundColor,
|
|
58
|
+
fontFamily: t.block.fontFamily || "inherit"
|
|
59
|
+
})), T = u(() => ({
|
|
60
|
+
fontSize: `${t.block.digitFontSize}px`,
|
|
61
|
+
fontWeight: "bold",
|
|
62
|
+
color: t.block.digitColor,
|
|
63
|
+
lineHeight: "1.2"
|
|
64
|
+
})), E = u(() => ({
|
|
65
|
+
fontSize: `${t.block.labelFontSize}px`,
|
|
66
|
+
color: t.block.labelColor,
|
|
67
|
+
marginTop: "4px"
|
|
68
|
+
})), D = u(() => ({
|
|
69
|
+
fontSize: `${t.block.digitFontSize}px`,
|
|
70
|
+
color: t.block.digitColor,
|
|
71
|
+
fontFamily: t.block.fontFamily || "inherit"
|
|
72
|
+
}));
|
|
73
|
+
return (t, o) => e.block.targetDate ? x.value && e.block.hideOnExpiry ? (i(), f("div", g, r(d(v).countdown.hidden), 1)) : x.value ? (i(), f("div", {
|
|
74
|
+
key: 2,
|
|
75
|
+
style: l(w.value),
|
|
76
|
+
class: "tpl:py-4 tpl:text-center"
|
|
77
|
+
}, [c("span", { style: l({
|
|
78
|
+
fontSize: `${e.block.digitFontSize}px`,
|
|
79
|
+
color: e.block.digitColor
|
|
80
|
+
}) }, r(e.block.expiredMessage), 5)], 4)) : (i(), f("div", {
|
|
81
|
+
key: 3,
|
|
82
|
+
style: l(w.value),
|
|
83
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:py-4"
|
|
84
|
+
}, [(i(!0), f(s, null, n(C.value, (t, n) => (i(), f(s, { key: t.label }, [n > 0 ? (i(), f("span", {
|
|
85
|
+
key: 0,
|
|
86
|
+
style: l(D.value),
|
|
87
|
+
class: "tpl:self-start"
|
|
88
|
+
}, r(e.block.separator), 5)) : a("", !0), c("div", _, [c("div", { style: l(T.value) }, r(t.value), 5), c("div", { style: l(E.value) }, r(t.label), 5)])], 64))), 128))], 4)) : (i(), f("div", h, r(d(v).countdown.setDate), 1));
|
|
89
|
+
}
|
|
90
|
+
}), y = /* @__PURE__ */ e({ default: () => b }), b = v;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { y as n, b as t };
|