Merge branch 'dev'

This commit is contained in:
thororen1234 2026-03-16 13:19:17 -04:00
commit b9b911d49a
No known key found for this signature in database
4 changed files with 20 additions and 18 deletions

View file

@ -8,9 +8,12 @@ import "./style.css";
import { definePluginSettings } from "@api/Settings";
import { Devs, EquicordDevs } from "@utils/constants";
import { classNameFactory } from "@utils/css";
import definePlugin, { OptionType } from "@utils/types";
import { UserStore } from "@webpack/common";
const cl = classNameFactory("vc-char-counter-");
const settings = definePluginSettings({
colorEffects: {
type: OptionType.BOOLEAN,
@ -27,10 +30,12 @@ export default definePlugin({
patches: [
{
find: ".CREATE_FORUM_POST||",
replacement: {
match: /(textValue:.{0,50}channelId:\i\.id\}\)),\i/,
replace: "$1,$self.getCharCounter(arguments[0].textValue)"
}
replacement: [
{
match: /(textValue:.{0,50}channelId:\i\.id\}\),)\i/,
replace: "$1$self.getCharCounter(arguments[0].textValue)"
}
]
},
{
find: "#{intl::PREMIUM_MESSAGE_LENGTH_UPSELL_TOOLTIP}",
@ -55,9 +60,9 @@ export default definePlugin({
}
return (
<div className="vc-char-counter" style={{ color }}>
<span className="vc-char-count">{length}</span>/
<span className="vc-char-max">{charMax}</span>
<div className={cl("counter")} style={{ color }}>
<span className={cl("count")} >{length}</span>/
<span className={cl("max")} >{charMax}</span>
</div>
);
}

View file

@ -1,4 +1,4 @@
.vc-char-counter {
.vc-char-counter-counter {
font-size: 12px;
color: var(--text-muted);
position: absolute;
@ -8,12 +8,9 @@
z-index: 2;
background: transparent;
transition: color 0.3s ease;
margin-right: 5px;
}
.vc-char-counter .vc-char-count {
.vc-char-counter-counter .vc-char-counter-count {
transition: color 0.3s ease;
}
.vc-char-counter .vc-char-max {
color: var(--primary-330);
}

View file

@ -154,8 +154,8 @@ export default definePlugin({
{
find: ".CREATE_FORUM_POST||",
replacement: {
match: /(textValue:.{0,50}channelId:\i\.id\}\)),\i/,
replace: "$1,$self.renderUploadProgress()"
match: /(textValue:.{0,50}channelId:\i\.id\}\))(?:,\i(,))?/,
replace: "$1,$self.renderUploadProgress()$2"
}
}
],

View file

@ -18,7 +18,7 @@
.vc-file-upload-progress-label {
font-size: 12px;
color: var(--header-primary);
color: var(--text-default);
}
.vc-file-upload-progress-meta {
@ -58,7 +58,7 @@
.vc-file-upload-progress-file {
font-size: 11px;
color: var(--header-secondary);
color: var(--text-default);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -70,4 +70,4 @@
.vc-file-upload-progress-wrap[data-phase="success"] .vc-file-upload-progress-fill {
background: var(--status-positive);
}
}