@fileverse-dev/ddoc 3.0.32 → 3.0.34-patch-1

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.
@@ -1,4 +1,4 @@
1
- import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-CA759oPB.mjs";
1
+ import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-DCoc3Unq.mjs";
2
2
  class S extends p {
3
3
  constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
4
4
  var o;
@@ -93963,7 +93963,7 @@ async function SF(e, t) {
93963
93963
  });
93964
93964
  return te === "0x" ? { data: void 0 } : { data: te };
93965
93965
  } catch (R) {
93966
- const B = IKt(R), { offchainLookup: H, offchainLookupSignature: $ } = await import("./ccip-DAx7jk6D.mjs");
93966
+ const B = IKt(R), { offchainLookup: H, offchainLookupSignature: $ } = await import("./ccip-Cv1AWocO.mjs");
93967
93967
  if (e.ccipRead !== !1 && (B == null ? void 0 : B.slice(0, 10)) === $ && x)
93968
93968
  return { data: await H(e, { data: B, to: x }) };
93969
93969
  throw I && (B == null ? void 0 : B.slice(0, 10)) === "0x101bb98d" ? new pZt({ factory: f }) : Sge(R, {
@@ -99411,7 +99411,7 @@ const Mme = Gn(void 0), nQt = ({
99411
99411
  Ae,
99412
99412
  ze || o
99413
99413
  );
99414
- return t == null || t.commands.setComment(pt.id || ""), s(pt.id || ""), setTimeout(l, 0), u == null || u(pt), pt.id;
99414
+ return t == null || t.commands.setComment(pt.id || ""), s(pt.id || ""), setTimeout(l, 0), u == null || u(pt), $e !== Ze ? t.chain().focus().setTextSelection({ from: $e, to: Ze }).run() : t.chain().focus().run(), pt.id;
99415
99415
  },
99416
99416
  [
99417
99417
  t,
@@ -109319,7 +109319,7 @@ const $E = (e) => {
109319
109319
  };
109320
109320
  l.trim() && e && (S == null || S(e, ue), u(""));
109321
109321
  }, ce = (ue) => {
109322
- ue.key === "Enter" && !ue.shiftKey && (ue.preventDefault(), !f && n ? ae() : re());
109322
+ ue.key === "Enter" && !ue.shiftKey && (ue.preventDefault(), f ? ae() : re());
109323
109323
  }, P = () => {
109324
109324
  d((ue) => !ue);
109325
109325
  }, J = () => {
@@ -248531,9 +248531,9 @@ const Fjn = ({
248531
248531
  }
248532
248532
  ),
248533
248533
  image: "",
248534
- isDisabled: !n || i,
248534
+ isDisabled: !n || i || a,
248535
248535
  command: ({ editor: f, range: h }) => {
248536
- if (!(!n || i))
248536
+ if (!(!n || i || a))
248537
248537
  return kjn(f, h, "slash", t), !0;
248538
248538
  }
248539
248539
  },
@@ -263989,19 +263989,29 @@ const $Pn = ({
263989
263989
  He(() => {
263990
263990
  s.current = o || !1;
263991
263991
  }, [o]);
263992
- const l = i == null ? void 0 : i.find(
263993
- (c) => c.id === t
263994
- ), u = Lt(
263992
+ const l = (d) => {
263993
+ const f = d.relatedTarget;
263994
+ f && d.currentTarget.contains(f) || e.commands.unsetCommentActive();
263995
+ }, u = i == null ? void 0 : i.find(
263996
+ (d) => d.id === t
263997
+ ), c = Lt(
263995
263998
  () => ({
263996
- shouldShow: ({ editor: c }) => {
263997
- var p, g;
263998
- const d = (p = c.getAttributes("comment")) == null ? void 0 : p.resolved, f = s.current, h = (c.isActive("comment") && !d && r && !f) ?? !1;
263999
- if (h) {
264000
- const m = (g = c.getAttributes("comment")) == null ? void 0 : g.commentId;
264001
- c.commands.setCommentActive(m);
263999
+ shouldShow: ({
264000
+ editor: d,
264001
+ view: f,
264002
+ element: h
264003
+ }) => {
264004
+ var v, x;
264005
+ const p = (v = d.getAttributes("comment")) == null ? void 0 : v.resolved, g = s.current, m = h.contains(document.activeElement);
264006
+ if (!(f.hasFocus() || m))
264007
+ return !1;
264008
+ const b = (d.isActive("comment") && !p && r && !g) ?? !1;
264009
+ if (b) {
264010
+ const k = (x = d.getAttributes("comment")) == null ? void 0 : x.commentId;
264011
+ d.commands.setCommentActive(k);
264002
264012
  } else
264003
- c.commands.unsetCommentActive();
264004
- return h;
264013
+ d.commands.unsetCommentActive();
264014
+ return b;
264005
264015
  },
264006
264016
  appendTo: () => document.getElementById("editor-canvas")
264007
264017
  }),
@@ -264010,7 +264020,8 @@ const $Pn = ({
264010
264020
  return /* @__PURE__ */ E.jsx(
264011
264021
  uk,
264012
264022
  {
264013
- ...u,
264023
+ onBlurCapture: l,
264024
+ ...c,
264014
264025
  options: {
264015
264026
  offset: {
264016
264027
  mainAxis: 0,
@@ -264039,13 +264050,13 @@ const $Pn = ({
264039
264050
  editor: e,
264040
264051
  activeCommentId: t ?? void 0,
264041
264052
  isBubbleMenu: !0,
264042
- initialComment: l == null ? void 0 : l.content,
264043
- selectedContent: l == null ? void 0 : l.selectedContent,
264053
+ initialComment: u == null ? void 0 : u.content,
264054
+ selectedContent: u == null ? void 0 : u.selectedContent,
264044
264055
  isDisabled: (
264045
264056
  /* @ts-expect-error ts */
264046
- l && !Object.hasOwn(l, "commentIndex")
264057
+ u && !Object.hasOwn(u, "commentIndex")
264047
264058
  ),
264048
- isCommentOwner: (l == null ? void 0 : l.username) === a
264059
+ isCommentOwner: (u == null ? void 0 : u.username) === a
264049
264060
  }
264050
264061
  )
264051
264062
  }
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-CA759oPB.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-DCoc3Unq.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.0.32",
5
+ "version": "3.0.34-patch-1",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {