@talogic/editor 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 talogic Automation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USEFUL OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,69 @@
1
- # Temporary Holding Version
1
+ # @talogic/editor
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The talogic rich-text editor for React. It is TipTap 3 with a toolbar that you choose tool by tool. The toolbar
4
+ uses talogic icons and talogic components. The editor reads and writes Markdown (the default) or HTML.
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ npm install @talogic/editor @talogic/react @talogic/icons
10
+ ```
11
+
12
+ The editor uses the classes of `@talogic/react`, so let Tailwind scan it next to `@talogic/react`:
13
+
14
+ ```css
15
+ @import "tailwindcss";
16
+ @import "@talogic/react/tokens.css";
17
+ @source "../node_modules/@talogic/react";
18
+ @source "../node_modules/@talogic/editor";
19
+ ```
20
+
21
+ ## Use
22
+
23
+ ```tsx
24
+ import { RICH_TEXT_PRESETS, RichTextEditor } from '@talogic/editor'
25
+
26
+ <RichTextEditor
27
+ aria-label='Note'
28
+ tools={RICH_TEXT_PRESETS.standard}
29
+ value={markdown}
30
+ onChange={setMarkdown}
31
+ placeholder='Write something…'
32
+ />
33
+ ```
34
+
35
+ | Prop | What it does |
36
+ |---|---|
37
+ | `tools` | The toolbar items, in order. Put `'\|'` between groups. The default is `RICH_TEXT_PRESETS.standard`. An empty list hides the toolbar. |
38
+ | `value` / `defaultValue` | The content, controlled or uncontrolled. |
39
+ | `format` | `markdown` (default) or `html`. It applies to `value`, `defaultValue` and `onChange`. |
40
+ | `onChange` | Gets the content in `format` after each change. |
41
+ | `editable` | Set it to `false` for read-only content without the toolbar. |
42
+ | `labels` | Replaces any toolbar word, for example a translation. `DEFAULT_RICH_TEXT_LABELS` holds the English words. |
43
+ | `extensions` | Extra TipTap extensions, for example mentions or wiki links. |
44
+ | `onEditorReady` | Gets the TipTap editor once it exists, for example for a word count. |
45
+
46
+ ### Tools
47
+
48
+ | Group | Tools |
49
+ |---|---|
50
+ | History | `undo`, `redo` |
51
+ | Text style | `heading` (a menu: paragraph and headings 1 to 6) |
52
+ | Marks | `bold`, `italic`, `underline`, `strike`, `code`, `subscript`, `superscript`, `highlight`, `textColor`, `clearFormatting` |
53
+ | Lists | `bulletList`, `orderedList`, `taskList`, `indent`, `outdent` |
54
+ | Alignment | `alignLeft`, `alignCenter`, `alignRight`, `alignJustify` |
55
+ | Blocks | `blockquote`, `codeBlock`, `horizontalRule` |
56
+ | Insert | `link` (a popover for the address), `table` (a menu that inserts a table and edits its rows, columns, cells and headers) |
57
+
58
+ The presets are `minimal` (for a comment box), `standard` (for a notes app) and `full` (for a document editor). To
59
+ change a preset, spread it:
60
+
61
+ ```tsx
62
+ <RichTextEditor tools={[...RICH_TEXT_PRESETS.standard, '|', 'table']} />
63
+ ```
64
+
65
+ The editor always loads every format, whatever the toolbar shows. This way, content keeps its formats in a smaller
66
+ toolbar. Markdown has no underline, colour or alignment, so choose `format='html'` when you need these.
67
+
68
+ The toolbar follows the ARIA toolbar pattern: the arrow keys move between its buttons, and Home and End jump to the
69
+ first and last button. Each button has a tooltip with its name and its keyboard shortcut.
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { RichTextEditor } from './rich-text-editor';
2
+ export type { RichTextEditorProps, RichTextFormat } from './rich-text-editor';
3
+ export { DEFAULT_RICH_TEXT_LABELS, RICH_TEXT_PRESETS } from './toolbar';
4
+ export type { RichTextLabels, RichTextTool, RichTextToolbarItem } from './toolbar';