Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ef27c3a60 |
No files matched your search
@@ -50,35 +50,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else-if="generatedMessage">
|
<div v-else-if="generatedMessage">
|
||||||
<div>
|
<div>
|
||||||
<ButtonStyled>
|
|
||||||
<button class="mb-2" @click="useSimpleEditor = !useSimpleEditor">
|
|
||||||
<template v-if="!useSimpleEditor">
|
|
||||||
<ToggleLeftIcon aria-hidden="true" />
|
|
||||||
Use simple mode
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<ToggleRightIcon aria-hidden="true" />
|
|
||||||
Use advanced mode
|
|
||||||
</template>
|
|
||||||
</button>
|
|
||||||
</ButtonStyled>
|
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
v-if="!useSimpleEditor"
|
|
||||||
v-model="message"
|
v-model="message"
|
||||||
:max-height="400"
|
:max-height="400"
|
||||||
placeholder="No message generated."
|
placeholder="No message generated."
|
||||||
:disabled="false"
|
:disabled="false"
|
||||||
:heading-buttons="false"
|
:heading-buttons="false"
|
||||||
/>
|
/>
|
||||||
<textarea
|
|
||||||
v-else
|
|
||||||
v-model="message"
|
|
||||||
type="text"
|
|
||||||
class="bg-bg-input h-[400px] w-full rounded-lg border border-solid border-divider px-3 py-2 font-mono text-base"
|
|
||||||
placeholder="No message generated."
|
|
||||||
autocomplete="off"
|
|
||||||
@input="persistState"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="isModpackPermissionsStage">
|
<div v-else-if="isModpackPermissionsStage">
|
||||||
@@ -346,8 +324,6 @@ import {
|
|||||||
CheckIcon,
|
CheckIcon,
|
||||||
KeyboardIcon,
|
KeyboardIcon,
|
||||||
EyeOffIcon,
|
EyeOffIcon,
|
||||||
ToggleLeftIcon,
|
|
||||||
ToggleRightIcon,
|
|
||||||
} from "@modrinth/assets";
|
} from "@modrinth/assets";
|
||||||
import {
|
import {
|
||||||
checklist,
|
checklist,
|
||||||
@@ -392,6 +368,7 @@ import {
|
|||||||
type Stage,
|
type Stage,
|
||||||
finalPermissionMessages,
|
finalPermissionMessages,
|
||||||
} from "@modrinth/moderation";
|
} from "@modrinth/moderation";
|
||||||
|
import * as prettier from "prettier";
|
||||||
import ModpackPermissionsFlow from "./ModpackPermissionsFlow.vue";
|
import ModpackPermissionsFlow from "./ModpackPermissionsFlow.vue";
|
||||||
import KeybindsModal from "./ChecklistKeybindsModal.vue";
|
import KeybindsModal from "./ChecklistKeybindsModal.vue";
|
||||||
import { useModerationStore } from "~/store/moderation.ts";
|
import { useModerationStore } from "~/store/moderation.ts";
|
||||||
@@ -415,7 +392,6 @@ const isModpackPermissionsStage = computed(() => {
|
|||||||
return currentStageObj.value.id === "modpack-permissions";
|
return currentStageObj.value.id === "modpack-permissions";
|
||||||
});
|
});
|
||||||
|
|
||||||
const useSimpleEditor = ref(false);
|
|
||||||
const message = ref("");
|
const message = ref("");
|
||||||
const generatedMessage = ref(false);
|
const generatedMessage = ref(false);
|
||||||
const loadingMessage = ref(false);
|
const loadingMessage = ref(false);
|
||||||
@@ -1142,7 +1118,19 @@ async function generateMessage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message.value = fullMessage;
|
try {
|
||||||
|
const formattedMessage = await prettier.format(fullMessage, {
|
||||||
|
parser: "markdown",
|
||||||
|
printWidth: 80,
|
||||||
|
proseWrap: "always",
|
||||||
|
tabWidth: 2,
|
||||||
|
useTabs: false,
|
||||||
|
});
|
||||||
|
message.value = formattedMessage;
|
||||||
|
} catch (formattingError) {
|
||||||
|
console.warn("Failed to format markdown, using original:", formattingError);
|
||||||
|
message.value = fullMessage;
|
||||||
|
}
|
||||||
|
|
||||||
generatedMessage.value = true;
|
generatedMessage.value = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ import {
|
|||||||
ScaleIcon,
|
ScaleIcon,
|
||||||
} from "@modrinth/assets";
|
} from "@modrinth/assets";
|
||||||
import { defineMessages, useVIntl } from "@vintl/vintl";
|
import { defineMessages, useVIntl } from "@vintl/vintl";
|
||||||
import { useLocalStorage } from "@vueuse/core";
|
|
||||||
import ConfettiExplosion from "vue-confetti-explosion";
|
import ConfettiExplosion from "vue-confetti-explosion";
|
||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
import ModerationQueueCard from "~/components/ui/moderation/ModerationQueueCard.vue";
|
import ModerationQueueCard from "~/components/ui/moderation/ModerationQueueCard.vue";
|
||||||
@@ -215,7 +214,7 @@ watch(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentFilterType = useLocalStorage("moderation-current-filter-type", () => "All projects");
|
const currentFilterType = ref("All projects");
|
||||||
const filterTypes: readonly string[] = readonly([
|
const filterTypes: readonly string[] = readonly([
|
||||||
"All projects",
|
"All projects",
|
||||||
"Modpacks",
|
"Modpacks",
|
||||||
@@ -226,7 +225,7 @@ const filterTypes: readonly string[] = readonly([
|
|||||||
"Shaders",
|
"Shaders",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const currentSortType = useLocalStorage("moderation-current-sort-type", () => "Oldest");
|
const currentSortType = ref("Oldest");
|
||||||
const sortTypes: readonly string[] = readonly(["Oldest", "Newest"]);
|
const sortTypes: readonly string[] = readonly(["Oldest", "Newest"]);
|
||||||
|
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1);
|
||||||
|
|||||||
@@ -72,7 +72,6 @@
|
|||||||
import { DropdownSelect, Button, Pagination } from "@modrinth/ui";
|
import { DropdownSelect, Button, Pagination } from "@modrinth/ui";
|
||||||
import { XIcon, SearchIcon, SortAscIcon, SortDescIcon, FilterIcon } from "@modrinth/assets";
|
import { XIcon, SearchIcon, SortAscIcon, SortDescIcon, FilterIcon } from "@modrinth/assets";
|
||||||
import { defineMessages, useVIntl } from "@vintl/vintl";
|
import { defineMessages, useVIntl } from "@vintl/vintl";
|
||||||
import { useLocalStorage } from "@vueuse/core";
|
|
||||||
import type { Report } from "@modrinth/utils";
|
import type { Report } from "@modrinth/utils";
|
||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
import type { ExtendedReport } from "@modrinth/moderation";
|
import type { ExtendedReport } from "@modrinth/moderation";
|
||||||
@@ -170,10 +169,10 @@ watch(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentFilterType = useLocalStorage("moderation-reports-filter-type", () => "All");
|
const currentFilterType = ref("All");
|
||||||
const filterTypes: readonly string[] = readonly(["All", "Unread", "Read"]);
|
const filterTypes: readonly string[] = readonly(["All", "Unread", "Read"]);
|
||||||
|
|
||||||
const currentSortType = useLocalStorage("moderation-reports-sort-type", () => "Oldest");
|
const currentSortType = ref("Oldest");
|
||||||
const sortTypes: readonly string[] = readonly(["Oldest", "Newest"]);
|
const sortTypes: readonly string[] = readonly(["Oldest", "Newest"]);
|
||||||
|
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1);
|
||||||
|
|||||||
@@ -169,8 +169,6 @@ import _TerminalSquareIcon from './icons/terminal-square.svg?component'
|
|||||||
import _TestIcon from './icons/test.svg?component'
|
import _TestIcon from './icons/test.svg?component'
|
||||||
import _TextQuoteIcon from './icons/text-quote.svg?component'
|
import _TextQuoteIcon from './icons/text-quote.svg?component'
|
||||||
import _TimerIcon from './icons/timer.svg?component'
|
import _TimerIcon from './icons/timer.svg?component'
|
||||||
import _ToggleLeftIcon from './icons/toggle-left.svg?component'
|
|
||||||
import _ToggleRightIcon from './icons/toggle-right.svg?component'
|
|
||||||
import _TransferIcon from './icons/transfer.svg?component'
|
import _TransferIcon from './icons/transfer.svg?component'
|
||||||
import _TrashIcon from './icons/trash.svg?component'
|
import _TrashIcon from './icons/trash.svg?component'
|
||||||
import _TriangleAlertIcon from './icons/triangle-alert.svg?component'
|
import _TriangleAlertIcon from './icons/triangle-alert.svg?component'
|
||||||
@@ -364,8 +362,6 @@ export const TerminalSquareIcon = _TerminalSquareIcon
|
|||||||
export const TestIcon = _TestIcon
|
export const TestIcon = _TestIcon
|
||||||
export const TextQuoteIcon = _TextQuoteIcon
|
export const TextQuoteIcon = _TextQuoteIcon
|
||||||
export const TimerIcon = _TimerIcon
|
export const TimerIcon = _TimerIcon
|
||||||
export const ToggleLeftIcon = _ToggleLeftIcon
|
|
||||||
export const ToggleRightIcon = _ToggleRightIcon
|
|
||||||
export const TransferIcon = _TransferIcon
|
export const TransferIcon = _TransferIcon
|
||||||
export const TrashIcon = _TrashIcon
|
export const TrashIcon = _TrashIcon
|
||||||
export const TriangleAlertIcon = _TriangleAlertIcon
|
export const TriangleAlertIcon = _TriangleAlertIcon
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-toggle-left-icon lucide-toggle-left"><circle cx="9" cy="12" r="3"/><rect width="20" height="14" x="2" y="5" rx="7"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 324 B |
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-toggle-right-icon lucide-toggle-right"><circle cx="15" cy="12" r="3"/><rect width="20" height="14" x="2" y="5" rx="7"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 327 B |
Reference in new issue
Block a user