@usememos/editor 26.10.11 → 26.10.13
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 +2 -1
- package/dist/base.css +52 -31
- package/dist/index.js +211 -29
- package/dist/index.js.map +3 -3
- package/dist/react.js.map +2 -2
- package/dist/style.css +167 -54
- package/dist/theme.css +61 -24
- package/dist/types/editor.d.ts +6 -0
- package/dist/types/labels.d.ts +1 -0
- package/dist/types/markdown/htmlSection.d.ts +28 -0
- package/dist/types/markdown/serialize.d.ts +2 -1
- package/dist/types/react/index.d.ts +1 -1
- package/dist/types/view/dom.d.ts +5 -0
- package/package.json +1 -1
|
@@ -18,7 +18,8 @@ export declare function serializeInline(inline: Inline, options?: MarkdownOption
|
|
|
18
18
|
* The inline content as Markdown can represent it, which is what parsing the
|
|
19
19
|
* serialized output gives back:
|
|
20
20
|
* - Whitespace at the edges of a bold, italic or strike run moves outside it,
|
|
21
|
-
* because `**foo **` is not valid emphasis.
|
|
21
|
+
* because `**foo **` is not valid emphasis. Whitespace in a code span
|
|
22
|
+
* stays: the delimiter then sits next to the backtick, as in `` **` a`** ``.
|
|
22
23
|
* - A "\n" in a code span is a hard break outside the code span.
|
|
23
24
|
* - Spaces and tabs that start or end a line of text are dropped, because
|
|
24
25
|
* Markdown strips them. Writing them as character references instead would
|
|
@@ -2,7 +2,7 @@ import { Editor, type EditorOptions, type SuggestionState } from '@usememos/edit
|
|
|
2
2
|
import { type CSSProperties } from 'react';
|
|
3
3
|
export type { Editor, SuggestionState } from '@usememos/editor';
|
|
4
4
|
/** Constructor options that the React components take as props. */
|
|
5
|
-
type EditorProps = Pick<EditorOptions, 'markdown' | 'extensions' | 'placeholder' | 'editable' | 'taskToggle' | 'autofocus' | 'attributes' | 'resolveUrl' | 'referrerPolicy' | 'headingIds' | 'onLinkClick' | 'theme' | 'toolbar' | 'slashMenu' | 'labels' | 'icons'>;
|
|
5
|
+
type EditorProps = Pick<EditorOptions, 'markdown' | 'extensions' | 'placeholder' | 'editable' | 'taskToggle' | 'autofocus' | 'attributes' | 'resolveUrl' | 'referrerPolicy' | 'headingIds' | 'onLinkClick' | 'theme' | 'toolbar' | 'slashMenu' | 'slashHint' | 'labels' | 'icons'>;
|
|
6
6
|
export interface MarkdownEditorProps extends EditorProps {
|
|
7
7
|
/** Markdown. The editor updates only when this is not a value it emitted itself. */
|
|
8
8
|
value?: string;
|
package/dist/types/view/dom.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Labels } from '../labels.js';
|
|
|
4
4
|
import type { IconName } from '../icons.js';
|
|
5
5
|
import type { ThemeClasses } from '../theme.js';
|
|
6
6
|
import { type Decoration } from '../decorations.js';
|
|
7
|
+
import type { MarkdownOptions } from '../markdown/options.js';
|
|
7
8
|
export declare const BLOCK_ATTR = "data-block-id";
|
|
8
9
|
/** The view name for code blocks of a language: `code:mermaid`. */
|
|
9
10
|
export declare function codeViewName(language: string): string;
|
|
@@ -33,6 +34,8 @@ export interface RenderContext {
|
|
|
33
34
|
readonly views?: ReadonlyMap<string, SyntaxView>;
|
|
34
35
|
/** A token or raw block of an extension syntax, rendered; null shows its source. */
|
|
35
36
|
readonly view?: (syntax: string, source: string, kind: 'inline' | 'block') => HTMLElement | null;
|
|
37
|
+
/** The document's Markdown options, for the Markdown inside an HTML section. */
|
|
38
|
+
readonly markdown?: MarkdownOptions;
|
|
36
39
|
/** Theme classes for rendered elements. */
|
|
37
40
|
readonly classes: ThemeClasses;
|
|
38
41
|
/** The icon of a UI control, or null for none. */
|
|
@@ -90,6 +93,8 @@ export declare class BlockRenderer {
|
|
|
90
93
|
widgetsAfter?: (blockId: string) => readonly HTMLElement[] | undefined;
|
|
91
94
|
/** Views of extension syntaxes, by syntax name. */
|
|
92
95
|
views?: ReadonlyMap<string, SyntaxView>;
|
|
96
|
+
/** The document's Markdown options, for the Markdown inside an HTML section. */
|
|
97
|
+
markdown?: MarkdownOptions;
|
|
93
98
|
/** Theme classes for rendered elements. Set before a full render. */
|
|
94
99
|
classes: ThemeClasses;
|
|
95
100
|
/** The icon of a UI control. */
|