@estiva-app/ui 0.102.1 → 0.102.2
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/LinkRow.d.ts +7 -3
- package/dist/LinkRow.d.ts.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +2 -2
- package/dist/linked.d.ts +3 -1
- package/dist/linked.d.ts.map +1 -1
- package/dist/linkedFrom.d.ts +1 -0
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +8 -2
- package/src/LinkCard.stories.tsx +6 -0
- package/src/LinkCard.tsx +1 -1
- package/src/LinkRow.test.tsx +13 -0
- package/src/LinkRow.tsx +12 -7
- package/src/linked.ts +3 -1
- package/src/linkedFrom.test.tsx +15 -3
- package/src/linkedFrom.ts +5 -3
package/dist/LinkRow.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ export interface LinkUnavailableProps {
|
|
|
3
3
|
kind: LinkedKind;
|
|
4
4
|
/** What it is, in a word: "Issue". Drawn as "You can't open this issue", or "Issue deleted". */
|
|
5
5
|
noun: string;
|
|
6
|
-
/** `noun` is its app's name ("App one"), its type having none:
|
|
6
|
+
/** `noun` is its app's name ("App one"), its type having none: "You can't open this file in App one". */
|
|
7
7
|
named?: boolean;
|
|
8
|
+
/** Its read failed (the network, a busy relay), which says nothing about access: "Couldn't load this issue". */
|
|
9
|
+
failed?: boolean;
|
|
8
10
|
/** @deprecated Not drawn since 0.102.0: someone who can't open it has nowhere to go. */
|
|
9
11
|
openIn?: {
|
|
10
12
|
app: string;
|
|
@@ -21,9 +23,11 @@ export interface LinkUnavailableProps {
|
|
|
21
23
|
* would have been, on the same fill and edge (Katerina, 29 Oct: "same styling
|
|
22
24
|
* as the linkcard default"), its words muted. Not this reader's: "You can't
|
|
23
25
|
* open this issue", the approved story's words, with no way out, since there
|
|
24
|
-
* is nothing for them to open (Miky, ALO-4's review, 3 November).
|
|
26
|
+
* is nothing for them to open (Miky, ALO-4's review, 3 November). A read that
|
|
27
|
+
* failed says "Couldn't load this issue" instead: it is not an answer about
|
|
28
|
+
* access (Miky, 3 November).
|
|
25
29
|
*/
|
|
26
|
-
export declare function LinkUnavailable({ kind, noun, named, card, deleted }: LinkUnavailableProps): import("react").JSX.Element;
|
|
30
|
+
export declare function LinkUnavailable({ kind, noun, named, card, deleted, failed }: LinkUnavailableProps): import("react").JSX.Element;
|
|
27
31
|
/** The not-available row with the words it is given; `href` makes the words a link (a part that can't be shown opens its whole file). */
|
|
28
32
|
export declare function UnavailableRow({ kind, words, href, card }: {
|
|
29
33
|
kind: LinkedKind;
|
package/dist/LinkRow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,gGAAgG;IAChG,IAAI,EAAE,MAAM,CAAA;IACZ,
|
|
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,gGAAgG;IAChG,IAAI,EAAE,MAAM,CAAA;IACZ,yGAAyG;IACzG,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gHAAgH;IAChH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,wFAAwF;IACxF,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACtC,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,oGAAoG;IACpG,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAKD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAa,EAAE,IAAY,EAAE,OAAe,EAAE,MAAc,EAAE,EAAE,oBAAoB,+BAKjI;AAED,yIAAyI;AACzI,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAY,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,+BAkBrI;AAED,sJAAsJ;AACtJ,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,MAAM,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,GAAG,EAAE,KAAa,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,+BAOlF;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,+BA+E7D"}
|
package/dist/index.js
CHANGED
|
@@ -4966,14 +4966,15 @@ function linkedFrom(object, options) {
|
|
|
4966
4966
|
function linkStateFrom(object, unread, options) {
|
|
4967
4967
|
if (object === void 0) return { state: "loading", kind: unread.kind };
|
|
4968
4968
|
const written = unread.url ? { url: unread.url } : {};
|
|
4969
|
-
|
|
4969
|
+
const why = unread.deleted ? { deleted: true } : unread.failed ? { failed: true } : {};
|
|
4970
|
+
if (object === null) return { state: "unavailable", kind: unread.kind, noun: unread.noun, ...why, ...written };
|
|
4970
4971
|
if (object.unreachable) {
|
|
4971
4972
|
const noun = nounOf(object);
|
|
4972
4973
|
return {
|
|
4973
4974
|
state: "unavailable",
|
|
4974
4975
|
kind: linkedKindOfKind(object.kind),
|
|
4975
4976
|
noun: noun || unread.noun,
|
|
4976
|
-
// Its app's name, its type having none: "You can't open this
|
|
4977
|
+
// Its app's name, its type having none: "You can't open this file in Notes".
|
|
4977
4978
|
...noun && !object.noun ? { named: true } : {},
|
|
4978
4979
|
...written
|
|
4979
4980
|
};
|
|
@@ -5125,9 +5126,10 @@ import { useContext as useContext11 } from "react";
|
|
|
5125
5126
|
import { useContext as useContext10 } from "react";
|
|
5126
5127
|
import { jsx as jsx64, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5127
5128
|
var ROW_CLASSES2 = "flex items-center gap-3 p-1.5 pr-3";
|
|
5128
|
-
function LinkUnavailable({ kind, noun, named: named2 = false, card = false, deleted = false }) {
|
|
5129
|
-
const word =
|
|
5130
|
-
|
|
5129
|
+
function LinkUnavailable({ kind, noun, named: named2 = false, card = false, deleted = false, failed = false }) {
|
|
5130
|
+
const word = named2 ? `file in ${noun}` : /^[A-Z][a-z]*$/.test(noun) ? noun.toLowerCase() : noun;
|
|
5131
|
+
const words = deleted ? `${named2 ? `File in ${noun}` : noun} deleted` : failed ? `Couldn't load this ${word}` : `You can't open this ${word}`;
|
|
5132
|
+
return /* @__PURE__ */ jsx64(UnavailableRow, { kind, words, card });
|
|
5131
5133
|
}
|
|
5132
5134
|
function UnavailableRow({ kind, words, href, card = false }) {
|
|
5133
5135
|
const wide = useContext10(inTheBox);
|
|
@@ -5156,7 +5158,7 @@ function LinkRow({ link, preview = true }) {
|
|
|
5156
5158
|
}
|
|
5157
5159
|
if (link.state === "unavailable") {
|
|
5158
5160
|
if (link.url) return /* @__PURE__ */ jsx64(WrittenUrl, { url: link.url, block: true });
|
|
5159
|
-
return /* @__PURE__ */ jsx64(LinkUnavailable, { kind: link.kind, noun: link.noun, named: link.named, deleted: link.deleted });
|
|
5161
|
+
return /* @__PURE__ */ jsx64(LinkUnavailable, { kind: link.kind, noun: link.noun, named: link.named, deleted: link.deleted, failed: link.failed });
|
|
5160
5162
|
}
|
|
5161
5163
|
const { linked } = link;
|
|
5162
5164
|
const status = chosenOf(linked.status);
|
|
@@ -5201,7 +5203,7 @@ function LinkCard({ link, readOnly = false, bare = false }) {
|
|
|
5201
5203
|
if (link.state === "loading") return /* @__PURE__ */ jsx65(LinkCardLoading, { kind: link.kind, shape: link.shape });
|
|
5202
5204
|
if (link.state === "unavailable") {
|
|
5203
5205
|
if (link.url) return /* @__PURE__ */ jsx65(WrittenUrl, { url: link.url, block: true });
|
|
5204
|
-
return /* @__PURE__ */ jsx65(LinkUnavailable, { kind: link.kind, noun: link.noun, named: link.named, deleted: link.deleted, card: true });
|
|
5206
|
+
return /* @__PURE__ */ jsx65(LinkUnavailable, { kind: link.kind, noun: link.noun, named: link.named, deleted: link.deleted, failed: link.failed, card: true });
|
|
5205
5207
|
}
|
|
5206
5208
|
const { linked } = link;
|
|
5207
5209
|
const body = linked.kind === "message" && linked.author ? /* @__PURE__ */ jsx65(SaidBody, { linked }) : /* @__PURE__ */ jsx65(CardBody, { linked, readOnly: readOnly || boxed });
|