@ones-editor/editor 2.1.1-beta.57 → 2.1.1-beta.59

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
@@ -5830,7 +5830,7 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
5830
5830
  }
5831
5831
  div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content {
5832
5832
  height: 400px;
5833
- overflow-x: auto;
5833
+ overflow-y: auto;
5834
5834
  overscroll-behavior: contain;
5835
5835
  }
5836
5836
  div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content .mobile-item {
@@ -7457,7 +7457,10 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-embe
7457
7457
  justify-content: center;
7458
7458
  max-width: 100%;
7459
7459
  }
7460
- .embed-block[data-embed-type=video] > div[data-type=block-content] .media.full-screen, .embed-block[data-embed-type=audio] > div[data-type=block-content] .media.full-screen {
7460
+ .embed-block[data-embed-type=video] > div[data-type=block-content].full-screen, .embed-block[data-embed-type=audio] > div[data-type=block-content].full-screen {
7461
+ width: 100%;
7462
+ }
7463
+ .embed-block[data-embed-type=video] > div[data-type=block-content] .media, .embed-block[data-embed-type=audio] > div[data-type=block-content] .media {
7461
7464
  width: 100%;
7462
7465
  }
7463
7466
  .embed-block[data-embed-type=video] > div[data-type=block-content] .media, .embed-block[data-embed-type=audio] > div[data-type=block-content] .media {
@@ -49983,6 +49986,9 @@ ${codeText}
49983
49986
  this.editor = editor;
49984
49987
  }
49985
49988
  isChecked(blockData, id) {
49989
+ if (!blockData.align && id === "left") {
49990
+ return true;
49991
+ }
49986
49992
  if (blockData.align === id) {
49987
49993
  return true;
49988
49994
  }
@@ -62662,66 +62668,45 @@ ${codeText}
62662
62668
  }
62663
62669
  return true;
62664
62670
  }
62665
- function getBlockPlaceholder(editor, options) {
62666
- var _a, _b, _c;
62667
- const block = editor.selection.focusedBlock;
62668
- const blockType = getBlockType(block);
62669
- const defaultPlaceholder = options.contentPlaceholder || i18n$1.t("placeholder.default");
62670
- let placeholder2 = clientType.isMobile ? "" : defaultPlaceholder;
62671
- if (blockType && isTextKindBlockType(editor, blockType)) {
62672
- if (block) {
62673
- if (!editor.isBlockWritable(block)) {
62674
- return "";
62675
- }
62676
- if (isCodeLineBlock(block)) {
62677
- return "";
62678
- }
62679
- if (isChildBlock(block) && !clientType.isMobile) {
62680
- const parentContainerBlock = getParentBlock(getParentContainer(block));
62681
- if (!parentContainerBlock || !((_b = (_a = getBlockClass(editor, parentContainerBlock)).getOptions) == null ? void 0 : _b.call(_a, editor).isMenuButtonBaseContainer)) {
62682
- placeholder2 = i18n$1.t("placeholder.common.contentInTable");
62683
- }
62684
- if (parentContainerBlock && getBlockType(parentContainerBlock) === "callout") {
62685
- placeholder2 = i18n$1.t("placeholder.common.contentInCallout");
62686
- }
62687
- }
62688
- placeholder2 = (_c = getTextKindBlockPlaceholder(block)) != null ? _c : placeholder2;
62689
- }
62690
- }
62691
- return placeholder2;
62692
- }
62693
62671
  function applyContentPlaceholder(editor, options) {
62694
- var _a;
62695
- const blockPlaceholder = getBlockPlaceholder(editor, options);
62672
+ var _a, _b, _c;
62673
+ let targetBlock = editor.selection.focusedBlock;
62674
+ let placeholder2 = options.contentPlaceholder || i18n$1.t("placeholder.default");
62696
62675
  const titleBlock = editor.getFirstBlock();
62697
62676
  const firstContentBlock = options.hideTitle ? titleBlock : getNextBlock(titleBlock);
62698
62677
  if (!firstContentBlock) {
62699
62678
  return;
62700
62679
  }
62701
62680
  const secondContentBlock = getNextBlock(firstContentBlock);
62702
- if (secondContentBlock) {
62703
- if (!options.addPlaceholderToAllCurrentEmptyBlock) {
62704
- return;
62705
- }
62681
+ if (secondContentBlock && !options.addPlaceholderToAllCurrentEmptyBlock) {
62682
+ return;
62706
62683
  }
62707
62684
  if (!secondContentBlock) {
62708
- if (isEmptyTextBlockWithoutCompositionText(editor, firstContentBlock)) {
62709
- applyPlaceholderToBlock(
62710
- editor,
62711
- firstContentBlock,
62712
- (_a = getTextKindBlockPlaceholder(firstContentBlock)) != null ? _a : blockPlaceholder
62713
- );
62714
- return;
62715
- }
62685
+ targetBlock = firstContentBlock;
62716
62686
  }
62717
- const focusedBlock = editor.getFocusedBlock();
62718
- if (!isEmptyTextBlockWithoutCompositionText(editor, focusedBlock)) {
62687
+ if (!isEmptyTextBlockWithoutCompositionText(editor, targetBlock)) {
62688
+ return;
62689
+ }
62690
+ if (!editor.isBlockWritable(targetBlock)) {
62691
+ return;
62692
+ }
62693
+ if (isCodeLineBlock(targetBlock)) {
62719
62694
  return;
62720
62695
  }
62721
- if (focusedBlock === titleBlock && !options.hideTitle) {
62696
+ if (targetBlock === titleBlock && !options.hideTitle) {
62722
62697
  return;
62723
62698
  }
62724
- applyPlaceholderToBlock(editor, focusedBlock, blockPlaceholder);
62699
+ if (isChildBlock(targetBlock)) {
62700
+ const parentContainerBlock = getParentBlock(getParentContainer(targetBlock));
62701
+ if (!parentContainerBlock || !((_b = (_a = getBlockClass(editor, parentContainerBlock)).getOptions) == null ? void 0 : _b.call(_a, editor).isMenuButtonBaseContainer)) {
62702
+ placeholder2 = i18n$1.t("placeholder.common.contentInContainer");
62703
+ }
62704
+ }
62705
+ if (clientType.isMobile) {
62706
+ placeholder2 = "";
62707
+ }
62708
+ placeholder2 = (_c = getTextKindBlockPlaceholder(targetBlock)) != null ? _c : placeholder2;
62709
+ applyPlaceholderToBlock(editor, targetBlock, placeholder2);
62725
62710
  }
62726
62711
  function applyTitlePlaceholder(editor, options) {
62727
62712
  var _a, _b;
@@ -75158,7 +75143,7 @@ ${content}
75158
75143
  link2.setAttribute("data-file-src", fileData.src);
75159
75144
  }
75160
75145
  function handleClickBox$1(editor, box, event) {
75161
- if (clientType.isMobile) {
75146
+ if (clientType.isMobile && !editor.readonly) {
75162
75147
  return;
75163
75148
  }
75164
75149
  const options = editor.options.componentsOptions.file;
@@ -78349,6 +78334,10 @@ ${content}
78349
78334
  this.mobileWrap.appendChild(content);
78350
78335
  this.createMobileItems(content, items, "");
78351
78336
  this.mobileWrap.addEventListener("click", this.handleMobileWrapClick);
78337
+ content.addEventListener("scroll", () => {
78338
+ var _a;
78339
+ return (_a = document.activeElement) == null ? void 0 : _a.blur();
78340
+ });
78352
78341
  return [{
78353
78342
  id: "create-mobile-item",
78354
78343
  name: "Create Mobile Item",
@@ -84223,12 +84212,14 @@ ${data2.flowchartText}
84223
84212
  });
84224
84213
  }
84225
84214
  setFullScreen() {
84226
- assert(logger$8, this.mediaContainer, "The media element not exist");
84227
- addClass(this.mediaContainer, "full-screen");
84215
+ var _a;
84216
+ assert(logger$8, (_a = this.mediaContainer) == null ? void 0 : _a.parentElement, "The media element not exist");
84217
+ addClass(this.mediaContainer.parentElement, "full-screen");
84228
84218
  }
84229
84219
  removeFullScreen() {
84230
- assert(logger$8, this.mediaContainer, "The media element not exist");
84231
- removeClass(this.mediaContainer, "full-screen");
84220
+ var _a;
84221
+ assert(logger$8, (_a = this.mediaContainer) == null ? void 0 : _a.parentElement, "The media element not exist");
84222
+ removeClass(this.mediaContainer.parentElement, "full-screen");
84232
84223
  }
84233
84224
  updateBlockAlign(blockData, content) {
84234
84225
  const block = getParentBlock(content);
@@ -84965,7 +84956,7 @@ ${data2.flowchartText}
84965
84956
  title: "\u8BF7\u8F93\u5165\u6807\u9898",
84966
84957
  readonlyTitle: "\u8BF7\u8F93\u5165\u6807\u9898",
84967
84958
  content: "\u70B9\u51FB + \uFF0C\u6216\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6",
84968
- contentInTable: "\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6",
84959
+ contentInContainer: "\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6",
84969
84960
  contentInCallout: "\u8BF7\u8F93\u5165"
84970
84961
  },
84971
84962
  local: {
@@ -84985,7 +84976,7 @@ ${data2.flowchartText}
84985
84976
  title: "Enter a title",
84986
84977
  readonlyTitle: "Enter a title",
84987
84978
  content: 'Click "+", or enter "/" to insert components quickly',
84988
- contentInTable: 'Enter "/" to insert components quickly',
84979
+ contentInContainer: 'Enter "/" to insert components quickly',
84989
84980
  contentInCallout: "Enter text here"
84990
84981
  },
84991
84982
  local: {
@@ -85005,7 +84996,7 @@ ${data2.flowchartText}
85005
84996
  title: "\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
85006
84997
  readonlyTitle: "\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
85007
84998
  content: "\u300C+\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u304B\u3001\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059",
85008
- contentInTable: "\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059",
84999
+ contentInContainer: "\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059",
85009
85000
  contentInCallout: "\u5185\u5BB9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"
85010
85001
  },
85011
85002
  local: {
@@ -86560,7 +86551,7 @@ ${data2.flowchartText}
86560
86551
  }
86561
86552
  }
86562
86553
  });
86563
- editor.version = "2.1.1-beta.57";
86554
+ editor.version = "2.1.1-beta.59";
86564
86555
  if (Logger$2.level === LogLevel.DEBUG) {
86565
86556
  window.setReauthFail = (fail) => {
86566
86557
  window.isReauthError = fail;
@@ -86658,7 +86649,7 @@ ${data2.flowchartText}
86658
86649
  });
86659
86650
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
86660
86651
  OnesEditorToolbar.register(editor);
86661
- editor.version = "2.1.1-beta.57";
86652
+ editor.version = "2.1.1-beta.59";
86662
86653
  return editor;
86663
86654
  }
86664
86655
  async function showDocVersions(editor, options, serverUrl) {
@@ -4,7 +4,7 @@ declare const _default: {
4
4
  title: string;
5
5
  readonlyTitle: string;
6
6
  content: string;
7
- contentInTable: string;
7
+ contentInContainer: string;
8
8
  contentInCallout: string;
9
9
  };
10
10
  local: {
@@ -4,7 +4,7 @@ declare const _default: {
4
4
  title: string;
5
5
  readonlyTitle: string;
6
6
  content: string;
7
- contentInTable: string;
7
+ contentInContainer: string;
8
8
  contentInCallout: string;
9
9
  };
10
10
  local: {
@@ -4,7 +4,7 @@ declare const _default: {
4
4
  title: string;
5
5
  readonlyTitle: string;
6
6
  content: string;
7
- contentInTable: string;
7
+ contentInContainer: string;
8
8
  contentInCallout: string;
9
9
  };
10
10
  local: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.1.1-beta.57",
3
+ "version": "2.1.1-beta.59",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",