@estiva-app/ui 0.91.1 → 0.92.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 (108) hide show
  1. package/dist/AppProvider.d.ts +7 -3
  2. package/dist/AppProvider.d.ts.map +1 -1
  3. package/dist/AttachedCard.d.ts +5 -1
  4. package/dist/AttachedCard.d.ts.map +1 -1
  5. package/dist/BlockNodes.d.ts +14 -1
  6. package/dist/BlockNodes.d.ts.map +1 -1
  7. package/dist/CommentBox.d.ts +9 -2
  8. package/dist/CommentBox.d.ts.map +1 -1
  9. package/dist/ComposerTriggers.d.ts +11 -2
  10. package/dist/ComposerTriggers.d.ts.map +1 -1
  11. package/dist/DocumentEditor.d.ts.map +1 -1
  12. package/dist/LinkCard.d.ts.map +1 -1
  13. package/dist/LinkChip.d.ts.map +1 -1
  14. package/dist/LinkChips.d.ts +2 -1
  15. package/dist/LinkChips.d.ts.map +1 -1
  16. package/dist/LinkParts.d.ts +6 -1
  17. package/dist/LinkParts.d.ts.map +1 -1
  18. package/dist/LinkPlaces.d.ts +7 -0
  19. package/dist/LinkPlaces.d.ts.map +1 -1
  20. package/dist/LinkRow.d.ts +29 -6
  21. package/dist/LinkRow.d.ts.map +1 -1
  22. package/dist/PartCard.d.ts +9 -2
  23. package/dist/PartCard.d.ts.map +1 -1
  24. package/dist/ReferenceCards.d.ts +9 -39
  25. package/dist/ReferenceCards.d.ts.map +1 -1
  26. package/dist/ReferenceMenu.d.ts.map +1 -1
  27. package/dist/Select.d.ts +7 -1
  28. package/dist/Select.d.ts.map +1 -1
  29. package/dist/editor.d.ts +1 -1
  30. package/dist/editor.d.ts.map +1 -1
  31. package/dist/editor.js +204 -183
  32. package/dist/editor.js.map +3 -3
  33. package/dist/eslint/index.js +1 -1
  34. package/dist/eslint/index.js.map +2 -2
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +172 -52
  38. package/dist/index.js.map +3 -3
  39. package/dist/linked.d.ts +48 -3
  40. package/dist/linked.d.ts.map +1 -1
  41. package/dist/linked.examples.d.ts +6 -0
  42. package/dist/linked.examples.d.ts.map +1 -1
  43. package/dist/linkedFrom.d.ts +7 -3
  44. package/dist/linkedFrom.d.ts.map +1 -1
  45. package/package.json +1 -1
  46. package/registry.json +78 -65
  47. package/src/AppProvider.mdx +7 -5
  48. package/src/AppProvider.test.tsx +15 -1
  49. package/src/AppProvider.tsx +13 -4
  50. package/src/AttachedCard.mdx +2 -1
  51. package/src/AttachedCard.test.tsx +28 -0
  52. package/src/AttachedCard.tsx +12 -2
  53. package/src/BlockNodes.mdx +8 -1
  54. package/src/BlockNodes.tsx +98 -11
  55. package/src/CommentBox.mdx +8 -2
  56. package/src/CommentBox.stories.tsx +28 -1
  57. package/src/CommentBox.test.tsx +64 -1
  58. package/src/CommentBox.tsx +44 -5
  59. package/src/ComposerTriggers.mdx +1 -0
  60. package/src/ComposerTriggers.tsx +34 -15
  61. package/src/DocumentEditor.mdx +1 -1
  62. package/src/DocumentEditor.stories.tsx +2 -2
  63. package/src/DocumentEditor.test.tsx +37 -7
  64. package/src/DocumentEditor.tsx +2 -1
  65. package/src/LinkCard.mdx +9 -5
  66. package/src/LinkCard.stories.tsx +17 -2
  67. package/src/LinkCard.test.tsx +21 -0
  68. package/src/LinkCard.tsx +35 -16
  69. package/src/LinkChip.mdx +6 -1
  70. package/src/LinkChip.stories.tsx +7 -1
  71. package/src/LinkChip.test.tsx +12 -0
  72. package/src/LinkChip.tsx +6 -2
  73. package/src/LinkChips.mdx +4 -3
  74. package/src/LinkChips.stories.tsx +2 -2
  75. package/src/LinkChips.test.tsx +1 -2
  76. package/src/LinkChips.ts +2 -1
  77. package/src/LinkParts.mdx +3 -2
  78. package/src/LinkParts.stories.tsx +8 -0
  79. package/src/LinkParts.tsx +43 -6
  80. package/src/LinkPlaces.mdx +3 -0
  81. package/src/LinkPlaces.ts +19 -0
  82. package/src/LinkRow.mdx +8 -2
  83. package/src/LinkRow.stories.tsx +14 -2
  84. package/src/LinkRow.test.tsx +31 -1
  85. package/src/LinkRow.tsx +69 -25
  86. package/src/PartCard.mdx +9 -1
  87. package/src/PartCard.stories.tsx +9 -0
  88. package/src/PartCard.test.tsx +13 -0
  89. package/src/PartCard.tsx +19 -5
  90. package/src/ReferenceCards.test.tsx +4 -35
  91. package/src/ReferenceCards.ts +10 -119
  92. package/src/ReferenceMenu.mdx +6 -4
  93. package/src/ReferenceMenu.test.tsx +67 -5
  94. package/src/ReferenceMenu.tsx +18 -7
  95. package/src/Select.mdx +4 -0
  96. package/src/Select.stories.tsx +11 -1
  97. package/src/Select.tsx +10 -2
  98. package/src/editor.ts +0 -3
  99. package/src/eslint/no-restyled-part.ts +1 -1
  100. package/src/index.ts +4 -1
  101. package/src/linked.examples.ts +6 -0
  102. package/src/linked.test.ts +35 -1
  103. package/src/linked.ts +108 -3
  104. package/src/linkedFrom.test.tsx +42 -2
  105. package/src/linkedFrom.ts +15 -7
  106. package/src/registry/registry.test.ts +25 -6
  107. package/src/ReferenceCards.mdx +0 -86
  108. package/src/ReferenceCards.stories.tsx +0 -66
package/dist/linked.d.ts CHANGED
@@ -70,8 +70,14 @@ export interface Linked {
70
70
  href: string;
71
71
  /** What the reader calls it, quietly before the title: "ABC-2". */
72
72
  key?: string;
73
- /** What the app calls it, from its description of its files: "Issue", "Project", "Topic", "Document". Absent, the kind's own word. */
73
+ /**
74
+ * What it is, in a word, from its app's description of its files: "Issue", "Project", "Topic", "Document"; the app's
75
+ * name when its type has none (record a-file-is-labelled-by-its-type-not-its-app; `linkedFrom` does both). Absent,
76
+ * the kind's own word.
77
+ */
74
78
  noun?: string;
79
+ /** Archived: its row and card say "Archived" in the line under the title, and its values read as words. */
80
+ archived?: boolean;
75
81
  /** The line under a card's title: what it is in. Drawn after the key. */
76
82
  subtitle?: string;
77
83
  /** Its short summary, a sentence or two. Without one a card shows the title alone. */
@@ -121,8 +127,10 @@ export interface LoadingShape {
121
127
  }
122
128
  /**
123
129
  * Where a link's lookup stands. `loading` knows the kind from the address, and
124
- * a shape when the app remembers one; `unavailable` is deleted or not the
125
- * reader's to see, which read the same (Miky, 15 Oct).
130
+ * a shape when the app remembers one; `unavailable` is not the reader's to see
131
+ * ("Issue not available"), or `deleted` ("Issue deleted"), which a reader tells
132
+ * apart by a deletion naming the address (SPEC §13.6.1: deleted is not
133
+ * not-permitted). Written as a URL, it is that URL either way (`url`).
126
134
  */
127
135
  export type LinkState = {
128
136
  state: 'loading';
@@ -138,6 +146,13 @@ export type LinkState = {
138
146
  app: string;
139
147
  href: string;
140
148
  };
149
+ /** Deleted, as a trusted deletion naming its address says (SPEC §13.6.1): "Issue deleted", with no way out. */
150
+ deleted?: boolean;
151
+ /**
152
+ * The URL it was written as: drawn as that URL, a plain link, in place of "not available" or "deleted" (SPEC
153
+ * §13.1, C21). Those words are only for a link with no URL to fall back on, a `nostr:` reference.
154
+ */
155
+ url?: string;
141
156
  } | {
142
157
  state: 'ready';
143
158
  linked: Linked;
@@ -146,6 +161,36 @@ export type LinkState = {
146
161
  export declare function chosenOf(picker: LinkedPicker | undefined): PickerOption | undefined;
147
162
  /** The shape `linked`'s card takes, for its placeholder the next time it loads. */
148
163
  export declare function loadingShapeOf(linked: Linked): LoadingShape;
164
+ /** A card's shape, and the height it drew at in px: the height holds what the shape cannot say, a summary of two lines. */
165
+ export type CardShape = LoadingShape & {
166
+ height?: number;
167
+ };
168
+ /**
169
+ * The shape each card last drew at on this device, so its placeholder the next
170
+ * time is the card's own height and nothing around it moves as it loads
171
+ * (Peek's peek#533 and #534, then Ship's copy). One per app, under its own
172
+ * key, in localStorage because the first paint reads it synchronously; the app
173
+ * clears it with the rest of the device's copy at sign-out.
174
+ */
175
+ export interface CardShapeMemory {
176
+ /** The shape the card for `id` took the last time this device drew it; before that, `firstDraw`'s for its kind, if any. */
177
+ of: (id: string, kind: LinkedKind) => CardShape | undefined;
178
+ /** The shape a card just drew at: `loadingShapeOf(linked)`, and the height it measured. */
179
+ note: (id: string, shape: CardShape) => void;
180
+ /** Sign-out. */
181
+ clear: () => void;
182
+ }
183
+ /**
184
+ * The device's memory of the shapes its cards drew at, under the app's own
185
+ * `storageKey`, keeping the newest `limit`. `firstDraw` is a kind's shape for
186
+ * a card this device has not drawn yet, where the kit's own placeholder for
187
+ * the kind is not the app's usual card. Peek's and Ship's `cardShapes`, lifted
188
+ * here for Leaf, the third app to need one.
189
+ */
190
+ export declare function cardShapeMemory(storageKey: string, options?: {
191
+ limit?: number;
192
+ firstDraw?: Partial<Record<LinkedKind, LoadingShape>>;
193
+ }): CardShapeMemory;
149
194
  /**
150
195
  * What this device last found it could not show, kept so the next open draws
151
196
  * "not available." from the first paint instead of a card's height that then
@@ -1 +1 @@
1
- {"version":3,"file":"linked.d.ts","sourceRoot":"","sources":["../src/linked.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,kCAAuB,CAAA;AAE5C,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;AAE3C,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AA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KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;CAAO,GAAG,eAAe,CA4C5J;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IAC5B,gFAAgF;IAChF,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,gBAAgB;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,oHAAoH;AACpH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,iBAAiB,CAuCpF"}
@@ -24,4 +24,10 @@ export declare const SAID: Linked;
24
24
  export declare const ready: (linked: Linked) => LinkState;
25
25
  export declare const LOADING: LinkState;
26
26
  export declare const UNAVAILABLE: LinkState;
27
+ /** Deleted, as a trusted deletion naming its address says: told apart from not available (SPEC §13.6.1). */
28
+ export declare const DELETED: LinkState;
29
+ /** Written as a URL that cannot be shown: it stays that URL. */
30
+ export declare const WRITTEN_AS_A_URL: LinkState;
31
+ /** The item, archived: its row and card say so, and its values read as words. */
32
+ export declare const ITEM_ARCHIVED: Linked;
27
33
  //# sourceMappingURL=linked.examples.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"linked.examples.d.ts","sourceRoot":"","sources":["../src/linked.examples.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAgB,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI7E,eAAO,MAAM,cAAc,EAAE,YAAY,EAKxC,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,YAAY,EAIhC,CAAA;AAMD,8FAA8F;AAE9F,eAAO,MAAM,IAAI,EAAE,MAWlB,CAAA;AAED,wD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kDAAkD;AAClD,eAAO,MAAM,IAAI,EAAE,MAQlB,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,QAAQ,MAAM,KAAG,SAAyC,CAAA;AAChF,eAAO,MAAM,OAAO,EAAE,SAA+C,CAAA;AACrE,eAAO,MAAM,WAAW,EAAE,SAAkH,CAAA;AAC5I,4GAA4G;AAC5G,eAAO,MAAM,OAAO,EAAE,SAAiF,CAAA;AACvG,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,EAAE,SAAuG,CAAA;AACtI,iFAAiF;AACjF,eAAO,MAAM,aAAa,EAAE,MAA8C,CAAA"}
@@ -77,12 +77,16 @@ export interface LinkedFromOptions<T extends LinkedSource = LinkedSource> {
77
77
  export declare function linkedFrom<T extends LinkedSource>(object: T, options: LinkedFromOptions<T>): Linked;
78
78
  /**
79
79
  * Where a reference's read stands, for the kit: `undefined` is still read,
80
- * `null` an answer of nothing. `unread` is what the app knows from the address
81
- * alone, for those two. Nothing, and a file the reader may not read, draw
82
- * alike: "not available." (Miky, 15 Oct).
80
+ * `null` an answer of nothing. `unread` is what the app knows without the
81
+ * object: its kind and noun from the address, whether a trusted deletion names
82
+ * it (`deleted`, SPEC §13.6.1: "Issue deleted", where nothing otherwise and a
83
+ * file the reader may not read draw alike, "not available"), and the URL it
84
+ * was written as (`url`), which it then reads as instead of either (§13.1).
83
85
  */
84
86
  export declare function linkStateFrom<T extends LinkedSource>(object: T | null | undefined, unread: {
85
87
  kind: LinkedKind;
86
88
  noun: string;
89
+ deleted?: boolean;
90
+ url?: string;
87
91
  }, options: LinkedFromOptions<T>): LinkState;
88
92
  //# sourceMappingURL=linkedFrom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"linkedFrom.d.ts","sourceRoot":"","sources":["../src/linkedFrom.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAe,kBAAkB,EAAE,UAAU,EAA4C,MAAM,UAAU,CAAA;AAExI,iEAAiE;AACjE,M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AAG,IAAI,GAAG,SAAS,EAC5B,MAAM,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3E,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,SAAS,CAeX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/ui",
3
- "version": "0.91.1",
3
+ "version": "0.92.0",
4
4
  "description": "Estiva's design tokens (the contract) and a small set of primitives (a convenience) for every Estiva app.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/registry.json CHANGED
@@ -4,9 +4,9 @@
4
4
  "kind": "package",
5
5
  "repo": "estiva-ui",
6
6
  "package": "@estiva-app/ui",
7
- "packageVersion": "0.91.1",
8
- "exports": 211,
9
- "typeExports": 211,
7
+ "packageVersion": "0.92.0",
8
+ "exports": 210,
9
+ "typeExports": 213,
10
10
  "files": null
11
11
  },
12
12
  "storybook": {
@@ -1103,6 +1103,25 @@
1103
1103
  "rounded-lg border bg-bg-surface border-border-default border-warning-muted hover:border-warning-muted border-dashed overflow-hidden"
1104
1104
  ]
1105
1105
  },
1106
+ {
1107
+ "name": "cardShapeMemory",
1108
+ "repo": "estiva-ui",
1109
+ "kind": "helper",
1110
+ "importPath": "@estiva-app/ui",
1111
+ "sourceFile": "src/linked.ts",
1112
+ "purpose": "The device's memory of the shapes its cards drew at, under the app's own `storageKey`, keeping the newest `limit`.",
1113
+ "purposeFrom": "comment",
1114
+ "props": [],
1115
+ "variants": [],
1116
+ "ownsBehaviours": [],
1117
+ "status": "stable",
1118
+ "migrationStage": null,
1119
+ "docsId": null,
1120
+ "storyId": null,
1121
+ "docPage": null,
1122
+ "app": null,
1123
+ "looks": []
1124
+ },
1106
1125
  {
1107
1126
  "name": "Checkbox",
1108
1127
  "repo": "estiva-ui",
@@ -2032,7 +2051,7 @@
2032
2051
  "name": "referenceIcon",
2033
2052
  "takes": "a handler",
2034
2053
  "required": false,
2035
- "note": "A `[` row's and chip's 16px icon from what it points at; absent, a neutral square."
2054
+ "note": "A `[` row's and chip's 16px icon from what it points at."
2036
2055
  },
2037
2056
  {
2038
2057
  "name": "insert",
@@ -2110,7 +2129,7 @@
2110
2129
  "name": "referenceView",
2111
2130
  "takes": "ComponentType<ReferenceViewProps>",
2112
2131
  "required": false,
2113
- "note": "How a `nostr:` reference the box holds is drawn — the app's own chip."
2132
+ "note": "How a link the box holds is drawn — a pasted one, a pasted `nostr:` address, and a `[` pick alike: the app's view of the kit's `LinkChip`, told it is being edited (no preview; a click stays in the draft)."
2114
2133
  },
2115
2134
  {
2116
2135
  "name": "extensions",
@@ -2215,6 +2234,7 @@
2215
2234
  "docPage": null,
2216
2235
  "app": null,
2217
2236
  "looks": [
2237
+ "text-small tabular-nums font-medium text-text-primary",
2218
2238
  "rounded-md text-small tabular-nums transition-colors hover:bg-bg-hover font-medium text-text-primary",
2219
2239
  "rounded-md text-small tabular-nums transition-colors hover:bg-bg-hover text-text-secondary",
2220
2240
  "rounded-md text-small tabular-nums transition-colors hover:bg-bg-hover"
@@ -4970,7 +4990,7 @@
4970
4990
  "kind": "component",
4971
4991
  "importPath": "@estiva-app/ui",
4972
4992
  "sourceFile": "src/LinkRow.tsx",
4973
- "purpose": "Not available: deleted, or not this reader's to see, which read the same.",
4993
+ "purpose": "Not available: not this reader's to see, or deleted, which says so (SPEC §13.6.1: deleted is not not-permitted).",
4974
4994
  "purposeFrom": "comment",
4975
4995
  "props": [
4976
4996
  {
@@ -4996,6 +5016,12 @@
4996
5016
  "takes": "true/false",
4997
5017
  "required": false,
4998
5018
  "note": "In a card's place: a card's 12px round it."
5019
+ },
5020
+ {
5021
+ "name": "deleted",
5022
+ "takes": "true/false",
5023
+ "required": false,
5024
+ "note": "Deleted (SPEC §13.6.1): \"Issue deleted\", and no way out, since there is nothing left to open."
4999
5025
  }
5000
5026
  ],
5001
5027
  "variants": [],
@@ -5119,7 +5145,13 @@
5119
5145
  "name": "noun",
5120
5146
  "takes": "text",
5121
5147
  "required": false,
5122
- "note": "What the app calls it, from its description of its files: \"Issue\", \"Project\", \"Topic\", \"Document\"."
5148
+ "note": "What it is, in a word, from its app's description of its files: \"Issue\", \"Project\", \"Topic\", \"Document\"; the app's name when its type has none (record a-file-is-labelled-by-its-type-not-its-app; `linkedFrom` does both)."
5149
+ },
5150
+ {
5151
+ "name": "archived",
5152
+ "takes": "true/false",
5153
+ "required": false,
5154
+ "note": "Archived: its row and card say \"Archived\" in the line under the title, and its values read as words."
5123
5155
  },
5124
5156
  {
5125
5157
  "name": "subtitle",
@@ -6209,7 +6241,7 @@
6209
6241
  "props": [
6210
6242
  {
6211
6243
  "name": "state",
6212
- "takes": "ready | loading | unavailable",
6244
+ "takes": "ready | loading | unavailable | deleted | detached | unaddressable",
6213
6245
  "required": false,
6214
6246
  "note": "Where its lookup stands. Default `ready`."
6215
6247
  },
@@ -6229,7 +6261,7 @@
6229
6261
  "name": "href",
6230
6262
  "takes": "text",
6231
6263
  "required": false,
6232
- "note": "Opens what it is part of, at the part."
6264
+ "note": "Opens what it is part of, at the part; `unaddressable`, the whole of it."
6233
6265
  },
6234
6266
  {
6235
6267
  "name": "partKey",
@@ -6274,7 +6306,10 @@
6274
6306
  "values": [
6275
6307
  "ready",
6276
6308
  "loading",
6277
- "unavailable"
6309
+ "unavailable",
6310
+ "deleted",
6311
+ "detached",
6312
+ "unaddressable"
6278
6313
  ]
6279
6314
  }
6280
6315
  ],
@@ -7250,8 +7285,8 @@
7250
7285
  "ownsBehaviours": [],
7251
7286
  "status": "stable",
7252
7287
  "migrationStage": null,
7253
- "docsId": "writing-referencecards--docs",
7254
- "storyId": "writing-referencecards--in-an-editor",
7288
+ "docsId": null,
7289
+ "storyId": null,
7255
7290
  "docPage": null,
7256
7291
  "app": null,
7257
7292
  "looks": []
@@ -7269,31 +7304,12 @@
7269
7304
  "ownsBehaviours": [],
7270
7305
  "status": "stable",
7271
7306
  "migrationStage": null,
7272
- "docsId": "writing-referencecards--docs",
7273
- "storyId": "writing-referencecards--in-an-editor",
7307
+ "docsId": null,
7308
+ "storyId": null,
7274
7309
  "docPage": null,
7275
7310
  "app": null,
7276
7311
  "looks": []
7277
7312
  },
7278
- {
7279
- "name": "ReferenceCards",
7280
- "repo": "estiva-ui",
7281
- "kind": "component",
7282
- "importPath": "@estiva-app/ui/editor",
7283
- "sourceFile": "src/ReferenceCards.ts",
7284
- "purpose": "Deprecated. A new editor uses LinkPlaces.",
7285
- "purposeFrom": "page",
7286
- "props": [],
7287
- "variants": [],
7288
- "ownsBehaviours": [],
7289
- "status": "stable",
7290
- "migrationStage": null,
7291
- "docsId": "writing-referencecards--docs",
7292
- "storyId": "writing-referencecards--in-an-editor",
7293
- "docPage": "src/ReferenceCards.mdx",
7294
- "app": null,
7295
- "looks": []
7296
- },
7297
7313
  {
7298
7314
  "name": "referenceMenu",
7299
7315
  "repo": "estiva-ui",
@@ -7968,6 +7984,12 @@
7968
7984
  "required": false,
7969
7985
  "note": null
7970
7986
  },
7987
+ {
7988
+ "name": "fill",
7989
+ "takes": "field | wash",
7990
+ "required": false,
7991
+ "note": "What the trigger is filled with: a form's `field` (default), or the see-through `wash` on a see-through card, one step over it, as the card is over the message (a link card's pickers; Katerina, 30 Oct: the field's fill read as a dark hole in a card on a selected message)."
7992
+ },
7971
7993
  {
7972
7994
  "name": "ariaLabel",
7973
7995
  "takes": "text",
@@ -8012,6 +8034,13 @@
8012
8034
  "default",
8013
8035
  "small"
8014
8036
  ]
8037
+ },
8038
+ {
8039
+ "prop": "fill",
8040
+ "values": [
8041
+ "field",
8042
+ "wash"
8043
+ ]
8015
8044
  }
8016
8045
  ],
8017
8046
  "ownsBehaviours": [
@@ -8055,15 +8084,18 @@
8055
8084
  "docPage": "src/Select.mdx",
8056
8085
  "app": null,
8057
8086
  "looks": [
8058
- "rounded-lg border bg-bg-field shadow-field text-left border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8059
- "rounded-lg border bg-bg-field shadow-field text-left border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8060
- "rounded-lg border bg-bg-field shadow-field text-left border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8061
- "rounded-lg border bg-bg-field shadow-field text-left border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8062
- "rounded-lg border bg-bg-field shadow-field text-left border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted hover:border-border-strong focus-visible:hover:border-border-focus aria-expanded:hover:border-border-focus disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8063
- "rounded-lg border bg-bg-field shadow-field text-left border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted hover:border-border-strong focus-visible:hover:border-border-focus aria-expanded:hover:border-border-focus disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8064
- "rounded-lg border bg-bg-field shadow-field text-left border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted hover:border-border-strong focus-visible:hover:border-border-focus aria-expanded:hover:border-border-focus disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8065
- "rounded-lg border bg-bg-field shadow-field text-left border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted hover:border-border-strong focus-visible:hover:border-border-focus aria-expanded:hover:border-border-focus disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8066
- "rounded-lg border bg-bg-field shadow-field text-left"
8087
+ "rounded-lg border text-left bg-bg-wash leaf:bg-bg-field leaf:shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8088
+ "rounded-lg border text-left bg-bg-wash leaf:bg-bg-field leaf:shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8089
+ "rounded-lg border text-left bg-bg-wash leaf:bg-bg-field leaf:shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8090
+ "rounded-lg border text-left bg-bg-wash leaf:bg-bg-field leaf:shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8091
+ "rounded-lg border text-left bg-bg-wash leaf:bg-bg-field leaf:shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted hover:border-border-strong focus-visible:hover:border-border-focus aria-expanded:hover:border-border-focus disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8092
+ "rounded-lg border text-left bg-bg-wash leaf:bg-bg-field leaf:shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted hover:border-border-strong focus-visible:hover:border-border-focus aria-expanded:hover:border-border-focus disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8093
+ "rounded-lg border text-left bg-bg-wash leaf:bg-bg-field leaf:shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted hover:border-border-strong focus-visible:hover:border-border-focus aria-expanded:hover:border-border-focus disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8094
+ "rounded-lg border text-left bg-bg-wash leaf:bg-bg-field leaf:shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted hover:border-border-strong focus-visible:hover:border-border-focus aria-expanded:hover:border-border-focus disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8095
+ "rounded-lg border text-left bg-bg-field shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8096
+ "rounded-lg border text-left bg-bg-field shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption",
8097
+ "rounded-lg border text-left bg-bg-field shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-input-value",
8098
+ "rounded-lg border text-left bg-bg-field shadow-field border-border-field outline-none transition-colors text-text-primary placeholder:text-text-muted disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field cursor-not-allowed bg-bg-disabled text-text-disabled focus-visible:border-border-focus aria-expanded:border-border-focus signal:transition-shadow signal:focus-visible:shadow-focus-ring text-caption"
8067
8099
  ]
8068
8100
  },
8069
8101
  {
@@ -8169,8 +8201,8 @@
8169
8201
  "ownsBehaviours": [],
8170
8202
  "status": "stable",
8171
8203
  "migrationStage": null,
8172
- "docsId": "writing-referencecards--docs",
8173
- "storyId": "writing-referencecards--in-an-editor",
8204
+ "docsId": null,
8205
+ "storyId": null,
8174
8206
  "docPage": null,
8175
8207
  "app": null,
8176
8208
  "looks": []
@@ -8188,8 +8220,8 @@
8188
8220
  "ownsBehaviours": [],
8189
8221
  "status": "stable",
8190
8222
  "migrationStage": null,
8191
- "docsId": "writing-referencecards--docs",
8192
- "storyId": "writing-referencecards--in-an-editor",
8223
+ "docsId": null,
8224
+ "storyId": null,
8193
8225
  "docPage": null,
8194
8226
  "app": null,
8195
8227
  "looks": []
@@ -9798,25 +9830,6 @@
9798
9830
  "app": null,
9799
9831
  "looks": []
9800
9832
  },
9801
- {
9802
- "name": "useReferenceCards",
9803
- "repo": "estiva-ui",
9804
- "kind": "hook",
9805
- "importPath": "@estiva-app/ui/editor",
9806
- "sourceFile": "src/ReferenceCards.ts",
9807
- "purpose": "The slots to draw cards into, kept current as the document changes.",
9808
- "purposeFrom": "comment",
9809
- "props": [],
9810
- "variants": [],
9811
- "ownsBehaviours": [],
9812
- "status": "stable",
9813
- "migrationStage": null,
9814
- "docsId": "writing-referencecards--docs",
9815
- "storyId": "writing-referencecards--in-an-editor",
9816
- "docPage": null,
9817
- "app": null,
9818
- "looks": []
9819
- },
9820
9833
  {
9821
9834
  "name": "useToast",
9822
9835
  "repo": "estiva-ui",
@@ -56,11 +56,13 @@ function Root({ children }) {
56
56
  the initials.
57
57
  - `navigate` gets the link's path, query and `#` part (`/message/1?x=2`),
58
58
  also when the `href` is the app's whole address (`https://app.test/message/1`):
59
- a router reads a whole address as a path under the current page. The browser keeps
60
- every other click: one already handled (`preventDefault`), one with Ctrl,
61
- Cmd, Shift or Alt, the middle button, a link that opens a new tab or
62
- downloads, and an address on another site or in another scheme
63
- (`folder:`, `mailto:`).
59
+ a router reads a whole address as a path under the current page.
60
+ - **Another site's address opens in a new tab** on a plain click, one that
61
+ cannot reach back into this page, as "Open in …" does: another app's file
62
+ never takes the reader out of this app. The browser keeps every other click:
63
+ one already handled (`preventDefault`), one with Ctrl, Cmd, Shift or Alt, the
64
+ middle button, a link that opens a new tab or downloads, and an address in
65
+ another scheme (`folder:`, `mailto:`).
64
66
  - A link's own `onClick` runs first, so an app that still passes its router
65
67
  click per link keeps working while it moves over.
66
68
  - `active` is still the caller's: say which row is the current page where you
@@ -124,7 +124,21 @@ describe('changing page', () => {
124
124
  })
125
125
 
126
126
  it.each([
127
- ['another site', <Link href="https://elsewhere.test/topics">Topics</Link>],
127
+ ['Link', <Link href="https://elsewhere.test/topics">Topics</Link>],
128
+ ['InlineChip', <InlineChip href="https://elsewhere.test/topics">Topics</InlineChip>],
129
+ ])('%s: a plain click to another site opens it in a new tab that cannot reach back, and stays in the app', (_name, part) => {
130
+ const navigate = vi.fn()
131
+ const open = vi.spyOn(window, 'open').mockImplementation(() => null)
132
+ inApp(navigate, part)
133
+ const event = new MouseEvent('click', { bubbles: true, cancelable: true })
134
+ screen.getByRole('link').dispatchEvent(event)
135
+ expect(open).toHaveBeenCalledWith('https://elsewhere.test/topics', '_blank', 'noopener,noreferrer')
136
+ expect(event.defaultPrevented).toBe(true)
137
+ expect(navigate).not.toHaveBeenCalled()
138
+ open.mockRestore()
139
+ })
140
+
141
+ it.each([
128
142
  ['another scheme', <Link href="folder:1234">Topics</Link>],
129
143
  ['a new tab', <Link href="/topics" external>Topics</Link>],
130
144
  ['a download', <Link href="/file.pdf" download>File</Link>],
@@ -49,11 +49,15 @@ export function usePictureFor(): AppSetup['pictureFor'] {
49
49
  * on a plain left click to this app's own address, the app's `navigate` in
50
50
  * place of a page load.
51
51
  *
52
+ * A plain left click to another site's address — another app's file — opens
53
+ * it in a new tab that cannot reach back into this one, as "Open in …" does
54
+ * (Katerina, 30 Oct): the app being written in is not left for it.
55
+ *
52
56
  * Left to the browser, as an `<a>` always is: a click the caller already
53
57
  * handled (`preventDefault`), a click with a modifier or another button (a new
54
- * tab), a link that opens elsewhere (`target`) or downloads, and an address on
55
- * another site or in another scheme (`folder:`, `mailto:`). So an app that
56
- * still passes its own router `onClick`, as Ship's `linkTo` does, is unchanged.
58
+ * tab), a link that opens elsewhere (`target`) or downloads, and an address in
59
+ * another scheme (`folder:`, `mailto:`). So an app that still passes its own
60
+ * router `onClick`, as Ship's `linkTo` does, is unchanged.
57
61
  */
58
62
  export function useInAppClick<E extends HTMLElement>(href: string | undefined, onClick?: MouseEventHandler<E>): MouseEventHandler<E> | undefined {
59
63
  const navigate = useContext(Setup).navigate
@@ -70,7 +74,12 @@ export function useInAppClick<E extends HTMLElement>(href: string | undefined, o
70
74
  } catch {
71
75
  return
72
76
  }
73
- if (url.origin !== window.location.origin) return
77
+ if (url.origin !== window.location.origin) {
78
+ if (url.protocol !== 'https:' && url.protocol !== 'http:') return
79
+ event.preventDefault()
80
+ window.open(url.href, '_blank', 'noopener,noreferrer')
81
+ return
82
+ }
74
83
  event.preventDefault()
75
84
  // The path, never the whole address: a router reads `https://…` as a path
76
85
  // under the current page and lands nowhere (Peek's message link, 8 October).
@@ -11,7 +11,7 @@ The one card attached to a piece of text, and the ✕ that removes it.
11
11
 
12
12
  ## When
13
13
 
14
- - **while writing** — `CommentBox` places it inside the box, with the files, on their fill, its values as words. Write nothing for that.
14
+ - **while writing** — `CommentBox` places it inside the box, with the files, on their fill, its values and its links as words, so a click on it never leaves the draft. Write nothing for that.
15
15
  - **after sending** — under the text, its values as pickers.
16
16
  - **no ✕** — no `onRemove`: to anyone but who wrote it.
17
17
 
@@ -35,6 +35,7 @@ import { AttachedCard } from '@estiva-app/ui'
35
35
  - `onRemove` is the app's: before sending it drops the card from what will be sent; after, it sends the edit that removes it.
36
36
  - It is at most 480px wide.
37
37
  - **An app that draws its sent cards itself** passes its card as `children` instead of `link`, so the card in a box and under a sent message are the same: `<AttachedCard onRemove={remove}>{appCard}</AttachedCard>`. `CommentBox` draws its card this way.
38
+ - **One inside another draws only its card**, with the outer one's ✕: an app whose sent card is an `AttachedCard` hands the box that same card, and the box's ✕ is the one. There is never a card in a card.
38
39
 
39
40
  ## What it owns
40
41
 
@@ -4,6 +4,7 @@ import { cleanup, render, screen } from '@testing-library/react'
4
4
  import userEvent from '@testing-library/user-event'
5
5
  import { afterEach, describe, expect, it, vi } from 'vitest'
6
6
  import { AttachedCard } from './AttachedCard'
7
+ import { inTheBox } from './linked'
7
8
  import { ITEM, ready } from './linked.examples'
8
9
 
9
10
  afterEach(cleanup)
@@ -33,6 +34,33 @@ describe('AttachedCard', () => {
33
34
  expect(onRemove).toHaveBeenCalledTimes(1)
34
35
  })
35
36
 
37
+ it('drawn inside another, as the box wraps the card an app hands it, is one card with one ✕, the outer one', async () => {
38
+ const user = userEvent.setup()
39
+ const outer = vi.fn()
40
+ const inner = vi.fn()
41
+ const { container } = render(
42
+ <AttachedCard onRemove={outer}>
43
+ <AttachedCard link={ready(ITEM)} onRemove={inner} />
44
+ </AttachedCard>,
45
+ )
46
+ expect(container.querySelectorAll('.group\\/card')).toHaveLength(1)
47
+ expect(screen.getAllByRole('button', { name: 'Remove' })).toHaveLength(1)
48
+ await user.click(screen.getByRole('button', { name: 'Remove' }))
49
+ expect(outer).toHaveBeenCalledTimes(1)
50
+ expect(inner).not.toHaveBeenCalled()
51
+ })
52
+
53
+ it('in a box being written in, its title and its count are words, not links, so the draft is not left', () => {
54
+ render(
55
+ <inTheBox.Provider value>
56
+ <AttachedCard link={ready(ITEM)} onRemove={() => {}} />
57
+ </inTheBox.Provider>,
58
+ )
59
+ expect(screen.getByText(ITEM.title)).toBeTruthy()
60
+ expect(screen.queryAllByRole('link')).toHaveLength(0)
61
+ expect(screen.getByText('4 comments')).toBeTruthy()
62
+ })
63
+
36
64
  it('has no ✕ for anyone but who wrote it', () => {
37
65
  render(<AttachedCard link={ready(ITEM)} />)
38
66
  expect(screen.queryByRole('button', { name: 'Remove' })).toBeNull()
@@ -7,8 +7,12 @@
7
7
  * On a screen that cannot hover it always shows, so a tap reaches it (Miky, 16
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
+ *
11
+ * One inside another draws only its card: the box wraps the card an app hands
12
+ * it, and an app that draws its sent card as an `AttachedCard` hands it that,
13
+ * so the box's ✕ is the one (Katerina, 30 Oct: no card in a card).
10
14
  */
11
- import type { ReactNode } from 'react'
15
+ import { createContext, useContext, type ReactNode } from 'react'
12
16
  import { RemoveBadge } from './AttachmentCard'
13
17
  import { LinkCard } from './LinkCard'
14
18
  import type { LinkState } from './linked'
@@ -24,11 +28,17 @@ interface AttachedCardBase {
24
28
  */
25
29
  export type AttachedCardProps = AttachedCardBase & ({ link: LinkState; children?: never } | { link?: never; children: ReactNode })
26
30
 
31
+ /** Inside an `AttachedCard`: one inside it draws only its card. */
32
+ const Attached = createContext(false)
33
+
27
34
  export function AttachedCard({ link, children, onRemove }: AttachedCardProps) {
35
+ const card = link ? <LinkCard link={link} /> : children
36
+ const inside = useContext(Attached)
37
+ if (inside) return <>{card}</>
28
38
  return (
29
39
  // At most 480px, so it never runs a column's or a wide box's whole width (Katerina, 29 and 30 Oct).
30
40
  <div className="group/card relative max-w-[480px]">
31
- {link ? <LinkCard link={link} /> : children}
41
+ <Attached.Provider value>{card}</Attached.Provider>
32
42
  {onRemove && (
33
43
  <RemoveBadge
34
44
  label="Remove"