ckeditor5-livewire 1.12.0 → 1.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ckeditor5-livewire",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "CKEditor 5 integration for Laravel Livewire",
5
5
  "author": "Mateusz Bagiński <cziken58@gmail.com>",
6
6
  "license": "MIT",
@@ -230,17 +230,9 @@ export class EditorComponentHook extends ClassHook<Snapshot> {
230
230
  sourceElements = sourceElements['main'];
231
231
  }
232
232
 
233
- let resolvedConfig = { ...config };
234
-
235
233
  // Do some postprocessing on received configuration.
236
- resolvedConfig = resolveEditorConfigElementReferences(resolvedConfig);
237
- resolvedConfig = resolveEditorConfigTranslations([...mixedTranslations].reverse(), language.ui, resolvedConfig);
238
- resolvedConfig = assignSourceElementsToEditorConfig(Constructor, sourceElements, resolvedConfig);
239
- resolvedConfig = assignInitialDataToEditorConfig(initialData, resolvedConfig);
240
-
241
- // Construct parsed config.
242
- const parsedConfig = {
243
- ...resolvedConfig,
234
+ let resolvedConfig = {
235
+ ...config,
244
236
  licenseKey,
245
237
  plugins: loadedPlugins,
246
238
  language,
@@ -249,14 +241,19 @@ export class EditorComponentHook extends ClassHook<Snapshot> {
249
241
  },
250
242
  };
251
243
 
252
- if (!context || !(sourceElements instanceof HTMLElement)) {
253
- return Constructor.create(parsedConfig);
244
+ resolvedConfig = resolveEditorConfigElementReferences(resolvedConfig);
245
+ resolvedConfig = resolveEditorConfigTranslations([...mixedTranslations].reverse(), language.ui, resolvedConfig);
246
+ resolvedConfig = assignSourceElementsToEditorConfig(Constructor, sourceElements, resolvedConfig);
247
+ resolvedConfig = assignInitialDataToEditorConfig(initialData, resolvedConfig);
248
+
249
+ if (!context) {
250
+ return Constructor.create(resolvedConfig);
254
251
  }
255
252
 
256
253
  const result = await createEditorInContext({
257
254
  context,
258
255
  creator: Constructor,
259
- config: parsedConfig,
256
+ config: resolvedConfig,
260
257
  });
261
258
 
262
259
  return result.editor;