@ones-editor/editor 2.5.1-beta.1 → 2.5.1-beta.10

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
@@ -11147,11 +11147,10 @@ var __publicField = (obj, key, value) => {
11147
11147
  constructor(options) {
11148
11148
  __publicField(this, "cancelScroll", null);
11149
11149
  __publicField(this, "options");
11150
- __publicField(this, "scrollDomInfo");
11151
11150
  __publicField(this, "scrolling", false);
11152
11151
  __publicField(this, "getScrollingDirection", (e2) => {
11153
11152
  const { x, y } = e2;
11154
- const { top, bottom, left, right } = this.scrollDomInfo;
11153
+ const { top, bottom, left, right } = this.getScrollDomInfo();
11155
11154
  const { edge } = this.options;
11156
11155
  if (edge.top && y <= edge.top + top) {
11157
11156
  return "top";
@@ -11188,7 +11187,6 @@ var __publicField = (obj, key, value) => {
11188
11187
  }
11189
11188
  });
11190
11189
  this.options = options;
11191
- this.scrollDomInfo = this.getScrollDomInfo();
11192
11190
  }
11193
11191
  getScrollDomInfo() {
11194
11192
  const { scrollElement } = this.options;
@@ -73834,6 +73832,18 @@ ${codeText}
73834
73832
  }
73835
73833
  if (token.type === "html") {
73836
73834
  const html = token.text;
73835
+ const testBr = html.trim().toLowerCase();
73836
+ if (testBr === "<br>" || testBr === "<br/>" || testBr === "<br />") {
73837
+ return [{
73838
+ insert: " ",
73839
+ attributes: {
73840
+ id: genId(),
73841
+ created: Date.now(),
73842
+ box: true,
73843
+ type: "br"
73844
+ }
73845
+ }];
73846
+ }
73837
73847
  applyHtmlToText(html, attributes);
73838
73848
  applyColorTagToText(html, attributes);
73839
73849
  applyFontSizeTagToText(html, attributes);
@@ -73868,6 +73878,22 @@ ${codeText}
73868
73878
  }
73869
73879
  }];
73870
73880
  }
73881
+ if (token.type === "image") {
73882
+ const href = token.href || "";
73883
+ if (href) {
73884
+ const boxData = {
73885
+ id: genId(),
73886
+ created: Date.now(),
73887
+ box: true,
73888
+ type: "image",
73889
+ src: href
73890
+ };
73891
+ return [{
73892
+ insert: " ",
73893
+ attributes: boxData
73894
+ }];
73895
+ }
73896
+ }
73871
73897
  logger$Q.warn(`unknown token in text: ${JSON.stringify(token)}`);
73872
73898
  return [];
73873
73899
  });
@@ -74209,15 +74235,24 @@ ${codeText}
74209
74235
  children: []
74210
74236
  };
74211
74237
  const groups = groupTokens(tokens);
74212
- groups.forEach((tokens2, index2) => {
74213
- const token = tokens2[0];
74238
+ groups.forEach((childTokens, index2) => {
74214
74239
  if (index2 === 0) {
74240
+ const token = childTokens[0];
74215
74241
  if (isInlineToken(token)) {
74216
- ret.text = tokensToText(tokens2, {}, options);
74242
+ ret.text = tokensToText(childTokens, {}, options);
74217
74243
  return;
74218
74244
  }
74219
74245
  }
74220
- ret.children.push(...tokensToBlocks(tokens2, options));
74246
+ if (childTokens.every((token) => isInlineToken(token))) {
74247
+ const blockText = tokensToText(childTokens, {}, options);
74248
+ ret.children.push({
74249
+ id: genId(),
74250
+ type: "text",
74251
+ text: blockText
74252
+ });
74253
+ return;
74254
+ }
74255
+ ret.children.push(...tokensToBlocks(childTokens, options));
74221
74256
  });
74222
74257
  return ret;
74223
74258
  }
@@ -85104,7 +85139,7 @@ ${data2.flowchartText}
85104
85139
  const block = blocks[i];
85105
85140
  if (block.type === "embed" && block.embedType === "drawio") {
85106
85141
  const src = ((_a = block.embedData) == null ? void 0 : _a.src) || "";
85107
- if (!this.isSameOrigin(editor, doc2, src)) {
85142
+ if (src && !this.isSameOrigin(editor, doc2, src)) {
85108
85143
  blocks.splice(i, 1);
85109
85144
  }
85110
85145
  }
@@ -92125,7 +92160,7 @@ ${data2.plantumlText}
92125
92160
  }
92126
92161
  }
92127
92162
  });
92128
- editor.version = "2.5.1-beta.1";
92163
+ editor.version = "2.5.1-beta.10";
92129
92164
  return editor;
92130
92165
  }
92131
92166
  function isDoc(doc2) {
@@ -92238,7 +92273,7 @@ ${data2.plantumlText}
92238
92273
  }
92239
92274
  });
92240
92275
  OnesEditorToolbar.register(editor);
92241
- editor.version = "2.5.1-beta.1";
92276
+ editor.version = "2.5.1-beta.10";
92242
92277
  return editor;
92243
92278
  }
92244
92279
  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.5.1-beta.1",
3
+ "version": "2.5.1-beta.10",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {