Hi, chat!
Could you please help me figure out how to create a custom feature for Lexical that wraps text and other inline nodes inside a "noWrap" wrapper, which would return something like {type: 'noWrap', children: []} in RichText?
Right now, I have a custom feature that inserts Lottie animations into the text. However, I need to wrap both the text and the Lottie elements inside the editor so that on the website, something like commu<lottie>nications renders within a single <span> rather than being split into three separate elements according to the JSON object hierarchy.
I've attached a screenshot showing how my editor currently look. And this is the object in the API.
"title": {
"root": {
"children": [
{
"children": [
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": "We are like, Netflix in commu",
"type": "text",
"version": 1
},
{
"type": "lottie",
"version": 1,
"lottieId": "67e04fda7ce6f4204c034d16"
},
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": "nications. For every single campaign we produce high",
"type": "text",
"version": 1
},
{
"type": "lottie",
"version": 1,
"lottieId": "67e02a447ce6f4204c034910"
},
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": "quality well-crafted branded content.",
"type": "text",
"version": 1
}
],
"direction": "ltr",
"format": "",
"indent": 0,
"type": "paragraph",
"version": 1,
"textFormat": 0,
"textStyle": ""
}
],
"direction": "ltr",
"format": "",
"indent": 0,
"type": "root",
"version": 1
}
},