Skip to content

Composables ​

All composables live in app/composables/ and are auto-imported — no import statement needed in components or pages. Files follow the useFeatureName.ts naming convention.

Directory Structure ​

composables/
├── api/              # Raw HTTP wrappers ($api calls), one file per resource
├── auth/             # Authentication state and login flow
├── branding/         # White-label branding resolution and application
├── core/
│   ├── common/       # General-purpose, reusable logic
│   ├── components/   # Logic extracted from specific components
│   ├── dialogs/      # Dialog business logic and action dispatchers
│   ├── layouts/      # Layout-level composables
│   └── pages/        # Page-level business logic
├── queries/          # TanStack Vue Query wrappers (cache + mutations)
└── useOrigin.ts      # SSR-safe request origin helper

Two-Layer Pattern ​

API composables own the request shape and expose isLoading / error. Query composables own caching via TanStack Vue Query and are the layer that components should call.

ts
// api/useFolderApi.ts — owns the $api call
export const useFolderApi = () => {
  const { isLoading, error, track } = useApiRequestState()
  const fetchFolders = async (params) => { ... }
  return { fetchFolders: track(fetchFolders), isLoading, error }
}

// queries/useFoldersQuery.ts — owns the TanStack cache
export const useFoldersQuery = (options) => {
  const { fetchFolders } = useFolderApi()
  const query = useQuery({ queryKey: [...], queryFn: () => fetchFolders(params) })
  return { query }
}

// FolderList.vue — calls the queries layer, never api/ directly
const { query } = useFoldersQuery({ sortValue, sortBy })

Some composables follow a cache-aside variant of this pattern: the query composable wraps queryClient.fetchQuery / fetchInfiniteQuery and stores results into a plain writable ref. This is intentional for cases where the UI needs to mutate the local list (drag-reorder, inline edits) without round-tripping the cache.


api/ — HTTP composables ​

Every api/ composable uses useApiRequestState() internally, which provides a shared isLoading computed and error ref, and a track wrapper that manages the pending counter. All returned methods are wrapped with track unless noted.

useApiRequestState.ts ​

Foundation composable consumed by every useXxxApi. Not called directly from components.

ProvidesDescription
isLoadingComputedRef<boolean> — true while any tracked call is in flight
errorRef<unknown> — last caught error, reset on each new call
track(fn)Wraps an async function with loading/error state; rethrows so callers keep their try/catch

Resource API composables ​

FileWhat it providesKey methods
useAnnouncementsApi.tsWorkspace announcements CRUDlistAnnouncements, getAnnouncementUsers, addAnnouncement, updateAnnouncement, deleteAnnouncement
useAssetDetailApi.tsFull detail, metadata, versions, and conversion for a single assetgetAssetDetail, getCustomFields, updateAssetField, updateCustomFields, convertResolution, convertFormat, makeCurrentVersion, deleteVersion
useAssetsApi.tsAsset library operations across the workspacegetRecentUploaded, updateWithField, deleteFile, viewAssetsCountApi, archiveAsset, convertAsset, recordDownloadHistory, makeCurrentVersion, deleteVersion
useBrowserOsApi.tsWraps the /api/browser-os Nitro route for geo + user-agent info (used by the login page)getBrowserOs
useBulkPortalVisibilityApi.tsPer-portal publish coverage for a bulk selection (POST digital-assets/permission/bulk-instance-visibility), used by the bulk portal visibility dialogfetchBulkInstanceVisibility
useCollageDetailsApi.tsInner search and popular filter data for a collage detail pagefetchInnerSearchData, performSearch
useCollectionApi.tsCollage (collection) CRUD — create, rename, delete, paginate, asset managementgetRecentsCollages, updateCollectionName, deleteCollection, getCollectionsByPage, getCollageDetails, loadCollageAssets, addAssetsToCollection, removeAssetsFromCollection, getCollections
useCommonApis.tsShared endpoints used across pagesgetOverviewData, getS3Resource, fetchSubscription, setBranding, checkBranding, getInnerSearchData, getUserProfile, updateUserProfile, getNotificationList
useCustomFieldsApi.tsCustom field definition managementlistCustomFields, createCustomField, updateCustomField, deleteCustomField, reorderCustomFields, toggleCustomFieldStatus
useDamApi.tsLow-level DAM endpoints: storage analytics, recent uploads, ZIP generation, notificationsgetStorageAnalytics, getRecentUploads, generateZip, generateSharedZip, getNotifications
useDamInstanceApi.tsFetches and normalizes the current DAM instance (company name, portal list, storage usage)fetchDamInstance (standalone export, not a composable)
useDamInstanceSettingsApi.tsDAM instance creation and settings — branding, password flows, invitation detailsupdateDamBranding, getWorkspaceDetail, getInstanceDetail, createDamInstance, forgotPassword, generatePassword, generateCommonPassword, getInvitationDetails, getPasswordDetails, resetPassword
useExternalUsersApi.tsExternal user managementlistExternalUsers, addExternalUser, editExternalUser, toggleExternalUserStatus
useFiltersApi.tsFetches and normalizes the full search filter universe into FilterCategory[] and PopularSearchDatagetSearchData, getInnerSearchData
useFolderApi.tsFolder/category CRUD and navigationgetRecentsFolders, deleteFolder, fetchFolders, fetchFolderContent, fetchAssetsWithThrottle, renameFolder, moveFiles, copyFile, moveMultiple
useMembersApi.tsWorkspace member management — list, roles, invite, deletelistMembers, getRoleModules, getUserDetails, checkEmail, deleteUser, revokeUser, resendInvitation, activateUser, resetUserPassword
useNotificationApi.tsUser and org notification preferencesgetUserNotifications, updateUserNotification, getOrgNotifications, updateOrgNotification, pauseWorkspaceNotification
usePasskeyApi.tsWebAuthn passkey management for profile settingsgetPasskeys, getRegisterOptions, registerPasskey, deletePasskey
usePermissionApi.tsContent permission managementfetchPortals, changePermission
usePortalApi.tsPortal (brand portal) CRUD — list, detail, create, settings, branding, visibilitylistPortals, getPortalDetail, createPortal, getInstanceList, updatePortalSettings, updatePortalBranding, updateInstance, updateInstanceSettings, updateWorkspaceBranding, changePortalVisibility, getSubscription, getPortalUsers, getBranding, getWorkspaceDetail
usePortalBannerApi.tsPortal banner managementlistBanners, upsertBanner, deleteBanner, updateBannerOrdering
usePortalTileApi.tsPortal tile managementlistTiles, createTile, upsertTile, deleteTile, updateTileOrder, updateSliderConfig
usePortalUsersApi.tsPortal user lifecycle on the portal detail pageresendInvitation, revokeInvitation, deleteUser, deleteRestoreUser, dealerActivate, updateUser, createUser
usePortalUsersSettingsApi.tsPaginated portal user list and write ops for the settings pagegetPortalUsers, resendInvitation, revokeInvitation, deleteUser, deleteRestoreUser, dealerActivate, updateUser
useRecentSearchApi.tsServer-backed recent search history per usergetRecentSearches, saveRecentSearch
useSearchApi.tsTypesense search via in-app proxy routessearchAssets, searchFolders, searchCollages, searchTags, multiSearch, getPopularSearchData, getSearchResults
useSharedAssetsApi.tsPublic shared asset viewing — authenticate, list, browseshowShareAssets, viewShareFilesWithCategory, getFolderCount, trackShareLinkView, authenticationCheck, searchShareData
useSharingApi.tsShare URL and embed code managementfetchShareUrlsApi, fetchEmbeddedUrlsApi, deleteShareUrlsApi, removeEmbedCodeApi, generateShareAssetsUrl, generateEmbedCode, generateCollectionShareUrl, updateShareUrl
useSsoApi.tsSAML SSO connection, sync, test, activity and sign-in resolve; see Single Sign-OnresolveSso (POST auth/sso/resolve), getConnection, saveConnection, syncConnection (metadata URL), syncConnectionFile (multipart metadata_file), testConnection, getActivity (default page 1, per_page 20), buildRedirectUrl (<apiBaseUrl>/auth/sso/<slug>/redirect?return_host&return_path), withReturnParams
useTagsApi.tsTag operations on single or multiple assetsaddTagsToFilesApi, deleteTagFromFilesApi, getSuggestedTagsApi, getCommonTagListApi
useTrashApi.tsTrash managementfetchTrashItems, permanentDeleteItems, restoreTrashItems
useTypesenseApi.tsLow-level Typesense proxy calls (prefer useSearchApi for typed searches)multiSearch, searchCollection, searchIds
useWorkspaceSettingsApi.tsWorkspace settings CRUDgetWorkspaceDetail, getWorkspaceUsers, updateWorkspaceSettings, updateWorkspaceFavicon, updateWorkspaceLogo, updateDomain, verifyDomain, getSubscription, updateWorkspaceOwner
useZipDownloadApi.tsStreams a zip archive from the external zip-worker service via native fetch (returns raw Response)fetchZipStream

queries/ — TanStack Vue Query composables ​

Query composables sit between the API layer and the UI. They manage caching, invalidation, and pagination. Components call these, not api/ directly.

FileWhat it provides
useAnnouncementsQuery.tsInfinite query for the announcements list
useAssetDetailQuery.tsCache-aside fetch for asset detail and custom fields
useAssetMutations.tsAsset write ops (update field, delete) with cache invalidation for the uncategorized/uploads page
useCollageContentsQuery.tsCache-aside fetch for collage/collection contents
useCollageListMutations.tsCollage list write ops (rename, delete) with cache invalidation
useCollageListQuery.tsInfinite query for the collages library list
useCustomFieldsMutations.tsCustom field write ops (delete, reorder, toggle status) with cache invalidation
useCustomFieldsQuery.tsReactive query for custom field definitions
useDashboardQuery.tsBatched queries for the dashboard — recent collages, recent folders, overview stats, weekly insights
useExternalUsersQuery.tsReactive query for the external users list per workspace and type
useFolderContentsQuery.tsCache-aside fetch for paginated folder contents
useFolderMutations.tsFolder write ops (delete, rename) with cache invalidation
useFoldersQuery.tsReactive query for the folders library list and overview data
useMembersMutations.tsMember write ops (delete, revoke, resend invitation, activate)
useMembersQuery.tsInfinite query for members list; reactive query for role modules and instances
useNotificationsMutations.tsNotification preference write ops (user, org, pause workspace)
useNotificationsQuery.tsCache-aside fetch for user and org notification settings
usePermissionPortalsQuery.tsCache-aside fetch for the portal list used by the permission dialog
usePortalBannersQuery.tsCache-aside fetch for portal banners (writable ref for drag-reorder)
usePortalDetailUsersQuery.tsInfinite query for portal users on the portal detail page
usePortalMutations.tsPortal write ops (updateInstance, updateInstanceSettings, updateWorkspaceBranding, changePortalVisibility); each invalidates queryKeys.portals.list and queryKeys.portals.instanceList for the workspace
usePortalTilesQuery.tsCache-aside fetch for portal tiles (writable ref for drag-reorder)
usePortalUsersSettingsMutations.tsPortal users write ops (resend, revoke, delete, restore, activate, update)
usePortalUsersSettingsQuery.tsInfinite query for the portal users settings list
usePortalsListQuery.tsReactive query for the portals list
useProfileQuery.tsCache-aside fetch for the user profile; reactive query for timezones
useSearchFiltersQuery.tsCache-aside fetch for global, folder-scoped, and collage-scoped filter data
useSharingMutations.tsSharing write ops (delete share URLs, remove embed codes, update share URL)
useSharingQuery.tsInfinite queries for share URLs and embed codes (separate queries, each with sort/filter in the key)
useSubscriptionQuery.tsReactive query for workspace subscription data; shared cache key across all pages that need it
useTrashMutations.tsTrash write ops (permanent delete, restore)
useTrashQuery.tsInfinite query for trash contents (assets + folders per page)
useWorkspaceSettingsQuery.tsCache-aside fetch for workspace detail (page spreads result into mutable form refs)

auth/ — Authentication ​

FileWhat it provides
useAuth.tsCore auth state — user, authToken, isAuthenticated, status (idle / loading / authenticated / unauthenticated / unreachable), isBackendUnreachable, login, logout, fetchUser, retryAuth. SSR-safe; uses useState keyed by NuxtApp instance to prevent race conditions between concurrent middleware. A failed /user call with no status, status 0 or 500+ sets unreachable (token kept, retry backoff 1 s doubling to 30 s with ±20% jitter, snackbar only on the first failure); 401 clears the session. retryAuth() resets the backoff and refetches. logout() posts /logout (or /external-logout for external sessions) with keepalive: true, skipCancel: true and on the client waits at most LOGOUT_WAIT_MS (300 ms) before clearing the session locally.
useAuthCookies.tsCentralised cookie read/write layer for the auth session. Exports AUTH_TOKEN_COOKIE, AUTH_STRATEGY_COOKIE, CURRENT_WORKSPACE_COOKIE constants and a composable with: readToken, readStoredToken (cookie → localStorage fallback), readStrategy, readWorkspace, writeSession (writes token + strategy with correct max-age per strategy), writeWorkspace (merges into stored value to preserve module data), clearSessionCookies (nulls workspace and all stale-session cookies on logout/401).
useAuthGuard.tsThin wrapper for pages that need the auth state: returns user, status, isBackendUnreachable from useAuth() and unresolvedUserResult() (navigateTo('/', { replace: true })).

branding/ — White-label branding ​

FileWhat it provides
useBrand.tsResolves the white-label brand for the current host — logo, favicon, brand name, tagline, colors, support email. Returns a brand computed ref. Handles SSR origin detection via X-Forwarded-Proto/Host.
useBrandingHead.tsDrives document <head> (title, Open Graph meta, favicon) reactively from the resolved brand. Suppresses host-brand assets on /shared-assets routes to avoid leaking the host workspace's logo onto shared links.
useBrandingTheme.tsApplies white-label primary_color / secondary_color to the active Vuetify light theme at runtime. Call once from the main layout setup. Only writes valid hex values.

core/common/ — General-purpose utilities ​

FileWhat it provides
useAmplitude.tsAmplitude analytics — trackActivity, trackViewModeChange, selectionMethodFor, cascadeSize. Manages shared selection-method and last-sent-view-mode state.
useAmplitudeAssetTracking.tsAsset-specific Amplitude events — trackImageEditor, trackCustomFieldChange.
useAmplitudeSearchTracking.tsSearch-specific Amplitude events — trackSearchPerformed, trackSearchResultClicked, trackFilterApplied. Debounces duplicate search events.
useAssetFile.tsReactive computeds from a file ref — fileExt, fileUrl, fileThumb, isImage, isVideo, isPdf, isAudio, isDoc, fileTypeIconUrl.
useChipTruncation.tsuseChipTruncation(items) — per-chip truncated flags (scrollWidth > clientWidth + 1 on the chip's .v-chip__content), re-measured after mount, when items change and when the Vuetify display width changes. Bind each chip with setChipEl(el, index).
useCommonFunction.tsDeprecated. Shim that delegates to useTransactionActivity. Use useTransactionActivity in new code.
useCsrf.tsCSRF token management — fetches the XSRF-TOKEN cookie from /api/csrf-token and exposes csrfToken. The login page (pages/index.vue) starts fetchCsrfToken() in parallel with verifyDomain() (Promise.all) instead of one after the other.
useDamNavigation.tsCentralized DAM route navigation with analytics dispatch and new-tab support. Accepts NavigationOptions including analytics context, query params, and hash.
useDayjs.tsReturns the dayjs instance.
useDragReorder.tsGeneric drag-to-reorder for any list or grid. Exposes draggingIndex, dragOverIndex, startDrag, bindRow.
useDraggableBar.tsDrag-to-reposition for the floating bulk-action bar. Clamps to viewport; ignores drags starting on .v-btn / .v-chip.
useErrorHandler.tsCentralized error handler — handleError(e, options). Sanitizes messages, logs, optionally shows snackbar, optionally rethrows.
useFilterOptionPaging.tsClient-side paging for long filter option lists: shows FILTER_OPTION_PAGE_SIZE (50) more items each time the list is scrolled past 85%; reset() (also run when the item count changes) returns to the first page and scrolls to top. Returns visible, hasMore, total, loadMore, reset, onScroll.
useHelpers.tsLarge utility bag consumed across the app. Includes workspace access checks, role/permission helpers (including canManageSsoSettings(workspace) = is_owner === true and isSsoAllowed(workspace) = sso_allowed === true), file-type predicates (isImage, isVideo, etc.), formatting helpers, and getWorkspaceId.
useImageStyle.tsAsset display helpers — getFileTypeIconUrl, getThumbnailStyle, getObjectFit, dimension computeds. Exports DEFAULT_ICON_TYPES set.
useInsightsChart.tsShared Chart.js config and bar_data builder for the "Last 7 Days" weekly-insights bar chart. Used by the dashboard and asset detail pages so both charts stay identical.
useMarqueeSelection.tsMouse marquee (rubber-band) selection for asset grids. Supports grid, list, and mosaic selectors.
useMittBus.tsReturns the global mitt EventBus instance from the Nuxt plugin.
usePwaSettings.tsReturns the PWA settings from runtimeConfig.public.pwa as a typed PwaSettings object. Not reactive — returns the static config value at call time. Used by PWA-aware components and layouts to read manifest and service-worker config.
useSearchEventBus.tsTyped search EventBus (mitt) with auto-cleanup on component unmount. Exposes typed on, off, emit for SearchEvents.
useSearchExecution.tsGeneric pagination/loading state machine for in-page Typesense searches. Accepts buildPayload, runSearch, mapHits, getTotal.
useSearchFilterEnrich.tsResolves and validates URL-restored filters against loaded filter pools. Strips invalid entries; resolves name stubs and custom-field label slugs to IDs.
useSearchFilterPool.tsReorders a filter pool to pin selected items to the top without mutating the input array.
useSearchFilterUrl.tsSerializes and deserializes applied filters to/from URL query params. Returns ParsedFilterQuery.
useSearchMethods.tsStateless filter-builder helpers for constructing Typesense filter_by strings.
useSnackbar.tsSnackbar facade over the client-only $snackbar plugin. Methods are no-ops on the server. Exposes success(message, timeout?), error(message, timeout?), info, warning.
useSortPreference.tsPersists sort field and direction per context identifier to cookies (sortValue_<id> / sortDirection_<id>). SSR-safe via useCookie. Exposes: getCachedSort() → CachedSortPreference | null, setCachedSort(field, direction) to write, and getCachedSortWithDefault(defaultField, defaultDirection) which falls back to provided defaults when no cached value exists.
useTagSearchLink.tstagSearchLink(tagName) builds /<workspace>/dam/search?tags=<name>&tags_op=all&tab=assets through serializeFiltersToQuery (filter tags / include-all-of, the same operator brand-portal uses). Returns '' for an empty tag or missing workspace.
useThumbnailSize.tsPersists grid thumbnail size (xsmall–xlarge) per context identifier in a cookie. SSR-safe.
useToggleSelection.tsShift-click range selection and select-all for asset lists. Operates on the caller's reactive list ref.
useTransactionActivity.tsCentralized analytics/transaction dispatch. Provides trackAsset, trackFolder, trackCollage, and generic dispatchTransaction. Fetches browser OS and location once per session. Retries and queue flushes dispatch with skipDeduplication: true, so a retried or queued event is not dropped as a duplicate of itself; the asset preview also sends views with skipDeduplication: true.
useTypesenseClient.tsTypesense collection names (COLLECTION_NAMES), default search params (DEFAULT_COMMON_PARAMS), and sort-field mapping (SORT_FIELD_MAP).
useUploadCommon.tsShared upload logic — file chunking, S3 multipart via Nitro routes, auto-tag trigger, transaction dispatch on completion.
useUploadQueue.tsConcurrency-limited upload task queue. Module-scoped singleton (default 5 concurrent). Exposes scheduleUploadTask, processQueue, resetQueue.
useViewMode.tsPersists grid / list / mosaic view mode per context identifier in a cookie. SSR-safe via useState.
useViewportFill.tsInfinite scroll helper — calls loadMore repeatedly until the scroll container is taller than the viewport or a max-attempts limit is hit.
useWorkspaceId.tsResolves the current workspace ID from route params, the currentWorkspace cookie, or the auth user. Exposes workspaceId, getWorkspaceId, isValidWorkspaceId, hasWorkspaceAccess.
useWorkspaceUniqueId.tsResolves the workspace_unique_id (Typesense tenant key) for the current workspace from the user's accessible workspaces list.
useZipShot.tsGenerates a PNG preview thumbnail of a ZIP archive's contents via the /api/zip-viewer/extract Nitro route.

core/components/ — Component-level logic ​

These composables are extracted from components that had enough logic to warrant separation. Each is tied to a specific component.

FileWhat it provides
useAccountSettingsLeftMenu.tsAccount settings sidebar — menu items, active route detection, navigation helpers. Includes a Single Sign-On entry (ROUTE_WORKSPACE_SETTINGS_SSO, also active on the SSO setup route), shown via canManageSsoSettings / isSsoAllowed.
useAssetCard.tsAsset grid/list card — context menu, selection, download, analytics dispatch. With externalPreview, handleExpandAsset emits expand (the page opens the Asset Preview Lightbox) instead of opening the quick-view dialog.
useAssetContainer.tsAsset preview container — resolves display file, handles image editor integration, manages preview state. isTransparentImage is true for png, svg, gif.
useAssetImageOverlay.tsImage card overlay — selection checkbox state, screen-size breakpoints (isLargeScreen, isSmallScreen).
useAssetMenu.tsAsset context-menu builder for the search results "Assets" tab. Returns a DamMenuItem[] array.
useAssetVersionItem.tsAsset version list item — download, make-current, delete version actions.
useAssetVideoOverlay.tsVideo card overlay — selection checkbox state, screen-size breakpoints.
useBreadCrumbs.tsBreadcrumb trail navigation for folders and collages. Handles share-link context and loading state.
useCollageCard.tsCollage grid card — inline rename, context menu, permission check, download.
useCollageMenu.tsCollage context-menu builder shared by the Collages page and search "Collages" tab.
useDamListRow.tsDAM list-view row — exports DAM_LIST_DEFAULT_COLUMNS, thumbnail size constant, and row display helpers.
useDamNotification.tsIn-app notification panel — badge count, notification list, Laravel Echo event handling.
useEmbedTableListItem.tsEmbed code table row — thumbnail resolution, copy-to-clipboard action.
useFolderCard.tsFolder grid card — context menu, permission check, selection.
useFolderMenu.tsFolder context-menu builder shared by the Folders page and search "Folders" tab.
useHeaderSearch.tsTop-bar header search dropdown — multi-collection preview (assets/folders/collages/tags), debounced query, navigate to search page on submit.
useImageEditActions.tsAsset detail image editor sidebar — crop preset groups, export format selection, apply/cancel crop.
usePdfPreview.tspdf.js viewer state for PDF previews: lazy-loads pdfjs-dist and its worker once, zoom 0.5–3 in 0.25 steps, rotation in 90° steps, fit to width (default) or page (pages at least 2.4× taller than wide open fit-to-page), page thumbnails 150 px wide, canvas size capped by the device WebGL MAX_TEXTURE_SIZE (2048–4096 px, at most 16,777,216 pixels). Returns render/cancel helpers, page navigation, sidebar toggle and zoom/rotate/fit actions.
usePortalBanners.tsPortal banner list management in the portal detail page — fetch, upsert, delete, drag-reorder.
usePortalBrandingTab.tsPortal branding form — brand name, colors, domain URL, public portal toggle, CNAME management.
usePortalTiles.tsPortal tile list management in the portal detail page — fetch, upsert, delete, drag-reorder, slider config.
useRecentSearches.tsServer-backed recent search history. Module-scoped singleton so the header bar and search page share one list.
useSearchAssets.tsAssets tab — Typesense search with infinite scroll, per-page windowing, scope support (global / folder / collage / shared).
useSearchBar.tsSearch bar input — debounced query ref, debouncedQuery, isFocused, browse history helpers.
useSearchCollages.tsCollages tab — Typesense search with independent pagination from the assets tab.
useSearchFilter.tsFilter state machine — loads categories and popular data, manages appliedFilters, syncs with URL query params.
useSearchFolders.tsFolders tab — Typesense search with independent pagination from the assets tab.
useShareTableListItem.tsShare URL table row — custom domain resolution, thumbnail, copy-to-clipboard.
useTagsBox.tsAsset tags input — tag suggestions via API, common tags list, add/remove tag operations.

core/dialogs/ — Dialog business logic ​

These composables power dialog components and action dispatchers that open dialogs via the dialog store.

FileWhat it provides
useAddEditBannerDialog.tsAdd/edit portal banner dialog — form state, image crop via getCropBlob, submit to usePortalBannerApi.
useAddEditTileDialog.tsAdd/edit portal tile dialog — form state, image crop, submit to usePortalTileApi.
useAddMultipleTags.tsBulk tag dialog — tag suggestions, add tags to multiple selected assets.
useAdvanceShareDialog.tsAdvanced share settings dialog — expiry date, password protection, link management.
useAssetActions.tsAsset action dispatcher — opens rename/delete dialogs via dialog store, emits mitt bus events for list updates.
useAssetPreview.tsOpens the Asset Preview Lightbox: openFromAsset(asset, allAssets, paging?), openFromSelection(selected, startAsset?, paging?) (snapshot; no-op when empty), close, selectedAssetsFrom, bulk-bar item builder createBulkActionItem(disabled) (key: 'preview', tooltip Only applicable for assets) and trackView(asset) (transaction + Amplitude + view count).
useAssetPreviewGestures.tsLightbox stage swipe, thumbnail-strip drag / wheel and neighbour preload (videos: thumbnail or preview image; others: compress, display, thumbnail, preview image). Returns isDragging.
useAssetPreviewNavigation.tsLightbox index, previous/next rules with pending page loads, position counter, prefetch at 60% (DEFAULT_PREFETCH_RATIO), arrow keys (ignored in inputs and media elements).
useAssetPreviewPager.tsLightbox page loader: head pages forward from the page already loaded, tail pages backward from the last page, de-duplicated by id; pauses auto-loading after an error.
useAssetQuickViewDialog.tsAsset quick-view dialog — inline preview, download, add-to-collage, tag editing.
useBulkPortalVisibilityDialog.tsPublish / unpublish assets, folders or collages to portals. Loads portals and, for assets and folders, per-portal coverage (none / partial / all, shown as <n> of <total>); each portal row stages publish or unpublish. Save sends one changePermission call per permission group (visibility 0 with instance_ids, else 1; folders add nested_apply), patches the asset/folder/collage caches, emits visibility-updated, then tracks permission-updated transactions and Amplitude visibility changes. Requires the matching subscription features (public_and_private_asset_customisation, folder_permission_customisation, collection_permission_customisation). On a failed group it reports what was applied, shows the error and reloads.
useCollageActions.tsCollage action dispatcher — opens rename/delete dialogs via dialog store, emits collage events.
useCreateOrRenameDialog.tsCreate/rename folder or collage dialog — form state, validation, API call.
useCreatePortalDialog.tsCreate new portal dialog — form state, domain/subdomain toggle, validation, submit.
useFileConversionDialog.tsDownload / format conversion dialog — resolution options, format selector. Pure UI; API calls emitted to parent.
useFolderActions.tsFolder action dispatcher — opens create/rename/delete dialogs, emits mitt bus events.
useFolderDialog.tsFolder tree picker dialog — Typesense-backed folder search, select destination for move/copy.
useSaveToCollage.ts"Save to Collage" dialog — debounced collage search, queued add operations, emits update event.
useShareAssetDialog.tsShare asset/folder/collage dialog — generates share URLs and embed codes, copy helpers.
useUserDialog.tsWorkspace member dialog — create/edit member with workspace and role assignment.

core/layouts/ — Layout composables ​

FileWhat it provides
useCollageErrorLayout.tsError layout side-effects: removes stale Vuetify overlays on mount; for unauthenticated users starts a 5-second countdown (redirectSecondsLeft) and then window.location.replace('/'), except for domain/branding errors (404 on / or with domain / not found / access denied messages, 402, 403) and a session-expired 401 on /, which would loop.
useCollageLayout.tsMain layout computeds — currentWorkspace, canUpload, storageFull. Also exposes upload and drag-drop helpers.
useCollageSidebar.tsSidebar nav — workspace switcher, primary menu items, create-new items, portal links, logout. profileMenuOpen is closed before logout; the sidebar treats window.innerWidth <= 1199 or max-width: 600px as mobile.
useSidebarMiniState.tsShared mini boolean that collapses the sidebar on detail routes (asset, folder, settings pages).

core/useSearchOverlay.ts ​

Module-scoped singleton isSearchOpen ref that controls the fullscreen search overlay. Both the header trigger button and the overlay itself call this composable.


core/pages/ — Page-level business logic ​

These composables are the single source of truth for each page's state, data fetching, and user action handling.

FileWhat it provides
useAddDamInstance.tsAdd DAM instance page — form state, domain/subdomain toggle, validation, submit.
useAnnouncementsPage.tsAnnouncements settings page — TanStack-backed list, delete, type filter, sort.
useAssetDetail.tsAsset detail page — full state management: asset data, versions, tags, custom fields, download, conversion, analytics.
useAssetDetailTags.tsTag management sub-composable for the asset detail page — add/remove tags for a single asset.
useCollage.tsCollages library page — list state, sort, delete/rename/share/permission dialogs. useCollage({ withList: false }) reuses the actions without running the list query (useCollageListQuery({ enabled })).
useCollageDetails.tsCollage detail page — inner search, file list, selection, bulk operations, pagination. fetchSearchPage(page) runs one inner-search page and maps the hits; the Asset Preview Lightbox uses it to page search results.
useCustomFieldCounts.tsAsset counts per custom field on the custom fields settings page, cached per workspace in localStorage. Fetches 1 field first (probe), then 5 at a time; revalidates every field once per page load; stops when the route changes or the throttle epoch changes; disables itself if the count endpoint answers 404, 405 or 501. Returns fieldCounts, countsPendingIds, isCountEndpointAvailable, fetchCountsForFields, invalidateCounts.
useCustomFieldsPage.tsCustom fields settings page — TanStack-backed list, delete, reorder, toggle status.
useDashboard.tsDashboard page — recent collages/folders, overview stats, weekly insights chart, quick-action routes.
useExternalUsersPage.tsExternal users settings page — TanStack-backed list, add, edit, toggle status.
useFolderDetail.tsFolder detail page — inner search, file list, selection, bulk operations, upload integration.
useFolders.tsFolders library page — folder list, sort, delete/move/rename with analytics. useFolders({ withList: false }) skips the list query (useFoldersQuery({ enabled })).
useMembersPage.tsMembers settings page — TanStack-backed list, roles, invite, delete, revoke. ssoAllowed (isSsoAllowed for the current workspace) drives the sign-in method column.
useNotificationSettings.tsNotification settings page — user and org preference management, subscription feature checks.
usePortalDetail.tsPortal detail page — settings tabs (branding, users, banners, tiles), subscription limits.
usePortalUsersPageSettings.tsPortal users settings page — TanStack-backed list, invite dialog, filter by user type.
usePortalsList.tsPortals list page — TanStack-backed list, create, subscription limit check.
useProfilePage.tsProfile settings page — personal info form, default workspace, passkey (WebAuthn) registration/deletion, timezone.
useSearchResultsPage.tsSearch results page — coordinates useSearchAssets, useSearchFolders, useSearchCollages, useSearchFilter; handles URL sync and Amplitude tracking.
useSharedAssetsPage.tsPublic shared assets page — password authentication, asset browsing, download, breadcrumb navigation.
useSharing.tsSharing page — TanStack-backed share URLs and embed codes lists, sort, filter, bulk delete.
useSsoProviderChoice.tsRemembers the identity provider picked in the SSO setup wizard in localStorage (sso-provider-choice:<workspace_id>:<user_id>). Returns selectedProvider, selectProvider, focusProviderAt.
useSsoProviderDetails.tsProvider-specific setup values for the SSO wizard and summary: SP values, provider values, synced summary, copy-to-clipboard (copiedField resets after 1.4 s). App name is Collage, or the white-label brand name (the app when unnamed).
useSsoSettingsPage.tsSSO settings page: setup steps, edit mode, metadata sync by URL or file (then polls every 3 s for up to 60 s), test, allowed domains (validated with /^(?!-)[a-z0-9-]+(\.[a-z0-9-]+)+$/i), enable toggle, save, and sign-in activity (20 per page). Defaults: recheck_days 7, stale_days 30. See Single Sign-On.
useTrashPage.tsTrash page — TanStack-backed list, bulk select, permanent delete, restore.
useUploadedPage.tsRecent uploads ("Uncategorized") page — paginated list, inline edit, custom fields.
useWorkspaceSettings.tsWorkspace settings page — detail form, domain management, favicon/logo upload, subscription display.

Root level ​

FileWhat it provides
useOrigin.tsReturns the current request origin as a string. SSR-safe — honors X-Forwarded-Proto and X-Forwarded-Host headers so the origin reflects the public-facing URL, not the reverse proxy's internal scheme. Fallback: runtimeConfig.public.baseUrl.