@ones-editor/editor 2.6.1-beta.1 → 2.6.1-beta.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
|
@@ -10588,6 +10588,10 @@ var __publicField = (obj, key, value) => {
|
|
|
10588
10588
|
];
|
|
10589
10589
|
return checkChar(str.charCodeAt(0), CJKRange);
|
|
10590
10590
|
}
|
|
10591
|
+
function isCJKPunctuation(char) {
|
|
10592
|
+
const reg = /[\u3000-\u303F\uFF00-\uFFEF\u2000-\u206F\u2E00-\u2E7F]/;
|
|
10593
|
+
return reg.test(char);
|
|
10594
|
+
}
|
|
10591
10595
|
function trimChar(s, char) {
|
|
10592
10596
|
let c = char;
|
|
10593
10597
|
assert(logger$4O, c.length === 1, "invalid char length");
|
|
@@ -25082,9 +25086,17 @@ var __publicField = (obj, key, value) => {
|
|
|
25082
25086
|
length: 1
|
|
25083
25087
|
};
|
|
25084
25088
|
}
|
|
25089
|
+
let charType = "text";
|
|
25090
|
+
if (isSpace(op.insert)) {
|
|
25091
|
+
charType = "space";
|
|
25092
|
+
} else if (isCJKPunctuation(op.insert)) {
|
|
25093
|
+
charType = "cjk_punctuation";
|
|
25094
|
+
} else if (isCJK(op.insert)) {
|
|
25095
|
+
charType = "cjk";
|
|
25096
|
+
}
|
|
25085
25097
|
return {
|
|
25086
25098
|
op,
|
|
25087
|
-
charType
|
|
25099
|
+
charType,
|
|
25088
25100
|
offset: newOffset,
|
|
25089
25101
|
length: op.insert.length
|
|
25090
25102
|
};
|
|
@@ -25110,9 +25122,17 @@ var __publicField = (obj, key, value) => {
|
|
|
25110
25122
|
length: 1
|
|
25111
25123
|
};
|
|
25112
25124
|
}
|
|
25125
|
+
let charType = "text";
|
|
25126
|
+
if (isSpace(op.insert)) {
|
|
25127
|
+
charType = "space";
|
|
25128
|
+
} else if (isCJKPunctuation(op.insert)) {
|
|
25129
|
+
charType = "cjk_punctuation";
|
|
25130
|
+
} else if (isCJK(op.insert)) {
|
|
25131
|
+
charType = "cjk";
|
|
25132
|
+
}
|
|
25113
25133
|
return {
|
|
25114
25134
|
op,
|
|
25115
|
-
charType
|
|
25135
|
+
charType,
|
|
25116
25136
|
offset,
|
|
25117
25137
|
length: op.insert.length
|
|
25118
25138
|
};
|
|
@@ -25173,6 +25193,7 @@ var __publicField = (obj, key, value) => {
|
|
|
25173
25193
|
return offset - 1;
|
|
25174
25194
|
}
|
|
25175
25195
|
let start = offset;
|
|
25196
|
+
let find = offsetInfo.charType;
|
|
25176
25197
|
if (offsetInfo.charType === "space") {
|
|
25177
25198
|
const startInfo2 = findPrevOffsetNotType(editor, block, start, "space");
|
|
25178
25199
|
if (!startInfo2) {
|
|
@@ -25185,8 +25206,9 @@ var __publicField = (obj, key, value) => {
|
|
|
25185
25206
|
return startInfo2.offset;
|
|
25186
25207
|
}
|
|
25187
25208
|
start = startInfo2.offset;
|
|
25209
|
+
find = getOffsetInfoBefore(editor, block, start).charType;
|
|
25188
25210
|
}
|
|
25189
|
-
const startInfo = findPrevOffsetNotType(editor, block, start,
|
|
25211
|
+
const startInfo = findPrevOffsetNotType(editor, block, start, find);
|
|
25190
25212
|
if (!startInfo)
|
|
25191
25213
|
return 0;
|
|
25192
25214
|
return startInfo.offset + startInfo.length;
|
|
@@ -25201,6 +25223,7 @@ var __publicField = (obj, key, value) => {
|
|
|
25201
25223
|
return offset + 1;
|
|
25202
25224
|
}
|
|
25203
25225
|
let start = offset;
|
|
25226
|
+
let find = offsetInfo.charType;
|
|
25204
25227
|
if (offsetInfo.charType === "space") {
|
|
25205
25228
|
const startInfo2 = findAfterOffsetNotType(editor, block, start, "space");
|
|
25206
25229
|
if (!startInfo2) {
|
|
@@ -25213,8 +25236,9 @@ var __publicField = (obj, key, value) => {
|
|
|
25213
25236
|
return startInfo2.offset;
|
|
25214
25237
|
}
|
|
25215
25238
|
start = startInfo2.offset;
|
|
25239
|
+
find = getOffsetInfoAfter(editor, block, start).charType;
|
|
25216
25240
|
}
|
|
25217
|
-
const startInfo = findAfterOffsetNotType(editor, block, start,
|
|
25241
|
+
const startInfo = findAfterOffsetNotType(editor, block, start, find);
|
|
25218
25242
|
if (!startInfo)
|
|
25219
25243
|
return getBlockTextLength$6(editor, block);
|
|
25220
25244
|
return startInfo.offset;
|
|
@@ -29398,8 +29422,8 @@ ${codeText}
|
|
|
29398
29422
|
"Cmd+ArrowRight": editorMoveLineEnd,
|
|
29399
29423
|
"Option+ArrowLeft": editorMoveWordLeft,
|
|
29400
29424
|
"Option+ArrowRight": editorMoveWordEnd,
|
|
29401
|
-
"
|
|
29402
|
-
"
|
|
29425
|
+
"Option+Shift+ArrowLeft": editorSelectWordLeft,
|
|
29426
|
+
"Option+Shift+ArrowRight": editorSelectWordEnd,
|
|
29403
29427
|
"Cmd+Shift+ArrowLeft": editorSelectLineHome,
|
|
29404
29428
|
"Cmd+Shift+ArrowRight": editorSelectLineEnd,
|
|
29405
29429
|
"Ctrl+A": editorMoveBlockStart,
|
|
@@ -29422,7 +29446,9 @@ ${codeText}
|
|
|
29422
29446
|
"Ctrl+Delete": editorHandleDeleteRightWord,
|
|
29423
29447
|
"Ctrl+Backspace": editorHandleDeleteLeftWord,
|
|
29424
29448
|
"Ctrl+ArrowLeft": editorMoveWordLeft,
|
|
29425
|
-
"Ctrl+ArrowRight": editorMoveWordEnd
|
|
29449
|
+
"Ctrl+ArrowRight": editorMoveWordEnd,
|
|
29450
|
+
"Ctrl+Shift+ArrowLeft": editorSelectWordLeft,
|
|
29451
|
+
"Ctrl+Shift+ArrowRight": editorSelectWordEnd
|
|
29426
29452
|
};
|
|
29427
29453
|
const isMac = clientType.isMac;
|
|
29428
29454
|
const CustomShortcuts = isMac ? MacShortcuts : WinLinuxShortcuts;
|
|
@@ -92406,7 +92432,7 @@ ${data2.plantumlText}
|
|
|
92406
92432
|
}
|
|
92407
92433
|
}
|
|
92408
92434
|
});
|
|
92409
|
-
editor.version = "2.6.1-beta.
|
|
92435
|
+
editor.version = "2.6.1-beta.2";
|
|
92410
92436
|
return editor;
|
|
92411
92437
|
}
|
|
92412
92438
|
function isDoc(doc2) {
|
|
@@ -92519,7 +92545,7 @@ ${data2.plantumlText}
|
|
|
92519
92545
|
}
|
|
92520
92546
|
});
|
|
92521
92547
|
OnesEditorToolbar.register(editor);
|
|
92522
|
-
editor.version = "2.6.1-beta.
|
|
92548
|
+
editor.version = "2.6.1-beta.2";
|
|
92523
92549
|
return editor;
|
|
92524
92550
|
}
|
|
92525
92551
|
async function showDocVersions(editor, options, serverUrl) {
|
|
@@ -138954,6 +138980,7 @@ ${data2.plantumlText}
|
|
|
138954
138980
|
exports2.isBox = isBox;
|
|
138955
138981
|
exports2.isBoxOp = isBoxOp;
|
|
138956
138982
|
exports2.isCJK = isCJK;
|
|
138983
|
+
exports2.isCJKPunctuation = isCJKPunctuation;
|
|
138957
138984
|
exports2.isChildContainer = isChildContainer;
|
|
138958
138985
|
exports2.isChildNode = isChildNode;
|
|
138959
138986
|
exports2.isClipboardEmpty = isClipboardEmpty$1;
|