Commit Graph
328 Commits
Author SHA1 Message Date
Tom Moor 179d7dd7be fix: Improve table controls around merged cells (#13897)
* wip

* fix: Position grips in merged cells from the rendered layout

* fix: Only merge row and column selections that cover whole rows or columns

* perf: Find merged cell spans without scanning the table map

* refactor: Extract helpers for cells starting in a row or column
2026-09-27 13:10:43 -04:00
Tom Moor 9e405b50a4 refactor: Attach observers in ref callbacks instead of effects (#13881)
* refactor: Attach observers in ref callbacks instead of effects

Use React 19 ref callback cleanup for the ResizeObserver in Scrollable and
PDF and the IntersectionObserver in useOnScreen, which now returns a ref
callback rather than taking a ref object.

* fix: Remove unused ts-expect-error directives
2026-09-25 07:30:34 -04:00
Tom Moor 9313fd22da Revert "fix(editor): reserve layout space for images (#13850)" (#13885)
This reverts commit 361f4b126d.
2026-09-25 07:12:31 -04:00
Tom Moor b72fd33e9c fix(editor): Use lazyWithRetry for shared editor lazy components (#13868)
Moves lazyWithRetry to shared/utils so the editor's ColorSwatch and
Mentions components can use it instead of React.lazy, avoiding the
Suspense reveal throttle once the chunk is loaded.
2026-09-23 20:50:37 -04:00
Sathvik3819 361f4b126d fix(editor): reserve layout space for images (#13850) 2026-09-23 23:00:40 +00:00
Tlntin 488bbb7461 feat: Line-height adjustments for Chinese, Japanese and Korean documents (#13822) 2026-09-22 03:18:17 +00:00
Tom Moor 4a2d36e2fa chore: Remove useIsMounted guards that only avoid the unmounted setState warning (#13843)
React 18+ no longer warns on setState after unmount, so the guards in
useRequest, useIdle, ActionButton, useDocumentSave and MultiplayerEditor are
removed. The Mentions guards protect an editor transaction against a destroyed
node view, so they are replaced with an effect-scoped cancel flag. Both
useIsMounted hook files are deleted.

Closes #13839
2026-09-21 22:37:27 -04:00
Tom Moor 2f57a36d50 Validate awareness identity in collaboration service (#13804)
* Validate awareness identity against connection context

* Validate awareness messages on the sending connection

* Encode real removal states and isolate ownership check in tests
2026-09-19 13:24:35 -04:00
Tom MoorandClaude Opus 5 4b4c7d3281 chore: React 19 upgrade (#13562)
* React 19 upgrade

Bumps react and react-dom to 19.2.8, with the dependency changes React 19
requires: react-is 19, @types/react 19, @types/react-dom 19,
react-helmet-async 3 and react-avatar-editor 15 (which now ships its own
types). framer-motion moves to 13 — its v6 types reference React.ReactHTML,
removed from @types/react 19.

The type changes fall into a few classes:

- The global JSX namespace is gone, so JSX.Element becomes React.JSX.Element
  and the custom element declarations move into a module augmentation.
- useRef() now requires an initial value.
- A ref created with a null initial value is typed nullable, so consumers
  that accept one are widened to RefObject<T | null>.
- React.ReactChild was removed; tooltips take React.ReactNode.
- Ref callbacks may only return a cleanup function. react-dnd connectors
  return the connected node, so useDragRef and useDropRef wrap useDrag and
  useDrop and hand back a ref callback.

react-i18next stays on v12: i18next 23 drops compatibilityJSON "v3", which
would rewrite all 64 _plural keys across every locale.

outline-icons, oy-vey and react-waypoint have no release that lists React 19
as a peer. All three render correctly under it; the install reports them as
unmet peers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Remove react-helmet and forwardRef

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 22:22:50 -04:00
UmbraCi 040e8332a7 fix(editor): prevent native img drag copying selected images (#13635) 2026-09-09 12:06:10 -04:00
Tom MoorandClaude Fable 5.1 07aa125b58 fix: Expand folded toggle blocks when printing (#13677)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 00:11:51 -04:00
Tom Moor cd082e7e3b fix: Allow document mentions to wrap (#13639)
* fix: Allow document mentions to wrap

* fix: Prevent mention icons from shrinking

* fix: Preserve mention icon and text styles

* fix: Prevent Font Awesome icons from shrinking
2026-09-05 03:08:31 +00:00
Tom Moor 2f78b54f30 fix: allow manual sizing of embedded PDFs (#13645) 2026-09-04 09:00:33 -04:00
Tom MoorandClaude 61f8ed9f49 fix: Crash opening document menu on mobile (#13526)
* fix: Crash opening document menu on mobile

The heading numbering submenu added to the document display options is
rendered through the `append` slot of `DropdownMenu`. On desktop that slot
lands inside the menu content, but on mobile it is rendered into a drawer,
which has no menu root for the Radix submenu primitives to attach to — so
opening the document overflow menu on mobile threw "`MenuSub` must be used
within `Menu`" and took down the page.

Flatten the submenu into an inline group of options on mobile, matching the
toggles it sits alongside.

Fixes OUTLINE-CLOUD-D1X

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5ExrfehTYgotb8d2aoMvK

* fix: Match heading prefix color to the heading anchor

The heading numbering prefix was drawn with the secondary text color while
the `#` anchor beside it uses the primary text color at 75% opacity. The
two read as the same tone in light mode, but diverge visibly in dark mode
where the primary text color is much brighter.

Draw the prefix from the same color and opacity as the anchor so the two
match in both themes.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5ExrfehTYgotb8d2aoMvK

* fix: Heading prefix missing when printing

The print stylesheet hides the heading pseudo element to keep the H1–H6
level labels out of print. That pseudo element also carries the heading
numbering prefix, so printing or exporting a numbered document dropped its
numbers.

Qualify the print selectors the same way the level labels themselves are,
so only the labels are hidden and the prefix still prints.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5ExrfehTYgotb8d2aoMvK

* Update Styles.ts
2026-08-22 18:17:02 -04:00
Tom MoorandClaude Fable 5 662bad7108 Add heading numbering display preference for documents (#13522)
* Add heading numbering display preference for documents

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix isRemoteTransaction call for new signature on main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix inTable detection for headings after a nested table

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Move from deco to pseudoclass

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-22 09:44:42 -04:00
Tom Moor e60dec32c2 Superellipse corners for menus, dialogs, and floating surfaces (#13520)
* Superellipse corner-shape utility for elevated surfaces

* Rename squircle helper to borderRadius, use block comment in CSS string
2026-08-21 19:36:11 -04:00
Tom MoorandClaude Opus 5 41e6daa623 fix: Unfurl GitLab epics (#13497)
* wip: Epic support

* fix: Unfurl GitLab epics and group work items

Group-scoped work items are parsed as project issues, producing a project
path of `groups/<group>` and a 404 from the issues API. Parse the namespace
around the `/-/` separator instead, and fetch group-scoped resources via the
epics API.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Truncate long mention labels instead of wrapping

A mention with a long unfurled title wrapped the pill onto several lines.
Cap it to a single line and elide the label, keeping icons and the trailing
identifier intact.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Build the project path only for project-scoped resources

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 23:55:26 +00:00
Tom Moor 2a9ac3b456 Tighten how editor node and mark attributes are rendered (#13486)
* fix: Sanitize the embed toolbar link and anchor embed url matchers

The "Open" link in an embed's bottom bar wrote the node's href attribute
into the DOM without passing it through sanitizeUrl, so a javascript: url
in that attribute ran on click.

Two embed matchers, and the regex built from a team's embed integration
settings, were not anchored, so a javascript: url that contained a
supported url further along still matched an embed and reached that link.

* fix: Only emit a list style the editor renders

The listStyle attribute is written into a list-style-type declaration.
Its validator returned a boolean rather than throwing, which Prosemirror
ignores, so any string reached the style attribute and a crafted value
appended further CSS declarations to the element.

* fix: Sanitize the image urls carried in a mention's unfurl attribute

The unfurl attribute holds a cached copy of the unfurl response on the
node, and is used whenever the store has no live entry for the url. Its
favicon and avatar urls were written to an img src unchanged, so a
crafted mention made every reader's browser request a chosen host.

* fix: Render a heading level and highlight color that cannot be used

Both attributes are used unchecked when the node is rendered. rgba()
throws for a color it cannot parse, and a level outside of 1-6 produces
an invalid tag name, so either one stopped the whole document rendering
in the browser and on the server. The heading level also reached a
repeat() in the Markdown serializer, unbounded.

Fall back when rendering rather than when reading, so that a value
written through collaborative editing, which does not run the attribute
validators, is covered too.
2026-08-19 08:06:48 -04:00
Tom Moor 628615f9bc fix: Dragging text within an image caption corrupts the document (#13449)
The caption is editable DOM outside of the document, so ProseMirror handled
the drag against the document selection instead — moving unrelated content and
throwing a mismatched transaction as the caption commit landed mid-dispatch.

Fixes OUTLINE-CLOUD-AB8
2026-08-15 20:23:30 -04:00
Tom MoorandClaude Opus 5 7c78773dc6 feat: Sticky first column in tables with a header column (#13444)
* feat: Sticky first column in tables with a header column

When a table is wider than the available space, the first column now stays
in place while the table is scrolled horizontally, matching the existing
behaviour of the header row. Only applies when every cell in that column is
a header cell.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* perf: Cache header column lookup per node

updateClassList runs on every horizontal scroll event, so the first column
check is kept until the table node itself changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 17:07:28 -04:00
Tom MoorandClaude Opus 5 551304697d feat: Highlight trigger text while suggestion menu is open (#13406)
* feat: Highlight trigger text while suggestion menu is open

Adds an inline decoration around the trigger character and search term
while the block, emoji, or mention menu is open.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Multiplayer edits

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 21:26:31 -04:00
Tom MoorandClaude Opus 5 60619649b5 fix: Consistently sanitize urls in editor components (#13372)
* fix: Consistently sanitize urls in editor components

Node attributes are authored content and cannot be assumed safe, but a few
render sinks were reading href and src straight from them. Applies the
existing sanitize helpers at the point of use in the attachment, PDF and
image components.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* feedback

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-10 12:21:23 +00:00
Tom MoorandClaude Opus 5 f81e8c3674 fix: Make the whole toggle title clickable in read only mode (#13365)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 22:58:47 -04:00
Tom Moor bc2c9ffd65 Tighten header, remove keyboard shortcuts floating button (#13304)
* Tighten header, remove keyboard shortcuts floating button

* fix: Standardize heading height const
2026-08-04 23:12:39 -04:00
Tom Moor bb520666ba Add time support to date mentions (#13222) 2026-08-01 11:47:46 -04:00
Tom Moor a9d31d3882 feat: Add color swatch hover card (#13192)
* feat: Add color swatch hover card

* refactor
2026-07-29 18:09:17 -04:00
Tom Moor 08a3b64295 chore: Exhaustive deps warning -> error (#13124)
* chore: Exhaustive deps turned to error

* Refactor useDragResize

* Refactor Lightbox to explicit state machine

* feedback

* ci
2026-07-25 10:43:49 -04:00
Tom Moor 87a4a40939 Remove ReactDOM from toDOM server rendering (#13109) 2026-07-23 20:06:27 -04:00
Tom MoorandClaude Opus 4.8 7d3e6591c2 feat: Add onNotice callback to decouple shared editor from toast library (#13046)
* feat: Add onNotice callback to decouple shared editor from toast library

Shared editor code called sonner's toast directly. Introduce an onNotice
callback (defaulting to a toast) so the shared editor stays agnostic of the
host app's notification library.

* Add lint rule to prevent regression

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 08:56:35 -04:00
Tom Moor 89a4584a7a fix: Inline images are not correctly output in HTML export (#13040) 2026-07-18 13:22:56 -04:00
Tom Moor bbf6b77dc1 fix: More comment gutter alignment fixes (#13024) 2026-07-16 21:00:02 -04:00
Tom Moor 48f216878d fix: Multiple fixes for comment gutter mark behavior and scroll-to-comment (#13013)
* Multiple improvements to comment gutter marks

* fix: Scroll to comment thread behavior jank
2026-07-15 22:49:32 -04:00
Tom Moor f1b9185e5c fix: Errored mermaid diagram should not be zoomable (#13001) 2026-07-13 21:31:13 -04:00
Tom Moor 39e2b8d219 fix: Remove math focus outline 2026-07-13 21:14:47 -04:00
Tom Moor 599b1c1b4a fix: Scope min css to table cells (#12981)
* fix: Scope min css to table cells

* feedback
2026-07-13 18:46:14 -04:00
Tom Moor f800c399b3 feat: Add support for rgb, hsl swatches (#12972) 2026-07-12 11:49:53 -04:00
Tom Moor 4fbea4c601 feat: Add preference to show comment marks in gutter (#12840)
* feat: Add pref for gutter comment marks

* simplify

* PR feedback

* wip

* Default enabled
2026-07-11 15:16:19 +02:00
tsushanthandtsushanth 4122f3896c Fix image overflow in table cells by capping width with CSS min() (#12902)
Images with a stored pixel width (e.g. from paste) set an inline
style="width: 1920px" on the image-wrapper and img elements. In tables
without explicit colwidth attributes the browser uses table-layout: auto,
which lets cells expand to the element's preferred width. The existing
max-width: 100% in the ImageWrapper styled-component cannot constrain
the wrapper because 100% of the already-expanded cell is also 1920px.

Changing to width: min(Npx, 100%) breaks the expansion: during auto
table layout the browser resolves 100% against the table's available
width rather than the cell's inflated size, so the element's
min-content contribution stays bounded and the cell no longer grows
beyond its share of the table width.

Fixes #12866

Co-authored-by: tsushanth <t.sushanth@gmail.com>
2026-07-10 18:16:23 -04:00
Salihu e9d1a2387d correctly paste doc links with hash (#12900)
* doc link with hash

* fix trim bug
2026-07-09 06:14:13 -04:00
UmbraCi 79d646b904 feat(editor): support image corner drag resizing with aspect ratio lock (#12690)
* feat(editor): support image corner drag resizing with aspect ratio lock

- Implement circular corner drag handles (ResizeTopLeft, ResizeTopRight, ResizeBottomLeft, ResizeBottomRight) using theme selection color.

- Update useDragResize hook to track coordinates as {x,y} object and handle aspect-ratio locked sizing for corner drags.

- Set overflow: visible on ImageWrapper to prevent corner handles from being clipped, and fade them in on hover.

* refactor(editor): simplify ResizeCorner styles by removing background and shadow properties

* fix(editor): fix corner resize speed and sync inputs in real-time

* fix(editor): improve corner resize cursor tracking and drag cursors

Project corner drag deltas onto the aspect-ratio vector so resizing
follows the pointer at 1x speed. Add a body class and global cursor
styles during image/media resize drags.

* refactor(editor): use relative import path inside shared directory

* fix(editor): resolve typescript type mismatch on dragging property in PDF component
2026-06-24 21:05:50 -04:00
Tom Moor 0daea28ab9 fix: Flicker of sticky table header (#12803) 2026-06-23 19:33:58 -04:00
Tom Moor 7993723931 feat: Add toggle headings (#12788) 2026-06-22 19:28:13 -04:00
Tom Moor 5554f72868 Special case small image layout (#12776) 2026-06-22 18:34:20 -04:00
Tom Moor de294525cb Remove unneccessarily heading-actions wrapper (#12772) 2026-06-21 15:28:54 -04:00
Tom Moor b7df005ad3 Remove heading folding (#12729) 2026-06-20 11:26:32 -04:00
Tom MoorandClaude Opus 4.8 283edf8ffd Hide original element during lightbox transition (#12756)
* fix: Lightbox effect tweaks

* refactor

* refactor

* fix: Address review feedback on image lightbox

- Use useLayoutEffect in useHideElement to hide/restore before paint
- Intersperse separators between image hover actions to avoid orphaned dividers when Download is hidden in edit mode

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 17:19:36 -04:00
Tom MoorandClaude Opus 4.8 d3917c2e23 fix: Cmd+A in image/video captions (#12751)
* fix: Cmd+A in image caption selects caption text, not whole document

* fix: Share caption Cmd+A select-all and fix placeholder rendering

Move the Cmd/Ctrl+A select-all handling into the shared Caption
component so image and video captions both select their own text
instead of the whole document. Also fix a stray brace in the caption
styles that corrupted the empty-caption placeholder rendering.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 11:16:41 -04:00
Tom Moor 25da5596a9 fix: Inline code marks longer than the width of editor escape (#12735) 2026-06-18 08:56:19 -04:00
Tom MoorandClaude Opus 4.8 0ffe077f6e fix: Various checkbox fixes (#12679)
* fix: Checkbox list item margin click and nested "Hide completed"

Clicking the margin beside a checkbox now places the cursor at the start
of the list item instead of being a dead zone, and shows a text cursor.

The "Hide completed" toggle no longer appears on a parent checkbox list
when completed items live in a checkbox list nested via a regular list
(checkbox -> list -> checkbox); those inner lists manage their own toggle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Checkbox improvements

* fix: Address PR review on checkbox NodeView

- Remove the checkbox click listener in CheckboxItemView.destroy() to
  avoid leaks when items are deleted/replaced.
- Globally escape "#" in the SSR fallback data URIs (replace all, not
  just the first occurrence).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 13:37:49 -04:00
Tom MoorandClaude 93c928439d fix: Nested list behavior (#12678)
* fix: preserve nesting when toggling to/from checklist in nested lists

Converting a list to or from a checklist previously cleared all nodes and
re-wrapped them, which flattened any nested list structure. Convert the
list nodes in place instead, recursively mapping list and item types so
nesting is preserved.

https://claude.ai/code/session_01BGH191WyuL9SgQyjfJ3YsD

* feat: convert plain list to checklist when typing checkbox marker

Typing "[ ] " at the start of an existing bullet or ordered list item now
converts the whole list to a checklist, preserving nested list structure,
reusing the in-place list conversion utility.

https://claude.ai/code/session_01BGH191WyuL9SgQyjfJ3YsD

* fix: place cursor at start of item after checklist conversion

After converting a list to a checklist via the checkbox marker input rule,
position the selection at the start of the converted item so the user can
continue typing immediately.

https://claude.ai/code/session_01BGH191WyuL9SgQyjfJ3YsD

* fix: remove vertical margin from checklist nested in a list

A checklist nested inside any list (bullet, ordered, or another checklist)
no longer carries the 1em vertical margin of a top-level checklist. Since
both list_item and checkbox_item render as li elements, target any
checklist-wrapper inside an li rather than only those inside another wrapper.

https://claude.ai/code/session_01BGH191WyuL9SgQyjfJ3YsD

* fix: only highlight the closest list in the formatting toolbar

When the selection sits inside a nested list, the toolbar previously marked
both the inner list and any ancestor list of a different type as active,
because each list button walked the full ancestor chain. Highlight only the
list closest to the selection.

https://claude.ai/code/session_01BGH191WyuL9SgQyjfJ3YsD

* fix: consider node selections on lists in isListActive

When a list node is the target of a NodeSelection, findParentNode resolves
to its parent list rather than the selected node. Check the selected node
directly so the toolbar reflects the selected list.

https://claude.ai/code/session_01BGH191WyuL9SgQyjfJ3YsD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-13 12:33:17 -04:00