@grapesjs/studio-sdk-plugins 1.0.4 → 1.0.5

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.
@@ -0,0 +1,78 @@
1
+ import { Editor } from 'grapesjs';
2
+ import { MarkType, Node } from 'prosemirror-model';
3
+ import { Command, EditorState, Transaction } from 'prosemirror-state';
4
+ import { EditorView } from 'prosemirror-view';
5
+ import { CustomRteOptions } from './types';
6
+ export declare const handleEnter: (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean;
7
+ export declare function handleShiftEnter(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
8
+ export declare function setAlignment(view: EditorView, alignment: string, force?: boolean): void;
9
+ export declare const markIsActiveAcrossSelection: (state: EditorState, markType: MarkType) => boolean;
10
+ export declare function setLink(view: EditorView, href: string, target?: string): void;
11
+ export declare function setFontSize(view: EditorView, size: string): void;
12
+ export declare const getClosestParentNode: (view: EditorView, predicate: (node: Node) => boolean) => {
13
+ pos: number;
14
+ start: number;
15
+ depth: number;
16
+ node: Node;
17
+ } | undefined;
18
+ export declare const cssStringToCssObject: (cssString: string) => Record<string, string>;
19
+ export declare const cssObjectToCssString: (cssObject: Record<string, string>) => string;
20
+ export declare function chainCommands(...commands: Command[]): Command;
21
+ export declare const focusCursor: (view: EditorView, opts?: CustomRteOptions) => void;
22
+ export declare const getCommands: (view: EditorView) => {
23
+ bold: {
24
+ toggle: () => boolean;
25
+ isActive: () => boolean;
26
+ };
27
+ italic: {
28
+ toggle: () => boolean;
29
+ isActive: () => boolean;
30
+ };
31
+ underline: {
32
+ toggle: () => boolean;
33
+ isActive: () => boolean;
34
+ };
35
+ strikethrough: {
36
+ toggle: () => boolean;
37
+ isActive: () => boolean;
38
+ };
39
+ link: {
40
+ get: () => any;
41
+ toggle: () => boolean;
42
+ isActive: () => boolean;
43
+ create: (props: {
44
+ url: string;
45
+ target?: string;
46
+ }) => void;
47
+ };
48
+ alignText: {
49
+ get: () => string;
50
+ set: (props: {
51
+ value: string;
52
+ }) => void;
53
+ };
54
+ fontSize: {
55
+ get: () => any;
56
+ set: (props: {
57
+ value: string;
58
+ }) => void;
59
+ };
60
+ image: {
61
+ open(editor: Editor): void;
62
+ };
63
+ heading: {
64
+ get: () => string;
65
+ set: ({ value }: {
66
+ value: string;
67
+ }) => void;
68
+ };
69
+ listBullet: {
70
+ isActive: () => boolean;
71
+ toggle: () => boolean;
72
+ };
73
+ listOrdered: {
74
+ isActive: () => boolean;
75
+ toggle: () => boolean;
76
+ };
77
+ };
78
+ export type BuiltInCommands = ReturnType<typeof getCommands>;
@@ -0,0 +1,3 @@
1
+ import { RteProseMirrorOptions } from './types';
2
+ declare const _default: import('../utils').PluginWithInit<RteProseMirrorOptions>;
3
+ export default _default;