feat(editor): wire @swarmnote/editor-react sibling package - #62
Merged
Conversation
Adopt `@swarmnote/editor-core` v0.1 plugin SDK in the SwarmNote host: - `NoteEditor.tsx` constructs `plugins[]` from preferences snapshot (`buildEditorPlugins`); `host` object replaces deprecated top-level `imageResolver` / `uploadFile` - `refreshBlockImagesEffect` now imported from `@swarmnote/editor-core/plugins/blockImage` subpath (main entry no longer re-exports it) Preferences: - `preferencesStore` adds `enabledPlugins: EditorPluginId[]` (defaults to all 8 enabled) and `codeBlockMode`. `migrateLegacyFeatures` defensively translates v0.0.x `features.*` keys and clears them (idempotent) - New "编辑器插件" section in `routes/settings/general.tsx` lists per-plugin Switch + codeBlock mode Select i18n: 21 new English strings backfilled in `src/locales/en/messages.po`. Documentation: - `dev-notes/plans/editor-plugin-architecture.md` marked as implemented; v0.1 BREAKING change summary appended as release-notes / PR description source - `dev-notes/knowledge/editor.md` gains a Plugin SDK section with the key constraints (subpath imports, host capabilities, boot-time freeze) BREAKING CHANGE: Editor `features` 7 fields removed upstream in `@swarmnote/editor-core` v0.1; capability enablement now lives in `plugins[]`. v0.0.x preferences containing `features.*` keys are auto-migrated via `migrateLegacyFeatures`. Refs: OpenSpec change `add-editor-plugin-sdk-v01`; pairs with sibling commit 37db01c.
Add @swarmnote/editor-react as a linked sibling dependency (alongside existing @swarmnote/editor-core): - package.json: pnpm.overrides + dependencies entries for editor-react - src/App.css: @source directive for sibling editor-react/dist so Tailwind 4 scans className literals from cross-package built output - dev-notes/knowledge/editor.md: document the new 4-package sibling architecture (editor-core / editor-web / editor-react / editor-react-native) - dev-notes/plans/editor-core-host-boundary.md: mark §六 partially implemented by OpenSpec change split-editor-react-packages Desktop host code is unchanged. SwarmNote still uses its own EditorContextMenu / TableContextMenu — those are business-level UI orchestration (deeply coupled to host shadcn primitives + uiStore + Lingui macro) and stay in the host repo per the component-library design philosophy. editor-react built-ins (EditorView, EditorToolbar, I18nProvider) are available for opt-in use when needed. Depends on swarmnote-editor commit 7acc831
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
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.
Summary
Wire desktop host to
@swarmnote/editor-reactfrom the v0.2 4-package sibling layout:pnpm.overridesaddslink:../swarmnote-editor/packages/editor-reactsrc/App.cssadds Tailwind 4@sourcedirective scanning siblingeditor-react/distdev-notes/knowledge/editor.mdwith the four-package layoutdev-notes/plans/editor-core-host-boundary.md§ VI with "已落实(部分)" bannerScope: host does not migrate its existing
EditorContextMenu/TableContextMenuto the sibling package — per OpenSpec D12, siblingeditor-reactis an independent component library, not a host migration target. Existing host UI stays.Stacked on top of #61 (host plugin SDK wiring). After #61 lands, this PR's base auto-flips to
develop.Commits
cc7bdc8— feat(editor): wire @swarmnote/editor-react sibling packageCross-repo refs
swarm-apps/swarmnote-editor#3(commits7acc831+4a98e10)swarm-apps/SwarmNote-RN#feat/use-editor-react-native(commitsb7b8bb2/0976329/a9b034e)Merge order
swarm-apps/swarmnote-editor#2→ sibling mainswarm-apps/swarmnote-editor#3→ sibling mainswarm-apps/SwarmNote-RN#feat/use-editor-react-native→ developTest plan
pnpm build(Vite) passespnpm lint:cipassespnpm tauri devsmoke test — deferred to next host UI change (decision in OpenSpec change)@sourceplacement (must be after all@importlines)