Files
Modrinth-plus/packages/assets/index.ts
Calum H. 7d92e4ec7f feat: content tab rewrite for worlds (#5136)
* feat: base content card component

* fix: tooltips + colors

* feat: fix orgs

* feat: base content tab internals rewrite

* feat: fix invalidmodal

* feat: add ContentModpackCard

* fix: extract types

* draft: layout

* feat: unlink modal

* feat: impl content tab

* fix: lint

* fix: toggling

* temp: disable updating stuff

* feat: selection v-model

* feat: bulk selection

* feat: mods tab rough draft

* feat: use fuse.js

* feat: add project combobox

* clean up project combobox

* feat: start install to play modal

* fix: events

* feat: use v-on

* feat: bulk actions + fix floating action bar width

* feat: figma alignments

* feat: migrate toggle to tailwind

* fix: row borders

* feat: disabled state

* feat: virtual list impl for card table based on window scroll

* fix: lint

* feat: virtualization + smaller contentcard items

* feat: use ContentCardTable + ContentCardItems

* feat: fix gap + border issues on last elm

* feat: cleanup + use proper searching

* fix: use TeleportOverflowMenu

* fix: fallback to svg if src is invalid on avatar component

* fix: storybook

* feat: start on updater modal

* feat: finish content updater modal

* feat: i18n pass

* feat: impl modal

* feat(app): backend changes for content tab refactor (#5237)

* feat: include_changelog=false for updater modal

* fix: hash overrides

* feat: update checking for modpack

* feat: qa

* feat: modpack content modal

* fix: padding in table to match modals + tightness

* fix: lint

* feat: delete modal

* feat: fix toggle bugs

* fix: prepr

* fix: duplicate messages

* qa: full width search

* qa: use bg-surface-1.5

* qa: animation for filter pills

* qa: standardize hover colors

* fix: border-[1px] is border

* qa: mass de-select actually mass selecting

* qa: match figma designs for floating action bar

* qa: modal fixes

* q: modal fixes x2

* fix: table border

* qa: confirm modals

* qa: modal alignment

* qa: re-add stuck heading + dedupe logic

* qa: dedupe virtual scrolling + remove dead components

* qa: responsiveness for content table + link fixes

* qa: version column link, tooltips + lint fixes

* qa: instance busy protections

* fix: installation freeze bug

* chore: remove old mods page

* refactor: deduplicate layout

* chore: delete old content page(s)

* qa

* qa

* qa

* feat: sort btn - to iterate

* fix: ml

* feat: date added

* fix: lint

* fix: formatting.ts removal

* feat: get_dependencies_as_content_items

* qa: final QA changes

* refactor: deduplicate + polish content.rs

* feat: hook up content.vue with v1

* feat: hide v1 content api behind frontend feature flag

* fix: query keys + copy on empty state

* chore: i18n pass

* feat: reimpl unlink + upload endpoint

* feat: use bulk endpoints v1

* fix: lint

* fix: flags

* fix: responsiveness via container queries

* fix: lint

* qa: 1

* qa: fixes

* qa: fix ssr issues with browse content

* qa: header page divider

* qa: modals

* fix: prepr

* fix: issues

* fix: lint

* fix: toggle v1 ff

* qa: 5

* qa: delete modal copy

* feat: creation flow modals (#5383)

* refactor: delete content v0 usages + impl

* feat: qa + fixes

* feat: installing banner using state event

* feat: fix modpack card bugs + filtering issues

* refactor: delete backups v0 api module

* feat: v1 servers GET endpoint

* fix: backups

* feat: swap to kyros upload v1 addon

* fix: use tanstack for loader.vue

* feat: finish install from discovery modal

* qa: bug fixes

* feat: set up installation settings

* fix: lint

* fix: typos

* fix: bugs

* fix: disable inline content

* feat: content tab improvements — upload UX, installation settings, and client-only indicators

   Upload cancellation and navigation guard:
   - Add ConfirmLeaveModal that prompts when navigating away during upload
   - Cancel in-flight XHR uploads when user confirms leaving the page
   - Add beforeunload handler to warn on browser/tab close during upload
   - Track uploadedBytes/totalBytes in UploadState for progress display
   - Replace Collapsible with Transition for upload progress admonition
   - Show byte progress and percentage in upload banner
   - Clamp upload progress to prevent exceeding 100%

   Installation settings (server.properties):
   - Add KnownPropertiesFields and PropertiesFields types to Archon types
   - Add buildProperties() to creation flow context to collect gamemode,
     difficulty, seed, world type, structures, and generator settings
   - Pass properties through installContent on onboarding, discovery, and
     ServerSetupModal flows

   Server setup and discovery flow improvements:
   - Migrate ServerSetupModal from servers_v0.reinstall to content_v1.installContent
   - Replace loaderApiNames lookup with toApiLoader() helper
   - Remove eraseDataOnInstall toggle — always use soft_override: false
   - Simplify modpack install on discovery page to use first available version
     and route through creation flow modal for both onboarding and non-onboarding
   - Differentiate post-install navigation: content page for onboarding,
     loader options for existing servers

   Modpack update flow:
   - Replace updateModpack() call with installContent() using soft_override: true
     to support version selection in the content updater modal

   Client-only mod indicators:
   - Add environment field to AddonVersion (reuses Labrinth.Projects.v3.Environment)
   - Add environment to ContentItem and isClientOnly to ContentCardTableItem
   - Show orange TriangleAlertIcon with tooltip on client-only mods in content table
   - Add "Client-only" filter pill to content filtering (controlled via
     showClientOnlyFilter on ContentManagerContext)
   - Apply client-only indicators in both ContentPageLayout and ModpackContentModal

   Misc:
   - Add CLAUDE.md note about using prepr commands for lint checks
   - Export ConfirmLeaveModal from instances barrel

* fix: piping

* fix: switch content disable for linked server instances

* feat: client only filter

* fix: prepr

* feat: hasUpdate shape update

* feat: bulk update endpoint impl for content in panel

* feat: websocket state impl again with new phases

* fix: ws

* fix: use timeout fn for sync admon + fix content card layout scroll for browsers with overflow anchor bug

* fix: qa bugs

* fix: lint, a11y and i18n

* refactor: set up layouts folder properly

* fix: linked data cache stuff + lint

* feat: move installationsettings to shared layout

* fix: lint

* fix: issues

* feat: temp fuck staging up

* fix: lockfile

* fix: data sync issues on loader.vue

* fix: lint

* Hide shader configuration files from content list (#5499)

* feat: workaround search problem + split out reset

* fix: qa

* fix: changelog not showing on first open

* fix: qa + optimistic updating improvements

* fix: prepr+lint

* fix: qa

* feat: qa

* fix: lint

* fix: lint

* fix: build

* fix: build

* fix: type errors

* fix: fade and JAVA_HOME passthrough

* feat: qa

* feat: impl diff shit

* fix: qa

* fix: app qa

* feat: update diff modal

* fix: endpoint

* fix: qa

* fix: qa

* fix: use bulk in modpack modal

* feat: abort signal impl + fix issues

* fix: diff modal trunc

* feat: qa

* fix: qa

* feat: tooltip content tab

* fix: prepr

* fix: dismiss on settings btn

* feat: qa

* feat: dont clear handlers on disconnect

* fix: lint

* fix: wrangler + introduce staging-archon env file

---------

Signed-off-by: Calum H. <calum@modrinth.com>
Co-authored-by: tdgao <mr.trumgao@gmail.com>
Co-authored-by: Artyom Ezri <61311568+Artezon@users.noreply.github.com>
2026-03-12 13:24:32 -07:00

225 lines
9.8 KiB
TypeScript

/**
* NOTE: You should re-export any manually added icons
* using consts to help TypeScript resolve the proper type
*
* NOTE: If an icon is part of the lucide icon set, it should be placed in the "icons" folder
* and automatically generated through the "pnpm run fix" command.
*/
import './omorphia.scss'
import _FourOhFourNotFound from './branding/404.svg?component'
// Branding
import _BrowserWindowSuccessIllustration from './branding/illustrations/browser-window-success.svg?component'
import _ModrinthIcon from './branding/logo.svg?component'
import _ModrinthPlusIcon from './branding/modrinth-plus.svg?component'
import _AngryRinthbot from './branding/rinthbot/angry.webp'
import _AnnoyedRinthbot from './branding/rinthbot/annoyed.webp'
import _ConfusedRinthbot from './branding/rinthbot/confused.webp'
import _ExcitedRinthbot from './branding/rinthbot/excited.webp'
import _LaughingRinthbot from './branding/rinthbot/laughing.webp'
import _SadRinthbot from './branding/rinthbot/sad.webp'
import _SleepingRinthbot from './branding/rinthbot/sleeping.webp'
import _SobbingRinthbot from './branding/rinthbot/sobbing.webp'
import _ThinkingRinthbot from './branding/rinthbot/thinking.webp'
import _WavingRinthbot from './branding/rinthbot/waving.webp'
// External Icons
import _AppleIcon from './external/apple.svg?component'
import _BlueskyIcon from './external/bluesky.svg?component'
import _BuyMeACoffeeIcon from './external/bmac.svg?component'
import _DiscordColorIcon from './external/color/discord.svg?component'
import _GitHubColorIcon from './external/color/github.svg?component'
import _GitLabColorIcon from './external/color/gitlab.svg?component'
import _GoogleColorIcon from './external/color/google.svg?component'
import _MicrosoftColorIcon from './external/color/microsoft.svg?component'
import _PayPalColorIcon from './external/color/paypal.svg?component'
import _SteamColorIcon from './external/color/steam.svg?component'
import _USDCColorIcon from './external/color/usdc.svg?component'
import _VenmoColorIcon from './external/color/venmo.svg?component'
import _CurseForgeIcon from './external/curseforge.svg?component'
import _DiscordIcon from './external/discord.svg?component'
import _FacebookIcon from './external/facebook.svg?component'
import _FlathubIcon from './external/flathub.svg?component'
import _GithubIcon from './external/github.svg?component'
import _MinecraftServerIcon from './external/illustrations/minecraft_server_icon.png?url'
import _InstagramIcon from './external/instagram.svg?component'
import _KoFiIcon from './external/kofi.svg?component'
import _MastodonIcon from './external/mastodon.svg?component'
import _OpenCollectiveIcon from './external/opencollective.svg?component'
import _PatreonIcon from './external/patreon.svg?component'
import _PayPalIcon from './external/paypal.svg?component'
import _PolygonIcon from './external/polygon.svg?component'
import _RedditIcon from './external/reddit.svg?component'
import _ReelsIcon from './external/reels.svg?component'
import _SnapchatIcon from './external/snapchat.svg?component'
import _ThreadsIcon from './external/threads.svg?component'
import _TikTokIcon from './external/tiktok.svg?component'
import _TumblrIcon from './external/tumblr.svg?component'
import _TwitchIcon from './external/twitch.svg?component'
import _TwitterIcon from './external/twitter.svg?component'
import _VenmoIcon from './external/venmo.svg?component'
import _VisaIcon from './external/visa.svg?component'
import _WindowsIcon from './external/windows.svg?component'
import _YouTubeIcon from './external/youtube.svg?component'
import _YouTubeGaming from './external/youtubegaming.svg?component'
import _YouTubeShortsIcon from './external/youtubeshorts.svg?component'
// Tag icon helpers - import maps from generated-icons
import type { IconComponent } from './generated-icons'
import { categoryIconMap, loaderIconMap } from './generated-icons'
import _DoneIllustration from './illustrations/done.svg?component'
import _EmptyIllustration from './illustrations/empty.svg?component'
import _EmptyInboxIllustration from './illustrations/empty-inbox.svg?component'
import _ErrorIllustration from './illustrations/error.svg?component'
import _NoConnectionIllustration from './illustrations/no-connection.svg?component'
import _NoCreditCardIllustration from './illustrations/no-credit-card.svg?component'
import _NoDocumentsIllustration from './illustrations/no-documents.svg?component'
import _NoGPSIllustration from './illustrations/no-gps.svg?component'
import _NoImagesIllustration from './illustrations/no-images.svg?component'
import _NoItemsCartIllustration from './illustrations/no-items-cart.svg?component'
import _NoMessagesIllustration from './illustrations/no-messages.svg?component'
import _NoSearchResultIllustration from './illustrations/no-search-result.svg?component'
import _NoTasksIllustration from './illustrations/no-tasks.svg?component'
export const ModrinthIcon = _ModrinthIcon
export const BrowserWindowSuccessIllustration = _BrowserWindowSuccessIllustration
export const FourOhFourNotFound = _FourOhFourNotFound
export const ModrinthPlusIcon = _ModrinthPlusIcon
export const AngryRinthbot = _AngryRinthbot
export const AnnoyedRinthbot = _AnnoyedRinthbot
export const ConfusedRinthbot = _ConfusedRinthbot
export const ExcitedRinthbot = _ExcitedRinthbot
export const LaughingRinthbot = _LaughingRinthbot
export const SadRinthbot = _SadRinthbot
export const SleepingRinthbot = _SleepingRinthbot
export const SobbingRinthbot = _SobbingRinthbot
export const ThinkingRinthbot = _ThinkingRinthbot
export const WavingRinthbot = _WavingRinthbot
export const PayPalColorIcon = _PayPalColorIcon
export const VenmoColorIcon = _VenmoColorIcon
export const DiscordColorIcon = _DiscordColorIcon
export const GitHubColorIcon = _GitHubColorIcon
export const GitLabColorIcon = _GitLabColorIcon
export const GoogleColorIcon = _GoogleColorIcon
export const MicrosoftColorIcon = _MicrosoftColorIcon
export const SteamColorIcon = _SteamColorIcon
export const AppleIcon = _AppleIcon
export const BlueskyIcon = _BlueskyIcon
export const BuyMeACoffeeIcon = _BuyMeACoffeeIcon
export const GithubIcon = _GithubIcon
export const CurseForgeIcon = _CurseForgeIcon
export const DiscordIcon = _DiscordIcon
export const FacebookIcon = _FacebookIcon
export const FlathubIcon = _FlathubIcon
export const InstagramIcon = _InstagramIcon
export const SnapchatIcon = _SnapchatIcon
export const ReelsIcon = _ReelsIcon
export const TikTokIcon = _TikTokIcon
export const TwitchIcon = _TwitchIcon
export const ThreadsIcon = _ThreadsIcon
export const KoFiIcon = _KoFiIcon
export const MastodonIcon = _MastodonIcon
export const OpenCollectiveIcon = _OpenCollectiveIcon
export const PatreonIcon = _PatreonIcon
export const PayPalIcon = _PayPalIcon
export const RedditIcon = _RedditIcon
export const TumblrIcon = _TumblrIcon
export const TwitterIcon = _TwitterIcon
export const WindowsIcon = _WindowsIcon
export const YouTubeIcon = _YouTubeIcon
export const YouTubeGaming = _YouTubeGaming
export const YouTubeShortsIcon = _YouTubeShortsIcon
export const VenmoIcon = _VenmoIcon
export const PolygonIcon = _PolygonIcon
export const USDCColorIcon = _USDCColorIcon
export const VisaIcon = _VisaIcon
export const MinecraftServerIcon = _MinecraftServerIcon
export * from './generated-icons'
export { default as ClassicPlayerModel } from './models/classic-player.gltf?url'
export { default as SlimPlayerModel } from './models/slim-player.gltf?url'
export const DoneIllustration = _DoneIllustration
export const EmptyIllustration = _EmptyIllustration
export const EmptyInboxIllustration = _EmptyInboxIllustration
export const ErrorIllustration = _ErrorIllustration
export const NoConnectionIllustration = _NoConnectionIllustration
export const NoCreditCardIllustration = _NoCreditCardIllustration
export const NoDocumentsIllustration = _NoDocumentsIllustration
export const NoGPSIllustration = _NoGPSIllustration
export const NoImagesIllustration = _NoImagesIllustration
export const NoItemsCartIllustration = _NoItemsCartIllustration
export const NoMessagesIllustration = _NoMessagesIllustration
export const NoSearchResultIllustration = _NoSearchResultIllustration
export const NoTasksIllustration = _NoTasksIllustration
export function getCategoryIcon(categoryName: string): IconComponent | undefined {
if (!categoryName) {
return undefined
}
return categoryIconMap[categoryName.toLowerCase()]
}
export function getLoaderIcon(loaderName: string): IconComponent | undefined {
if (!loaderName) {
return undefined
}
return loaderIconMap[loaderName.toLowerCase()]
}
// will try loader first, then category
export function getTagIcon(tagName: string): IconComponent | undefined {
if (!tagName) {
return undefined
}
return getLoaderIcon(tagName) ?? getCategoryIcon(tagName)
}
export const SERVER_CATEGORY_ICON_MAP: Record<string, string> = {
'adventure-mode': 'compass',
anarchy: 'skull',
'battle-royale': 'target',
bedwars: 'bed-double',
bosses: 'crown',
classes: 'badge',
competitive: 'trophy',
'creative-mode': 'palette',
'creator-community': 'clapperboard',
crossplay: 'gamepad-2',
'custom-content': 'blocks',
dungeons: 'castle',
factions: 'flag',
gens: 'pickaxe',
'hardcore-mode': 'heart-crack',
'keep-inventory': 'backpack',
kitpvp: 'sword',
lifesteal: 'heart-pulse',
media: 'film',
microgames: 'grid-3x3',
minigames: 'dices',
mmo: 'globe',
network: 'network',
'offline-mode': 'wifi-off',
oneblock: 'square',
op: 'zap',
parkour: 'footprints',
'personal-worlds': 'house',
plots: 'map-pinned',
pokemon: 'paw-print',
prison: 'lock',
pve: 'shield',
pvp: 'swords',
questing: 'scroll-text',
racing: 'gauge',
'recording-smp': 'camera',
roleplay: 'theater',
rpg: 'wand-sparkles',
skyblock: 'cloud',
smp: 'users',
'survival-mode': 'tree-pine',
teams: 'handshake',
technical: 'terminal',
towns: 'building-2',
whitelisted: 'badge-check',
'world-resets': 'refresh-ccw',
}