Lightcord/LightcordApi/js/main.js

2296 lines
247 KiB
JavaScript
Raw Normal View History

2020-06-10 16:16:33 +02:00
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
/******/ })
/************************************************************************/
/******/ ({
2020-06-16 15:51:21 +02:00
/***/ "./src/alias/react-dom.ts":
/*!********************************!*\
!*** ./src/alias/react-dom.ts ***!
\********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
module.exports = window["Reac" + "tDOM"];
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/components/components.ts":
/*!**************************************!*\
!*** ./src/components/components.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const Button_1 = __webpack_require__(/*! ./inputs/Button */ "./src/components/inputs/Button.tsx");
const Switch_1 = __webpack_require__(/*! ./inputs/Switch */ "./src/components/inputs/Switch.tsx");
const RadioGroup_1 = __webpack_require__(/*! ./inputs/RadioGroup */ "./src/components/inputs/RadioGroup.tsx");
const TextArea_1 = __webpack_require__(/*! ./inputs/TextArea */ "./src/components/inputs/TextArea.tsx");
const TextInput_1 = __webpack_require__(/*! ./inputs/TextInput */ "./src/components/inputs/TextInput.tsx");
const Dropdown_1 = __webpack_require__(/*! ./inputs/Dropdown */ "./src/components/inputs/Dropdown.tsx");
const Title_1 = __webpack_require__(/*! ./general/Title */ "./src/components/general/Title.tsx");
const SettingsTitle_1 = __webpack_require__(/*! ./general/SettingsTitle */ "./src/components/general/SettingsTitle.tsx");
const Tabs_1 = __webpack_require__(/*! ./general/Tabs */ "./src/components/general/Tabs.tsx");
const SettingSubTitle_1 = __webpack_require__(/*! ./general/SettingSubTitle */ "./src/components/general/SettingSubTitle.tsx");
const CodeBlock_1 = __webpack_require__(/*! ./general/CodeBlock */ "./src/components/general/CodeBlock.tsx");
const cloneNullProto_1 = __webpack_require__(/*! ../modules/cloneNullProto */ "./src/modules/cloneNullProto.ts");
const Tooltip_1 = __webpack_require__(/*! ./general/Tooltip */ "./src/components/general/Tooltip.ts");
2020-07-11 21:29:08 +02:00
const ColorPicker_1 = __webpack_require__(/*! ./inputs/ColorPicker */ "./src/components/inputs/ColorPicker.tsx");
const AlertBox_1 = __webpack_require__(/*! ./general/AlertBox */ "./src/components/general/AlertBox.tsx");
2020-07-10 01:44:40 +02:00
exports.default = cloneNullProto_1.default({
inputs: cloneNullProto_1.default({
Button: Button_1.default,
Switch: Switch_1.default,
Choices: RadioGroup_1.default,
RadioGroup: RadioGroup_1.default,
TextArea: TextArea_1.default,
TextInput: TextInput_1.default,
2020-07-11 21:29:08 +02:00
Dropdown: Dropdown_1.default,
ColorPicker: ColorPicker_1.default
2020-07-10 01:44:40 +02:00
}),
general: cloneNullProto_1.default({
Title: Title_1.default,
SettingsTitle: SettingsTitle_1.default,
SettingSubTitle: SettingSubTitle_1.default,
Tabs: Tabs_1.default,
CodeBlock: CodeBlock_1.default,
2020-07-11 21:29:08 +02:00
Tooltip: Tooltip_1.default,
AlertBox: AlertBox_1.default
2020-07-10 01:44:40 +02:00
})
});
2020-06-16 15:51:21 +02:00
2020-07-11 21:29:08 +02:00
/***/ }),
/***/ "./src/components/general/AlertBox.tsx":
/*!*********************************************!*\
!*** ./src/components/general/AlertBox.tsx ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let AlertBoxModules;
class AlertBox extends React.Component {
get modules() {
return AlertBoxModules || (AlertBoxModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "Markdown" && e.default.defaultProps.parser).default
]);
}
render() {
const [Markdown] = this.modules;
let wrap;
let children;
if (typeof this.props.children === "string") {
wrap = Markdown.prototype.render.call({
props: Object.assign({
className: "",
children: this.props.children
}, Markdown.defaultProps)
});
children = wrap.props.children;
}
else {
wrap = Markdown.prototype.render.call({
props: Object.assign({
className: "",
children: ""
}, Markdown.defaultProps)
});
children = this.props.children;
}
wrap.props.children = React.createElement("div", { className: "lc-alert-box lc-alert-box-" + this.props.type },
React.createElement("blockquote", { className: "lc-blockquote" }, children));
2020-07-11 21:29:08 +02:00
return wrap;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: "***Discord's*** **Markdown** _is_ [supported](https://google.com) or you can just insert your own react childs."
}
], [
{
type: "info"
2020-07-11 21:29:08 +02:00
},
{
type: "success"
2020-07-11 21:29:08 +02:00
},
{
type: "warn"
2020-07-11 21:29:08 +02:00
},
{
type: "error"
2020-07-11 21:29:08 +02:00
}
]);
return AllPreviews;
})();
}
}
exports.default = AlertBox;
AlertBox.defaultProps = {
type: "info",
children: null
};
AlertBox.help = {
info: "You can insert markdown (as string) or normal react childs",
warn: "All string will be interpreted as markdown. If you want raw string, pass an array with the string inside."
};
let AllPreviews;
2020-06-26 21:05:09 +02:00
/***/ }),
/***/ "./src/components/general/CodeBlock.tsx":
/*!**********************************************!*\
!*** ./src/components/general/CodeBlock.tsx ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let CodeBlockModules;
class CodeBlock extends React.Component {
get modules() {
return CodeBlockModules || (CodeBlockModules = [
WebpackLoader_1.default.find(e => e.markup),
WebpackLoader_1.default.find(e => e.messageContent),
WebpackLoader_1.default.find(e => e.scrollbarGhostHairline),
WebpackLoader_1.default.find(e => e.highlight),
WebpackLoader_1.default.find(e => e.marginBottom8)
]);
}
render() {
let [messageModule1, messageModule2, scrollbarModule1, hightlightJS, marginModule1] = this.modules;
const code = this.props.language === "plaintext" ? React.createElement("code", { className: `${scrollbarModule1.scrollbarGhostHairline} hljs` }, this.props.content) : React.createElement("code", { className: `${scrollbarModule1.scrollbarGhostHairline} hljs`, dangerouslySetInnerHTML: { __html: hightlightJS.highlight(this.props.language, this.props.content).value } });
return (React.createElement("div", { className: `${messageModule1.markup} ${messageModule2.messageContent}` },
React.createElement("pre", null, code),
React.createElement("div", { className: marginModule1.marginBottom8 })));
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
content: "console.log(\"Exemple code\")"
}
]);
AllPreviews.push([
{
language: "js"
},
{
language: "plaintext"
},
...CodeBlock.prototype.modules[3].listLanguages().filter(e => e !== "js").map(e => ({ language: e }))
]);
return AllPreviews;
})();
}
}
exports.default = CodeBlock;
CodeBlock.defaultProps = {
language: "plaintext",
content: ""
};
let AllPreviews;
2020-06-26 21:05:09 +02:00
/***/ }),
/***/ "./src/components/general/SettingSubTitle.tsx":
/*!****************************************************!*\
!*** ./src/components/general/SettingSubTitle.tsx ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let TitleModules;
class SettingSubTitle extends React.Component {
get modules() {
return TitleModules || (TitleModules = [
WebpackLoader_1.default.find(e => typeof e.marginTop60 === "string"),
WebpackLoader_1.default.findByUniqueProperties(["h5"]),
window.Lightcord.Api.WebpackLoader.findByUniqueProperties(["size14"]),
window.Lightcord.Api.WebpackLoader.findByUniqueProperties(["colorStandard"])
]);
}
render() {
let [marginModule, titleModule, sizeModule, colorModule] = this.modules;
let props = this.props;
let className = `${colorModule.colorStandard} ${sizeModule.size14} ${titleModule.h5} ${marginModule.marginBottom4}`;
if (props.className)
className = +" " + props.className;
return React.createElement("h5", { className }, props.children);
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: "Exemple title"
}
]);
return AllPreviews;
})();
}
}
exports.default = SettingSubTitle;
SettingSubTitle.defaultProps = {
children: [],
className: ""
};
let AllPreviews;
2020-06-26 21:05:09 +02:00
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/components/general/SettingsTitle.tsx":
/*!**************************************************!*\
!*** ./src/components/general/SettingsTitle.tsx ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const Title_1 = __webpack_require__(/*! ./Title */ "./src/components/general/Title.tsx");
let TitleModules;
class SettingsTitle extends React.Component {
constructor(props) {
super(props);
}
get modules() {
return TitleModules || (TitleModules = [
WebpackLoader_1.default.find(e => typeof e.marginTop60 === "string")
]);
}
render() {
let [marginModule] = this.modules;
let props = this.props;
let className = `${marginModule.marginTop60} ${marginModule.marginBottom20}`;
if (props.className)
className = +" " + props.className;
return React.createElement(Title_1.default, { className }, props.children);
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: "Exemple title"
}
]);
return AllPreviews;
})();
}
}
exports.default = SettingsTitle;
SettingsTitle.defaultProps = {
children: [""],
className: ""
};
let AllPreviews;
2020-06-26 21:05:09 +02:00
/***/ }),
/***/ "./src/components/general/Tabs.tsx":
/*!*****************************************!*\
!*** ./src/components/general/Tabs.tsx ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tab = void 0;
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const Title_1 = __webpack_require__(/*! ./Title */ "./src/components/general/Title.tsx");
class Tabs extends React.Component {
constructor(props) {
super(props);
this.tabsElements = [];
this.state = {
active: this.props.active || null
};
}
get tabs() {
return this.props.tabs || [];
}
changeTab(tab) {
if (tab === this.state.active)
return;
if (this.props.onChange)
this.props.onChange(tab);
this.setState({
active: tab
});
this.tabsElements.forEach(e => e.setActive(tab === e.props.id));
}
render() {
return (React.createElement("div", { className: "lc-tabWrapper", style: this.props.style },
React.createElement("div", { className: "lc-tabnav", style: { flex: "0 1 auto" } }, this.tabs.map(tab => {
return React.createElement(Tab, { TabContainer: this, title: tab.label, id: tab.id, key: btoa(tab.label + ":" + tab.id) });
})),
React.createElement("div", { className: "lc-tab" }, this.props.children)));
}
isActive(tab) {
return this.state.active === tab;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: (React.createElement("div", { style: { marginTop: "20px", marginBottom: "20px" } },
React.createElement("div", { style: {
backgroundColor: "var(--background-primary)",
padding: "30px 30px",
borderRadius: "8px"
}, className: "lc-tab-box-shadow" },
React.createElement(Title_1.default, null, "Preview tabs"))))
}
], [
{
tabs: [
{
label: "Active tab",
id: "1"
},
{
label: "Unactive tab",
id: "2"
}
]
}
], [
{
active: "1"
}
], [
{
onChange: (tabId) => { }
}
]);
return AllPreviews;
})();
}
}
exports.default = Tabs;
Tabs.defaultProps = {
children: null,
tabs: [{ label: "No tabs was passed to <Tabs>.", id: "none" }],
active: null,
onChange: noop_1.default,
style: {}
};
let AllPreviews;
class Tab extends React.Component {
constructor(props) {
super(props);
this.state = {
active: props.TabContainer.isActive(props.id)
};
this.props.TabContainer.tabsElements.push(this);
}
setActive(isActive) {
this.setState({
active: !!isActive
});
}
render() {
let className = `lc-navItem`;
if (this.state.active) {
className += ` lc-navItemActive`;
}
else {
className += ` lc-navItemInactive`;
}
return (React.createElement("div", { className: className, onClick: () => {
this.props.TabContainer.changeTab(this.props.id);
} }, this.props.title));
}
}
exports.Tab = Tab;
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/components/general/Title.tsx":
/*!******************************************!*\
!*** ./src/components/general/Title.tsx ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let TitleModules;
class Title extends React.Component {
constructor(props) {
super(props);
}
get modules() {
return TitleModules || (TitleModules = [
WebpackLoader_1.default.find(e => typeof e.colorStandard === "string"),
WebpackLoader_1.default.find(e => typeof e.size32 === "string"),
WebpackLoader_1.default.find(e => typeof e.h2 === "string")
]);
}
render() {
let [colorModule, sizeModule, titleModule] = this.modules;
let props = this.props;
let className = `${colorModule.colorStandard} ${sizeModule.size14} ${titleModule.h2} ${titleModule.defaultColor} ${titleModule.defaultMarginh2}`;
if (props.className)
className += " " + props.className;
return React.createElement("h2", { className }, props.children);
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: "Exemple title"
}
]);
return AllPreviews;
})();
}
}
exports.default = Title;
Title.defaultProps = {
children: null,
className: null
};
let AllPreviews;
2020-06-16 15:51:21 +02:00
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/components/general/Tooltip.ts":
/*!*******************************************!*\
!*** ./src/components/general/Tooltip.ts ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const excludeProperties_1 = __webpack_require__(/*! ../../modules/excludeProperties */ "./src/modules/excludeProperties.ts");
let TooltipModules;
class Tooltip extends React.Component {
constructor(props) {
super(props);
}
get modules() {
return TooltipModules || (TooltipModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "Tooltip")
]);
}
render() {
let [Tooltip] = this.modules;
let props = excludeProperties_1.default(this.props, ["children"]);
return React.createElement(Tooltip.default, props, (data) => {
return React.createElement("div", Object.assign(Object.assign({}, data), { style: {
width: "fit-content",
height: "fit-content"
} }), this.props.children);
});
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
children: React.createElement(window.Lightcord.Api.Components.inputs.Button, {
color: "green",
look: "ghost",
size: "small",
hoverColor: "yellow",
onClick: () => { },
wrapper: false
}, "Hover this button to see the tooltip")
}
]);
AllPreviews.push([
{
text: "Example Tooltip Text"
}
]);
let colors = [];
Tooltip.Colors.forEach(color => {
colors.push({
color: color
});
});
AllPreviews.push(colors);
let positions = [];
Tooltip.Positions.forEach(p => {
positions.push({
position: p
});
});
AllPreviews.push(positions);
return AllPreviews;
})();
}
}
exports.default = Tooltip;
Tooltip.defaultProps = {
children: null,
text: "No text was passed to Tooltip",
position: "top",
color: "brand"
};
Tooltip.Positions = ["top", "left", "right", "bottom"];
Tooltip.Colors = ["black", "grey", "brand", "green", "yellow", "red"];
let AllPreviews;
2020-07-04 22:42:26 +02:00
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/components/inputs/Button.tsx":
/*!******************************************!*\
!*** ./src/components/inputs/Button.tsx ***!
\******************************************/
2020-06-10 16:16:33 +02:00
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let ButtonModules;
class Button extends React.Component {
constructor(props) {
super(props);
this.state = {
hover: false
};
}
get modules() {
return ButtonModules || (ButtonModules = [
WebpackLoader_1.default.findByUniqueProperties(["_horizontal"]),
WebpackLoader_1.default.findByUniqueProperties(["colorTransparent"]),
WebpackLoader_1.default.findByUniqueProperties(["buttonWrapper"]),
WebpackLoader_1.default.findByUniqueProperties(["ButtonColors"]),
]);
}
render() {
let [flexModule, euhModule1, buttonModule, colorsModule,] = this.modules;
let props = {};
if (this.props) {
if ("color" in this.props) {
props.color = this.props.color;
}
if ("children" in this.props) {
props.children = this.props.children;
}
if ("onClick" in this.props) {
props.onClick = this.props.onClick;
}
if ("wrapper" in this.props) {
props.wrapper = !!this.props.wrapper;
}
if ("look" in this.props) {
props.look = this.props.look;
}
if ("size" in this.props) {
props.size = this.props.size;
}
if ("hoverColor" in this.props) {
props.hoverColor = this.props.hoverColor;
}
if ("disabled" in this.props) {
props.disabled = this.props.disabled;
}
else {
props.disabled = false;
}
}
if (props.color) {
props.color = props.color.toLowerCase();
if (!Button.Colors.includes(props.color)) {
props.color = Button.Colors[0];
}
}
else {
props.color = Button.Colors[0];
}
if (props.look) {
props.look = props.look.toLowerCase();
if (!Button.Looks.includes(props.look)) {
props.look = Button.Looks[0];
}
}
else {
props.look = Button.Looks[0];
}
if (props.size) {
props.size = props.size.toLowerCase();
if (!Button.Sizes.includes(props.size)) {
props.size = Button.Sizes[0];
}
}
else {
props.size = Button.Sizes[0];
}
if (props.hoverColor) {
props.hoverColor = props.hoverColor.toLowerCase();
if (!Button.HoverColors.includes(props.hoverColor)) {
props.hoverColor = Button.HoverColors[0];
}
}
else {
props.hoverColor = Button.HoverColors[0];
}
let buttonSize = props.size ? colorsModule.ButtonSizes[props.size.toUpperCase()] || "" : "";
if (buttonSize)
buttonSize = " " + buttonSize;
let hoverColor = props.hoverColor ? colorsModule.ButtonHovers[props.hoverColor.toUpperCase()] || "" : "";
if (hoverColor)
hoverColor = " " + hoverColor;
props.onClick = typeof props.onClick === "function" ? props.onClick : () => { };
if (typeof props.wrapper !== "boolean")
props.wrapper = true;
let hover = this.state.hover ? euhModule1.hasHover : "";
if (hover)
hover = " " + hover;
let button = React.createElement("button", { type: "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) => {
if (!hoverColor)
return;
this.setState({ hover: true });
}, onMouseLeave: (ev) => {
if (!hoverColor)
return;
this.setState({ hover: false });
}, disabled: props.disabled },
React.createElement("div", { className: euhModule1.contents }, props.children));
if (props.wrapper) {
return React.createElement("div", { className: buttonModule.buttonWrapper }, button);
}
return button;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
let colors = [];
for (let color of Button.Colors) {
colors.push({
color: color
});
}
AllPreviews.push(colors);
let looks = [];
for (let look of Button.Looks) {
looks.push({
look: look
});
}
AllPreviews.push(looks);
let sizes = [];
for (let size of Button.Sizes) {
sizes.push({
size: size
});
}
AllPreviews.push(sizes);
let hovers = [];
for (let hover of Button.HoverColors) {
hovers.push({
hoverColor: hover
});
}
AllPreviews.push(hovers);
AllPreviews.push([{ children: "Test Button" }]);
AllPreviews.push([{ onClick: () => { } }]);
AllPreviews.push([{ wrapper: false }]);
AllPreviews.push([{ disabled: false }, { disabled: true }]);
return AllPreviews;
})();
}
}
exports.default = Button;
Button.Colors = ["brand", "grey", "red", "green", "yellow", "primary", "link", "white", "black", "transparent"];
Button.Looks = ["filled", "inverted", "outlined", "ghost", "link", "blank"];
Button.Sizes = ["small", "medium", "large", "xlarge", "min", "max", "icon", "none"];
Button.HoverColors = ["default", ...Button.Colors];
let AllPreviews;
2020-06-10 16:16:33 +02:00
2020-07-11 21:29:08 +02:00
/***/ }),
/***/ "./src/components/inputs/ColorPicker.tsx":
/*!***********************************************!*\
!*** ./src/components/inputs/ColorPicker.tsx ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const Utils_1 = __webpack_require__(/*! ../../modules/Utils */ "./src/modules/Utils.ts");
const Constants = {
defaultColor: 10070709,
baseColors: [
1752220,
3066993,
3447003,
10181046,
15277667,
15844367,
15105570,
15158332,
9807270,
6323595,
1146986,
2067276,
2123412,
7419530,
11342935,
12745742,
11027200,
10038562,
9936031,
5533306
]
};
let ColorPickerModules;
let isFetching = null;
/**
* This componennt needs to be loaded. As a result, you may experience 100-300ms loading the first time.
* Render will return `null` before loaded.
*/
2020-07-11 21:29:08 +02:00
class ColorPicker extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
value: props.value || null,
lastColor: this.props.value
};
this.onChange = this.onChange.bind(this);
}
/** Preload the component. */
static preload() {
if (ColorPicker.prototype.modules[0])
return;
if (isFetching)
return;
new ColorPicker({}).render();
}
2020-07-11 21:29:08 +02:00
onChange(val) {
this.props.onChange(val);
this.setState({
value: val
});
this.forceUpdate();
}
get modules() {
return ColorPickerModules || (ColorPickerModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "ColorPicker")
]);
}
renderColorPicker() {
let [ColorPickerComponent] = this.modules;
if (!ColorPickerComponent) {
if (isFetching) { // support for multiple color picker
isFetching.then(() => this.forceUpdate());
return null;
}
2020-07-11 21:29:08 +02:00
ColorPickerModules = null;
let resolve;
isFetching = new Promise(res => (resolve = res));
const GuildSettingsRoles = new (WebpackLoader_1.default.find(e => e.default && e.default.displayName && e.default.displayName.includes("GuildSettingsRoles")).default)().render().type;
const settings = GuildSettingsRoles.prototype.renderRoleSettings.call({
props: {
guild: {
roles: [],
id: null,
isOwner: () => false
},
currentUser: {
id: null
}
},
getSelectedRole() {
return {
id: null
};
}
});
const GuildRoleSettings = settings.props.children.type;
let children = GuildRoleSettings.prototype.renderColorPicker.call({
props: {
role: {
id: null,
color: 0
},
locked: false,
everyone: false
}
}).props.children;
children.type(children.props).props.children.type._ctor().then(c => {
this.forceUpdate();
resolve();
});
return null;
}
return React.createElement(ColorPickerComponent.default, { colors: this.props.baseColors, defaultColor: this.props.defaultColor, value: this.state.value, disabled: this.props.disabled, onChange: this.onChange, customColor: this.props.customColor });
}
render() {
if (this.state.lastColor !== this.props.value) {
this.state = {
value: this.props.value,
lastColor: this.props.value
};
}
return this.renderColorPicker();
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([
{
disabled: false
},
{
disabled: true
}
], [
{
value: Utils_1.default.HexColorToDecimal("#7289DA")
}, {
value: null
}
], [
{
onChange: (color) => { }
}
]);
return AllPreviews;
})();
}
}
exports.default = ColorPicker;
ColorPicker.defaultProps = {
defaultColor: Constants.defaultColor,
customColor: null,
baseColors: Constants.baseColors,
value: null,
disabled: false,
onChange: noop_1.default
};
ColorPicker.help = {
info: "To convert hex colors to decimal, you can do `Lightcord.Api.Utils.HexColorToDecimal('#yourcolor')` and go back with `Lightcord.Api.Utils.DecimalColorToHex(7506394)`",
warn: "The component may not appear instantly. The component need to be loaded, so you could experience 50-300ms loading time depending on your internet connection."
2020-07-11 21:29:08 +02:00
};
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/Dropdown.tsx":
/*!********************************************!*\
!*** ./src/components/inputs/Dropdown.tsx ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let DropdownModules;
class Dropdown extends React.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.state = {
value: props.value || null
};
}
onChange(value) {
this.props.onChange(value);
this.setState({
value: value
});
}
get modules() {
return DropdownModules || (DropdownModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "SelectTempWrapper").default
]);
}
render() {
let [DropdownComponent] = this.modules;
let props = this.props;
let returnValue = React.createElement(DropdownComponent, Object.assign({}, props, { onChange: this.onChange, value: this.state.value }));
return returnValue;
}
get value() {
return this.state.value;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
error: null
}, {
error: "An error occured"
}], [{
options: [
{
value: "option1",
label: "Option 1"
},
{
value: "option2",
label: "Option 2"
},
{
value: "option3",
label: "Option 3"
}
]
}], [{
value: "option1"
}], [{
disabled: false
}, {
disabled: true
}], [{
searchable: true
}, {
searchable: false
}], [{
clearable: true
}, {
clearable: false
}], [{
isMulti: false
}, {
isMulti: true
}]);
return AllPreviews;
})();
}
}
exports.default = Dropdown;
Dropdown.defaultProps = {
className: null,
error: null,
options: [{
value: "none",
"label": "No options - No options was passed to Dropdown. If you meant to put an empty dropdown, input an empty array."
}],
valueRenderer: null,
multiValueRenderer: null,
optionRenderer: null,
onChange: noop_1.default,
value: null,
disabled: false,
searchable: false,
clearable: false,
styleOverrides: null,
lightThemeColorOverrides: null,
darkThemeColorOverrides: null,
isMulti: false
};
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/RadioGroup.tsx":
/*!**********************************************!*\
!*** ./src/components/inputs/RadioGroup.tsx ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
let RadioGroupModule;
class RadioGroup extends React.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.state = {
value: props.value
};
}
onChange(ev) {
this.props.onChange(ev.value);
this.setState({
value: ev.value
});
}
get modules() {
return RadioGroupModule || (RadioGroupModule = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "RadioGroup").default
]);
}
render() {
let [RadioGroupComponent] = this.modules;
let props = this.props;
return React.createElement(RadioGroupComponent, { options: props.options, onChange: this.onChange, value: this.state.value, disabled: props.disabled, size: RadioGroupComponent.Sizes[props.size.toUpperCase()], itemType: RadioGroupComponent.ItemTypes[props.itemType.toUpperCase()], infoClassName: props.infoClassName });
}
get value() {
return this.state.value;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
options: [
{
value: "option1",
name: "Option 1",
desc: "description 1"
},
{
value: "option2",
name: "Option 2",
desc: "description 2"
},
{
value: "option3",
name: "Option 3",
desc: "description 3"
}
]
}], [{
value: "option1"
}], [{
disabled: false
}, {
disabled: true
}], [{
size: "medium"
}, {
size: "small"
}], [{
itemType: "bar"
}, {
itemType: "panel"
}]);
return AllPreviews;
})();
}
}
exports.default = RadioGroup;
RadioGroup.defaultProps = {
options: [{
value: "none",
name: "No options",
desc: "No options was passed to Choices. If you meant to display no options at all, please pass an empty array.",
color: "#f04747"
}],
value: null,
disabled: false,
size: "medium",
itemType: "bar",
infoClassName: null,
onChange: noop_1.default
};
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/Switch.tsx":
/*!******************************************!*\
!*** ./src/components/inputs/Switch.tsx ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
let SwitchModules;
class Switch extends React.Component {
constructor(props) {
super(props);
this.state = {
value: props.value || false
};
this.onChange = this.onChange.bind(this);
}
get modules() {
return SwitchModules || (SwitchModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "Switch").default
]);
}
render() {
let [SwitchComponent] = this.modules;
let props = this.props;
return (React.createElement(SwitchComponent, { id: props.id, onChange: this.onChange, value: this.state.value || false, fill: props.fill, theme: SwitchComponent.Themes[props.theme.toUpperCase()], disabled: props.disabled, className: props.className, size: SwitchComponent.Sizes[props.size.toUpperCase()], style: props.style }));
}
onChange(value) {
this.props.onChange(!this.state.value);
this.setState({
value: !this.state.value
});
}
get value() {
return this.state.value;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{ onChange: (value) => { } }]);
AllPreviews.push([{
value: false
}], [{
theme: "default"
}, {
theme: "clear"
}], [{
disabled: false
}, {
disabled: true
}], [{
id: "api-preview-switch"
}], [{
fill: null
}], [{
size: "default"
}, {
size: "mini"
}], [{
style: {}
}]);
return AllPreviews;
})();
}
}
exports.default = Switch;
Switch.defaultProps = {
id: null,
onChange: noop_1.default,
value: false,
fill: null,
theme: "default",
disabled: false,
className: null,
size: "default",
style: {}
};
2020-07-11 21:29:08 +02:00
Switch.help = {
error: "The `clear` option doesn't work well on light theme."
};
2020-07-10 01:44:40 +02:00
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/TextArea.tsx":
/*!********************************************!*\
!*** ./src/components/inputs/TextArea.tsx ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
let TextAreaModules;
class TextArea extends React.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.onFocus = this.onFocus.bind(this);
this.onBlur = this.onBlur.bind(this);
this.onKeyDown = this.onKeyDown.bind(this);
this.state = {
value: props.value || ""
};
}
get modules() {
return TextAreaModules || (TextAreaModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "TextArea").default
]);
}
onChange(value, name) {
this.props.onChange(value, name);
this.setState({
value
});
}
onFocus(ev, name) {
this.props.onFocus(ev, name);
}
onBlur(ev, name) {
this.props.onBlur(ev, name);
}
onKeyDown(ev) {
this.props.onKeyDown(ev);
}
render() {
let [TextAreaComponent] = this.modules;
let props = this.props;
return React.createElement(TextAreaComponent, Object.assign({}, props, { onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, value: this.state.value }));
}
get value() {
return this.state.value || "";
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
name: "api-preview-textarea"
}]);
AllPreviews.push([{
disabled: false
}, {
disabled: true
}]);
AllPreviews.push([{
placeholder: null
}]);
AllPreviews.push([{
autoFocus: false
}, {
autoFocus: true
}]);
AllPreviews.push([{
resizeable: false
}, {
resizeable: true
}]);
AllPreviews.push([{
flex: false
}, {
flex: true
}]);
AllPreviews.push([{
autosize: false
}, {
autosize: true
}]);
AllPreviews.push([{
rows: 3
}, {
rows: 2
}, {
rows: 1
}]);
AllPreviews.push([{
value: ""
}]);
AllPreviews.push([{
error: null
}, {
error: "Example error"
}]);
AllPreviews.push([{
maxLength: 100
}]);
AllPreviews.push([{
className: ""
}]);
AllPreviews.push([{
inputClassName: ""
}]);
AllPreviews.push([{
id: "api-preview-textarea"
}]);
return AllPreviews;
})();
}
}
exports.default = TextArea;
TextArea.defaultProps = {
name: null,
disabled: false,
placeholder: null,
autoFocus: false,
resizeable: false,
flex: false,
autosize: false,
rows: 3,
value: "",
error: null,
maxLength: null,
className: null,
id: null,
onChange: noop_1.default,
onFocus: noop_1.default,
onBlur: noop_1.default,
onKeyDown: noop_1.default
};
2020-07-11 21:29:08 +02:00
TextArea.help = {
warn: "This should be used for multi line inputs."
};
2020-07-10 01:44:40 +02:00
let AllPreviews;
/***/ }),
2020-06-16 15:51:21 +02:00
/***/ "./src/components/inputs/TextInput.tsx":
/*!*********************************************!*\
!*** ./src/components/inputs/TextInput.tsx ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
let TextInputModules;
class TextInput extends React.PureComponent {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.onFocus = this.onFocus.bind(this);
this.onBlur = this.onBlur.bind(this);
this.state = {
value: props.value || ""
};
}
get modules() {
return TextInputModules || (TextInputModules = [
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "TextInput").default
]);
}
onChange(value, name) {
this.hasSet = false;
this.props.onChange(value, name, this);
if (this.hasSet)
return; // prevent event if the onChange has changed the value.
this.setState({
value
});
this.forceUpdate();
}
onFocus(ev, name) {
this.props.onFocus(ev, name, this);
}
onBlur(ev, name) {
this.props.onBlur(ev, name, this);
}
render() {
let [TextAreaComponent] = this.modules;
let props = this.props;
return React.createElement(TextAreaComponent, Object.assign({}, props, { onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, value: this.state.value }));
}
get value() {
return this.state.value || "";
}
setValue(value) {
this.setState({
value: value
});
this.forceUpdate();
this.hasSet = true;
}
static get AllPreviews() {
return AllPreviews || (() => {
AllPreviews = [];
AllPreviews.push([{
name: "api-preview-textinput"
}], [{
size: "default"
}, {
size: "mini"
}], [{
disabled: false
}, {
disabled: true
}], [{
placeholder: ""
}], [{
value: ""
}], [{
error: null
}, {
error: "Example error"
}], [{
maxLength: 999
}], [{
className: ""
}], [{
inputClassName: ""
}], [{
id: "api-preview-textinput"
}], [{
onChange: (value, name) => { }
}]);
return AllPreviews;
})();
}
}
exports.default = TextInput;
TextInput.defaultProps = {
name: "",
size: "default",
disabled: false,
placeholder: "",
value: "",
error: null,
maxLength: 999,
className: "",
inputClassName: "",
id: null,
onChange: noop_1.default,
onFocus: noop_1.default,
onBlur: noop_1.default
};
2020-07-11 21:29:08 +02:00
TextInput.help = {
warn: "This should be used for single line inputs."
};
2020-07-10 01:44:40 +02:00
let AllPreviews;
/***/ }),
/***/ "./src/components/private/Notice.tsx":
/*!*******************************************!*\
!*** ./src/components/private/Notice.tsx ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultNotice = void 0;
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const Notices_1 = __webpack_require__(/*! ./Notices */ "./src/components/private/Notices.tsx");
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
let NoticeModules;
exports.defaultNotice = {
text: "",
id: "unknown id",
onClick: noop_1.default,
buttonText: null,
type: "default"
};
class Notice extends React.Component {
get modules() {
return NoticeModules || (NoticeModules = [
WebpackLoader_1.default.find(e => e.noticeInfo)
]);
}
render() {
const [noticeClasses] = this.modules;
const className = noticeClasses["notice" + this.props.type.slice(0, 1).toUpperCase() + this.props.type.slice(1)];
if (!className) {
Notices_1.notices.pop();
setImmediate(() => {
Notices_1.events.emit("noticeUpdate");
});
return null;
}
const button = this.props.buttonText ? React.createElement("button", { className: noticeClasses.button, onClick: () => {
Notices_1.notices.pop();
this.props.onClick();
Notices_1.events.emit("noticeUpdate");
} }, this.props.buttonText) : null;
return React.createElement("div", { className: className },
React.createElement("div", { className: noticeClasses.dismiss, role: "button", tabIndex: 0, onClick: () => {
Notices_1.notices.pop();
Notices_1.events.emit("noticeUpdate");
} }),
this.props.text,
button);
}
}
exports.default = Notice;
Notice.displayName = "LightcordNotice";
Notice.defaultProps = exports.defaultNotice;
/***/ }),
/***/ "./src/components/private/Notices.tsx":
/*!********************************************!*\
!*** ./src/components/private/Notices.tsx ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.notices = exports.events = void 0;
const Notice_1 = __webpack_require__(/*! ./Notice */ "./src/components/private/Notice.tsx");
const events_1 = __webpack_require__(/*! events */ "events");
exports.events = new events_1.EventEmitter();
class Notices extends React.Component {
constructor(props) {
super(props);
this.noticeHandler = this.noticeHandler.bind(this);
}
noticeHandler() {
this.forceUpdate();
}
componentWillMount() {
exports.events.on("noticeUpdate", this.noticeHandler);
}
componentWillUnmount() {
exports.events.off("noticeUpdate", this.noticeHandler);
}
render() {
if (!this.hasNotice)
return null;
const notice = exports.notices[0];
return React.createElement(Notice_1.default, Object.assign({}, notice));
}
get hasNotice() {
return exports.notices.length > 0;
}
}
exports.default = Notices;
Notices.displayName = "LightcordNotices";
Notices.defaultProps = {};
exports.notices = [];
2020-06-10 16:16:33 +02:00
/***/ }),
/***/ "./src/index.ts":
/*!**********************!*\
!*** ./src/index.ts ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const WebpackLoader_1 = __webpack_require__(/*! ./modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
const components_1 = __webpack_require__(/*! ./components/components */ "./src/components/components.ts");
const uuid_1 = __webpack_require__(/*! ./modules/uuid */ "./src/modules/uuid.ts");
const Utils_1 = __webpack_require__(/*! ./modules/Utils */ "./src/modules/Utils.ts");
const DiscordTools_1 = __webpack_require__(/*! ./modules/DiscordTools */ "./src/modules/DiscordTools.ts");
const patchers = __webpack_require__(/*! ./modules/patchers */ "./src/modules/patchers.ts");
patchers.patch();
2020-07-10 01:44:40 +02:00
const LightcordApi = {
WebpackLoader: WebpackLoader_1.default,
Components: components_1.default,
uuid: uuid_1.default,
Utils: Utils_1.default,
DiscordTools: DiscordTools_1.default
2020-07-10 01:44:40 +02:00
};
exports.default = LightcordApi;
Object.assign(window.Lightcord.Api, LightcordApi);
2020-06-10 16:16:33 +02:00
/***/ }),
/***/ "./src/modules/DiscordTools.ts":
/*!*************************************!*\
!*** ./src/modules/DiscordTools.ts ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Notice = void 0;
const Notices_1 = __webpack_require__(/*! ../components/private/Notices */ "./src/components/private/Notices.tsx");
const Utils_1 = __webpack_require__(/*! ./Utils */ "./src/modules/Utils.ts");
const uuid_1 = __webpack_require__(/*! ./uuid */ "./src/modules/uuid.ts");
const cloneNullProto_1 = __webpack_require__(/*! ./cloneNullProto */ "./src/modules/cloneNullProto.ts");
const events_1 = __webpack_require__(/*! events */ "events");
const Notice_1 = __webpack_require__(/*! ../components/private/Notice */ "./src/components/private/Notice.tsx");
const excludeProperties_1 = __webpack_require__(/*! ./excludeProperties */ "./src/modules/excludeProperties.ts");
const noop_1 = __webpack_require__(/*! ./noop */ "./src/modules/noop.ts");
const WebpackLoader_1 = __webpack_require__(/*! ./WebpackLoader */ "./src/modules/WebpackLoader.ts");
let soundModule;
exports.default = new class DiscordTools {
showNotice(data) {
if (typeof data !== "object" || typeof data.text !== "string")
throw new Error(`This notice is not valid. Given: ${Utils_1.default.formatJSObject(data)}`);
let newData = cloneNullProto_1.default(Object.assign({}, Notice_1.defaultNotice, data));
newData.id = uuid_1.default();
Notices_1.notices.push(newData);
Notices_1.events.emit("noticeUpdate");
const notice = new Notice(newData);
return notice;
}
get notices() {
return Notices_1.notices.map(data => new Notice(data));
}
/**
* Quickly send notification (Even when no focused.)
* @param data The notification. Be sure to include all properties except functions cause they're optional.
* Notifications have a timeout of 3-5 seconds.
* They look like this: https://i.imgur.com/jzuxKKu.png
*/
showNotification(data) {
const notification = new window.Notification(data.title, excludeProperties_1.default(data, [
"title",
"onClick",
"onClose",
"onShow"
]));
notification.onclick = data.onClick || noop_1.default;
notification.onshow = data.onShow || noop_1.default;
notification.onclose = data.onClose || noop_1.default;
return notification;
}
playSound(sound) {
soundModule = soundModule || WebpackLoader_1.default.findByUniqueProperties(["createSound"]);
if (!soundModule)
throw new WebpackLoader_1.WebpackLoaderError("Couldn't find soundModule here.");
const created = soundModule.createSound(sound);
created.play();
return created;
}
};
const EventHandler = function () {
if (this.removed !== this.state.removed) {
if (this.removed) {
this.emit("removed");
}
}
if (this.showing !== this.state.showing) {
if (this.showing) {
this.emit("showing", true);
}
else {
this.emit("showing", false);
}
}
if (this.index !== this.state.index) {
this.emit("index", this.index);
}
};
/** A notice interface for modifying it and subscribing to events. */
class Notice extends events_1.EventEmitter {
constructor(data) {
super();
this.data = data;
this.state = {
removed: this.removed,
showing: this.showing,
index: this.index
};
let eventFunc = EventHandler.bind(this);
Notices_1.events.on("noticeUpdate", eventFunc);
this.on("removed", () => {
Notices_1.events.off("noticeUpdate", eventFunc);
});
}
get removed() {
return !Notices_1.notices.find(e => e.id === this.id);
}
get showing() {
return this.index === 0;
}
get index() {
return Notices_1.notices.findIndex(e => e.id === this.id);
}
get id() {
return this.data.id;
}
get text() {
return this.data.text;
}
set text(text) {
this.data.text = text;
Notices_1.events.emit("noticeUpdate");
}
get type() {
return this.data.type;
}
set type(type) {
this.data.type = type;
Notices_1.events.emit("noticeUpdate");
}
get buttonText() {
return this.data.buttonText;
}
set buttonText(buttonText) {
this.data.buttonText = buttonText;
Notices_1.events.emit("noticeUpdate");
}
get onClick() {
return this.data.onClick;
}
set onClick(onClick) {
this.data.onClick = onClick;
Notices_1.events.emit("noticeUpdate");
}
remove() {
if (this.removed)
return;
Notices_1.notices.splice(this.index, 1);
Notices_1.events.emit("noticeUpdate");
}
}
exports.Notice = Notice;
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/modules/PluginUtilities.ts":
/*!****************************************!*\
!*** ./src/modules/PluginUtilities.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const components_1 = __webpack_require__(/*! ../components/components */ "./src/components/components.ts");
const Utils_1 = __webpack_require__(/*! ./Utils */ "./src/modules/Utils.ts");
const uuid_1 = __webpack_require__(/*! ./uuid */ "./src/modules/uuid.ts");
const TextInput_1 = __webpack_require__(/*! ../components/inputs/TextInput */ "./src/components/inputs/TextInput.tsx");
exports.default = new class PluginUtilities {
constructor() { }
renderSettings(settings) {
let items = this.renderSettingsToReact(settings);
let elem = React.createElement("div", { key: uuid_1.default() }, items);
return Utils_1.default.ReactToHTMLElement(elem);
}
renderSettingsToReact(settings) {
let items = [];
settings.forEach(item => {
if (typeof item !== "object")
return items.push(item);
if (item.props && "children" in item.props) {
if (!Array.isArray(item.props.children))
item.props.children = [item.props.children];
item.props.children = this.renderSettingsToReact(item.props.children);
}
if (!item.props)
item.props = {};
item.props.key = uuid_1.default();
let component = Utils_1.default.getNestedProps(components_1.default, item.component);
if (!component) {
let warning = new TextInput_1.default({
value: `Warning: No component was found for: "${item.component}". Please correct your code.`,
disabled: true,
error: `Warning: No component was found for: "${item.component}". Please correct your code.`
}).render();
items.push(warning);
return;
}
items.push(React.createElement(component, Object.create(item.props)));
});
return items;
}
};
2020-06-16 15:51:21 +02:00
/***/ }),
/***/ "./src/modules/Utils.ts":
/*!******************************!*\
!*** ./src/modules/Utils.ts ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const ReactDOM = __webpack_require__(/*! react-dom */ "./src/alias/react-dom.ts");
const PluginUtilities_1 = __webpack_require__(/*! ./PluginUtilities */ "./src/modules/PluginUtilities.ts");
exports.default = new class Utils {
constructor() { }
ReactToHTMLElement(ReactElement) {
const element = document.createElement("div");
ReactDOM.render(ReactElement, element);
return element;
}
get PluginUtils() { return PluginUtilities_1.default; }
getNestedProps(obj, path) {
let segments = path.split(".");
for (let seg of segments) {
obj = obj && (seg in obj) ? obj[seg] : undefined;
}
return obj;
}
2020-07-11 21:29:08 +02:00
DecimalColorToHex(color) {
return "#" + color.toString(16).toUpperCase();
2020-07-11 21:29:08 +02:00
}
HexColorToDecimal(color) {
color = color.replace(/[#;]/g, "");
let res = parseInt(color, 16);
if (isNaN(res))
throw new Error(`Invalid color: ${color}`);
return res;
}
removeDa(className) {
if (!className)
return className;
return className.split(" ").filter(e => !e.startsWith("da-")).join(" ");
}
FindReact(dom, traverseUp = 0) {
/** took from https://stackoverflow.com/questions/29321742/react-getting-a-component-from-a-dom-element-for-debugging */
const key = Object.keys(dom).find(key => key.startsWith("__reactInternalInstance$"));
const domFiber = dom[key];
if (domFiber == null)
return null;
// react <16
if (domFiber._currentElement) {
let compFiber = domFiber._currentElement._owner;
for (let i = 0; i < traverseUp; i++) {
compFiber = compFiber._currentElement._owner;
}
return compFiber._instance;
}
// react 16+
const GetCompFiber = fiber => {
//return fiber._debugOwner; // this also works, but is __DEV__ only
let parentFiber = fiber.return;
while (typeof parentFiber.type == "string") {
parentFiber = parentFiber.return;
}
return parentFiber;
};
let compFiber = GetCompFiber(domFiber);
for (let i = 0; i < traverseUp; i++) {
compFiber = GetCompFiber(compFiber);
}
return compFiber.stateNode;
}
hasClass(classNames, className) {
if (!classNames || !className)
return false;
const classnames = classNames.split(" ");
for (let classname of this.removeDa(className).split(" ")) {
if (!classnames.includes(classname))
return false;
}
return true;
}
formatJSObject(obj) {
if (["string", "number", "boolean", "bigint", "undefined"].includes(typeof obj))
return JSON.stringify(obj);
if (obj === null)
return "null";
if (typeof obj === "function")
return String(obj);
if (typeof obj === "symbol")
return String(obj);
if (Array.isArray(obj)) {
if (!obj.length)
return "[]";
return `[\n ${obj.map(e => this.formatJSObject(e)).join(",\n ")}\n]`;
}
else {
const keys = Object.keys(obj);
if (keys.length === 0)
return "{}";
return `{\n ${keys.map(key => {
let original = key;
if (typeof key === "symbol")
key = "[" + String(key) + "]";
else {
if (typeof key === "number")
key = String(key);
else {
console.log(key);
if (isNaN(parseInt(key[0]))) {
key = this.formatJSObject(key);
}
else if (/[^\w\d_$]/g.test(key)) {
key = this.formatJSObject(key);
}
}
}
return `${key}: ${this.formatJSObject(obj[original])}`;
})}\n}`;
}
}
2020-07-10 01:44:40 +02:00
};
2020-06-16 15:51:21 +02:00
2020-06-10 16:16:33 +02:00
/***/ }),
/***/ "./src/modules/WebpackLoader.ts":
/*!**************************************!*\
!*** ./src/modules/WebpackLoader.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebpackLoaderError = void 0;
2020-07-10 01:44:40 +02:00
const BDModules = window.BDModules;
exports.default = new class WebpackLoader {
constructor() { }
get(id) {
return BDModules.get(id);
}
find(filter) {
2020-07-11 21:29:08 +02:00
let result = BDModules.get(filter)[0];
if (!result) {
console.warn(filter, "couldn't find the module.");
}
return result;
2020-07-10 01:44:40 +02:00
}
findByUniqueProperties(props) {
return BDModules.get((mod) => {
if (mod.__esModule && ("default" in mod)) {
let doesMatch = true;
for (let prop of props) {
if (!Object.prototype.hasOwnProperty.call(mod.default, prop))
doesMatch = false;
}
if (doesMatch)
return true;
}
for (let prop of props) {
if (!Object.prototype.hasOwnProperty.call(mod, prop))
return false;
}
return true;
})[0];
}
filter(filter) {
return BDModules.get(filter);
}
filterByUniqueProperties(props) {
return BDModules.get((mod) => {
if (mod.__esModule && ("default" in mod)) {
let doesMatch = true;
for (let prop of props) {
if (!Object.prototype.hasOwnProperty.call(mod.default, prop))
doesMatch = false;
}
if (doesMatch)
return true;
}
for (let prop of props) {
if (!Object.prototype.hasOwnProperty.call(mod, prop))
return false;
}
return true;
});
}
};
class WebpackLoaderError extends Error {
constructor(message = "") {
message += "\n\tThis error is related to Lightcord not being able to find a WebpackModule. \n\tPlease show this error and a few lines of logs above this error. \n\tOpen an issue on https://github.com/Lightcord/Lightcord or in their discord server.";
super(message);
this.name = "WebpackLoaderError";
}
}
exports.WebpackLoaderError = WebpackLoaderError;
2020-06-10 16:16:33 +02:00
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/modules/cloneNullProto.ts":
/*!***************************************!*\
!*** ./src/modules/cloneNullProto.ts ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Recreate the given object without the __proto__. Useful for better formatting when output in console.
* @param obj The object to recreate
*/
function cloneNullProto(obj) {
let o = Object.create(null);
Object.keys(obj).forEach(k => {
o[k] = obj[k];
});
return o;
}
exports.default = cloneNullProto;
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/modules/excludeProperties.ts":
/*!******************************************!*\
!*** ./src/modules/excludeProperties.ts ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
function excludeProperties(obj, props) {
let newObj = {};
Object.keys(obj).forEach((k) => {
if (props.includes(k))
return;
newObj[k] = obj[k];
});
return newObj;
}
exports.default = excludeProperties;
2020-07-04 22:42:26 +02:00
/***/ }),
/***/ "./src/modules/noop.ts":
/*!*****************************!*\
!*** ./src/modules/noop.ts ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
function NOOP() { }
exports.default = NOOP;
/***/ }),
/***/ "./src/modules/patchers.ts":
/*!*********************************!*\
!*** ./src/modules/patchers.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.patch = void 0;
const Utils_1 = __webpack_require__(/*! ./Utils */ "./src/modules/Utils.ts");
const Notices_1 = __webpack_require__(/*! ../components/private/Notices */ "./src/components/private/Notices.tsx");
function patch() {
/** START NOTICE */
getModule(e => e.default && e.default.displayName === "ConnectedAppView")
.then(async (mod) => {
const appClasses = await getModule(e => e.hasNotice);
const buildRender = original => {
return function render() {
const returnValue = original.call(this, ...arguments);
const newchildren = [];
let children = returnValue.props.children[1].props.children;
if (!Array.isArray(children))
children = [children];
newchildren.push(children[0]);
newchildren.push(React.createElement(Notices_1.default, { container: this }));
newchildren.push(children[1]);
returnValue.props.children[1].props.children = newchildren;
returnValue.props.children[1].props.children[2].props.children[0].props.render = buildRenderChannelSidebar(returnValue.props.children[1].props.children[2].props.children[0].props.render);
return returnValue;
};
};
const buildRenderChannelSidebar = original => {
return function renderChannelSidebar() {
const returnValue = original.call(this, ...arguments);
const hasNotice = Notices_1.notices.length > 0;
if (!hasNotice)
return returnValue;
if (!Utils_1.default.hasClass(returnValue.props.className, appClasses.hasNotice)) {
returnValue.props.className += " " + Utils_1.default.removeDa(appClasses.hasNotice);
}
return returnValue;
};
};
mod.default.prototype.render = buildRender(mod.default.prototype.render);
(async function () {
const base = document.querySelector("." + Utils_1.default.removeDa(appClasses.base));
if (!base)
throw new Error(`Could not find base here`);
const elem = Utils_1.default.FindReact(base);
elem.render = buildRender(elem.render);
elem.forceUpdate();
})();
});
/** END NOTICE */
}
exports.patch = patch;
function getModule(filter) {
return new Promise((resolve) => {
window.Lightcord.Api.ensureExported(filter)
.then(resolve)
.catch(err => {
console.error("[LIGHTCORD]", err, filter);
});
});
}
/***/ }),
/***/ "./src/modules/uuid.ts":
/*!*****************************!*\
!*** ./src/modules/uuid.ts ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
2020-07-10 01:44:40 +02:00
Object.defineProperty(exports, "__esModule", { value: true });
const uuidv1 = __webpack_require__(/*! uuid/v1 */ "uuid/v1");
const uuidv4 = __webpack_require__(/*! uuid/v4 */ "uuid/v4");
let uuid = Object.assign(function () {
return uuidv4();
}, { v1: () => uuidv1(), v4: () => uuidv4() });
exports.default = uuid;
/***/ }),
/***/ "events":
/*!*************************!*\
!*** external "events" ***!
\*************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = require("events");
/***/ }),
/***/ "uuid/v1":
/*!**************************!*\
!*** external "uuid/v1" ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = require("uuid/v1");
/***/ }),
/***/ "uuid/v4":
/*!**************************!*\
!*** external "uuid/v4" ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = require("uuid/v4");
2020-06-10 16:16:33 +02:00
/***/ })
/******/ });
2020-07-15 19:20:27 +02:00
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2FsaWFzL3JlYWN0LWRvbS50cyIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9jb21wb25lbnRzLnRzIiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9jb21wb25lbnRzL2dlbmVyYWwvQWxlcnRCb3gudHN4Iiwid2VicGFjazovL0xpZ2h0Y29yZEFwaS8uL3NyYy9jb21wb25lbnRzL2dlbmVyYWwvQ29kZUJsb2NrLnRzeCIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9nZW5lcmFsL1NldHRpbmdTdWJUaXRsZS50c3giLCJ3ZWJwYWNrOi8vTGlnaHRjb3JkQXBpLy4vc3JjL2NvbXBvbmVudHMvZ2VuZXJhbC9TZXR0aW5nc1RpdGxlLnRzeCIsIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvLi9zcmMvY29tcG9uZW50cy9nZW5lcmFsL1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