@ones-editor/editor 2.2.8-beta.8 → 2.2.10-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/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +3 -2
- package/@ones-editor/core/src/core/types.d.ts +1 -1
- package/@ones-editor/core/src/utils/character.d.ts +0 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/box-helper/standard-box-commands.d.ts +1 -5
- package/@ones-editor/ui/src/index.d.ts +0 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -1
- package/dist/index.js +772 -803
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -858,10 +858,10 @@ div.tippy-box[data-theme=menu] .tippy-arrow::after {
|
|
|
858
858
|
transform: rotate(45deg);
|
|
859
859
|
}
|
|
860
860
|
div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar-root, div.tippy-box[data-theme=toolbar] .tippy-content .editor-command-bar-root {
|
|
861
|
-
box-shadow:
|
|
861
|
+
box-shadow: 0px 0px 1px rgba(48, 48, 48, 0.25), 0px 12px 24px rgba(48, 48, 48, 0.15);
|
|
862
862
|
}
|
|
863
863
|
div.tippy-box[data-theme=toolbar] .tippy-content .editor-command-bar-root {
|
|
864
|
-
|
|
864
|
+
overflow: initial;
|
|
865
865
|
}
|
|
866
866
|
div.tippy-box button {
|
|
867
867
|
outline: none;
|
|
@@ -901,7 +901,7 @@ div.tippy-box button {
|
|
|
901
901
|
}
|
|
902
902
|
.editor-command-bar.fixed.mobile .command-item.checked, .editor-command-bar.toolbar.mobile .command-item.checked {
|
|
903
903
|
border-radius: 3px;
|
|
904
|
-
background: #
|
|
904
|
+
background: #F0F6FF;
|
|
905
905
|
}
|
|
906
906
|
.editor-command-bar {
|
|
907
907
|
pointer-events: all;
|
|
@@ -1019,6 +1019,8 @@ div.tippy-box button {
|
|
|
1019
1019
|
gap: 5px;
|
|
1020
1020
|
padding: 5px 10px;
|
|
1021
1021
|
background: #ffffff;
|
|
1022
|
+
box-shadow: 0px 0px 1px rgba(48, 48, 48, 0.2), 0px 8px 16px rgba(48, 48, 48, 0.15);
|
|
1023
|
+
border-radius: 3px;
|
|
1022
1024
|
}
|
|
1023
1025
|
.editor-command-bar.toolbar .command-item {
|
|
1024
1026
|
background: transparent;
|
|
@@ -1111,7 +1113,6 @@ div.tippy-box button {
|
|
|
1111
1113
|
.editor-command-bar.footer {
|
|
1112
1114
|
width: 100%;
|
|
1113
1115
|
}
|
|
1114
|
-
.reference-hidden[data-tippy-hidden],
|
|
1115
1116
|
.reference-hidden .tippy-box[data-reference-hidden] {
|
|
1116
1117
|
opacity: 0;
|
|
1117
1118
|
pointer-events: none;
|
|
@@ -2052,6 +2053,11 @@ div.tippy-box[data-theme=editor-tooltip] > .tippy-content {
|
|
|
2052
2053
|
border-radius: 8px;
|
|
2053
2054
|
background: none;
|
|
2054
2055
|
}
|
|
2056
|
+
[data-command-bar-id=cursor-toolbar].mobile .tippy-box .tippy-content .editor-command-bar-root,
|
|
2057
|
+
[data-command-bar-id=paste-special-button].mobile .tippy-box .tippy-content .editor-command-bar-root,
|
|
2058
|
+
[data-command-bar-id=editor-toolbar].mobile .tippy-box .tippy-content .editor-command-bar-root {
|
|
2059
|
+
box-shadow: none;
|
|
2060
|
+
}
|
|
2055
2061
|
[data-command-bar-id=cursor-toolbar].mobile .tippy-content,
|
|
2056
2062
|
[data-command-bar-id=cursor-toolbar].mobile .editor-command-bar-root,
|
|
2057
2063
|
[data-command-bar-id=cursor-toolbar].mobile .editor-command-bar,
|
|
@@ -2084,61 +2090,6 @@ div.tippy-box[data-theme=editor-tooltip] > .tippy-content {
|
|
|
2084
2090
|
height: 40px;
|
|
2085
2091
|
transform: scaleX(0.5);
|
|
2086
2092
|
background-color: var(--Fills-Vibrant-Secondary, rgba(127, 127, 127, 0.4));
|
|
2087
|
-
}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer {
|
|
2088
|
-
position: absolute;
|
|
2089
|
-
background-color: transparent;
|
|
2090
|
-
border: 1px solid #0064ff;
|
|
2091
|
-
pointer-events: none;
|
|
2092
|
-
z-index: 1;
|
|
2093
|
-
display: none;
|
|
2094
|
-
}
|
|
2095
|
-
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer.active {
|
|
2096
|
-
display: block;
|
|
2097
|
-
}
|
|
2098
|
-
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper {
|
|
2099
|
-
position: absolute;
|
|
2100
|
-
width: 10px;
|
|
2101
|
-
height: 10px;
|
|
2102
|
-
background-color: #0064ff;
|
|
2103
|
-
border-radius: 50%;
|
|
2104
|
-
pointer-events: all;
|
|
2105
|
-
outline: 2px solid #fff;
|
|
2106
|
-
}
|
|
2107
|
-
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper::before {
|
|
2108
|
-
content: "";
|
|
2109
|
-
position: absolute;
|
|
2110
|
-
top: -3px;
|
|
2111
|
-
left: -3px;
|
|
2112
|
-
width: 16px;
|
|
2113
|
-
height: 16px;
|
|
2114
|
-
}
|
|
2115
|
-
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom {
|
|
2116
|
-
left: calc(50% - 5px);
|
|
2117
|
-
bottom: -5px;
|
|
2118
|
-
cursor: ns-resize;
|
|
2119
|
-
}
|
|
2120
|
-
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.top-left {
|
|
2121
|
-
left: -5px;
|
|
2122
|
-
top: -5px;
|
|
2123
|
-
cursor: nwse-resize;
|
|
2124
|
-
}
|
|
2125
|
-
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.top-right {
|
|
2126
|
-
right: -5px;
|
|
2127
|
-
top: -5px;
|
|
2128
|
-
cursor: nesw-resize;
|
|
2129
|
-
}
|
|
2130
|
-
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom-left {
|
|
2131
|
-
left: -5px;
|
|
2132
|
-
bottom: -5px;
|
|
2133
|
-
cursor: nesw-resize;
|
|
2134
|
-
}
|
|
2135
|
-
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom-right {
|
|
2136
|
-
right: -5px;
|
|
2137
|
-
bottom: -5px;
|
|
2138
|
-
cursor: nwse-resize;
|
|
2139
|
-
}
|
|
2140
|
-
div.editor-root.readonly div.editor-content div[data-type=editor-block] > [data-type=block-tools] .block-resizer {
|
|
2141
|
-
display: none;
|
|
2142
2093
|
}div[data-type=editor-block].block-exclusive:after {
|
|
2143
2094
|
content: attr(data-exclusive-tips);
|
|
2144
2095
|
position: absolute;
|
|
@@ -2944,6 +2895,61 @@ div.editor-root.readonly div.editor-content div[data-type=editor-block] div[data
|
|
|
2944
2895
|
}
|
|
2945
2896
|
div.editor-root.readonly div.editor-content div[data-type=editor-block] div[data-type=block-content] > span.status-box .box-status-common:hover {
|
|
2946
2897
|
outline: none;
|
|
2898
|
+
}div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer {
|
|
2899
|
+
position: absolute;
|
|
2900
|
+
background-color: transparent;
|
|
2901
|
+
border: 1px solid #0064ff;
|
|
2902
|
+
pointer-events: none;
|
|
2903
|
+
z-index: 1;
|
|
2904
|
+
display: none;
|
|
2905
|
+
}
|
|
2906
|
+
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer.active {
|
|
2907
|
+
display: block;
|
|
2908
|
+
}
|
|
2909
|
+
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper {
|
|
2910
|
+
position: absolute;
|
|
2911
|
+
width: 10px;
|
|
2912
|
+
height: 10px;
|
|
2913
|
+
background-color: #0064ff;
|
|
2914
|
+
border-radius: 50%;
|
|
2915
|
+
pointer-events: all;
|
|
2916
|
+
outline: 2px solid #fff;
|
|
2917
|
+
}
|
|
2918
|
+
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper::before {
|
|
2919
|
+
content: "";
|
|
2920
|
+
position: absolute;
|
|
2921
|
+
top: -3px;
|
|
2922
|
+
left: -3px;
|
|
2923
|
+
width: 16px;
|
|
2924
|
+
height: 16px;
|
|
2925
|
+
}
|
|
2926
|
+
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom {
|
|
2927
|
+
left: calc(50% - 5px);
|
|
2928
|
+
bottom: -5px;
|
|
2929
|
+
cursor: ns-resize;
|
|
2930
|
+
}
|
|
2931
|
+
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.top-left {
|
|
2932
|
+
left: -5px;
|
|
2933
|
+
top: -5px;
|
|
2934
|
+
cursor: nwse-resize;
|
|
2935
|
+
}
|
|
2936
|
+
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.top-right {
|
|
2937
|
+
right: -5px;
|
|
2938
|
+
top: -5px;
|
|
2939
|
+
cursor: nesw-resize;
|
|
2940
|
+
}
|
|
2941
|
+
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom-left {
|
|
2942
|
+
left: -5px;
|
|
2943
|
+
bottom: -5px;
|
|
2944
|
+
cursor: nesw-resize;
|
|
2945
|
+
}
|
|
2946
|
+
div.editor-root div.editor-content div[data-type=editor-block] [data-type=block-tools] .block-resizer .resize-gripper.bottom-right {
|
|
2947
|
+
right: -5px;
|
|
2948
|
+
bottom: -5px;
|
|
2949
|
+
cursor: nwse-resize;
|
|
2950
|
+
}
|
|
2951
|
+
div.editor-root.readonly div.editor-content div[data-type=editor-block] > [data-type=block-tools] .block-resizer {
|
|
2952
|
+
display: none;
|
|
2947
2953
|
}.before-content, .editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected [data-type=block-content] .images .image-container.active::before, .editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image].selected:not(.focused) [data-type=block-content] .images .image-container::before {
|
|
2948
2954
|
content: " ";
|
|
2949
2955
|
position: absolute;
|
|
@@ -10079,9 +10085,6 @@ var __publicField = (obj, key, value) => {
|
|
|
10079
10085
|
c = "\\\\";
|
|
10080
10086
|
return s.replace(new RegExp(`^[${c}]+|[${c}]+$`, "g"), "");
|
|
10081
10087
|
}
|
|
10082
|
-
function isFunction$1(functionToCheck) {
|
|
10083
|
-
return !!functionToCheck && {}.toString.call(functionToCheck) === "[object Function]";
|
|
10084
|
-
}
|
|
10085
10088
|
function isPrintableKey(key) {
|
|
10086
10089
|
if (!key)
|
|
10087
10090
|
return false;
|
|
@@ -25709,8 +25712,7 @@ var __publicField = (obj, key, value) => {
|
|
|
25709
25712
|
if (enableHorizontal) {
|
|
25710
25713
|
animateScrollTo(target, {
|
|
25711
25714
|
elementToScroll: getScrollContainer$1(target, { horizontal: true }),
|
|
25712
|
-
disableHorizontal: false
|
|
25713
|
-
speed: options.speed
|
|
25715
|
+
disableHorizontal: false
|
|
25714
25716
|
});
|
|
25715
25717
|
}
|
|
25716
25718
|
const mobileClient = editor.options.componentsOptions.mobile;
|
|
@@ -25718,8 +25720,7 @@ var __publicField = (obj, key, value) => {
|
|
|
25718
25720
|
elementToScroll: (_a = options.elementToScroll) != null ? _a : getScrollContainer$1(target),
|
|
25719
25721
|
disableHorizontal: true,
|
|
25720
25722
|
verticalOffset: options == null ? void 0 : options.verticalOffset,
|
|
25721
|
-
getClientHeight: mobileClient && clientType.isMobile ? mobileClient.getViewPortHeight : void 0
|
|
25722
|
-
speed: options.speed
|
|
25723
|
+
getClientHeight: mobileClient && clientType.isMobile ? mobileClient.getViewPortHeight : void 0
|
|
25723
25724
|
});
|
|
25724
25725
|
} else if (target.scrollIntoView) {
|
|
25725
25726
|
target.scrollIntoView({
|
|
@@ -27431,7 +27432,7 @@ var __publicField = (obj, key, value) => {
|
|
|
27431
27432
|
}
|
|
27432
27433
|
const logger$3g = getLogger("table-scroll");
|
|
27433
27434
|
class DomEventHandler {
|
|
27434
|
-
constructor(editor, dom, name, handler, data2
|
|
27435
|
+
constructor(editor, dom, name, handler, data2) {
|
|
27435
27436
|
__publicField(this, "handleEvent", (event) => {
|
|
27436
27437
|
this.handler(this.editor, event, this.data);
|
|
27437
27438
|
});
|
|
@@ -27440,7 +27441,7 @@ var __publicField = (obj, key, value) => {
|
|
|
27440
27441
|
this.name = name;
|
|
27441
27442
|
this.handler = handler;
|
|
27442
27443
|
this.data = data2;
|
|
27443
|
-
dom.addEventListener(name, this.handleEvent
|
|
27444
|
+
dom.addEventListener(name, this.handleEvent);
|
|
27444
27445
|
}
|
|
27445
27446
|
destroy() {
|
|
27446
27447
|
this.dom.removeEventListener(this.name, this.handleEvent);
|
|
@@ -27457,16 +27458,16 @@ var __publicField = (obj, key, value) => {
|
|
|
27457
27458
|
this.handlers.delete(element);
|
|
27458
27459
|
});
|
|
27459
27460
|
}
|
|
27460
|
-
addEventListener(element, eventName, eventHandler, data2
|
|
27461
|
+
addEventListener(element, eventName, eventHandler, data2) {
|
|
27461
27462
|
const existsHandlers = this.handlers.get(element);
|
|
27462
27463
|
if (existsHandlers) {
|
|
27463
27464
|
if (existsHandlers.find((handler) => handler.handler === eventHandler && handler.name === eventName)) {
|
|
27464
27465
|
logger$3g.warn(`event has already registered: ${eventName}`);
|
|
27465
27466
|
return;
|
|
27466
27467
|
}
|
|
27467
|
-
existsHandlers.push(new DomEventHandler(this.editor, element, eventName, eventHandler, data2
|
|
27468
|
+
existsHandlers.push(new DomEventHandler(this.editor, element, eventName, eventHandler, data2));
|
|
27468
27469
|
} else {
|
|
27469
|
-
const handler = new DomEventHandler(this.editor, element, eventName, eventHandler, data2
|
|
27470
|
+
const handler = new DomEventHandler(this.editor, element, eventName, eventHandler, data2);
|
|
27470
27471
|
this.handlers.set(element, [handler]);
|
|
27471
27472
|
}
|
|
27472
27473
|
}
|
|
@@ -40121,43 +40122,26 @@ ${codeText}
|
|
|
40121
40122
|
this.emit("click", this, item, target);
|
|
40122
40123
|
}
|
|
40123
40124
|
createPopperOptions() {
|
|
40124
|
-
var _a, _b
|
|
40125
|
+
var _a, _b;
|
|
40125
40126
|
const popperOptions = { modifiers: [] };
|
|
40126
40127
|
const overflowBoundary = this.options.overflowBoundary;
|
|
40127
|
-
const padding = this.options.padding;
|
|
40128
40128
|
if (overflowBoundary) {
|
|
40129
40129
|
(_a = popperOptions == null ? void 0 : popperOptions.modifiers) == null ? void 0 : _a.push({
|
|
40130
|
-
name: "
|
|
40131
|
-
|
|
40132
|
-
|
|
40133
|
-
|
|
40134
|
-
const popper = state.elements.popper;
|
|
40135
|
-
const popperRect = popper.getBoundingClientRect();
|
|
40136
|
-
const overflowBoundaryRect = overflowBoundary.getBoundingClientRect();
|
|
40137
|
-
const topCheck = popperRect.top < overflowBoundaryRect.top;
|
|
40138
|
-
const bottomCheck = popperRect.bottom > overflowBoundaryRect.bottom;
|
|
40139
|
-
const leftCheck = popperRect.left < overflowBoundaryRect.left;
|
|
40140
|
-
const rightCheck = popperRect.right > overflowBoundaryRect.right;
|
|
40141
|
-
if (topCheck || bottomCheck || leftCheck || rightCheck) {
|
|
40142
|
-
popper.setAttribute("data-tippy-hidden", "");
|
|
40143
|
-
} else {
|
|
40144
|
-
popper.removeAttribute("data-tippy-hidden");
|
|
40145
|
-
}
|
|
40130
|
+
name: "flip",
|
|
40131
|
+
options: {
|
|
40132
|
+
boundary: overflowBoundary,
|
|
40133
|
+
fallbackPlacements: ["top", "bottom"]
|
|
40146
40134
|
}
|
|
40147
40135
|
});
|
|
40148
40136
|
}
|
|
40149
|
-
if (padding) {
|
|
40137
|
+
if (this.options.padding) {
|
|
40150
40138
|
(_b = popperOptions == null ? void 0 : popperOptions.modifiers) == null ? void 0 : _b.push({
|
|
40151
40139
|
name: "preventOverflow",
|
|
40152
40140
|
options: {
|
|
40153
|
-
padding
|
|
40141
|
+
padding: this.options.padding
|
|
40154
40142
|
}
|
|
40155
40143
|
});
|
|
40156
40144
|
}
|
|
40157
|
-
(_c = popperOptions == null ? void 0 : popperOptions.modifiers) == null ? void 0 : _c.push({
|
|
40158
|
-
name: "flip",
|
|
40159
|
-
enabled: false
|
|
40160
|
-
});
|
|
40161
40145
|
return popperOptions;
|
|
40162
40146
|
}
|
|
40163
40147
|
destroy() {
|
|
@@ -47002,413 +46986,7 @@ ${codeText}
|
|
|
47002
46986
|
}
|
|
47003
46987
|
return rects[0];
|
|
47004
46988
|
}
|
|
47005
|
-
const
|
|
47006
|
-
embedProperties: {
|
|
47007
|
-
edit: "\u7F16\u8F91",
|
|
47008
|
-
addComment: "\u6DFB\u52A0\u6279\u6CE8"
|
|
47009
|
-
}
|
|
47010
|
-
};
|
|
47011
|
-
const enUS$v = {
|
|
47012
|
-
embedProperties: {
|
|
47013
|
-
edit: "Edit",
|
|
47014
|
-
addComment: "Add annotation"
|
|
47015
|
-
}
|
|
47016
|
-
};
|
|
47017
|
-
const jaJP$v = {
|
|
47018
|
-
embedProperties: {
|
|
47019
|
-
edit: "\u7DE8\u96C6",
|
|
47020
|
-
addComment: "\u6CE8\u91C8\u3092\u8FFD\u52A0"
|
|
47021
|
-
}
|
|
47022
|
-
};
|
|
47023
|
-
i18n$1.mergeLang({
|
|
47024
|
-
"zh-CN": zhCN$v,
|
|
47025
|
-
"en-US": enUS$v,
|
|
47026
|
-
"ja-JP": jaJP$v
|
|
47027
|
-
});
|
|
47028
|
-
const logger$24 = getLogger("embed-block-properties");
|
|
47029
|
-
function addCommentToBlock$1(editor, block) {
|
|
47030
|
-
var _a;
|
|
47031
|
-
for (const hook of editor.blockHooks) {
|
|
47032
|
-
const commands = (_a = hook.commands) == null ? void 0 : _a.call(hook, editor, block, null);
|
|
47033
|
-
if (!commands) {
|
|
47034
|
-
continue;
|
|
47035
|
-
}
|
|
47036
|
-
if (commands.group === "block-comment-actions") {
|
|
47037
|
-
const command = commands.commands[0];
|
|
47038
|
-
if (!command) {
|
|
47039
|
-
continue;
|
|
47040
|
-
}
|
|
47041
|
-
commands.executeCommand(editor, block, commands.commands[0], null);
|
|
47042
|
-
return true;
|
|
47043
|
-
}
|
|
47044
|
-
}
|
|
47045
|
-
return false;
|
|
47046
|
-
}
|
|
47047
|
-
class StandardEmbedBlockCommands {
|
|
47048
|
-
constructor(editor, block, properties) {
|
|
47049
|
-
__publicField(this, "group", "hovering-toolbar");
|
|
47050
|
-
__publicField(this, "_commands", [{
|
|
47051
|
-
id: "edit",
|
|
47052
|
-
name: i18n$1.t("embedProperties.edit"),
|
|
47053
|
-
icon: EditIcon
|
|
47054
|
-
}, {
|
|
47055
|
-
id: "separator",
|
|
47056
|
-
name: "",
|
|
47057
|
-
type: "separator"
|
|
47058
|
-
}]);
|
|
47059
|
-
this.editor = editor;
|
|
47060
|
-
this.block = block;
|
|
47061
|
-
this.properties = properties;
|
|
47062
|
-
}
|
|
47063
|
-
get commands() {
|
|
47064
|
-
var _a, _b, _c, _d;
|
|
47065
|
-
if (clientType.isMobile) {
|
|
47066
|
-
return [];
|
|
47067
|
-
}
|
|
47068
|
-
let standardCommands = [];
|
|
47069
|
-
if ((_a = this.properties) == null ? void 0 : _a.presetIds) {
|
|
47070
|
-
this.properties.presetIds.forEach((id) => {
|
|
47071
|
-
const command = this._commands.find((item) => item.id === id);
|
|
47072
|
-
if (command) {
|
|
47073
|
-
standardCommands.push(command);
|
|
47074
|
-
}
|
|
47075
|
-
});
|
|
47076
|
-
}
|
|
47077
|
-
if (((_b = this.properties) == null ? void 0 : _b.extCommands) && Array.isArray(this.properties.extCommands)) {
|
|
47078
|
-
standardCommands.push(...this.properties.extCommands);
|
|
47079
|
-
}
|
|
47080
|
-
if (typeof ((_c = this.properties) == null ? void 0 : _c.extCommands) === "function") {
|
|
47081
|
-
standardCommands.push(...this.properties.extCommands(this.editor, this.block));
|
|
47082
|
-
}
|
|
47083
|
-
if ((_d = this.properties) == null ? void 0 : _d.extIds) {
|
|
47084
|
-
this.properties.extIds.forEach((id) => {
|
|
47085
|
-
const command = this._commands.find((item) => item.id === id);
|
|
47086
|
-
if (command) {
|
|
47087
|
-
standardCommands.push(command);
|
|
47088
|
-
}
|
|
47089
|
-
});
|
|
47090
|
-
}
|
|
47091
|
-
const { enableComments = true } = this.editor.options;
|
|
47092
|
-
if (!enableComments || this.editor.readonly) {
|
|
47093
|
-
standardCommands = standardCommands.filter((command) => command.id !== "add-comment");
|
|
47094
|
-
}
|
|
47095
|
-
if (this.editor.readonly) {
|
|
47096
|
-
standardCommands = standardCommands.filter((command) => command.id !== "edit");
|
|
47097
|
-
}
|
|
47098
|
-
standardCommands.forEach((item) => {
|
|
47099
|
-
if (item.id === "add-comment" || item.id === "edit") {
|
|
47100
|
-
item.states = this.editor.isBlockWritable(this.block) ? [] : ["disabled"];
|
|
47101
|
-
}
|
|
47102
|
-
});
|
|
47103
|
-
return standardCommands;
|
|
47104
|
-
}
|
|
47105
|
-
executeCommand(editor, block, item) {
|
|
47106
|
-
var _a, _b;
|
|
47107
|
-
if ((_b = (_a = this.properties) == null ? void 0 : _a.handleExecuteCommand) == null ? void 0 : _b.call(_a, editor, block, item)) {
|
|
47108
|
-
return;
|
|
47109
|
-
}
|
|
47110
|
-
if (item.id === "add-comment") {
|
|
47111
|
-
if (!addCommentToBlock$1(editor, block)) {
|
|
47112
|
-
logger$24.error("failed to add comment to block");
|
|
47113
|
-
}
|
|
47114
|
-
return;
|
|
47115
|
-
}
|
|
47116
|
-
logger$24.error(`unknown command: ${JSON.stringify(item)}`);
|
|
47117
|
-
}
|
|
47118
|
-
}
|
|
47119
|
-
function getStandardEmbedBlockProperties(editor, block, properties) {
|
|
47120
|
-
return {
|
|
47121
|
-
blockCommands: {
|
|
47122
|
-
"hovering-toolbar": new StandardEmbedBlockCommands(editor, block, properties)
|
|
47123
|
-
}
|
|
47124
|
-
};
|
|
47125
|
-
}
|
|
47126
|
-
function createResizeGripper(parent, type) {
|
|
47127
|
-
const elem = createElement("div", ["resize-gripper", type], parent);
|
|
47128
|
-
elem.setAttribute("data-resize-type", type);
|
|
47129
|
-
}
|
|
47130
|
-
function getExistsResizer(block) {
|
|
47131
|
-
const tools = getBlockTools(block);
|
|
47132
|
-
return tools.querySelector(".block-resizer");
|
|
47133
|
-
}
|
|
47134
|
-
function hideResizer(block) {
|
|
47135
|
-
const exists = getExistsResizer(block);
|
|
47136
|
-
if (exists) {
|
|
47137
|
-
removeClass(exists, "active");
|
|
47138
|
-
}
|
|
47139
|
-
}
|
|
47140
|
-
function updateSize(block, element, resizer) {
|
|
47141
|
-
const blockRect = block.getBoundingClientRect();
|
|
47142
|
-
const elementRect = element.getBoundingClientRect();
|
|
47143
|
-
const top = elementRect.top - blockRect.top;
|
|
47144
|
-
const left = elementRect.left - blockRect.left;
|
|
47145
|
-
const width = elementRect.width;
|
|
47146
|
-
const height = elementRect.height;
|
|
47147
|
-
resizer.style.top = `${top}px`;
|
|
47148
|
-
resizer.style.left = `${left}px`;
|
|
47149
|
-
resizer.style.width = `${width}px`;
|
|
47150
|
-
resizer.style.height = `${height}px`;
|
|
47151
|
-
}
|
|
47152
|
-
function createResizer(block, element, options, mouseDownEvent) {
|
|
47153
|
-
const exists = getExistsResizer(block);
|
|
47154
|
-
if (exists) {
|
|
47155
|
-
addClass(exists, "active");
|
|
47156
|
-
updateSize(block, element, exists);
|
|
47157
|
-
return exists;
|
|
47158
|
-
}
|
|
47159
|
-
const tools = getBlockTools(block);
|
|
47160
|
-
const resizer = createElement("div", ["block-resizer"], tools);
|
|
47161
|
-
updateSize(block, element, resizer);
|
|
47162
|
-
options.resize.forEach((type) => {
|
|
47163
|
-
createResizeGripper(resizer, type);
|
|
47164
|
-
});
|
|
47165
|
-
resizer.addEventListener("mousedown", mouseDownEvent);
|
|
47166
|
-
addClass(resizer, "active");
|
|
47167
|
-
return resizer;
|
|
47168
|
-
}
|
|
47169
|
-
function updateResizer(block, element) {
|
|
47170
|
-
const resizer = getExistsResizer(block);
|
|
47171
|
-
if (!resizer) {
|
|
47172
|
-
return;
|
|
47173
|
-
}
|
|
47174
|
-
if (!isChildNode(block, element)) {
|
|
47175
|
-
return;
|
|
47176
|
-
}
|
|
47177
|
-
const blockRect = block.getBoundingClientRect();
|
|
47178
|
-
const elementRect = element.getBoundingClientRect();
|
|
47179
|
-
const top = elementRect.top - blockRect.top;
|
|
47180
|
-
const left = elementRect.left - blockRect.left;
|
|
47181
|
-
const width = elementRect.width;
|
|
47182
|
-
const height = elementRect.height;
|
|
47183
|
-
resizer.style.top = `${top}px`;
|
|
47184
|
-
resizer.style.left = `${left}px`;
|
|
47185
|
-
resizer.style.width = `${width}px`;
|
|
47186
|
-
resizer.style.height = `${height}px`;
|
|
47187
|
-
}
|
|
47188
|
-
const style$a = "";
|
|
47189
|
-
const logger$23 = getLogger("block-resizer");
|
|
47190
|
-
class BlockResizer extends tinyTypedEmitter.TypedEmitter {
|
|
47191
|
-
constructor(editor, options) {
|
|
47192
|
-
super();
|
|
47193
|
-
__publicField(this, "resizableElement");
|
|
47194
|
-
__publicField(this, "block", null);
|
|
47195
|
-
__publicField(this, "startRect", null);
|
|
47196
|
-
__publicField(this, "startPos", null);
|
|
47197
|
-
__publicField(this, "resizeType", null);
|
|
47198
|
-
__publicField(this, "enabled", false);
|
|
47199
|
-
__publicField(this, "handleEditorResize", () => {
|
|
47200
|
-
if (this.block) {
|
|
47201
|
-
this.updateResizer();
|
|
47202
|
-
}
|
|
47203
|
-
});
|
|
47204
|
-
__publicField(this, "handleMouseDown", (event) => {
|
|
47205
|
-
event.preventDefault();
|
|
47206
|
-
event.stopPropagation();
|
|
47207
|
-
const element = this.getResizableElement();
|
|
47208
|
-
if (!element) {
|
|
47209
|
-
return;
|
|
47210
|
-
}
|
|
47211
|
-
if (event.button !== 0) {
|
|
47212
|
-
return;
|
|
47213
|
-
}
|
|
47214
|
-
const gripper = event.target;
|
|
47215
|
-
if (!gripper) {
|
|
47216
|
-
return;
|
|
47217
|
-
}
|
|
47218
|
-
if (!(gripper instanceof HTMLElement)) {
|
|
47219
|
-
return;
|
|
47220
|
-
}
|
|
47221
|
-
const resizeType = gripper.getAttribute("data-resize-type");
|
|
47222
|
-
if (!resizeType) {
|
|
47223
|
-
return;
|
|
47224
|
-
}
|
|
47225
|
-
this.bindEvents();
|
|
47226
|
-
this.startRect = element.getBoundingClientRect();
|
|
47227
|
-
this.startPos = event;
|
|
47228
|
-
this.resizeType = resizeType;
|
|
47229
|
-
setDefaultCursor(window.getComputedStyle(gripper).cursor);
|
|
47230
|
-
if (this.block) {
|
|
47231
|
-
this.editor.selection.selectBlock(this.block, 0);
|
|
47232
|
-
}
|
|
47233
|
-
});
|
|
47234
|
-
__publicField(this, "handleMouseMove", (event) => {
|
|
47235
|
-
if (!this.startPos || !this.startRect || !this.resizeType) {
|
|
47236
|
-
return;
|
|
47237
|
-
}
|
|
47238
|
-
const element = this.getResizableElement();
|
|
47239
|
-
if (!element || !this.block) {
|
|
47240
|
-
return;
|
|
47241
|
-
}
|
|
47242
|
-
const deltaX = event.x - this.startPos.x;
|
|
47243
|
-
const deltaY = event.y - this.startPos.y;
|
|
47244
|
-
const oldRect = this.startRect;
|
|
47245
|
-
let { top, left, right, bottom } = oldRect;
|
|
47246
|
-
if (this.resizeType === "bottom" || this.resizeType === "bottom-left" || this.resizeType === "bottom-right") {
|
|
47247
|
-
bottom += deltaY;
|
|
47248
|
-
}
|
|
47249
|
-
if (this.resizeType === "top" || this.resizeType === "top-left" || this.resizeType === "top-right") {
|
|
47250
|
-
top += deltaY;
|
|
47251
|
-
}
|
|
47252
|
-
if (this.resizeType === "left" || this.resizeType === "top-left" || this.resizeType === "bottom-left") {
|
|
47253
|
-
left += deltaX;
|
|
47254
|
-
}
|
|
47255
|
-
if (this.resizeType === "right" || this.resizeType === "top-right" || this.resizeType === "bottom-right") {
|
|
47256
|
-
right += deltaX;
|
|
47257
|
-
}
|
|
47258
|
-
const width = right > left ? right - left : 0;
|
|
47259
|
-
const height = bottom > top ? bottom - top : 0;
|
|
47260
|
-
const newRect = new DOMRect(left, top, width, height);
|
|
47261
|
-
this.emit("resizing", this, newRect);
|
|
47262
|
-
const newElement = this.getResizableElement();
|
|
47263
|
-
if (newElement) {
|
|
47264
|
-
updateResizer(this.block, newElement);
|
|
47265
|
-
}
|
|
47266
|
-
});
|
|
47267
|
-
__publicField(this, "handleMouseUp", (event) => {
|
|
47268
|
-
if (event.button !== 0) {
|
|
47269
|
-
return;
|
|
47270
|
-
}
|
|
47271
|
-
setDefaultCursor("");
|
|
47272
|
-
this.unbindEvents();
|
|
47273
|
-
this.emit("resized", this);
|
|
47274
|
-
const element = this.getResizableElement();
|
|
47275
|
-
if (!element || !this.block) {
|
|
47276
|
-
return;
|
|
47277
|
-
}
|
|
47278
|
-
updateResizer(this.block, element);
|
|
47279
|
-
});
|
|
47280
|
-
this.editor = editor;
|
|
47281
|
-
this.options = options;
|
|
47282
|
-
this.editor.addListener("resize", this.handleEditorResize);
|
|
47283
|
-
}
|
|
47284
|
-
enableResize(block, resizableElement) {
|
|
47285
|
-
this.block = block;
|
|
47286
|
-
this.resizableElement = resizableElement;
|
|
47287
|
-
this.createResizer();
|
|
47288
|
-
this.enabled = true;
|
|
47289
|
-
}
|
|
47290
|
-
disableResize() {
|
|
47291
|
-
if (!this.block) {
|
|
47292
|
-
return;
|
|
47293
|
-
}
|
|
47294
|
-
hideResizer(this.block);
|
|
47295
|
-
this.enabled = false;
|
|
47296
|
-
}
|
|
47297
|
-
update(block, resizableElement) {
|
|
47298
|
-
this.block = block;
|
|
47299
|
-
this.resizableElement = resizableElement;
|
|
47300
|
-
const elem = this.getResizableElement();
|
|
47301
|
-
if (elem && this.enabled) {
|
|
47302
|
-
this.createResizer();
|
|
47303
|
-
}
|
|
47304
|
-
}
|
|
47305
|
-
updateResizer() {
|
|
47306
|
-
const newElement = this.getResizableElement();
|
|
47307
|
-
if (newElement && this.block) {
|
|
47308
|
-
updateResizer(this.block, newElement);
|
|
47309
|
-
}
|
|
47310
|
-
}
|
|
47311
|
-
getBlock() {
|
|
47312
|
-
return this.block;
|
|
47313
|
-
}
|
|
47314
|
-
destroy() {
|
|
47315
|
-
this.editor.removeListener("resize", this.handleEditorResize);
|
|
47316
|
-
}
|
|
47317
|
-
getResizableElement() {
|
|
47318
|
-
if (this.resizableElement) {
|
|
47319
|
-
return this.resizableElement;
|
|
47320
|
-
}
|
|
47321
|
-
if (!this.block) {
|
|
47322
|
-
return null;
|
|
47323
|
-
}
|
|
47324
|
-
return getBlockContent(this.block);
|
|
47325
|
-
}
|
|
47326
|
-
createResizer() {
|
|
47327
|
-
const element = this.getResizableElement();
|
|
47328
|
-
if (!element || !this.block) {
|
|
47329
|
-
return;
|
|
47330
|
-
}
|
|
47331
|
-
assert(logger$23, isChildNode(this.block, element), "not a block child element");
|
|
47332
|
-
createResizer(this.block, element, this.options, this.handleMouseDown);
|
|
47333
|
-
}
|
|
47334
|
-
bindEvents() {
|
|
47335
|
-
document.addEventListener("mousemove", this.handleMouseMove);
|
|
47336
|
-
document.addEventListener("mouseup", this.handleMouseUp);
|
|
47337
|
-
}
|
|
47338
|
-
unbindEvents() {
|
|
47339
|
-
document.removeEventListener("mousemove", this.handleMouseMove);
|
|
47340
|
-
document.removeEventListener("mouseup", this.handleMouseUp);
|
|
47341
|
-
}
|
|
47342
|
-
}
|
|
47343
|
-
class EmbedBlockResizer {
|
|
47344
|
-
constructor(editor) {
|
|
47345
|
-
__publicField(this, "resizing", false);
|
|
47346
|
-
__publicField(this, "blockResizer");
|
|
47347
|
-
__publicField(this, "handleResized", () => {
|
|
47348
|
-
this.resizing = false;
|
|
47349
|
-
});
|
|
47350
|
-
__publicField(this, "handleResizing", (resizer, rect) => {
|
|
47351
|
-
var _a, _b;
|
|
47352
|
-
this.resizing = true;
|
|
47353
|
-
const block = resizer.getBlock();
|
|
47354
|
-
if (block) {
|
|
47355
|
-
if (((_b = (_a = getBlockClass(this.editor, block)).notify) == null ? void 0 : _b.call(_a, this.editor, "resize", { block, rect })) === true) {
|
|
47356
|
-
return;
|
|
47357
|
-
}
|
|
47358
|
-
const blockType = getEmbedType(block);
|
|
47359
|
-
const { adjustableMinHeight } = getEmbedClassByType(this.editor, blockType);
|
|
47360
|
-
const height = Math.max(rect.height, adjustableMinHeight || 100);
|
|
47361
|
-
const oldData = this.editor.getBlockData(block);
|
|
47362
|
-
const oldEmbedData = oldData.embedData;
|
|
47363
|
-
const newEmbedData = {
|
|
47364
|
-
...oldEmbedData,
|
|
47365
|
-
height
|
|
47366
|
-
};
|
|
47367
|
-
this.editor.updateEmbedData(block, newEmbedData);
|
|
47368
|
-
}
|
|
47369
|
-
});
|
|
47370
|
-
__publicField(this, "handleHoveringBlockChange", (block, old) => {
|
|
47371
|
-
if (this.resizing) {
|
|
47372
|
-
return;
|
|
47373
|
-
}
|
|
47374
|
-
if (old && isEmbedBlock(old) && hasClass(old, "resizable")) {
|
|
47375
|
-
this.disableResizer();
|
|
47376
|
-
}
|
|
47377
|
-
if (block && isEmbedBlock(block) && hasClass(block, "resizable") && this.editor.isBlockWritable(block)) {
|
|
47378
|
-
this.tryEnableResizer(block);
|
|
47379
|
-
}
|
|
47380
|
-
});
|
|
47381
|
-
__publicField(this, "handleEditorResize", () => {
|
|
47382
|
-
this.blockResizer.updateResizer();
|
|
47383
|
-
});
|
|
47384
|
-
this.editor = editor;
|
|
47385
|
-
OnesEditorHoveringBlock.get(editor).addListener("change", this.handleHoveringBlockChange);
|
|
47386
|
-
this.blockResizer = new BlockResizer(this.editor, {
|
|
47387
|
-
resize: ["bottom"]
|
|
47388
|
-
});
|
|
47389
|
-
this.blockResizer.addListener("resizing", this.handleResizing);
|
|
47390
|
-
this.blockResizer.addListener("resized", this.handleResized);
|
|
47391
|
-
this.editor.addListener("resize", this.handleEditorResize);
|
|
47392
|
-
}
|
|
47393
|
-
destroy() {
|
|
47394
|
-
this.editor.removeListener("resize", this.handleEditorResize);
|
|
47395
|
-
OnesEditorHoveringBlock.get(this.editor).removeListener("change", this.handleHoveringBlockChange);
|
|
47396
|
-
}
|
|
47397
|
-
tryEnableResizer(block) {
|
|
47398
|
-
this.blockResizer.enableResize(block);
|
|
47399
|
-
}
|
|
47400
|
-
disableResizer() {
|
|
47401
|
-
this.blockResizer.disableResize();
|
|
47402
|
-
}
|
|
47403
|
-
static get(editor) {
|
|
47404
|
-
return editor.addCustom("EmbedBlockResizer", () => new EmbedBlockResizer(editor));
|
|
47405
|
-
}
|
|
47406
|
-
static register(editor, block) {
|
|
47407
|
-
addClass(block, "resizable");
|
|
47408
|
-
return editor.addCustom("EmbedBlockResizer", () => new EmbedBlockResizer(editor));
|
|
47409
|
-
}
|
|
47410
|
-
}
|
|
47411
|
-
const logger$22 = getLogger("exclusive-block");
|
|
46989
|
+
const logger$24 = getLogger("exclusive-block");
|
|
47412
46990
|
function addExclusiveStyle(editor, block, userId, displayName) {
|
|
47413
46991
|
var _a;
|
|
47414
46992
|
addClass(block, "block-exclusive");
|
|
@@ -47426,7 +47004,7 @@ ${codeText}
|
|
|
47426
47004
|
block.removeAttribute("data-exclusive-tips");
|
|
47427
47005
|
}
|
|
47428
47006
|
function updateBlockExclusive(editor, block, exclusive, userId, displayName) {
|
|
47429
|
-
logger$
|
|
47007
|
+
logger$24.debug(`block ${getBlockId(block)} ${exclusive ? "exclusive" : "unexclusive"}, ${userId}, ${displayName}`);
|
|
47430
47008
|
if (exclusive) {
|
|
47431
47009
|
addExclusiveStyle(editor, block, userId, displayName);
|
|
47432
47010
|
} else {
|
|
@@ -47583,28 +47161,28 @@ ${codeText}
|
|
|
47583
47161
|
}
|
|
47584
47162
|
}
|
|
47585
47163
|
const exclusiveBlockStyles = "";
|
|
47586
|
-
const zhCN$
|
|
47164
|
+
const zhCN$v = {
|
|
47587
47165
|
exclusive: {
|
|
47588
47166
|
tips: "\u300C{editor}\u300D\u6B63\u5728\u7F16\u8F91\uFF0C\u300C{embedType}\u300D\u4E0D\u652F\u6301\u591A\u4EBA\u7F16\u8F91",
|
|
47589
47167
|
fallbackAbstract: "\u8BE5 Block"
|
|
47590
47168
|
}
|
|
47591
47169
|
};
|
|
47592
|
-
const enUS$
|
|
47170
|
+
const enUS$v = {
|
|
47593
47171
|
exclusive: {
|
|
47594
47172
|
tips: "\u300C{editor}\u300Dis editing\uFF0C\u300C{embedType}\u300Ddoes not support multi-person editing",
|
|
47595
47173
|
fallbackAbstract: "This Block"
|
|
47596
47174
|
}
|
|
47597
47175
|
};
|
|
47598
|
-
const jaJP$
|
|
47176
|
+
const jaJP$v = {
|
|
47599
47177
|
exclusive: {
|
|
47600
47178
|
tips: "\u300C{editor}\u300D\u306F\u7DE8\u96C6\u4E2D\u3067\u3059\u3002\u300C{embedType}\u300D\u306F\u8907\u6570\u4EBA\u3067\u540C\u6642\u7DE8\u96C6\u3067\u304D\u307E\u305B\u3093",
|
|
47601
47179
|
fallbackAbstract: "\u3053\u306E\u8981\u7D20"
|
|
47602
47180
|
}
|
|
47603
47181
|
};
|
|
47604
47182
|
i18n$1.mergeLang({
|
|
47605
|
-
"zh-CN": zhCN$
|
|
47606
|
-
"en-US": enUS$
|
|
47607
|
-
"ja-JP": jaJP$
|
|
47183
|
+
"zh-CN": zhCN$v,
|
|
47184
|
+
"en-US": enUS$v,
|
|
47185
|
+
"ja-JP": jaJP$v
|
|
47608
47186
|
});
|
|
47609
47187
|
function getBlockInfo(editor, block) {
|
|
47610
47188
|
const data2 = editor.getBlockData(block);
|
|
@@ -47780,22 +47358,22 @@ ${codeText}
|
|
|
47780
47358
|
};
|
|
47781
47359
|
}
|
|
47782
47360
|
}
|
|
47783
|
-
const style$
|
|
47784
|
-
const zhCN$
|
|
47361
|
+
const style$a = "";
|
|
47362
|
+
const zhCN$u = {
|
|
47785
47363
|
locker: {
|
|
47786
47364
|
lock: "\u9501\u5B9A",
|
|
47787
47365
|
unlock: "\u89E3\u9664\u9501\u5B9A",
|
|
47788
47366
|
lockedBy: "\u88AB {name} \u9501\u5B9A"
|
|
47789
47367
|
}
|
|
47790
47368
|
};
|
|
47791
|
-
const enUS$
|
|
47369
|
+
const enUS$u = {
|
|
47792
47370
|
locker: {
|
|
47793
47371
|
lock: "Lock",
|
|
47794
47372
|
unlock: "Unlock",
|
|
47795
47373
|
lockedBy: "Locked by {name}"
|
|
47796
47374
|
}
|
|
47797
47375
|
};
|
|
47798
|
-
const jaJP$
|
|
47376
|
+
const jaJP$u = {
|
|
47799
47377
|
locker: {
|
|
47800
47378
|
lock: "\u30ED\u30C3\u30AF",
|
|
47801
47379
|
unlock: "\u30ED\u30C3\u30AF\u89E3\u9664",
|
|
@@ -47803,9 +47381,9 @@ ${codeText}
|
|
|
47803
47381
|
}
|
|
47804
47382
|
};
|
|
47805
47383
|
i18n$1.mergeLang({
|
|
47806
|
-
"zh-CN": zhCN$
|
|
47807
|
-
"en-US": enUS$
|
|
47808
|
-
"ja-JP": jaJP$
|
|
47384
|
+
"zh-CN": zhCN$u,
|
|
47385
|
+
"en-US": enUS$u,
|
|
47386
|
+
"ja-JP": jaJP$u
|
|
47809
47387
|
});
|
|
47810
47388
|
class BlockLockerPasteHandler {
|
|
47811
47389
|
async handleBeforePasteDoc(editor, doc2) {
|
|
@@ -47817,7 +47395,7 @@ ${codeText}
|
|
|
47817
47395
|
return false;
|
|
47818
47396
|
}
|
|
47819
47397
|
}
|
|
47820
|
-
const logger$
|
|
47398
|
+
const logger$23 = getLogger("context-menu-utils");
|
|
47821
47399
|
function blobToString(blob) {
|
|
47822
47400
|
return new Promise((resolve, reject) => {
|
|
47823
47401
|
const reader = new FileReader();
|
|
@@ -47838,7 +47416,7 @@ ${codeText}
|
|
|
47838
47416
|
const types2 = items[0].types;
|
|
47839
47417
|
return !data2.trim() && types2.length === 1 && types2.includes("text/plain");
|
|
47840
47418
|
} catch (error2) {
|
|
47841
|
-
logger$
|
|
47419
|
+
logger$23.warn(`Failed to read clipboard data: ${error2}`);
|
|
47842
47420
|
return true;
|
|
47843
47421
|
}
|
|
47844
47422
|
}
|
|
@@ -47887,7 +47465,7 @@ ${codeText}
|
|
|
47887
47465
|
}
|
|
47888
47466
|
return dataTransfer;
|
|
47889
47467
|
}
|
|
47890
|
-
const logger$
|
|
47468
|
+
const logger$22 = getLogger("ClipboardProvider");
|
|
47891
47469
|
class ClipboardProvider {
|
|
47892
47470
|
constructor(editor, options) {
|
|
47893
47471
|
__publicField(this, "id", "ClipboardProvider");
|
|
@@ -47973,7 +47551,7 @@ ${codeText}
|
|
|
47973
47551
|
}
|
|
47974
47552
|
}).catch((err) => {
|
|
47975
47553
|
this.clipboardPermission.read = "denied";
|
|
47976
|
-
logger$
|
|
47554
|
+
logger$22.log(err);
|
|
47977
47555
|
});
|
|
47978
47556
|
} catch (error2) {
|
|
47979
47557
|
this.clipboardPermission = {
|
|
@@ -48034,14 +47612,13 @@ ${codeText}
|
|
|
48034
47612
|
}
|
|
48035
47613
|
}
|
|
48036
47614
|
class StandardBoxCommands {
|
|
48037
|
-
constructor(editor
|
|
47615
|
+
constructor(editor) {
|
|
48038
47616
|
__publicField(this, "group", "standard-box-commands");
|
|
48039
47617
|
__publicField(this, "providers", []);
|
|
48040
47618
|
this.editor = editor;
|
|
48041
|
-
|
|
48042
|
-
|
|
48043
|
-
|
|
48044
|
-
this.providers.push(provider);
|
|
47619
|
+
if (clientType.isMobile) {
|
|
47620
|
+
this.providers.push(new ClipboardProvider(this.editor, { withPaste: false }));
|
|
47621
|
+
}
|
|
48045
47622
|
}
|
|
48046
47623
|
get commands() {
|
|
48047
47624
|
if (this.editor.readonly) {
|
|
@@ -48052,14 +47629,6 @@ ${codeText}
|
|
|
48052
47629
|
for (const provider of this.providers) {
|
|
48053
47630
|
items.push(...provider.getAvailableCommands(this.editor, focusedBlock, this.editor.selection.range));
|
|
48054
47631
|
}
|
|
48055
|
-
for (const extId of this.extIds || []) {
|
|
48056
|
-
if (extId === "separator") {
|
|
48057
|
-
items.push({ id: "sep", name: "", type: "separator" });
|
|
48058
|
-
}
|
|
48059
|
-
if (extId === "add-comment") {
|
|
48060
|
-
items.push({ id: "add-comment", name: i18n$1.t("comment.comment"), icon: CommentIcon$1 });
|
|
48061
|
-
}
|
|
48062
|
-
}
|
|
48063
47632
|
return items;
|
|
48064
47633
|
}
|
|
48065
47634
|
executeCommand(editor, block, box, item) {
|
|
@@ -48074,20 +47643,12 @@ ${codeText}
|
|
|
48074
47643
|
return;
|
|
48075
47644
|
}
|
|
48076
47645
|
}
|
|
48077
|
-
if (item.id === "add-comment") {
|
|
48078
|
-
addCommentToBlock$1(editor, block);
|
|
48079
|
-
}
|
|
48080
47646
|
}
|
|
48081
47647
|
static create(editor) {
|
|
48082
47648
|
return new StandardBoxCommands(editor);
|
|
48083
47649
|
}
|
|
48084
|
-
static mobileCreate(editor) {
|
|
48085
|
-
const instance = new StandardBoxCommands(editor);
|
|
48086
|
-
instance.addProvider(new ClipboardProvider(editor, { withPaste: false }));
|
|
48087
|
-
return instance;
|
|
48088
|
-
}
|
|
48089
47650
|
}
|
|
48090
|
-
const logger$
|
|
47651
|
+
const logger$21 = getLogger("object-commands");
|
|
48091
47652
|
const SEP$1 = {
|
|
48092
47653
|
id: "",
|
|
48093
47654
|
name: "",
|
|
@@ -48143,7 +47704,7 @@ ${codeText}
|
|
|
48143
47704
|
let element = null;
|
|
48144
47705
|
const commands = [];
|
|
48145
47706
|
if (clientType.isMobile && child && isBox(child)) {
|
|
48146
|
-
boxCommands.push(StandardBoxCommands
|
|
47707
|
+
boxCommands.push(new StandardBoxCommands(editor));
|
|
48147
47708
|
}
|
|
48148
47709
|
if (boxCommands.length > 0) {
|
|
48149
47710
|
element = child;
|
|
@@ -48173,10 +47734,10 @@ ${codeText}
|
|
|
48173
47734
|
const result = getSpecialBlockCommands(editor, block, child, "hovering-toolbar");
|
|
48174
47735
|
const { boxCommands, blockCommands } = result;
|
|
48175
47736
|
if (clientType.isMobile && child && isBox(child)) {
|
|
48176
|
-
boxCommands.push(StandardBoxCommands
|
|
47737
|
+
boxCommands.push(new StandardBoxCommands(editor));
|
|
48177
47738
|
}
|
|
48178
47739
|
if (boxCommands.length > 0) {
|
|
48179
|
-
assert(logger$
|
|
47740
|
+
assert(logger$21, child, "child is null");
|
|
48180
47741
|
for (let i = 0; i < boxCommands.length; i++) {
|
|
48181
47742
|
if (boxCommands[i].commands.find((c) => c.id === item.id)) {
|
|
48182
47743
|
boxCommands[i].executeCommand(editor, block, child, item);
|
|
@@ -48443,18 +48004,18 @@ ${codeText}
|
|
|
48443
48004
|
}
|
|
48444
48005
|
}
|
|
48445
48006
|
const LIST_MAX_LEVEL = 8;
|
|
48446
|
-
const logger$
|
|
48447
|
-
const logger$
|
|
48007
|
+
const logger$20 = getLogger("list-block");
|
|
48008
|
+
const logger$1$ = getLogger("list-block");
|
|
48448
48009
|
function isListBlock(block) {
|
|
48449
48010
|
return getBlockType(block) === "list";
|
|
48450
48011
|
}
|
|
48451
48012
|
function ensureIsListBlock(block) {
|
|
48452
|
-
assert(logger$
|
|
48013
|
+
assert(logger$1$, isListBlock(block), "not a list block");
|
|
48453
48014
|
}
|
|
48454
48015
|
function getListBlockType(block) {
|
|
48455
48016
|
ensureIsListBlock(block);
|
|
48456
48017
|
const type = block.getAttribute("data-list-type");
|
|
48457
|
-
assert(logger$
|
|
48018
|
+
assert(logger$1$, type, "no list type");
|
|
48458
48019
|
return type;
|
|
48459
48020
|
}
|
|
48460
48021
|
function isTextOnlyListBlock(block) {
|
|
@@ -48473,7 +48034,7 @@ ${codeText}
|
|
|
48473
48034
|
function getListBlockGroupId(block) {
|
|
48474
48035
|
ensureIsListBlock(block);
|
|
48475
48036
|
const groupId = block.getAttribute("data-list-group-id");
|
|
48476
|
-
assert(logger$
|
|
48037
|
+
assert(logger$1$, groupId, "no group id");
|
|
48477
48038
|
return groupId;
|
|
48478
48039
|
}
|
|
48479
48040
|
function getListBlockProperties(block) {
|
|
@@ -48483,7 +48044,7 @@ ${codeText}
|
|
|
48483
48044
|
const start = (_c = Number.parseInt((_b = block.getAttribute("data-list-start")) != null ? _b : "1", 10)) != null ? _c : 1;
|
|
48484
48045
|
const level = (_e = Number.parseInt((_d = block.getAttribute("data-list-level")) != null ? _d : "1", 10)) != null ? _e : 1;
|
|
48485
48046
|
const groupId = block.getAttribute("data-list-group-id");
|
|
48486
|
-
assert(logger$
|
|
48047
|
+
assert(logger$1$, groupId, "no group id");
|
|
48487
48048
|
return {
|
|
48488
48049
|
type,
|
|
48489
48050
|
start,
|
|
@@ -48752,7 +48313,7 @@ ${codeText}
|
|
|
48752
48313
|
this.nodeMap.set(block, node);
|
|
48753
48314
|
if (parentBlock) {
|
|
48754
48315
|
const parentNode = this.nodeMap.get(parentBlock);
|
|
48755
|
-
assert(logger$
|
|
48316
|
+
assert(logger$20, parentNode, "no parent node");
|
|
48756
48317
|
parentNode.children.push(node);
|
|
48757
48318
|
} else {
|
|
48758
48319
|
this.rootNodes.push(node);
|
|
@@ -48820,7 +48381,7 @@ ${codeText}
|
|
|
48820
48381
|
return hasClass(block, "editor-in-mindmap-first");
|
|
48821
48382
|
}
|
|
48822
48383
|
function isViewingAsMindmap(block) {
|
|
48823
|
-
assert(logger$
|
|
48384
|
+
assert(logger$20, isListBlock(block), "not a list block");
|
|
48824
48385
|
if (hasClass(block, "editor-in-mindmap-first")) {
|
|
48825
48386
|
return true;
|
|
48826
48387
|
}
|
|
@@ -48841,12 +48402,12 @@ ${codeText}
|
|
|
48841
48402
|
const container = getParentContainer(from);
|
|
48842
48403
|
if (to) {
|
|
48843
48404
|
const container2 = getParentContainer(to);
|
|
48844
|
-
assert(logger$
|
|
48405
|
+
assert(logger$20, container === container2, "invalid block container");
|
|
48845
48406
|
}
|
|
48846
48407
|
const fromIndex = getBlockIndex(from);
|
|
48847
48408
|
if (to) {
|
|
48848
48409
|
const toIndex = getBlockIndex(to);
|
|
48849
|
-
assert(logger$
|
|
48410
|
+
assert(logger$20, fromIndex <= toIndex, "invalid block index");
|
|
48850
48411
|
}
|
|
48851
48412
|
addClass(from, ...styles);
|
|
48852
48413
|
if (!to || to === from) {
|
|
@@ -48854,7 +48415,7 @@ ${codeText}
|
|
|
48854
48415
|
}
|
|
48855
48416
|
let next2 = getNextBlock(from);
|
|
48856
48417
|
while (next2 !== to) {
|
|
48857
|
-
assert(logger$
|
|
48418
|
+
assert(logger$20, next2, "no next button");
|
|
48858
48419
|
addClass(next2, ...styles);
|
|
48859
48420
|
next2 = getNextBlock(next2);
|
|
48860
48421
|
}
|
|
@@ -48865,7 +48426,7 @@ ${codeText}
|
|
|
48865
48426
|
async function requestMindmapFullscreen(editor, block, mindmapTools) {
|
|
48866
48427
|
const tools = getBlockTools(block);
|
|
48867
48428
|
const exitFullscreenButton = tools.querySelector('[data-button-id="mindmap-fullscreen"]');
|
|
48868
|
-
assert(logger$
|
|
48429
|
+
assert(logger$20, exitFullscreenButton, "no full screen button");
|
|
48869
48430
|
const resetMindmap = () => {
|
|
48870
48431
|
setTimeout(() => {
|
|
48871
48432
|
mindmapTools.toMindmap(editor, block, {}, { reset: true, mindmapTools });
|
|
@@ -48885,7 +48446,7 @@ ${codeText}
|
|
|
48885
48446
|
try {
|
|
48886
48447
|
await exitFullscreen();
|
|
48887
48448
|
} catch (err) {
|
|
48888
|
-
logger$
|
|
48449
|
+
logger$20.error(err);
|
|
48889
48450
|
}
|
|
48890
48451
|
onExitFullscreen();
|
|
48891
48452
|
} else {
|
|
@@ -48894,7 +48455,7 @@ ${codeText}
|
|
|
48894
48455
|
await requestFullscreen(tools);
|
|
48895
48456
|
resetMindmap();
|
|
48896
48457
|
} catch (err) {
|
|
48897
|
-
logger$
|
|
48458
|
+
logger$20.error(err);
|
|
48898
48459
|
}
|
|
48899
48460
|
exitFullscreenButton.innerHTML = ExitFullScreenIcon;
|
|
48900
48461
|
exitFullscreenButton.setAttribute(`data-editor-tooltip-${editor.clientId}-dynamic`, i18n$1.t("mindmap.exitFullscreen"));
|
|
@@ -49175,7 +48736,7 @@ ${codeText}
|
|
|
49175
48736
|
if (!svg) {
|
|
49176
48737
|
return;
|
|
49177
48738
|
}
|
|
49178
|
-
assert(logger$
|
|
48739
|
+
assert(logger$20, svg, "no mindmap svg");
|
|
49179
48740
|
svg.remove();
|
|
49180
48741
|
editor.domEvents.removeAllListeners(svg);
|
|
49181
48742
|
destroyMindmapButtons(editor, block);
|
|
@@ -49227,7 +48788,7 @@ ${codeText}
|
|
|
49227
48788
|
});
|
|
49228
48789
|
__publicField(this, "handleMouseEnter", () => {
|
|
49229
48790
|
const block = getParentBlock(this.toMindmapButton);
|
|
49230
|
-
assert(logger$
|
|
48791
|
+
assert(logger$20, block && isListBlock(block), "no parent list");
|
|
49231
48792
|
highlightEntireList(this.editor, block, true);
|
|
49232
48793
|
this.currentBlock = block;
|
|
49233
48794
|
});
|
|
@@ -49239,7 +48800,7 @@ ${codeText}
|
|
|
49239
48800
|
});
|
|
49240
48801
|
__publicField(this, "handleClick", () => {
|
|
49241
48802
|
const block = getParentBlock(this.toMindmapButton);
|
|
49242
|
-
assert(logger$
|
|
48803
|
+
assert(logger$20, block && isListBlock(block), "no parent list");
|
|
49243
48804
|
toMindmap(this.editor, block, {}, { saveData: true, selectBlock: true, mindmapTools: Mindmap });
|
|
49244
48805
|
});
|
|
49245
48806
|
this.editor = editor;
|
|
@@ -49367,11 +48928,11 @@ ${codeText}
|
|
|
49367
48928
|
}
|
|
49368
48929
|
}
|
|
49369
48930
|
function handleDropOnList(editor, draggedBlock, targetListBlock, insertPos) {
|
|
49370
|
-
logger$
|
|
48931
|
+
logger$20.debug("drag a block on a list block");
|
|
49371
48932
|
if (!isTextKindBlock(editor, draggedBlock)) {
|
|
49372
48933
|
return false;
|
|
49373
48934
|
}
|
|
49374
|
-
assert(logger$
|
|
48935
|
+
assert(logger$20, isListBlock(targetListBlock), "target is not a list block");
|
|
49375
48936
|
const { type, start, level, groupId } = getListBlockProperties(targetListBlock);
|
|
49376
48937
|
const newStart = insertPos === "after" ? start + 1 : start;
|
|
49377
48938
|
const oldData = editor.getBlockData(draggedBlock);
|
|
@@ -49404,7 +48965,7 @@ ${codeText}
|
|
|
49404
48965
|
return true;
|
|
49405
48966
|
}
|
|
49406
48967
|
function handleDragList(editor, draggedBlock, targetBlock, insertPos) {
|
|
49407
|
-
logger$
|
|
48968
|
+
logger$20.debug("drag a list between text blocks");
|
|
49408
48969
|
if (insertPos === "after") {
|
|
49409
48970
|
const nextBlock = getNextBlock(targetBlock);
|
|
49410
48971
|
if (nextBlock && isListBlock(nextBlock)) {
|
|
@@ -49441,11 +49002,11 @@ ${codeText}
|
|
|
49441
49002
|
}
|
|
49442
49003
|
const { blockId } = dragData;
|
|
49443
49004
|
const draggedBlock = editor.getBlockById(blockId);
|
|
49444
|
-
assert(logger$
|
|
49005
|
+
assert(logger$20, draggedBlock, "no dragged block");
|
|
49445
49006
|
const { isSourceBlock, targetBlock } = options;
|
|
49446
49007
|
if (!isSourceBlock && targetBlock) {
|
|
49447
|
-
assert(logger$
|
|
49448
|
-
assert(logger$
|
|
49008
|
+
assert(logger$20, block === targetBlock, "block !== target block");
|
|
49009
|
+
assert(logger$20, isListBlock(targetBlock), "target is not a list block");
|
|
49449
49010
|
return handleDropOnList(editor, draggedBlock, targetBlock, insertPos);
|
|
49450
49011
|
}
|
|
49451
49012
|
return handleDragList(editor, draggedBlock, targetBlock, insertPos);
|
|
@@ -49947,7 +49508,7 @@ ${codeText}
|
|
|
49947
49508
|
}
|
|
49948
49509
|
const nextBrother = getListNextBrother(block);
|
|
49949
49510
|
while (nextBlock !== nextBrother) {
|
|
49950
|
-
assert(logger$
|
|
49511
|
+
assert(logger$20, nextBlock, "no next block");
|
|
49951
49512
|
if (isListBlock(nextBlock)) {
|
|
49952
49513
|
if (getListBlockLevel(nextBlock) > getListBlockLevel(block)) {
|
|
49953
49514
|
return nextBlock;
|
|
@@ -50046,9 +49607,9 @@ ${codeText}
|
|
|
50046
49607
|
}
|
|
50047
49608
|
return true;
|
|
50048
49609
|
}
|
|
50049
|
-
const logger$
|
|
49610
|
+
const logger$1_ = getLogger("list-block");
|
|
50050
49611
|
function cloneListData(editor, block, options) {
|
|
50051
|
-
assert(logger$
|
|
49612
|
+
assert(logger$1_, isListBlock(block), "not a list block");
|
|
50052
49613
|
const blockData = {
|
|
50053
49614
|
...editor.getBlockData(block),
|
|
50054
49615
|
id: genId()
|
|
@@ -50123,7 +49684,7 @@ ${codeText}
|
|
|
50123
49684
|
return true;
|
|
50124
49685
|
}
|
|
50125
49686
|
function findPrevBrotherAsParent(block) {
|
|
50126
|
-
assert(logger$
|
|
49687
|
+
assert(logger$20, isListBlock(block), "not a list block");
|
|
50127
49688
|
const { level } = getListBlockProperties(block);
|
|
50128
49689
|
let prevBlock = getPrevBlock(block);
|
|
50129
49690
|
while (prevBlock) {
|
|
@@ -50150,7 +49711,7 @@ ${codeText}
|
|
|
50150
49711
|
}
|
|
50151
49712
|
function findPrevBrother(editor, fromBlock, toParentBlock) {
|
|
50152
49713
|
let prevBlock = getPrevBlock(fromBlock);
|
|
50153
|
-
assert(logger$
|
|
49714
|
+
assert(logger$20, prevBlock, "no prev brother");
|
|
50154
49715
|
const parentLevel = getListBlockLevel(toParentBlock);
|
|
50155
49716
|
while (prevBlock) {
|
|
50156
49717
|
if (prevBlock === toParentBlock) {
|
|
@@ -50171,7 +49732,7 @@ ${codeText}
|
|
|
50171
49732
|
}
|
|
50172
49733
|
ensureIsListBlock(block);
|
|
50173
49734
|
const prevBrother = findPrevBrotherAsParent(block);
|
|
50174
|
-
assert(logger$
|
|
49735
|
+
assert(logger$20, prevBrother, "no list prev brother");
|
|
50175
49736
|
const newParent = prevBrother;
|
|
50176
49737
|
const newBrother = findPrevBrother(editor, block, newParent);
|
|
50177
49738
|
const level = getListBlockLevel(newParent) + 1;
|
|
@@ -50370,14 +49931,14 @@ ${codeText}
|
|
|
50370
49931
|
this.editor.removeListener("afterClearSelection", this.handleAfterClearSelection);
|
|
50371
49932
|
}
|
|
50372
49933
|
}
|
|
50373
|
-
const logger$
|
|
49934
|
+
const logger$1Z = getLogger("customize-list-start-menu");
|
|
50374
49935
|
class CustomizeListStartDialog {
|
|
50375
49936
|
constructor(editor) {
|
|
50376
49937
|
__publicField(this, "popup");
|
|
50377
49938
|
__publicField(this, "block", null);
|
|
50378
49939
|
__publicField(this, "show", (editor, block) => {
|
|
50379
49940
|
const listBlockMarker = block.querySelector("div.list-container");
|
|
50380
|
-
assert(logger$
|
|
49941
|
+
assert(logger$1Z, listBlockMarker, "list-block mark does not exist");
|
|
50381
49942
|
this.block = block;
|
|
50382
49943
|
this.popup.manualShow(listBlockMarker, {
|
|
50383
49944
|
theme: "light"
|
|
@@ -50535,7 +50096,7 @@ ${codeText}
|
|
|
50535
50096
|
const listContainer = findTarget(event, "div.list-container");
|
|
50536
50097
|
if (listContainer && this.editor.isWritable()) {
|
|
50537
50098
|
const block = getParentBlock(listContainer);
|
|
50538
|
-
assert(logger$
|
|
50099
|
+
assert(logger$20, block, "no parent block");
|
|
50539
50100
|
ensureIsListBlock(block);
|
|
50540
50101
|
const blockData = editor.getBlockData(block);
|
|
50541
50102
|
if (blockData && blockData.checkbox) {
|
|
@@ -50675,7 +50236,7 @@ ${codeText}
|
|
|
50675
50236
|
}
|
|
50676
50237
|
return blockContent;
|
|
50677
50238
|
}
|
|
50678
|
-
const zhCN$
|
|
50239
|
+
const zhCN$t = {
|
|
50679
50240
|
list: {
|
|
50680
50241
|
confirm: "\u786E\u5B9A",
|
|
50681
50242
|
setStart: "\u8BBE\u7F6E\u7F16\u53F7",
|
|
@@ -50695,7 +50256,7 @@ ${codeText}
|
|
|
50695
50256
|
exitFullscreen: "\u9000\u51FA\u5168\u5C4F"
|
|
50696
50257
|
}
|
|
50697
50258
|
};
|
|
50698
|
-
const enUS$
|
|
50259
|
+
const enUS$t = {
|
|
50699
50260
|
list: {
|
|
50700
50261
|
confirm: "Confirm",
|
|
50701
50262
|
setStart: "Set number",
|
|
@@ -50715,7 +50276,7 @@ ${codeText}
|
|
|
50715
50276
|
exitFullscreen: "Exit full screen"
|
|
50716
50277
|
}
|
|
50717
50278
|
};
|
|
50718
|
-
const jaJP$
|
|
50279
|
+
const jaJP$t = {
|
|
50719
50280
|
list: {
|
|
50720
50281
|
confirm: "OK",
|
|
50721
50282
|
setStart: "\u756A\u53F7\u3092\u8A2D\u5B9A",
|
|
@@ -50736,12 +50297,12 @@ ${codeText}
|
|
|
50736
50297
|
}
|
|
50737
50298
|
};
|
|
50738
50299
|
i18n$1.mergeLang({
|
|
50739
|
-
"zh-CN": zhCN$
|
|
50740
|
-
"en-US": enUS$
|
|
50741
|
-
"ja-JP": jaJP$
|
|
50300
|
+
"zh-CN": zhCN$t,
|
|
50301
|
+
"en-US": enUS$t,
|
|
50302
|
+
"ja-JP": jaJP$t
|
|
50742
50303
|
});
|
|
50743
|
-
const style$
|
|
50744
|
-
const logger$
|
|
50304
|
+
const style$9 = "";
|
|
50305
|
+
const logger$1Y = getLogger("list-block:paste-handler");
|
|
50745
50306
|
class ListPasteHandler {
|
|
50746
50307
|
constructor() {
|
|
50747
50308
|
__publicField(this, "fixStartByList", null);
|
|
@@ -50795,7 +50356,7 @@ ${codeText}
|
|
|
50795
50356
|
startIds.set(newGroupId, 1);
|
|
50796
50357
|
} else {
|
|
50797
50358
|
const start = startIds.get(groupId);
|
|
50798
|
-
assert(logger$
|
|
50359
|
+
assert(logger$1Y, start, "start is null");
|
|
50799
50360
|
block.start = start + 1;
|
|
50800
50361
|
block.groupId = groupId;
|
|
50801
50362
|
startIds.set(groupId, start + 1);
|
|
@@ -50815,7 +50376,7 @@ ${codeText}
|
|
|
50815
50376
|
return false;
|
|
50816
50377
|
}
|
|
50817
50378
|
}
|
|
50818
|
-
const logger$
|
|
50379
|
+
const logger$1X = getLogger("list selection to doc");
|
|
50819
50380
|
function convertListToText(data2) {
|
|
50820
50381
|
const textData = { type: "text" };
|
|
50821
50382
|
Object.entries(data2).forEach(([key, value]) => {
|
|
@@ -50830,7 +50391,7 @@ ${codeText}
|
|
|
50830
50391
|
const data2 = cloneDeep__default.default(editorGetBlockData(editor, selectedBlock.block));
|
|
50831
50392
|
const start = selectedBlock.start;
|
|
50832
50393
|
const end = selectedBlock.end;
|
|
50833
|
-
assert(logger$
|
|
50394
|
+
assert(logger$1X, data2.text, "no block text");
|
|
50834
50395
|
const len = getBlockTextLength$6(editor, selectedBlock.block);
|
|
50835
50396
|
if (end.offset - start.offset === len) {
|
|
50836
50397
|
return {
|
|
@@ -51406,7 +50967,7 @@ ${codeText}
|
|
|
51406
50967
|
toolbar2 == null ? void 0 : toolbar2.enableTextToolbar();
|
|
51407
50968
|
}, 300);
|
|
51408
50969
|
};
|
|
51409
|
-
const logger$
|
|
50970
|
+
const logger$1W = getLogger("inline-box-items");
|
|
51410
50971
|
function insertEmptyBlockLink(editor, containerId, blockIndex) {
|
|
51411
50972
|
let block = editor.findBlockByIndex(containerId, blockIndex);
|
|
51412
50973
|
let placement = "bottom-start";
|
|
@@ -51417,7 +50978,7 @@ ${codeText}
|
|
|
51417
50978
|
const onFinished = (linkText, linkUrl) => {
|
|
51418
50979
|
editor.undoManager.runInGroup(() => {
|
|
51419
50980
|
try {
|
|
51420
|
-
assert(logger$
|
|
50981
|
+
assert(logger$1W, block, "block not found");
|
|
51421
50982
|
if (!isEmptyTextBlock(editor, block)) {
|
|
51422
50983
|
block = editor.insertTextBlock([], containerId, blockIndex);
|
|
51423
50984
|
}
|
|
@@ -51428,7 +50989,7 @@ ${codeText}
|
|
|
51428
50989
|
editor.selection.selectBlock(block, getTextLength(text2));
|
|
51429
50990
|
editor.focus();
|
|
51430
50991
|
} catch (error2) {
|
|
51431
|
-
logger$
|
|
50992
|
+
logger$1W.error(error2);
|
|
51432
50993
|
}
|
|
51433
50994
|
});
|
|
51434
50995
|
};
|
|
@@ -51448,7 +51009,7 @@ ${codeText}
|
|
|
51448
51009
|
function insertLink(editor, containerId, blockIndex) {
|
|
51449
51010
|
const block = editor.getBlockByIndex(containerId, blockIndex);
|
|
51450
51011
|
const range = editor.selection.range;
|
|
51451
|
-
assert(logger$
|
|
51012
|
+
assert(logger$1W, isSimpleBlockPosition(range.start), "invalid block position");
|
|
51452
51013
|
const rects = getBlockClientRects(editor, block, range);
|
|
51453
51014
|
if (rects.length === 0) {
|
|
51454
51015
|
return;
|
|
@@ -51474,7 +51035,7 @@ ${codeText}
|
|
|
51474
51035
|
editor.selection.selectBlock(block, start + linkText.length);
|
|
51475
51036
|
editor.focus();
|
|
51476
51037
|
} catch (error2) {
|
|
51477
|
-
logger$
|
|
51038
|
+
logger$1W.error(error2);
|
|
51478
51039
|
}
|
|
51479
51040
|
});
|
|
51480
51041
|
};
|
|
@@ -51692,7 +51253,7 @@ ${codeText}
|
|
|
51692
51253
|
function getToolbar(editor) {
|
|
51693
51254
|
return editor.findCustom("toolbar-handler");
|
|
51694
51255
|
}
|
|
51695
|
-
const logger$
|
|
51256
|
+
const logger$1V = getLogger("link-popup");
|
|
51696
51257
|
function getLinkHref(child) {
|
|
51697
51258
|
var _a, _b;
|
|
51698
51259
|
return (_b = (_a = child.getAttribute("link")) != null ? _a : child.textContent) != null ? _b : "";
|
|
@@ -51730,7 +51291,7 @@ ${codeText}
|
|
|
51730
51291
|
editor.selection.selectBlock(block, range.start + linkText.length);
|
|
51731
51292
|
editor.focus();
|
|
51732
51293
|
} catch (error2) {
|
|
51733
|
-
logger$
|
|
51294
|
+
logger$1V.error(error2);
|
|
51734
51295
|
}
|
|
51735
51296
|
};
|
|
51736
51297
|
const onClose = () => {
|
|
@@ -51969,7 +51530,7 @@ ${codeText}
|
|
|
51969
51530
|
this.editProvider = new EditLinkProvider();
|
|
51970
51531
|
}
|
|
51971
51532
|
}
|
|
51972
|
-
const logger$
|
|
51533
|
+
const logger$1U = getLogger("readonly-toolbar");
|
|
51973
51534
|
const SEP = {
|
|
51974
51535
|
id: "",
|
|
51975
51536
|
name: "",
|
|
@@ -52032,7 +51593,7 @@ ${codeText}
|
|
|
52032
51593
|
});
|
|
52033
51594
|
__publicField(this, "handleSelectionChange", debounce__default.default((editor) => {
|
|
52034
51595
|
var _a;
|
|
52035
|
-
assert(logger$
|
|
51596
|
+
assert(logger$1U, editor === this.editor, "editor mismatch");
|
|
52036
51597
|
if (!editor.readonly) {
|
|
52037
51598
|
this.toolbar.close("selectionChange");
|
|
52038
51599
|
return;
|
|
@@ -52111,7 +51672,7 @@ ${codeText}
|
|
|
52111
51672
|
this.toolbar = new ManualToolbar([], void 0, {
|
|
52112
51673
|
tooltipId: editor.clientId,
|
|
52113
51674
|
id: "editor-readonly-toolbar",
|
|
52114
|
-
overflowBoundary:
|
|
51675
|
+
overflowBoundary: popover == null ? void 0 : popover.overflowBoundary,
|
|
52115
51676
|
refuseOverflow: true,
|
|
52116
51677
|
padding: 20
|
|
52117
51678
|
});
|
|
@@ -52218,7 +51779,7 @@ ${codeText}
|
|
|
52218
51779
|
return visible;
|
|
52219
51780
|
}
|
|
52220
51781
|
}
|
|
52221
|
-
const logger$
|
|
51782
|
+
const logger$1T = getLogger("toolbar-handler");
|
|
52222
51783
|
class OnesEditorToolbar {
|
|
52223
51784
|
constructor(editor) {
|
|
52224
51785
|
__publicField(this, "id", "editor-toolbar");
|
|
@@ -52305,7 +51866,7 @@ ${codeText}
|
|
|
52305
51866
|
});
|
|
52306
51867
|
__publicField(this, "handleSelectionChange", debounce__default.default((editor) => {
|
|
52307
51868
|
var _a;
|
|
52308
|
-
assert(logger$
|
|
51869
|
+
assert(logger$1T, editor === this.editor, "editor mismatch");
|
|
52309
51870
|
if (editor.selection.range.isCollapsed() || this.mouseDown) {
|
|
52310
51871
|
if (this.toolbarType === "object") {
|
|
52311
51872
|
const element = (_a = this.toolbar.tippyInstance) == null ? void 0 : _a.reference;
|
|
@@ -52345,7 +51906,7 @@ ${codeText}
|
|
|
52345
51906
|
this.toolbar = new ManualToolbar([], void 0, {
|
|
52346
51907
|
tooltipId: editor.clientId,
|
|
52347
51908
|
id: "editor-toolbar",
|
|
52348
|
-
overflowBoundary:
|
|
51909
|
+
overflowBoundary: popover == null ? void 0 : popover.overflowBoundary,
|
|
52349
51910
|
refuseOverflow: true,
|
|
52350
51911
|
padding: 20,
|
|
52351
51912
|
showName: clientType.isMobile,
|
|
@@ -52624,7 +52185,7 @@ ${codeText}
|
|
|
52624
52185
|
this.texWidth = [tex, width];
|
|
52625
52186
|
}
|
|
52626
52187
|
}
|
|
52627
|
-
const logger$
|
|
52188
|
+
const logger$1S = getLogger("mathjax-converter");
|
|
52628
52189
|
const MATHJAX_SCRIPT_ID = "MathJax-script";
|
|
52629
52190
|
const MATHJAX_BUFFER = 30;
|
|
52630
52191
|
const REDUCED_UNIT = 8;
|
|
@@ -52673,7 +52234,7 @@ ${codeText}
|
|
|
52673
52234
|
const svg = result.querySelector("svg");
|
|
52674
52235
|
return svg.outerHTML;
|
|
52675
52236
|
} catch (err) {
|
|
52676
|
-
logger$
|
|
52237
|
+
logger$1S.error(err);
|
|
52677
52238
|
throw err;
|
|
52678
52239
|
} finally {
|
|
52679
52240
|
lockers.release(lockId);
|
|
@@ -52721,7 +52282,7 @@ ${codeText}
|
|
|
52721
52282
|
...perfectState
|
|
52722
52283
|
};
|
|
52723
52284
|
}
|
|
52724
|
-
const logger$
|
|
52285
|
+
const logger$1R = getLogger("edit-mathjax");
|
|
52725
52286
|
class MathjaxEditor {
|
|
52726
52287
|
constructor() {
|
|
52727
52288
|
__publicField(this, "editMathjaxPopup", null);
|
|
@@ -52798,9 +52359,9 @@ ${codeText}
|
|
|
52798
52359
|
this.observer.observe(textarea2);
|
|
52799
52360
|
}
|
|
52800
52361
|
getTextarea() {
|
|
52801
|
-
assert(logger$
|
|
52362
|
+
assert(logger$1R, this.editMathjaxPopup, "no exists mathjax editor popup");
|
|
52802
52363
|
const textarea2 = this.editMathjaxPopup.content.querySelector("textarea");
|
|
52803
|
-
assert(logger$
|
|
52364
|
+
assert(logger$1R, textarea2, "no textarea");
|
|
52804
52365
|
return textarea2;
|
|
52805
52366
|
}
|
|
52806
52367
|
destroy() {
|
|
@@ -52870,7 +52431,7 @@ ${codeText}
|
|
|
52870
52431
|
};
|
|
52871
52432
|
editMathjax(editor, box, data2.tex, update2);
|
|
52872
52433
|
}
|
|
52873
|
-
const logger$
|
|
52434
|
+
const logger$1Q = getLogger("mathjax-box");
|
|
52874
52435
|
function updateCaret(editor, event) {
|
|
52875
52436
|
editor.selection.updateSelection(null);
|
|
52876
52437
|
const target = event.target;
|
|
@@ -52975,7 +52536,7 @@ ${codeText}
|
|
|
52975
52536
|
};
|
|
52976
52537
|
editor.updateBoxData(newData);
|
|
52977
52538
|
}).catch((err) => {
|
|
52978
|
-
logger$
|
|
52539
|
+
logger$1Q.error(`failed to convert and upload mathjax: ${JSON.stringify(err)}`);
|
|
52979
52540
|
});
|
|
52980
52541
|
return data2;
|
|
52981
52542
|
}
|
|
@@ -52994,7 +52555,7 @@ ${codeText}
|
|
|
52994
52555
|
}
|
|
52995
52556
|
function handleClickBox$3(editor, box, event) {
|
|
52996
52557
|
const parentBlock = getParentBlock(box);
|
|
52997
|
-
assert(logger$
|
|
52558
|
+
assert(logger$1Q, parentBlock, "failed to get block");
|
|
52998
52559
|
if (!editor.isBlockWritable(parentBlock)) {
|
|
52999
52560
|
return;
|
|
53000
52561
|
}
|
|
@@ -53191,28 +52752,28 @@ $$${mathData.mathjaxText}$$
|
|
|
53191
52752
|
getBlockProperties: getBlockProperties$b
|
|
53192
52753
|
};
|
|
53193
52754
|
const mathjaxStyle = "";
|
|
53194
|
-
const zhCN$
|
|
52755
|
+
const zhCN$s = {
|
|
53195
52756
|
mathjax: {
|
|
53196
52757
|
emptyText: "\u7A7A\u7684\u516C\u5F0F",
|
|
53197
52758
|
abstract: "\u516C\u5F0F"
|
|
53198
52759
|
}
|
|
53199
52760
|
};
|
|
53200
|
-
const enUS$
|
|
52761
|
+
const enUS$s = {
|
|
53201
52762
|
mathjax: {
|
|
53202
52763
|
emptyText: "Empty formula",
|
|
53203
52764
|
abstract: "Formula"
|
|
53204
52765
|
}
|
|
53205
52766
|
};
|
|
53206
|
-
const jaJP$
|
|
52767
|
+
const jaJP$s = {
|
|
53207
52768
|
mathjax: {
|
|
53208
52769
|
emptyText: "\u6570\u5F0F\u306A\u3057",
|
|
53209
52770
|
abstract: "\u6570\u5F0F"
|
|
53210
52771
|
}
|
|
53211
52772
|
};
|
|
53212
52773
|
i18n$1.mergeLang({
|
|
53213
|
-
"zh-CN": zhCN$
|
|
53214
|
-
"en-US": enUS$
|
|
53215
|
-
"ja-JP": jaJP$
|
|
52774
|
+
"zh-CN": zhCN$s,
|
|
52775
|
+
"en-US": enUS$s,
|
|
52776
|
+
"ja-JP": jaJP$s
|
|
53216
52777
|
});
|
|
53217
52778
|
function convertToMath(editor, containerId, blockIndex, offset) {
|
|
53218
52779
|
const block = editor.getBlockByIndex(containerId, blockIndex);
|
|
@@ -58746,7 +58307,7 @@ $$${mathData.mathjaxText}$$
|
|
|
58746
58307
|
const docBlockText = { insert: " ", attributes: data2 };
|
|
58747
58308
|
return docBlockText;
|
|
58748
58309
|
}
|
|
58749
|
-
const logger$
|
|
58310
|
+
const logger$1P = getLogger("StatusBoxEditor");
|
|
58750
58311
|
class StatusBoxEditor {
|
|
58751
58312
|
constructor(editor) {
|
|
58752
58313
|
__publicField(this, "linkPopup", null);
|
|
@@ -58769,10 +58330,10 @@ $$${mathData.mathjaxText}$$
|
|
|
58769
58330
|
});
|
|
58770
58331
|
__publicField(this, "handClose", () => {
|
|
58771
58332
|
var _a;
|
|
58772
|
-
assert(logger$
|
|
58333
|
+
assert(logger$1P, this.boxElement, "boxElement not found");
|
|
58773
58334
|
const boxData = this.editor.getBoxData(this.boxElement);
|
|
58774
58335
|
const block = getParentBlock(this.boxElement);
|
|
58775
|
-
assert(logger$
|
|
58336
|
+
assert(logger$1P, block, "block not found");
|
|
58776
58337
|
if (!boxData.title) {
|
|
58777
58338
|
const offset = getChildOffset(block, this.boxElement);
|
|
58778
58339
|
this.editor.deleteTextFromBlock(block, offset.start, 1);
|
|
@@ -58810,7 +58371,7 @@ $$${mathData.mathjaxText}$$
|
|
|
58810
58371
|
return;
|
|
58811
58372
|
}
|
|
58812
58373
|
const color = lodash.exports.capitalize(e2.target.getAttribute("data-color"));
|
|
58813
|
-
assert(logger$
|
|
58374
|
+
assert(logger$1P, this.boxElement, "boxElement not found");
|
|
58814
58375
|
const data2 = this.editor.getBoxData(this.boxElement);
|
|
58815
58376
|
this.statusPalette.changeColor(color);
|
|
58816
58377
|
const newData = { ...data2, color };
|
|
@@ -58827,7 +58388,7 @@ $$${mathData.mathjaxText}$$
|
|
|
58827
58388
|
});
|
|
58828
58389
|
__publicField(this, "onTitleChange", (e2) => {
|
|
58829
58390
|
const title = e2.target.value;
|
|
58830
|
-
assert(logger$
|
|
58391
|
+
assert(logger$1P, this.boxElement, "boxElement not found");
|
|
58831
58392
|
const data2 = this.editor.getBoxData(this.boxElement);
|
|
58832
58393
|
const newData = { ...data2, title: title.trim() };
|
|
58833
58394
|
this.editor.updateBoxData(newData, { noFocus: true });
|
|
@@ -58940,7 +58501,7 @@ $$${mathData.mathjaxText}$$
|
|
|
58940
58501
|
toStandardText: toStandardText$1,
|
|
58941
58502
|
matchText: matchText$1
|
|
58942
58503
|
};
|
|
58943
|
-
const logger$
|
|
58504
|
+
const logger$1O = getLogger("status-box-command");
|
|
58944
58505
|
class StatusBoxCommand {
|
|
58945
58506
|
static get commands() {
|
|
58946
58507
|
return [
|
|
@@ -58959,7 +58520,7 @@ $$${mathData.mathjaxText}$$
|
|
|
58959
58520
|
const block = editor.getBlockByIndex(containerId, blockIndex);
|
|
58960
58521
|
const boxOp = createEmptyStatusBox();
|
|
58961
58522
|
const { start } = editor.selection.range;
|
|
58962
|
-
assert(logger$
|
|
58523
|
+
assert(logger$1O, isSimpleBlockPosition(start), "invalid block position");
|
|
58963
58524
|
editor.insertBoxToBlock(block, start.offset, boxOp.attributes);
|
|
58964
58525
|
const box = editor.getBoxById((_a = boxOp.attributes) == null ? void 0 : _a.id);
|
|
58965
58526
|
editor.addCustom("status-box", (editor2) => new StatusBoxEditor(editor2)).editorStatus(box);
|
|
@@ -58978,7 +58539,7 @@ $$${mathData.mathjaxText}$$
|
|
|
58978
58539
|
}
|
|
58979
58540
|
}
|
|
58980
58541
|
__publicField(StatusBoxCommand, "id", "insert-status");
|
|
58981
|
-
const enUS$
|
|
58542
|
+
const enUS$r = {
|
|
58982
58543
|
status: {
|
|
58983
58544
|
empty: "Set status",
|
|
58984
58545
|
command: {
|
|
@@ -59002,7 +58563,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59002
58563
|
}
|
|
59003
58564
|
}
|
|
59004
58565
|
};
|
|
59005
|
-
const zhCN$
|
|
58566
|
+
const zhCN$r = {
|
|
59006
58567
|
status: {
|
|
59007
58568
|
empty: "\u8BBE\u7F6E\u72B6\u6001",
|
|
59008
58569
|
command: {
|
|
@@ -59026,7 +58587,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59026
58587
|
}
|
|
59027
58588
|
}
|
|
59028
58589
|
};
|
|
59029
|
-
const jaJP$
|
|
58590
|
+
const jaJP$r = {
|
|
59030
58591
|
status: {
|
|
59031
58592
|
empty: "\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u8A2D\u5B9A",
|
|
59032
58593
|
command: {
|
|
@@ -59051,12 +58612,12 @@ $$${mathData.mathjaxText}$$
|
|
|
59051
58612
|
}
|
|
59052
58613
|
};
|
|
59053
58614
|
const langs$2 = {
|
|
59054
|
-
"en-US": enUS$
|
|
59055
|
-
"zh-CN": zhCN$
|
|
59056
|
-
"ja-JP": jaJP$
|
|
58615
|
+
"en-US": enUS$r,
|
|
58616
|
+
"zh-CN": zhCN$r,
|
|
58617
|
+
"ja-JP": jaJP$r
|
|
59057
58618
|
};
|
|
59058
58619
|
i18n$1.mergeLang(langs$2);
|
|
59059
|
-
const logger$
|
|
58620
|
+
const logger$1N = getLogger("inline-box-items");
|
|
59060
58621
|
function insertEmptyBlockMath(editor, containerId, blockIndex) {
|
|
59061
58622
|
return editor.undoManager.runInGroup(() => {
|
|
59062
58623
|
var _a;
|
|
@@ -59067,7 +58628,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59067
58628
|
const boxOp = createEmptyMathjaxBox();
|
|
59068
58629
|
editor.setBlockText(block, [boxOp]);
|
|
59069
58630
|
const boxId = (_a = boxOp.attributes) == null ? void 0 : _a.id;
|
|
59070
|
-
assert(logger$
|
|
58631
|
+
assert(logger$1N, boxId, "mathjax box id is empty");
|
|
59071
58632
|
setTimeout(() => {
|
|
59072
58633
|
const box = editor.getBoxById(boxId);
|
|
59073
58634
|
editMathjaxBox(editor, box);
|
|
@@ -59080,11 +58641,11 @@ $$${mathData.mathjaxText}$$
|
|
|
59080
58641
|
var _a;
|
|
59081
58642
|
const block = editor.getBlockByIndex(containerId, blockIndex);
|
|
59082
58643
|
const range = editor.selection.range;
|
|
59083
|
-
assert(logger$
|
|
58644
|
+
assert(logger$1N, isSimpleBlockPosition(range.start), "invalid block position");
|
|
59084
58645
|
const boxOp = createEmptyMathjaxBox();
|
|
59085
58646
|
editor.insertBoxToBlock(block, range.start.offset, boxOp.attributes);
|
|
59086
58647
|
const boxId = (_a = boxOp.attributes) == null ? void 0 : _a.id;
|
|
59087
|
-
assert(logger$
|
|
58648
|
+
assert(logger$1N, boxId, "mathjax box id is empty");
|
|
59088
58649
|
setTimeout(() => {
|
|
59089
58650
|
const box = editor.getBoxById(boxId);
|
|
59090
58651
|
editMathjaxBox(editor, box);
|
|
@@ -59251,7 +58812,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59251
58812
|
}
|
|
59252
58813
|
}
|
|
59253
58814
|
};
|
|
59254
|
-
const logger$
|
|
58815
|
+
const logger$1M = getLogger("insert-menu");
|
|
59255
58816
|
const injectGroup = (commands, group, startIndex) => {
|
|
59256
58817
|
commands.forEach((command, index2) => {
|
|
59257
58818
|
command.group = group;
|
|
@@ -59390,7 +58951,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59390
58951
|
return true;
|
|
59391
58952
|
}
|
|
59392
58953
|
const blockId = getBlockId(block);
|
|
59393
|
-
assert(logger$
|
|
58954
|
+
assert(logger$1M, range.isSimple(), "invalid range");
|
|
59394
58955
|
const offset = range.start.offset;
|
|
59395
58956
|
if (quickItem.commandProvider) {
|
|
59396
58957
|
const params2 = { from: "quick-menu", blockId, offset };
|
|
@@ -59426,7 +58987,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59426
58987
|
});
|
|
59427
58988
|
}
|
|
59428
58989
|
}
|
|
59429
|
-
const logger$
|
|
58990
|
+
const logger$1L = getLogger("quick-command-providers");
|
|
59430
58991
|
class QuickCommandProviders extends AbstractProvider {
|
|
59431
58992
|
constructor(editor) {
|
|
59432
58993
|
super(editor);
|
|
@@ -59446,7 +59007,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59446
59007
|
}
|
|
59447
59008
|
getCommands(range) {
|
|
59448
59009
|
var _a, _b;
|
|
59449
|
-
assert(logger$
|
|
59010
|
+
assert(logger$1L, range.start.blockId === range.end.blockId, "invalid range");
|
|
59450
59011
|
const commandsMap = /* @__PURE__ */ new Map();
|
|
59451
59012
|
const block = this.editor.getBlockById(range.anchor.blockId);
|
|
59452
59013
|
const container = getParentContainer(block);
|
|
@@ -59851,7 +59412,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59851
59412
|
"CtrlOrCmd+K": (editor) => executeShortcut(editor, "link"),
|
|
59852
59413
|
...headingShortcut()
|
|
59853
59414
|
};
|
|
59854
|
-
const zhCN$
|
|
59415
|
+
const zhCN$q = {
|
|
59855
59416
|
quickMenu: {
|
|
59856
59417
|
basic: {
|
|
59857
59418
|
heading: {
|
|
@@ -59907,7 +59468,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59907
59468
|
selectBlock: "\u9009\u62E9\u533A\u5757"
|
|
59908
59469
|
}
|
|
59909
59470
|
};
|
|
59910
|
-
const enUS$
|
|
59471
|
+
const enUS$q = {
|
|
59911
59472
|
quickMenu: {
|
|
59912
59473
|
basic: {
|
|
59913
59474
|
heading: {
|
|
@@ -59963,7 +59524,7 @@ $$${mathData.mathjaxText}$$
|
|
|
59963
59524
|
selectBlock: "Select Block"
|
|
59964
59525
|
}
|
|
59965
59526
|
};
|
|
59966
|
-
const jaJP$
|
|
59527
|
+
const jaJP$q = {
|
|
59967
59528
|
quickMenu: {
|
|
59968
59529
|
basic: {
|
|
59969
59530
|
heading: {
|
|
@@ -60020,9 +59581,9 @@ $$${mathData.mathjaxText}$$
|
|
|
60020
59581
|
}
|
|
60021
59582
|
};
|
|
60022
59583
|
i18n$1.mergeLang({
|
|
60023
|
-
"zh-CN": zhCN$
|
|
60024
|
-
"en-US": enUS$
|
|
60025
|
-
"ja-JP": jaJP$
|
|
59584
|
+
"zh-CN": zhCN$q,
|
|
59585
|
+
"en-US": enUS$q,
|
|
59586
|
+
"ja-JP": jaJP$q
|
|
60026
59587
|
});
|
|
60027
59588
|
class TextStylesFixedProvider extends ProxyProvider {
|
|
60028
59589
|
constructor(editor, afterCommandCallback) {
|
|
@@ -60227,7 +59788,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60227
59788
|
return false;
|
|
60228
59789
|
}
|
|
60229
59790
|
}
|
|
60230
|
-
const logger$
|
|
59791
|
+
const logger$1K = getLogger("block-command-providers");
|
|
60231
59792
|
class BlockCommandProviders extends AbstractProvider {
|
|
60232
59793
|
constructor(editor, afterCommandCallback) {
|
|
60233
59794
|
super(editor);
|
|
@@ -60248,7 +59809,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60248
59809
|
this.registerCommandProvider(new InsertGroupProvider(editor));
|
|
60249
59810
|
}
|
|
60250
59811
|
getCommands(range) {
|
|
60251
|
-
assert(logger$
|
|
59812
|
+
assert(logger$1K, range.start.blockId === range.end.blockId, "invalid range");
|
|
60252
59813
|
const block = this.editor.getBlockById(range.anchor.blockId);
|
|
60253
59814
|
const commandsMap = /* @__PURE__ */ new Map();
|
|
60254
59815
|
let startIndex = 100;
|
|
@@ -60262,7 +59823,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60262
59823
|
return this.filterItems(range, commands);
|
|
60263
59824
|
}
|
|
60264
59825
|
}
|
|
60265
|
-
const logger$
|
|
59826
|
+
const logger$1J = getLogger("standard-block-actions");
|
|
60266
59827
|
class StandardBlockActionHook {
|
|
60267
59828
|
constructor() {
|
|
60268
59829
|
__publicField(this, "executeCommand", (editor, bloockElement, item) => {
|
|
@@ -60281,7 +59842,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60281
59842
|
this.deleteBlock(editor, block);
|
|
60282
59843
|
}
|
|
60283
59844
|
} catch (err) {
|
|
60284
|
-
logger$
|
|
59845
|
+
logger$1J.error(`failed to execute block command: ${JSON.stringify(err)}`);
|
|
60285
59846
|
}
|
|
60286
59847
|
});
|
|
60287
59848
|
}
|
|
@@ -60349,7 +59910,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60349
59910
|
}
|
|
60350
59911
|
}
|
|
60351
59912
|
}
|
|
60352
|
-
const logger$
|
|
59913
|
+
const logger$1I = getLogger("block-menu");
|
|
60353
59914
|
class BlockMenu {
|
|
60354
59915
|
constructor(editor) {
|
|
60355
59916
|
__publicField(this, "menu");
|
|
@@ -60357,7 +59918,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60357
59918
|
__publicField(this, "commandBlock", null);
|
|
60358
59919
|
__publicField(this, "blockCommandProviders");
|
|
60359
59920
|
__publicField(this, "handleShow", () => {
|
|
60360
|
-
assert(logger$
|
|
59921
|
+
assert(logger$1I, this.currentBlock, "no target block before show block menu");
|
|
60361
59922
|
const items = this.blockCommandProviders.getCommands(this.editor.selection.range);
|
|
60362
59923
|
this.menu.updateItems(items);
|
|
60363
59924
|
this.commandBlock = this.currentBlock;
|
|
@@ -60368,7 +59929,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60368
59929
|
}
|
|
60369
59930
|
});
|
|
60370
59931
|
__publicField(this, "handleItemClick", (bar2, item) => {
|
|
60371
|
-
assert(logger$
|
|
59932
|
+
assert(logger$1I, this.commandBlock, "no command block before show block menu");
|
|
60372
59933
|
this.blockCommandProviders.executeCommand(this.editor.selection.range, item);
|
|
60373
59934
|
if (!item.element) {
|
|
60374
59935
|
this.close();
|
|
@@ -60411,7 +59972,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60411
59972
|
this.menu.destroy();
|
|
60412
59973
|
}
|
|
60413
59974
|
}
|
|
60414
|
-
const logger$
|
|
59975
|
+
const logger$1H = getLogger("text-styles");
|
|
60415
59976
|
function getIntersectionStyles(text2) {
|
|
60416
59977
|
const getOpStyle = (op) => {
|
|
60417
59978
|
if (!op.attributes) {
|
|
@@ -60445,10 +60006,10 @@ $$${mathData.mathjaxText}$$
|
|
|
60445
60006
|
return new Map(Object.entries(attributes));
|
|
60446
60007
|
}
|
|
60447
60008
|
function applyTextStyle(editor, block, range, style2, value) {
|
|
60448
|
-
assert(logger$
|
|
60009
|
+
assert(logger$1H, range.isSimple(), "invalid range");
|
|
60449
60010
|
const { start, end } = range;
|
|
60450
|
-
assert(logger$
|
|
60451
|
-
assert(logger$
|
|
60011
|
+
assert(logger$1H, start.blockId === end.blockId && start.blockId === getBlockId(block), "invalid range");
|
|
60012
|
+
assert(logger$1H, style2.startsWith("style-"), "invalid style");
|
|
60452
60013
|
const oldText = editor.getBlockText(block);
|
|
60453
60014
|
let newText = oldText;
|
|
60454
60015
|
if (style2 === "style-sub") {
|
|
@@ -60494,13 +60055,13 @@ $$${mathData.mathjaxText}$$
|
|
|
60494
60055
|
return standardItems;
|
|
60495
60056
|
}
|
|
60496
60057
|
function getSubText(editor, block, range) {
|
|
60497
|
-
assert(logger$
|
|
60058
|
+
assert(logger$1H, range.isSimple(), "nor a simple range");
|
|
60498
60059
|
const { start, end } = range;
|
|
60499
|
-
assert(logger$
|
|
60500
|
-
assert(logger$
|
|
60501
|
-
assert(logger$
|
|
60060
|
+
assert(logger$1H, start.isSimple(), "is not a simple block position");
|
|
60061
|
+
assert(logger$1H, end.isSimple(), "is not a simple block position");
|
|
60062
|
+
assert(logger$1H, isTextKindBlock(editor, block), "invalid block type, not a text kind block");
|
|
60502
60063
|
const blockId = getBlockId(block);
|
|
60503
|
-
assert(logger$
|
|
60064
|
+
assert(logger$1H, start.blockId === blockId && end.blockId === blockId, "invalid range");
|
|
60504
60065
|
const text2 = editor.getBlockText(block);
|
|
60505
60066
|
let subText2 = [];
|
|
60506
60067
|
if (start.offset === end.offset) {
|
|
@@ -60512,7 +60073,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60512
60073
|
}
|
|
60513
60074
|
return subText2;
|
|
60514
60075
|
}
|
|
60515
|
-
const logger$
|
|
60076
|
+
const logger$1G = getLogger("text-commands");
|
|
60516
60077
|
function getCommands$1(editor, text2) {
|
|
60517
60078
|
const StandardTextStyles = {
|
|
60518
60079
|
"style-bold": [i18n$1.t("commands.bold"), shortcutToDisplayText("CtrlOrCmd+B"), BoldIcon],
|
|
@@ -60530,13 +60091,13 @@ $$${mathData.mathjaxText}$$
|
|
|
60530
60091
|
}
|
|
60531
60092
|
function executeStyleCommand(editor, block, range, command, params, result) {
|
|
60532
60093
|
if (!command.startsWith("style-")) {
|
|
60533
|
-
logger$
|
|
60094
|
+
logger$1G.warn(`unknown command: ${command}`);
|
|
60534
60095
|
return false;
|
|
60535
60096
|
}
|
|
60536
60097
|
const value = params == null ? void 0 : params.value;
|
|
60537
60098
|
const type = typeof value;
|
|
60538
60099
|
if (type !== "string" && type !== "number" && type !== "boolean" && type !== "undefined") {
|
|
60539
|
-
logger$
|
|
60100
|
+
logger$1G.warn(`invalid value type, accept string | number | boolean | undefined, current is ${type}`);
|
|
60540
60101
|
return false;
|
|
60541
60102
|
}
|
|
60542
60103
|
const newText = applyTextStyle(editor, block, range, command, value);
|
|
@@ -60761,7 +60322,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60761
60322
|
this.providers = [new TextScriptProvider(editor)];
|
|
60762
60323
|
}
|
|
60763
60324
|
}
|
|
60764
|
-
const logger$
|
|
60325
|
+
const logger$1F = getLogger("text-command-provider");
|
|
60765
60326
|
class TextCommandProvider {
|
|
60766
60327
|
constructor(editor, options) {
|
|
60767
60328
|
__publicField(this, "id", "TextCommandProvider");
|
|
@@ -60881,7 +60442,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60881
60442
|
}
|
|
60882
60443
|
static fromTextCommandId(id) {
|
|
60883
60444
|
const prefix = "text/";
|
|
60884
|
-
assert(logger$
|
|
60445
|
+
assert(logger$1F, id.startsWith(prefix), `invalid item id: ${id}`);
|
|
60885
60446
|
return id.substring(prefix.length);
|
|
60886
60447
|
}
|
|
60887
60448
|
}
|
|
@@ -60997,7 +60558,7 @@ $$${mathData.mathjaxText}$$
|
|
|
60997
60558
|
};
|
|
60998
60559
|
editor.updateBlockData(block, newData);
|
|
60999
60560
|
}
|
|
61000
|
-
function addCommentToBlock(editor, block, provider) {
|
|
60561
|
+
function addCommentToBlock$1(editor, block, provider) {
|
|
61001
60562
|
const abstract = getCommentAbstract(editor, [block]);
|
|
61002
60563
|
const comment = createComment({
|
|
61003
60564
|
editor,
|
|
@@ -61008,7 +60569,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61008
60569
|
provider.localCreateComment(comment, doc2);
|
|
61009
60570
|
return comment;
|
|
61010
60571
|
}
|
|
61011
|
-
const logger$
|
|
60572
|
+
const logger$1E = getLogger("standard-block-actions");
|
|
61012
60573
|
class CommentBlockHook {
|
|
61013
60574
|
constructor(provider, editorComments) {
|
|
61014
60575
|
__publicField(this, "executeCommand", (editor, block, item) => {
|
|
@@ -61016,9 +60577,9 @@ $$${mathData.mathjaxText}$$
|
|
|
61016
60577
|
try {
|
|
61017
60578
|
this.editorComments.showCommentList();
|
|
61018
60579
|
const block2 = editor.getBlockById(blockId);
|
|
61019
|
-
addCommentToBlock(editor, block2, this.provider);
|
|
60580
|
+
addCommentToBlock$1(editor, block2, this.provider);
|
|
61020
60581
|
} catch (err) {
|
|
61021
|
-
logger$
|
|
60582
|
+
logger$1E.error(`failed to execute block command: ${JSON.stringify(err)}`);
|
|
61022
60583
|
}
|
|
61023
60584
|
});
|
|
61024
60585
|
this.provider = provider;
|
|
@@ -61122,7 +60683,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61122
60683
|
const attributes = Array.from(element.attributes).map((c) => c.name);
|
|
61123
60684
|
return attributes.filter((attribute) => attribute.startsWith("comment-")).map((attribute) => attribute.replace("comment-", ""));
|
|
61124
60685
|
}
|
|
61125
|
-
const logger$
|
|
60686
|
+
const logger$1D = getLogger("doc-comments");
|
|
61126
60687
|
function addBlockComments(doc2, block, result, resultSet) {
|
|
61127
60688
|
if (block.comments) {
|
|
61128
60689
|
const blockComments = block.comments;
|
|
@@ -61217,8 +60778,8 @@ $$${mathData.mathjaxText}$$
|
|
|
61217
60778
|
const result = commentGroup.filter((group) => commentsMap.has(group.groupId)).sort((group1, group2) => {
|
|
61218
60779
|
const index1 = commentsMap.get(group1.groupId);
|
|
61219
60780
|
const index2 = commentsMap.get(group2.groupId);
|
|
61220
|
-
assert(logger$
|
|
61221
|
-
assert(logger$
|
|
60781
|
+
assert(logger$1D, index1 !== void 0, `comment not exists in doc, ${group1.groupId}`);
|
|
60782
|
+
assert(logger$1D, index2 !== void 0, `comment not exists in doc, ${group2.groupId}`);
|
|
61222
60783
|
return index1 - index2;
|
|
61223
60784
|
});
|
|
61224
60785
|
return result;
|
|
@@ -61279,7 +60840,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61279
60840
|
const commentIds = intersection__default.default(comments1, comments2);
|
|
61280
60841
|
return commentIds;
|
|
61281
60842
|
}
|
|
61282
|
-
const logger$
|
|
60843
|
+
const logger$1C = getLogger("active-comments");
|
|
61283
60844
|
function inactiveComment(editor, commentId) {
|
|
61284
60845
|
const activeCommentElements = editor.rootContainer.querySelectorAll(`span.comment[comment-${commentId}],[data-type=editor-block].comment[comment-${commentId}]`);
|
|
61285
60846
|
activeCommentElements.forEach((el) => {
|
|
@@ -61315,7 +60876,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61315
60876
|
const commentIds = getCommentsFromSelection(editor);
|
|
61316
60877
|
if (commentIds.indexOf(commentId) === -1) {
|
|
61317
60878
|
const block = getParentBlock(targetElement);
|
|
61318
|
-
assert(logger$
|
|
60879
|
+
assert(logger$1C, block, "block not found");
|
|
61319
60880
|
const offset = getChildOffset(block, targetElement);
|
|
61320
60881
|
const anchor2 = createSimpleBlockPosition(block, offset.start, "normal");
|
|
61321
60882
|
editor.selection.setSelection(anchor2, void 0, { noScroll: direction === "next" });
|
|
@@ -61357,7 +60918,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61357
60918
|
function isValidSize(size) {
|
|
61358
60919
|
return typeof size === "number";
|
|
61359
60920
|
}
|
|
61360
|
-
const logger$
|
|
60921
|
+
const logger$1B = getLogger("image-data");
|
|
61361
60922
|
const md5Cache = /* @__PURE__ */ new Map();
|
|
61362
60923
|
const DEFAULT_WIDTH$1 = 1e3;
|
|
61363
60924
|
const DEFAULT_HEIGHT = 400;
|
|
@@ -61489,7 +61050,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61489
61050
|
if (heightKey && isValidSize(image.height)) {
|
|
61490
61051
|
result[heightKey] = image.height;
|
|
61491
61052
|
}
|
|
61492
|
-
assert(logger$
|
|
61053
|
+
assert(logger$1B, image.flex, "no image flex");
|
|
61493
61054
|
const flexKey = getImageFlexKeyFromSrc(index2);
|
|
61494
61055
|
result[flexKey] = image.flex;
|
|
61495
61056
|
});
|
|
@@ -61545,7 +61106,224 @@ $$${mathData.mathjaxText}$$
|
|
|
61545
61106
|
const totalFlex = images.reduce((accumulator, currentValue) => accumulator + currentValue.flex, 0);
|
|
61546
61107
|
return totalFlex;
|
|
61547
61108
|
}
|
|
61548
|
-
|
|
61109
|
+
function createResizeGripper(parent, type) {
|
|
61110
|
+
const elem = createElement("div", ["resize-gripper", type], parent);
|
|
61111
|
+
elem.setAttribute("data-resize-type", type);
|
|
61112
|
+
}
|
|
61113
|
+
function getExistsResizer(block) {
|
|
61114
|
+
const tools = getBlockTools(block);
|
|
61115
|
+
return tools.querySelector(".block-resizer");
|
|
61116
|
+
}
|
|
61117
|
+
function hideResizer(block) {
|
|
61118
|
+
const exists = getExistsResizer(block);
|
|
61119
|
+
if (exists) {
|
|
61120
|
+
removeClass(exists, "active");
|
|
61121
|
+
}
|
|
61122
|
+
}
|
|
61123
|
+
function updateSize(block, element, resizer) {
|
|
61124
|
+
const blockRect = block.getBoundingClientRect();
|
|
61125
|
+
const elementRect = element.getBoundingClientRect();
|
|
61126
|
+
const top = elementRect.top - blockRect.top;
|
|
61127
|
+
const left = elementRect.left - blockRect.left;
|
|
61128
|
+
const width = elementRect.width;
|
|
61129
|
+
const height = elementRect.height;
|
|
61130
|
+
resizer.style.top = `${top}px`;
|
|
61131
|
+
resizer.style.left = `${left}px`;
|
|
61132
|
+
resizer.style.width = `${width}px`;
|
|
61133
|
+
resizer.style.height = `${height}px`;
|
|
61134
|
+
}
|
|
61135
|
+
function createResizer(block, element, options, mouseDownEvent) {
|
|
61136
|
+
const exists = getExistsResizer(block);
|
|
61137
|
+
if (exists) {
|
|
61138
|
+
addClass(exists, "active");
|
|
61139
|
+
updateSize(block, element, exists);
|
|
61140
|
+
return exists;
|
|
61141
|
+
}
|
|
61142
|
+
const tools = getBlockTools(block);
|
|
61143
|
+
const resizer = createElement("div", ["block-resizer"], tools);
|
|
61144
|
+
updateSize(block, element, resizer);
|
|
61145
|
+
options.resize.forEach((type) => {
|
|
61146
|
+
createResizeGripper(resizer, type);
|
|
61147
|
+
});
|
|
61148
|
+
resizer.addEventListener("mousedown", mouseDownEvent);
|
|
61149
|
+
addClass(resizer, "active");
|
|
61150
|
+
return resizer;
|
|
61151
|
+
}
|
|
61152
|
+
function updateResizer(block, element) {
|
|
61153
|
+
const resizer = getExistsResizer(block);
|
|
61154
|
+
if (!resizer) {
|
|
61155
|
+
return;
|
|
61156
|
+
}
|
|
61157
|
+
if (!isChildNode(block, element)) {
|
|
61158
|
+
return;
|
|
61159
|
+
}
|
|
61160
|
+
const blockRect = block.getBoundingClientRect();
|
|
61161
|
+
const elementRect = element.getBoundingClientRect();
|
|
61162
|
+
const top = elementRect.top - blockRect.top;
|
|
61163
|
+
const left = elementRect.left - blockRect.left;
|
|
61164
|
+
const width = elementRect.width;
|
|
61165
|
+
const height = elementRect.height;
|
|
61166
|
+
resizer.style.top = `${top}px`;
|
|
61167
|
+
resizer.style.left = `${left}px`;
|
|
61168
|
+
resizer.style.width = `${width}px`;
|
|
61169
|
+
resizer.style.height = `${height}px`;
|
|
61170
|
+
}
|
|
61171
|
+
const style$8 = "";
|
|
61172
|
+
const logger$1A = getLogger("block-resizer");
|
|
61173
|
+
class BlockResizer extends tinyTypedEmitter.TypedEmitter {
|
|
61174
|
+
constructor(editor, options) {
|
|
61175
|
+
super();
|
|
61176
|
+
__publicField(this, "resizableElement");
|
|
61177
|
+
__publicField(this, "block", null);
|
|
61178
|
+
__publicField(this, "startRect", null);
|
|
61179
|
+
__publicField(this, "startPos", null);
|
|
61180
|
+
__publicField(this, "resizeType", null);
|
|
61181
|
+
__publicField(this, "enabled", false);
|
|
61182
|
+
__publicField(this, "handleEditorResize", () => {
|
|
61183
|
+
if (this.block) {
|
|
61184
|
+
this.updateResizer();
|
|
61185
|
+
}
|
|
61186
|
+
});
|
|
61187
|
+
__publicField(this, "handleMouseDown", (event) => {
|
|
61188
|
+
event.preventDefault();
|
|
61189
|
+
event.stopPropagation();
|
|
61190
|
+
const element = this.getResizableElement();
|
|
61191
|
+
if (!element) {
|
|
61192
|
+
return;
|
|
61193
|
+
}
|
|
61194
|
+
if (event.button !== 0) {
|
|
61195
|
+
return;
|
|
61196
|
+
}
|
|
61197
|
+
const gripper = event.target;
|
|
61198
|
+
if (!gripper) {
|
|
61199
|
+
return;
|
|
61200
|
+
}
|
|
61201
|
+
if (!(gripper instanceof HTMLElement)) {
|
|
61202
|
+
return;
|
|
61203
|
+
}
|
|
61204
|
+
const resizeType = gripper.getAttribute("data-resize-type");
|
|
61205
|
+
if (!resizeType) {
|
|
61206
|
+
return;
|
|
61207
|
+
}
|
|
61208
|
+
this.bindEvents();
|
|
61209
|
+
this.startRect = element.getBoundingClientRect();
|
|
61210
|
+
this.startPos = event;
|
|
61211
|
+
this.resizeType = resizeType;
|
|
61212
|
+
setDefaultCursor(window.getComputedStyle(gripper).cursor);
|
|
61213
|
+
if (this.block) {
|
|
61214
|
+
this.editor.selection.selectBlock(this.block, 0);
|
|
61215
|
+
}
|
|
61216
|
+
});
|
|
61217
|
+
__publicField(this, "handleMouseMove", (event) => {
|
|
61218
|
+
if (!this.startPos || !this.startRect || !this.resizeType) {
|
|
61219
|
+
return;
|
|
61220
|
+
}
|
|
61221
|
+
const element = this.getResizableElement();
|
|
61222
|
+
if (!element || !this.block) {
|
|
61223
|
+
return;
|
|
61224
|
+
}
|
|
61225
|
+
const deltaX = event.x - this.startPos.x;
|
|
61226
|
+
const deltaY = event.y - this.startPos.y;
|
|
61227
|
+
const oldRect = this.startRect;
|
|
61228
|
+
let { top, left, right, bottom } = oldRect;
|
|
61229
|
+
if (this.resizeType === "bottom" || this.resizeType === "bottom-left" || this.resizeType === "bottom-right") {
|
|
61230
|
+
bottom += deltaY;
|
|
61231
|
+
}
|
|
61232
|
+
if (this.resizeType === "top" || this.resizeType === "top-left" || this.resizeType === "top-right") {
|
|
61233
|
+
top += deltaY;
|
|
61234
|
+
}
|
|
61235
|
+
if (this.resizeType === "left" || this.resizeType === "top-left" || this.resizeType === "bottom-left") {
|
|
61236
|
+
left += deltaX;
|
|
61237
|
+
}
|
|
61238
|
+
if (this.resizeType === "right" || this.resizeType === "top-right" || this.resizeType === "bottom-right") {
|
|
61239
|
+
right += deltaX;
|
|
61240
|
+
}
|
|
61241
|
+
const width = right > left ? right - left : 0;
|
|
61242
|
+
const height = bottom > top ? bottom - top : 0;
|
|
61243
|
+
const newRect = new DOMRect(left, top, width, height);
|
|
61244
|
+
this.emit("resizing", this, newRect);
|
|
61245
|
+
const newElement = this.getResizableElement();
|
|
61246
|
+
if (newElement) {
|
|
61247
|
+
updateResizer(this.block, newElement);
|
|
61248
|
+
}
|
|
61249
|
+
});
|
|
61250
|
+
__publicField(this, "handleMouseUp", (event) => {
|
|
61251
|
+
if (event.button !== 0) {
|
|
61252
|
+
return;
|
|
61253
|
+
}
|
|
61254
|
+
setDefaultCursor("");
|
|
61255
|
+
this.unbindEvents();
|
|
61256
|
+
this.emit("resized", this);
|
|
61257
|
+
const element = this.getResizableElement();
|
|
61258
|
+
if (!element || !this.block) {
|
|
61259
|
+
return;
|
|
61260
|
+
}
|
|
61261
|
+
updateResizer(this.block, element);
|
|
61262
|
+
});
|
|
61263
|
+
this.editor = editor;
|
|
61264
|
+
this.options = options;
|
|
61265
|
+
this.editor.addListener("resize", this.handleEditorResize);
|
|
61266
|
+
}
|
|
61267
|
+
enableResize(block, resizableElement) {
|
|
61268
|
+
this.block = block;
|
|
61269
|
+
this.resizableElement = resizableElement;
|
|
61270
|
+
this.createResizer();
|
|
61271
|
+
this.enabled = true;
|
|
61272
|
+
}
|
|
61273
|
+
disableResize() {
|
|
61274
|
+
if (!this.block) {
|
|
61275
|
+
return;
|
|
61276
|
+
}
|
|
61277
|
+
hideResizer(this.block);
|
|
61278
|
+
this.enabled = false;
|
|
61279
|
+
}
|
|
61280
|
+
update(block, resizableElement) {
|
|
61281
|
+
this.block = block;
|
|
61282
|
+
this.resizableElement = resizableElement;
|
|
61283
|
+
const elem = this.getResizableElement();
|
|
61284
|
+
if (elem && this.enabled) {
|
|
61285
|
+
this.createResizer();
|
|
61286
|
+
}
|
|
61287
|
+
}
|
|
61288
|
+
updateResizer() {
|
|
61289
|
+
const newElement = this.getResizableElement();
|
|
61290
|
+
if (newElement && this.block) {
|
|
61291
|
+
updateResizer(this.block, newElement);
|
|
61292
|
+
}
|
|
61293
|
+
}
|
|
61294
|
+
getBlock() {
|
|
61295
|
+
return this.block;
|
|
61296
|
+
}
|
|
61297
|
+
destroy() {
|
|
61298
|
+
this.editor.removeListener("resize", this.handleEditorResize);
|
|
61299
|
+
}
|
|
61300
|
+
getResizableElement() {
|
|
61301
|
+
if (this.resizableElement) {
|
|
61302
|
+
return this.resizableElement;
|
|
61303
|
+
}
|
|
61304
|
+
if (!this.block) {
|
|
61305
|
+
return null;
|
|
61306
|
+
}
|
|
61307
|
+
return getBlockContent(this.block);
|
|
61308
|
+
}
|
|
61309
|
+
createResizer() {
|
|
61310
|
+
const element = this.getResizableElement();
|
|
61311
|
+
if (!element || !this.block) {
|
|
61312
|
+
return;
|
|
61313
|
+
}
|
|
61314
|
+
assert(logger$1A, isChildNode(this.block, element), "not a block child element");
|
|
61315
|
+
createResizer(this.block, element, this.options, this.handleMouseDown);
|
|
61316
|
+
}
|
|
61317
|
+
bindEvents() {
|
|
61318
|
+
document.addEventListener("mousemove", this.handleMouseMove);
|
|
61319
|
+
document.addEventListener("mouseup", this.handleMouseUp);
|
|
61320
|
+
}
|
|
61321
|
+
unbindEvents() {
|
|
61322
|
+
document.removeEventListener("mousemove", this.handleMouseMove);
|
|
61323
|
+
document.removeEventListener("mouseup", this.handleMouseUp);
|
|
61324
|
+
}
|
|
61325
|
+
}
|
|
61326
|
+
const logger$1z = getLogger("image-dom");
|
|
61549
61327
|
function getExistsProgressMask(imageContainer) {
|
|
61550
61328
|
return imageContainer.querySelector(".uploading-progress-mask");
|
|
61551
61329
|
}
|
|
@@ -61562,7 +61340,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61562
61340
|
function getImageUploadingProgressValueElement(imageContainer) {
|
|
61563
61341
|
const bar2 = getImageUploadingProgressMask(imageContainer);
|
|
61564
61342
|
const value = bar2.querySelector(".uploading-progress-bar-value");
|
|
61565
|
-
assert(logger$
|
|
61343
|
+
assert(logger$1z, value, "no progress value");
|
|
61566
61344
|
return value;
|
|
61567
61345
|
}
|
|
61568
61346
|
function setImageUploading(imageContainer, progress) {
|
|
@@ -61652,7 +61430,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61652
61430
|
const images = Array.from(block.querySelectorAll(".image-container"));
|
|
61653
61431
|
return images;
|
|
61654
61432
|
}
|
|
61655
|
-
const logger$
|
|
61433
|
+
const logger$1y = getLogger("table-resize-drag-drop");
|
|
61656
61434
|
class ImageSplitterResizer {
|
|
61657
61435
|
constructor(editor, elem, data2, mouseDownEvent) {
|
|
61658
61436
|
__publicField(this, "cursor", "col-resize");
|
|
@@ -61665,7 +61443,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61665
61443
|
const imageObject = getImageObject(this.editor, block);
|
|
61666
61444
|
const images = imageObject.getImages();
|
|
61667
61445
|
const splitterIndex = this.data.splitterIndex;
|
|
61668
|
-
assert(logger$
|
|
61446
|
+
assert(logger$1y, splitterIndex >= 0 && splitterIndex < images.length - 1, `invalid splitter index: ${splitterIndex}`);
|
|
61669
61447
|
const imageContainers = getImageContainersByBlock(block);
|
|
61670
61448
|
const initWidths = imageContainers.map((imageContainer) => imageContainer.getBoundingClientRect().width);
|
|
61671
61449
|
this.initWidths = initWidths;
|
|
@@ -61683,7 +61461,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61683
61461
|
const imageObject = getImageObject(this.editor, block);
|
|
61684
61462
|
const images = cloneDeep__default.default(imageObject.getImages());
|
|
61685
61463
|
const splitterIndex = this.data.splitterIndex;
|
|
61686
|
-
assert(logger$
|
|
61464
|
+
assert(logger$1y, splitterIndex >= 0 && splitterIndex < images.length - 1, `invalid splitter index: ${splitterIndex}`);
|
|
61687
61465
|
const width1 = this.initWidths[splitterIndex];
|
|
61688
61466
|
const width2 = this.initWidths[splitterIndex + 1];
|
|
61689
61467
|
if (width1 + width2 < 100) {
|
|
@@ -61702,7 +61480,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61702
61480
|
newWidths[splitterIndex] += delta;
|
|
61703
61481
|
newWidths[splitterIndex + 1] -= delta;
|
|
61704
61482
|
const imageContainers = getImageContainersByBlock(block);
|
|
61705
|
-
assert(logger$
|
|
61483
|
+
assert(logger$1y, imageContainers.length === images.length, "invalid image data");
|
|
61706
61484
|
const totalWidth = newWidths.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
|
|
61707
61485
|
for (let i = 0; i < images.length; i++) {
|
|
61708
61486
|
const flex = newWidths[i] / totalWidth;
|
|
@@ -61775,7 +61553,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61775
61553
|
editor.domEvents.addEventListener(splitter2, "mousedown", handleSplitterMouseDown);
|
|
61776
61554
|
editor.domEvents.addEventListener(splitter2, "dblclick", handleSplitterDblclick);
|
|
61777
61555
|
}
|
|
61778
|
-
const logger$
|
|
61556
|
+
const logger$1x = getLogger("image-item");
|
|
61779
61557
|
function getParentImageBlock(eventTarget) {
|
|
61780
61558
|
if (!eventTarget) {
|
|
61781
61559
|
return null;
|
|
@@ -61854,7 +61632,7 @@ $$${mathData.mathjaxText}$$
|
|
|
61854
61632
|
if (file2) {
|
|
61855
61633
|
imageObject.replaceImage(index2, file2);
|
|
61856
61634
|
} else {
|
|
61857
|
-
logger$
|
|
61635
|
+
logger$1x.warn(`failed to download image: ${imageData.src}`);
|
|
61858
61636
|
}
|
|
61859
61637
|
}
|
|
61860
61638
|
function createLoadErrorElement(editor, imageContainer, imageData) {
|
|
@@ -62077,7 +61855,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62077
61855
|
function isImageFile(fileType) {
|
|
62078
61856
|
return fileType.startsWith("image/");
|
|
62079
61857
|
}
|
|
62080
|
-
const logger$
|
|
61858
|
+
const logger$1w = getLogger("image-object");
|
|
62081
61859
|
class ImageObject {
|
|
62082
61860
|
constructor(editor, blockData) {
|
|
62083
61861
|
__publicField(this, "images", []);
|
|
@@ -62368,7 +62146,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62368
62146
|
this.editor.updateEmbedData(block2, embedData);
|
|
62369
62147
|
return true;
|
|
62370
62148
|
} catch (err) {
|
|
62371
|
-
logger$
|
|
62149
|
+
logger$1w.error(err);
|
|
62372
62150
|
const block2 = this.editor.findBlockById(this.blockData.id);
|
|
62373
62151
|
if (!block2) {
|
|
62374
62152
|
return false;
|
|
@@ -62385,7 +62163,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62385
62163
|
if (!block) {
|
|
62386
62164
|
return;
|
|
62387
62165
|
}
|
|
62388
|
-
assert(logger$
|
|
62166
|
+
assert(logger$1w, flex.length === this.images.length, "invalid flex");
|
|
62389
62167
|
for (let i = 0; i < this.images.length; i++) {
|
|
62390
62168
|
this.images[i].flex = flex[i];
|
|
62391
62169
|
}
|
|
@@ -62434,7 +62212,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62434
62212
|
}
|
|
62435
62213
|
}
|
|
62436
62214
|
const imageEmbedStyle = "";
|
|
62437
|
-
const logger$
|
|
62215
|
+
const logger$1v = getLogger("drop-indicator");
|
|
62438
62216
|
const INDICATOR_SIZE$1 = 2;
|
|
62439
62217
|
class DropIndicator {
|
|
62440
62218
|
constructor(editor) {
|
|
@@ -62479,7 +62257,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62479
62257
|
if (insertPos === "before") {
|
|
62480
62258
|
const beforeBlock = getPrevVisibleBlock(block);
|
|
62481
62259
|
if (!beforeBlock) {
|
|
62482
|
-
assert(logger$
|
|
62260
|
+
assert(logger$1v, isChildContainer(getParentContainer(block)), "block does not in a child container");
|
|
62483
62261
|
const rect = block.getBoundingClientRect();
|
|
62484
62262
|
const viewRect2 = this.getViewRect(block);
|
|
62485
62263
|
return new DOMRect(viewRect2.x, rect.y, viewRect2.width, INDICATOR_SIZE$1);
|
|
@@ -62505,14 +62283,14 @@ $$${mathData.mathjaxText}$$
|
|
|
62505
62283
|
const PADDING = 5;
|
|
62506
62284
|
if (insertPos.pos === "left") {
|
|
62507
62285
|
const parent = getParentContainer(block);
|
|
62508
|
-
assert(logger$
|
|
62286
|
+
assert(logger$1v, parent, "block does not in a container");
|
|
62509
62287
|
const rect = block.getBoundingClientRect();
|
|
62510
62288
|
const viewRect = this.getViewRect(block);
|
|
62511
62289
|
return new DOMRect(viewRect.x - INDICATOR_SIZE$1 - PADDING, rect.y, INDICATOR_SIZE$1, rect.height);
|
|
62512
62290
|
}
|
|
62513
62291
|
if (insertPos.pos === "right") {
|
|
62514
62292
|
const parent = getParentContainer(block);
|
|
62515
|
-
assert(logger$
|
|
62293
|
+
assert(logger$1v, parent, "block does not in a container");
|
|
62516
62294
|
const rect = block.getBoundingClientRect();
|
|
62517
62295
|
let viewRect;
|
|
62518
62296
|
if (isEmbedBlock(block)) {
|
|
@@ -62609,7 +62387,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62609
62387
|
}
|
|
62610
62388
|
return void 0;
|
|
62611
62389
|
}
|
|
62612
|
-
const logger$
|
|
62390
|
+
const logger$1u = getLogger("code-dom");
|
|
62613
62391
|
function isCodeBlock(block) {
|
|
62614
62392
|
return getBlockType(block) === "code";
|
|
62615
62393
|
}
|
|
@@ -62627,8 +62405,8 @@ $$${mathData.mathjaxText}$$
|
|
|
62627
62405
|
}
|
|
62628
62406
|
function getParentCodeBlock(elem) {
|
|
62629
62407
|
const codeBlock2 = elem.closest("div[data-type=editor-block][data-block-type=code]");
|
|
62630
|
-
assert(logger$
|
|
62631
|
-
assert(logger$
|
|
62408
|
+
assert(logger$1u, codeBlock2, "no parent code block");
|
|
62409
|
+
assert(logger$1u, isCodeBlock(codeBlock2), "not a code block");
|
|
62632
62410
|
return codeBlock2;
|
|
62633
62411
|
}
|
|
62634
62412
|
const SUPPORTED_LANGUAGES = () => ({
|
|
@@ -62719,7 +62497,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62719
62497
|
function setDefaultLanguage(editor, lang) {
|
|
62720
62498
|
return editor.settingsProvider.setItem("editor-code-lang", lang);
|
|
62721
62499
|
}
|
|
62722
|
-
const logger$
|
|
62500
|
+
const logger$1t = getLogger("convert-to-code");
|
|
62723
62501
|
function convertToCode(editor, srcBlock) {
|
|
62724
62502
|
if (!isTextKindBlock(editor, srcBlock)) {
|
|
62725
62503
|
return null;
|
|
@@ -62732,7 +62510,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62732
62510
|
const textContainerId = genId();
|
|
62733
62511
|
editor.doc.localInsertChildContainers([{ containerId: textContainerId, blocks: [textBlock] }]);
|
|
62734
62512
|
const text2 = editor.getBlockData(srcBlock).text;
|
|
62735
|
-
assert(logger$
|
|
62513
|
+
assert(logger$1t, text2, "no text");
|
|
62736
62514
|
let alias = toPlainText(text2);
|
|
62737
62515
|
if (alias.startsWith("```")) {
|
|
62738
62516
|
alias = alias.substring(3);
|
|
@@ -62750,16 +62528,16 @@ $$${mathData.mathjaxText}$$
|
|
|
62750
62528
|
};
|
|
62751
62529
|
}
|
|
62752
62530
|
const codeBlock = "";
|
|
62753
|
-
const logger$
|
|
62531
|
+
const logger$1s = getLogger("code-block-child-container");
|
|
62754
62532
|
function getTextContainer(codeBlock2) {
|
|
62755
|
-
assert(logger$
|
|
62533
|
+
assert(logger$1s, isCodeBlock(codeBlock2), "not a code block");
|
|
62756
62534
|
const content = getBlockContent(codeBlock2);
|
|
62757
62535
|
const textContainer = content.querySelector(":scope > div.editor-code-root > div.code-text-root [data-type=editor-container].child");
|
|
62758
|
-
assert(logger$
|
|
62536
|
+
assert(logger$1s, textContainer, "no code text container");
|
|
62759
62537
|
return textContainer;
|
|
62760
62538
|
}
|
|
62761
62539
|
function getCaptionContainer(codeBlock2) {
|
|
62762
|
-
assert(logger$
|
|
62540
|
+
assert(logger$1s, isCodeBlock(codeBlock2), "not a code block");
|
|
62763
62541
|
const content = getBlockContent(codeBlock2);
|
|
62764
62542
|
const textContainer = content.querySelector(":scope > div.editor-code-root > div.code-caption-root [data-type=editor-container].child");
|
|
62765
62543
|
if (!textContainer)
|
|
@@ -62788,7 +62566,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62788
62566
|
}
|
|
62789
62567
|
return getBlockType(block) === "code";
|
|
62790
62568
|
}
|
|
62791
|
-
const logger$
|
|
62569
|
+
const logger$1r = getLogger("code-caption");
|
|
62792
62570
|
function toggleCodeCaption(editor, codeBlock2) {
|
|
62793
62571
|
if (editor.readonly) {
|
|
62794
62572
|
return;
|
|
@@ -62801,7 +62579,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62801
62579
|
}
|
|
62802
62580
|
const captionContainerId = createEmptyContainer(editor.doc);
|
|
62803
62581
|
const oldData = editor.getBlockData(codeBlock2);
|
|
62804
|
-
assert(logger$
|
|
62582
|
+
assert(logger$1r, oldData.children.length === 1, "code block should have only one child");
|
|
62805
62583
|
const newData = {
|
|
62806
62584
|
...oldData,
|
|
62807
62585
|
children: [oldData.children[0], captionContainerId]
|
|
@@ -62817,7 +62595,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62817
62595
|
return false;
|
|
62818
62596
|
}
|
|
62819
62597
|
const parentBlock = getParentBlock(parentContainer);
|
|
62820
|
-
assert(logger$
|
|
62598
|
+
assert(logger$1r, parentBlock, "no parent block");
|
|
62821
62599
|
if (!isCodeBlock(parentBlock)) {
|
|
62822
62600
|
return false;
|
|
62823
62601
|
}
|
|
@@ -62837,7 +62615,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62837
62615
|
const lastBlock2 = getLastChildBlock(textContainer);
|
|
62838
62616
|
editor.selection.selectBlock(lastBlock2, getBlockTextLength$6(editor, lastBlock2));
|
|
62839
62617
|
const oldData = editor.getBlockData(codeBlock2);
|
|
62840
|
-
assert(logger$
|
|
62618
|
+
assert(logger$1r, oldData.children.length === 2, "code block should have only one child");
|
|
62841
62619
|
const captionContainerId = oldData.children[1];
|
|
62842
62620
|
const newData = {
|
|
62843
62621
|
...oldData,
|
|
@@ -62846,7 +62624,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62846
62624
|
editor.updateBlockData(codeBlock2, newData);
|
|
62847
62625
|
editor.deleteChildContainers([captionContainerId]);
|
|
62848
62626
|
}
|
|
62849
|
-
const logger$
|
|
62627
|
+
const logger$1q = getLogger("paste-in-table-block");
|
|
62850
62628
|
class PasteEventHandler {
|
|
62851
62629
|
constructor(editor) {
|
|
62852
62630
|
this.editor = editor;
|
|
@@ -62867,7 +62645,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62867
62645
|
return false;
|
|
62868
62646
|
}
|
|
62869
62647
|
const parentBlock = getParentBlock(parentContainer);
|
|
62870
|
-
assert(logger$
|
|
62648
|
+
assert(logger$1q, parentBlock, "no parent block");
|
|
62871
62649
|
if (!isCodeBlock(parentBlock)) {
|
|
62872
62650
|
return false;
|
|
62873
62651
|
}
|
|
@@ -62931,7 +62709,7 @@ $$${mathData.mathjaxText}$$
|
|
|
62931
62709
|
function registerCodeBlockCommandProvider(editor) {
|
|
62932
62710
|
editor.addCustom("code-block-command-provider", (editor2) => new CodeBlockCommandProvider(editor2));
|
|
62933
62711
|
}
|
|
62934
|
-
const logger$
|
|
62712
|
+
const logger$1p = getLogger("code-caption-input-handler");
|
|
62935
62713
|
function getCurrentCaptionBlock(editor) {
|
|
62936
62714
|
if (!editor.selection.range.isSimple()) {
|
|
62937
62715
|
return null;
|
|
@@ -63044,7 +62822,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63044
62822
|
editor.undoManager.runInGroup(() => {
|
|
63045
62823
|
editor.clearSelectedContents();
|
|
63046
62824
|
const start = editor.selection.range.start;
|
|
63047
|
-
assert(logger$
|
|
62825
|
+
assert(logger$1p, start.isSimple(), "not simple position");
|
|
63048
62826
|
editor.insertTextToBlock(block, start.offset, text2);
|
|
63049
62827
|
});
|
|
63050
62828
|
return true;
|
|
@@ -63089,9 +62867,9 @@ $$${mathData.mathjaxText}$$
|
|
|
63089
62867
|
};
|
|
63090
62868
|
editor.updateBlockData(codeBlock2, newData);
|
|
63091
62869
|
}
|
|
63092
|
-
const logger$
|
|
62870
|
+
const logger$1o = getLogger("code-block-header");
|
|
63093
62871
|
function selectCodeBlock(editor, block, options) {
|
|
63094
|
-
assert(logger$
|
|
62872
|
+
assert(logger$1o, isCodeBlock(block), "not a code block");
|
|
63095
62873
|
const firstBlock = getFirstChildBlock(getTextContainer(block));
|
|
63096
62874
|
editor.selection.selectBlock(firstBlock, 0);
|
|
63097
62875
|
if (options.focusToEditor) {
|
|
@@ -63133,8 +62911,8 @@ $$${mathData.mathjaxText}$$
|
|
|
63133
62911
|
const target = event.target;
|
|
63134
62912
|
const select2 = target.closest(".language-select");
|
|
63135
62913
|
const block = getParentBlock(select2);
|
|
63136
|
-
assert(logger$
|
|
63137
|
-
assert(logger$
|
|
62914
|
+
assert(logger$1o, block, "no parent block");
|
|
62915
|
+
assert(logger$1o, getBlockType(block) === "code", "not a code block");
|
|
63138
62916
|
const codeData = editor2.getBlockData(block);
|
|
63139
62917
|
const dropdown2 = editor2.getCustom("code-header-language-select-dropdown");
|
|
63140
62918
|
dropdown2.custom = { codeBlock: block, editor: editor2 };
|
|
@@ -63157,11 +62935,11 @@ $$${mathData.mathjaxText}$$
|
|
|
63157
62935
|
function handleCodeHeaderButtonClick(editor, event) {
|
|
63158
62936
|
const target = event.target;
|
|
63159
62937
|
const button2 = target.closest(".code-header-button");
|
|
63160
|
-
assert(logger$
|
|
62938
|
+
assert(logger$1o, button2, "no button");
|
|
63161
62939
|
const block = getParentBlock(target);
|
|
63162
|
-
assert(logger$
|
|
62940
|
+
assert(logger$1o, block, "no parent block");
|
|
63163
62941
|
const id = button2.getAttribute("data-id");
|
|
63164
|
-
assert(logger$
|
|
62942
|
+
assert(logger$1o, getBlockType(block) === "code", "not a code block");
|
|
63165
62943
|
if (id === "wrap") {
|
|
63166
62944
|
const old = editor.getBlockData(block);
|
|
63167
62945
|
changeCodeBlockWrap(editor, block, !old.nowrap);
|
|
@@ -63187,7 +62965,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63187
62965
|
}
|
|
63188
62966
|
});
|
|
63189
62967
|
}).catch((err) => {
|
|
63190
|
-
logger$
|
|
62968
|
+
logger$1o.error(err.message);
|
|
63191
62969
|
});
|
|
63192
62970
|
return;
|
|
63193
62971
|
}
|
|
@@ -63238,7 +63016,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63238
63016
|
}
|
|
63239
63017
|
function getCodeBlockHeader(block) {
|
|
63240
63018
|
const header = block.querySelector(".code-block-header");
|
|
63241
|
-
assert(logger$
|
|
63019
|
+
assert(logger$1o, header, "no code block header");
|
|
63242
63020
|
return header;
|
|
63243
63021
|
}
|
|
63244
63022
|
function handleCodeScroll(editor, event) {
|
|
@@ -63287,7 +63065,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63287
63065
|
focusBlockId: textBlock.id
|
|
63288
63066
|
};
|
|
63289
63067
|
}
|
|
63290
|
-
const logger$
|
|
63068
|
+
const logger$1n = getLogger("code-block");
|
|
63291
63069
|
function getPaddingNum(index2) {
|
|
63292
63070
|
if (index2 <= 2) {
|
|
63293
63071
|
return 32;
|
|
@@ -63314,10 +63092,10 @@ $$${mathData.mathjaxText}$$
|
|
|
63314
63092
|
handlePasteInTableEvent(editor);
|
|
63315
63093
|
registerCodeBlockCommandProvider(editor);
|
|
63316
63094
|
trackChildBlockEvent(editor, handleDebounceUpdate);
|
|
63317
|
-
assert(logger$
|
|
63095
|
+
assert(logger$1n, blockData.type === "code", "invalid block data type");
|
|
63318
63096
|
const codeData = blockData;
|
|
63319
|
-
assert(logger$
|
|
63320
|
-
assert(logger$
|
|
63097
|
+
assert(logger$1n, codeData.children, "invalid block data children");
|
|
63098
|
+
assert(logger$1n, codeData.children.length === 1 || codeData.children.length === 2, "invalid block data children length");
|
|
63321
63099
|
setTimeout(() => {
|
|
63322
63100
|
if (isNodeRemoved(blockElement))
|
|
63323
63101
|
return;
|
|
@@ -63368,15 +63146,15 @@ $$${mathData.mathjaxText}$$
|
|
|
63368
63146
|
}
|
|
63369
63147
|
function updateSelection$3(editor, block, from, to) {
|
|
63370
63148
|
if (from.isSimple()) {
|
|
63371
|
-
assert(logger$
|
|
63372
|
-
logger$
|
|
63149
|
+
assert(logger$1n, to.isSimple(), "from is simple position but to is not simple position");
|
|
63150
|
+
logger$1n.debug("full select list");
|
|
63373
63151
|
addClass(block, "full-selected");
|
|
63374
63152
|
return;
|
|
63375
63153
|
}
|
|
63376
|
-
assert(logger$
|
|
63154
|
+
assert(logger$1n, !to.isSimple(), "from is complex position but end is simple position");
|
|
63377
63155
|
const f = from;
|
|
63378
63156
|
const t2 = to;
|
|
63379
|
-
assert(logger$
|
|
63157
|
+
assert(logger$1n, f.blockId === t2.blockId, "only allow update one table selection");
|
|
63380
63158
|
const containers = getCodeChildContainers(block);
|
|
63381
63159
|
containers.forEach((container) => {
|
|
63382
63160
|
const containerId = getContainerId(container);
|
|
@@ -63411,8 +63189,8 @@ $$${mathData.mathjaxText}$$
|
|
|
63411
63189
|
const containersIds = childContainers.map(getContainerId);
|
|
63412
63190
|
const startIndex = containersIds.indexOf(start.childContainerId);
|
|
63413
63191
|
const endIndex = containersIds.indexOf(end.childContainerId);
|
|
63414
|
-
assert(logger$
|
|
63415
|
-
assert(logger$
|
|
63192
|
+
assert(logger$1n, startIndex !== -1, "invalid start pos");
|
|
63193
|
+
assert(logger$1n, endIndex !== -1, "invalid end pos");
|
|
63416
63194
|
const ret = [childContainers[startIndex]];
|
|
63417
63195
|
if (startIndex !== endIndex) {
|
|
63418
63196
|
ret.push(childContainers[endIndex]);
|
|
@@ -63420,7 +63198,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63420
63198
|
return ret;
|
|
63421
63199
|
}
|
|
63422
63200
|
function handleBlockElementUpdated(editor, block, blockData) {
|
|
63423
|
-
assert(logger$
|
|
63201
|
+
assert(logger$1n, isCodeBlock(block), "invalid block type");
|
|
63424
63202
|
const codeData = blockData;
|
|
63425
63203
|
updateCodeBlockElementStyles(editor, block, codeData);
|
|
63426
63204
|
}
|
|
@@ -63612,10 +63390,10 @@ ${codeText}
|
|
|
63612
63390
|
"Shift+Tab": handleShiftTab$1,
|
|
63613
63391
|
"CtrlOrCmd+A": selectCode
|
|
63614
63392
|
};
|
|
63615
|
-
const logger$
|
|
63393
|
+
const logger$1m = getLogger("code-text-decorate");
|
|
63616
63394
|
class CodeTextDecorator {
|
|
63617
63395
|
decorateText(editor, path, blockText) {
|
|
63618
|
-
assert(logger$
|
|
63396
|
+
assert(logger$1m, path.length > 0, "invalid path");
|
|
63619
63397
|
if (path.length === 1) {
|
|
63620
63398
|
return {};
|
|
63621
63399
|
}
|
|
@@ -63640,7 +63418,7 @@ ${codeText}
|
|
|
63640
63418
|
const grammar = getProsmGrammar(codeData.language);
|
|
63641
63419
|
const tokens = Prism__default.default.tokenize(code, grammar);
|
|
63642
63420
|
const tokenToText = (token, attributes) => {
|
|
63643
|
-
assert(logger$
|
|
63421
|
+
assert(logger$1m, token, "no token");
|
|
63644
63422
|
if (typeof token === "string") {
|
|
63645
63423
|
const ret = {
|
|
63646
63424
|
insert: token,
|
|
@@ -63648,7 +63426,7 @@ ${codeText}
|
|
|
63648
63426
|
};
|
|
63649
63427
|
return [ret];
|
|
63650
63428
|
}
|
|
63651
|
-
assert(logger$
|
|
63429
|
+
assert(logger$1m, token instanceof Prism__default.default.Token, "invalid token type");
|
|
63652
63430
|
const content = token.content;
|
|
63653
63431
|
const newAttributes = cloneDeep__default.default(attributes);
|
|
63654
63432
|
newAttributes[`style-code-${token.type}`] = true;
|
|
@@ -63664,18 +63442,18 @@ ${codeText}
|
|
|
63664
63442
|
const ret = tokens2.map((t2) => tokenToText(t2, newAttributes)).flat();
|
|
63665
63443
|
return ret;
|
|
63666
63444
|
}
|
|
63667
|
-
assert(logger$
|
|
63445
|
+
assert(logger$1m, content instanceof Prism__default.default.Token, "invalid token");
|
|
63668
63446
|
return tokenToText(content, newAttributes);
|
|
63669
63447
|
};
|
|
63670
63448
|
const ops = tokens.map((token) => tokenToText(token, {}));
|
|
63671
63449
|
const newText = ops.flat();
|
|
63672
|
-
assert(logger$
|
|
63450
|
+
assert(logger$1m, getTextLength(newText) === getTextLength(text2), "failed to highlight code, text length mismatch");
|
|
63673
63451
|
return {
|
|
63674
63452
|
text: newText
|
|
63675
63453
|
};
|
|
63676
63454
|
}
|
|
63677
63455
|
}
|
|
63678
|
-
const zhCN$
|
|
63456
|
+
const zhCN$p = {
|
|
63679
63457
|
code: {
|
|
63680
63458
|
title: "\u4EE3\u7801",
|
|
63681
63459
|
abstract: "\u4EE3\u7801",
|
|
@@ -63687,7 +63465,7 @@ ${codeText}
|
|
|
63687
63465
|
plainText: "Plain Text"
|
|
63688
63466
|
}
|
|
63689
63467
|
};
|
|
63690
|
-
const enUS$
|
|
63468
|
+
const enUS$p = {
|
|
63691
63469
|
code: {
|
|
63692
63470
|
title: "Code",
|
|
63693
63471
|
abstract: "Code",
|
|
@@ -63699,7 +63477,7 @@ ${codeText}
|
|
|
63699
63477
|
plainText: "Plain Text"
|
|
63700
63478
|
}
|
|
63701
63479
|
};
|
|
63702
|
-
const jaJP$
|
|
63480
|
+
const jaJP$p = {
|
|
63703
63481
|
code: {
|
|
63704
63482
|
title: "\u30B3\u30FC\u30C9",
|
|
63705
63483
|
abstract: "\u30B3\u30FC\u30C9",
|
|
@@ -63712,9 +63490,9 @@ ${codeText}
|
|
|
63712
63490
|
}
|
|
63713
63491
|
};
|
|
63714
63492
|
i18n$1.mergeLang({
|
|
63715
|
-
"zh-CN": zhCN$
|
|
63716
|
-
"en-US": enUS$
|
|
63717
|
-
"ja-JP": jaJP$
|
|
63493
|
+
"zh-CN": zhCN$p,
|
|
63494
|
+
"en-US": enUS$p,
|
|
63495
|
+
"ja-JP": jaJP$p
|
|
63718
63496
|
});
|
|
63719
63497
|
function convertToTable(editor, containerId, blockIndex, offset) {
|
|
63720
63498
|
const block = editor.getBlockByIndex(containerId, blockIndex);
|
|
@@ -63975,7 +63753,7 @@ ${codeText}
|
|
|
63975
63753
|
}
|
|
63976
63754
|
return false;
|
|
63977
63755
|
}
|
|
63978
|
-
const logger$
|
|
63756
|
+
const logger$1l = getLogger("match-text-style");
|
|
63979
63757
|
function matchTextPair(text2, find) {
|
|
63980
63758
|
if (text2.length < find.length * 2 + 1) {
|
|
63981
63759
|
return -1;
|
|
@@ -64045,7 +63823,7 @@ ${codeText}
|
|
|
64045
63823
|
editor.insertBoxToBlock(block, start, boxData);
|
|
64046
63824
|
});
|
|
64047
63825
|
} catch (err) {
|
|
64048
|
-
logger$
|
|
63826
|
+
logger$1l.warn(`failed to convert to box, ${err.message}`);
|
|
64049
63827
|
continue;
|
|
64050
63828
|
}
|
|
64051
63829
|
}
|
|
@@ -64108,7 +63886,7 @@ ${codeText}
|
|
|
64108
63886
|
return false;
|
|
64109
63887
|
}
|
|
64110
63888
|
}
|
|
64111
|
-
const enUS$
|
|
63889
|
+
const enUS$o = {
|
|
64112
63890
|
placeholder: {
|
|
64113
63891
|
default: "Type / for commands",
|
|
64114
63892
|
heading: "Heading {heading}",
|
|
@@ -64119,7 +63897,7 @@ ${codeText}
|
|
|
64119
63897
|
mobileDefault: "Type to add content"
|
|
64120
63898
|
}
|
|
64121
63899
|
};
|
|
64122
|
-
const zhCN$
|
|
63900
|
+
const zhCN$o = {
|
|
64123
63901
|
placeholder: {
|
|
64124
63902
|
default: "\u8F93\u5165\u300C/\u300D\u5FEB\u901F\u63D2\u5165",
|
|
64125
63903
|
heading: "\u6807\u9898{heading}",
|
|
@@ -64130,7 +63908,7 @@ ${codeText}
|
|
|
64130
63908
|
mobileDefault: "\u8F93\u5165\u4EE5\u6DFB\u52A0\u5185\u5BB9"
|
|
64131
63909
|
}
|
|
64132
63910
|
};
|
|
64133
|
-
const jaJP$
|
|
63911
|
+
const jaJP$o = {
|
|
64134
63912
|
placeholder: {
|
|
64135
63913
|
default: "\u300C/\u300D\u3092\u5165\u529B\u3057\u3066\u7D20\u65E9\u304F\u633F\u5165\u3059\u308B",
|
|
64136
63914
|
heading: "\u898B\u51FA\u3057{heading}",
|
|
@@ -64142,9 +63920,9 @@ ${codeText}
|
|
|
64142
63920
|
}
|
|
64143
63921
|
};
|
|
64144
63922
|
const langs$1 = {
|
|
64145
|
-
"en-US": enUS$
|
|
64146
|
-
"zh-CN": zhCN$
|
|
64147
|
-
"ja-JP": jaJP$
|
|
63923
|
+
"en-US": enUS$o,
|
|
63924
|
+
"zh-CN": zhCN$o,
|
|
63925
|
+
"ja-JP": jaJP$o
|
|
64148
63926
|
};
|
|
64149
63927
|
i18n$1.mergeLang(langs$1);
|
|
64150
63928
|
function isEmptyTextBlockWithoutCompositionText(editor, block) {
|
|
@@ -64311,7 +64089,7 @@ ${codeText}
|
|
|
64311
64089
|
}
|
|
64312
64090
|
return false;
|
|
64313
64091
|
}
|
|
64314
|
-
const logger$
|
|
64092
|
+
const logger$1k = getLogger("enforce-title");
|
|
64315
64093
|
class EnforceWithDocumentTitleHandler {
|
|
64316
64094
|
constructor(editor, options = {
|
|
64317
64095
|
headingLevel: 1
|
|
@@ -64383,7 +64161,7 @@ ${codeText}
|
|
|
64383
64161
|
var _a, _b;
|
|
64384
64162
|
try {
|
|
64385
64163
|
const blocks = editor.doc.getContainerBlocks(getContainerId(editor.rootContainer));
|
|
64386
|
-
assert(logger$
|
|
64164
|
+
assert(logger$1k, blocks.length > 0, "root container is empty");
|
|
64387
64165
|
const firstBlock = blocks[0];
|
|
64388
64166
|
if (firstBlock.type !== "text" && !this.options.hideTitle) {
|
|
64389
64167
|
const blockData = createTextBlockData("", { heading: (_a = this.options.headingLevel) != null ? _a : 1 });
|
|
@@ -64392,7 +64170,7 @@ ${codeText}
|
|
|
64392
64170
|
return;
|
|
64393
64171
|
}
|
|
64394
64172
|
if (!this.options.hideTitle) {
|
|
64395
|
-
assert(logger$
|
|
64173
|
+
assert(logger$1k, firstBlock.text, "invalid text block");
|
|
64396
64174
|
const block = editor.getBlockById(firstBlock.id);
|
|
64397
64175
|
if (hasAttributes(firstBlock.text) || firstBlock.quoted || firstBlock.heading !== this.options.headingLevel) {
|
|
64398
64176
|
const text2 = editor.getBlockString(block);
|
|
@@ -64477,7 +64255,7 @@ ${codeText}
|
|
|
64477
64255
|
});
|
|
64478
64256
|
return orgDataUrl;
|
|
64479
64257
|
}
|
|
64480
|
-
const logger$
|
|
64258
|
+
const logger$1j = getLogger("drag-preview-image");
|
|
64481
64259
|
class DragPreviewImage {
|
|
64482
64260
|
constructor(editor) {
|
|
64483
64261
|
__publicField(this, "startPosition", null);
|
|
@@ -64485,7 +64263,7 @@ ${codeText}
|
|
|
64485
64263
|
__publicField(this, "handleDragStart", async (e2, preview) => {
|
|
64486
64264
|
var _a, _b, _c, _d, _e, _f;
|
|
64487
64265
|
const target = e2.target;
|
|
64488
|
-
assert(logger$
|
|
64266
|
+
assert(logger$1j, target instanceof Element, `Invalid Drag target:${target}`);
|
|
64489
64267
|
const { x: startX, y: startY } = e2;
|
|
64490
64268
|
this.startPosition = {
|
|
64491
64269
|
x: startX,
|
|
@@ -64571,7 +64349,7 @@ ${codeText}
|
|
|
64571
64349
|
}
|
|
64572
64350
|
return block;
|
|
64573
64351
|
}
|
|
64574
|
-
const logger$
|
|
64352
|
+
const logger$1i = getLogger("block-menu-drag-handler");
|
|
64575
64353
|
function createDragEventFromMouseEvent$2(event, type) {
|
|
64576
64354
|
const dragEvent = new DragEvent(type, {
|
|
64577
64355
|
bubbles: true,
|
|
@@ -64592,7 +64370,7 @@ ${codeText}
|
|
|
64592
64370
|
__publicField(this, "oldPos", { x: 0, y: 0 });
|
|
64593
64371
|
__publicField(this, "handleMouseDown", (event) => {
|
|
64594
64372
|
const block = this.button.blockMenu.currentBlock;
|
|
64595
|
-
assert(logger$
|
|
64373
|
+
assert(logger$1i, block, "no dragged block");
|
|
64596
64374
|
if (event.button !== 0) {
|
|
64597
64375
|
return;
|
|
64598
64376
|
}
|
|
@@ -64620,7 +64398,7 @@ ${codeText}
|
|
|
64620
64398
|
});
|
|
64621
64399
|
}
|
|
64622
64400
|
const block = this.button.blockMenu.currentBlock;
|
|
64623
|
-
assert(logger$
|
|
64401
|
+
assert(logger$1i, block, "no dragged block");
|
|
64624
64402
|
(_b = (_a = getBlockClass(this.editor, block)).notify) == null ? void 0 : _b.call(_a, this.editor, "beginDrag");
|
|
64625
64403
|
const dragEvent = createDragEventFromMouseEvent$2(event, "dragstart");
|
|
64626
64404
|
registerStandardDraggedObject(this.editor, dragEvent, block);
|
|
@@ -64640,7 +64418,7 @@ ${codeText}
|
|
|
64640
64418
|
this.handleDragStart(event);
|
|
64641
64419
|
}
|
|
64642
64420
|
this.oldPos = { x, y };
|
|
64643
|
-
assert(logger$
|
|
64421
|
+
assert(logger$1i, target instanceof Element, "target is invalid");
|
|
64644
64422
|
this.dragPreview.handleDrag(event);
|
|
64645
64423
|
const dragEvent = createDragEventFromMouseEvent$2(event, "dragover");
|
|
64646
64424
|
this.editor.contentElement.dispatchEvent(dragEvent);
|
|
@@ -64648,7 +64426,7 @@ ${codeText}
|
|
|
64648
64426
|
__publicField(this, "handleDragEnd", (event) => {
|
|
64649
64427
|
var _a;
|
|
64650
64428
|
const block = this.button.blockMenu.currentBlock;
|
|
64651
|
-
assert(logger$
|
|
64429
|
+
assert(logger$1i, block, "no dragged block");
|
|
64652
64430
|
window.isDragging = false;
|
|
64653
64431
|
this.dragPreview.handleDragEnd();
|
|
64654
64432
|
(_a = this.autoScroll) == null ? void 0 : _a.inactive();
|
|
@@ -64871,7 +64649,7 @@ ${codeText}
|
|
|
64871
64649
|
this.rootButton.destroy();
|
|
64872
64650
|
}
|
|
64873
64651
|
}
|
|
64874
|
-
const zhCN$
|
|
64652
|
+
const zhCN$n = {
|
|
64875
64653
|
blockMenu: {
|
|
64876
64654
|
section: {
|
|
64877
64655
|
basics: "\u57FA\u7840",
|
|
@@ -64895,7 +64673,7 @@ ${codeText}
|
|
|
64895
64673
|
}
|
|
64896
64674
|
}
|
|
64897
64675
|
};
|
|
64898
|
-
const enUS$
|
|
64676
|
+
const enUS$n = {
|
|
64899
64677
|
blockMenu: {
|
|
64900
64678
|
section: {
|
|
64901
64679
|
basics: "Basic",
|
|
@@ -64919,7 +64697,7 @@ ${codeText}
|
|
|
64919
64697
|
}
|
|
64920
64698
|
}
|
|
64921
64699
|
};
|
|
64922
|
-
const jaJP$
|
|
64700
|
+
const jaJP$n = {
|
|
64923
64701
|
blockMenu: {
|
|
64924
64702
|
section: {
|
|
64925
64703
|
basics: "\u4E00\u822C",
|
|
@@ -64944,9 +64722,9 @@ ${codeText}
|
|
|
64944
64722
|
}
|
|
64945
64723
|
};
|
|
64946
64724
|
i18n$1.mergeLang({
|
|
64947
|
-
"zh-CN": zhCN$
|
|
64948
|
-
"en-US": enUS$
|
|
64949
|
-
"ja-JP": jaJP$
|
|
64725
|
+
"zh-CN": zhCN$n,
|
|
64726
|
+
"en-US": enUS$n,
|
|
64727
|
+
"ja-JP": jaJP$n
|
|
64950
64728
|
});
|
|
64951
64729
|
const style$6 = "";
|
|
64952
64730
|
class DragData {
|
|
@@ -65026,7 +64804,7 @@ ${codeText}
|
|
|
65026
64804
|
function clearDraggedObject(editor) {
|
|
65027
64805
|
getDragData(editor).clearData();
|
|
65028
64806
|
}
|
|
65029
|
-
const logger$
|
|
64807
|
+
const logger$1h = getLogger("find-drop-target");
|
|
65030
64808
|
function childContainerFromPoint(x, y) {
|
|
65031
64809
|
const elem = getElementFromPoint(x, y);
|
|
65032
64810
|
if (!elem) {
|
|
@@ -65139,13 +64917,13 @@ ${codeText}
|
|
|
65139
64917
|
return true;
|
|
65140
64918
|
}
|
|
65141
64919
|
const parentBlock = getParentBlock(container);
|
|
65142
|
-
assert(logger$
|
|
64920
|
+
assert(logger$1h, parentBlock, "no parent block");
|
|
65143
64921
|
if (!editor.isBlockWritable(parentBlock)) {
|
|
65144
64922
|
return false;
|
|
65145
64923
|
}
|
|
65146
64924
|
return canInsertAsSibling(editor, parentBlock);
|
|
65147
64925
|
}
|
|
65148
|
-
const logger$
|
|
64926
|
+
const logger$1g = getLogger("drop-target");
|
|
65149
64927
|
function getEmbedClassByFile(editor, file2) {
|
|
65150
64928
|
let embedClass = {};
|
|
65151
64929
|
if (/image/.test(file2.type)) {
|
|
@@ -65155,7 +64933,7 @@ ${codeText}
|
|
|
65155
64933
|
} else if (/video/.test(file2.type)) {
|
|
65156
64934
|
embedClass = editor.editorEmbeds.getEmbedClass("video");
|
|
65157
64935
|
}
|
|
65158
|
-
assert(logger$
|
|
64936
|
+
assert(logger$1g, embedClass, `unSupport file type ${file2.type}`);
|
|
65159
64937
|
return embedClass;
|
|
65160
64938
|
}
|
|
65161
64939
|
async function patchInsertFile(editor, files, containerId, blockIndex) {
|
|
@@ -65902,7 +65680,7 @@ ${codeText}
|
|
|
65902
65680
|
}
|
|
65903
65681
|
}
|
|
65904
65682
|
}
|
|
65905
|
-
const zhCN$
|
|
65683
|
+
const zhCN$m = {
|
|
65906
65684
|
image: {
|
|
65907
65685
|
title: "\u56FE\u7247",
|
|
65908
65686
|
upload: {
|
|
@@ -65918,7 +65696,7 @@ ${codeText}
|
|
|
65918
65696
|
abstract: "\u56FE\u7247"
|
|
65919
65697
|
}
|
|
65920
65698
|
};
|
|
65921
|
-
const enUS$
|
|
65699
|
+
const enUS$m = {
|
|
65922
65700
|
image: {
|
|
65923
65701
|
title: "Image",
|
|
65924
65702
|
upload: {
|
|
@@ -65934,7 +65712,7 @@ ${codeText}
|
|
|
65934
65712
|
abstract: "Image"
|
|
65935
65713
|
}
|
|
65936
65714
|
};
|
|
65937
|
-
const jaJP$
|
|
65715
|
+
const jaJP$m = {
|
|
65938
65716
|
image: {
|
|
65939
65717
|
title: "\u753B\u50CF",
|
|
65940
65718
|
upload: {
|
|
@@ -65951,9 +65729,9 @@ ${codeText}
|
|
|
65951
65729
|
}
|
|
65952
65730
|
};
|
|
65953
65731
|
i18n$1.mergeLang({
|
|
65954
|
-
"zh-CN": zhCN$
|
|
65955
|
-
"en-US": enUS$
|
|
65956
|
-
"ja-JP": jaJP$
|
|
65732
|
+
"zh-CN": zhCN$m,
|
|
65733
|
+
"en-US": enUS$m,
|
|
65734
|
+
"ja-JP": jaJP$m
|
|
65957
65735
|
});
|
|
65958
65736
|
function convertToImage(editor, containerId, blockIndex, offset) {
|
|
65959
65737
|
const block = editor.getBlockByIndex(containerId, blockIndex);
|
|
@@ -66007,7 +65785,7 @@ ${codeText}
|
|
|
66007
65785
|
return false;
|
|
66008
65786
|
}
|
|
66009
65787
|
}
|
|
66010
|
-
const logger$
|
|
65788
|
+
const logger$1f = getLogger("copy-image");
|
|
66011
65789
|
function getImageClipboardData(editor, img, imageObject, index2) {
|
|
66012
65790
|
const imageData = imageObject.getImages()[index2];
|
|
66013
65791
|
const widthPercent = imageObject.getImages().length === 1 ? imageObject.getWidthPercent() : imageData.flex * 100;
|
|
@@ -66048,7 +65826,7 @@ ${codeText}
|
|
|
66048
65826
|
});
|
|
66049
65827
|
clipboardData["image/png"] = fileBlob;
|
|
66050
65828
|
} catch (error2) {
|
|
66051
|
-
logger$
|
|
65829
|
+
logger$1f.error(error2);
|
|
66052
65830
|
}
|
|
66053
65831
|
addMetaToDoc(editor, doc2);
|
|
66054
65832
|
const url = editor.doc.buildResourceUrl(imageData.src, { withToken: true });
|
|
@@ -66321,6 +66099,195 @@ ${codeText}
|
|
|
66321
66099
|
}
|
|
66322
66100
|
return getDragInsertPos(editor, block, images, x);
|
|
66323
66101
|
}
|
|
66102
|
+
const zhCN$l = {
|
|
66103
|
+
embedProperties: {
|
|
66104
|
+
edit: "\u7F16\u8F91",
|
|
66105
|
+
addComment: "\u6DFB\u52A0\u6279\u6CE8"
|
|
66106
|
+
}
|
|
66107
|
+
};
|
|
66108
|
+
const enUS$l = {
|
|
66109
|
+
embedProperties: {
|
|
66110
|
+
edit: "Edit",
|
|
66111
|
+
addComment: "Add annotation"
|
|
66112
|
+
}
|
|
66113
|
+
};
|
|
66114
|
+
const jaJP$l = {
|
|
66115
|
+
embedProperties: {
|
|
66116
|
+
edit: "\u7DE8\u96C6",
|
|
66117
|
+
addComment: "\u6CE8\u91C8\u3092\u8FFD\u52A0"
|
|
66118
|
+
}
|
|
66119
|
+
};
|
|
66120
|
+
i18n$1.mergeLang({
|
|
66121
|
+
"zh-CN": zhCN$l,
|
|
66122
|
+
"en-US": enUS$l,
|
|
66123
|
+
"ja-JP": jaJP$l
|
|
66124
|
+
});
|
|
66125
|
+
const logger$1e = getLogger("embed-block-properties");
|
|
66126
|
+
function addCommentToBlock(editor, block) {
|
|
66127
|
+
var _a;
|
|
66128
|
+
for (const hook of editor.blockHooks) {
|
|
66129
|
+
const commands = (_a = hook.commands) == null ? void 0 : _a.call(hook, editor, block, null);
|
|
66130
|
+
if (!commands) {
|
|
66131
|
+
continue;
|
|
66132
|
+
}
|
|
66133
|
+
if (commands.group === "block-comment-actions") {
|
|
66134
|
+
const command = commands.commands[0];
|
|
66135
|
+
if (!command) {
|
|
66136
|
+
continue;
|
|
66137
|
+
}
|
|
66138
|
+
commands.executeCommand(editor, block, commands.commands[0], null);
|
|
66139
|
+
return true;
|
|
66140
|
+
}
|
|
66141
|
+
}
|
|
66142
|
+
return false;
|
|
66143
|
+
}
|
|
66144
|
+
class StandardEmbedBlockCommands {
|
|
66145
|
+
constructor(editor, block, properties) {
|
|
66146
|
+
__publicField(this, "group", "hovering-toolbar");
|
|
66147
|
+
__publicField(this, "_commands", [{
|
|
66148
|
+
id: "edit",
|
|
66149
|
+
name: i18n$1.t("embedProperties.edit"),
|
|
66150
|
+
icon: EditIcon
|
|
66151
|
+
}, {
|
|
66152
|
+
id: "separator",
|
|
66153
|
+
name: "",
|
|
66154
|
+
type: "separator"
|
|
66155
|
+
}]);
|
|
66156
|
+
this.editor = editor;
|
|
66157
|
+
this.block = block;
|
|
66158
|
+
this.properties = properties;
|
|
66159
|
+
}
|
|
66160
|
+
get commands() {
|
|
66161
|
+
var _a, _b, _c, _d;
|
|
66162
|
+
if (clientType.isMobile) {
|
|
66163
|
+
return [];
|
|
66164
|
+
}
|
|
66165
|
+
let standardCommands = [];
|
|
66166
|
+
if ((_a = this.properties) == null ? void 0 : _a.presetIds) {
|
|
66167
|
+
this.properties.presetIds.forEach((id) => {
|
|
66168
|
+
const command = this._commands.find((item) => item.id === id);
|
|
66169
|
+
if (command) {
|
|
66170
|
+
standardCommands.push(command);
|
|
66171
|
+
}
|
|
66172
|
+
});
|
|
66173
|
+
}
|
|
66174
|
+
if (((_b = this.properties) == null ? void 0 : _b.extCommands) && Array.isArray(this.properties.extCommands)) {
|
|
66175
|
+
standardCommands.push(...this.properties.extCommands);
|
|
66176
|
+
}
|
|
66177
|
+
if (typeof ((_c = this.properties) == null ? void 0 : _c.extCommands) === "function") {
|
|
66178
|
+
standardCommands.push(...this.properties.extCommands(this.editor, this.block));
|
|
66179
|
+
}
|
|
66180
|
+
if ((_d = this.properties) == null ? void 0 : _d.extIds) {
|
|
66181
|
+
this.properties.extIds.forEach((id) => {
|
|
66182
|
+
const command = this._commands.find((item) => item.id === id);
|
|
66183
|
+
if (command) {
|
|
66184
|
+
standardCommands.push(command);
|
|
66185
|
+
}
|
|
66186
|
+
});
|
|
66187
|
+
}
|
|
66188
|
+
const { enableComments = true } = this.editor.options;
|
|
66189
|
+
if (!enableComments || this.editor.readonly) {
|
|
66190
|
+
standardCommands = standardCommands.filter((command) => command.id !== "add-comment");
|
|
66191
|
+
}
|
|
66192
|
+
if (this.editor.readonly) {
|
|
66193
|
+
standardCommands = standardCommands.filter((command) => command.id !== "edit");
|
|
66194
|
+
}
|
|
66195
|
+
standardCommands.forEach((item) => {
|
|
66196
|
+
if (item.id === "add-comment" || item.id === "edit") {
|
|
66197
|
+
item.states = this.editor.isBlockWritable(this.block) ? [] : ["disabled"];
|
|
66198
|
+
}
|
|
66199
|
+
});
|
|
66200
|
+
return standardCommands;
|
|
66201
|
+
}
|
|
66202
|
+
executeCommand(editor, block, item) {
|
|
66203
|
+
var _a, _b;
|
|
66204
|
+
if ((_b = (_a = this.properties) == null ? void 0 : _a.handleExecuteCommand) == null ? void 0 : _b.call(_a, editor, block, item)) {
|
|
66205
|
+
return;
|
|
66206
|
+
}
|
|
66207
|
+
if (item.id === "add-comment") {
|
|
66208
|
+
if (!addCommentToBlock(editor, block)) {
|
|
66209
|
+
logger$1e.error("failed to add comment to block");
|
|
66210
|
+
}
|
|
66211
|
+
return;
|
|
66212
|
+
}
|
|
66213
|
+
logger$1e.error(`unknown command: ${JSON.stringify(item)}`);
|
|
66214
|
+
}
|
|
66215
|
+
}
|
|
66216
|
+
function getStandardEmbedBlockProperties(editor, block, properties) {
|
|
66217
|
+
return {
|
|
66218
|
+
blockCommands: {
|
|
66219
|
+
"hovering-toolbar": new StandardEmbedBlockCommands(editor, block, properties)
|
|
66220
|
+
}
|
|
66221
|
+
};
|
|
66222
|
+
}
|
|
66223
|
+
class EmbedBlockResizer {
|
|
66224
|
+
constructor(editor) {
|
|
66225
|
+
__publicField(this, "resizing", false);
|
|
66226
|
+
__publicField(this, "blockResizer");
|
|
66227
|
+
__publicField(this, "handleResized", () => {
|
|
66228
|
+
this.resizing = false;
|
|
66229
|
+
});
|
|
66230
|
+
__publicField(this, "handleResizing", (resizer, rect) => {
|
|
66231
|
+
var _a, _b;
|
|
66232
|
+
this.resizing = true;
|
|
66233
|
+
const block = resizer.getBlock();
|
|
66234
|
+
if (block) {
|
|
66235
|
+
if (((_b = (_a = getBlockClass(this.editor, block)).notify) == null ? void 0 : _b.call(_a, this.editor, "resize", { block, rect })) === true) {
|
|
66236
|
+
return;
|
|
66237
|
+
}
|
|
66238
|
+
const blockType = getEmbedType(block);
|
|
66239
|
+
const { adjustableMinHeight } = getEmbedClassByType(this.editor, blockType);
|
|
66240
|
+
const height = Math.max(rect.height, adjustableMinHeight || 100);
|
|
66241
|
+
const oldData = this.editor.getBlockData(block);
|
|
66242
|
+
const oldEmbedData = oldData.embedData;
|
|
66243
|
+
const newEmbedData = {
|
|
66244
|
+
...oldEmbedData,
|
|
66245
|
+
height
|
|
66246
|
+
};
|
|
66247
|
+
this.editor.updateEmbedData(block, newEmbedData);
|
|
66248
|
+
}
|
|
66249
|
+
});
|
|
66250
|
+
__publicField(this, "handleHoveringBlockChange", (block, old) => {
|
|
66251
|
+
if (this.resizing) {
|
|
66252
|
+
return;
|
|
66253
|
+
}
|
|
66254
|
+
if (old && isEmbedBlock(old) && hasClass(old, "resizable")) {
|
|
66255
|
+
this.disableResizer();
|
|
66256
|
+
}
|
|
66257
|
+
if (block && isEmbedBlock(block) && hasClass(block, "resizable") && this.editor.isBlockWritable(block)) {
|
|
66258
|
+
this.tryEnableResizer(block);
|
|
66259
|
+
}
|
|
66260
|
+
});
|
|
66261
|
+
__publicField(this, "handleEditorResize", () => {
|
|
66262
|
+
this.blockResizer.updateResizer();
|
|
66263
|
+
});
|
|
66264
|
+
this.editor = editor;
|
|
66265
|
+
OnesEditorHoveringBlock.get(editor).addListener("change", this.handleHoveringBlockChange);
|
|
66266
|
+
this.blockResizer = new BlockResizer(this.editor, {
|
|
66267
|
+
resize: ["bottom"]
|
|
66268
|
+
});
|
|
66269
|
+
this.blockResizer.addListener("resizing", this.handleResizing);
|
|
66270
|
+
this.blockResizer.addListener("resized", this.handleResized);
|
|
66271
|
+
this.editor.addListener("resize", this.handleEditorResize);
|
|
66272
|
+
}
|
|
66273
|
+
destroy() {
|
|
66274
|
+
this.editor.removeListener("resize", this.handleEditorResize);
|
|
66275
|
+
OnesEditorHoveringBlock.get(this.editor).removeListener("change", this.handleHoveringBlockChange);
|
|
66276
|
+
}
|
|
66277
|
+
tryEnableResizer(block) {
|
|
66278
|
+
this.blockResizer.enableResize(block);
|
|
66279
|
+
}
|
|
66280
|
+
disableResizer() {
|
|
66281
|
+
this.blockResizer.disableResize();
|
|
66282
|
+
}
|
|
66283
|
+
static get(editor) {
|
|
66284
|
+
return editor.addCustom("EmbedBlockResizer", () => new EmbedBlockResizer(editor));
|
|
66285
|
+
}
|
|
66286
|
+
static register(editor, block) {
|
|
66287
|
+
addClass(block, "resizable");
|
|
66288
|
+
return editor.addCustom("EmbedBlockResizer", () => new EmbedBlockResizer(editor));
|
|
66289
|
+
}
|
|
66290
|
+
}
|
|
66324
66291
|
class ImageHoveringToolbarCommands$1 {
|
|
66325
66292
|
constructor(editor, block) {
|
|
66326
66293
|
__publicField(this, "group", "hovering-toolbar");
|
|
@@ -66392,7 +66359,7 @@ ${codeText}
|
|
|
66392
66359
|
executeCommand(editor, block, item) {
|
|
66393
66360
|
switch (item.id) {
|
|
66394
66361
|
case "addComment":
|
|
66395
|
-
addCommentToBlock
|
|
66362
|
+
addCommentToBlock(editor, block);
|
|
66396
66363
|
break;
|
|
66397
66364
|
case "left":
|
|
66398
66365
|
case "center":
|
|
@@ -67772,7 +67739,7 @@ ${codeText}
|
|
|
67772
67739
|
this.editor.addListener("selectionChanged", this.handleSelectionChanged);
|
|
67773
67740
|
this.editor.addListener("resize", this.handleEditorResize);
|
|
67774
67741
|
this.editor.addListener("docChanged", this.handleDocChanged);
|
|
67775
|
-
this.editor.
|
|
67742
|
+
this.editor.scrollContainer.addEventListener("wheel", this.handleScroll, { passive: false });
|
|
67776
67743
|
this.items.forEach((item) => item.addListener("resize", this.handleItemResize));
|
|
67777
67744
|
this.groupItemHandlers = new CommentGroupItemHandlers(this, commentsProvider);
|
|
67778
67745
|
document.addEventListener("click", this.handleDocumentClick);
|
|
@@ -67781,6 +67748,7 @@ ${codeText}
|
|
|
67781
67748
|
this.editor.removeListener("selectionChanged", this.handleSelectionChanged);
|
|
67782
67749
|
this.editor.removeListener("resize", this.handleEditorResize);
|
|
67783
67750
|
this.editor.removeListener("docChanged", this.handleDocChanged);
|
|
67751
|
+
this.editor.scrollContainer.removeEventListener("wheel", this.handleScroll);
|
|
67784
67752
|
super.destroy();
|
|
67785
67753
|
this.unbindEvents();
|
|
67786
67754
|
this.removeAllListeners();
|
|
@@ -68655,7 +68623,7 @@ ${codeText}
|
|
|
68655
68623
|
const types2 = ["table", "layout"];
|
|
68656
68624
|
if (types2.includes(getBlockType(block))) {
|
|
68657
68625
|
editor.selection.setSelection(createSimpleBlockPosition(block, 0, "home"), createSimpleBlockPosition(block, 0, "end"));
|
|
68658
|
-
comment = addCommentToBlock(editor, block, this.provider);
|
|
68626
|
+
comment = addCommentToBlock$1(editor, block, this.provider);
|
|
68659
68627
|
}
|
|
68660
68628
|
}
|
|
68661
68629
|
comment = comment != null ? comment : addCommentToTextBlocks(editor, range, this.provider);
|
|
@@ -68676,7 +68644,7 @@ ${codeText}
|
|
|
68676
68644
|
try {
|
|
68677
68645
|
this.editorComments.showCommentList();
|
|
68678
68646
|
const block2 = editor.getBlockById(blockId);
|
|
68679
|
-
addCommentToBlock(editor, block2, this.provider);
|
|
68647
|
+
addCommentToBlock$1(editor, block2, this.provider);
|
|
68680
68648
|
} catch (err) {
|
|
68681
68649
|
logger$13.error(`failed to execute block command: ${JSON.stringify(err)}`);
|
|
68682
68650
|
}
|
|
@@ -69012,11 +68980,11 @@ ${codeText}
|
|
|
69012
68980
|
const { containerId } = path[path.length - 1];
|
|
69013
68981
|
const targetBlock = getParentBlock(getContainerById(editor, containerId));
|
|
69014
68982
|
if (targetBlock && getBlockType(targetBlock) === "code") {
|
|
69015
|
-
addCommentToBlock(editor, targetBlock, editorComments.commentProvider);
|
|
68983
|
+
addCommentToBlock$1(editor, targetBlock, editorComments.commentProvider);
|
|
69016
68984
|
return;
|
|
69017
68985
|
}
|
|
69018
68986
|
}
|
|
69019
|
-
addCommentToBlock(editor, block, editorComments.commentProvider);
|
|
68987
|
+
addCommentToBlock$1(editor, block, editorComments.commentProvider);
|
|
69020
68988
|
return;
|
|
69021
68989
|
}
|
|
69022
68990
|
const selectedBlocks = getAllSelectedBlocks(editor, { simpleBlockOnly: true });
|
|
@@ -69253,7 +69221,7 @@ ${codeText}
|
|
|
69253
69221
|
editor2.selection.selectBlock(block, 0, getBlockTextLength$6(editor2, block), { noScroll: true });
|
|
69254
69222
|
const editorComments = editor2.getCustom("editor-comments");
|
|
69255
69223
|
editorComments.showCommentList();
|
|
69256
|
-
addCommentToBlock(editor2, block, editorComments.commentProvider);
|
|
69224
|
+
addCommentToBlock$1(editor2, block, editorComments.commentProvider);
|
|
69257
69225
|
}
|
|
69258
69226
|
}
|
|
69259
69227
|
};
|
|
@@ -69287,7 +69255,7 @@ ${codeText}
|
|
|
69287
69255
|
const selectedBlock = range.getSelectedBlocks()[0];
|
|
69288
69256
|
if (selectedBlock) {
|
|
69289
69257
|
const editorComments = editor.getCustom("editor-comments");
|
|
69290
|
-
addCommentToBlock(editor, selectedBlock.block, editorComments.commentProvider);
|
|
69258
|
+
addCommentToBlock$1(editor, selectedBlock.block, editorComments.commentProvider);
|
|
69291
69259
|
}
|
|
69292
69260
|
return;
|
|
69293
69261
|
}
|
|
@@ -69595,7 +69563,7 @@ ${codeText}
|
|
|
69595
69563
|
const popover = editor.options.componentsOptions.popover;
|
|
69596
69564
|
this.toolbar = new ManualToolbar([], void 0, {
|
|
69597
69565
|
id: "table-row-column-toolbar",
|
|
69598
|
-
overflowBoundary:
|
|
69566
|
+
overflowBoundary: popover == null ? void 0 : popover.overflowBoundary,
|
|
69599
69567
|
refuseOverflow: true,
|
|
69600
69568
|
tooltipId: this.editor.clientId
|
|
69601
69569
|
});
|
|
@@ -69659,7 +69627,7 @@ ${codeText}
|
|
|
69659
69627
|
modifiers: [{
|
|
69660
69628
|
name: "flip",
|
|
69661
69629
|
options: {
|
|
69662
|
-
boundary:
|
|
69630
|
+
boundary: popover == null ? void 0 : popover.overflowBoundary,
|
|
69663
69631
|
fallbackPlacements: ["left", "right"]
|
|
69664
69632
|
}
|
|
69665
69633
|
}]
|
|
@@ -76548,7 +76516,7 @@ ${content}
|
|
|
76548
76516
|
} else if (item.id === "download") {
|
|
76549
76517
|
downloadFile$1(editor, box);
|
|
76550
76518
|
} else if (item.id === "add-comment") {
|
|
76551
|
-
addCommentToBlock
|
|
76519
|
+
addCommentToBlock(editor, block);
|
|
76552
76520
|
}
|
|
76553
76521
|
}
|
|
76554
76522
|
}
|
|
@@ -76840,7 +76808,7 @@ ${content}
|
|
|
76840
76808
|
} else if (item.id === "download") {
|
|
76841
76809
|
downloadFile(editor, block);
|
|
76842
76810
|
} else if (item.id === "add-comment") {
|
|
76843
|
-
addCommentToBlock
|
|
76811
|
+
addCommentToBlock(editor, block);
|
|
76844
76812
|
}
|
|
76845
76813
|
}
|
|
76846
76814
|
}
|
|
@@ -79598,7 +79566,6 @@ ${content}
|
|
|
79598
79566
|
}
|
|
79599
79567
|
destroy() {
|
|
79600
79568
|
this.editor.doc.unregisterCallback(this);
|
|
79601
|
-
this.removeAllListeners();
|
|
79602
79569
|
}
|
|
79603
79570
|
isHeadingBlock(blockData) {
|
|
79604
79571
|
return !!blockData.heading;
|
|
@@ -80360,22 +80327,22 @@ ${content}
|
|
|
80360
80327
|
const image = createElement("img", ["editor-template-thumb"], imageContaniner);
|
|
80361
80328
|
image.src = imageSrc;
|
|
80362
80329
|
image.style.display = "none";
|
|
80363
|
-
|
|
80330
|
+
image.onerror = () => {
|
|
80364
80331
|
var _a2;
|
|
80365
80332
|
const placeholder2 = (_a2 = options == null ? void 0 : options.placeHolderImageSrc) != null ? _a2 : TEMPLATE_PLACEHOLDER;
|
|
80366
80333
|
if (image.src !== placeholder2) {
|
|
80367
80334
|
image.src = placeholder2;
|
|
80368
80335
|
}
|
|
80369
|
-
}
|
|
80370
|
-
|
|
80336
|
+
};
|
|
80337
|
+
image.onload = () => {
|
|
80371
80338
|
image.style.display = "";
|
|
80372
|
-
}
|
|
80339
|
+
};
|
|
80373
80340
|
const nameDiv = createElement("div", ["editor-template-name"], card);
|
|
80374
80341
|
const span = createElement("span", [], nameDiv, name);
|
|
80375
80342
|
if (options == null ? void 0 : options.showTemplateTitleAttr) {
|
|
80376
80343
|
span.setAttribute("title", name);
|
|
80377
80344
|
}
|
|
80378
|
-
|
|
80345
|
+
card.onclick = () => clickHandler(card);
|
|
80379
80346
|
return card;
|
|
80380
80347
|
}
|
|
80381
80348
|
function getDocThumbImage(editor, template) {
|
|
@@ -86347,7 +86314,7 @@ ${data2.flowchartText}
|
|
|
86347
86314
|
executeCommand(editor, block, item) {
|
|
86348
86315
|
switch (item.id) {
|
|
86349
86316
|
case "addComment":
|
|
86350
|
-
addCommentToBlock
|
|
86317
|
+
addCommentToBlock(editor, block);
|
|
86351
86318
|
break;
|
|
86352
86319
|
case "left":
|
|
86353
86320
|
case "center":
|
|
@@ -88124,14 +88091,12 @@ ${data2.flowchartText}
|
|
|
88124
88091
|
}
|
|
88125
88092
|
}
|
|
88126
88093
|
const logger$1 = getLogger("editor-to-docx");
|
|
88127
|
-
const ERROR_MESSAGE = "editor-to-docx: read image error";
|
|
88128
88094
|
async function readImage(editor, _appId, _docId, _src) {
|
|
88129
88095
|
try {
|
|
88130
88096
|
const url = editor.doc.buildResourceUrl(_src, { withToken: true });
|
|
88131
88097
|
let file2 = await downloadImageToFile$1(url);
|
|
88132
|
-
if (!file2)
|
|
88133
|
-
|
|
88134
|
-
}
|
|
88098
|
+
if (!file2)
|
|
88099
|
+
return [void 0, url];
|
|
88135
88100
|
if (file2.type.indexOf("/svg") !== -1) {
|
|
88136
88101
|
const pngFile = await convertImageFileToPng(file2);
|
|
88137
88102
|
if (pngFile) {
|
|
@@ -88141,7 +88106,7 @@ ${data2.flowchartText}
|
|
|
88141
88106
|
const arrayBuffer = await file2.arrayBuffer();
|
|
88142
88107
|
return [arrayBuffer, url];
|
|
88143
88108
|
} catch (error2) {
|
|
88144
|
-
throw new ExportImageError(error2.message ||
|
|
88109
|
+
throw new ExportImageError(error2.message || "read image error");
|
|
88145
88110
|
}
|
|
88146
88111
|
}
|
|
88147
88112
|
async function getDocByBlock(editor, doc2, block) {
|
|
@@ -88376,7 +88341,13 @@ ${data2.flowchartText}
|
|
|
88376
88341
|
}
|
|
88377
88342
|
}
|
|
88378
88343
|
});
|
|
88379
|
-
editor.version = "2.2.
|
|
88344
|
+
editor.version = "2.2.10-beta.2";
|
|
88345
|
+
if (Logger$2.level === LogLevel.DEBUG) {
|
|
88346
|
+
window.setReauthFail = (fail) => {
|
|
88347
|
+
window.isReauthError = fail;
|
|
88348
|
+
};
|
|
88349
|
+
window.reConnect = (token) => editor.doc.externalDoc.client.connection.reConnect(token);
|
|
88350
|
+
}
|
|
88380
88351
|
return editor;
|
|
88381
88352
|
}
|
|
88382
88353
|
function isDoc(doc2) {
|
|
@@ -88471,7 +88442,7 @@ ${data2.flowchartText}
|
|
|
88471
88442
|
});
|
|
88472
88443
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
88473
88444
|
OnesEditorToolbar.register(editor);
|
|
88474
|
-
editor.version = "2.2.
|
|
88445
|
+
editor.version = "2.2.10-beta.2";
|
|
88475
88446
|
return editor;
|
|
88476
88447
|
}
|
|
88477
88448
|
async function showDocVersions(editor, options, serverUrl) {
|
|
@@ -134314,7 +134285,6 @@ ${data2.flowchartText}
|
|
|
134314
134285
|
exports2.ShareDBLocalDoc = ShareDBLocalDoc;
|
|
134315
134286
|
exports2.ShareDBServer = ShareDBServer;
|
|
134316
134287
|
exports2.SimpleCache = SimpleCache;
|
|
134317
|
-
exports2.StandardBoxCommands = StandardBoxCommands;
|
|
134318
134288
|
exports2.StandardEmbedBlockCommands = StandardEmbedBlockCommands;
|
|
134319
134289
|
exports2.TEXT_STYLE_BACKGROUND_COLOR_PREFIX = TEXT_STYLE_BACKGROUND_COLOR_PREFIX;
|
|
134320
134290
|
exports2.TEXT_STYLE_COLOR_PREFIX = TEXT_STYLE_COLOR_PREFIX;
|
|
@@ -134333,7 +134303,7 @@ ${data2.flowchartText}
|
|
|
134333
134303
|
exports2.addAttribute = addAttribute;
|
|
134334
134304
|
exports2.addClass = addClass;
|
|
134335
134305
|
exports2.addColor = addColor;
|
|
134336
|
-
exports2.addCommentToBlock = addCommentToBlock
|
|
134306
|
+
exports2.addCommentToBlock = addCommentToBlock;
|
|
134337
134307
|
exports2.addDays = addDays;
|
|
134338
134308
|
exports2.addMetaToDoc = addMetaToDoc;
|
|
134339
134309
|
exports2.addMonths = addMonths;
|
|
@@ -134702,7 +134672,6 @@ ${data2.flowchartText}
|
|
|
134702
134672
|
exports2.isFirefox = isFirefox;
|
|
134703
134673
|
exports2.isFirstChildBlockInComplexBlock = isFirstChildBlockInComplexBlock;
|
|
134704
134674
|
exports2.isFullSelectedOneComplexBlock = isFullSelectedOneComplexBlock;
|
|
134705
|
-
exports2.isFunction = isFunction$1;
|
|
134706
134675
|
exports2.isHeadingBlock = isHeadingBlock$1;
|
|
134707
134676
|
exports2.isHighSurrogate = t$7;
|
|
134708
134677
|
exports2.isInBlock = isInBlock;
|