@ones-editor/editor 2.2.2 → 2.2.4-beta.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/@ones-editor/list-block/src/list-data/index.d.ts +2 -0
- package/@ones-editor/mathjax/src/mathjax-state/index.d.ts +2 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -0
- package/dist/index.js +100 -73
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import CommandBar from './command-bar';
|
|
|
3
3
|
import { CommandBarOptions, CommandItemElement, ManualShowCommandBarOptions } from './types';
|
|
4
4
|
export default class FixedToolbar extends CommandBar {
|
|
5
5
|
constructor(parent: HTMLElement, items: CommandItem[], options?: CommandBarOptions);
|
|
6
|
+
handleDocumentKeydown: (event: KeyboardEvent) => boolean;
|
|
6
7
|
protected initCommandBarElement(elem: HTMLElement): void;
|
|
7
8
|
protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
|
|
8
9
|
close(): void;
|
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,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
|
|
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"] {
|
|
@@ -2573,7 +2574,7 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
|
|
|
2573
2574
|
padding: 4px 15px;
|
|
2574
2575
|
}
|
|
2575
2576
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar-root {
|
|
2576
|
-
max-height:
|
|
2577
|
+
max-height: 100%;
|
|
2577
2578
|
}
|
|
2578
2579
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar-header {
|
|
2579
2580
|
width: 100%;
|
|
@@ -2619,7 +2620,6 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
|
|
|
2619
2620
|
width: 100%;
|
|
2620
2621
|
}
|
|
2621
2622
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] {
|
|
2622
|
-
height: 495px;
|
|
2623
2623
|
align-items: start;
|
|
2624
2624
|
}
|
|
2625
2625
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup].selected {
|
|
@@ -2682,6 +2682,7 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
|
|
|
2682
2682
|
color: var(--color-0);
|
|
2683
2683
|
}
|
|
2684
2684
|
div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] img.mathjax {
|
|
2685
|
+
flex-shrink: 0;
|
|
2685
2686
|
-webkit-touch-callout: none;
|
|
2686
2687
|
}
|
|
2687
2688
|
div.editor-root.readonly div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] img.mathjax {
|
|
@@ -23174,19 +23175,6 @@ var __publicField = (obj, key, value) => {
|
|
|
23174
23175
|
});
|
|
23175
23176
|
return ret;
|
|
23176
23177
|
}
|
|
23177
|
-
function getOffsetBetweenChildren(block, x, y) {
|
|
23178
|
-
const rects = getBlockRects(block);
|
|
23179
|
-
for (let i = 1; i < rects.length; i++) {
|
|
23180
|
-
const prev = rects[i - 1];
|
|
23181
|
-
const next2 = rects[i];
|
|
23182
|
-
if (x >= prev.rect.right && x <= next2.rect.left) {
|
|
23183
|
-
if (y >= prev.rect.top && y <= prev.rect.bottom && y >= next2.rect.top && y <= next2.rect.bottom) {
|
|
23184
|
-
return getChildOffset(block, next2.child).start;
|
|
23185
|
-
}
|
|
23186
|
-
}
|
|
23187
|
-
}
|
|
23188
|
-
return null;
|
|
23189
|
-
}
|
|
23190
23178
|
function getTextBlockRangeFromPoint(editor, block, xOrign, yOrign) {
|
|
23191
23179
|
const elem = getElementFromPoint(xOrign, yOrign);
|
|
23192
23180
|
if (!elem)
|
|
@@ -23225,11 +23213,6 @@ var __publicField = (obj, key, value) => {
|
|
|
23225
23213
|
if (!pointInRect(rect, x, y)) {
|
|
23226
23214
|
return null;
|
|
23227
23215
|
}
|
|
23228
|
-
const offset2 = getOffsetBetweenChildren(block, x, y);
|
|
23229
|
-
if (offset2 !== null) {
|
|
23230
|
-
const pos2 = createSimpleBlockPosition(block, offset2, "normal");
|
|
23231
|
-
return new EditorSimpleSelectionRange(editor, { anchor: pos2, focus: pos2 });
|
|
23232
|
-
}
|
|
23233
23216
|
const pos = geLineHomeEndPositionFromPoint(block, x, y);
|
|
23234
23217
|
if (pos) {
|
|
23235
23218
|
return new EditorSimpleSelectionRange(editor, { anchor: pos, focus: pos });
|
|
@@ -26388,6 +26371,10 @@ var __publicField = (obj, key, value) => {
|
|
|
26388
26371
|
const firstBlock = getFirstChildBlock(nextContainer);
|
|
26389
26372
|
return firstBlock;
|
|
26390
26373
|
}
|
|
26374
|
+
const targetBlock = isFindPrev(type) ? getPrevBlock(parentComplexBlock) : getNextBlock(parentComplexBlock);
|
|
26375
|
+
if (targetBlock) {
|
|
26376
|
+
return targetBlock;
|
|
26377
|
+
}
|
|
26391
26378
|
return findNextBlockInComplexBlock(editor, parentComplexBlock, type);
|
|
26392
26379
|
}
|
|
26393
26380
|
function findNextOrPrevOfParentBlock(editor, block, type) {
|
|
@@ -30569,6 +30556,11 @@ ${codeText}
|
|
|
30569
30556
|
if (!value) {
|
|
30570
30557
|
delete attributes[key];
|
|
30571
30558
|
} else {
|
|
30559
|
+
const scriptKeys = ["style-sub", "style-super"];
|
|
30560
|
+
if (scriptKeys.includes(key)) {
|
|
30561
|
+
const [another] = scriptKeys.filter((keys) => keys !== key);
|
|
30562
|
+
delete attributes[another];
|
|
30563
|
+
}
|
|
30572
30564
|
attributes[key] = value;
|
|
30573
30565
|
}
|
|
30574
30566
|
});
|
|
@@ -38878,7 +38870,7 @@ ${codeText}
|
|
|
38878
38870
|
const TreeIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.80894 1.37566L9.19382 1.05649V1.05649L8.80894 1.37566ZM7.26945 1.37566L6.88457 1.05649V1.05649L7.26945 1.37566ZM12.7147 6.08541L13.0996 5.76623V5.76623L12.7147 6.08541ZM11.4874 7.72375V7.22375H10.1891L11.152 8.09459L11.4874 7.72375ZM14.159 10.1399L14.4944 9.76908L14.159 10.1399ZM10.0508 11.8816V11.3816H9.55085V11.8816H10.0508ZM10.0508 15V15.5H10.5508V15H10.0508ZM6.02806 15H5.52806V15.5H6.02806V15ZM6.02806 11.8816H6.52806V11.3816H6.02806V11.8816ZM1.91945 10.1399L2.25483 10.5108H2.25483L1.91945 10.1399ZM4.59108 7.72375L4.92646 8.09459L5.88936 7.22375H4.59108V7.72375ZM3.36368 6.0854L3.74855 6.40458L3.36368 6.0854ZM9.19382 1.05649C8.59399 0.333182 7.48441 0.333182 6.88457 1.05649L7.65432 1.69483C7.85427 1.45373 8.22413 1.45373 8.42407 1.69483L9.19382 1.05649ZM13.0996 5.76623L9.19382 1.05649L8.42407 1.69483L12.3298 6.40458L13.0996 5.76623ZM11.945 8.22375C13.215 8.22375 13.9103 6.74387 13.0996 5.76623L12.3298 6.40458C12.6001 6.73046 12.3683 7.22375 11.945 7.22375V8.22375ZM11.4874 8.22375H11.945V7.22375H11.4874V8.22375ZM14.4944 9.76908L11.8227 7.35292L11.152 8.09459L13.8236 10.5108L14.4944 9.76908ZM13.4882 12.3816C14.8612 12.3816 15.5126 10.69 14.4944 9.76908L13.8236 10.5108C14.163 10.8177 13.9459 11.3816 13.4882 11.3816V12.3816ZM10.0508 12.3816H13.4882V11.3816H10.0508V12.3816ZM9.55085 11.8816V15H10.5508V11.8816H9.55085ZM10.0508 14.5H6.02806V15.5H10.0508V14.5ZM6.52806 15V11.8816H5.52806V15H6.52806ZM2.59021 12.3816H6.02806V11.3816H2.59021V12.3816ZM1.58407 9.76909C0.565789 10.69 1.21726 12.3816 2.59021 12.3816V11.3816C2.13256 11.3816 1.9154 10.8177 2.25483 10.5108L1.58407 9.76909ZM4.2557 7.35292L1.58407 9.76909L2.25483 10.5108L4.92646 8.09459L4.2557 7.35292ZM4.13343 8.22375H4.59108V7.22375H4.13343V8.22375ZM2.97881 5.76623C2.16805 6.74387 2.86334 8.22375 4.13343 8.22375V7.22375C3.71007 7.22375 3.4783 6.73046 3.74855 6.40458L2.97881 5.76623ZM6.88457 1.05649L2.97881 5.76623L3.74855 6.40458L7.65432 1.69483L6.88457 1.05649Z" fill="currentColor"/>\n</svg>\n';
|
|
38879
38871
|
const TimeIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 8C1.5 4.41023 4.41023 1.5 8 1.5C11.5898 1.5 14.5 4.41023 14.5 8C14.5 11.5898 11.5898 14.5 8 14.5C4.41023 14.5 1.5 11.5898 1.5 8ZM8 0.5C3.85794 0.5 0.5 3.85794 0.5 8C0.5 12.1421 3.85794 15.5 8 15.5C12.1421 15.5 15.5 12.1421 15.5 8C15.5 3.85794 12.1421 0.5 8 0.5ZM7.5 3V8V8.5H8H12V7.5H8.5V3H7.5Z" fill="currentColor"/>\n</svg>\n';
|
|
38880
38872
|
const SearchIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10.8597 11.4183L14.0962 14.8891M12.5 7.5C12.5 10.5376 10.0376 13 7 13C3.96243 13 1.5 10.5376 1.5 7.5C1.5 4.46243 3.96243 2 7 2C10.0376 2 12.5 4.46243 12.5 7.5Z" stroke="#87888A" stroke-width="2"/>\n</svg>\n';
|
|
38881
|
-
const TextGroupIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.49984 9.5L7.00009 9.5" stroke="
|
|
38873
|
+
const TextGroupIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.49984 9.5L7.00009 9.5" stroke="currentColor"/>\n<path d="M15.0001 13.5V6.5" stroke="currentColor" stroke-linejoin="round"/>\n<path d="M15.0001 10C15.0001 11.3807 13.8808 12.5 12.5001 12.5C11.1194 12.5 10.0001 11.3807 10.0001 10C10.0001 8.61929 11.1194 7.5 12.5001 7.5C13.8808 7.5 15.0001 8.61929 15.0001 10Z" stroke="currentColor"/>\n<path d="M1.00009 13.5L4.99984 2.5L8.50009 13.5" stroke="currentColor" stroke-linejoin="round"/>\n</svg>\n';
|
|
38882
38874
|
const TabIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14 2L2 2" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M14 6H7" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M2 10.5V5.5L5.5 8L2 10.5Z" fill="#2D2D2E"/>\n<path d="M14 10H7" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M14 14H2" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
|
|
38883
38875
|
const ShiftTabIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2 2H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M7 6H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M5.5 10.5V5.5L2 8L5.5 10.5Z" fill="#2D2D2E"/>\n<path d="M7 10H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M2 14H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
|
|
38884
38876
|
const TableEditIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8 14.5H2.5C1.94772 14.5 1.5 14.0523 1.5 13.5V2.5C1.5 1.94772 1.94772 1.5 2.5 1.5H13.5C14.0523 1.5 14.5 1.94772 14.5 2.5V8" stroke="#2D2D2E"/>\n<path d="M1.6 4.8H14.4" stroke="#2D2D2E"/>\n<path d="M1.6 9.6H8.00078" stroke="#2D2D2E"/>\n<path d="M5.6 1.6L5.6 14.4" stroke="#2D2D2E"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5043 8.98727L11.6789 8.22924C11.7097 8.09564 11.8387 8 11.9881 8H12.8119C12.9613 8 13.0903 8.09564 13.1211 8.22924L13.2957 8.98727C13.3177 9.08256 13.3912 9.16027 13.488 9.20102C13.569 9.23514 13.648 9.2726 13.7248 9.31318C13.8018 9.35372 13.877 9.3976 13.95 9.44477C14.037 9.50098 14.1474 9.52034 14.2487 9.49008L15.0543 9.24927C15.1963 9.20683 15.3514 9.26108 15.4261 9.37933L15.9576 10.2206C16.0323 10.3389 16.0062 10.4888 15.895 10.5799L15.2639 11.0972C15.1846 11.1622 15.1477 11.2593 15.1575 11.3562C15.1657 11.4375 15.1698 11.5189 15.1697 11.6C15.1698 11.6811 15.1658 11.7625 15.1576 11.8438C15.1478 11.9407 15.1847 12.0378 15.264 12.1028L15.895 12.62C16.0062 12.7112 16.0324 12.8611 15.9577 12.9793L15.4262 13.8206C15.3515 13.9389 15.1963 13.9931 15.0544 13.9507L14.2487 13.7099C14.1474 13.6796 14.037 13.699 13.95 13.7552C13.877 13.8024 13.8018 13.8463 13.7248 13.8868C13.648 13.9274 13.569 13.9649 13.488 13.999C13.3912 14.0397 13.3177 14.1174 13.2957 14.2127L13.1211 14.9708C13.0903 15.1044 12.9613 15.2 12.8119 15.2H11.9881C11.8387 15.2 11.7097 15.1044 11.6789 14.9708L11.5043 14.2127C11.4823 14.1174 11.4088 14.0397 11.312 13.999C11.231 13.9649 11.152 13.9274 11.0752 13.8868C10.9982 13.8463 10.923 13.8024 10.85 13.7552C10.763 13.699 10.6526 13.6796 10.5513 13.7099L9.74565 13.9507C9.60366 13.9931 9.44854 13.9389 9.37384 13.8206L8.84234 12.9793C8.76764 12.8611 8.79378 12.7112 8.905 12.62L9.53602 12.1028C9.61534 12.0378 9.6522 11.9407 9.64243 11.8438C9.63424 11.7625 9.63023 11.6811 9.63031 11.6C9.63023 11.5189 9.63426 11.4375 9.64247 11.3562C9.65226 11.2593 9.61539 11.1622 9.53607 11.0972L8.90506 10.5799C8.79384 10.4888 8.7677 10.3389 8.8424 10.2206L9.3739 9.37933C9.4486 9.26108 9.60371 9.20683 9.74571 9.24927L10.5514 9.49008C10.6526 9.52034 10.7631 9.50098 10.8501 9.44477C10.923 9.3976 10.9982 9.35372 11.0752 9.31318C11.152 9.2726 11.231 9.23514 11.312 9.20102C11.4088 9.16027 11.4823 9.08256 11.5043 8.98727ZM12.3278 12.5136C12.8866 12.5136 13.3396 12.0996 13.3396 11.5889C13.3396 11.0783 12.8866 10.6643 12.3278 10.6643C11.769 10.6643 11.316 11.0783 11.316 11.5889C11.316 12.0996 11.769 12.5136 12.3278 12.5136Z" fill="#2D2D2E"/>\n</svg>\n';
|
|
@@ -40209,6 +40201,18 @@ ${codeText}
|
|
|
40209
40201
|
class FixedToolbar extends CommandBar {
|
|
40210
40202
|
constructor(parent, items, options) {
|
|
40211
40203
|
super(items, void 0, options);
|
|
40204
|
+
__publicField(this, "handleDocumentKeydown", (event) => {
|
|
40205
|
+
if (!this.isVisible) {
|
|
40206
|
+
return true;
|
|
40207
|
+
}
|
|
40208
|
+
if (event.isComposing) {
|
|
40209
|
+
return true;
|
|
40210
|
+
}
|
|
40211
|
+
if (this.subBar) {
|
|
40212
|
+
return this.subBar.handleDocumentKeydown(event);
|
|
40213
|
+
}
|
|
40214
|
+
return true;
|
|
40215
|
+
});
|
|
40212
40216
|
__publicField(this, "getSubBarOptions", (item) => {
|
|
40213
40217
|
var _a;
|
|
40214
40218
|
const options = {
|
|
@@ -48213,6 +48217,44 @@ ${codeText}
|
|
|
48213
48217
|
"Shift+Tab": handleShiftTab$3,
|
|
48214
48218
|
"Backspace": handleBackspace$2
|
|
48215
48219
|
};
|
|
48220
|
+
function getListType(listData) {
|
|
48221
|
+
if (listData.textOnly) {
|
|
48222
|
+
return "text-only";
|
|
48223
|
+
}
|
|
48224
|
+
if (listData.checkbox) {
|
|
48225
|
+
return listData.checkbox;
|
|
48226
|
+
}
|
|
48227
|
+
if (listData.ordered) {
|
|
48228
|
+
return "ordered";
|
|
48229
|
+
}
|
|
48230
|
+
return "unordered";
|
|
48231
|
+
}
|
|
48232
|
+
function getListMarker(listData) {
|
|
48233
|
+
var _a, _b;
|
|
48234
|
+
if (listData.checkbox) {
|
|
48235
|
+
return "";
|
|
48236
|
+
}
|
|
48237
|
+
const level = (_a = listData.level) != null ? _a : 1;
|
|
48238
|
+
if (listData.ordered) {
|
|
48239
|
+
const num = getListNumber(level, (_b = listData.start) != null ? _b : 1);
|
|
48240
|
+
return `${num}.`;
|
|
48241
|
+
}
|
|
48242
|
+
return getListBullet(level);
|
|
48243
|
+
}
|
|
48244
|
+
function pickTextBlockData(listBlockData) {
|
|
48245
|
+
const textBlockData = {
|
|
48246
|
+
id: genId(),
|
|
48247
|
+
type: "text",
|
|
48248
|
+
text: listBlockData.text
|
|
48249
|
+
};
|
|
48250
|
+
const keys = ["heading", "quoted", "align"];
|
|
48251
|
+
for (const key of keys) {
|
|
48252
|
+
if (listBlockData[key] !== void 0) {
|
|
48253
|
+
textBlockData[key] = listBlockData[key];
|
|
48254
|
+
}
|
|
48255
|
+
}
|
|
48256
|
+
return textBlockData;
|
|
48257
|
+
}
|
|
48216
48258
|
function findPreviousBrotherWithHeading(block, heading, level = 1) {
|
|
48217
48259
|
if (!heading) {
|
|
48218
48260
|
return null;
|
|
@@ -48309,7 +48351,9 @@ ${codeText}
|
|
|
48309
48351
|
const fixStart = new FixStartByBlock(editor, srcBlock, { start: 1 });
|
|
48310
48352
|
fixStart.fix();
|
|
48311
48353
|
}
|
|
48354
|
+
const pickedTextBlock = pickTextBlockData(srcData);
|
|
48312
48355
|
const blockData = {
|
|
48356
|
+
...pickedTextBlock,
|
|
48313
48357
|
id: genId(),
|
|
48314
48358
|
type: "list",
|
|
48315
48359
|
level,
|
|
@@ -48318,12 +48362,6 @@ ${codeText}
|
|
|
48318
48362
|
ordered: false,
|
|
48319
48363
|
text: text2
|
|
48320
48364
|
};
|
|
48321
|
-
if (srcData.quoted) {
|
|
48322
|
-
blockData.quoted = true;
|
|
48323
|
-
}
|
|
48324
|
-
if (srcData.heading) {
|
|
48325
|
-
blockData.heading = srcData.heading;
|
|
48326
|
-
}
|
|
48327
48365
|
if (type === "ordered") {
|
|
48328
48366
|
blockData.ordered = true;
|
|
48329
48367
|
} else if (type === "checked" || type === "unchecked") {
|
|
@@ -48337,30 +48375,6 @@ ${codeText}
|
|
|
48337
48375
|
}
|
|
48338
48376
|
};
|
|
48339
48377
|
}
|
|
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
48378
|
function isCheck(type) {
|
|
48365
48379
|
return type === "checked" || type === "unchecked";
|
|
48366
48380
|
}
|
|
@@ -48511,17 +48525,7 @@ ${codeText}
|
|
|
48511
48525
|
function convertListToTextBlock(editor, block) {
|
|
48512
48526
|
ensureIsListBlock(block);
|
|
48513
48527
|
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
|
-
}
|
|
48528
|
+
const textBlockData = pickTextBlockData(listBlockData);
|
|
48525
48529
|
const container = getParentContainer(block);
|
|
48526
48530
|
const blockIndex = getBlockIndex(block);
|
|
48527
48531
|
editor.deleteBlock(block);
|
|
@@ -49732,7 +49736,7 @@ ${codeText}
|
|
|
49732
49736
|
__publicField(this, "onShow", () => {
|
|
49733
49737
|
const scrollContainer = getScrollContainer$1(document.body);
|
|
49734
49738
|
const clientHeight = scrollContainer.clientHeight;
|
|
49735
|
-
this.linkPopup.content.style.
|
|
49739
|
+
this.linkPopup.content.style.height = `${clientHeight - 20}px`;
|
|
49736
49740
|
this.emit("show");
|
|
49737
49741
|
});
|
|
49738
49742
|
__publicField(this, "close", () => {
|
|
@@ -50912,6 +50916,7 @@ ${codeText}
|
|
|
50912
50916
|
class MathjaxStateData {
|
|
50913
50917
|
constructor() {
|
|
50914
50918
|
__publicField(this, "dataUrl", "");
|
|
50919
|
+
__publicField(this, "texWidth", null);
|
|
50915
50920
|
__publicField(this, "error", null);
|
|
50916
50921
|
}
|
|
50917
50922
|
destroy() {
|
|
@@ -50924,6 +50929,9 @@ ${codeText}
|
|
|
50924
50929
|
this.dataUrl = "";
|
|
50925
50930
|
this.error = error2;
|
|
50926
50931
|
}
|
|
50932
|
+
setTexWidth(tex, width) {
|
|
50933
|
+
this.texWidth = [tex, width];
|
|
50934
|
+
}
|
|
50927
50935
|
}
|
|
50928
50936
|
const logger$1R = getLogger("mathjax-converter");
|
|
50929
50937
|
const MATHJAX_SCRIPT_ID = "MathJax-script";
|
|
@@ -51222,6 +51230,20 @@ ${codeText}
|
|
|
51222
51230
|
}
|
|
51223
51231
|
}
|
|
51224
51232
|
});
|
|
51233
|
+
const [tex, width] = state.texWidth || [];
|
|
51234
|
+
if (tex === mathData.tex && width) {
|
|
51235
|
+
img.style.width = `${width}px`;
|
|
51236
|
+
} else {
|
|
51237
|
+
mathjax2Svg(editor, mathData.tex).then((svg) => {
|
|
51238
|
+
const { width: width2 } = analyzeMathjaxSvgWidth(svg);
|
|
51239
|
+
state.setTexWidth(mathData.tex, width2);
|
|
51240
|
+
const boxElement2 = editor.findBoxById(mathData.id);
|
|
51241
|
+
const imgElement = boxElement2 == null ? void 0 : boxElement2.querySelector("img");
|
|
51242
|
+
if (imgElement) {
|
|
51243
|
+
imgElement.style.width = `${width2}px`;
|
|
51244
|
+
}
|
|
51245
|
+
});
|
|
51246
|
+
}
|
|
51225
51247
|
editor.domEvents.addEventListener(img, "load", updateCaret);
|
|
51226
51248
|
return;
|
|
51227
51249
|
}
|
|
@@ -58638,6 +58660,9 @@ $$${mathData.mathjaxText}$$
|
|
|
58638
58660
|
__publicField(this, "handleItemClick", (bar2, item) => {
|
|
58639
58661
|
assert(logger$1H, this.commandBlock, "no command block before show block menu");
|
|
58640
58662
|
this.blockCommandProviders.executeCommand(this.editor.selection.range, item);
|
|
58663
|
+
if (!item.element) {
|
|
58664
|
+
this.close();
|
|
58665
|
+
}
|
|
58641
58666
|
});
|
|
58642
58667
|
__publicField(this, "close", () => {
|
|
58643
58668
|
this.menu.close("clickItem");
|
|
@@ -78438,6 +78463,7 @@ ${content}
|
|
|
78438
78463
|
this.scrollEventTarget = void 0;
|
|
78439
78464
|
}
|
|
78440
78465
|
}
|
|
78466
|
+
const DEFAULT_WAIT = 300;
|
|
78441
78467
|
const highlightTextAll = (text2, find) => {
|
|
78442
78468
|
if (!find) {
|
|
78443
78469
|
return text2;
|
|
@@ -78570,7 +78596,7 @@ ${content}
|
|
|
78570
78596
|
this._queryItems(find).then((items) => {
|
|
78571
78597
|
this.createMobileItems(content, items, find);
|
|
78572
78598
|
});
|
|
78573
|
-
},
|
|
78599
|
+
}, DEFAULT_WAIT));
|
|
78574
78600
|
__publicField(this, "createMobileWrap", () => {
|
|
78575
78601
|
if (this.mobileWrap) {
|
|
78576
78602
|
return this.mobileWrap;
|
|
@@ -78651,7 +78677,8 @@ ${content}
|
|
|
78651
78677
|
onShown: this.onShown,
|
|
78652
78678
|
onClickItem: this.onClickItem,
|
|
78653
78679
|
queryItems: this.queryItems,
|
|
78654
|
-
onClose: this.onClose
|
|
78680
|
+
onClose: this.onClose,
|
|
78681
|
+
wait: DEFAULT_WAIT
|
|
78655
78682
|
});
|
|
78656
78683
|
}
|
|
78657
78684
|
destroy() {
|
|
@@ -79808,14 +79835,14 @@ ${content}
|
|
|
79808
79835
|
this.providers.push(new InsertMenuProvider(editor));
|
|
79809
79836
|
}
|
|
79810
79837
|
get whiteList() {
|
|
79811
|
-
|
|
79838
|
+
let list2 = ["insert-image", "insert-table", "insert-link", "insert-hr"];
|
|
79812
79839
|
const focusBlock = this.editor.selection.focusedBlock;
|
|
79813
79840
|
if (!isRootBlock(focusBlock)) {
|
|
79814
|
-
|
|
79841
|
+
list2 = list2.filter((id) => id !== "insert-table");
|
|
79815
79842
|
}
|
|
79816
79843
|
const o = this.editor.getComponentOptions("mobile");
|
|
79817
79844
|
if (o == null ? void 0 : o.isAndroidApp) {
|
|
79818
|
-
|
|
79845
|
+
list2 = list2.filter((id) => id !== "insert-image");
|
|
79819
79846
|
}
|
|
79820
79847
|
return list2;
|
|
79821
79848
|
}
|
|
@@ -86873,7 +86900,7 @@ ${data2.flowchartText}
|
|
|
86873
86900
|
}
|
|
86874
86901
|
}
|
|
86875
86902
|
});
|
|
86876
|
-
editor.version = "2.2.
|
|
86903
|
+
editor.version = "2.2.4-beta.1";
|
|
86877
86904
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
86878
86905
|
window.setReauthFail = (fail) => {
|
|
86879
86906
|
window.isReauthError = fail;
|
|
@@ -86974,7 +87001,7 @@ ${data2.flowchartText}
|
|
|
86974
87001
|
});
|
|
86975
87002
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
86976
87003
|
OnesEditorToolbar.register(editor);
|
|
86977
|
-
editor.version = "2.2.
|
|
87004
|
+
editor.version = "2.2.4-beta.1";
|
|
86978
87005
|
return editor;
|
|
86979
87006
|
}
|
|
86980
87007
|
async function showDocVersions(editor, options, serverUrl) {
|