feat: Notes Editor on a bundled Quill 2 instead of the remote TinyMCE - #1807
Conversation
✅ Deploy Preview for afmg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
5f095e7 to
56bf0b2
Compare
|
The first message says: Do you know if some people use this? I don't know if people with other alphabets are affected. And, on another topic, sone of the dropped features are interesting. |
|
Good question, and worth checking rather than assuming, so I did. The font family and size pickers were not actually reaching anyone. The toolbar config asks for On other alphabets: typing Cyrillic depends on your keyboard layout, not the editor toolbar, and the note box sets no font family, so notes render in the page font either way. The special characters grid would not have helped there in any case: it holds 288 characters, of which 51 are Greek and none are Cyrillic. It is currency signs, accented Latin, maths, arrows and punctuation. What is genuinely dropped: the symbol grid, horizontal rule, media embed, print, word count, indent/outdent, and auto-linking of typed URLs. Auto-linking is the one I would expect to be missed most. Anything with markup Quill cannot represent can still be edited through the HTML mode button, and if any of these are wanted back they are small additions on top of Quill: a font picker mainly needs someone to decide the font list, since the underlying format already round-trips any value. |
|
Will update an merge to branch |
* heightmap countour lines (#1813) * Options full migration (#1666) * init - migrate main.js * continue - options.ts * continue - settings * migrateSettingsFormat * refactor: clean up comments and reorganize LOCKS_KEY declaration * migrateSettingsFormat * refactor: remove unused properties and update migration functions for legacy settings * Refactor options usage to capitalize 'Options' throughout the codebase - Updated references from 'options' to 'Options' in various files including export-json.ts, load.ts, save.ts, stats.ts, url-params.ts, debugUtils.ts, fileUtils.ts, unitUtils.ts, and preferences.ts. - Introduced new storage migration logic to handle legacy settings and ensure compatibility with the current options structure. - Added tests for storage migration and deep merging of options to validate the changes. - Implemented a deepMerge utility function to facilitate merging of nested objects while preserving existing values. * Refactor global Options to options and update related references - Changed all instances of globalThis.Options to globalThis.options across multiple files for consistency. - Updated tests and utility functions to reflect the new options naming convention. - Ensured that all settings and configurations are correctly accessed through the new options object. - Introduced options-model and options-store components to better manage application state and options. - Adjusted local storage keys for options and locks to maintain compatibility with the new structure. * graph globald remove * viewport globals gone * viewport * mapId and mapHistory global gone * ocean style fix * fixes * fixes * init shell * fixes * architectural rework - non-final * fixes * fixes * legacy options migration * fixes * fixes * meh changes * still bad * unufied model * update * fixes * format * fixes * fixes * fixes * fix * fixes --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> * burg-treasury-edit (#1814) * fixes * preserve dialog positions * feat: Notes Editor on a bundled Quill 2 instead of the remote TinyMCE (#1807) * chore: add quill 2 as a dependency * feat: rich text helpers for the notes editor on quill * feat: notes editor on quill instead of the remote tinymce * chore: drop the bundled tinymce * fix: guard a leading script or style tag in the rich text check * test: notes editor e2e on the bundled quill editor * fix: keep ordinary spaces in saved notes and treat table headers as raw markup * chore: bump to 1.151.3, changelog entry * chore: re-pin the npm deps hash for the quill dependency * fix: let the assistant's answers be selected and copied * quill tools rework --------- Co-authored-by: Azgaar <azgaar.fmg@yandex.com> * Entity notes (#1817) * docs: PRD for notes on entities Replace the global notes side table with an optional note field on the entity, widen note support to 17 entity types, and migrate existing maps in one version step. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * feat: move notes onto the entities they describe Replace the global `notes` side table with an optional `note` field on the entity, and give markers the `name` the note used to carry. - new components/entity-notes.ts: element id <-> entity resolution, note get/set/clear, the aggregate walk the editor and the font scan need - notes editor lists notes grouped by entity type, exchanges csv addressed by entity, and drops the separate note title - delete the ten lifecycle blocks that kept the array in sync: burg renumbering, regiment id rewrite on state merge, marker removal, added-label removal, the duplicate-marker-id patch, resample splicing - auto-update distributes an old map's notes onto entities, collides river/route duplicates, folds a divergent note title into the text as a heading, and hands back what no entity claims as a csv - .map field 4 is written empty from this version on Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * feat: notes for every note-bearing entity, and feature note restoration - note buttons in the states, provinces, cultures, religions, biomes, zones, goods and markets tables, and in the journey and market dialogs - every note button is dimmed until its entity has a note - Features.captureUserData/restoreUserData match a feature's name and note back by grid cell after the graph is rebuilt, so a heightmap edit that keeps a lake keeps what the user wrote about it; resample carries the note along with the name it already carried - tests for the resolver, the migration and the feature restore - data model, glossary and wiki describe notes as an entity field Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * refactor: Notes store, shared button markup, contained legacy migration - entity-notes exports a NotesStore singleton (Notes.get/set/list/...) following the Pins and Layers convention, replacing loose functions - drop the inactive state on note buttons: having no note is normal - every note button comes from Notes.getButton(id, subject) or Notes.getIcon(subject), so the markup and tip are written once - the v1.152.0 note migration lives entirely inside its isOlderThan block: no module state, and the older blocks that renumber markers and added labels record a rename map instead of editing notes; the unattached notes come back as the migration's return value Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * refactor: move the Notes store to generators, offer orphans from auto-update Notes sit next to the data they annotate, and the store has controlling methods, so components/entity-notes becomes generators/notes. The unattached-note csv is offered from inside the v1.152.0 block, only when the migration actually found some, so the loader no longer carries a result through just to open a dialog. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * refactor: remove outdated notes mapping and auto-update details from data model documentation * feat: enhance notes functionality and editor interactions for entities * fix actions column --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> * docs update * icons: viewport renderer * markers - viewport renderer * markets - viewport rendering * routes, rivers, goods - viewport rendering * fixes * biome upgrade * fixes * fixes --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: barrulus <b@rry.im>
Closes #1803. Supersedes #1799.
What
The Notes Editor now uses Quill 2, bundled with the app, instead of TinyMCE fetched at runtime from azgaar.github.io. Notes stay plain HTML strings in the .map file; the editor is only a view over them. Version 1.151.3 (patch: the notes format is unchanged).
Why
TinyMCE was loaded with a dynamic
import()of a remote URL. When that load fails (Desktop App CSP, offline), Vite reports a missing chunk and the app shows the "New version released" prompt while the editor degrades to a bare contenteditable (#1660). #1799 patched the loader; this replaces the editor as discussed.Bundling TinyMCE through npm, the other option, would fold a GPL-2.0-or-later library into the MIT build. Quill's BSD-3 avoids that question.
Behaviour
<br>runs become paragraphs, and tables gain Quill'sdata-rowcell attributes and a border style.<iframe>, a legacy<hr>) open in a raw HTML textarea automatically; a button below the editor switches any note to HTML mode and back.Notes for review
public/libs/tinymce(4.7 MB) is deleted. Every Desktop build already blocks the remote load through its CSP (that is Spurious "New version released" dialog when adding a note in the Electron desktop client #1660), so the desktop is unaffected. Self-hosted copies and forks pinned between 1.123.2 and 1.151.2 load TinyMCE from the deployed copy of that folder at runtime; once this deploys they fall back to the plain editor until they update.'self'chunk now.<template>element rather than atext/htmldocument so a leading<script>or<style>cannot slip past it.src/test-setup.tsgained a guarded jsdomRange.getBoundingClientRect/getClientRectsshim because Quill's focus path calls them and jsdom never implements them.