@bigbinary/neeto-editor 1.12.6 → 1.13.0

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.
Files changed (3) hide show
  1. package/index.js +7 -7
  2. package/package.json +1 -1
  3. package/types.d.ts +15 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-editor",
3
- "version": "1.12.6",
3
+ "version": "1.13.0",
4
4
  "main": "./index.js",
5
5
  "module": "./index.js",
6
6
  "types": "./types.d.ts",
package/types.d.ts CHANGED
@@ -12,6 +12,7 @@ import { CodeBlockLowlightOptions } from "@tiptap/extension-code-block-lowlight"
12
12
  import { StarterKitOptions } from "@tiptap/starter-kit";
13
13
  import { PlaceholderOptions } from "@tiptap/extension-placeholder";
14
14
  import { CharacterCountOptions } from "@tiptap/extension-character-count";
15
+ import Variables from "components/Editor/CustomExtensions/Variable/index";
15
16
 
16
17
  interface Command {
17
18
  title: string;
@@ -24,9 +25,15 @@ interface Command {
24
25
  }
25
26
 
26
27
  interface Variable {
28
+ label?: string;
29
+ key: string;
30
+ value?: any;
31
+ }
32
+
33
+ interface VariableCategory {
27
34
  category_key: string;
28
- category_label: string;
29
- variables?: Array<{ key: string; label: string }>;
35
+ category_label?: string;
36
+ variables?: Variable[];
30
37
  }
31
38
 
32
39
  interface Mention {
@@ -69,7 +76,7 @@ interface MenuProps {
69
76
  addons?: string[];
70
77
  uploadEndpoint?: string;
71
78
  mentions?: Mention[];
72
- variables?: Variable[];
79
+ variables: (VariableCategory | Variable)[];
73
80
  addonCommands?: Command[];
74
81
  isIndependant?: boolean;
75
82
  className?: string;
@@ -98,7 +105,7 @@ interface EditorProps {
98
105
  onFocus?: EditorFocus;
99
106
  onBlur?: EditorFocus;
100
107
  onSubmit?: (htmlContent: string) => void;
101
- variables?: Variable[];
108
+ variables: (VariableCategory | Variable)[];
102
109
  mentions?: Mention[];
103
110
  placeholder?: string;
104
111
  extensions?: Array<Node | Extension>;
@@ -121,6 +128,9 @@ interface AttachmentsProps {
121
128
  attachments?: Array<attachment>;
122
129
  dragDropRef?: React.RefObject<HTMLDivElement>;
123
130
  onChange: (attachments: attachment[]) => void;
131
+ isIndependent?: boolean;
132
+ disabled?: boolean;
133
+ className?: string;
124
134
  }
125
135
 
126
136
  export function Editor(props: EditorProps): JSX.Element;
@@ -132,6 +142,7 @@ export function Attachments(props: AttachmentsProps): JSX.Element;
132
142
  export function EditorContent(props: {
133
143
  content?: string;
134
144
  className?: string;
145
+ variables: (VariableCategory | Variable)[];
135
146
  [otherProps: string]: any;
136
147
  }): JSX.Element;
137
148