update .prettierignore

This commit is contained in:
Send_Nukez 2021-10-25 19:53:08 +02:00 committed by GitHub Action
parent a1955ca59a
commit f2e123314d
2 changed files with 363 additions and 362 deletions

View file

@ -1 +1,2 @@
Vibrant.min.js Vibrant.min.js
dist/

View file

@ -1,361 +1,361 @@
export default class ConfigMenu { export default class ConfigMenu {
/** /**
* @typedef {Object} DribbblishConfigItem * @typedef {Object} DribbblishConfigItem
* @property {"checkbox" | "select" | "button" | "slider" | "number" | "text" | "time" | "color"} type * @property {"checkbox" | "select" | "button" | "slider" | "number" | "text" | "time" | "color"} type
* @property {String|DribbblishConfigArea} [area={name: "Main Settings", order: 0}] * @property {String|DribbblishConfigArea} [area={name: "Main Settings", order: 0}]
* @property {any} [data={}] * @property {any} [data={}]
* @property {Number} [order=0] order < 0 = Higher up | order > 0 = Lower Down * @property {Number} [order=0] order < 0 = Higher up | order > 0 = Lower Down
* @property {String} key * @property {String} key
* @property {String} name * @property {String} name
* @property {String} [description=""] * @property {String} [description=""]
* @property {any} [defaultValue] * @property {any} [defaultValue]
* @property {Boolean} [hidden=false] * @property {Boolean} [hidden=false]
* @property {Boolean} [insertOnTop=false] * @property {Boolean} [insertOnTop=false]
* @property {Boolean} [fireInitialChange=true] * @property {Boolean} [fireInitialChange=true]
* @property {showChildren} [showChildren] * @property {showChildren} [showChildren]
* @property {onAppended} [onAppended] * @property {onAppended} [onAppended]
* @property {onChange} [onChange] * @property {onChange} [onChange]
* @property {DribbblishConfigItem[]} [children=[]] * @property {DribbblishConfigItem[]} [children=[]]
* @property {String} [childOf=null] key of parent (set automatically) * @property {String} [childOf=null] key of parent (set automatically)
*/ */
/** /**
* @typedef DribbblishConfigArea * @typedef DribbblishConfigArea
* @property {String} name * @property {String} name
* @property {Number} [order=0] order < 0 = Higher up | order > 0 = Lower Down * @property {Number} [order=0] order < 0 = Higher up | order > 0 = Lower Down
*/ */
/** /**
* @callback showChildren * @callback showChildren
* @param {any} value * @param {any} value
* @returns {Boolean | String[]} * @returns {Boolean | String[]}
*/ */
/** /**
* @callback onAppended * @callback onAppended
* @returns {void} * @returns {void}
*/ */
/** /**
* @callback onChange * @callback onChange
* @param {any} value * @param {any} value
* @returns {void} * @returns {void}
*/ */
/** @type {Object.<string, DribbblishConfigItem>} */ /** @type {Object.<string, DribbblishConfigItem>} */
#config; #config;
constructor() { constructor() {
this.#config = {}; this.#config = {};
this.configButton = new Spicetify.Menu.Item("Dribbblish Settings", false, () => this.open()); this.configButton = new Spicetify.Menu.Item("Dribbblish Settings", false, () => this.open());
this.configButton.register(); this.configButton.register();
const container = document.createElement("div"); const container = document.createElement("div");
container.id = "dribbblish-config"; container.id = "dribbblish-config";
container.innerHTML = /* html */ ` container.innerHTML = /* html */ `
<div class="dribbblish-config-container"> <div class="dribbblish-config-container">
<button aria-label="Close" class="dribbblish-config-close main-trackCreditsModal-closeBtn"> <button aria-label="Close" class="dribbblish-config-close main-trackCreditsModal-closeBtn">
<svg width="18" height="18" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M31.098 29.794L16.955 15.65 31.097 1.51 29.683.093 15.54 14.237 1.4.094-.016 1.508 14.126 15.65-.016 29.795l1.414 1.414L15.54 17.065l14.144 14.143" fill="currentColor" fill-rule="evenodd"></path></svg> <svg width="18" height="18" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M31.098 29.794L16.955 15.65 31.097 1.51 29.683.093 15.54 14.237 1.4.094-.016 1.508 14.126 15.65-.016 29.795l1.414 1.414L15.54 17.065l14.144 14.143" fill="currentColor" fill-rule="evenodd"></path></svg>
</button> </button>
<h1>Dribbblish Settings</h1> <h1>Dribbblish Settings</h1>
<div class="dribbblish-config-areas"></div> <div class="dribbblish-config-areas"></div>
</div> </div>
<div class="dribbblish-config-backdrop"></div> <div class="dribbblish-config-backdrop"></div>
`; `;
document.body.appendChild(container); document.body.appendChild(container);
document.querySelector(".dribbblish-config-close").addEventListener("click", () => this.close()); document.querySelector(".dribbblish-config-close").addEventListener("click", () => this.close());
document.querySelector(".dribbblish-config-backdrop").addEventListener("click", () => this.close()); document.querySelector(".dribbblish-config-backdrop").addEventListener("click", () => this.close());
} }
open() { open() {
document.getElementById("dribbblish-config").setAttribute("active", ""); document.getElementById("dribbblish-config").setAttribute("active", "");
} }
close() { close() {
document.getElementById("dribbblish-config").removeAttribute("active"); document.getElementById("dribbblish-config").removeAttribute("active");
} }
/** /**
* @private * @private
* @param {DribbblishConfigItem} options * @param {DribbblishConfigItem} options
*/ */
addInputHTML(options) { addInputHTML(options) {
this.registerArea(options.area); this.registerArea(options.area);
const parent = document.querySelector(`.dribbblish-config-area[name="${options.area.name}"] .dribbblish-config-area-items`); const parent = document.querySelector(`.dribbblish-config-area[name="${options.area.name}"] .dribbblish-config-area-items`);
const elem = document.createElement("div"); const elem = document.createElement("div");
elem.style.order = options.order; elem.style.order = options.order;
elem.classList.add("dribbblish-config-item"); elem.classList.add("dribbblish-config-item");
elem.setAttribute("key", options.key); elem.setAttribute("key", options.key);
elem.setAttribute("type", options.type); elem.setAttribute("type", options.type);
elem.setAttribute("hidden", options.hidden); elem.setAttribute("hidden", options.hidden);
if (options.childOf) elem.setAttribute("parent", options.childOf); if (options.childOf) elem.setAttribute("parent", options.childOf);
elem.innerHTML = /* html */ ` elem.innerHTML = /* html */ `
<h2 class="x-settings-title main-type-cello${!options.description ? " no-desc" : ""}" as="h2">${options.name}</h2> <h2 class="x-settings-title main-type-cello${!options.description ? " no-desc" : ""}" as="h2">${options.name}</h2>
<label class="main-type-mesto">${options.description.replace(/\n/g, "<br>")}</label> <label class="main-type-mesto">${options.description.replace(/\n/g, "<br>")}</label>
<label class="x-toggle-wrapper x-settings-secondColumn"> <label class="x-toggle-wrapper x-settings-secondColumn">
${options.input} ${options.input}
</label> </label>
`; `;
if (options.insertOnTop && parent.children.length > 0) { if (options.insertOnTop && parent.children.length > 0) {
parent.insertBefore(elem, parent.children[0]); parent.insertBefore(elem, parent.children[0]);
} else { } else {
parent.appendChild(elem); parent.appendChild(elem);
} }
} }
/** /**
* @param {DribbblishConfigItem} options * @param {DribbblishConfigItem} options
*/ */
register(options) { register(options) {
/** @type {DribbblishConfigItem} */ /** @type {DribbblishConfigItem} */
const defaultOptions = { const defaultOptions = {
hidden: false, hidden: false,
area: "Main Settings", area: "Main Settings",
order: 0, order: 0,
data: {}, data: {},
name: "", name: "",
description: "", description: "",
insertOnTop: false, insertOnTop: false,
fireInitialChange: true, fireInitialChange: true,
showChildren: () => true, showChildren: () => true,
onAppended: () => {}, onAppended: () => {},
onChange: () => {}, onChange: () => {},
children: [], children: [],
childOf: null childOf: null
}; };
// Set Defaults // Set Defaults
options = { ...defaultOptions, ...options }; options = { ...defaultOptions, ...options };
if (typeof options.area == "string") options.area = { name: options.area, order: 0 }; if (typeof options.area == "string") options.area = { name: options.area, order: 0 };
options.description = options.description options.description = options.description
.split("\n") .split("\n")
.filter((line) => line.trim() != "") .filter((line) => line.trim() != "")
.map((line) => line.trim()) .map((line) => line.trim())
.join("\n"); .join("\n");
options._onChange = options.onChange; options._onChange = options.onChange;
options.onChange = (val) => { options.onChange = (val) => {
options._onChange(val); options._onChange(val);
const show = options.showChildren(val); const show = options.showChildren(val);
options.children.forEach((child) => this.setHidden(child.key, Array.isArray(show) ? !show.includes(child.key) : !show)); options.children.forEach((child) => this.setHidden(child.key, Array.isArray(show) ? !show.includes(child.key) : !show));
}; };
options.children = options.children.map((child) => { options.children = options.children.map((child) => {
return { ...child, area: options.area, childOf: options.key }; return { ...child, area: options.area, childOf: options.key };
}); });
this.#config[options.key] = options; this.#config[options.key] = options;
this.#config[options.key].value = localStorage.getItem(`dribbblish:config:${options.key}`) ?? JSON.stringify(options.defaultValue); this.#config[options.key].value = localStorage.getItem(`dribbblish:config:${options.key}`) ?? JSON.stringify(options.defaultValue);
if (options.type == "checkbox") { if (options.type == "checkbox") {
const input = /* html */ ` const input = /* html */ `
<input id="dribbblish-config-input-${options.key}" class="x-toggle-input" type="checkbox"${this.get(options.key) ? " checked" : ""}> <input id="dribbblish-config-input-${options.key}" class="x-toggle-input" type="checkbox"${this.get(options.key) ? " checked" : ""}>
<span class="x-toggle-indicatorWrapper"> <span class="x-toggle-indicatorWrapper">
<span class="x-toggle-indicator"></span> <span class="x-toggle-indicator"></span>
</span> </span>
`; `;
this.addInputHTML({ ...options, input }); this.addInputHTML({ ...options, input });
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("change", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("change", (e) => {
this.set(options.key, e.target.checked); this.set(options.key, e.target.checked);
options.onChange(this.get(options.key)); options.onChange(this.get(options.key));
}); });
} else if (options.type == "select") { } else if (options.type == "select") {
// Validate // Validate
const val = this.get(options.key); const val = this.get(options.key);
if (val < 0 || val > options.data.length - 1) this.set(options.key); if (val < 0 || val > options.data.length - 1) this.set(options.key);
const input = /* html */ ` const input = /* html */ `
<select class="main-dropDown-dropDown" id="dribbblish-config-input-${options.key}"> <select class="main-dropDown-dropDown" id="dribbblish-config-input-${options.key}">
${options.data.map((option, i) => `<option value="${i}"${this.get(options.key) == i ? " selected" : ""}>${option}</option>`).join("")} ${options.data.map((option, i) => `<option value="${i}"${this.get(options.key) == i ? " selected" : ""}>${option}</option>`).join("")}
</select> </select>
`; `;
this.addInputHTML({ ...options, input }); this.addInputHTML({ ...options, input });
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("change", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("change", (e) => {
this.set(options.key, Number(e.target.value)); this.set(options.key, Number(e.target.value));
options.onChange(this.get(options.key)); options.onChange(this.get(options.key));
}); });
} else if (options.type == "button") { } else if (options.type == "button") {
options.fireInitialChange = false; options.fireInitialChange = false;
if (typeof options.data != "string") options.data = options.name; if (typeof options.data != "string") options.data = options.name;
const input = /* html */ ` const input = /* html */ `
<button class="main-buttons-button main-button-primary" type="button" id="dribbblish-config-input-${options.key}"> <button class="main-buttons-button main-button-primary" type="button" id="dribbblish-config-input-${options.key}">
<div class="x-settings-buttonContainer"> <div class="x-settings-buttonContainer">
<span>${options.data}</span> <span>${options.data}</span>
</div> </div>
</button> </button>
`; `;
this.addInputHTML({ ...options, input }); this.addInputHTML({ ...options, input });
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("click", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("click", (e) => {
options.onChange(true); options.onChange(true);
}); });
} else if (options.type == "number") { } else if (options.type == "number") {
// Validate // Validate
if (options.defaultValue == null) options.defaultValue = 0; if (options.defaultValue == null) options.defaultValue = 0;
const val = this.get(options.key); const val = this.get(options.key);
if (options.data.min != null && val < options.data.min) this.set(options.key, options.data.min); if (options.data.min != null && val < options.data.min) this.set(options.key, options.data.min);
if (options.data.max != null && val > options.data.max) this.set(options.key, options.data.max); if (options.data.max != null && val > options.data.max) this.set(options.key, options.data.max);
const input = /* html */ ` const input = /* html */ `
<input type="number" id="dribbblish-config-input-${options.key}" value="${this.get(options.key)}"> <input type="number" id="dribbblish-config-input-${options.key}" value="${this.get(options.key)}">
`; `;
this.addInputHTML({ ...options, input }); this.addInputHTML({ ...options, input });
// Prevent inputting +, - and e. Why is it even possible in the first place? // Prevent inputting +, - and e. Why is it even possible in the first place?
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("keypress", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("keypress", (e) => {
if (["+", "-", "e"].includes(e.key)) e.preventDefault(); if (["+", "-", "e"].includes(e.key)) e.preventDefault();
}); });
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => {
if (options.data.min != null && e.target.value < options.data.min) e.target.value = options.data.min; if (options.data.min != null && e.target.value < options.data.min) e.target.value = options.data.min;
if (options.data.max != null && e.target.value > options.data.max) e.target.value = options.data.max; if (options.data.max != null && e.target.value > options.data.max) e.target.value = options.data.max;
this.set(options.key, Number(e.target.value)); this.set(options.key, Number(e.target.value));
options.onChange(this.get(options.key)); options.onChange(this.get(options.key));
}); });
} else if (options.type == "text") { } else if (options.type == "text") {
if (options.defaultValue == null) options.defaultValue = ""; if (options.defaultValue == null) options.defaultValue = "";
const input = /* html */ ` const input = /* html */ `
<input type="text" id="dribbblish-config-input-${options.key}" value="${this.get(options.key)}"> <input type="text" id="dribbblish-config-input-${options.key}" value="${this.get(options.key)}">
`; `;
this.addInputHTML({ ...options, input }); this.addInputHTML({ ...options, input });
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => {
// TODO: maybe add an validation function via `data.validate` // TODO: maybe add an validation function via `data.validate`
this.set(options.key, e.target.value); this.set(options.key, e.target.value);
options.onChange(this.get(options.key)); options.onChange(this.get(options.key));
}); });
} else if (options.type == "slider") { } else if (options.type == "slider") {
// Validate // Validate
if (options.defaultValue == null) options.defaultValue = 0; if (options.defaultValue == null) options.defaultValue = 0;
const val = this.get(options.key); const val = this.get(options.key);
if (options.data.min != null && val < options.data.min) this.set(options.key, options.data.min); if (options.data.min != null && val < options.data.min) this.set(options.key, options.data.min);
if (options.data.max != null && val > options.data.max) this.set(options.key, options.data.max); if (options.data.max != null && val > options.data.max) this.set(options.key, options.data.max);
const input = /* html */ ` const input = /* html */ `
<input <input
type="range" type="range"
id="dribbblish-config-input-${options.key}" id="dribbblish-config-input-${options.key}"
name="${options.name}" name="${options.name}"
min="${options.data?.min ?? "0"}" min="${options.data?.min ?? "0"}"
max="${options.data?.max ?? "100"}" max="${options.data?.max ?? "100"}"
step="${options.data?.step ?? "1"}" step="${options.data?.step ?? "1"}"
value="${this.get(options.key)}" value="${this.get(options.key)}"
tooltip="${this.get(options.key)}${options.data?.suffix ?? ""}" tooltip="${this.get(options.key)}${options.data?.suffix ?? ""}"
> >
`; `;
this.addInputHTML({ ...options, input }); this.addInputHTML({ ...options, input });
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => {
document.getElementById(`dribbblish-config-input-${options.key}`).setAttribute("tooltip", `${e.target.value}${options.data?.suffix ?? ""}`); document.getElementById(`dribbblish-config-input-${options.key}`).setAttribute("tooltip", `${e.target.value}${options.data?.suffix ?? ""}`);
document.getElementById(`dribbblish-config-input-${options.key}`).setAttribute("value", e.target.value); document.getElementById(`dribbblish-config-input-${options.key}`).setAttribute("value", e.target.value);
this.set(options.key, Number(e.target.value)); this.set(options.key, Number(e.target.value));
options.onChange(this.get(options.key)); options.onChange(this.get(options.key));
}); });
} else if (options.type == "time") { } else if (options.type == "time") {
// Validate // Validate
if (options.defaultValue == null) options.defaultValue = "00:00"; if (options.defaultValue == null) options.defaultValue = "00:00";
const input = /* html */ ` const input = /* html */ `
<input type="time" id="dribbblish-config-input-${options.key}" name="${options.name}" value="${this.get(options.key)}"> <input type="time" id="dribbblish-config-input-${options.key}" name="${options.name}" value="${this.get(options.key)}">
`; `;
this.addInputHTML({ ...options, input }); this.addInputHTML({ ...options, input });
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => {
document.getElementById(`dribbblish-config-input-${options.key}`).setAttribute("value", e.target.value); document.getElementById(`dribbblish-config-input-${options.key}`).setAttribute("value", e.target.value);
this.set(options.key, e.target.value); this.set(options.key, e.target.value);
options.onChange(this.get(options.key)); options.onChange(this.get(options.key));
}); });
} else if (options.type == "color") { } else if (options.type == "color") {
// Validate // Validate
if (options.defaultValue == null) options.defaultValue = "#000000"; if (options.defaultValue == null) options.defaultValue = "#000000";
const input = /* html */ ` const input = /* html */ `
<input type="color" id="dribbblish-config-input-${options.key}" name="${options.name}" value="${this.get(options.key)}"> <input type="color" id="dribbblish-config-input-${options.key}" name="${options.name}" value="${this.get(options.key)}">
`; `;
this.addInputHTML({ ...options, input }); this.addInputHTML({ ...options, input });
document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => { document.getElementById(`dribbblish-config-input-${options.key}`).addEventListener("input", (e) => {
this.set(options.key, e.target.value); this.set(options.key, e.target.value);
options.onChange(this.get(options.key)); options.onChange(this.get(options.key));
}); });
} else { } else {
throw new Error(`Config Type "${options.type}" invalid`); throw new Error(`Config Type "${options.type}" invalid`);
} }
options.children.forEach((child) => this.register(child)); options.children.forEach((child) => this.register(child));
options.onAppended(); options.onAppended();
if (options.fireInitialChange) options.onChange(this.get(options.key)); if (options.fireInitialChange) options.onChange(this.get(options.key));
} }
/** /**
* @param {DribbblishConfigArea} area * @param {DribbblishConfigArea} area
*/ */
registerArea(area) { registerArea(area) {
if (!document.querySelector(`.dribbblish-config-area[name="${area.name}"]`)) { if (!document.querySelector(`.dribbblish-config-area[name="${area.name}"]`)) {
const areaElem = document.createElement("div"); const areaElem = document.createElement("div");
areaElem.classList.add("dribbblish-config-area"); areaElem.classList.add("dribbblish-config-area");
areaElem.style.order = area.order; areaElem.style.order = area.order;
const uncollapsedAreas = JSON.parse(localStorage.getItem("dribbblish:config-areas:uncollapsed") ?? "[]"); const uncollapsedAreas = JSON.parse(localStorage.getItem("dribbblish:config-areas:uncollapsed") ?? "[]");
if (!uncollapsedAreas.includes(area.name)) areaElem.toggleAttribute("collapsed"); if (!uncollapsedAreas.includes(area.name)) areaElem.toggleAttribute("collapsed");
areaElem.setAttribute("name", area.name); areaElem.setAttribute("name", area.name);
areaElem.innerHTML = /* html */ ` areaElem.innerHTML = /* html */ `
<h2 class="dribbblish-config-area-header"> <h2 class="dribbblish-config-area-header">
${area.name} ${area.name}
<svg height="24" width="24" viewBox="0 0 24 24" class="main-topBar-icon"><polyline points="16 4 7 12 16 20" fill="none" stroke="currentColor"></polyline></svg> <svg height="24" width="24" viewBox="0 0 24 24" class="main-topBar-icon"><polyline points="16 4 7 12 16 20" fill="none" stroke="currentColor"></polyline></svg>
</h2> </h2>
<div class="dribbblish-config-area-items"></div> <div class="dribbblish-config-area-items"></div>
`; `;
document.querySelector(".dribbblish-config-areas").appendChild(areaElem); document.querySelector(".dribbblish-config-areas").appendChild(areaElem);
areaElem.querySelector("h2").addEventListener("click", () => { areaElem.querySelector("h2").addEventListener("click", () => {
areaElem.toggleAttribute("collapsed"); areaElem.toggleAttribute("collapsed");
let uncollapsedAreas = JSON.parse(localStorage.getItem("dribbblish:config-areas:uncollapsed") ?? "[]"); let uncollapsedAreas = JSON.parse(localStorage.getItem("dribbblish:config-areas:uncollapsed") ?? "[]");
if (areaElem.hasAttribute("collapsed")) { if (areaElem.hasAttribute("collapsed")) {
uncollapsedAreas = uncollapsedAreas.filter((areaName) => areaName != area.name); uncollapsedAreas = uncollapsedAreas.filter((areaName) => areaName != area.name);
} else { } else {
uncollapsedAreas.push(area.name); uncollapsedAreas.push(area.name);
} }
localStorage.setItem("dribbblish:config-areas:uncollapsed", JSON.stringify(uncollapsedAreas)); localStorage.setItem("dribbblish:config-areas:uncollapsed", JSON.stringify(uncollapsedAreas));
}); });
} }
} }
/** /**
* *
* @param {String} key * @param {String} key
* @param {any} defaultValueOverride * @param {any} defaultValueOverride
* @returns {any} * @returns {any}
*/ */
get(key, defaultValueOverride) { get(key, defaultValueOverride) {
const val = JSON.parse(this.#config[key].value ?? null); // Turn undefined into null because `JSON.parse()` dosen't like undefined const val = JSON.parse(this.#config[key].value ?? null); // Turn undefined into null because `JSON.parse()` dosen't like undefined
if (val == null) return defaultValueOverride ?? this.#config[key].defaultValue; if (val == null) return defaultValueOverride ?? this.#config[key].defaultValue;
return val; return val;
} }
/** /**
* *
* @param {String} key * @param {String} key
* @param {any} val * @param {any} val
*/ */
set(key, val) { set(key, val) {
this.#config[key].value = JSON.stringify(val); this.#config[key].value = JSON.stringify(val);
localStorage.setItem(`dribbblish:config:${key}`, JSON.stringify(val)); localStorage.setItem(`dribbblish:config:${key}`, JSON.stringify(val));
} }
/** /**
* *
* @param {String} key * @param {String} key
* @param {Boolean} hidden * @param {Boolean} hidden
*/ */
setHidden(key, hidden) { setHidden(key, hidden) {
this.#config[key].hidden = hidden; this.#config[key].hidden = hidden;
document.querySelector(`.dribbblish-config-item[key="${key}"]`).setAttribute("hidden", hidden); document.querySelector(`.dribbblish-config-item[key="${key}"]`).setAttribute("hidden", hidden);
} }
getOptions(key) { getOptions(key) {
return this.#config[key]; return this.#config[key];
} }
} }