forked from zicloud/bigscreen_admin
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
660 B
JavaScript
28 lines
660 B
JavaScript
class Theme {
|
|
static DEFAULTS = {
|
|
modules: {}
|
|
};
|
|
static themes = {
|
|
default: Theme
|
|
};
|
|
modules = {};
|
|
constructor(quill, options) {
|
|
this.quill = quill;
|
|
this.options = options;
|
|
}
|
|
init() {
|
|
Object.keys(this.options.modules).forEach(name => {
|
|
if (this.modules[name] == null) {
|
|
this.addModule(name);
|
|
}
|
|
});
|
|
}
|
|
addModule(name) {
|
|
// @ts-expect-error
|
|
const ModuleClass = this.quill.constructor.import(`modules/${name}`);
|
|
this.modules[name] = new ModuleClass(this.quill, this.options.modules[name] || {});
|
|
return this.modules[name];
|
|
}
|
|
}
|
|
export default Theme;
|
|
//# sourceMappingURL=theme.js.map
|