mirror of
https://github.com/modrinth/code.git
synced 2026-09-03 05:25:58 +00:00
* Rule 1.x, 3.2 and 3.3x support * reorganize * Kinda Jank dynamic list stuff that should probably be implemented better but its 1:30 am * Checklist Stage Title * Make Stage Title Good * Rule 1.x, 3.2 and 3.3x support * reorganize * Kinda Jank dynamic list stuff that should probably be implemented better but its 1:30 am * Checklist Stage Title * Make Stage Title Good * oops i forgot 3.1 * Insufficient description improvement test * "i forgor" checklist tooltips tooltips (kinda jank but they work) update to latest * only use indexedDb for moderation storage, localStorage forces a bunch of cringe * store moderation stuff separately + compact checklist stuff * give stages actual titles + rename what was previously called titles to hints * Title & Slug, Summary Description, Links, License, Gallery, Versions and Reupload migrated to new system™️ * put stageoptions before nodes * do state and variablse in tooltips * checklist fully migrated to new system, not much new has been added (yet) * forgot to only do modpack permissions for modpacks * Idk why I wasn't just mutating the builder * actual node type hierarchy + action abstraction + improve message/text handling * dropdown + "functional" quick fixes * dropdown + "functional" quick fixes * Allow moderators to suggest correct environment. * remove vestigial function * Prioritization™️ * quickest fixes in the west * start of metadata stage + optimize checklist parsing + a couple of qol features * futureproof™️ environment metadata + just give me project context everywhere * tidy up after today's refactoring * tidy up after tidying up after today's refactoring * move loaders to metadata (from versions) * better required display + vueify + reorganize messages + tag quick fixes + todo * fix log spam + concat md * more bugs * nested state access * update description stage, add showcase clarity * Fix links stage mostly, and tweak metadata stage. * fix links lag + actions on stages * setup links bonus buttons * Change stage order * Update rules stage * Move conditional stages to the top where they belong. * fix some metadata stuff * fix stage selector * don't show non-english buttons on servers without english support. * prepr * stop linter from trying to break my markdown * fix: some issues * fix: lint * not sure why but link's links weren't links * fix quick fixes (again) (idk how they keep breaking) * make messages only actually count as messages if they actually have content * rename horror button to spoilers button * Update links name to match the links settings * re-review stage * unbreak stage selector * passing off version stage fixing. * actually fix the stage selector this time * fix showcase clarity msg * redirect when checklist updates slug fix initial stage not being first if first stage is only shown under certain conditions move to a consistent naming scheme * redirect when checklist updates slug fix initial stage not being first if first stage is only shown under certain conditions move to a consistent naming scheme * ok maybe lets use kebab * move custom description advice stage to first button. * temp priority on corrections applied * make metadata page go to non setting versions page * links stage bonus buttons, src required flag, show link value in msgs, fix msg groupings. * update re-review button * reupload stage navigates to project Description. * fix: link stage using page context too late * chore: run prepr * fix(ci): tell typo check to ignore moderation utils * fix: pr comment if storybook fails * make complex nodes less complex (for the most part) fix re-review stage shown condition new fancy message collection system all buttons that contribute to messages now have relevant tooltips don't store default values in checklist db * make complex nodes less complex (for the most part) fix re-review stage shown condition new fancy message collection system all buttons that contribute to messages now have relevant tooltips don't store default values in checklist db * maybe fixed markdown escaping? * tweak re-review wording. * Update license stage handling and info * add mixed option back for env info * fix: formatEnvironments fix: formatEnvironments * update metadata environment group shown * fix: status alert priority * fix: display suggested slug in slug/misused message * actually navigate when we change project slug * ok like redirect but like don't lose state when slug changes :smart: * make checklist reset button reset only current stage if there's modifications to it instead of full checklist * fix versions stage messages not working * fix donation links not being in a column * I think slug stuff is working? also like actually 100% garunteed markdown escaping works now * prepr * pseudo stages no longer interact with non-pseudo stages at all also query projects better I think? fix repetitive message spam in links stage * apply quick fixes before refreshing page * differentiate reset and return to start * remove random empty lines in some situations * better inaccurate slug message * slug correction input reset button resets to current slug again instead of auto * better keybind navigation * incorrect environment message tweak * use environment name(s) in checklist info * prepr --------- Signed-off-by: Prospector <6166773+Prospector@users.noreply.github.com> Co-authored-by: chyzman <chyzalt@gmail.com> Co-authored-by: Calum H. (IMB11) <contact@cal.engineer> Co-authored-by: Gravy Boat <gravy@thatgravyboat.tech> Co-authored-by: Michael H. <michael@iptables.sh> Co-authored-by: chyz <32403637+chyzman@users.noreply.github.com> Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
60 lines
1.9 KiB
TypeScript
60 lines
1.9 KiB
TypeScript
import type { Labrinth } from '@modrinth/api-client'
|
|
import type { DeepReadonly, Ref, ShallowRef } from 'vue'
|
|
|
|
import { createContext } from '.'
|
|
|
|
export const PROJECT_DEP_MARKER_QUERY = { dep: '1' } as const
|
|
|
|
export type CdnDownloadReason = 'standalone' | 'dependency'
|
|
|
|
export interface ProjectPageContext {
|
|
// Data refs
|
|
projectV2: Ref<Labrinth.Projects.v2.Project>
|
|
projectV3: Ref<Labrinth.Projects.v3.Project>
|
|
currentMember: Ref<Labrinth.Projects.v3.TeamMember | null>
|
|
allMembers: Ref<Labrinth.Projects.v3.TeamMember[]>
|
|
organization: Ref<Labrinth.Projects.v3.Organization | null>
|
|
// Lazy version loading (client-side only)
|
|
versions: Ref<Labrinth.Versions.v2.Version[] | null>
|
|
versionsLoading: Ref<boolean>
|
|
versionsLoaded: Ref<boolean>
|
|
// Lazy dependencies loading (client-side only)
|
|
dependencies: Ref<Labrinth.Projects.v2.DependencyInfo | null>
|
|
dependenciesLoading: Ref<boolean>
|
|
|
|
thread: ShallowRef<Labrinth.Threads.v3.Thread | null | undefined>
|
|
|
|
cdnDownloadReason: DeepReadonly<Ref<CdnDownloadReason>>
|
|
|
|
// Invalidate all project queries (auto-refetches active ones)
|
|
invalidate: () => Promise<void>
|
|
|
|
// Lazy loading
|
|
loadVersions: () => void
|
|
loadDependencies: () => void
|
|
|
|
// Mutation functions
|
|
patchProject: (data: Record<string, unknown>, quiet?: boolean) => Promise<boolean>
|
|
patchProjectV3: (data: Record<string, unknown>, quiet?: boolean) => Promise<boolean>
|
|
patchIcon: (icon: File) => Promise<boolean>
|
|
setProcessing: () => Promise<void>
|
|
createGalleryItem: (
|
|
file: File,
|
|
title?: string,
|
|
description?: string,
|
|
featured?: boolean,
|
|
ordering?: number,
|
|
) => Promise<boolean>
|
|
editGalleryItem: (
|
|
imageUrl: string,
|
|
title?: string,
|
|
description?: string,
|
|
featured?: boolean,
|
|
ordering?: number,
|
|
) => Promise<boolean>
|
|
deleteGalleryItem: (imageUrl: string) => Promise<boolean>
|
|
}
|
|
|
|
export const [injectProjectPageContext, provideProjectPageContext] =
|
|
createContext<ProjectPageContext>('root', 'projectPageContext')
|