@estiva-app/ui 0.91.0 → 0.91.1
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/AttachedCard.d.ts +2 -2
- package/dist/AttachedCard.d.ts.map +1 -1
- package/dist/Card.d.ts +4 -1
- package/dist/Card.d.ts.map +1 -1
- package/dist/LinkCard.d.ts.map +1 -1
- package/dist/LinkRow.d.ts +1 -1
- package/dist/LinkRow.d.ts.map +1 -1
- package/dist/PartCard.d.ts +10 -2
- package/dist/PartCard.d.ts.map +1 -1
- package/dist/ShowMore.d.ts +8 -3
- package/dist/ShowMore.d.ts.map +1 -1
- package/dist/index.js +64 -36
- package/dist/index.js.map +3 -3
- package/dist/linkedFrom.d.ts +5 -0
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +26 -10
- package/src/AttachedCard.test.tsx +3 -3
- package/src/AttachedCard.tsx +5 -7
- package/src/Card.test.tsx +1 -1
- package/src/Card.tsx +5 -2
- package/src/CommentBox.test.tsx +1 -1
- package/src/LinkCard.mdx +5 -4
- package/src/LinkCard.stories.tsx +3 -0
- package/src/LinkCard.test.tsx +8 -2
- package/src/LinkCard.tsx +28 -21
- package/src/LinkChip.mdx +1 -1
- package/src/LinkChip.test.tsx +1 -1
- package/src/LinkChip.tsx +1 -1
- package/src/LinkRow.mdx +2 -2
- package/src/LinkRow.test.tsx +1 -1
- package/src/LinkRow.tsx +6 -7
- package/src/PartCard.mdx +2 -1
- package/src/PartCard.stories.tsx +24 -0
- package/src/PartCard.test.tsx +1 -1
- package/src/PartCard.tsx +21 -6
- package/src/ShowMore.mdx +4 -4
- package/src/ShowMore.tsx +11 -6
- package/src/linked.examples.ts +1 -1
- package/src/linkedFrom.test.tsx +55 -3
- package/src/linkedFrom.ts +46 -2
package/dist/AttachedCard.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* Oct, kickoff). Inside a box being written in, `CommentBox` places it with the
|
|
9
9
|
* files, and the card there reads as words on the files' fill (`inTheBox`).
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import type { ReactNode } from 'react';
|
|
12
|
+
import type { LinkState } from './linked';
|
|
13
13
|
interface AttachedCardBase {
|
|
14
14
|
/** Draws the ✕. Without it the card shows with none, as it does to anyone but the author. */
|
|
15
15
|
onRemove?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachedCard.d.ts","sourceRoot":"","sources":["../src/AttachedCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"AttachedCard.d.ts","sourceRoot":"","sources":["../src/AttachedCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,UAAU,gBAAgB;IACxB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC,CAAA;AAElI,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,iBAAiB,+BAc3E"}
|
package/dist/Card.d.ts
CHANGED
|
@@ -9,7 +9,10 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
|
9
9
|
*
|
|
10
10
|
* - **The fill is chosen by what the card sits on**: `surface` on the page,
|
|
11
11
|
* `elevated` on something already filled, `inset` inside a message, `none`
|
|
12
|
-
* for a hairline alone.
|
|
12
|
+
* for a hairline alone. `inset` is the see-through wash, one step over
|
|
13
|
+
* whatever the message is drawn on: a selected or hovered message's fill
|
|
14
|
+
* shows through it, as an inline chip's does (Katerina, 30 Oct: a solid fill
|
|
15
|
+
* was as light as a selected message's tint, and the card melted into it).
|
|
13
16
|
* - **The hairline follows the fill**: the default hairline on `surface` and
|
|
14
17
|
* `elevated`, the subtle one on `inset` and `none`. Every card has 8px
|
|
15
18
|
* corners.
|
package/dist/Card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../src/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAI7D
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../src/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAI7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAA;AAChE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAA;AACpD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAA;AA8BhD,MAAM,WAAW,SAAU,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IAC7D,gDAAgD;IAChD,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,6HAA6H;IAC7H,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qFAAqF;IACrF,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,wGAAwG;IACxG,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,IAAI,CAAC,EACnB,IAAgB,EAChB,IAAI,EACJ,KAAkC,EAClC,eAAuB,EACvB,OAAe,EACf,QAAgB,EAChB,MAAc,EACd,SAAS,EACT,UAAkB,EAClB,IAAY,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,SAAS,+BAqCX"}
|
package/dist/LinkCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkCard.d.ts","sourceRoot":"","sources":["../src/LinkCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LinkCard.d.ts","sourceRoot":"","sources":["../src/LinkCard.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAyB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAA;AAMpG,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAA;IACf,0HAA0H;IAC1H,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gFAAgF;IAChF,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAKD,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAgB,EAAE,IAAY,EAAE,EAAE,aAAa,+BAa/E;AAsHD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,8GAA8G;IAC9G,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB;AAED,mHAAmH;AACnH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,oBAAoB,+BA8DpE"}
|
package/dist/LinkRow.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Linked, type LinkedKind, type LinkState } from './linked';
|
|
2
2
|
export interface LinkUnavailableProps {
|
|
3
3
|
kind: LinkedKind;
|
|
4
|
-
/** What it is, in a word: "Issue". Drawn as "Issue
|
|
4
|
+
/** What it is, in a word: "Issue". Drawn as "Issue not available". */
|
|
5
5
|
noun: string;
|
|
6
6
|
/** Where it may still open, for someone who can: its app and address. */
|
|
7
7
|
openIn?: {
|
package/dist/LinkRow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkRow.d.ts","sourceRoot":"","sources":["../src/LinkRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LinkRow.d.ts","sourceRoot":"","sources":["../src/LinkRow.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAsB,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAM3F,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACtC,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAKD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAY,EAAE,EAAE,oBAAoB,+BAiBzF;AAED,8HAA8H;AAC9H,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,MAAM,CAEnE;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAA;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,OAAc,EAAE,EAAE,YAAY,+BAiE7D"}
|
package/dist/PartCard.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface PartCardProps {
|
|
|
22
22
|
href?: string;
|
|
23
23
|
/** The key of what it is part of: "ABC-2". */
|
|
24
24
|
partKey?: string;
|
|
25
|
-
/** What it is part of, in a word, for "A part of this issue
|
|
25
|
+
/** What it is part of, in a word, for "A part of this issue not available". Absent, its kind's word. */
|
|
26
26
|
noun?: string;
|
|
27
27
|
/** Where it may still open, for someone who can, when it is not available. */
|
|
28
28
|
openIn?: {
|
|
@@ -31,6 +31,14 @@ export interface PartCardProps {
|
|
|
31
31
|
};
|
|
32
32
|
/** The part's blocks, drawn by the app. */
|
|
33
33
|
children?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* The way out to where the part lives: a small `Button` with a leading icon ("Open in Leaf"). Drawn under the
|
|
36
|
+
* blocks at the right, level with Show more, outside the quote bar (Katerina, 30 Oct: "the vertical line should not
|
|
37
|
+
* be covering the button"). Peek and Ship put it in ShowMore's row inside the blocks before.
|
|
38
|
+
*/
|
|
39
|
+
action?: ReactNode;
|
|
40
|
+
/** Cut the blocks at this height, in px, behind ShowMore's fade and its Show more. Absent, they are drawn whole. */
|
|
41
|
+
maxHeight?: number;
|
|
34
42
|
}
|
|
35
|
-
export declare function PartCard({ state, kind, heading, href, partKey, noun, openIn, children }: PartCardProps): import("react").JSX.Element;
|
|
43
|
+
export declare function PartCard({ state, kind, heading, href, partKey, noun, openIn, children, action, maxHeight }: PartCardProps): import("react").JSX.Element;
|
|
36
44
|
//# sourceMappingURL=PartCard.d.ts.map
|
package/dist/PartCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartCard.d.ts","sourceRoot":"","sources":["../src/PartCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKlD,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"PartCard.d.ts","sourceRoot":"","sources":["../src/PartCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKlD,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAMpD,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,aAAa,CAAA;IAC3C,uCAAuC;IACvC,IAAI,EAAE,UAAU,CAAA;IAChB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,oHAAoH;IACpH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAe,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,aAAa,+BAiCnI"}
|
package/dist/ShowMore.d.ts
CHANGED
|
@@ -23,11 +23,16 @@ export interface ShowMoreProps {
|
|
|
23
23
|
children: ReactNode;
|
|
24
24
|
/** The height to cut at, in px. Default 96: about seven lines of caption text. */
|
|
25
25
|
maxHeight?: number;
|
|
26
|
-
/**
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Nothing to choose: the fade is the content's own, fading out over whatever it sits on, a see-through
|
|
28
|
+
* inset card and a selected message included. Accepted, and ignored.
|
|
29
|
+
*/
|
|
30
|
+
surface?: 'surface' | 'inset' | 'elevated';
|
|
28
31
|
/** A small muted `Button` with a leading icon, at the right of the toggle's row: the way out to where the content lives. Its words end where the content does. */
|
|
29
32
|
action?: ReactNode;
|
|
33
|
+
/** On the content alone, not the toggle's row under it: PartCard's quote bar runs beside the blocks only. */
|
|
34
|
+
contentClassName?: string;
|
|
30
35
|
className?: string;
|
|
31
36
|
}
|
|
32
|
-
export declare function ShowMore({ children, maxHeight,
|
|
37
|
+
export declare function ShowMore({ children, maxHeight, action, contentClassName, className }: ShowMoreProps): import("react").JSX.Element;
|
|
33
38
|
//# sourceMappingURL=ShowMore.d.ts.map
|
package/dist/ShowMore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowMore.d.ts","sourceRoot":"","sources":["../src/ShowMore.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,SAAS,CAAA;IACnB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB
|
|
1
|
+
{"version":3,"file":"ShowMore.d.ts","sourceRoot":"","sources":["../src/ShowMore.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,SAAS,CAAA;IACnB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,CAAA;IAC1C,kKAAkK;IAClK,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,6GAA6G;IAC7G,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAKD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAc,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,aAAa,+BAiCxG"}
|
package/dist/index.js
CHANGED
|
@@ -125,7 +125,7 @@ import { jsx as jsx3 } from "react/jsx-runtime";
|
|
|
125
125
|
var FILL_CLASSES = {
|
|
126
126
|
surface: "bg-bg-surface border-border-default",
|
|
127
127
|
elevated: "bg-bg-elevated border-border-default",
|
|
128
|
-
inset: "bg-bg-
|
|
128
|
+
inset: "bg-bg-wash border-border-subtle",
|
|
129
129
|
none: "border-border-subtle"
|
|
130
130
|
};
|
|
131
131
|
var HAIRLINE_HOVER_CLASSES = {
|
|
@@ -3935,8 +3935,8 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
|
|
|
3935
3935
|
import { useLayoutEffect as useLayoutEffect5, useRef as useRef13, useState as useState12 } from "react";
|
|
3936
3936
|
import { IconChevronDown as IconChevronDown4, IconChevronUp } from "@tabler/icons-react";
|
|
3937
3937
|
import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3938
|
-
var
|
|
3939
|
-
function ShowMore({ children, maxHeight = 96,
|
|
3938
|
+
var FADE = "linear-gradient(to top, transparent, black 40px)";
|
|
3939
|
+
function ShowMore({ children, maxHeight = 96, action, contentClassName, className }) {
|
|
3940
3940
|
const box = useRef13(null);
|
|
3941
3941
|
const [open, setOpen] = useState12(false);
|
|
3942
3942
|
const [overflows, setOverflows] = useState12(false);
|
|
@@ -3952,10 +3952,7 @@ function ShowMore({ children, maxHeight = 96, surface = "surface", action, class
|
|
|
3952
3952
|
}, [maxHeight]);
|
|
3953
3953
|
const cut = overflows && !open;
|
|
3954
3954
|
return /* @__PURE__ */ jsxs39("div", { className: cn("flex flex-col items-start", className), children: [
|
|
3955
|
-
/* @__PURE__ */
|
|
3956
|
-
children,
|
|
3957
|
-
cut && /* @__PURE__ */ jsx56("div", { "aria-hidden": true, className: cn("pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent", FADE_CLASSES[surface]) })
|
|
3958
|
-
] }),
|
|
3955
|
+
/* @__PURE__ */ jsx56("div", { ref: box, className: cn("relative w-full", cut && "overflow-hidden", contentClassName), style: cut ? { maxHeight, maskImage: FADE, WebkitMaskImage: FADE } : void 0, onFocus: cut ? () => setOpen(true) : void 0, children }),
|
|
3959
3956
|
action ? /* @__PURE__ */ jsxs39("div", { className: cn("mt-1 flex w-full items-center gap-2", overflows ? "justify-between" : "justify-end"), children: [
|
|
3960
3957
|
overflows && /* @__PURE__ */ jsx56(Toggle, { open, onToggle: () => setOpen((o) => !o) }),
|
|
3961
3958
|
/* @__PURE__ */ jsx56("div", { className: "-mr-2 flex shrink-0", children: action })
|
|
@@ -4157,6 +4154,16 @@ function archivedLine(archive, noun, options = {}) {
|
|
|
4157
4154
|
var archivedLine2 = archivedLine;
|
|
4158
4155
|
|
|
4159
4156
|
// src/linkedFrom.ts
|
|
4157
|
+
function agoOf(seconds, now = Date.now()) {
|
|
4158
|
+
const gone = Math.max(0, Math.floor(now / 1e3 - seconds));
|
|
4159
|
+
if (gone < 60) return "just now";
|
|
4160
|
+
if (gone < 3600) return `${Math.floor(gone / 60)}m ago`;
|
|
4161
|
+
if (gone < 86400) return `${Math.floor(gone / 3600)}h ago`;
|
|
4162
|
+
if (gone < 7 * 86400) return `${Math.floor(gone / 86400)}d ago`;
|
|
4163
|
+
const date = new Date(seconds * 1e3);
|
|
4164
|
+
const year = date.getFullYear() === new Date(now).getFullYear() ? {} : { year: "numeric" };
|
|
4165
|
+
return date.toLocaleDateString(void 0, { day: "numeric", month: "short", ...year });
|
|
4166
|
+
}
|
|
4160
4167
|
var CARD_ROWS = 7;
|
|
4161
4168
|
var KIND_PAGE = 30842;
|
|
4162
4169
|
var KIND_CHANNEL2 = 39e3;
|
|
@@ -4258,15 +4265,32 @@ function ownerOf(object, options, onAct) {
|
|
|
4258
4265
|
...slot.label ? { ownerLabel: slot.label } : {}
|
|
4259
4266
|
};
|
|
4260
4267
|
}
|
|
4268
|
+
function authorOf(object, directory) {
|
|
4269
|
+
if (object.kind === KIND_CHANNEL2 || !object.address) return void 0;
|
|
4270
|
+
const pubkey = object.address.split(":")[1];
|
|
4271
|
+
if (!pubkey || !/^[0-9a-f]{64}$/.test(pubkey)) return void 0;
|
|
4272
|
+
const profile = object.people?.[pubkey] ?? directory?.[pubkey];
|
|
4273
|
+
if (!profile?.displayName) return void 0;
|
|
4274
|
+
return { name: profile.displayName, ...profile.picture ? { picture: profile.picture } : {} };
|
|
4275
|
+
}
|
|
4261
4276
|
function linkedFrom(object, options) {
|
|
4262
4277
|
const { slots, people } = object;
|
|
4263
4278
|
const id = idOf(object);
|
|
4264
4279
|
const href = options.hrefOf(object, true);
|
|
4280
|
+
const updated = object.changedAt !== void 0 ? (options.whenOf ?? agoOf)(object.changedAt) : void 0;
|
|
4265
4281
|
if (isMessage(object) && slots.title?.isPubkey) {
|
|
4266
4282
|
const person = people?.[slots.title.value];
|
|
4267
4283
|
const name = person?.displayName ?? "\u2014";
|
|
4268
4284
|
const body = slots.body?.value ? options.previewText(slots.body.value, people) : "";
|
|
4269
|
-
return {
|
|
4285
|
+
return {
|
|
4286
|
+
id,
|
|
4287
|
+
kind: "message",
|
|
4288
|
+
title: name,
|
|
4289
|
+
href,
|
|
4290
|
+
author: { name, ...person?.picture ? { picture: person.picture } : {} },
|
|
4291
|
+
...body ? { body } : {},
|
|
4292
|
+
...updated ? { updated } : {}
|
|
4293
|
+
};
|
|
4270
4294
|
}
|
|
4271
4295
|
const onAct = object.archived ? void 0 : options.onAct;
|
|
4272
4296
|
const key = keyOf(object);
|
|
@@ -4274,6 +4298,7 @@ function linkedFrom(object, options) {
|
|
|
4274
4298
|
const owner = ownerOf(object, options, onAct);
|
|
4275
4299
|
const children = childrenOf(object, options);
|
|
4276
4300
|
const done = doneOf(object);
|
|
4301
|
+
const author = owner ? void 0 : authorOf(object, options.directory);
|
|
4277
4302
|
return {
|
|
4278
4303
|
id,
|
|
4279
4304
|
kind: linkedKindOfKind(object.kind),
|
|
@@ -4287,7 +4312,9 @@ function linkedFrom(object, options) {
|
|
|
4287
4312
|
...owner ?? {},
|
|
4288
4313
|
...options.conversation ? { conversation: options.conversation } : {},
|
|
4289
4314
|
...children ? { children } : {},
|
|
4290
|
-
...done ? { done } : {}
|
|
4315
|
+
...done ? { done } : {},
|
|
4316
|
+
...author ? { authors: [author] } : {},
|
|
4317
|
+
...updated ? { updated } : {}
|
|
4291
4318
|
};
|
|
4292
4319
|
}
|
|
4293
4320
|
function linkStateFrom(object, unread, options) {
|
|
@@ -4426,11 +4453,11 @@ import { jsx as jsx61, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
|
4426
4453
|
var ROW_CLASSES2 = "flex items-center gap-3 p-1.5 pr-3";
|
|
4427
4454
|
function LinkUnavailable({ kind, noun, openIn, card = false }) {
|
|
4428
4455
|
const wide = useContext7(inTheBox);
|
|
4429
|
-
return /* @__PURE__ */ jsxs42(Card, { fill: wide ? "elevated" : "inset", className: cn(card ? "flex items-center gap-3 p-3" : ROW_CLASSES2,
|
|
4456
|
+
return /* @__PURE__ */ jsxs42(Card, { fill: wide ? "elevated" : "inset", className: cn(card ? "flex items-center gap-3 p-3" : ROW_CLASSES2, "max-w-[480px]"), children: [
|
|
4430
4457
|
/* @__PURE__ */ jsx61("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx61(LinkedIcon, { kind }) }),
|
|
4431
4458
|
/* @__PURE__ */ jsxs42("span", { className: "min-w-0 flex-1 truncate text-body-2 text-text-muted", children: [
|
|
4432
4459
|
noun,
|
|
4433
|
-
"
|
|
4460
|
+
" not available"
|
|
4434
4461
|
] }),
|
|
4435
4462
|
openIn && /* @__PURE__ */ jsx61("span", { className: "shrink-0 text-caption text-text-secondary", children: /* @__PURE__ */ jsxs42(Link, { href: openIn.href, variant: "quiet", external: true, children: [
|
|
4436
4463
|
"Open in ",
|
|
@@ -4443,8 +4470,7 @@ function linkMetaOf(linked, withWhen = false) {
|
|
|
4443
4470
|
return [linked.key, kindNounOf(linked), linked.subtitle, withWhen ? linked.updated : void 0].filter(Boolean).join(" \xB7 ");
|
|
4444
4471
|
}
|
|
4445
4472
|
function LinkRow({ link, preview = true }) {
|
|
4446
|
-
const
|
|
4447
|
-
const width = !wide && "max-w-[480px]";
|
|
4473
|
+
const width = "max-w-[480px]";
|
|
4448
4474
|
if (link.state === "loading") {
|
|
4449
4475
|
return /* @__PURE__ */ jsx61("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs42(Card, { fill: "inset", "aria-hidden": true, className: cn(ROW_CLASSES2, width), children: [
|
|
4450
4476
|
/* @__PURE__ */ jsx61("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx61(LinkedIcon, { kind: link.kind }) }),
|
|
@@ -4493,12 +4519,13 @@ function LinkCard({ link, readOnly = false, bare = false }) {
|
|
|
4493
4519
|
const { linked } = link;
|
|
4494
4520
|
const body = linked.kind === "message" && linked.author ? /* @__PURE__ */ jsx62(SaidBody, { linked }) : /* @__PURE__ */ jsx62(CardBody, { linked, readOnly: readOnly || boxed });
|
|
4495
4521
|
if (bare) return /* @__PURE__ */ jsx62("div", { className: CARD_CLASSES, children: body });
|
|
4496
|
-
return /* @__PURE__ */ jsx62(Card, { fill: boxed ? "elevated" : "inset", className: cn(CARD_CLASSES,
|
|
4522
|
+
return /* @__PURE__ */ jsx62(Card, { fill: boxed ? "elevated" : "inset", className: cn(CARD_CLASSES, "max-w-[480px]"), children: body });
|
|
4497
4523
|
}
|
|
4498
4524
|
function CardBody({ linked, readOnly }) {
|
|
4499
4525
|
const boxed = useContext8(inTheBox);
|
|
4500
4526
|
const on = boxed ? "elevated" : "inset";
|
|
4501
4527
|
const meta = linkMetaOf(linked);
|
|
4528
|
+
const footed = Boolean(linked.status || linked.owner || linked.authors || linked.updated);
|
|
4502
4529
|
return /* @__PURE__ */ jsxs43(Fragment15, { children: [
|
|
4503
4530
|
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-3", children: [
|
|
4504
4531
|
/* @__PURE__ */ jsx62(LinkTile, { kind: linked.kind }),
|
|
@@ -4506,9 +4533,10 @@ function CardBody({ linked, readOnly }) {
|
|
|
4506
4533
|
/* @__PURE__ */ jsx62("span", { className: "block min-w-0 text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", truncate: true, className: "block", children: linked.title }) }),
|
|
4507
4534
|
meta && /* @__PURE__ */ jsx62("span", { className: "truncate text-caption text-text-secondary", children: meta })
|
|
4508
4535
|
] }),
|
|
4509
|
-
(linked.done || linked.members) && // On the title's line, not halfway down the header.
|
|
4536
|
+
(linked.done || linked.conversation || linked.members) && // On the title's line, not halfway down the header: the ring, the count, the faces, as a row's (Katerina, 30 Oct).
|
|
4510
4537
|
/* @__PURE__ */ jsxs43("span", { className: "flex h-[19.6px] shrink-0 items-center gap-2 self-start", children: [
|
|
4511
4538
|
linked.done && /* @__PURE__ */ jsx62(ProgressRing, { done: linked.done.done, total: linked.done.total }),
|
|
4539
|
+
linked.conversation && /* @__PURE__ */ jsx62(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }),
|
|
4512
4540
|
linked.members && /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.members, size: 16, on })
|
|
4513
4541
|
] })
|
|
4514
4542
|
] }),
|
|
@@ -4532,16 +4560,18 @@ function CardBody({ linked, readOnly }) {
|
|
|
4532
4560
|
/* @__PURE__ */ jsx62("p", { className: "line-clamp-2 text-body-2 text-text-secondary", children: linked.latest.body })
|
|
4533
4561
|
] })
|
|
4534
4562
|
] }),
|
|
4535
|
-
/* @__PURE__ */ jsxs43("div", { className: "flex min-h-6 items-center gap-2", children: [
|
|
4563
|
+
footed && /* @__PURE__ */ jsxs43("div", { className: "flex min-h-6 items-center gap-2", children: [
|
|
4536
4564
|
(linked.status || linked.owner) && /* @__PURE__ */ jsx62(LinkPickers, { status: linked.status, owner: linked.owner, ownerLabel: linked.ownerLabel, readOnly }),
|
|
4537
4565
|
linked.authors ? /* @__PURE__ */ jsxs43("span", { className: "flex min-w-0 items-center gap-2 text-caption text-text-secondary", children: [
|
|
4538
4566
|
/* @__PURE__ */ jsx62(AvatarGroup, { members: linked.authors, size: 16, on }),
|
|
4539
|
-
linked.updated && /* @__PURE__ */
|
|
4567
|
+
linked.updated && /* @__PURE__ */ jsxs43("span", { className: "shrink-0 italic", children: [
|
|
4568
|
+
"Updated ",
|
|
4569
|
+
linked.updated
|
|
4570
|
+
] })
|
|
4540
4571
|
] }) : !linked.status && !linked.owner && linked.updated && /* @__PURE__ */ jsxs43("span", { className: "text-caption italic text-text-secondary", children: [
|
|
4541
4572
|
"Updated ",
|
|
4542
4573
|
linked.updated
|
|
4543
|
-
] })
|
|
4544
|
-
linked.conversation && /* @__PURE__ */ jsx62("span", { className: "ml-auto flex", children: /* @__PURE__ */ jsx62(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }) })
|
|
4574
|
+
] })
|
|
4545
4575
|
] })
|
|
4546
4576
|
] });
|
|
4547
4577
|
}
|
|
@@ -4550,8 +4580,8 @@ function SaidBody({ linked }) {
|
|
|
4550
4580
|
return /* @__PURE__ */ jsxs43(Fragment15, { children: [
|
|
4551
4581
|
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
|
|
4552
4582
|
/* @__PURE__ */ jsx62(Avatar, { name: author.name, src: author.picture, size: 24 }),
|
|
4553
|
-
/* @__PURE__ */ jsx62("span", { className: "text-body-2-strong text-text-primary", children: author.name }),
|
|
4554
|
-
/* @__PURE__ */ jsx62("span", { className: cn("text-caption text-text-muted", TIME_CLASSES), children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: linked.updated
|
|
4583
|
+
/* @__PURE__ */ jsx62("span", { className: "text-body-2-strong text-text-primary", children: linked.updated ? author.name : /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: author.name }) }),
|
|
4584
|
+
linked.updated && /* @__PURE__ */ jsx62("span", { className: cn("text-caption text-text-muted", TIME_CLASSES), children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: linked.updated }) })
|
|
4555
4585
|
] }),
|
|
4556
4586
|
/* @__PURE__ */ jsx62("p", { className: "line-clamp-4 text-body-2 text-text-secondary", children: linked.body ?? linked.title })
|
|
4557
4587
|
] });
|
|
@@ -4567,7 +4597,7 @@ var KIND_SHAPE = {
|
|
|
4567
4597
|
function LinkCardLoading({ kind, shape }) {
|
|
4568
4598
|
const { subtitle = false, summary = true, rows = 0, latest = false, ring = false, footer = "line" } = shape ?? KIND_SHAPE[kind];
|
|
4569
4599
|
const boxed = useContext8(inTheBox);
|
|
4570
|
-
return /* @__PURE__ */ jsx62("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs43(Card, { fill: boxed ? "elevated" : "inset", "aria-hidden": true, className: cn(CARD_CLASSES,
|
|
4600
|
+
return /* @__PURE__ */ jsx62("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs43(Card, { fill: boxed ? "elevated" : "inset", "aria-hidden": true, className: cn(CARD_CLASSES, "max-w-[480px]"), children: [
|
|
4571
4601
|
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-3", children: [
|
|
4572
4602
|
/* @__PURE__ */ jsx62("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx62(LinkedIcon, { kind }) }),
|
|
4573
4603
|
/* @__PURE__ */ jsxs43("span", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
@@ -4631,7 +4661,7 @@ function LinkChip({ link, preview = true }) {
|
|
|
4631
4661
|
if (link.state === "unavailable") {
|
|
4632
4662
|
return /* @__PURE__ */ jsxs44(InlineChip, { tone: "muted", icon: /* @__PURE__ */ jsx64(LinkedIcon, { kind: link.kind, size: 14, tone: "inherit" }), children: [
|
|
4633
4663
|
link.noun,
|
|
4634
|
-
"
|
|
4664
|
+
" not available"
|
|
4635
4665
|
] });
|
|
4636
4666
|
}
|
|
4637
4667
|
const { linked } = link;
|
|
@@ -4655,18 +4685,16 @@ function LinkChip({ link, preview = true }) {
|
|
|
4655
4685
|
}
|
|
4656
4686
|
|
|
4657
4687
|
// src/AttachedCard.tsx
|
|
4658
|
-
import { useContext as useContext9 } from "react";
|
|
4659
4688
|
import { jsx as jsx65, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4660
4689
|
function AttachedCard({ link, children, onRemove }) {
|
|
4661
|
-
const boxed = useContext9(inTheBox);
|
|
4662
4690
|
return (
|
|
4663
|
-
// At most 480px
|
|
4664
|
-
/* @__PURE__ */ jsxs45("div", { className:
|
|
4691
|
+
// At most 480px, so it never runs a column's or a wide box's whole width (Katerina, 29 and 30 Oct).
|
|
4692
|
+
/* @__PURE__ */ jsxs45("div", { className: "group/card relative max-w-[480px]", children: [
|
|
4665
4693
|
link ? /* @__PURE__ */ jsx65(LinkCard, { link }) : children,
|
|
4666
4694
|
onRemove && /* @__PURE__ */ jsx65(
|
|
4667
4695
|
RemoveBadge,
|
|
4668
4696
|
{
|
|
4669
|
-
label: "Remove
|
|
4697
|
+
label: "Remove",
|
|
4670
4698
|
onRemove,
|
|
4671
4699
|
className: "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100"
|
|
4672
4700
|
}
|
|
@@ -4676,16 +4704,16 @@ function AttachedCard({ link, children, onRemove }) {
|
|
|
4676
4704
|
}
|
|
4677
4705
|
|
|
4678
4706
|
// src/PartCard.tsx
|
|
4679
|
-
import { useContext as
|
|
4707
|
+
import { useContext as useContext9 } from "react";
|
|
4680
4708
|
import { jsx as jsx66, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4681
|
-
function PartCard({ state = "ready", kind, heading, href, partKey, noun, openIn, children }) {
|
|
4709
|
+
function PartCard({ state = "ready", kind, heading, href, partKey, noun, openIn, children, action, maxHeight }) {
|
|
4682
4710
|
const word = noun ?? kindNounOf({ kind }) ?? "File";
|
|
4683
|
-
const boxed =
|
|
4711
|
+
const boxed = useContext9(inTheBox);
|
|
4684
4712
|
if (state === "loading") return /* @__PURE__ */ jsx66(LinkCardLoading, { kind, shape: { summary: true, rows: 0, footer: "none" } });
|
|
4685
4713
|
if (state === "unavailable") return /* @__PURE__ */ jsx66(LinkUnavailable, { kind, noun: `A part of this ${word.toLowerCase()}`, openIn, card: true });
|
|
4686
4714
|
return (
|
|
4687
|
-
//
|
|
4688
|
-
/* @__PURE__ */ jsxs46(Card, { fill: boxed ? "elevated" : "inset", className:
|
|
4715
|
+
// At most 480px wide, in a box too; in a box being written in, on the files' fill as the card beside it is.
|
|
4716
|
+
/* @__PURE__ */ jsxs46(Card, { fill: boxed ? "elevated" : "inset", className: "flex max-w-[480px] flex-col gap-3 p-3", children: [
|
|
4689
4717
|
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-3", children: [
|
|
4690
4718
|
/* @__PURE__ */ jsx66(LinkTile, { kind }),
|
|
4691
4719
|
/* @__PURE__ */ jsxs46("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
@@ -4693,7 +4721,7 @@ function PartCard({ state = "ready", kind, heading, href, partKey, noun, openIn,
|
|
|
4693
4721
|
/* @__PURE__ */ jsx66("span", { className: "truncate text-caption text-text-secondary", children: partKey ? `A part of ${partKey}` : `A part of this ${word.toLowerCase()}` })
|
|
4694
4722
|
] })
|
|
4695
4723
|
] }),
|
|
4696
|
-
/* @__PURE__ */ jsx66("div", { className: QUOTE_BAR_CLASSES, children })
|
|
4724
|
+
action || maxHeight !== void 0 ? /* @__PURE__ */ jsx66(ShowMore, { maxHeight: maxHeight ?? Infinity, surface: boxed ? "elevated" : "inset", action, contentClassName: QUOTE_BAR_CLASSES, children }) : /* @__PURE__ */ jsx66("div", { className: QUOTE_BAR_CLASSES, children })
|
|
4697
4725
|
] })
|
|
4698
4726
|
);
|
|
4699
4727
|
}
|
|
@@ -5007,7 +5035,7 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
|
|
|
5007
5035
|
}
|
|
5008
5036
|
|
|
5009
5037
|
// src/Toast.tsx
|
|
5010
|
-
import { createContext as createContext8, useContext as
|
|
5038
|
+
import { createContext as createContext8, useContext as useContext10, useMemo as useMemo6 } from "react";
|
|
5011
5039
|
import { Toast as BaseToast } from "@base-ui/react/toast";
|
|
5012
5040
|
import { IconAlertCircle as IconAlertCircle2, IconCircleCheck as IconCircleCheck2, IconCircleX as IconCircleX2 } from "@tabler/icons-react";
|
|
5013
5041
|
import { jsx as jsx76, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
@@ -5114,7 +5142,7 @@ function ToastList() {
|
|
|
5114
5142
|
});
|
|
5115
5143
|
}
|
|
5116
5144
|
function useToast() {
|
|
5117
|
-
const ctx =
|
|
5145
|
+
const ctx = useContext10(ToastContext);
|
|
5118
5146
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
5119
5147
|
return ctx;
|
|
5120
5148
|
}
|