@fileverse-dev/ddoc 3.2.6-sg-5 → 3.2.6-sg-6
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
CHANGED
|
@@ -187845,11 +187845,18 @@ const OGe = Number.POSITIVE_INFINITY, db = (e) => e.isVisible && e.isMeasured &&
|
|
|
187845
187845
|
viewportBottom: n
|
|
187846
187846
|
}) => {
|
|
187847
187847
|
const r = e.flatMap(
|
|
187848
|
-
(
|
|
187848
|
+
(a) => Array.from(a.getClientRects())
|
|
187849
187849
|
);
|
|
187850
|
-
|
|
187851
|
-
|
|
187852
|
-
|
|
187850
|
+
if (!r.length)
|
|
187851
|
+
return null;
|
|
187852
|
+
const o = r.some(
|
|
187853
|
+
(a) => a.bottom >= t && a.top <= n
|
|
187854
|
+
), i = Math.min(...r.map((a) => a.top)), s = Math.max(...r.map((a) => a.bottom));
|
|
187855
|
+
return {
|
|
187856
|
+
top: i,
|
|
187857
|
+
height: Math.max(1, s - i),
|
|
187858
|
+
intersectsViewport: o
|
|
187859
|
+
};
|
|
187853
187860
|
}, VGe = (e, t) => e === t ? 0 : e === null ? 1 : t === null ? -1 : e - t, KGe = ({
|
|
187854
187861
|
previousOrderedFloatingCardIds: e,
|
|
187855
187862
|
nextFloatingCards: t,
|
|
@@ -188048,7 +188055,8 @@ const OGe = Number.POSITIVE_INFINITY, db = (e) => e.isVisible && e.isMeasured &&
|
|
|
188048
188055
|
);
|
|
188049
188056
|
}, []), p = Ae(
|
|
188050
188057
|
(v, D) => {
|
|
188051
|
-
u(v)
|
|
188058
|
+
const w = u(v);
|
|
188059
|
+
w.invalidationFlags |= D;
|
|
188052
188060
|
},
|
|
188053
188061
|
[u]
|
|
188054
188062
|
), h = Ae(() => {
|
|
@@ -188114,9 +188122,12 @@ const OGe = Number.POSITIVE_INFINITY, db = (e) => e.isVisible && e.isMeasured &&
|
|
|
188114
188122
|
});
|
|
188115
188123
|
},
|
|
188116
188124
|
[]
|
|
188117
|
-
), y = Ae(
|
|
188118
|
-
(
|
|
188119
|
-
|
|
188125
|
+
), y = Ae(
|
|
188126
|
+
() => t.current.map(
|
|
188127
|
+
(v) => GGe(u(v))
|
|
188128
|
+
),
|
|
188129
|
+
[u]
|
|
188130
|
+
), F = Ae(() => {
|
|
188120
188131
|
e.current.clear(), t.current = [], n.current.clear(), r.current = !0, o.current.clear(), i.current.recomputeFromIndex = 0, s.current = [], l([]);
|
|
188121
188132
|
}, []);
|
|
188122
188133
|
return {
|
|
@@ -188489,7 +188500,6 @@ const OGe = Number.POSITIVE_INFINITY, db = (e) => e.isVisible && e.isMeasured &&
|
|
|
188489
188500
|
vr.Anchor
|
|
188490
188501
|
), O(G ?? 0), Y();
|
|
188491
188502
|
}, [
|
|
188492
|
-
R,
|
|
188493
188503
|
s,
|
|
188494
188504
|
y,
|
|
188495
188505
|
v,
|
|
@@ -188741,16 +188751,16 @@ const OGe = Number.POSITIVE_INFINITY, db = (e) => e.isVisible && e.isMeasured &&
|
|
|
188741
188751
|
floatingCards: l,
|
|
188742
188752
|
scrollContainerRef: n
|
|
188743
188753
|
}), f = Et(
|
|
188744
|
-
() => p.map((
|
|
188745
|
-
(
|
|
188754
|
+
() => p.map((m) => a.get(m)).filter(
|
|
188755
|
+
(m) => m !== void 0
|
|
188746
188756
|
),
|
|
188747
188757
|
[p, a]
|
|
188748
|
-
);
|
|
188758
|
+
), g = c && l.length > 0;
|
|
188749
188759
|
return {
|
|
188750
188760
|
floatingCardListContainerRef: d,
|
|
188751
188761
|
mountedFloatingCards: f,
|
|
188752
188762
|
registerCardNode: h,
|
|
188753
|
-
shouldRender:
|
|
188763
|
+
shouldRender: g
|
|
188754
188764
|
};
|
|
188755
188765
|
}, pte = 300, iXe = (e) => e instanceof Element ? !!e.closest(
|
|
188756
188766
|
'button, [role="button"], a, [data-inline-comment-actions-menu], [data-radix-popper-content-wrapper]'
|
|
@@ -188781,24 +188791,27 @@ const sXe = ({
|
|
|
188781
188791
|
isHidden: t,
|
|
188782
188792
|
registerCardNode: n
|
|
188783
188793
|
}) => {
|
|
188784
|
-
const r = Ne((
|
|
188794
|
+
const r = Ne((c) => c.focusFloatingCard), o = Ne((c) => c.inlineDrafts[e.draftId]), i = Ne((c) => c.username), s = Ne((c) => c.isConnected), a = je(null), l = Ys(i), u = Ae(
|
|
188795
|
+
(c) => {
|
|
188796
|
+
a.current = c, n(e.floatingCardId, c);
|
|
188797
|
+
},
|
|
188798
|
+
[e.floatingCardId, n]
|
|
188799
|
+
);
|
|
188785
188800
|
return _e(() => {
|
|
188786
188801
|
if (!o || !e.isFocused || t)
|
|
188787
188802
|
return;
|
|
188788
|
-
const
|
|
188789
|
-
var
|
|
188790
|
-
const
|
|
188791
|
-
|
|
188803
|
+
const c = window.requestAnimationFrame(() => {
|
|
188804
|
+
var p;
|
|
188805
|
+
const d = (p = a.current) == null ? void 0 : p.querySelector("textarea, input");
|
|
188806
|
+
d == null || d.focus({ preventScroll: !0 });
|
|
188792
188807
|
});
|
|
188793
188808
|
return () => {
|
|
188794
|
-
window.cancelAnimationFrame(
|
|
188809
|
+
window.cancelAnimationFrame(c);
|
|
188795
188810
|
};
|
|
188796
188811
|
}, [e.isFocused, o, t]), o ? /* @__PURE__ */ x.jsx(
|
|
188797
188812
|
lm,
|
|
188798
188813
|
{
|
|
188799
|
-
ref:
|
|
188800
|
-
a.current = u, n(e.floatingCardId, u);
|
|
188801
|
-
},
|
|
188814
|
+
ref: u,
|
|
188802
188815
|
floatingCardId: e.floatingCardId,
|
|
188803
188816
|
isHidden: t,
|
|
188804
188817
|
isFocused: e.isFocused,
|
|
@@ -188881,11 +188894,16 @@ const sXe = ({
|
|
|
188881
188894
|
isHidden: t,
|
|
188882
188895
|
registerCardNode: n
|
|
188883
188896
|
}) => {
|
|
188884
|
-
const r = Ne((
|
|
188897
|
+
const r = Ne((g) => g.focusFloatingCard), o = Ne((g) => g.submitDraft), i = Ne((g) => g.discardDraft), s = Ne((g) => g.isConnected), a = !!e.selectedText, l = !!e.insertedText, u = !!e.linkHref, c = a || l || u, d = Ne((g) => g.username), p = Ys(d), h = Ae(
|
|
188898
|
+
(g) => {
|
|
188899
|
+
n(e.floatingCardId, g);
|
|
188900
|
+
},
|
|
188901
|
+
[e.floatingCardId, n]
|
|
188902
|
+
), f = u ? "link" : a ? l ? "replace" : "delete" : l ? "add" : null;
|
|
188885
188903
|
return /* @__PURE__ */ x.jsx(
|
|
188886
188904
|
lm,
|
|
188887
188905
|
{
|
|
188888
|
-
ref:
|
|
188906
|
+
ref: h,
|
|
188889
188907
|
floatingCardId: e.floatingCardId,
|
|
188890
188908
|
isHidden: t,
|
|
188891
188909
|
isFocused: e.isFocused,
|
|
@@ -188926,7 +188944,7 @@ const sXe = ({
|
|
|
188926
188944
|
) })
|
|
188927
188945
|
] }),
|
|
188928
188946
|
/* @__PURE__ */ x.jsxs("div", { className: "flex-1 ml-[32px]", children: [
|
|
188929
|
-
|
|
188947
|
+
f === "add" && /* @__PURE__ */ x.jsxs("p", { className: "text-body-sm break-words", children: [
|
|
188930
188948
|
/* @__PURE__ */ x.jsx("span", { className: "font-semibold", children: "Add:" }),
|
|
188931
188949
|
" ",
|
|
188932
188950
|
/* @__PURE__ */ x.jsxs("span", { children: [
|
|
@@ -188935,7 +188953,7 @@ const sXe = ({
|
|
|
188935
188953
|
"”"
|
|
188936
188954
|
] })
|
|
188937
188955
|
] }),
|
|
188938
|
-
|
|
188956
|
+
f === "delete" && /* @__PURE__ */ x.jsxs("p", { className: "text-body-sm", children: [
|
|
188939
188957
|
/* @__PURE__ */ x.jsx("span", { className: "font-semibold", children: "Delete:" }),
|
|
188940
188958
|
" ",
|
|
188941
188959
|
/* @__PURE__ */ x.jsxs("span", { className: "line-through", children: [
|
|
@@ -188944,7 +188962,7 @@ const sXe = ({
|
|
|
188944
188962
|
"”"
|
|
188945
188963
|
] })
|
|
188946
188964
|
] }),
|
|
188947
|
-
|
|
188965
|
+
f === "replace" && /* @__PURE__ */ x.jsxs("p", { className: "text-body-sm", children: [
|
|
188948
188966
|
/* @__PURE__ */ x.jsx("span", { className: "font-semibold", children: "Replace:" }),
|
|
188949
188967
|
" ",
|
|
188950
188968
|
/* @__PURE__ */ x.jsxs("span", { className: "line-through", children: [
|
|
@@ -188961,7 +188979,7 @@ const sXe = ({
|
|
|
188961
188979
|
"”"
|
|
188962
188980
|
] })
|
|
188963
188981
|
] }),
|
|
188964
|
-
|
|
188982
|
+
f === "link" && /* @__PURE__ */ x.jsxs("p", { className: "text-body-sm", children: [
|
|
188965
188983
|
/* @__PURE__ */ x.jsx("span", { className: "font-semibold", children: "Add link:" }),
|
|
188966
188984
|
" ",
|
|
188967
188985
|
/* @__PURE__ */ x.jsxs("span", { children: [
|
|
@@ -188970,7 +188988,7 @@ const sXe = ({
|
|
|
188970
188988
|
'"'
|
|
188971
188989
|
] })
|
|
188972
188990
|
] }),
|
|
188973
|
-
!
|
|
188991
|
+
!f && /* @__PURE__ */ x.jsx("p", { className: "text-body-sm color-text-secondary italic", children: "Start typing to suggest a change" })
|
|
188974
188992
|
] }),
|
|
188975
188993
|
/* @__PURE__ */ x.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ x.jsx(
|
|
188976
188994
|
It,
|
|
@@ -188991,33 +189009,38 @@ const sXe = ({
|
|
|
188991
189009
|
isHidden: n,
|
|
188992
189010
|
registerCardNode: r
|
|
188993
189011
|
}) => {
|
|
188994
|
-
const o = Ne((
|
|
189012
|
+
const o = Ne((b) => b.focusFloatingCard), i = Ne((b) => b.focusCommentInEditor), s = Ne((b) => b.isDDocOwner), a = Ne((b) => b.username), l = Ne((b) => b.acceptSuggestion), u = Ne((b) => b.deleteComment), c = Ae(
|
|
189013
|
+
(b) => {
|
|
189014
|
+
r(e.floatingCardId, b);
|
|
189015
|
+
},
|
|
189016
|
+
[r, e.floatingCardId]
|
|
189017
|
+
);
|
|
188995
189018
|
if (!t) return null;
|
|
188996
|
-
const
|
|
189019
|
+
const d = () => {
|
|
188997
189020
|
o(e.floatingCardId), !e.isFocused && e.commentId && i(e.commentId);
|
|
188998
|
-
},
|
|
189021
|
+
}, p = !!(a && t.username && t.username === a), h = s, f = !s && p, g = () => {
|
|
188999
189022
|
e.commentId && l(e.commentId);
|
|
189000
|
-
},
|
|
189023
|
+
}, m = () => {
|
|
189001
189024
|
e.commentId && u(e.commentId);
|
|
189002
189025
|
};
|
|
189003
189026
|
return /* @__PURE__ */ x.jsx(
|
|
189004
189027
|
lm,
|
|
189005
189028
|
{
|
|
189006
|
-
ref:
|
|
189029
|
+
ref: c,
|
|
189007
189030
|
floatingCardId: e.floatingCardId,
|
|
189008
189031
|
isHidden: n,
|
|
189009
189032
|
isFocused: e.isFocused,
|
|
189010
|
-
onFocus:
|
|
189033
|
+
onFocus: d,
|
|
189011
189034
|
children: /* @__PURE__ */ x.jsxs("div", { className: "flex group flex-col gap-2 p-3 pb-0", children: [
|
|
189012
189035
|
/* @__PURE__ */ x.jsx(
|
|
189013
189036
|
cXe,
|
|
189014
189037
|
{
|
|
189015
189038
|
username: t.username,
|
|
189016
189039
|
createdAt: t.createdAt,
|
|
189017
|
-
canAcceptReject:
|
|
189018
|
-
canWithdraw:
|
|
189019
|
-
onAccept:
|
|
189020
|
-
onReject:
|
|
189040
|
+
canAcceptReject: h,
|
|
189041
|
+
canWithdraw: f,
|
|
189042
|
+
onAccept: g,
|
|
189043
|
+
onReject: m
|
|
189021
189044
|
}
|
|
189022
189045
|
),
|
|
189023
189046
|
/* @__PURE__ */ x.jsx("div", { className: "ml-[32px]", children: /* @__PURE__ */ x.jsx(dXe, { comment: t }) }),
|
|
@@ -189026,7 +189049,7 @@ const sXe = ({
|
|
|
189026
189049
|
{
|
|
189027
189050
|
thread: e,
|
|
189028
189051
|
comment: t,
|
|
189029
|
-
onFocusRequest:
|
|
189052
|
+
onFocusRequest: d
|
|
189030
189053
|
}
|
|
189031
189054
|
),
|
|
189032
189055
|
/* @__PURE__ */ x.jsx(hXe, { thread: e, comment: t })
|
|
@@ -189058,7 +189081,7 @@ const sXe = ({
|
|
|
189058
189081
|
s.isEns && /* @__PURE__ */ x.jsx("img", { src: df, alt: "verified", className: "w-3.5 h-3.5" })
|
|
189059
189082
|
] }),
|
|
189060
189083
|
/* @__PURE__ */ x.jsx("span", { className: "text-helper-text-sm color-text-secondary whitespace-nowrap", children: t && m3(t) }),
|
|
189061
|
-
/* @__PURE__ */ x.jsxs("div", { className: "ml-auto opacity-0 group-hover:opacity-100 items-center gap-1", children: [
|
|
189084
|
+
/* @__PURE__ */ x.jsxs("div", { className: "ml-auto opacity-0 group-hover:opacity-100 flex items-center gap-1", children: [
|
|
189062
189085
|
n && /* @__PURE__ */ x.jsxs(x.Fragment, { children: [
|
|
189063
189086
|
/* @__PURE__ */ x.jsx(
|
|
189064
189087
|
sn,
|
|
@@ -189272,7 +189295,7 @@ const sXe = ({
|
|
|
189272
189295
|
registerCardNode: o,
|
|
189273
189296
|
isCollaborationEnabled: i
|
|
189274
189297
|
}) => {
|
|
189275
|
-
const s = Ne((
|
|
189298
|
+
const s = Ne((D) => D.focusFloatingCard), a = Ne((D) => D.focusCommentInEditor), l = Ne((D) => D.isConnected), u = Ne((D) => D.resolveComment), c = Ne((D) => D.username), d = Ne((D) => D.deleteComment), p = Ne((D) => D.isDDocOwner), [h, f] = Me(!1), g = !!(t != null && t.username && t.username === c) || p, m = () => {
|
|
189276
189299
|
e.commentId && f(!0);
|
|
189277
189300
|
}, b = () => {
|
|
189278
189301
|
f(!1);
|
|
@@ -189280,11 +189303,16 @@ const sXe = ({
|
|
|
189280
189303
|
e.commentId && (f(!1), d(e.commentId));
|
|
189281
189304
|
}, F = () => {
|
|
189282
189305
|
s(e.floatingCardId), !e.isFocused && e.commentId && a(e.commentId);
|
|
189283
|
-
}
|
|
189306
|
+
}, v = Ae(
|
|
189307
|
+
(D) => {
|
|
189308
|
+
o(e.floatingCardId, D);
|
|
189309
|
+
},
|
|
189310
|
+
[o, e.floatingCardId]
|
|
189311
|
+
);
|
|
189284
189312
|
return /* @__PURE__ */ x.jsx(
|
|
189285
189313
|
lm,
|
|
189286
189314
|
{
|
|
189287
|
-
ref:
|
|
189315
|
+
ref: v,
|
|
189288
189316
|
floatingCardId: e.floatingCardId,
|
|
189289
189317
|
isHidden: r,
|
|
189290
189318
|
isFocused: e.isFocused,
|
|
@@ -68,7 +68,11 @@ export declare const getRect: ({ elements, viewportTop, viewportBottom, }: {
|
|
|
68
68
|
elements: HTMLElement[];
|
|
69
69
|
viewportTop: number;
|
|
70
70
|
viewportBottom: number;
|
|
71
|
-
}) =>
|
|
71
|
+
}) => {
|
|
72
|
+
top: number;
|
|
73
|
+
height: number;
|
|
74
|
+
intersectsViewport: boolean;
|
|
75
|
+
} | null;
|
|
72
76
|
export declare const reconcileOrderedFloatingCardIds: ({ previousOrderedFloatingCardIds, nextFloatingCards, getPos, }: {
|
|
73
77
|
previousOrderedFloatingCardIds: string[];
|
|
74
78
|
nextFloatingCards: CommentFloatingCard[];
|