@bigbinary/neeto-editor 0.6.8 → 0.7.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/CHANGELOG.md +12 -0
- package/dist/editor-content.min.css +1 -0
- package/dist/editor-output.js +3 -0
- package/package.json +8 -3
- package/types.d.ts +78 -0
- package/build/index.js +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -22,6 +22,18 @@ Prefix the change with one of these keywords:
|
|
|
22
22
|
- *Fixed*: for any bug fixes.
|
|
23
23
|
- *Security*: in case of vulnerabilities.
|
|
24
24
|
|
|
25
|
+
## 0.7.2 - 2022-09-01
|
|
26
|
+
|
|
27
|
+
- Added: type support to all the exported components.
|
|
28
|
+
|
|
29
|
+
## 0.7.1 - 2022-08-29
|
|
30
|
+
|
|
31
|
+
- Changed: CodeBlock theme to light.
|
|
32
|
+
|
|
33
|
+
## 0.7.0 - 2022-08-25
|
|
34
|
+
|
|
35
|
+
- Changed: **BREAKING** the CDN for editor content styles from https://cdn.jsdelivr.net/gh/bigbinary/neeto-editor-tiptap@master/dist/editor-content.min.css to https://cdn.jsdelivr.net/gh/bigbinary/neeto-editor@master/dist/editor-content.min.css.
|
|
36
|
+
|
|
25
37
|
## 0.6.8 - 2022-08-24
|
|
26
38
|
|
|
27
39
|
- Fixed issue where variables added get appended to starting of the existing content rather than at the end.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";@import url("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/github.min.css");.neeto-editor-content{white-space:pre-wrap;word-break:break-word}.neeto-editor-content h1,.neeto-editor-content h2,.neeto-editor-content h3,.neeto-editor-content h4,.neeto-editor-content h5,.neeto-editor-content h6{font-size:revert}.neeto-editor-content p{line-height:1.625;margin-bottom:16px}.neeto-editor-content p:empty:after{content:" "}.neeto-editor-content p:last-child{margin-bottom:0}.neeto-editor-content code{background-color:rgba(175,184,193,.2);border-radius:6px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:85%;padding:.2em .4em}.neeto-editor-content pre{background-color:#f6f8fa;border-radius:2px;font-size:14px;line-height:20px;margin-bottom:8px;margin-top:8px;overflow-x:auto;padding:16px}.neeto-editor-content pre>code{background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:400;line-height:inherit;padding:0}.neeto-editor-content blockquote{border-left-color:#e5e7eb;border-left-width:4px;color:#1b1f23;font-weight:500;margin:8px 0;padding-left:12px;quotes:"“" "”" "‘" "’"}.neeto-editor-content blockquote>p:after,.neeto-editor-content blockquote>p:before{content:""!important}.neeto-editor-content ol,.neeto-editor-content ul{list-style:revert;margin:revert;padding:revert}.neeto-editor-content ol>li>p,.neeto-editor-content ul>li>p{margin-bottom:.375rem!important;margin-top:0!important}.neeto-editor-content ol li:before,.neeto-editor-content ul li:before{background-color:#1b1f23}.neeto-editor-content a[href]{color:#276ef1}.neeto-editor-content .video-wrapper{height:315px;margin:auto;width:560px}.neeto-editor-content mark{background:#c9e4cc;border-radius:2px;color:inherit;padding:0 4px}.neeto-editor-content [data-variable]{background-color:rgba(233,235,237,.5);border-radius:2px;color:#49545c;display:inline-flex;line-height:1;padding:4px 6px}.neeto-editor-content [data-mention]{opacity:.6}.neeto-editor-content--hidden{display:none}.neeto-editor__image{border:1.5px solid #eaf3fc;display:inline-block;margin:0 12px}.neeto-editor__image figure{margin:16px 12px;outline:none}.neeto-editor__image figure img{height:100%;-o-object-fit:contain;object-fit:contain;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto;width:100%}.neeto-editor__image figure figcaption{color:#49545c;text-align:center}.neeto-editor__image-defaults{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.neeto-editor__image--none{display:flex;justify-content:center}.neeto-editor__image--left{float:left;margin-left:0}.neeto-editor__image--right{float:right;margin-right:0}.neeto-editor__image--center{margin:0 auto}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var css = "@charset \"UTF-8\";@import url(\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/github.min.css\");.neeto-editor-content{white-space:pre-wrap;word-break:break-word}.neeto-editor-content h1,.neeto-editor-content h2,.neeto-editor-content h3,.neeto-editor-content h4,.neeto-editor-content h5,.neeto-editor-content h6{font-size:revert}.neeto-editor-content p{line-height:1.625;margin-bottom:16px}.neeto-editor-content p:empty:after{content:\" \"}.neeto-editor-content p:last-child{margin-bottom:0}.neeto-editor-content code{background-color:rgba(175,184,193,.2);border-radius:6px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:85%;padding:.2em .4em}.neeto-editor-content pre{background-color:#f6f8fa;border-radius:2px;font-size:14px;line-height:20px;margin-bottom:8px;margin-top:8px;overflow-x:auto;padding:16px}.neeto-editor-content pre>code{background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:400;line-height:inherit;padding:0}.neeto-editor-content blockquote{border-left-color:#e5e7eb;border-left-width:4px;color:#1b1f23;font-weight:500;margin:8px 0;padding-left:12px;quotes:\"“\" \"”\" \"‘\" \"’\"}.neeto-editor-content blockquote>p:after,.neeto-editor-content blockquote>p:before{content:\"\"!important}.neeto-editor-content ol,.neeto-editor-content ul{list-style:revert;margin:revert;padding:revert}.neeto-editor-content ol>li>p,.neeto-editor-content ul>li>p{margin-bottom:.375rem!important;margin-top:0!important}.neeto-editor-content ol li:before,.neeto-editor-content ul li:before{background-color:#1b1f23}.neeto-editor-content a[href]{color:#276ef1}.neeto-editor-content .video-wrapper{height:315px;margin:auto;width:560px}.neeto-editor-content mark{background:#c9e4cc;border-radius:2px;color:inherit;padding:0 4px}.neeto-editor-content [data-variable]{background-color:rgba(233,235,237,.5);border-radius:2px;color:#49545c;display:inline-flex;line-height:1;padding:4px 6px}.neeto-editor-content [data-mention]{opacity:.6}.neeto-editor-content--hidden{display:none}.neeto-editor__image{border:1.5px solid #eaf3fc;display:inline-block;margin:0 12px}.neeto-editor__image figure{margin:16px 12px;outline:none}.neeto-editor__image figure img{height:100%;-o-object-fit:contain;object-fit:contain;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto;width:100%}.neeto-editor__image figure figcaption{color:#49545c;text-align:center}.neeto-editor__image-defaults{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.neeto-editor__image--none{display:flex;justify-content:center}.neeto-editor__image--left{float:left;margin-left:0}.neeto-editor__image--right{float:right;margin-right:0}.neeto-editor__image--center{margin:0 auto}";
|
|
2
|
+
|
|
3
|
+
export { css, css as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"main": "./build/index.js",
|
|
5
|
+
"types": "./types.d.ts",
|
|
5
6
|
"description": "neetoEditor is the library that drives the rich text experience in all neeto products built at BigBinary",
|
|
6
7
|
"keywords": [
|
|
7
8
|
"ui",
|
|
@@ -9,6 +10,10 @@
|
|
|
9
10
|
"editor",
|
|
10
11
|
"react"
|
|
11
12
|
],
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"types.d.ts"
|
|
16
|
+
],
|
|
12
17
|
"author": "BigBinary",
|
|
13
18
|
"license": "MIT",
|
|
14
19
|
"devDependencies": {
|
|
@@ -142,10 +147,10 @@
|
|
|
142
147
|
},
|
|
143
148
|
"proxy": "http://localhost:3000",
|
|
144
149
|
"bugs": {
|
|
145
|
-
"url": "https://github.com/bigbinary/neeto-editor
|
|
150
|
+
"url": "https://github.com/bigbinary/neeto-editor/issues"
|
|
146
151
|
},
|
|
147
152
|
"repository": {
|
|
148
153
|
"type": "git",
|
|
149
|
-
"url": "git+https://github.com/bigbinary/neeto-editor
|
|
154
|
+
"url": "git+https://github.com/bigbinary/neeto-editor.git"
|
|
150
155
|
}
|
|
151
156
|
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { UppyOptions } from "@uppy/core/types";
|
|
2
|
+
import {
|
|
3
|
+
Editor as TiptapEditor,
|
|
4
|
+
Extension,
|
|
5
|
+
Node,
|
|
6
|
+
} from "@tiptap/core/dist/packages/core/src";
|
|
7
|
+
import { Range } from "@tiptap/core/dist/packages/core/src/types";
|
|
8
|
+
import { Transaction } from "prosemirror-state";
|
|
9
|
+
|
|
10
|
+
interface Command {
|
|
11
|
+
title: string;
|
|
12
|
+
Icon: Function;
|
|
13
|
+
description?: string;
|
|
14
|
+
optionName: string;
|
|
15
|
+
command?: (props: { editor: TiptapEditor; range: Range }) => void;
|
|
16
|
+
items?: Command[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Variable {
|
|
20
|
+
category_key: string;
|
|
21
|
+
category_label: string;
|
|
22
|
+
variables?: Array<{ key: string; label: string }>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Mention {
|
|
26
|
+
key?: string;
|
|
27
|
+
name: string;
|
|
28
|
+
imageUrl?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type KeyboardShortcuts = {
|
|
32
|
+
[shortcut: string]: (props: { editor: TiptapEditor }) => boolean | void;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type EditorFocus = (props: {
|
|
36
|
+
editor: TiptapEditor;
|
|
37
|
+
event: FocusEvent;
|
|
38
|
+
transaction: Transaction;
|
|
39
|
+
}) => void;
|
|
40
|
+
|
|
41
|
+
export function Editor(props: {
|
|
42
|
+
forceTitle?: boolean;
|
|
43
|
+
titleError?: boolean;
|
|
44
|
+
hideSlashCommands?: boolean;
|
|
45
|
+
defaults?: string[];
|
|
46
|
+
addons?: string[];
|
|
47
|
+
addonCommands?: Command[];
|
|
48
|
+
className?: string;
|
|
49
|
+
uploadEndpoint?: string;
|
|
50
|
+
uploadConfig?: UppyOptions<Record<string, unknown>>;
|
|
51
|
+
initialValue?: string;
|
|
52
|
+
onChange?: (htmlContent: string) => void;
|
|
53
|
+
onFocus?: EditorFocus;
|
|
54
|
+
onBlur?: EditorFocus;
|
|
55
|
+
menuType?: string;
|
|
56
|
+
variables?: Variable[];
|
|
57
|
+
mentions?: Mention[];
|
|
58
|
+
showImageInMention?: boolean;
|
|
59
|
+
placeholder?: { title: string } | string | null;
|
|
60
|
+
extensions?: Array<Node | Extension>;
|
|
61
|
+
contentClassName?: string[];
|
|
62
|
+
characterLimit?: number;
|
|
63
|
+
editorSecrets?: Array<{ unsplash?: string }>;
|
|
64
|
+
rows?: number;
|
|
65
|
+
autoFocus?: boolean;
|
|
66
|
+
onSubmit?: (htmlContent: string) => void;
|
|
67
|
+
heightStrategy?: string;
|
|
68
|
+
characterCountStrategy?: string;
|
|
69
|
+
keyboardShortcuts?: KeyboardShortcuts;
|
|
70
|
+
error?: string;
|
|
71
|
+
[otherProps: string]: any;
|
|
72
|
+
}): JSX.Element;
|
|
73
|
+
|
|
74
|
+
export function EditorContent(props: {
|
|
75
|
+
content?: string;
|
|
76
|
+
className?: string;
|
|
77
|
+
[otherProps: string]: any;
|
|
78
|
+
}): JSX.Element;
|