* /dream api: Upload StableDiffusion image to Firestore
* Minor tweaks
* Set content type on uploaded image
This makes it so the image doesn't auto-download when opened in a new tab
* Allow users to dream directly from within Manifold
* Remove unused import
* Implement a /comment endpoint which supports html and markdown
* Upgrade @tiptap/core to latest
* Update all tiptap deps to beta.199
* Add @tiptap/suggestion
* Import @tiptap/html in the right place
* ... add deps everywhere
So I have no idea how common deps work apparently
* Add tiptap/suggestion too
* Clean up dream
* More cleanups
* Rework /comment endpoint
* Move API to /comment
* Change imports in case that matters
* Add a couple todos
* Dynamically import micromark
* Parallellize gsutil with -m option
* Adding comments via api working, editor.tsx erroring out
* Unused import
* Remove disabled state from useTextEditor
Co-authored-by: Ian Philips <iansphilips@gmail.com>
* Fix freezing when typing big docs
* Make rich text fields autosave to localstorage
* Add autosave for comments
* delete vestigial text editor from challenges
* Clear autosave on submit post/market/comment
* lint
* Revert "Revert "Use %mention to embed a contract card in rich text editor (#869)""
This reverts commit e0634cea6d.
* Overwrite name to prevent breakages
* Fix '%' mentioning if you escape out
* Cleanup: merge render functions
* Bring up a list of contracts with @
* Fix hot reload for RichContent
* Render contracts as half-size cards
* Use % as the prompt; allow for spaces
* WIP: When there's no matching question, create a new contract
* Revert "WIP: When there's no matching question, create a new contract"
This reverts commit efae1bf715.
* Rename to contract-mention
* WIP: Try to merge in @ and % side by side
* Add a different pluginKey
* Track the prosemirror-state dep
* De-feedify contract bets list
* De-feedify contract comments lists
* Clean up a bunch of duplicated work in the comments list stuff
* Remove wrapper markup from comment replies list
* Fix sort order on comments I broke
* Kill now unhelpful `CommentRepliesList` wrapper component
* More random cleanup
* More cleanup and fix some styling I had broken
* Make bet calculations less wrong
* Keep up to date with master
* Make copy link component copy better URL
* Make highlighted comments align properly
* Make user header left align with content on comments
* Fix some free response UI stuff up
* Make all tooltips use our component
* Stop mobile tooltip crop (daisy -> floating-ui)
* Show tooltip on tap for touch devices
Except tooltips on buttons
* migrate another daisy tooltip to ours
* Prevent hidden tooltip from covering click/hover
* Embed a tweet by URL
* Clean up imports
* Prevent tweetId from getting interpreted as a number
* Use a single place to embed iframe, Youtube, and Tweets
* Support Manifold and Metaculus embeds
* Remove unused import
* Simplify Manifold paste logic
* Clean up embed rewrite code
* Add back comment
* Rejigger config so tsx is only in web/
* Clean up comment
* Revert unnecessary tsconfig change
* Fix placeholder
* Lighten placeholder
* Embed markets using the "add markets" template
* Override dev domain
* Improve market modal style
- contract searchbar now sticky
- entire card clickable to select (if quickbet is hidden)
- adjust selected card styles
* remove extra export
* Hide pills
* Fix browser redirect warning
* Insert all markets instead of just one
* fix type error
* fixup "Insert all markets instead of just one"
Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
* Allow focus on all parts of editor
* Fix background and text colors
* Restrict height of image in comment
* Remove "Type *markdown*" placeholder
it's a little misleading (can't do markdown links) and messes with focus
to be replaced with a highlight menu in the future
* Revert "Revert "Switch comments/chat to rich text editor (#703)""
This reverts commit 33906adfe4.
* Fix typing after being weird on Android
Issue: character from mention gets deleted. Most weird on Swiftkey:
mention gets duplicated instead of deleting.
See https://github.com/ProseMirror/prosemirror/issues/565https://bugs.chromium.org/p/chromium/issues/detail?id=612446
The keyboard still closes unexpectedly when you delete :(
* On reply, put space instead of \n after mention
* Remove image upload from placeholder text
- Redundant with image upload button
- Too long on mobile
* fix dependency
* Switch comments/chat to rich text editor
* Remove TruncatedComment
* Re-add submit on enter
* Insert at mention on reply
* Update editor style for send button
* only submit on enter in chat
* code review: refactor
* use more specific type for upload
* fix ESlint and errors from merge
* fix trigger on every render eslint warning
* Notify people mentioned in comment
* fix type errors
* Add @ mentions to editor
* Fix mention list not loading
* Sort mention list by prefix, follow count
* Render at mention with Linkify component
- mentions are now Next <Link> rather than <a>
- fix bug where editor.getText() returns [object Object] for mentions
- fix mention rendering for posted markets
* Try embedding iframes in tiptap
* When iframe code is pasted, inject it into the editor
* Code cleanups and comments
* Remove clsx dependency
Cuz it doesn't exist in `common` anyways
* Rename to tiptap-iframe
- links and blockquotes have light font weight, like other text
- font size in editor matches font size in description
- old descriptions have same style as new
- placeholder text matches editor style
- decrease line-height a bit
* Use rich text editor on the description
* Write a new line to description when the question is changed
* Stop showing categories
* Allow anyone to edit their own question
* Add TipTap editor and renderer components
* Change market description editor to rich text
* Type description as JSON, fix string-based logic
- Delete make-predictions.tsx
- Delete feed logic that showed descriptions
* wip Fix API validation
* fix type error
* fix extension import (backend)
In firebase, typescript compiles imports into common js imports
like `const StarterKit = require("@tiptap/starter-kit")`
Even though StarterKit is exported from the cjs file, it gets imported
as undefined. But it magically works if we import *
If you're reading this in the future, consider replacing StarterKit with
the entire list of extensions.
* Stop load on fail create market, improve warning
* Refactor editor as hook / fix infinite submit bug
Move state of editor back up to parent
We have to do this later anyways to allow parent to edit
* Add images - display, paste + uploading
* add uploading state of image
* Fix placeholder, misc styling
min height, quote
* Fix appending to description
* code review fixes: rename, refactor, chop carets
* Add hint & upload button on new lines
- bump to Tailwind 3.1 for arbitrary variants
* clean up, run prettier
* rename FileButton to FileUploadButton
* add image extension as functions dependency