File size: 3,203 Bytes
76fc93a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
08e4c7a
 
 
 
 
 
 
76fc93a
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/* ============================================================================ */
/* Editor chrome inside ProseMirror                                             */
/*                                                                              */
/* Editing-only visuals: math editors, placeholders, selection outlines,        */
/* collaboration cursors, comment marks. None of these appear in published HTML.*/
/* ============================================================================ */

/* ---- Math editing ---- */

.tiptap [data-type="inline-math"],
.tiptap [data-type="block-math"] {
  cursor: pointer;
}

.tiptap [data-type="inline-math"] .tiptap-mathematics-editor {
  font-family: "SFMono-Regular", "Fira Code", monospace;
  font-size: 0.85em;
  color: var(--code-text);
  background: var(--code-bg);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  outline: none;
}

.tiptap [data-type="block-math"] .tiptap-mathematics-editor {
  display: block;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--code-text);
  background: var(--bg-code-block);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: var(--spacing-1) var(--spacing-3);
  outline: none;
  text-align: center;
}

/* ---- Selection highlights ---- */

.tiptap .selectedCell { background: var(--accent-bg); }

.tiptap .ProseMirror-selectednode img {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: 8px;
}

.tiptap [data-component].ProseMirror-selectednode {
  outline: 2px solid rgba(149, 141, 241, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---- Comment marks ---- */

.comment-mark {
  background: var(--accent-bg);
  border-bottom: 2px solid rgba(149, 141, 241, 0.4);
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}
.comment-mark:hover { background: var(--accent-bg-hover); }
.comment-mark.resolved {
  background: transparent;
  border-bottom: 1px dashed var(--border-color);
}

/* ---- Collaboration cursors ---- */

.collaboration-cursor__caret {
  position: relative;
  margin-left: -1px;
  margin-right: -1px;
  border-left: 2px solid;
  word-break: normal;
  pointer-events: none;
}

.collaboration-cursor__label {
  position: absolute;
  top: -1.4em;
  left: -1px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px 3px 3px 0;
  white-space: nowrap;
  color: #000;
  user-select: none;
  pointer-events: none;
}

.collaboration-cursor__avatar {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* When a peer also broadcasts an `agentFocus`, the AgentFocus decoration
   already renders a "<Name> agent" label on the working range. We hide
   the plain caret+label here so the same user isn't shown twice. */
.collaboration-cursor--silenced {
  display: none !important;
}

/* ---- Placeholder ---- */

.tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--text-faint);
  pointer-events: none;
  height: 0;
}