@clevertask/scribe 0.0.13 → 0.0.15
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 +5 -10
- package/dist/assets/index.css +1 -1
- package/dist/components/Menu/BarMenu.d.ts +3 -2
- package/dist/components/Menu/BarMenu.d.ts.map +1 -0
- package/dist/components/Menu/BarMenu.js +39 -18
- package/dist/components/Menu/BubbleMenu.d.ts +3 -2
- package/dist/components/Menu/BubbleMenu.d.ts.map +1 -0
- package/dist/components/Menu/BubbleMenu.js +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts +2 -1
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -0
- package/dist/components/Menu/Mobile/ListOptionBar.js +3 -15
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +2 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -0
- package/dist/components/Scribe/extension/emoji/EmojiList.js +25 -14
- package/dist/components/Scribe/extension/emoji/suggest.d.ts +1 -0
- package/dist/components/Scribe/extension/emoji/suggest.d.ts.map +1 -0
- package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
- package/dist/components/Scribe/extension/extension-link.d.ts +2 -1
- package/dist/components/Scribe/extension/extension-link.d.ts.map +1 -0
- package/dist/components/Scribe/extension/extension-link.js +2 -4
- package/dist/components/Scribe/extension/extension-markdown-paste.d.ts +4 -0
- package/dist/components/Scribe/extension/extension-markdown-paste.d.ts.map +1 -0
- package/dist/components/Scribe/extension/extension-markdown-paste.js +46 -0
- package/dist/components/Scribe/extension/extension-selectedText.d.ts +2 -1
- package/dist/components/Scribe/extension/extension-selectedText.d.ts.map +1 -0
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.d.ts +3 -2
- package/dist/components/Scribe/extension/index.d.ts.map +1 -0
- package/dist/components/Scribe/extension/index.js +25 -23
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts +3 -2
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -0
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +6 -5
- package/dist/components/Scribe/extension/slashCommand/index.d.ts +3 -2
- package/dist/components/Scribe/extension/slashCommand/index.d.ts.map +1 -0
- package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/items.d.ts +3 -2
- package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -0
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +2 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts.map +1 -0
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
- package/dist/components/Scribe/index.d.ts +6 -4
- package/dist/components/Scribe/index.d.ts.map +1 -0
- package/dist/components/Scribe/index.js +34 -44
- package/dist/{index-flsxByQS.js → index-BKFDqQPh.js} +9 -3
- package/dist/{index-BfaHEr44.js → index-CL2WLiGu.js} +1 -1
- package/dist/{index-CWvaDN_2.js → index-Cxf4VEm1.js} +5252 -5318
- package/dist/{index-Bvgjhwaj.js → index-PzbCrHp0.js} +1 -1
- package/dist/main.css +3 -0
- package/dist/main.d.ts +4 -3
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +1 -1
- package/dist/{marked.esm-H7n4rMcO.js → markdown-to-html-__93dwok.js} +50 -47
- package/dist/{purify.es-DcWaZU6I.js → purify.es-BPDBzHtc.js} +114 -114
- package/dist/utils/convert-legacy-math-delimiters.d.ts +1 -0
- package/dist/utils/convert-legacy-math-delimiters.d.ts.map +1 -0
- package/dist/utils/create-scribe-editor.d.ts +3 -2
- package/dist/utils/create-scribe-editor.d.ts.map +1 -0
- package/dist/utils/create-scribe-editor.js +8 -4
- package/dist/utils/html-to-markdown.d.ts +1 -0
- package/dist/utils/html-to-markdown.d.ts.map +1 -0
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.d.ts +6 -5
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -3
- package/dist/utils/is-in-viewport.d.ts +1 -0
- package/dist/utils/is-in-viewport.d.ts.map +1 -0
- package/dist/utils/markdown-to-html.d.ts +1 -0
- package/dist/utils/markdown-to-html.d.ts.map +1 -0
- package/dist/utils/markdown-to-html.js +3 -4
- package/package.json +53 -56
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ A versatile, block-based rich text editor for diverse applications, built with T
|
|
|
6
6
|
|
|
7
7
|
- **Block-based Editing:** Enjoy a familiar and intuitive Notion-style editing experience.
|
|
8
8
|
- **Markdown Support:** Parse and render Markdown content effortlessly.
|
|
9
|
+
- **Markdown Paste:** Paste plain-text markdown into the editor and have it converted into rich content automatically.
|
|
9
10
|
- **Versatile Integration:** Easily integrate `@clevertask/scribe` into any project requiring rich text editing.
|
|
10
11
|
- **View and Edit:** Seamlessly switch between viewing and editing modes.
|
|
11
12
|
|
|
@@ -153,6 +154,8 @@ export declare function md2html(md: string): string;
|
|
|
153
154
|
|
|
154
155
|
Convert markdown to html. Useful if you're rendering an AI-based response, or if you were storing content on markdown in your database and want to show it on the text editor. This function sanitizes the content to prevent XSS attacks.
|
|
155
156
|
|
|
157
|
+
Editable Scribe instances also use this conversion internally when you paste plain-text markdown into the editor.
|
|
158
|
+
|
|
156
159
|
**Usage Example**:
|
|
157
160
|
|
|
158
161
|
```tsx
|
|
@@ -168,11 +171,7 @@ const ChatMessages = () => {
|
|
|
168
171
|
return messages.map((message) => (
|
|
169
172
|
<Flex key={message.id} direction="column" mb="4">
|
|
170
173
|
<Heading size="4">{`${message.role}: `}</Heading>
|
|
171
|
-
<Scribe
|
|
172
|
-
editable={false}
|
|
173
|
-
showBarMenu={false}
|
|
174
|
-
content={md2html(message.content)}
|
|
175
|
-
/>
|
|
174
|
+
<Scribe editable={false} showBarMenu={false} content={md2html(message.content)} />
|
|
176
175
|
</Flex>
|
|
177
176
|
));
|
|
178
177
|
};
|
|
@@ -219,11 +218,7 @@ This helper is primarily for consumers upgrading from older Scribe versions who
|
|
|
219
218
|
**Usage Example**:
|
|
220
219
|
|
|
221
220
|
```tsx
|
|
222
|
-
import {
|
|
223
|
-
convertLegacyMathDelimiters,
|
|
224
|
-
md2html,
|
|
225
|
-
Scribe,
|
|
226
|
-
} from "@clevertask/scribe";
|
|
221
|
+
import { convertLegacyMathDelimiters, md2html, Scribe } from "@clevertask/scribe";
|
|
227
222
|
|
|
228
223
|
const html = md2html(convertLegacyMathDelimiters(rawMarkdown));
|
|
229
224
|
|