@ones-editor/editor 2.2.19-beta.1 → 2.2.19-beta.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
@@ -81772,18 +81772,15 @@ ${content}
81772
81772
  }
81773
81773
  });
81774
81774
  __publicField(this, "handleReadonlyChanged", (editor) => {
81775
- var _a, _b;
81775
+ var _a;
81776
81776
  const header = this.block.querySelector(".embed-graph-header");
81777
81777
  assert(logger$k, header, "header does not exist");
81778
81778
  const data2 = this.editor.getBlockData(this.block);
81779
- const { flex = DEFAULT_FLEX, code, src } = this.getGraphData(data2);
81780
- if (editor.readonly) {
81781
- (_a = this.layout) == null ? void 0 : _a.showRight();
81782
- header.style.display = "none";
81783
- } else {
81784
- (_b = this.layout) == null ? void 0 : _b.showBoth(flex);
81785
- header.style.display = "flex";
81786
- }
81779
+ const { flex = DEFAULT_FLEX, code, src, view } = this.getGraphData(data2);
81780
+ header.style.display = editor.readonly || clientType.isMobile ? "none" : "flex";
81781
+ const realView = this.getRealView(view);
81782
+ (_a = this.viewSelect) == null ? void 0 : _a.setSelectedView(realView);
81783
+ this.updateLayout(realView, flex);
81787
81784
  this.updateDraw(src, code);
81788
81785
  });
81789
81786
  __publicField(this, "updateLayoutData", () => {
@@ -81954,6 +81951,7 @@ ${content}
81954
81951
  this.updateDraw(src, code);
81955
81952
  setTimeout(() => {
81956
81953
  if (clientType.isMobile) {
81954
+ header.style.display = "none";
81957
81955
  return;
81958
81956
  }
81959
81957
  const blockElement = this.editor.getBlockById(blockData.id);
@@ -89141,6 +89139,10 @@ ${data2.plantumlText}
89141
89139
  editor.input.addHandler(new ListPasteHandler());
89142
89140
  editor.doc.registerCallback(new HeadingBlockDocEvents(editor));
89143
89141
  editor.addCustom("remote-cursor", () => new RemoteCarets(editor));
89142
+ editor.addCustom("editor-image-preview", () => new ImagePreviewHandler(editor, (editor2, img) => {
89143
+ var _a2, _b2;
89144
+ (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
89145
+ }));
89144
89146
  if (!clientType.isMobile) {
89145
89147
  editor.addCustom("editor-quick-menu", () => {
89146
89148
  var _a2;
@@ -89150,10 +89152,6 @@ ${data2.plantumlText}
89150
89152
  editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
89151
89153
  (_l = editor.findCustom("editor-quick-menu")) == null ? void 0 : _l.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
89152
89154
  (_m = editor.findCustom("editor-block-menu")) == null ? void 0 : _m.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
89153
- editor.addCustom("editor-image-preview", () => new ImagePreviewHandler(editor, (editor2, img) => {
89154
- var _a2, _b2;
89155
- (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
89156
- }));
89157
89155
  }
89158
89156
  if (enableComments) {
89159
89157
  editor.addCustom(
@@ -89230,7 +89228,7 @@ ${data2.plantumlText}
89230
89228
  }
89231
89229
  }
89232
89230
  });
89233
- editor.version = "2.2.19-beta.1";
89231
+ editor.version = "2.2.19-beta.2";
89234
89232
  return editor;
89235
89233
  }
89236
89234
  function isDoc(doc2) {
@@ -89284,6 +89282,10 @@ ${data2.plantumlText}
89284
89282
  editor.input.addHandler(new OnesEditorPasteHandler(editor));
89285
89283
  editor.input.addHandler(new BlockLockerPasteHandler());
89286
89284
  editor.input.addHandler(new ListPasteHandler());
89285
+ editor.addCustom("editor-image-preview", () => new ImagePreviewHandler(editor, (editor2, img) => {
89286
+ var _a2, _b2;
89287
+ (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
89288
+ }));
89287
89289
  if (!clientType.isMobile) {
89288
89290
  editor.addCustom("editor-quick-menu", () => {
89289
89291
  var _a2;
@@ -89294,10 +89296,6 @@ ${data2.plantumlText}
89294
89296
  editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
89295
89297
  (_k = editor.findCustom("editor-quick-menu")) == null ? void 0 : _k.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
89296
89298
  (_l = editor.findCustom("editor-block-menu")) == null ? void 0 : _l.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
89297
- editor.addCustom("editor-image-preview", () => new ImagePreviewHandler(editor, (editor2, img) => {
89298
- var _a2, _b2;
89299
- (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
89300
- }));
89301
89299
  } else {
89302
89300
  editor.addCustom("mobile-helper", () => new OnesEditorMobileHelper(editor));
89303
89301
  }
@@ -89331,7 +89329,7 @@ ${data2.plantumlText}
89331
89329
  });
89332
89330
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
89333
89331
  OnesEditorToolbar.register(editor);
89334
- editor.version = "2.2.19-beta.1";
89332
+ editor.version = "2.2.19-beta.2";
89335
89333
  return editor;
89336
89334
  }
89337
89335
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.2.19-beta.1",
3
+ "version": "2.2.19-beta.2",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {