@nevuto/editors 0.0.0-stage → 0.2.20
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 +21 -0
- package/README.md +28 -2
- package/dist/BlockEditor/BlockDragHandle.d.ts +11 -0
- package/dist/BlockEditor/BlockDragHandle.d.ts.map +1 -0
- package/dist/BlockEditor/BlockEditor.d.ts +68 -0
- package/dist/BlockEditor/BlockEditor.d.ts.map +1 -0
- package/dist/BlockEditor/BlockMenu.d.ts +28 -0
- package/dist/BlockEditor/BlockMenu.d.ts.map +1 -0
- package/dist/BlockEditor/ButtonBlock.d.ts +18 -0
- package/dist/BlockEditor/ButtonBlock.d.ts.map +1 -0
- package/dist/BlockEditor/ButtonBlockView.d.ts +3 -0
- package/dist/BlockEditor/ButtonBlockView.d.ts.map +1 -0
- package/dist/BlockEditor/CalloutBlock.d.ts +15 -0
- package/dist/BlockEditor/CalloutBlock.d.ts.map +1 -0
- package/dist/BlockEditor/CalloutBlockView.d.ts +3 -0
- package/dist/BlockEditor/CalloutBlockView.d.ts.map +1 -0
- package/dist/BlockEditor/EntityBlockView.d.ts +32 -0
- package/dist/BlockEditor/EntityBlockView.d.ts.map +1 -0
- package/dist/BlockEditor/EntityBlocks.d.ts +16 -0
- package/dist/BlockEditor/EntityBlocks.d.ts.map +1 -0
- package/dist/BlockEditor/GalleryBlock.d.ts +24 -0
- package/dist/BlockEditor/GalleryBlock.d.ts.map +1 -0
- package/dist/BlockEditor/GalleryBlockView.d.ts +3 -0
- package/dist/BlockEditor/GalleryBlockView.d.ts.map +1 -0
- package/dist/BlockEditor/HtmlBlock.d.ts +13 -0
- package/dist/BlockEditor/HtmlBlock.d.ts.map +1 -0
- package/dist/BlockEditor/HtmlBlockView.d.ts +3 -0
- package/dist/BlockEditor/HtmlBlockView.d.ts.map +1 -0
- package/dist/BlockEditor/ImageBlock.d.ts +26 -0
- package/dist/BlockEditor/ImageBlock.d.ts.map +1 -0
- package/dist/BlockEditor/ImageBlockView.d.ts +3 -0
- package/dist/BlockEditor/ImageBlockView.d.ts.map +1 -0
- package/dist/BlockEditor/InsertBetween.d.ts +26 -0
- package/dist/BlockEditor/InsertBetween.d.ts.map +1 -0
- package/dist/BlockEditor/SlashCommand.d.ts +24 -0
- package/dist/BlockEditor/SlashCommand.d.ts.map +1 -0
- package/dist/BlockEditor/TableBubbleMenu.d.ts +9 -0
- package/dist/BlockEditor/TableBubbleMenu.d.ts.map +1 -0
- package/dist/BlockEditor/TextBubbleMenu.d.ts +7 -0
- package/dist/BlockEditor/TextBubbleMenu.d.ts.map +1 -0
- package/dist/BlockEditor/TitleField.d.ts +17 -0
- package/dist/BlockEditor/TitleField.d.ts.map +1 -0
- package/dist/BlockEditor/ToggleBlock.d.ts +14 -0
- package/dist/BlockEditor/ToggleBlock.d.ts.map +1 -0
- package/dist/BlockEditor/ToggleBlockView.d.ts +3 -0
- package/dist/BlockEditor/ToggleBlockView.d.ts.map +1 -0
- package/dist/BlockEditor/VideoBlock.d.ts +25 -0
- package/dist/BlockEditor/VideoBlock.d.ts.map +1 -0
- package/dist/BlockEditor/VideoBlockView.d.ts +3 -0
- package/dist/BlockEditor/VideoBlockView.d.ts.map +1 -0
- package/dist/BlockEditor/WordCount.d.ts +9 -0
- package/dist/BlockEditor/WordCount.d.ts.map +1 -0
- package/dist/BlockEditor/blocks.d.ts +37 -0
- package/dist/BlockEditor/blocks.d.ts.map +1 -0
- package/dist/BlockEditor/index.d.ts +26 -0
- package/dist/BlockEditor/index.d.ts.map +1 -0
- package/dist/BlockEditor/insertAtomBlock.d.ts +30 -0
- package/dist/BlockEditor/insertAtomBlock.d.ts.map +1 -0
- package/dist/RichTextEditor/DynamicVariable.d.ts +48 -0
- package/dist/RichTextEditor/DynamicVariable.d.ts.map +1 -0
- package/dist/RichTextEditor/IndentExtension.d.ts +11 -0
- package/dist/RichTextEditor/IndentExtension.d.ts.map +1 -0
- package/dist/RichTextEditor/LinkModal.d.ts +9 -0
- package/dist/RichTextEditor/LinkModal.d.ts.map +1 -0
- package/dist/RichTextEditor/MenuBar.d.ts +24 -0
- package/dist/RichTextEditor/MenuBar.d.ts.map +1 -0
- package/dist/RichTextEditor/RichTextEditor.d.ts +41 -0
- package/dist/RichTextEditor/RichTextEditor.d.ts.map +1 -0
- package/dist/RichTextEditor/VariablePicker.d.ts +15 -0
- package/dist/RichTextEditor/VariablePicker.d.ts.map +1 -0
- package/dist/RichTextEditor/index.d.ts +5 -0
- package/dist/RichTextEditor/index.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +386 -0
- package/dist/index.mjs +39687 -0
- package/package.json +63 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nevuto
|
|
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 USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nevuto/editors
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Editors for Nevuto UI: a rich text editor and a block editor with slash commands.
|
|
4
|
+
|
|
5
|
+
Part of Nevuto UI, the design system of the Nevuto admin. Apps embedded in the admin can use it to look like part of it.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i @nevuto/editors
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peer dependencies: react, react-dom.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import '@nevuto/editors/styles.css'
|
|
19
|
+
import { RichTextEditor, BlockEditor } from '@nevuto/editors'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Links
|
|
23
|
+
|
|
24
|
+
- Nevuto UI docs: https://design.nevuto.com
|
|
25
|
+
- Building apps for Nevuto: https://nevuto.dev
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
interface BlockDragHandleProps {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The grip that appears in the left margin of whichever block the pointer is
|
|
7
|
+
* over: drag it to reorder, click it for the block's own actions.
|
|
8
|
+
*/
|
|
9
|
+
export declare function BlockDragHandle({ editor }: BlockDragHandleProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=BlockDragHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockDragHandle.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/BlockDragHandle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAK3C,UAAU,oBAAoB;IAC5B,MAAM,EAAE,MAAM,CAAA;CACf;AAWD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,+BA2G/D"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
import { JSONContent } from '@tiptap/core';
|
|
3
|
+
import { EntityReference } from './EntityBlocks';
|
|
4
|
+
import { BlockDefinition } from './blocks';
|
|
5
|
+
/** An empty document — a single blank paragraph, what a fresh post starts as. */
|
|
6
|
+
export declare const EMPTY_DOCUMENT: JSONContent;
|
|
7
|
+
export interface BlockEditorChangeMeta {
|
|
8
|
+
/** True while the document holds nothing but empty blocks. */
|
|
9
|
+
isEmpty: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface BlockEditorProps {
|
|
12
|
+
/** Controlled document. Unlike RichTextEditor this is Tiptap JSON, not HTML:
|
|
13
|
+
blocks carry attributes (image layout, button href, …) that HTML drops. */
|
|
14
|
+
value?: JSONContent;
|
|
15
|
+
defaultValue?: JSONContent;
|
|
16
|
+
/** Shown in the first block while the document is empty. */
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Always called with a full document — never null, so hosts do not need to
|
|
19
|
+
normalise it before handing it to a form field. */
|
|
20
|
+
onChange?: (value: JSONContent, meta: BlockEditorChangeMeta) => void;
|
|
21
|
+
onFocus?: () => void;
|
|
22
|
+
onBlur?: () => void;
|
|
23
|
+
readOnly?: boolean;
|
|
24
|
+
/** Places the caret in the document on mount. */
|
|
25
|
+
autoFocus?: boolean;
|
|
26
|
+
/** Measure of the writing column. Blocks may break out of it later (full-width
|
|
27
|
+
images), which is why it is a width and not a plain container max-width. */
|
|
28
|
+
contentWidth?: string;
|
|
29
|
+
/** What `/` and the + button offer. Spread `defaultBlocks` to extend it:
|
|
30
|
+
`blocks={[...defaultBlocks, productCardBlock]}`. */
|
|
31
|
+
blocks?: BlockDefinition[];
|
|
32
|
+
/** The + button beside empty lines, and the insert line between blocks. */
|
|
33
|
+
showInsertButton?: boolean;
|
|
34
|
+
/** The formatting menu that appears over a text selection. */
|
|
35
|
+
showBubbleMenu?: boolean;
|
|
36
|
+
/** The grip in the left margin for reordering and per-block actions. */
|
|
37
|
+
showDragHandle?: boolean;
|
|
38
|
+
/** Word and character totals in the bottom-right corner. */
|
|
39
|
+
showWordCount?: boolean;
|
|
40
|
+
/** Stores a file and resolves with its URL — the app owns the endpoint, the
|
|
41
|
+
editor only hands over the file. Without it, media blocks fall back to
|
|
42
|
+
accepting a pasted URL. */
|
|
43
|
+
onUpload?: (file: File) => Promise<string>;
|
|
44
|
+
/** File picker filter for media blocks. */
|
|
45
|
+
uploadAccept?: string;
|
|
46
|
+
/** Opens the app's product picker (a modal in admin-app) and resolves with
|
|
47
|
+
the chosen record, or null if the user cancels. The product block is
|
|
48
|
+
hidden from the menu when this is missing. */
|
|
49
|
+
onPickProduct?: () => Promise<EntityReference | null>;
|
|
50
|
+
/** Same contract as onPickProduct, for collections. */
|
|
51
|
+
onPickCollection?: () => Promise<EntityReference | null>;
|
|
52
|
+
/** The post title, shown above the document in the same writing column. */
|
|
53
|
+
title?: string;
|
|
54
|
+
onTitleChange?: (title: string) => void;
|
|
55
|
+
titlePlaceholder?: string;
|
|
56
|
+
/** Renders the title field. Off by default — plenty of hosts lay the title
|
|
57
|
+
out themselves. */
|
|
58
|
+
showTitle?: boolean;
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface BlockEditorRef {
|
|
62
|
+
/** Focuses the document, placing the caret at the end by default. */
|
|
63
|
+
focus: (position?: 'start' | 'end') => void;
|
|
64
|
+
/** The underlying Tiptap instance — null until the editor mounts. */
|
|
65
|
+
editor: Editor | null;
|
|
66
|
+
}
|
|
67
|
+
export declare const BlockEditor: import('react').ForwardRefExoticComponent<BlockEditorProps & import('react').RefAttributes<BlockEditorRef>>;
|
|
68
|
+
//# sourceMappingURL=BlockEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockEditor.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/BlockEditor.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAS,MAAM,cAAc,CAAA;AAsBtD,OAAO,EAAiC,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAOpF,OAAO,EAA+B,KAAK,eAAe,EAAE,MAAM,UAAU,CAAA;AAG5E,iFAAiF;AACjF,eAAO,MAAM,cAAc,EAAE,WAA+D,CAAA;AAE5F,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B;kFAC8E;IAC9E,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,YAAY,CAAC,EAAE,WAAW,CAAA;IAC1B,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;0DACsD;IACtD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAA;IACpE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;mFAC+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;2DACuD;IACvD,MAAM,CAAC,EAAE,eAAe,EAAE,CAAA;IAC1B,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,8DAA8D;IAC9D,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,wEAAwE;IACxE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;kCAE8B;IAC9B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC1C,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;qDAEiD;IACjD,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;IACrD,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;IACxD,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;0BACsB;IACtB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,CAAA;IAC3C,qEAAqE;IACrE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAyCD,eAAO,MAAM,WAAW,6GAwXvB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BlockDefinition } from './blocks';
|
|
2
|
+
/** Where the menu anchors — a caret rect from Tiptap or a button's rect. */
|
|
3
|
+
export interface MenuAnchor {
|
|
4
|
+
top: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
}
|
|
8
|
+
export interface BlockMenuProps {
|
|
9
|
+
blocks: BlockDefinition[];
|
|
10
|
+
/** Re-read on scroll and resize so the panel travels with whatever it is
|
|
11
|
+
attached to — the + button or the caret — instead of hanging in place. */
|
|
12
|
+
getAnchor: () => MenuAnchor | null;
|
|
13
|
+
/** Text typed after `/`; shown as "no results" context when nothing matches. */
|
|
14
|
+
query: string;
|
|
15
|
+
onSelect: (block: BlockDefinition) => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
emptyLabel?: string;
|
|
18
|
+
/** Listen for keys directly instead of waiting to be driven through the ref.
|
|
19
|
+
The slash menu is driven by Suggestion's key handler; the + button has no
|
|
20
|
+
such handler, so its menu captures keys itself. */
|
|
21
|
+
captureKeys?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface BlockMenuRef {
|
|
24
|
+
/** Returns true when the menu consumed the key, so the editor ignores it. */
|
|
25
|
+
onKeyDown: (event: KeyboardEvent) => boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const BlockMenu: import('react').ForwardRefExoticComponent<BlockMenuProps & import('react').RefAttributes<BlockMenuRef>>;
|
|
28
|
+
//# sourceMappingURL=BlockMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockMenu.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/BlockMenu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB;iFAC6E;IAC7E,SAAS,EAAE,MAAM,UAAU,GAAG,IAAI,CAAA;IAClC,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;0DAEsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAA;CAC7C;AAKD,eAAO,MAAM,SAAS,yGAoJrB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export type ButtonBlockStyle = 'fill' | 'outline';
|
|
3
|
+
export type ButtonBlockAlign = 'left' | 'center' | 'right';
|
|
4
|
+
declare module '@tiptap/core' {
|
|
5
|
+
interface Commands<ReturnType> {
|
|
6
|
+
buttonBlock: {
|
|
7
|
+
insertButtonBlock: (attrs?: {
|
|
8
|
+
text?: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
style?: ButtonBlockStyle;
|
|
11
|
+
align?: ButtonBlockAlign;
|
|
12
|
+
}) => ReturnType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const BUTTON_BLOCK_NAME = "buttonBlock";
|
|
17
|
+
export declare const ButtonBlock: Node<any, any>;
|
|
18
|
+
//# sourceMappingURL=ButtonBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonBlock.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/ButtonBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAKpD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAA;AACjD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE1D,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,WAAW,EAAE;YACX,iBAAiB,EAAE,CAAC,KAAK,CAAC,EAAE;gBAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;gBACb,IAAI,CAAC,EAAE,MAAM,CAAA;gBACb,KAAK,CAAC,EAAE,gBAAgB,CAAA;gBACxB,KAAK,CAAC,EAAE,gBAAgB,CAAA;aACzB,KAAK,UAAU,CAAA;SACjB,CAAA;KACF;CACF;AAED,eAAO,MAAM,iBAAiB,gBAAgB,CAAA;AAE9C,eAAO,MAAM,WAAW,gBAsDtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonBlockView.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/ButtonBlockView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAsBnE,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,+BA+FtG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export type CalloutTone = 'information' | 'success' | 'warning' | 'error' | 'neutral';
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
calloutBlock: {
|
|
6
|
+
insertCalloutBlock: (attrs?: {
|
|
7
|
+
emoji?: string | null;
|
|
8
|
+
tone?: CalloutTone;
|
|
9
|
+
}) => ReturnType;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const CALLOUT_BLOCK_NAME = "callout";
|
|
14
|
+
export declare const CalloutBlock: Node<any, any>;
|
|
15
|
+
//# sourceMappingURL=CalloutBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutBlock.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/CalloutBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAIpD,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;AAErF,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,YAAY,EAAE;YACZ,kBAAkB,EAAE,CAAC,KAAK,CAAC,EAAE;gBAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;gBAAC,IAAI,CAAC,EAAE,WAAW,CAAA;aAAE,KAAK,UAAU,CAAA;SAC1F,CAAA;KACF;CACF;AAED,eAAO,MAAM,kBAAkB,YAAY,CAAA;AAE3C,eAAO,MAAM,YAAY,gBAiDvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutBlockView.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/CalloutBlockView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAkBpF,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,+BA2GvG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { NodeViewProps } from '@tiptap/react';
|
|
3
|
+
/** What the host's picker hands back. The editor stores it verbatim. */
|
|
4
|
+
export interface EntityReference {
|
|
5
|
+
/** The record's id — the app resolves fresh data from this at render time. */
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
/** Thumbnail URL. */
|
|
9
|
+
imageUrl?: string | null;
|
|
10
|
+
/** Secondary line: price for a product, item count for a collection. */
|
|
11
|
+
subtitle?: string | null;
|
|
12
|
+
/** Optional third line, e.g. a handle or SKU. */
|
|
13
|
+
meta?: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface EntityBlockOptions {
|
|
16
|
+
/** Opens the host's picker (a modal in admin-app) and resolves with the
|
|
17
|
+
chosen record, or null when the user cancels. Without it the block cannot
|
|
18
|
+
be filled, which is why the slash menu hides it. */
|
|
19
|
+
onPick?: () => Promise<EntityReference | null>;
|
|
20
|
+
}
|
|
21
|
+
interface EntityBlockViewProps extends NodeViewProps {
|
|
22
|
+
/** Wording for the empty state, e.g. 'product' or 'collection'. */
|
|
23
|
+
noun: string;
|
|
24
|
+
icon: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Shared body for the product and collection blocks: both are a reference to a
|
|
28
|
+
* record the app owns, picked through the app's own modal.
|
|
29
|
+
*/
|
|
30
|
+
export declare function EntityBlockView({ node, updateAttributes, deleteNode, editor, selected, extension, noun, icon, }: EntityBlockViewProps): import("react").JSX.Element;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=EntityBlockView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityBlockView.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/EntityBlockView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAKnE,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC;;2DAEuD;IACvD,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;CAC/C;AAED,UAAU,oBAAqB,SAAQ,aAAa;IAClD,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,IAAI,GACL,EAAE,oBAAoB,+BAoGtB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { EntityBlockOptions, EntityReference } from './EntityBlockView';
|
|
3
|
+
export type { EntityReference, EntityBlockOptions };
|
|
4
|
+
declare module '@tiptap/core' {
|
|
5
|
+
interface Commands<ReturnType> {
|
|
6
|
+
entityBlocks: {
|
|
7
|
+
insertProductBlock: (entity?: EntityReference) => ReturnType;
|
|
8
|
+
insertCollectionBlock: (entity?: EntityReference) => ReturnType;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const PRODUCT_BLOCK_NAME = "productBlock";
|
|
13
|
+
export declare const COLLECTION_BLOCK_NAME = "collectionBlock";
|
|
14
|
+
export declare const ProductBlock: Node<EntityBlockOptions, any>;
|
|
15
|
+
export declare const CollectionBlock: Node<EntityBlockOptions, any>;
|
|
16
|
+
//# sourceMappingURL=EntityBlocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityBlocks.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/EntityBlocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAGpD,OAAO,EAAmB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGlG,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA;AAEnD,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,YAAY,EAAE;YACZ,kBAAkB,EAAE,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,UAAU,CAAA;YAC5D,qBAAqB,EAAE,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,UAAU,CAAA;SAChE,CAAA;KACF;CACF;AAED,eAAO,MAAM,kBAAkB,iBAAiB,CAAA;AAChD,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AAmEtD,eAAO,MAAM,YAAY,+BAMvB,CAAA;AAEF,eAAO,MAAM,eAAe,+BAM1B,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { ImageLayout } from './ImageBlock';
|
|
3
|
+
export interface GalleryImage {
|
|
4
|
+
src: string;
|
|
5
|
+
alt?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface GalleryBlockOptions {
|
|
8
|
+
onUpload?: (file: File) => Promise<string>;
|
|
9
|
+
accept: string;
|
|
10
|
+
}
|
|
11
|
+
declare module '@tiptap/core' {
|
|
12
|
+
interface Commands<ReturnType> {
|
|
13
|
+
galleryBlock: {
|
|
14
|
+
insertGalleryBlock: (attrs?: {
|
|
15
|
+
images?: GalleryImage[];
|
|
16
|
+
caption?: string;
|
|
17
|
+
layout?: ImageLayout;
|
|
18
|
+
}) => ReturnType;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export declare const GALLERY_BLOCK_NAME = "gallery";
|
|
23
|
+
export declare const GalleryBlock: Node<GalleryBlockOptions, any>;
|
|
24
|
+
//# sourceMappingURL=GalleryBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryBlock.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/GalleryBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAIpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC1C,MAAM,EAAE,MAAM,CAAA;CACf;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,YAAY,EAAE;YACZ,kBAAkB,EAAE,CAAC,KAAK,CAAC,EAAE;gBAAE,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;gBAAC,OAAO,CAAC,EAAE,MAAM,CAAC;gBAAC,MAAM,CAAC,EAAE,WAAW,CAAA;aAAE,KAAK,UAAU,CAAA;SAChH,CAAA;KACF;CACF;AAED,eAAO,MAAM,kBAAkB,YAAY,CAAA;AAE3C,eAAO,MAAM,YAAY,gCA8DvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryBlockView.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/GalleryBlockView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAyBnE,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,aAAa,+BAmRlH"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
declare module '@tiptap/core' {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
htmlBlock: {
|
|
5
|
+
insertHtmlBlock: (attrs?: {
|
|
6
|
+
html?: string;
|
|
7
|
+
}) => ReturnType;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const HTML_BLOCK_NAME = "htmlBlock";
|
|
12
|
+
export declare const HtmlBlock: Node<any, any>;
|
|
13
|
+
//# sourceMappingURL=HtmlBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlBlock.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/HtmlBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAKpD,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,SAAS,EAAE;YACT,eAAe,EAAE,CAAC,KAAK,CAAC,EAAE;gBAAE,IAAI,CAAC,EAAE,MAAM,CAAA;aAAE,KAAK,UAAU,CAAA;SAC3D,CAAA;KACF;CACF;AAED,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C,eAAO,MAAM,SAAS,gBAwCpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlBlockView.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/HtmlBlockView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAGnE,OAAO,iCAAiC,CAAA;AAKxC,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,+BAwFpG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export type ImageLayout = 'normal' | 'wide' | 'full';
|
|
3
|
+
export interface ImageBlockOptions {
|
|
4
|
+
/** Stores the file and resolves with its URL. Without it the block only
|
|
5
|
+
accepts a pasted URL — the library never talks to a backend itself. */
|
|
6
|
+
onUpload?: (file: File) => Promise<string>;
|
|
7
|
+
/** File picker filter. */
|
|
8
|
+
accept: string;
|
|
9
|
+
HTMLAttributes: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
declare module '@tiptap/core' {
|
|
12
|
+
interface Commands<ReturnType> {
|
|
13
|
+
imageBlock: {
|
|
14
|
+
/** Inserts an image block; omit src to get the upload placeholder. */
|
|
15
|
+
insertImageBlock: (attrs?: {
|
|
16
|
+
src?: string;
|
|
17
|
+
alt?: string;
|
|
18
|
+
caption?: string;
|
|
19
|
+
layout?: ImageLayout;
|
|
20
|
+
}) => ReturnType;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export declare const IMAGE_BLOCK_NAME = "image";
|
|
25
|
+
export declare const ImageBlock: Node<ImageBlockOptions, any>;
|
|
26
|
+
//# sourceMappingURL=ImageBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageBlock.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/ImageBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAKpD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;AAEpD,MAAM,WAAW,iBAAiB;IAChC;8EAC0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC1C,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACxC;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,UAAU,EAAE;YACV,sEAAsE;YACtE,gBAAgB,EAAE,CAAC,KAAK,CAAC,EAAE;gBAAE,GAAG,CAAC,EAAE,MAAM,CAAC;gBAAC,GAAG,CAAC,EAAE,MAAM,CAAC;gBAAC,OAAO,CAAC,EAAE,MAAM,CAAC;gBAAC,MAAM,CAAC,EAAE,WAAW,CAAA;aAAE,KAAK,UAAU,CAAA;SACjH,CAAA;KACF;CACF;AAED,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,eAAO,MAAM,UAAU,8BAwErB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageBlockView.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/ImageBlockView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAoBnE,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,aAAa,+BAyPhH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
export interface InsertBetweenTarget {
|
|
3
|
+
/** Document position a new block should land at. */
|
|
4
|
+
pos: number;
|
|
5
|
+
/** Rect of the gap, in viewport coordinates, for anchoring the menu. */
|
|
6
|
+
rect: {
|
|
7
|
+
top: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
left: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
interface InsertBetweenProps {
|
|
13
|
+
editor: Editor;
|
|
14
|
+
/** The editor's own box, so the indicator can be placed inside it. */
|
|
15
|
+
wrapper: HTMLElement | null;
|
|
16
|
+
onInsert: (target: InsertBetweenTarget) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The line-and-plus that appears between two blocks when the pointer rests in
|
|
20
|
+
* the gap. Clicking it opens the block menu at that exact position, which is
|
|
21
|
+
* the only way to insert between an image and the block under it without
|
|
22
|
+
* first making an empty paragraph.
|
|
23
|
+
*/
|
|
24
|
+
export declare function InsertBetween({ editor, wrapper, onInsert }: InsertBetweenProps): import("react").JSX.Element | null;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=InsertBetween.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InsertBetween.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/InsertBetween.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAI3C,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAA;IACX,wEAAwE;IACxE,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACpD;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;CAChD;AAKD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,kBAAkB,sCAsE9E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Extension, Range } from '@tiptap/core';
|
|
2
|
+
import { PluginKey } from '@tiptap/pm/state';
|
|
3
|
+
export interface SlashCommandState {
|
|
4
|
+
/** The `/query` text, for deletion when a block is chosen. */
|
|
5
|
+
range: Range;
|
|
6
|
+
/** What was typed after the slash. */
|
|
7
|
+
query: string;
|
|
8
|
+
/** Live caret rect — call it again to follow the document as it scrolls. */
|
|
9
|
+
getRect: () => DOMRect | null;
|
|
10
|
+
}
|
|
11
|
+
export interface SlashCommandOptions {
|
|
12
|
+
/** Called with the live state while the menu should be open, null on exit. */
|
|
13
|
+
onStateChange: (state: SlashCommandState | null) => void;
|
|
14
|
+
/** Return true to keep the key from reaching the document. */
|
|
15
|
+
onKeyDown: (event: KeyboardEvent) => boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const SLASH_COMMAND_KEY: PluginKey<any>;
|
|
18
|
+
/**
|
|
19
|
+
* Reports slash-menu position and query; the menu itself renders in React.
|
|
20
|
+
* Keeping the list out of Suggestion's `items` means the host can change its
|
|
21
|
+
* block registry without the ProseMirror plugin being rebuilt.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SlashCommand: Extension<SlashCommandOptions, any>;
|
|
24
|
+
//# sourceMappingURL=SlashCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlashCommand.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/SlashCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAG5C,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,KAAK,EAAE,KAAK,CAAA;IACZ,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,4EAA4E;IAC5E,OAAO,EAAE,MAAM,OAAO,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,aAAa,EAAE,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAA;IACxD,8DAA8D;IAC9D,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAA;CAC7C;AAED,eAAO,MAAM,iBAAiB,gBAA2C,CAAA;AAEzE;;;;GAIG;AACH,eAAO,MAAM,YAAY,qCAwCvB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
interface TableBubbleMenuProps {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
}
|
|
5
|
+
/** True while the user has dragged across cells rather than selecting text. */
|
|
6
|
+
export declare function isCellSelection(editor: Editor): boolean;
|
|
7
|
+
export declare function TableBubbleMenu({ editor }: TableBubbleMenuProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=TableBubbleMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableBubbleMenu.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/TableBubbleMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAkB3D,UAAU,oBAAoB;IAC5B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,+BA+I/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextBubbleMenu.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/TextBubbleMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AA4B3D,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAA;CACf;AAqBD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BA+V7D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface TitleFieldProps {
|
|
2
|
+
value: string;
|
|
3
|
+
placeholder: string;
|
|
4
|
+
readOnly: boolean;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
/** Called when the caret should leave the title and enter the document. */
|
|
7
|
+
onLeave: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The post's title, above the document but inside the same writing column.
|
|
11
|
+
* It is deliberately not a Tiptap node: the title is a separate field on the
|
|
12
|
+
* post, and keeping it out of the document means it can never be dragged,
|
|
13
|
+
* deleted or wrapped in a block.
|
|
14
|
+
*/
|
|
15
|
+
export declare function TitleField({ value, placeholder, readOnly, onChange, onLeave }: TitleFieldProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=TitleField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleField.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/TitleField.tsx"],"names":[],"mappings":"AAGA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,2EAA2E;IAC3E,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,eAAe,+BA+B9F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
declare module '@tiptap/core' {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
toggleBlock: {
|
|
5
|
+
insertToggleBlock: (attrs?: {
|
|
6
|
+
summary?: string;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
}) => ReturnType;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const TOGGLE_BLOCK_NAME = "toggleBlock";
|
|
13
|
+
export declare const ToggleBlock: Node<any, any>;
|
|
14
|
+
//# sourceMappingURL=ToggleBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleBlock.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/ToggleBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAIpD,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,WAAW,EAAE;YACX,iBAAiB,EAAE,CAAC,KAAK,CAAC,EAAE;gBAAE,OAAO,CAAC,EAAE,MAAM,CAAC;gBAAC,IAAI,CAAC,EAAE,OAAO,CAAA;aAAE,KAAK,UAAU,CAAA;SAChF,CAAA;KACF;CACF;AAED,eAAO,MAAM,iBAAiB,gBAAgB,CAAA;AAE9C,eAAO,MAAM,WAAW,gBAiDtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleBlockView.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/ToggleBlockView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAKpF,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,+BAgEtG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { ImageLayout } from './ImageBlock';
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
videoBlock: {
|
|
6
|
+
insertVideoBlock: (attrs?: {
|
|
7
|
+
src?: string;
|
|
8
|
+
caption?: string;
|
|
9
|
+
layout?: ImageLayout;
|
|
10
|
+
}) => ReturnType;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export declare const VIDEO_BLOCK_NAME = "videoBlock";
|
|
15
|
+
export interface VideoEmbed {
|
|
16
|
+
kind: 'iframe' | 'file';
|
|
17
|
+
url: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Turns a watch URL into something embeddable. Anything that is not a known
|
|
21
|
+
* provider is treated as a direct media file, which covers self-hosted MP4s.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveVideoEmbed(raw: string): VideoEmbed | null;
|
|
24
|
+
export declare const VideoBlock: Node<any, any>;
|
|
25
|
+
//# sourceMappingURL=VideoBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoBlock.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/VideoBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAIpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,UAAU,EAAE;YACV,gBAAgB,EAAE,CAAC,KAAK,CAAC,EAAE;gBAAE,GAAG,CAAC,EAAE,MAAM,CAAC;gBAAC,OAAO,CAAC,EAAE,MAAM,CAAC;gBAAC,MAAM,CAAC,EAAE,WAAW,CAAA;aAAE,KAAK,UAAU,CAAA;SACnG,CAAA;KACF;CACF;AAED,eAAO,MAAM,gBAAgB,eAAe,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;IACvB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAahE;AAED,eAAO,MAAM,UAAU,gBAgDrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoBlockView.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/VideoBlockView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAoBnE,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,+BAuHrG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
interface WordCountProps {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
}
|
|
5
|
+
/** Word and character totals, read from the CharacterCount extension so the
|
|
6
|
+
document is not re-scanned on every keystroke. */
|
|
7
|
+
export declare function WordCount({ editor }: WordCountProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=WordCount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WordCount.d.ts","sourceRoot":"","sources":["../../src/BlockEditor/WordCount.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3D,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;qDACqD;AACrD,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,+BAuBnD"}
|