@ones-editor/editor 2.1.1-beta.81 → 2.1.1-beta.83

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.
@@ -10,6 +10,7 @@ export type EditorInputOptions = {
10
10
  maxLength?: number;
11
11
  prefix?: Element;
12
12
  suffixClose?: boolean;
13
+ mode?: 'textarea' | 'input';
13
14
  };
14
15
  export declare class EditorInput {
15
16
  private parent;
package/dist/index.js CHANGED
@@ -1594,6 +1594,7 @@ div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar.menu .menu-ite
1594
1594
  line-height: 1.4;
1595
1595
  color: #000;
1596
1596
  width: 100%;
1597
+ resize: none;
1597
1598
  }
1598
1599
  .editor-input-wrap .editor-input-container .editor-input:hover {
1599
1600
  border-color: #0064ff;
@@ -2616,12 +2617,40 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
2616
2617
  [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap {
2617
2618
  padding: 0px 15px;
2618
2619
  }
2620
+ [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap.error .editor-input-container.textarea {
2621
+ border: 1px solid #e82100;
2622
+ }
2619
2623
  [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container {
2620
2624
  padding: 0;
2621
2625
  }
2622
2626
  [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container .editor-input {
2623
2627
  line-height: 1.4;
2624
- padding: 11px 10px;
2628
+ height: 100%;
2629
+ white-space: nowrap;
2630
+ }
2631
+ [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea {
2632
+ padding: 0px 10px;
2633
+ border: 1px solid #c7c7c7;
2634
+ height: 44px;
2635
+ }
2636
+ [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea:hover {
2637
+ border-color: #0064ff;
2638
+ }
2639
+ [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea.focus {
2640
+ border-color: #0064ff;
2641
+ box-shadow: 0px 0px 0px 2px rgba(51, 143, 229, 0.2);
2642
+ }
2643
+ [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea .editor-input {
2644
+ border: none;
2645
+ padding: 11px 0px;
2646
+ width: calc(100% - 20px);
2647
+ }
2648
+ [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea .editor-input:hover {
2649
+ border: none;
2650
+ }
2651
+ [data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea .editor-input:focus {
2652
+ border: none;
2653
+ box-shadow: none;
2625
2654
  }div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.math-box {
2626
2655
  display: inline-flex;
2627
2656
  vertical-align: middle;
@@ -41009,6 +41038,11 @@ ${codeText}
41009
41038
  });
41010
41039
  __publicField(this, "handleKeyDown", (e2, composing) => {
41011
41040
  var _a, _b;
41041
+ if (this.options.mode === "textarea") {
41042
+ if (e2.code === "Enter") {
41043
+ e2.preventDefault();
41044
+ }
41045
+ }
41012
41046
  (_b = (_a = this.options).onKeyDown) == null ? void 0 : _b.call(_a, e2, composing);
41013
41047
  });
41014
41048
  __publicField(this, "showSuffix", () => {
@@ -41030,6 +41064,12 @@ ${codeText}
41030
41064
  });
41031
41065
  __publicField(this, "handleInput", (e2) => {
41032
41066
  var _a, _b;
41067
+ if (this.options.mode === "textarea") {
41068
+ const input2 = e2.target;
41069
+ if (input2.value.includes("\n")) {
41070
+ input2.value = input2.value.replace(/\n/g, "");
41071
+ }
41072
+ }
41033
41073
  (_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, e2);
41034
41074
  removeClass(this.container, "error");
41035
41075
  if (this.options.maxLength) {
@@ -41088,7 +41128,19 @@ ${codeText}
41088
41128
  }
41089
41129
  }
41090
41130
  const inputContainer = createElement("div", ["editor-input-container"], container);
41091
- const input2 = createElement("input", ["editor-input"], null);
41131
+ let input2;
41132
+ if ((options == null ? void 0 : options.mode) === "textarea") {
41133
+ addClass(inputContainer, "textarea");
41134
+ input2 = createElement("textarea", ["editor-input"], null);
41135
+ input2.onfocus = () => {
41136
+ addClass(inputContainer, "focus");
41137
+ };
41138
+ input2.onblur = () => {
41139
+ removeClass(inputContainer, "focus");
41140
+ };
41141
+ } else {
41142
+ input2 = createElement("input", ["editor-input"], null);
41143
+ }
41092
41144
  const prefix = options.prefix;
41093
41145
  if (prefix) {
41094
41146
  const suffixContainer = createElement("div", ["editor-input-prefix"], inputContainer);
@@ -49888,7 +49940,8 @@ ${codeText}
49888
49940
  defaultValue: linkText,
49889
49941
  suffixClose: clientType.isMobile,
49890
49942
  onChange: this.onChange,
49891
- onKeyDown: this.handleTextKeyboard
49943
+ onKeyDown: this.handleTextKeyboard,
49944
+ mode: clientType.isMobile ? "textarea" : "input"
49892
49945
  });
49893
49946
  this.form.linkUrl = createInput(content, {
49894
49947
  className: "link-popup-gap",
@@ -49898,7 +49951,8 @@ ${codeText}
49898
49951
  defaultValue: linkUrl,
49899
49952
  suffixClose: clientType.isMobile,
49900
49953
  onChange: this.onChange,
49901
- onKeyDown: this.handleUrlKeyboard
49954
+ onKeyDown: this.handleUrlKeyboard,
49955
+ mode: clientType.isMobile ? "textarea" : "input"
49902
49956
  });
49903
49957
  return content;
49904
49958
  }
@@ -79748,6 +79802,9 @@ ${content}
79748
79802
  return groupEachCommand(commands);
79749
79803
  });
79750
79804
  __publicField(this, "showToolbar", () => {
79805
+ if (this.editor.readonly) {
79806
+ return;
79807
+ }
79751
79808
  tippy$1.hideAll();
79752
79809
  const commands = this.getCommands();
79753
79810
  this.toolbar.updateItems(commands);
@@ -86766,7 +86823,7 @@ ${data2.flowchartText}
86766
86823
  }
86767
86824
  }
86768
86825
  });
86769
- editor.version = "2.1.1-beta.81";
86826
+ editor.version = "2.1.1-beta.83";
86770
86827
  if (Logger$2.level === LogLevel.DEBUG) {
86771
86828
  window.setReauthFail = (fail) => {
86772
86829
  window.isReauthError = fail;
@@ -86867,7 +86924,7 @@ ${data2.flowchartText}
86867
86924
  });
86868
86925
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
86869
86926
  OnesEditorToolbar.register(editor);
86870
- editor.version = "2.1.1-beta.81";
86927
+ editor.version = "2.1.1-beta.83";
86871
86928
  return editor;
86872
86929
  }
86873
86930
  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.1.1-beta.81",
3
+ "version": "2.1.1-beta.83",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",