@ones-editor/editor 2.3.0-beta.12 → 2.3.0-beta.13
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.
|
@@ -7,17 +7,12 @@ export default class ErrorInfoBar {
|
|
|
7
7
|
private message;
|
|
8
8
|
private _hideTimer;
|
|
9
9
|
private _adjustParentInterval;
|
|
10
|
-
private _messageText;
|
|
11
10
|
private _type;
|
|
12
11
|
constructor(editor: OnesEditor);
|
|
13
|
-
show(message: string,
|
|
14
|
-
type: BarType;
|
|
15
|
-
customMessage?: string;
|
|
16
|
-
}): void;
|
|
12
|
+
show(message: string, type: BarType): void;
|
|
17
13
|
hide(): void;
|
|
18
14
|
visible(): boolean;
|
|
19
15
|
destroy(): void;
|
|
20
16
|
private findParent;
|
|
21
17
|
private autoAdjustParent;
|
|
22
|
-
private getErrorMessage;
|
|
23
18
|
}
|
package/dist/index.js
CHANGED
|
@@ -85522,8 +85522,7 @@ ${docStr}
|
|
|
85522
85522
|
drawioContainer.setAttribute("data-placeholder", i18n$1.t("drawio.loading"));
|
|
85523
85523
|
const clientId = editor.clientId;
|
|
85524
85524
|
const popupClass = ["editor-popup-info-container", `editor-popup-info-container-${clientId}`];
|
|
85525
|
-
|
|
85526
|
-
errorInfoContainer.setAttribute("data-custom-error-message", i18n$1.t("error.networkPopup"));
|
|
85525
|
+
createElement("div", popupClass, drawioContainer);
|
|
85527
85526
|
drawioIframe = createElement("iframe", ["drawio-iframe-element"], drawioContainer);
|
|
85528
85527
|
drawioIframe.setAttribute("frameborder", "0");
|
|
85529
85528
|
addClass(drawioContainer, SHOW_FULL_SCREEN_IFRAME);
|
|
@@ -88215,7 +88214,6 @@ ${data2.flowchartText}
|
|
|
88215
88214
|
__publicField(this, "message");
|
|
88216
88215
|
__publicField(this, "_hideTimer", null);
|
|
88217
88216
|
__publicField(this, "_adjustParentInterval", null);
|
|
88218
|
-
__publicField(this, "_messageText", "");
|
|
88219
88217
|
__publicField(this, "_type", "error");
|
|
88220
88218
|
this.editor = editor;
|
|
88221
88219
|
const root2 = createElement("div", ["error-info-bar"], null);
|
|
@@ -88224,14 +88222,13 @@ ${data2.flowchartText}
|
|
|
88224
88222
|
const message = createElement("div", ["message"], content);
|
|
88225
88223
|
this.message = message;
|
|
88226
88224
|
}
|
|
88227
|
-
show(message,
|
|
88228
|
-
this.
|
|
88229
|
-
this._type = options.type;
|
|
88225
|
+
show(message, type) {
|
|
88226
|
+
this._type = type;
|
|
88230
88227
|
const parent = this.findParent();
|
|
88231
88228
|
if (this.root.parentElement !== parent) {
|
|
88232
88229
|
parent.insertAdjacentElement("afterbegin", this.root);
|
|
88233
88230
|
}
|
|
88234
|
-
this.message.innerText =
|
|
88231
|
+
this.message.innerText = message;
|
|
88235
88232
|
removeClass(this.root, "hidden");
|
|
88236
88233
|
this.root.setAttribute("data-type", this._type);
|
|
88237
88234
|
if (this._hideTimer) {
|
|
@@ -88299,13 +88296,6 @@ ${data2.flowchartText}
|
|
|
88299
88296
|
currentParent.insertAdjacentElement("afterbegin", this.root);
|
|
88300
88297
|
}, 1e3);
|
|
88301
88298
|
}
|
|
88302
|
-
getErrorMessage(parent) {
|
|
88303
|
-
const customErrorMessage = parent.getAttribute("data-custom-error-message");
|
|
88304
|
-
if (customErrorMessage && this._type === "error") {
|
|
88305
|
-
return customErrorMessage;
|
|
88306
|
-
}
|
|
88307
|
-
return this._messageText;
|
|
88308
|
-
}
|
|
88309
88299
|
}
|
|
88310
88300
|
const logger$6 = getLogger("error-handler");
|
|
88311
88301
|
class DefaultErrorHandler {
|
|
@@ -88401,10 +88391,9 @@ ${data2.flowchartText}
|
|
|
88401
88391
|
if (this._editor) {
|
|
88402
88392
|
this._editor.readonly = true;
|
|
88403
88393
|
}
|
|
88404
|
-
this.
|
|
88405
|
-
|
|
88406
|
-
|
|
88407
|
-
});
|
|
88394
|
+
const defaultMessage = this.hasPopup() ? i18n$1.t("error.networkPopup") : i18n$1.t("error.network");
|
|
88395
|
+
const errorMessage = customMessage || defaultMessage;
|
|
88396
|
+
this.bar.show(errorMessage, "error");
|
|
88408
88397
|
}
|
|
88409
88398
|
autoHide() {
|
|
88410
88399
|
var _a;
|
|
@@ -90776,7 +90765,7 @@ ${data2.flowchartText}
|
|
|
90776
90765
|
}
|
|
90777
90766
|
}
|
|
90778
90767
|
});
|
|
90779
|
-
editor.version = "2.3.0-beta.
|
|
90768
|
+
editor.version = "2.3.0-beta.13";
|
|
90780
90769
|
return editor;
|
|
90781
90770
|
}
|
|
90782
90771
|
function isDoc(doc2) {
|
|
@@ -90883,7 +90872,7 @@ ${data2.flowchartText}
|
|
|
90883
90872
|
}
|
|
90884
90873
|
});
|
|
90885
90874
|
OnesEditorToolbar.register(editor);
|
|
90886
|
-
editor.version = "2.3.0-beta.
|
|
90875
|
+
editor.version = "2.3.0-beta.13";
|
|
90887
90876
|
return editor;
|
|
90888
90877
|
}
|
|
90889
90878
|
async function showDocVersions(editor, options, serverUrl) {
|