super-productivity/packages/plugin-dev/document-mode
Johannes Millan 670a48c77e fix(document-mode): mount guard, bubble cross-block, version forward-compat
Three smaller lifecycle / correctness fixes from the review:

- mount() is now idempotent (isMounted flag). The iframe is normally
  rebuilt from scratch on embed open, but HMR or unusual host
  re-init flows could call mount() twice — every body-appended
  element and every document-level listener would then duplicate.
  One-mount-per-iframe is enforced.

- BubbleMenu.shouldShow now walks the full selection range with
  nodesBetween instead of only checking the start position's node.
  A selection that crosses an atom (e.g. paragraph → divider →
  paragraph) no longer shows the inline-mark menu — toggling bold
  across the divider wouldn't have done anything useful anyway.

- readBlob: future-version guard. If the stored blob's version is
  ahead of STORAGE_VERSION (user synced from a newer build), refuse
  to load and set isStorageUnreadable. scheduleSave is now gated on
  it too, so a downgrade can't overwrite the user's newer blob with
  our empty fallback. Recovery is automatic on update to a build
  that understands the newer schema.
2026-05-21 20:48:27 +02:00
..
scripts feat(document-mode): add TipTap-based document-mode plugin (POC) 2026-05-21 17:22:31 +02:00
src fix(document-mode): mount guard, bubble cross-block, version forward-compat 2026-05-21 20:48:27 +02:00
.gitignore feat(document-mode): add TipTap-based document-mode plugin (POC) 2026-05-21 17:22:31 +02:00
package-lock.json feat(document-mode): Notion-style UX (gutter, bubble menu, block menu) 2026-05-21 17:34:13 +02:00
package.json feat(document-mode): Notion-style UX (gutter, bubble menu, block menu) 2026-05-21 17:34:13 +02:00
tsconfig.json feat(document-mode): add TipTap-based document-mode plugin (POC) 2026-05-21 17:22:31 +02:00