@ones-editor/editor 3.1.2-beta.ONES22301271.2 → 3.1.2

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/dist/index.js CHANGED
@@ -97100,7 +97100,7 @@ ${JSON.stringify(error2, null, 2)}`);
97100
97100
  }
97101
97101
  }
97102
97102
  });
97103
- editor.version = "3.1.2-beta.ONES22301271.2";
97103
+ editor.version = "3.1.2";
97104
97104
  return editor;
97105
97105
  }
97106
97106
  function isDoc(doc2) {
@@ -97119,31 +97119,36 @@ ${JSON.stringify(error2, null, 2)}`);
97119
97119
  const enableComments = options == null ? void 0 : options.enableComments;
97120
97120
  const quickMenu = (_c = (_b = options.componentsOptions) == null ? void 0 : _b.quickMenu) != null ? _c : { id: "quick-menu", trigger: ["/"], commandProviders: [] };
97121
97121
  (_d = quickMenu.commandProviders) == null ? void 0 : _d.push(new GraphCommandProvider());
97122
- const editor = createEditor(root2, doc2, {
97123
- id: options.id,
97124
- readonly: options.readonly,
97125
- scrollContainer: options == null ? void 0 : options.scrollContainer,
97126
- enableResolveComments: options == null ? void 0 : options.enableResolveComments,
97127
- enableComments,
97128
- dateTimeFormatter: options.dateTimeFormatter,
97129
- components: {
97130
- blocks: [...StandardBlocks, ...(_f = (_e = options.components) == null ? void 0 : _e.blocks) != null ? _f : []],
97131
- commandProviders: [new TableBlockCommandProvider()],
97132
- decorators: [new CodeTextDecorator(), new RemoteCaretsDecorator()],
97133
- embeds: [...StandardEmbeds, ...((_g = options.components) == null ? void 0 : _g.embeds) || []],
97134
- boxes: [MathjaxBox, MentionBox, FileBox, StatusBox, ...((_h = options.components) == null ? void 0 : _h.boxes) || []],
97135
- insertions: [RemoteCaretsInsertion],
97136
- blockHooks: [...((_i = options.components) == null ? void 0 : _i.blockHooks) || []],
97137
- textRenders: [
97138
- enableComments && new OnesEditorCommentsRender(),
97139
- new BlockPaddingRender(),
97140
- ...((_j = options.components) == null ? void 0 : _j.textRenders) || []
97141
- ].filter(Boolean),
97142
- options: { ...options.componentsOptions, quickMenu }
97143
- },
97144
- shortcuts: [TableShortcuts, FindReplaceShortcuts, TextStyleShortcuts, DefaultShortcuts]
97145
- });
97122
+ let editorForCleanup;
97146
97123
  try {
97124
+ const editor = createEditor(root2, doc2, {
97125
+ id: options.id,
97126
+ readonly: options.readonly,
97127
+ scrollContainer: options == null ? void 0 : options.scrollContainer,
97128
+ enableResolveComments: options == null ? void 0 : options.enableResolveComments,
97129
+ enableComments,
97130
+ dateTimeFormatter: options.dateTimeFormatter,
97131
+ components: {
97132
+ blocks: [...StandardBlocks, ...(_f = (_e = options.components) == null ? void 0 : _e.blocks) != null ? _f : []],
97133
+ commandProviders: [new TableBlockCommandProvider()],
97134
+ decorators: [new CodeTextDecorator(), new RemoteCaretsDecorator()],
97135
+ embeds: [...StandardEmbeds, ...((_g = options.components) == null ? void 0 : _g.embeds) || []],
97136
+ boxes: [MathjaxBox, MentionBox, FileBox, StatusBox, ...((_h = options.components) == null ? void 0 : _h.boxes) || []],
97137
+ insertions: [RemoteCaretsInsertion],
97138
+ blockHooks: [...((_i = options.components) == null ? void 0 : _i.blockHooks) || []],
97139
+ textRenders: [
97140
+ enableComments && new OnesEditorCommentsRender(),
97141
+ new BlockPaddingRender(),
97142
+ ...((_j = options.components) == null ? void 0 : _j.textRenders) || []
97143
+ ].filter(Boolean),
97144
+ options: { ...options.componentsOptions, quickMenu }
97145
+ },
97146
+ shortcuts: [TableShortcuts, FindReplaceShortcuts, TextStyleShortcuts, DefaultShortcuts]
97147
+ });
97148
+ editorForCleanup = editor;
97149
+ if (options.readonly) {
97150
+ editor.readonly = true;
97151
+ }
97147
97152
  if (options.compact) {
97148
97153
  addClass(editor.rootElement, "compact");
97149
97154
  if (options.headingButton === false)
@@ -97236,14 +97241,19 @@ ${JSON.stringify(error2, null, 2)}`);
97236
97241
  OnesEditorDropTarget.register(editor);
97237
97242
  OnesEditorTocProvider.register(editor);
97238
97243
  OnesEditorExclusiveBlock.register(editor);
97239
- editor.version = "3.1.2-beta.ONES22301271.2";
97244
+ editor.version = "3.1.2";
97240
97245
  return editor;
97241
97246
  } catch (error2) {
97242
- try {
97243
- editor.destroy();
97244
- } catch (destroyError) {
97245
- logger.error(`failed to rollback local editor: ${destroyError.message}`);
97247
+ if (editorForCleanup) {
97248
+ try {
97249
+ editorForCleanup.destroy();
97250
+ } catch (destroyError) {
97251
+ logger.error(destroyError);
97252
+ }
97253
+ } else {
97254
+ doc2.destroy();
97246
97255
  }
97256
+ root2.replaceChildren();
97247
97257
  throw error2;
97248
97258
  }
97249
97259
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "3.1.2-beta.ONES22301271.2",
3
+ "version": "3.1.2",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {