@estiva-app/ui 0.91.2 → 0.92.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/AppProvider.d.ts +7 -3
- package/dist/AppProvider.d.ts.map +1 -1
- package/dist/AttachedCard.d.ts +5 -1
- package/dist/AttachedCard.d.ts.map +1 -1
- package/dist/BlockNodes.d.ts +14 -1
- package/dist/BlockNodes.d.ts.map +1 -1
- package/dist/Button.d.ts +11 -1
- package/dist/Button.d.ts.map +1 -1
- package/dist/CommentBox.d.ts +9 -2
- package/dist/CommentBox.d.ts.map +1 -1
- package/dist/ComposerTriggers.d.ts +11 -2
- package/dist/ComposerTriggers.d.ts.map +1 -1
- package/dist/DocumentEditor.d.ts.map +1 -1
- package/dist/LinkCard.d.ts.map +1 -1
- package/dist/LinkChip.d.ts.map +1 -1
- package/dist/LinkChips.d.ts +2 -1
- package/dist/LinkChips.d.ts.map +1 -1
- package/dist/LinkParts.d.ts +6 -1
- package/dist/LinkParts.d.ts.map +1 -1
- package/dist/LinkPlaces.d.ts +7 -0
- package/dist/LinkPlaces.d.ts.map +1 -1
- package/dist/LinkRow.d.ts +29 -6
- package/dist/LinkRow.d.ts.map +1 -1
- package/dist/PartCard.d.ts +9 -2
- package/dist/PartCard.d.ts.map +1 -1
- package/dist/ReferenceCards.d.ts +9 -39
- package/dist/ReferenceCards.d.ts.map +1 -1
- package/dist/ReferenceMenu.d.ts.map +1 -1
- package/dist/editor.d.ts +1 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +204 -183
- package/dist/editor.js.map +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +211 -97
- package/dist/index.js.map +3 -3
- package/dist/linked.d.ts +48 -3
- package/dist/linked.d.ts.map +1 -1
- package/dist/linked.examples.d.ts +6 -0
- package/dist/linked.examples.d.ts.map +1 -1
- package/dist/linkedFrom.d.ts +7 -3
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +65 -56
- package/src/AppProvider.mdx +7 -5
- package/src/AppProvider.test.tsx +15 -1
- package/src/AppProvider.tsx +13 -4
- package/src/AttachedCard.mdx +2 -1
- package/src/AttachedCard.test.tsx +28 -0
- package/src/AttachedCard.tsx +12 -2
- package/src/BlockNodes.mdx +8 -1
- package/src/BlockNodes.tsx +98 -11
- package/src/Button.mdx +25 -3
- package/src/Button.stories.tsx +15 -1
- package/src/Button.test.tsx +33 -0
- package/src/Button.tsx +65 -49
- package/src/CommentBox.mdx +8 -2
- package/src/CommentBox.stories.tsx +28 -1
- package/src/CommentBox.test.tsx +64 -1
- package/src/CommentBox.tsx +44 -5
- package/src/ComposerTriggers.mdx +1 -0
- package/src/ComposerTriggers.tsx +34 -15
- package/src/DocumentEditor.mdx +1 -1
- package/src/DocumentEditor.stories.tsx +2 -2
- package/src/DocumentEditor.test.tsx +37 -7
- package/src/DocumentEditor.tsx +2 -1
- package/src/LinkCard.mdx +9 -5
- package/src/LinkCard.stories.tsx +17 -2
- package/src/LinkCard.test.tsx +21 -0
- package/src/LinkCard.tsx +35 -16
- package/src/LinkChip.mdx +6 -1
- package/src/LinkChip.stories.tsx +7 -1
- package/src/LinkChip.test.tsx +12 -0
- package/src/LinkChip.tsx +6 -2
- package/src/LinkChips.mdx +4 -3
- package/src/LinkChips.stories.tsx +2 -2
- package/src/LinkChips.test.tsx +1 -2
- package/src/LinkChips.ts +2 -1
- package/src/LinkParts.mdx +3 -2
- package/src/LinkParts.stories.tsx +8 -0
- package/src/LinkParts.tsx +40 -6
- package/src/LinkPlaces.mdx +3 -0
- package/src/LinkPlaces.ts +19 -0
- package/src/LinkRow.mdx +8 -2
- package/src/LinkRow.stories.tsx +14 -2
- package/src/LinkRow.test.tsx +31 -1
- package/src/LinkRow.tsx +69 -25
- package/src/PartCard.mdx +9 -1
- package/src/PartCard.stories.tsx +9 -0
- package/src/PartCard.test.tsx +13 -0
- package/src/PartCard.tsx +19 -5
- package/src/ReferenceCards.test.tsx +4 -35
- package/src/ReferenceCards.ts +10 -119
- package/src/ReferenceMenu.mdx +6 -4
- package/src/ReferenceMenu.test.tsx +67 -5
- package/src/ReferenceMenu.tsx +18 -7
- package/src/editor.ts +0 -3
- package/src/index.ts +4 -1
- package/src/linked.examples.ts +6 -0
- package/src/linked.test.ts +35 -1
- package/src/linked.ts +108 -3
- package/src/linkedFrom.test.tsx +42 -2
- package/src/linkedFrom.ts +15 -7
- package/src/registry/registry.test.ts +25 -6
- package/src/ReferenceCards.mdx +0 -86
- 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
|
-
/**
|
|
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
|
|
125
|
-
*
|
|
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
|
package/dist/linked.d.ts.map
CHANGED
|
@@ -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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EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,SAAS,GAAG,SAAS,CAAA;IAC3D,2FAA2F;IAC3F,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;IAC5C,gBAAgB;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAoBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,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,wDAAwD;AACxD,eAAO,MAAM,cAAc,EAAE,MAAuG,CAAA;AAEpI,oFAAoF;AACpF,eAAO,MAAM,WAAW,EAAE,MAA0F,CAAA;AAEpH,+DAA+D;AAC/D,eAAO,MAAM,eAAe,EAAE,MAAiI,CAAA;AAE/J,0EAA0E;AAC1E,eAAO,MAAM,KAAK,EAAE,MAiBnB,CAAA;AAED,yFAAyF;AACzF,eAAO,MAAM,KAAK,EAAE,MAUnB,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,IAAI,EAAE,MAQlB,CAAA;AAED,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"}
|
|
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,wDAAwD;AACxD,eAAO,MAAM,cAAc,EAAE,MAAuG,CAAA;AAEpI,oFAAoF;AACpF,eAAO,MAAM,WAAW,EAAE,MAA0F,CAAA;AAEpH,+DAA+D;AAC/D,eAAO,MAAM,eAAe,EAAE,MAAiI,CAAA;AAE/J,0EAA0E;AAC1E,eAAO,MAAM,KAAK,EAAE,MAiBnB,CAAA;AAED,yFAAyF;AACzF,eAAO,MAAM,KAAK,EAAE,MAUnB,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,IAAI,EAAE,MAQlB,CAAA;AAED,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"}
|
package/dist/linkedFrom.d.ts
CHANGED
|
@@ -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
|
|
81
|
-
*
|
|
82
|
-
*
|
|
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
|
package/dist/linkedFrom.d.ts.map
CHANGED
|
@@ -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,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,uCAAuC;AACvC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,uFAAuF;AACvF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC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;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;CACrC;AA2KD,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,MAAM,CAkDnG;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,YAAY,EAClD,MAAM,EAAE,CAAC,GAAG,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
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.
|
|
8
|
-
"exports":
|
|
9
|
-
"typeExports":
|
|
7
|
+
"packageVersion": "0.92.1",
|
|
8
|
+
"exports": 210,
|
|
9
|
+
"typeExports": 213,
|
|
10
10
|
"files": null
|
|
11
11
|
},
|
|
12
12
|
"storybook": {
|
|
@@ -869,6 +869,18 @@
|
|
|
869
869
|
"required": false,
|
|
870
870
|
"note": "Why the action cannot succeed right now."
|
|
871
871
|
},
|
|
872
|
+
{
|
|
873
|
+
"name": "href",
|
|
874
|
+
"takes": "text",
|
|
875
|
+
"required": false,
|
|
876
|
+
"note": "A link that looks like a button: an anchor, so the address stays real for a modified click, a new tab or \"copy link address\", as `IconButton` and `Link` keep it."
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"name": "external",
|
|
880
|
+
"takes": "true/false",
|
|
881
|
+
"required": false,
|
|
882
|
+
"note": "With `href`: another site, or another app."
|
|
883
|
+
},
|
|
872
884
|
{
|
|
873
885
|
"name": "children",
|
|
874
886
|
"takes": "anything",
|
|
@@ -1103,6 +1115,25 @@
|
|
|
1103
1115
|
"rounded-lg border bg-bg-surface border-border-default border-warning-muted hover:border-warning-muted border-dashed overflow-hidden"
|
|
1104
1116
|
]
|
|
1105
1117
|
},
|
|
1118
|
+
{
|
|
1119
|
+
"name": "cardShapeMemory",
|
|
1120
|
+
"repo": "estiva-ui",
|
|
1121
|
+
"kind": "helper",
|
|
1122
|
+
"importPath": "@estiva-app/ui",
|
|
1123
|
+
"sourceFile": "src/linked.ts",
|
|
1124
|
+
"purpose": "The device's memory of the shapes its cards drew at, under the app's own `storageKey`, keeping the newest `limit`.",
|
|
1125
|
+
"purposeFrom": "comment",
|
|
1126
|
+
"props": [],
|
|
1127
|
+
"variants": [],
|
|
1128
|
+
"ownsBehaviours": [],
|
|
1129
|
+
"status": "stable",
|
|
1130
|
+
"migrationStage": null,
|
|
1131
|
+
"docsId": null,
|
|
1132
|
+
"storyId": null,
|
|
1133
|
+
"docPage": null,
|
|
1134
|
+
"app": null,
|
|
1135
|
+
"looks": []
|
|
1136
|
+
},
|
|
1106
1137
|
{
|
|
1107
1138
|
"name": "Checkbox",
|
|
1108
1139
|
"repo": "estiva-ui",
|
|
@@ -2032,7 +2063,7 @@
|
|
|
2032
2063
|
"name": "referenceIcon",
|
|
2033
2064
|
"takes": "a handler",
|
|
2034
2065
|
"required": false,
|
|
2035
|
-
"note": "A `[` row's and chip's 16px icon from what it points at
|
|
2066
|
+
"note": "A `[` row's and chip's 16px icon from what it points at."
|
|
2036
2067
|
},
|
|
2037
2068
|
{
|
|
2038
2069
|
"name": "insert",
|
|
@@ -2110,7 +2141,7 @@
|
|
|
2110
2141
|
"name": "referenceView",
|
|
2111
2142
|
"takes": "ComponentType<ReferenceViewProps>",
|
|
2112
2143
|
"required": false,
|
|
2113
|
-
"note": "How a
|
|
2144
|
+
"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
2145
|
},
|
|
2115
2146
|
{
|
|
2116
2147
|
"name": "extensions",
|
|
@@ -2215,6 +2246,7 @@
|
|
|
2215
2246
|
"docPage": null,
|
|
2216
2247
|
"app": null,
|
|
2217
2248
|
"looks": [
|
|
2249
|
+
"text-small tabular-nums font-medium text-text-primary",
|
|
2218
2250
|
"rounded-md text-small tabular-nums transition-colors hover:bg-bg-hover font-medium text-text-primary",
|
|
2219
2251
|
"rounded-md text-small tabular-nums transition-colors hover:bg-bg-hover text-text-secondary",
|
|
2220
2252
|
"rounded-md text-small tabular-nums transition-colors hover:bg-bg-hover"
|
|
@@ -4970,7 +5002,7 @@
|
|
|
4970
5002
|
"kind": "component",
|
|
4971
5003
|
"importPath": "@estiva-app/ui",
|
|
4972
5004
|
"sourceFile": "src/LinkRow.tsx",
|
|
4973
|
-
"purpose": "Not available:
|
|
5005
|
+
"purpose": "Not available: not this reader's to see, or deleted, which says so (SPEC §13.6.1: deleted is not not-permitted).",
|
|
4974
5006
|
"purposeFrom": "comment",
|
|
4975
5007
|
"props": [
|
|
4976
5008
|
{
|
|
@@ -4996,6 +5028,12 @@
|
|
|
4996
5028
|
"takes": "true/false",
|
|
4997
5029
|
"required": false,
|
|
4998
5030
|
"note": "In a card's place: a card's 12px round it."
|
|
5031
|
+
},
|
|
5032
|
+
{
|
|
5033
|
+
"name": "deleted",
|
|
5034
|
+
"takes": "true/false",
|
|
5035
|
+
"required": false,
|
|
5036
|
+
"note": "Deleted (SPEC §13.6.1): \"Issue deleted\", and no way out, since there is nothing left to open."
|
|
4999
5037
|
}
|
|
5000
5038
|
],
|
|
5001
5039
|
"variants": [],
|
|
@@ -5119,7 +5157,13 @@
|
|
|
5119
5157
|
"name": "noun",
|
|
5120
5158
|
"takes": "text",
|
|
5121
5159
|
"required": false,
|
|
5122
|
-
"note": "What
|
|
5160
|
+
"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)."
|
|
5161
|
+
},
|
|
5162
|
+
{
|
|
5163
|
+
"name": "archived",
|
|
5164
|
+
"takes": "true/false",
|
|
5165
|
+
"required": false,
|
|
5166
|
+
"note": "Archived: its row and card say \"Archived\" in the line under the title, and its values read as words."
|
|
5123
5167
|
},
|
|
5124
5168
|
{
|
|
5125
5169
|
"name": "subtitle",
|
|
@@ -6209,7 +6253,7 @@
|
|
|
6209
6253
|
"props": [
|
|
6210
6254
|
{
|
|
6211
6255
|
"name": "state",
|
|
6212
|
-
"takes": "ready | loading | unavailable",
|
|
6256
|
+
"takes": "ready | loading | unavailable | deleted | detached | unaddressable",
|
|
6213
6257
|
"required": false,
|
|
6214
6258
|
"note": "Where its lookup stands. Default `ready`."
|
|
6215
6259
|
},
|
|
@@ -6229,7 +6273,7 @@
|
|
|
6229
6273
|
"name": "href",
|
|
6230
6274
|
"takes": "text",
|
|
6231
6275
|
"required": false,
|
|
6232
|
-
"note": "Opens what it is part of, at the part."
|
|
6276
|
+
"note": "Opens what it is part of, at the part; `unaddressable`, the whole of it."
|
|
6233
6277
|
},
|
|
6234
6278
|
{
|
|
6235
6279
|
"name": "partKey",
|
|
@@ -6274,7 +6318,10 @@
|
|
|
6274
6318
|
"values": [
|
|
6275
6319
|
"ready",
|
|
6276
6320
|
"loading",
|
|
6277
|
-
"unavailable"
|
|
6321
|
+
"unavailable",
|
|
6322
|
+
"deleted",
|
|
6323
|
+
"detached",
|
|
6324
|
+
"unaddressable"
|
|
6278
6325
|
]
|
|
6279
6326
|
}
|
|
6280
6327
|
],
|
|
@@ -7250,8 +7297,8 @@
|
|
|
7250
7297
|
"ownsBehaviours": [],
|
|
7251
7298
|
"status": "stable",
|
|
7252
7299
|
"migrationStage": null,
|
|
7253
|
-
"docsId":
|
|
7254
|
-
"storyId":
|
|
7300
|
+
"docsId": null,
|
|
7301
|
+
"storyId": null,
|
|
7255
7302
|
"docPage": null,
|
|
7256
7303
|
"app": null,
|
|
7257
7304
|
"looks": []
|
|
@@ -7269,31 +7316,12 @@
|
|
|
7269
7316
|
"ownsBehaviours": [],
|
|
7270
7317
|
"status": "stable",
|
|
7271
7318
|
"migrationStage": null,
|
|
7272
|
-
"docsId":
|
|
7273
|
-
"storyId":
|
|
7319
|
+
"docsId": null,
|
|
7320
|
+
"storyId": null,
|
|
7274
7321
|
"docPage": null,
|
|
7275
7322
|
"app": null,
|
|
7276
7323
|
"looks": []
|
|
7277
7324
|
},
|
|
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
7325
|
{
|
|
7298
7326
|
"name": "referenceMenu",
|
|
7299
7327
|
"repo": "estiva-ui",
|
|
@@ -8185,8 +8213,8 @@
|
|
|
8185
8213
|
"ownsBehaviours": [],
|
|
8186
8214
|
"status": "stable",
|
|
8187
8215
|
"migrationStage": null,
|
|
8188
|
-
"docsId":
|
|
8189
|
-
"storyId":
|
|
8216
|
+
"docsId": null,
|
|
8217
|
+
"storyId": null,
|
|
8190
8218
|
"docPage": null,
|
|
8191
8219
|
"app": null,
|
|
8192
8220
|
"looks": []
|
|
@@ -8204,8 +8232,8 @@
|
|
|
8204
8232
|
"ownsBehaviours": [],
|
|
8205
8233
|
"status": "stable",
|
|
8206
8234
|
"migrationStage": null,
|
|
8207
|
-
"docsId":
|
|
8208
|
-
"storyId":
|
|
8235
|
+
"docsId": null,
|
|
8236
|
+
"storyId": null,
|
|
8209
8237
|
"docPage": null,
|
|
8210
8238
|
"app": null,
|
|
8211
8239
|
"looks": []
|
|
@@ -9814,25 +9842,6 @@
|
|
|
9814
9842
|
"app": null,
|
|
9815
9843
|
"looks": []
|
|
9816
9844
|
},
|
|
9817
|
-
{
|
|
9818
|
-
"name": "useReferenceCards",
|
|
9819
|
-
"repo": "estiva-ui",
|
|
9820
|
-
"kind": "hook",
|
|
9821
|
-
"importPath": "@estiva-app/ui/editor",
|
|
9822
|
-
"sourceFile": "src/ReferenceCards.ts",
|
|
9823
|
-
"purpose": "The slots to draw cards into, kept current as the document changes.",
|
|
9824
|
-
"purposeFrom": "comment",
|
|
9825
|
-
"props": [],
|
|
9826
|
-
"variants": [],
|
|
9827
|
-
"ownsBehaviours": [],
|
|
9828
|
-
"status": "stable",
|
|
9829
|
-
"migrationStage": null,
|
|
9830
|
-
"docsId": "writing-referencecards--docs",
|
|
9831
|
-
"storyId": "writing-referencecards--in-an-editor",
|
|
9832
|
-
"docPage": null,
|
|
9833
|
-
"app": null,
|
|
9834
|
-
"looks": []
|
|
9835
|
-
},
|
|
9836
9845
|
{
|
|
9837
9846
|
"name": "useToast",
|
|
9838
9847
|
"repo": "estiva-ui",
|
package/src/AppProvider.mdx
CHANGED
|
@@ -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.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
(`
|
|
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
|
package/src/AppProvider.test.tsx
CHANGED
|
@@ -124,7 +124,21 @@ describe('changing page', () => {
|
|
|
124
124
|
})
|
|
125
125
|
|
|
126
126
|
it.each([
|
|
127
|
-
['
|
|
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>],
|
package/src/AppProvider.tsx
CHANGED
|
@@ -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
|
|
55
|
-
* another
|
|
56
|
-
*
|
|
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)
|
|
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).
|
package/src/AttachedCard.mdx
CHANGED
|
@@ -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()
|
package/src/AttachedCard.tsx
CHANGED
|
@@ -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
|
|
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
|
-
|
|
41
|
+
<Attached.Provider value>{card}</Attached.Provider>
|
|
32
42
|
{onRemove && (
|
|
33
43
|
<RemoveBadge
|
|
34
44
|
label="Remove"
|
package/src/BlockNodes.mdx
CHANGED
|
@@ -78,7 +78,14 @@ const editor = useEditor({
|
|
|
78
78
|
`tableCell` nodes, and ProseMirror drops a node its schema does not have —
|
|
79
79
|
the save would delete the table.
|
|
80
80
|
- `ReferenceNode`'s `view` gets the `uri` and draws the thing it points at,
|
|
81
|
-
resolved by the app. Without one, the URI is drawn as text.
|
|
81
|
+
resolved by the app. Without one, the URI is drawn as text. It is told
|
|
82
|
+
`editing` while the editor is editable; with `editingLine` (a document),
|
|
83
|
+
only while the caret is on its line, so a link elsewhere on the page can
|
|
84
|
+
show its hover preview.
|
|
85
|
+
- **A card's own links and controls work while editing.** A click on its
|
|
86
|
+
title, its count or a picker goes to them, and a press on a picker keeps the
|
|
87
|
+
caret where it was, so the picker opens; only a click on the card's empty
|
|
88
|
+
space is the link's menu (`ReferenceMenu`).
|
|
82
89
|
- `AttachmentNode`'s `view` gets the block's `imeta` fields as `attrs`.
|
|
83
90
|
Without one, the file's name is drawn as text.
|
|
84
91
|
- `UnknownBlock` draws a block the editor has no design for as its text, in a
|