@refraction-ui/react 0.17.1 → 0.18.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/{chunk-VZLV27H2.js → chunk-4A4BW3GR.js} +7 -3
- package/dist/chunk-4A4BW3GR.js.map +1 -0
- package/dist/form.js +1 -1
- package/dist/index.cjs +3576 -1503
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3556 -1504
- package/dist/index.js.map +1 -1
- package/dist/internal/composer/index.d.ts +58 -6
- package/dist/internal/emoji-picker/index.d.cts +115 -7
- package/dist/internal/emoji-picker/index.d.ts +115 -7
- package/dist/internal/react-composer/index.d.ts +22 -1
- package/dist/internal/react-emoji-picker/index.d.cts +46 -21
- package/dist/internal/react-emoji-picker/index.d.ts +46 -21
- package/dist/theme.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-VZLV27H2.js.map +0 -1
|
@@ -547,8 +547,15 @@ declare function createComposer(config?: ComposerConfig): ComposerAPI;
|
|
|
547
547
|
* Boolean-ish variants use string 'true'/'false' keys per repo convention
|
|
548
548
|
* (raw booleans fail the dts build).
|
|
549
549
|
*/
|
|
550
|
-
/**
|
|
550
|
+
/**
|
|
551
|
+
* Outer surface (the rounded card wrapping tray + field + action row).
|
|
552
|
+
* `surface` picks the resting fill: `outlined` (transparent-on-page card) or
|
|
553
|
+
* `filled` (a calm muted fill distinct from the page). Both keep a tasteful
|
|
554
|
+
* focus-visible ring on the pill — a hairline border plus a single-px ring, not
|
|
555
|
+
* a slammed saturated full-perimeter brand border.
|
|
556
|
+
*/
|
|
551
557
|
declare const composerSurfaceVariants: (props?: ({
|
|
558
|
+
surface?: "outlined" | "filled" | undefined;
|
|
552
559
|
disabled?: "true" | "false" | undefined;
|
|
553
560
|
error?: "true" | "false" | undefined;
|
|
554
561
|
} & {
|
|
@@ -558,16 +565,37 @@ declare const composerSurfaceVariants: (props?: ({
|
|
|
558
565
|
declare const composerFieldClass = "block w-full resize-none bg-transparent px-3.5 py-3 text-sm placeholder:text-muted-foreground focus:outline-none";
|
|
559
566
|
/** Attachment tray above the field, inside the dock. */
|
|
560
567
|
declare const composerTrayClass = "flex flex-wrap gap-2 px-3 pt-3";
|
|
561
|
-
/**
|
|
568
|
+
/**
|
|
569
|
+
* A single attachment chip. Chips animate in on add (scale + fade) and, when
|
|
570
|
+
* the adapter marks one `exiting`, animate out faster before unmounting. Both
|
|
571
|
+
* degrade to opacity-only / instant under reduced motion.
|
|
572
|
+
*/
|
|
562
573
|
declare const composerAttachmentChipVariants: (props?: ({
|
|
563
574
|
status?: "pending" | "uploading" | "ready" | "error" | undefined;
|
|
575
|
+
exiting?: "true" | "false" | undefined;
|
|
564
576
|
} & {
|
|
565
577
|
className?: string;
|
|
566
578
|
}) | undefined) => string;
|
|
567
579
|
/** A committed inline token pill rendered by adapters over the flat string. */
|
|
568
580
|
declare const composerTokenPillClass = "rounded bg-accent/40 px-0.5 text-accent-foreground";
|
|
569
|
-
/**
|
|
570
|
-
|
|
581
|
+
/**
|
|
582
|
+
* The caret-anchored suggestion menu. Enters with an eased fade+scale from its
|
|
583
|
+
* bottom edge (it sits above the field); reduced motion drops the movement.
|
|
584
|
+
*/
|
|
585
|
+
declare const composerMenuClass = "z-20 w-72 overflow-hidden rounded-xl border border-border bg-popover shadow-lg origin-bottom motion-safe:animate-fade-in-scale";
|
|
586
|
+
/**
|
|
587
|
+
* The inline expression/accessory panel docked below the field. It is part of
|
|
588
|
+
* the composer's own stack (never a floating portal), so the textarea and the
|
|
589
|
+
* message in progress stay fully visible while the panel is open. Opens with an
|
|
590
|
+
* eased fade; reduced motion shows it instantly.
|
|
591
|
+
*/
|
|
592
|
+
declare const composerAccessoryPanelClass = "border-t border-border motion-safe:animate-fade-in";
|
|
593
|
+
/** The built-in expression-panel toggle button. */
|
|
594
|
+
declare const composerAccessoryToggleVariants: (props?: ({
|
|
595
|
+
active?: "true" | "false" | undefined;
|
|
596
|
+
} & {
|
|
597
|
+
className?: string;
|
|
598
|
+
}) | undefined) => string;
|
|
571
599
|
/** A suggestion row; `active` follows keyboard/pointer last-input-wins. */
|
|
572
600
|
declare const composerMenuItemVariants: (props?: ({
|
|
573
601
|
active?: "true" | "false" | undefined;
|
|
@@ -580,11 +608,35 @@ declare const composerCounterVariants: (props?: ({
|
|
|
580
608
|
} & {
|
|
581
609
|
className?: string;
|
|
582
610
|
}) | undefined) => string;
|
|
583
|
-
/**
|
|
611
|
+
/**
|
|
612
|
+
* Primary action (send ⇄ stop swap driven by `{hasText, canSend, isBusy}`).
|
|
613
|
+
* The colour/affordance change eases; the adapter keys the button on busy so
|
|
614
|
+
* the swap pops in (scale) rather than snapping. Reduced motion keeps it calm.
|
|
615
|
+
*/
|
|
584
616
|
declare const composerPrimaryActionVariants: (props?: ({
|
|
585
617
|
enabled?: "true" | "false" | undefined;
|
|
586
618
|
} & {
|
|
587
619
|
className?: string;
|
|
588
620
|
}) | undefined) => string;
|
|
589
621
|
|
|
590
|
-
|
|
622
|
+
interface EmojiTriggerOptions {
|
|
623
|
+
/** Trigger id. Default 'emoji'. */
|
|
624
|
+
id?: string;
|
|
625
|
+
/** Symbol. Default ':'. */
|
|
626
|
+
symbol?: string;
|
|
627
|
+
/** Max results surfaced to the menu. Default 8. */
|
|
628
|
+
maxResults?: number;
|
|
629
|
+
/**
|
|
630
|
+
* Minimum query length before resolving (avoids flooding the menu with the
|
|
631
|
+
* whole set on a lone ':'). Default 1.
|
|
632
|
+
*/
|
|
633
|
+
minQueryLength?: number;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Build a `:` emoji trigger. Typing `:fir` filters the full set; committing
|
|
637
|
+
* inserts the glyph (🔥). Pair it with the picker for the same coverage in both
|
|
638
|
+
* surfaces.
|
|
639
|
+
*/
|
|
640
|
+
declare function createEmojiTrigger(options?: EmojiTriggerOptions): ComposerTrigger;
|
|
641
|
+
|
|
642
|
+
export { type ActiveTriggerState, type AppliedEdit, type ApplyValueEditArgs, CIRCUIT_BREAKER_THRESHOLD, CLOSED_SUGGESTION_STATE, COUNTER_VISIBLE_FRACTION, type CanSendArgs, type CommitTokenArgs, type CommitTokenResult, type ComposerAPI, type ComposerAttachment, type ComposerAttachmentDraft, type ComposerAttachmentKind, type ComposerAttachmentStatus, type ComposerCandidate, type ComposerConfig, type ComposerDraft, type ComposerDraftStore, type ComposerEvent, type ComposerMode, type ComposerOutput, type ComposerSelection, type ComposerState, type ComposerSubmission, type ComposerToken, type ComposerTrigger, type ComposerTriggerResolver, type ComposerTriggerScope, type ComposerValidationResult, type ComposerValidator, type CounterState, DEFAULT_DRAFT_DEBOUNCE_MS, DEFAULT_MAX_LINES, DEFAULT_MAX_QUERY_LENGTH, DEFAULT_MAX_VISIBLE_RESULTS, DEFAULT_MIN_LINES, DEFAULT_TYPING_SIGNAL_INTERVAL_MS, DISMISS_GRACE_MS, type DetectTriggerArgs, type DismissedOccurrence, type EmojiTriggerOptions, type EnterResult, LOADING_DELAY_MS, type PlacedToken, type ResolvedToken, type ResolvedTrigger, SCAN_UNITS_PER_GRAPHEME, type SuggestionController, type SuggestionState, type TextEdit, type TokenRange, type TriggerMatch, type TypedEmojiHit, applyValueEdit, canSend, clampGraphemes, commitTokenAt, composerAccessoryPanelClass, composerAccessoryToggleVariants, composerAttachmentChipVariants, composerCounterVariants, composerFieldClass, composerMenuClass, composerMenuItemVariants, composerPrimaryActionVariants, composerSurfaceVariants, composerTokenPillClass, composerTrayClass, computeCounter, createComposer, createEmojiTrigger, createSuggestionController, detectActiveTrigger, detectTypedEmoji, diffEdit, expandRangeOverTokens, graphemeLength, isGraphemeBoundary, payloadFor, resolveTriggerConfig, scanWindowFor, serializeTokens, shouldSubmitOnEnter, snapSelectionToTokens, toMessageAttachment };
|
|
@@ -2,18 +2,48 @@ import { AccessibilityProps } from '../shared/index.cjs';
|
|
|
2
2
|
|
|
3
3
|
type EmojiCategory = 'smileys' | 'people' | 'nature' | 'food' | 'travel' | 'activities' | 'objects' | 'symbols' | 'flags';
|
|
4
4
|
interface EmojiEntry {
|
|
5
|
+
/** The rendered glyph (native codepoints). */
|
|
5
6
|
emoji: string;
|
|
7
|
+
/** CLDR short name, e.g. "face with tears of joy". */
|
|
6
8
|
name: string;
|
|
7
9
|
category: EmojiCategory;
|
|
10
|
+
/** Search keywords (does not include the name words verbatim-repeated). */
|
|
8
11
|
keywords: string[];
|
|
12
|
+
/** Canonical `snake_case` shortcode body (no surrounding colons). */
|
|
13
|
+
shortcode: string;
|
|
9
14
|
}
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
/** Total number of base emoji shipped. */
|
|
16
|
+
declare const EMOJI_COUNT_TOTAL = 1906;
|
|
17
|
+
/** All categories in display order. */
|
|
12
18
|
declare const EMOJI_CATEGORIES: EmojiCategory[];
|
|
13
|
-
/** Category display labels */
|
|
19
|
+
/** Category display labels. */
|
|
14
20
|
declare const CATEGORY_LABELS: Record<EmojiCategory, string>;
|
|
15
|
-
/**
|
|
21
|
+
/** Emojis grouped by category (display order preserved within each group). */
|
|
22
|
+
declare const EMOJI_DATA: Record<EmojiCategory, EmojiEntry[]>;
|
|
23
|
+
/** Get all emojis as a flat array (display order). */
|
|
16
24
|
declare function getAllEmojis(): EmojiEntry[];
|
|
25
|
+
/**
|
|
26
|
+
* Curated popular aliases (`:body:` → glyph) that don't match the derived
|
|
27
|
+
* snake_case name — the short forms people actually type (`:joy:`, `:100:`,
|
|
28
|
+
* `:thumbsup:`). These take precedence over derived shortcodes on lookup.
|
|
29
|
+
* This is the ONE place aliases live (rich-editor consumes it, no duplication).
|
|
30
|
+
*/
|
|
31
|
+
declare const SHORTCODE_ALIASES: Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a `:shortcode:` (with or without surrounding colons) to its glyph.
|
|
34
|
+
* Aliases win over derived shortcodes. Returns `null` when unknown.
|
|
35
|
+
*/
|
|
36
|
+
declare function resolveShortcode(code: string): string | null;
|
|
37
|
+
/**
|
|
38
|
+
* `:body:` → glyph map covering the full derived set plus curated aliases.
|
|
39
|
+
* This is the shared source rich-editor's `EMOJI_MAP` is built from.
|
|
40
|
+
*/
|
|
41
|
+
declare function buildShortcodeMap(): Record<string, string>;
|
|
42
|
+
/**
|
|
43
|
+
* Fuzzy-search emoji by name, keyword, or shortcode. Prefix matches on the
|
|
44
|
+
* shortcode/name rank first. Used by the picker search and the `:` trigger.
|
|
45
|
+
*/
|
|
46
|
+
declare function searchEmojis(query: string, limit?: number): EmojiEntry[];
|
|
17
47
|
|
|
18
48
|
interface EmojiPickerProps {
|
|
19
49
|
/** Callback when an emoji is selected */
|
|
@@ -62,7 +92,81 @@ interface EmojiPickerAPI {
|
|
|
62
92
|
}
|
|
63
93
|
declare function createEmojiPicker(props?: EmojiPickerProps): EmojiPickerAPI;
|
|
64
94
|
|
|
65
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Twemoji asset resolution — maps a native emoji glyph to its Twemoji SVG
|
|
97
|
+
* filename/URL. This is the data half of the `emojiRenderer` seam: it lets the
|
|
98
|
+
* React/Astro adapters render a UNIFORM emoji set (one look on every OS) instead
|
|
99
|
+
* of per-platform native glyphs, WhatsApp-style, by lazily loading one small SVG
|
|
100
|
+
* per glyph from a CDN (or a self-hosted mirror) — nothing is bundled eagerly.
|
|
101
|
+
*
|
|
102
|
+
* Twemoji graphics are © Twitter / the Twemoji contributors, licensed CC-BY 4.0.
|
|
103
|
+
* Consumers rendering with Twemoji must preserve that attribution (see the
|
|
104
|
+
* package README / NOTICE).
|
|
105
|
+
*
|
|
106
|
+
* The filename algorithm mirrors upstream `twemoji.toCodePoint`: surrogate
|
|
107
|
+
* pairs are combined to codepoints, and the U+FE0F variation selector is
|
|
108
|
+
* stripped from non-ZWJ sequences (Twemoji names files without it).
|
|
109
|
+
*/
|
|
110
|
+
/** Default CDN base for Twemoji SVG assets (jsDelivr, pinned). */
|
|
111
|
+
declare const DEFAULT_TWEMOJI_BASE_URL = "https://cdn.jsdelivr.net/gh/jdecked/twemoji@15.1.0/assets/svg/";
|
|
112
|
+
/**
|
|
113
|
+
* Twemoji asset filename (without extension) for a glyph, e.g. `1f600`,
|
|
114
|
+
* `1f1fa-1f1f8`, `2764` (heart, FE0F stripped).
|
|
115
|
+
*/
|
|
116
|
+
declare function twemojiFilename(emoji: string): string;
|
|
117
|
+
/** Full Twemoji SVG URL for a glyph. */
|
|
118
|
+
declare function twemojiAssetUrl(emoji: string, baseUrl?: string): string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Sticker seam — types + a small bundled starter pack.
|
|
122
|
+
*
|
|
123
|
+
* Stickers are host-extensible: a consumer (or a future bundled pack) supplies
|
|
124
|
+
* `StickerSet`s and the picker renders them in a dedicated tab. Three render
|
|
125
|
+
* paths are supported so the API is ready for animated content without any
|
|
126
|
+
* heavy dependency in the core:
|
|
127
|
+
* - `kind: 'svg'` — inline SVG markup (can self-animate via SMIL, no JS).
|
|
128
|
+
* - `kind: 'image'` — a URL to a static or animated (WebP/GIF/APNG) asset.
|
|
129
|
+
* - `kind: 'lottie'`— a URL/JSON handed to a host-provided Lottie player.
|
|
130
|
+
*
|
|
131
|
+
* The starter pack below ships a handful of simple, consistent flat stickers
|
|
132
|
+
* (128×128, one visual language) so the tab is not empty out of the box, and
|
|
133
|
+
* proves the animated render path with a self-animating SMIL heart — no Lottie
|
|
134
|
+
* runtime required.
|
|
135
|
+
*/
|
|
136
|
+
type StickerKind = 'svg' | 'image' | 'lottie';
|
|
137
|
+
interface StickerItem {
|
|
138
|
+
/** Stable id (unique within its set). */
|
|
139
|
+
id: string;
|
|
140
|
+
/** Accessible label / alt text. */
|
|
141
|
+
label: string;
|
|
142
|
+
kind: StickerKind;
|
|
143
|
+
/**
|
|
144
|
+
* The sticker payload: inline SVG markup (`svg`), an asset URL (`image`), or
|
|
145
|
+
* a Lottie JSON URL or serialized object (`lottie`).
|
|
146
|
+
*/
|
|
147
|
+
source: string;
|
|
148
|
+
/** Search keywords. */
|
|
149
|
+
keywords?: string[];
|
|
150
|
+
/** True when the sticker animates (drives reduced-motion handling). */
|
|
151
|
+
animated?: boolean;
|
|
152
|
+
}
|
|
153
|
+
interface StickerSet {
|
|
154
|
+
/** Stable id (unique across sets). */
|
|
155
|
+
id: string;
|
|
156
|
+
/** Human-readable set name (tab tooltip). */
|
|
157
|
+
label: string;
|
|
158
|
+
/** A representative emoji/char for the set's tab icon. */
|
|
159
|
+
icon?: string;
|
|
160
|
+
stickers: StickerItem[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Refraction starter sticker pack — a tasteful, consistent flat set. The
|
|
164
|
+
* `pulse-heart` sticker self-animates via SMIL to demonstrate the animated
|
|
165
|
+
* render path; the rest are static.
|
|
166
|
+
*/
|
|
167
|
+
declare const STARTER_STICKER_SET: StickerSet;
|
|
168
|
+
|
|
169
|
+
declare const emojiPickerContainerStyles = "w-80 rounded-lg border bg-popover text-popover-foreground shadow-md motion-safe:animate-fade-in-scale origin-top";
|
|
66
170
|
declare const emojiPickerSearchStyles = "w-full border-b px-3 py-2 text-sm bg-transparent outline-none placeholder:text-muted-foreground";
|
|
67
171
|
declare const emojiPickerCategoryBarStyles = "flex border-b px-1";
|
|
68
172
|
declare const emojiPickerCategoryTabVariants: (props?: ({
|
|
@@ -71,7 +175,11 @@ declare const emojiPickerCategoryTabVariants: (props?: ({
|
|
|
71
175
|
className?: string;
|
|
72
176
|
}) | undefined) => string;
|
|
73
177
|
declare const emojiPickerGridStyles = "grid grid-cols-8 gap-0.5 p-2 max-h-64 overflow-y-auto";
|
|
74
|
-
declare const emojiPickerEmojiButtonStyles = "flex items-center justify-center h-8 w-8 rounded cursor-pointer text-lg hover:bg-accent transition-
|
|
178
|
+
declare const emojiPickerEmojiButtonStyles = "flex items-center justify-center h-8 w-8 rounded cursor-pointer text-lg transition-transform duration-100 ease-out hover:bg-accent hover:scale-125 active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none motion-reduce:hover:scale-100";
|
|
75
179
|
declare const emojiPickerSectionLabelStyles = "px-2 py-1 text-xs font-medium text-muted-foreground";
|
|
180
|
+
/** The swappable category/search/sticker panel; fades on category switch. */
|
|
181
|
+
declare const emojiPickerPanelStyles = "motion-safe:animate-fade-in origin-top";
|
|
182
|
+
/** A single sticker cell in the sticker tab. */
|
|
183
|
+
declare const emojiPickerStickerButtonStyles = "flex items-center justify-center rounded-lg p-1.5 aspect-square cursor-pointer transition-transform duration-100 ease-out hover:bg-accent hover:scale-110 active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none motion-reduce:hover:scale-100";
|
|
76
184
|
|
|
77
|
-
export { CATEGORY_LABELS, EMOJI_CATEGORIES, EMOJI_DATA, type EmojiCategory, type EmojiEntry, type EmojiPickerAPI, type EmojiPickerProps, type EmojiPickerState, createEmojiPicker, emojiPickerCategoryBarStyles, emojiPickerCategoryTabVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, emojiPickerSearchStyles, emojiPickerSectionLabelStyles, getAllEmojis };
|
|
185
|
+
export { CATEGORY_LABELS, DEFAULT_TWEMOJI_BASE_URL, EMOJI_CATEGORIES, EMOJI_COUNT_TOTAL, EMOJI_DATA, type EmojiCategory, type EmojiEntry, type EmojiPickerAPI, type EmojiPickerProps, type EmojiPickerState, SHORTCODE_ALIASES, STARTER_STICKER_SET, type StickerItem, type StickerKind, type StickerSet, buildShortcodeMap, createEmojiPicker, emojiPickerCategoryBarStyles, emojiPickerCategoryTabVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, emojiPickerPanelStyles, emojiPickerSearchStyles, emojiPickerSectionLabelStyles, emojiPickerStickerButtonStyles, getAllEmojis, resolveShortcode, searchEmojis, twemojiAssetUrl, twemojiFilename };
|
|
@@ -2,18 +2,48 @@ import { AccessibilityProps } from '../shared/index.js';
|
|
|
2
2
|
|
|
3
3
|
type EmojiCategory = 'smileys' | 'people' | 'nature' | 'food' | 'travel' | 'activities' | 'objects' | 'symbols' | 'flags';
|
|
4
4
|
interface EmojiEntry {
|
|
5
|
+
/** The rendered glyph (native codepoints). */
|
|
5
6
|
emoji: string;
|
|
7
|
+
/** CLDR short name, e.g. "face with tears of joy". */
|
|
6
8
|
name: string;
|
|
7
9
|
category: EmojiCategory;
|
|
10
|
+
/** Search keywords (does not include the name words verbatim-repeated). */
|
|
8
11
|
keywords: string[];
|
|
12
|
+
/** Canonical `snake_case` shortcode body (no surrounding colons). */
|
|
13
|
+
shortcode: string;
|
|
9
14
|
}
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
/** Total number of base emoji shipped. */
|
|
16
|
+
declare const EMOJI_COUNT_TOTAL = 1906;
|
|
17
|
+
/** All categories in display order. */
|
|
12
18
|
declare const EMOJI_CATEGORIES: EmojiCategory[];
|
|
13
|
-
/** Category display labels */
|
|
19
|
+
/** Category display labels. */
|
|
14
20
|
declare const CATEGORY_LABELS: Record<EmojiCategory, string>;
|
|
15
|
-
/**
|
|
21
|
+
/** Emojis grouped by category (display order preserved within each group). */
|
|
22
|
+
declare const EMOJI_DATA: Record<EmojiCategory, EmojiEntry[]>;
|
|
23
|
+
/** Get all emojis as a flat array (display order). */
|
|
16
24
|
declare function getAllEmojis(): EmojiEntry[];
|
|
25
|
+
/**
|
|
26
|
+
* Curated popular aliases (`:body:` → glyph) that don't match the derived
|
|
27
|
+
* snake_case name — the short forms people actually type (`:joy:`, `:100:`,
|
|
28
|
+
* `:thumbsup:`). These take precedence over derived shortcodes on lookup.
|
|
29
|
+
* This is the ONE place aliases live (rich-editor consumes it, no duplication).
|
|
30
|
+
*/
|
|
31
|
+
declare const SHORTCODE_ALIASES: Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a `:shortcode:` (with or without surrounding colons) to its glyph.
|
|
34
|
+
* Aliases win over derived shortcodes. Returns `null` when unknown.
|
|
35
|
+
*/
|
|
36
|
+
declare function resolveShortcode(code: string): string | null;
|
|
37
|
+
/**
|
|
38
|
+
* `:body:` → glyph map covering the full derived set plus curated aliases.
|
|
39
|
+
* This is the shared source rich-editor's `EMOJI_MAP` is built from.
|
|
40
|
+
*/
|
|
41
|
+
declare function buildShortcodeMap(): Record<string, string>;
|
|
42
|
+
/**
|
|
43
|
+
* Fuzzy-search emoji by name, keyword, or shortcode. Prefix matches on the
|
|
44
|
+
* shortcode/name rank first. Used by the picker search and the `:` trigger.
|
|
45
|
+
*/
|
|
46
|
+
declare function searchEmojis(query: string, limit?: number): EmojiEntry[];
|
|
17
47
|
|
|
18
48
|
interface EmojiPickerProps {
|
|
19
49
|
/** Callback when an emoji is selected */
|
|
@@ -62,7 +92,81 @@ interface EmojiPickerAPI {
|
|
|
62
92
|
}
|
|
63
93
|
declare function createEmojiPicker(props?: EmojiPickerProps): EmojiPickerAPI;
|
|
64
94
|
|
|
65
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Twemoji asset resolution — maps a native emoji glyph to its Twemoji SVG
|
|
97
|
+
* filename/URL. This is the data half of the `emojiRenderer` seam: it lets the
|
|
98
|
+
* React/Astro adapters render a UNIFORM emoji set (one look on every OS) instead
|
|
99
|
+
* of per-platform native glyphs, WhatsApp-style, by lazily loading one small SVG
|
|
100
|
+
* per glyph from a CDN (or a self-hosted mirror) — nothing is bundled eagerly.
|
|
101
|
+
*
|
|
102
|
+
* Twemoji graphics are © Twitter / the Twemoji contributors, licensed CC-BY 4.0.
|
|
103
|
+
* Consumers rendering with Twemoji must preserve that attribution (see the
|
|
104
|
+
* package README / NOTICE).
|
|
105
|
+
*
|
|
106
|
+
* The filename algorithm mirrors upstream `twemoji.toCodePoint`: surrogate
|
|
107
|
+
* pairs are combined to codepoints, and the U+FE0F variation selector is
|
|
108
|
+
* stripped from non-ZWJ sequences (Twemoji names files without it).
|
|
109
|
+
*/
|
|
110
|
+
/** Default CDN base for Twemoji SVG assets (jsDelivr, pinned). */
|
|
111
|
+
declare const DEFAULT_TWEMOJI_BASE_URL = "https://cdn.jsdelivr.net/gh/jdecked/twemoji@15.1.0/assets/svg/";
|
|
112
|
+
/**
|
|
113
|
+
* Twemoji asset filename (without extension) for a glyph, e.g. `1f600`,
|
|
114
|
+
* `1f1fa-1f1f8`, `2764` (heart, FE0F stripped).
|
|
115
|
+
*/
|
|
116
|
+
declare function twemojiFilename(emoji: string): string;
|
|
117
|
+
/** Full Twemoji SVG URL for a glyph. */
|
|
118
|
+
declare function twemojiAssetUrl(emoji: string, baseUrl?: string): string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Sticker seam — types + a small bundled starter pack.
|
|
122
|
+
*
|
|
123
|
+
* Stickers are host-extensible: a consumer (or a future bundled pack) supplies
|
|
124
|
+
* `StickerSet`s and the picker renders them in a dedicated tab. Three render
|
|
125
|
+
* paths are supported so the API is ready for animated content without any
|
|
126
|
+
* heavy dependency in the core:
|
|
127
|
+
* - `kind: 'svg'` — inline SVG markup (can self-animate via SMIL, no JS).
|
|
128
|
+
* - `kind: 'image'` — a URL to a static or animated (WebP/GIF/APNG) asset.
|
|
129
|
+
* - `kind: 'lottie'`— a URL/JSON handed to a host-provided Lottie player.
|
|
130
|
+
*
|
|
131
|
+
* The starter pack below ships a handful of simple, consistent flat stickers
|
|
132
|
+
* (128×128, one visual language) so the tab is not empty out of the box, and
|
|
133
|
+
* proves the animated render path with a self-animating SMIL heart — no Lottie
|
|
134
|
+
* runtime required.
|
|
135
|
+
*/
|
|
136
|
+
type StickerKind = 'svg' | 'image' | 'lottie';
|
|
137
|
+
interface StickerItem {
|
|
138
|
+
/** Stable id (unique within its set). */
|
|
139
|
+
id: string;
|
|
140
|
+
/** Accessible label / alt text. */
|
|
141
|
+
label: string;
|
|
142
|
+
kind: StickerKind;
|
|
143
|
+
/**
|
|
144
|
+
* The sticker payload: inline SVG markup (`svg`), an asset URL (`image`), or
|
|
145
|
+
* a Lottie JSON URL or serialized object (`lottie`).
|
|
146
|
+
*/
|
|
147
|
+
source: string;
|
|
148
|
+
/** Search keywords. */
|
|
149
|
+
keywords?: string[];
|
|
150
|
+
/** True when the sticker animates (drives reduced-motion handling). */
|
|
151
|
+
animated?: boolean;
|
|
152
|
+
}
|
|
153
|
+
interface StickerSet {
|
|
154
|
+
/** Stable id (unique across sets). */
|
|
155
|
+
id: string;
|
|
156
|
+
/** Human-readable set name (tab tooltip). */
|
|
157
|
+
label: string;
|
|
158
|
+
/** A representative emoji/char for the set's tab icon. */
|
|
159
|
+
icon?: string;
|
|
160
|
+
stickers: StickerItem[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Refraction starter sticker pack — a tasteful, consistent flat set. The
|
|
164
|
+
* `pulse-heart` sticker self-animates via SMIL to demonstrate the animated
|
|
165
|
+
* render path; the rest are static.
|
|
166
|
+
*/
|
|
167
|
+
declare const STARTER_STICKER_SET: StickerSet;
|
|
168
|
+
|
|
169
|
+
declare const emojiPickerContainerStyles = "w-80 rounded-lg border bg-popover text-popover-foreground shadow-md motion-safe:animate-fade-in-scale origin-top";
|
|
66
170
|
declare const emojiPickerSearchStyles = "w-full border-b px-3 py-2 text-sm bg-transparent outline-none placeholder:text-muted-foreground";
|
|
67
171
|
declare const emojiPickerCategoryBarStyles = "flex border-b px-1";
|
|
68
172
|
declare const emojiPickerCategoryTabVariants: (props?: ({
|
|
@@ -71,7 +175,11 @@ declare const emojiPickerCategoryTabVariants: (props?: ({
|
|
|
71
175
|
className?: string;
|
|
72
176
|
}) | undefined) => string;
|
|
73
177
|
declare const emojiPickerGridStyles = "grid grid-cols-8 gap-0.5 p-2 max-h-64 overflow-y-auto";
|
|
74
|
-
declare const emojiPickerEmojiButtonStyles = "flex items-center justify-center h-8 w-8 rounded cursor-pointer text-lg hover:bg-accent transition-
|
|
178
|
+
declare const emojiPickerEmojiButtonStyles = "flex items-center justify-center h-8 w-8 rounded cursor-pointer text-lg transition-transform duration-100 ease-out hover:bg-accent hover:scale-125 active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none motion-reduce:hover:scale-100";
|
|
75
179
|
declare const emojiPickerSectionLabelStyles = "px-2 py-1 text-xs font-medium text-muted-foreground";
|
|
180
|
+
/** The swappable category/search/sticker panel; fades on category switch. */
|
|
181
|
+
declare const emojiPickerPanelStyles = "motion-safe:animate-fade-in origin-top";
|
|
182
|
+
/** A single sticker cell in the sticker tab. */
|
|
183
|
+
declare const emojiPickerStickerButtonStyles = "flex items-center justify-center rounded-lg p-1.5 aspect-square cursor-pointer transition-transform duration-100 ease-out hover:bg-accent hover:scale-110 active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none motion-reduce:hover:scale-100";
|
|
76
184
|
|
|
77
|
-
export { CATEGORY_LABELS, EMOJI_CATEGORIES, EMOJI_DATA, type EmojiCategory, type EmojiEntry, type EmojiPickerAPI, type EmojiPickerProps, type EmojiPickerState, createEmojiPicker, emojiPickerCategoryBarStyles, emojiPickerCategoryTabVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, emojiPickerSearchStyles, emojiPickerSectionLabelStyles, getAllEmojis };
|
|
185
|
+
export { CATEGORY_LABELS, DEFAULT_TWEMOJI_BASE_URL, EMOJI_CATEGORIES, EMOJI_COUNT_TOTAL, EMOJI_DATA, type EmojiCategory, type EmojiEntry, type EmojiPickerAPI, type EmojiPickerProps, type EmojiPickerState, SHORTCODE_ALIASES, STARTER_STICKER_SET, type StickerItem, type StickerKind, type StickerSet, buildShortcodeMap, createEmojiPicker, emojiPickerCategoryBarStyles, emojiPickerCategoryTabVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, emojiPickerPanelStyles, emojiPickerSearchStyles, emojiPickerSectionLabelStyles, emojiPickerStickerButtonStyles, getAllEmojis, resolveShortcode, searchEmojis, twemojiAssetUrl, twemojiFilename };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ComposerTrigger, ComposerCandidate, ComposerAttachmentDraft, ComposerDraftStore, ComposerValidator, ComposerSubmission, ComposerAttachment, ComposerEvent, ComposerAPI, ComposerState, ComposerConfig } from '../composer/index.js';
|
|
3
|
-
export { ComposerAPI, ComposerAttachment, ComposerAttachmentDraft, ComposerAttachmentKind, ComposerAttachmentStatus, ComposerCandidate, ComposerConfig, ComposerDraft, ComposerDraftStore, ComposerEvent, ComposerMode, ComposerOutput, ComposerSelection, ComposerState, ComposerSubmission, ComposerToken, ComposerTrigger, ComposerTriggerResolver, ComposerTriggerScope, ComposerValidationResult, ComposerValidator, CounterState, EnterResult, PlacedToken, ResolvedToken, SuggestionState, composerAttachmentChipVariants, composerCounterVariants, composerFieldClass, composerMenuClass, composerMenuItemVariants, composerPrimaryActionVariants, composerSurfaceVariants, composerTokenPillClass, composerTrayClass, createComposer, toMessageAttachment } from '../composer/index.js';
|
|
3
|
+
export { ComposerAPI, ComposerAttachment, ComposerAttachmentDraft, ComposerAttachmentKind, ComposerAttachmentStatus, ComposerCandidate, ComposerConfig, ComposerDraft, ComposerDraftStore, ComposerEvent, ComposerMode, ComposerOutput, ComposerSelection, ComposerState, ComposerSubmission, ComposerToken, ComposerTrigger, ComposerTriggerResolver, ComposerTriggerScope, ComposerValidationResult, ComposerValidator, CounterState, EmojiTriggerOptions, EnterResult, PlacedToken, ResolvedToken, SuggestionState, composerAccessoryPanelClass, composerAccessoryToggleVariants, composerAttachmentChipVariants, composerCounterVariants, composerFieldClass, composerMenuClass, composerMenuItemVariants, composerPrimaryActionVariants, composerSurfaceVariants, composerTokenPillClass, composerTrayClass, createComposer, createEmojiTrigger, toMessageAttachment } from '../composer/index.js';
|
|
4
4
|
|
|
5
5
|
/** All user-facing text; every entry is overridable via the `strings` prop. */
|
|
6
6
|
interface RefractionComposerStrings {
|
|
@@ -21,6 +21,8 @@ interface RefractionComposerStrings {
|
|
|
21
21
|
counterLabel: (remaining: number) => string;
|
|
22
22
|
editingLabel: string;
|
|
23
23
|
cancelEditLabel: string;
|
|
24
|
+
/** Accessible name of the expression-panel toggle button. */
|
|
25
|
+
accessoryPanelLabel: string;
|
|
24
26
|
/** Live-region announcement while the suggestion menu shows results. */
|
|
25
27
|
resultsAnnouncement: (count: number) => string;
|
|
26
28
|
}
|
|
@@ -56,6 +58,25 @@ interface RefractionComposerProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
56
58
|
/** Busy/streaming: swaps the default send button for a stop button. */
|
|
57
59
|
busy?: boolean;
|
|
58
60
|
onStop?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Resting fill of the composer surface. `outlined` (default) is a
|
|
63
|
+
* transparent-on-page card; `filled` uses a calm muted fill distinct from the
|
|
64
|
+
* page. Both keep a tasteful focus-visible ring.
|
|
65
|
+
*/
|
|
66
|
+
surface?: 'outlined' | 'filled';
|
|
67
|
+
/**
|
|
68
|
+
* Content for the inline expression panel (e.g. an emoji picker). When set, a
|
|
69
|
+
* toggle button appears in the action row and the panel docks BELOW the field
|
|
70
|
+
* inside the composer's own stack — it never floats over or covers the text
|
|
71
|
+
* being typed. Toggle open/close is animated and reduced-motion aware.
|
|
72
|
+
*/
|
|
73
|
+
accessoryPanel?: React.ReactNode;
|
|
74
|
+
/** Controlled open state for the accessory panel. */
|
|
75
|
+
accessoryPanelOpen?: boolean;
|
|
76
|
+
/** Initial open state for the accessory panel (uncontrolled). Default false. */
|
|
77
|
+
defaultAccessoryPanelOpen?: boolean;
|
|
78
|
+
/** Fired when the accessory-panel toggle changes the open state. */
|
|
79
|
+
onAccessoryPanelToggle?: (open: boolean) => void;
|
|
59
80
|
autoFocus?: boolean;
|
|
60
81
|
dir?: 'ltr' | 'rtl' | 'auto';
|
|
61
82
|
/** Trigger configs (mention '@', slash '/', emoji ':', …). Fixed at mount. */
|
|
@@ -1,32 +1,57 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { EmojiEntry } from '../emoji-picker/index.cjs';
|
|
3
|
-
export { CATEGORY_LABELS, EmojiPickerProps as CoreEmojiPickerProps, EMOJI_CATEGORIES, EMOJI_DATA, EmojiCategory, EmojiEntry, EmojiPickerAPI, EmojiPickerState, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles } from '../emoji-picker/index.cjs';
|
|
3
|
+
import { EmojiEntry, StickerItem, StickerSet } from '../emoji-picker/index.cjs';
|
|
4
|
+
export { CATEGORY_LABELS, EmojiPickerProps as CoreEmojiPickerProps, DEFAULT_TWEMOJI_BASE_URL, EMOJI_CATEGORIES, EMOJI_COUNT_TOTAL, EMOJI_DATA, EmojiCategory, EmojiEntry, EmojiPickerAPI, EmojiPickerState, SHORTCODE_ALIASES, STARTER_STICKER_SET, StickerItem, StickerKind, StickerSet, buildShortcodeMap, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, getAllEmojis, resolveShortcode, searchEmojis, twemojiAssetUrl, twemojiFilename } from '../emoji-picker/index.cjs';
|
|
4
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The emoji render seam: maps an emoji entry to a React node. Swap it to change
|
|
8
|
+
* how glyphs are painted (native, Twemoji, Noto, Fluent, a Lottie player, …)
|
|
9
|
+
* WITHOUT touching the data or the picker. The default is `twemojiRenderer`,
|
|
10
|
+
* which lazily loads one small uniform SVG per glyph (WhatsApp-style "one look
|
|
11
|
+
* everywhere"); `nativeEmojiRenderer` falls back to the OS glyph.
|
|
12
|
+
*/
|
|
13
|
+
type EmojiRenderer = (emoji: EmojiEntry) => React.ReactNode;
|
|
14
|
+
/** The sticker render seam: maps a sticker item to a React node. */
|
|
15
|
+
type StickerRenderer = (sticker: StickerItem) => React.ReactNode;
|
|
16
|
+
/** Renders the OS-native glyph (non-uniform across platforms). */
|
|
17
|
+
declare const nativeEmojiRenderer: EmojiRenderer;
|
|
18
|
+
/**
|
|
19
|
+
* Renders a uniform Twemoji SVG (CC-BY 4.0 — attribution required, see the
|
|
20
|
+
* package README). Lazily loaded per glyph; the native glyph is the `alt`
|
|
21
|
+
* fallback if the asset can't load (e.g. offline).
|
|
22
|
+
*/
|
|
23
|
+
declare function createTwemojiRenderer(baseUrl?: string): EmojiRenderer;
|
|
24
|
+
declare const twemojiRenderer: EmojiRenderer;
|
|
25
|
+
/**
|
|
26
|
+
* Default sticker renderer. Handles inline SVG (`svg`, may self-animate via
|
|
27
|
+
* SMIL) and image/animated-WebP URLs (`image`). For `lottie`, a host must
|
|
28
|
+
* supply its own `stickerRenderer` with a Lottie player; the default shows the
|
|
29
|
+
* static poster if `source` is a URL, else the label.
|
|
30
|
+
*/
|
|
31
|
+
declare const defaultStickerRenderer: StickerRenderer;
|
|
5
32
|
interface EmojiPickerProps {
|
|
33
|
+
/** Fired with the selected emoji entry. */
|
|
6
34
|
onSelect?: (emoji: EmojiEntry) => void;
|
|
35
|
+
/** Fired with the selected sticker. */
|
|
36
|
+
onStickerSelect?: (sticker: StickerItem) => void;
|
|
37
|
+
/** Initial recents (most-recent-first). */
|
|
7
38
|
recentEmojis?: EmojiEntry[];
|
|
8
39
|
className?: string;
|
|
40
|
+
/** Emoji render seam. Default: uniform Twemoji. */
|
|
41
|
+
emojiRenderer?: EmojiRenderer;
|
|
42
|
+
/** Base URL for Twemoji assets (self-host to avoid the public CDN). */
|
|
43
|
+
twemojiBaseUrl?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Sticker sets for the sticker tab. Defaults to the bundled starter pack;
|
|
46
|
+
* pass `[]` to hide the sticker tab entirely.
|
|
47
|
+
*/
|
|
48
|
+
stickerSets?: StickerSet[];
|
|
49
|
+
/** Sticker render seam. Default: `defaultStickerRenderer`. */
|
|
50
|
+
stickerRenderer?: StickerRenderer;
|
|
9
51
|
}
|
|
10
|
-
declare function EmojiPicker({ onSelect, recentEmojis: initialRecent, className }: EmojiPickerProps):
|
|
11
|
-
role?: string | undefined;
|
|
12
|
-
tabIndex?: number | undefined;
|
|
13
|
-
'aria-label'?: string | undefined;
|
|
14
|
-
'aria-labelledby'?: string | undefined;
|
|
15
|
-
'aria-describedby'?: string | undefined;
|
|
16
|
-
'aria-controls'?: string | undefined;
|
|
17
|
-
'aria-expanded'?: boolean | undefined;
|
|
18
|
-
'aria-selected'?: boolean | undefined;
|
|
19
|
-
'aria-hidden'?: boolean | undefined;
|
|
20
|
-
'aria-disabled'?: boolean | undefined;
|
|
21
|
-
'aria-pressed'?: boolean | "mixed" | undefined;
|
|
22
|
-
'aria-checked'?: boolean | "mixed" | undefined;
|
|
23
|
-
'aria-current'?: boolean | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
24
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
25
|
-
'aria-atomic'?: boolean | undefined;
|
|
26
|
-
className: string;
|
|
27
|
-
}, HTMLElement>;
|
|
52
|
+
declare function EmojiPicker({ onSelect, onStickerSelect, recentEmojis: initialRecent, className, emojiRenderer, twemojiBaseUrl, stickerSets, stickerRenderer, }: EmojiPickerProps): react_jsx_runtime.JSX.Element;
|
|
28
53
|
declare namespace EmojiPicker {
|
|
29
54
|
var displayName: string;
|
|
30
55
|
}
|
|
31
56
|
|
|
32
|
-
export { EmojiPicker, type EmojiPickerProps };
|
|
57
|
+
export { EmojiPicker, type EmojiPickerProps, type EmojiRenderer, type StickerRenderer, createTwemojiRenderer, defaultStickerRenderer, nativeEmojiRenderer, twemojiRenderer };
|
|
@@ -1,32 +1,57 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { EmojiEntry } from '../emoji-picker/index.js';
|
|
3
|
-
export { CATEGORY_LABELS, EmojiPickerProps as CoreEmojiPickerProps, EMOJI_CATEGORIES, EMOJI_DATA, EmojiCategory, EmojiEntry, EmojiPickerAPI, EmojiPickerState, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles } from '../emoji-picker/index.js';
|
|
3
|
+
import { EmojiEntry, StickerItem, StickerSet } from '../emoji-picker/index.js';
|
|
4
|
+
export { CATEGORY_LABELS, EmojiPickerProps as CoreEmojiPickerProps, DEFAULT_TWEMOJI_BASE_URL, EMOJI_CATEGORIES, EMOJI_COUNT_TOTAL, EMOJI_DATA, EmojiCategory, EmojiEntry, EmojiPickerAPI, EmojiPickerState, SHORTCODE_ALIASES, STARTER_STICKER_SET, StickerItem, StickerKind, StickerSet, buildShortcodeMap, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, getAllEmojis, resolveShortcode, searchEmojis, twemojiAssetUrl, twemojiFilename } from '../emoji-picker/index.js';
|
|
4
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The emoji render seam: maps an emoji entry to a React node. Swap it to change
|
|
8
|
+
* how glyphs are painted (native, Twemoji, Noto, Fluent, a Lottie player, …)
|
|
9
|
+
* WITHOUT touching the data or the picker. The default is `twemojiRenderer`,
|
|
10
|
+
* which lazily loads one small uniform SVG per glyph (WhatsApp-style "one look
|
|
11
|
+
* everywhere"); `nativeEmojiRenderer` falls back to the OS glyph.
|
|
12
|
+
*/
|
|
13
|
+
type EmojiRenderer = (emoji: EmojiEntry) => React.ReactNode;
|
|
14
|
+
/** The sticker render seam: maps a sticker item to a React node. */
|
|
15
|
+
type StickerRenderer = (sticker: StickerItem) => React.ReactNode;
|
|
16
|
+
/** Renders the OS-native glyph (non-uniform across platforms). */
|
|
17
|
+
declare const nativeEmojiRenderer: EmojiRenderer;
|
|
18
|
+
/**
|
|
19
|
+
* Renders a uniform Twemoji SVG (CC-BY 4.0 — attribution required, see the
|
|
20
|
+
* package README). Lazily loaded per glyph; the native glyph is the `alt`
|
|
21
|
+
* fallback if the asset can't load (e.g. offline).
|
|
22
|
+
*/
|
|
23
|
+
declare function createTwemojiRenderer(baseUrl?: string): EmojiRenderer;
|
|
24
|
+
declare const twemojiRenderer: EmojiRenderer;
|
|
25
|
+
/**
|
|
26
|
+
* Default sticker renderer. Handles inline SVG (`svg`, may self-animate via
|
|
27
|
+
* SMIL) and image/animated-WebP URLs (`image`). For `lottie`, a host must
|
|
28
|
+
* supply its own `stickerRenderer` with a Lottie player; the default shows the
|
|
29
|
+
* static poster if `source` is a URL, else the label.
|
|
30
|
+
*/
|
|
31
|
+
declare const defaultStickerRenderer: StickerRenderer;
|
|
5
32
|
interface EmojiPickerProps {
|
|
33
|
+
/** Fired with the selected emoji entry. */
|
|
6
34
|
onSelect?: (emoji: EmojiEntry) => void;
|
|
35
|
+
/** Fired with the selected sticker. */
|
|
36
|
+
onStickerSelect?: (sticker: StickerItem) => void;
|
|
37
|
+
/** Initial recents (most-recent-first). */
|
|
7
38
|
recentEmojis?: EmojiEntry[];
|
|
8
39
|
className?: string;
|
|
40
|
+
/** Emoji render seam. Default: uniform Twemoji. */
|
|
41
|
+
emojiRenderer?: EmojiRenderer;
|
|
42
|
+
/** Base URL for Twemoji assets (self-host to avoid the public CDN). */
|
|
43
|
+
twemojiBaseUrl?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Sticker sets for the sticker tab. Defaults to the bundled starter pack;
|
|
46
|
+
* pass `[]` to hide the sticker tab entirely.
|
|
47
|
+
*/
|
|
48
|
+
stickerSets?: StickerSet[];
|
|
49
|
+
/** Sticker render seam. Default: `defaultStickerRenderer`. */
|
|
50
|
+
stickerRenderer?: StickerRenderer;
|
|
9
51
|
}
|
|
10
|
-
declare function EmojiPicker({ onSelect, recentEmojis: initialRecent, className }: EmojiPickerProps):
|
|
11
|
-
role?: string | undefined;
|
|
12
|
-
tabIndex?: number | undefined;
|
|
13
|
-
'aria-label'?: string | undefined;
|
|
14
|
-
'aria-labelledby'?: string | undefined;
|
|
15
|
-
'aria-describedby'?: string | undefined;
|
|
16
|
-
'aria-controls'?: string | undefined;
|
|
17
|
-
'aria-expanded'?: boolean | undefined;
|
|
18
|
-
'aria-selected'?: boolean | undefined;
|
|
19
|
-
'aria-hidden'?: boolean | undefined;
|
|
20
|
-
'aria-disabled'?: boolean | undefined;
|
|
21
|
-
'aria-pressed'?: boolean | "mixed" | undefined;
|
|
22
|
-
'aria-checked'?: boolean | "mixed" | undefined;
|
|
23
|
-
'aria-current'?: boolean | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
24
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
25
|
-
'aria-atomic'?: boolean | undefined;
|
|
26
|
-
className: string;
|
|
27
|
-
}, HTMLElement>;
|
|
52
|
+
declare function EmojiPicker({ onSelect, onStickerSelect, recentEmojis: initialRecent, className, emojiRenderer, twemojiBaseUrl, stickerSets, stickerRenderer, }: EmojiPickerProps): react_jsx_runtime.JSX.Element;
|
|
28
53
|
declare namespace EmojiPicker {
|
|
29
54
|
var displayName: string;
|
|
30
55
|
}
|
|
31
56
|
|
|
32
|
-
export { EmojiPicker, type EmojiPickerProps };
|
|
57
|
+
export { EmojiPicker, type EmojiPickerProps, type EmojiRenderer, type StickerRenderer, createTwemojiRenderer, defaultStickerRenderer, nativeEmojiRenderer, twemojiRenderer };
|
package/dist/theme.js
CHANGED
package/package.json
CHANGED