@brevitaz/brv-text-editor 1.1.2 → 1.2.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.
- package/README.md +70 -177
- package/dist/brv-text-editor.css +2 -2
- package/dist/brv-text-editor.es.js +4 -116
- package/dist/brv-text-editor.es.js.map +1 -1
- package/dist/brv-text-editor.umd.js +4 -116
- package/dist/brv-text-editor.umd.js.map +1 -1
- package/package.json +4 -3
- package/screenshots/editor.png +0 -0
- package/screenshots/preview.png +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
# brv-text-editor
|
|
1
|
+
# @brevitaz/brv-text-editor
|
|
2
2
|
|
|
3
|
-
A fully-
|
|
4
|
-
|
|
3
|
+
A fully-featured React rich text editor and preview component built on [Tiptap](https://tiptap.dev/) (ProseMirror) + [Lucide React](https://lucide.dev/) icons.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+

|
|
5
8
|
|
|
6
9
|
---
|
|
7
10
|
|
|
@@ -16,20 +19,21 @@ Built on [Tiptap](https://tiptap.dev/) (ProseMirror) + [Lucide React](https://lu
|
|
|
16
19
|
| **Callouts** | 6 themed callout blocks — Info, Success, Warning, Danger, Tip, Note |
|
|
17
20
|
| **Alignment** | Left, center, right text alignment |
|
|
18
21
|
| **Media** | Insert links (with edit/remove popover) and images by URL |
|
|
19
|
-
| **History** | Undo / Redo
|
|
22
|
+
| **History** | Undo / Redo |
|
|
20
23
|
| **Configurable toolbar** | Enable/disable toolbar groups via the `toolbar` prop |
|
|
21
24
|
| **Word count** | Live character and word count in the footer |
|
|
22
|
-
| **
|
|
25
|
+
| **Theming** | Built-in presets + full CSS variable customisation via `createTheme()` |
|
|
26
|
+
| **Preview** | `RichTextPreview` renders saved HTML in a styled card with emoji reactions |
|
|
23
27
|
|
|
24
28
|
---
|
|
25
29
|
|
|
26
30
|
## Installation
|
|
27
31
|
|
|
28
32
|
```bash
|
|
29
|
-
npm install brv-text-editor
|
|
33
|
+
npm install @brevitaz/brv-text-editor
|
|
30
34
|
```
|
|
31
35
|
|
|
32
|
-
> **Peer dependencies**
|
|
36
|
+
> **Peer dependencies** — React 19 must already be installed in your project.
|
|
33
37
|
> `react` and `react-dom` are **not** bundled inside the package.
|
|
34
38
|
|
|
35
39
|
```bash
|
|
@@ -45,13 +49,13 @@ npm install react react-dom
|
|
|
45
49
|
|
|
46
50
|
```js
|
|
47
51
|
// main.jsx / main.tsx / _app.jsx
|
|
48
|
-
import 'brv-text-editor/dist/brv-text-editor.css'
|
|
52
|
+
import '@brevitaz/brv-text-editor/dist/brv-text-editor.css'
|
|
49
53
|
```
|
|
50
54
|
|
|
51
55
|
### 2. Use the editor
|
|
52
56
|
|
|
53
57
|
```jsx
|
|
54
|
-
import { RichTextEditor } from 'brv-text-editor'
|
|
58
|
+
import { RichTextEditor } from '@brevitaz/brv-text-editor'
|
|
55
59
|
|
|
56
60
|
function MyPage() {
|
|
57
61
|
const handleSave = (html) => {
|
|
@@ -74,16 +78,14 @@ function MyPage() {
|
|
|
74
78
|
|
|
75
79
|
```jsx
|
|
76
80
|
import { useState } from 'react'
|
|
77
|
-
import { RichTextEditor, RichTextPreview } from 'brv-text-editor'
|
|
78
|
-
|
|
79
|
-
const AUTHOR = { name: 'Jane Doe', initials: 'JD', avatarColor: '#1a6b3c' }
|
|
81
|
+
import { RichTextEditor, RichTextPreview } from '@brevitaz/brv-text-editor'
|
|
80
82
|
|
|
81
83
|
function NotesPage() {
|
|
82
84
|
const [notes, setNotes] = useState([])
|
|
83
85
|
|
|
84
86
|
const handleSave = (html) => {
|
|
85
87
|
setNotes(prev => [
|
|
86
|
-
{ id: Date.now(), html
|
|
88
|
+
{ id: Date.now(), html },
|
|
87
89
|
...prev,
|
|
88
90
|
])
|
|
89
91
|
}
|
|
@@ -93,13 +95,7 @@ function NotesPage() {
|
|
|
93
95
|
<RichTextEditor onSubmit={handleSave} submitLabel="Post" showActions />
|
|
94
96
|
|
|
95
97
|
{notes.map(note => (
|
|
96
|
-
<RichTextPreview
|
|
97
|
-
key={note.id}
|
|
98
|
-
html={note.html}
|
|
99
|
-
author={AUTHOR}
|
|
100
|
-
timestamp={note.timestamp}
|
|
101
|
-
onDismiss={() => setNotes(n => n.filter(x => x.id !== note.id))}
|
|
102
|
-
/>
|
|
98
|
+
<RichTextPreview key={note.id} html={note.html} />
|
|
103
99
|
))}
|
|
104
100
|
</>
|
|
105
101
|
)
|
|
@@ -124,6 +120,9 @@ function NotesPage() {
|
|
|
124
120
|
| `minHeight` | `number` | `140` | Minimum editor height in pixels |
|
|
125
121
|
| `autofocus` | `boolean` | `false` | Whether to focus the editor on mount |
|
|
126
122
|
| `toolbar` | `object` | `DEFAULT_TOOLBAR` | Toggle toolbar groups (see below) |
|
|
123
|
+
| `theme` | `string` | `'unleashteams'` | Built-in theme preset |
|
|
124
|
+
| `themeVars` | `object` | `{}` | CSS variable overrides for custom theming |
|
|
125
|
+
| `className` | `string` | `''` | Additional class for the root wrapper |
|
|
127
126
|
|
|
128
127
|
#### Toolbar groups
|
|
129
128
|
|
|
@@ -168,184 +167,76 @@ Callouts are stored as `<div data-callout="type">` in the HTML output, so they r
|
|
|
168
167
|
| Prop | Type | Default | Description |
|
|
169
168
|
|---|---|---|---|
|
|
170
169
|
| `html` | `string` | `''` | Raw HTML string to render |
|
|
171
|
-
| `author` | `{ name, initials, avatarColor? }` | `{ name:'Anonymous', initials:'A' }` | Author info shown in the card header |
|
|
172
|
-
| `timestamp` | `string` | `''` | Human-readable timestamp string |
|
|
173
|
-
| `onDismiss` | `() => void` | — | If provided, shows a × button to remove the card |
|
|
174
170
|
| `showReactions` | `boolean` | `true` | Whether to show the emoji reactions row |
|
|
175
171
|
| `reactions` | `string[]` | `['👍','❤️','🎉','🙌']` | Emoji list for the reactions row |
|
|
172
|
+
| `theme` | `string` | `'unleashteams'` | Built-in theme preset |
|
|
173
|
+
| `themeVars` | `object` | `{}` | CSS variable overrides for custom theming |
|
|
176
174
|
|
|
177
175
|
---
|
|
178
176
|
|
|
179
|
-
##
|
|
180
|
-
|
|
181
|
-
You have two options: a **private npm registry** (recommended) or a **direct Git dependency**.
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
### Option A — Private npm registry (recommended)
|
|
186
|
-
|
|
187
|
-
This is the cleanest approach. Developers run a single `npm install` and get the package like any other.
|
|
188
|
-
|
|
189
|
-
#### Step 1 — Set up a registry
|
|
190
|
-
|
|
191
|
-
Choose one:
|
|
192
|
-
|
|
193
|
-
| Option | Notes |
|
|
194
|
-
|---|---|
|
|
195
|
-
| **GitHub Packages** | Free for private repos; scoped package (`@your-org/brv-text-editor`). Good if you already use GitHub. |
|
|
196
|
-
| **npm private registry** | Paid; works with unscoped names. |
|
|
197
|
-
| **Verdaccio** (self-hosted) | Free, runs on your own server/container. Full npm protocol compatible. |
|
|
198
|
-
| **AWS CodeArtifact / JFrog** | Enterprise options; cost depends on usage. |
|
|
199
|
-
|
|
200
|
-
#### Step 2 — Scope the package (recommended for private registries)
|
|
201
|
-
|
|
202
|
-
In `package.json`, rename to a scoped name:
|
|
203
|
-
|
|
204
|
-
```json
|
|
205
|
-
{
|
|
206
|
-
"name": "@your-org/brv-text-editor"
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
This prevents name collisions with the public registry.
|
|
211
|
-
|
|
212
|
-
#### Step 3 — Authenticate and publish
|
|
213
|
-
|
|
214
|
-
**GitHub Packages example:**
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
# 1. Create a Personal Access Token (PAT) with write:packages scope on GitHub
|
|
218
|
-
|
|
219
|
-
# 2. Login to the GitHub registry
|
|
220
|
-
npm login --registry=https://npm.pkg.github.com --scope=@your-org
|
|
221
|
-
|
|
222
|
-
# 3. Build the library
|
|
223
|
-
npm run build:lib
|
|
224
|
-
|
|
225
|
-
# 4. Publish
|
|
226
|
-
npm publish --registry=https://npm.pkg.github.com
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
**Verdaccio example:**
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
# 1. Start Verdaccio (or point to your hosted instance)
|
|
233
|
-
npx verdaccio # → http://localhost:4873
|
|
234
|
-
|
|
235
|
-
# 2. Create an account (first time only)
|
|
236
|
-
npm adduser --registry http://localhost:4873
|
|
237
|
-
|
|
238
|
-
# 3. Build and publish
|
|
239
|
-
npm run build:lib
|
|
240
|
-
npm publish --registry http://localhost:4873
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
#### Step 4 — Configure developers' machines
|
|
177
|
+
## Theming
|
|
244
178
|
|
|
245
|
-
|
|
246
|
-
Create or update `.npmrc` in their project (or the monorepo root):
|
|
179
|
+
Every color, font, border, and spacing value is driven by a CSS custom property. Override them at any scope.
|
|
247
180
|
|
|
248
|
-
|
|
249
|
-
# .npmrc – checked into source control
|
|
250
|
-
@your-org:registry=https://npm.pkg.github.com
|
|
251
|
-
# or for Verdaccio:
|
|
252
|
-
# @your-org:registry=http://your-verdaccio-host:4873
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
They also need to authenticate once:
|
|
181
|
+
### Built-in presets
|
|
256
182
|
|
|
257
|
-
```
|
|
258
|
-
|
|
183
|
+
```jsx
|
|
184
|
+
<RichTextEditor theme="classic" />
|
|
259
185
|
```
|
|
260
186
|
|
|
261
|
-
|
|
187
|
+
### Custom overrides via props
|
|
262
188
|
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
|
|
266
|
-
@your-org:registry=https://npm.pkg.github.com
|
|
189
|
+
```jsx
|
|
190
|
+
<RichTextEditor themeVars={{ '--rte-color-primary': '#7c3aed' }} />
|
|
267
191
|
```
|
|
268
192
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
npm install @your-org/brv-text-editor
|
|
273
|
-
```
|
|
193
|
+
### Using `createTheme()`
|
|
274
194
|
|
|
275
195
|
```jsx
|
|
276
|
-
import '@
|
|
277
|
-
|
|
196
|
+
import { RichTextEditor, createTheme } from '@brevitaz/brv-text-editor'
|
|
197
|
+
|
|
198
|
+
const myTheme = createTheme({
|
|
199
|
+
'--rte-color-primary': '#7c3aed',
|
|
200
|
+
'--rte-btn-active-bg': '#ede9fe',
|
|
201
|
+
'--rte-btn-active-color': '#7c3aed',
|
|
202
|
+
'--rte-color-primary-hover': '#faf5ff',
|
|
203
|
+
'--rte-focus-border': '#a78bfa',
|
|
204
|
+
'--rte-focus-ring': 'rgba(124, 58, 237, 0.18)',
|
|
205
|
+
'--rte-blockquote-border': '#a78bfa',
|
|
206
|
+
'--rte-checkbox-accent': '#7c3aed',
|
|
207
|
+
'--rte-selection-bg': '#ede9fe',
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
<RichTextEditor themeVars={myTheme} />
|
|
278
211
|
```
|
|
279
212
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
```bash
|
|
283
|
-
# Bump the version (choose: patch | minor | major)
|
|
284
|
-
npm version patch
|
|
285
|
-
|
|
286
|
-
# Rebuild and publish
|
|
287
|
-
npm run build:lib && npm publish --registry <your-registry-url>
|
|
288
|
-
```
|
|
213
|
+
### Available CSS variables
|
|
289
214
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
215
|
+
| Variable | Description |
|
|
216
|
+
|---|---|
|
|
217
|
+
| `--rte-color-primary` | Primary action color |
|
|
218
|
+
| `--rte-color-primary-hover` | Primary hover state |
|
|
219
|
+
| `--rte-btn-active-bg` / `--rte-btn-active-color` | Active button styling |
|
|
220
|
+
| `--rte-surface` / `--rte-surface-toolbar` | Background colors |
|
|
221
|
+
| `--rte-border` / `--rte-border-toolbar` | Border colors |
|
|
222
|
+
| `--rte-text` / `--rte-text-muted` / `--rte-text-placeholder` | Text colors |
|
|
223
|
+
| `--rte-code-bg` / `--rte-code-color` | Code styling |
|
|
224
|
+
| `--rte-blockquote-border` / `--rte-blockquote-color` | Blockquote styling |
|
|
225
|
+
| `--rte-checkbox-accent` | Task list checkbox color |
|
|
226
|
+
| `--rte-focus-border` / `--rte-focus-ring` | Focus states |
|
|
227
|
+
| `--rte-font-family` | Font stack |
|
|
228
|
+
| `--rte-radius` / `--rte-radius-sm` / `--rte-radius-lg` | Border radii |
|
|
294
229
|
|
|
295
230
|
---
|
|
296
231
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
If you just want to share quickly within your organization without setting up a registry, push the repo to your internal Git host and developers install directly from Git:
|
|
232
|
+
## Local development
|
|
300
233
|
|
|
301
234
|
```bash
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
npm install git+ssh://git@github.com/your-org/brv-text-editor.git
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
**Important:** The `dist/` folder must be committed to the repo for this to work, because npm won't run `build:lib` automatically on install.
|
|
235
|
+
# Start the demo app
|
|
236
|
+
npm run dev
|
|
308
237
|
|
|
309
|
-
|
|
310
|
-
# Before pushing for the first time (and after each release):
|
|
238
|
+
# Build the distributable library
|
|
311
239
|
npm run build:lib
|
|
312
|
-
git add dist/
|
|
313
|
-
git commit -m "chore: rebuild dist for v1.0.x"
|
|
314
|
-
git push
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
To pin to a specific version, use a tag:
|
|
318
|
-
|
|
319
|
-
```bash
|
|
320
|
-
# Tag a release
|
|
321
|
-
git tag v1.0.1
|
|
322
|
-
git push origin v1.0.1
|
|
323
|
-
|
|
324
|
-
# Install that exact tag
|
|
325
|
-
npm install git+https://github.com/your-org/brv-text-editor.git#v1.0.1
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
---
|
|
329
|
-
|
|
330
|
-
## Local development / testing the library
|
|
331
|
-
|
|
332
|
-
```bash
|
|
333
|
-
# In this repo — build the library and create a local link
|
|
334
|
-
npm run build:lib
|
|
335
|
-
npm link
|
|
336
|
-
|
|
337
|
-
# In your consumer app's folder
|
|
338
|
-
npm link brv-text-editor # or @your-org/brv-text-editor
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
Or use `npm pack` to simulate exactly what gets published:
|
|
342
|
-
|
|
343
|
-
```bash
|
|
344
|
-
npm pack
|
|
345
|
-
# → brv-text-editor-1.0.0.tgz
|
|
346
|
-
|
|
347
|
-
# In your consumer app:
|
|
348
|
-
npm install /path/to/brv-text-editor-1.0.0.tgz
|
|
349
240
|
```
|
|
350
241
|
|
|
351
242
|
---
|
|
@@ -354,16 +245,18 @@ npm install /path/to/brv-text-editor-1.0.0.tgz
|
|
|
354
245
|
|
|
355
246
|
```
|
|
356
247
|
rich-text-editor/
|
|
357
|
-
├── dist/ ← Library output
|
|
248
|
+
├── dist/ ← Library output
|
|
358
249
|
│ ├── brv-text-editor.es.js ← ES module bundle
|
|
359
250
|
│ ├── brv-text-editor.umd.js ← UMD/CJS bundle
|
|
360
251
|
│ └── brv-text-editor.css ← Extracted stylesheet
|
|
361
252
|
├── src/
|
|
362
253
|
│ ├── index.js ← Library entry (exports both components)
|
|
363
|
-
│ ├── index.css ← All styles (
|
|
254
|
+
│ ├── index.css ← All styles (editor + preview)
|
|
364
255
|
│ ├── components/
|
|
365
256
|
│ │ ├── RichTextEditor.jsx ← Editor component
|
|
366
257
|
│ │ └── RichTextPreview.jsx ← Preview card component
|
|
258
|
+
│ ├── extensions/
|
|
259
|
+
│ │ └── Callout.js ← Custom callout block extension
|
|
367
260
|
│ ├── App.jsx ← Demo application
|
|
368
261
|
│ └── main.jsx ← Demo entry point
|
|
369
262
|
├── vite.config.js ← Demo app Vite config
|
|
@@ -379,11 +272,11 @@ rich-text-editor/
|
|
|
379
272
|
|---|---|
|
|
380
273
|
| `npm run dev` | Start the demo app dev server |
|
|
381
274
|
| `npm run build` | Build the demo app |
|
|
382
|
-
| `npm run build:lib` | Build the distributable library
|
|
275
|
+
| `npm run build:lib` | Build the distributable library into `dist/` |
|
|
383
276
|
| `npm run preview` | Preview the built demo app |
|
|
384
277
|
|
|
385
278
|
---
|
|
386
279
|
|
|
387
280
|
## License
|
|
388
281
|
|
|
389
|
-
MIT
|
|
282
|
+
MIT — [Brevitaz Systems](https://brevitaz.com)
|
package/dist/brv-text-editor.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* ─────────────────────────────────────────────────────────────────────────── */
|
|
24
24
|
|
|
25
|
-
/* Default theme —
|
|
25
|
+
/* Default theme — Teal palette */
|
|
26
26
|
.rte-root {
|
|
27
27
|
/* ── Brand ───────────────────────────────────────────── */
|
|
28
28
|
--rte-color-primary: #065666; /* primary CTA / active icon color */
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
/* ─── Classic theme preset (warm
|
|
85
|
+
/* ─── Classic theme preset (warm earthy palette) ─────────────────────────── */
|
|
86
86
|
.rte-root[data-rte-theme="classic"] {
|
|
87
87
|
--rte-color-primary: #1a6b3c;
|
|
88
88
|
--rte-color-primary-hover: #f0fdf4;
|
|
@@ -23917,9 +23917,9 @@ const DEFAULT_TOOLBAR = {
|
|
|
23917
23917
|
history: true
|
|
23918
23918
|
};
|
|
23919
23919
|
const RTE_THEMES = {
|
|
23920
|
-
/** Default —
|
|
23920
|
+
/** Default — Teal palette */
|
|
23921
23921
|
unleashteams: {},
|
|
23922
|
-
/** Warm
|
|
23922
|
+
/** Warm earthy palette */
|
|
23923
23923
|
classic: {
|
|
23924
23924
|
"--rte-color-primary": "#1a6b3c",
|
|
23925
23925
|
"--rte-color-primary-hover": "#f0fdf4",
|
|
@@ -24738,17 +24738,6 @@ function RichTextEditor({
|
|
|
24738
24738
|
)
|
|
24739
24739
|
);
|
|
24740
24740
|
}
|
|
24741
|
-
function formatHtml(html) {
|
|
24742
|
-
let indent = 0;
|
|
24743
|
-
return html.replace(/></g, ">\n<").split("\n").map((line) => {
|
|
24744
|
-
const closing = line.match(/^<\//);
|
|
24745
|
-
const selfClose = line.match(/\/>$/) || line.match(/^<(br|hr|img|input)/);
|
|
24746
|
-
if (closing) indent = Math.max(0, indent - 2);
|
|
24747
|
-
const result = " ".repeat(indent) + line.trim();
|
|
24748
|
-
if (!closing && !selfClose && line.match(/^<[^/]/)) indent += 2;
|
|
24749
|
-
return result;
|
|
24750
|
-
}).join("\n");
|
|
24751
|
-
}
|
|
24752
24741
|
function EmojiReaction({ emoji: emoji2 }) {
|
|
24753
24742
|
const [count, setCount] = useState(0);
|
|
24754
24743
|
const [active, setActive] = useState(false);
|
|
@@ -24783,30 +24772,13 @@ function EmojiReaction({ emoji: emoji2 }) {
|
|
|
24783
24772
|
}
|
|
24784
24773
|
function RichTextPreview({
|
|
24785
24774
|
html = "",
|
|
24786
|
-
author = { name: "Anonymous", initials: "A", avatarColor: "#065666" },
|
|
24787
|
-
timestamp = "",
|
|
24788
|
-
onDismiss,
|
|
24789
24775
|
showReactions = true,
|
|
24790
24776
|
reactions = ["👍", "❤️", "🎉", "🙌"],
|
|
24791
24777
|
theme = "unleashteams",
|
|
24792
24778
|
themeVars = {}
|
|
24793
24779
|
}) {
|
|
24794
|
-
const [tab, setTab] = useState("preview");
|
|
24795
24780
|
const presetVars = RTE_THEMES[theme] ?? {};
|
|
24796
24781
|
const resolvedVars = { ...presetVars, ...themeVars };
|
|
24797
|
-
const tabStyle = (active) => ({
|
|
24798
|
-
padding: "6px 14px",
|
|
24799
|
-
border: "none",
|
|
24800
|
-
borderBottom: active ? "2px solid var(--rte-color-primary)" : "2px solid transparent",
|
|
24801
|
-
background: "none",
|
|
24802
|
-
cursor: "pointer",
|
|
24803
|
-
fontSize: 13,
|
|
24804
|
-
fontFamily: "var(--rte-font-family)",
|
|
24805
|
-
fontWeight: active ? 600 : 400,
|
|
24806
|
-
color: active ? "var(--rte-color-primary)" : "var(--rte-text-muted)",
|
|
24807
|
-
transition: "color 0.15s, border-color 0.15s",
|
|
24808
|
-
marginBottom: -1
|
|
24809
|
-
});
|
|
24810
24782
|
return /* @__PURE__ */ React.createElement(
|
|
24811
24783
|
"div",
|
|
24812
24784
|
{
|
|
@@ -24826,98 +24798,14 @@ function RichTextPreview({
|
|
|
24826
24798
|
}
|
|
24827
24799
|
},
|
|
24828
24800
|
/* @__PURE__ */ React.createElement(
|
|
24829
|
-
"div",
|
|
24830
|
-
{
|
|
24831
|
-
style: {
|
|
24832
|
-
padding: "14px 18px 0",
|
|
24833
|
-
display: "flex",
|
|
24834
|
-
alignItems: "flex-start",
|
|
24835
|
-
justifyContent: "space-between",
|
|
24836
|
-
gap: 10
|
|
24837
|
-
}
|
|
24838
|
-
},
|
|
24839
|
-
/* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 10 } }, /* @__PURE__ */ React.createElement(
|
|
24840
|
-
"div",
|
|
24841
|
-
{
|
|
24842
|
-
style: {
|
|
24843
|
-
width: 34,
|
|
24844
|
-
height: 34,
|
|
24845
|
-
borderRadius: "50%",
|
|
24846
|
-
background: author.avatarColor ?? "var(--rte-color-primary)",
|
|
24847
|
-
display: "flex",
|
|
24848
|
-
alignItems: "center",
|
|
24849
|
-
justifyContent: "center",
|
|
24850
|
-
fontSize: 13,
|
|
24851
|
-
fontWeight: 700,
|
|
24852
|
-
color: "#fff",
|
|
24853
|
-
flexShrink: 0,
|
|
24854
|
-
fontFamily: "var(--rte-font-family)"
|
|
24855
|
-
}
|
|
24856
|
-
},
|
|
24857
|
-
author.initials
|
|
24858
|
-
), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: { fontSize: 14, fontWeight: 600, color: "var(--rte-text)", lineHeight: 1.3, fontFamily: "var(--rte-font-family)" } }, author.name), /* @__PURE__ */ React.createElement("div", { style: { fontSize: 11, color: "var(--rte-text-muted)", fontFamily: "var(--rte-font-family)" } }, timestamp))),
|
|
24859
|
-
onDismiss && /* @__PURE__ */ React.createElement(
|
|
24860
|
-
"button",
|
|
24861
|
-
{
|
|
24862
|
-
onClick: onDismiss,
|
|
24863
|
-
title: "Dismiss",
|
|
24864
|
-
style: {
|
|
24865
|
-
border: "none",
|
|
24866
|
-
background: "none",
|
|
24867
|
-
cursor: "pointer",
|
|
24868
|
-
color: "var(--rte-btn-disabled-color)",
|
|
24869
|
-
fontSize: 20,
|
|
24870
|
-
lineHeight: 1,
|
|
24871
|
-
padding: "2px 4px",
|
|
24872
|
-
borderRadius: "var(--rte-radius-sm)",
|
|
24873
|
-
transition: "color 0.1s"
|
|
24874
|
-
},
|
|
24875
|
-
onMouseEnter: (e) => e.currentTarget.style.color = "var(--rte-text-muted)",
|
|
24876
|
-
onMouseLeave: (e) => e.currentTarget.style.color = "var(--rte-btn-disabled-color)"
|
|
24877
|
-
},
|
|
24878
|
-
"×"
|
|
24879
|
-
)
|
|
24880
|
-
),
|
|
24881
|
-
/* @__PURE__ */ React.createElement(
|
|
24882
|
-
"div",
|
|
24883
|
-
{
|
|
24884
|
-
style: {
|
|
24885
|
-
display: "flex",
|
|
24886
|
-
gap: 0,
|
|
24887
|
-
padding: "10px 18px 0",
|
|
24888
|
-
borderBottom: "1px solid var(--rte-border-toolbar)"
|
|
24889
|
-
}
|
|
24890
|
-
},
|
|
24891
|
-
/* @__PURE__ */ React.createElement("button", { style: tabStyle(tab === "preview"), onClick: () => setTab("preview") }, "Preview"),
|
|
24892
|
-
/* @__PURE__ */ React.createElement("button", { style: tabStyle(tab === "source"), onClick: () => setTab("source") }, "HTML source")
|
|
24893
|
-
),
|
|
24894
|
-
tab === "preview" ? /* @__PURE__ */ React.createElement(
|
|
24895
24801
|
"div",
|
|
24896
24802
|
{
|
|
24897
24803
|
className: "rtp-content",
|
|
24898
24804
|
dangerouslySetInnerHTML: { __html: html },
|
|
24899
|
-
style: { padding: "
|
|
24805
|
+
style: { padding: "14px 22px 20px" }
|
|
24900
24806
|
}
|
|
24901
|
-
) : /* @__PURE__ */ React.createElement(
|
|
24902
|
-
"pre",
|
|
24903
|
-
{
|
|
24904
|
-
style: {
|
|
24905
|
-
margin: 0,
|
|
24906
|
-
padding: "16px 18px",
|
|
24907
|
-
fontSize: 12,
|
|
24908
|
-
fontFamily: "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace",
|
|
24909
|
-
whiteSpace: "pre-wrap",
|
|
24910
|
-
wordBreak: "break-all",
|
|
24911
|
-
color: "var(--rte-text-muted)",
|
|
24912
|
-
background: "var(--rte-surface-subtle)",
|
|
24913
|
-
maxHeight: 320,
|
|
24914
|
-
overflowY: "auto",
|
|
24915
|
-
lineHeight: 1.6
|
|
24916
|
-
}
|
|
24917
|
-
},
|
|
24918
|
-
formatHtml(html)
|
|
24919
24807
|
),
|
|
24920
|
-
|
|
24808
|
+
showReactions && reactions.length > 0 && /* @__PURE__ */ React.createElement(
|
|
24921
24809
|
"div",
|
|
24922
24810
|
{
|
|
24923
24811
|
style: {
|