@templatical/editor 0.0.1 → 0.0.3

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 (130) hide show
  1. package/dist/AiChatSidebar-busJk9hm.js +214 -0
  2. package/dist/AiFeatureMenu-DLGv_-pj.js +63 -0
  3. package/dist/CloudEditor-BDnHd6Um.js +919 -0
  4. package/dist/CollaboratorBar-Dv3l52vC.js +91 -0
  5. package/dist/CommentsSidebar-4tjp0VU5.js +439 -0
  6. package/dist/DesignReferenceSidebar-CmwXvltV.js +273 -0
  7. package/dist/LoadingTrack-vK8W2PJf.js +10 -0
  8. package/dist/ModuleBrowserModal-lrk3Fr0H.js +205 -0
  9. package/dist/ModulePreviewCanvas-BcBJLnwL.js +106 -0
  10. package/dist/ParagraphEditor-DH8cSC6m.js +625 -0
  11. package/dist/RichTextEditorContent-CQqodi7p.js +133 -0
  12. package/dist/SaveModuleDialog-Bmzi72td.js +122 -0
  13. package/dist/SnapshotHistory-AEgi9Xsn.js +126 -0
  14. package/dist/TemplateScoringPanel-CTgMtc0-.js +249 -0
  15. package/dist/TestEmailModal-Dpq1is9S.js +94 -0
  16. package/dist/TitleEditor-CLcDdcWI.js +167 -0
  17. package/dist/TplModal-CGzRjR96.js +44 -0
  18. package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
  19. package/dist/blockTypeIcons-BpPTqcok.js +126 -0
  20. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +3 -0
  21. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +1 -0
  22. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +2 -0
  23. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +1 -0
  24. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +3 -0
  25. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +1 -0
  26. package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
  27. package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
  28. package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
  29. package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
  30. package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
  31. package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
  32. package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
  33. package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
  34. package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
  35. package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
  36. package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
  37. package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
  38. package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
  39. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
  40. package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
  41. package/dist/cdn/chunks/extensions-ea_ewKUl.js +2 -0
  42. package/dist/cdn/chunks/extensions-ea_ewKUl.js.map +1 -0
  43. package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
  44. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
  45. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
  46. package/dist/cdn/chunks/styleConstants-CNejCb-L.js +2 -0
  47. package/dist/cdn/chunks/styleConstants-CNejCb-L.js.map +1 -0
  48. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
  49. package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
  50. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +2 -0
  51. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +1 -0
  52. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +2 -0
  53. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +1 -0
  54. package/dist/cdn/editor.css +1 -0
  55. package/dist/cdn/editor.js +2 -0
  56. package/dist/cdn/editor.js.map +1 -0
  57. package/dist/check-B7kDuZmP.js +7 -0
  58. package/dist/chevron-down-DJLW2Q9Z.js +7 -0
  59. package/dist/circle-alert-E2vYPs5r.js +25 -0
  60. package/dist/clock-lWIIQA3C.js +12 -0
  61. package/dist/de-B4Ob4vCo.js +682 -0
  62. package/dist/dist-4LiM9FDd.js +35 -0
  63. package/dist/dist-Bu7veieH.js +776 -0
  64. package/dist/dist-C1BIRHCQ.js +61 -0
  65. package/dist/dist-CG-vEqSU.js +314 -0
  66. package/dist/dist-C_ymrGFi.js +10625 -0
  67. package/dist/dist-ChAGLpWo.js +35 -0
  68. package/dist/dist-D_HQYSY-.js +189 -0
  69. package/dist/dist-DkypH7qG.js +5 -0
  70. package/dist/dist-DmOE-Ubp.js +74 -0
  71. package/dist/dist-DmpMJbmZ.js +513 -0
  72. package/dist/dist-DrvKRSU6.js +47 -0
  73. package/dist/dist-Dxnd0GRf.js +5 -0
  74. package/dist/dist-DysAFIPy.js +2054 -0
  75. package/dist/emojiData-BfWQS72m.js +17 -0
  76. package/dist/en-YXsspZJG.js +682 -0
  77. package/dist/extensions-CKM99njP.js +420 -0
  78. package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
  79. package/dist/i18n-CJsFtdbZ.js +23 -0
  80. package/dist/image-up-X4xIq4ea.js +23 -0
  81. package/dist/keys-Dwa2PmdD.js +10 -0
  82. package/dist/liquid.browser-BemTg3sZ.js +3272 -0
  83. package/dist/loader-circle-BTQQxC3l.js +7 -0
  84. package/dist/message-circle-Blgm6V_h.js +7 -0
  85. package/dist/refresh-cw-Bb4PEeW1.js +44 -0
  86. package/dist/scan-line-7lZPfOdm.js +25 -0
  87. package/dist/send-C0ltAQrv.js +10 -0
  88. package/dist/shield-check-f-qv4RKs.js +10 -0
  89. package/dist/sparkles-KhBCGlqB.js +23 -0
  90. package/dist/styleConstants-D4SOZGBV.js +94 -0
  91. package/dist/styles-DSw1VNU3.js +3406 -0
  92. package/dist/templatical-editor.css +2 -1
  93. package/dist/templatical-editor.js +242 -9
  94. package/dist/templatical-editor.umd.cjs +112 -524
  95. package/dist/timeouts-CmBrLeZA.js +4 -0
  96. package/dist/trash-2-OwjZ-guZ.js +25 -0
  97. package/dist/triangle-alert-DOSRIUYZ.js +17 -0
  98. package/dist/useEditorCore-Cc4RCwWq.js +5556 -0
  99. package/dist/useI18n-DUirdXEX.js +17 -0
  100. package/dist/useMergeTag-DVnlvPYJ.js +33 -0
  101. package/dist/x-CGlq2XQe.js +10 -0
  102. package/package.json +30 -20
  103. package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
  104. package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
  105. package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
  106. package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
  107. package/dist/CommentsSidebar-PVUlloyB.js +0 -655
  108. package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
  109. package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
  110. package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
  111. package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
  112. package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
  113. package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
  114. package/dist/TestEmailModal-Cwre5elw.js +0 -128
  115. package/dist/TextEditor-BuUOIByX.js +0 -780
  116. package/dist/de-BWIAblxs.js +0 -685
  117. package/dist/en-cYyUzNV1.js +0 -685
  118. package/dist/index-0tWUczNu.js +0 -47
  119. package/dist/index-4okvXjqk.js +0 -41
  120. package/dist/index-BSc6h5zo.js +0 -967
  121. package/dist/index-CrvwWlhN.js +0 -41
  122. package/dist/index-D-iD-7lO.js +0 -10961
  123. package/dist/index-D-ygXbc8.js +0 -2452
  124. package/dist/index-DbrWKz-e.js +0 -1415
  125. package/dist/index-DeUeHy6g.js +0 -422
  126. package/dist/index-Ude6e9RU.js +0 -41
  127. package/dist/index-ZQzHBwkr.js +0 -12767
  128. package/dist/liquid.browser-CeNxS2GL.js +0 -3493
  129. package/dist/loader-circle-tM9j2mRh.js +0 -13
  130. package/dist/shield-check-Ngi9jAQc.js +0 -20
@@ -0,0 +1,91 @@
1
+ import "./useEditorCore-Cc4RCwWq.js";
2
+ import { t as e } from "./useI18n-DUirdXEX.js";
3
+ import { n as t } from "./_plugin-vue_export-helper-B1-bu7yR.js";
4
+ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, normalizeStyle as l, openBlock as u, renderList as d, toDisplayString as f, unref as p } from "vue";
5
+ var m = t("wifi-off", [
6
+ ["path", {
7
+ d: "M12 20h.01",
8
+ key: "zekei9"
9
+ }],
10
+ ["path", {
11
+ d: "M8.5 16.429a5 5 0 0 1 7 0",
12
+ key: "1bycff"
13
+ }],
14
+ ["path", {
15
+ d: "M5 12.859a10 10 0 0 1 5.17-2.69",
16
+ key: "1dl1wf"
17
+ }],
18
+ ["path", {
19
+ d: "M19 12.859a10 10 0 0 0-2.007-1.523",
20
+ key: "4k23kn"
21
+ }],
22
+ ["path", {
23
+ d: "M2 8.82a15 15 0 0 1 4.177-2.643",
24
+ key: "1grhjp"
25
+ }],
26
+ ["path", {
27
+ d: "M22 8.82a15 15 0 0 0-11.288-3.764",
28
+ key: "z3jwby"
29
+ }],
30
+ ["path", {
31
+ d: "m2 2 20 20",
32
+ key: "1ooewy"
33
+ }]
34
+ ]), h = t("wifi", [
35
+ ["path", {
36
+ d: "M12 20h.01",
37
+ key: "zekei9"
38
+ }],
39
+ ["path", {
40
+ d: "M2 8.82a15 15 0 0 1 20 0",
41
+ key: "dnpr2z"
42
+ }],
43
+ ["path", {
44
+ d: "M5 12.859a10 10 0 0 1 14 0",
45
+ key: "1x1e6c"
46
+ }],
47
+ ["path", {
48
+ d: "M8.5 16.429a5 5 0 0 1 7 0",
49
+ key: "1bycff"
50
+ }]
51
+ ]), g = { class: "tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2" }, _ = ["title"], v = {
52
+ key: 0,
53
+ class: "tpl:flex tpl:items-center tpl:-space-x-1.5"
54
+ }, y = ["title"], b = ["title"], x = 3, S = /* @__PURE__ */ c({
55
+ __name: "CollaboratorBar",
56
+ props: {
57
+ collaborators: {},
58
+ isConnected: { type: Boolean }
59
+ },
60
+ setup(t) {
61
+ let c = t, { t: S } = e(), C = r(() => c.collaborators.slice(0, x)), w = r(() => c.collaborators.slice(x)), T = r(() => w.value.length), E = r(() => w.value.map((e) => e.name).join("\n"));
62
+ function D(e) {
63
+ let t = e.trim().split(/\s+/);
64
+ return t.length >= 2 ? (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase() : e.charAt(0).toUpperCase();
65
+ }
66
+ return (e, r) => (u(), o("div", g, [s("div", {
67
+ class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",
68
+ style: l({ color: t.isConnected ? "var(--tpl-success)" : "var(--tpl-text-muted)" }),
69
+ title: t.isConnected ? p(S).collaboration.connected : p(S).collaboration.disconnected
70
+ }, [t.isConnected ? (u(), i(p(h), {
71
+ key: 0,
72
+ size: 12,
73
+ "stroke-width": 2
74
+ })) : (u(), i(p(m), {
75
+ key: 1,
76
+ size: 12,
77
+ "stroke-width": 2
78
+ }))], 12, _), t.collaborators.length > 0 ? (u(), o("div", v, [(u(!0), o(n, null, d(C.value, (e) => (u(), o("div", {
79
+ key: e.id,
80
+ 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:text-white tpl:transition-transform tpl:duration-150 tpl:hover:z-10 tpl:hover:scale-110 tpl:border-[var(--tpl-bg)]",
81
+ style: l({ backgroundColor: e.color }),
82
+ title: e.name
83
+ }, f(D(e.name)), 13, y))), 128)), T.value > 0 ? (u(), o("div", {
84
+ key: 0,
85
+ 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)]",
86
+ title: E.value
87
+ }, " +" + f(T.value), 9, b)) : a("", !0)])) : a("", !0)]));
88
+ }
89
+ });
90
+ //#endregion
91
+ export { S as default };
@@ -0,0 +1,439 @@
1
+ import { c as e, f as t, r as n } from "./keys-Dwa2PmdD.js";
2
+ import { t as r } from "./useI18n-DUirdXEX.js";
3
+ import { n as i, t as ee } from "./_plugin-vue_export-helper-B1-bu7yR.js";
4
+ import { t as te } from "./check-B7kDuZmP.js";
5
+ import { t as ne } from "./chevron-down-DJLW2Q9Z.js";
6
+ import { t as re } from "./loader-circle-BTQQxC3l.js";
7
+ import { t as ie } from "./message-circle-Blgm6V_h.js";
8
+ import { t as a } from "./send-C0ltAQrv.js";
9
+ import { t as o } from "./trash-2-OwjZ-guZ.js";
10
+ import { t as s } from "./x-CGlq2XQe.js";
11
+ import { t as ae } from "./formatRelativeTime-DX3FgqN9.js";
12
+ import { Fragment as c, Transition as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as oe, createVNode as h, defineComponent as g, inject as _, nextTick as se, normalizeClass as v, normalizeStyle as ce, openBlock as y, ref as b, renderList as x, toDisplayString as S, unref as C, vModelText as w, watch as T, withCtx as E, withDirectives as D } from "vue";
13
+ var le = i("chevron-up", [["path", {
14
+ d: "m18 15-6-6-6 6",
15
+ key: "153udz"
16
+ }]]), ue = i("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
+ }]]), O = i("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
+ }]]), de = i("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
+ }]]), fe = {
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
+ }, 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 = {
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
+ }, 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 = {
43
+ key: 0,
44
+ class: "tpl:flex tpl:h-full tpl:items-center tpl:justify-center"
45
+ }, ye = {
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
+ }, be = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, xe = {
49
+ key: 2,
50
+ class: "tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3"
51
+ }, 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 = {
52
+ key: 0,
53
+ class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
54
+ }, Oe = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, ke = ["title", "onClick"], Ae = ["title", "onClick"], je = ["title", "onClick"], Me = {
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
+ }, Ne = {
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
+ }, Pe = ["onClick"], Fe = {
61
+ key: 2,
62
+ class: "tpl:mt-2"
63
+ }, Ie = ["onKeydown"], Le = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, Re = ["disabled", "onClick"], ze = {
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
+ }, Be = {
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
+ }, Ve = { class: "tpl:flex-1" }, He = ["onClick"], Ue = {
70
+ key: 5,
71
+ class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2"
72
+ }, We = ["title", "onClick"], Ge = ["onClick"], Ke = {
73
+ key: 0,
74
+ class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
75
+ }, 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 = {
76
+ key: 0,
77
+ class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
78
+ }, Qe = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, $e = ["title", "onClick"], et = ["title", "onClick"], tt = {
79
+ key: 0,
80
+ class: "tpl:mt-1.5"
81
+ }, nt = ["onKeydown"], rt = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, it = ["disabled", "onClick"], at = {
82
+ key: 1,
83
+ class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
84
+ }, ot = {
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
+ }, st = { class: "tpl:flex-1" }, ct = ["onClick"], lt = {
88
+ key: 0,
89
+ class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
90
+ }, 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 = {
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
+ }, gt = {
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
+ }, _t = ["placeholder", "disabled"], vt = ["disabled"], k = /* @__PURE__ */ ee(/* @__PURE__ */ g({
97
+ __name: "CommentsSidebar",
98
+ props: { visible: { type: Boolean } },
99
+ emits: ["close", "filterBlock"],
100
+ setup(i, { expose: ee, emit: g }) {
101
+ let k = i, A = g, { t: j, format: M } = r(), N = _(t), yt = _(n), P = _(e), F = b("unresolved"), I = b(null), L = b(""), R = b(null), z = b(""), B = b(null), V = b(""), H = b(/* @__PURE__ */ new Set()), U = b(null), W = b(null), bt = u(() => yt.userConfig?.id ?? null), xt = u(() => {
102
+ let e = /* @__PURE__ */ new Set();
103
+ for (let t of N.content.value.blocks) if (e.add(t.id), t.type === "section") for (let n of t.children) for (let t of n) e.add(t.id);
104
+ return e;
105
+ });
106
+ function St(e) {
107
+ return e ? !xt.value.has(e) : !1;
108
+ }
109
+ let Ct = u(() => F.value !== "block" || !I.value ? !1 : !(N.savedBlockIds?.value.has(I.value) ?? !0)), G = u(() => {
110
+ let e = P.comments.value;
111
+ return F.value === "unresolved" ? e = e.filter((e) => !e.resolved_at) : F.value === "block" && I.value && (e = e.filter((e) => e.block_id === I.value)), e;
112
+ });
113
+ T(() => k.visible, (e) => {
114
+ e && P.loadComments();
115
+ }), T(() => N.state.selectedBlockId, (e) => {
116
+ F.value === "block" && e && (I.value = e);
117
+ });
118
+ function K(e, t) {
119
+ F.value = e, I.value = e === "block" ? t ?? null : null;
120
+ }
121
+ function wt(e) {
122
+ K("block", e), A("filterBlock", e);
123
+ }
124
+ function Tt(e) {
125
+ H.value.has(e) ? H.value.delete(e) : H.value.add(e);
126
+ }
127
+ function Et(e) {
128
+ R.value = e, z.value = "", B.value = null, H.value.has(e) || H.value.add(e);
129
+ }
130
+ function Dt() {
131
+ R.value = null, z.value = "";
132
+ }
133
+ function q(e) {
134
+ B.value = e.id, V.value = e.body, R.value = null;
135
+ }
136
+ function J() {
137
+ B.value = null, V.value = "";
138
+ }
139
+ function Y(e) {
140
+ U.value = e;
141
+ }
142
+ function X() {
143
+ U.value = null;
144
+ }
145
+ async function Z() {
146
+ let e = L.value.trim();
147
+ if (!e) return;
148
+ let t = F.value === "block" ? I.value : void 0;
149
+ await P.addComment(e, t ?? void 0), L.value = "";
150
+ }
151
+ async function Ot(e) {
152
+ let t = z.value.trim();
153
+ if (!t) return;
154
+ let n = P.comments.value.find((t) => t.id === e);
155
+ await P.addComment(t, n?.block_id ?? void 0, e), R.value = null, z.value = "";
156
+ }
157
+ async function Q(e) {
158
+ let t = V.value.trim();
159
+ t && (await P.editComment(e, t), B.value = null, V.value = "");
160
+ }
161
+ async function kt(e) {
162
+ await P.removeComment(e), U.value = null;
163
+ }
164
+ async function At(e) {
165
+ await P.toggleResolve(e);
166
+ }
167
+ function $(e) {
168
+ return e.author_identifier === bt.value;
169
+ }
170
+ function jt(e) {
171
+ return ae(e, j.snapshotHistory) ?? e;
172
+ }
173
+ function Mt(e) {
174
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Z());
175
+ }
176
+ function Nt(e, t) {
177
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Ot(t));
178
+ }
179
+ function Pt(e, t) {
180
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q(t)), e.key === "Escape" && J();
181
+ }
182
+ function Ft() {
183
+ se(() => {
184
+ W.value?.focus();
185
+ });
186
+ }
187
+ return ee({
188
+ filterByBlock: wt,
189
+ focusNewComment: Ft
190
+ }), (e, t) => (y(), d(l, {
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: E(() => [i.visible ? (y(), p("div", fe, [
199
+ m("div", pe, [m("div", me, [
200
+ h(C(ie), {
201
+ size: 13,
202
+ "stroke-width": 2
203
+ }),
204
+ m("span", null, S(C(j).comments.title), 1),
205
+ C(P).unresolvedCount.value > 0 ? (y(), p("span", he, S(C(P).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: t[0] ||= (e) => A("close")
209
+ }, [h(C(s), {
210
+ size: 14,
211
+ "stroke-width": 2
212
+ })])]),
213
+ m("div", ge, [
214
+ m("button", {
215
+ class: v(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", F.value === "unresolved" ? "tpl-comment-filter--active" : ""]),
216
+ onClick: t[1] ||= (e) => K("unresolved")
217
+ }, S(C(j).comments.filterUnresolved), 3),
218
+ m("button", {
219
+ class: v(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", F.value === "all" ? "tpl-comment-filter--active" : ""]),
220
+ onClick: t[2] ||= (e) => K("all")
221
+ }, S(C(j).comments.filterAll), 3),
222
+ C(N).state.selectedBlockId ? (y(), p("button", {
223
+ key: 0,
224
+ class: v(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", F.value === "block" ? "tpl-comment-filter--active" : ""]),
225
+ onClick: t[3] ||= (e) => K("block", C(N).state.selectedBlockId ?? void 0)
226
+ }, S(C(j).comments.filterBlock), 3)) : f("", !0)
227
+ ]),
228
+ m("div", _e, [C(P).isLoading.value ? (y(), p("div", ve, [h(C(re), {
229
+ class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
230
+ size: 24,
231
+ "stroke-width": 2
232
+ })])) : G.value.length === 0 ? (y(), p("div", ye, [h(C(ie), {
233
+ size: 32,
234
+ "stroke-width": 1.5,
235
+ class: "tpl:text-[var(--tpl-text-dim)]"
236
+ }), m("p", be, S(F.value === "all" ? C(j).comments.noCommentsHint : C(j).comments.noComments), 1)])) : (y(), p("div", xe, [(y(!0), p(c, null, x(G.value, (e) => (y(), p("div", {
237
+ key: e.id,
238
+ class: "tpl-comment-thread"
239
+ }, [
240
+ m("div", Se, [
241
+ m("div", Ce, [m("div", we, [
242
+ m("span", Te, S($(e) ? C(j).comments.ownedByYou : e.author_name), 1),
243
+ m("span", Ee, S(jt(e.created_at)), 1),
244
+ e.updated_at === e.created_at ? f("", !0) : (y(), p("span", De, " (" + S(C(j).comments.edited) + ") ", 1))
245
+ ]), m("div", Oe, [
246
+ m("button", {
247
+ class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
248
+ title: e.resolved_at ? C(j).comments.unresolve : C(j).comments.resolve,
249
+ onClick: (t) => At(e.id)
250
+ }, [h(C(ue), {
251
+ size: 13,
252
+ "stroke-width": 2,
253
+ class: "tpl-resolve-icon",
254
+ style: ce({ color: e.resolved_at ? "var(--tpl-primary)" : void 0 })
255
+ }, null, 8, ["style"])], 8, ke),
256
+ $(e) ? (y(), p("button", {
257
+ key: 0,
258
+ class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
259
+ title: C(j).comments.edit,
260
+ onClick: (t) => q(e)
261
+ }, [h(C(O), {
262
+ size: 12,
263
+ "stroke-width": 2
264
+ })], 8, Ae)) : f("", !0),
265
+ $(e) ? (y(), p("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: C(j).comments.delete,
269
+ onClick: (t) => Y(e.id)
270
+ }, [h(C(o), {
271
+ size: 12,
272
+ "stroke-width": 2
273
+ })], 8, je)) : f("", !0)
274
+ ])]),
275
+ h(l, { name: "tpl-resolve" }, {
276
+ default: E(() => [e.resolved_at ? (y(), p("div", Me, [h(C(te), {
277
+ size: 10,
278
+ "stroke-width": 2.5
279
+ }), m("span", null, S(C(M)(C(j).comments.resolvedBy, { name: e.resolved_by_name ?? "" })), 1)])) : f("", !0)]),
280
+ _: 2
281
+ }, 1024),
282
+ e.block_id && St(e.block_id) ? (y(), p("span", Ne, S(C(j).comments.missingBlock), 1)) : e.block_id ? (y(), p("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: (t) => C(N).selectBlock(e.block_id ?? "")
286
+ }, " Block ", 8, Pe)) : f("", !0),
287
+ B.value === e.id ? (y(), p("div", Fe, [D(m("textarea", {
288
+ "onUpdate:modelValue": t[4] ||= (e) => V.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: (t) => Pt(t, e.id)
292
+ }, null, 40, Ie), [[w, V.value]]), m("div", Le, [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: !V.value.trim() || C(P).isSubmitting.value,
295
+ onClick: (t) => Q(e.id)
296
+ }, S(C(j).comments.save), 9, Re), 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: t[5] ||= (e) => J()
299
+ }, S(C(j).comments.cancel), 1)])])) : (y(), p("p", ze, S(e.body), 1)),
300
+ U.value === e.id ? (y(), p("div", Be, [
301
+ m("span", Ve, S(C(j).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: (t) => kt(e.id)
305
+ }, S(C(j).comments.delete), 9, He),
306
+ m("button", {
307
+ class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
308
+ onClick: t[6] ||= (e) => X()
309
+ }, S(C(j).comments.cancel), 1)
310
+ ])) : f("", !0),
311
+ B.value !== e.id && U.value !== e.id ? (y(), p("div", Ue, [m("button", {
312
+ class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
313
+ title: C(j).comments.reply,
314
+ onClick: (t) => Et(e.id)
315
+ }, [h(C(de), {
316
+ size: 13,
317
+ "stroke-width": 2,
318
+ class: "tpl:text-[var(--tpl-primary)]"
319
+ })], 8, We), (e.replies?.length ?? 0) > 0 ? (y(), p("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: (t) => Tt(e.id)
323
+ }, [H.value.has(e.id) ? (y(), d(C(le), {
324
+ key: 0,
325
+ size: 11,
326
+ "stroke-width": 2
327
+ })) : (y(), d(C(ne), {
328
+ key: 1,
329
+ size: 11,
330
+ "stroke-width": 2
331
+ })), oe(" " + S((e.replies?.length ?? 0) === 1 ? C(M)(C(j).comments.replyOne, { count: String(e.replies?.length ?? 0) }) : C(M)(C(j).comments.replyMany, { count: String(e.replies?.length ?? 0) })), 1)], 8, Ge)) : f("", !0)])) : f("", !0)
332
+ ]),
333
+ h(l, { name: "tpl-replies" }, {
334
+ default: E(() => [H.value.has(e.id) && (e.replies?.length ?? 0) > 0 ? (y(), p("div", Ke, [(y(!0), p(c, null, x(e.replies, (n, r) => (y(), p("div", {
335
+ key: n.id,
336
+ class: v(["tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5", r < (e.replies?.length ?? 0) - 1 ? "tpl:mb-2" : ""])
337
+ }, [
338
+ m("div", qe, [m("div", Je, [
339
+ m("span", Ye, S($(n) ? C(j).comments.ownedByYou : n.author_name), 1),
340
+ m("span", Xe, S(jt(n.created_at)), 1),
341
+ n.updated_at === n.created_at ? f("", !0) : (y(), p("span", Ze, " (" + S(C(j).comments.edited) + ") ", 1))
342
+ ]), m("div", Qe, [$(n) ? (y(), p("button", {
343
+ key: 0,
344
+ class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
345
+ title: C(j).comments.edit,
346
+ onClick: (e) => q(n)
347
+ }, [h(C(O), {
348
+ size: 11,
349
+ "stroke-width": 2
350
+ })], 8, $e)) : f("", !0), $(n) ? (y(), p("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: C(j).comments.delete,
354
+ onClick: (e) => Y(n.id)
355
+ }, [h(C(o), {
356
+ size: 11,
357
+ "stroke-width": 2
358
+ })], 8, et)) : f("", !0)])]),
359
+ B.value === n.id ? (y(), p("div", tt, [D(m("textarea", {
360
+ "onUpdate:modelValue": t[7] ||= (e) => V.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, n.id)
364
+ }, null, 40, nt), [[w, V.value]]), m("div", rt, [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: !V.value.trim() || C(P).isSubmitting.value,
367
+ onClick: (e) => Q(n.id)
368
+ }, S(C(j).comments.save), 9, it), 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: t[8] ||= (e) => J()
371
+ }, S(C(j).comments.cancel), 1)])])) : (y(), p("p", at, S(n.body), 1)),
372
+ U.value === n.id ? (y(), p("div", ot, [
373
+ m("span", st, S(C(j).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) => kt(n.id)
377
+ }, S(C(j).comments.delete), 9, ct),
378
+ m("button", {
379
+ class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
380
+ onClick: t[9] ||= (e) => X()
381
+ }, S(C(j).comments.cancel), 1)
382
+ ])) : f("", !0)
383
+ ], 2))), 128))])) : f("", !0)]),
384
+ _: 2
385
+ }, 1024),
386
+ h(l, { name: "tpl-replies" }, {
387
+ default: E(() => [R.value === e.id ? (y(), p("div", lt, [m("div", ut, [D(m("textarea", {
388
+ "onUpdate:modelValue": t[10] ||= (e) => z.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: C(j).comments.replyPlaceholder,
391
+ rows: "2",
392
+ onKeydown: (t) => Nt(t, e.id)
393
+ }, null, 40, dt), [[w, z.value]]), m("div", ft, [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: !z.value.trim() || C(P).isSubmitting.value,
396
+ onClick: (t) => Ot(e.id)
397
+ }, [h(C(a), {
398
+ size: 14,
399
+ "stroke-width": 2
400
+ })], 8, pt), 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: t[11] ||= (e) => Dt()
403
+ }, [h(C(s), {
404
+ size: 14,
405
+ "stroke-width": 2
406
+ })])])])])) : f("", !0)]),
407
+ _: 2
408
+ }, 1024)
409
+ ]))), 128))]))]),
410
+ m("div", mt, [Ct.value ? (y(), p("div", ht, S(C(j).comments.saveTemplateFirst), 1)) : (y(), p("div", gt, [D(m("textarea", {
411
+ ref_key: "newCommentInput",
412
+ ref: W,
413
+ "onUpdate:modelValue": t[12] ||= (e) => L.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: C(j).comments.placeholder,
416
+ disabled: C(P).isSubmitting.value,
417
+ rows: "2",
418
+ onKeydown: Mt
419
+ }, null, 40, _t), [[w, L.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: !L.value.trim() || C(P).isSubmitting.value,
422
+ onClick: Z
423
+ }, [C(P).isSubmitting.value ? (y(), d(C(re), {
424
+ key: 0,
425
+ class: "tpl-spinner",
426
+ size: 16,
427
+ "stroke-width": 2
428
+ })) : (y(), d(C(a), {
429
+ key: 1,
430
+ size: 16,
431
+ "stroke-width": 2
432
+ }))], 8, vt)]))])
433
+ ])) : f("", !0)]),
434
+ _: 1
435
+ }));
436
+ }
437
+ }), [["__scopeId", "data-v-36508fac"]]);
438
+ //#endregion
439
+ export { k as default };