@tldraw/commenting 0.0.0-bootstrap → 5.3.0-canary.31036673d3f8

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 (279) hide show
  1. package/README.md +0 -2
  2. package/commenting.css +1139 -329
  3. package/dist-cjs/canvas/anchor-lifecycle.js +148 -0
  4. package/dist-cjs/canvas/anchor-lifecycle.js.map +7 -0
  5. package/dist-cjs/canvas/cluster-input.js +2 -2
  6. package/dist-cjs/canvas/cluster-input.js.map +2 -2
  7. package/dist-cjs/canvas/comment-body.js +1 -1
  8. package/dist-cjs/canvas/comment-body.js.map +2 -2
  9. package/dist-cjs/canvas/comment-drafts.js +54 -0
  10. package/dist-cjs/canvas/comment-drafts.js.map +7 -0
  11. package/dist-cjs/canvas/comment-mutations.js +123 -0
  12. package/dist-cjs/canvas/comment-mutations.js.map +7 -0
  13. package/dist-cjs/canvas/comment-reactions.js +163 -0
  14. package/dist-cjs/canvas/comment-reactions.js.map +7 -0
  15. package/dist-cjs/canvas/comment-render.js +5 -3
  16. package/dist-cjs/canvas/comment-render.js.map +2 -2
  17. package/dist-cjs/canvas/comment-store.js +19 -9
  18. package/dist-cjs/canvas/comment-store.js.map +2 -2
  19. package/dist-cjs/canvas/comment-tool.js +64 -14
  20. package/dist-cjs/canvas/comment-tool.js.map +2 -2
  21. package/dist-cjs/canvas/comments-filter-menu.js +20 -38
  22. package/dist-cjs/canvas/comments-filter-menu.js.map +2 -2
  23. package/dist-cjs/canvas/comments-overflow-menu.js +22 -27
  24. package/dist-cjs/canvas/comments-overflow-menu.js.map +2 -2
  25. package/dist-cjs/canvas/comments-overlay.js +429 -474
  26. package/dist-cjs/canvas/comments-overlay.js.map +2 -2
  27. package/dist-cjs/canvas/comments-sidebar.js +35 -32
  28. package/dist-cjs/canvas/comments-sidebar.js.map +2 -2
  29. package/dist-cjs/canvas/comments-visibility-toggle.js +65 -0
  30. package/dist-cjs/canvas/comments-visibility-toggle.js.map +7 -0
  31. package/dist-cjs/canvas/context.js +17 -0
  32. package/dist-cjs/canvas/context.js.map +7 -0
  33. package/dist-cjs/canvas/hooks.js +22 -3
  34. package/dist-cjs/canvas/hooks.js.map +2 -2
  35. package/dist-cjs/canvas/options.js +19 -2
  36. package/dist-cjs/canvas/options.js.map +2 -2
  37. package/dist-cjs/canvas/pin-stacking.js +56 -0
  38. package/dist-cjs/canvas/pin-stacking.js.map +7 -0
  39. package/dist-cjs/canvas/sidebar-filters.js +2 -2
  40. package/dist-cjs/canvas/sidebar-filters.js.map +2 -2
  41. package/dist-cjs/canvas/state.js +28 -14
  42. package/dist-cjs/canvas/state.js.map +2 -2
  43. package/dist-cjs/canvas/thread-preview.js +185 -0
  44. package/dist-cjs/canvas/thread-preview.js.map +7 -0
  45. package/dist-cjs/canvas/thread-stack.js +199 -0
  46. package/dist-cjs/canvas/thread-stack.js.map +7 -0
  47. package/dist-cjs/canvas/thread-state.js +67 -21
  48. package/dist-cjs/canvas/thread-state.js.map +2 -2
  49. package/dist-cjs/canvas/thread-view.js +397 -0
  50. package/dist-cjs/canvas/thread-view.js.map +7 -0
  51. package/dist-cjs/clustering/computeClusterTable.js +4 -4
  52. package/dist-cjs/clustering/computeClusterTable.js.map +2 -2
  53. package/dist-cjs/clustering/runtime.js +119 -7
  54. package/dist-cjs/clustering/runtime.js.map +2 -2
  55. package/dist-cjs/clustering/types.js.map +1 -1
  56. package/dist-cjs/index.d.ts +763 -333
  57. package/dist-cjs/index.js +46 -28
  58. package/dist-cjs/index.js.map +2 -2
  59. package/dist-cjs/ui/byline.js +6 -4
  60. package/dist-cjs/ui/byline.js.map +2 -2
  61. package/dist-cjs/ui/comment-card.js +15 -8
  62. package/dist-cjs/ui/comment-card.js.map +2 -2
  63. package/dist-cjs/ui/comment-composer.js +137 -36
  64. package/dist-cjs/ui/comment-composer.js.map +2 -2
  65. package/dist-cjs/ui/comment-pin.js +24 -2
  66. package/dist-cjs/ui/comment-pin.js.map +2 -2
  67. package/dist-cjs/ui/comment-thread.js +9 -7
  68. package/dist-cjs/ui/comment-thread.js.map +2 -2
  69. package/dist-cjs/ui/comments-list.js +30 -18
  70. package/dist-cjs/ui/comments-list.js.map +2 -2
  71. package/dist-cjs/ui/count-badge.js +3 -2
  72. package/dist-cjs/ui/count-badge.js.map +2 -2
  73. package/dist-cjs/ui/emoji-picker.js +54 -0
  74. package/dist-cjs/ui/emoji-picker.js.map +7 -0
  75. package/dist-cjs/ui/empty-state.js +3 -3
  76. package/dist-cjs/ui/empty-state.js.map +2 -2
  77. package/dist-cjs/ui/format-time.js +4 -1
  78. package/dist-cjs/ui/format-time.js.map +2 -2
  79. package/dist-cjs/ui/reaction-picker.js +73 -0
  80. package/dist-cjs/ui/reaction-picker.js.map +7 -0
  81. package/dist-cjs/ui/reaction.js +59 -6
  82. package/dist-cjs/ui/reaction.js.map +2 -2
  83. package/dist-cjs/ui/reactions.js +20 -7
  84. package/dist-cjs/ui/reactions.js.map +2 -2
  85. package/dist-cjs/ui/{mention.js → reply-count.js} +9 -11
  86. package/dist-cjs/ui/reply-count.js.map +7 -0
  87. package/dist-cjs/ui/send-button.js +20 -1
  88. package/dist-cjs/ui/send-button.js.map +2 -2
  89. package/dist-cjs/ui/{comment-text.js → tooltip-button.js} +12 -9
  90. package/dist-cjs/ui/tooltip-button.js.map +7 -0
  91. package/dist-esm/canvas/anchor-lifecycle.mjs +128 -0
  92. package/dist-esm/canvas/anchor-lifecycle.mjs.map +7 -0
  93. package/dist-esm/canvas/cluster-input.mjs +2 -2
  94. package/dist-esm/canvas/cluster-input.mjs.map +2 -2
  95. package/dist-esm/canvas/comment-body.mjs +1 -1
  96. package/dist-esm/canvas/comment-body.mjs.map +2 -2
  97. package/dist-esm/canvas/comment-drafts.mjs +34 -0
  98. package/dist-esm/canvas/comment-drafts.mjs.map +7 -0
  99. package/dist-esm/canvas/comment-mutations.mjs +103 -0
  100. package/dist-esm/canvas/comment-mutations.mjs.map +7 -0
  101. package/dist-esm/canvas/comment-reactions.mjs +152 -0
  102. package/dist-esm/canvas/comment-reactions.mjs.map +7 -0
  103. package/dist-esm/canvas/comment-render.mjs +5 -3
  104. package/dist-esm/canvas/comment-render.mjs.map +2 -2
  105. package/dist-esm/canvas/comment-store.mjs +19 -9
  106. package/dist-esm/canvas/comment-store.mjs.map +2 -2
  107. package/dist-esm/canvas/comment-tool.mjs +67 -17
  108. package/dist-esm/canvas/comment-tool.mjs.map +2 -2
  109. package/dist-esm/canvas/comments-filter-menu.mjs +20 -38
  110. package/dist-esm/canvas/comments-filter-menu.mjs.map +2 -2
  111. package/dist-esm/canvas/comments-overflow-menu.mjs +23 -27
  112. package/dist-esm/canvas/comments-overflow-menu.mjs.map +2 -2
  113. package/dist-esm/canvas/comments-overlay.mjs +450 -479
  114. package/dist-esm/canvas/comments-overlay.mjs.map +3 -3
  115. package/dist-esm/canvas/comments-sidebar.mjs +38 -35
  116. package/dist-esm/canvas/comments-sidebar.mjs.map +2 -2
  117. package/dist-esm/canvas/comments-visibility-toggle.mjs +45 -0
  118. package/dist-esm/canvas/comments-visibility-toggle.mjs.map +7 -0
  119. package/dist-esm/canvas/context.mjs +1 -0
  120. package/dist-esm/canvas/context.mjs.map +7 -0
  121. package/dist-esm/canvas/hooks.mjs +28 -5
  122. package/dist-esm/canvas/hooks.mjs.map +2 -2
  123. package/dist-esm/canvas/options.mjs +21 -3
  124. package/dist-esm/canvas/options.mjs.map +2 -2
  125. package/dist-esm/canvas/pin-stacking.mjs +36 -0
  126. package/dist-esm/canvas/pin-stacking.mjs.map +7 -0
  127. package/dist-esm/canvas/sidebar-filters.mjs +2 -2
  128. package/dist-esm/canvas/sidebar-filters.mjs.map +2 -2
  129. package/dist-esm/canvas/state.mjs +29 -19
  130. package/dist-esm/canvas/state.mjs.map +2 -2
  131. package/dist-esm/canvas/thread-preview.mjs +170 -0
  132. package/dist-esm/canvas/thread-preview.mjs.map +7 -0
  133. package/dist-esm/canvas/thread-stack.mjs +190 -0
  134. package/dist-esm/canvas/thread-stack.mjs.map +7 -0
  135. package/dist-esm/canvas/thread-state.mjs +71 -22
  136. package/dist-esm/canvas/thread-state.mjs.map +2 -2
  137. package/dist-esm/canvas/thread-view.mjs +402 -0
  138. package/dist-esm/canvas/thread-view.mjs.map +7 -0
  139. package/dist-esm/clustering/computeClusterTable.mjs +4 -4
  140. package/dist-esm/clustering/computeClusterTable.mjs.map +2 -2
  141. package/dist-esm/clustering/runtime.mjs +119 -7
  142. package/dist-esm/clustering/runtime.mjs.map +2 -2
  143. package/dist-esm/index.d.mts +763 -333
  144. package/dist-esm/index.mjs +87 -41
  145. package/dist-esm/index.mjs.map +2 -2
  146. package/dist-esm/ui/byline.mjs +6 -4
  147. package/dist-esm/ui/byline.mjs.map +2 -2
  148. package/dist-esm/ui/comment-card.mjs +15 -8
  149. package/dist-esm/ui/comment-card.mjs.map +2 -2
  150. package/dist-esm/ui/comment-composer.mjs +148 -36
  151. package/dist-esm/ui/comment-composer.mjs.map +2 -2
  152. package/dist-esm/ui/comment-pin.mjs +24 -2
  153. package/dist-esm/ui/comment-pin.mjs.map +2 -2
  154. package/dist-esm/ui/comment-thread.mjs +9 -7
  155. package/dist-esm/ui/comment-thread.mjs.map +2 -2
  156. package/dist-esm/ui/comments-list.mjs +43 -29
  157. package/dist-esm/ui/comments-list.mjs.map +2 -2
  158. package/dist-esm/ui/count-badge.mjs +3 -2
  159. package/dist-esm/ui/count-badge.mjs.map +2 -2
  160. package/dist-esm/ui/emoji-picker.mjs +34 -0
  161. package/dist-esm/ui/emoji-picker.mjs.map +7 -0
  162. package/dist-esm/ui/empty-state.mjs +3 -3
  163. package/dist-esm/ui/empty-state.mjs.map +2 -2
  164. package/dist-esm/ui/format-time.mjs +4 -1
  165. package/dist-esm/ui/format-time.mjs.map +2 -2
  166. package/dist-esm/ui/reaction-picker.mjs +60 -0
  167. package/dist-esm/ui/reaction-picker.mjs.map +7 -0
  168. package/dist-esm/ui/reaction.mjs +60 -7
  169. package/dist-esm/ui/reaction.mjs.map +2 -2
  170. package/dist-esm/ui/reactions.mjs +21 -8
  171. package/dist-esm/ui/reactions.mjs.map +2 -2
  172. package/dist-esm/ui/reply-count.mjs +9 -0
  173. package/dist-esm/ui/reply-count.mjs.map +7 -0
  174. package/dist-esm/ui/send-button.mjs +20 -1
  175. package/dist-esm/ui/send-button.mjs.map +2 -2
  176. package/dist-esm/ui/tooltip-button.mjs +12 -0
  177. package/dist-esm/ui/tooltip-button.mjs.map +7 -0
  178. package/package.json +6 -6
  179. package/src/canvas/anchor-lifecycle.test.ts +290 -0
  180. package/src/canvas/anchor-lifecycle.ts +205 -0
  181. package/src/canvas/canvas.css +461 -46
  182. package/src/canvas/cluster-input.test.ts +31 -23
  183. package/src/canvas/cluster-input.ts +3 -4
  184. package/src/canvas/comment-body.tsx +1 -1
  185. package/src/canvas/comment-drafts.test.ts +55 -0
  186. package/src/canvas/comment-drafts.ts +46 -0
  187. package/src/canvas/comment-mutations.test.ts +410 -0
  188. package/src/canvas/comment-mutations.ts +288 -0
  189. package/src/canvas/comment-reactions.test.ts +132 -0
  190. package/src/canvas/comment-reactions.tsx +245 -0
  191. package/src/canvas/comment-render.test.ts +1 -1
  192. package/src/canvas/comment-render.ts +9 -5
  193. package/src/canvas/comment-store.ts +67 -27
  194. package/src/canvas/comment-tool.test.ts +162 -0
  195. package/src/canvas/comment-tool.tsx +105 -23
  196. package/src/canvas/comments-filter-menu.tsx +23 -32
  197. package/src/canvas/comments-overflow-menu.tsx +14 -21
  198. package/src/canvas/comments-overlay.tsx +695 -622
  199. package/src/canvas/comments-sidebar.test.ts +45 -0
  200. package/src/canvas/comments-sidebar.tsx +76 -58
  201. package/src/canvas/comments-visibility-toggle.tsx +49 -0
  202. package/src/canvas/context.ts +47 -0
  203. package/src/canvas/hooks.ts +52 -11
  204. package/src/canvas/options.test.ts +52 -2
  205. package/src/canvas/options.ts +133 -9
  206. package/src/canvas/pin-stacking.test.ts +114 -0
  207. package/src/canvas/pin-stacking.ts +57 -0
  208. package/src/canvas/sidebar-filters.ts +4 -3
  209. package/src/canvas/state.ts +92 -35
  210. package/src/canvas/thread-preview.test.ts +91 -0
  211. package/src/canvas/thread-preview.tsx +304 -0
  212. package/src/canvas/thread-stack.tsx +252 -0
  213. package/src/canvas/thread-state.test.ts +209 -0
  214. package/src/canvas/thread-state.ts +137 -36
  215. package/src/canvas/thread-view.tsx +516 -0
  216. package/src/clustering/computeClusterTable.test.ts +24 -23
  217. package/src/clustering/computeClusterTable.ts +5 -5
  218. package/src/clustering/runtime.test.ts +217 -7
  219. package/src/clustering/runtime.ts +171 -17
  220. package/src/clustering/types.ts +9 -9
  221. package/src/index.ts +76 -40
  222. package/src/ui/byline.tsx +7 -5
  223. package/src/ui/comment-card.tsx +20 -10
  224. package/src/ui/comment-composer.tsx +206 -40
  225. package/src/ui/comment-pin.tsx +26 -2
  226. package/src/ui/comment-thread.tsx +13 -6
  227. package/src/ui/comments-list.test.ts +31 -0
  228. package/src/ui/comments-list.tsx +45 -21
  229. package/src/ui/comments.css +566 -281
  230. package/src/ui/count-badge.tsx +9 -2
  231. package/src/ui/emoji-picker.test.ts +25 -0
  232. package/src/ui/emoji-picker.tsx +76 -0
  233. package/src/ui/empty-state.tsx +3 -3
  234. package/src/ui/format-time.ts +7 -2
  235. package/src/ui/reaction-picker.tsx +109 -0
  236. package/src/ui/reaction.tsx +121 -6
  237. package/src/ui/reactions.tsx +69 -10
  238. package/src/ui/reply-count.ts +16 -0
  239. package/src/ui/send-button.tsx +18 -3
  240. package/src/ui/tooltip-button.tsx +20 -0
  241. package/dist-cjs/canvas/region-options.js +0 -49
  242. package/dist-cjs/canvas/region-options.js.map +0 -7
  243. package/dist-cjs/ui/avatar.js +0 -43
  244. package/dist-cjs/ui/avatar.js.map +0 -7
  245. package/dist-cjs/ui/comment-mention.js +0 -42
  246. package/dist-cjs/ui/comment-mention.js.map +0 -7
  247. package/dist-cjs/ui/comment-text.js.map +0 -7
  248. package/dist-cjs/ui/mention-list.js +0 -70
  249. package/dist-cjs/ui/mention-list.js.map +0 -7
  250. package/dist-cjs/ui/mention-suggestion.js +0 -206
  251. package/dist-cjs/ui/mention-suggestion.js.map +0 -7
  252. package/dist-cjs/ui/mention.js.map +0 -7
  253. package/dist-cjs/ui/render-markdown.js +0 -63
  254. package/dist-cjs/ui/render-markdown.js.map +0 -7
  255. package/dist-esm/canvas/region-options.mjs +0 -29
  256. package/dist-esm/canvas/region-options.mjs.map +0 -7
  257. package/dist-esm/ui/avatar.mjs +0 -23
  258. package/dist-esm/ui/avatar.mjs.map +0 -7
  259. package/dist-esm/ui/comment-mention.mjs +0 -22
  260. package/dist-esm/ui/comment-mention.mjs.map +0 -7
  261. package/dist-esm/ui/comment-text.mjs +0 -9
  262. package/dist-esm/ui/comment-text.mjs.map +0 -7
  263. package/dist-esm/ui/mention-list.mjs +0 -50
  264. package/dist-esm/ui/mention-list.mjs.map +0 -7
  265. package/dist-esm/ui/mention-suggestion.mjs +0 -186
  266. package/dist-esm/ui/mention-suggestion.mjs.map +0 -7
  267. package/dist-esm/ui/mention.mjs +0 -11
  268. package/dist-esm/ui/mention.mjs.map +0 -7
  269. package/dist-esm/ui/render-markdown.mjs +0 -45
  270. package/dist-esm/ui/render-markdown.mjs.map +0 -7
  271. package/src/canvas/region-options.ts +0 -57
  272. package/src/ui/avatar.tsx +0 -31
  273. package/src/ui/comment-mention.ts +0 -47
  274. package/src/ui/comment-text.tsx +0 -12
  275. package/src/ui/mention-list.tsx +0 -106
  276. package/src/ui/mention-suggestion.test.ts +0 -18
  277. package/src/ui/mention-suggestion.tsx +0 -285
  278. package/src/ui/mention.tsx +0 -9
  279. package/src/ui/render-markdown.tsx +0 -72
@@ -1,69 +1,343 @@
1
1
  /* The comments layer is portaled into the editor container. Pins live in the canvas-in-front layer
2
2
  (beneath the UI panels at z-index 300), so the toolbar and style panel draw over them; the open
3
- thread's popover portals up to the menus layer separately (`.cmt-canvas-popover`) so it isn't
3
+ thread's popover portals up to the menus layer separately (`.tlui-cmt-canvas-popover`) so it isn't
4
4
  clipped. Click-through except on its own children. */
5
- .cmt-canvas-layer {
5
+ .tlui-cmt-canvas-layer {
6
6
  position: absolute;
7
7
  inset: 0;
8
- z-index: var(--tl-layer-canvas-in-front);
8
+ /* Just below the collaborator cursor layer, so cursors ride over the pins — and below the
9
+ in-front content (250), so active tool UI covers both. Derived, not a literal, so the
10
+ ordering can't silently drift if the cursor slot moves. */
11
+ z-index: calc(var(--tl-layer-collaborators) - 5);
9
12
  pointer-events: none;
10
13
  }
11
14
 
12
- .cmt-canvas-pin,
13
- .cmt-canvas-cluster,
14
- .cmt-canvas-composer {
15
+ .tlui-cmt-canvas-pin,
16
+ .tlui-cmt-canvas-cluster,
17
+ .tlui-cmt-canvas-composer {
15
18
  position: absolute;
16
19
  }
17
20
 
18
- .cmt-canvas-pin,
19
- .cmt-canvas-composer {
21
+ .tlui-cmt-canvas-composer {
20
22
  pointer-events: auto;
21
23
  }
22
24
 
23
- /* Badges are clickable (zoom to the cluster's first split). */
24
- .cmt-canvas-cluster {
25
- transform: translate(-50%, -50%);
25
+ /* The pin's only interactive surface is the square hit layer below — the wrapper itself is
26
+ inert. Its box sits at the anchor point, not over the (translated) visual, so letting it take
27
+ events would put a phantom hit zone beside the pin. */
28
+ .tlui-cmt-canvas-pin {
29
+ pointer-events: none;
30
+ }
31
+
32
+ .tlui-cmt-button {
33
+ appearance: none;
34
+ margin: 0;
35
+ padding: 0;
36
+ border: none;
37
+ background: none;
38
+ color: inherit;
39
+ font: inherit;
40
+ }
41
+
42
+ /* Anchored by its bottom-left corner like a pin, so the badge sits up-and-right of the cluster's
43
+ centroid — the same visual-to-anchor relationship a single comment pin has. */
44
+ .tlui-cmt-canvas-cluster {
45
+ transform: translate(0, -100%);
26
46
  pointer-events: auto;
27
47
  cursor: pointer;
28
48
  }
29
49
 
30
- .cmt-cluster-fade {
50
+ /* Keyboard focus has to be visible on the canvas, where there's no surrounding chrome to imply
51
+ it. The ring goes on the marker visual (the rounded pin/badge), not the button box, so it
52
+ traces the shape rather than a rectangle around it; the button's own outline is suppressed
53
+ because its box is offset from what you see. */
54
+ .tlui-cmt-canvas-pin__marker:focus-visible,
55
+ .tlui-cmt-canvas-cluster:focus-visible {
56
+ outline: none;
57
+ }
58
+ .tlui-cmt-canvas-pin__marker:focus-visible .tlui-cmt-marker,
59
+ .tlui-cmt-canvas-cluster:focus-visible .tlui-cmt-marker {
60
+ outline: 2px solid var(--tl-color-selected);
61
+ outline-offset: 2px;
62
+ }
63
+ /* Focus should read like hover, so the pin lifts the same way when tabbed to. */
64
+ .tlui-cmt-canvas-pin__marker:focus-visible .tlui-cmt-marker {
65
+ transform: scale(var(--tlui-cmt-marker-hover-scale));
66
+ }
67
+
68
+ .tlui-cmt-cluster-fade {
31
69
  opacity: 1;
32
70
  transition: opacity 150ms ease;
33
71
  }
34
72
 
35
- .cmt-cluster-fade--entering {
73
+ .tlui-cmt-cluster-fade--entering {
36
74
  opacity: 0;
37
75
  }
38
76
 
39
- .cmt-cluster-fade--present {
77
+ .tlui-cmt-cluster-fade--present {
40
78
  opacity: 1;
41
79
  }
42
80
 
43
- .cmt-cluster-fade--exiting {
81
+ .tlui-cmt-cluster-fade--exiting {
44
82
  opacity: 0;
45
83
  }
46
84
 
47
- .cmt-cluster-fade--entering *,
48
- .cmt-cluster-fade--exiting * {
85
+ .tlui-cmt-cluster-fade--entering *,
86
+ .tlui-cmt-cluster-fade--exiting * {
49
87
  pointer-events: none !important;
50
88
  }
51
89
 
52
90
  @media (prefers-reduced-motion: reduce) {
53
- .cmt-cluster-fade {
91
+ .tlui-cmt-cluster-fade {
54
92
  transition: none;
55
93
  }
56
94
  }
57
95
 
58
96
  /* The open thread (its pin + popover) sits above the other pins, so nearby markers don't
59
97
  overlap its popover — they tuck behind it. */
60
- .cmt-canvas-pin--open {
98
+ .tlui-cmt-canvas-pin--open {
61
99
  z-index: 1;
62
100
  }
63
101
 
102
+ /* The count badge standing in for a stack of coincident pins — same face as a cluster badge,
103
+ but clicking opens the stack's thread list rather than zooming (no zoom can separate them).
104
+ Re-enables pointer events: the badge lives inside `.tlui-cmt-canvas-pin`, which is inert
105
+ (`pointer-events: none`) so its box doesn't shadow the canvas — without this the badge renders
106
+ but can't be hovered or clicked, like the cluster badge's own `pointer-events: auto`. */
107
+ .tlui-cmt-canvas-stack-badge {
108
+ /* Bottom-left anchored like the pins it stands in for, and like the cluster badge. */
109
+ transform: translate(0, -100%);
110
+ width: max-content;
111
+ pointer-events: auto;
112
+ cursor: pointer;
113
+ }
114
+
115
+ .tlui-cmt-canvas-stack-badge:focus-visible {
116
+ outline: none;
117
+ }
118
+ .tlui-cmt-canvas-stack-badge:focus-visible .tlui-cmt-marker {
119
+ outline: 2px solid var(--tl-color-selected);
120
+ outline-offset: 2px;
121
+ transform: scale(var(--tlui-cmt-marker-hover-scale));
122
+ }
123
+
124
+ /* The stack's popover content: one card per thread, the expanded thread inline among them. */
125
+ .tlui-cmt-stack-list {
126
+ display: flex;
127
+ flex-direction: column;
128
+ gap: 10px;
129
+ }
130
+
131
+ /* The expanded thread is the only entry with pills floating above its panel — its header actions,
132
+ and its first comment's hover actions. Those reach ~15px up, past the list's 10px gap, so give
133
+ this one entry extra room: without it the pills land on the card above, and against the scroll
134
+ box's clip edge. Collapsed cards keep their own actions inside, so they need none of this. */
135
+ .tlui-cmt-stack-list__thread {
136
+ margin-top: 8px;
137
+ }
138
+
139
+ /* Collapsed entries match the expanded thread's surface (same width, panel, elevation) so the
140
+ list reads as one column of cards with one of them opened up. */
141
+ .tlui-cmt-stack-list__card {
142
+ box-sizing: border-box;
143
+ position: relative;
144
+ width: 300px;
145
+ background: var(--tl-color-panel);
146
+ border-radius: 12px;
147
+ box-shadow: var(--tl-shadow-3);
148
+ padding: 2px 12px 10px;
149
+ cursor: pointer;
150
+ text-align: left;
151
+ display: block;
152
+ }
153
+
154
+ /* The card's keyboard affordance, covering the whole surface so it's one target rather than a
155
+ control tucked in a corner. It's laid under the card's content instead of wrapping it: a comment
156
+ body renders its links as anchors, which can't be nested inside a button (see the note in
157
+ `StackThreadCard`). Pointer clicks anywhere still reach the card's own handler by bubbling. */
158
+ .tlui-cmt-stack-list__card-action {
159
+ position: absolute;
160
+ inset: 0;
161
+ border-radius: inherit;
162
+ cursor: pointer;
163
+ }
164
+
165
+ .tlui-cmt-stack-list__card-action:focus-visible {
166
+ outline: 2px solid var(--tl-color-selected);
167
+ outline-offset: 2px;
168
+ }
169
+
170
+ /* The wrapper is the card's surface — inside it the comment is plain content, mirroring how the
171
+ thread panel flattens its own cards. Stacked above the action overlay so the body's links stay
172
+ clickable. */
173
+ .tlui-cmt-stack-list__card .tlui-cmt-card {
174
+ position: relative;
175
+ width: 100%;
176
+ gap: 0;
177
+ padding: 0;
178
+ background: transparent;
179
+ border: none;
180
+ }
181
+
182
+ /* The hover preview, shown for any marker — a pin, a coincident stack, or a cluster badge. Live,
183
+ not a tooltip: the pointer travels into it to hover and click the cards.
184
+
185
+ Two elements, deliberately: this root is the hover *region* (it reaches back over the marker via
186
+ the bridge below), and `__panel` inside it is the visible surface. A pseudo-element's hover
187
+ counts as its host's, so a surface on this root would light up whenever the pointer was on the
188
+ marker — the pin would appear pressed just for being hovered. */
189
+ .tlui-cmt-canvas-preview {
190
+ position: absolute;
191
+ z-index: var(--tl-layer-menus);
192
+ pointer-events: auto;
193
+ }
194
+
195
+ /* The bridge over the gap between the marker and the panel. Moving right off the pin would
196
+ otherwise cross bare canvas, and that leave would retract the panel before the pointer arrived.
197
+ Invisible, part of the panel's hover region, and only present while the panel is.
198
+
199
+ It spans the gap and stops there. Reaching any further would put it over the marker itself, and
200
+ since it sits in the menus layer — above the pins — it would take the marker's hover and clicks:
201
+ the pin would go dead exactly where it looks most alive. The marker needs no covering anyway, as
202
+ it carries the same hover handlers.
203
+
204
+ The gap is the panel's own offset (`--tlui-cmt-preview-offset`, set from `POPOVER_OFFSET` so
205
+ there's one source) less however far the marker reaches toward it, per variant below. */
206
+ .tlui-cmt-canvas-preview::before {
207
+ content: '';
208
+ position: absolute;
209
+ top: 0;
210
+ bottom: 0;
211
+ right: 100%;
212
+ width: max(0px, var(--tlui-cmt-preview-bridge, 0px));
213
+ }
214
+
215
+ /* A pin is anchored at its bottom-left corner, so its full width lies between anchor and panel.
216
+ The popover and preview share a first-comment position now that the actions float outside the
217
+ panel rather than reserving a header row, so no vertical shift is needed. */
218
+ .tlui-cmt-canvas-preview--thread {
219
+ --tlui-cmt-preview-bridge: calc(var(--tlui-cmt-preview-offset) - var(--tlui-cmt-pin-size));
220
+ }
221
+
222
+ /* A badge is anchored at its bottom-left corner like a pin, so its full width does too. */
223
+ .tlui-cmt-canvas-preview--list {
224
+ --tlui-cmt-preview-bridge: calc(var(--tlui-cmt-preview-offset) - var(--tlui-cmt-marker-size));
225
+ }
226
+
227
+ .tlui-cmt-canvas-preview__panel {
228
+ display: flex;
229
+ flex-direction: column;
230
+ }
231
+
232
+ /* Previewing a single pin: the thread panel itself, minus the header — the same surface, width,
233
+ and flattened comment (see `.tlui-cmt-thread .tlui-cmt-card`), so the hover shows exactly what
234
+ the click opens. */
235
+ .tlui-cmt-canvas-preview__panel--thread {
236
+ box-sizing: border-box;
237
+ width: 300px;
238
+ gap: var(--tlui-cmt-thread-gap);
239
+ /* Top/bottom only — the card pads its own sides now (12px), matching the expanded thread. A
240
+ little extra below so the (often truncated) last line doesn't sit against the rounded edge. */
241
+ padding: 4px 0 8px;
242
+ background: var(--tl-color-panel);
243
+ border-radius: var(--tl-radius-4);
244
+ box-shadow: var(--tl-shadow-3);
245
+ }
246
+ /* The reply count is a short line that sits closer to the edge than a wrapped comment does, so give
247
+ it more room below when it's the panel's last line. */
248
+ .tlui-cmt-canvas-preview__panel--thread:has(.tlui-cmt-card__replies) {
249
+ padding-bottom: 12px;
250
+ }
251
+
252
+ /* Previewing a stack or cluster: one card per thread, matching the card list a click opens. */
253
+ .tlui-cmt-canvas-preview__panel--list {
254
+ gap: 8px;
255
+ padding: 4px 0 8px;
256
+ }
257
+
258
+ /* Matches the stack list's card surface, so a preview and the list it previews read as the same
259
+ object seen twice — once on hover, once opened. */
260
+ .tlui-cmt-preview-card {
261
+ box-sizing: border-box;
262
+ width: 300px;
263
+ background: var(--tl-color-panel);
264
+ border-radius: 12px;
265
+ box-shadow: var(--tl-shadow-3);
266
+ /* A 2px nudge above the byline's centring — a boxed card reads a touch better with it than the
267
+ single preview's flat card, which pads 0 vertically and leans on the panel + byline. */
268
+ padding: 2px 12px 10px;
269
+ }
270
+
271
+ .tlui-cmt-preview-card--selectable {
272
+ cursor: pointer;
273
+ }
274
+
275
+ /* Every card surface that tints on hover — a collapsed thread in a stack list, a preview card, and
276
+ the single-comment preview panel. One rule, because they're the same object to the eye.
277
+
278
+ The opaque low-surface token, not a translucent muted one: these float directly over the canvas,
279
+ where a translucent fill would let shapes show through.
280
+
281
+ The second line is why this isn't a one-liner. `--tl-shadow-3` ends with a 1px *inset* ring in
282
+ `--tl-color-panel-contrast` — pure white in light mode — and an inset shadow paints over the
283
+ background. At rest that's invisible (the panel is 99% white under a 100% white ring), but tint
284
+ the background to grey and the ring stays white, hugging the edge as a pale outline. Re-tinting
285
+ `--tl-color-panel-contrast` here wouldn't reach it: `--tl-shadow-3` is declared on the container,
286
+ so its var() was already substituted there and the white is baked into what we inherit. Instead
287
+ lay a ring of the new surface over the old one — first shadow in the list paints on top. */
288
+ .tlui-cmt-stack-list__card:hover,
289
+ .tlui-cmt-preview-card--selectable:hover,
290
+ .tlui-cmt-canvas-preview__panel--thread.tlui-cmt-canvas-preview__panel--selectable:hover {
291
+ --tlui-cmt-preview-hover-surface: color-mix(
292
+ in srgb,
293
+ var(--tl-color-low) 50%,
294
+ var(--tl-color-panel)
295
+ );
296
+ background: var(--tlui-cmt-preview-hover-surface);
297
+ box-shadow:
298
+ inset 0 0 0 1px var(--tlui-cmt-preview-hover-surface),
299
+ var(--tl-shadow-3);
300
+ cursor: pointer;
301
+ }
302
+
303
+ .tlui-cmt-preview-card .tlui-cmt-card {
304
+ width: 100%;
305
+ gap: 0;
306
+ padding: 0;
307
+ background: transparent;
308
+ border: none;
309
+ }
310
+
311
+ /* A preview is a glance, not a list — past a few cards it says how many were left out rather than
312
+ growing to the height of the cluster. */
313
+ .tlui-cmt-preview-more {
314
+ box-sizing: border-box;
315
+ width: 300px;
316
+ padding: 6px 14px;
317
+ border-radius: 12px;
318
+ background: var(--tl-color-panel);
319
+ box-shadow: var(--tl-shadow-3);
320
+ color: var(--tl-color-text-3);
321
+ font-size: 12px;
322
+ }
323
+
324
+ @media (prefers-reduced-motion: no-preference) {
325
+ .tlui-cmt-canvas-preview {
326
+ animation: tlui-cmt-preview-in 120ms ease;
327
+ }
328
+ @keyframes tlui-cmt-preview-in {
329
+ from {
330
+ opacity: 0;
331
+ }
332
+ to {
333
+ opacity: 1;
334
+ }
335
+ }
336
+ }
337
+
64
338
  /* A region anchor's area: a dashed box under the pins, non-interactive so canvas events pass
65
339
  through. Drawn for the live drag draft and for a region thread while hovered or open. */
66
- .cmt-canvas-region {
340
+ .tlui-cmt-canvas-region {
67
341
  position: absolute;
68
342
  pointer-events: none;
69
343
  border: 2px dashed var(--tl-color-selected);
@@ -73,13 +347,13 @@
73
347
 
74
348
  /* A movable region body (the 'body'/'both' move modes): draggable to translate the whole region.
75
349
  Interactive, so it captures the interior while shown — the tradeoff of dragging the body. */
76
- .cmt-canvas-region--movable {
350
+ .tlui-cmt-canvas-region--movable {
77
351
  pointer-events: auto;
78
352
  cursor: move;
79
353
  }
80
354
 
81
355
  /* Corner resize handles on a region box (three corners; the pin corner is the move handle). */
82
- .cmt-canvas-region-handle {
356
+ .tlui-cmt-canvas-region-handle {
83
357
  position: absolute;
84
358
  width: 9px;
85
359
  height: 9px;
@@ -91,58 +365,199 @@
91
365
  touch-action: none;
92
366
  }
93
367
 
94
- /* Centre the pin marker on its anchor point. */
95
- .cmt-canvas-pin__marker {
368
+ /* Anchor the pin by its bottom-left corner, so the marker's one sharp corner (the pin shape's
369
+ 3px bottom-left) points at the exact anchor point. */
370
+ .tlui-cmt-canvas-pin__marker {
371
+ position: relative;
96
372
  width: max-content;
97
- transform: translate(-50%, -50%);
98
- cursor: grab;
373
+ transform: translate(0, -100%);
374
+ /* Default at rest, like hovering a shape; the editor's move cursor while dragging (below). */
375
+ cursor: var(--tl-cursor-default);
99
376
  touch-action: none;
377
+ pointer-events: none;
378
+ }
379
+
380
+ /* Dragging a pin shows the same move cursor as dragging a shape. */
381
+ .tlui-cmt-canvas-pin--dragging .tlui-cmt-canvas-pin__marker {
382
+ cursor: var(--tl-cursor-move);
383
+ }
384
+
385
+ /* The predictable hit area: a fixed square over the marker's box, and the only part of the pin
386
+ that takes pointer events. Events over it target the marker (a pseudo-element's events report
387
+ its originating element), so the marker's handlers and :hover keep working — but the hit area
388
+ no longer stretches with pin content or scales with the hover transform. */
389
+ .tlui-cmt-canvas-pin__marker::after {
390
+ content: '';
391
+ position: absolute;
392
+ inset: 0;
393
+ pointer-events: auto;
394
+ }
395
+
396
+ /* With the hit layer targeting the marker, the pin visual is never the hovered element itself
397
+ (`:hover` matches the target and its ancestors, and the pin is the marker's child) — so the
398
+ canvas pin's hover has to key off the hit layer instead of the marker's own `:hover`. Only the
399
+ selector differs: the values come from the same tokens the shared rule uses, so a pin on the
400
+ canvas and a badge (which is hovered directly) lift by exactly the same amount. */
401
+ .tlui-cmt-canvas-pin__marker:hover .tlui-cmt-marker {
402
+ transform: scale(var(--tlui-cmt-marker-hover-scale));
403
+ }
404
+ .tlui-cmt-canvas-pin__marker:hover .tlui-cmt-marker:not(.tlui-cmt-marker--open) {
405
+ box-shadow: var(--tlui-cmt-marker-shadow-hover);
100
406
  }
101
- .cmt-canvas-pin__marker:active {
102
- cursor: grabbing;
407
+ /* The comment pin doesn't scale on hover — only the shadow lifts (badges still scale). */
408
+ .tlui-cmt-canvas-pin__marker:hover .tlui-cmt-pin {
409
+ transform: none;
103
410
  }
104
411
 
105
412
  /* The open thread's popover — portaled to the menus layer (above the UI), positioned at the pin. */
106
- .cmt-canvas-popover {
413
+ .tlui-cmt-canvas-popover {
107
414
  position: absolute;
108
415
  z-index: var(--tl-layer-menus);
109
416
  pointer-events: auto;
110
417
  }
111
418
 
112
419
  /* The placement composer — a distinct floating view (portaled to the menus layer, below the click
113
- point): a pencil "draft" avatar beside a pill field that is itself the surface (no wrapping
114
- panel). Scoped here so the in-thread reply composer keeps its own squarer look. */
115
- .cmt-canvas-composer {
420
+ point): a draft avatar pin beside a pill field that is itself the surface (no wrapping panel).
421
+ Scoped here so the in-thread reply composer keeps its own squarer look. */
422
+ .tlui-cmt-canvas-composer {
116
423
  position: absolute;
117
424
  z-index: var(--tl-layer-menus);
118
425
  pointer-events: auto;
119
- transform: translateY(8px);
120
- /* The rich-text editor has no intrinsic width (unlike the old <input>), so give the floating
121
- placement composer a definite width or it collapses to nothing. */
122
- width: 280px;
426
+ /* Anchor the draft avatar bottom-left like the pins it becomes: it is a pin wide and sits 4px
427
+ into the row, so its bottom-left corner is 4px right of and 4px + a pin below the composer's
428
+ top-left corner. */
429
+ transform: translate(-4px, calc(-4px - var(--tlui-cmt-pin-size)));
430
+ }
431
+
432
+ /* A region placement centres the draft avatar on the region's pin corner — the pin it becomes
433
+ straddles that corner. The avatar's centre sits 4px + half a pin into the composer. */
434
+ .tlui-cmt-canvas-composer--region {
435
+ --tlui-cmt-draft-avatar-centre: calc(4px + var(--tlui-cmt-pin-size) / 2);
436
+ transform: translate(
437
+ calc(-1 * var(--tlui-cmt-draft-avatar-centre)),
438
+ calc(-1 * var(--tlui-cmt-draft-avatar-centre))
439
+ );
123
440
  }
124
- .cmt-canvas-composer .cmt-composer__field {
441
+
442
+ /* Fallback placement (no composer to show): no draft avatar to anchor by, so no offset — a small
443
+ panel hanging off the click point, sized to its content (e.g. the host's sign-in prompt). */
444
+ .tlui-cmt-canvas-composer--fallback {
445
+ transform: none;
446
+ width: auto;
447
+ display: flex;
448
+ flex-direction: column;
449
+ padding: 8px;
125
450
  background: var(--tl-color-panel);
126
- border-color: transparent;
127
451
  border-radius: var(--tl-radius-4);
452
+ box-shadow: var(--tl-shadow-3);
453
+ }
454
+ .tlui-cmt-canvas-composer .tlui-cmt-composer {
455
+ gap: 6px;
456
+ }
457
+ /* The card: a fixed 300×42 surface whose uniform 3px padding derives the 294×36 focusable input. */
458
+ .tlui-cmt-canvas-composer .tlui-cmt-composer__field {
459
+ position: relative;
460
+ flex: none;
461
+ width: 300px;
462
+ min-height: 42px;
463
+ padding: 3px;
464
+ border: none;
465
+ background: var(--tl-color-panel);
466
+ border-radius: var(--tl-radius-3);
467
+ box-shadow: var(--tl-shadow-2);
468
+ /* The pin is anchored by its bottom corner at the click point and can't move; raise the taller
469
+ card onto the shorter pin's centre instead. */
470
+ margin-top: -6px;
471
+ }
472
+ /* Focused (the placement composer autofocuses on mount): a selection-blue ring inset 3px from the
473
+ card edge, so the card frames a bordered input rather than the border sitting on the card edge. */
474
+ .tlui-cmt-canvas-composer .tlui-cmt-composer__field:focus-within::before {
475
+ content: '';
476
+ position: absolute;
477
+ inset: 3px;
478
+ border: 1px solid var(--tl-color-selected);
479
+ border-radius: var(--tl-radius-2);
480
+ pointer-events: none;
481
+ }
482
+ /* The text sits 12px in from the focus ring rather than against it. The placeholder is absolutely
483
+ positioned (it ignores the wrap's padding), so it carries the same offset itself. */
484
+ .tlui-cmt-canvas-composer .tlui-cmt-composer__input-wrap {
485
+ padding: 4.5px 12px;
486
+ }
487
+ .tlui-cmt-canvas-composer .tlui-cmt-composer__field--expanded .tlui-cmt-composer__input-wrap {
488
+ /* The base expanded rule re-pads the right edge for the squarer composer's geometry; here the
489
+ 12px is already symmetric. */
490
+ padding-right: 12px;
491
+ }
492
+ .tlui-cmt-canvas-composer .tlui-cmt-input__placeholder {
493
+ left: 12px;
494
+ }
495
+ /* The draft avatar previews the pin it becomes — a white 28px pin holding the author's 22px avatar
496
+ circle — sharing the composer's lift. Not interactive: it drops the pin's pointer cursor and
497
+ hover affordances (scale + shadow bump), but keeps a 40×40 hit area (the ::after below). */
498
+ .tlui-cmt-canvas-composer .tlui-cmt-pin {
499
+ position: relative;
500
+ box-shadow: var(--tl-shadow-2);
501
+ cursor: default;
502
+ }
503
+ .tlui-cmt-canvas-composer .tlui-cmt-pin::after {
504
+ content: '';
505
+ position: absolute;
506
+ inset: -6px;
507
+ }
508
+ .tlui-cmt-canvas-composer .tlui-cmt-pin:hover {
509
+ transform: none;
128
510
  box-shadow: var(--tl-shadow-2);
129
511
  }
512
+ /* The placement composer's send button — a bare arrow, no pill: grey while empty, black once
513
+ there's something to send. A 28px square centred in the 36px input height, so its hover wash
514
+ clears the focus ring rather than butting against it; the ::after keeps a 40×40 hit area. */
515
+ .tlui-cmt-canvas-composer .tlui-cmt-send {
516
+ position: relative;
517
+ width: 28px;
518
+ height: 28px;
519
+ margin-right: 4px;
520
+ background: transparent;
521
+ border-radius: var(--tl-radius-2);
522
+ color: var(--tl-color-text-3);
523
+ }
524
+ .tlui-cmt-canvas-composer .tlui-cmt-send::after {
525
+ content: '';
526
+ position: absolute;
527
+ inset: -6px;
528
+ }
529
+ .tlui-cmt-canvas-composer .tlui-cmt-send:not(:disabled) {
530
+ color: var(--tl-color-text-1);
531
+ }
532
+ /* Hover and press wash grey behind the bare arrow (the same treatment as the thread actions),
533
+ overriding the base button's blue fill. */
534
+ .tlui-cmt-canvas-composer .tlui-cmt-send:hover:not(:disabled) {
535
+ background: var(--tl-color-muted-2);
536
+ }
537
+ .tlui-cmt-canvas-composer .tlui-cmt-send:active:not(:disabled) {
538
+ background: var(--tl-color-muted-1);
539
+ }
540
+ /* In the expanded (multi-line) layout the send drops to the bottom-right corner; give it the same
541
+ 4px gap from the focus ring on the bottom that it already keeps on the right. */
542
+ .tlui-cmt-canvas-composer .tlui-cmt-composer__field--expanded .tlui-cmt-send {
543
+ margin-bottom: 4px;
544
+ }
130
545
 
131
- /* The comments list panel — a right-side surface shown while the comment tool is active. Below
132
- the popover layer, so an open thread still draws over it. Sits under the top-right share panel
133
- (top offset clears its ~48px height) and sizes to its content, scrolling past max-height rather
134
- than stretching the full canvas height. */
135
- .cmt-canvas-sidebar {
546
+ /* The comments list panel — a right-side surface shown while the comments sidebar is open. Below
547
+ the popover layer, so an open thread still draws over it. Its top aligns flush with the style
548
+ panel (48px from the top, clearing the share panel) and it sizes to its content, scrolling past
549
+ max-height rather than stretching the full canvas height. */
550
+ .tlui-cmt-canvas-sidebar {
136
551
  position: absolute;
137
- top: 56px;
552
+ top: 48px;
138
553
  right: 8px;
139
554
  width: 280px;
140
- max-height: calc(100% - 64px);
555
+ max-height: calc(100% - 56px);
141
556
  z-index: var(--tl-layer-panels);
142
557
  pointer-events: auto;
143
558
  display: flex;
144
559
  background: var(--tl-color-panel);
145
560
  border-radius: var(--tl-radius-4);
146
- box-shadow: var(--tl-shadow-2);
561
+ box-shadow: var(--tl-shadow-3);
147
562
  overflow: hidden;
148
563
  }