@fileverse-dev/ddoc 2.1.1-patch-8 → 2.1.1-patch-10

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.
Files changed (2) hide show
  1. package/dist/index.es.js +16 -7
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -79421,7 +79421,7 @@ const m5 = [
79421
79421
  { color: "#073763", code: "bg-[#073763]" },
79422
79422
  { color: "#20124D", code: "bg-[#20124D]" },
79423
79423
  { color: "#4C1130", code: "bg-[#4C1130]" }
79424
- ], u4 = (t, e) => t.type.includes("image") && !t.type.includes("image/png") && !t.type.includes("image/jpeg") ? (e && typeof e == "function" && e("Invalid image type. Try PNG or JPEG."), !1) : !0, BQ = (t) => {
79424
+ ], u4 = (t, e) => t.type.includes("image") && !["image/png", "image/jpeg", "image/gif"].includes(t.type) ? (e && typeof e == "function" && e("Invalid image type. Try PNG, JPEG or GIF."), !1) : !0, BQ = (t) => {
79425
79425
  const n = `
79426
79426
  <!DOCTYPE html>
79427
79427
  <html>
@@ -80061,14 +80061,18 @@ const m5 = [
80061
80061
  {
80062
80062
  icon: "Code",
80063
80063
  title: "Code",
80064
- onClick: () => t == null ? void 0 : t.chain().focus().toggleCode().run(),
80064
+ onClick: () => {
80065
+ t != null && t.isActive("codeBlock") && (t == null || t.chain().focus().toggleCodeBlock().run()), t == null || t.chain().focus().toggleCode().run();
80066
+ },
80065
80067
  isActive: t == null ? void 0 : t.isActive("code"),
80066
80068
  group: "More"
80067
80069
  },
80068
80070
  {
80069
80071
  icon: "Braces",
80070
80072
  title: "Code Block",
80071
- onClick: () => t == null ? void 0 : t.chain().focus().toggleCodeBlock().run(),
80073
+ onClick: () => {
80074
+ t != null && t.isActive("code") && (t == null || t.chain().focus().toggleCode().run()), t == null || t.chain().focus().toggleCodeBlock().run();
80075
+ },
80072
80076
  isActive: t == null ? void 0 : t.isActive("codeBlock"),
80073
80077
  group: "More"
80074
80078
  },
@@ -109005,10 +109009,15 @@ Qn.addRule("listItem", {
109005
109009
  let r = n.bulletListMarker + " ";
109006
109010
  const i = e.parentNode;
109007
109011
  if (i && i.nodeName === "OL") {
109008
- const s = i.getAttribute("start"), o = Array.prototype.indexOf.call(i.children, e);
109009
- r = (s ? Number(s) + o : o + 1) + ". ";
109010
- }
109011
- return r + t + (e.nextSibling && !/\n$/.test(t) ? `
109012
+ const l = i.getAttribute("start"), c = Array.prototype.indexOf.call(i.children, e);
109013
+ r = (l ? Number(l) + c : c + 1) + ". ";
109014
+ }
109015
+ let s = 0, o = e.parentNode;
109016
+ for (; o && (o.nodeName === "UL" || o.nodeName === "OL"); )
109017
+ s++, o = o.parentNode;
109018
+ s > 1 && (r = " ".repeat(s - 1) + r);
109019
+ const a = !e.nextSibling || s === 1;
109020
+ return r + t + (a ? `
109012
109021
  ` : "");
109013
109022
  }
109014
109023
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "2.1.1-patch-8",
5
+ "version": "2.1.1-patch-10",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {