@ones-editor/editor 2.2.1 → 2.2.2-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
@@ -2620,7 +2620,6 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
2620
2620
  width: 100%;
2621
2621
  }
2622
2622
  [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] {
2623
- height: 495px;
2624
2623
  align-items: start;
2625
2624
  }
2626
2625
  [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup].selected {
@@ -2683,6 +2682,7 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
2683
2682
  color: var(--color-0);
2684
2683
  }
2685
2684
  div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] img.mathjax {
2685
+ flex-shrink: 0;
2686
2686
  -webkit-touch-callout: none;
2687
2687
  }
2688
2688
  div.editor-root.readonly div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] img.mathjax {
@@ -6097,6 +6097,9 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
6097
6097
  flex: 1;
6098
6098
  min-width: 0;
6099
6099
  }
6100
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].callout-block .callout-root .callout-content > .child {
6101
+ padding: 0;
6102
+ }
6100
6103
  .editor-root [data-type=editor-container].root div[data-type=editor-block].callout-block .callout-root .callout-content div[data-type=editor-block].list-block > div.list-container,
6101
6104
  .editor-root [data-type=editor-container].root div[data-type=editor-block].callout-block .callout-root .callout-content div[data-type=editor-block].list-block > div[data-type=block-content] {
6102
6105
  background-color: transparent;
@@ -38885,7 +38888,7 @@ ${codeText}
38885
38888
  const TreeIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.80894 1.37566L9.19382 1.05649V1.05649L8.80894 1.37566ZM7.26945 1.37566L6.88457 1.05649V1.05649L7.26945 1.37566ZM12.7147 6.08541L13.0996 5.76623V5.76623L12.7147 6.08541ZM11.4874 7.72375V7.22375H10.1891L11.152 8.09459L11.4874 7.72375ZM14.159 10.1399L14.4944 9.76908L14.159 10.1399ZM10.0508 11.8816V11.3816H9.55085V11.8816H10.0508ZM10.0508 15V15.5H10.5508V15H10.0508ZM6.02806 15H5.52806V15.5H6.02806V15ZM6.02806 11.8816H6.52806V11.3816H6.02806V11.8816ZM1.91945 10.1399L2.25483 10.5108H2.25483L1.91945 10.1399ZM4.59108 7.72375L4.92646 8.09459L5.88936 7.22375H4.59108V7.72375ZM3.36368 6.0854L3.74855 6.40458L3.36368 6.0854ZM9.19382 1.05649C8.59399 0.333182 7.48441 0.333182 6.88457 1.05649L7.65432 1.69483C7.85427 1.45373 8.22413 1.45373 8.42407 1.69483L9.19382 1.05649ZM13.0996 5.76623L9.19382 1.05649L8.42407 1.69483L12.3298 6.40458L13.0996 5.76623ZM11.945 8.22375C13.215 8.22375 13.9103 6.74387 13.0996 5.76623L12.3298 6.40458C12.6001 6.73046 12.3683 7.22375 11.945 7.22375V8.22375ZM11.4874 8.22375H11.945V7.22375H11.4874V8.22375ZM14.4944 9.76908L11.8227 7.35292L11.152 8.09459L13.8236 10.5108L14.4944 9.76908ZM13.4882 12.3816C14.8612 12.3816 15.5126 10.69 14.4944 9.76908L13.8236 10.5108C14.163 10.8177 13.9459 11.3816 13.4882 11.3816V12.3816ZM10.0508 12.3816H13.4882V11.3816H10.0508V12.3816ZM9.55085 11.8816V15H10.5508V11.8816H9.55085ZM10.0508 14.5H6.02806V15.5H10.0508V14.5ZM6.52806 15V11.8816H5.52806V15H6.52806ZM2.59021 12.3816H6.02806V11.3816H2.59021V12.3816ZM1.58407 9.76909C0.565789 10.69 1.21726 12.3816 2.59021 12.3816V11.3816C2.13256 11.3816 1.9154 10.8177 2.25483 10.5108L1.58407 9.76909ZM4.2557 7.35292L1.58407 9.76909L2.25483 10.5108L4.92646 8.09459L4.2557 7.35292ZM4.13343 8.22375H4.59108V7.22375H4.13343V8.22375ZM2.97881 5.76623C2.16805 6.74387 2.86334 8.22375 4.13343 8.22375V7.22375C3.71007 7.22375 3.4783 6.73046 3.74855 6.40458L2.97881 5.76623ZM6.88457 1.05649L2.97881 5.76623L3.74855 6.40458L7.65432 1.69483L6.88457 1.05649Z" fill="currentColor"/>\n</svg>\n';
38886
38889
  const TimeIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 8C1.5 4.41023 4.41023 1.5 8 1.5C11.5898 1.5 14.5 4.41023 14.5 8C14.5 11.5898 11.5898 14.5 8 14.5C4.41023 14.5 1.5 11.5898 1.5 8ZM8 0.5C3.85794 0.5 0.5 3.85794 0.5 8C0.5 12.1421 3.85794 15.5 8 15.5C12.1421 15.5 15.5 12.1421 15.5 8C15.5 3.85794 12.1421 0.5 8 0.5ZM7.5 3V8V8.5H8H12V7.5H8.5V3H7.5Z" fill="currentColor"/>\n</svg>\n';
38887
38890
  const SearchIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10.8597 11.4183L14.0962 14.8891M12.5 7.5C12.5 10.5376 10.0376 13 7 13C3.96243 13 1.5 10.5376 1.5 7.5C1.5 4.46243 3.96243 2 7 2C10.0376 2 12.5 4.46243 12.5 7.5Z" stroke="#87888A" stroke-width="2"/>\n</svg>\n';
38888
- const TextGroupIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.49984 9.5L7.00009 9.5" stroke="#2D2D2E"/>\n<path d="M15.0001 13.5V6.5" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M15.0001 10C15.0001 11.3807 13.8808 12.5 12.5001 12.5C11.1194 12.5 10.0001 11.3807 10.0001 10C10.0001 8.61929 11.1194 7.5 12.5001 7.5C13.8808 7.5 15.0001 8.61929 15.0001 10Z" stroke="#2D2D2E"/>\n<path d="M1.00009 13.5L4.99984 2.5L8.50009 13.5" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
38891
+ const TextGroupIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.49984 9.5L7.00009 9.5" stroke="currentColor"/>\n<path d="M15.0001 13.5V6.5" stroke="currentColor" stroke-linejoin="round"/>\n<path d="M15.0001 10C15.0001 11.3807 13.8808 12.5 12.5001 12.5C11.1194 12.5 10.0001 11.3807 10.0001 10C10.0001 8.61929 11.1194 7.5 12.5001 7.5C13.8808 7.5 15.0001 8.61929 15.0001 10Z" stroke="currentColor"/>\n<path d="M1.00009 13.5L4.99984 2.5L8.50009 13.5" stroke="currentColor" stroke-linejoin="round"/>\n</svg>\n';
38889
38892
  const TabIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14 2L2 2" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M14 6H7" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M2 10.5V5.5L5.5 8L2 10.5Z" fill="#2D2D2E"/>\n<path d="M14 10H7" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M14 14H2" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
38890
38893
  const ShiftTabIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2 2H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M7 6H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M5.5 10.5V5.5L2 8L5.5 10.5Z" fill="#2D2D2E"/>\n<path d="M7 10H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M2 14H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
38891
38894
  const TableEditIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8 14.5H2.5C1.94772 14.5 1.5 14.0523 1.5 13.5V2.5C1.5 1.94772 1.94772 1.5 2.5 1.5H13.5C14.0523 1.5 14.5 1.94772 14.5 2.5V8" stroke="#2D2D2E"/>\n<path d="M1.6 4.8H14.4" stroke="#2D2D2E"/>\n<path d="M1.6 9.6H8.00078" stroke="#2D2D2E"/>\n<path d="M5.6 1.6L5.6 14.4" stroke="#2D2D2E"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5043 8.98727L11.6789 8.22924C11.7097 8.09564 11.8387 8 11.9881 8H12.8119C12.9613 8 13.0903 8.09564 13.1211 8.22924L13.2957 8.98727C13.3177 9.08256 13.3912 9.16027 13.488 9.20102C13.569 9.23514 13.648 9.2726 13.7248 9.31318C13.8018 9.35372 13.877 9.3976 13.95 9.44477C14.037 9.50098 14.1474 9.52034 14.2487 9.49008L15.0543 9.24927C15.1963 9.20683 15.3514 9.26108 15.4261 9.37933L15.9576 10.2206C16.0323 10.3389 16.0062 10.4888 15.895 10.5799L15.2639 11.0972C15.1846 11.1622 15.1477 11.2593 15.1575 11.3562C15.1657 11.4375 15.1698 11.5189 15.1697 11.6C15.1698 11.6811 15.1658 11.7625 15.1576 11.8438C15.1478 11.9407 15.1847 12.0378 15.264 12.1028L15.895 12.62C16.0062 12.7112 16.0324 12.8611 15.9577 12.9793L15.4262 13.8206C15.3515 13.9389 15.1963 13.9931 15.0544 13.9507L14.2487 13.7099C14.1474 13.6796 14.037 13.699 13.95 13.7552C13.877 13.8024 13.8018 13.8463 13.7248 13.8868C13.648 13.9274 13.569 13.9649 13.488 13.999C13.3912 14.0397 13.3177 14.1174 13.2957 14.2127L13.1211 14.9708C13.0903 15.1044 12.9613 15.2 12.8119 15.2H11.9881C11.8387 15.2 11.7097 15.1044 11.6789 14.9708L11.5043 14.2127C11.4823 14.1174 11.4088 14.0397 11.312 13.999C11.231 13.9649 11.152 13.9274 11.0752 13.8868C10.9982 13.8463 10.923 13.8024 10.85 13.7552C10.763 13.699 10.6526 13.6796 10.5513 13.7099L9.74565 13.9507C9.60366 13.9931 9.44854 13.9389 9.37384 13.8206L8.84234 12.9793C8.76764 12.8611 8.79378 12.7112 8.905 12.62L9.53602 12.1028C9.61534 12.0378 9.6522 11.9407 9.64243 11.8438C9.63424 11.7625 9.63023 11.6811 9.63031 11.6C9.63023 11.5189 9.63426 11.4375 9.64247 11.3562C9.65226 11.2593 9.61539 11.1622 9.53607 11.0972L8.90506 10.5799C8.79384 10.4888 8.7677 10.3389 8.8424 10.2206L9.3739 9.37933C9.4486 9.26108 9.60371 9.20683 9.74571 9.24927L10.5514 9.49008C10.6526 9.52034 10.7631 9.50098 10.8501 9.44477C10.923 9.3976 10.9982 9.35372 11.0752 9.31318C11.152 9.2726 11.231 9.23514 11.312 9.20102C11.4088 9.16027 11.4823 9.08256 11.5043 8.98727ZM12.3278 12.5136C12.8866 12.5136 13.3396 12.0996 13.3396 11.5889C13.3396 11.0783 12.8866 10.6643 12.3278 10.6643C11.769 10.6643 11.316 11.0783 11.316 11.5889C11.316 12.0996 11.769 12.5136 12.3278 12.5136Z" fill="#2D2D2E"/>\n</svg>\n';
@@ -49739,7 +49742,7 @@ ${codeText}
49739
49742
  __publicField(this, "onShow", () => {
49740
49743
  const scrollContainer = getScrollContainer$1(document.body);
49741
49744
  const clientHeight = scrollContainer.clientHeight;
49742
- this.linkPopup.content.style.maxHeight = `${clientHeight - 20}px`;
49745
+ this.linkPopup.content.style.height = `${clientHeight - 20}px`;
49743
49746
  this.emit("show");
49744
49747
  });
49745
49748
  __publicField(this, "close", () => {
@@ -50919,6 +50922,7 @@ ${codeText}
50919
50922
  class MathjaxStateData {
50920
50923
  constructor() {
50921
50924
  __publicField(this, "dataUrl", "");
50925
+ __publicField(this, "texWidth", null);
50922
50926
  __publicField(this, "error", null);
50923
50927
  }
50924
50928
  destroy() {
@@ -50931,6 +50935,9 @@ ${codeText}
50931
50935
  this.dataUrl = "";
50932
50936
  this.error = error2;
50933
50937
  }
50938
+ setTexWidth(tex, width) {
50939
+ this.texWidth = [tex, width];
50940
+ }
50934
50941
  }
50935
50942
  const logger$1R = getLogger("mathjax-converter");
50936
50943
  const MATHJAX_SCRIPT_ID = "MathJax-script";
@@ -51229,6 +51236,20 @@ ${codeText}
51229
51236
  }
51230
51237
  }
51231
51238
  });
51239
+ const [tex, width] = state.texWidth || [];
51240
+ if (tex === mathData.tex && width) {
51241
+ img.style.width = `${width}px`;
51242
+ } else {
51243
+ mathjax2Svg(editor, mathData.tex).then((svg) => {
51244
+ const { width: width2 } = analyzeMathjaxSvgWidth(svg);
51245
+ state.setTexWidth(mathData.tex, width2);
51246
+ const boxElement2 = editor.findBoxById(mathData.id);
51247
+ const imgElement = boxElement2 == null ? void 0 : boxElement2.querySelector("img");
51248
+ if (imgElement) {
51249
+ imgElement.style.width = `${width2}px`;
51250
+ }
51251
+ });
51252
+ }
51232
51253
  editor.domEvents.addEventListener(img, "load", updateCaret);
51233
51254
  return;
51234
51255
  }
@@ -79815,14 +79836,14 @@ ${content}
79815
79836
  this.providers.push(new InsertMenuProvider(editor));
79816
79837
  }
79817
79838
  get whiteList() {
79818
- const list2 = ["insert-image", "insert-table", "insert-link", "insert-hr"];
79839
+ let list2 = ["insert-image", "insert-table", "insert-link", "insert-hr"];
79819
79840
  const focusBlock = this.editor.selection.focusedBlock;
79820
79841
  if (!isRootBlock(focusBlock)) {
79821
- return list2.filter((id) => id !== "insert-table");
79842
+ list2 = list2.filter((id) => id !== "insert-table");
79822
79843
  }
79823
79844
  const o = this.editor.getComponentOptions("mobile");
79824
79845
  if (o == null ? void 0 : o.isAndroidApp) {
79825
- return list2.filter((id) => id !== "insert-image");
79846
+ list2 = list2.filter((id) => id !== "insert-image");
79826
79847
  }
79827
79848
  return list2;
79828
79849
  }
@@ -86880,7 +86901,7 @@ ${data2.flowchartText}
86880
86901
  }
86881
86902
  }
86882
86903
  });
86883
- editor.version = "2.2.1";
86904
+ editor.version = "2.2.2-beta.2";
86884
86905
  if (Logger$2.level === LogLevel.DEBUG) {
86885
86906
  window.setReauthFail = (fail) => {
86886
86907
  window.isReauthError = fail;
@@ -86981,7 +87002,7 @@ ${data2.flowchartText}
86981
87002
  });
86982
87003
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
86983
87004
  OnesEditorToolbar.register(editor);
86984
- editor.version = "2.2.1";
87005
+ editor.version = "2.2.2-beta.2";
86985
87006
  return editor;
86986
87007
  }
86987
87008
  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.1",
3
+ "version": "2.2.2-beta.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",