Skip to content
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

Lexical based editor #5058

Merged
merged 107 commits into from
Sep 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
5a4f595
Editors: Added lexical editor for testing
ssddanbrown May 27, 2024
6e852d2
Lexical: Played with commands, extracted & improved callout node
ssddanbrown May 27, 2024
49546cd
Lexical: Switched to ts for new editor build
ssddanbrown May 27, 2024
0f8bd86
Lexical: Added custom id-supporting paragraph blocks
ssddanbrown May 28, 2024
b24d60e
Lexical: Started UI fundementals with basic button
ssddanbrown May 28, 2024
483d9bf
Lexical: Added a range of format buttons
ssddanbrown May 28, 2024
dc1a40e
Lexical: Added ui container type
ssddanbrown May 29, 2024
57259ae
Lexical: Added format previews to format buttons
ssddanbrown May 30, 2024
ae98745
Lexical: Started on form UI
ssddanbrown May 30, 2024
7c504a1
Lexical: Created core modal functionality
ssddanbrown Jun 1, 2024
a74e041
Lexical: Started build of image node and decoration UI
ssddanbrown Jun 3, 2024
ba871ec
Lexical: Started image resize controls, Defined thorough decorator model
ssddanbrown Jun 5, 2024
e959c46
Lexical: Made image resize handles functional
ssddanbrown Jun 5, 2024
0722960
Lexical: Added selection to state for aligned reading
ssddanbrown Jun 5, 2024
5c34363
Added base node/button for details/summary
ssddanbrown Jun 6, 2024
e889bc6
Lexical: Added view/edit source code button/form/action
ssddanbrown Jun 12, 2024
a475cf6
Lexical: Added clear formatting button
ssddanbrown Jun 12, 2024
9e43e03
Lexical: Added color picker controls
ssddanbrown Jun 12, 2024
e2409a5
Lexical: Added basic list button/support
ssddanbrown Jun 19, 2024
13d970c
Lexical: Added button icon system
ssddanbrown Jun 19, 2024
f47f7dd
Lexical: Added base table support and started resize handling
ssddanbrown Jun 21, 2024
ac01c62
Lexical: Added table creator UI
ssddanbrown Jun 21, 2024
a07092b
Lexical: Updated lexical, added undo state tracking, format styles
ssddanbrown Jun 23, 2024
5546b8f
Lexical: Added more icons, made reflective text/bg color buttons
ssddanbrown Jun 23, 2024
3af22ce
Lexical: Created custom table node with col width handling
ssddanbrown Jun 24, 2024
5993663
Lexical: Extracted mouse drag tracking to new helper
ssddanbrown Jun 25, 2024
b1130cb
Lexical: Linked up table resize handler (unfinished)
ssddanbrown Jun 26, 2024
72a0e08
Lexical: Completed initial table cell resize handle logic
ssddanbrown Jun 26, 2024
4e2820d
Lexical: Added horizontal rule node
ssddanbrown Jun 27, 2024
f10ec32
Lexical: Added overflow container
ssddanbrown Jun 27, 2024
517c578
Lexical: Reorganised some logic into manager
ssddanbrown Jun 30, 2024
c9a03c5
Lexical: Added base context toolbar logic
ssddanbrown Jun 30, 2024
b1c4890
Lexical: Added context toolbar placement, added link toolbar
ssddanbrown Jun 30, 2024
c2ecbf0
Lexical: Added tracked container, added fullscreen action
ssddanbrown Jul 1, 2024
9ebbf7c
Lexical: Started loading real content, Improved html loading
ssddanbrown Jul 1, 2024
97f570a
Lexical: Started code block node implementation
ssddanbrown Jul 2, 2024
d0a5a5e
Lexical: Linked code block to editor, added button
ssddanbrown Jul 2, 2024
feca1f0
Lexical: Started diagram support
ssddanbrown Jul 3, 2024
a8f1160
JS: Converted come common services to typescript
ssddanbrown Jul 3, 2024
04c7e68
Lexical: Linked up saving logic of editor via interface
ssddanbrown Jul 4, 2024
2c96af9
Lexical: Worked on toolbar styling, got format submenu working
ssddanbrown Jul 4, 2024
51d8044
Lexical: Added initial form/modal styles
ssddanbrown Jul 9, 2024
ea4c50c
Lexical: Added code block selection & edit features
ssddanbrown Jul 16, 2024
b367490
Lexical: Added list support, started todo
ssddanbrown Jul 17, 2024
5002a89
Lexical: Standardised helper function format
ssddanbrown Jul 17, 2024
634b0aa
Lexical: Started converting drawio to TS
ssddanbrown Jul 18, 2024
fb87fb5
JS: Converted http service to ts
ssddanbrown Jul 18, 2024
c7c0df0
Lexical: Finished up core drawing insert/editing
ssddanbrown Jul 19, 2024
63f4b42
Lexical: Added toolbar scroll/resize handling
ssddanbrown Jul 19, 2024
b618287
Lexical: Added table toolbar, organised button code
ssddanbrown Jul 21, 2024
2cab778
Lexical: Improved table resize bars
ssddanbrown Jul 23, 2024
76b0d2d
Lexical: Added common events support
ssddanbrown Jul 23, 2024
f284d31
Lexical: Started media node support
ssddanbrown Jul 25, 2024
c8f6b7e
Lexical: Got media node core work & form done
ssddanbrown Jul 27, 2024
ce8c9dd
Lexical: Added form complex/tab ui support
ssddanbrown Jul 28, 2024
9a7edc6
Lexical: Started drop handling, handled templates
ssddanbrown Jul 29, 2024
d86837a
Lexical: Got working with attachment insert/drop
ssddanbrown Jul 29, 2024
fe05cff
Lexical: Linked up change/draft management
ssddanbrown Jul 29, 2024
13f8f39
Lexical: Updated task list to use/support old format
ssddanbrown Jul 30, 2024
6b06d49
Lexical: Started table menu options
ssddanbrown Aug 2, 2024
a27a325
Lexical: Started on table actions
ssddanbrown Aug 2, 2024
e94ad78
Lexical: Completed out table menu elements, logic pending
ssddanbrown Aug 3, 2024
efec752
Lexical: Split helpers to utils, refactored files
ssddanbrown Aug 3, 2024
8939f31
Lexical: Started linking up cell properties form
ssddanbrown Aug 5, 2024
b3d3b14
Lexical: Finished off core cell properties functionality
ssddanbrown Aug 5, 2024
fcc1c29
Lexical: Added table cell node import logic
ssddanbrown Aug 6, 2024
e8532ef
Lexical: Added merge cell logic
ssddanbrown Aug 7, 2024
da54e1d
Lexical: Added cell width fetching, Created custom row node
ssddanbrown Aug 9, 2024
db4208a
Lexical: Linked row properties form up
ssddanbrown Aug 9, 2024
abbfd42
Lexical: Kinda made row copy/paste work
ssddanbrown Aug 9, 2024
ebf95f6
Lexical: Wired table properties, and other buttons
ssddanbrown Aug 10, 2024
ec965f2
Lexical: Added id support for all main block types
ssddanbrown Aug 11, 2024
accf256
Lexical: Integrated image manager to image button/form
ssddanbrown Aug 13, 2024
1ef4044
Lexical: Connected link selector to link form
ssddanbrown Aug 16, 2024
ad6b26b
Lexical: Added basic URL field header option list
ssddanbrown Aug 16, 2024
0039f89
Lexical: Integrated diagram manager, added menu split button
ssddanbrown Aug 17, 2024
111a313
Lexical: Added custom alignment handling for blocks
ssddanbrown Aug 18, 2024
aa1fac6
Lexical: Started adding editor shortcuts
ssddanbrown Aug 20, 2024
dbb2fe3
Lexical: Finished off baseline shortcut implementation
ssddanbrown Aug 20, 2024
ddf5f25
Lexical: Added drop/paste image handling
ssddanbrown Aug 21, 2024
8a13a9d
Lexical: Improved table row copy/paste
ssddanbrown Aug 22, 2024
1ebb0f8
Lexical: Added table column cut/copy/paste support
ssddanbrown Aug 22, 2024
1c9afcb
Lexical: Added some level of img/media alignment
ssddanbrown Sep 6, 2024
e5b6d28
Lexical: Revamped image node resize method
ssddanbrown Sep 7, 2024
bed2c29
Lexical: Added media resize support via drag handles
ssddanbrown Sep 8, 2024
16518a4
Lexical: Range of bug fixes, Updated lexical version
ssddanbrown Sep 8, 2024
fd07aa0
Lexical: Further fixes
ssddanbrown Sep 9, 2024
fb49371
Lexical: Refined editor UI
ssddanbrown Sep 9, 2024
ced66f1
Lexical: Added single node backspace/delete support
ssddanbrown Sep 9, 2024
2036438
Lexical: Added single node enter handling
ssddanbrown Sep 10, 2024
5083188
Lexical: Added block indenting capability
ssddanbrown Sep 10, 2024
662110c
Lexical: Custom list nesting support
ssddanbrown Sep 13, 2024
6872eb8
Lexical: Altered keyboard handling to indicant handled state
ssddanbrown Sep 13, 2024
5f46d71
Lexical: Fixed a range of issues in RTL mode
ssddanbrown Sep 15, 2024
03490d6
Lexical: Added RTL/LTR actions
ssddanbrown Sep 16, 2024
22d078b
Lexical: Imported core lexical libs
ssddanbrown Sep 18, 2024
ccd486f
Lexical: Got a range of Editor tests working
ssddanbrown Sep 18, 2024
787e06e
Lexical: Adapted a range of further existing tests
ssddanbrown Sep 20, 2024
dba8ab9
Lexical: Finished conversion/update of test files
ssddanbrown Sep 20, 2024
654a7a5
Lexical: Removed reconciler level direction handling
ssddanbrown Sep 21, 2024
e6edd93
Lexical: Added alignment detoggle, fixed inital focus area
ssddanbrown Sep 21, 2024
2add15b
Lexical: Added direction support to extra blocks
ssddanbrown Sep 22, 2024
ef3de10
Lexical: Added UI translation support
ssddanbrown Sep 22, 2024
c8ccb2b
Lexical: Range of fixes
ssddanbrown Sep 22, 2024
8b32e6c
Page Editors: Added switching/options for new lexical editor
ssddanbrown Sep 22, 2024
a62d838
Lexical: Updated toolbar & text node exporting
ssddanbrown Sep 23, 2024
1b9310e
Meta: Added lexical licensing info and added TS/JS CI testing
ssddanbrown Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Lexical: Fixed a range of issues in RTL mode
ssddanbrown committed Sep 15, 2024

Verified

This commit was signed with the committer’s verified signature.
ssddanbrown Dan Brown
commit 5f46d71af0af216e413af8771f227f2a73deb2ec
2 changes: 2 additions & 0 deletions resources/js/components/wysiwyg-editor.js
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@ export class WysiwygEditor extends Component {
this.editor = wysiwyg.createPageEditorInstance(this.editContainer, editorContent, {
drawioUrl: this.getDrawIoUrl(),
pageId: Number(this.$opts.pageId),
darkMode: document.documentElement.classList.contains('dark-mode'),
textDirection: this.$opts.textDirection,
translations: {
imageUploadErrorText: this.$opts.imageUploadErrorText,
serverUploadLimitText: this.$opts.serverUploadLimitText,
5 changes: 5 additions & 0 deletions resources/js/wysiwyg/index.ts
Original file line number Diff line number Diff line change
@@ -42,8 +42,13 @@ export function createPageEditorInstance(container: HTMLElement, htmlContent: st
const editWrap = el('div', {
class: 'editor-content-wrap',
}, [editArea]);

container.append(editWrap);
container.classList.add('editor-container');
container.setAttribute('dir', options.textDirection);
if (options.darkMode) {
container.classList.add('editor-dark');
}

const editor = createEditor(config);
editor.setRootElement(editArea);
4 changes: 2 additions & 2 deletions resources/js/wysiwyg/todo.md
Original file line number Diff line number Diff line change
@@ -2,12 +2,12 @@

## In progress

//
- RTL/LTR support

## Main Todo

- Mac: Shortcut support via command.
- RTL/LTR support
- Translations

## Secondary Todo

9 changes: 8 additions & 1 deletion resources/sass/_editor.scss
Original file line number Diff line number Diff line change
@@ -96,6 +96,9 @@ body.editor-is-fullscreen {
fill: #888;
}
}
.editor-container[dir="rtl"] .editor-menu-button-icon {
rotate: 180deg;
}
.editor-button-with-menu-container {
display: flex;
flex-direction: row;
@@ -171,6 +174,9 @@ body.editor-is-fullscreen {
background-position: 98% 50%;
background-size: 28px;
}
.editor-container[dir="rtl"] .editor-format-menu-toggle {
background-position: 2% 50%;
}
.editor-format-menu .editor-dropdown-menu {
min-width: 300px;
.editor-dropdown-menu {
@@ -324,9 +330,10 @@ body.editor-is-fullscreen {
.editor-node-resizer {
position: absolute;
left: 0;
right: 0;
right: auto;
display: inline-block;
outline: 2px dashed var(--editor-color-primary);
direction: ltr;
}
.editor-node-resizer-handle {
position: absolute;
2 changes: 0 additions & 2 deletions resources/sass/_pages.scss
Original file line number Diff line number Diff line change
@@ -2,13 +2,11 @@
display: flex;
flex-direction: column;
align-items: stretch;
overflow: hidden;

.edit-area {
flex: 1;
flex-direction: column;
z-index: 10;
overflow: hidden;
border-radius: 0 0 8px 8px;
}