@estiva-app/ui 0.74.0 → 0.75.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.
Files changed (72) hide show
  1. package/dist/CardUnder.d.ts +10 -0
  2. package/dist/CardUnder.d.ts.map +1 -0
  3. package/dist/CommentHighlights.d.ts.map +1 -1
  4. package/dist/InlineChip.d.ts +2 -0
  5. package/dist/InlineChip.d.ts.map +1 -1
  6. package/dist/LinkCard.d.ts +17 -0
  7. package/dist/LinkCard.d.ts.map +1 -0
  8. package/dist/LinkChip.d.ts +8 -0
  9. package/dist/LinkChip.d.ts.map +1 -0
  10. package/dist/LinkParts.d.ts +45 -0
  11. package/dist/LinkParts.d.ts.map +1 -0
  12. package/dist/LinkPreview.d.ts +21 -0
  13. package/dist/LinkPreview.d.ts.map +1 -0
  14. package/dist/LinkRow.d.ts +24 -0
  15. package/dist/LinkRow.d.ts.map +1 -0
  16. package/dist/PartCard.d.ts +32 -0
  17. package/dist/PartCard.d.ts.map +1 -0
  18. package/dist/Skeleton.d.ts +12 -2
  19. package/dist/Skeleton.d.ts.map +1 -1
  20. package/dist/editor.js +42 -17
  21. package/dist/editor.js.map +3 -3
  22. package/dist/eslint/index.js +1 -0
  23. package/dist/eslint/index.js.map +2 -2
  24. package/dist/eslint/no-restyled-part.d.ts.map +1 -1
  25. package/dist/index.d.ts +8 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +480 -71
  28. package/dist/index.js.map +4 -4
  29. package/dist/linked.d.ts +168 -0
  30. package/dist/linked.d.ts.map +1 -0
  31. package/dist/linked.examples.d.ts +27 -0
  32. package/dist/linked.examples.d.ts.map +1 -0
  33. package/package.json +1 -1
  34. package/registry.json +784 -7
  35. package/src/CardUnder.mdx +53 -0
  36. package/src/CardUnder.stories.tsx +45 -0
  37. package/src/CardUnder.test.tsx +40 -0
  38. package/src/CardUnder.tsx +45 -0
  39. package/src/CommentHighlights.test.ts +56 -2
  40. package/src/CommentHighlights.ts +51 -12
  41. package/src/InlineChip.tsx +2 -0
  42. package/src/LinkCard.mdx +58 -0
  43. package/src/LinkCard.stories.tsx +68 -0
  44. package/src/LinkCard.test.tsx +103 -0
  45. package/src/LinkCard.tsx +209 -0
  46. package/src/LinkChip.mdx +51 -0
  47. package/src/LinkChip.stories.tsx +40 -0
  48. package/src/LinkChip.test.tsx +83 -0
  49. package/src/LinkChip.tsx +51 -0
  50. package/src/LinkParts.mdx +49 -0
  51. package/src/LinkParts.stories.tsx +61 -0
  52. package/src/LinkParts.tsx +147 -0
  53. package/src/LinkPreview.mdx +47 -0
  54. package/src/LinkPreview.stories.tsx +38 -0
  55. package/src/LinkPreview.tsx +55 -0
  56. package/src/LinkRow.mdx +47 -0
  57. package/src/LinkRow.stories.tsx +49 -0
  58. package/src/LinkRow.test.tsx +38 -0
  59. package/src/LinkRow.tsx +107 -0
  60. package/src/PartCard.mdx +43 -0
  61. package/src/PartCard.stories.tsx +35 -0
  62. package/src/PartCard.test.tsx +30 -0
  63. package/src/PartCard.tsx +59 -0
  64. package/src/Skeleton.tsx +7 -3
  65. package/src/eslint/no-native-title.test.ts +3 -2
  66. package/src/eslint/no-restyled-part.ts +1 -0
  67. package/src/index.ts +25 -0
  68. package/src/linked.examples.ts +107 -0
  69. package/src/linked.test.ts +58 -0
  70. package/src/linked.ts +217 -0
  71. package/src/registry/registry.test.ts +8 -8
  72. package/stories/Choosing.mdx +7 -0
@@ -0,0 +1,10 @@
1
+ import type { LinkState } from './linked';
2
+ export interface CardUnderProps {
3
+ link: LinkState;
4
+ /** Draws the ✕. Without it the card shows with none, as it does to anyone but the author. */
5
+ onRemove?: () => void;
6
+ /** The ✕ waits for hover or focus: under text already sent. Always shown on a screen that cannot hover. */
7
+ revealOnHover?: boolean;
8
+ }
9
+ export declare function CardUnder({ link, onRemove, revealOnHover }: CardUnderProps): import("react").JSX.Element;
10
+ //# sourceMappingURL=CardUnder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardUnder.d.ts","sourceRoot":"","sources":["../src/CardUnder.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,CAAA;IACf,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,2GAA2G;IAC3G,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAqB,EAAE,EAAE,cAAc,+BAqBlF"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommentHighlights.d.ts","sourceRoot":"","sources":["../src/CommentHighlights.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKxC;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAA;IACb,uFAAuF;IACvF,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,8EAA8E;IAC9E,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB,sFAAsF;IACtF,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB;AAED,qDAAqD;AACrD,MAAM,MAAM,YAAY;AACtB,6DAA6D;AAC3D;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA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AyE;AACzE,eAAO,MAAM,iBAAiB,0CA6D5B,CAAA;AAEF,wDAAwD;AACxD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,aAAa,EAAE,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,QAGhH;AAED,0GAA0G;AAC1G,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,YAAY,CAEhF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI,CAOxF;AAED,0FAA0F;AAC1F,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAErD;AA6BD,yGAAyG;AACzG,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAuExE"}
@@ -39,6 +39,8 @@ export declare const INLINE_CHIP_TONE_CLASSES: {
39
39
  * copy of this chip still has the 16.8px box).
40
40
  */
41
41
  readonly quiet: "h-[19.6px] bg-bg-active text-text-muted font-mono text-caption";
42
+ /** A file this reader cannot open — deleted, or not theirs to see: said in words, quieter than a link. */
43
+ readonly muted: "bg-bg-active text-text-muted";
42
44
  };
43
45
  export type InlineChipTone = keyof typeof INLINE_CHIP_TONE_CLASSES;
44
46
  /** The chip's classes for a tone, with anything the caller adds. For renderers that cannot use the component. */
@@ -1 +1 @@
1
- {"version":3,"file":"InlineChip.d.ts","sourceRoot":"","sources":["../src/InlineChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAI7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,oGAAoG;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AS,CAAC,EAAE,MAAM,UAE3E;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IACnF,mDAAmD;IACnD,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,mFAAmF;IACnF,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BAsB1G"}
@@ -0,0 +1,17 @@
1
+ import type { LinkedKind, LinkState, LoadingShape } from './linked';
2
+ export interface LinkCardProps {
3
+ link: LinkState;
4
+ /** The values read as words, never pickers: the hover preview. */
5
+ readOnly?: boolean;
6
+ /** No frame of its own: inside a box that draws one, as the hover preview's. */
7
+ bare?: boolean;
8
+ }
9
+ export declare function LinkCard({ link, readOnly, bare }: LinkCardProps): import("react").JSX.Element;
10
+ export interface LinkCardLoadingProps {
11
+ kind: LinkedKind;
12
+ /** What the card will hold (`loadingShapeOf` from the last time it drew); the kind's usual card otherwise. */
13
+ shape?: LoadingShape;
14
+ }
15
+ /** The card it will become, drawn in bars at the card's own height. */
16
+ export declare function LinkCardLoading({ kind, shape }: LinkCardLoadingProps): import("react").JSX.Element;
17
+ //# sourceMappingURL=LinkCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkCard.d.ts","sourceRoot":"","sources":["../src/LinkCard.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAU,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAK3E,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAA;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gFAAgF;IAChF,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAgB,EAAE,IAAY,EAAE,EAAE,aAAa,+BAW/E;AAsGD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,8GAA8G;IAC9G,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,oBAAoB,+BA6DpE"}
@@ -0,0 +1,8 @@
1
+ import type { LinkState } from './linked';
2
+ export interface LinkChipProps {
3
+ link: LinkState;
4
+ /** Hovering shows its card. Off where a card would cover what the reader is choosing from. */
5
+ preview?: boolean;
6
+ }
7
+ export declare function LinkChip({ link, preview }: LinkChipProps): import("react").JSX.Element;
8
+ //# sourceMappingURL=LinkChip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkChip.d.ts","sourceRoot":"","sources":["../src/LinkChip.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAMzC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAA;IACf,8FAA8F;IAC9F,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAc,EAAE,EAAE,aAAa,+BA8B/D"}
@@ -0,0 +1,45 @@
1
+ import { type LinkedConversation, type LinkedKind, type LinkedPicker, type LinkedStatus } from './linked';
2
+ /** A status as its shape, which reads without colour; its words on hover and to a screen reader. */
3
+ export declare function StatusMark({ status }: {
4
+ status: LinkedStatus;
5
+ }): import("react").JSX.Element;
6
+ /** The icon for what a link stands for. A page of text has its own. */
7
+ export declare function LinkedIcon({ kind, size, tone }: {
8
+ kind: LinkedKind;
9
+ size?: 14 | 16;
10
+ tone?: 'secondary' | 'inherit';
11
+ }): import("react").JSX.Element;
12
+ /** A key, the way people say it ("ABC-2"): before the title, quieter than it. */
13
+ export declare function LinkKey({ children }: {
14
+ children: string;
15
+ }): import("react").JSX.Element;
16
+ /** Progress as a small ring, with the count beside it. */
17
+ export declare function ProgressRing({ done, total }: {
18
+ done: number;
19
+ total: number;
20
+ }): import("react").JSX.Element;
21
+ /**
22
+ * The count of what was said, a link to where it is read. With something
23
+ * unread there the words are brighter and a dot follows. It sits above a
24
+ * row's covering link, so the row opens the thing and the count its
25
+ * conversation.
26
+ */
27
+ export declare function CommentCount({ conversation, noun }: {
28
+ conversation: LinkedConversation;
29
+ noun?: string;
30
+ }): import("react").JSX.Element;
31
+ export interface LinkPickersProps {
32
+ status?: LinkedPicker;
33
+ owner?: LinkedPicker;
34
+ /** The owner's word: "Assignee", "Lead". */
35
+ ownerLabel?: string;
36
+ /** Draws the values as words even where they could be changed: the hover preview. */
37
+ readOnly?: boolean;
38
+ }
39
+ /**
40
+ * A status and an owner, where the reader can change them from the card. A
41
+ * picker whose app passed no `onChange` reads as words in the same place: the
42
+ * reader may not change it. The hover preview is always words.
43
+ */
44
+ export declare function LinkPickers({ status, owner, ownerLabel, readOnly }: LinkPickersProps): import("react").JSX.Element;
45
+ //# sourceMappingURL=LinkParts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkParts.d.ts","sourceRoot":"","sources":["../src/LinkParts.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAY,KAAK,kBAAkB,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAqB,MAAM,UAAU,CAAA;AAkBtI,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,+BAO9D;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,IAAkB,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,+BAGvI;AAED,iFAAiF;AACjF,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,+BAEzD;AAED,0DAA0D;AAC1D,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAiB5E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,YAAY,EAAE,IAAiB,EAAE,EAAE;IAAE,YAAY,EAAE,kBAAkB,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAYpH;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,UAAoB,EAAE,QAAgB,EAAE,EAAE,gBAAgB,+BA0CtG"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A link's card, shown on hover over its chip or its row: read only, in the
3
+ * package's one elevated box. A screen that cannot hover draws no preview, and
4
+ * a tap opens the link (Miky, WID-2: "there's no hover on touch").
5
+ */
6
+ import { type ReactNode } from 'react';
7
+ import type { Linked } from './linked';
8
+ /** Whether this screen can hover. Without `matchMedia` (a test, a server) it is taken to. */
9
+ export declare function useCanHover(): boolean;
10
+ export interface LinkPreviewProps {
11
+ linked: Linked;
12
+ /** The trigger fills its column, as a row does; a chip is inline. */
13
+ block?: boolean;
14
+ children: ReactNode;
15
+ }
16
+ export declare function LinkPreview({ linked, block, children }: LinkPreviewProps): import("react").JSX.Element;
17
+ /** The preview drawn open, for a still picture of it: the same box PreviewCard draws. */
18
+ export declare function LinkPreviewOpen({ linked }: {
19
+ linked: Linked;
20
+ }): import("react").JSX.Element;
21
+ //# sourceMappingURL=LinkPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkPreview.d.ts","sourceRoot":"","sources":["../src/LinkPreview.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAatC,6FAA6F;AAC7F,wBAAgB,WAAW,IAAI,OAAO,CAMrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,KAAa,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAShF;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,+BAM7D"}
@@ -0,0 +1,24 @@
1
+ import { type LinkedKind, type LinkState } from './linked';
2
+ export interface LinkUnavailableProps {
3
+ kind: LinkedKind;
4
+ /** What it is, in a word: "Item". Drawn as "Item — not available.". */
5
+ noun: string;
6
+ /** Where it may still open, for someone who can: its app and address. */
7
+ openIn?: {
8
+ app: string;
9
+ href: string;
10
+ };
11
+ }
12
+ /**
13
+ * Not available: deleted, or not this reader's to see, which read the same.
14
+ * One line at a row's height, whether a row or a card was to draw. The way
15
+ * out stays, since the app it lives in may still open it for you.
16
+ */
17
+ export declare function LinkUnavailable({ kind, noun, openIn }: LinkUnavailableProps): import("react").JSX.Element;
18
+ export interface LinkRowProps {
19
+ link: LinkState;
20
+ /** Hovering shows its card. */
21
+ preview?: boolean;
22
+ }
23
+ export declare function LinkRow({ link, preview }: LinkRowProps): import("react").JSX.Element;
24
+ //# sourceMappingURL=LinkRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkRow.d.ts","sourceRoot":"","sources":["../src/LinkRow.tsx"],"names":[],"mappings":"AASA,OAAO,EAAY,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAKpE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACvC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,oBAAoB,+BAc3E;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,+BAyD7D"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * A part of something longer, shared live: its blocks as they are now, under
3
+ * the header of what it is part of (why:
4
+ * https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-shared-part-of-a-page-is-a-selected-run-of-blocks.md).
5
+ * There is no row or card choice for a part: it draws itself. The app draws
6
+ * the blocks and passes them as `children`.
7
+ */
8
+ import type { ReactNode } from 'react';
9
+ import type { LinkedKind } from './linked';
10
+ export interface PartCardProps {
11
+ /** Where its lookup stands. Default `ready`. */
12
+ state?: 'ready' | 'loading' | 'unavailable';
13
+ /** What it is part of, by its icon. */
14
+ kind: LinkedKind;
15
+ /** The title of what it is part of. */
16
+ heading?: string;
17
+ /** Opens what it is part of, at the part. */
18
+ href?: string;
19
+ /** The key of what it is part of: "ABC-2". */
20
+ partKey?: string;
21
+ /** What it is part of, in a word, for "A part of this item — not available.". */
22
+ noun?: string;
23
+ /** Where it may still open, for someone who can, when it is not available. */
24
+ openIn?: {
25
+ app: string;
26
+ href: string;
27
+ };
28
+ /** The part's blocks, drawn by the app. */
29
+ children?: ReactNode;
30
+ }
31
+ export declare function PartCard({ state, kind, heading, href, partKey, noun, openIn, children }: PartCardProps): import("react").JSX.Element;
32
+ //# sourceMappingURL=PartCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PartCard.d.ts","sourceRoot":"","sources":["../src/PartCard.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAI1C,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,iFAAiF;IACjF,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;CACrB;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAe,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,+BAwBzH"}
@@ -8,11 +8,20 @@ import type { CSSProperties } from 'react';
8
8
  * A list reveals after 150ms (`animate-skeleton-in`, in the preset) so a
9
9
  * fast load never flashes a skeleton — Peek's rule.
10
10
  */
11
+ declare const SKELETON_SHAPE: {
12
+ readonly bar: "rounded-sm";
13
+ readonly round: "rounded-full";
14
+ readonly control: "rounded-md";
15
+ };
11
16
  /** One pulsing bar at the inset colour: the piece every placeholder here is
12
- * built from. It draws nothing of its own — give it a width and a height. */
13
- export declare function SkeletonBar({ className, style }: {
17
+ * built from. It draws nothing of its own — give it a width and a height.
18
+ * `on="inset"` on an inset card, where the inset colour would vanish;
19
+ * `shape` for a line of words, a face or a ring, or a control. */
20
+ export declare function SkeletonBar({ className, style, on, shape }: {
14
21
  className?: string;
15
22
  style?: CSSProperties;
23
+ on?: 'surface' | 'inset';
24
+ shape?: keyof typeof SKELETON_SHAPE;
16
25
  }): import("react").JSX.Element;
17
26
  /** A 32px row: a 16px square and a bar, like a row with a face and a name. */
18
27
  export declare function SkeletonRow({ barWidth }: {
@@ -23,4 +32,5 @@ export declare function SkeletonList({ rows, className }: {
23
32
  rows?: number;
24
33
  className?: string;
25
34
  }): import("react").JSX.Element;
35
+ export {};
26
36
  //# sourceMappingURL=Skeleton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../src/Skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAG1C;;;;;;;;GAQG;AACH;8EAC8E;AAC9E,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,+BAE9F;AAID,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,EAAE,QAAc,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,+BAOpE;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,EAAE,IAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAQ1F"}
1
+ {"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../src/Skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAG1C;;;;;;;;GAQG;AACH,QAAA,MAAM,cAAc;;;;CAA+E,CAAA;AAEnG;;;mEAGmE;AACnE,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAc,EAAE,KAAa,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAC;IAAC,EAAE,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,OAAO,cAAc,CAAA;CAAE,+BAE5L;AAID,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,EAAE,QAAc,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,+BAOpE;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,EAAE,IAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAQ1F"}
package/dist/editor.js CHANGED
@@ -675,20 +675,44 @@ function textOf(block) {
675
675
  let text = "";
676
676
  const starts = [];
677
677
  const ends = [];
678
- block.node.descendants((node, offset) => {
679
- const at = block.pos + 1 + offset;
680
- if (node.isText && node.text) {
681
- for (let i = 0; i < node.text.length; i++) starts.push(at + i), ends.push(at + i + 1);
682
- text += node.text;
683
- } else if (node.isInline && node.isLeaf) {
684
- const wire = typeof node.attrs.uri === "string" ? node.attrs.uri : "";
685
- for (let i = 0; i < wire.length; i++) starts.push(at), ends.push(at + node.nodeSize);
686
- text += wire;
678
+ const add = (chars, start, end) => {
679
+ for (let i = 0; i < chars.length; i++) starts.push(start), ends.push(end);
680
+ text += chars;
681
+ };
682
+ const walk = (node, pos) => {
683
+ if (node.isTextblock) {
684
+ node.forEach((child, offset) => {
685
+ const at = pos + 1 + offset;
686
+ if (child.isText && child.text) {
687
+ for (let i = 0; i < child.text.length; i++) starts.push(at + i), ends.push(at + i + 1);
688
+ text += child.text;
689
+ } else if (child.type.name === "hardBreak") add("\n", at, at + child.nodeSize);
690
+ else if (child.isInline && child.isLeaf) add(String(child.attrs.href || child.attrs.uri || ""), at, at + child.nodeSize);
691
+ });
692
+ return;
687
693
  }
688
- return true;
689
- });
694
+ if (node.type.name === "listItem") {
695
+ node.forEach((child, offset) => void (LISTS.has(child.type.name) || walk(child, pos + 1 + offset)));
696
+ return;
697
+ }
698
+ const children = LISTS.has(node.type.name) ? itemsOf(node, pos) : childrenOf(node, pos);
699
+ children.forEach(({ node: child, pos: at }, index) => {
700
+ if (index > 0) add("\n", at, at);
701
+ walk(child, at);
702
+ });
703
+ };
704
+ walk(block.node, block.pos);
690
705
  return { text, starts, ends };
691
706
  }
707
+ var LISTS = /* @__PURE__ */ new Set(["bulletList", "orderedList"]);
708
+ function childrenOf(node, pos) {
709
+ const out = [];
710
+ node.forEach((child, offset) => void out.push({ node: child, pos: pos + 1 + offset }));
711
+ return out;
712
+ }
713
+ function itemsOf(list, pos) {
714
+ return childrenOf(list, pos).flatMap((item) => [item, ...childrenOf(item.node, item.pos).flatMap((c) => LISTS.has(c.node.type.name) ? itemsOf(c.node, c.pos) : [])]);
715
+ }
692
716
  function find(text, words, from, context) {
693
717
  let first = -1;
694
718
  for (let at = text.indexOf(words, from); at !== -1; at = text.indexOf(words, at + 1)) {
@@ -883,6 +907,7 @@ function anchorOfSelection(editor) {
883
907
  if (run.length > 1 && end <= 0) run = run.slice(0, -1), lastText = textOf(run[run.length - 1]), end = lastText.text.length;
884
908
  if (run.length === 1) lastText = firstText;
885
909
  if (run.length === 1 && firstText.text && start >= end) return null;
910
+ if (run.length === 1 && firstText.text && !firstText.text.slice(start, end).replace(/\n/g, "")) return null;
886
911
  const blocks = run.map((p) => p.node.attrs.blockId);
887
912
  if (start === 0 && end >= lastText.text.length) return { blocks };
888
913
  const single = run.length === 1;
@@ -1477,8 +1502,8 @@ function EditorBlockHandle({ editor, turnInto = turnIntoRows, actions, children,
1477
1502
  }, [editor, turnInto]);
1478
1503
  return /* @__PURE__ */ jsx6(BlockHandle, { editing, actions, className, children });
1479
1504
  }
1480
- var LISTS = ["bulletList", "orderedList"];
1481
- var isList = (node) => LISTS.includes(node.type.name);
1505
+ var LISTS2 = ["bulletList", "orderedList"];
1506
+ var isList = (node) => LISTS2.includes(node.type.name);
1482
1507
  function listItems(list, at) {
1483
1508
  const out = [];
1484
1509
  list.descendants((node, pos) => {
@@ -2304,7 +2329,7 @@ function claimsIn(doc2) {
2304
2329
  doc2.descendants((node, pos, parent) => {
2305
2330
  const fixed = node.type.name === "unknownBlock";
2306
2331
  if (!fixed && !BLOCK_TYPE_SET.has(node.type.name)) return;
2307
- if (parent?.type.name === "listItem" && LISTS2.has(node.type.name)) return;
2332
+ if (parent?.type.name === "listItem" && LISTS3.has(node.type.name)) return;
2308
2333
  const id = node.attrs.blockId;
2309
2334
  if (typeof id !== "string" || id === "") return;
2310
2335
  const copies = claims.get(id);
@@ -2351,11 +2376,11 @@ function repeatedBlockIds(doc2, before, mapping) {
2351
2376
  }
2352
2377
  var BLOCK_CONTAINERS = /* @__PURE__ */ new Set(["bulletList", "orderedList", "table", "tableRow", "tableHeader", "tableCell"]);
2353
2378
  var FLATTENED = /* @__PURE__ */ new Set(["listItem", "blockquote"]);
2354
- var LISTS2 = /* @__PURE__ */ new Set(["bulletList", "orderedList"]);
2379
+ var LISTS3 = /* @__PURE__ */ new Set(["bulletList", "orderedList"]);
2355
2380
  function innerLists(item, pos) {
2356
2381
  const out = [];
2357
2382
  item.forEach((child, offset) => {
2358
- if (LISTS2.has(child.type.name)) out.push({ pos: pos + 1 + offset, node: child });
2383
+ if (LISTS3.has(child.type.name)) out.push({ pos: pos + 1 + offset, node: child });
2359
2384
  });
2360
2385
  return out;
2361
2386
  }
@@ -2384,7 +2409,7 @@ function hiddenIds(doc2) {
2384
2409
  doc2.descendants((node, pos) => {
2385
2410
  if (!FLATTENED.has(node.type.name)) return;
2386
2411
  node.forEach((child, offset) => {
2387
- const inner = child.isTextblock || node.type.name === "listItem" && LISTS2.has(child.type.name);
2412
+ const inner = child.isTextblock || node.type.name === "listItem" && LISTS3.has(child.type.name);
2388
2413
  if (inner && idOf(child) !== void 0) out.push(pos + 1 + offset);
2389
2414
  });
2390
2415
  });