Small changes, fixing linux build

This commit is contained in:
Jean Ouina 2020-08-01 11:05:17 +02:00
parent 80b2b93b51
commit 0ca1af9b74
21 changed files with 560 additions and 438 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -289,13 +289,13 @@
left: 25px; left: 25px;
display: block !important; display: block !important;
cursor: pointer; cursor: pointer;
color: #FFF; color: var(--header-primary);
position: fixed; position: fixed;
} }
#removemenu ul a { #removemenu ul a {
text-decoration: none; text-decoration: none;
color: #FFF; color: var(--header-primary);
padding: 3px; padding: 3px;
} }
@ -370,7 +370,7 @@
background: var(--background-secondary); background: var(--background-secondary);
box-shadow: rgba(0, 0, 0, 0.1) 1px 0 0 0; box-shadow: rgba(0, 0, 0, 0.1) 1px 0 0 0;
flex-grow: 1; flex-grow: 1;
color: #FFF; color: var(--header-primary);
} }
.theme-light #bda-qem button { .theme-light #bda-qem button {
@ -413,7 +413,7 @@
.theme-light #bda-qem button.active, .theme-light #bda-qem button.active,
.theme-light #bda-qem button.active:hover { .theme-light #bda-qem button.active:hover {
color: #ffffff; color: var(--header-primary);
} }
#bda-qem-twitch-container, #bda-qem-twitch-container,
@ -459,8 +459,8 @@
#bd-pub-button { #bd-pub-button {
border-radius: 4px; border-radius: 4px;
background-color: rgb(47, 49, 54); background-color: var(--background-secondary);
color: #b9bbbe; color: var(--header-secondary);
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
@ -475,7 +475,7 @@
width: 0; width: 0;
line-height: 24px; line-height: 24px;
font-size: 12px; font-size: 12px;
color: #b9bbbe; color: var(--header-secondary);
font-weight: 700; font-weight: 700;
margin-right: 10px; margin-right: 10px;
} }
@ -588,7 +588,7 @@
} }
#pubslayer .ui-tab-bar-item.selected { #pubslayer .ui-tab-bar-item.selected {
color: #fff; color: var(--header-primary);
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
} }
@ -626,7 +626,7 @@
#pubslayer button { #pubslayer button {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: var(--header-primary);
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
line-height: 16px; line-height: 16px;
@ -949,7 +949,7 @@
.bd-pfbtn { .bd-pfbtn {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: #fff;
border-radius: 5px; border-radius: 5px;
margin-left: 10px; margin-left: 10px;
} }
@ -983,7 +983,7 @@
.theme-dark .ui-tab-bar-item.selected { .theme-dark .ui-tab-bar-item.selected {
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
color: #fff; color: var(--header-primary);
} }
.theme-light .ui-tab-bar-item { .theme-light .ui-tab-bar-item {
@ -997,7 +997,7 @@
.theme-light .ui-tab-bar-item.selected { .theme-light .ui-tab-bar-item.selected {
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
color: #fff; color: var(--header-primary);
} }
.ui-tab-bar-header { .ui-tab-bar-header {
@ -1287,7 +1287,7 @@
.bd-addon-list .bd-card-footer button { .bd-addon-list .bd-card-footer button {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: #fff;
border-radius: 5px; border-radius: 5px;
display: block; display: block;
margin-left: auto; margin-left: auto;
@ -1421,7 +1421,7 @@
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .2); box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .2);
padding: 12px 20px; padding: 12px 20px;
z-index: 1; z-index: 1;
color: #fff; color: var(--header-primary);
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
line-height: 19px; line-height: 19px;
@ -1429,7 +1429,7 @@
.bd-modal-wrapper .bd-modal-body { .bd-modal-wrapper .bd-modal-body {
background-color: var(--background-primary); background-color: var(--background-primary);
color: #fff; color: var(--header-primary);
flex-direction: row; flex-direction: row;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
@ -1459,7 +1459,7 @@
.bd-modal-wrapper .footer button { .bd-modal-wrapper .footer button {
background-color: var(--bd-blue); background-color: var(--bd-blue);
color: #fff; color: var(--header-primary);
min-height: 32px; min-height: 32px;
min-width: 60px; min-width: 60px;
align-items: center; align-items: center;
@ -1504,20 +1504,20 @@
.bd-modal-wrapper .tab-bar-container .tab-bar-item { .bd-modal-wrapper .tab-bar-container .tab-bar-item {
margin: 0 15px; margin: 0 15px;
padding: 15px 0; padding: 15px 0;
color: #fff !important; color: var(--header-primary) !important;
opacity: 0.5; opacity: 0.5;
transition: opacity 200ms ease; transition: opacity 200ms ease;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
} }
.bd-modal-wrapper .tab-bar-container .tab-bar-item:hover { .bd-modal-wrapper .tab-bar-container .tab-bar-item:hover {
border-color: #fff; border-color: var(--header-primary);
cursor: pointer; cursor: pointer;
} }
.bd-modal-wrapper .tab-bar-container .tab-bar-item.selected { .bd-modal-wrapper .tab-bar-container .tab-bar-item.selected {
opacity: 1; opacity: 1;
border-color: #fff; border-color: var(--header-primary);
} }
.bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item { .bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item {
@ -1527,7 +1527,7 @@
.bd-modal-wrapper .table-header { .bd-modal-wrapper .table-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
color: #fff; color: var(--header-primary);
font-weight: 700; font-weight: 700;
padding-bottom: 10px; padding-bottom: 10px;
margin: 3px 15px 0 15px; margin: 3px 15px 0 15px;
@ -1557,7 +1557,7 @@
.bd-modal-wrapper .error { .bd-modal-wrapper .error {
display: flex; display: flex;
color: #fff; color: var(--header-primary);
border-bottom: 1px solid rgba(255, 255, 255, 0.25); border-bottom: 1px solid rgba(255, 255, 255, 0.25);
padding: 15px 0; padding: 15px 0;
align-items: center; align-items: center;
@ -1600,7 +1600,7 @@
border-radius: 5px; border-radius: 5px;
box-shadow: 0 0 0 1px rgba(32, 34, 37, .6), 0 2px 10px 0 rgba(0, 0, 0, .2); box-shadow: 0 0 0 1px rgba(32, 34, 37, .6), 0 2px 10px 0 rgba(0, 0, 0, .2);
font-weight: 500; font-weight: 500;
color: #fff; color: var(--header-primary);
user-select: text; user-select: text;
font-size: 14px; font-size: 14px;
opacity: 1; opacity: 1;
@ -1608,6 +1608,18 @@
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
} }
.theme-light .bd-toast.toast-error,
.theme-light .bd-toast.toast-danger,
.theme-light .bd-toast.toast-warning,
.theme-light .bd-toast.toast-warn,
.theme-light .bd-toast.toast-success,
.theme-light .bd-toast.toast-info {
color: #fff;
}
.theme-light .bd-toast {
box-shadow: 0 0 0 1px rgba(223, 221, 218, .6), 0 2px 10px 0 rgba(255, 255, 255, .2);
}
@keyframes bd-toast-down { @keyframes bd-toast-down {
to { to {
@ -2068,7 +2080,7 @@
content: ""; content: "";
display: block; display: block;
position: absolute; position: absolute;
background-color: #fff; background-color: var(--header-primary);
z-index: 1; z-index: 1;
width: 18px; width: 18px;
margin: 3px; margin: 3px;
@ -2210,9 +2222,15 @@
white-space: pre; white-space: pre;
} }
.bd-select .bd-select-option:hover, .bd-select .bd-select-option:hover {
background: var(--background-modifier-hover);
}
.bd-select .bd-select-option:active {
background: var(--background-modifier-active);
}
.bd-select .bd-select-option.selected { .bd-select .bd-select-option.selected {
background: #26272B; background: var(--background-modifier-selected);
} }
@ -2223,17 +2241,20 @@
border-radius: 3px; border-radius: 3px;
outline: none; outline: none;
border: 0; border: 0;
background-color: #202225; background-color: var(--background-secondary);
color: #fff; color: var(--text-normal);
display: flex; display: flex;
align-items: center; align-items: center;
} }
.bd-search-wrapper.focused {
background-color: var(--background-modifier-selected)
}
.bd-search { .bd-search {
padding: 2px 3px; padding: 2px 3px;
background: none; background: none;
border: 0; border: 0;
color: #fff; color: var(--header-primary);
flex: 1; flex: 1;
} }

File diff suppressed because one or more lines are too long

View File

@ -3702,7 +3702,8 @@
"js-tokens": { "js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
}, },
"jsesc": { "jsesc": {
"version": "2.5.2", "version": "2.5.2",
@ -3886,6 +3887,7 @@
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"dev": true,
"requires": { "requires": {
"js-tokens": "^3.0.0 || ^4.0.0" "js-tokens": "^3.0.0 || ^4.0.0"
} }
@ -4278,7 +4280,8 @@
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true
}, },
"object-copy": { "object-copy": {
"version": "0.1.0", "version": "0.1.0",
@ -4676,16 +4679,6 @@
"integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=",
"dev": true "dev": true
}, },
"prop-types": {
"version": "15.7.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
"integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
"requires": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.8.1"
}
},
"prr": { "prr": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
@ -4772,21 +4765,6 @@
"safe-buffer": "^5.1.0" "safe-buffer": "^5.1.0"
} }
}, },
"react": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz",
"integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2"
}
},
"react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"read-pkg": { "read-pkg": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",

View File

@ -145,6 +145,7 @@ Core.prototype.patchPopoutWindow = async function() {
.then(popoutModule => { .then(popoutModule => {
if(canceled)return if(canceled)return
/*
// Not a good idea to do it like that. // Not a good idea to do it like that.
const interceptor = window.Lightcord.DiscordModules.dispatcher._interceptor const interceptor = window.Lightcord.DiscordModules.dispatcher._interceptor
window.Lightcord.DiscordModules.dispatcher.setInterceptor(function(action){ window.Lightcord.DiscordModules.dispatcher.setInterceptor(function(action){
@ -173,7 +174,7 @@ Core.prototype.patchPopoutWindow = async function() {
const window = popoutModule.default.getWindow(ev.key) const window = popoutModule.default.getWindow(ev.key)
console.log(window) console.log(window)
}) })
}) })*/
}) })
}; };

View File

@ -201,26 +201,22 @@ export default class Utils {
static showToast(content, options = {}) { static showToast(content, options = {}) {
if (!document.querySelector(".bd-toasts")) { if (!document.querySelector(".bd-toasts")) {
const container = document.querySelector("."+removeDa(BDModules.get(e => e.sidebar && e.hasNotice)[0].sidebar)+" + div") || null; const container = document.querySelector("."+removeDa(BDModules.get(e => e.sidebar && e.hasNotice)[0].sidebar)+" + div") || null;
const memberlist = container ? container.querySelector("."+removeDa(BDModules.get(e => e.membersWrap)[0].membersWrap)) : null;
const form = container ? container.querySelector("form") : null; const form = container ? container.querySelector("form") : null;
const left = container ? container.getBoundingClientRect().left : 310;
const right = memberlist ? memberlist.getBoundingClientRect().left : 0;
const width = right ? right - container.getBoundingClientRect().left : Utils.screenWidth - left - 240;
const bottom = form ? form.offsetHeight : 80; const bottom = form ? form.offsetHeight : 80;
const toastWrapper = document.createElement("div"); const toastWrapper = document.createElement("div");
toastWrapper.classList.add("bd-toasts"); toastWrapper.classList.add("bd-toasts");
toastWrapper.style.setProperty("left", left + "px");
toastWrapper.style.setProperty("width", width + "px");
toastWrapper.style.setProperty("bottom", bottom+"px"); toastWrapper.style.setProperty("bottom", bottom+"px");
document.querySelector("#app-mount").appendChild(toastWrapper); document.querySelector("#app-mount").appendChild(toastWrapper);
} }
const toastWrapper = document.querySelector(".bd-toasts")
const {type = "", icon = true, timeout = 3000} = options; const {type = "", icon = true, timeout = 3000} = options;
const toastElem = document.createElement("div"); const toastElem = document.createElement("div");
toastElem.classList.add("bd-toast"); toastElem.classList.add("bd-toast");
if (type) toastElem.classList.add("toast-" + type); if (type) toastElem.classList.add("toast-" + type);
if (type && icon) toastElem.classList.add("icon"); if (type && icon) toastElem.classList.add("icon");
toastElem.innerText = content; toastElem.innerText = content;
document.querySelector(".bd-toasts").appendChild(toastElem); toastWrapper.appendChild(toastElem);
toastWrapper.style.setProperty("left", `calc(50% - ${toastWrapper.offsetWidth / 2}px)`);
setTimeout(() => { setTimeout(() => {
toastElem.classList.add("closing"); toastElem.classList.add("closing");
setTimeout(() => { setTimeout(() => {

View File

@ -289,13 +289,13 @@
left: 25px; left: 25px;
display: block !important; display: block !important;
cursor: pointer; cursor: pointer;
color: #FFF; color: var(--header-primary);
position: fixed; position: fixed;
} }
#removemenu ul a { #removemenu ul a {
text-decoration: none; text-decoration: none;
color: #FFF; color: var(--header-primary);
padding: 3px; padding: 3px;
} }
@ -370,7 +370,7 @@
background: var(--background-secondary); background: var(--background-secondary);
box-shadow: rgba(0, 0, 0, 0.1) 1px 0 0 0; box-shadow: rgba(0, 0, 0, 0.1) 1px 0 0 0;
flex-grow: 1; flex-grow: 1;
color: #FFF; color: var(--header-primary);
} }
.theme-light #bda-qem button { .theme-light #bda-qem button {
@ -413,7 +413,7 @@
.theme-light #bda-qem button.active, .theme-light #bda-qem button.active,
.theme-light #bda-qem button.active:hover { .theme-light #bda-qem button.active:hover {
color: #ffffff; color: var(--header-primary);
} }
#bda-qem-twitch-container, #bda-qem-twitch-container,
@ -459,8 +459,8 @@
#bd-pub-button { #bd-pub-button {
border-radius: 4px; border-radius: 4px;
background-color: rgb(47, 49, 54); background-color: var(--background-secondary);
color: #b9bbbe; color: var(--header-secondary);
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
@ -475,7 +475,7 @@
width: 0; width: 0;
line-height: 24px; line-height: 24px;
font-size: 12px; font-size: 12px;
color: #b9bbbe; color: var(--header-secondary);
font-weight: 700; font-weight: 700;
margin-right: 10px; margin-right: 10px;
} }
@ -588,7 +588,7 @@
} }
#pubslayer .ui-tab-bar-item.selected { #pubslayer .ui-tab-bar-item.selected {
color: #fff; color: var(--header-primary);
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
} }
@ -626,7 +626,7 @@
#pubslayer button { #pubslayer button {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: var(--header-primary);
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
line-height: 16px; line-height: 16px;
@ -949,7 +949,7 @@
.bd-pfbtn { .bd-pfbtn {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: #fff;
border-radius: 5px; border-radius: 5px;
margin-left: 10px; margin-left: 10px;
} }
@ -983,7 +983,7 @@
.theme-dark .ui-tab-bar-item.selected { .theme-dark .ui-tab-bar-item.selected {
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
color: #fff; color: var(--header-primary);
} }
.theme-light .ui-tab-bar-item { .theme-light .ui-tab-bar-item {
@ -997,7 +997,7 @@
.theme-light .ui-tab-bar-item.selected { .theme-light .ui-tab-bar-item.selected {
background-color: var(--background-modifier-selected); background-color: var(--background-modifier-selected);
color: #fff; color: var(--header-primary);
} }
.ui-tab-bar-header { .ui-tab-bar-header {
@ -1287,7 +1287,7 @@
.bd-addon-list .bd-card-footer button { .bd-addon-list .bd-card-footer button {
background: var(--bd-blue); background: var(--bd-blue);
color: #FFF; color: #fff;
border-radius: 5px; border-radius: 5px;
display: block; display: block;
margin-left: auto; margin-left: auto;
@ -1421,7 +1421,7 @@
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .2); box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .2);
padding: 12px 20px; padding: 12px 20px;
z-index: 1; z-index: 1;
color: #fff; color: var(--header-primary);
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
line-height: 19px; line-height: 19px;
@ -1429,7 +1429,7 @@
.bd-modal-wrapper .bd-modal-body { .bd-modal-wrapper .bd-modal-body {
background-color: var(--background-primary); background-color: var(--background-primary);
color: #fff; color: var(--header-primary);
flex-direction: row; flex-direction: row;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
@ -1459,7 +1459,7 @@
.bd-modal-wrapper .footer button { .bd-modal-wrapper .footer button {
background-color: var(--bd-blue); background-color: var(--bd-blue);
color: #fff; color: var(--header-primary);
min-height: 32px; min-height: 32px;
min-width: 60px; min-width: 60px;
align-items: center; align-items: center;
@ -1504,20 +1504,20 @@
.bd-modal-wrapper .tab-bar-container .tab-bar-item { .bd-modal-wrapper .tab-bar-container .tab-bar-item {
margin: 0 15px; margin: 0 15px;
padding: 15px 0; padding: 15px 0;
color: #fff !important; color: var(--header-primary) !important;
opacity: 0.5; opacity: 0.5;
transition: opacity 200ms ease; transition: opacity 200ms ease;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
} }
.bd-modal-wrapper .tab-bar-container .tab-bar-item:hover { .bd-modal-wrapper .tab-bar-container .tab-bar-item:hover {
border-color: #fff; border-color: var(--header-primary);
cursor: pointer; cursor: pointer;
} }
.bd-modal-wrapper .tab-bar-container .tab-bar-item.selected { .bd-modal-wrapper .tab-bar-container .tab-bar-item.selected {
opacity: 1; opacity: 1;
border-color: #fff; border-color: var(--header-primary);
} }
.bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item { .bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item {
@ -1527,7 +1527,7 @@
.bd-modal-wrapper .table-header { .bd-modal-wrapper .table-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
color: #fff; color: var(--header-primary);
font-weight: 700; font-weight: 700;
padding-bottom: 10px; padding-bottom: 10px;
margin: 3px 15px 0 15px; margin: 3px 15px 0 15px;
@ -1557,7 +1557,7 @@
.bd-modal-wrapper .error { .bd-modal-wrapper .error {
display: flex; display: flex;
color: #fff; color: var(--header-primary);
border-bottom: 1px solid rgba(255, 255, 255, 0.25); border-bottom: 1px solid rgba(255, 255, 255, 0.25);
padding: 15px 0; padding: 15px 0;
align-items: center; align-items: center;
@ -1600,7 +1600,7 @@
border-radius: 5px; border-radius: 5px;
box-shadow: 0 0 0 1px rgba(32, 34, 37, .6), 0 2px 10px 0 rgba(0, 0, 0, .2); box-shadow: 0 0 0 1px rgba(32, 34, 37, .6), 0 2px 10px 0 rgba(0, 0, 0, .2);
font-weight: 500; font-weight: 500;
color: #fff; color: var(--header-primary);
user-select: text; user-select: text;
font-size: 14px; font-size: 14px;
opacity: 1; opacity: 1;
@ -1608,6 +1608,18 @@
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
} }
.theme-light .bd-toast.toast-error,
.theme-light .bd-toast.toast-danger,
.theme-light .bd-toast.toast-warning,
.theme-light .bd-toast.toast-warn,
.theme-light .bd-toast.toast-success,
.theme-light .bd-toast.toast-info {
color: #fff;
}
.theme-light .bd-toast {
box-shadow: 0 0 0 1px rgba(223, 221, 218, .6), 0 2px 10px 0 rgba(255, 255, 255, .2);
}
@keyframes bd-toast-down { @keyframes bd-toast-down {
to { to {
@ -2068,7 +2080,7 @@
content: ""; content: "";
display: block; display: block;
position: absolute; position: absolute;
background-color: #fff; background-color: var(--header-primary);
z-index: 1; z-index: 1;
width: 18px; width: 18px;
margin: 3px; margin: 3px;
@ -2210,9 +2222,15 @@
white-space: pre; white-space: pre;
} }
.bd-select .bd-select-option:hover, .bd-select .bd-select-option:hover {
background: var(--background-modifier-hover);
}
.bd-select .bd-select-option:active {
background: var(--background-modifier-active);
}
.bd-select .bd-select-option.selected { .bd-select .bd-select-option.selected {
background: #26272B; background: var(--background-modifier-selected);
} }
@ -2223,17 +2241,20 @@
border-radius: 3px; border-radius: 3px;
outline: none; outline: none;
border: 0; border: 0;
background-color: #202225; background-color: var(--background-secondary);
color: #fff; color: var(--text-normal);
display: flex; display: flex;
align-items: center; align-items: center;
} }
.bd-search-wrapper.focused {
background-color: var(--background-modifier-selected)
}
.bd-search { .bd-search {
padding: 2px 3px; padding: 2px 3px;
background: none; background: none;
border: 0; border: 0;
color: #fff; color: var(--header-primary);
flex: 1; flex: 1;
} }

View File

@ -15,6 +15,7 @@ import BdApi from "../modules/bdApi";
import Utils from "../modules/utils"; import Utils from "../modules/utils";
import TooltipWrap from "./tooltipWrap"; import TooltipWrap from "./tooltipWrap";
import bdEvents from "../modules/bdEvents"; import bdEvents from "../modules/bdEvents";
import EmulatedTooltip from "./tooltip";
const Tooltip = WebpackModules.findByDisplayName("Tooltip"); const Tooltip = WebpackModules.findByDisplayName("Tooltip");
@ -174,9 +175,14 @@ export default class CardList extends BDV2.reactComponent {
if(typeof window.PluginUpdates.checkAll !== "function")return null if(typeof window.PluginUpdates.checkAll !== "function")return null
if(!this.isPlugins)return null if(!this.isPlugins)return null
let tooltipIsShowing = false
let tooltip
return <TooltipWrap text="Checks for updates of plugins that support this feature. Right-click for a list."> return <TooltipWrap text="Checks for updates of plugins that support this feature. Right-click for a list.">
<span style={{marginLeft: "10px"}}> <span style={{marginLeft: "10px"}} onMouseLeave={() => {
<Lightcord.Api.Components.inputs.Button color="brand" look="filled" size="min" hoverColor="default" onClick={() => { tooltipIsShowing = false
tooltip.hide()
}}>
<Lightcord.Api.Components.inputs.Button ref="checkUpdateButton" color="brand" look="filled" size="min" hoverColor="default" onClick={() => {
try{ try{
Utils.showToast("Plugin update check in progress.", {type: "info"}) Utils.showToast("Plugin update check in progress.", {type: "info"})
window.PluginUpdates.checkAll() window.PluginUpdates.checkAll()
@ -190,7 +196,17 @@ export default class CardList extends BDV2.reactComponent {
console.error(e) console.error(e)
Utils.showToast("An error occured while checking update.", {type: "error"}) Utils.showToast("An error occured while checking update.", {type: "error"})
} }
}} wrapper={false} disabled={false}> }} wrapper={false} disabled={false} onRightClick={() => {
if(!this.refs.checkUpdateButton)return
if (!window.PluginUpdates || !window.PluginUpdates.plugins) return;
if(tooltipIsShowing)return
tooltip = new EmulatedTooltip(this.refs.checkUpdateButton.refs.original.refs.button, Object.values(window.PluginUpdates.plugins).map(p => p.name).join(", "), {
side: "bottom",
attachEvents: false
})
tooltip.show()
tooltipIsShowing = true
}}>
Check for Updates Check for Updates
</Lightcord.Api.Components.inputs.Button> </Lightcord.Api.Components.inputs.Button>
</span> </span>
@ -209,7 +225,13 @@ export default class CardList extends BDV2.reactComponent {
const addonCards = this.getAddons(); const addonCards = this.getAddons();
return <ContentColumn title={`${this.props.type.toUpperCase()}${addonCards.length}`}> return <ContentColumn title={`${this.props.type.toUpperCase()}${addonCards.length}`}>
<button key="folder-button" className="bd-button bd-pfbtn" onClick={this.openFolder.bind(this)}>Open {this.isPlugins ? "Plugin" : "Theme"} Folder</button> <Lightcord.Api.Components.inputs.Button key="folder-button" color="brand"
look="filled" size="min" hoverColor="default" onClick={this.openFolder.bind(this)} wrapper={false}
style={{
marginLeft: "10px"
}}>
Open {this.isPlugins ? "Plugin" : "Theme"} Folder
</Lightcord.Api.Components.inputs.Button>
{this.renderCheckUpdates()} {this.renderCheckUpdates()}
{!settingsCookie["fork-ps-5"] && refreshIcon} {!settingsCookie["fork-ps-5"] && refreshIcon}
<div className="bd-controls bd-addon-controls"> <div className="bd-controls bd-addon-controls">

View File

@ -4,9 +4,23 @@ import SearchIcon from "../icons/search";
const React = BDV2.React; const React = BDV2.React;
export default class Search extends React.Component { export default class Search extends React.Component {
constructor(props){
super(props)
this.state = {
focused: false
}
}
render() { render() {
return <div className="bd-search-wrapper"> const className = ["bd-search-wrapper"]
<input onChange={this.props.onChange} onKeyDown={this.props.onKeyDown} type="text" className="bd-search" placeholder={this.props.placeholder} maxLength="50" /> if(this.state.focused)className.push("focused")
return <div className={className.join(" ")}>
<input onChange={this.props.onChange} onKeyDown={this.props.onKeyDown} type="text"
className="bd-search" placeholder={this.props.placeholder} maxLength="50"
onFocus={() => {
this.setState({focused: true})
}} onBlur={() => {
this.setState({focused: false})
}}/>
<SearchIcon /> <SearchIcon />
</div>; </div>;
} }

View File

@ -7,6 +7,7 @@ export default class Switch extends React.Component {
super(props); super(props);
this.state = {checked: this.props.checked}; this.state = {checked: this.props.checked};
this.onChange = this.onChange.bind(this); this.onChange = this.onChange.bind(this);
this.switch = <Lightcord.Api.Components.inputs.Switch onChange={this.onChange} value={this.state.checked} />
} }
onChange(value) { onChange(value) {
@ -16,6 +17,6 @@ export default class Switch extends React.Component {
} }
render() { render() {
return <Lightcord.Api.Components.inputs.Switch onChange={this.onChange} value={this.state.checked} /> return this.switch
} }
} }

View File

@ -35,8 +35,8 @@ export default class SwitchItem extends BDV2.reactComponent {
} }
return BDV2.react.createElement("div", {className: "ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item"}, return BDV2.react.createElement("div", {className: "ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item"},
BDV2.react.createElement("div", {className: "ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap"}, BDV2.react.createElement("div", {className: "ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap"},
BDV2.react.createElement("h3", {className: "ui-form-title h3 margin-reset margin-reset ui-flex-child"}, text), BDV2.react.createElement("h3", {key: "title", className: "ui-form-title h3 margin-reset margin-reset ui-flex-child"}, text),
BDV2.react.createElement(Switch, {onChange: this.onChange, checked: this.props.checked}) BDV2.react.createElement(Switch, {key: "switch", onChange: this.onChange, checked: this.props.checked})
), ),
BDV2.react.createElement("div", {className: "ui-form-text style-description margin-top-4", style: {flex: "1 1 auto"}}, info) BDV2.react.createElement("div", {className: "ui-form-text style-description margin-top-4", style: {flex: "1 1 auto"}}, info)
); );

View File

@ -38,13 +38,6 @@ const toPx = function(value) {
return `${value}px`; return `${value}px`;
}; };
/* <div class="layer-v9HyYc da-layer" style="left: 234.5px; bottom: 51px;">
<div class="tooltip-2QfLtc da-tooltip tooltipTop-XDDSxx tooltipBlack-PPG47z">
<div class="tooltipPointer-3ZfirK da-tooltipPointer"></div>
User Settings
</div>
</div> */
export default class EmulatedTooltip { export default class EmulatedTooltip {
/** /**
* *
@ -56,9 +49,10 @@ export default class EmulatedTooltip {
* @param {string} [options.side=top] - can be any of top, right, bottom, left * @param {string} [options.side=top] - can be any of top, right, bottom, left
* @param {boolean} [options.preventFlip=false] - prevents moving the tooltip to the opposite side if it is too big or goes offscreen * @param {boolean} [options.preventFlip=false] - prevents moving the tooltip to the opposite side if it is too big or goes offscreen
* @param {boolean} [options.disabled=false] - whether the tooltip should be disabled from showing on hover * @param {boolean} [options.disabled=false] - whether the tooltip should be disabled from showing on hover
* @param {boolean} [options.attachEvents=true] - whether the tooltip should listen to mouseenter and mouseleave events.
*/ */
constructor(node, text, options = {}) { constructor(node, text, options = {}) {
const {style = "black", side = "top", preventFlip = false, disabled = false} = options; const {style = "black", side = "top", preventFlip = false, disabled = false, attachEvents = true} = options;
this.node = node instanceof jQuery ? node[0] : node; this.node = node instanceof jQuery ? node[0] : node;
this.label = text; this.label = text;
this.style = style.toLowerCase(); this.style = style.toLowerCase();
@ -85,6 +79,7 @@ export default class EmulatedTooltip {
this.tooltipElement.append(this.labelElement); this.tooltipElement.append(this.labelElement);
this.element.append(this.tooltipElement); this.element.append(this.tooltipElement);
if(attachEvents){
this.node.addEventListener("mouseenter", () => { this.node.addEventListener("mouseenter", () => {
if (this.disabled) return; if (this.disabled) return;
this.show(); this.show();
@ -108,6 +103,7 @@ export default class EmulatedTooltip {
this.hide(); this.hide();
}); });
} }
}
/** Container where the tooltip will be appended. */ /** Container where the tooltip will be appended. */
get container() { get container() {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,17 +1,20 @@
import WebpackLoader from "../../modules/WebpackLoader" import WebpackLoader from "../../modules/WebpackLoader"
import { MouseEventHandler, ReactNode } from "react" import { ReactNode, CSSProperties } from "react"
import NOOP from "../../modules/noop"
let ButtonModules let ButtonModules
type ButtonProps = { type ButtonProps = {
children?: ReactNode, children?: ReactNode,
onClick?: MouseEventHandler, onClick?: () => void,
color?: ButtonColor, color?: ButtonColor,
wrapper?: boolean, wrapper?: boolean,
look?: ButtonLook, look?: ButtonLook,
size?: ButtonSize, size?: ButtonSize,
hoverColor?: ButtonHovers, hoverColor?: ButtonHovers,
disabled?: boolean disabled?: boolean,
style?: CSSProperties,
onRightClick?: () => void
} }
export default class Button extends React.Component<ButtonProps, {hover: boolean}> { export default class Button extends React.Component<ButtonProps, {hover: boolean}> {
constructor(props:ButtonProps){ constructor(props:ButtonProps){
@ -72,6 +75,16 @@ export default class Button extends React.Component<ButtonProps, {hover: boolean
}else{ }else{
props.disabled = false props.disabled = false
} }
if("style" in this.props){
props.style = this.props.style
}else{
props.style = {}
}
if("onRightClick" in this.props){
props.onRightClick = this.props.onRightClick
}else{
props.onRightClick = NOOP
}
} }
if(props.color){ if(props.color){
@ -123,19 +136,19 @@ export default class Button extends React.Component<ButtonProps, {hover: boolean
if(hover)hover = " " + hover if(hover)hover = " " + hover
let button = <button type="button" let button = <button type="button"
className={`${flexModule.flexChild} ${euhModule1.button} ${colorsModule.ButtonLooks[props.look.toUpperCase()]} ${colorsModule.ButtonColors[props.color.toUpperCase()]}${buttonSize}${hoverColor}${hover} ${euhModule1.grow}`} ref="button" className={`${flexModule.flexChild} ${euhModule1.button} ${colorsModule.ButtonLooks[props.look.toUpperCase()]} ${colorsModule.ButtonColors[props.color.toUpperCase()]}${buttonSize}${hoverColor}${hover} ${euhModule1.grow}`}
style={{flex: "0 1 auto"}} onClick={this.props.onClick} onMouseEnter={(ev) => { style={{flex: "0 1 auto", ...props.style}} onClick={() => props.onClick()} onMouseEnter={(ev) => {
if(!hoverColor)return if(!hoverColor)return
this.setState({hover: true}) this.setState({hover: true})
}} onMouseLeave={(ev) => { }} onMouseLeave={(ev) => {
if(!hoverColor)return if(!hoverColor)return
this.setState({hover: false}) this.setState({hover: false})
}} disabled={props.disabled}> }} disabled={props.disabled} onContextMenu={() => props.onRightClick()}>
<div className={euhModule1.contents}>{props.children}</div> <div className={euhModule1.contents}>{props.children}</div>
</button> </button>
if(props.wrapper){ if(props.wrapper){
return <div className={buttonModule.buttonWrapper}> return <div ref="wrapper" className={buttonModule.buttonWrapper}>
{button} {button}
</div> </div>
} }

View File

@ -79,7 +79,7 @@ export function createProxyErrorCatcherClass<base = Function>(Class:base):base &
const ClassCopy = (class Proxied extends React.Component { const ClassCopy = (class Proxied extends React.Component {
render(){ render(){
return <ErrorCatcher key={uuid()}> return <ErrorCatcher key={uuid()}>
{React.createElement(Class as any, {...this.props, key: uuid()})} {React.createElement(Class as any, {ref: "original", ...this.props, key: uuid()})}
</ErrorCatcher> </ErrorCatcher>
} }

View File

@ -442,7 +442,7 @@ async function privateInit(){
data.friend_suggestion_count = data.friend_suggestion_count || 0 data.friend_suggestion_count = data.friend_suggestion_count || 0
data.presences = data.presences || [] data.presences = data.presences || []
}else{ }else{
logger.log(`Logged in as an user. Skipping`) logger.log(`Logged in as an user. Skipping user spoofing.`)
} }
} }
let returnValue = _handleDispatch.call(this, ...arguments) let returnValue = _handleDispatch.call(this, ...arguments)

View File

@ -15,6 +15,7 @@ function forwardToCurrentWebview(event){
}] }]
} }
/** discord_desktop_core Stable */
ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_FOCUS")) ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_FOCUS"))
ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_BLUR")) ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_BLUR"))
ipc.on(...forwardToCurrentWebview("SYSTEM_TRAY_OPEN_VOICE_SETTINGS")) ipc.on(...forwardToCurrentWebview("SYSTEM_TRAY_OPEN_VOICE_SETTINGS"))
@ -37,6 +38,10 @@ ipc.on(...forwardToCurrentWebview("ACCESSIBILITY_SUPPORT_CHANGED"))
ipc.on(...forwardToCurrentWebview("HELP_OPEN")) ipc.on(...forwardToCurrentWebview("HELP_OPEN"))
ipc.on(...forwardToCurrentWebview("USER_SETTINGS_OPEN")) ipc.on(...forwardToCurrentWebview("USER_SETTINGS_OPEN"))
ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_PATH")) ipc.on(...forwardToCurrentWebview("MAIN_WINDOW_PATH"))
/** discord_desktop_core Development */
ipc.on(...forwardToCurrentWebview("NAVIGATE_BACK"))
ipc.on(...forwardToCurrentWebview("NAVIGATE_FORWARD"))
ipc.on("RELOAD", () => { ipc.on("RELOAD", () => {
let webview = webviews.get(document.querySelector(".chrome-tab[active]")) let webview = webviews.get(document.querySelector(".chrome-tab[active]"))
if(!webview)return if(!webview)return

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "lightcord", "name": "lightcord",
"version": "0.1.3", "version": "0.1.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -14,7 +14,8 @@
"build:minify": "node build.js", "build:minify": "node build.js",
"build:after": "node afterbuild.js", "build:after": "node afterbuild.js",
"devInstall": "npm i --save-dev --arch=ia32 electron@8.4.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\"", "devInstall": "npm i --save-dev --arch=ia32 electron@8.4.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\"",
"devInstall:64": "npm i --save-dev --arch=x64 electron@8.4.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\"" "devInstall:64": "npm i --save-dev --arch=x64 electron@8.4.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\"",
"versions": "echo Electron: && electron -v && echo Typescript: && tsc -v"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",