* Avoid destroyed tippy warning
Tippy doesn't remove its onDocumentPress listener when destroyed.
Instead the listener removes itself after calling hide for hideOnClick.
It doesn't look like there is a way to reliable work around this.
This skips the warning for the first hide call on a destroyed tippy
instance.
Cleanup is only performed after at least ten tippy instances have been
created.
* Hide tooltips for elements that are no longer connected to the document
* Only render action modals after first show
* Only render action dropdown after first show
* Modals fix for quick unmount
Modals use `await import("bootstrap/js/dist/modal")` when being mounted.
This means its possible that the component unmounts before the promise
resolves.
* bind() dropdown toggle click handler
* Modal mixin
* Add hide post UI
* Add toggle to home and community feeds to show hidden posts
* Add i18n (and add lockfile to prettier ignore)
* Change show hidden style
* Tippy
* Enable @babel/plugin-proposal-decorators
Dependency already exists
* Use tippy.js delegate addon, cleanup tippy instances from a mixin.
The delegate addon creates tippy instances from mouse and touch events
with a matching `event.target`. This is initially significantly cheaper
than creating all instances at once. The addon keeps all created tippy
instances alive until it is destroyed itself.
`tippyMixin` destroys the addon instance after every render, as long as
all instances are hidden. This drops some tippy instances that may have
to be recreated later (e.g when the mouse moves over the trigger again),
but is otherwise fairly cheap (creates one tippy instance).
* Restore scroll positions when resource loading settles.
The history module generates a random string (`location.key`) for every
browser history entry. The names for saved positions include this key.
The position is saved before a route component unmounts or before the
`location.key` changes.
The `scrollMixin` tires to restore the scroll position after every
change of `location.key`. It only does so after the first render for
which the route components `loadingSettled()` returns true.
Things like `scrollToComments` should only scroll when `history.action`
is not "POP".
* Drop individual scrollTo calls
* Scroll to comments without reloading post
---------
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
The same code is reused for the "show context" button as for the "link
to self" button. I'm not sure that's such a good idea in the long run.
There was a const `parentCommentId` that was always set even when not
having the `showContext` prop, causing the bug #2401.
* Adding alt_text and custom_thumbnail to post form.
* Adding htmlFor, and only show alt_text if its an image post.
* Only show custom thumbnail url field when its not an image post.
* creates the initial loading skeleton for the home page
* initial setup for the trending communities loading skeleton
* adds posts loading skeleton to the community page
* finishes the creation of all loading skeletons for large devices
* finishes loading skeleton for smaller screens
* removes unecessary code for the loading skeleton
* [loading skeleton] removes unecessary mock code
* [loading skeleton] removes custom css classes and adds more bootstrap css classes on the skeleton loading
* replaces custom styles with bootstrap classes
* rendes only one component for desktop and mobile screens
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
* fixes lint's indentation problems
* transforms span tags into self-closing tags
* removes every inline style from the loading-skeleton.tsx file
---------
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
* Pass parsed query params as props to components
* Pass parsed query params to fetchInitialData
* Pass router Match to fetchInitialData
* Cast individual routes to their concrete types
Adds an IRoutePropsWithFetch definition for routes with getQueryParams
or fetchInitialData to cause compiler errors when the types no longer
match.
* Don't double decode query parameters.
Problem: A search for "%ab" produces a url with "%25ab". Refreshing
the page results in URLSearchParams turning "%25ab" back into "%ab".
decodeURIComponent() then complains about "%ab" being malformed.
This removes decodeURIComponent() calls for query parameters and
composes all query strings with getQueryString(), which now uses
URLSearchParams. Query parsing already goes through getQueryParams()
which also uses URLSearchParams.
* Fix for PictrsImage when src also has query params
* Small getQueryParams cleanup
* Add banned blurb to community sidebar
* Hide interactable parts of posts and comments when banned from community
* Add translation
* Fix some typescript errors
* Fix typescript errors
* PR feedback
* Update deps
* Add community visibility to community form for editing and creating
* Add translations
* Make visibility display
* Add translations
---------
Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
* Set data-bs-theme attribute from Theme component
* Handle temporary theme changes in Theme component
* Fetch theme list on AdminSettings component mount
* Include CodeTheme in Theme component
* Improve handling of browser-compact theme
---------
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>