@ones-editor/editor 2.1.1-beta.55 → 2.1.1-beta.56
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
|
@@ -75020,6 +75020,10 @@ ${content}
|
|
|
75020
75020
|
name: i18n$1.t("file.commands.download"),
|
|
75021
75021
|
icon: DownloadIcon
|
|
75022
75022
|
},
|
|
75023
|
+
{
|
|
75024
|
+
id: "preview",
|
|
75025
|
+
name: i18n$1.t("file.commands.preview")
|
|
75026
|
+
},
|
|
75023
75027
|
{
|
|
75024
75028
|
id: "add-comment",
|
|
75025
75029
|
name: i18n$1.t("file.commands.comment"),
|
|
@@ -75056,6 +75060,9 @@ ${content}
|
|
|
75056
75060
|
get commands() {
|
|
75057
75061
|
let items = this._commands.slice();
|
|
75058
75062
|
const needRemoveCommandIds = /* @__PURE__ */ new Set();
|
|
75063
|
+
if (!clientType.isMobile) {
|
|
75064
|
+
needRemoveCommandIds.add("preview");
|
|
75065
|
+
}
|
|
75059
75066
|
if (this.editor.readonly || clientType.isMobile) {
|
|
75060
75067
|
needRemoveCommandIds.add("to-link");
|
|
75061
75068
|
needRemoveCommandIds.add("to-card");
|
|
@@ -75082,6 +75089,18 @@ ${content}
|
|
|
75082
75089
|
return items;
|
|
75083
75090
|
}
|
|
75084
75091
|
executeCommand(editor, block, box, item) {
|
|
75092
|
+
if (item.id === "preview") {
|
|
75093
|
+
const options = editor.options.componentsOptions.file;
|
|
75094
|
+
if (options == null ? void 0 : options.onClick) {
|
|
75095
|
+
const mouseEvent = new MouseEvent("mousedown", {
|
|
75096
|
+
bubbles: true,
|
|
75097
|
+
cancelable: true,
|
|
75098
|
+
button: 0
|
|
75099
|
+
});
|
|
75100
|
+
options.onClick(editor, box, mouseEvent);
|
|
75101
|
+
}
|
|
75102
|
+
return;
|
|
75103
|
+
}
|
|
75085
75104
|
if (item.id === "to-card") {
|
|
75086
75105
|
const container = getParentContainer(block);
|
|
75087
75106
|
const containerId = getContainerId(container);
|
|
@@ -75139,14 +75158,14 @@ ${content}
|
|
|
75139
75158
|
link2.setAttribute("data-file-src", fileData.src);
|
|
75140
75159
|
}
|
|
75141
75160
|
function handleClickBox$1(editor, box, event) {
|
|
75161
|
+
if (clientType.isMobile) {
|
|
75162
|
+
return;
|
|
75163
|
+
}
|
|
75142
75164
|
const options = editor.options.componentsOptions.file;
|
|
75143
75165
|
if (options == null ? void 0 : options.onClick) {
|
|
75144
75166
|
options.onClick(editor, box, event);
|
|
75145
75167
|
return;
|
|
75146
75168
|
}
|
|
75147
|
-
if (clientType.isMobile) {
|
|
75148
|
-
return;
|
|
75149
|
-
}
|
|
75150
75169
|
downloadFile$1(editor, box);
|
|
75151
75170
|
}
|
|
75152
75171
|
function getBoxProperties$1(editor, boxElement) {
|
|
@@ -75494,7 +75513,8 @@ ${content}
|
|
|
75494
75513
|
download: "\u4E0B\u8F7D",
|
|
75495
75514
|
toLink: "\u8F6C\u4E3A\u6807\u9898",
|
|
75496
75515
|
toCard: "\u8F6C\u4E3A\u5361\u7247",
|
|
75497
|
-
comment: "\u6DFB\u52A0\u6279\u6CE8"
|
|
75516
|
+
comment: "\u6DFB\u52A0\u6279\u6CE8",
|
|
75517
|
+
preview: "\u9884\u89C8"
|
|
75498
75518
|
}
|
|
75499
75519
|
}
|
|
75500
75520
|
};
|
|
@@ -75505,7 +75525,8 @@ ${content}
|
|
|
75505
75525
|
download: "Download",
|
|
75506
75526
|
toLink: "To Link",
|
|
75507
75527
|
toCard: "To Card",
|
|
75508
|
-
comment: "Add annotation"
|
|
75528
|
+
comment: "Add annotation",
|
|
75529
|
+
preview: "Preview"
|
|
75509
75530
|
}
|
|
75510
75531
|
}
|
|
75511
75532
|
};
|
|
@@ -75516,7 +75537,8 @@ ${content}
|
|
|
75516
75537
|
download: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9",
|
|
75517
75538
|
toLink: "\u30BF\u30A4\u30C8\u30EB\u306B\u5909\u63DB",
|
|
75518
75539
|
toCard: "\u30AB\u30FC\u30C9\u306B\u5909\u63DB",
|
|
75519
|
-
comment: "\u6CE8\u91C8\u3092\u8FFD\u52A0"
|
|
75540
|
+
comment: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
|
|
75541
|
+
preview: "\u30D7\u30EC\u30D3\u30E5\u30FC"
|
|
75520
75542
|
}
|
|
75521
75543
|
}
|
|
75522
75544
|
};
|
|
@@ -86538,7 +86560,7 @@ ${data2.flowchartText}
|
|
|
86538
86560
|
}
|
|
86539
86561
|
}
|
|
86540
86562
|
});
|
|
86541
|
-
editor.version = "2.1.1-beta.
|
|
86563
|
+
editor.version = "2.1.1-beta.56";
|
|
86542
86564
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
86543
86565
|
window.setReauthFail = (fail) => {
|
|
86544
86566
|
window.isReauthError = fail;
|
|
@@ -86636,7 +86658,7 @@ ${data2.flowchartText}
|
|
|
86636
86658
|
});
|
|
86637
86659
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
86638
86660
|
OnesEditorToolbar.register(editor);
|
|
86639
|
-
editor.version = "2.1.1-beta.
|
|
86661
|
+
editor.version = "2.1.1-beta.56";
|
|
86640
86662
|
return editor;
|
|
86641
86663
|
}
|
|
86642
86664
|
async function showDocVersions(editor, options, serverUrl) {
|