@estiva-app/ui 0.105.0 → 0.107.0
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/AttachmentCard.d.ts.map +1 -1
- package/dist/CommentBox.d.ts +10 -6
- package/dist/CommentBox.d.ts.map +1 -1
- package/dist/ConversationCard.d.ts +9 -3
- package/dist/ConversationCard.d.ts.map +1 -1
- package/dist/PinnedComment.d.ts +7 -1
- package/dist/PinnedComment.d.ts.map +1 -1
- package/dist/ReactionRow.d.ts +12 -2
- package/dist/ReactionRow.d.ts.map +1 -1
- package/dist/conversation.examples.d.ts +28 -2
- package/dist/conversation.examples.d.ts.map +1 -1
- package/dist/editor.js +163 -23
- package/dist/editor.js.map +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +240 -142
- package/dist/index.js.map +4 -4
- package/package.json +3 -3
- package/registry.json +55 -17
- package/src/AttachmentCard.tsx +4 -1
- package/src/CommentBox.mdx +5 -2
- package/src/CommentBox.stories.tsx +57 -25
- package/src/CommentBox.test.tsx +72 -12
- package/src/CommentBox.tsx +59 -23
- package/src/ConversationCard.mdx +3 -0
- package/src/ConversationCard.stories.tsx +33 -6
- package/src/ConversationCard.test.tsx +85 -1
- package/src/ConversationCard.tsx +48 -8
- package/src/PinnedComment.tsx +11 -3
- package/src/ReactionRow.tsx +8 -2
- package/src/Thread.stories.tsx +14 -1
- package/src/Thread.tsx +1 -1
- package/src/conversation.examples.tsx +36 -7
- package/src/index.ts +1 -1
- package/src/registry/registry.test.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -752,6 +752,7 @@ var typeLabelOf = (name) => extensionOf(name).toUpperCase() || "FILE";
|
|
|
752
752
|
var TILE_CLASSES = TYPE_TILE_CLASSES;
|
|
753
753
|
var NAME_CLASSES = "text-caption font-medium text-text-primary truncate";
|
|
754
754
|
var NOTE_CLASSES = "text-small tracking-wide leading-tight truncate";
|
|
755
|
+
var FAILED_NOTE_CLASSES = "text-small tracking-wide leading-tight line-clamp-2 text-error-default";
|
|
755
756
|
function TypeIcon({ name }) {
|
|
756
757
|
const Icon = ICON_BY_EXTENSION[extensionOf(name)] ?? IconFile;
|
|
757
758
|
return /* @__PURE__ */ jsx12(Icon, { size: 20, stroke: 1.5 });
|
|
@@ -912,7 +913,7 @@ function AttachmentCard({
|
|
|
912
913
|
{
|
|
913
914
|
text: (failed || warning ? note : state === "uploading" ? note ?? "Uploading\u2026" : note ?? sizeText) ?? "",
|
|
914
915
|
hint: noteHint,
|
|
915
|
-
className:
|
|
916
|
+
className: failed ? FAILED_NOTE_CLASSES : cn(NOTE_CLASSES, warning ? "text-warning-default" : "text-text-secondary")
|
|
916
917
|
}
|
|
917
918
|
)
|
|
918
919
|
] }),
|
|
@@ -4801,8 +4802,75 @@ function archivedLine(archive, noun, options = {}) {
|
|
|
4801
4802
|
if (!archive.with)
|
|
4802
4803
|
return `Archived. Unarchive it${where} to ${to}.`;
|
|
4803
4804
|
const word = noun?.trim();
|
|
4804
|
-
return `Unarchive the ${word
|
|
4805
|
+
return `Unarchive the ${word || "parent"}${where} to ${to}.`;
|
|
4806
|
+
}
|
|
4807
|
+
|
|
4808
|
+
// node_modules/@estiva-app/conversation/dist/refusals.js
|
|
4809
|
+
var REFUSAL_REASONS = {
|
|
4810
|
+
"too-long": "it is too long",
|
|
4811
|
+
gone: "this message was deleted, or you can no longer write here",
|
|
4812
|
+
"no-access": "you can no longer write here",
|
|
4813
|
+
archived: "this team is archived",
|
|
4814
|
+
busy: "too many at once, try again in a moment",
|
|
4815
|
+
clock: "your computer\u2019s clock is wrong; set it and try again",
|
|
4816
|
+
"signed-out": "you are signed out; sign in again",
|
|
4817
|
+
unknown: "something went wrong, try again"
|
|
4818
|
+
};
|
|
4819
|
+
function textOf(reason) {
|
|
4820
|
+
if (reason == null)
|
|
4821
|
+
return "";
|
|
4822
|
+
if (typeof reason === "string") {
|
|
4823
|
+
const json = reason.trim();
|
|
4824
|
+
if (json.startsWith("{")) {
|
|
4825
|
+
try {
|
|
4826
|
+
return textOf(JSON.parse(json)) || reason;
|
|
4827
|
+
} catch {
|
|
4828
|
+
return reason;
|
|
4829
|
+
}
|
|
4830
|
+
}
|
|
4831
|
+
return reason;
|
|
4832
|
+
}
|
|
4833
|
+
if (reason instanceof Error)
|
|
4834
|
+
return textOf(reason.message);
|
|
4835
|
+
if (typeof reason === "object") {
|
|
4836
|
+
const r = reason;
|
|
4837
|
+
for (const key of ["error", "message", "reason"]) {
|
|
4838
|
+
const value = r[key];
|
|
4839
|
+
if (typeof value === "string")
|
|
4840
|
+
return textOf(value);
|
|
4841
|
+
if (value && typeof value === "object")
|
|
4842
|
+
return textOf(value);
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4845
|
+
return String(reason);
|
|
4846
|
+
}
|
|
4847
|
+
var CAUSES = new Set(Object.keys(REFUSAL_REASONS));
|
|
4848
|
+
var RULES = [
|
|
4849
|
+
[/content (is \d+ bytes, max|exceeds maximum size)|too long/i, "too-long"],
|
|
4850
|
+
[/rate-limited|quota|too many|too busy|relay is busy|admission|\b429\b|concurrency/i, "busy"],
|
|
4851
|
+
[/timestamp too far|clock/i, "clock"],
|
|
4852
|
+
[/auth-required|insufficient scope|does not match authenticated|signed out|sign in|\b401\b|token_rejected|session_expired/i, "signed-out"],
|
|
4853
|
+
[/archived/i, "archived"],
|
|
4854
|
+
[/target (event )?not found|not (editable|deletable) by you|was deleted|no longer on this page/i, "gone"],
|
|
4855
|
+
[/^(restricted|blocked):|not a (channel |relay )?member|only members|no longer (post|write)|banned|timed out until|writes are fenced|\b403\b/i, "no-access"]
|
|
4856
|
+
];
|
|
4857
|
+
function refusalCause(reason) {
|
|
4858
|
+
if (reason && typeof reason === "object" && "cause" in reason) {
|
|
4859
|
+
const cause = reason.cause;
|
|
4860
|
+
if (typeof cause === "string" && CAUSES.has(cause))
|
|
4861
|
+
return cause;
|
|
4862
|
+
}
|
|
4863
|
+
const text = textOf(reason);
|
|
4864
|
+
for (const [rule, cause] of RULES)
|
|
4865
|
+
if (rule.test(text))
|
|
4866
|
+
return cause;
|
|
4867
|
+
return "unknown";
|
|
4868
|
+
}
|
|
4869
|
+
function refusalReason(reason) {
|
|
4870
|
+
return REFUSAL_REASONS[refusalCause(reason)];
|
|
4805
4871
|
}
|
|
4872
|
+
var MB = 1024 * 1024;
|
|
4873
|
+
var UPLOAD_LIMITS = { gif: 10 * MB, image: 50 * MB, other: 1e8 };
|
|
4806
4874
|
|
|
4807
4875
|
// src/archivedLine.ts
|
|
4808
4876
|
var archivedLine2 = archivedLine;
|
|
@@ -5948,16 +6016,32 @@ function useFaceLine(root, active, toDot = false) {
|
|
|
5948
6016
|
return line;
|
|
5949
6017
|
}
|
|
5950
6018
|
|
|
6019
|
+
// src/PinnedComment.tsx
|
|
6020
|
+
import { jsx as jsx81, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6021
|
+
var goneWords = (deleted) => deleted ? "This comment was deleted." : "This comment can\u2019t be shown.";
|
|
6022
|
+
var GONE_CLOSED = "This thread takes no new replies.";
|
|
6023
|
+
function PinnedComment({ author, time, at: given, words, deleted = false, unseen = false }) {
|
|
6024
|
+
const at = momentOf(given);
|
|
6025
|
+
return /* @__PURE__ */ jsx81(Card, { fill: "elevated", clip: true, children: deleted || unseen ? /* @__PURE__ */ jsx81("p", { className: "p-2 text-caption italic text-text-muted", children: goneWords(deleted) }) : /* @__PURE__ */ jsxs59("div", { className: "flex flex-col p-2", children: [
|
|
6026
|
+
/* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2", children: [
|
|
6027
|
+
/* @__PURE__ */ jsx81(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }),
|
|
6028
|
+
/* @__PURE__ */ jsx81("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
|
|
6029
|
+
/* @__PURE__ */ jsx81(MetaText, { className: "shrink-0", children: at === void 0 ? time : /* @__PURE__ */ jsx81(WithTooltip, { label: exactTime(at), children: /* @__PURE__ */ jsx81("time", { dateTime: new Date(at).toISOString(), children: time }) }) })
|
|
6030
|
+
] }),
|
|
6031
|
+
/* @__PURE__ */ jsx81("div", { className: "pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx81("div", { className: "truncate text-caption text-text-secondary", children: words }) })
|
|
6032
|
+
] }) });
|
|
6033
|
+
}
|
|
6034
|
+
|
|
5951
6035
|
// src/ConversationCard.tsx
|
|
5952
|
-
import { Fragment as Fragment23, jsx as
|
|
6036
|
+
import { Fragment as Fragment23, jsx as jsx82, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
5953
6037
|
function When({ time, at: given, timeHref, timeLabel = "Link to this" }) {
|
|
5954
6038
|
const at = momentOf(given);
|
|
5955
6039
|
const exact = at === void 0 ? void 0 : exactTime(at);
|
|
5956
|
-
const said = at === void 0 ? time : /* @__PURE__ */
|
|
6040
|
+
const said = at === void 0 ? time : /* @__PURE__ */ jsx82("time", { dateTime: new Date(at).toISOString(), children: time });
|
|
5957
6041
|
if (timeHref) {
|
|
5958
|
-
return /* @__PURE__ */
|
|
6042
|
+
return /* @__PURE__ */ jsx82(WithTooltip, { label: exact ? `${exact} \xB7 ${timeLabel}` : timeLabel, wrapperClassName: "shrink-0", children: /* @__PURE__ */ jsx82(MetaText, { className: "contents", children: /* @__PURE__ */ jsx82(Link, { href: timeHref, variant: "quiet", "data-interactive": true, children: said }) }) });
|
|
5959
6043
|
}
|
|
5960
|
-
return /* @__PURE__ */
|
|
6044
|
+
return /* @__PURE__ */ jsx82(MetaText, { className: "shrink-0", children: exact ? /* @__PURE__ */ jsx82(WithTooltip, { label: exact, children: said }) : time });
|
|
5961
6045
|
}
|
|
5962
6046
|
var fadeBefore = (end) => `linear-gradient(to right, black ${end - 16}px, transparent ${end}px)`;
|
|
5963
6047
|
function useClearOfStrip(root, strip, shown2) {
|
|
@@ -5975,15 +6059,15 @@ function useClearOfStrip(root, strip, shown2) {
|
|
|
5975
6059
|
return end;
|
|
5976
6060
|
}
|
|
5977
6061
|
function Head({ author, time, at, timeHref, timeLabel, edited, isNew, urgent, meta, end }) {
|
|
5978
|
-
return /* @__PURE__ */
|
|
5979
|
-
/* @__PURE__ */
|
|
5980
|
-
/* @__PURE__ */
|
|
5981
|
-
/* @__PURE__ */
|
|
5982
|
-
/* @__PURE__ */
|
|
5983
|
-
/* @__PURE__ */
|
|
6062
|
+
return /* @__PURE__ */ jsxs60("div", { className: "flex w-full items-center gap-2", children: [
|
|
6063
|
+
/* @__PURE__ */ jsxs60("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: [
|
|
6064
|
+
/* @__PURE__ */ jsx82("span", { "data-face": true, className: "relative flex shrink-0", children: /* @__PURE__ */ jsx82(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }) }),
|
|
6065
|
+
/* @__PURE__ */ jsx82("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
|
|
6066
|
+
/* @__PURE__ */ jsx82(When, { time, at, timeHref, timeLabel }),
|
|
6067
|
+
/* @__PURE__ */ jsx82(EditedMarker, { edited }),
|
|
5984
6068
|
meta
|
|
5985
6069
|
] }),
|
|
5986
|
-
isNew && (urgent ? /* @__PURE__ */
|
|
6070
|
+
isNew && (urgent ? /* @__PURE__ */ jsx82(UrgentMark, {}) : /* @__PURE__ */ jsx82(UnreadDot, {}))
|
|
5987
6071
|
] });
|
|
5988
6072
|
}
|
|
5989
6073
|
function attentionOf(fresh, urgent, inThreadCard) {
|
|
@@ -5991,13 +6075,13 @@ function attentionOf(fresh, urgent, inThreadCard) {
|
|
|
5991
6075
|
return urgent ? "warning" : "accent";
|
|
5992
6076
|
}
|
|
5993
6077
|
function EndedLine({ by, note, at }) {
|
|
5994
|
-
return /* @__PURE__ */
|
|
5995
|
-
/* @__PURE__ */
|
|
5996
|
-
/* @__PURE__ */
|
|
5997
|
-
/* @__PURE__ */
|
|
5998
|
-
/* @__PURE__ */
|
|
5999
|
-
/* @__PURE__ */
|
|
6000
|
-
at && /* @__PURE__ */
|
|
6078
|
+
return /* @__PURE__ */ jsxs60("div", { "data-resolved": "line", className: "relative flex items-start py-1", children: [
|
|
6079
|
+
/* @__PURE__ */ jsx82("span", { className: "flex h-[17px] w-10 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx82("span", { "data-dot": true, className: "relative z-10 flex size-2 items-center justify-center rounded-full bg-bg-surface", children: /* @__PURE__ */ jsx82("span", { className: "size-1 rounded-full bg-success-default" }) }) }),
|
|
6080
|
+
/* @__PURE__ */ jsxs60("p", { className: "min-w-0 text-h5 leading-snug", children: [
|
|
6081
|
+
/* @__PURE__ */ jsx82("span", { className: "whitespace-nowrap text-text-primary", children: by }),
|
|
6082
|
+
/* @__PURE__ */ jsx82(IconArrowNarrowRight, { size: 12, stroke: 1.5, className: "mx-1.5 -mt-px inline shrink-0 text-text-primary" }),
|
|
6083
|
+
/* @__PURE__ */ jsx82("span", { className: "text-text-secondary", children: note }),
|
|
6084
|
+
at && /* @__PURE__ */ jsxs60(MetaText, { size: "chip", children: [
|
|
6001
6085
|
" \xB7 ",
|
|
6002
6086
|
at
|
|
6003
6087
|
] })
|
|
@@ -6006,19 +6090,42 @@ function EndedLine({ by, note, at }) {
|
|
|
6006
6090
|
}
|
|
6007
6091
|
function ResolvedCheck({ by, note, at }) {
|
|
6008
6092
|
const said = `Resolved by ${by}${at ? `, ${at}` : ""}${note ? `: ${note}` : ""}`;
|
|
6009
|
-
return /* @__PURE__ */
|
|
6010
|
-
/* @__PURE__ */
|
|
6093
|
+
return /* @__PURE__ */ jsx82(WithTooltip, { label: said, wrapperClassName: "flex shrink-0", children: /* @__PURE__ */ jsxs60("span", { className: "flex items-center gap-1 text-caption text-success-default", children: [
|
|
6094
|
+
/* @__PURE__ */ jsx82(IconCircleCheck4, { size: 14, stroke: 1.5 }),
|
|
6011
6095
|
"Resolved"
|
|
6012
6096
|
] }) });
|
|
6013
6097
|
}
|
|
6014
6098
|
function Words({ children }) {
|
|
6015
|
-
return /* @__PURE__ */
|
|
6099
|
+
return /* @__PURE__ */ jsx82("div", { className: "relative w-full break-words pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx82("div", { className: "flex flex-col gap-2 text-body-2 text-text-secondary", children }) });
|
|
6100
|
+
}
|
|
6101
|
+
function useReactionRefusal(reactions) {
|
|
6102
|
+
const [refused, setRefused] = useState23();
|
|
6103
|
+
const latest = useRef19(0);
|
|
6104
|
+
const toggle = reactions?.onToggle;
|
|
6105
|
+
if (!reactions || !toggle) return { row: reactions, refused };
|
|
6106
|
+
const onToggle = (emoji) => {
|
|
6107
|
+
const mine = ++latest.current;
|
|
6108
|
+
setRefused(void 0);
|
|
6109
|
+
const say = (reason) => {
|
|
6110
|
+
if (mine === latest.current) setRefused(refusalReason(reason));
|
|
6111
|
+
};
|
|
6112
|
+
const answer = toggle(emoji);
|
|
6113
|
+
if (!answer) return;
|
|
6114
|
+
return answer.then((said) => {
|
|
6115
|
+
if (said && !said.accepted) say(said.reason);
|
|
6116
|
+
return said;
|
|
6117
|
+
}, (reason) => {
|
|
6118
|
+
say(reason);
|
|
6119
|
+
return { accepted: false, reason };
|
|
6120
|
+
});
|
|
6121
|
+
};
|
|
6122
|
+
return { row: { ...reactions, onToggle }, refused };
|
|
6016
6123
|
}
|
|
6017
6124
|
function Reactions({ reactions, refused, readOnly }) {
|
|
6018
6125
|
if ((!reactions || reactions.reactions.length === 0) && !refused) return null;
|
|
6019
|
-
return /* @__PURE__ */
|
|
6020
|
-
reactions && /* @__PURE__ */
|
|
6021
|
-
refused && /* @__PURE__ */
|
|
6126
|
+
return /* @__PURE__ */ jsxs60("div", { className: "relative flex w-full flex-col gap-1 pb-2 pl-8 pt-1", children: [
|
|
6127
|
+
reactions && /* @__PURE__ */ jsx82(ReactionRow, { ...reactions, onToggle: readOnly ? void 0 : reactions.onToggle }),
|
|
6128
|
+
refused && /* @__PURE__ */ jsxs60(FieldLine, { tone: "error", children: [
|
|
6022
6129
|
"Not reacted: ",
|
|
6023
6130
|
refused,
|
|
6024
6131
|
"."
|
|
@@ -6026,9 +6133,9 @@ function Reactions({ reactions, refused, readOnly }) {
|
|
|
6026
6133
|
] });
|
|
6027
6134
|
}
|
|
6028
6135
|
function Editing({ author, children }) {
|
|
6029
|
-
return /* @__PURE__ */
|
|
6030
|
-
/* @__PURE__ */
|
|
6031
|
-
/* @__PURE__ */
|
|
6136
|
+
return /* @__PURE__ */ jsx82("div", { className: "p-2", children: /* @__PURE__ */ jsxs60("div", { className: "flex items-start gap-2", children: [
|
|
6137
|
+
/* @__PURE__ */ jsx82(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot, className: "mt-1 shrink-0" }),
|
|
6138
|
+
/* @__PURE__ */ jsx82("div", { className: "min-w-0 flex-1", children })
|
|
6032
6139
|
] }) });
|
|
6033
6140
|
}
|
|
6034
6141
|
function stillHere(root) {
|
|
@@ -6041,7 +6148,7 @@ function stillHere(root) {
|
|
|
6041
6148
|
}
|
|
6042
6149
|
function DeleteQuestion({ noun, onDelete, refused, onClose, children }) {
|
|
6043
6150
|
const [answered, setAnswered] = useState23(false);
|
|
6044
|
-
return /* @__PURE__ */
|
|
6151
|
+
return /* @__PURE__ */ jsx82(
|
|
6045
6152
|
ConfirmDialog,
|
|
6046
6153
|
{
|
|
6047
6154
|
title: `Delete this ${noun}?`,
|
|
@@ -6060,7 +6167,7 @@ function DeleteQuestion({ noun, onDelete, refused, onClose, children }) {
|
|
|
6060
6167
|
}
|
|
6061
6168
|
function ResolveQuestion({ onResolve, refused, onClose }) {
|
|
6062
6169
|
const [answered, setAnswered] = useState23(false);
|
|
6063
|
-
return /* @__PURE__ */
|
|
6170
|
+
return /* @__PURE__ */ jsx82(
|
|
6064
6171
|
ResolveDialog,
|
|
6065
6172
|
{
|
|
6066
6173
|
refused: answered ? refused : void 0,
|
|
@@ -6084,7 +6191,8 @@ function useEditing(editing, onEditingChange) {
|
|
|
6084
6191
|
return [now, set];
|
|
6085
6192
|
}
|
|
6086
6193
|
function ConversationCard(props) {
|
|
6087
|
-
const { author, about, files, reactions,
|
|
6194
|
+
const { author, about, files, reactions, isNew = false, urgent = false, own = false, editor, deleted: isDeleted = false, unseen = false, replies, onReply, resolved, noun = "comment", onResolve, resolveHint, resolveRefused, onReopen, selected, onClick, onDelete, deleteNote, deleteRefused, menu, menuAfter, menuLabel, editLabel, deleteLabel, moreLabel = "More actions", className, children } = props;
|
|
6195
|
+
const deleted = isDeleted || unseen;
|
|
6088
6196
|
const readOnly = (props.readOnly ?? false) || deleted;
|
|
6089
6197
|
const inThreadCard = useContext14(InThreadCard);
|
|
6090
6198
|
const item = useContext14(InConversationItem);
|
|
@@ -6106,14 +6214,15 @@ function ConversationCard(props) {
|
|
|
6106
6214
|
const showStrip = hovered && !isEditing && !readOnly;
|
|
6107
6215
|
const strip = useRef19(null);
|
|
6108
6216
|
const wordsEnd = useClearOfStrip(root, strip, showStrip);
|
|
6109
|
-
const
|
|
6217
|
+
const { row: reactionRow, refused: reactionRefused } = useReactionRefusal(reactions);
|
|
6218
|
+
const react = reactionRow?.onToggle;
|
|
6110
6219
|
const press = onClick ?? (readOnly && !replies?.count ? void 0 : item?.toggle);
|
|
6111
6220
|
const reply = onReply ?? item?.show;
|
|
6112
6221
|
const marked = selected ?? (item && !item.under ? item.open : void 0);
|
|
6113
6222
|
const under = !!item?.under;
|
|
6114
|
-
const repliesRow = replies && replies.count > 0 && /* @__PURE__ */
|
|
6115
|
-
return /* @__PURE__ */
|
|
6116
|
-
/* @__PURE__ */
|
|
6223
|
+
const repliesRow = replies && replies.count > 0 && /* @__PURE__ */ jsx82(RepliesRow, { ...replies, onOpen: replies.onOpen ?? (under ? item?.toggle : void 0), open: replies.open ?? (under && !!item?.open), urgent });
|
|
6224
|
+
return /* @__PURE__ */ jsxs60(Fragment23, { children: [
|
|
6225
|
+
/* @__PURE__ */ jsxs60(
|
|
6117
6226
|
Card,
|
|
6118
6227
|
{
|
|
6119
6228
|
ref: root,
|
|
@@ -6138,12 +6247,12 @@ function ConversationCard(props) {
|
|
|
6138
6247
|
setHovered(false);
|
|
6139
6248
|
},
|
|
6140
6249
|
children: [
|
|
6141
|
-
isEditing ? /* @__PURE__ */
|
|
6142
|
-
deleted ? /* @__PURE__ */
|
|
6143
|
-
!!about && /* @__PURE__ */
|
|
6144
|
-
/* @__PURE__ */
|
|
6145
|
-
] }) : /* @__PURE__ */
|
|
6146
|
-
/* @__PURE__ */
|
|
6250
|
+
isEditing ? /* @__PURE__ */ jsx82(Editing, { author, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs60("div", { "data-comment-body": true, className: "flex flex-col items-start px-2 pt-2", children: [
|
|
6251
|
+
deleted ? /* @__PURE__ */ jsxs60(Fragment23, { children: [
|
|
6252
|
+
!!about && /* @__PURE__ */ jsx82("div", { className: "relative w-full pl-8 pr-2", children: about }),
|
|
6253
|
+
/* @__PURE__ */ jsx82("p", { className: cn("w-full pb-2 pl-8 pr-2 text-caption italic text-text-muted", !!about && "pt-1"), children: goneWords(isDeleted) })
|
|
6254
|
+
] }) : /* @__PURE__ */ jsxs60(Fragment23, { children: [
|
|
6255
|
+
/* @__PURE__ */ jsx82(
|
|
6147
6256
|
Head,
|
|
6148
6257
|
{
|
|
6149
6258
|
author,
|
|
@@ -6154,24 +6263,24 @@ function ConversationCard(props) {
|
|
|
6154
6263
|
edited: props.edited,
|
|
6155
6264
|
isNew,
|
|
6156
6265
|
urgent,
|
|
6157
|
-
meta: resolved && /* @__PURE__ */
|
|
6266
|
+
meta: resolved && /* @__PURE__ */ jsx82(ResolvedCheck, { by: resolved.by, note: resolved.note, at: resolved.at }),
|
|
6158
6267
|
end: wordsEnd
|
|
6159
6268
|
}
|
|
6160
6269
|
),
|
|
6161
6270
|
!!about && // Under the name, above the words (Katerina, 1 November).
|
|
6162
|
-
/* @__PURE__ */
|
|
6163
|
-
/* @__PURE__ */
|
|
6271
|
+
/* @__PURE__ */ jsx82("div", { className: "relative w-full pl-8 pr-2 pt-0.5", children: about }),
|
|
6272
|
+
/* @__PURE__ */ jsx82(Words, { children })
|
|
6164
6273
|
] }),
|
|
6165
|
-
!deleted && files && /* @__PURE__ */
|
|
6166
|
-
/* @__PURE__ */
|
|
6274
|
+
!deleted && files && /* @__PURE__ */ jsx82("div", { className: "relative flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
|
|
6275
|
+
/* @__PURE__ */ jsx82(Reactions, { reactions: reactionRow, refused: reactionRefused, readOnly }),
|
|
6167
6276
|
resolved?.note && // Who resolved it and the note, above the way into the replies; the check by the time says "Resolved" (Katerina, 1 November).
|
|
6168
|
-
/* @__PURE__ */
|
|
6169
|
-
repliesRow && /* @__PURE__ */
|
|
6277
|
+
/* @__PURE__ */ jsx82("div", { className: "relative w-full pb-1", children: /* @__PURE__ */ jsx82("div", { className: "-ml-2 w-[calc(100%+8px)]", children: /* @__PURE__ */ jsx82(EndedLine, { by: resolved.by, note: resolved.note, at: resolved.at }) }) }),
|
|
6278
|
+
repliesRow && /* @__PURE__ */ jsx82("div", { className: "relative w-full", children: repliesRow })
|
|
6170
6279
|
] }),
|
|
6171
6280
|
dotLine && // One bar from the face to the dot, measured (useFaceLine): 2px, centred under the 24px face, 8px in.
|
|
6172
6281
|
// Its top and height come from the measure: where the face ends and the dot stands are not known ahead.
|
|
6173
|
-
/* @__PURE__ */
|
|
6174
|
-
showStrip && /* @__PURE__ */
|
|
6282
|
+
/* @__PURE__ */ jsx82("span", { "aria-hidden": true, className: "pointer-events-none absolute left-[19px] w-0.5 bg-border-default", style: { top: dotLine.top, height: dotLine.height } }),
|
|
6283
|
+
showStrip && /* @__PURE__ */ jsx82("div", { ref: strip, className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx82(
|
|
6175
6284
|
ConversationActions,
|
|
6176
6285
|
{
|
|
6177
6286
|
options: reactions?.options,
|
|
@@ -6184,10 +6293,10 @@ function ConversationCard(props) {
|
|
|
6184
6293
|
resolved: !!resolved,
|
|
6185
6294
|
onResolve: onResolve && (() => setResolving(true)),
|
|
6186
6295
|
onReopen,
|
|
6187
|
-
more: offersMenu && /* @__PURE__ */
|
|
6296
|
+
more: offersMenu && /* @__PURE__ */ jsx82(
|
|
6188
6297
|
ConversationMenu,
|
|
6189
6298
|
{
|
|
6190
|
-
trigger: /* @__PURE__ */
|
|
6299
|
+
trigger: /* @__PURE__ */ jsx82(ToolbarButton, { tooltip: moreLabel, "aria-label": moreLabel, children: /* @__PURE__ */ jsx82(IconDotsVertical4, { size: 16, stroke: 1.5 }) }),
|
|
6191
6300
|
open: menuOpen,
|
|
6192
6301
|
onOpenChange: (open) => {
|
|
6193
6302
|
setMenuOpen(open);
|
|
@@ -6211,19 +6320,20 @@ function ConversationCard(props) {
|
|
|
6211
6320
|
]
|
|
6212
6321
|
}
|
|
6213
6322
|
),
|
|
6214
|
-
deleting && onDelete && /* @__PURE__ */
|
|
6215
|
-
/* @__PURE__ */
|
|
6216
|
-
replies && replies.count > 0 && /* @__PURE__ */
|
|
6323
|
+
deleting && onDelete && /* @__PURE__ */ jsx82(DeleteQuestion, { noun, onDelete, refused: deleteRefused, onClose: () => setDeleting(false), children: deleteNote !== void 0 ? typeof deleteNote === "string" ? /* @__PURE__ */ jsx82("p", { children: deleteNote }) : deleteNote : /* @__PURE__ */ jsxs60(Fragment23, { children: [
|
|
6324
|
+
/* @__PURE__ */ jsx82("p", { children: "It is deleted for everyone." }),
|
|
6325
|
+
replies && replies.count > 0 && /* @__PURE__ */ jsxs60("p", { children: [
|
|
6217
6326
|
"Its ",
|
|
6218
6327
|
replies.count === 1 ? "reply stays" : `${replies.count} replies stay`,
|
|
6219
6328
|
"."
|
|
6220
6329
|
] })
|
|
6221
6330
|
] }) }),
|
|
6222
|
-
resolving && onResolve && /* @__PURE__ */
|
|
6331
|
+
resolving && onResolve && /* @__PURE__ */ jsx82(ResolveQuestion, { onResolve, refused: resolveRefused, onClose: () => setResolving(false) })
|
|
6223
6332
|
] });
|
|
6224
6333
|
}
|
|
6225
6334
|
function ReplyCard(props) {
|
|
6226
|
-
const { id, author, about, files,
|
|
6335
|
+
const { id, author, about, files, isNew = false, urgent = false, own = false, editor, onDelete, deleteNote, deleteRefused, menu, menuAfter, menuLabel, editLabel, deleteLabel, moreLabel = "More actions", noun = "reply", className, children } = props;
|
|
6336
|
+
const { row: reactions, refused: reactionRefused } = useReactionRefusal(props.reactions);
|
|
6227
6337
|
const readOnly = props.readOnly ?? false;
|
|
6228
6338
|
const [hovered, setHovered] = useState23(false);
|
|
6229
6339
|
const [menuOpen, setMenuOpen] = useState23(false);
|
|
@@ -6241,8 +6351,8 @@ function ReplyCard(props) {
|
|
|
6241
6351
|
useLayoutEffect7(() => {
|
|
6242
6352
|
if (drawn) drawn.added += 1;
|
|
6243
6353
|
}, [drawn]);
|
|
6244
|
-
return /* @__PURE__ */
|
|
6245
|
-
/* @__PURE__ */
|
|
6354
|
+
return /* @__PURE__ */ jsxs60(Fragment23, { children: [
|
|
6355
|
+
/* @__PURE__ */ jsxs60(
|
|
6246
6356
|
Card,
|
|
6247
6357
|
{
|
|
6248
6358
|
ref: root,
|
|
@@ -6265,15 +6375,15 @@ function ReplyCard(props) {
|
|
|
6265
6375
|
setHovered(false);
|
|
6266
6376
|
},
|
|
6267
6377
|
children: [
|
|
6268
|
-
isEditing ? /* @__PURE__ */
|
|
6269
|
-
/* @__PURE__ */
|
|
6270
|
-
about && /* @__PURE__ */
|
|
6271
|
-
/* @__PURE__ */
|
|
6272
|
-
files && /* @__PURE__ */
|
|
6273
|
-
/* @__PURE__ */
|
|
6378
|
+
isEditing ? /* @__PURE__ */ jsx82(Editing, { author, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs60("div", { className: "flex flex-col items-start px-2 pt-2", children: [
|
|
6379
|
+
/* @__PURE__ */ jsx82(Head, { author, time: props.time, at: props.at, timeHref: props.timeHref, timeLabel: props.timeLabel, edited: props.edited, isNew, urgent, end: wordsEnd }),
|
|
6380
|
+
about && /* @__PURE__ */ jsx82("div", { className: "w-full pl-8 pr-2 pt-0.5", children: about }),
|
|
6381
|
+
/* @__PURE__ */ jsx82(Words, { children }),
|
|
6382
|
+
files && /* @__PURE__ */ jsx82("div", { className: "flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
|
|
6383
|
+
/* @__PURE__ */ jsx82(Reactions, { reactions, refused: reactionRefused, readOnly })
|
|
6274
6384
|
] }),
|
|
6275
6385
|
showStrip && // In a box of its own, as a comment's: the box is what the head measures to keep clear of.
|
|
6276
|
-
/* @__PURE__ */
|
|
6386
|
+
/* @__PURE__ */ jsx82("div", { ref: strip, className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx82(
|
|
6277
6387
|
ConversationActions,
|
|
6278
6388
|
{
|
|
6279
6389
|
options: reactions?.options,
|
|
@@ -6282,10 +6392,10 @@ function ReplyCard(props) {
|
|
|
6282
6392
|
setPicking(open);
|
|
6283
6393
|
if (!open) settle();
|
|
6284
6394
|
},
|
|
6285
|
-
more: offersMenu && /* @__PURE__ */
|
|
6395
|
+
more: offersMenu && /* @__PURE__ */ jsx82(
|
|
6286
6396
|
ConversationMenu,
|
|
6287
6397
|
{
|
|
6288
|
-
trigger: /* @__PURE__ */
|
|
6398
|
+
trigger: /* @__PURE__ */ jsx82(ToolbarButton, { tooltip: moreLabel, "aria-label": moreLabel, children: /* @__PURE__ */ jsx82(IconDotsVertical4, { size: 16, stroke: 1.5 }) }),
|
|
6289
6399
|
open: menuOpen,
|
|
6290
6400
|
onOpenChange: (next) => {
|
|
6291
6401
|
setMenuOpen(next);
|
|
@@ -6305,7 +6415,7 @@ function ReplyCard(props) {
|
|
|
6305
6415
|
]
|
|
6306
6416
|
}
|
|
6307
6417
|
),
|
|
6308
|
-
deleting && onDelete && /* @__PURE__ */
|
|
6418
|
+
deleting && onDelete && /* @__PURE__ */ jsx82(DeleteQuestion, { noun, onDelete, refused: deleteRefused, onClose: () => setDeleting(false), children: deleteNote === void 0 ? /* @__PURE__ */ jsx82("p", { children: "It is deleted for everyone." }) : typeof deleteNote === "string" ? /* @__PURE__ */ jsx82("p", { children: deleteNote }) : deleteNote })
|
|
6309
6419
|
] });
|
|
6310
6420
|
}
|
|
6311
6421
|
|
|
@@ -6313,27 +6423,27 @@ function ReplyCard(props) {
|
|
|
6313
6423
|
import { Fragment as Fragment24, useCallback as useCallback6, useEffect as useEffect14, useLayoutEffect as useLayoutEffect8, useRef as useRef20, useState as useState25 } from "react";
|
|
6314
6424
|
|
|
6315
6425
|
// src/Panel.tsx
|
|
6316
|
-
import { jsx as
|
|
6426
|
+
import { jsx as jsx83, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6317
6427
|
function Frame({ title, chevron = false, actions, header, children, footer, bodyClassName, bodyRef, onBodyScroll, className, broken = false }) {
|
|
6318
|
-
return /* @__PURE__ */
|
|
6319
|
-
header ?? /* @__PURE__ */
|
|
6428
|
+
return /* @__PURE__ */ jsxs61("div", { className: cn("flex h-full min-h-0 flex-1 flex-col", className), children: [
|
|
6429
|
+
header ?? /* @__PURE__ */ jsx83(ContainerHeader, { title, chevron, actions }),
|
|
6320
6430
|
broken ? (
|
|
6321
6431
|
// The message takes the room the body had and centres itself in it.
|
|
6322
|
-
/* @__PURE__ */
|
|
6323
|
-
) : /* @__PURE__ */
|
|
6324
|
-
!broken && footer && /* @__PURE__ */
|
|
6432
|
+
/* @__PURE__ */ jsx83("div", { className: "flex min-h-0 flex-1 flex-col px-4", children })
|
|
6433
|
+
) : /* @__PURE__ */ jsx83(ScrollArea, { className: "min-h-0 flex-1", contentClassName: bodyClassName, viewportRef: bodyRef, onScroll: onBodyScroll, children }),
|
|
6434
|
+
!broken && footer && /* @__PURE__ */ jsx83("div", { className: "shrink-0", children: footer })
|
|
6325
6435
|
] });
|
|
6326
6436
|
}
|
|
6327
6437
|
function Panel(props) {
|
|
6328
|
-
return /* @__PURE__ */
|
|
6438
|
+
return /* @__PURE__ */ jsx83(
|
|
6329
6439
|
ErrorBoundary,
|
|
6330
6440
|
{
|
|
6331
6441
|
label: "panel",
|
|
6332
6442
|
frame: (message) => (
|
|
6333
6443
|
// Only the name comes back with the message: the actions and the footer may be what threw.
|
|
6334
|
-
/* @__PURE__ */
|
|
6444
|
+
/* @__PURE__ */ jsx83(Frame, { title: props.title, chevron: props.chevron, className: props.className, broken: true, children: message })
|
|
6335
6445
|
),
|
|
6336
|
-
children: /* @__PURE__ */
|
|
6446
|
+
children: /* @__PURE__ */ jsx83(Frame, { ...props })
|
|
6337
6447
|
}
|
|
6338
6448
|
);
|
|
6339
6449
|
}
|
|
@@ -6437,11 +6547,11 @@ function useWatchSeen(seen, root, attribute) {
|
|
|
6437
6547
|
}
|
|
6438
6548
|
|
|
6439
6549
|
// src/ConversationLayout.tsx
|
|
6440
|
-
import { Fragment as Fragment25, jsx as
|
|
6550
|
+
import { Fragment as Fragment25, jsx as jsx84, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
6441
6551
|
var threadOf = (item) => typeof item?.thread === "function" ? item.thread() : item?.thread;
|
|
6442
6552
|
function List({ items, open, under, above, loading, empty, change, caret }) {
|
|
6443
|
-
if (loading) return /* @__PURE__ */
|
|
6444
|
-
if (items.length === 0) return typeof empty === "string" ? /* @__PURE__ */
|
|
6553
|
+
if (loading) return /* @__PURE__ */ jsx84(SkeletonConversation, {});
|
|
6554
|
+
if (items.length === 0) return typeof empty === "string" ? /* @__PURE__ */ jsx84(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx84(Fragment25, { children: empty });
|
|
6445
6555
|
const stateOf = (item) => change && item.thread ? {
|
|
6446
6556
|
under,
|
|
6447
6557
|
open: open === item.id,
|
|
@@ -6450,12 +6560,12 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
|
|
|
6450
6560
|
} : null;
|
|
6451
6561
|
const draw2 = (item) => {
|
|
6452
6562
|
if (!under) {
|
|
6453
|
-
return /* @__PURE__ */
|
|
6563
|
+
return /* @__PURE__ */ jsxs62(Fragment24, { children: [
|
|
6454
6564
|
item.before,
|
|
6455
|
-
/* @__PURE__ */
|
|
6565
|
+
/* @__PURE__ */ jsx84("div", { "data-conversation-item": item.id, className: cn("flex flex-col", SHOWN_CLASSES), children: /* @__PURE__ */ jsx84(InConversationItem.Provider, { value: stateOf(item), children: item.card }) })
|
|
6456
6566
|
] }, item.id);
|
|
6457
6567
|
}
|
|
6458
|
-
return /* @__PURE__ */
|
|
6568
|
+
return /* @__PURE__ */ jsx84(UnderItem, { item, isOpen: open === item.id && !!item.thread, state: stateOf(item), caret }, item.id);
|
|
6459
6569
|
};
|
|
6460
6570
|
if (!under) {
|
|
6461
6571
|
const stretches = [];
|
|
@@ -6471,11 +6581,11 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
|
|
|
6471
6581
|
seen.set(name, count);
|
|
6472
6582
|
stretches.push({ key: `${item.day === void 0 ? "no-day" : `day:${name}`}#${count}`, day: item.day, items: [item] });
|
|
6473
6583
|
}
|
|
6474
|
-
return /* @__PURE__ */
|
|
6584
|
+
return /* @__PURE__ */ jsxs62(Fragment25, { children: [
|
|
6475
6585
|
above,
|
|
6476
6586
|
stretches.map(
|
|
6477
|
-
(stretch) => stretch.day === void 0 ? /* @__PURE__ */
|
|
6478
|
-
/* @__PURE__ */
|
|
6587
|
+
(stretch) => stretch.day === void 0 ? /* @__PURE__ */ jsx84(Fragment24, { children: stretch.items.map(draw2) }, stretch.key) : /* @__PURE__ */ jsxs62("div", { className: "flex flex-col gap-2", children: [
|
|
6588
|
+
/* @__PURE__ */ jsx84(Divider, { look: "section", label: stretch.day, sticky: true }),
|
|
6479
6589
|
stretch.items.map(draw2)
|
|
6480
6590
|
] }, stretch.key)
|
|
6481
6591
|
)
|
|
@@ -6483,11 +6593,11 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
|
|
|
6483
6593
|
}
|
|
6484
6594
|
const resolved = items.filter((item) => item.resolved);
|
|
6485
6595
|
const gone = items.filter((item) => item.gone && !item.resolved);
|
|
6486
|
-
const group = (title, list) => list.length > 0 && /* @__PURE__ */
|
|
6596
|
+
const group = (title, list) => list.length > 0 && /* @__PURE__ */ jsx84(
|
|
6487
6597
|
CollapsibleSection,
|
|
6488
6598
|
{
|
|
6489
6599
|
title,
|
|
6490
|
-
trailing: /* @__PURE__ */
|
|
6600
|
+
trailing: /* @__PURE__ */ jsx84(Chip, { type: "neutral", label: String(list.length) }),
|
|
6491
6601
|
defaultOpen: false,
|
|
6492
6602
|
openFor: list.some((item) => item.id === open) ? open : void 0,
|
|
6493
6603
|
className: "shrink-0",
|
|
@@ -6495,7 +6605,7 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
|
|
|
6495
6605
|
children: list.map(draw2)
|
|
6496
6606
|
}
|
|
6497
6607
|
);
|
|
6498
|
-
return /* @__PURE__ */
|
|
6608
|
+
return /* @__PURE__ */ jsxs62(Fragment25, { children: [
|
|
6499
6609
|
above,
|
|
6500
6610
|
items.filter((item) => !item.resolved && !item.gone).map(draw2),
|
|
6501
6611
|
group("On deleted blocks", gone),
|
|
@@ -6505,7 +6615,7 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
|
|
|
6505
6615
|
function UnderItem({ item, isOpen, state, caret }) {
|
|
6506
6616
|
const root = useRef20(null);
|
|
6507
6617
|
const line = useFaceLine(root, isOpen);
|
|
6508
|
-
return /* @__PURE__ */
|
|
6618
|
+
return /* @__PURE__ */ jsxs62(
|
|
6509
6619
|
Card,
|
|
6510
6620
|
{
|
|
6511
6621
|
ref: root,
|
|
@@ -6517,13 +6627,13 @@ function UnderItem({ item, isOpen, state, caret }) {
|
|
|
6517
6627
|
quietUntilHover: !isOpen,
|
|
6518
6628
|
className: cn("relative flex flex-col", isOpen && "pb-2", SHOWN_CLASSES),
|
|
6519
6629
|
children: [
|
|
6520
|
-
/* @__PURE__ */
|
|
6521
|
-
/* @__PURE__ */
|
|
6522
|
-
isOpen && /* @__PURE__ */
|
|
6630
|
+
/* @__PURE__ */ jsx84(InConversationItem.Provider, { value: state, children: /* @__PURE__ */ jsx84(InThreadCard.Provider, { value: isOpen, children: /* @__PURE__ */ jsxs62(LineByLayout.Provider, { value: true, children: [
|
|
6631
|
+
/* @__PURE__ */ jsx84("div", { className: "-m-px flex flex-col", children: item.card }),
|
|
6632
|
+
isOpen && /* @__PURE__ */ jsx84(caretOnOpen.Provider, { value: caret, children: threadOf(item) })
|
|
6523
6633
|
] }) }) }),
|
|
6524
6634
|
line && // The face's line, one bar, last so it stands over a hovered card's fill; 19px in, centred under the face.
|
|
6525
6635
|
// Its top and height come from the measure: where the face and the last reply end are not known ahead.
|
|
6526
|
-
/* @__PURE__ */
|
|
6636
|
+
/* @__PURE__ */ jsx84("span", { "aria-hidden": true, className: "pointer-events-none absolute left-[19px] w-0.5 bg-border-default", style: { top: line.top, height: line.height } })
|
|
6527
6637
|
]
|
|
6528
6638
|
}
|
|
6529
6639
|
);
|
|
@@ -6646,72 +6756,72 @@ function ConversationLayout({
|
|
|
6646
6756
|
// The body at least the column's height: the comments start at its top, and the note under them (`below`) is pushed
|
|
6647
6757
|
// to its foot, so with few comments it sits on the box, as a short conversation's last line does in Peek's two
|
|
6648
6758
|
// columns (Katerina, 2 November); with many it comes after them, and scrolls with them.
|
|
6649
|
-
/* @__PURE__ */
|
|
6650
|
-
/* @__PURE__ */
|
|
6651
|
-
!loading && below != null && below !== false && below !== "" && /* @__PURE__ */
|
|
6759
|
+
/* @__PURE__ */ jsxs62(Panel, { className: cn("w-[384px] flex-none", className), title, actions, bodyRef: setBody, bodyClassName: "flex min-h-full flex-col gap-2 p-3", footer: box && /* @__PURE__ */ jsx84("div", { className: "p-3", children: box }), children: [
|
|
6760
|
+
/* @__PURE__ */ jsx84(List, { items, open, under: true, above, loading, empty, change, caret }),
|
|
6761
|
+
!loading && below != null && below !== false && below !== "" && /* @__PURE__ */ jsx84("div", { className: "mt-auto flex flex-col gap-2", children: below })
|
|
6652
6762
|
] })
|
|
6653
6763
|
);
|
|
6654
6764
|
}
|
|
6655
6765
|
const opened = threadOf(items.find((item) => item.id === open));
|
|
6656
6766
|
const side = opened || aside;
|
|
6657
|
-
return /* @__PURE__ */
|
|
6658
|
-
/* @__PURE__ */
|
|
6767
|
+
return /* @__PURE__ */ jsxs62("div", { className: cn("flex min-h-0 min-w-0 flex-1", className), children: [
|
|
6768
|
+
/* @__PURE__ */ jsx84(
|
|
6659
6769
|
ErrorBoundary,
|
|
6660
6770
|
{
|
|
6661
6771
|
label: "conversation",
|
|
6662
|
-
frame: (message) => /* @__PURE__ */
|
|
6663
|
-
/* @__PURE__ */
|
|
6664
|
-
/* @__PURE__ */
|
|
6772
|
+
frame: (message) => /* @__PURE__ */ jsxs62("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
6773
|
+
/* @__PURE__ */ jsx84(ContainerHeader, { title }),
|
|
6774
|
+
/* @__PURE__ */ jsx84("div", { className: "flex min-h-0 flex-1 flex-col px-4", children: message })
|
|
6665
6775
|
] }),
|
|
6666
|
-
children: /* @__PURE__ */
|
|
6776
|
+
children: /* @__PURE__ */ jsxs62("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
6667
6777
|
header,
|
|
6668
|
-
/* @__PURE__ */
|
|
6669
|
-
top != null && top !== false && top !== "" && /* @__PURE__ */
|
|
6670
|
-
/* @__PURE__ */
|
|
6671
|
-
/* @__PURE__ */
|
|
6672
|
-
/* @__PURE__ */
|
|
6778
|
+
/* @__PURE__ */ jsxs62(ScrollArea, { className: "min-h-0 flex-1", viewportRef: setBody, onScroll: scrolled, contentClassName: "flex min-h-full flex-col", children: [
|
|
6779
|
+
top != null && top !== false && top !== "" && /* @__PURE__ */ jsx84("div", { className: "shrink-0 px-4 pt-4", children: top }),
|
|
6780
|
+
/* @__PURE__ */ jsx84("div", { className: "min-h-0 flex-1" }),
|
|
6781
|
+
/* @__PURE__ */ jsxs62("div", { className: "flex shrink-0 flex-col gap-2 p-4", children: [
|
|
6782
|
+
/* @__PURE__ */ jsx84(List, { items, open, under: false, above, loading, empty, change, caret }),
|
|
6673
6783
|
!loading && below
|
|
6674
6784
|
] })
|
|
6675
6785
|
] }),
|
|
6676
|
-
box && /* @__PURE__ */
|
|
6786
|
+
box && /* @__PURE__ */ jsx84("div", { className: "shrink-0 p-3", children: /* @__PURE__ */ jsx84(sendsInLayout.Provider, { value: sends, children: box }) })
|
|
6677
6787
|
] })
|
|
6678
6788
|
}
|
|
6679
6789
|
),
|
|
6680
6790
|
side && // Its own catch, as Peek's column had: a thread or a panel that throws says so in the column, and the comments stay.
|
|
6681
6791
|
// One catch per thread, and one for the aside: a thread that threw is let go once it is closed or another opens,
|
|
6682
6792
|
// as Peek's column, drawn only while a thread was open, let it go on closing. Each thread is drawn afresh.
|
|
6683
|
-
/* @__PURE__ */
|
|
6793
|
+
/* @__PURE__ */ jsx84("div", { className: "flex w-[384px] shrink-0 flex-col overflow-hidden border-l border-border-subtle", children: /* @__PURE__ */ jsx84(ErrorBoundary, { label: "thread panel", children: opened ? /* @__PURE__ */ jsx84(caretOnOpen.Provider, { value: caret, children: opened }) : aside }, opened ? `thread:${open}` : "aside") })
|
|
6684
6794
|
] });
|
|
6685
6795
|
}
|
|
6686
6796
|
|
|
6687
6797
|
// src/ConversationPlace.tsx
|
|
6688
|
-
import { jsx as
|
|
6798
|
+
import { jsx as jsx85, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6689
6799
|
function ConversationPlace({ relation, place, children, className, ...props }) {
|
|
6690
|
-
return /* @__PURE__ */
|
|
6691
|
-
/* @__PURE__ */
|
|
6692
|
-
/* @__PURE__ */
|
|
6693
|
-
place && /* @__PURE__ */
|
|
6800
|
+
return /* @__PURE__ */ jsxs63("div", { className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
6801
|
+
/* @__PURE__ */ jsxs63("div", { className: "flex items-center gap-2", children: [
|
|
6802
|
+
/* @__PURE__ */ jsx85(Chip, { type: "neutral", label: relation }),
|
|
6803
|
+
place && /* @__PURE__ */ jsx85("span", { className: "truncate text-caption text-text-muted", children: place })
|
|
6694
6804
|
] }),
|
|
6695
6805
|
children
|
|
6696
6806
|
] });
|
|
6697
6807
|
}
|
|
6698
6808
|
|
|
6699
6809
|
// src/QuotedLine.tsx
|
|
6700
|
-
import { jsx as
|
|
6810
|
+
import { jsx as jsx86, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6701
6811
|
var SINCE = { reworded: "Changed since", gone: "Deleted from the page" };
|
|
6702
6812
|
function QuotedLine({ words, state = "here", label }) {
|
|
6703
6813
|
const shown2 = words ?? label ?? "";
|
|
6704
6814
|
const inThePage = !!words && state === "here";
|
|
6705
|
-
return /* @__PURE__ */
|
|
6706
|
-
/* @__PURE__ */
|
|
6707
|
-
state !== "here" && /* @__PURE__ */
|
|
6815
|
+
return /* @__PURE__ */ jsxs64("div", { "data-quoted": words ? state : "part", className: "flex w-full min-w-0 flex-col gap-0.5", children: [
|
|
6816
|
+
/* @__PURE__ */ jsx86(WithTooltip, { label: shown2, wrapperClassName: "flex min-w-0", children: /* @__PURE__ */ jsx86("p", { className: "line-clamp-2 text-caption text-text-secondary", children: /* @__PURE__ */ jsx86("mark", { className: cn("rounded-sm px-0.5 text-text-primary [box-decoration-break:clone]", inThePage ? "bg-warning-muted" : "bg-bg-inset text-text-secondary", state === "gone" && "line-through"), children: shown2 }) }) }),
|
|
6817
|
+
state !== "here" && /* @__PURE__ */ jsx86("span", { className: "text-caption italic text-text-muted", children: SINCE[state] })
|
|
6708
6818
|
] });
|
|
6709
6819
|
}
|
|
6710
6820
|
|
|
6711
6821
|
// src/ReactionHorizon.tsx
|
|
6712
|
-
import { Fragment as Fragment26, jsx as
|
|
6822
|
+
import { Fragment as Fragment26, jsx as jsx87, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
6713
6823
|
function Said({ limit, omitted, noun }) {
|
|
6714
|
-
return /* @__PURE__ */
|
|
6824
|
+
return /* @__PURE__ */ jsxs65(Fragment26, { children: [
|
|
6715
6825
|
"Reactions are shown for the latest ",
|
|
6716
6826
|
limit,
|
|
6717
6827
|
" ",
|
|
@@ -6724,11 +6834,11 @@ function Said({ limit, omitted, noun }) {
|
|
|
6724
6834
|
] });
|
|
6725
6835
|
}
|
|
6726
6836
|
function ReactionHorizon({ limit, omitted, cut = false, noun = "comments", keepRoom = false }) {
|
|
6727
|
-
const room = keepRoom && omitted <= 0 && /* @__PURE__ */
|
|
6837
|
+
const room = keepRoom && omitted <= 0 && /* @__PURE__ */ jsx87("p", { "aria-hidden": true, className: "invisible text-caption text-text-muted", children: /* @__PURE__ */ jsx87(Said, { limit, omitted: 1, noun }) });
|
|
6728
6838
|
if (omitted <= 0 && !cut) return room || null;
|
|
6729
|
-
return /* @__PURE__ */
|
|
6730
|
-
/* @__PURE__ */
|
|
6731
|
-
omitted > 0 && /* @__PURE__ */
|
|
6839
|
+
return /* @__PURE__ */ jsxs65(Fragment26, { children: [
|
|
6840
|
+
/* @__PURE__ */ jsxs65("p", { className: "text-caption text-text-muted", children: [
|
|
6841
|
+
omitted > 0 && /* @__PURE__ */ jsx87(Said, { limit, omitted, noun }),
|
|
6732
6842
|
omitted > 0 && cut && " ",
|
|
6733
6843
|
cut && "Some reactions may be missing."
|
|
6734
6844
|
] }),
|
|
@@ -6736,20 +6846,6 @@ function ReactionHorizon({ limit, omitted, cut = false, noun = "comments", keepR
|
|
|
6736
6846
|
] });
|
|
6737
6847
|
}
|
|
6738
6848
|
|
|
6739
|
-
// src/PinnedComment.tsx
|
|
6740
|
-
import { jsx as jsx87, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
6741
|
-
function PinnedComment({ author, time, at: given, words, deleted = false }) {
|
|
6742
|
-
const at = momentOf(given);
|
|
6743
|
-
return /* @__PURE__ */ jsx87(Card, { fill: "elevated", clip: true, children: deleted ? /* @__PURE__ */ jsx87("p", { className: "p-2 text-caption italic text-text-muted", children: "This comment was deleted." }) : /* @__PURE__ */ jsxs65("div", { className: "flex flex-col p-2", children: [
|
|
6744
|
-
/* @__PURE__ */ jsxs65("div", { className: "flex items-center gap-2", children: [
|
|
6745
|
-
/* @__PURE__ */ jsx87(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }),
|
|
6746
|
-
/* @__PURE__ */ jsx87("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
|
|
6747
|
-
/* @__PURE__ */ jsx87(MetaText, { className: "shrink-0", children: at === void 0 ? time : /* @__PURE__ */ jsx87(WithTooltip, { label: exactTime(at), children: /* @__PURE__ */ jsx87("time", { dateTime: new Date(at).toISOString(), children: time }) }) })
|
|
6748
|
-
] }),
|
|
6749
|
-
/* @__PURE__ */ jsx87("div", { className: "pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx87("div", { className: "truncate text-caption text-text-secondary", children: words }) })
|
|
6750
|
-
] }) });
|
|
6751
|
-
}
|
|
6752
|
-
|
|
6753
6849
|
// src/ArchiveDialog.tsx
|
|
6754
6850
|
import { useState as useState26 } from "react";
|
|
6755
6851
|
import { jsx as jsx88, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
@@ -6921,7 +7017,7 @@ function Thread({
|
|
|
6921
7017
|
] }),
|
|
6922
7018
|
footer: foot && /* @__PURE__ */ jsx92("div", { className: "p-3", children: foot }),
|
|
6923
7019
|
children: [
|
|
6924
|
-
start && /* @__PURE__ */ jsx92("div", { className: cn("px-4 pb-2 pt-4", SHOWN_CLASSES), "data-thread-start": start.id, children: /* @__PURE__ */ jsx92(PinnedComment, { author: start.author, time: start.time, at: start.at, words: start.words, deleted: start.deleted }) }),
|
|
7020
|
+
start && /* @__PURE__ */ jsx92("div", { className: cn("px-4 pb-2 pt-4", SHOWN_CLASSES), "data-thread-start": start.id, children: /* @__PURE__ */ jsx92(PinnedComment, { author: start.author, time: start.time, at: start.at, words: start.words, deleted: start.deleted, unseen: start.unseen }) }),
|
|
6925
7021
|
/* @__PURE__ */ jsx92(Divider, { look: "section", label: "Replies", className: "px-4 py-2" }),
|
|
6926
7022
|
/* @__PURE__ */ jsx92("div", { className: "flex flex-col gap-2 px-4 pb-4", children: /* @__PURE__ */ jsx92(caretOnOpen.Provider, { value: 0, children: /* @__PURE__ */ jsx92(repliesDrawn.Provider, { value: drawn, children: /* @__PURE__ */ jsx92(Replies, { loading, empty, children }) }) }) })
|
|
6927
7023
|
]
|
|
@@ -7285,6 +7381,7 @@ export {
|
|
|
7285
7381
|
FilePicker,
|
|
7286
7382
|
Form,
|
|
7287
7383
|
FormDialog,
|
|
7384
|
+
GONE_CLOSED,
|
|
7288
7385
|
INLINE_CHIP_CLASSES,
|
|
7289
7386
|
INLINE_CHIP_TONE_CLASSES,
|
|
7290
7387
|
IconButton,
|
|
@@ -7382,6 +7479,7 @@ export {
|
|
|
7382
7479
|
caretOnOpen,
|
|
7383
7480
|
chosenOf,
|
|
7384
7481
|
cn,
|
|
7482
|
+
goneWords,
|
|
7385
7483
|
hueFor,
|
|
7386
7484
|
inTheBox,
|
|
7387
7485
|
initialsFor,
|