diff --git a/.gitignore b/.gitignore index 41e1ec58..c3ffd582 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,10 @@ .env.test.local .env.production.local +# Ignore yalc generated files +yalc.lock +/.yalc + npm-debug.log* yarn-debug.log* yarn-error.log* diff --git a/src/components/Editor/CustomExtensions/Variable/VariableComponent.jsx b/src/components/Editor/CustomExtensions/Variable/VariableComponent.jsx index 1feead57..bfe6581b 100644 --- a/src/components/Editor/CustomExtensions/Variable/VariableComponent.jsx +++ b/src/components/Editor/CustomExtensions/Variable/VariableComponent.jsx @@ -1,4 +1,5 @@ import { NodeViewWrapper } from "@tiptap/react"; +import { Tooltip } from "neetoui"; import { MAX_VARIABLE_NAME_DISPLAY_LENGTH } from "./constants"; @@ -16,8 +17,10 @@ const VariableComponent = ({ node, extension }) => { data-variable="" > {extension.options.charOpen} - {variableName?.substr(0, MAX_VARIABLE_NAME_DISPLAY_LENGTH)?.trim()} - {shouldTruncate && "..."} + + {variableName?.substr(0, MAX_VARIABLE_NAME_DISPLAY_LENGTH)?.trim()} + {shouldTruncate && "..."} + {extension.options.charClose} ); diff --git a/src/components/Editor/Menu/Fixed/index.jsx b/src/components/Editor/Menu/Fixed/index.jsx index 4d657875..106e5dc5 100644 --- a/src/components/Editor/Menu/Fixed/index.jsx +++ b/src/components/Editor/Menu/Fixed/index.jsx @@ -140,9 +140,17 @@ const Fixed = ({ options.includes(EDITOR_OPTIONS.VIDEO_UPLOAD); const handleVariableClick = item => { - const { category, key, label } = item; + const { category, categoryLabel, key, label } = item; const variableName = category ? `${category}.${key}` : key; - editor.chain().focus().setVariable({ id: variableName, label }).run(); + const variableLabel = category + ? `${categoryLabel || category}:${label}` + : label; + + editor + .chain() + .focus() + .setVariable({ id: variableName, label: variableLabel }) + .run(); }; return (