-
Notifications
You must be signed in to change notification settings - Fork 132
Conversation
This commit sets up the classic ckeditor to be used in place of quill. Most functionality (specifically with the footer buttons and syncing) do not work as of yet.
The two footer buttons: `enable-sync` and `give-feedback` now work as intended. When `enable-sync` is clicked however, the `sync-note` covers the footer buttons currently instead of being displayed above them.
Formats added: - All text sizes - block quotes Also added the `cursor: text` to the text editor area.
This was an attempt to build the Classic editor from source as outlined in this guide: https://docs.ckeditor.com/ckeditor5/latest/builds/guide- s/integration/advanced-setup.html. This isn't bundled correctly however since ClassicEditor.js and Markdown.js are at the top-level of the directory and need to be inside the `sidebar/` directory.
Hello @szymonkups and @Reinmar This part is going mostly well but could use your advice on the following:
|
src/sidebar/panel.js
Outdated
}); | ||
} | ||
}); | ||
// content.forEach(node => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szymonkups, @Reinmar Need a bit of help here. We used to look at node attributes in Quill to detect of features are being used. How do we detect if bold
, italic
, etc are used? getData
just returns text. In Quill there is quill.getContents(); vs quill.getData();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be something like:
import Range from '@ckeditor/ckeditor5-engine/src/model/range';
const range = Range.createIn( editor.document.getRoot() );
for ( const value of range ) {
if ( value.item.is( 'text' ) ) {
console.log( Array.from( value.item.getAttributes() ) );
}
}
Iterating over a range uses a tree walker and value
is an instance of TreeWalkerValue
.
This will print which text attributes are used. You can also check which elements are used by console.log( value.item.name )
if value.item.is( 'element' )
is true.
Of course, this means that you need to build this code together with CKEditor. So you can't use a built version of CKEditor, but build CKEditor from source together with the code which uses it. It's explained here: https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/framework/guides/quick-start.html.
We're now working on making it simpler to write some basic features without building CKEditor. This means exposing more APIs somewhere in the editor
properties.
PS. Why do you need to check which features are used in the editor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS. Why do you need to check which features are used in the editor?
So we can learn which features are the most popular. User research, etc.. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Natim wanna take a look at this?
need to uncomment the content.forEach(node => {
function, otherwise metrics works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"uncomment" => make it work. You might need to add a dependency that includes the Range
module.
build CKEditor from source together with the code which uses it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Natim Our build script is here: https://github.com/mozilla/notes/pull/394/files#diff-bef1bc0d0ce8255123c3de896c5a796b , builds and copies with npm run postinstall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seems to work:
ERROR in ./src/ckeditor.js
Module not found: Error: Can't resolve '@ckeditor/ckeditor5-editor-classic/src/classiceditor' in '/home/rhubscher/mozilla/notes/ckeditor-build/src'
@ ./src/ckeditor.js 6:0-85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to install npm install --save @ckeditor/ckeditor5-editor-classic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm install --save @ckeditor/ckeditor5-build-classic
nailed it.
Great to see that you're moving forward with this :) I really want to see the final result.
|
Migration:
|
@Reinmar thank you so much for the quick response. It is really helpful! @cedricium I pushed fixes to the dark theme, it's ~70% there. Let me know if you have time to tweak the |
@vladikoff sure thing, will work on the dark theme 👍 |
@vladikoff so far I have a fix for the 'Choose heading' label overflow and I made the link color more visible for the Dark theme. Is there anything else you saw that needs specific fixing? |
Changes made result in the following: - fixed the heading dropdown border overlap issue - replicated `:hover` and `:active` styles from the light theme - added a border to tooltips to make them stand out better
Dark Theme touchups
Early Beta to start QA: addon-1.9.0b1.zip |
@cedricium awesome work on the dark theme 👍 |
Fixes #413 Fixes "Hello!" is not a heading on fresh start"
* Fix hardcoded version number * Simplify build script and npm start
@Natim this should be ready for release. Could you go over the code and see if you can see anything we should adjust? One final thing to check is the metrics. Let me know if you got time to check that before merging. I couldn't get these to work:
but I think we can ship without that. I removed the |
@cedricium feel free to also take a look ^ |
-- Disregard, got it working. -- |
Awesome :) |
@@ -10,7 +10,7 @@ const analytics = new TestPilotGA({ | |||
ds: 'addon', | |||
an: 'Notes Experiment', | |||
aid: 'notes@mozilla.com', | |||
av: '1.9.0dev' // XXX: Change version on release | |||
av: browser.runtime.getManifest().version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I am going to land this to give more time to translators to catch up before next week release. |
@szymonkups and @Reinmar, this is now live: https://medium.com/firefox-test-pilot/testpilot-notes-v1-9-0-b166c6cd7353 |
TODO
Missing placeholderWaiting on Implement configurable editor's placeholder ckeditor/ckeditor5#479rename 'Choose Style' to 'Aa' in the dropdown
Focus on openDelayed until The content area from "Firefox Notes" sidebar does not gain focus when it is opened or switched #330L10N
"Hello!" is not a heading on fresh start
Missing
strikebuttonFigure out
change
events in the editorMake welcome message use the bold
Hello!
Bug with "Headings" when formats are mixed with lists:
I think we might need to fork the headings plugin or send a pull request to make that text configurable.
Text migration
Fix CSS issue with linksMoved to Add links support with adjusted CSS #396Dark Theme support
Dark Theme fixes
Metrics based on editor usage (via @Natim)
RTL supportBring back RTL support with ckeditor #414