Skip to content

Commit

Permalink
PlatformIndicators v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Strencher committed Nov 9, 2023
1 parent 412058e commit 36d5ab2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
6 changes: 5 additions & 1 deletion PlatformIndicators/components/indicators.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.indicatorContainer {
display: inline-flex;
vertical-align: bottom;
margin-bottom: 2px;
margin-left: 5px;

svg {
Expand Down Expand Up @@ -33,3 +32,8 @@
border-right: thin solid var(--background-modifier-hover);
height: 22px;
}

div[id*=message-reply] .indicatorContainer.type_Chat {
margin-left: 0;
margin-right: 2px;
}
2 changes: 1 addition & 1 deletion PlatformIndicators/components/settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function SwitchItem(props) {
value={value}
children={props.name}
onChange={value => {
Settings.set(props.id, !value);
Settings.set(props.id, value);
}}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion PlatformIndicators/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "APlatformIndicators",
"version": "1.5.0",
"version": "1.5.1",
"authors": [
{
"name": "Strencher",
Expand Down
22 changes: 6 additions & 16 deletions scripts/new-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,15 @@ function makeMeta(manifest) {
}

const styleLoader = `
import manifest from "@manifest";
import {DOM} from "@api";
export default {
sheets: [],
_element: null,
load() {
if (this._element) return;
this._element = Object.assign(document.createElement("style"), {
textContent: this.sheets.join("\\n"),
id: manifest.name
});
document.head.appendChild(this._element);
DOM.addStyle(this.sheets.join("\\n"));
},
unload() {
this._element?.remove();
this._element = null;
DOM.removeStyle();
}
}`;

Expand Down Expand Up @@ -141,7 +135,7 @@ const watcher = watch({
get "@manifest"() {return "export default " + fs.readFileSync(manifestPath, "utf8");},
"@api":
"import manifest from \"@manifest\";" +
"export const {Data, Patcher, DOM, ReactUtils, Utils, Webpack, UI, ContextMenu} = new BdApi(manifest.name);",
"export const {Net, Data, Patcher, ReactUtils, Utils, Webpack, UI, ContextMenu, DOM} = new BdApi(manifest.name);",
}),
{

Expand Down Expand Up @@ -205,12 +199,8 @@ watcher.on("event", async event => {
let {output: [{code}]} = await bundle.generate({format: "cjs", exports: "auto"});

code = code.replace(/var (\w+) =/, "const $1 =");
code = jsBeautify(code, {
indent_size: 4,
indent_char: " ",
end_with_newline: true,
brace_style: "preserve-inline"
});
code = code.replaceAll("/* @__PURE__ */ ", "");
code = jsBeautify(code, {});

const contents = makeMeta(manifest) + code;

Expand Down

0 comments on commit 36d5ab2

Please sign in to comment.