@fileverse-dev/ddoc 3.0.33 → 3.0.34-patch-2

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-ByOEaqj9.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-C28rvaQu.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-9Gyiz2Ta.mjs");
93966
+ const B = IKt(R), { offchainLookup: H, offchainLookupSignature: $ } = await import("./ccip-DlOrXx61.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.commands.focus(), t == null || t.commands.setComment(pt.id || ""), s(pt.id || ""), setTimeout(l, 0), u == null || u(pt), pt.id;
99415
99415
  },
99416
99416
  [
99417
99417
  t,
@@ -263989,19 +263989,28 @@ 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
+ }) => {
264003
+ var y, b;
264004
+ const h = (y = d.getAttributes("comment")) == null ? void 0 : y.resolved, p = s.current;
264005
+ if (!f.hasFocus())
264006
+ return !1;
264007
+ const m = (d.isActive("comment") && !h && r && !p) ?? !1;
264008
+ if (m) {
264009
+ const v = (b = d.getAttributes("comment")) == null ? void 0 : b.commentId;
264010
+ d.commands.setCommentActive(v);
264002
264011
  } else
264003
- c.commands.unsetCommentActive();
264004
- return h;
264012
+ d.commands.unsetCommentActive();
264013
+ return m;
264005
264014
  },
264006
264015
  appendTo: () => document.getElementById("editor-canvas")
264007
264016
  }),
@@ -264010,7 +264019,8 @@ const $Pn = ({
264010
264019
  return /* @__PURE__ */ E.jsx(
264011
264020
  uk,
264012
264021
  {
264013
- ...u,
264022
+ onBlurCapture: l,
264023
+ ...c,
264014
264024
  options: {
264015
264025
  offset: {
264016
264026
  mainAxis: 0,
@@ -264039,13 +264049,13 @@ const $Pn = ({
264039
264049
  editor: e,
264040
264050
  activeCommentId: t ?? void 0,
264041
264051
  isBubbleMenu: !0,
264042
- initialComment: l == null ? void 0 : l.content,
264043
- selectedContent: l == null ? void 0 : l.selectedContent,
264052
+ initialComment: u == null ? void 0 : u.content,
264053
+ selectedContent: u == null ? void 0 : u.selectedContent,
264044
264054
  isDisabled: (
264045
264055
  /* @ts-expect-error ts */
264046
- l && !Object.hasOwn(l, "commentIndex")
264056
+ u && !Object.hasOwn(u, "commentIndex")
264047
264057
  ),
264048
- isCommentOwner: (l == null ? void 0 : l.username) === a
264058
+ isCommentOwner: (u == null ? void 0 : u.username) === a
264049
264059
  }
264050
264060
  )
264051
264061
  }
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-ByOEaqj9.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-C28rvaQu.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.33",
5
+ "version": "3.0.34-patch-2",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {