jedison 1.22.2 → 1.22.3
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/CHANGELOG.md +5 -0
- package/dist/cjs/jedison.cjs +1 -1
- package/dist/cjs/jedison.cjs.map +1 -1
- package/dist/esm/jedison.js +12 -4
- package/dist/esm/jedison.js.map +1 -1
- package/dist/umd/jedison.umd.js +1 -1
- package/dist/umd/jedison.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/jedison.js
CHANGED
|
@@ -2079,7 +2079,11 @@ class Instance extends EventEmitter {
|
|
|
2079
2079
|
* @returns {*} The final value after constraint enforcement
|
|
2080
2080
|
*/
|
|
2081
2081
|
setValue(newValue, notifyParent = true, initiator = "api") {
|
|
2082
|
-
|
|
2082
|
+
const wasInactive = !this.isActive;
|
|
2083
|
+
if (wasInactive) {
|
|
2084
|
+
this.isActive = true;
|
|
2085
|
+
}
|
|
2086
|
+
if (this.value === newValue && !wasInactive) {
|
|
2083
2087
|
return this.value;
|
|
2084
2088
|
}
|
|
2085
2089
|
const purifiedValue = this.purify(newValue);
|
|
@@ -2092,7 +2096,7 @@ class Instance extends EventEmitter {
|
|
|
2092
2096
|
newValue = schemaConst;
|
|
2093
2097
|
}
|
|
2094
2098
|
}
|
|
2095
|
-
if (!wasPurified && !different(this.value, newValue)) {
|
|
2099
|
+
if (!wasPurified && !different(this.value, newValue) && !wasInactive) {
|
|
2096
2100
|
return this.value;
|
|
2097
2101
|
}
|
|
2098
2102
|
this.value = newValue;
|
|
@@ -2258,7 +2262,11 @@ class Editor {
|
|
|
2258
2262
|
*/
|
|
2259
2263
|
init() {
|
|
2260
2264
|
this.theme = this.instance.jedison.theme;
|
|
2261
|
-
|
|
2265
|
+
const parseMarkdownOption = getSchemaXOption(this.instance.schema, "parseMarkdown") ?? this.instance.jedison.getOption("parseMarkdown");
|
|
2266
|
+
this.markdownEnabled = Boolean(parseMarkdownOption) && typeof window !== "undefined" && Boolean(window.marked);
|
|
2267
|
+
if (parseMarkdownOption && !this.markdownEnabled && typeof window !== "undefined") {
|
|
2268
|
+
console.warn("Jedison: parseMarkdown is enabled but window.marked was not found. Markdown will not be parsed.");
|
|
2269
|
+
}
|
|
2262
2270
|
this.purifyEnabled = getSchemaXOption(this.instance.schema, "purifyHtml") ?? this.instance.jedison.getOption("purifyHtml");
|
|
2263
2271
|
this.markdownCache = /* @__PURE__ */ new Map();
|
|
2264
2272
|
this.purifyCache = /* @__PURE__ */ new Map();
|
|
@@ -7507,7 +7515,7 @@ class JsonWalker {
|
|
|
7507
7515
|
}
|
|
7508
7516
|
}
|
|
7509
7517
|
}
|
|
7510
|
-
const version = "1.22.
|
|
7518
|
+
const version = "1.22.3";
|
|
7511
7519
|
class Jedison extends EventEmitter {
|
|
7512
7520
|
/**
|
|
7513
7521
|
* Creates a Jedison instance.
|