diff --git a/.gitignore b/.gitignore index f50f2e49..27bb947b 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,5 @@ logs # VSCode .vscode/mcp.json + +/supabase diff --git a/.nuxtrc b/.nuxtrc index 1e780800..640f280a 100644 --- a/.nuxtrc +++ b/.nuxtrc @@ -1 +1 @@ -setups.@nuxt/test-utils="3.23.0" \ No newline at end of file +setups.@nuxt/test-utils="4.0.3" \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 3783a8b9..c318556f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,9 @@ "i18n-ally.keystyle": "nested", "cSpell.words": [ "dompurify", + "gamesystem", "imagekit", + "magicitems", "medior", "nuxtjs", "tabler", diff --git a/app/components/atoms/ActionsTable.vue b/app/components/atoms/ActionsTable.vue index e7e16fee..a2a4225d 100644 --- a/app/components/atoms/ActionsTable.vue +++ b/app/components/atoms/ActionsTable.vue @@ -1,29 +1,46 @@ diff --git a/app/components/atoms/ContentCardContent.vue b/app/components/atoms/ContentCardContent.vue deleted file mode 100644 index df560c6a..00000000 --- a/app/components/atoms/ContentCardContent.vue +++ /dev/null @@ -1,241 +0,0 @@ - - - diff --git a/app/components/atoms/DiceRoller.vue b/app/components/atoms/DiceRoller.vue index bf921743..82577706 100644 --- a/app/components/atoms/DiceRoller.vue +++ b/app/components/atoms/DiceRoller.vue @@ -12,15 +12,15 @@ withDefaults(defineProps<{ const { toast } = useToast() const { t } = useI18n() -const dices: Dice[] = ['d4', 'd6', 'd8', 'd10', 'd12', 'd20', 'd100'] -const toRoll = ref>({ d4: 0, d6: 0, d8: 0, d10: 0, d12: 0, d20: 0, d100: 0 }) +const dices: DndDice[] = ['d4', 'd6', 'd8', 'd10', 'd12', 'd20', 'd100'] +const toRoll = ref>({ d4: 0, d6: 0, d8: 0, d10: 0, d12: 0, d20: 0, d100: 0 }) -function calculateDiceRoll() { - const rolled: Partial> = {} +function calculateDndDiceRoll() { + const rolled: Partial> = {} for (const [dice, count] of Object.entries(toRoll.value)) { if (count > 0) { - rolled[dice as Dice] = rollDice(+dice.replace('d', ''), count) + rolled[dice as DndDice] = rollDice(+dice.replace('d', ''), count) } } @@ -110,7 +110,7 @@ function calculateDiceRoll() { type="button" :disabled="Object.values(toRoll).every((value) => value === 0)" class="mt-4 w-full" - @click="calculateDiceRoll" + @click="calculateDndDiceRoll" > {{ $t('actions.roll') }} diff --git a/app/components/atoms/FantasyNameGenerator.vue b/app/components/atoms/FantasyNameGenerator.vue index 6bf597e3..0c585306 100644 --- a/app/components/atoms/FantasyNameGenerator.vue +++ b/app/components/atoms/FantasyNameGenerator.vue @@ -17,7 +17,7 @@ const { t } = useI18n() const names = ref([]) const selectedRace = ref('random') -const selectedGender = ref('random') +const selectedDndGender = ref('random') onMounted(() => generate()) @@ -25,7 +25,7 @@ function generate(): void { names.value = [] const race = selectedRace.value === 'random' ? undefined : selectedRace.value - const gender = selectedGender.value === 'random' ? undefined : selectedGender.value + const gender = selectedDndGender.value === 'random' ? undefined : selectedDndGender.value for (let i = 0; i < props.amount; i++) { names.value.push(randomName(race, gender)) @@ -41,7 +41,7 @@ function handleCopy(name: string): void { }) } -watch([selectedRace, selectedGender], () => { +watch([selectedRace, selectedDndGender], () => { generate() }) @@ -79,9 +79,9 @@ watch([selectedRace, selectedGender], () => { data-test-label class="text-sm font-medium" > - Gender + DndGender - + diff --git a/app/components/atoms/GameSystemFilter.vue b/app/components/atoms/GameSystemFilter.vue new file mode 100644 index 00000000..de5f2a58 --- /dev/null +++ b/app/components/atoms/GameSystemFilter.vue @@ -0,0 +1,136 @@ + + + diff --git a/app/components/form/AcOverride.vue b/app/components/form/AcOverride.vue index 86acb661..7ff42d41 100644 --- a/app/components/form/AcOverride.vue +++ b/app/components/form/AcOverride.vue @@ -6,7 +6,7 @@ import * as z from 'zod' const props = defineProps<{ sheet: InitiativeSheet | undefined item: InitiativeSheetRow - handleAcChanges: (amount: number, type: AcType) => Partial + handleAcChanges: (amount: number, type: DndAcType) => Partial updateRow: (row: Partial) => Promise }>() @@ -18,7 +18,7 @@ const formSchema = toTypedSchema(z.object({ const { handleSubmit, setFieldValue } = useForm({ validationSchema: formSchema, initialValues: { - ...(props.item.maxAcOld ? { amount: props.item.maxAc } : { }), + ...(props.item.maxArmorClassOld ? { amount: props.item.maxArmorClass } : { }), }, }) @@ -32,8 +32,8 @@ const onSubmit = handleSubmit(async (values) => { const { amount, reset } = values - const row = reset || amount === props.item.maxAcOld - ? props.handleAcChanges(props.item.maxAcOld ?? 0, 'override-reset') + const row = reset || amount === props.item.maxArmorClassOld + ? props.handleAcChanges(props.item.maxArmorClassOld ?? 0, 'override-reset') : props.handleAcChanges(amount, 'override') await props.updateRow(row) @@ -63,10 +63,10 @@ const onSubmit = handleSubmit(async (values) => { - + diff --git a/app/components/form/AcUpdate.vue b/app/components/form/AcUpdate.vue index f41603e5..c9b9fc1b 100644 --- a/app/components/form/AcUpdate.vue +++ b/app/components/form/AcUpdate.vue @@ -6,11 +6,11 @@ import * as z from 'zod' const props = defineProps<{ sheet: InitiativeSheet | undefined item: InitiativeSheetRow - handleAcChanges: (amount: number, type: AcType) => Partial + handleAcChanges: (amount: number, type: DndAcType) => Partial updateRow: (row: Partial) => Promise }>() -const selectedType = ref('remove') +const selectedType = ref('remove') const formSchema = toTypedSchema(z.object({ amount: z.number().min(0).max(1000), diff --git a/app/components/form/AcUpdateBase.vue b/app/components/form/AcUpdateBase.vue index 06a51afe..8e00a8ab 100644 --- a/app/components/form/AcUpdateBase.vue +++ b/app/components/form/AcUpdateBase.vue @@ -6,7 +6,7 @@ import * as z from 'zod' const props = defineProps<{ sheet: InitiativeSheet | undefined item: InitiativeSheetRow - handleAcChanges: (amount: number, type: AcType) => Partial + handleAcChanges: (amount: number, type: DndAcType) => Partial updateRow: (row: Partial) => Promise }>() diff --git a/app/components/form/ActionInputs.vue b/app/components/form/ActionInputs.vue index 1378e97b..eb8de785 100644 --- a/app/components/form/ActionInputs.vue +++ b/app/components/form/ActionInputs.vue @@ -1,11 +1,42 @@