wysimark-lite 0.9.0 → 0.9.2
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 +65 -159
- package/dist/metafile-esm.json +1 -1
- package/dist/wysimark.d.ts +2 -13
- package/dist/wysimark.js +151 -164
- package/dist/wysimark.mjs +371 -4482
- package/dist/wysimark.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,189 +1,95 @@
|
|
|
1
|
-
# Wysimark
|
|
1
|
+
# Wysimark-lite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A modern and clean rich text editor for React, supporting CommonMark and GFM Markdown spec.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### As React Component
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```tsx
|
|
10
|
+
import { Editable, useEditor } from "wysimark-lite";
|
|
11
|
+
import React from "react";
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
const Editor: React.FC = () => {
|
|
14
|
+
const [value, setValue] = React.useState("");
|
|
15
|
+
const editor = useEditor({});
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
return (
|
|
18
|
+
<div style={{ width: "800px" }}>
|
|
19
|
+
<Editable editor={editor} value={value} onChange={setValue} />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
```
|
|
14
24
|
|
|
15
|
-
|
|
25
|
+
With initial value:
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
```tsx
|
|
28
|
+
const Editor: React.FC = () => {
|
|
29
|
+
const [value, setValue] = React.useState(`# Welcome to Wysimark
|
|
18
30
|
|
|
19
|
-
|
|
31
|
+
This is a **rich text editor** with _markdown_ support.`);
|
|
32
|
+
const editor = useEditor({});
|
|
20
33
|
|
|
21
|
-
|
|
34
|
+
return <Editable editor={editor} value={value} onChange={setValue} />;
|
|
35
|
+
};
|
|
36
|
+
```
|
|
22
37
|
|
|
23
|
-
|
|
38
|
+
### Direct Initialization
|
|
24
39
|
|
|
25
|
-
|
|
40
|
+
You can also initialize the editor directly on an HTML element:
|
|
26
41
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
```html
|
|
43
|
+
<div id="editor"></div>
|
|
44
|
+
<script type="module">
|
|
45
|
+
import { createWysimark } from "wysimark-lite";
|
|
30
46
|
|
|
31
|
-
|
|
47
|
+
const editor = createWysimark(document.getElementById("editor"), {
|
|
48
|
+
initialMarkdown: "# Hello Wysimark\n\nStart typing here...",
|
|
49
|
+
onChange: (markdown) => {
|
|
50
|
+
console.log("Markdown changed:", markdown);
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
54
|
+
```
|
|
32
55
|
|
|
33
|
-
|
|
34
|
-
- **Image Resizing/Optimization in the Cloud**: Automacally delivers server resized and optimized files through a high speed CDN in the cloud.
|
|
56
|
+
## Features
|
|
35
57
|
|
|
36
|
-
|
|
58
|
+
- **Complete Markdown Support**: Full support for CommonMark and GFM Markdown spec
|
|
59
|
+
- **Modern Design**: Clean and contemporary interface that integrates seamlessly with React applications
|
|
60
|
+
- **User-Friendly Interface**:
|
|
61
|
+
- Simplified toolbar with toggle buttons (click to activate/deactivate formatting)
|
|
62
|
+
- Markdown shortcuts (e.g., `**` for **bold**, `#` for heading)
|
|
63
|
+
- Keyboard shortcuts (e.g., `Ctrl/Cmd + B` for bold)
|
|
64
|
+
- Japanese localized UI (toolbar and menu items in Japanese)
|
|
65
|
+
- **Enhanced List Support**:
|
|
66
|
+
- Nested lists support (create hierarchical lists with multiple levels)
|
|
67
|
+
- Mix different list types in the hierarchy
|
|
68
|
+
|
|
69
|
+
## Supported Features
|
|
37
70
|
|
|
38
71
|
- Tables
|
|
39
|
-
- Ordered and
|
|
72
|
+
- Ordered and Unordered Lists with nesting support
|
|
40
73
|
- Task lists
|
|
41
|
-
-
|
|
42
|
-
- File Attachments
|
|
43
|
-
- Heading and paragraph blocks
|
|
74
|
+
- Headings and paragraphs
|
|
44
75
|
- Code blocks with syntax highlighting
|
|
45
76
|
- Inline code
|
|
46
77
|
- Links
|
|
47
|
-
- Text styling
|
|
48
|
-
|
|
49
|
-
## Usability
|
|
50
|
-
|
|
51
|
-
### Button Tooltips with hints and shortcuts
|
|
52
|
-
|
|
53
|
-
Hovering over the toolbar displays helpful tooltips and keyboard shortcuts. Window, Linux and Mac each get their own OS specific shortcuts following the conventions of each operating system.
|
|
54
|
-
|
|
55
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/toolbar-button-tooltips@2x.png" width="540">
|
|
56
|
-
|
|
57
|
-
### Sticky Dropdown Menus with Hints and shortcuts
|
|
58
|
-
|
|
59
|
-
Menus stay closed until they are clicked open and then they stay open as you hover over other menu buttons. This makes discoverability in menus fast, easy and it works like your operating system. Drop down menus show icons, hints and device operating system dependant shortcuts.
|
|
60
|
-
|
|
61
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/toolbar-menu@2x.png" width="541">
|
|
62
|
-
|
|
63
|
-
### Quick Pick Table Builder
|
|
64
|
-
|
|
65
|
-
Use the flyout to quickly select how many rows and columns in your table.
|
|
66
|
-
|
|
67
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/toolbar-table-menu@2x.png" width="541">
|
|
68
|
-
|
|
69
|
-
### Quick Pick Emoji Picker
|
|
70
|
-
|
|
71
|
-
Integrates the `emoji-mart` Emoji Picker.
|
|
72
|
-
|
|
73
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/toolbar-emoji-dialog@2x.png" width="559">
|
|
74
|
-
|
|
75
|
-
## Image and Attachment Uploading
|
|
76
|
-
|
|
77
|
-
Wysimark supports image and file uploading using Portive, a service created by the creator of Wysimark to an Amazon AWS S3 Bucket. Wysimark supports three intuitive ways to upload images to Wysimark.
|
|
78
|
-
|
|
79
|
-
### Upload from Toolbar
|
|
80
|
-
|
|
81
|
-
Click the image or attachment icon in the toolbar then select an image from your computer to upload it.
|
|
82
|
-
|
|
83
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/image-select-dialog@2x.png" width="577">
|
|
84
|
-
|
|
85
|
-
### Drag and Drop Images and Files
|
|
86
|
-
|
|
87
|
-
Drag and drop files from Windows Explorer the Mac Finder or your operating system's equivalent directly into editor to start uploading.
|
|
88
|
-
|
|
89
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/image-drag-and-drop@2x.png" width="545">
|
|
90
|
-
|
|
91
|
-
### Paste Images and Files
|
|
92
|
-
|
|
93
|
-
Copy and paste images from anywhere in your operating system directly into the editor to start uploading.
|
|
94
|
-
|
|
95
|
-
## Easy Image Resizing
|
|
96
|
-
|
|
97
|
-
### Drag to Resize
|
|
98
|
-
|
|
99
|
-
Grab a resize handle on the image and drag to resize.
|
|
100
|
-
|
|
101
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/image-resize-drag@2x.jpg" width="545">
|
|
102
|
-
|
|
103
|
-
The current width and height of the image are shown as you drag.
|
|
104
|
-
|
|
105
|
-
An image, resized and optimized in the cloud, will be delivered to the user based on the final width and height.
|
|
106
|
-
|
|
107
|
-
### Preset: Resize to Fixed Width
|
|
108
|
-
|
|
109
|
-
You can provide a set of preset shortcuts to your users with fixed bounds that users can click.
|
|
110
|
-
|
|
111
|
-
In this example, we provide S, M and L sizes and M is set to have bounds of 320x320. Based on this image, the preset value shows 320x213.
|
|
112
|
-
|
|
113
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/image-resize-fixed@2x.jpg" width="545">
|
|
78
|
+
- Text styling (bold, italic, inline code)
|
|
79
|
+
- Block quotes
|
|
114
80
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
You can also provide a set of preset shortcuts to your users with fractional sizes that users can click. This is useful, for example, if a user takes a screenshot in a high DPI device (e.g. 2x) and the use wants to resize it to exactly half the uploaded size so as to maintain a 1 to 1 size in the editor.
|
|
118
|
-
|
|
119
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/image-resize-fraction@2x.jpg" width="545">
|
|
120
|
-
|
|
121
|
-
## Checklists
|
|
122
|
-
|
|
123
|
-
Supports nested checklists. Supports toggling of checklists by clicking on them.
|
|
124
|
-
|
|
125
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/checklist-nested@2x.png" width="545">
|
|
126
|
-
|
|
127
|
-
## Lists: Mix Numbered, Bullet and Checklists
|
|
128
|
-
|
|
129
|
-
Supports mixing of numbered, bullet and checklists.
|
|
130
|
-
|
|
131
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/list-mixed@2x.png" width="545">
|
|
132
|
-
|
|
133
|
-
## Nested Block Quotes
|
|
134
|
-
|
|
135
|
-
Supports nesting of block quotes through the toolbar menu. Selected block quote indent and outdent content. Fully supports all content type in block quotes like lists, tables and images.
|
|
136
|
-
|
|
137
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/blockquote-nested@2x.png" width="545">
|
|
138
|
-
|
|
139
|
-
## Links
|
|
140
|
-
|
|
141
|
-
### Viewing Link Details
|
|
142
|
-
|
|
143
|
-
Click a link in the editor to see its details, like the website domain, link path, and tooltip. Want to change or delete the link? Use the icons at the top of the dialog.
|
|
144
|
-
|
|
145
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/link-view-detail-dialog@2x.png" width="545">
|
|
146
|
-
|
|
147
|
-
### Editing Link Details
|
|
148
|
-
|
|
149
|
-
When Viewing Link Details click the "Edit Link" icon to edit the link. You can easily edit the URL and tooltip text for any link.
|
|
150
|
-
|
|
151
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/link-edit-dialog@2x.png" width="545">
|
|
152
|
-
|
|
153
|
-
## Responsive Toolbar Layouts
|
|
154
|
-
|
|
155
|
-
The Wysimark Toolbar dynamically adjusts the layout of its buttons depending on the width of the available space. Works with full screen editing all the way down to narrow devices in portrait mode or thinner web forms.
|
|
156
|
-
|
|
157
|
-
### Wide Toolbar
|
|
158
|
-
|
|
159
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/editor-wide-width@2x.jpg" width="540">
|
|
160
|
-
|
|
161
|
-
### Medium Toolbar
|
|
162
|
-
|
|
163
|
-
Insert for table, images attachments and emoji are merged into one button.
|
|
164
|
-
|
|
165
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/editor-medium-width@2x.jpg" width="559">
|
|
166
|
-
|
|
167
|
-
### Narrow Toolbar
|
|
168
|
-
|
|
169
|
-
The **bold** and _italic_ styles are merged into the styles button.
|
|
170
|
-
|
|
171
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/editor-narrow-width@2x.jpg" width="360">
|
|
172
|
-
|
|
173
|
-
## Code Blocks with Syntax Highlighting
|
|
174
|
-
|
|
175
|
-
Built-in support for syntax highlighting in code blocks.
|
|
176
|
-
|
|
177
|
-
<img src="https://raw.githubusercontent.com/portive/wysimark-assets/main/readme/syntax-highlighting@2x.png" width="544">
|
|
178
|
-
|
|
179
|
-
## Works in all Modern Browsers
|
|
81
|
+
## Browser Support
|
|
180
82
|
|
|
181
83
|
- Google Chrome
|
|
182
84
|
- Apple Safari
|
|
183
85
|
- Microsoft Edge
|
|
184
86
|
- Firefox
|
|
185
87
|
|
|
186
|
-
##
|
|
88
|
+
## Requirements
|
|
89
|
+
|
|
90
|
+
- React >= 17.x
|
|
91
|
+
- React DOM >= 17.x
|
|
92
|
+
|
|
93
|
+
## License
|
|
187
94
|
|
|
188
|
-
|
|
189
|
-
- Mobile/Tablet: iOS and Android
|
|
95
|
+
MIT
|