@ones-editor/editor 3.0.11 → 3.0.12-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
@@ -7798,6 +7798,38 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
7798
7798
  }
7799
7799
  div.editor-root.readonly div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=drawio] [data-src] {
7800
7800
  cursor: zoom-in;
7801
+ }
7802
+ .command-item.menu-item[data-id=insert-drawio] {
7803
+ width: 100%;
7804
+ }
7805
+ .command-item.menu-item[data-id=insert-drawio] .uml-menu-item {
7806
+ color: #2d2d2e;
7807
+ user-select: none;
7808
+ transition: background 20ms ease-in 0s;
7809
+ width: 100%;
7810
+ height: 32px;
7811
+ padding: 6px 10px;
7812
+ display: flex;
7813
+ align-items: center;
7814
+ box-sizing: border-box;
7815
+ }
7816
+ .command-item.menu-item[data-id=insert-drawio] .uml-menu-item .menu-item-icon {
7817
+ display: flex;
7818
+ align-items: center;
7819
+ justify-content: center;
7820
+ height: 24px;
7821
+ width: 24px;
7822
+ margin-right: 5px;
7823
+ margin-top: -2px;
7824
+ display: flex;
7825
+ flex-direction: column;
7826
+ justify-content: center;
7827
+ }
7828
+ .command-item.menu-item[data-id=insert-drawio] .uml-menu-item .menu-item-name {
7829
+ white-space: nowrap;
7830
+ flex-grow: 1;
7831
+ display: flex;
7832
+ align-items: center;
7801
7833
  }.embed-block[data-embed-type=mermaid],
7802
7834
  .embed-block[data-embed-type=flowchart],
7803
7835
  .embed-block[data-embed-type=plantuml] {
@@ -41761,7 +41793,9 @@ ${codeText}
41761
41793
  }
41762
41794
  }
41763
41795
  if (item.element) {
41764
- return;
41796
+ if (!item.useDefaultClickHandler) {
41797
+ return;
41798
+ }
41765
41799
  }
41766
41800
  this.emit("click", this, item, elem);
41767
41801
  if (item.clickToClose === false) {
@@ -88546,7 +88580,18 @@ ${data2.flowchartText}
88546
88580
  update(editor, embed, data2);
88547
88581
  return true;
88548
88582
  }
88549
- function getOptions$3() {
88583
+ function getOptions$3(editor) {
88584
+ var _a;
88585
+ const drawioOptions = getDrawioOptions(editor);
88586
+ const suffixElem = (_a = drawioOptions.menuItemSuffix) == null ? void 0 : _a.call(drawioOptions, editor);
88587
+ const element = suffixElem ? () => {
88588
+ const root2 = createElement("div", ["uml-menu-item"], null);
88589
+ const iconElem = createElement("div", ["menu-item-icon"], root2);
88590
+ iconElem.innerHTML = UmlIcon;
88591
+ createElement("div", ["menu-item-name"], root2, i18n$1.t("drawio.title"));
88592
+ root2.appendChild(suffixElem);
88593
+ return root2;
88594
+ } : void 0;
88550
88595
  return {
88551
88596
  name: "UML",
88552
88597
  insertEmbedCommandItems: [{
@@ -88555,21 +88600,27 @@ ${data2.flowchartText}
88555
88600
  icon: UmlIcon,
88556
88601
  group: "common",
88557
88602
  order: 600,
88558
- subText: getShortcutById("insert-drawio")
88603
+ subText: getShortcutById("insert-drawio"),
88604
+ element,
88605
+ useDefaultClickHandler: true
88559
88606
  }],
88560
- handleInsertEmptyEmbed: async (editor, options) => {
88607
+ handleInsertEmptyEmbed: async (editor2, options) => {
88608
+ var _a2, _b;
88609
+ if (((_b = (_a2 = drawioOptions.callbacks) == null ? void 0 : _a2.onBeforeInsertDrawio) == null ? void 0 : _b.call(_a2, editor2)) === false) {
88610
+ return null;
88611
+ }
88561
88612
  const embedData = {
88562
88613
  src: "",
88563
88614
  xml: "",
88564
88615
  xmlSvg: ""
88565
88616
  };
88566
- const block = editor.insertEmbed(options.containerId, options.blockIndex, "drawio", embedData);
88617
+ const block = editor2.insertEmbed(options.containerId, options.blockIndex, "drawio", embedData);
88567
88618
  setTimeout(() => {
88568
88619
  const blockContent = getBlockContent(block);
88569
88620
  const embed = blockContent.querySelector(":scope > .editor-drawio-content");
88570
88621
  assert(logger$i, embed, "embed should not be null");
88571
- const blockData = editor.getBlockData(block);
88572
- editDrawIO(editor, block, embed, blockData.embedData);
88622
+ const blockData = editor2.getBlockData(block);
88623
+ editDrawIO(editor2, block, embed, blockData.embedData);
88573
88624
  }, 100);
88574
88625
  return block;
88575
88626
  }
@@ -96799,7 +96850,7 @@ ${JSON.stringify(error2, null, 2)}`);
96799
96850
  }
96800
96851
  }
96801
96852
  });
96802
- editor.version = "3.0.11";
96853
+ editor.version = "3.0.12-beta.2";
96803
96854
  return editor;
96804
96855
  }
96805
96856
  function isDoc(doc2) {
@@ -96933,7 +96984,7 @@ ${JSON.stringify(error2, null, 2)}`);
96933
96984
  OnesEditorDropTarget.register(editor);
96934
96985
  OnesEditorTocProvider.register(editor);
96935
96986
  OnesEditorExclusiveBlock.register(editor);
96936
- editor.version = "3.0.11";
96987
+ editor.version = "3.0.12-beta.2";
96937
96988
  return editor;
96938
96989
  }
96939
96990
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "3.0.11",
3
+ "version": "3.0.12-beta.2",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {