@ones-editor/editor 2.2.26 → 2.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -5100,12 +5100,16 @@ div.editor-root div.editor-content div[data-type=editor-container] div.embed-blo
|
|
|
5100
5100
|
border-radius: 6px;
|
|
5101
5101
|
border: 1px solid #DFE1E5;
|
|
5102
5102
|
padding: 10px;
|
|
5103
|
+
position: relative;
|
|
5103
5104
|
}
|
|
5104
5105
|
div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root::before {
|
|
5105
5106
|
border-radius: 3px;
|
|
5106
5107
|
}
|
|
5107
5108
|
div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root:hover {
|
|
5108
|
-
background-color:
|
|
5109
|
+
background-color: rgb(247, 248, 250);
|
|
5110
|
+
}
|
|
5111
|
+
div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root:hover .file-actions {
|
|
5112
|
+
background-color: rgb(247, 248, 250);
|
|
5109
5113
|
}
|
|
5110
5114
|
div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root:hover .file-actions button {
|
|
5111
5115
|
display: flex;
|
|
@@ -5124,13 +5128,18 @@ div.editor-root div.editor-content div[data-type=editor-container] div.embed-blo
|
|
|
5124
5128
|
display: flex;
|
|
5125
5129
|
flex-direction: row;
|
|
5126
5130
|
align-items: center;
|
|
5127
|
-
white-space: nowrap;
|
|
5128
5131
|
font-size: 14px;
|
|
5129
5132
|
margin-top: 2px;
|
|
5130
5133
|
}
|
|
5131
5134
|
div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name-pre {
|
|
5132
|
-
|
|
5135
|
+
display: -webkit-box;
|
|
5133
5136
|
overflow: hidden;
|
|
5137
|
+
word-break: break-all;
|
|
5138
|
+
-webkit-line-clamp: 1;
|
|
5139
|
+
-webkit-box-orient: vertical;
|
|
5140
|
+
}
|
|
5141
|
+
div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name-suf {
|
|
5142
|
+
white-space: nowrap;
|
|
5134
5143
|
}
|
|
5135
5144
|
div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info {
|
|
5136
5145
|
display: flex;
|
|
@@ -5157,8 +5166,13 @@ div.editor-root div.editor-content div[data-type=editor-container] div.embed-blo
|
|
|
5157
5166
|
flex-shrink: 0;
|
|
5158
5167
|
}
|
|
5159
5168
|
div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions {
|
|
5160
|
-
|
|
5169
|
+
position: absolute;
|
|
5170
|
+
top: 0;
|
|
5171
|
+
right: 0;
|
|
5172
|
+
bottom: 0;
|
|
5161
5173
|
display: flex;
|
|
5174
|
+
align-items: center;
|
|
5175
|
+
justify-content: center;
|
|
5162
5176
|
column-gap: 15px;
|
|
5163
5177
|
margin-right: 10px;
|
|
5164
5178
|
margin-left: 5px;
|
|
@@ -11585,15 +11599,16 @@ var __publicField = (obj, key, value) => {
|
|
|
11585
11599
|
if (!isTextKindBlock(this.editor, block)) {
|
|
11586
11600
|
return;
|
|
11587
11601
|
}
|
|
11602
|
+
const eTarget = event.target;
|
|
11588
11603
|
const box = getParentBox(elem);
|
|
11589
|
-
if (box) {
|
|
11604
|
+
if (box && isChildNode(box, eTarget)) {
|
|
11590
11605
|
const block2 = getParentBlock(box);
|
|
11591
11606
|
assert(logger$4p, block2, "no parent block");
|
|
11592
11607
|
(_b = (_a = this.editor.editorBoxes.getBoxClass(getBoxTypeFromElement(box))) == null ? void 0 : _a.handleClickBox) == null ? void 0 : _b.call(_a, this.editor, box, event);
|
|
11593
11608
|
return;
|
|
11594
11609
|
}
|
|
11595
11610
|
const link2 = elem.closest("span.text.link");
|
|
11596
|
-
if (link2) {
|
|
11611
|
+
if (link2 && isChildNode(link2, eTarget)) {
|
|
11597
11612
|
const children = getTextBlockContentChildren(block);
|
|
11598
11613
|
const index2 = children.indexOf(link2);
|
|
11599
11614
|
if (index2 !== -1) {
|
|
@@ -45880,7 +45895,7 @@ ${codeText}
|
|
|
45880
45895
|
}
|
|
45881
45896
|
function getSizeAsScale(element, num) {
|
|
45882
45897
|
const scale = getElementScale(element);
|
|
45883
|
-
return num / scale;
|
|
45898
|
+
return Math.round(num / scale);
|
|
45884
45899
|
}
|
|
45885
45900
|
function getScrollWrapPaddingSize(scrollWrap) {
|
|
45886
45901
|
const computedStyle = window.getComputedStyle(scrollWrap);
|
|
@@ -45965,7 +45980,7 @@ ${codeText}
|
|
|
45965
45980
|
}
|
|
45966
45981
|
return scrollbarContainer;
|
|
45967
45982
|
}
|
|
45968
|
-
function
|
|
45983
|
+
function resetScrollbarCore(scrollCore, scrollWrap) {
|
|
45969
45984
|
const scrollContainer = getScrollContainer(scrollWrap);
|
|
45970
45985
|
const scrollbarContainer = getScrollbarContainer(scrollContainer);
|
|
45971
45986
|
const { scrollWidth, clientWidth } = getElementScrollSize(scrollContainer);
|
|
@@ -45976,9 +45991,12 @@ ${codeText}
|
|
|
45976
45991
|
fixScrollWrapLeftBoundary(scrollCore, scrollContainer);
|
|
45977
45992
|
const overflowWidth = scrollWidth - clientWidth;
|
|
45978
45993
|
assert(logger$2h, scrollbarContainer.firstElementChild instanceof HTMLDivElement, "invalid child for scroll bar");
|
|
45979
|
-
|
|
45980
|
-
scrollbarContainer.
|
|
45994
|
+
const width = getSizeAsScale(scrollContainer, originWidth + maxRight - paddingLeft - paddingRight);
|
|
45995
|
+
scrollbarContainer.style.width = `${width}px`;
|
|
45996
|
+
const childWidth = getSizeAsScale(scrollContainer, originWidth + maxRight + overflowWidth - paddingLeft - paddingRight);
|
|
45997
|
+
scrollbarContainer.firstElementChild.style.width = `${childWidth}px`;
|
|
45981
45998
|
}
|
|
45999
|
+
const resetScrollbar = debounce__default.default(resetScrollbarCore, 50);
|
|
45982
46000
|
function resetScrollbarLeft(scrollContainer, scrollbarContainer) {
|
|
45983
46001
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
45984
46002
|
const { paddingLeft } = getScrollWrapPaddingSize(scrollWrap);
|
|
@@ -46154,6 +46172,7 @@ ${codeText}
|
|
|
46154
46172
|
class ContainerResizeObserver {
|
|
46155
46173
|
constructor(scrollCore, callback) {
|
|
46156
46174
|
__publicField(this, "resizeObserver");
|
|
46175
|
+
__publicField(this, "lastWidth", 0);
|
|
46157
46176
|
__publicField(this, "handleResizeEntry", (entry) => {
|
|
46158
46177
|
const scrollContainer = entry.target;
|
|
46159
46178
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
@@ -46163,6 +46182,11 @@ ${codeText}
|
|
|
46163
46182
|
this.callback(scrollContainer);
|
|
46164
46183
|
});
|
|
46165
46184
|
__publicField(this, "handleContentResize", (entries) => {
|
|
46185
|
+
const width = Math.round(entries[0].contentRect.width);
|
|
46186
|
+
if (width === this.lastWidth) {
|
|
46187
|
+
return;
|
|
46188
|
+
}
|
|
46189
|
+
this.lastWidth = width;
|
|
46166
46190
|
entries.forEach((entry) => {
|
|
46167
46191
|
const container = this.containers.get(getContainer(entry.target));
|
|
46168
46192
|
if (container) {
|
|
@@ -76843,10 +76867,11 @@ ${content}
|
|
|
76843
76867
|
const nameElement = createElement("div", ["file-name"], detail);
|
|
76844
76868
|
if (afterIndex > 0) {
|
|
76845
76869
|
createElement("span", ["file-name-pre"], nameElement, fileName.slice(0, afterIndex));
|
|
76846
|
-
createElement("span", [], nameElement, fileName.slice(afterIndex));
|
|
76870
|
+
createElement("span", ["file-name-suf"], nameElement, fileName.slice(afterIndex));
|
|
76847
76871
|
} else {
|
|
76848
76872
|
nameElement.textContent = fileName;
|
|
76849
76873
|
}
|
|
76874
|
+
nameElement.title = fileName;
|
|
76850
76875
|
const infos = createElement("div", ["file-info"], detail);
|
|
76851
76876
|
if (creator) {
|
|
76852
76877
|
createElement("div", ["file-creator"], infos, creator);
|
|
@@ -88652,7 +88677,7 @@ ${data2.flowchartText}
|
|
|
88652
88677
|
}
|
|
88653
88678
|
}
|
|
88654
88679
|
});
|
|
88655
|
-
editor.version = "2.2.
|
|
88680
|
+
editor.version = "2.2.28";
|
|
88656
88681
|
return editor;
|
|
88657
88682
|
}
|
|
88658
88683
|
function isDoc(doc2) {
|
|
@@ -88747,7 +88772,7 @@ ${data2.flowchartText}
|
|
|
88747
88772
|
});
|
|
88748
88773
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
88749
88774
|
OnesEditorToolbar.register(editor);
|
|
88750
|
-
editor.version = "2.2.
|
|
88775
|
+
editor.version = "2.2.28";
|
|
88751
88776
|
return editor;
|
|
88752
88777
|
}
|
|
88753
88778
|
async function showDocVersions(editor, options, serverUrl) {
|