@estiva-app/ui 0.102.0 → 0.102.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/LinkRow.d.ts +3 -1
- package/dist/LinkRow.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +3 -3
- package/dist/linked.d.ts +2 -0
- package/dist/linked.d.ts.map +1 -1
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +7 -1
- package/src/LinkCard.tsx +1 -1
- package/src/LinkRow.tsx +6 -4
- package/src/linked.ts +2 -0
- package/src/linkedFrom.test.tsx +5 -0
- package/src/linkedFrom.ts +4 -1
package/dist/LinkRow.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ 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: kept as written, "You can't open this App one". */
|
|
7
|
+
named?: boolean;
|
|
6
8
|
/** @deprecated Not drawn since 0.102.0: someone who can't open it has nowhere to go. */
|
|
7
9
|
openIn?: {
|
|
8
10
|
app: string;
|
|
@@ -21,7 +23,7 @@ export interface LinkUnavailableProps {
|
|
|
21
23
|
* open this issue", the approved story's words, with no way out, since there
|
|
22
24
|
* is nothing for them to open (Miky, ALO-4's review, 3 November).
|
|
23
25
|
*/
|
|
24
|
-
export declare function LinkUnavailable({ kind, noun, card, deleted }: LinkUnavailableProps): import("react").JSX.Element;
|
|
26
|
+
export declare function LinkUnavailable({ kind, noun, named, card, deleted }: LinkUnavailableProps): import("react").JSX.Element;
|
|
25
27
|
/** 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). */
|
|
26
28
|
export declare function UnavailableRow({ kind, words, href, card }: {
|
|
27
29
|
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,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;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAY,EAAE,OAAe,EAAE,EAAE,oBAAoB,+
|
|
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,kHAAkH;IAClH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,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;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAa,EAAE,IAAY,EAAE,OAAe,EAAE,EAAE,oBAAoB,+BAIjH;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
|
@@ -4968,10 +4968,13 @@ function linkStateFrom(object, unread, options) {
|
|
|
4968
4968
|
const written = unread.url ? { url: unread.url } : {};
|
|
4969
4969
|
if (object === null) return { state: "unavailable", kind: unread.kind, noun: unread.noun, ...unread.deleted ? { deleted: true } : {}, ...written };
|
|
4970
4970
|
if (object.unreachable) {
|
|
4971
|
+
const noun = nounOf(object);
|
|
4971
4972
|
return {
|
|
4972
4973
|
state: "unavailable",
|
|
4973
4974
|
kind: linkedKindOfKind(object.kind),
|
|
4974
|
-
noun:
|
|
4975
|
+
noun: noun || unread.noun,
|
|
4976
|
+
// Its app's name, its type having none: "You can't open this Notes", not "this notes".
|
|
4977
|
+
...noun && !object.noun ? { named: true } : {},
|
|
4975
4978
|
...written
|
|
4976
4979
|
};
|
|
4977
4980
|
}
|
|
@@ -5122,8 +5125,8 @@ import { useContext as useContext11 } from "react";
|
|
|
5122
5125
|
import { useContext as useContext10 } from "react";
|
|
5123
5126
|
import { jsx as jsx64, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5124
5127
|
var ROW_CLASSES2 = "flex items-center gap-3 p-1.5 pr-3";
|
|
5125
|
-
function LinkUnavailable({ kind, noun, card = false, deleted = false }) {
|
|
5126
|
-
const word = /^[A-Z][a-z]*$/.test(noun) ? noun.toLowerCase() : noun;
|
|
5128
|
+
function LinkUnavailable({ kind, noun, named: named2 = false, card = false, deleted = false }) {
|
|
5129
|
+
const word = !named2 && /^[A-Z][a-z]*$/.test(noun) ? noun.toLowerCase() : noun;
|
|
5127
5130
|
return /* @__PURE__ */ jsx64(UnavailableRow, { kind, words: deleted ? `${noun} deleted` : `You can't open this ${word}`, card });
|
|
5128
5131
|
}
|
|
5129
5132
|
function UnavailableRow({ kind, words, href, card = false }) {
|
|
@@ -5153,7 +5156,7 @@ function LinkRow({ link, preview = true }) {
|
|
|
5153
5156
|
}
|
|
5154
5157
|
if (link.state === "unavailable") {
|
|
5155
5158
|
if (link.url) return /* @__PURE__ */ jsx64(WrittenUrl, { url: link.url, block: true });
|
|
5156
|
-
return /* @__PURE__ */ jsx64(LinkUnavailable, { kind: link.kind, noun: link.noun, deleted: link.deleted });
|
|
5159
|
+
return /* @__PURE__ */ jsx64(LinkUnavailable, { kind: link.kind, noun: link.noun, named: link.named, deleted: link.deleted });
|
|
5157
5160
|
}
|
|
5158
5161
|
const { linked } = link;
|
|
5159
5162
|
const status = chosenOf(linked.status);
|
|
@@ -5198,7 +5201,7 @@ function LinkCard({ link, readOnly = false, bare = false }) {
|
|
|
5198
5201
|
if (link.state === "loading") return /* @__PURE__ */ jsx65(LinkCardLoading, { kind: link.kind, shape: link.shape });
|
|
5199
5202
|
if (link.state === "unavailable") {
|
|
5200
5203
|
if (link.url) return /* @__PURE__ */ jsx65(WrittenUrl, { url: link.url, block: true });
|
|
5201
|
-
return /* @__PURE__ */ jsx65(LinkUnavailable, { kind: link.kind, noun: link.noun, deleted: link.deleted, card: true });
|
|
5204
|
+
return /* @__PURE__ */ jsx65(LinkUnavailable, { kind: link.kind, noun: link.noun, named: link.named, deleted: link.deleted, card: true });
|
|
5202
5205
|
}
|
|
5203
5206
|
const { linked } = link;
|
|
5204
5207
|
const body = linked.kind === "message" && linked.author ? /* @__PURE__ */ jsx65(SaidBody, { linked }) : /* @__PURE__ */ jsx65(CardBody, { linked, readOnly: readOnly || boxed });
|