@aswin.dev/editor 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/AccessibilityPanel-CvQGLdu6.js +108 -0
  2. package/dist/AiChatSidebar-B3SJIKG_.js +229 -0
  3. package/dist/AiFeatureMenu-BLLKoOos.js +63 -0
  4. package/dist/BlockA11yBadge-CXDLqkcJ.js +34 -0
  5. package/dist/CloudEditor-BCz1ZTYC.js +1172 -0
  6. package/dist/CollaboratorBar-DuPYW5iF.js +95 -0
  7. package/dist/CommentsSidebar-B1pvJdqF.js +441 -0
  8. package/dist/CountdownBlock-BNSj1jvJ.js +92 -0
  9. package/dist/CountdownToolbar-ClJr2GzL.js +210 -0
  10. package/dist/DesignReferenceSidebar-B8V_F2yF.js +276 -0
  11. package/dist/LoadingTrack-B0CWFHXQ.js +10 -0
  12. package/dist/ModuleBrowserModal-DrUFMTDx.js +206 -0
  13. package/dist/ModulePreviewCanvas-CHdOwV_4.js +106 -0
  14. package/dist/NumberWithSuffix-DkXUez9t.js +422 -0
  15. package/dist/ParagraphEditor-D75wl3BX.js +695 -0
  16. package/dist/RichTextEditorContent-DYkIauIk.js +137 -0
  17. package/dist/SaveModuleDialog-FZ9lxY7_.js +123 -0
  18. package/dist/SnapshotHistory-BR3eV120.js +127 -0
  19. package/dist/TemplateScoringPanel-4GTNHej5.js +256 -0
  20. package/dist/TestEmailModal--ue5w9fT.js +94 -0
  21. package/dist/TitleEditor-fStSADI-.js +172 -0
  22. package/dist/TplModal-BwSfxIHf.js +44 -0
  23. package/dist/_plugin-vue_export-helper-B0hnzhyu.js +8 -0
  24. package/dist/accessibility-e8JYu_zd.js +27 -0
  25. package/dist/blockTypeIcons-BcTrDjmH.js +126 -0
  26. package/dist/bundle-stats.json +10 -0
  27. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +97 -0
  28. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +1 -0
  29. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +59 -0
  30. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +1 -0
  31. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +33 -0
  32. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +1 -0
  33. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +1143 -0
  34. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +1 -0
  35. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +51 -0
  36. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +1 -0
  37. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +93 -0
  38. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +1 -0
  39. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +212 -0
  40. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +1 -0
  41. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +195 -0
  42. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +1 -0
  43. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +107 -0
  44. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +1 -0
  45. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +423 -0
  46. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +1 -0
  47. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +544 -0
  48. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +1 -0
  49. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +106 -0
  50. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +1 -0
  51. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +119 -0
  52. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +1 -0
  53. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +171 -0
  54. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +1 -0
  55. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +22 -0
  56. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +1 -0
  57. package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
  58. package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
  59. package/dist/cdn/chunks/de-D8CnZxV9.js +523 -0
  60. package/dist/cdn/chunks/de-D8CnZxV9.js.map +1 -0
  61. package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
  62. package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
  63. package/dist/cdn/chunks/draggable-Bcb86AsV.js +11572 -0
  64. package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
  65. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
  66. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
  67. package/dist/cdn/chunks/en-8FHaQv4V.js +523 -0
  68. package/dist/cdn/chunks/en-8FHaQv4V.js.map +1 -0
  69. package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
  70. package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
  71. package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
  72. package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
  73. package/dist/cdn/chunks/extensions-DIxF31tA.js +598 -0
  74. package/dist/cdn/chunks/extensions-DIxF31tA.js.map +1 -0
  75. package/dist/cdn/chunks/features-DEMb13KS.js +6814 -0
  76. package/dist/cdn/chunks/features-DEMb13KS.js.map +1 -0
  77. package/dist/cdn/chunks/icons-CsLTcirh.js +700 -0
  78. package/dist/cdn/chunks/icons-CsLTcirh.js.map +1 -0
  79. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
  80. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
  81. package/dist/cdn/chunks/media-library-CVaNvhpM.js +6014 -0
  82. package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +1 -0
  83. package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
  84. package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
  85. package/dist/cdn/chunks/quality-BaBfc54_.js +1456 -0
  86. package/dist/cdn/chunks/quality-BaBfc54_.js.map +1 -0
  87. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  88. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  89. package/dist/cdn/chunks/renderer-CUxvx7ro.js +548 -0
  90. package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +1 -0
  91. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  92. package/dist/cdn/chunks/src-CRaqN-p8.js +497 -0
  93. package/dist/cdn/chunks/src-CRaqN-p8.js.map +1 -0
  94. package/dist/cdn/chunks/styleConstants-DP1VOca8.js +57 -0
  95. package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +1 -0
  96. package/dist/cdn/chunks/styles-BHJULjNR.js +2947 -0
  97. package/dist/cdn/chunks/styles-BHJULjNR.js.map +1 -0
  98. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +14654 -0
  99. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +1 -0
  100. package/dist/cdn/editor.css +2 -0
  101. package/dist/cdn/editor.js +250 -0
  102. package/dist/cdn/editor.js.map +1 -0
  103. package/dist/check-Da05j8yl.js +7 -0
  104. package/dist/chevron-down-R2uY34iD.js +7 -0
  105. package/dist/circle-alert-DZuGWPX-.js +25 -0
  106. package/dist/clock-CRp2sIub.js +12 -0
  107. package/dist/cloud-DEk_b4CR.js +1733 -0
  108. package/dist/createLucideIcon-C3pa2siy.js +43 -0
  109. package/dist/de-Brqvgr43.js +521 -0
  110. package/dist/de-DCaaCE5s.js +207 -0
  111. package/dist/dist-B1IR0bpH.js +326 -0
  112. package/dist/dist-BFawx6IS.js +519 -0
  113. package/dist/dist-BaQIYPsn.js +35 -0
  114. package/dist/dist-Cp0zXPAD.js +189 -0
  115. package/dist/dist-D6uC2xhi.js +5 -0
  116. package/dist/dist-D90y8dvT.js +2082 -0
  117. package/dist/dist-DDJIWTRY.js +776 -0
  118. package/dist/dist-DJmnUmW9.js +362 -0
  119. package/dist/dist-DjviJBCi.js +74 -0
  120. package/dist/dist-KoBJjK1G.js +61 -0
  121. package/dist/dist-aRzjfSRN.js +35 -0
  122. package/dist/dist-iLBdeBDR.js +10658 -0
  123. package/dist/dist-us-RpCWN.js +47 -0
  124. package/dist/dist-wzMIGj-D.js +5 -0
  125. package/dist/emojiData-PQyVa4bU.js +17 -0
  126. package/dist/en-DXCyK4-X.js +207 -0
  127. package/dist/en-WDVp87TE.js +521 -0
  128. package/dist/extensions-CUcl9Ok4.js +799 -0
  129. package/dist/formatRelativeTime-BOEf47hq.js +12 -0
  130. package/dist/image-up-MBZKKg9p.js +23 -0
  131. package/dist/index.d.ts +275 -0
  132. package/dist/info-CJEC7piy.js +19 -0
  133. package/dist/keys-ciNfSSGj.js +10 -0
  134. package/dist/liquid.browser-CdMv1BTn.js +3277 -0
  135. package/dist/loader-circle-DsY5Yg33.js +7 -0
  136. package/dist/message-circle-yElBbR2C.js +7 -0
  137. package/dist/readableTextColor-CY3SiRnt.js +30 -0
  138. package/dist/refresh-cw-CE_AGtn8.js +29 -0
  139. package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
  140. package/dist/scan-line-D0vcUekt.js +25 -0
  141. package/dist/send-DH4oDQqC.js +10 -0
  142. package/dist/shield-check-CfJgs2Hd.js +10 -0
  143. package/dist/sparkles-CvRXGqFs.js +23 -0
  144. package/dist/style.css +2 -0
  145. package/dist/styleConstants-fWzlIIwN.js +55 -0
  146. package/dist/styles-DEXEkBvg.js +3176 -0
  147. package/dist/templatical-editor.js +249 -0
  148. package/dist/text-align-start-BT9VUDxK.js +43 -0
  149. package/dist/timeouts-BSGxjuUF.js +4 -0
  150. package/dist/trash-2-DbP2Y6t2.js +25 -0
  151. package/dist/triangle-alert-aOXceTSe.js +17 -0
  152. package/dist/useCloudI18n-BuIwR6OE.js +23 -0
  153. package/dist/useEditorCore-C6ost42Q.js +9342 -0
  154. package/dist/useI18n-lb2DHDiu.js +17 -0
  155. package/dist/useMergeTag-CBwKnnNB.js +34 -0
  156. package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +5775 -0
  157. package/dist/x-u2oVmjN_.js +10 -0
  158. package/package.json +1 -1
@@ -0,0 +1,95 @@
1
+ import { M as e, Mt as t, Ot as n, P as r, S as i, _ as a, d as o, g as s, h as c, it as l, m as u, p as d } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
2
+ import "./useEditorCore-C6ost42Q.js";
3
+ import { t as f } from "./createLucideIcon-C3pa2siy.js";
4
+ import { n as p } from "./useCloudI18n-BuIwR6OE.js";
5
+ import { t as m } from "./readableTextColor-CY3SiRnt.js";
6
+ var h = f("wifi-off", [
7
+ ["path", {
8
+ d: "M12 20h.01",
9
+ key: "zekei9"
10
+ }],
11
+ ["path", {
12
+ d: "M8.5 16.429a5 5 0 0 1 7 0",
13
+ key: "1bycff"
14
+ }],
15
+ ["path", {
16
+ d: "M5 12.859a10 10 0 0 1 5.17-2.69",
17
+ key: "1dl1wf"
18
+ }],
19
+ ["path", {
20
+ d: "M19 12.859a10 10 0 0 0-2.007-1.523",
21
+ key: "4k23kn"
22
+ }],
23
+ ["path", {
24
+ d: "M2 8.82a15 15 0 0 1 4.177-2.643",
25
+ key: "1grhjp"
26
+ }],
27
+ ["path", {
28
+ d: "M22 8.82a15 15 0 0 0-11.288-3.764",
29
+ key: "z3jwby"
30
+ }],
31
+ ["path", {
32
+ d: "m2 2 20 20",
33
+ key: "1ooewy"
34
+ }]
35
+ ]), g = f("wifi", [
36
+ ["path", {
37
+ d: "M12 20h.01",
38
+ key: "zekei9"
39
+ }],
40
+ ["path", {
41
+ d: "M2 8.82a15 15 0 0 1 20 0",
42
+ key: "dnpr2z"
43
+ }],
44
+ ["path", {
45
+ d: "M5 12.859a10 10 0 0 1 14 0",
46
+ key: "1x1e6c"
47
+ }],
48
+ ["path", {
49
+ d: "M8.5 16.429a5 5 0 0 1 7 0",
50
+ key: "1bycff"
51
+ }]
52
+ ]), _ = { class: "tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2" }, v = ["title"], y = {
53
+ key: 0,
54
+ class: "tpl:flex tpl:items-center tpl:-space-x-1.5"
55
+ }, b = ["title"], x = ["title"], S = 3, C = /* @__PURE__ */ i({
56
+ __name: "CollaboratorBar",
57
+ props: {
58
+ collaborators: {},
59
+ isConnected: { type: Boolean }
60
+ },
61
+ setup(i) {
62
+ let f = i, { t: C } = p(), w = d(() => f.collaborators.slice(0, S)), T = d(() => f.collaborators.slice(S)), E = d(() => T.value.length), D = d(() => T.value.map((e) => e.name).join("\n"));
63
+ function O(e) {
64
+ let t = e.trim().split(/\s+/);
65
+ return t.length >= 2 ? (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase() : e.charAt(0).toUpperCase();
66
+ }
67
+ return (d, f) => (e(), a("div", _, [u("div", {
68
+ class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",
69
+ style: n({ color: i.isConnected ? "var(--tpl-success)" : "var(--tpl-text-muted)" }),
70
+ title: i.isConnected ? l(C).collaboration.connected : l(C).collaboration.disconnected
71
+ }, [i.isConnected ? (e(), c(l(g), {
72
+ key: 0,
73
+ size: 12,
74
+ "stroke-width": 2
75
+ })) : (e(), c(l(h), {
76
+ key: 1,
77
+ size: 12,
78
+ "stroke-width": 2
79
+ }))], 12, v), i.collaborators.length > 0 ? (e(), a("div", y, [(e(!0), a(o, null, r(w.value, (r) => (e(), a("div", {
80
+ key: r.id,
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: n({
83
+ backgroundColor: r.color,
84
+ color: l(m)(r.color)
85
+ }),
86
+ title: r.name
87
+ }, t(O(r.name)), 13, b))), 128)), E.value > 0 ? (e(), a("div", {
88
+ key: 0,
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
+ title: D.value
91
+ }, " +" + t(E.value), 9, x)) : s("", !0)])) : s("", !0)]));
92
+ }
93
+ });
94
+ //#endregion
95
+ export { C as default };
@@ -0,0 +1,441 @@
1
+ import { Dt as e, H as t, M as n, Mt as r, O as i, Ot as a, P as o, Q as s, S as c, V as l, _ as u, b as d, d as f, g as p, h as m, it as h, m as g, p as _, s as v, t as y, y as ee, z as b } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
2
+ import { O as x, i as te, m as ne, u as re } from "./keys-ciNfSSGj.js";
3
+ import { t as ie } from "./useI18n-lb2DHDiu.js";
4
+ import { t as S } from "./createLucideIcon-C3pa2siy.js";
5
+ import { t as ae } from "./check-Da05j8yl.js";
6
+ import { t as oe } from "./chevron-down-R2uY34iD.js";
7
+ import { t as C } from "./loader-circle-DsY5Yg33.js";
8
+ import { t as w } from "./message-circle-yElBbR2C.js";
9
+ import { t as T } from "./send-DH4oDQqC.js";
10
+ import { t as E } from "./trash-2-DbP2Y6t2.js";
11
+ import { t as D } from "./x-u2oVmjN_.js";
12
+ import { t as O } from "./_plugin-vue_export-helper-B0hnzhyu.js";
13
+ import { n as se } from "./useCloudI18n-BuIwR6OE.js";
14
+ import { t as ce } from "./formatRelativeTime-BOEf47hq.js";
15
+ var le = S("chevron-up", [["path", {
16
+ d: "m18 15-6-6-6 6",
17
+ key: "153udz"
18
+ }]]), ue = S("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
+ }]]), k = S("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
+ }]]), de = S("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
+ }]]), fe = {
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
+ }, pe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, me = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]" }, he = {
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
+ }, ge = { class: "tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2" }, _e = { class: "tpl:flex-1 tpl:overflow-y-auto" }, ve = {
45
+ key: 0,
46
+ class: "tpl:flex tpl:h-full tpl:items-center tpl:justify-center"
47
+ }, ye = {
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
+ }, be = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, xe = {
51
+ key: 2,
52
+ class: "tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3"
53
+ }, Se = { class: "tpl-comment-card tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-3" }, Ce = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, we = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Te = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ee = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, De = {
54
+ key: 0,
55
+ class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
56
+ }, Oe = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, ke = ["title", "onClick"], Ae = ["title", "onClick"], je = ["title", "onClick"], Me = {
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
+ }, Ne = {
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
+ }, Pe = ["onClick"], Fe = {
63
+ key: 2,
64
+ class: "tpl:mt-2"
65
+ }, Ie = ["onKeydown"], Le = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, Re = ["disabled", "onClick"], ze = {
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
+ }, Be = {
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
+ }, Ve = { class: "tpl:flex-1" }, He = ["onClick"], Ue = {
72
+ key: 5,
73
+ class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2"
74
+ }, We = ["title", "onClick"], Ge = ["onClick"], Ke = {
75
+ key: 0,
76
+ class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
77
+ }, qe = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, Je = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Ye = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Xe = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, Ze = {
78
+ key: 0,
79
+ class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
80
+ }, Qe = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, $e = ["title", "onClick"], et = ["title", "onClick"], tt = {
81
+ key: 0,
82
+ class: "tpl:mt-1.5"
83
+ }, nt = ["onKeydown"], rt = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, it = ["disabled", "onClick"], at = {
84
+ key: 1,
85
+ class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
86
+ }, ot = {
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
+ }, st = { class: "tpl:flex-1" }, ct = ["onClick"], lt = {
90
+ key: 0,
91
+ class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
92
+ }, ut = { class: "tpl:flex tpl:items-end tpl:gap-2" }, dt = ["placeholder", "onKeydown"], ft = { class: "tpl:flex tpl:shrink-0 tpl:flex-col tpl:gap-1" }, pt = ["disabled", "onClick"], mt = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, ht = {
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
+ }, gt = {
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
+ }, _t = ["placeholder", "disabled"], vt = ["disabled"], A = /* @__PURE__ */ O(/* @__PURE__ */ c({
99
+ __name: "CommentsSidebar",
100
+ props: { visible: { type: Boolean } },
101
+ emits: ["close", "filterBlock"],
102
+ setup(c, { expose: S, emit: O }) {
103
+ let A = c, j = O, { format: M } = ie(), { t: N } = se(), P = x(ne, "CommentsSidebar"), yt = x(te, "CommentsSidebar"), F = x(re, "CommentsSidebar"), I = s("unresolved"), L = s(null), R = s(""), z = s(null), B = s(""), V = s(null), H = s(""), U = s(/* @__PURE__ */ new Set()), W = s(null), G = s(null), bt = _(() => yt.userConfig?.id ?? null), xt = _(() => {
104
+ let e = /* @__PURE__ */ new Set();
105
+ for (let t of P.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 St(e) {
109
+ return e ? !xt.value.has(e) : !1;
110
+ }
111
+ let Ct = _(() => I.value !== "block" || !L.value ? !1 : !(P.savedBlockIds?.value.has(L.value) ?? !0)), K = _(() => {
112
+ let e = F.comments.value;
113
+ return I.value === "unresolved" ? e = e.filter((e) => !e.resolved_at) : I.value === "block" && L.value && (e = e.filter((e) => e.block_id === L.value)), e;
114
+ });
115
+ b(() => A.visible, (e) => {
116
+ e && F.loadComments();
117
+ }), b(() => P.state.selectedBlockId, (e) => {
118
+ I.value === "block" && e && (L.value = e);
119
+ });
120
+ function q(e, t) {
121
+ I.value = e, L.value = e === "block" ? t ?? null : null;
122
+ }
123
+ function wt(e) {
124
+ q("block", e), j("filterBlock", e);
125
+ }
126
+ function Tt(e) {
127
+ U.value.has(e) ? U.value.delete(e) : U.value.add(e);
128
+ }
129
+ function Et(e) {
130
+ z.value = e, B.value = "", V.value = null, U.value.has(e) || U.value.add(e);
131
+ }
132
+ function Dt() {
133
+ z.value = null, B.value = "";
134
+ }
135
+ function J(e) {
136
+ V.value = e.id, H.value = e.body, z.value = null;
137
+ }
138
+ function Y() {
139
+ V.value = null, H.value = "";
140
+ }
141
+ function X(e) {
142
+ W.value = e;
143
+ }
144
+ function Ot() {
145
+ W.value = null;
146
+ }
147
+ async function Z() {
148
+ let e = R.value.trim();
149
+ if (!e) return;
150
+ let t = I.value === "block" ? L.value : void 0;
151
+ await F.addComment(e, t ?? void 0), R.value = "";
152
+ }
153
+ async function kt(e) {
154
+ let t = B.value.trim();
155
+ if (!t) return;
156
+ let n = F.comments.value.find((t) => t.id === e);
157
+ await F.addComment(t, n?.block_id ?? void 0, e), z.value = null, B.value = "";
158
+ }
159
+ async function Q(e) {
160
+ let t = H.value.trim();
161
+ t && (await F.editComment(e, t), V.value = null, H.value = "");
162
+ }
163
+ async function At(e) {
164
+ await F.removeComment(e), W.value = null;
165
+ }
166
+ async function jt(e) {
167
+ await F.toggleResolve(e);
168
+ }
169
+ function $(e) {
170
+ return e.author_identifier === bt.value;
171
+ }
172
+ function Mt(e) {
173
+ return ce(e, N.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" && Y();
183
+ }
184
+ function It() {
185
+ i(() => {
186
+ G.value?.focus();
187
+ });
188
+ }
189
+ return S({
190
+ filterByBlock: wt,
191
+ focusNewComment: It
192
+ }), (i, s) => (n(), m(y, {
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: l(() => [c.visible ? (n(), u("div", fe, [
201
+ g("div", pe, [g("div", me, [
202
+ d(h(w), {
203
+ size: 13,
204
+ "stroke-width": 2
205
+ }),
206
+ g("span", null, r(h(N).comments.title), 1),
207
+ h(F).unresolvedCount.value > 0 ? (n(), u("span", he, r(h(F).unresolvedCount.value), 1)) : p("", !0)
208
+ ]), g("button", {
209
+ class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
210
+ onClick: s[0] ||= (e) => j("close")
211
+ }, [d(h(D), {
212
+ size: 14,
213
+ "stroke-width": 2
214
+ })])]),
215
+ g("div", ge, [
216
+ g("button", {
217
+ 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", I.value === "unresolved" ? "tpl-comment-filter--active" : ""]),
218
+ onClick: s[1] ||= (e) => q("unresolved")
219
+ }, r(h(N).comments.filterUnresolved), 3),
220
+ g("button", {
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", I.value === "all" ? "tpl-comment-filter--active" : ""]),
222
+ onClick: s[2] ||= (e) => q("all")
223
+ }, r(h(N).comments.filterAll), 3),
224
+ h(P).state.selectedBlockId ? (n(), u("button", {
225
+ key: 0,
226
+ 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", I.value === "block" ? "tpl-comment-filter--active" : ""]),
227
+ onClick: s[3] ||= (e) => q("block", h(P).state.selectedBlockId ?? void 0)
228
+ }, r(h(N).comments.filterBlock), 3)) : p("", !0)
229
+ ]),
230
+ g("div", _e, [h(F).isLoading.value ? (n(), u("div", ve, [d(h(C), {
231
+ class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
232
+ size: 24,
233
+ "stroke-width": 2
234
+ })])) : K.value.length === 0 ? (n(), u("div", ye, [d(h(w), {
235
+ size: 32,
236
+ "stroke-width": 1.5,
237
+ class: "tpl:text-[var(--tpl-text-dim)]"
238
+ }), g("p", be, r(I.value === "all" ? h(N).comments.noCommentsHint : h(N).comments.noComments), 1)])) : (n(), u("div", xe, [(n(!0), u(f, null, o(K.value, (i) => (n(), u("div", {
239
+ key: i.id,
240
+ class: "tpl-comment-thread"
241
+ }, [
242
+ g("div", Se, [
243
+ g("div", Ce, [g("div", we, [
244
+ g("span", Te, r($(i) ? h(N).comments.ownedByYou : i.author_name), 1),
245
+ g("span", Ee, r(Mt(i.created_at)), 1),
246
+ i.updated_at === i.created_at ? p("", !0) : (n(), u("span", De, " (" + r(h(N).comments.edited) + ") ", 1))
247
+ ]), g("div", Oe, [
248
+ g("button", {
249
+ class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
250
+ title: i.resolved_at ? h(N).comments.unresolve : h(N).comments.resolve,
251
+ onClick: (e) => jt(i.id)
252
+ }, [d(h(ue), {
253
+ size: 13,
254
+ "stroke-width": 2,
255
+ class: "tpl-resolve-icon",
256
+ style: a({ color: i.resolved_at ? "var(--tpl-primary)" : void 0 })
257
+ }, null, 8, ["style"])], 8, ke),
258
+ $(i) ? (n(), u("button", {
259
+ key: 0,
260
+ class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
261
+ title: h(N).comments.edit,
262
+ onClick: (e) => J(i)
263
+ }, [d(h(k), {
264
+ size: 12,
265
+ "stroke-width": 2
266
+ })], 8, Ae)) : p("", !0),
267
+ $(i) ? (n(), u("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(N).comments.delete,
271
+ onClick: (e) => X(i.id)
272
+ }, [d(h(E), {
273
+ size: 12,
274
+ "stroke-width": 2
275
+ })], 8, je)) : p("", !0)
276
+ ])]),
277
+ d(y, { name: "tpl-resolve" }, {
278
+ default: l(() => [i.resolved_at ? (n(), u("div", Me, [d(h(ae), {
279
+ size: 10,
280
+ "stroke-width": 2.5
281
+ }), g("span", null, r(h(M)(h(N).comments.resolvedBy, { name: i.resolved_by_name ?? "" })), 1)])) : p("", !0)]),
282
+ _: 2
283
+ }, 1024),
284
+ i.block_id && St(i.block_id) ? (n(), u("span", Ne, r(h(N).comments.missingBlock), 1)) : i.block_id ? (n(), u("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(P).selectBlock(i.block_id ?? "")
288
+ }, " Block ", 8, Pe)) : p("", !0),
289
+ V.value === i.id ? (n(), u("div", Fe, [t(g("textarea", {
290
+ "onUpdate:modelValue": s[4] ||= (e) => H.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, i.id)
294
+ }, null, 40, Ie), [[v, H.value]]), g("div", Le, [g("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: !H.value.trim() || h(F).isSubmitting.value,
297
+ onClick: (e) => Q(i.id)
298
+ }, r(h(N).comments.save), 9, Re), g("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: s[5] ||= (e) => Y()
301
+ }, r(h(N).comments.cancel), 1)])])) : (n(), u("p", ze, r(i.body), 1)),
302
+ W.value === i.id ? (n(), u("div", Be, [
303
+ g("span", Ve, r(h(N).comments.deleteConfirm), 1),
304
+ g("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(i.id)
307
+ }, r(h(N).comments.delete), 9, He),
308
+ g("button", {
309
+ class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
310
+ onClick: s[6] ||= (e) => Ot()
311
+ }, r(h(N).comments.cancel), 1)
312
+ ])) : p("", !0),
313
+ V.value !== i.id && W.value !== i.id ? (n(), u("div", Ue, [g("button", {
314
+ class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
315
+ title: h(N).comments.reply,
316
+ onClick: (e) => Et(i.id)
317
+ }, [d(h(de), {
318
+ size: 13,
319
+ "stroke-width": 2,
320
+ class: "tpl:text-[var(--tpl-primary)]"
321
+ })], 8, We), (i.replies?.length ?? 0) > 0 ? (n(), u("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) => Tt(i.id)
325
+ }, [U.value.has(i.id) ? (n(), m(h(le), {
326
+ key: 0,
327
+ size: 11,
328
+ "stroke-width": 2
329
+ })) : (n(), m(h(oe), {
330
+ key: 1,
331
+ size: 11,
332
+ "stroke-width": 2
333
+ })), ee(" " + r((i.replies?.length ?? 0) === 1 ? h(M)(h(N).comments.replyOne, { count: String(i.replies?.length ?? 0) }) : h(M)(h(N).comments.replyMany, { count: String(i.replies?.length ?? 0) })), 1)], 8, Ge)) : p("", !0)])) : p("", !0)
334
+ ]),
335
+ d(y, { name: "tpl-replies" }, {
336
+ default: l(() => [U.value.has(i.id) && (i.replies?.length ?? 0) > 0 ? (n(), u("div", Ke, [(n(!0), u(f, null, o(i.replies, (a, o) => (n(), u("div", {
337
+ key: a.id,
338
+ class: e(["tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5", o < (i.replies?.length ?? 0) - 1 ? "tpl:mb-2" : ""])
339
+ }, [
340
+ g("div", qe, [g("div", Je, [
341
+ g("span", Ye, r($(a) ? h(N).comments.ownedByYou : a.author_name), 1),
342
+ g("span", Xe, r(Mt(a.created_at)), 1),
343
+ a.updated_at === a.created_at ? p("", !0) : (n(), u("span", Ze, " (" + r(h(N).comments.edited) + ") ", 1))
344
+ ]), g("div", Qe, [$(a) ? (n(), u("button", {
345
+ key: 0,
346
+ class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
347
+ title: h(N).comments.edit,
348
+ onClick: (e) => J(a)
349
+ }, [d(h(k), {
350
+ size: 11,
351
+ "stroke-width": 2
352
+ })], 8, $e)) : p("", !0), $(a) ? (n(), u("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(N).comments.delete,
356
+ onClick: (e) => X(a.id)
357
+ }, [d(h(E), {
358
+ size: 11,
359
+ "stroke-width": 2
360
+ })], 8, et)) : p("", !0)])]),
361
+ V.value === a.id ? (n(), u("div", tt, [t(g("textarea", {
362
+ "onUpdate:modelValue": s[7] ||= (e) => H.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, a.id)
366
+ }, null, 40, nt), [[v, H.value]]), g("div", rt, [g("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: !H.value.trim() || h(F).isSubmitting.value,
369
+ onClick: (e) => Q(a.id)
370
+ }, r(h(N).comments.save), 9, it), g("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: s[8] ||= (e) => Y()
373
+ }, r(h(N).comments.cancel), 1)])])) : (n(), u("p", at, r(a.body), 1)),
374
+ W.value === a.id ? (n(), u("div", ot, [
375
+ g("span", st, r(h(N).comments.deleteConfirm), 1),
376
+ g("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(a.id)
379
+ }, r(h(N).comments.delete), 9, ct),
380
+ g("button", {
381
+ class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
382
+ onClick: s[9] ||= (e) => Ot()
383
+ }, r(h(N).comments.cancel), 1)
384
+ ])) : p("", !0)
385
+ ], 2))), 128))])) : p("", !0)]),
386
+ _: 2
387
+ }, 1024),
388
+ d(y, { name: "tpl-replies" }, {
389
+ default: l(() => [z.value === i.id ? (n(), u("div", lt, [g("div", ut, [t(g("textarea", {
390
+ "onUpdate:modelValue": s[10] ||= (e) => B.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(N).comments.replyPlaceholder,
393
+ rows: "2",
394
+ onKeydown: (e) => Pt(e, i.id)
395
+ }, null, 40, dt), [[v, B.value]]), g("div", ft, [g("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: !B.value.trim() || h(F).isSubmitting.value,
398
+ onClick: (e) => kt(i.id)
399
+ }, [d(h(T), {
400
+ size: 14,
401
+ "stroke-width": 2
402
+ })], 8, pt), g("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: s[11] ||= (e) => Dt()
405
+ }, [d(h(D), {
406
+ size: 14,
407
+ "stroke-width": 2
408
+ })])])])])) : p("", !0)]),
409
+ _: 2
410
+ }, 1024)
411
+ ]))), 128))]))]),
412
+ g("div", mt, [Ct.value ? (n(), u("div", ht, r(h(N).comments.saveTemplateFirst), 1)) : (n(), u("div", gt, [t(g("textarea", {
413
+ ref_key: "newCommentInput",
414
+ ref: G,
415
+ "onUpdate:modelValue": s[12] ||= (e) => R.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(N).comments.placeholder,
418
+ disabled: h(F).isSubmitting.value,
419
+ rows: "2",
420
+ onKeydown: Nt
421
+ }, null, 40, _t), [[v, R.value]]), g("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: !R.value.trim() || h(F).isSubmitting.value,
424
+ onClick: Z
425
+ }, [h(F).isSubmitting.value ? (n(), m(h(C), {
426
+ key: 0,
427
+ class: "tpl-spinner",
428
+ size: 16,
429
+ "stroke-width": 2
430
+ })) : (n(), m(h(T), {
431
+ key: 1,
432
+ size: 16,
433
+ "stroke-width": 2
434
+ }))], 8, vt)]))])
435
+ ])) : p("", !0)]),
436
+ _: 1
437
+ }));
438
+ }
439
+ }), [["__scopeId", "data-v-d204f573"]]);
440
+ //#endregion
441
+ export { A as default };
@@ -0,0 +1,92 @@
1
+ import { r as e } from "./rolldown-runtime-BZGGJVDF.js";
2
+ import { M as t, Mt as n, Ot as r, P as i, Q as a, S as o, _ as s, d as c, g as l, it as u, m as d, p as f } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
3
+ import { o as p } from "./dist-B1IR0bpH.js";
4
+ import { t as m } from "./useI18n-lb2DHDiu.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__ */ o({
13
+ __name: "CountdownBlock",
14
+ props: {
15
+ block: {},
16
+ viewport: {}
17
+ },
18
+ setup(e) {
19
+ let o = e, { t: v } = m(), y = a(Date.now());
20
+ p(() => {
21
+ y.value = Date.now();
22
+ }, 1e3);
23
+ let b = f(() => {
24
+ if (!o.block.targetDate) return null;
25
+ let e = new Date(o.block.targetDate);
26
+ return isNaN(e.getTime()) ? null : e.getTime();
27
+ }), x = f(() => b.value ? y.value >= b.value : !1), S = f(() => {
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 = f(() => {
42
+ let e = [];
43
+ return o.block.showDays && e.push({
44
+ value: String(S.value.days).padStart(2, "0"),
45
+ label: o.block.labelDays
46
+ }), o.block.showHours && e.push({
47
+ value: String(S.value.hours).padStart(2, "0"),
48
+ label: o.block.labelHours
49
+ }), o.block.showMinutes && e.push({
50
+ value: String(S.value.minutes).padStart(2, "0"),
51
+ label: o.block.labelMinutes
52
+ }), o.block.showSeconds && e.push({
53
+ value: String(S.value.seconds).padStart(2, "0"),
54
+ label: o.block.labelSeconds
55
+ }), e;
56
+ }), w = f(() => ({
57
+ backgroundColor: o.block.backgroundColor,
58
+ fontFamily: o.block.fontFamily || "inherit"
59
+ })), T = f(() => ({
60
+ fontSize: `${o.block.digitFontSize}px`,
61
+ fontWeight: "bold",
62
+ color: o.block.digitColor,
63
+ lineHeight: "1.2"
64
+ })), E = f(() => ({
65
+ fontSize: `${o.block.labelFontSize}px`,
66
+ color: o.block.labelColor,
67
+ marginTop: "4px"
68
+ })), D = f(() => ({
69
+ fontSize: `${o.block.digitFontSize}px`,
70
+ color: o.block.digitColor,
71
+ fontFamily: o.block.fontFamily || "inherit"
72
+ }));
73
+ return (a, o) => e.block.targetDate ? x.value && e.block.hideOnExpiry ? (t(), s("div", g, n(u(v).countdown.hidden), 1)) : x.value ? (t(), s("div", {
74
+ key: 2,
75
+ style: r(w.value),
76
+ class: "tpl:py-4 tpl:text-center"
77
+ }, [d("span", { style: r({
78
+ fontSize: `${e.block.digitFontSize}px`,
79
+ color: e.block.digitColor
80
+ }) }, n(e.block.expiredMessage), 5)], 4)) : (t(), s("div", {
81
+ key: 3,
82
+ style: r(w.value),
83
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:py-4"
84
+ }, [(t(!0), s(c, null, i(C.value, (i, a) => (t(), s(c, { key: i.label }, [a > 0 ? (t(), s("span", {
85
+ key: 0,
86
+ style: r(D.value),
87
+ class: "tpl:self-start"
88
+ }, n(e.block.separator), 5)) : l("", !0), d("div", _, [d("div", { style: r(T.value) }, n(i.value), 5), d("div", { style: r(E.value) }, n(i.label), 5)])], 64))), 128))], 4)) : (t(), s("div", h, n(u(v).countdown.setDate), 1));
89
+ }
90
+ }), y = /* @__PURE__ */ e({ default: () => b }), b = v;
91
+ //#endregion
92
+ export { y as n, b as t };