@estiva-app/ui 0.104.2 → 0.104.3
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/ContainerHeader.d.ts.map +1 -1
- package/dist/ConversationCard.d.ts +8 -2
- package/dist/ConversationCard.d.ts.map +1 -1
- package/dist/ConversationLayout.d.ts +4 -1
- package/dist/ConversationLayout.d.ts.map +1 -1
- package/dist/index.js +69 -23
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/registry.json +2 -2
- package/src/ContainerHeader.mdx +2 -0
- package/src/ContainerHeader.test.tsx +6 -0
- package/src/ContainerHeader.tsx +3 -1
- package/src/ConversationCard.mdx +4 -2
- package/src/ConversationCard.stories.tsx +14 -0
- package/src/ConversationCard.test.tsx +130 -2
- package/src/ConversationCard.tsx +128 -56
- package/src/ConversationLayout.mdx +4 -0
- package/src/ConversationLayout.tsx +4 -1
- package/src/PageHeader.mdx +1 -0
- package/src/ReplyCard.mdx +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerHeader.d.ts","sourceRoot":"","sources":["../src/ContainerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,KAAK,EAAE,SAAS,CAAA;IAChB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,yFAAyF;IACzF,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,OAAe,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,oBAAoB,+
|
|
1
|
+
{"version":3,"file":"ContainerHeader.d.ts","sourceRoot":"","sources":["../src/ContainerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,KAAK,EAAE,SAAS,CAAA;IAChB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,yFAAyF;IACzF,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,OAAe,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,oBAAoB,+BAuC9G"}
|
|
@@ -50,7 +50,10 @@ export interface ConversationEntryProps {
|
|
|
50
50
|
* everyone.", and on a comment how many replies stay. A string is one paragraph; a node is drawn as given.
|
|
51
51
|
*/
|
|
52
52
|
deleteNote?: ReactNode;
|
|
53
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Why the last delete was refused, in plain words: said under the question, while it stays open (`onDelete` answered
|
|
55
|
+
* `false`). Only in the question it answered: one opened again says nothing until its own Delete is refused.
|
|
56
|
+
*/
|
|
54
57
|
deleteRefused?: string;
|
|
55
58
|
/** The app's own rows in the ⋯ menu, after Resolve: `MenuItem`s. */
|
|
56
59
|
menu?: ReactNode;
|
|
@@ -93,7 +96,10 @@ export interface ConversationCardProps extends ConversationEntryProps {
|
|
|
93
96
|
resolveHint?: string;
|
|
94
97
|
/** Resolve, with the note written in the dialog the card opens. Offered on the strip and in the menu. */
|
|
95
98
|
onResolve?: (note: string) => Promise<boolean | void> | boolean | void;
|
|
96
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* Why the last resolve was refused, in plain words: said under the note, while the dialog stays open (`onResolve`
|
|
101
|
+
* answered `false`). Only in the dialog it answered: one opened again says nothing until its own Resolve is refused.
|
|
102
|
+
*/
|
|
97
103
|
resolveRefused?: string;
|
|
98
104
|
onReopen?: () => void;
|
|
99
105
|
/** The one open beside its thread. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationCard.d.ts","sourceRoot":"","sources":["../src/ConversationCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"ConversationCard.d.ts","sourceRoot":"","sources":["../src/ConversationCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAA;AAarG,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAQ/D,4FAA4F;AAC5F,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED,wCAAwC;AACxC,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,4DAA4D;IAC5D,IAAI,EAAE,SAAS,CAAA;IACf,sHAAsH;IACtH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0HAA0H;IAC1H,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yGAAyG;IACzG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8FAA8F;IAC9F,QAAQ,EAAE,SAAS,CAAA;IACnB,6GAA6G;IAC7G,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,uEAAuE;IACvE,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,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AAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACrD;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kGAAkG;IAClG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yGAAyG;IACzG,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,CAAA;IACtE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,4IAA4I;IAC5I,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,0GAA0G;IAC1G,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAmND;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,+BA8L5D;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAsG9C"}
|
|
@@ -52,7 +52,10 @@ export interface ConversationLayoutProps {
|
|
|
52
52
|
* it, it opens at the newest each time it is drawn. `useLeftAt` with the same name says when it was left, for a "New" line.
|
|
53
53
|
*/
|
|
54
54
|
rememberAs?: string;
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* The comments' scrolling box, in both layouts: two columns' list, and one column's Panel body. Two columns, where it
|
|
57
|
+
* scrolls is the layout's: an app reads it, and keeps no place of its own in it.
|
|
58
|
+
*/
|
|
56
59
|
bodyRef?: Ref<HTMLDivElement>;
|
|
57
60
|
/** Two columns: the comments' box scrolled. */
|
|
58
61
|
onBodyScroll?: UIEventHandler<HTMLDivElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationLayout.d.ts","sourceRoot":"","sources":["../src/ConversationLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAgB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAYxJ,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAIhE,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,yCAAyC;IACzC,IAAI,EAAE,SAAS,CAAA;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAA;IACtC,mHAAmH;IACnH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iKAAiK;IACjK,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,0MAA0M;IAC1M,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,uHAAuH;IACvH,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,uPAAuP;IACvP,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC3B,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAClC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oJAAoJ;IACpJ,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAA;IAC/C,+DAA+D;IAC/D,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,iGAAiG;IACjG,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,oPAAoP;IACpP,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,0IAA0I;IAC1I,GAAG,CAAC,EAAE,SAAS,CAAA;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ACjB,oPAAoP;IACpP,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,0IAA0I;IAC1I,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2HAA2H;IAC3H,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;IAC7B,+CAA+C;IAC/C,YAAY,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;IAC7C,0HAA0H;IAC1H,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,yJAAyJ;IACzJ,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,uIAAuI;IACvI,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,wDAAwD;IACxD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAsJD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,KAAK,EACL,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,GAAG,EACH,KAAK,EACL,KAAK,EACL,GAAG,EACH,OAAe,EACf,KAA0B,EAC1B,MAAM,EACN,KAAkB,EAClB,OAAO,EACP,UAAU,EACV,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,SAAS,GACV,EAAE,uBAAuB,+BAgLzB"}
|
package/dist/index.js
CHANGED
|
@@ -1658,7 +1658,9 @@ function ContainerHeader({ title, chevron = false, titleMenu, actions, className
|
|
|
1658
1658
|
// (pl-2.5 + the button's px-1.5 = pl-4): the words stay where a title's
|
|
1659
1659
|
// are, and the fill is inside the bar — a negative margin had it clipped
|
|
1660
1660
|
// (Katerina, 5 October).
|
|
1661
|
-
|
|
1661
|
+
// 12px between the title and the buttons, as between the right group's own parts: a cut title, and a button
|
|
1662
|
+
// after it, ran right up to them (Leaf's adoption review, 4 November). A bar whose title fits does not move.
|
|
1663
|
+
/* @__PURE__ */ jsxs16("div", { className: cn("flex h-12 shrink-0 items-center justify-between gap-3 overflow-hidden border-b border-border-subtle py-2 pr-4", titleMenu != null ? "pl-2.5" : "pl-4", className), children: [
|
|
1662
1664
|
/* @__PURE__ */ jsx23("div", { className: cn("flex items-center gap-2 overflow-hidden", text ? "shrink-0" : "min-w-0 flex-1"), children: titleMenu != null ? /* @__PURE__ */ jsx23(
|
|
1663
1665
|
Menu,
|
|
1664
1666
|
{
|
|
@@ -5956,9 +5958,24 @@ function When({ time, at: given, timeHref, timeLabel = "Link to this" }) {
|
|
|
5956
5958
|
}
|
|
5957
5959
|
return /* @__PURE__ */ jsx81(MetaText, { className: "shrink-0", children: exact ? /* @__PURE__ */ jsx81(WithTooltip, { label: exact, children: said }) : time });
|
|
5958
5960
|
}
|
|
5959
|
-
|
|
5961
|
+
var fadeBefore = (end) => `linear-gradient(to right, black ${end - 16}px, transparent ${end}px)`;
|
|
5962
|
+
function useClearOfStrip(root, strip, shown2) {
|
|
5963
|
+
const [end, setEnd] = useState23();
|
|
5964
|
+
useLayoutEffect7(() => {
|
|
5965
|
+
const words = root.current?.querySelector("[data-head]");
|
|
5966
|
+
if (!shown2 || !words || !strip.current) {
|
|
5967
|
+
setEnd(void 0);
|
|
5968
|
+
return;
|
|
5969
|
+
}
|
|
5970
|
+
const stop = strip.current.getBoundingClientRect().left - 8;
|
|
5971
|
+
const reach = Math.max(...Array.from(words.children, (part) => part.getBoundingClientRect().right));
|
|
5972
|
+
setEnd(reach > stop ? stop - words.getBoundingClientRect().left : void 0);
|
|
5973
|
+
}, [root, strip, shown2]);
|
|
5974
|
+
return end;
|
|
5975
|
+
}
|
|
5976
|
+
function Head({ author, time, at, timeHref, timeLabel, edited, isNew, urgent, meta, end }) {
|
|
5960
5977
|
return /* @__PURE__ */ jsxs59("div", { className: "flex w-full items-center gap-2", children: [
|
|
5961
|
-
/* @__PURE__ */ jsxs59("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
5978
|
+
/* @__PURE__ */ jsxs59("div", { "data-head": true, className: "flex min-w-0 flex-1 items-center gap-2", style: end === void 0 ? void 0 : { maskImage: fadeBefore(end), WebkitMaskImage: fadeBefore(end) }, children: [
|
|
5962
5979
|
/* @__PURE__ */ jsx81("span", { "data-face": true, className: "relative flex shrink-0", children: /* @__PURE__ */ jsx81(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }) }),
|
|
5963
5980
|
/* @__PURE__ */ jsx81("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
|
|
5964
5981
|
/* @__PURE__ */ jsx81(When, { time, at, timeHref, timeLabel }),
|
|
@@ -6021,6 +6038,41 @@ function stillHere(root) {
|
|
|
6021
6038
|
return root.matches(":hover");
|
|
6022
6039
|
}
|
|
6023
6040
|
}
|
|
6041
|
+
function DeleteQuestion({ noun, onDelete, refused, onClose, children }) {
|
|
6042
|
+
const [answered, setAnswered] = useState23(false);
|
|
6043
|
+
return /* @__PURE__ */ jsx81(
|
|
6044
|
+
ConfirmDialog,
|
|
6045
|
+
{
|
|
6046
|
+
title: `Delete this ${noun}?`,
|
|
6047
|
+
confirmLabel: `Delete ${noun}`,
|
|
6048
|
+
destructive: true,
|
|
6049
|
+
onConfirm: async () => {
|
|
6050
|
+
const ok = await onDelete();
|
|
6051
|
+
setAnswered(true);
|
|
6052
|
+
return ok;
|
|
6053
|
+
},
|
|
6054
|
+
onClose,
|
|
6055
|
+
refused: answered ? refused : void 0,
|
|
6056
|
+
children
|
|
6057
|
+
}
|
|
6058
|
+
);
|
|
6059
|
+
}
|
|
6060
|
+
function ResolveQuestion({ onResolve, refused, onClose }) {
|
|
6061
|
+
const [answered, setAnswered] = useState23(false);
|
|
6062
|
+
return /* @__PURE__ */ jsx81(
|
|
6063
|
+
ResolveDialog,
|
|
6064
|
+
{
|
|
6065
|
+
refused: answered ? refused : void 0,
|
|
6066
|
+
onCancel: onClose,
|
|
6067
|
+
onResolve: async (note) => {
|
|
6068
|
+
const ok = await onResolve(note);
|
|
6069
|
+
setAnswered(true);
|
|
6070
|
+
if (ok !== false) onClose();
|
|
6071
|
+
return ok;
|
|
6072
|
+
}
|
|
6073
|
+
}
|
|
6074
|
+
);
|
|
6075
|
+
}
|
|
6024
6076
|
function useEditing(editing, onEditingChange) {
|
|
6025
6077
|
const [own, setOwn] = useState23(false);
|
|
6026
6078
|
const now = editing ?? own;
|
|
@@ -6051,6 +6103,8 @@ function ConversationCard(props) {
|
|
|
6051
6103
|
const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
|
|
6052
6104
|
const offersMenu = !!resolves || !!menu || !!menuAfter || own && (!!editor || !!onDelete);
|
|
6053
6105
|
const showStrip = hovered && !isEditing && !readOnly;
|
|
6106
|
+
const strip = useRef19(null);
|
|
6107
|
+
const wordsEnd = useClearOfStrip(root, strip, showStrip);
|
|
6054
6108
|
const react = reactions?.onToggle;
|
|
6055
6109
|
const press = onClick ?? (readOnly && !replies?.count ? void 0 : item?.toggle);
|
|
6056
6110
|
const reply = onReply ?? item?.show;
|
|
@@ -6099,7 +6153,8 @@ function ConversationCard(props) {
|
|
|
6099
6153
|
edited: props.edited,
|
|
6100
6154
|
isNew,
|
|
6101
6155
|
urgent,
|
|
6102
|
-
meta: resolved && /* @__PURE__ */ jsx81(ResolvedCheck, { by: resolved.by, note: resolved.note, at: resolved.at })
|
|
6156
|
+
meta: resolved && /* @__PURE__ */ jsx81(ResolvedCheck, { by: resolved.by, note: resolved.note, at: resolved.at }),
|
|
6157
|
+
end: wordsEnd
|
|
6103
6158
|
}
|
|
6104
6159
|
),
|
|
6105
6160
|
!!about && // Under the name, above the words (Katerina, 1 November).
|
|
@@ -6115,7 +6170,7 @@ function ConversationCard(props) {
|
|
|
6115
6170
|
dotLine && // One bar from the face to the dot, measured (useFaceLine): 2px, centred under the 24px face, 8px in.
|
|
6116
6171
|
// Its top and height come from the measure: where the face ends and the dot stands are not known ahead.
|
|
6117
6172
|
/* @__PURE__ */ jsx81("span", { "aria-hidden": true, className: "pointer-events-none absolute left-[19px] w-0.5 bg-border-default", style: { top: dotLine.top, height: dotLine.height } }),
|
|
6118
|
-
showStrip && /* @__PURE__ */ jsx81("div", { className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx81(
|
|
6173
|
+
showStrip && /* @__PURE__ */ jsx81("div", { ref: strip, className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx81(
|
|
6119
6174
|
ConversationActions,
|
|
6120
6175
|
{
|
|
6121
6176
|
options: reactions?.options,
|
|
@@ -6155,7 +6210,7 @@ function ConversationCard(props) {
|
|
|
6155
6210
|
]
|
|
6156
6211
|
}
|
|
6157
6212
|
),
|
|
6158
|
-
deleting && onDelete && /* @__PURE__ */ jsx81(
|
|
6213
|
+
deleting && onDelete && /* @__PURE__ */ jsx81(DeleteQuestion, { noun, onDelete, refused: deleteRefused, onClose: () => setDeleting(false), children: deleteNote !== void 0 ? typeof deleteNote === "string" ? /* @__PURE__ */ jsx81("p", { children: deleteNote }) : deleteNote : /* @__PURE__ */ jsxs59(Fragment23, { children: [
|
|
6159
6214
|
/* @__PURE__ */ jsx81("p", { children: "It is deleted for everyone." }),
|
|
6160
6215
|
replies && replies.count > 0 && /* @__PURE__ */ jsxs59("p", { children: [
|
|
6161
6216
|
"Its ",
|
|
@@ -6163,18 +6218,7 @@ function ConversationCard(props) {
|
|
|
6163
6218
|
"."
|
|
6164
6219
|
] })
|
|
6165
6220
|
] }) }),
|
|
6166
|
-
resolving && onResolve && /* @__PURE__ */ jsx81(
|
|
6167
|
-
ResolveDialog,
|
|
6168
|
-
{
|
|
6169
|
-
refused: resolveRefused,
|
|
6170
|
-
onCancel: () => setResolving(false),
|
|
6171
|
-
onResolve: async (note) => {
|
|
6172
|
-
const ok = await onResolve(note);
|
|
6173
|
-
if (ok !== false) setResolving(false);
|
|
6174
|
-
return ok;
|
|
6175
|
-
}
|
|
6176
|
-
}
|
|
6177
|
-
)
|
|
6221
|
+
resolving && onResolve && /* @__PURE__ */ jsx81(ResolveQuestion, { onResolve, refused: resolveRefused, onClose: () => setResolving(false) })
|
|
6178
6222
|
] });
|
|
6179
6223
|
}
|
|
6180
6224
|
function ReplyCard(props) {
|
|
@@ -6189,6 +6233,8 @@ function ReplyCard(props) {
|
|
|
6189
6233
|
const offersMenu = !!menu || !!menuAfter || own && (!!editor || !!onDelete);
|
|
6190
6234
|
const showStrip = hovered && !isEditing && !readOnly && (offersMenu || !!reactions?.onToggle);
|
|
6191
6235
|
const root = useRef19(null);
|
|
6236
|
+
const strip = useRef19(null);
|
|
6237
|
+
const wordsEnd = useClearOfStrip(root, strip, showStrip);
|
|
6192
6238
|
const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
|
|
6193
6239
|
const drawn = useContext14(repliesDrawn);
|
|
6194
6240
|
useLayoutEffect7(() => {
|
|
@@ -6219,16 +6265,16 @@ function ReplyCard(props) {
|
|
|
6219
6265
|
},
|
|
6220
6266
|
children: [
|
|
6221
6267
|
isEditing ? /* @__PURE__ */ jsx81(Editing, { author, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs59("div", { className: "flex flex-col items-start px-2 pt-2", children: [
|
|
6222
|
-
/* @__PURE__ */ jsx81(Head, { author, time: props.time, at: props.at, timeHref: props.timeHref, timeLabel: props.timeLabel, edited: props.edited, isNew, urgent }),
|
|
6268
|
+
/* @__PURE__ */ jsx81(Head, { author, time: props.time, at: props.at, timeHref: props.timeHref, timeLabel: props.timeLabel, edited: props.edited, isNew, urgent, end: wordsEnd }),
|
|
6223
6269
|
about && /* @__PURE__ */ jsx81("div", { className: "w-full pl-8 pr-2 pt-0.5", children: about }),
|
|
6224
6270
|
/* @__PURE__ */ jsx81(Words, { children }),
|
|
6225
6271
|
files && /* @__PURE__ */ jsx81("div", { className: "flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
|
|
6226
6272
|
/* @__PURE__ */ jsx81(Reactions, { reactions, refused: reactionRefused, readOnly })
|
|
6227
6273
|
] }),
|
|
6228
|
-
showStrip &&
|
|
6274
|
+
showStrip && // In a box of its own, as a comment's: the box is what the head measures to keep clear of.
|
|
6275
|
+
/* @__PURE__ */ jsx81("div", { ref: strip, className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx81(
|
|
6229
6276
|
ConversationActions,
|
|
6230
6277
|
{
|
|
6231
|
-
className: "absolute right-1 top-1 z-10",
|
|
6232
6278
|
options: reactions?.options,
|
|
6233
6279
|
onReact: reactions?.onToggle,
|
|
6234
6280
|
onPickerOpenChange: (open) => {
|
|
@@ -6254,11 +6300,11 @@ function ReplyCard(props) {
|
|
|
6254
6300
|
}
|
|
6255
6301
|
)
|
|
6256
6302
|
}
|
|
6257
|
-
)
|
|
6303
|
+
) })
|
|
6258
6304
|
]
|
|
6259
6305
|
}
|
|
6260
6306
|
),
|
|
6261
|
-
deleting && onDelete && /* @__PURE__ */ jsx81(
|
|
6307
|
+
deleting && onDelete && /* @__PURE__ */ jsx81(DeleteQuestion, { noun, onDelete, refused: deleteRefused, onClose: () => setDeleting(false), children: deleteNote === void 0 ? /* @__PURE__ */ jsx81("p", { children: "It is deleted for everyone." }) : typeof deleteNote === "string" ? /* @__PURE__ */ jsx81("p", { children: deleteNote }) : deleteNote })
|
|
6262
6308
|
] });
|
|
6263
6309
|
}
|
|
6264
6310
|
|