@ones-editor/editor 2.2.1 → 2.2.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
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
div.editor-root {
|
|
37
37
|
--text-color: #303030;
|
|
38
38
|
--primary-color: #0064ff;
|
|
39
|
-
--background-selection: #
|
|
39
|
+
--background-selection: #0064ff1A;
|
|
40
40
|
--background-code: #cdcdcd40;
|
|
41
41
|
}
|
|
42
42
|
div.editor-root {
|
|
@@ -175,8 +175,7 @@ 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
|
|
179
|
-
font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
|
|
178
|
+
font: 0.8em Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
|
|
180
179
|
}
|
|
181
180
|
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 {
|
|
182
181
|
vertical-align: sub;
|
|
@@ -361,7 +360,7 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
|
|
|
361
360
|
border-left: 4px solid #d4d6d9;
|
|
362
361
|
color: #87888a;
|
|
363
362
|
}
|
|
364
|
-
div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]:not([data-list-level]
|
|
363
|
+
div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-quoted]:not([data-list-level]) {
|
|
365
364
|
padding-left: 8px;
|
|
366
365
|
}
|
|
367
366
|
div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-heading="1"] {
|
|
@@ -6097,6 +6096,9 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
|
|
|
6097
6096
|
flex: 1;
|
|
6098
6097
|
min-width: 0;
|
|
6099
6098
|
}
|
|
6099
|
+
.editor-root [data-type=editor-container].root div[data-type=editor-block].callout-block .callout-root .callout-content > .child {
|
|
6100
|
+
padding: 0;
|
|
6101
|
+
}
|
|
6100
6102
|
.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
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[data-type=block-content] {
|
|
6102
6104
|
background-color: transparent;
|
|
@@ -26386,10 +26388,6 @@ var __publicField = (obj, key, value) => {
|
|
|
26386
26388
|
const firstBlock = getFirstChildBlock(nextContainer);
|
|
26387
26389
|
return firstBlock;
|
|
26388
26390
|
}
|
|
26389
|
-
const targetBlock = isFindPrev(type) ? getPrevBlock(parentComplexBlock) : getNextBlock(parentComplexBlock);
|
|
26390
|
-
if (targetBlock) {
|
|
26391
|
-
return targetBlock;
|
|
26392
|
-
}
|
|
26393
26391
|
return findNextBlockInComplexBlock(editor, parentComplexBlock, type);
|
|
26394
26392
|
}
|
|
26395
26393
|
function findNextOrPrevOfParentBlock(editor, block, type) {
|
|
@@ -30571,11 +30569,6 @@ ${codeText}
|
|
|
30571
30569
|
if (!value) {
|
|
30572
30570
|
delete attributes[key];
|
|
30573
30571
|
} 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
|
-
}
|
|
30579
30572
|
attributes[key] = value;
|
|
30580
30573
|
}
|
|
30581
30574
|
});
|
|
@@ -48220,44 +48213,6 @@ ${codeText}
|
|
|
48220
48213
|
"Shift+Tab": handleShiftTab$3,
|
|
48221
48214
|
"Backspace": handleBackspace$2
|
|
48222
48215
|
};
|
|
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
|
-
}
|
|
48261
48216
|
function findPreviousBrotherWithHeading(block, heading, level = 1) {
|
|
48262
48217
|
if (!heading) {
|
|
48263
48218
|
return null;
|
|
@@ -48354,9 +48309,7 @@ ${codeText}
|
|
|
48354
48309
|
const fixStart = new FixStartByBlock(editor, srcBlock, { start: 1 });
|
|
48355
48310
|
fixStart.fix();
|
|
48356
48311
|
}
|
|
48357
|
-
const pickedTextBlock = pickTextBlockData(srcData);
|
|
48358
48312
|
const blockData = {
|
|
48359
|
-
...pickedTextBlock,
|
|
48360
48313
|
id: genId(),
|
|
48361
48314
|
type: "list",
|
|
48362
48315
|
level,
|
|
@@ -48365,6 +48318,12 @@ ${codeText}
|
|
|
48365
48318
|
ordered: false,
|
|
48366
48319
|
text: text2
|
|
48367
48320
|
};
|
|
48321
|
+
if (srcData.quoted) {
|
|
48322
|
+
blockData.quoted = true;
|
|
48323
|
+
}
|
|
48324
|
+
if (srcData.heading) {
|
|
48325
|
+
blockData.heading = srcData.heading;
|
|
48326
|
+
}
|
|
48368
48327
|
if (type === "ordered") {
|
|
48369
48328
|
blockData.ordered = true;
|
|
48370
48329
|
} else if (type === "checked" || type === "unchecked") {
|
|
@@ -48378,6 +48337,30 @@ ${codeText}
|
|
|
48378
48337
|
}
|
|
48379
48338
|
};
|
|
48380
48339
|
}
|
|
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
|
+
}
|
|
48381
48364
|
function isCheck(type) {
|
|
48382
48365
|
return type === "checked" || type === "unchecked";
|
|
48383
48366
|
}
|
|
@@ -48528,7 +48511,17 @@ ${codeText}
|
|
|
48528
48511
|
function convertListToTextBlock(editor, block) {
|
|
48529
48512
|
ensureIsListBlock(block);
|
|
48530
48513
|
const listBlockData = editor.getBlockData(block);
|
|
48531
|
-
const textBlockData =
|
|
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
|
+
}
|
|
48532
48525
|
const container = getParentContainer(block);
|
|
48533
48526
|
const blockIndex = getBlockIndex(block);
|
|
48534
48527
|
editor.deleteBlock(block);
|
|
@@ -86880,7 +86873,7 @@ ${data2.flowchartText}
|
|
|
86880
86873
|
}
|
|
86881
86874
|
}
|
|
86882
86875
|
});
|
|
86883
|
-
editor.version = "2.2.
|
|
86876
|
+
editor.version = "2.2.2";
|
|
86884
86877
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
86885
86878
|
window.setReauthFail = (fail) => {
|
|
86886
86879
|
window.isReauthError = fail;
|
|
@@ -86981,7 +86974,7 @@ ${data2.flowchartText}
|
|
|
86981
86974
|
});
|
|
86982
86975
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
86983
86976
|
OnesEditorToolbar.register(editor);
|
|
86984
|
-
editor.version = "2.2.
|
|
86977
|
+
editor.version = "2.2.2";
|
|
86985
86978
|
return editor;
|
|
86986
86979
|
}
|
|
86987
86980
|
async function showDocVersions(editor, options, serverUrl) {
|