@ones-editor/editor 0.0.7-beta.41 → 0.0.7-beta.42
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/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +33 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9350,6 +9350,12 @@ var __publicField = (obj, key, value) => {
|
|
|
9350
9350
|
constructor(editor, rootContainer) {
|
|
9351
9351
|
__publicField(this, "resizeObserver");
|
|
9352
9352
|
__publicField(this, "handleContextMenu", (event) => {
|
|
9353
|
+
if (clientType.isSafari) {
|
|
9354
|
+
const sel = document.getSelection();
|
|
9355
|
+
if (sel && !sel.isCollapsed) {
|
|
9356
|
+
sel.collapseToStart();
|
|
9357
|
+
}
|
|
9358
|
+
}
|
|
9353
9359
|
});
|
|
9354
9360
|
__publicField(this, "handleResize", () => {
|
|
9355
9361
|
try {
|
|
@@ -9431,7 +9437,6 @@ var __publicField = (obj, key, value) => {
|
|
|
9431
9437
|
this.editor.selectionHandler.handleMouseDown(event, { autoScroll: true });
|
|
9432
9438
|
}
|
|
9433
9439
|
if (!clientType.isMobileSafari) {
|
|
9434
|
-
event.preventDefault();
|
|
9435
9440
|
this.editor.input.focus();
|
|
9436
9441
|
}
|
|
9437
9442
|
if (event.button === 2) {
|
|
@@ -50923,10 +50928,10 @@ ${codeText}
|
|
|
50923
50928
|
const blockType = getBlockType(block);
|
|
50924
50929
|
const isListBlock2 = blockType === "list";
|
|
50925
50930
|
const isUnorderedList = isListBlock2 && ordered === false && !checkbox2;
|
|
50926
|
-
const
|
|
50931
|
+
const isOrderedList2 = isListBlock2 && ordered;
|
|
50927
50932
|
const isCheckList = isListBlock2 && !!checkbox2;
|
|
50928
50933
|
this.createItem("unordered-list", UnorderedIcon, parent, isUnorderedList);
|
|
50929
|
-
this.createItem("ordered-list", OrderedIcon, parent,
|
|
50934
|
+
this.createItem("ordered-list", OrderedIcon, parent, isOrderedList2);
|
|
50930
50935
|
this.createItem("check-list", CheckboxIcon, parent, isCheckList);
|
|
50931
50936
|
});
|
|
50932
50937
|
__publicField(this, "handleClick", (editor, event) => {
|
|
@@ -55020,6 +55025,29 @@ ${codeText}
|
|
|
55020
55025
|
}
|
|
55021
55026
|
});
|
|
55022
55027
|
}
|
|
55028
|
+
function isOrderedList(elem) {
|
|
55029
|
+
const startEl = elem.querySelector('[style="mso-list:Ignore"]');
|
|
55030
|
+
if (startEl) {
|
|
55031
|
+
const startValue = startEl.innerText;
|
|
55032
|
+
return startValue && startValue.trim() !== "-";
|
|
55033
|
+
}
|
|
55034
|
+
return true;
|
|
55035
|
+
}
|
|
55036
|
+
function getListStart(elem) {
|
|
55037
|
+
var _a;
|
|
55038
|
+
const orderedList = isOrderedList(elem);
|
|
55039
|
+
if (!orderedList) {
|
|
55040
|
+
return 1;
|
|
55041
|
+
}
|
|
55042
|
+
const startEl = elem.querySelector('[style="mso-list:Ignore"]');
|
|
55043
|
+
if (startEl) {
|
|
55044
|
+
const startValue = startEl.innerText;
|
|
55045
|
+
if (startValue) {
|
|
55046
|
+
return (_a = Number.parseInt(startValue, 10)) != null ? _a : 1;
|
|
55047
|
+
}
|
|
55048
|
+
}
|
|
55049
|
+
return 1;
|
|
55050
|
+
}
|
|
55023
55051
|
function getListData(elem) {
|
|
55024
55052
|
if (!isList(elem)) {
|
|
55025
55053
|
return {};
|
|
@@ -55027,10 +55055,10 @@ ${codeText}
|
|
|
55027
55055
|
const level = getLevel(elem);
|
|
55028
55056
|
const groupId = elem.getAttribute("data-group-id") || genId();
|
|
55029
55057
|
return {
|
|
55030
|
-
start:
|
|
55058
|
+
start: getListStart(elem),
|
|
55031
55059
|
level,
|
|
55032
55060
|
groupId,
|
|
55033
|
-
ordered:
|
|
55061
|
+
ordered: isOrderedList(elem),
|
|
55034
55062
|
type: "list"
|
|
55035
55063
|
};
|
|
55036
55064
|
}
|