Commit Graph
15 Commits
Author SHA1 Message Date
thzxx d7cae48073 feat(parser): v0.1.15 — parser short+medium term improvements
Short-term fixes:
- Fix ***bold italic*** / ___bold italic___ triple emphasis
- Fix link text inline formatting (recursive renderInline on [**bold**](url))
- Fix backtick inline code nesting (CommonMark-compliant extractInlineCodes)
- Fix tab indentation stripping in indented code blocks

Medium-term improvements:
- parseTokens() / renderTokens() separation API for token-level transform
- registerBlockHandler() table-driven block handler registry
- Backslash escape support (\* \_ \)

Also:
- Add 48 new test cases (583 total, 7 suites, all passing)
- Parser coverage: 95.43% stmts / 91.38% branches / 100% funcs / 98.25% lines
- Update README.md, site/, package.json to v0.1.15
2026-07-24 21:39:11 +08:00
thzxx b9e98a4ff4 release: v0.1.14 — syntax highlight, Mermaid, fileSystem, preview links
feat(core): syntax highlight editor overlay
- Transparent highlight-layer behind textarea with regex-based token coloring
- Supports heading, bold, italic, strikethrough, code, link, image, list, quote, hr
- Scroll-synced with textarea, config.syntaxHighlight toggle

feat(core): preview link click interception
- Clicks on preview links intercepted, emitted as 'linkClick' event
- Configurable via onLinkClick(uri, text, editor) callback
- Default: opens in new tab, anchor links pass through

feat(parser): Mermaid diagram rendering
- ```mermaid code blocks render as <div class="me-mermaid"><pre class="mermaid">

feat(plugins): fileSystem plugin (IndexedDB persistence)
- saveToFile(id) / loadFromFile(id) / deleteFile(id) / listFiles()
- Uses IndexedDB 'metona-editor-fs' database

feat(config): maxLength (char limit), syntaxHighlight toggle

style: syntax highlight theme colors, Mermaid container

chore: bump version 0.1.13 → 0.1.14 across all files
2026-07-24 17:16:55 +08:00
thzxx 0ce7494c7a chore: bump to 0.1.13 for republish 2026-07-24 16:25:02 +08:00
thzxx 4e63870180 release: v0.1.12 — accessibility, Zen mode, scroll sync v2, shortcutHelp plugin
feat(a11y): toolbar keyboard navigation (Arrow keys, Home, End)
feat(a11y): aria-live region for screen reader announcements on mode change
feat(a11y): enhance focus-visible style (outline-offset: 2px, hide on mouse focus)

feat(core): Zen mode (editor.toggleZen() / exec('zen'))
- Toggle with Ctrl+Shift+Z shortcut concept
- Auto-hide toolbar and statusbar, mouse to top edge reveals toolbar
- Centered editor pane with max-width constraint

feat(core): heading-aware scroll sync v2
- Sync preview scroll to nearest heading before cursor position
- Falls back to proportional sync when no headings found

feat(core): Word wrap toggle (editor.toggleWordWrap() / setWordWrap(bool))

feat(plugins): shortcutHelp preset plugin
- Press '?' to open keyboard shortcuts overlay panel
- Lists built-in + user-registered shortcuts
- Click overlay or press Escape to close

style: Zen mode CSS, sr-only class, focus-visible refinement

test: 3 new tests for Zen mode, WordWrap, shortcutHelp (535 total)

chore: bump version 0.1.11 → 0.1.12 across all files
2026-07-24 16:10:51 +08:00
thzxx faa329682c release: v0.1.11 — quality & stability improvements
fix(core): clear _outlineTimer in destroy() to prevent post-destroy callbacks
fix(core): remove '<' from BRACKET_PAIRS to avoid HTML tag conflicts
fix(core): setValue now updates outline panel and resets gutter scroll
fix(core): getValue returns '' on destroyed instances (safe API access)
opt(core): _renderGutter skips rebuild when line count unchanged
chore: bump version 0.1.10 → 0.1.11 across all files
2026-07-24 15:59:07 +08:00
thzxx a570dac75a release: v0.1.10 2026-07-24 13:16:02 +08:00
thzxx 734a423b9d release: v0.1.9 2026-07-24 11:27:47 +08:00
thzxx a70bfbf0cd feat(site): add emoji favicon to demo, docs, index pages
- demo.html: 📝
- docs.html: 📖
- index.html: 🚀
2026-07-24 10:55:08 +08:00
thzxx 4fd79b9890 chore: sync all version tags to 0.1.8 2026-07-24 10:51:33 +08:00
thzxx 289b8e55a6 release: v0.1.7 — editing experience: gutter, auto-format, bracket close, drag-drop, outline
feat(core): line number gutter with current line highlight
- .me-gutter rendered alongside textarea, sync-scrolls with content
- .me-gutter-active highlights the line containing the cursor
- config.lineNumbers (default true) to toggle

feat(core): smart Enter auto-formatting
- List continuation: '- ' / '1. ' auto-insert on Enter at end of list item
- Ordered list auto-increment: '1.' → '2.'
- Quote continuation: '> ' auto-insert on Enter at end of quote line
- Empty list/quote item: Enter removes the marker (end list)

feat(core): bracket/quote auto-close
- (), [], {}, <>, "", '', ``, **, __ auto-close pairs
- Selection wrapping: select text then press ( → wraps as (text)
- config.autoBrackets (default true) to toggle

feat(core): drag & drop file support
- Drop image files → auto base64 inline insert ![](data:...)
- Drop text/code files → insert file contents
- Drop external text from browser → insert at cursor

feat(core): outline/TOC panel
- Extracts headings from rendered HTML preview
- Nested tree with indentation by heading level
- Click to scroll-jump in both preview and textarea
- config.outline (default false) to toggle

style: gutter, outline panel, current line highlight CSS

test: 11 new tests for gutter, auto-format, bracket close, outline (532 total)

chore: bump version 0.1.6 → 0.1.7 across all files, site, types
2026-07-24 10:33:12 +08:00
thzxx 45ed8d5351 release: v0.1.6 — plugin v2, i18n instance isolation, shortcuts, toolbar, toast
feat(plugins): plugin system v2
- depends: declarative plugin dependencies with topological sort (Kahn algorithm)
- async plugins: install() returning Promise auto-await
- editor.unuse(name): uninstall individual plugins
- pluginUtils.validateConfig(schema, config): configuration validation
- plugin priority field controls install order within same dependency level

feat(i18n): instance-level locale isolation, pluralization, dynamic loading
- createInstanceI18n(): per-editor independent locale contexts
- editor.setLocale()/getLocale()/t() instance methods
- Plural rules: t('items', { count: 5 }) auto-selects one/other/few/many
- i18nUtils.loadRemote(url, locale): fetch translation packs from remote
- editor.on('localeChange') event

feat(core): toolbar & shortcut customization, context menu, toast
- editor.registerShortcut(combo, handler): custom keyboard shortcuts
- editor.configureToolbar(tools): dynamic toolbar rebuild
- editor.removeToolbarButton(action): remove single button
- editor.registerContextMenu(items): right-click context menu
- editor.toast(msg, {type, duration, animation}): toast notifications

style: toast notifications, context menu, dropdown CSS
- .me-toast with success/error/warning/info types, fade/slide animations
- .me-context-menu with items, separators, shortcut hints

test: 22 new tests covering plugin deps, unuse, shortcuts, toast, i18n plural (521 total)

chore: bump version 0.1.5 → 0.1.6 across all files, site, types
2026-07-24 10:17:57 +08:00
thzxx d41da3c204 docs(site): update site pages for v0.1.5 theme features
- Update version references to 0.1.5 across demo/docs/index
- Add instance-level theme APIs to docs.html
- Add external theme following, theme inheritance docs
- Update index.html feature description
2026-07-24 09:57:11 +08:00
thzxx f8b9f4a761 release: v0.1.4 — parser enhancement, new syntax, performance optimization
feat(parser): comprehensive Markdown parser enhancement
- Add nested list support (multi-level unordered/ordered, mixed nesting)
- Add Setext headings (=== / ---)
- Add indented code blocks (4-space indent)
- Add HTML comment passthrough (<!-- -->)
- Add entity reference protection (&amp; &#169;)
- Add ordered list start attribute
- Add link title single-quote support
- Add LaTeX math formulas ($inline$ / $$block$$)
- Add footnote support ([^1] ref + [^1]: definition)
- Add definition lists (term\n: definition)
- Extend emoji map from 85 to 150+ common emojis
- Fix backtick code block matching (CommonMark spec)
- Fix italic regex character truncation (lookbehind assertions)
- Fix superscript/subscript/strikethrough ambiguity
- Fix blockquote prefix handling (>text without space)
- Enhance safeUrl filtering (additional protocol checks)
- Enhance slugify (Unicode NFKC normalization)

perf(parser): single-pass inline scanning, render cache, pre-compiled regex
- Replace 14-step chained regex with unified single-pass scanInline()
- Add cachedRenderInline() with FIFO LRU eviction (300-entry cap)
- Pre-compile 15+ static regex constants for block boundary detection
- Skip redundant style='text-align:left' on default-aligned table cells

style(parser): add CSS for footnotes, definition lists, math formulas, sup/sub

test(parser): 44 new test cases covering all v0.1.4 syntax additions (469 total)

chore: bump version 0.1.3 → 0.1.4 across all source files, docs, site pages
2026-07-24 09:35:51 +08:00
thzxx 2eb86d29b6 fix(site): escape => to =&gt; in docs.html code blocks
Arrow functions in code examples were unescaped, causing parse
errors in some browsers. Script block arrow functions preserved.
2026-07-23 21:14:32 +08:00
thzxx 71ddda1155 feat(site): add docs.html, update demo and index for v0.1.3
- docs.html: comprehensive single-page documentation with sidebar navigation
  covering all APIs, config, events, plugins, themes, i18n, and syntax reference
- demo.html: add readOnly toggle, emoji/new syntax demo content,
  imagePaste plugin, refresh API button, docs link
- index.html: add docs link to nav and footer
2026-07-23 21:08:12 +08:00