Is it possible to convert draft-js ContentState to an openxml document? - reactjs

I'm looking at the React component draft-js, a rich content editor which creates a blob of text called "ContentState". I have a React 18 web application created using create-react-app.
Is it possible to convert the ContentState created by the draft-js component into an OpenXml document section? I could do this client-side, or server-side in a .Net Core web api that receives a post from the react web page and uses the MS OpenXml sdk.

Related

Strapi WYSIWYG editor supports both react markdown and normal rich text. How to detect in react frontend whether the text is markdown or not?

I am trying to integrate Strapi CMS with React js code base. For one of the content types, a WYSIWYG editor is needed. Strapi default editor supports both React markdown and rich text options.
But when rendering the field on frontend, the logic needs to be a bit different for both options. The markdown would needed parser, the rich text would have to be set using dangerouslySetInnerHTML. How to detect on frontend, which way to use?

How can I embed a react page or component inside a flutter-web app?

I want to embed an unhosted react page (or a react component with some fancy 3rd party graph library) inside a flutter-for-web app. Why? I am think the react graph app I have is much nicer than what I can do in flutter (using the existing 3rd party packages) and so it might be good if I could just embed that react stuff inside a flutter-for-web app until I can do in flutter what I already have in react.
There is a flutter package (flutter_inappwebview) that can do this for mobile but I need to do it for a web app. I need to pass data back and forth between the react stuff and the flutter stuff too, so for instance the react graph will take in its data from flutter - not direct from the network or DB - and after drawing its pretty pictures and some user interaction will be able to send data back to my flutter code.
Is this easy? Already done in another package I haven't found yet? I know I can interop with javascript but just using #JS to interact with the react package (along with maybe some redux or maybe another basic state management) solution just sounds like it might be a tricky job.
Thanks

Render DjangoCKEditor in React CKEditor

I would like to know whether it is possible to render RichTextField from Django CKEditor using CKEditor from ckeditor5-react ? As far as I know, we could manually render django field in anyway as long as the name and id is the same as the form field. But I have no idea how do I replicate Django CKEditor using React CKEditor.
Yes, it's possible to use Django CKEditor with Ckeditor5-react. I have done it in the past and it was doable, but I don't recommend using CKeditor with React anymore. The problem with React Ckeditor is that it stores data in HTML format, meaning you have to "dangerously render HTML" in your react virtual dom. There are many libraries that stores data in a JSON format rather than HTML format like CKEditor do, to name some:
Slate Js
Quill
Draft Js
try using them, you can use TextField in Django Model to store your stringified JSON.

React CkEDITOR Image upload to django backend

I have used React as fronted and DRF for API and Django as backend. I have a ckeditor in React and want to upload a image from ckeditor. How can I acheive that
you should create upload adapter for your component, CKEditor has explained its features very good, check it out here and here
also, you can use this package to handle this feature

Migrate Android webview to React-Native-Webview

I have a Hybrid Android App which uses Android WebView for rendering the Web Pages.
I have Wiziwig Editor (which is written in HTML, javascript, and css). I am using Webkit Interface for communicating between Java and JavaScript
I want to integrate React Native in my Editor. Previously I was using JavaScript models and JS functions for implementing various functionalities in the WiziWig Editor and manipulating DOM.
But its UX is not fast and appealing. Moreover, I had integrated the Twitter BloodHound Engine in Editor. Whenever the user types in the Editor the typeahead list of BloodHound Engine lags.
I am thinking of using the React Native in my Editor. With React Native I can also use the Android Native components for showing messages and other things instead of the JavaScript Models. There are also other possibilities of improvement with React Native.
I built a demo app in which, I am able to communicate between Java and Javascript code using React Native Modules.
Question
My WiziWig has so much Code already written in HTML, CSS, and plain JavaScript. In order to convert my code to React Native and using Native components for UI, it would take a lot of time.
Is there a way in which I can use my old code base in React Native and then I slowly move the code to the React Native using JSX and components.
I have seen There is Render function in React Native for Rendering the html content. But I have to write the plain JS code in JSX. Is there a fast way to do it. Because my file has already 4495 lines of Code.
Thanks in advance

Resources