Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2026-03-20 15:59:56 -04:00
commit 591c054d59
No known key found for this signature in database
2 changed files with 22 additions and 12 deletions

View file

@ -14,7 +14,7 @@ import definePlugin from "@utils/types";
import { Tooltip, useState } from "@webpack/common";
const CheckMarkIcon = () => {
return <svg width="24" height="24" viewBox="0 0 24 24">
return <svg width="18" height="18" viewBox="0 0 24 24">
<path fill="currentColor" d="M21.7 5.3a1 1 0 0 1 0 1.4l-12 12a1 1 0 0 1-1.4 0l-6-6a1 1 0 1 1 1.4-1.4L9 16.58l11.3-11.3a1 1 0 0 1 1.4 0Z"></path>
</svg>;
};
@ -26,10 +26,18 @@ export default definePlugin({
patches: [
{
find: "#{intl::PREVIEW_BYTES_LEFT}",
replacement: {
match: /fileName:\i,fileSize:\i}\),(?=.{0,75}?setLanguage:)(?<=fileContents:(\i),bytesLeft:(\i).+?)/g,
replace: "$&$self.addCopyButton({fileContents:$1,bytesLeft:$2}),"
}
replacement: [
// Inline preview
{
match: /fileContents:(\i),bytesLeft:(\i)\}\):null,/,
replace: "$&$self.addCopyButton({fileContents:$1,bytesLeft:$2}),"
},
// Modal
{
match: /align:"\i"\}\),(?=\(0,\i\.jsx\)\(\i,\{wordWrap:\i,setWordWrap:\i)/,
replace: "$&$self.addCopyButton(arguments[0]),"
}
]
}
],
@ -51,7 +59,12 @@ export default definePlugin({
}
}}
>
{recentlyCopied ? <CheckMarkIcon /> : bytesLeft > 0 ? <NoEntrySignIcon color="var(--channel-icon)" /> : <CopyIcon />}
{recentlyCopied
? <CheckMarkIcon />
: bytesLeft > 0
? <NoEntrySignIcon width={18} height={18} color="var(--channel-icon)" />
: <CopyIcon width={18} height={18} />
}
</div>
)}
</Tooltip>

View file

@ -1,9 +1,6 @@
.vc-cfc-button {
color: var(--interactive-icon-default);
display: flex;
align-items: center;
margin-left: 16px;
cursor: pointer;
padding-left: 4px;
}
.vc-cfc-button:hover {
color: var(--interactive-icon-hover);
}