@bigbinary/neeto-editor 0.1.15 → 0.2.1

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 (72) hide show
  1. package/index.js +37 -14
  2. package/package.json +18 -4
  3. package/src/App.js +5 -28
  4. package/src/Common/Avatar.js +168 -0
  5. package/src/Common/Button.js +95 -0
  6. package/src/Common/CodeBlock.js +11 -0
  7. package/src/Common/Description.js +8 -0
  8. package/src/Common/Dropdown/index.js +122 -0
  9. package/src/Common/Heading.js +13 -0
  10. package/src/Common/HighlightText.js +7 -0
  11. package/src/Common/Icons/HashtagFilled.js +59 -0
  12. package/src/Common/Icons/TextColor.js +35 -0
  13. package/src/Common/Icons/index.js +2 -0
  14. package/src/Common/Input.js +70 -0
  15. package/src/Common/Label.js +45 -0
  16. package/src/Common/ListItems.js +17 -0
  17. package/src/Common/Modal.js +91 -0
  18. package/src/Common/Tab.js +79 -0
  19. package/src/Common/ToolTip.js +37 -0
  20. package/src/Editor/CustomExtensions/BubbleMenu/index.js +33 -26
  21. package/src/Editor/CustomExtensions/Embeds.js +5 -3
  22. package/src/Editor/CustomExtensions/FixedMenu/FontSizeOption.js +32 -0
  23. package/src/Editor/CustomExtensions/FixedMenu/TextColorOption.js +29 -0
  24. package/src/Editor/CustomExtensions/FixedMenu/constants.js +3 -0
  25. package/src/Editor/CustomExtensions/FixedMenu/index.js +183 -0
  26. package/src/Editor/CustomExtensions/Image/LinkUploader/URLForm.js +39 -0
  27. package/src/Editor/CustomExtensions/Image/LocalUploader.js +21 -0
  28. package/src/Editor/CustomExtensions/Image/ProgressBar.js +34 -0
  29. package/src/Editor/CustomExtensions/Image/Uploader.js +72 -31
  30. package/src/Editor/CustomExtensions/Image/constants.js +5 -0
  31. package/src/Editor/CustomExtensions/Mention/ExtensionConfig.js +66 -0
  32. package/src/Editor/CustomExtensions/Mention/MentionList.js +96 -0
  33. package/src/Editor/CustomExtensions/Mention/helpers.js +23 -0
  34. package/src/Editor/CustomExtensions/Placeholder/ExtensionConfig.js +81 -0
  35. package/src/Editor/CustomExtensions/Placeholder/helpers.js +18 -0
  36. package/src/Editor/CustomExtensions/SlashCommands/Commands.js +5 -10
  37. package/src/Editor/CustomExtensions/SlashCommands/CommandsList.js +15 -16
  38. package/src/Editor/CustomExtensions/SlashCommands/ExtensionConfig.js +200 -155
  39. package/src/Editor/CustomExtensions/Variable/ExtensionConfig.js +208 -0
  40. package/src/Editor/CustomExtensions/Variable/VariableList.js +45 -0
  41. package/src/Editor/CustomExtensions/Variable/VariableSuggestion.js +20 -0
  42. package/src/Editor/CustomExtensions/Variable/helpers.js +31 -0
  43. package/src/Editor/CustomExtensions/Variable/index.js +35 -0
  44. package/src/Editor/CustomExtensions/useCustomExtensions.js +88 -0
  45. package/src/Editor/index.js +59 -41
  46. package/src/constants/regexp.js +1 -0
  47. package/src/examples/constants.js +95 -0
  48. package/src/examples/index.js +186 -0
  49. package/src/hooks/useOutsideClick.js +19 -0
  50. package/src/hooks/useTabBar.js +9 -0
  51. package/src/index.scss +32 -12
  52. package/src/styles/abstracts/_mixins.scss +20 -0
  53. package/src/styles/abstracts/_neeto-ui-variables.scss +107 -0
  54. package/src/styles/abstracts/_variables.scss +13 -0
  55. package/src/styles/components/_avatar.scss +105 -0
  56. package/src/styles/components/_button.scss +161 -0
  57. package/src/styles/components/_codeblock.scss +16 -0
  58. package/src/{Editor/styles/CommandsList.scss → styles/components/_command-list.scss} +12 -1
  59. package/src/styles/components/_dropdown.scss +69 -0
  60. package/src/styles/components/_editor-variables.scss +12 -0
  61. package/src/{Editor/styles/EditorStyles.scss → styles/components/_editor.scss} +33 -7
  62. package/src/styles/components/_fixed-menu.scss +17 -0
  63. package/src/styles/components/_image-uploader.scss +109 -0
  64. package/src/styles/components/_input.scss +165 -0
  65. package/src/styles/components/_tab.scss +74 -0
  66. package/src/styles/components/_tooltip.scss +152 -0
  67. package/src/utils/common.js +13 -0
  68. package/webpack.config.js +7 -0
  69. package/webpack.dev.config.js +7 -0
  70. package/public/logo192.png +0 -0
  71. package/public/logo512.png +0 -0
  72. package/src/logo.svg +0 -1
@@ -1,164 +1,209 @@
1
- import sharedState from "../../sharedState";
2
- import Commands from "./Commands";
1
+ import { Extension } from "@tiptap/core";
3
2
  import CommandsList from "./CommandsList";
3
+ import { PluginKey } from "prosemirror-state";
4
+ import Suggestion from "@tiptap/suggestion";
4
5
  import tippy from "tippy.js";
5
6
  import { ReactRenderer } from "@tiptap/react";
6
7
  import {
7
- BsCardText,
8
- BsTypeH1,
9
- BsTypeH2,
10
- BsListOl,
11
- BsListUl,
12
- BsCodeSlash,
13
- BsCardImage,
14
- BsFillCameraVideoFill,
15
- BsBlockquoteLeft,
16
- } from "react-icons/bs";
8
+ Paragraph,
9
+ TextH1,
10
+ TextH2,
11
+ ListDot,
12
+ ListNumber,
13
+ Blockquote,
14
+ Image,
15
+ Video,
16
+ Code,
17
+ } from "@bigbinary/neeto-icons";
17
18
 
18
- export default Commands.configure({
19
- HTMLAttributes: {
20
- class: "commands",
21
- },
22
- suggestion: {
23
- items: (query) => {
24
- return [
25
- {
26
- title: "Paragraph",
27
- description: "Add a plain text block",
28
- Icon: BsCardText,
29
- command: ({ editor, range }) => {
30
- editor
31
- .chain()
32
- .focus()
33
- .deleteRange(range)
34
- .setNode("paragraph")
35
- .run();
36
- },
37
- },
38
- {
39
- title: "H1",
40
- description: "Add a big heading",
41
- Icon: BsTypeH1,
42
- command: ({ editor, range }) => {
43
- editor
44
- .chain()
45
- .focus()
46
- .deleteRange(range)
47
- .setNode("heading", { level: 1 })
48
- .run();
49
- },
50
- },
51
- {
52
- title: "H2",
53
- description: "Add a sub-heading",
54
- Icon: BsTypeH2,
55
- command: ({ editor, range }) => {
56
- editor
57
- .chain()
58
- .focus()
59
- .deleteRange(range)
60
- .setNode("heading", { level: 2 })
61
- .run();
62
- },
63
- },
64
- {
65
- title: "Numbered list",
66
- description: "Add a list with numbering",
67
- Icon: BsListOl,
68
- command: ({ editor, range }) => {
69
- editor.chain().focus().deleteRange(range).toggleOrderedList().run();
70
- },
71
- },
72
- {
73
- title: "Bulleted list",
74
- description: "Add an list bullets",
75
- Icon: BsListUl,
76
- command: ({ editor, range }) => {
77
- editor.chain().focus().deleteRange(range).toggleBulletList().run();
78
- },
79
- },
80
- {
81
- title: "Blockquote",
82
- description: "Add a quote",
83
- Icon: BsBlockquoteLeft,
84
- command: ({ editor, range }) => {
85
- editor.chain().focus().deleteRange(range).toggleBlockquote().run();
86
- },
87
- },
88
- {
89
- title: "Image",
90
- description: "Add an image",
91
- Icon: BsCardImage,
92
- command: ({ editor, range }) => {
93
- sharedState.showImageUpload = true;
94
- sharedState.range = range;
95
- editor.chain().focus().deleteRange(range).run();
96
- },
97
- },
98
- {
99
- title: "Youtube/Vimeo",
100
- description: "Embed a video from major services",
101
- Icon: BsFillCameraVideoFill,
102
- command: ({ editor, range }) => {
103
- const embedURL = prompt("Please enter Youtube/Vimeo embed URL");
104
- editor
105
- .chain()
106
- .focus()
107
- .deleteRange(range)
108
- .setExternalVideo({ src: embedURL })
109
- .run();
110
- },
111
- },
112
- {
113
- title: "Code block",
114
- description: "Add a code block with syntax highlighting",
115
- Icon: BsCodeSlash,
116
- command: ({ editor, range }) => {
117
- editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
19
+ export const CommandsPluginKey = new PluginKey("commands");
20
+
21
+ export default {
22
+ configure: ({ setImageUploadVisible }) =>
23
+ Extension.create({
24
+ addOptions() {
25
+ return {
26
+ HTMLAttributes: {
27
+ class: "commands",
118
28
  },
119
- },
120
- ]
121
- .filter((item) =>
122
- item.title.toLowerCase().startsWith(query.toLowerCase())
123
- )
124
- .slice(0, 10);
125
- },
126
- render: () => {
127
- let reactRenderer;
128
- let popup;
29
+ suggestion: {
30
+ char: "/",
31
+ startOfLine: false,
32
+ pluginKey: CommandsPluginKey,
33
+ command: ({ editor, range, props }) => {
34
+ props.command({ editor, range });
35
+ },
36
+
37
+ items: () => {
38
+ return [
39
+ {
40
+ title: "Paragraph",
41
+ description: "Add a plain text block",
42
+ Icon: Paragraph,
43
+ command: ({ editor, range }) => {
44
+ editor
45
+ .chain()
46
+ .focus()
47
+ .deleteRange(range)
48
+ .setNode("paragraph")
49
+ .run();
50
+ },
51
+ },
52
+ {
53
+ title: "H1",
54
+ description: "Add a big heading",
55
+ Icon: TextH1,
56
+ command: ({ editor, range }) => {
57
+ editor
58
+ .chain()
59
+ .focus()
60
+ .deleteRange(range)
61
+ .setNode("heading", { level: 1 })
62
+ .run();
63
+ },
64
+ },
65
+ {
66
+ title: "H2",
67
+ description: "Add a sub-heading",
68
+ Icon: TextH2,
69
+ command: ({ editor, range }) => {
70
+ editor
71
+ .chain()
72
+ .focus()
73
+ .deleteRange(range)
74
+ .setNode("heading", { level: 2 })
75
+ .run();
76
+ },
77
+ },
78
+ {
79
+ title: "Numbered list",
80
+ description: "Add a list with numbering",
81
+ Icon: ListNumber,
82
+ command: ({ editor, range }) => {
83
+ editor
84
+ .chain()
85
+ .focus()
86
+ .deleteRange(range)
87
+ .toggleOrderedList()
88
+ .run();
89
+ },
90
+ },
91
+ {
92
+ title: "Bulleted list",
93
+ description: "Add an list bullets",
94
+ Icon: ListDot,
95
+ command: ({ editor, range }) => {
96
+ editor
97
+ .chain()
98
+ .focus()
99
+ .deleteRange(range)
100
+ .toggleBulletList()
101
+ .run();
102
+ },
103
+ },
104
+ {
105
+ title: "Blockquote",
106
+ description: "Add a quote",
107
+ Icon: Blockquote,
108
+ command: ({ editor, range }) => {
109
+ editor
110
+ .chain()
111
+ .focus()
112
+ .deleteRange(range)
113
+ .toggleBlockquote()
114
+ .run();
115
+ },
116
+ },
117
+ {
118
+ title: "Image",
119
+ description: "Add an image",
120
+ Icon: Image,
121
+ command: ({ editor, range }) => {
122
+ setImageUploadVisible(true);
123
+ editor.chain().focus().deleteRange(range).run();
124
+ },
125
+ },
126
+ {
127
+ title: "Youtube/Vimeo",
128
+ description: "Embed a video from major services",
129
+ Icon: Video,
130
+ command: ({ editor, range }) => {
131
+ const embedURL = prompt(
132
+ "Please enter Youtube/Vimeo embed URL"
133
+ );
134
+ editor
135
+ .chain()
136
+ .focus()
137
+ .deleteRange(range)
138
+ .setExternalVideo({ src: embedURL })
139
+ .run();
140
+ },
141
+ },
142
+ {
143
+ title: "Code block",
144
+ description: "Add a code block with syntax highlighting",
145
+ Icon: Code,
146
+ command: ({ editor, range }) => {
147
+ editor
148
+ .chain()
149
+ .focus()
150
+ .deleteRange(range)
151
+ .toggleCodeBlock()
152
+ .run();
153
+ },
154
+ },
155
+ ];
156
+ },
129
157
 
130
- return {
131
- onStart: (props) => {
132
- reactRenderer = new ReactRenderer(CommandsList, {
133
- props,
134
- editor: props.editor,
135
- });
158
+ render: () => {
159
+ let reactRenderer;
160
+ let popup;
136
161
 
137
- popup = tippy("body", {
138
- getReferenceClientRect: props.clientRect,
139
- appendTo: () => document.body,
140
- content: reactRenderer.element,
141
- showOnCreate: true,
142
- interactive: true,
143
- trigger: "manual",
144
- placement: "bottom-start",
145
- });
146
- },
147
- onUpdate(props) {
148
- reactRenderer.updateProps(props);
162
+ return {
163
+ onStart: (props) => {
164
+ reactRenderer = new ReactRenderer(CommandsList, {
165
+ props,
166
+ editor: props.editor,
167
+ });
168
+
169
+ popup = tippy("body", {
170
+ getReferenceClientRect: props.clientRect,
171
+ appendTo: () => document.body,
172
+ content: reactRenderer.element,
173
+ showOnCreate: true,
174
+ interactive: true,
175
+ trigger: "manual",
176
+ placement: "bottom-start",
177
+ arrow: false,
178
+ });
179
+ },
180
+ onUpdate(props) {
181
+ reactRenderer.updateProps(props);
182
+
183
+ popup[0].setProps({
184
+ getReferenceClientRect: props.clientRect,
185
+ });
186
+ },
187
+ onKeyDown(props) {
188
+ return reactRenderer.ref?.onKeyDown(props);
189
+ },
190
+ onExit() {
191
+ popup[0].destroy();
192
+ reactRenderer.destroy();
193
+ },
194
+ };
195
+ },
196
+ },
197
+ };
198
+ },
149
199
 
150
- popup[0].setProps({
151
- getReferenceClientRect: props.clientRect,
152
- });
153
- },
154
- onKeyDown(props) {
155
- return reactRenderer.ref?.onKeyDown(props);
156
- },
157
- onExit() {
158
- popup[0].destroy();
159
- reactRenderer.destroy();
160
- },
161
- };
162
- },
163
- },
164
- });
200
+ addProseMirrorPlugins() {
201
+ return [
202
+ Suggestion({
203
+ editor: this.editor,
204
+ ...this.options.suggestion,
205
+ }),
206
+ ];
207
+ },
208
+ }),
209
+ };
@@ -0,0 +1,208 @@
1
+ import tippy from "tippy.js";
2
+ import Suggestion from "@tiptap/suggestion";
3
+ import { Node, mergeAttributes } from "@tiptap/core";
4
+ import { ReactRenderer } from "@tiptap/react";
5
+ import { PluginKey } from "prosemirror-state";
6
+
7
+ import VariableSuggestion from "./VariableSuggestion";
8
+
9
+ export const VariablePluginKey = new PluginKey("variables");
10
+
11
+ const Variable = Node.create({
12
+ name: "variable",
13
+
14
+ addOptions() {
15
+ return {
16
+ HTMLAttributes: { class: "variable__text" },
17
+ charOpen: "{{",
18
+ charClose: "}}",
19
+ renderLabel({ options, node }) {
20
+ return `${options.charOpen}${node.attrs.label || node.attrs.id}${
21
+ options.charClose
22
+ }`;
23
+ },
24
+ suggestion: {},
25
+ };
26
+ },
27
+
28
+ group: "inline",
29
+
30
+ inline: true,
31
+
32
+ selectable: false,
33
+
34
+ atom: true,
35
+
36
+ addAttributes() {
37
+ return {
38
+ id: {
39
+ default: null,
40
+ parseHTML: (element) => element.getAttribute("data-id"),
41
+ renderHTML: (attributes) => {
42
+ if (!attributes.id) {
43
+ return {};
44
+ }
45
+
46
+ return {
47
+ "data-id": attributes.id,
48
+ };
49
+ },
50
+ },
51
+
52
+ label: {
53
+ default: null,
54
+ parseHTML: (element) => element.getAttribute("data-label"),
55
+ renderHTML: (attributes) => {
56
+ if (!attributes.label) {
57
+ return {};
58
+ }
59
+
60
+ return {
61
+ "data-label": attributes.label,
62
+ };
63
+ },
64
+ },
65
+ };
66
+ },
67
+
68
+ parseHTML() {
69
+ return [
70
+ {
71
+ tag: "span[data-variable]",
72
+ },
73
+ ];
74
+ },
75
+
76
+ renderHTML({ node, HTMLAttributes }) {
77
+ return [
78
+ "span",
79
+ mergeAttributes(
80
+ { "data-variable": "" },
81
+ this.options.HTMLAttributes,
82
+ HTMLAttributes
83
+ ),
84
+ this.options.renderLabel({
85
+ options: this.options,
86
+ node,
87
+ }),
88
+ ];
89
+ },
90
+
91
+ renderText({ node }) {
92
+ return this.options.renderLabel({
93
+ options: this.options,
94
+ node,
95
+ });
96
+ },
97
+
98
+ addCommands() {
99
+ return {
100
+ setVariable:
101
+ (attributes) =>
102
+ ({ chain }) => {
103
+ chain()
104
+ .focus()
105
+ .insertContent([
106
+ {
107
+ type: this.name,
108
+ attrs: attributes,
109
+ },
110
+ {
111
+ type: "text",
112
+ text: " ",
113
+ },
114
+ ])
115
+ .run();
116
+ },
117
+ };
118
+ },
119
+
120
+ addKeyboardShortcuts() {
121
+ return {
122
+ Backspace: () =>
123
+ this.editor.commands.command(({ tr, state }) => {
124
+ let isVariable = false;
125
+ const { selection } = state;
126
+ const { empty, anchor } = selection;
127
+
128
+ if (!empty) {
129
+ return false;
130
+ }
131
+
132
+ state.doc.nodesBetween(anchor - 1, anchor, (node, pos) => {
133
+ if (node.type.name === this.name) {
134
+ isVariable = true;
135
+ tr.insertText("", pos, pos + node.nodeSize);
136
+
137
+ return false;
138
+ }
139
+ });
140
+
141
+ return isVariable;
142
+ }),
143
+ };
144
+ },
145
+
146
+ addProseMirrorPlugins() {
147
+ return [
148
+ Suggestion({
149
+ editor: this.editor,
150
+ ...this.options.suggestion,
151
+ }),
152
+ ];
153
+ },
154
+ });
155
+
156
+ const suggestionConfig = {
157
+ char: "{{",
158
+ startOfLine: false,
159
+ pluginKey: VariablePluginKey,
160
+ command: ({ editor, range, props }) => {
161
+ editor.chain().focus().deleteRange(range).setVariable(props).run();
162
+ },
163
+
164
+ items: () => [],
165
+ render: () => {
166
+ let reactRenderer;
167
+ let popup;
168
+
169
+ return {
170
+ onStart: (props) => {
171
+ reactRenderer = new ReactRenderer(VariableSuggestion, {
172
+ props,
173
+ editor: props.editor,
174
+ });
175
+
176
+ popup = tippy("body", {
177
+ getReferenceClientRect: props.clientRect,
178
+ appendTo: () => document.body,
179
+ content: reactRenderer.element,
180
+ showOnCreate: true,
181
+ interactive: true,
182
+ trigger: "manual",
183
+ placement: "bottom-start",
184
+ });
185
+ },
186
+ onUpdate(props) {
187
+ reactRenderer.updateProps(props);
188
+
189
+ popup[0].setProps({
190
+ getReferenceClientRect: props.clientRect,
191
+ });
192
+ },
193
+
194
+ onExit() {
195
+ popup[0].destroy();
196
+ reactRenderer.destroy();
197
+ },
198
+ };
199
+ },
200
+ };
201
+
202
+ export default {
203
+ configure: ({ suggestion = {} }) => {
204
+ return Variable.configure({
205
+ suggestion: { ...suggestionConfig, ...suggestion },
206
+ });
207
+ },
208
+ };
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+
3
+ import { parseVariables } from "./helpers";
4
+
5
+ const VariableList = ({ onClickVariable, variables }) => {
6
+ const parsedVariables = parseVariables(variables);
7
+
8
+ if (!(variables && variables.length)) {
9
+ return null;
10
+ }
11
+
12
+ return (
13
+ <div className="p-3 bg-white">
14
+ {parsedVariables.map(({ label, variables }) => (
15
+ <VariableCategory
16
+ key={label}
17
+ title={label}
18
+ variables={variables}
19
+ onClickItem={onClickVariable}
20
+ />
21
+ ))}
22
+ </div>
23
+ );
24
+ };
25
+
26
+ export default VariableList;
27
+
28
+ const VariableCategory = ({ title, variables, onClickItem }) => {
29
+ return (
30
+ <div className="my-3">
31
+ {title ? <p className="text-xs font-semibold">{title}</p> : null}
32
+ <div className="mt-1 space-x-2">
33
+ {variables.map((item) => (
34
+ <button
35
+ onClick={() => onClickItem(item)}
36
+ key={`${item.label}--${item.value}`}
37
+ className="px-2 py-1 text-xs text-white bg-blue-400 rounded-sm"
38
+ >
39
+ {item.label}
40
+ </button>
41
+ ))}
42
+ </div>
43
+ </div>
44
+ );
45
+ };
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+
3
+ import VariableList from "./VariableList";
4
+
5
+ const VariableSuggestion = ({ items, command }) => {
6
+ return (
7
+ <div className="shadow-md">
8
+ <VariableList
9
+ variables={items}
10
+ onClickVariable={(variable) => {
11
+ const { category_key, key } = variable;
12
+ const variableName = category_key ? `${category_key}.${key}` : key;
13
+ command({ label: variableName, id: variableName });
14
+ }}
15
+ />
16
+ </div>
17
+ );
18
+ };
19
+
20
+ export default VariableSuggestion;
@@ -0,0 +1,31 @@
1
+ /* Helper function that accepts an array of variables and injects category to each item in the group
2
+ And also performs grouping of indvidual variables under common category as 'Others'. */
3
+
4
+ export const parseVariables = (variableArr = []) => {
5
+ const uncategorized = [];
6
+ const groupedVariables = [];
7
+ variableArr.forEach((variable) => {
8
+ const { category_key, category_label, variables } = variable;
9
+ if (category_key && variables) {
10
+ const parsedVariables = variables.map((categoryVariable) => ({
11
+ ...categoryVariable,
12
+ category_key,
13
+ }));
14
+ groupedVariables.push({
15
+ label: category_label,
16
+ variables: parsedVariables,
17
+ });
18
+ } else uncategorized.push(variable);
19
+ });
20
+
21
+ /* If there are other categorised variables already present, group all uncategorized variables under title 'Others'.
22
+ otherwise, if all available variables are uncategorised, do not render 'Others' title */
23
+
24
+ if (uncategorized.length) {
25
+ groupedVariables.push({
26
+ label: groupedVariables.length ? "Others" : null,
27
+ variables: uncategorized,
28
+ });
29
+ }
30
+ return groupedVariables;
31
+ };
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+
3
+ import VariableList from "./VariableList";
4
+ import Dropdown from "common/Dropdown";
5
+ import { HashtagFilled } from "common/Icons";
6
+
7
+ import { MENU_ICON_SIZE } from "../FixedMenu/constants";
8
+
9
+ const Variables = ({ editor, variables }) => {
10
+ const handleClickItem = (item) => {
11
+ const { category_key, key } = item;
12
+ const variableName = category_key ? `${category_key}.${key}` : key;
13
+ editor.chain().focus().setVariable({ label: variableName }).run();
14
+ };
15
+
16
+ if (!(variables && variables.length)) {
17
+ return null;
18
+ }
19
+
20
+ return (
21
+ <Dropdown
22
+ customTarget={() => (
23
+ <button className="relative h-full p-3 editor-fixed-menu--item variable-selection-popup">
24
+ <HashtagFilled size={MENU_ICON_SIZE} />
25
+ </button>
26
+ )}
27
+ >
28
+ <div className="items-container">
29
+ <VariableList onClickVariable={handleClickItem} variables={variables} />
30
+ </div>
31
+ </Dropdown>
32
+ );
33
+ };
34
+
35
+ export default Variables;