first commit
This commit is contained in:
28
public/assets/quill/core/theme.js
Normal file
28
public/assets/quill/core/theme.js
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
Reference in New Issue
Block a user