@ones-editor/editor 1.1.18-beta.19 → 1.1.18-beta.20
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
|
@@ -45105,7 +45105,6 @@ ${codeText}
|
|
|
45105
45105
|
}
|
|
45106
45106
|
class ListBlockInputHandler {
|
|
45107
45107
|
constructor(editor) {
|
|
45108
|
-
__publicField(this, "fixStartByList", null);
|
|
45109
45108
|
this.editor = editor;
|
|
45110
45109
|
}
|
|
45111
45110
|
handleBeforeKeyDown(editor, event) {
|
|
@@ -45147,66 +45146,6 @@ ${codeText}
|
|
|
45147
45146
|
}
|
|
45148
45147
|
return this.editor.undoManager.runInGroup(() => handleTab$2(this.editor));
|
|
45149
45148
|
}
|
|
45150
|
-
getPreListBlock(editor) {
|
|
45151
|
-
const startBlock = editor.selection.startBlock;
|
|
45152
|
-
if (isListBlock(startBlock)) {
|
|
45153
|
-
return startBlock;
|
|
45154
|
-
}
|
|
45155
|
-
const preBlock = getPrevBlock(startBlock);
|
|
45156
|
-
if (preBlock && isListBlock(preBlock)) {
|
|
45157
|
-
return preBlock;
|
|
45158
|
-
}
|
|
45159
|
-
return null;
|
|
45160
|
-
}
|
|
45161
|
-
async handleBeforePasteDoc(editor, doc2) {
|
|
45162
|
-
const preBlock = this.getPreListBlock(editor);
|
|
45163
|
-
const preBlockData = preBlock ? editor.getBlockData(preBlock) : null;
|
|
45164
|
-
if (preBlock) {
|
|
45165
|
-
this.fixStartByList = new FixStartByWillDeletedList(editor, preBlock);
|
|
45166
|
-
}
|
|
45167
|
-
const groupIds = /* @__PURE__ */ new Map();
|
|
45168
|
-
const getGroupId = (id) => {
|
|
45169
|
-
if (groupIds.has(id)) {
|
|
45170
|
-
return groupIds.get(id);
|
|
45171
|
-
}
|
|
45172
|
-
return id;
|
|
45173
|
-
};
|
|
45174
|
-
Object.values(doc2.blocks).forEach((blocks) => {
|
|
45175
|
-
blocks.forEach((block, index2) => {
|
|
45176
|
-
var _a;
|
|
45177
|
-
if (block.type === "list") {
|
|
45178
|
-
const preDocBlock = (_a = blocks[index2 - 1]) != null ? _a : preBlockData;
|
|
45179
|
-
let needReset = !preDocBlock || preDocBlock.type !== "list" || preDocBlock.level !== block.level;
|
|
45180
|
-
if (needReset && index2 !== 0) {
|
|
45181
|
-
needReset = getGroupId(preDocBlock.groupId) !== block.groupId;
|
|
45182
|
-
}
|
|
45183
|
-
if (needReset) {
|
|
45184
|
-
block.start = 1;
|
|
45185
|
-
const newGroupId = genId();
|
|
45186
|
-
groupIds.set(newGroupId, block.groupId);
|
|
45187
|
-
block.groupId = newGroupId;
|
|
45188
|
-
} else {
|
|
45189
|
-
if (index2 === 0 && isListBlock(editor.selection.startBlock)) {
|
|
45190
|
-
block.start = preDocBlock.start;
|
|
45191
|
-
} else {
|
|
45192
|
-
block.start = preDocBlock.start + 1;
|
|
45193
|
-
}
|
|
45194
|
-
block.groupId = preDocBlock.groupId;
|
|
45195
|
-
}
|
|
45196
|
-
}
|
|
45197
|
-
});
|
|
45198
|
-
});
|
|
45199
|
-
return false;
|
|
45200
|
-
}
|
|
45201
|
-
async handleAfterPaste(editor) {
|
|
45202
|
-
editor.undoManager.runInGroup(() => {
|
|
45203
|
-
if (this.fixStartByList) {
|
|
45204
|
-
this.fixStartByList.fix();
|
|
45205
|
-
this.fixStartByList = null;
|
|
45206
|
-
}
|
|
45207
|
-
});
|
|
45208
|
-
return false;
|
|
45209
|
-
}
|
|
45210
45149
|
}
|
|
45211
45150
|
class ListClearSelectionHandler {
|
|
45212
45151
|
constructor(editor) {
|
|
@@ -77198,7 +77137,7 @@ ${data.flowchartText}
|
|
|
77198
77137
|
}
|
|
77199
77138
|
}
|
|
77200
77139
|
});
|
|
77201
|
-
editor.version = "1.1.18-beta.
|
|
77140
|
+
editor.version = "1.1.18-beta.20";
|
|
77202
77141
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
77203
77142
|
window.setReauthFail = (fail) => {
|
|
77204
77143
|
window.isReauthError = fail;
|
|
@@ -77287,7 +77226,7 @@ ${data.flowchartText}
|
|
|
77287
77226
|
});
|
|
77288
77227
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
77289
77228
|
OnesEditorToolbar.register(editor);
|
|
77290
|
-
editor.version = "1.1.18-beta.
|
|
77229
|
+
editor.version = "1.1.18-beta.20";
|
|
77291
77230
|
return editor;
|
|
77292
77231
|
}
|
|
77293
77232
|
async function showDocVersions(editor, options, serverUrl) {
|