Comments (9)
I would like to work on this too.
from web-components.
This will likely be solved in withLists/insertBreak
which handles essentially the functionality of pressing ENTER, or in RichTextEditor/onKeyDown
where you can place a check for SHIFT+ENTER and make that create a new paragraph block.
from web-components.
@irmerk Still working on it. I will be sending a PR soon.
from web-components.
@irmerk As described in the issue SHIFT + Enter
is used to create a new paragraph. By pressing even only Enter
inside the variable we can create a new paragraph. Can you confirm it?
from web-components.
Just ENTER doesn't add a new paragraph. Only SHIFT + ENTER
from web-components.
@irmerk I am not exactly able to trace from where it is coming. Can you please guide me a bit?
from web-components.
@arteevraina any update on this?
from web-components.
@irmerk withLists/insertBreak
is in markdown-editor
repo. Could not find any reference for it in cicero-ui
. Could you guide me a little bit more please?
from web-components.
Ah yes! Definitely. So I was wrong and it would actually be in withVariables
, so yeah not in markdown-editor
, sorry!
The way these withSomething
functions are working is they're taking the Slate editor and manipulating the functions on it. So each withSomething
wrapping the editor can dictate it's own version of editor.insertBreak
and then they will all be called during runtime.
In withVariables
, we will need to do something similar to what was done in markdown-editor
's withLists
, extracting insertBreak
from editor
and manipulating it.
const withVariables = (editor) => {
const { insertBreak, insertText, isInline } = editor;
editor.insertBreak = () => {
// Some logic similar-ish to what is in withLists/insertBreak
insertBreak();
};
editor.insertText = (text) => {...};
editor.isInline = element => {...};
return editor;
};
There's a chance this might not be the right approach? Another suggestion is similar, but with normalizeNode
:
const withVariables = (editor) => {
const { insertText, isInline, normalizeNode } = editor;
editor.normalizeNode = ([node, path]) => {
// Maybe some logic to prevent multiple paragraphs in a variable?
return normalizeNode([node, path])
};
editor.insertText = (text) => {...};
editor.isInline = element => {...};
return editor;
};
I'd search through Slate docs, especially their examples for more reference.
from web-components.
Related Issues (20)
- installation error HOT 3
- Paragraphs above or below clause templates can't be deleted HOT 3
- Change markdown editor empty-state text HOT 4
- Overriding Default CSS
- web-components release 0.97 makes inconsistent assumptions about Concerto
- Adding Docstrings to the Project HOT 1
- Styling-Library HOT 11
- contract-editor error onChange: Cannot read property 'focus' of null HOT 5
- Change in Demo Text Of Markdown Editor HOT 2
- Adding Background In Inline Code HOT 6
- Heading Markdown Shortcut WYSIWYG (What You See Is What You Get) HOT 1
- npm install doesn't work for @accordproject/ui-markdown-editor HOT 5
- Undefined Nodes in some templates HOT 2
- Deployed github-page shows an Error 404 page. HOT 4
- Inline Markdown Shortcuts (WYSIWYG) HOT 2
- Update Readme HOT 1
- Formatting Button Error HOT 10
- [BUG]: Buttons not working HOT 4
- Implementation of PurgeCSS HOT 2
- Twitter icon is old. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-components.