spacedrive/interface/hooks/index.ts

34 lines
1.2 KiB
TypeScript
Raw Normal View History

[ENG-471, ENG-472] Add `dry_run` parameter to some API routes and related UI changes (#750) * Add dry_run for `location.create` and `location.addLibrary` * Add dry_run to IndexerRuleCreateArgs - Add invalidate_query to create and edit api method of the location route - Adjust some code to use the new dry_run property * `AddLocationDialog` and `IndexerRuleEditor` now validate with backend without user interaction - Create `useCallbackToWatchForm` to make it easier to watch form changes with an async function that also executes during component mount - `method` is now part of the `addLocationDialog` form schema, and a hidden input - Add an `index.ts` for hooks and components * Fix mobile * Remove redundant type definition * Add `useCallbackToWatchForm` as an additional hook to `react-hooks/exhaustive-deps` - Improve `useCallbackToWatchForm` argument handling, to avoid duplicated references to form * Fix unnecessary form value updates in `addLocationDialog` - Move reset `method` on `path` change logic from the superfluous `useEffect` to `useCallbackToWatchForm` in `addLocationDialog` - Improve core API debug logs for `dry_run` - Fix incorrect file name for `useCallbackToWatchForm` hook - Improve the documentation for `useCallbackToWatchForm` - Fix `useCallbackToWatchForm` not ignoring callback errors - Fix `useCallbackToWatchForm` ignoring returned Promise from `onWatch` - Add basic validation for the `form` argument in `useCallbackToWatchForm` * Remove superflous if checks - generate new core.ts * Remove DryRunError * Remove unused import --------- Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-04-29 10:49:51 +00:00
export * from './useCallbackToWatchForm';
[ENG-528] QuickPreview isn't correctly handling errors for video/audio playback (#815) * Centralize the file preview logic in `Thumb.tsx` * Fix useEffect * Fix Inspector thumb keeping internal state from previous selected files - Change video border to follow video aspect-ratio, just like Finder * Restore memo to Thumb - Only add borders to video thumb, not the video itself * Simplify and improve Thumb logic - Add A internal Thumbnail component - Rename main component to FileThumb to match mobile naming - Move getIcon utility function to assets/icons * Add new `useCallbackToWatchResize` hook - Replace `ResizeObserver` with new resize hook in `Thumb` - Simplify and improve `useIsDark` hook by replacing `react-responsive` with direct usage of WebAPI `matchMedia` - Fix `Thumb` src not updating correctly - Fix video extension incorrectly showing when size <= 80 in `Thumb` * Fix `Inspector` not updating thumb type - Remove superfluous `newThumb` from `getExplorerItemData` * Remove superfluous `ThumSize` * Forgot a `?` * Fix incorrect className check in `Thumb` - Updated changed files to use the hooks root import * Format * Fix PDF preview compleatly breaking the application - Allow Linux to access both the spacedrive:// custom protocol and the workaround webserver - On Linux only use the webserver for audio and video, which don't work when requested through a custom protocol - Configure tauri IPC to allow API access to the spacedrive://localhost domain, to avoid PDF previews from breaking the security scope and rendering the application unusable - Configure CSP to allow the pdf plugin custom protocol used by webkit - Fix race condition between Thumb error handler and thumbType useEffect, by using replacing it with a useLayoutEffect - Improve Thumb's error handling
2023-05-18 03:31:15 +00:00
export * from './useCallbackToWatchResize';
[ENG-471, ENG-472] Add `dry_run` parameter to some API routes and related UI changes (#750) * Add dry_run for `location.create` and `location.addLibrary` * Add dry_run to IndexerRuleCreateArgs - Add invalidate_query to create and edit api method of the location route - Adjust some code to use the new dry_run property * `AddLocationDialog` and `IndexerRuleEditor` now validate with backend without user interaction - Create `useCallbackToWatchForm` to make it easier to watch form changes with an async function that also executes during component mount - `method` is now part of the `addLocationDialog` form schema, and a hidden input - Add an `index.ts` for hooks and components * Fix mobile * Remove redundant type definition * Add `useCallbackToWatchForm` as an additional hook to `react-hooks/exhaustive-deps` - Improve `useCallbackToWatchForm` argument handling, to avoid duplicated references to form * Fix unnecessary form value updates in `addLocationDialog` - Move reset `method` on `path` change logic from the superfluous `useEffect` to `useCallbackToWatchForm` in `addLocationDialog` - Improve core API debug logs for `dry_run` - Fix incorrect file name for `useCallbackToWatchForm` hook - Improve the documentation for `useCallbackToWatchForm` - Fix `useCallbackToWatchForm` not ignoring callback errors - Fix `useCallbackToWatchForm` ignoring returned Promise from `onWatch` - Add basic validation for the `form` argument in `useCallbackToWatchForm` * Remove superflous if checks - generate new core.ts * Remove DryRunError * Remove unused import --------- Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-04-29 10:49:51 +00:00
export * from './useClickOutside';
export * from './useCounter';
export * from './useDebouncedForm';
export * from './useDismissibleNoticeStore';
export * from './useFocusState';
export * from './useInputState';
[ENG-528] QuickPreview isn't correctly handling errors for video/audio playback (#815) * Centralize the file preview logic in `Thumb.tsx` * Fix useEffect * Fix Inspector thumb keeping internal state from previous selected files - Change video border to follow video aspect-ratio, just like Finder * Restore memo to Thumb - Only add borders to video thumb, not the video itself * Simplify and improve Thumb logic - Add A internal Thumbnail component - Rename main component to FileThumb to match mobile naming - Move getIcon utility function to assets/icons * Add new `useCallbackToWatchResize` hook - Replace `ResizeObserver` with new resize hook in `Thumb` - Simplify and improve `useIsDark` hook by replacing `react-responsive` with direct usage of WebAPI `matchMedia` - Fix `Thumb` src not updating correctly - Fix video extension incorrectly showing when size <= 80 in `Thumb` * Fix `Inspector` not updating thumb type - Remove superfluous `newThumb` from `getExplorerItemData` * Remove superfluous `ThumSize` * Forgot a `?` * Fix incorrect className check in `Thumb` - Updated changed files to use the hooks root import * Format * Fix PDF preview compleatly breaking the application - Allow Linux to access both the spacedrive:// custom protocol and the workaround webserver - On Linux only use the webserver for audio and video, which don't work when requested through a custom protocol - Configure tauri IPC to allow API access to the spacedrive://localhost domain, to avoid PDF previews from breaking the security scope and rendering the application unusable - Configure CSP to allow the pdf plugin custom protocol used by webkit - Fix race condition between Thumb error handler and thumbType useEffect, by using replacing it with a useLayoutEffect - Improve Thumb's error handling
2023-05-18 03:31:15 +00:00
export * from './useIsDark';
export * from './useKeyDeleteFile';
export * from './useKeybind';
export * from './useKeybindEventHandler';
[ENG-471, ENG-472] Add `dry_run` parameter to some API routes and related UI changes (#750) * Add dry_run for `location.create` and `location.addLibrary` * Add dry_run to IndexerRuleCreateArgs - Add invalidate_query to create and edit api method of the location route - Adjust some code to use the new dry_run property * `AddLocationDialog` and `IndexerRuleEditor` now validate with backend without user interaction - Create `useCallbackToWatchForm` to make it easier to watch form changes with an async function that also executes during component mount - `method` is now part of the `addLocationDialog` form schema, and a hidden input - Add an `index.ts` for hooks and components * Fix mobile * Remove redundant type definition * Add `useCallbackToWatchForm` as an additional hook to `react-hooks/exhaustive-deps` - Improve `useCallbackToWatchForm` argument handling, to avoid duplicated references to form * Fix unnecessary form value updates in `addLocationDialog` - Move reset `method` on `path` change logic from the superfluous `useEffect` to `useCallbackToWatchForm` in `addLocationDialog` - Improve core API debug logs for `dry_run` - Fix incorrect file name for `useCallbackToWatchForm` hook - Improve the documentation for `useCallbackToWatchForm` - Fix `useCallbackToWatchForm` not ignoring callback errors - Fix `useCallbackToWatchForm` ignoring returned Promise from `onWatch` - Add basic validation for the `form` argument in `useCallbackToWatchForm` * Remove superflous if checks - generate new core.ts * Remove DryRunError * Remove unused import --------- Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-04-29 10:49:51 +00:00
export * from './useOperatingSystem';
export * from './useScrolled';
[ENG-1269] Search options (#1561) * search options start * small progress * more * bunch of stuff * semi functioning filters * cleanup setup api * progress * remove filters * hooked up to query epic moment * fix * move db stuff to specific modules * in/notIn for some fields * generate ts * big gains * working filter options for locations, tags and kind * working search query * perfect fixed filters * saved searches lol * merge error * saved searches via api * better routing * [ENG-1338] Fix fresh Spacedrive install failing to start due to attempting to query a nonexistent Library (#1649) Fix Spacedrive failing to start due to attempting to query a nonexistent Library - Rename useShoudRedirect to useRedirectToNewLocations - Improve behaviour for the immedite redirection after adding a new location * Show hidden files false by default (#1652) bool * fix remove filter in list * tweaks * fix nav buttons * unify MediaData search handling * cleanup saved search writing * Add left top bar portals for tags and search + fixed media view on tags * added search to filter dropdown * render cycle improvements * hotfix * wip * Refactor with Brendan, but this is a WIP and the search query no longer works Co-authored-by: Brendan Allan <Brendonovich@users.noreply.github.com> * progress * fix location/$id page * fix tags too Co-authored-by: Brendan Allan <Brendonovich@users.noreply.github.com> * 3rd refactor lol epic style * half-done with enum-ification of SearchFilterArgs * broken fixed filters but working inNotIn filters * search name + extension kinda working * hidden filter * fixed filters working?? * deferred search value * extensions works * filtered search items mostly working * tweaks * stacked approach working for non-search filters * move to Explorer/Search * actually use filterArgs in queries things actually work properly now * added new icons from Mint * goof * cleanup types, filters and mutation logic * actually use search value * remove overview from sidebar * don't shrink LibrariesDropdown ga * remove overview from sidebar and default to /network --------- Co-authored-by: Brendan Allan <brendonovich@outlook.com> Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com> Co-authored-by: Brendan Allan <Brendonovich@users.noreply.github.com>
2023-11-17 06:58:44 +00:00
// export * from './useSearchStore';
export * from './useDragAndDropState';
export * from './useIsLocationIndexing';
export * from './useIsTextTruncated';
export * from './useKeyMatcher';
export * from './useLocale';
export * from './useMouseItemResize';
export * from './usePrefersReducedMotion';
export * from './useRandomInterval';
export * from './useRedirectToNewLocation';
export * from './useRouteTitle';
export * from './useShortcut';
Release landing page (#1464) * start * not for this branch lol * fix dates * fix spacing * revert mistake * progress * blog * improve wording * more blog * more blog moment * moreee blog * cant spell can i * bloggggg * change name * some rambling * sentence meowment * merge * prep * perfect app ui template for landing * updated landing image * fix border * section * fix query param handling * remove apps/snapshot * remove `WindowControls` * Playwright in setup script * `showControls` in a store * better screenshot + fixed stars with fadeout * fix show controls store mistake * begin bento boxes * bento box stuff * taggrid * release blog post: clarifying punctuation & rearrange some sentences (#1097) * landing page wip * Update index.tsx * tweak * Update pnpm-lock.yaml * Update app.webp * better app image + line animation wip * wip * tweak + image * tweaks + 60 fps ball * 60 fps platforms anim * landing updates * static globe * tweaks * device detect and dynamic imports * Accessibility and minor performance improvements from Lh report. * Update globe.webp * Improve randomness of line animation, better cloud image * isMobile vid support * Update index.tsx * new art * docs * docs * Improvements and feedback * Update index.tsx * improvements * quick art tweak * updated art * increase size * SVG animation * animations * convert platforms to arr and framer motion * new section - wip preview * remove border app animation - more animation work * mobile tweaks * tweak * duration adjustment * animation improvements * different floating times for other circles * Pricing page * tweak * optimize images, accessibility values, svg attribute cleanup * launch prep * fix blog link * adding location docs * hover effect * fixes to layout * Update index.tsx * another show controls method * use PageLayoutContext in other file * merge * desktop release download api * update publishing api * hook up desktop releases api to landing page * screenshot stuff * Delete .github/scripts/setup-system.sh * Update october-alpha-release.mdx * rotating screenshots, fixed blog and apple download chooser --------- Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: pr <pineapplerind.info@gmail.com> Co-authored-by: ameer2468 <33054370+ameer2468@users.noreply.github.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-10-11 04:05:40 +00:00
export * from './useShowControls';
export * from './useTheme';
export * from './useWindowSize';
export * from './useWindowState';
export * from './useZodParams';
export * from './useZodRouteParams';
export * from './useZodSearchParams';