Skip to content

v0.14.0

Choose a tag to compare

@Innei Innei released this 20 May 08:38
· 85 commits to main since this release
3d7ac4a

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: removed PresentDialogProvider, usePresentDialog, PresentDialogFn, PresentDialogProps (and the ./present-dialog subpath 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 to useNestedDocConfig().onExpand / useExcalidrawModuleConfig().onExpand from the matching @haklex/rich-compose/modules/<name> entry.

Features

  • @haklex/rich-compose: new defineConfigurableModule helper. Every expand-capable module (nested-doc, excalidraw, image, gallery) now exposes module.setup(config) and a matching useConfig() hook for its renderer.
  • @haklex/rich-compose/modules/image: new imageModule with onClick configuration — hosts can wire a lightbox without overriding the renderer.
  • @haklex/rich-compose/modules/gallery: galleryModule carries the same onClick configuration path.
  • @haklex/rich-ext-excalidraw: new ExcalidrawExpandShell + excalidrawFullscreenPopup style exports; ExcalidrawConfigProvider / useExcalidrawConfig re-exported from @haklex/rich-compose/modules/excalidraw.
  • @haklex/rich-ext-nested-doc: new NestedDocPreviewCard export — reusable preview card matching the default expand affordance.

Bug Fixes / Internal

  • @haklex/rich-renderer-image, @haklex/rich-ext-gallery: dropped the transitive react-photo-view dependency. Hosts wanting in-place lightbox should declare it themselves and wire it via the new onClick modules.
  • @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.00.14.0.