v0.14.0
Summary
v0.14.0 rebuilds how nested-doc, excalidraw, image, and gallery nodes expand into dialogs. The previous PresentDialogProvider / usePresentDialog bridge from @haklex/rich-editor is gone — every "expand on click" affordance now flows through a per-module onExpand callback wired via the new configurable-module API (module.setup({ onExpand })). Hosts get full control of dialog presentation; renderer packages drop their hidden dependency on the editor context.
Breaking Changes
@haklex/rich-editor: removedPresentDialogProvider,usePresentDialog,PresentDialogFn,PresentDialogProps(and the./present-dialogsubpath entry).- Migration: replace
<PresentDialogProvider value={presentDialog}>+usePresentDialog()usage with per-module.setup({ onExpand }). For example:import { nestedDocModule } from '@haklex/rich-compose/modules/nested-doc' import { excalidrawModule } from '@haklex/rich-compose/modules/excalidraw' const configuredNestedDoc = nestedDocModule.setup({ onExpand: ({ content, title, target }) => presentDialog({ content, title }), }) const configuredExcalidraw = excalidrawModule.setup({ onExpand: ({ content, theme, target }) => presentDialog({ content, theme }), })
- Custom overrides that previously called
usePresentDialog()should switch touseNestedDocConfig().onExpand/useExcalidrawModuleConfig().onExpandfrom the matching@haklex/rich-compose/modules/<name>entry.
- Migration: replace
Features
@haklex/rich-compose: newdefineConfigurableModulehelper. Every expand-capable module (nested-doc, excalidraw, image, gallery) now exposesmodule.setup(config)and a matchinguseConfig()hook for its renderer.@haklex/rich-compose/modules/image: newimageModulewithonClickconfiguration — hosts can wire a lightbox without overriding the renderer.@haklex/rich-compose/modules/gallery:galleryModulecarries the sameonClickconfiguration path.@haklex/rich-ext-excalidraw: newExcalidrawExpandShell+excalidrawFullscreenPopupstyle exports;ExcalidrawConfigProvider/useExcalidrawConfigre-exported from@haklex/rich-compose/modules/excalidraw.@haklex/rich-ext-nested-doc: newNestedDocPreviewCardexport — reusable preview card matching the default expand affordance.
Bug Fixes / Internal
@haklex/rich-renderer-image,@haklex/rich-ext-gallery: dropped the transitivereact-photo-viewdependency. Hosts wanting in-place lightbox should declare it themselves and wire it via the newonClickmodules.@haklex/rich-ext-excalidraw: refactored the display / expand split into a dedicated shell component.
Bump rationale
| Package | Diff signal | Level |
|---|---|---|
rich-editor |
Removed PresentDialogProvider/usePresentDialog/PresentDialogFn/PresentDialogProps public exports |
major |
rich-compose |
Additive configurable-module API + per-module .setup/useConfig |
minor |
rich-ext-excalidraw |
Additive exports ($createExcalidrawNode, ExcalidrawConfigProvider, ExcalidrawExpandShell, …) |
minor |
rich-ext-nested-doc |
Additive export (NestedDocPreviewCard) |
minor |
rich-ext-gallery |
Dropped react-photo-view dep; renderer internals |
patch |
rich-renderer-image |
Dropped react-photo-view dep; renderer internals |
patch |
Shared-version convention: highest classification wins. In 0.x semver, breaking changes ship as a minor bump → 0.13.0 → 0.14.0.