-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DEV-13254] Implement settings menu for variables with optional fallback #561
[DEV-13254] Implement settings menu for variables with optional fallback #561
Conversation
packages/slate-editor/src/extensions/variables/VariableElement.module.scss
Outdated
Show resolved
Hide resolved
….module.scss Thanks @e1himself Co-authored-by: Ivan Voskoboinyk <ivan@prezly.com>
@@ -5,6 +5,7 @@ export const VARIABLE_NODE_TYPE = 'variable'; | |||
|
|||
export interface VariableNode extends ElementNode { | |||
type: typeof VARIABLE_NODE_TYPE; | |||
fallback?: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kudlajz by the way, Slate does not allow null
as a node property value. Setting a property to null with Transforms.setNodes()
will remove it from the object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%something%
but instead use the label for better claritywithFallback: true
can have a text fallback set for themI still have to run this with the UX people so the UI might change.
Default:
With fallback defined:
Choosing different options: