@lobehub/editor 1.27.0 → 1.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,6 +40,7 @@ export var Kernel = /*#__PURE__*/function (_EventEmitter) {
|
|
|
40
40
|
_this = _super.call(this);
|
|
41
41
|
_defineProperty(_assertThisInitialized(_this), "dataTypeMap", void 0);
|
|
42
42
|
_defineProperty(_assertThisInitialized(_this), "plugins", []);
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "pluginsConfig", new Map());
|
|
43
44
|
_defineProperty(_assertThisInitialized(_this), "pluginsInstances", []);
|
|
44
45
|
_defineProperty(_assertThisInitialized(_this), "nodes", []);
|
|
45
46
|
_defineProperty(_assertThisInitialized(_this), "themes", {});
|
|
@@ -167,7 +168,7 @@ export var Kernel = /*#__PURE__*/function (_EventEmitter) {
|
|
|
167
168
|
try {
|
|
168
169
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
169
170
|
var plugin = _step.value;
|
|
170
|
-
var instance = new plugin(this, plugin
|
|
171
|
+
var instance = new plugin(this, this.pluginsConfig.get(plugin));
|
|
171
172
|
this.pluginsInstances.push(instance);
|
|
172
173
|
}
|
|
173
174
|
} catch (err) {
|
|
@@ -225,7 +226,7 @@ export var Kernel = /*#__PURE__*/function (_EventEmitter) {
|
|
|
225
226
|
try {
|
|
226
227
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
227
228
|
var plugin = _step2.value;
|
|
228
|
-
var instance = new plugin(this, plugin
|
|
229
|
+
var instance = new plugin(this, this.pluginsConfig.get(plugin));
|
|
229
230
|
this.pluginsInstances.push(instance);
|
|
230
231
|
}
|
|
231
232
|
} catch (err) {
|
|
@@ -435,15 +436,12 @@ export var Kernel = /*#__PURE__*/function (_EventEmitter) {
|
|
|
435
436
|
} else {
|
|
436
437
|
// Same plugin, just update config if provided
|
|
437
438
|
if (config !== undefined) {
|
|
438
|
-
|
|
439
|
-
plugin.__config = config;
|
|
439
|
+
this.pluginsConfig.set(plugin, config);
|
|
440
440
|
}
|
|
441
441
|
return this; // If plugin already exists, don't register again
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
|
|
445
|
-
plugin.__config = config || {};
|
|
446
|
-
// @ts-expect-error not error
|
|
444
|
+
this.pluginsConfig.set(plugin, config || {});
|
|
447
445
|
this.plugins.push(plugin);
|
|
448
446
|
this.logger.debug("\uD83D\uDD0C Plugin: ".concat(plugin.pluginName));
|
|
449
447
|
return this;
|
package/package.json
CHANGED