@fluid-app/fluid-cli-theme-dev 0.1.534 → 0.1.536
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/dist-cli-preview/.vite/manifest.json +276 -295
- package/dist/dist-cli-preview/account-screens.js +1 -1
- package/dist/dist-cli-preview/chunks/{Combobox-CJDvxjNn.js → Combobox-D4l7DbBy.js} +54 -53
- package/dist/dist-cli-preview/chunks/{ContactsScreen-DD3XWK3Q.js → ContactsScreen-CEtA3-1c.js} +903 -850
- package/dist/dist-cli-preview/chunks/MediaScreen-C2rOxuuv.js +8 -0
- package/dist/dist-cli-preview/chunks/{MemberManagementProviders-iVdfo0DH.js → MemberManagementProviders-B_YXVcDi.js} +13 -13
- package/dist/dist-cli-preview/chunks/{MemberShareablesScreen-BulCAnNO.js → MemberShareablesScreen-UNjYr5R6.js} +4207 -3757
- package/dist/dist-cli-preview/chunks/{MessagingScreen-DlDsOy19.js → MessagingScreen-Btga_V0H.js} +24118 -21933
- package/dist/dist-cli-preview/chunks/MobileActionSheet-CrEH2vO7.js +1384 -0
- package/dist/dist-cli-preview/chunks/{MySiteScreen-BfPfyV4m.js → MySiteScreen-B1fGtPDj.js} +177 -163
- package/dist/dist-cli-preview/chunks/OrdersScreen-Bf9DtOCA.js +9 -0
- package/dist/dist-cli-preview/chunks/{OrdersScreen-C4yi3z2p.js → OrdersScreen-DyyL-P7j.js} +35 -34
- package/dist/dist-cli-preview/chunks/PlaylistsScreen-tws56I3H.js +8 -0
- package/dist/dist-cli-preview/chunks/{PortalTenantClientProvider-Clys_Bme.js → PortalTenantClientProvider-DUOOCXfW.js} +1 -1
- package/dist/dist-cli-preview/chunks/{ProfileScreen-e4QhExeS.js → ProfileScreen-wZO6QMrU.js} +259 -234
- package/dist/dist-cli-preview/chunks/ResponsiveDialog-DSDcOjhm.js +731 -0
- package/dist/dist-cli-preview/chunks/Select-DmRoXIkQ.js +2499 -0
- package/dist/dist-cli-preview/chunks/{SubscriptionsScreen-DysTJ6w_.js → SubscriptionsScreen-BR2C0m7M.js} +3 -3
- package/dist/dist-cli-preview/chunks/Textarea-C59p5Cek.js +365 -0
- package/dist/dist-cli-preview/chunks/{account-screen-runtime-B3e0JV6I.js → account-screen-runtime-BqMndJcu.js} +1389 -1409
- package/dist/dist-cli-preview/chunks/{arrow-left-BOYuYcvT.js → arrow-left-CFy5J6Id.js} +1 -1
- package/dist/dist-cli-preview/chunks/{cli-preview-cY0EPyxC.js → cli-preview-DZOhxtLy.js} +10 -10
- package/dist/dist-cli-preview/chunks/{client.gen-jwIybX1j.js → client.gen-DTVKCFco.js} +12 -12
- package/dist/dist-cli-preview/chunks/{copy-Cm_EKxcg.js → copy-Da4VLOCZ.js} +1 -1
- package/dist/dist-cli-preview/chunks/{countries-api-adapter-BCS0247N.js → countries-api-adapter-Bh5QfCO1.js} +2 -2
- package/dist/dist-cli-preview/chunks/{create-card-entry-container-CZi7shLR.js → create-card-entry-container-ohrRYgww.js} +1939 -1929
- package/dist/dist-cli-preview/chunks/{hey-api-client-B6n5a7q-.js → hey-api-client-BIjWueui.js} +1 -1
- package/dist/dist-cli-preview/chunks/{index-CfLLmITa.js → index-BMWjXC9i.js} +405 -869
- package/dist/dist-cli-preview/chunks/{index-DFIsiT9r.js → index-BVehJyDQ.js} +2080 -2372
- package/dist/dist-cli-preview/chunks/index-_r1wSvno.js +427 -0
- package/dist/dist-cli-preview/chunks/{isAfter-D0zQuNEJ.js → isAfter-BR4uNpua.js} +145 -156
- package/dist/dist-cli-preview/chunks/{map-pin-Vt1smsNu.js → map-pin-C_cK_i_W.js} +1 -1
- package/dist/dist-cli-preview/chunks/messaging-B1UjYRdl.js +4 -0
- package/dist/dist-cli-preview/chunks/{mount-account-screen-BOVvR3Og.js → mount-account-screen-JJGALFRE.js} +8 -8
- package/dist/dist-cli-preview/chunks/{navigate-account-screen-D756rD78.js → navigate-account-screen-C0VoUNOi.js} +1 -1
- package/dist/dist-cli-preview/chunks/schemas-D0s3rDQw.js +4851 -0
- package/dist/dist-cli-preview/chunks/{screen-route-slug-utils-HNXiCpo6.js → screen-route-slug-utils-n2BiDZmp.js} +205 -260
- package/dist/dist-cli-preview/chunks/search-zEnxG69C.js +14 -0
- package/dist/dist-cli-preview/chunks/sheet-haptics-context-p5ZPxslK.js +133 -0
- package/dist/dist-cli-preview/chunks/{sidebar-BDgHluGp.js → sidebar-CjPHl33n.js} +8 -8
- package/dist/dist-cli-preview/chunks/{sortable.esm-Cw91KlVU.js → sortable.esm-CrxUZkb-.js} +373 -362
- package/dist/dist-cli-preview/chunks/{store-api-context-BCaEZBlj.js → store-api-context-0k_ECvSE.js} +1 -1
- package/dist/dist-cli-preview/chunks/translation-api-context-factory-CP0LBb-M.js +74 -0
- package/dist/dist-cli-preview/chunks/{use-mobile-BztyG-mE.js → use-mobile-DIhDH3dI.js} +1 -1
- package/dist/dist-cli-preview/chunks/{use-optional-store-Dl6PSQur.js → use-optional-store-t4xzc2Rl.js} +2 -2
- package/dist/dist-cli-preview/chunks/use-store-YC0Ovzht.js +76 -0
- package/dist/dist-cli-preview/chunks/{useInfiniteQuery-fL_VYHHr.js → useInfiniteQuery-Bnzu0kZa.js} +9 -20
- package/dist/dist-cli-preview/chunks/{users-B3YJ3D1U.js → users-CabXl4EL.js} +1 -1
- package/package.json +2 -2
- package/dist/dist-cli-preview/chunks/Breadcrumb-ixf0cTR_.js +0 -91
- package/dist/dist-cli-preview/chunks/MediaScreen-D8WSOaze.js +0 -8
- package/dist/dist-cli-preview/chunks/MobileActionSheet-aGr-nGxu.js +0 -3884
- package/dist/dist-cli-preview/chunks/OrdersScreen-hidM-JR_.js +0 -9
- package/dist/dist-cli-preview/chunks/PlaylistsScreen-BIqSXZ5B.js +0 -8
- package/dist/dist-cli-preview/chunks/ellipsis-C1sJRT_T.js +0 -15
- package/dist/dist-cli-preview/chunks/eye-BHBOtWLw.js +0 -20
- package/dist/dist-cli-preview/chunks/index-COIiY5Im.js +0 -135
- package/dist/dist-cli-preview/chunks/log-out-segl_UhK.js +0 -30
- package/dist/dist-cli-preview/chunks/messaging-C_IkzF0O.js +0 -4
- package/dist/dist-cli-preview/chunks/pause-YWP8mWBs.js +0 -41
- package/dist/dist-cli-preview/chunks/schemas-BiM-ImW1.js +0 -5565
- package/dist/dist-cli-preview/chunks/sheet-haptics-context-d9udqor0.js +0 -116
- package/dist/dist-cli-preview/chunks/trash-2-CZEbdFT_.js +0 -17
- package/dist/dist-cli-preview/chunks/use-store-aahN8SDp.js +0 -400
- package/dist/dist-cli-preview/chunks/user-B4pULYRZ.js +0 -14
|
@@ -1,62 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Ve = [
|
|
9
|
-
[
|
|
10
|
-
"path",
|
|
11
|
-
{
|
|
12
|
-
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
13
|
-
key: "1i5ecw"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
17
|
-
], It = ce("settings", Ve);
|
|
18
|
-
/**
|
|
19
|
-
* @license lucide-react v0.575.0 - ISC
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the ISC license.
|
|
22
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/
|
|
24
|
-
const ze = [
|
|
25
|
-
[
|
|
26
|
-
"path",
|
|
27
|
-
{
|
|
28
|
-
d: "M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",
|
|
29
|
-
key: "1dfntj"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
["path", { d: "M15 3v5a1 1 0 0 0 1 1h5", key: "6s6qgf" }]
|
|
33
|
-
], Tt = ce("sticky-note", ze);
|
|
34
|
-
function At({
|
|
35
|
-
icon: e,
|
|
36
|
-
className: t,
|
|
37
|
-
variant: r = "ghost",
|
|
38
|
-
size: o = "icon",
|
|
39
|
-
isActive: n,
|
|
40
|
-
...a
|
|
41
|
-
}) {
|
|
42
|
-
return /* @__PURE__ */ h.jsx(
|
|
43
|
-
Fe,
|
|
44
|
-
{
|
|
45
|
-
variant: r,
|
|
46
|
-
size: o,
|
|
47
|
-
"data-active": n,
|
|
48
|
-
className: Me(n && "bg-accent text-accent-foreground", t),
|
|
49
|
-
...a,
|
|
50
|
-
children: /* @__PURE__ */ h.jsx(e, {})
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
var De = Object.defineProperty, Ne = (e, t) => {
|
|
55
|
-
for (var r in t) De(e, r, { get: t[r], enumerable: !0 });
|
|
56
|
-
}, Le = {};
|
|
57
|
-
Ne(Le, { ActiveEmoji: () => Pe, Empty: () => Ae, List: () => He, Loading: () => Te, Root: () => be, Search: () => xe, SkinTone: () => $e, SkinToneSelector: () => Ie, Viewport: () => ke });
|
|
58
|
-
var de = "'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif", q = ["none", "light", "medium-light", "medium", "medium-dark", "dark"];
|
|
59
|
-
function B(e) {
|
|
1
|
+
import { l, j as h } from "./account-screen-runtime-BqMndJcu.js";
|
|
2
|
+
var $e = Object.defineProperty, Fe = (e, t) => {
|
|
3
|
+
for (var r in t) $e(e, r, { get: t[r], enumerable: !0 });
|
|
4
|
+
}, Ve = {};
|
|
5
|
+
Fe(Ve, { ActiveEmoji: () => Ae, Empty: () => Te, List: () => Re, Loading: () => Ie, Root: () => je, Search: () => be, SkinTone: () => Pe, SkinToneSelector: () => He, Viewport: () => xe });
|
|
6
|
+
var ce = "'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif", q = ["none", "light", "medium-light", "medium", "medium-dark", "dark"];
|
|
7
|
+
function O(e) {
|
|
60
8
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
61
9
|
}
|
|
62
10
|
var $ = 2, H = null;
|
|
@@ -67,7 +15,7 @@ function G(e) {
|
|
|
67
15
|
}
|
|
68
16
|
if (!H || (queueMicrotask(() => {
|
|
69
17
|
H && (H = null);
|
|
70
|
-
}), H.canvas.width = $, H.canvas.height = $, H.font = `2px ${
|
|
18
|
+
}), H.canvas.width = $, H.canvas.height = $, H.font = `2px ${ce}`, H.textBaseline = "middle", H.measureText(e).width >= $ * 2)) return !1;
|
|
71
19
|
H.fillStyle = "#00f", H.fillText(e, 0, 0);
|
|
72
20
|
let t = H.getImageData(0, 0, $, $).data;
|
|
73
21
|
H.clearRect(0, 0, $, $), H.fillStyle = "#f00", H.fillText(e, 0, 0);
|
|
@@ -85,7 +33,7 @@ function Y(e, t, r) {
|
|
|
85
33
|
return null;
|
|
86
34
|
}
|
|
87
35
|
}
|
|
88
|
-
function
|
|
36
|
+
function de(e, t, r) {
|
|
89
37
|
e.setItem(t, JSON.stringify(r));
|
|
90
38
|
}
|
|
91
39
|
function Q(e) {
|
|
@@ -102,11 +50,11 @@ function W(e) {
|
|
|
102
50
|
if (typeof e != "number") throw new Error();
|
|
103
51
|
return e;
|
|
104
52
|
}
|
|
105
|
-
function
|
|
53
|
+
function ge(e) {
|
|
106
54
|
if (typeof e != "boolean") throw new Error();
|
|
107
55
|
return e;
|
|
108
56
|
}
|
|
109
|
-
function
|
|
57
|
+
function D(e) {
|
|
110
58
|
return (t) => {
|
|
111
59
|
if (typeof t != "object" || t === null) throw new Error();
|
|
112
60
|
let r = {};
|
|
@@ -117,13 +65,13 @@ function z(e) {
|
|
|
117
65
|
return r;
|
|
118
66
|
};
|
|
119
67
|
}
|
|
120
|
-
function
|
|
68
|
+
function B(e) {
|
|
121
69
|
return (t) => {
|
|
122
70
|
if (!Array.isArray(t)) throw new Error();
|
|
123
71
|
return t.length > 0 && e(t[0]), t;
|
|
124
72
|
};
|
|
125
73
|
}
|
|
126
|
-
var
|
|
74
|
+
var fe = (e, t) => `${e}/${t}/data.json`, me = (e, t) => `${e}/${t}/messages.json`, Me = ["bn", "da", "de", "en-gb", "en", "es-mx", "es", "et", "fi", "fr", "hi", "hu", "it", "ja", "ko", "lt", "ms", "nb", "nl", "pl", "pt", "ru", "sv", "th", "uk", "vi", "zh-hant", "zh"], Z = "en", he = (e) => `frimousse/data/${e}`, ee = "frimousse/metadata";
|
|
127
75
|
async function te(e, t) {
|
|
128
76
|
try {
|
|
129
77
|
return (await fetch(e, { method: "HEAD", signal: t })).headers.get("etag");
|
|
@@ -131,103 +79,103 @@ async function te(e, t) {
|
|
|
131
79
|
return null;
|
|
132
80
|
}
|
|
133
81
|
}
|
|
134
|
-
async function
|
|
135
|
-
let [{ emojis: o, emojisEtag: n }, { messages:
|
|
136
|
-
return { emojis: o, messages:
|
|
82
|
+
async function De(e, t, r) {
|
|
83
|
+
let [{ emojis: o, emojisEtag: n }, { messages: s, messagesEtag: a }] = await Promise.all([fetch(fe(e, t), { signal: r }).then(async (i) => ({ emojis: await i.json(), emojisEtag: i.headers.get("etag") })), fetch(me(e, t), { signal: r }).then(async (i) => ({ messages: await i.json(), messagesEtag: i.headers.get("etag") }))]);
|
|
84
|
+
return { emojis: o, messages: s, emojisEtag: n, messagesEtag: a };
|
|
137
85
|
}
|
|
138
|
-
async function
|
|
139
|
-
let [o, n] = await Promise.all([te(
|
|
86
|
+
async function ze(e, t, r) {
|
|
87
|
+
let [o, n] = await Promise.all([te(fe(e, t), r), te(me(e, t), r)]);
|
|
140
88
|
return { emojisEtag: o, messagesEtag: n };
|
|
141
89
|
}
|
|
142
|
-
function
|
|
90
|
+
function Ne(e) {
|
|
143
91
|
return e.skins ? e.skins.filter((t) => typeof t.tone == "number").reduce((t, r) => {
|
|
144
92
|
let o = q[r.tone];
|
|
145
93
|
return t[o] = r.emoji, t;
|
|
146
94
|
}, {}) : void 0;
|
|
147
95
|
}
|
|
148
96
|
async function re(e, t, r) {
|
|
149
|
-
let { emojis: o, emojisEtag: n, messages:
|
|
150
|
-
return
|
|
97
|
+
let { emojis: o, emojisEtag: n, messages: s, messagesEtag: a } = await De(e, t, r), i = s.subgroups.find((d) => d.key === "country-flag" || d.key === "subdivision-flag"), g = s.groups.filter((d) => d.key !== "component"), u = o.filter((d) => "group" in d), m = g.map((d) => ({ index: d.order, label: O(d.message) })), c = s.skinTones.reduce((d, j) => (d[j.key] = O(j.message), d), {}), p = u.map((d) => ({ emoji: d.emoji, category: d.group, version: d.version, label: O(d.label), tags: d.tags ?? [], countryFlag: i && d.subgroup === i.order || void 0, skins: Ne(d) })), f = { locale: t, emojis: p, categories: m, skinTones: c };
|
|
98
|
+
return de(localStorage, he(t), { data: f, metadata: { emojisEtag: n, messagesEtag: a } }), f;
|
|
151
99
|
}
|
|
152
|
-
function
|
|
100
|
+
function Le(e, t) {
|
|
153
101
|
let r = /* @__PURE__ */ new Map();
|
|
154
|
-
for (let
|
|
155
|
-
let o = [...r.keys()].sort((
|
|
156
|
-
if (typeof t == "number") return { emojiVersion: t, countryFlags:
|
|
157
|
-
for (let
|
|
158
|
-
let i = r.get(
|
|
159
|
-
if (G(i)) return { emojiVersion:
|
|
102
|
+
for (let a of e) r.has(a.version) || r.set(a.version, a.emoji);
|
|
103
|
+
let o = [...r.keys()].sort((a, i) => i - a), n = o[0] ?? 0, s = G("🇪🇺");
|
|
104
|
+
if (typeof t == "number") return { emojiVersion: t, countryFlags: s };
|
|
105
|
+
for (let a of o) {
|
|
106
|
+
let i = r.get(a);
|
|
107
|
+
if (G(i)) return { emojiVersion: a, countryFlags: s };
|
|
160
108
|
}
|
|
161
|
-
return { emojiVersion: n, countryFlags:
|
|
109
|
+
return { emojiVersion: n, countryFlags: s };
|
|
162
110
|
}
|
|
163
|
-
var
|
|
164
|
-
async function
|
|
165
|
-
let n = typeof r == "string" ? r : `https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t == "number" ? Math.floor(t) : "latest"}`,
|
|
166
|
-
if (!
|
|
167
|
-
else if (
|
|
111
|
+
var Ue = D({ emojiVersion: W, countryFlags: ge }), We = D({ data: D({ locale: S, emojis: B(D({ emoji: S, category: W, label: S, version: W, tags: B(S), countryFlag: Q(ge), skins: Q(D({ light: S, "medium-light": S, medium: S, "medium-dark": S, dark: S })) })), categories: B(D({ index: W, label: S })), skinTones: D({ light: S, "medium-light": S, medium: S, "medium-dark": S, dark: S }) }), metadata: D({ emojisEtag: X(S), messagesEtag: X(S) }) });
|
|
112
|
+
async function Oe({ locale: e, emojiVersion: t, emojibaseUrl: r, signal: o }) {
|
|
113
|
+
let n = typeof r == "string" ? r : `https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t == "number" ? Math.floor(t) : "latest"}`, s = Y(sessionStorage, ee, Ue), a = Y(localStorage, he(e), We), i;
|
|
114
|
+
if (!a) i = await re(n, e, o);
|
|
115
|
+
else if (s) i = a.data;
|
|
168
116
|
else try {
|
|
169
|
-
let { emojisEtag: u, messagesEtag: m } = await
|
|
170
|
-
i = !u || !m || u !==
|
|
117
|
+
let { emojisEtag: u, messagesEtag: m } = await ze(n, e, o);
|
|
118
|
+
i = !u || !m || u !== a.metadata.emojisEtag || m !== a.metadata.messagesEtag ? await re(n, e, o) : a.data;
|
|
171
119
|
} catch {
|
|
172
|
-
i =
|
|
120
|
+
i = a.data;
|
|
173
121
|
}
|
|
174
|
-
|
|
122
|
+
s ?? (s = Le(i.emojis, t)), de(sessionStorage, ee, s);
|
|
175
123
|
let g = i.emojis.filter((u) => {
|
|
176
|
-
let m = u.version <=
|
|
177
|
-
return u.countryFlag ? m &&
|
|
124
|
+
let m = u.version <= s.emojiVersion;
|
|
125
|
+
return u.countryFlag ? m && s.countryFlags : m;
|
|
178
126
|
});
|
|
179
127
|
return { locale: e, emojis: g, categories: i.categories, skinTones: i.skinTones };
|
|
180
128
|
}
|
|
181
129
|
function oe(e) {
|
|
182
|
-
return
|
|
130
|
+
return Me.includes(e) ? e : (console.warn(`Locale "${e}" is not supported, using "${Z}" instead.`), Z);
|
|
183
131
|
}
|
|
184
132
|
function ne(e) {
|
|
185
133
|
return q.includes(e) ? e : (console.warn(`Skin tone "${e}" is not valid, using "none" instead.`), "none");
|
|
186
134
|
}
|
|
187
|
-
function
|
|
135
|
+
function Be(e, t) {
|
|
188
136
|
let r = [];
|
|
189
137
|
if (t <= 0) return r;
|
|
190
138
|
for (let o = 0, n = e.length; o < n; o += t) r.push(e.slice(o, o + t));
|
|
191
139
|
return r;
|
|
192
140
|
}
|
|
193
|
-
function
|
|
141
|
+
function qe(e, t) {
|
|
194
142
|
if (!t) return e;
|
|
195
143
|
let r = t.toLowerCase().trim(), o = /* @__PURE__ */ new WeakMap();
|
|
196
144
|
return e.filter((n) => {
|
|
197
|
-
let
|
|
198
|
-
n.label.toLowerCase().includes(r) && (
|
|
199
|
-
for (let
|
|
200
|
-
return
|
|
201
|
-
}).sort((n,
|
|
202
|
-
}
|
|
203
|
-
function
|
|
204
|
-
let n =
|
|
145
|
+
let s = 0;
|
|
146
|
+
n.label.toLowerCase().includes(r) && (s += 10);
|
|
147
|
+
for (let a of n.tags) a.toLowerCase().includes(r) && (s += 1);
|
|
148
|
+
return s > 0 ? (o.set(n, s), !0) : !1;
|
|
149
|
+
}).sort((n, s) => (o.get(s) ?? 0) - (o.get(n) ?? 0));
|
|
150
|
+
}
|
|
151
|
+
function Je(e, t, r, o) {
|
|
152
|
+
let n = qe(e.emojis, o), s = [], a = [], i = [], g = {}, u = 0, m = 0;
|
|
205
153
|
for (let c of n) g[c.category] || (g[c.category] = []), g[c.category].push({ emoji: r && r !== "none" && c.skins ? c.skins[r] : c.emoji, label: c.label });
|
|
206
154
|
for (let c of e.categories) {
|
|
207
155
|
let p = g[c.index];
|
|
208
156
|
if (!p || p.length === 0) continue;
|
|
209
|
-
let f =
|
|
210
|
-
|
|
157
|
+
let f = Be(Array.from(p), t).map((d) => ({ categoryIndex: u, emojis: d }));
|
|
158
|
+
s.push(...f), a.push({ label: c.label, rowsCount: f.length, startRowIndex: m }), i.push(m), u++, m += f.length;
|
|
211
159
|
}
|
|
212
|
-
return { count: n.length, categories:
|
|
160
|
+
return { count: n.length, categories: a, categoriesStartRowIndices: i, rows: s, skinTones: e.skinTones };
|
|
213
161
|
}
|
|
214
|
-
function
|
|
215
|
-
let t = {}, r = null, o = null, n = /* @__PURE__ */ new Set(),
|
|
162
|
+
function _e(e) {
|
|
163
|
+
let t = {}, r = null, o = null, n = /* @__PURE__ */ new Set(), s = () => {
|
|
216
164
|
if (r) {
|
|
217
165
|
t = r, r = null;
|
|
218
166
|
for (let u of n) u(t);
|
|
219
167
|
}
|
|
220
168
|
o = null;
|
|
221
|
-
},
|
|
222
|
-
r ?? (r = t), Object.assign(r, typeof u == "function" ? u(
|
|
169
|
+
}, a = () => r ?? t, i = (u) => {
|
|
170
|
+
r ?? (r = t), Object.assign(r, typeof u == "function" ? u(a()) : u), o || (o = requestAnimationFrame(s));
|
|
223
171
|
}, g = (u) => (n.add(u), () => n.delete(u));
|
|
224
|
-
return t = e(i,
|
|
172
|
+
return t = e(i, a), { get: a, set: i, subscribe: g };
|
|
225
173
|
}
|
|
226
|
-
function
|
|
174
|
+
function Ke(e) {
|
|
227
175
|
let [t] = l.useState(e);
|
|
228
176
|
return t;
|
|
229
177
|
}
|
|
230
|
-
function
|
|
178
|
+
function Ge(e) {
|
|
231
179
|
let t = l.createContext(null);
|
|
232
180
|
return { useStore: () => {
|
|
233
181
|
let r = l.useContext(t);
|
|
@@ -238,32 +186,32 @@ function et(e) {
|
|
|
238
186
|
function P(e, t, r = Object.is) {
|
|
239
187
|
let [o, n] = l.useState(() => t(e.get()));
|
|
240
188
|
return l.useEffect(() => e.subscribe(() => {
|
|
241
|
-
let
|
|
242
|
-
n((
|
|
189
|
+
let s = t(e.get());
|
|
190
|
+
n((a) => r(a, s) ? a : s);
|
|
243
191
|
}), [e, t, r]), l.useDebugValue(o), o;
|
|
244
192
|
}
|
|
245
|
-
function
|
|
193
|
+
function M(e, t, r) {
|
|
246
194
|
let o = l.useCallback((n) => n[t], [t]);
|
|
247
195
|
return P(e, o, r);
|
|
248
196
|
}
|
|
249
197
|
var ie = 2;
|
|
250
|
-
function
|
|
198
|
+
function Ye(e, t, r, o) {
|
|
251
199
|
let n = 0;
|
|
252
|
-
return
|
|
253
|
-
let g =
|
|
254
|
-
if (!u || u.rows.length === 0 || !m || !c || !p) return
|
|
200
|
+
return _e((s, a) => ({ locale: t, columns: r, skinTone: o, onEmojiSelect: e, data: null, search: "", interaction: "none", activeColumnIndex: 0, activeRowIndex: 0, rowHeight: null, categoryHeaderHeight: null, viewportWidth: null, viewportHeight: null, viewportCurrentCategoryIndex: null, viewportStartCategoryIndex: 0, viewportStartRowIndex: 0, viewportEndRowIndex: 0, rootRef: null, searchRef: null, viewportRef: null, listRef: null, updateViewportState: (i) => {
|
|
201
|
+
let g = a(), u = i?.data ?? g.data, m = i?.categoryHeaderHeight ?? g.categoryHeaderHeight, c = i?.rowHeight ?? g.rowHeight, p = i?.viewportHeight ?? g.viewportHeight;
|
|
202
|
+
if (!u || u.rows.length === 0 || !m || !c || !p) return s({ ...i, viewportStartCategoryIndex: 0, viewportStartRowIndex: 0, viewportEndRowIndex: 0 });
|
|
255
203
|
let f = 0, d = 0;
|
|
256
204
|
for (let I of u.categories) if (d++ * m + I.startRowIndex * c < n) f += m;
|
|
257
205
|
else break;
|
|
258
206
|
let j = u.categories.length * m + u.rows.length * c, w = Math.floor(ie * c / 2), k = Math.ceil(ie * c / 2), E = Math.min(n - f - w, j - p), R = E + p + k, v = Math.max(0, Math.floor(E / c)), b = Math.min(u.rows.length - 1, Math.ceil(R / c)), x = u.rows[v]?.categoryIndex;
|
|
259
|
-
return
|
|
207
|
+
return s(x === void 0 && i ? i : { ...i, viewportStartCategoryIndex: x, viewportStartRowIndex: v, viewportEndRowIndex: b });
|
|
260
208
|
}, onDataChange: (i) => {
|
|
261
|
-
|
|
209
|
+
a().updateViewportState({ data: i, activeColumnIndex: 0, activeRowIndex: 0 });
|
|
262
210
|
}, onSearchChange: (i) => {
|
|
263
|
-
|
|
211
|
+
s({ search: i, interaction: i ? "keyboard" : "none" });
|
|
264
212
|
}, onActiveEmojiChange: (i, g, u) => {
|
|
265
|
-
if (
|
|
266
|
-
let { listRef: m, viewportRef: c, rowHeight: p, viewportHeight: f, categoryHeaderHeight: d } =
|
|
213
|
+
if (s({ interaction: i, activeColumnIndex: g, activeRowIndex: u }), i !== "keyboard") return;
|
|
214
|
+
let { listRef: m, viewportRef: c, rowHeight: p, viewportHeight: f, categoryHeaderHeight: d } = a(), j = m?.current, w = c?.current;
|
|
267
215
|
if (!j || !w || !p || !d || !f) return;
|
|
268
216
|
let k = u;
|
|
269
217
|
k === 0 && w.scrollTo({ top: 0, behavior: "instant" });
|
|
@@ -274,79 +222,79 @@ function tt(e, t, r, o) {
|
|
|
274
222
|
let F = I + f - x;
|
|
275
223
|
(R < I || R + p > F) && w.scrollTo({ top: Math.max(R < I + d ? R - Math.max(d, b) : R - f + p + x, 0), behavior: "instant" });
|
|
276
224
|
}, onActiveEmojiReset: () => {
|
|
277
|
-
|
|
225
|
+
s({ interaction: "none", activeColumnIndex: 0, activeRowIndex: 0 });
|
|
278
226
|
}, onRowHeightChange: (i) => {
|
|
279
|
-
|
|
227
|
+
a().updateViewportState({ rowHeight: i });
|
|
280
228
|
}, onCategoryHeaderHeightChange: (i) => {
|
|
281
|
-
|
|
229
|
+
a().updateViewportState({ categoryHeaderHeight: i });
|
|
282
230
|
}, onViewportSizeChange: (i, g) => {
|
|
283
|
-
|
|
231
|
+
a().updateViewportState({ viewportWidth: i, viewportHeight: g });
|
|
284
232
|
}, onViewportScroll: (i) => {
|
|
285
|
-
n = i,
|
|
233
|
+
n = i, a().updateViewportState();
|
|
286
234
|
} }));
|
|
287
235
|
}
|
|
288
|
-
var { useStore: T, Provider:
|
|
289
|
-
function
|
|
236
|
+
var { useStore: T, Provider: Qe } = Ge("EmojiPicker.Root is missing.");
|
|
237
|
+
function Xe(e) {
|
|
290
238
|
return e.search;
|
|
291
239
|
}
|
|
292
|
-
function
|
|
240
|
+
function J(e) {
|
|
293
241
|
return e.interaction === "none" ? void 0 : e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex];
|
|
294
242
|
}
|
|
295
|
-
function
|
|
243
|
+
function Ze(e) {
|
|
296
244
|
return e.data === void 0 || typeof e.data?.count == "number" && e.data.count === 0;
|
|
297
245
|
}
|
|
298
|
-
function
|
|
246
|
+
function et(e) {
|
|
299
247
|
return e.data === null || e.viewportHeight === null || e.rowHeight === null || e.categoryHeaderHeight === null;
|
|
300
248
|
}
|
|
301
|
-
function
|
|
249
|
+
function we(e) {
|
|
302
250
|
return e.data?.rows.length;
|
|
303
251
|
}
|
|
304
|
-
function
|
|
252
|
+
function tt(e) {
|
|
305
253
|
return e.data?.categories.length;
|
|
306
254
|
}
|
|
307
|
-
function
|
|
255
|
+
function rt(e) {
|
|
308
256
|
return e.data?.categoriesStartRowIndices;
|
|
309
257
|
}
|
|
310
|
-
function
|
|
258
|
+
function ot(e) {
|
|
311
259
|
return e.data?.skinTones;
|
|
312
260
|
}
|
|
313
|
-
function
|
|
261
|
+
function pe(e, t) {
|
|
314
262
|
return e?.emoji === t?.emoji;
|
|
315
263
|
}
|
|
316
|
-
function
|
|
317
|
-
return e?.categoryIndex !== t?.categoryIndex || e?.emojis.length !== t?.emojis.length ? !1 : !!e?.emojis.every((r, o) =>
|
|
264
|
+
function nt(e, t) {
|
|
265
|
+
return e?.categoryIndex !== t?.categoryIndex || e?.emojis.length !== t?.emojis.length ? !1 : !!e?.emojis.every((r, o) => pe(r, t?.emojis[o]));
|
|
318
266
|
}
|
|
319
|
-
var
|
|
320
|
-
function
|
|
321
|
-
if (!e.split(
|
|
322
|
-
let r = e.split(
|
|
323
|
-
return t === "none" ? r : r.split(
|
|
324
|
-
let
|
|
325
|
-
return !ae.test(o) ||
|
|
326
|
-
}).join(
|
|
267
|
+
var z = "", ae = /\p{Emoji_Modifier_Base}/u, it = /\uFE0F$/, at = /\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu, st = { light: "🏻", "medium-light": "🏼", medium: "🏽", "medium-dark": "🏾", dark: "🏿" };
|
|
268
|
+
function lt(e, t) {
|
|
269
|
+
if (!e.split(z).some((o) => ae.test(o))) return e;
|
|
270
|
+
let r = e.split(z).map((o) => o.replace(at, "")).join(z);
|
|
271
|
+
return t === "none" ? r : r.split(z).map((o, n, s) => {
|
|
272
|
+
let a = s.length > 1;
|
|
273
|
+
return !ae.test(o) || a && o === "🤝" ? o : o.replace(it, "") + st[t];
|
|
274
|
+
}).join(z);
|
|
327
275
|
}
|
|
328
|
-
function
|
|
329
|
-
return q.map((t) => ({ skinTone: t, emoji:
|
|
276
|
+
function ut(e) {
|
|
277
|
+
return q.map((t) => ({ skinTone: t, emoji: lt(e, t) }));
|
|
330
278
|
}
|
|
331
|
-
function
|
|
332
|
-
let e = T(), t = P(e,
|
|
279
|
+
function ve() {
|
|
280
|
+
let e = T(), t = P(e, J, pe);
|
|
333
281
|
return l.useDeferredValue(t);
|
|
334
282
|
}
|
|
335
|
-
function
|
|
336
|
-
let t = T(), r =
|
|
337
|
-
t.set({ skinTone:
|
|
283
|
+
function ye(e = "✋") {
|
|
284
|
+
let t = T(), r = M(t, "skinTone"), o = l.useMemo(() => ut(e), [e]), n = l.useCallback((s) => {
|
|
285
|
+
t.set({ skinTone: s });
|
|
338
286
|
}, []);
|
|
339
287
|
return [r, n, o];
|
|
340
288
|
}
|
|
341
|
-
function
|
|
289
|
+
function _(e, t) {
|
|
342
290
|
if (Object.is(e, t)) return !0;
|
|
343
291
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null || Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
344
292
|
let r = Object.keys(e), o = Object.keys(t);
|
|
345
293
|
return r.length !== o.length ? !1 : r.every((n) => n in t && e[n] === t[n]);
|
|
346
294
|
}
|
|
347
|
-
function
|
|
295
|
+
function ct(...e) {
|
|
348
296
|
}
|
|
349
|
-
function
|
|
297
|
+
function dt(e, t) {
|
|
350
298
|
let r = null;
|
|
351
299
|
if (typeof window.requestIdleCallback == "function") r = window.requestIdleCallback(e, t);
|
|
352
300
|
else {
|
|
@@ -359,49 +307,49 @@ function wt(e, t) {
|
|
|
359
307
|
typeof window.cancelIdleCallback == "function" ? window.cancelIdleCallback(r) : window.clearTimeout(r);
|
|
360
308
|
};
|
|
361
309
|
}
|
|
362
|
-
var
|
|
363
|
-
function
|
|
310
|
+
var V = typeof window < "u" ? l.useLayoutEffect : l.useEffect;
|
|
311
|
+
function gt(e) {
|
|
364
312
|
let t = l.useRef(e);
|
|
365
|
-
return
|
|
313
|
+
return V(() => {
|
|
366
314
|
t.current = e;
|
|
367
315
|
}), l.useCallback((...r) => t.current(...r), []);
|
|
368
316
|
}
|
|
369
|
-
function
|
|
370
|
-
let [r, o] = l.useState(void 0), n = T(),
|
|
317
|
+
function ft({ emojiVersion: e, emojibaseUrl: t }) {
|
|
318
|
+
let [r, o] = l.useState(void 0), n = T(), s = M(n, "locale"), a = M(n, "columns"), i = M(n, "skinTone"), g = M(n, "search");
|
|
371
319
|
return l.useEffect(() => {
|
|
372
320
|
let u = new AbortController(), m = u.signal;
|
|
373
|
-
return
|
|
321
|
+
return Oe({ locale: s, emojiVersion: e, emojibaseUrl: t, signal: m }).then((c) => {
|
|
374
322
|
o(c);
|
|
375
323
|
}).catch((c) => {
|
|
376
324
|
m.aborted || console.error(c);
|
|
377
325
|
}), () => {
|
|
378
326
|
u.abort();
|
|
379
327
|
};
|
|
380
|
-
}, [e, t,
|
|
381
|
-
if (r) return
|
|
382
|
-
n.get().onDataChange(
|
|
328
|
+
}, [e, t, s]), l.useEffect(() => {
|
|
329
|
+
if (r) return dt(() => {
|
|
330
|
+
n.get().onDataChange(Je(r, a, i, g));
|
|
383
331
|
}, { timeout: 100 });
|
|
384
|
-
}, [r,
|
|
332
|
+
}, [r, a, i, g]), null;
|
|
385
333
|
}
|
|
386
|
-
var
|
|
387
|
-
let p =
|
|
334
|
+
var je = l.forwardRef(({ locale: e = "en", columns: t = 9, skinTone: r = "none", onEmojiSelect: o = ct, emojiVersion: n, emojibaseUrl: s, onFocusCapture: a, onBlurCapture: i, children: g, style: u, ...m }, c) => {
|
|
335
|
+
let p = gt(o), f = Ke(() => Ye(p, oe(e), t, ne(r))), [d, j] = l.useState(!1), w = l.useRef(null), k = l.useCallback((v) => {
|
|
388
336
|
v && (w.current = v, f.set({ rootRef: w }));
|
|
389
337
|
}, []);
|
|
390
|
-
|
|
338
|
+
V(() => {
|
|
391
339
|
f.set({ locale: oe(e) });
|
|
392
|
-
}, [e]),
|
|
340
|
+
}, [e]), V(() => {
|
|
393
341
|
f.set({ columns: t });
|
|
394
|
-
}, [t]),
|
|
342
|
+
}, [t]), V(() => {
|
|
395
343
|
f.set({ skinTone: ne(r) });
|
|
396
344
|
}, [r]);
|
|
397
345
|
let E = l.useCallback((v) => {
|
|
398
|
-
|
|
346
|
+
a?.(v);
|
|
399
347
|
let { searchRef: b, viewportRef: x } = f.get(), I = v.target === b?.current || v.target.hasAttribute("frimousse-search"), F = v.target === x?.current || v.target.hasAttribute("frimousse-viewport");
|
|
400
348
|
v.isDefaultPrevented() || (j(I || F), v.isDefaultPrevented() || (j(I || F), F ? f.get().onActiveEmojiChange("keyboard", 0, 0) : I && f.get().search === "" && f.set({ interaction: "none" })));
|
|
401
|
-
}, [
|
|
349
|
+
}, [a]), R = l.useCallback((v) => {
|
|
402
350
|
i?.(v), !v.isDefaultPrevented() && !v.currentTarget.contains(v.relatedTarget) && j(!1);
|
|
403
351
|
}, [i]);
|
|
404
|
-
return
|
|
352
|
+
return V(() => {
|
|
405
353
|
d || f.get().onActiveEmojiReset();
|
|
406
354
|
}, [d]), l.useImperativeHandle(c, () => w.current), l.useEffect(() => {
|
|
407
355
|
if (!d) return;
|
|
@@ -409,7 +357,7 @@ var be = l.forwardRef(({ locale: e = "en", columns: t = 9, skinTone: r = "none",
|
|
|
409
357
|
if (b.defaultPrevented || !b.key.startsWith("Arrow") && b.key !== "Enter") return;
|
|
410
358
|
let { data: x, onEmojiSelect: I, onActiveEmojiChange: F, interaction: N, activeColumnIndex: L, activeRowIndex: U } = f.get();
|
|
411
359
|
if (b.key === "Enter") {
|
|
412
|
-
let C =
|
|
360
|
+
let C = J(f.get());
|
|
413
361
|
C && (b.preventDefault(), I(C));
|
|
414
362
|
}
|
|
415
363
|
if (b.key.startsWith("Arrow")) {
|
|
@@ -448,57 +396,57 @@ var be = l.forwardRef(({ locale: e = "en", columns: t = 9, skinTone: r = "none",
|
|
|
448
396
|
return document.addEventListener("keydown", v), () => {
|
|
449
397
|
document.removeEventListener("keydown", v);
|
|
450
398
|
};
|
|
451
|
-
}, [d]),
|
|
399
|
+
}, [d]), V(() => {
|
|
452
400
|
let v = null, b = null, x = null, I = null, F = f.subscribe((y) => {
|
|
453
401
|
w.current && (v !== y.viewportWidth && (v = y.viewportWidth, w.current.style.setProperty("--frimousse-viewport-width", `${y.viewportWidth}px`)), b !== y.viewportHeight && (b = y.viewportHeight, w.current.style.setProperty("--frimousse-viewport-height", `${y.viewportHeight}px`)), x !== y.rowHeight && (x = y.rowHeight, w.current.style.setProperty("--frimousse-row-height", `${y.rowHeight}px`)), I !== y.categoryHeaderHeight && (I = y.categoryHeaderHeight, w.current.style.setProperty("--frimousse-category-header-height", `${y.categoryHeaderHeight}px`)));
|
|
454
402
|
}), { viewportWidth: N, viewportHeight: L, rowHeight: U, categoryHeaderHeight: C } = f.get();
|
|
455
403
|
return N && w.current.style.setProperty("--frimousse-viewport-width", `${N}px`), L && w.current.style.setProperty("--frimousse-viewport-height", `${L}px`), U && w.current.style.setProperty("--frimousse-row-height", `${U}px`), C && w.current.style.setProperty("--frimousse-category-header-height", `${C}px`), F;
|
|
456
|
-
}, []), h.jsx("div", { "data-focused": d ? "" : void 0, "frimousse-root": "", onBlurCapture: R, onFocusCapture: E, ...m, ref: k, style: { "--frimousse-emoji-font":
|
|
457
|
-
}),
|
|
458
|
-
let
|
|
459
|
-
c && (
|
|
404
|
+
}, []), h.jsx("div", { "data-focused": d ? "" : void 0, "frimousse-root": "", onBlurCapture: R, onFocusCapture: E, ...m, ref: k, style: { "--frimousse-emoji-font": ce, ...u }, children: h.jsxs(Qe, { store: f, children: [h.jsx(ft, { emojiVersion: n, emojibaseUrl: s }), g] }) });
|
|
405
|
+
}), be = l.forwardRef(({ value: e, defaultValue: t, onChange: r, ...o }, n) => {
|
|
406
|
+
let s = T(), a = l.useRef(null), i = l.useCallback((c) => {
|
|
407
|
+
c && (a.current = c, s.set({ searchRef: a }));
|
|
460
408
|
}, []), g = typeof e == "string", u = l.useRef(g);
|
|
461
409
|
l.useEffect(() => {
|
|
462
410
|
u.current = g;
|
|
463
|
-
}, [g]),
|
|
464
|
-
|
|
465
|
-
}, []),
|
|
466
|
-
typeof e == "string" &&
|
|
411
|
+
}, [g]), V(() => {
|
|
412
|
+
s.set({ search: typeof e == "string" ? e : typeof t == "string" ? t : "" });
|
|
413
|
+
}, []), V(() => {
|
|
414
|
+
typeof e == "string" && s.get().onSearchChange(e);
|
|
467
415
|
}, [e]);
|
|
468
416
|
let m = l.useCallback((c) => {
|
|
469
|
-
r?.(c), c.isDefaultPrevented() ||
|
|
417
|
+
r?.(c), c.isDefaultPrevented() || s.get().onSearchChange(c.target.value);
|
|
470
418
|
}, [r]);
|
|
471
|
-
return l.useImperativeHandle(n, () =>
|
|
472
|
-
}),
|
|
473
|
-
let e =
|
|
419
|
+
return l.useImperativeHandle(n, () => a.current), h.jsx("input", { autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", enterKeyHint: "done", "frimousse-search": "", placeholder: "Search…", spellCheck: !1, type: "search", ...o, defaultValue: t, onChange: m, ref: i, value: e });
|
|
420
|
+
}), mt = l.memo(() => {
|
|
421
|
+
let e = ve();
|
|
474
422
|
return e ? h.jsx("div", { "aria-live": "polite", style: { border: 0, clip: "rect(0, 0, 0, 0)", height: 1, margin: -1, overflow: "hidden", padding: 0, position: "absolute", whiteSpace: "nowrap", width: 1, wordWrap: "normal" }, children: e.label }) : null;
|
|
475
|
-
}),
|
|
476
|
-
let
|
|
477
|
-
p && (i.current = p,
|
|
478
|
-
}, []), u = P(
|
|
479
|
-
t?.(p),
|
|
423
|
+
}), xe = l.forwardRef(({ children: e, onScroll: t, onKeyDown: r, style: o, ...n }, s) => {
|
|
424
|
+
let a = T(), i = l.useRef(null), g = l.useCallback((p) => {
|
|
425
|
+
p && (i.current = p, a.set({ viewportRef: i }));
|
|
426
|
+
}, []), u = P(a, we), m = P(a, tt), c = l.useCallback((p) => {
|
|
427
|
+
t?.(p), a.get().onViewportScroll(p.currentTarget.scrollTop);
|
|
480
428
|
}, [t]);
|
|
481
|
-
return
|
|
429
|
+
return V(() => {
|
|
482
430
|
if (!i.current) return;
|
|
483
431
|
let p = new ResizeObserver(([f]) => {
|
|
484
|
-
let d = f?.borderBoxSize[0]?.inlineSize ?? 0, j = f?.borderBoxSize[0]?.blockSize ?? 0, { onViewportSizeChange: w, viewportHeight: k, viewportWidth: E } =
|
|
432
|
+
let d = f?.borderBoxSize[0]?.inlineSize ?? 0, j = f?.borderBoxSize[0]?.blockSize ?? 0, { onViewportSizeChange: w, viewportHeight: k, viewportWidth: E } = a.get();
|
|
485
433
|
(k !== j || E !== d) && w(d, j);
|
|
486
434
|
});
|
|
487
|
-
return p.observe(i.current),
|
|
435
|
+
return p.observe(i.current), a.get().onViewportSizeChange(i.current.offsetWidth, i.current.clientHeight), () => {
|
|
488
436
|
p.disconnect();
|
|
489
437
|
};
|
|
490
|
-
}, []), l.useImperativeHandle(
|
|
438
|
+
}, []), l.useImperativeHandle(s, () => i.current), h.jsxs("div", { "frimousse-viewport": "", ...n, onScroll: c, ref: g, style: { position: "relative", boxSizing: "border-box", contain: "layout paint", containIntrinsicSize: typeof u == "number" && typeof m == "number" ? `var(--frimousse-viewport-width, auto) calc(${u} * var(--frimousse-row-height) + ${m} * var(--frimousse-category-header-height))` : void 0, overflowY: "auto", overscrollBehavior: "contain", scrollbarGutter: "stable", willChange: "scroll-position", ...o }, children: [h.jsx(mt, {}), e] });
|
|
491
439
|
});
|
|
492
|
-
function
|
|
440
|
+
function ke(e, t, r) {
|
|
493
441
|
return { emoji: { ...e, isActive: r }, role: "gridcell", "aria-colindex": t, "aria-selected": r || void 0, "aria-label": e.label, "data-active": r ? "" : void 0, "frimousse-emoji": "", style: { fontFamily: "var(--frimousse-emoji-font)" }, tabIndex: -1 };
|
|
494
442
|
}
|
|
495
|
-
function
|
|
443
|
+
function Ee(e, t = !1) {
|
|
496
444
|
return { role: t ? void 0 : "row", "aria-rowindex": t ? void 0 : e, "frimousse-row": "", style: { contain: t ? void 0 : "content", height: t ? void 0 : "var(--frimousse-row-height)", display: "flex" } };
|
|
497
445
|
}
|
|
498
|
-
function
|
|
446
|
+
function Ce(e, t) {
|
|
499
447
|
return { "frimousse-category": "", style: { contain: "content", top: t ? `calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))` : void 0, height: t ? `calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))` : void 0, width: "100%", pointerEvents: "none", position: "absolute" } };
|
|
500
448
|
}
|
|
501
|
-
function
|
|
449
|
+
function Se(e, t = !1) {
|
|
502
450
|
return { category: e, "frimousse-category-header": "", style: { contain: t ? void 0 : "layout paint", height: t ? void 0 : "var(--frimousse-category-header-height)", pointerEvents: "auto", position: "sticky", top: 0 } };
|
|
503
451
|
}
|
|
504
452
|
function se(e, t, r, o) {
|
|
@@ -507,27 +455,27 @@ function se(e, t, r, o) {
|
|
|
507
455
|
function le(e, t, r) {
|
|
508
456
|
return { "aria-colcount": e, "aria-rowcount": t, "frimousse-list": "", style: { "--frimousse-list-columns": e, ...r }, role: "grid" };
|
|
509
457
|
}
|
|
510
|
-
function
|
|
458
|
+
function ht(e) {
|
|
511
459
|
e.preventDefault();
|
|
512
460
|
}
|
|
513
|
-
var
|
|
514
|
-
let n = T(),
|
|
461
|
+
var wt = l.memo(({ Emoji: e, emoji: t, columnIndex: r, rowIndex: o }) => {
|
|
462
|
+
let n = T(), s = P(n, (u) => J(u)?.emoji === t.emoji), a = l.useCallback(() => {
|
|
515
463
|
n.get().onEmojiSelect(t);
|
|
516
464
|
}, [t]), i = l.useCallback(() => {
|
|
517
465
|
n.get().onActiveEmojiChange("pointer", r, o);
|
|
518
466
|
}, [r, o]), g = l.useCallback(() => {
|
|
519
467
|
n.get().onActiveEmojiReset();
|
|
520
468
|
}, []);
|
|
521
|
-
return h.jsx(e, { ...
|
|
522
|
-
}),
|
|
523
|
-
let o = T(), n = P(o, (
|
|
524
|
-
return n ? h.jsx(e, { ...
|
|
525
|
-
}),
|
|
526
|
-
let r = T(), o = P(r, (n) => n.data?.categories[t],
|
|
527
|
-
return o ? h.jsx("div", { ...
|
|
469
|
+
return h.jsx(e, { ...ke(t, r, s), onClick: a, onPointerDown: ht, onPointerEnter: i, onPointerLeave: g });
|
|
470
|
+
}), pt = l.memo(({ Row: e, Emoji: t, rowIndex: r }) => {
|
|
471
|
+
let o = T(), n = P(o, (s) => s.data?.rows[r], nt);
|
|
472
|
+
return n ? h.jsx(e, { ...Ee(r), children: n.emojis.map((s, a) => h.jsx(wt, { Emoji: t, columnIndex: a, emoji: s, rowIndex: r }, s.label)) }) : null;
|
|
473
|
+
}), vt = l.memo(({ CategoryHeader: e, categoryIndex: t }) => {
|
|
474
|
+
let r = T(), o = P(r, (n) => n.data?.categories[t], _);
|
|
475
|
+
return o ? h.jsx("div", { ...Ce(t, o), children: h.jsx(e, { ...Se({ label: o.label }) }) }) : null;
|
|
528
476
|
}), ue = l.memo(({ CategoryHeader: e, Row: t, Emoji: r }) => {
|
|
529
|
-
let o = l.useRef(null), n = T(),
|
|
530
|
-
return
|
|
477
|
+
let o = l.useRef(null), n = T(), s = M(n, "columns"), a = l.useMemo(() => Array(s).fill({ emoji: "🙂", label: "" }), [s]), i = l.useMemo(() => ({ label: "Category" }), []), g = l.useRef(null), u = l.useRef(null);
|
|
478
|
+
return V(() => {
|
|
531
479
|
let m = o.current?.parentElement?.parentElement;
|
|
532
480
|
if (!m || !g.current || !u.current) return;
|
|
533
481
|
let c = new ResizeObserver((d) => {
|
|
@@ -541,80 +489,77 @@ var bt = l.memo(({ Emoji: e, emoji: t, columnIndex: r, rowIndex: o }) => {
|
|
|
541
489
|
return p(g.current.clientHeight), f(u.current.clientHeight), () => {
|
|
542
490
|
c.disconnect();
|
|
543
491
|
};
|
|
544
|
-
}, []), h.jsxs("div", { "aria-hidden": !0, ref: o, style: { height: 0, visibility: "hidden" }, children: [h.jsx("div", { "frimousse-row-sizer": "", ref: g, children: h.jsx(t, { ...
|
|
492
|
+
}, []), h.jsxs("div", { "aria-hidden": !0, ref: o, style: { height: 0, visibility: "hidden" }, children: [h.jsx("div", { "frimousse-row-sizer": "", ref: g, children: h.jsx(t, { ...Ee(-1, !0), children: a.map((m, c) => h.jsx(r, { ...ke(m, c, !1) }, c)) }) }), h.jsx("div", { ...Ce(-1), children: h.jsx("div", { "frimousse-category-header-sizer": "", ref: u, children: h.jsx(e, { ...Se(i, !0) }) }) })] });
|
|
545
493
|
});
|
|
546
|
-
function
|
|
494
|
+
function yt({ category: e, ...t }) {
|
|
547
495
|
return h.jsx("div", { ...t, children: e.label });
|
|
548
496
|
}
|
|
549
|
-
function
|
|
497
|
+
function jt({ emoji: e, ...t }) {
|
|
550
498
|
return h.jsx("button", { type: "button", ...t, children: e.emoji });
|
|
551
499
|
}
|
|
552
|
-
function
|
|
500
|
+
function bt({ ...e }) {
|
|
553
501
|
return h.jsx("div", { ...e });
|
|
554
502
|
}
|
|
555
|
-
var
|
|
556
|
-
let n = T(),
|
|
557
|
-
k && (
|
|
558
|
-
}, []), i = t?.CategoryHeader ??
|
|
559
|
-
return l.useImperativeHandle(o, () =>
|
|
503
|
+
var Re = l.forwardRef(({ style: e, components: t, ...r }, o) => {
|
|
504
|
+
let n = T(), s = l.useRef(null), a = l.useCallback((k) => {
|
|
505
|
+
k && (s.current = k, n.set({ listRef: s }));
|
|
506
|
+
}, []), i = t?.CategoryHeader ?? yt, g = t?.Emoji ?? jt, u = t?.Row ?? bt, m = M(n, "columns"), c = M(n, "viewportStartRowIndex"), p = M(n, "viewportEndRowIndex"), f = P(n, we), d = P(n, rt, _), j = l.useMemo(() => d?.filter((k) => k < c).length ?? 0, [d, c]), w = d?.length ?? 0;
|
|
507
|
+
return l.useImperativeHandle(o, () => s.current), !f || !d || w === 0 ? h.jsx("div", { ...le(m, 0, e), ...r, children: h.jsx("div", { ...se(0, 0, 0, 0), children: h.jsx(ue, { CategoryHeader: i, Emoji: g, Row: u }) }) }) : h.jsx("div", { ...le(m, f, e), ...r, ref: a, children: h.jsxs("div", { ...se(f, w, c, j), children: [h.jsx(ue, { CategoryHeader: i, Emoji: g, Row: u }), Array.from({ length: p - c + 1 }, (k, E) => {
|
|
560
508
|
let R = c + E, v = d.indexOf(R);
|
|
561
|
-
return h.jsxs(l.Fragment, { children: [v >= 0 && h.jsx("div", { style: { height: "var(--frimousse-category-header-height)" } }), h.jsx(
|
|
562
|
-
}), Array.from({ length: w }, (k, E) => h.jsx(
|
|
563
|
-
}),
|
|
564
|
-
let
|
|
509
|
+
return h.jsxs(l.Fragment, { children: [v >= 0 && h.jsx("div", { style: { height: "var(--frimousse-category-header-height)" } }), h.jsx(pt, { Emoji: g, Row: u, rowIndex: R })] }, R);
|
|
510
|
+
}), Array.from({ length: w }, (k, E) => h.jsx(vt, { CategoryHeader: i, categoryIndex: E }, E))] }) });
|
|
511
|
+
}), He = l.forwardRef(({ emoji: e, onClick: t, "aria-label": r = "Change skin tone", ...o }, n) => {
|
|
512
|
+
let s = T(), a = P(s, ot, _), [i, g, u] = ye(e), m = l.useMemo(() => Math.max(0, u.findIndex((w) => w.skinTone === i)), [i, u]), c = u[m], p = u[(m + 1) % u.length].skinTone, f = i === "none" ? void 0 : a?.[i], d = p === "none" ? void 0 : a?.[p], j = l.useCallback((w) => {
|
|
565
513
|
t?.(w), w.isDefaultPrevented() || g(p);
|
|
566
514
|
}, [t, g, p]);
|
|
567
515
|
return h.jsx("button", { type: "button", ...o, "aria-label": r + (d ? ` (${d})` : ""), "aria-live": "polite", "aria-valuetext": f, "frimousse-skin-tone-selector": "", onClick: j, ref: n, children: c.emoji });
|
|
568
516
|
});
|
|
569
|
-
function
|
|
517
|
+
function Ie({ children: e, ...t }) {
|
|
570
518
|
let r = T();
|
|
571
|
-
return P(r,
|
|
519
|
+
return P(r, et) ? h.jsx("span", { "frimousse-loading": "", ...t, children: e }) : null;
|
|
572
520
|
}
|
|
573
|
-
function
|
|
574
|
-
let t = T(), r = P(t,
|
|
521
|
+
function xt({ children: e }) {
|
|
522
|
+
let t = T(), r = P(t, Xe);
|
|
575
523
|
return e({ search: r });
|
|
576
524
|
}
|
|
577
|
-
function
|
|
525
|
+
function Te({ children: e, ...t }) {
|
|
578
526
|
let r = T();
|
|
579
|
-
return P(r,
|
|
527
|
+
return P(r, Ze) ? h.jsx("span", { "frimousse-empty": "", ...t, children: typeof e == "function" ? h.jsx(xt, { children: e }) : e }) : null;
|
|
580
528
|
}
|
|
581
|
-
function
|
|
582
|
-
let t =
|
|
529
|
+
function Ae({ children: e }) {
|
|
530
|
+
let t = ve();
|
|
583
531
|
return e({ emoji: t });
|
|
584
532
|
}
|
|
585
|
-
function
|
|
586
|
-
let [r, o, n] =
|
|
533
|
+
function Pe({ children: e, emoji: t }) {
|
|
534
|
+
let [r, o, n] = ye(t);
|
|
587
535
|
return e({ skinTone: r, setSkinTone: o, skinToneVariations: n });
|
|
588
536
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
function
|
|
537
|
+
je.displayName = "EmojiPicker.Root";
|
|
538
|
+
be.displayName = "EmojiPicker.Search";
|
|
539
|
+
xe.displayName = "EmojiPicker.Viewport";
|
|
540
|
+
Re.displayName = "EmojiPicker.List";
|
|
541
|
+
Ie.displayName = "EmojiPicker.Loading";
|
|
542
|
+
Te.displayName = "EmojiPicker.Empty";
|
|
543
|
+
He.displayName = "EmojiPicker.SkinToneSelector";
|
|
544
|
+
Ae.displayName = "EmojiPicker.ActiveEmoji";
|
|
545
|
+
Pe.displayName = "EmojiPicker.SkinTone";
|
|
546
|
+
function Et(e) {
|
|
599
547
|
return e.split("/").map((t) => t.trim()).filter(Boolean);
|
|
600
548
|
}
|
|
601
|
-
function
|
|
549
|
+
function Ct(e) {
|
|
602
550
|
try {
|
|
603
551
|
return decodeURIComponent(e);
|
|
604
552
|
} catch {
|
|
605
553
|
return e;
|
|
606
554
|
}
|
|
607
555
|
}
|
|
608
|
-
function
|
|
556
|
+
function St(e) {
|
|
609
557
|
return encodeURIComponent(String(e));
|
|
610
558
|
}
|
|
611
559
|
export {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
$t as d,
|
|
618
|
-
Ft as e,
|
|
619
|
-
Pt as s
|
|
560
|
+
ye as Q,
|
|
561
|
+
Ve as a,
|
|
562
|
+
Ct as d,
|
|
563
|
+
St as e,
|
|
564
|
+
Et as s
|
|
620
565
|
};
|