@ones-editor/editor 2.2.16-beta.12 → 2.2.16-beta.14

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
@@ -3262,7 +3262,7 @@ div.editor-root.readonly div.editor-content div[data-type=editor-block] div[data
3262
3262
  position: absolute;
3263
3263
  right: 100%;
3264
3264
  top: 0;
3265
- padding-right: 5px;
3265
+ margin-right: 5px;
3266
3266
  display: flex;
3267
3267
  align-items: center;
3268
3268
  }
@@ -5845,7 +5845,7 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5845
5845
  }
5846
5846
  .version-dialog .version-loading {
5847
5847
  display: flex;
5848
- flex: 1;
5848
+ height: 100%;
5849
5849
  align-items: center;
5850
5850
  justify-content: center;
5851
5851
  overflow: hidden;
@@ -5876,6 +5876,7 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5876
5876
  min-width: 0;
5877
5877
  }
5878
5878
  .version-dialog .version-viewer .version-dialog-editor {
5879
+ flex: 1;
5879
5880
  overflow-y: auto;
5880
5881
  position: relative;
5881
5882
  }
@@ -10664,7 +10665,7 @@ var __publicField = (obj, key, value) => {
10664
10665
  __publicField(this, "getScrollingDirection", (e2) => {
10665
10666
  const { x, y } = e2;
10666
10667
  const { top, bottom, left, right } = this.scrollDomInfo;
10667
- const { edge } = this.options;
10668
+ const edge = this.edge;
10668
10669
  if (edge.top && y <= edge.top + top) {
10669
10670
  return "top";
10670
10671
  }
@@ -10681,7 +10682,7 @@ var __publicField = (obj, key, value) => {
10681
10682
  });
10682
10683
  __publicField(this, "handleMouseMove", (e2) => {
10683
10684
  var _a;
10684
- const { scrollElement, step = 10, onDirectionChange } = this.options;
10685
+ const { scrollElement, onDirectionChange } = this.options;
10685
10686
  const direction = this.getScrollingDirection(e2);
10686
10687
  if (direction) {
10687
10688
  if (this.scrolling) {
@@ -10690,7 +10691,7 @@ var __publicField = (obj, key, value) => {
10690
10691
  logger$4z.debug(`scroll direction: ${direction}`);
10691
10692
  this.cancelScroll = continuousScroll(scrollElement, {
10692
10693
  direction,
10693
- step
10694
+ step: this.step
10694
10695
  });
10695
10696
  onDirectionChange == null ? void 0 : onDirectionChange(direction);
10696
10697
  this.scrolling = true;
@@ -10702,6 +10703,12 @@ var __publicField = (obj, key, value) => {
10702
10703
  this.options = options;
10703
10704
  this.scrollDomInfo = this.getScrollDomInfo();
10704
10705
  }
10706
+ get edge() {
10707
+ return window.edge || 50;
10708
+ }
10709
+ get step() {
10710
+ return window.step || 10;
10711
+ }
10705
10712
  getScrollDomInfo() {
10706
10713
  const { scrollElement } = this.options;
10707
10714
  const rect = scrollElement.getBoundingClientRect();
@@ -82359,8 +82366,7 @@ ${content}
82359
82366
  assert(logger$j, iframe.contentWindow, "iframe.contentWindow does not exist");
82360
82367
  if (evt.data.length > 0) {
82361
82368
  const msg = JSON.parse(evt.data);
82362
- const xml = drawIoData.xmlSvg || drawIoData.xml;
82363
- assert(logger$j, xml, "xml does not exist");
82369
+ const xml = drawIoData.xmlSvg || drawIoData.xml || "";
82364
82370
  switch (msg.event) {
82365
82371
  case "configure":
82366
82372
  iframe.contentWindow.postMessage(JSON.stringify({
@@ -82433,12 +82439,13 @@ ${content}
82433
82439
  const svg = await downloadSvgToString(editor, editor.doc.buildResourceUrl(data2.src));
82434
82440
  if (svg) {
82435
82441
  data2.xmlSvg = svg;
82442
+ } else {
82443
+ if (!data2.xml && !data2.xmlSvg) {
82444
+ showWarnToast();
82445
+ return;
82446
+ }
82436
82447
  }
82437
82448
  }
82438
- if (!data2.xml && !data2.xmlSvg) {
82439
- showWarnToast();
82440
- return;
82441
- }
82442
82449
  const { drawioIframe, exit: exitIframe } = await initializeDrawioIframe(editor, block);
82443
82450
  exclusiveBlock(editor, block);
82444
82451
  const loaded = () => {
@@ -88486,7 +88493,7 @@ ${data2.flowchartText}
88486
88493
  }
88487
88494
  }
88488
88495
  });
88489
- editor.version = "2.2.16-beta.12";
88496
+ editor.version = "2.2.16-beta.14";
88490
88497
  return editor;
88491
88498
  }
88492
88499
  function isDoc(doc2) {
@@ -88581,7 +88588,7 @@ ${data2.flowchartText}
88581
88588
  });
88582
88589
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
88583
88590
  OnesEditorToolbar.register(editor);
88584
- editor.version = "2.2.16-beta.12";
88591
+ editor.version = "2.2.16-beta.14";
88585
88592
  return editor;
88586
88593
  }
88587
88594
  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.16-beta.12",
3
+ "version": "2.2.16-beta.14",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",