Article Builder v3

Article Builder v3

The first article builder page was an attempt at letting the user build an article using the entire page. This was to allow the user to have a Word-like or Google Docs-like experience. It didn't have a great UI and it would be difficult to add a html/css/javascript editor to the Lexical Editor while still keeping what we care most about the rich text editor - the ability of readers to highlight certain sections of the article and comment specifically on that section. The point of the first iteration of the article builder was to keep the toolbar in view at all times.

The second article builder was an attempt at letting the user create smaller sections of an article and then add, remove, and rearrange the sections with drag and drop functionality. I think this version works better at smaller screen sizes and it is what I will be copying with this third iteration of the article builder.

New Article Builder Requirements

  • This article builder should look like the second version except instead of a add / remove button. Each "section" should have an add editor, add HTML/CSS/JavaScript, and remove section buttons.
  • The tabs for the HTML / CSS / JavaScript editor should be hidden when the editor is not focused. Listen for the focusin events.
  • When submitted, the lexical state for each lexical editor should be serialized to JSON and stored in an array and each html/css/js "Custom Code" section should be stored as html: string, css: string, javascript: string. See the object below
  • type ArticleBuilderToPost = (StringifiedLexicalState|{
    html: string, css: string, js: string
    })[];
  • Since I am the only one using the article builder for now, I don't need to worry about sand-boxing the javascript. I just need to post the html / css / js to the server and get back the js with a nonce.

Things To Keep In Mind

  • There can only be one article builder v3 per page due to the fact the sort container must have the same id as all of the sections, and it is more trouble than its worth (probably) to make that work.

Article Builder Implementation

Insert Math Markup

ESC
About Inserting Math Content
Display Style:

Embed News Content

ESC
About Embedding News Content

Embed Youtube Video

ESC
Embedding Youtube Videos

Embed TikTok Video

ESC
Embedding TikTok Videos

Embed X Post

ESC
Embedding X Posts

Embed Instagram Post

ESC
Embedding Instagram Posts

Insert Details Element

ESC

Example Output:

Summary Title
You will be able to insert content here after confirming the title of the <details> element.

Insert Table

ESC
Customization
Align:
Preview:

Insert Horizontal Rule

#000000

Preview:


Insert Chart

ESC

View Content At Different Sizes

ESC

Edit Style of Block Nodes

ESC

Edit the background color, default text color, margin, padding, and border of block nodes. Editable block nodes include paragraphs, headers, and lists.

#ffffff
#000000

Edit Selected Cells

Change the background color, vertical align, and borders of the cells in the current selection.

#ffffff
Vertical Align:
Border
#000000
Border Style:

Edit Table

ESC
Customization:
Align:

Upload Lexical State

ESC

Upload a .lexical file. If the file type matches the type of the current editor, then a preview will be shown below the file input.

Upload 3D Object

ESC

Upload Jupyter Notebook

ESC

Upload a Jupyter notebook and embed the resulting HTML in the text editor.

Insert Custom HTML

ESC

Edit Image Background Color

ESC
#ffffff

Insert Columns Layout

ESC
Column Type:

Select Code Language

ESC
Select Coding Language