@rtif-sdk/web 1.4.0 → 1.5.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 (44) hide show
  1. package/dist/block-drag-handler.d.ts +26 -0
  2. package/dist/block-drag-handler.d.ts.map +1 -1
  3. package/dist/block-drag-handler.js +33 -23
  4. package/dist/block-drag-handler.js.map +1 -1
  5. package/dist/block-gutter.d.ts +81 -0
  6. package/dist/block-gutter.d.ts.map +1 -0
  7. package/dist/block-gutter.js +331 -0
  8. package/dist/block-gutter.js.map +1 -0
  9. package/dist/drop-indicator.d.ts.map +1 -1
  10. package/dist/drop-indicator.js +8 -34
  11. package/dist/drop-indicator.js.map +1 -1
  12. package/dist/editor.d.ts.map +1 -1
  13. package/dist/editor.js +23 -11
  14. package/dist/editor.js.map +1 -1
  15. package/dist/floating-toolbar.d.ts.map +1 -1
  16. package/dist/floating-toolbar.js +4 -7
  17. package/dist/floating-toolbar.js.map +1 -1
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +2 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/link-popover.d.ts.map +1 -1
  23. package/dist/link-popover.js +2 -43
  24. package/dist/link-popover.js.map +1 -1
  25. package/dist/renderer.d.ts.map +1 -1
  26. package/dist/renderer.js +27 -5
  27. package/dist/renderer.js.map +1 -1
  28. package/dist/selection-sync.d.ts.map +1 -1
  29. package/dist/selection-sync.js +20 -3
  30. package/dist/selection-sync.js.map +1 -1
  31. package/dist/types.d.ts +6 -0
  32. package/dist/types.d.ts.map +1 -1
  33. package/package.json +8 -4
  34. package/styles/all.css +20 -0
  35. package/styles/base.css +33 -0
  36. package/styles/block-gutter.css +76 -0
  37. package/styles/blocks.css +199 -0
  38. package/styles/drop-indicator.css +37 -0
  39. package/styles/floating-toolbar.css +51 -0
  40. package/styles/link-popover.css +64 -0
  41. package/styles/marks.css +27 -0
  42. package/styles/mention.css +17 -0
  43. package/styles/pickers.css +317 -0
  44. package/styles/toolbar.css +151 -0
package/dist/types.d.ts CHANGED
@@ -42,6 +42,12 @@ export interface WebEditorConfig {
42
42
  * Default: false.
43
43
  */
44
44
  readonly autoFocus?: boolean;
45
+ /**
46
+ * Enable the block gutter toolbar (hover-revealed + button and drag handle).
47
+ * Set to `false` to disable the gutter entirely.
48
+ * Default: `true`.
49
+ */
50
+ readonly gutter?: boolean;
45
51
  /**
46
52
  * Auto-create a link popover for Cmd+K and click-to-edit.
47
53
  * Requires the link plugin on the engine (included in all presets except PRESET_PLAINTEXT).
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAE/B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,iBAAiB,EAAE,SAAS,CAAC,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;IACzB,+BAA+B;IAC/B,OAAO,IAAI,IAAI,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtif-sdk/web",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "RTIF web platform implementation (contenteditable)",
5
5
  "author": "coryrobinson42@gmail.com",
6
6
  "type": "module",
@@ -10,12 +10,16 @@
10
10
  ".": {
11
11
  "types": "./dist/index.d.ts",
12
12
  "import": "./dist/index.js"
13
- }
13
+ },
14
+ "./styles/*": "./styles/*"
14
15
  },
15
16
  "files": [
16
- "dist"
17
+ "dist",
18
+ "styles"
19
+ ],
20
+ "sideEffects": [
21
+ "./styles/*.css"
17
22
  ],
18
- "sideEffects": false,
19
23
  "engines": {
20
24
  "node": ">=20.0.0"
21
25
  },
package/styles/all.css ADDED
@@ -0,0 +1,20 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF — All Styles
3
+ *
4
+ * Import this file to include all RTIF component styles.
5
+ * For selective loading, import individual files instead.
6
+ *
7
+ * Usage:
8
+ * import '@rtif-sdk/web/styles/all.css';
9
+ * -------------------------------------------------------- */
10
+
11
+ @import './base.css';
12
+ @import './marks.css';
13
+ @import './blocks.css';
14
+ @import './toolbar.css';
15
+ @import './floating-toolbar.css';
16
+ @import './link-popover.css';
17
+ @import './block-gutter.css';
18
+ @import './drop-indicator.css';
19
+ @import './pickers.css';
20
+ @import './mention.css';
@@ -0,0 +1,33 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF Base Styles
3
+ *
4
+ * CSS custom properties for theming, scoped to .rtif-editor.
5
+ * Uses :where() for 0 specificity — easy to override.
6
+ * -------------------------------------------------------- */
7
+
8
+ :where(.rtif-editor) {
9
+ --rtif-accent-color: #2563eb;
10
+ --rtif-surface: #fff;
11
+ --rtif-border: #ccc;
12
+ --rtif-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
13
+ --rtif-radius: 6px;
14
+ --rtif-radius-sm: 4px;
15
+ --rtif-ui-font: system-ui, -apple-system, sans-serif;
16
+ --rtif-ui-font-size: 14px;
17
+ --rtif-z-gutter: 5;
18
+ --rtif-z-drop-line: 10;
19
+ --rtif-z-drop-overlay: 20;
20
+ --rtif-z-popover: 9999;
21
+ }
22
+
23
+ /* Utility: hide elements via class toggle instead of inline display */
24
+ .rtif-hidden {
25
+ display: none !important;
26
+ }
27
+
28
+ /* Placeholder text for empty editor */
29
+ [data-empty]::before {
30
+ content: attr(data-placeholder);
31
+ color: #aaa;
32
+ pointer-events: none;
33
+ }
@@ -0,0 +1,76 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF Block Gutter & Drag Handle Styles
3
+ *
4
+ * Notion-style hover toolbar to the left of blocks.
5
+ * Position (top, height) set by JS. Left offset defined
6
+ * here as a CSS property for easy override.
7
+ * -------------------------------------------------------- */
8
+
9
+ .rtif-block-gutter {
10
+ position: absolute;
11
+ left: -48px;
12
+ display: flex;
13
+ align-items: center;
14
+ gap: 2px;
15
+ z-index: var(--rtif-z-gutter, 5);
16
+ user-select: none;
17
+ }
18
+
19
+ .rtif-gutter-add {
20
+ width: 20px;
21
+ height: 20px;
22
+ border: none;
23
+ background: transparent;
24
+ cursor: pointer;
25
+ border-radius: var(--rtif-radius-sm, 4px);
26
+ font-size: 16px;
27
+ line-height: 1;
28
+ color: currentColor;
29
+ opacity: 0.4;
30
+ padding: 0;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ }
35
+
36
+ .rtif-gutter-add:hover {
37
+ opacity: 0.7;
38
+ background: rgba(0, 0, 0, 0.04);
39
+ }
40
+
41
+ /* Drag handle — shared visual styles for gutter and standalone contexts */
42
+ .rtif-drag-handle {
43
+ width: 20px;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ cursor: grab;
48
+ opacity: 0.4;
49
+ user-select: none;
50
+ font-size: 14px;
51
+ line-height: 1;
52
+ color: currentColor;
53
+ border: none;
54
+ background: transparent;
55
+ padding: 0;
56
+ }
57
+
58
+ /* Standalone drag handle (outside gutter) — positioned absolutely */
59
+ .rtif-drag-handle:not(.rtif-block-gutter .rtif-drag-handle) {
60
+ position: absolute;
61
+ z-index: var(--rtif-z-gutter, 5);
62
+ }
63
+
64
+ /* Drag handle inside gutter — inherits gutter's positioning, add height */
65
+ .rtif-block-gutter .rtif-drag-handle {
66
+ height: 20px;
67
+ }
68
+
69
+ .rtif-drag-handle:hover {
70
+ opacity: 0.7;
71
+ }
72
+
73
+ /* Block being dragged */
74
+ .rtif-block-dragging {
75
+ opacity: 0.5;
76
+ }
@@ -0,0 +1,199 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF Block Type Styles
3
+ *
4
+ * Classes applied by block renderers in block-renderer.ts.
5
+ * Block attrs (align, indent) use inline styles for dynamic
6
+ * values — not covered here.
7
+ * -------------------------------------------------------- */
8
+
9
+ /* ---- Headings ---- */
10
+ .rtif-heading {
11
+ font-weight: 700;
12
+ line-height: 1.3;
13
+ margin-top: 0.5em;
14
+ }
15
+
16
+ .rtif-h1 { font-size: 1.75em; }
17
+ .rtif-h2 { font-size: 1.375em; }
18
+ .rtif-h3 { font-size: 1.125em; }
19
+ .rtif-h4 { font-size: 1em; }
20
+ .rtif-h5 { font-size: 0.875em; }
21
+ .rtif-h6 { font-size: 0.75em; }
22
+
23
+ /* ---- Lists ---- */
24
+ [data-block-type="list-item"] {
25
+ padding-left: 1.5em;
26
+ position: relative;
27
+ }
28
+
29
+ [data-block-type="list-item"][data-list-style="bullet"]::before {
30
+ content: '\2022'; /* bullet */
31
+ position: absolute;
32
+ left: 0.25em;
33
+ color: #888;
34
+ }
35
+
36
+ [data-block-type="list-item"][data-list-style="ordered"] {
37
+ counter-increment: rtif-list;
38
+ }
39
+
40
+ [data-block-type="list-item"][data-list-style="ordered"]::before {
41
+ content: counter(rtif-list) '.';
42
+ position: absolute;
43
+ left: 0;
44
+ color: #888;
45
+ font-size: 0.875em;
46
+ }
47
+
48
+ /* Reset counter when a non-list block appears */
49
+ [data-block-type="text"],
50
+ .rtif-heading,
51
+ .rtif-blockquote,
52
+ .rtif-code-block {
53
+ counter-reset: rtif-list;
54
+ }
55
+
56
+ /* Nested list indentation */
57
+ [data-list-depth="1"] { padding-left: 3em; }
58
+ [data-list-depth="2"] { padding-left: 4.5em; }
59
+ [data-list-depth="3"] { padding-left: 6em; }
60
+ [data-list-depth="4"] { padding-left: 7.5em; }
61
+ [data-list-depth="5"] { padding-left: 9em; }
62
+
63
+ /* ---- Blockquote ---- */
64
+ .rtif-blockquote {
65
+ border-left: 3px solid #d0d0d0;
66
+ padding-left: 1em;
67
+ color: #555;
68
+ font-style: italic;
69
+ }
70
+
71
+ /* ---- Code block ---- */
72
+ .rtif-code-block {
73
+ font-family: 'SF Mono', Menlo, Consolas, monospace;
74
+ font-size: 0.875rem;
75
+ background: #1e1e2e;
76
+ color: #cdd6f4;
77
+ padding: 1em 1.25em;
78
+ border-radius: 6px;
79
+ line-height: 1.5;
80
+ white-space: pre-wrap;
81
+ }
82
+
83
+ /* ---- Horizontal rule ---- */
84
+ [data-block-type="hr"] {
85
+ border: none;
86
+ border-top: 1px solid #ddd;
87
+ margin: 0.75em 0;
88
+ min-height: 1px;
89
+ }
90
+
91
+ /* ---- Callout ---- */
92
+ .rtif-callout {
93
+ padding: 0.75em 1em;
94
+ border-radius: 6px;
95
+ border-left: 4px solid;
96
+ margin: 0.5em 0;
97
+ }
98
+
99
+ .rtif-callout[data-variant="info"] { background: #e8f4fd; border-color: #3b82f6; }
100
+ .rtif-callout[data-variant="warning"] { background: #fef3cd; border-color: #f59e0b; }
101
+ .rtif-callout[data-variant="error"] { background: #fee2e2; border-color: #ef4444; }
102
+ .rtif-callout[data-variant="success"] { background: #d1fae5; border-color: #10b981; }
103
+ .rtif-callout[data-variant="note"] { background: #f3f4f6; border-color: #6b7280; }
104
+
105
+ .rtif-callout-icon {
106
+ margin-right: 0.5em;
107
+ }
108
+
109
+ /* ---- Image block ---- */
110
+ [data-block-type="image"] {
111
+ text-align: center;
112
+ padding: 0.5em 0;
113
+ margin: 0.5em 0;
114
+ }
115
+
116
+ [data-block-type="image"] img {
117
+ max-width: 100%;
118
+ max-height: 500px;
119
+ border-radius: 6px;
120
+ object-fit: contain;
121
+ }
122
+
123
+ /* Upload in progress (data URL src) */
124
+ [data-block-type="image"] img[src^="data:"] {
125
+ opacity: 0.7;
126
+ outline: 2px dashed #3b82f6;
127
+ outline-offset: 4px;
128
+ }
129
+
130
+ /* ---- Embed block ---- */
131
+ [data-block-type="embed"] {
132
+ margin: 0.5em 0;
133
+ border-radius: 6px;
134
+ overflow: hidden;
135
+ }
136
+
137
+ /* Video embeds (YouTube, Vimeo) — 16:9 responsive */
138
+ .rtif-embed-video {
139
+ position: relative;
140
+ padding-bottom: 56.25%;
141
+ height: 0;
142
+ overflow: hidden;
143
+ background: #000;
144
+ border-radius: 6px;
145
+ }
146
+
147
+ .rtif-embed-video .rtif-embed-iframe {
148
+ position: absolute;
149
+ top: 0;
150
+ left: 0;
151
+ width: 100%;
152
+ height: 100%;
153
+ border: none;
154
+ }
155
+
156
+ /* Twitter/X embeds */
157
+ .rtif-embed-tweet {
158
+ padding: 1em;
159
+ background: #f9fafb;
160
+ border: 1px solid #e0e0e0;
161
+ border-radius: 6px;
162
+ }
163
+
164
+ .rtif-embed-tweet-quote {
165
+ margin: 0;
166
+ padding: 0.75em 1em;
167
+ border-left: 3px solid #1da1f2;
168
+ font-size: 0.9375rem;
169
+ color: #333;
170
+ }
171
+
172
+ .rtif-embed-tweet-quote a {
173
+ color: #1da1f2;
174
+ text-decoration: none;
175
+ font-weight: 500;
176
+ }
177
+
178
+ .rtif-embed-tweet-quote a:hover {
179
+ text-decoration: underline;
180
+ }
181
+
182
+ /* Generic embeds */
183
+ .rtif-embed-generic {
184
+ padding: 1em;
185
+ background: #f9fafb;
186
+ border: 1px solid #e0e0e0;
187
+ border-radius: 6px;
188
+ text-align: center;
189
+ }
190
+
191
+ .rtif-embed-link {
192
+ color: #1a73e8;
193
+ text-decoration: none;
194
+ font-size: 0.875rem;
195
+ }
196
+
197
+ .rtif-embed-link:hover {
198
+ text-decoration: underline;
199
+ }
@@ -0,0 +1,37 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF Drop Indicator Styles
3
+ *
4
+ * Visual feedback for drag-and-drop. Line position (top)
5
+ * set by JS. All visual properties are CSS-driven.
6
+ * -------------------------------------------------------- */
7
+
8
+ .rtif-drop-indicator {
9
+ position: absolute;
10
+ height: 2px;
11
+ left: 0;
12
+ right: 0;
13
+ background-color: var(--rtif-accent-color, #2563eb);
14
+ pointer-events: none;
15
+ z-index: var(--rtif-z-drop-line, 10);
16
+ }
17
+
18
+ .rtif-drop-overlay {
19
+ position: absolute;
20
+ inset: 0;
21
+ z-index: var(--rtif-z-drop-overlay, 20);
22
+ pointer-events: none;
23
+ border: 2px dashed var(--rtif-accent-color, #2563eb);
24
+ border-radius: var(--rtif-radius-sm, 4px);
25
+ background-color: rgba(37, 99, 235, 0.05);
26
+ display: flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ }
30
+
31
+ .rtif-drop-overlay-label {
32
+ color: var(--rtif-accent-color, #2563eb);
33
+ font-size: var(--rtif-ui-font-size, 14px);
34
+ font-weight: 500;
35
+ pointer-events: none;
36
+ user-select: none;
37
+ }
@@ -0,0 +1,51 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF Floating Toolbar Styles
3
+ *
4
+ * Appears near text selection. Positioned via JS (top/left).
5
+ * Structural properties (position, z-index) defined here.
6
+ * -------------------------------------------------------- */
7
+
8
+ .rtif-floating-toolbar {
9
+ position: fixed;
10
+ z-index: var(--rtif-z-popover, 9999);
11
+ display: flex;
12
+ align-items: center;
13
+ gap: 2px;
14
+ padding: 4px;
15
+ background: var(--rtif-surface, #fff);
16
+ border: 1px solid var(--rtif-border, #d0d0d0);
17
+ border-radius: var(--rtif-radius, 6px);
18
+ box-shadow: var(--rtif-shadow, 0 2px 8px rgba(0, 0, 0, 0.15));
19
+ }
20
+
21
+ .rtif-floating-toolbar-button {
22
+ display: inline-flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ min-width: 28px;
26
+ height: 28px;
27
+ padding: 0 4px;
28
+ border: none;
29
+ border-radius: var(--rtif-radius-sm, 4px);
30
+ background: transparent;
31
+ font-size: 0.75rem;
32
+ font-weight: 600;
33
+ color: #444;
34
+ cursor: pointer;
35
+ transition: background 0.1s;
36
+ }
37
+
38
+ .rtif-floating-toolbar-button:hover {
39
+ background: #e8e8e8;
40
+ }
41
+
42
+ .rtif-floating-toolbar-button[aria-pressed="true"],
43
+ .rtif-floating-toolbar-button.rtif-floating-toolbar-active {
44
+ background: #d0e0ff;
45
+ color: #1a5ccc;
46
+ }
47
+
48
+ .rtif-floating-toolbar-button[aria-disabled="true"] {
49
+ opacity: 0.3;
50
+ cursor: not-allowed;
51
+ }
@@ -0,0 +1,64 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF Link Popover Styles
3
+ *
4
+ * Floating dialog for creating/editing links. Positioned
5
+ * via JS (top/left). All visual properties are CSS-driven.
6
+ * -------------------------------------------------------- */
7
+
8
+ .rtif-link-popover {
9
+ position: fixed;
10
+ z-index: var(--rtif-z-popover, 9999);
11
+ background-color: var(--rtif-surface, #fff);
12
+ border: 1px solid var(--rtif-border, #ccc);
13
+ border-radius: var(--rtif-radius, 6px);
14
+ padding: 8px;
15
+ box-shadow: var(--rtif-shadow, 0 2px 8px rgba(0, 0, 0, 0.15));
16
+ display: flex;
17
+ align-items: center;
18
+ gap: 6px;
19
+ font-family: var(--rtif-ui-font, system-ui, -apple-system, sans-serif);
20
+ font-size: var(--rtif-ui-font-size, 14px);
21
+ }
22
+
23
+ .rtif-link-popover-input {
24
+ flex: 1;
25
+ min-width: 200px;
26
+ padding: 4px 8px;
27
+ border: 1px solid var(--rtif-border, #ccc);
28
+ border-radius: var(--rtif-radius-sm, 4px);
29
+ font-size: var(--rtif-ui-font-size, 14px);
30
+ outline: none;
31
+ }
32
+
33
+ .rtif-link-popover-input:focus {
34
+ border-color: var(--rtif-accent-color, #0066cc);
35
+ box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
36
+ }
37
+
38
+ .rtif-link-popover-apply {
39
+ padding: 4px 12px;
40
+ border: none;
41
+ border-radius: var(--rtif-radius-sm, 4px);
42
+ background-color: var(--rtif-accent-color, #0066cc);
43
+ color: #fff;
44
+ cursor: pointer;
45
+ font-size: 13px;
46
+ }
47
+
48
+ .rtif-link-popover-apply:hover {
49
+ filter: brightness(0.85);
50
+ }
51
+
52
+ .rtif-link-popover-remove {
53
+ padding: 4px 12px;
54
+ border: 1px solid #cc0000;
55
+ border-radius: var(--rtif-radius-sm, 4px);
56
+ background-color: transparent;
57
+ color: #cc0000;
58
+ cursor: pointer;
59
+ font-size: 13px;
60
+ }
61
+
62
+ .rtif-link-popover-remove:hover {
63
+ background-color: rgba(204, 0, 0, 0.08);
64
+ }
@@ -0,0 +1,27 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF Inline Mark Styles
3
+ *
4
+ * Classes applied by mark renderers in mark-renderer.ts.
5
+ * Parameterized marks (color, fontSize, fontFamily) use
6
+ * inline styles for dynamic values — not covered here.
7
+ * -------------------------------------------------------- */
8
+
9
+ .rtif-bold { font-weight: 700; }
10
+ .rtif-italic { font-style: italic; }
11
+ .rtif-underline { text-decoration: underline; }
12
+ .rtif-strikethrough { text-decoration: line-through; }
13
+ .rtif-underline.rtif-strikethrough { text-decoration: underline line-through; }
14
+
15
+ .rtif-code {
16
+ font-family: 'SF Mono', Menlo, Consolas, monospace;
17
+ font-size: 0.875em;
18
+ padding: 0.15em 0.35em;
19
+ border-radius: 3px;
20
+ background: #f0f0f0;
21
+ }
22
+
23
+ .rtif-link {
24
+ color: #1a73e8;
25
+ text-decoration: underline;
26
+ cursor: pointer;
27
+ }
@@ -0,0 +1,17 @@
1
+ /* --------------------------------------------------------
2
+ * RTIF Mention Chip Styles
3
+ *
4
+ * Inline mention chip rendered by mention-plugin.ts.
5
+ * The element has contenteditable="false" and atomic: true.
6
+ * -------------------------------------------------------- */
7
+
8
+ .rtif-mention {
9
+ display: inline;
10
+ padding: 0.1em 0.4em;
11
+ border-radius: 4px;
12
+ background: #e8f0fe;
13
+ color: #1a5ccc;
14
+ font-weight: 500;
15
+ font-size: 0.9375em;
16
+ white-space: nowrap;
17
+ }