-
Notifications
You must be signed in to change notification settings - Fork 0
GitHub issues #3
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…s editor components - Added AnimatedBlockWrapper component for smooth focus animations without layout shifts. - Updated FormattedTextInput to remove minHeight to prevent layout jumps. - Enhanced ChecklistPlugin with animated focus states and background color transitions. - Integrated animated background color in CodePlugin for improved focus feedback. - Modified HeadingPlugin to include animated border color for focus indication. - Updated ListPlugin to animate background color on focus. - Enhanced ParagraphPlugin with animated border and background colors. - Improved QuotePlugin with animated bar and background colors for focus states. - Introduced BLOCK_SPACING constants and animation configurations for consistent styling. - Established a new blockStyles.ts file to centralize styling and animation logic for editor blocks.
…oved quote handling - Added BlockActionToolbar to EditorCore for better block management. - Introduced readOnly prop in EditorCore to control editing capabilities. - Enhanced ChecklistPlugin and ListPlugin with visual indicators for nested levels. - Improved QuotePlugin to support multi-line quotes with depth management. - Refactored quote input handling to maintain depth state and cursor position. - Updated editor types to include quoteLineDepths for better depth tracking.
…t useKeyboardOffset hook for dynamic keyboard height
- Upgraded @expo/vector-icons to 15.0.3 - Updated expo and related packages to their latest compatible versions - Upgraded react and react-dom to 19.1.0 - Updated react-native to 0.81.5 - Upgraded react-native-reanimated to 4.1.1 - Updated various other dependencies for improved performance and compatibility
- Added EditorThemeContext for managing themes in the editor. - Integrated theme provider to load and save user preferences using AsyncStorage. - Updated MarkdownEditor to utilize the new theme context. - Refactored plugin registration to ensure singleton instances and prevent duplicates. - Improved Markdown serialization and deserialization to support new block types (callout, checklist, image, video). - Enhanced EditorProvider to manage block metadata effectively. - Created comprehensive documentation for the plugin architecture and usage patterns. - Updated utility functions for better markdown handling and block creation.
…system - Introduce FocusManager (components/editor/utils) to centralize block focus and post-scroll focus application. - Refactor EditorCore to use FlatList (virtualized rendering) with: - getItemLayout using measured block heights (ESTIMATED_BLOCK_HEIGHT fallback) - onScrollToIndexFailed handler that estimates offset and applies pending focus - requestBlockFocus API to request/perform focus + reveal - removed legacy ScrollView-based measure/scroll machinery and related timeouts - Track per-block heights and pass handle to FlatList for layout optimization. - Update BlockRenderer to: - register/unregister blocks with FocusManager - measure block height via onLayout and call onBlockHeightChange - attempt to focus inner component when FocusManager triggers focus - Add EditorCore.backup.tsx as a backup snapshot of the previous EditorCore implementation. Improves performance and reliability of focus + scroll behavior, and prepares editor for large documents.
… BlockRenderer - Convert built-in block components (Paragraph, Heading, List, Checklist, Code, Callout, Divider, Image, Video, Table, etc.) to use forwardRef + useImperativeHandle and expose a standard focus() handle for the editor FocusManager. - Update BlockRenderer to forward the component ref to block components so the FocusManager can call focus() and to treat isEditing as focused when mounting. - Add tests (plugin-focus-handles.test.tsx) to assert built-in plugins provide focus handles. - Update plugin architecture docs with a "Focus & Scroll Contract" describing ref/focus requirements. - Minor test file newline/whitespace fix.
…and improved list handling
- Editor API: extend insertBlock signature to accept options { meta, content } across types/editor, EditorCore, MarkdownEditor, EditorProvider and EditorScreen; forward meta/content when creating/inserting blocks.
- Plugin-aware blocks: EditorProvider.createBlock now consults pluginRegistry and uses plugin.createBlock when available, preserving plugin defaults (meta/content/pluginId) on creation.
- Lists: add getListSiblingIndices util; BlockActionToolbar and EditorBottomBar can toggle list type across contiguous sibling list items and restore previous meta when toggling back.
- ListPlugin: add createBlock, remove inline toggle UI interaction, fix handleEnter to correctly renumber subsequent ordered siblings (respecting nesting), and rewrite reorderList to compute indices per nesting level.
- TablePlugin: safer immutable updates for rows/columns (handle missing rows/cells and avoid undefined mutations).
- MarkdownEditor: delegate insertBlock to underlying editor ref with fallback createBlock that applies options.
- Tests: remove legacy/duplicative tests and add focused list-plugin.test.ts and markdown-serialization.test.ts covering list behavior and markdown round-trips.
- Chore(deps): bump various Expo / RN / tooling deps in package.json & package-lock; add react-test-renderer devDependency.
Notes: preserves existing behavior while enabling block creation with plugin-provided defaults and better list semantics (sibling-aware toggles and correct ordered indices).
… stale unsaved state - Replace invisible "tap to add" empty space with a centered "Add block" button (icon + label) in EditorCore, add proper styles and accessibility attributes. - Fix editor effect to clear unsaved changes when no actual changes are detected and update effect deps to include clearUnsavedChanges and hasUnsavedChanges.
…s & pending-focus logic Dismiss the keyboard when opening block menu or inserting a block to avoid layout/jump issues. Add viewPosition and viewOffset support and propagate them to FlatList.scrollToIndex. Improve pending-focus handling to auto-apply when a block registers and choose viewPosition/viewOffset based on keyboard and bottom-bar heights. Add debug logging around FocusManager requests/registrations and focus application.
…s/scroll reveal flow - wrap app in an optional KeyboardProvider (safe require + fallback) in _layout.tsx - add react-native-keyboard-controller dependency and update lockfiles/package.json - expose a measure() from BlockRenderer (measureInWindow) and register it with FocusManager - extend FocusManager with reveal lifecycle: awaiting flags, notifyRevealComplete, measureBlock, and improved request/apply focus timing - enhance EditorCore to track scroll offset, schedule reveal completion checks, retry fallback reveals, and adjust scrolling when keyboard appears; wire FlatList scroll events - update useKeyboardOffset to consume optional KeyboardController events when available - remove stale backup file and tweak related build/test lock entries
…s core, plugins, ui, utils, and infra
This commit contains a broad set of changes that improve formatting consistency, tighten types, fix small logic issues, and add several functional improvements (notable focus/scroll, markdown handling, plugin metadata preservation, and keyboard/drag-drop behavior). Changes are grouped below for easier review.
Highlights
- Editor core & rendering
- Integrate FlatList virtualization improvements and robust scroll-to-index fallback in EditorCore (getItemLayout, onScrollToIndexFailed, requestBlockFocus resiliance and retry logic).
- Track block heights and emit onBlockHeightChange; measure block layout in BlockRenderer and call callbacks.
- Improve FocusManager usage and scheduling of reveal completion (scheduleRevealCompletionCheck).
- Tidy up useImperativeHandle and many callbacks to be stable (memoize, add deps).
- Better error handling via SafeBlockRenderer/BlockErrorBoundary (formatting + compacted JSX).
- Text input, formatting and keyboard
- Refactor FormattedText and FormattedTextInput for cleaner props, inline returns, show formatted view when not editing, add preventNewlines option, improved placeholder color and focus flow.
- Keyboard handling (useEditorKeyboard, KeyboardHandler) refactored: normalized handlers (Enter/Backspace/Tab/Arrow/general keys), improved shortcut list and handling, support for EnhancedKeyboardResult, debouncing, and web compatibility fixes.
- Cursor preservation and selection handling improvements.
- Markdown & plugins
- Introduce and tidy MarkdownRegistry utilities (serialize/parse), ensure built-in + plugin-based markdown parsing preserves block meta and uses registry serializers.
- EditorProvider: ensure createBlock accepts meta, preserve meta when creating blocks, use MarkdownRegistry for import/export, plugin registration improvements and safer error handling.
- PluginRegistry & PluginFactory cleanup: stronger validation, consistent insertion order for markdown plugins, minor API/format fixes.
- Built-in plugins (Callout, Checklist, Code, Divider, Heading, Image, List, Paragraph, Quote, Table, Video) updated with:
- Cleaner component implementations, forwardRef/useImperativeHandle usage, improved dark-mode styling and interactions.
- Better markdown parsing/serialization and meta preservation.
- UI improvements (controls, placeholders, edit flows, validation).
- Minor behavioral fixes (e.g. checklist toggle, list/ordered index handling, quote depths, table column/row editing).
- Drag & drop
- Reworked EditorDragDrop: clearer state updates, consistent handlers (startDrag, handleDrag, endDrag, cancelDrag), improved external drop handling (files/text/html), cleaner props for overlay and indicators.
- State management & history
- EditorState and EditorProvider: normalize history shape, debounced history updates, setBlocksImmediate for instant UI updates, undo/redo enhancements and canUndo/canRedo flags.
- Improvements to useEditorState public API and internal functions (generateBlockId stability, create/duplicate/move/delete block semantics).
- UI, styles and design system
- Numerous style cleanups, consistent trailing commas and formatting across block styles, design system and theme helpers.
- Colors, DesignSystem and ThemeProvider minor adjustments and normalization.
- FormattingToolbar, KeyboardDock, KeyboardDock layout/padding fixes and style unification.
- Utilities & misc
- markdownParser, cursorPreservation, animations, and other utils: cleaned up formatting, small algorithm/regex tweaks, newline handling improvements and robust joins.
- Icon mapping fixes in IconSymbol.
- Tests/jest: improved jest-setup mocks and transformIgnorePatterns trimming; jest config and setup tidy.
- package.json: add Prettier formatting scripts and bump expo dev version; remove deprecated reset script file.
- Storage backends (Renterd, IPFS, Local): small formatting fixes and header/body fetch formatting; IPFS remains a placeholder.
- TypeScript & typings: small tsconfig include/path formatting, many plugin and editor type signatures adjusted for clarity and trailing commas.
Other
- Documentation update for plugin architecture clarifications
- Many whitespace, style, trailing-comma, and lint-friendly changes across components and codebase to improve consistency.
Notes
- Mostly non-breaking behavioral improvements, but plugin authors should verify custom plugins/controllers for EnhancedKeyboardResult support and meta preservation expectations.
- IPFS backend is explicitly still not implemented.
- Some files contain non-functional formatting-only edits for consistency.
Files touched (non-exhaustive summary)
- core: EditorCore.tsx, EditorProvider.tsx, EditorState.ts, EditorContext.ts, BlockRenderer.tsx, EditorDragDrop.ts, EditorKeyboard.ts, KeyboardHandler.tsx, PluginRegistry.ts
- components: FormattedText*, FormattedTextInput, FormattingToolbar, KeyboardDock, many built-in plugin components (CalloutPlugin, ChecklistPlugin, CodePlugin, DividerPlugin, HeadingPlugin, ImagePlugin, ListPlugin, ParagraphPlugin, QuotePlugin, TablePlugin, VideoPlugin)
- utils: MarkdownRegistry, markdownParser, cursorPreservation, animations, PluginFactory
- ui: IconSymbol
- constants: Colors, DesignSystem
- services/storage: RenterdBackend, LocalStorageBackend, IPFSBackend
- tests & infra: jest-setup.js, jest.config.js, package.json (scripts), tsconfig.json
…mprovements - Reorder and consolidate imports across auth/settings; add missing storage type/context imports - Cast IconSymbol name props to any to silence type errors in UI items - Render block components via React.createElement to ensure refs work for dynamic components - Safe-cast plugin.createBlock call in EditorProvider to support plugin-provided blocks - Add EditorBlockType import and adjust mode typing in editor state - Cast callout type in MarkdownRegistry to avoid type issues - Restore ComponentType import and default controller/toolbar/settings in PluginFactory - Add tsconfig exclude for tests and update README to reference project type-check scripts
…egistry, and PluginFactory
…i, inline formatting)
- Parse & serialize footnote definitions and references; preserve footnote meta
- Parse & serialize definition lists (term + ": definition") and support multiple defs
- Support heading custom IDs ({#id}) and include IDs in serialization/round-trip
- Add inline formatting: strikethrough (~~~~), highlight (== ==), subscript (~ ~), superscript (^ ^)
- Auto-link http/https URLs and expose 'link' segment type
- Add emoji shortcodes via new utils/emojiMap and replaceEmojiShortcodes integration
- Extend types (EditorBlock, FormattedTextSegment) and FormattedText styles to cover new segment types
- Update MarkdownRegistry / markdownParser to handle new syntaxes and serialization
- Add tests (extended-markdown.test.ts) and a markdown-showcase.md example
- Misc: minor import/formatting cleanups and small UI JSX formatting tweaks
…-style highlight navigation, long-press link/footnote UX, and tests - Add FootnotePlugin and DefinitionListPlugin and register them as built-in block plugins - Extend MarkdownRegistry / parsing to support footnote definitions, definition-list blocks, heading IDs, and emoji; refactor built-in parsing into shared helper - Implement Notion-style block highlight + navigation: - BlockRenderer highlight overlay + animation, isHighlighted prop, propagate onFootnotePress - EditorProvider / EditorState: highlightedBlockId, highlight/clear APIs - EditorCore: requestBlockHighlight, scrollToFootnote helper, improved reveal scheduling/fallbacks and applyFocus option - FocusManager: retry when blocks not yet registered, added applyFocus flag - Wire footnote navigation end-to-end: FormattedText long-press handlers for links and footnote refs, FormattedTextInput forwards onFootnotePress, Paragraph/Footnote/DefinitionList plugins consume onFootnotePress - Heading & paragraph plugin tweaks (preserve/display heading IDs, pass footnote handlers) - Add extensive tests (under __tests__) for footnote edge-cases, parsing debug, round-trip, plugin-based parsing, and unified parser scenarios - Misc: markdown-showcase formatting fixes, small markdownParser/processInlineFormatting cleanup, editor.tsx dev logging and keyboard hook import reorder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.