@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.
@@ -10,6 +10,7 @@ export declare class Kernel extends EventEmitter implements IEditorKernel {
10
10
  private static globalHotReloadMode;
11
11
  private dataTypeMap;
12
12
  private plugins;
13
+ private pluginsConfig;
13
14
  private pluginsInstances;
14
15
  private nodes;
15
16
  private themes;
@@ -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.__config);
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.__config);
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
- // @ts-expect-error not error
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
- // @ts-expect-error not error
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/editor",
3
- "version": "1.27.0",
3
+ "version": "1.27.1",
4
4
  "description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
5
5
  "keywords": [
6
6
  "lobehub",