@kaitify/core 0.0.2-beta.5 → 0.0.2-beta.6
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/lib/kaitify-core.es.js
CHANGED
|
@@ -37252,23 +37252,25 @@ class Editor {
|
|
|
37252
37252
|
*/
|
|
37253
37253
|
isEditable() {
|
|
37254
37254
|
var _a;
|
|
37255
|
-
return ((_a = this.$el) == null ? void 0 : _a.getAttribute("contenteditable"))
|
|
37255
|
+
return ((_a = this.$el) == null ? void 0 : _a.getAttribute("contenteditable")) === "true";
|
|
37256
37256
|
}
|
|
37257
37257
|
/**
|
|
37258
37258
|
* 设置编辑器是否深色模式
|
|
37259
37259
|
*/
|
|
37260
37260
|
setDark(dark) {
|
|
37261
|
+
var _a, _b;
|
|
37261
37262
|
if (dark) {
|
|
37262
|
-
this.$el.setAttribute("kaitify-dark", "");
|
|
37263
|
+
(_a = this.$el) == null ? void 0 : _a.setAttribute("kaitify-dark", "");
|
|
37263
37264
|
} else {
|
|
37264
|
-
this.$el.removeAttribute("kaitify-dark");
|
|
37265
|
+
(_b = this.$el) == null ? void 0 : _b.removeAttribute("kaitify-dark");
|
|
37265
37266
|
}
|
|
37266
37267
|
}
|
|
37267
37268
|
/**
|
|
37268
37269
|
* 是否深色模式
|
|
37269
37270
|
*/
|
|
37270
37271
|
isDark() {
|
|
37271
|
-
|
|
37272
|
+
var _a;
|
|
37273
|
+
return ((_a = this.$el) == null ? void 0 : _a.hasAttribute("kaitify-dark")) ?? false;
|
|
37272
37274
|
}
|
|
37273
37275
|
/**
|
|
37274
37276
|
* 判断编辑器是否为空,这里的空指的是编辑器内只有一个段落,并且段落里只有占位符
|