Commit 4a904ef
authored
Develop (#2)
* fix: update bundle identifier and enhance production build configuration
* refactor(editor): improve type definitions and enhance component display names
* refactor: update imports and clean up unused code across multiple components
* feat: Implement animated block wrappers to enhance focus states across 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.
* feat: Enhance editor functionality with block action toolbar and improved 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.
* feat: Add KeyboardDock component for unified bottom dock and implement useKeyboardOffset hook for dynamic keyboard height
* chore: update dependencies to latest versions
- 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
* feat: Implement unified EditorBottomBar with keyboard dock and contextual controls
* feat(editor): enhance block management with improved logging and height handling
* feat: Enhance editor with theme context and plugin architecture
- 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.
* chore(app): update adaptive icons and splash images
* chore(dependencies): update expo-dev-client and related packages
* feat(editor): add FocusManager and virtualized FlatList focus/scroll 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.
* feat(editor): expose focus handles on built-in block plugins and wire 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.
* feat(editor): add insertBlock options, plugin-driven block creation, 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).
* feat(editor): replace empty-space footer with Add block button; clear 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.
* feat(editor): dismiss keyboard on block actions; enhance focus options & 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.
* feat(editor): integrate optional keyboard controller and improve focus/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
* feat(editor): large cleanup, refactor, and feature improvements across 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
* refactor(editor): import cleanup, typing fixes, and block rendering improvements
- 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
* refactor(editor): clean up and reorder imports in settings, MarkdownRegistry, and PluginFactory
* feat(markdown): add extended markdown features (footnotes, defs, emoji, 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
* feat(editor/markdown): add footnote & definition-list support, Notion-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 reorder1 parent 17f87cb commit 4a904ef
File tree
124 files changed
+16437
-11505
lines changed- .vercel
- __tests__
- app
- assets
- images
- adaptive-icon
- components
- editor
- components
- contexts
- core
- docs
- plugins
- built-in
- styles
- types
- utils
- ui
- constants
- contexts
- hooks
- scripts
- services/storage
- themes
- types
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
124 files changed
+16437
-11505
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | | - | |
18 | 19 | | |
19 | | - | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | | - | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
32 | 68 | | |
33 | 69 | | |
34 | 70 | | |
| |||
0 commit comments