@fileverse-dev/ddoc 3.0.96-zustand-16 → 3.0.96-zustand-17
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/dist/index.es.js +32 -19
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -42536,35 +42536,43 @@ const nfe = () => D0e((e, t) => ({
|
|
|
42536
42536
|
return i == null || i(g, b), g.id;
|
|
42537
42537
|
},
|
|
42538
42538
|
createFloatingDraft: () => {
|
|
42539
|
-
const { editor: n, onInlineComment: r } = Pn(t), {
|
|
42539
|
+
const { editor: n, onInlineComment: r } = Pn(t), {
|
|
42540
|
+
activeComment: o,
|
|
42541
|
+
isDesktopFloatingEnabled: i,
|
|
42542
|
+
isCommentActive: s,
|
|
42543
|
+
isConnected: a,
|
|
42544
|
+
setCommentDrawerOpen: l
|
|
42545
|
+
} = t();
|
|
42540
42546
|
if (!n)
|
|
42541
42547
|
return null;
|
|
42542
|
-
|
|
42548
|
+
if (!a)
|
|
42549
|
+
return l == null || l(!0), null;
|
|
42550
|
+
const { state: u } = n, { from: c, to: d } = u.selection, p = u.doc.textBetween(c, d, " ");
|
|
42543
42551
|
if (!i)
|
|
42544
|
-
return s ? o && e({ selectedText: o.selectedContent || "" }) : e({ selectedText:
|
|
42545
|
-
if (
|
|
42552
|
+
return s ? o && e({ selectedText: o.selectedContent || "" }) : e({ selectedText: p }), e({ isCommentOpen: !0 }), r == null || r(), null;
|
|
42553
|
+
if (c >= d || !p.trim())
|
|
42546
42554
|
return null;
|
|
42547
|
-
const
|
|
42548
|
-
if (!n.commands.setDraftComment(
|
|
42555
|
+
const h = `draft-${Fc()}`;
|
|
42556
|
+
if (!n.commands.setDraftComment(h))
|
|
42549
42557
|
return null;
|
|
42550
|
-
const
|
|
42551
|
-
return e((
|
|
42552
|
-
selectedText:
|
|
42558
|
+
const g = `draft:${h}`;
|
|
42559
|
+
return e((m) => ({
|
|
42560
|
+
selectedText: p,
|
|
42553
42561
|
isBubbleMenuSuppressed: !0,
|
|
42554
42562
|
floatingItems: [
|
|
42555
|
-
...
|
|
42563
|
+
...m.floatingItems.map((b) => ({ ...b, isFocused: !1 })),
|
|
42556
42564
|
{
|
|
42557
|
-
itemId:
|
|
42565
|
+
itemId: g,
|
|
42558
42566
|
type: "draft",
|
|
42559
|
-
draftId:
|
|
42560
|
-
selectedText:
|
|
42567
|
+
draftId: h,
|
|
42568
|
+
selectedText: p,
|
|
42561
42569
|
draftText: "",
|
|
42562
42570
|
isAuthPending: !1,
|
|
42563
42571
|
isOpen: !0,
|
|
42564
42572
|
isFocused: !0
|
|
42565
42573
|
}
|
|
42566
42574
|
]
|
|
42567
|
-
})), r == null || r(),
|
|
42575
|
+
})), r == null || r(), h;
|
|
42568
42576
|
},
|
|
42569
42577
|
updateFloatingDraftText: (n, r) => {
|
|
42570
42578
|
e((o) => ({
|
|
@@ -42691,13 +42699,18 @@ const nfe = () => D0e((e, t) => ({
|
|
|
42691
42699
|
});
|
|
42692
42700
|
},
|
|
42693
42701
|
openFloatingThread: (n) => {
|
|
42694
|
-
const { editor: r, setActiveCommentId: o } = Pn(t), i = t()
|
|
42695
|
-
|
|
42702
|
+
const { editor: r, setActiveCommentId: o } = Pn(t), { isConnected: i, setCommentDrawerOpen: s } = t();
|
|
42703
|
+
if (!i) {
|
|
42704
|
+
s == null || s(!0);
|
|
42705
|
+
return;
|
|
42706
|
+
}
|
|
42707
|
+
const a = t().tabComments.find(
|
|
42708
|
+
(l) => l.id === n && !l.deleted && !l.resolved
|
|
42696
42709
|
);
|
|
42697
|
-
!r || !(
|
|
42698
|
-
floatingItems: DS(
|
|
42710
|
+
!r || !(a != null && a.selectedContent) || (e((l) => ({
|
|
42711
|
+
floatingItems: DS(l.floatingItems, {
|
|
42699
42712
|
commentId: n,
|
|
42700
|
-
selectedText:
|
|
42713
|
+
selectedText: a.selectedContent || ""
|
|
42701
42714
|
})
|
|
42702
42715
|
})), o(n), r.commands.setCommentActive(n));
|
|
42703
42716
|
},
|