@estiva-app/ui 0.109.0 → 0.110.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/QuotedLine.d.ts +10 -2
- package/dist/QuotedLine.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/registry.json +13 -1
- package/src/QuotedLine.mdx +3 -0
- package/src/QuotedLine.stories.tsx +3 -0
- package/src/QuotedLine.test.tsx +13 -0
- package/src/QuotedLine.tsx +19 -3
package/dist/QuotedLine.d.ts
CHANGED
|
@@ -5,12 +5,20 @@ export interface QuotedLineProps {
|
|
|
5
5
|
state?: 'here' | 'reworded' | 'gone';
|
|
6
6
|
/** A part with no words, a picture or a whole block: what it is, in the app's words ("Picture: plan.png"). */
|
|
7
7
|
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Where the words are in their file, when the reader is not looking at it: the words open it there. The page that
|
|
10
|
+
* shows the file beside its comments gives none. Navigation is yours, as for every `Link`.
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
13
|
+
/** `href` is another app's: it opens in a new tab. */
|
|
14
|
+
external?: boolean;
|
|
8
15
|
}
|
|
9
16
|
/**
|
|
10
17
|
* What a comment on a part of the page is on: its words, two lines at most, in the page's own highlight, so the two
|
|
11
18
|
* read as one. ConversationCard puts it under the name, above the comment's words ("above the message, not above the
|
|
12
19
|
* person": Katerina, 1 November). Words changed since or deleted lose the highlight and say so; a part with no words
|
|
13
|
-
* gives its name, on the grey: it is not words of the page.
|
|
20
|
+
* gives its name, on the grey: it is not words of the page. With `href`, the words are the way to them in their file
|
|
21
|
+
* (Miky, 10 November: a reader in another app reaches the sentence in one click, as the part card's link did).
|
|
14
22
|
*/
|
|
15
|
-
export declare function QuotedLine({ words, state, label }: QuotedLineProps): import("react").JSX.Element;
|
|
23
|
+
export declare function QuotedLine({ words, state, label, href, external }: QuotedLineProps): import("react").JSX.Element;
|
|
16
24
|
//# sourceMappingURL=QuotedLine.d.ts.map
|
package/dist/QuotedLine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuotedLine.d.ts","sourceRoot":"","sources":["../src/QuotedLine.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuotedLine.d.ts","sourceRoot":"","sources":["../src/QuotedLine.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0GAA0G;IAC1G,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAA;IACpC,8GAA8G;IAC9G,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAID;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAc,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAqB3F"}
|
package/dist/index.js
CHANGED
|
@@ -6973,11 +6973,12 @@ function ConversationPlace({ relation, place, children, className, ...props }) {
|
|
|
6973
6973
|
// src/QuotedLine.tsx
|
|
6974
6974
|
import { jsx as jsx89, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
6975
6975
|
var SINCE = { reworded: "Changed since", gone: "Deleted from the page" };
|
|
6976
|
-
function QuotedLine({ words, state = "here", label }) {
|
|
6976
|
+
function QuotedLine({ words, state = "here", label, href, external }) {
|
|
6977
6977
|
const shown2 = words ?? label ?? "";
|
|
6978
6978
|
const inThePage = !!words && state === "here";
|
|
6979
|
+
const mark = /* @__PURE__ */ jsx89("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 });
|
|
6979
6980
|
return /* @__PURE__ */ jsxs67("div", { "data-quoted": words ? state : "part", className: "flex w-full min-w-0 flex-col gap-0.5", children: [
|
|
6980
|
-
/* @__PURE__ */ jsx89(WithTooltip, { label: shown2, wrapperClassName: "flex min-w-0", children: /* @__PURE__ */ jsx89("p", { className: "line-clamp-2 text-caption text-text-secondary", children: /* @__PURE__ */ jsx89(
|
|
6981
|
+
/* @__PURE__ */ jsx89(WithTooltip, { label: shown2, wrapperClassName: "flex min-w-0", children: /* @__PURE__ */ jsx89("p", { className: "line-clamp-2 text-caption text-text-secondary", children: href ? /* @__PURE__ */ jsx89(Link, { href, variant: "quiet", external, children: mark }) : mark }) }),
|
|
6981
6982
|
state !== "here" && /* @__PURE__ */ jsx89("span", { className: "text-caption italic text-text-muted", children: SINCE[state] })
|
|
6982
6983
|
] });
|
|
6983
6984
|
}
|