@usableapp/cardds 0.7.157 → 0.7.158
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/CHANGELOG.md +23 -0
- package/css/actions.css +33 -4
- package/css/base.css +8 -0
- package/css/card.css +5 -0
- package/css/forms.css +14 -1
- package/css/lists.css +4 -0
- package/css/parts.css +5 -1
- package/css/sheet.css +5 -2
- package/css/stamp.css +2 -0
- package/css/tokens.css +1 -0
- package/dist/actions/Btn.d.ts +12 -3
- package/dist/actions/Btn.js +6 -3
- package/dist/actions/BtnRow.d.ts +6 -2
- package/dist/actions/BtnRow.js +3 -3
- package/dist/actions/IconBtn.d.ts +8 -2
- package/dist/actions/IconBtn.js +4 -2
- package/dist/actions/LinkBlock.d.ts +9 -0
- package/dist/actions/LinkBlock.js +8 -0
- package/dist/actions/useSendOut.d.ts +4 -0
- package/dist/actions/useSendOut.js +15 -0
- package/dist/cardds.css +77 -8
- package/dist/cards/Card.d.ts +8 -1
- package/dist/cards/CardParts.d.ts +8 -0
- package/dist/cards/CardParts.js +5 -0
- package/dist/catalog.json +1 -1
- package/dist/forms/MessageBar.d.ts +9 -2
- package/dist/forms/MessageBar.js +6 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lists/Bubble.d.ts +859 -4
- package/dist/lists/Bubble.js +18 -4
- package/dist/lists/Row.d.ts +4 -0
- package/dist/media/MapArea.d.ts +7 -1
- package/dist/media/MapArea.js +5 -3
- package/dist/parts/Foot.d.ts +8 -2
- package/dist/parts/Foot.js +4 -3
- package/dist/stamp/Stamp.d.ts +1 -0
- package/dist/stamp/Stamp.js +1 -0
- package/dist/state.d.ts +2 -2
- package/dist/state.js +4 -4
- package/dist/type/Text.d.ts +5 -1
- package/dist/type/Text.js +3 -2
- package/dist/type/icons.d.ts +1 -1
- package/dist/type/icons.js +2 -2
- package/docs/reference.md +49 -5
- package/icons.svg +1 -0
- package/package.json +1 -1
|
@@ -20,6 +20,13 @@ export interface MessageBarProps extends Omit<ComponentProps<'textarea'>, 'value
|
|
|
20
20
|
people?: MentionPerson[];
|
|
21
21
|
/** a person was picked from the `@` list — the words already hold their name; who to tell is the app's */
|
|
22
22
|
onMention?: (person: MentionPerson) => void;
|
|
23
|
+
/** a REPLY-TO QUOTE over the box: the line being answered ("Noi: thank you for…"), cut at one line, a rule at its start. CONTROLLED: shown while
|
|
24
|
+
* the app passes it; the app drops it (after a send, or on `onQuoteClose`). Knobs `--message-bar-quote-ink`, `--message-bar-quote-rule-ink` */
|
|
25
|
+
quote?: ReactNode;
|
|
26
|
+
/** the quote's ✕ was pressed: the member drops the reply-to — the app stops passing `quote`. Without it the quote has no ✕ */
|
|
27
|
+
onQuoteClose?: () => void;
|
|
28
|
+
/** the quote's ✕'s accessible name ("Cancel the reply") — the app's word, cardds has none; needed with `onQuoteClose` */
|
|
29
|
+
quoteCloseLabel?: string;
|
|
23
30
|
/** classes for the bar, not the textarea */
|
|
24
31
|
className?: string;
|
|
25
32
|
/** inline style for the bar, not the textarea */
|
|
@@ -35,6 +42,6 @@ export interface MessageBarProps extends Omit<ComponentProps<'textarea'>, 'value
|
|
|
35
42
|
* keyboard, and the body stops above it however tall it grows. Controlled like an
|
|
36
43
|
* input: `value` + `onValueChange`, or `defaultValue`. `people` turns on naming with `@` (a comment that names a neighbour): the
|
|
37
44
|
* matching names are listed above the box, a pick writes `@name ` and reports it to `onMention`; a written name is marked and a
|
|
38
|
-
* backspace takes it whole.
|
|
45
|
+
* backspace takes it whole. `quote` is a reply-to line over the box (the message being answered), with a ✕ (`onQuoteClose`) — the app shows and drops it.
|
|
39
46
|
*/
|
|
40
|
-
export declare function MessageBar({ value, defaultValue, onValueChange, onSend, sendLabel, sendIcon, lead, people, onMention, className, style, rows, ref, onKeyDown, onSelect, onScroll, onBlur, ...textarea }: MessageBarProps): import("react").JSX.Element;
|
|
47
|
+
export declare function MessageBar({ value, defaultValue, onValueChange, onSend, sendLabel, sendIcon, lead, people, onMention, quote, onQuoteClose, quoteCloseLabel, className, style, rows, ref, onKeyDown, onSelect, onScroll, onBlur, ...textarea }: MessageBarProps): import("react").JSX.Element;
|
package/dist/forms/MessageBar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from 'react';
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
|
-
import { setRefs, useControlled } from '../state.js';
|
|
4
|
+
import { setRefs, useControlled, warnOnce } from '../state.js';
|
|
5
5
|
import { useMention } from './mention.js';
|
|
6
6
|
import { IconBtn } from '../actions/IconBtn.js';
|
|
7
7
|
/**
|
|
@@ -14,21 +14,23 @@ import { IconBtn } from '../actions/IconBtn.js';
|
|
|
14
14
|
* keyboard, and the body stops above it however tall it grows. Controlled like an
|
|
15
15
|
* input: `value` + `onValueChange`, or `defaultValue`. `people` turns on naming with `@` (a comment that names a neighbour): the
|
|
16
16
|
* matching names are listed above the box, a pick writes `@name ` and reports it to `onMention`; a written name is marked and a
|
|
17
|
-
* backspace takes it whole.
|
|
17
|
+
* backspace takes it whole. `quote` is a reply-to line over the box (the message being answered), with a ✕ (`onQuoteClose`) — the app shows and drops it.
|
|
18
18
|
*/
|
|
19
|
-
export function MessageBar({ value, defaultValue = '', onValueChange, onSend, sendLabel, sendIcon = 'arrow-up', lead, people, onMention, className, style, rows = 1, ref, onKeyDown, onSelect, onScroll, onBlur, ...textarea }) {
|
|
19
|
+
export function MessageBar({ value, defaultValue = '', onValueChange, onSend, sendLabel, sendIcon = 'arrow-up', lead, people, onMention, quote, onQuoteClose, quoteCloseLabel, className, style, rows = 1, ref, onKeyDown, onSelect, onScroll, onBlur, ...textarea }) {
|
|
20
20
|
const [shown, request] = useControlled(value, defaultValue, onValueChange);
|
|
21
21
|
const box = useRef(null);
|
|
22
22
|
const under = useRef(null);
|
|
23
23
|
const mention = useMention(box, shown, people, onMention);
|
|
24
24
|
const empty = !shown.trim();
|
|
25
|
+
if (onQuoteClose && !quoteCloseLabel)
|
|
26
|
+
warnOnce('message-bar-quote-label', 'cardds MessageBar: `onQuoteClose` without `quoteCloseLabel` — the quote\'s ✕ has no name');
|
|
25
27
|
const send = () => {
|
|
26
28
|
if (empty)
|
|
27
29
|
return;
|
|
28
30
|
onSend?.(shown);
|
|
29
31
|
request('');
|
|
30
32
|
};
|
|
31
|
-
return (_jsxs("div", { className: cx('message-bar', className), style: style, children: [mention.list, lead, _jsxs("div", { className: "message-bar__box", "data-value": shown, children: [mention.under && _jsx("div", { ref: under, className: "message-bar__input mention-under", "aria-hidden": "true", children: mention.under }), _jsx("textarea", { ref: setRefs(box, ref), className: "message-bar__input", rows: rows, ...textarea, value: shown, onChange: (e) => request(e.currentTarget.value), onKeyDown: (e) => { onKeyDown?.(e); if (!e.defaultPrevented)
|
|
33
|
+
return (_jsxs("div", { className: cx('message-bar', className), style: style, children: [mention.list, quote != null && (_jsxs("div", { className: "message-bar__quote", children: [_jsx("span", { className: "message-bar__quote-words", children: quote }), onQuoteClose && _jsx(IconBtn, { sm: true, icon: "x", label: quoteCloseLabel ?? '', onPointerDown: (e) => e.preventDefault(), onClick: onQuoteClose })] })), lead, _jsxs("div", { className: "message-bar__box", "data-value": shown, children: [mention.under && _jsx("div", { ref: under, className: "message-bar__input mention-under", "aria-hidden": "true", children: mention.under }), _jsx("textarea", { ref: setRefs(box, ref), className: "message-bar__input", rows: rows, ...textarea, value: shown, onChange: (e) => request(e.currentTarget.value), onKeyDown: (e) => { onKeyDown?.(e); if (!e.defaultPrevented)
|
|
32
34
|
mention.onKeyDown(e); }, onSelect: (e) => { onSelect?.(e); mention.look(); }, onBlur: (e) => { onBlur?.(e); mention.leave(); }, onScroll: (e) => { onScroll?.(e); if (under.current)
|
|
33
35
|
under.current.scrollTop = e.currentTarget.scrollTop; } })] }), _jsx(IconBtn, { invert: true, icon: sendIcon, label: sendLabel, disabled: empty, onPointerDown: (e) => e.preventDefault(), onClick: send })] }));
|
|
34
36
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export * from './actions/BtnGroup.js';
|
|
|
43
43
|
export * from './actions/Fab.js';
|
|
44
44
|
export * from './actions/BtnRow.js';
|
|
45
45
|
export * from './actions/Link.js';
|
|
46
|
+
export * from './actions/LinkBlock.js';
|
|
46
47
|
export * from './actions/Countdown.js';
|
|
47
48
|
export * from './forms/Field.js';
|
|
48
49
|
export * from './forms/FileBtn.js';
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ export * from './actions/BtnGroup.js';
|
|
|
47
47
|
export * from './actions/Fab.js';
|
|
48
48
|
export * from './actions/BtnRow.js';
|
|
49
49
|
export * from './actions/Link.js';
|
|
50
|
+
export * from './actions/LinkBlock.js';
|
|
50
51
|
export * from './actions/Countdown.js';
|
|
51
52
|
export * from './forms/Field.js';
|
|
52
53
|
export * from './forms/FileBtn.js';
|