Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/labrinth-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
GIT_HASH: ${{ github.sha }}
SCCACHE_CACHE_SIZE: ${{ needs.skip-if-clean.outputs.internal == 'true' && '20G' || '' }}
RUSTC_WRAPPER: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'sccache' || '' }}
RUST_MIN_STACK: '16777216'
RUST_MIN_STACK: '268435456'
steps:
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/public/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ components:
- ai_content_code
- ai_content_assets
- ai_content_text
- ai_content_functionality
- ai_functionality
- advertisements
- epilepsy_triggers
- system_interactions
Expand Down Expand Up @@ -2202,7 +2202,7 @@ paths:
- `ai_content_code`
- `ai_content_assets`
- `ai_content_text`
- `ai_content_functionality`
- `ai_functionality`
- `advertisements`
- `epilepsy_triggers`
- `system_interactions`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const messages = defineMessages({
},
description1: {
id: 'project.settings.disclosures.advertising.description.1',
defaultMessage: `You must enable this if your project contains advertisements, sponsorships, or promotions of other works.`,
defaultMessage: `Must be enabled if this project contains advertisements, sponsorships, or promotions of other works.`,
},
description2: {
id: 'project.settings.disclosures.advertising.description.2',
defaultMessage: `If the promotion has no direct monetary value <emphasis>and</emphasis> it is for something that the average person would consider <italic>relevant</italic> and <italic>unobtrusive</italic> (such as a link to your Modrinth profile in the corner of the settings page for your own mod), we would not consider that an advertisement.`,
defaultMessage: `This does not pertain to unobtrusive promotion of relevant content with no direct monetary value (such as a link to a Modrinth profile in your own configuration menu), and does not pertain to advertisements in the project page such as sponsored banners in the description.`,
},
notePlaceholder: {
id: 'project.settings.disclosures.advertising.note-placeholder',
Expand All @@ -49,6 +49,7 @@ const messages = defineMessages({
v-model="model.enabled"
:icon="MegaphoneIcon"
:title="formatMessage(messages.title)"
info-link="https://support.modrinth.com/en/articles/16567675#h_d486036510"
@set-lock-status="emit('setLockStatus', $event)"
>
<p>{{ formatMessage(messages.description1) }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const emit = defineEmits<{

const { formatMessage } = useVIntl()

const AI_USES: AiUsage[] = ['code', 'assets', 'text', 'functionality']
const AI_USES: AiUsage[] = ['code', 'assets', 'text']

const messages = defineMessages({
title: {
Expand All @@ -34,19 +34,20 @@ const messages = defineMessages({
},
description: {
id: 'project.settings.disclosures.ai.description',
defaultMessage: `You must enable this if this project contains a substantial amount of AI-generated code, any
assets that are substantially AI-generated, the project's functionality relies on the use of
generative AI, or if any element of your project's page such as description or publishing
relies on generative AI.`,
defaultMessage: `Must be enabled if this project contains any AI-generated assets or text, or if it contains a substantial amount of AI-generated code.`,
},
contentRules: {
id: 'project.settings.disclosures.ai.content-rules',
description2: {
id: 'project.settings.disclosures.ai.description.2',
defaultMessage: `It is important to be honest if generative AI has played a significant role in the production or publishing of this content. An easy way to think about this is if you would consider AI a co-author of the project, you should disclose it here.`,
},
stillUnsure: {
id: 'project.settings.disclosures.ai.still-unsure',
defaultMessage:
"Please refer to Section 6 of <rules>Modrinth's Content Rules</rules> for more information.",
"Still unsure? Refer to our guide to <faq-link>Disclosure and Usage of AI</faq-link> and section 6 of <rules>Modrinth's Content Rules</rules> for more information.",
},
typesDescription: {
id: 'project.settings.disclosures.ai.types-description',
defaultMessage: 'What is generative AI being used for?',
defaultMessage: 'What types of content have been generated with AI?',
},
notePlaceholder: {
id: 'project.settings.disclosures.ai.note-placeholder',
Expand Down Expand Up @@ -76,10 +77,23 @@ function setUse(use: AiUsage, enabled: boolean) {
:icon="SparklesIcon"
:title="formatMessage(messages.title)"
:description="formatMessage(messages.description)"
info-link="https://support.modrinth.com/en/articles/16567675#h_ec72dfca13"
@set-lock-status="emit('setLockStatus', $event)"
>
<p>
{{ formatMessage(messages.description2) }}
</p>
<p class="text-secondary">
<IntlFormatted :message-id="messages.contentRules">
<IntlFormatted :message-id="messages.stillUnsure">
<template #faq-link="{ children }">
<a
href="https://support.modrinth.com/en/articles/16551575"
target="_blank"
class="smart-clickable:allow-pointer-events underline hover:text-primary"
>
<component :is="() => normalizeChildren(children)" />
</a>
</template>
<template #rules="{ children }">
<nuxt-link
to="/legal/rules#generative-ai"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<script setup lang="ts">
import { BrainCircuitIcon } from '@modrinth/assets'
import { commonMessages, defineMessages, SettingsFormGroup, Textarea, useVIntl } from '@modrinth/ui'

import DisclosureToggleCard from './DisclosureToggleCard.vue'
import type { DisclosureCardMetaProps, DisclosureLockStatus, NoteDisclosure } from './types'

const model = defineModel<NoteDisclosure>({ required: true })

const props = defineProps<DisclosureCardMetaProps>()

const emit = defineEmits<{
setLockStatus: [status: DisclosureLockStatus]
}>()

const { formatMessage } = useVIntl()

const messages = defineMessages({
title: {
id: 'project.settings.disclosures.ai-functionality.title',
defaultMessage: 'Contains generative AI functionality',
},
description: {
id: 'project.settings.disclosures.ai-functionality.description',
defaultMessage:
'Must be enabled if the project has functionality that makes use of generative AI, such as an in-game chatbot or dynamically generated textures.',
},
notePlaceholder: {
id: 'project.settings.disclosures.ai-functionality.note-placeholder',
defaultMessage: 'e.g. The NPCs uses generative AI for dialogue options.',
},
})
</script>

<template>
<DisclosureToggleCard
v-bind="props"
v-model="model.enabled"
:icon="BrainCircuitIcon"
:title="formatMessage(messages.title)"
:description="formatMessage(messages.description)"
info-link="https://support.modrinth.com/en/articles/16567675#h_4482fb3bf7"
@set-lock-status="emit('setLockStatus', $event)"
>
<template #expanded>
<SettingsFormGroup
:title="formatMessage(commonMessages.explanationLabel)"
title-for="ai-functionality-disclosure-note"
optional
>
<Textarea
id="ai-functionality-disclosure-note"
v-model="model.note"
:rows="3"
class="max-w-[40rem]"
:disabled="disabled"
:placeholder="formatMessage(messages.notePlaceholder)"
/>
</SettingsFormGroup>
</template>
</DisclosureToggleCard>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const messages = defineMessages({
v-model="model.enabled"
:icon="ArchiveIcon"
:title="formatMessage(messages.title)"
info-link="https://support.modrinth.com/en/articles/16567675#h_76b62c699c"
@set-lock-status="emit('setLockStatus', $event)"
>
<p>{{ formatMessage(messages.description1) }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function setOptionalField(
:icon="GitForkIcon"
:title="formatMessage(messages.title)"
:description="formatMessage(messages.description)"
info-link="https://support.modrinth.com/en/articles/16567675#h_6422cc821e"
@set-lock-status="emit('setLockStatus', $event)"
>
<template #expanded>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { CircleSlashIcon, LockIcon, LockOpenIcon } from '@modrinth/assets'
import { CircleSlashIcon, LockIcon, LockOpenIcon, UnknownIcon } from '@modrinth/assets'
import {
Button,
ButtonGroup,
Expand All @@ -8,6 +8,7 @@ import {
normalizeChildren,
SettingsInlineWarning,
SettingsToggleCard,
useVIntl,
} from '@modrinth/ui'
import type { Component } from 'vue'
import { computed } from 'vue'
Expand All @@ -17,11 +18,14 @@ import type { DisclosureCardMetaProps, DisclosureLockStatus } from './types'

defineOptions({ inheritAttrs: false })

const { formatMessage } = useVIntl()

const props = defineProps<
DisclosureCardMetaProps & {
title: string
icon?: Component
description?: string
infoLink?: string
}
>()

Expand Down Expand Up @@ -55,6 +59,10 @@ const messages = defineMessages({
defaultMessage:
'This disclosure has been locked by the moderators. Please <contact-support-link>contact support</contact-support-link> if you believe this is in error.',
},
infoTooltip: {
id: 'project.settings.disclosures.info-tooltip',
defaultMessage: 'Click to learn more about when to use this disclosure.',
},
})

const lockWarningMessage = computed(() => {
Expand Down Expand Up @@ -91,6 +99,18 @@ function setLockStatus(status: DisclosureLockStatus) {
:description="description"
>
<slot />
<template #title-suffix>
<a
v-if="infoLink"
v-tooltip="formatMessage(messages.infoTooltip)"
class="smart-clickable:allow-pointer-events flex text-secondary hover:brightness-[--hover-brightness]"
:href="infoLink"
target="_blank"
rel="noopener noreferrer"
>
<UnknownIcon class="size-5" />
</a>
</template>
<template v-if="$slots.expanded" #expanded>
<slot name="expanded" />
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const messages = defineMessages({
description: {
id: 'project.settings.disclosures.paid-features.description',
defaultMessage:
'You must enable this if your project contains features that can be obtained by spending real-world money.',
'Must be enabled if this project contains features that can be unlocked by spending real-world money.',
},
featuresDescription: {
id: 'project.settings.disclosures.paid-features.features-description',
Expand Down Expand Up @@ -70,6 +70,7 @@ function removeFeature(index: number) {
:icon="CircleDollarSignIcon"
:title="formatMessage(messages.title)"
:description="formatMessage(messages.description)"
info-link="https://support.modrinth.com/en/articles/16567675#h_37c3b31394"
@set-lock-status="emit('setLockStatus', $event)"
>
<template #expanded>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const messages = defineMessages({
:icon="EyeIcon"
:title="formatMessage(messages.title)"
:description="formatMessage(messages.description)"
info-link="https://support.modrinth.com/en/articles/16567675#h_22ffae0bb1"
@set-lock-status="emit('setLockStatus', $event)"
>
<template #expanded>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { CircuitBoardIcon } from '@modrinth/assets'
import { MonitorCogIcon } from '@modrinth/assets'
import { defineMessages, SettingsFormGroup, Textarea, useVIntl } from '@modrinth/ui'

import DisclosureToggleCard from './DisclosureToggleCard.vue'
Expand Down Expand Up @@ -44,9 +44,10 @@ const messages = defineMessages({
<DisclosureToggleCard
v-bind="props"
v-model="model.enabled"
:icon="CircuitBoardIcon"
:icon="MonitorCogIcon"
:title="formatMessage(messages.title)"
:description="formatMessage(messages.description)"
info-link="https://support.modrinth.com/en/articles/16567675#h_ec72dfca13"
@set-lock-status="emit('setLockStatus', $event)"
>
<template #expanded>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function removeEntry(index: number) {
:icon="RadioTowerIcon"
:title="formatMessage(messages.title)"
:description="formatMessage(messages.description)"
info-link="https://support.modrinth.com/en/articles/16567675#h_490dcf364b"
@set-lock-status="emit('setLockStatus', $event)"
>
<template #expanded>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function findDisclosure<T extends DisclosureType>(
return disclosures.find((disclosure): disclosure is DisclosureOf<T> => disclosure.type === type)
}

type NoteDisclosureType = 'advertisements' | 'epilepsy_triggers' | 'archived'
type NoteDisclosureType = 'ai_functionality' | 'advertisements' | 'epilepsy_triggers' | 'archived'

function createNoteModel(
disclosures: ProjectDisclosureData[],
Expand Down Expand Up @@ -66,6 +66,7 @@ export function disclosuresToForm(disclosures: ProjectDisclosureData[]): Disclos
uses: ai ? [...(ai.uses ?? [])] : [],
note: ai?.note ?? '',
},
aiFunctionality: createNoteModel(disclosures, 'ai_functionality'),
advertising: createNoteModel(disclosures, 'advertisements'),
paidFeatures: {
enabled: isActiveDisclosure(paidFeatures),
Expand Down Expand Up @@ -110,6 +111,8 @@ export function formToDisclosure(
uses: [...form.ai.uses],
note: form.ai.note.trim() || null,
}
case 'ai_functionality':
return { type: 'ai_functionality', note: form.aiFunctionality.note.trim() || null }
case 'advertisements':
return { type: 'advertisements', note: form.advertising.note.trim() || null }
case 'paid_features':
Expand Down Expand Up @@ -151,6 +154,9 @@ export function formToDisclosures(form: DisclosureFormState): ProjectDisclosure[
if (form.ai.enabled) {
set.push(formToDisclosure(form, 'ai_content'))
}
if (form.aiFunctionality.enabled) {
set.push(formToDisclosure(form, 'ai_functionality'))
}
if (form.advertising.enabled) {
set.push(formToDisclosure(form, 'advertisements'))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { default as AdvertisingDisclosureCard } from './AdvertisingDisclosureCard.vue'
export { default as AiDisclosureCard } from './AiDisclosureCard.vue'
export { default as AiFunctionalityDisclosureCard } from './AiFunctionalityDisclosureCard.vue'
export { default as ArchivedDisclosureCard } from './ArchivedDisclosureCard.vue'
export { default as DerivativeDisclosureCard } from './DerivativeDisclosureCard.vue'
export { default as DisclosureToggleCard } from './DisclosureToggleCard.vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type DerivativeDisclosure = {

export type DisclosureFormState = {
ai: AiDisclosure
aiFunctionality: NoteDisclosure
advertising: NoteDisclosure
paidFeatures: PaidFeaturesDisclosure
telemetry: TelemetryDisclosure
Expand Down
6 changes: 0 additions & 6 deletions apps/frontend/src/locales/de-CH/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3821,18 +3821,12 @@
"project.settings.disclosures.advertising.description.1": {
"message": "Du musst dies aktivieren, wenn dein Projekt Werbung, Sponsoren oder Werbeaktionen für andere Werke enthält."
},
"project.settings.disclosures.advertising.description.2": {
"message": "Falls die Werbung keinen direkten finanziellen Wert hat <emphasis>und</emphasis> sich auf etwas bezieht, das die durchschnittliche Person als <italic>relevant</italic> und <italic>unaufdringlich</italic> betrachten würde (wie beispielsweise einen Link zu deinem Modrinth-Profil in der Ecke der Einstellungsseite für deinen eigenen Mod), würden wir dies nicht als Werbung betrachten."
},
"project.settings.disclosures.advertising.note-placeholder": {
"message": "z.B: Fügt den SMP-Server von Modrinth automatisch zu deiner Serverliste hinzu."
},
"project.settings.disclosures.advertising.title": {
"message": "Enthält Werbung"
},
"project.settings.disclosures.ai.content-rules": {
"message": "Weitere Informationen findest du in Abschnitt 6 der <rules>Inhaltsrichtlinien von Modrinth</rules>."
},
"project.settings.disclosures.ai.description": {
"message": "Du musst dies aktivieren, wenn dieses Projekt einen erheblichen Anteil an KI-generiertem Code enthält, wenn Assets vorhanden sind, die zu einem wesentlichen Teil KI-generiert sind, wenn die Funktionalität des Projekts auf dem Einsatz von generativer KI beruht oder wenn Elemente der Projektseite wie die Beschreibung oder die Veröffentlichung generativer KI basieren."
},
Expand Down
6 changes: 0 additions & 6 deletions apps/frontend/src/locales/de-DE/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3821,18 +3821,12 @@
"project.settings.disclosures.advertising.description.1": {
"message": "Du musst dies aktivieren, wenn dein Projekt Werbung, Sponsoren oder Werbeaktionen für andere Werke enthält."
},
"project.settings.disclosures.advertising.description.2": {
"message": "Falls die Werbung keinen direkten finanziellen Wert hat <emphasis>und</emphasis> sich auf etwas bezieht, das die durchschnittliche Person als <italic>relevant</italic> und <italic>unaufdringlich</italic> betrachten würde (wie beispielsweise einen Link zu deinem Modrinth-Profil in der Ecke der Einstellungsseite für deinen eigenen Mod), würden wir dies nicht als Werbung betrachten."
},
"project.settings.disclosures.advertising.note-placeholder": {
"message": "z.B: Fügt den SMP-Server von Modrinth automatisch zu deiner Serverliste hinzu."
},
"project.settings.disclosures.advertising.title": {
"message": "Enthält Werbung"
},
"project.settings.disclosures.ai.content-rules": {
"message": "Weitere Informationen findest du in Abschnitt 6 der <rules>Inhaltsrichtlinien von Modrinth</rules>."
},
"project.settings.disclosures.ai.description": {
"message": "Du musst dies aktivieren, wenn dieses Projekt einen erheblichen Anteil an KI-generiertem Code enthält, wenn Assets vorhanden sind, die zu einem wesentlichen Teil KI-generiert sind, wenn die Funktionalität des Projekts auf dem Einsatz von generativer KI beruht oder wenn Elemente der Projektseite wie die Beschreibung oder die Veröffentlichung generativer KI basieren."
},
Expand Down
Loading
Loading