220 Commits

Author SHA1 Message Date
Tom Moor
87761e9bf2 feat: Code blocks can now optionally display line numbers (#4324)
* feat: Code blocks can now optionally display line numbers as a user preference

* Touch more breathing room
2022-10-24 06:44:46 -07:00
Tom Moor
e00e3e232a fix: Hard to select text in link editor input 2022-10-23 13:43:22 -04:00
Tom Moor
1f1dd23e18 feat: Add block command to create Mermaid diagram
closes #4272
2022-10-23 13:28:01 -04:00
Tom Moor
5654c312b1 Remove TLDraw from embed menu as it no longer supports embedding 2022-10-11 21:47:39 -04:00
Tom Moor
1a88cb9d08 fix: Upgrade popper, tippy to fix error (#4224)
* Upgrade popper, tippy to fix error

* tsc
2022-10-04 10:13:46 -07:00
Tom Moor
b9bf2e58cb feat: Add cursor style user preference (#4199)
* feat: Add cursor style user preference

* Remove headings for now
2022-10-01 04:39:45 -07:00
Tom Moor
6455b5332d feat: Cmd+Enter opens selected link, closes #4151 2022-09-22 20:53:25 -04:00
Tom Moor
e8a6de3f18 feat: Add HTML export option (#4056)
* tidy

* Add title to HTML export

* fix: Add compatability for documents without collab state

* Add HTML download option to UI

* docs

* fix nodes that required document to render

* Refactor to allow for styling of HTML export

* div>article for easier programatic content extraction
2022-09-07 04:34:39 -07:00
Tom Moor
e1b0e94fd5 Wrap code blocks when printing, closes #4001 2022-09-03 23:39:22 +02:00
Nicolas Caluori
2d29f0f042 Content is displayed wrongly when printing / Save as PDF (#4043) 2022-09-02 01:05:09 -07:00
Apoorv Mishra
4dbad4e46c feat: Support embed configuration (#3980)
* wip

* stash

* fix: make authenticationId nullable fk

* fix: apply generics to resolve compile time type errors

* fix: loosen integration settings

* chore: refactor into functional component

* feat: pass integrations all the way to embeds

* perf: avoid re-fetching integrations

* fix: change attr name to avoid type overlap

* feat: use hostname from embed settings in matcher

* Revert "feat: use hostname from embed settings in matcher"

This reverts commit e7485d9cda4dcf45104e460465ca104a56c67ddc.

* feat: refactor  into a class

* chore: refactor url regex formation as a util

* fix: escape regex special chars

* fix: remove in-house escapeRegExp in favor of lodash's

* fix: sanitize url

* perf: memoize embeds

* fix: rename hostname to url and allow spreading entire settings instead of just url

* fix: replace diagrams with drawio

* fix: rename

* fix: support self-hosted and saas both

* fix: assert on settings url

* fix: move embed integrations loading to hook

* fix: address review comments

* fix: use observer in favor of explicit state setters

* fix: refactor useEmbedIntegrations into useEmbeds

* fix: use translations for toasts

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-08-26 12:21:46 +05:30
Tom Moor
93bb9d067d fix: H1 and title should be different sizes, closes #3975 2022-08-15 23:02:35 +02:00
Tom Moor
1d242d44b1 chore: Add eslint rule for object shorthand (#3955) 2022-08-11 05:18:14 -07:00
Tom Moor
e5c5e8907a fix: Disallow data: URI's for images 2022-08-09 16:31:09 +02:00
Tom Moor
f9d9a82e47 fix: Cannot hit enter after sentance starting with forward slash
closes #3879
2022-07-29 09:15:48 +01:00
Tom Moor
8fdd5bf734 fix: substitution of content when sending an image to a profile (#3869)
* fix: Limit public uploads to basic image types

* test
2022-07-26 12:10:00 -07:00
Tom Moor
ef2abf824e fix: Correctly sanitize href in link editor 'open url' flow 2022-07-22 00:23:53 +01:00
Tom Moor
4af69b2758 fix: Moving an image to empty space results in endless upload (#3799)
* fix: Error dragging images below doc, types

* fix: Handle html/text content dropped into padding

* refactor, docs
2022-07-17 03:31:55 -07:00
Tom Moor
0b0a1b0169 fix: Heading action depth conflict, closes #3558 2022-07-16 17:58:02 +01:00
CuriousCorrelation
acabc00643 fix: ToolbarMenu popup on inline code selection (#3775)
* fix: `ToolbarMenu` popup on inline code selection

* fix: Replace `isCode` checks with single `isInCode`

* feat: Only relevant options on `code_inline` selection

* Change special case with item visibility toggle

* fix: `formattingMenuItems` visibility in `code_inline`
2022-07-15 16:10:47 -07:00
Tom Moor
caaf6dd76b fix: Enter at beginning of collapsed heading should create a new heading above (#3754) 2022-07-09 02:23:12 -07:00
Tom Moor
32b7a7df00 fix: Handle sanitizeUrl can receive non-string value
closes #3746
2022-07-08 21:15:07 +02:00
Tom Moor
4e189b8970 Improved sanitization of href's in editor 2022-07-05 10:14:16 +02:00
Tom Moor
9a6e09bafa feat: Add mermaidjs integration (#3679)
* feat: Add mermaidjs integration (#3523)

* Add mermaidjs to dependencies and CodeFenceNode

* Fix diagram id for mermaidjs diagrams

* Fix typescript compiler errors on mermaid integration

* Fix id generation for mermaid diagrams

* Refactor mermaidjs integration into prosemirror plugin

* Remove unnecessary class attribute in mermaidjs integration

* Change mermaidjs label to singular

* Change decorator.inline to decorator.node for mermaid diagram id

* Fix diagram toggle state

* Add border and background to mermaid diagrams

* Stop mermaidjs from overwriting fontFamily inside diagrams

* Add stable diagramId to mermaid diagrams

* Separate text for hide/show diagram
Use uuid as diagramId, avoid storing in state
Fix cursor on diagrams

* fix: Base diagram visibility off presence of source

* fix: More cases where our font-family is ignored

* Disable HTML labels

* fix: Button styling – not technically required but now we have a third button this felt all the more needed

closes #3116

* named chunks

* Upgrade mermaid 9.1.3

Co-authored-by: Jan Niklas Richter <5812215+ArcticXWolf@users.noreply.github.com>
2022-06-28 22:44:36 -07:00
Tom Moor
c4006cef7b perf: Remove markdown serialize from editor render path (#3567)
* perf: Remove markdown serialize from editor render path

* fix: Simplify heading equality check

* perf: Add cache for slugified headings

* tsc
2022-05-21 12:50:27 -07:00
Tom Moor
bf0ff6c823 chore: Casing of logger -> Logger as it's an instantiated class 2022-05-21 13:59:23 +01:00
Tom Moor
ec748f9914 fix: Floating toolbar should not appear until mouseup when selecting with mouse
closes #3564
2022-05-21 12:57:29 +01:00
Tom Moor
ef668c2fa0 Tweak design of notices 2022-05-21 11:06:35 +01:00
Tom Moor
90ca8655af fix: Collapsed header button unclickable when full-width document option is selected
closes #3558
2022-05-20 10:04:36 +01:00
Tom Moor
0577c73f06 fix: Links with anchors are broken when pages are renamed
closes #3553
2022-05-20 09:43:54 +01:00
Tom Moor
b75a6928cb Revert "fix: Fade out navigation when editing and mouse hasn't moved (#3256)" (#3502)
This reverts commit e0cf873a36.
2022-05-06 13:28:37 -07:00
Saumya Pandey
e0cf873a36 fix: Fade out navigation when editing and mouse hasn't moved (#3256)
* fix: hide header when editing

* fix: settings collab switch

* Update app/hooks/useMouseMove.ts

Co-authored-by: Tom Moor <tom.moor@gmail.com>

* fix: accept timeout parameter

* fix: don't hide observing banner

* fix: hide on focused and observing

* perf: memo

* hide References too

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-05-07 00:17:09 +05:30
Tom Moor
11477a1185 chore: Centralize clientside logging 2022-04-25 23:31:30 -07:00
Tom Moor
2fb0182e16 tom/use-event-listener 2022-04-17 11:00:28 -07:00
Tom Moor
f23f0d57de fix: Link editor should reset when selection changes
closes #3362
2022-04-13 08:55:43 -07:00
Tom Moor
1de732c82a fix: CommandMenu height when filtered 2022-04-12 20:58:39 -07:00
Tom Moor
abbc3bdb30 fix: Consistent menus in editor (#3363)
* Use scrollable in context menu

* fix: Remove old blockToolbar styles
2022-04-12 20:12:45 -07:00
Tom Moor
1f93027c97 feat: Add date and time slash commands to block menu 2022-04-07 18:50:50 -07:00
Tom Moor
9c766362ed fix: Hanging separators in filtered block menu 2022-04-04 22:35:28 -07:00
Tom Moor
cefceaac3e chore: Combine z-index from editor 2022-04-04 21:50:52 -07:00
Tom Moor
3de06b8005 fix: Missing separtor between notices and integrations in block menu
fix: Memory leak in block menu

closes #3330
2022-04-03 17:07:55 -07:00
Tom Moor
cf71fc1108 fix: Text relayout caused by external link decorations rendered async 2022-04-03 16:48:40 -07:00
Tom Moor
fde053ebc8 fix: Add stricter validation around image file type uploads (#3324)
* fix: Add stricter validation around image file type uploads

* revert backend restrictions, we want to allow unsupported images as file attachments
2022-04-01 19:26:27 -07:00
Tom Moor
6f2a4488e8 chore: Editor refactor (#3286)
* cleanup

* add context

* EventEmitter allows removal of toolbar props from extensions

* Move to 'packages' of extensions
Remove EmojiTrigger extension

* types

* iteration

* fix render flashing

* fix: Missing nodes in collection descriptions
2022-03-30 19:10:34 -07:00
忽如寄
9f400af73b refactor: ♻️ refactor isHosted && type clean up (#3290)
* refactor: ♻️ refactor isHosted && type clean up

Change-Id: I4dfbad8a07607432801de78920ce42bf81e46498

* refactor: ♻️ code clean up

Change-Id: I8f487a33d332a2acaff84397a97371b56ace28a1

* feat: 💄 lint

Change-Id: I776b1a5e249bdb542f8e6da7cb2277821cf91094

* feat:  ci type

Change-Id: I486dde7bf60321238e9a394c40ad8cdb8bfc54c8

* feat: some code sugession

Change-Id: I4761d057344b95a98e99068d312a42292977875b
2022-03-27 15:18:37 -07:00
Tom Moor
203980c845 fix: ARIA fixes, missing button labels 2022-03-16 23:41:06 -07:00
Nan Yu
ac2a124714 fix: prevent history from crashing due to missing EditorView (#3257)
* put the editor into read only mode when examining history
2022-03-16 15:01:25 -07:00
Tom Moor
631d600920 feat: File attachments (#3031)
* stash

* refactor, working in non-collab + collab editor

* attachment styling

* Avoid crypto require in browser

* AttachmentIcon, handling unknown types

* Do not allow attachment creation for file sizes over limit

* Allow image as file attachment

* Upload placeholder styling

* lint

* Refactor: Do not use placeholder for file attachmentuploads

* Add loading spinner

* fix: Extra paragraphs around attachments on insert

* Bump editor

* fix build error

* Remove attachment placeholder when upload fails

* Remove unused styles

* fix: Attachments on shared pages

* Merge fixes
2022-03-06 13:58:58 -08:00
Tom Moor
b9c7694b21 Updated placeholders, minor editor tweaks 2022-02-18 08:42:24 -08:00
Tom Moor
cbe65ddcd7 fix: Clicking links when editor hasn't been focused should navigate 2022-02-17 20:08:04 -08:00