Refactor date group actions from Svelte component to TypeScript class

• Convert asset-date-group-actions.svelte to date-group-actions-lib.svelte.ts class
• Remove complex prop binding between asset-grid-without-scrubber and asset-date-group
• Use class instance in asset-date-group with direct method access
This commit is contained in:
midzelis 2025-08-14 20:16:22 +00:00
parent 0beeea6985
commit 9a30198238
4 changed files with 220 additions and 245 deletions

View file

@ -2,7 +2,6 @@
import { afterNavigate, beforeNavigate } from '$app/navigation';
import { page } from '$app/stores';
import { resizeObserver, type OnResizeCallback } from '$lib/actions/resize-observer';
import AssetDateGroupActions from '$lib/components/photos-page/asset-date-group-actions.svelte';
import AssetGridActions from '$lib/components/photos-page/asset-grid-actions.svelte';
import AssetViewerAndActions from '$lib/components/photos-page/asset-viewer-and-actions.svelte';
import Skeleton from '$lib/components/photos-page/skeleton.svelte';
@ -75,7 +74,7 @@
album = null,
person = null,
isShowDeleteConfirmation = $bindable(false),
onSelect = () => {},
onSelect = (asset: TimelineAsset) => void 0,
onEscape = () => {},
children,
empty,
@ -278,16 +277,6 @@
let onSelectAssetCandidates = <(asset: TimelineAsset | null) => void>$state();
</script>
<AssetDateGroupActions
{timelineManager}
{assetInteraction}
handleScrollTop={scrollTop}
{onSelect}
bind:onDateGroupSelect
bind:onSelectAssets
bind:onSelectAssetCandidates
></AssetDateGroupActions>
<AssetGridActions {scrollToAsset} {timelineManager} {assetInteraction} bind:isShowDeleteConfirmation {onEscape}
></AssetGridActions>
@ -356,9 +345,8 @@
{isSelectionMode}
{singleSelect}
{monthGroup}
onSelect={onDateGroupSelect}
{onSelectAssetCandidates}
{onSelectAssets}
{onSelect}
{scrollTop}
onScrollCompensation={handleScrollCompensation}
{customLayout}
{onThumbnailClick}