@ones-editor/editor 2.2.0-beta.2 → 2.2.1

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
@@ -36,7 +36,7 @@
36
36
  div.editor-root {
37
37
  --text-color: #303030;
38
38
  --primary-color: #0064ff;
39
- --background-selection: #0064ff1A;
39
+ --background-selection: #0064ff1a;
40
40
  --background-code: #cdcdcd40;
41
41
  }
42
42
  div.editor-root {
@@ -175,7 +175,8 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
175
175
  /* border: 1px solid #BCBEC0; */
176
176
  background-color: var(--background-code);
177
177
  padding: 4px;
178
- font: 0.8em Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
178
+ font-size: 0.8em;
179
+ font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
179
180
  }
180
181
  div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.text.style-sub, div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.inputting-insertion.style-sub {
181
182
  vertical-align: sub;
@@ -360,7 +361,7 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
360
361
  border-left: 4px solid #d4d6d9;
361
362
  color: #87888a;
362
363
  }
363
- div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]:not([data-list-level]) {
364
+ div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]:not([data-list-level], [block-padding-level]) {
364
365
  padding-left: 8px;
365
366
  }
366
367
  div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="1"] {
@@ -6096,9 +6097,6 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
6096
6097
  flex: 1;
6097
6098
  min-width: 0;
6098
6099
  }
6099
- .editor-root [data-type=editor-container].root div[data-type=editor-block].callout-block .callout-root .callout-content > .child {
6100
- padding: 0;
6101
- }
6102
6100
  .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,
6103
6101
  .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] {
6104
6102
  background-color: transparent;
@@ -26388,6 +26386,10 @@ var __publicField = (obj, key, value) => {
26388
26386
  const firstBlock = getFirstChildBlock(nextContainer);
26389
26387
  return firstBlock;
26390
26388
  }
26389
+ const targetBlock = isFindPrev(type) ? getPrevBlock(parentComplexBlock) : getNextBlock(parentComplexBlock);
26390
+ if (targetBlock) {
26391
+ return targetBlock;
26392
+ }
26391
26393
  return findNextBlockInComplexBlock(editor, parentComplexBlock, type);
26392
26394
  }
26393
26395
  function findNextOrPrevOfParentBlock(editor, block, type) {
@@ -30569,6 +30571,11 @@ ${codeText}
30569
30571
  if (!value) {
30570
30572
  delete attributes[key];
30571
30573
  } else {
30574
+ const scriptKeys = ["style-sub", "style-super"];
30575
+ if (scriptKeys.includes(key)) {
30576
+ const [another] = scriptKeys.filter((keys) => keys !== key);
30577
+ delete attributes[another];
30578
+ }
30572
30579
  attributes[key] = value;
30573
30580
  }
30574
30581
  });
@@ -48213,6 +48220,44 @@ ${codeText}
48213
48220
  "Shift+Tab": handleShiftTab$3,
48214
48221
  "Backspace": handleBackspace$2
48215
48222
  };
48223
+ function getListType(listData) {
48224
+ if (listData.textOnly) {
48225
+ return "text-only";
48226
+ }
48227
+ if (listData.checkbox) {
48228
+ return listData.checkbox;
48229
+ }
48230
+ if (listData.ordered) {
48231
+ return "ordered";
48232
+ }
48233
+ return "unordered";
48234
+ }
48235
+ function getListMarker(listData) {
48236
+ var _a, _b;
48237
+ if (listData.checkbox) {
48238
+ return "";
48239
+ }
48240
+ const level = (_a = listData.level) != null ? _a : 1;
48241
+ if (listData.ordered) {
48242
+ const num = getListNumber(level, (_b = listData.start) != null ? _b : 1);
48243
+ return `${num}.`;
48244
+ }
48245
+ return getListBullet(level);
48246
+ }
48247
+ function pickTextBlockData(listBlockData) {
48248
+ const textBlockData = {
48249
+ id: genId(),
48250
+ type: "text",
48251
+ text: listBlockData.text
48252
+ };
48253
+ const keys = ["heading", "quoted", "align"];
48254
+ for (const key of keys) {
48255
+ if (listBlockData[key] !== void 0) {
48256
+ textBlockData[key] = listBlockData[key];
48257
+ }
48258
+ }
48259
+ return textBlockData;
48260
+ }
48216
48261
  function findPreviousBrotherWithHeading(block, heading, level = 1) {
48217
48262
  if (!heading) {
48218
48263
  return null;
@@ -48309,7 +48354,9 @@ ${codeText}
48309
48354
  const fixStart = new FixStartByBlock(editor, srcBlock, { start: 1 });
48310
48355
  fixStart.fix();
48311
48356
  }
48357
+ const pickedTextBlock = pickTextBlockData(srcData);
48312
48358
  const blockData = {
48359
+ ...pickedTextBlock,
48313
48360
  id: genId(),
48314
48361
  type: "list",
48315
48362
  level,
@@ -48318,12 +48365,6 @@ ${codeText}
48318
48365
  ordered: false,
48319
48366
  text: text2
48320
48367
  };
48321
- if (srcData.quoted) {
48322
- blockData.quoted = true;
48323
- }
48324
- if (srcData.heading) {
48325
- blockData.heading = srcData.heading;
48326
- }
48327
48368
  if (type === "ordered") {
48328
48369
  blockData.ordered = true;
48329
48370
  } else if (type === "checked" || type === "unchecked") {
@@ -48337,30 +48378,6 @@ ${codeText}
48337
48378
  }
48338
48379
  };
48339
48380
  }
48340
- function getListType(listData) {
48341
- if (listData.textOnly) {
48342
- return "text-only";
48343
- }
48344
- if (listData.checkbox) {
48345
- return listData.checkbox;
48346
- }
48347
- if (listData.ordered) {
48348
- return "ordered";
48349
- }
48350
- return "unordered";
48351
- }
48352
- function getListMarker(listData) {
48353
- var _a, _b;
48354
- if (listData.checkbox) {
48355
- return "";
48356
- }
48357
- const level = (_a = listData.level) != null ? _a : 1;
48358
- if (listData.ordered) {
48359
- const num = getListNumber(level, (_b = listData.start) != null ? _b : 1);
48360
- return `${num}.`;
48361
- }
48362
- return getListBullet(level);
48363
- }
48364
48381
  function isCheck(type) {
48365
48382
  return type === "checked" || type === "unchecked";
48366
48383
  }
@@ -48511,17 +48528,7 @@ ${codeText}
48511
48528
  function convertListToTextBlock(editor, block) {
48512
48529
  ensureIsListBlock(block);
48513
48530
  const listBlockData = editor.getBlockData(block);
48514
- const textBlockData = {
48515
- id: genId(),
48516
- type: "text",
48517
- text: listBlockData.text
48518
- };
48519
- if (listBlockData.heading) {
48520
- textBlockData.heading = listBlockData.heading;
48521
- }
48522
- if (listBlockData.heading) {
48523
- textBlockData.heading = listBlockData.heading;
48524
- }
48531
+ const textBlockData = pickTextBlockData(listBlockData);
48525
48532
  const container = getParentContainer(block);
48526
48533
  const blockIndex = getBlockIndex(block);
48527
48534
  editor.deleteBlock(block);
@@ -86873,7 +86880,7 @@ ${data2.flowchartText}
86873
86880
  }
86874
86881
  }
86875
86882
  });
86876
- editor.version = "2.2.0-beta.2";
86883
+ editor.version = "2.2.1";
86877
86884
  if (Logger$2.level === LogLevel.DEBUG) {
86878
86885
  window.setReauthFail = (fail) => {
86879
86886
  window.isReauthError = fail;
@@ -86974,7 +86981,7 @@ ${data2.flowchartText}
86974
86981
  });
86975
86982
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
86976
86983
  OnesEditorToolbar.register(editor);
86977
- editor.version = "2.2.0-beta.2";
86984
+ editor.version = "2.2.1";
86978
86985
  return editor;
86979
86986
  }
86980
86987
  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.0-beta.2",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",