@layers-app/shared 0.3.5 → 0.3.6
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/components/ColorPicker/ColorPicker.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +63 -62
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +88 -71
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +12 -13
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +1 -0
- package/dist/components/EmojiPicker/IconsPanel.js +13 -13
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +36 -35
- package/dist/constants.js +1 -1
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +77 -129
- package/dist/helpers/showNotifications.module.css.js +12 -26
- package/dist/index.css +1 -1
- package/dist/lang/locales/ui_en.json.js +5 -5
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +5 -5
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { ColorPickerList } from './ColorPickerList';
|
|
|
3
3
|
import type { ColorItem } from './types';
|
|
4
4
|
interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof Omit<ColorSwatchProps, 'color'>> {
|
|
5
5
|
value?: string | null;
|
|
6
|
+
label?: string;
|
|
6
7
|
isActive?: boolean;
|
|
7
8
|
swatchShape?: 'circle' | 'square';
|
|
8
9
|
swatchVariant?: 'filled' | 'outline';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,gBAAgB,EAEhB,SAAS,EAKV,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,gBAAgB,EAEhB,SAAS,EAKV,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAiHzC,UAAU,gBACR,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,EACrC,IAAI,CACF,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,MAAM,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CACtC;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,6GAmDvB,CAAC;AASF,eAAO,MAAM,WAAW;YAzLd,MAAM,GAAG,IAAI;eACV,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;uBACX,OAAO;aACjB,SAAS,EAAE;kBACN,QAAQ,GAAG,QAAQ;oBACjB,QAAQ,GAAG,SAAS;eACzB,OAAO;gBACN,OAAO;iBACN,MAAM;;;;;CAqLnB,CAAC"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Tick02Icon as
|
|
4
|
-
import { HugeiconsIcon as
|
|
5
|
-
import { useMantineTheme as
|
|
6
|
-
import { IconPalette as
|
|
7
|
-
import
|
|
8
|
-
import { DEFAULT_VALUES as
|
|
9
|
-
import { ColorPickerToolbar as
|
|
10
|
-
import { ColorPickerList as
|
|
11
|
-
import { normalizeColorItem as
|
|
12
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, useState as x } from "react";
|
|
3
|
+
import { Tick02Icon as j } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as A } from "@hugeicons/react";
|
|
5
|
+
import { useMantineTheme as w, getThemeColor as E, Flex as C, Tooltip as R, ColorSwatch as D, parseThemeColor as F, ColorInput as H, ActionIcon as v } from "@mantine/core";
|
|
6
|
+
import { IconPalette as M, IconPencil as U } from "@tabler/icons-react";
|
|
7
|
+
import V from "styled-components";
|
|
8
|
+
import { DEFAULT_VALUES as g } from "../../constants.js";
|
|
9
|
+
import { ColorPickerToolbar as q } from "./ColorPickerToolbar.js";
|
|
10
|
+
import { ColorPickerList as _ } from "./ColorPickerList.js";
|
|
11
|
+
import { normalizeColorItem as B } from "./types.js";
|
|
12
|
+
const G = y(
|
|
13
13
|
({
|
|
14
14
|
value: o,
|
|
15
|
-
onChange:
|
|
15
|
+
onChange: l,
|
|
16
16
|
allowCustomColor: n,
|
|
17
|
-
colors:
|
|
17
|
+
colors: s,
|
|
18
18
|
swatchShape: a = "circle",
|
|
19
19
|
swatchVariant: m = "filled",
|
|
20
20
|
withTick: d = !1,
|
|
21
|
-
fullWidth:
|
|
22
|
-
swatchSize:
|
|
21
|
+
fullWidth: p = !1,
|
|
22
|
+
swatchSize: i = 30,
|
|
23
23
|
...u
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
color: o ||
|
|
27
|
-
theme:
|
|
28
|
-
}), [z, I] =
|
|
29
|
-
return O ? /* @__PURE__ */
|
|
24
|
+
}, f) => {
|
|
25
|
+
const r = w(), t = F({
|
|
26
|
+
color: o || g.COLORS[0],
|
|
27
|
+
theme: r
|
|
28
|
+
}), [z, I] = x(t.value), [O, b] = x(!1);
|
|
29
|
+
return O ? /* @__PURE__ */ h(C, { align: "center", mih: 30, children: [
|
|
30
30
|
/* @__PURE__ */ e(
|
|
31
|
-
|
|
31
|
+
H,
|
|
32
32
|
{
|
|
33
33
|
w: "100%",
|
|
34
34
|
popoverProps: {
|
|
@@ -40,54 +40,55 @@ const B = g(
|
|
|
40
40
|
size: "xs",
|
|
41
41
|
value: z,
|
|
42
42
|
onChange: I,
|
|
43
|
-
onChangeEnd:
|
|
43
|
+
onChangeEnd: l,
|
|
44
44
|
placeholder: "Select custom color"
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
47
|
/* @__PURE__ */ e(
|
|
48
|
-
|
|
48
|
+
v,
|
|
49
49
|
{
|
|
50
50
|
radius: "xl",
|
|
51
51
|
variant: "default",
|
|
52
52
|
color: "gray",
|
|
53
|
-
onClick: () =>
|
|
54
|
-
children: /* @__PURE__ */ e(
|
|
53
|
+
onClick: () => b(!1),
|
|
54
|
+
children: /* @__PURE__ */ e(M, { size: 16 })
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
|
-
] }, 1) : /* @__PURE__ */
|
|
58
|
-
|
|
57
|
+
] }, 1) : /* @__PURE__ */ h(
|
|
58
|
+
C,
|
|
59
59
|
{
|
|
60
|
-
ref:
|
|
60
|
+
ref: f,
|
|
61
61
|
...u,
|
|
62
|
-
justify:
|
|
62
|
+
justify: p ? "space-between" : "flex-start",
|
|
63
63
|
align: "center",
|
|
64
64
|
children: [
|
|
65
|
-
(
|
|
66
|
-
const { value:
|
|
65
|
+
(s || g.COLORS).map((P, S) => {
|
|
66
|
+
const { value: c, border: T, bg: L, label: $ } = B(P);
|
|
67
67
|
return /* @__PURE__ */ e(
|
|
68
|
-
|
|
68
|
+
J,
|
|
69
69
|
{
|
|
70
|
-
value:
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
value: c,
|
|
71
|
+
label: $,
|
|
72
|
+
isActive: c === o,
|
|
73
|
+
size: i - 4,
|
|
73
74
|
swatchShape: a,
|
|
74
75
|
swatchVariant: m,
|
|
75
76
|
withTick: d,
|
|
76
77
|
borderColor: T,
|
|
77
78
|
bgColor: L,
|
|
78
|
-
onClick: () =>
|
|
79
|
+
onClick: () => l?.(c)
|
|
79
80
|
},
|
|
80
|
-
|
|
81
|
+
c || S
|
|
81
82
|
);
|
|
82
83
|
}),
|
|
83
84
|
n && /* @__PURE__ */ e(
|
|
84
|
-
|
|
85
|
+
v,
|
|
85
86
|
{
|
|
86
87
|
radius: "xl",
|
|
87
88
|
variant: "default",
|
|
88
89
|
color: "gray",
|
|
89
|
-
onClick: () =>
|
|
90
|
-
children: /* @__PURE__ */ e(
|
|
90
|
+
onClick: () => b(!0),
|
|
91
|
+
children: /* @__PURE__ */ e(U, { size: 16 })
|
|
91
92
|
}
|
|
92
93
|
)
|
|
93
94
|
]
|
|
@@ -95,15 +96,15 @@ const B = g(
|
|
|
95
96
|
2
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
|
-
),
|
|
99
|
-
({ value: o, isActive:
|
|
100
|
-
const
|
|
101
|
-
return /* @__PURE__ */ e(
|
|
102
|
-
|
|
99
|
+
), k = y(
|
|
100
|
+
({ value: o, label: l, isActive: n, swatchShape: s, swatchVariant: a = "filled", withTick: m, borderColor: d, bgColor: p, ...i }, u) => {
|
|
101
|
+
const f = w(), r = o ? E(o, f) : "", t = a === "outline";
|
|
102
|
+
return /* @__PURE__ */ e(C, { w: i.size || 24, h: i.size || 24, justify: "center", align: "center", style: { position: "relative" }, children: /* @__PURE__ */ e(R, { label: l || o || "", withArrow: !0, children: /* @__PURE__ */ h(
|
|
103
|
+
D,
|
|
103
104
|
{
|
|
104
|
-
ref:
|
|
105
|
+
ref: u,
|
|
105
106
|
color: t ? "transparent" : r,
|
|
106
|
-
radius:
|
|
107
|
+
radius: s === "circle" ? "xl" : "sm",
|
|
107
108
|
styles: t ? {
|
|
108
109
|
alphaOverlay: { display: "none" },
|
|
109
110
|
shadowOverlay: { display: "none" }
|
|
@@ -111,12 +112,12 @@ const B = g(
|
|
|
111
112
|
style: {
|
|
112
113
|
cursor: "pointer",
|
|
113
114
|
color: "var(--mantine-color-white)",
|
|
114
|
-
background: t ?
|
|
115
|
-
border: t ? `2px solid ${
|
|
115
|
+
background: t ? p || `var(--mantine-color-${o}-light, ${r}20)` : void 0,
|
|
116
|
+
border: t ? `2px solid ${d || `var(--mantine-color-${o}-outline, ${r})`}` : void 0
|
|
116
117
|
},
|
|
117
|
-
...
|
|
118
|
+
...i,
|
|
118
119
|
children: [
|
|
119
|
-
|
|
120
|
+
n && /* @__PURE__ */ e(
|
|
120
121
|
"span",
|
|
121
122
|
{
|
|
122
123
|
style: {
|
|
@@ -126,27 +127,27 @@ const B = g(
|
|
|
126
127
|
right: -4,
|
|
127
128
|
bottom: -4,
|
|
128
129
|
border: `2px solid ${r}`,
|
|
129
|
-
borderRadius:
|
|
130
|
+
borderRadius: s === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
|
|
130
131
|
pointerEvents: "none",
|
|
131
132
|
boxSizing: "border-box"
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
),
|
|
135
|
-
|
|
136
|
+
m && n && /* @__PURE__ */ e(A, { size: 20, icon: j })
|
|
136
137
|
]
|
|
137
138
|
}
|
|
138
139
|
) }) });
|
|
139
140
|
}
|
|
140
|
-
),
|
|
141
|
+
), J = V(k)`
|
|
141
142
|
.mantine-ColorSwatch-colorOverlay {
|
|
142
143
|
border-radius: ${({ swatchShape: o }) => o === "square" ? "3px" : "50%"};
|
|
143
144
|
}
|
|
144
|
-
`,
|
|
145
|
-
ColorCircle:
|
|
146
|
-
List:
|
|
147
|
-
Toolbar:
|
|
145
|
+
`, lo = Object.assign(G, {
|
|
146
|
+
ColorCircle: k,
|
|
147
|
+
List: _,
|
|
148
|
+
Toolbar: q
|
|
148
149
|
});
|
|
149
150
|
export {
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
k as ColorCircle,
|
|
152
|
+
lo as ColorPicker
|
|
152
153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMjE;6DAC6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMjE;6DAC6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAsCD,eAAO,MAAM,kBAAkB,oHA2K7B,CAAC"}
|
|
@@ -1,121 +1,138 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useMantineColorScheme as
|
|
4
|
-
import { TextColorIcon as
|
|
5
|
-
import {
|
|
6
|
-
import { useRecentColors as
|
|
7
|
-
import
|
|
1
|
+
import { jsxs as S, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useState as H, useCallback as w, useMemo as I } from "react";
|
|
3
|
+
import { useMantineColorScheme as j, Box as h, Flex as B, Tooltip as P, UnstyledButton as U } from "@mantine/core";
|
|
4
|
+
import { TextColorIcon as K, HighlightSwatch as D } from "./icons.js";
|
|
5
|
+
import { normalizeColorItem as $, isDefaultColor as q } from "./types.js";
|
|
6
|
+
import { useRecentColors as E } from "./useRecentColors.js";
|
|
7
|
+
import c from "./ColorPicker.module.css.js";
|
|
8
8
|
function k({
|
|
9
|
-
isActive:
|
|
9
|
+
isActive: s,
|
|
10
10
|
round: m,
|
|
11
|
-
disabled:
|
|
12
|
-
onClick:
|
|
13
|
-
children:
|
|
11
|
+
disabled: u,
|
|
12
|
+
onClick: d,
|
|
13
|
+
children: i,
|
|
14
|
+
tooltipLabel: f
|
|
14
15
|
}) {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const v = /* @__PURE__ */ r(
|
|
17
|
+
U,
|
|
17
18
|
{
|
|
18
19
|
type: "button",
|
|
19
|
-
className: `${
|
|
20
|
-
onMouseDown: (
|
|
21
|
-
onClick:
|
|
22
|
-
disabled:
|
|
23
|
-
children:
|
|
20
|
+
className: `${c.inlineSwatch}${m ? ` ${c.inlineSwatchRound}` : ""}${s ? ` ${c.inlineSwatchActive}` : ""}`,
|
|
21
|
+
onMouseDown: (C) => C.preventDefault(),
|
|
22
|
+
onClick: d,
|
|
23
|
+
disabled: u,
|
|
24
|
+
children: i
|
|
24
25
|
}
|
|
25
26
|
);
|
|
27
|
+
return f ? /* @__PURE__ */ r(P, { label: f, withArrow: !0, children: v }) : v;
|
|
26
28
|
}
|
|
27
|
-
const
|
|
28
|
-
const { colorScheme:
|
|
29
|
-
(e,
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
(
|
|
29
|
+
const Y = z(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d = 9, disabled: i, recentColorsLabel: f = "Recently used" }, v) => {
|
|
30
|
+
const { colorScheme: C } = j(), x = C === "dark", { recentColors: M, addRecent: F } = E({ maxItems: d }), [L, T] = H(M), p = w(
|
|
31
|
+
(e, o, t) => {
|
|
32
|
+
u && (F(e, o, t), T((l) => {
|
|
33
|
+
const n = l.filter(
|
|
34
|
+
(a) => !(a.value === e && a.sectionKey === o)
|
|
33
35
|
);
|
|
34
|
-
return [{ value: e, sectionKey:
|
|
35
|
-
})), m(e,
|
|
36
|
+
return [{ value: e, sectionKey: o, border: t }, ...n].slice(0, d);
|
|
37
|
+
})), m(e, o);
|
|
36
38
|
},
|
|
37
|
-
[m,
|
|
38
|
-
),
|
|
39
|
+
[m, u, F]
|
|
40
|
+
), g = I(() => {
|
|
39
41
|
const e = {};
|
|
40
|
-
for (const
|
|
42
|
+
for (const o of s) e[o.key] = o;
|
|
41
43
|
return e;
|
|
42
|
-
}, [
|
|
43
|
-
(e) =>
|
|
44
|
-
|
|
44
|
+
}, [s]), y = w(
|
|
45
|
+
(e, o) => {
|
|
46
|
+
if (!o) return;
|
|
47
|
+
const t = g[o];
|
|
48
|
+
if (!t) return;
|
|
49
|
+
const l = t.colors.find((b) => $(b).value === e);
|
|
50
|
+
if (!l) return;
|
|
51
|
+
const { label: n, value: a } = $(l);
|
|
52
|
+
return n || a;
|
|
53
|
+
},
|
|
54
|
+
[g]
|
|
55
|
+
), N = w(
|
|
56
|
+
(e) => q(e) ? x ? "#FFFFFF" : "#000000" : e,
|
|
57
|
+
[x]
|
|
45
58
|
);
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
const
|
|
51
|
-
return
|
|
59
|
+
return /* @__PURE__ */ S(h, { ref: v, children: [
|
|
60
|
+
u && L.length > 0 && /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
|
|
61
|
+
/* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: f }),
|
|
62
|
+
/* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: L.map((e, o) => {
|
|
63
|
+
const t = e.sectionKey ? g[e.sectionKey] : void 0, l = t?.key === "textColor" || t?.key === "color" || e.sectionKey === "color", n = y(e.value, e.sectionKey);
|
|
64
|
+
return l ? /* @__PURE__ */ r(
|
|
52
65
|
k,
|
|
53
66
|
{
|
|
54
67
|
isActive: !1,
|
|
55
|
-
disabled:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
disabled: i,
|
|
69
|
+
tooltipLabel: n,
|
|
70
|
+
onClick: () => p(e.value, e.sectionKey ?? ""),
|
|
71
|
+
children: /* @__PURE__ */ r(
|
|
72
|
+
K,
|
|
59
73
|
{
|
|
60
74
|
size: 20,
|
|
61
|
-
color:
|
|
75
|
+
color: N(e.value),
|
|
62
76
|
showBorder: !0
|
|
63
77
|
}
|
|
64
78
|
)
|
|
65
79
|
},
|
|
66
|
-
`${e.sectionKey}-${e.value}-${
|
|
67
|
-
) : /* @__PURE__ */
|
|
80
|
+
`${e.sectionKey}-${e.value}-${o}`
|
|
81
|
+
) : /* @__PURE__ */ r(
|
|
68
82
|
k,
|
|
69
83
|
{
|
|
70
84
|
isActive: !1,
|
|
71
85
|
round: !0,
|
|
72
|
-
disabled:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
86
|
+
disabled: i,
|
|
87
|
+
tooltipLabel: n,
|
|
88
|
+
onClick: () => p(e.value, e.sectionKey ?? ""),
|
|
89
|
+
children: /* @__PURE__ */ r(
|
|
90
|
+
D,
|
|
76
91
|
{
|
|
77
92
|
bgColor: e.value,
|
|
78
93
|
borderColor: e.border || "var(--mantine-color-default-border)"
|
|
79
94
|
}
|
|
80
95
|
)
|
|
81
96
|
},
|
|
82
|
-
`${e.sectionKey}-${e.value}-${
|
|
97
|
+
`${e.sectionKey}-${e.value}-${o}`
|
|
83
98
|
);
|
|
84
99
|
}) })
|
|
85
100
|
] }),
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
e.label && /* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
const { value: l, border:
|
|
92
|
-
return
|
|
101
|
+
s.map((e) => {
|
|
102
|
+
const o = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
|
|
103
|
+
return /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
|
|
104
|
+
e.label && /* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: e.label }),
|
|
105
|
+
/* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: e.colors.map((t) => {
|
|
106
|
+
const { value: l, border: n, label: a } = $(t), b = l === e.value, R = N(l), A = a || l;
|
|
107
|
+
return o ? /* @__PURE__ */ r(
|
|
93
108
|
k,
|
|
94
109
|
{
|
|
95
|
-
isActive:
|
|
110
|
+
isActive: b,
|
|
96
111
|
round: !0,
|
|
97
|
-
disabled:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
112
|
+
disabled: i,
|
|
113
|
+
tooltipLabel: A,
|
|
114
|
+
onClick: () => p(l, e.key, n),
|
|
115
|
+
children: /* @__PURE__ */ r(
|
|
116
|
+
D,
|
|
101
117
|
{
|
|
102
118
|
bgColor: l,
|
|
103
|
-
borderColor:
|
|
119
|
+
borderColor: n || R
|
|
104
120
|
}
|
|
105
121
|
)
|
|
106
122
|
},
|
|
107
123
|
l
|
|
108
|
-
) : /* @__PURE__ */
|
|
124
|
+
) : /* @__PURE__ */ r(
|
|
109
125
|
k,
|
|
110
126
|
{
|
|
111
|
-
isActive:
|
|
112
|
-
disabled:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
127
|
+
isActive: b,
|
|
128
|
+
disabled: i,
|
|
129
|
+
tooltipLabel: A,
|
|
130
|
+
onClick: () => p(l, e.key),
|
|
131
|
+
children: /* @__PURE__ */ r(
|
|
132
|
+
K,
|
|
116
133
|
{
|
|
117
134
|
size: 20,
|
|
118
|
-
color:
|
|
135
|
+
color: R,
|
|
119
136
|
showBorder: !0
|
|
120
137
|
}
|
|
121
138
|
)
|
|
@@ -128,5 +145,5 @@ const Q = D(({ sections: i, onChange: m, withRecentColors: a, maxRecentColors: h
|
|
|
128
145
|
] });
|
|
129
146
|
});
|
|
130
147
|
export {
|
|
131
|
-
|
|
148
|
+
Y as ColorPickerToolbar
|
|
132
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmojiPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPanel.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAsBjD,eAAO,MAAM,UAAU,GAAI,6DAMxB,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG;IAC5E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,
|
|
1
|
+
{"version":3,"file":"EmojiPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPanel.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAsBjD,eAAO,MAAM,UAAU,GAAI,6DAMxB,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG;IAC5E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,4CAgTA,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as y, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as d, useRef as m, useEffect as R, useCallback as K } from "react";
|
|
3
3
|
import { useTranslation as L } from "react-i18next";
|
|
4
4
|
import { Search01Icon as U, ShuffleIcon as V, Clock01Icon as W, SmileIcon as X, Pizza01Icon as Z, FootballIcon as _, Airplane01Icon as ee, BulbIcon as te, Asterisk02Icon as oe, Flag02Icon as re } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as c } from "@hugeicons/react";
|
|
@@ -27,17 +27,17 @@ const he = [
|
|
|
27
27
|
{ i: "symbols", icon: /* @__PURE__ */ t(c, { size: 20, icon: oe }) },
|
|
28
28
|
{ i: "flags", icon: /* @__PURE__ */ t(c, { size: 20, icon: re }) }
|
|
29
29
|
], Re = ({
|
|
30
|
-
locales:
|
|
30
|
+
locales: u,
|
|
31
31
|
onChange: C,
|
|
32
32
|
onClose: M,
|
|
33
33
|
setRandomIcon: P,
|
|
34
34
|
querySearch: p
|
|
35
35
|
}) => {
|
|
36
|
-
const [b, k] =
|
|
36
|
+
const [b, k] = d("frequent"), x = m("frequent"), h = m({}), I = m(null), [S, w] = d(""), [Q, O] = d([]), [a, B] = d(null), [E, j] = d([]), { t: G } = L(), g = m(!1), l = m(null);
|
|
37
37
|
R(() => {
|
|
38
38
|
if (typeof p == "string") {
|
|
39
39
|
const e = p.slice(1);
|
|
40
|
-
if (
|
|
40
|
+
if (w(e), a) {
|
|
41
41
|
const o = a.search(e);
|
|
42
42
|
j(o.map((r) => r.item.e));
|
|
43
43
|
}
|
|
@@ -74,7 +74,7 @@ const he = [
|
|
|
74
74
|
const H = K(
|
|
75
75
|
(e) => {
|
|
76
76
|
const o = e.currentTarget.value;
|
|
77
|
-
if (
|
|
77
|
+
if (w(o), a) {
|
|
78
78
|
const r = a.search(o);
|
|
79
79
|
j(r.map((s) => s.item.e));
|
|
80
80
|
}
|
|
@@ -128,8 +128,8 @@ const he = [
|
|
|
128
128
|
ie,
|
|
129
129
|
{
|
|
130
130
|
leftSection: /* @__PURE__ */ t(c, { size: 16, icon: U }),
|
|
131
|
-
value:
|
|
132
|
-
placeholder: `${
|
|
131
|
+
value: S,
|
|
132
|
+
placeholder: `${u?.search}...`,
|
|
133
133
|
"data-autofocus": !0,
|
|
134
134
|
styles: {
|
|
135
135
|
input: {
|
|
@@ -142,7 +142,7 @@ const he = [
|
|
|
142
142
|
radius: "var(--mantine-radius-default)"
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
/* @__PURE__ */ t(ce, { withArrow: !0, label: G("random"), children: /* @__PURE__ */ t(
|
|
145
|
+
/* @__PURE__ */ t(ce, { withArrow: !0, label: u?.random || G("random"), children: /* @__PURE__ */ t(
|
|
146
146
|
A,
|
|
147
147
|
{
|
|
148
148
|
h: 36,
|
|
@@ -175,7 +175,7 @@ const he = [
|
|
|
175
175
|
},
|
|
176
176
|
ref: I,
|
|
177
177
|
onScroll: $,
|
|
178
|
-
children:
|
|
178
|
+
children: S ? /* @__PURE__ */ y(v, { flex: 1, align: "stretch", children: [
|
|
179
179
|
!J && /* @__PURE__ */ t(
|
|
180
180
|
F,
|
|
181
181
|
{
|
|
@@ -185,7 +185,7 @@ const he = [
|
|
|
185
185
|
top: -1,
|
|
186
186
|
style: { zIndex: 1 },
|
|
187
187
|
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
|
|
188
|
-
children: /* @__PURE__ */ t(q, { fz: "sm", c: "dimmed", children:
|
|
188
|
+
children: /* @__PURE__ */ t(q, { fz: "sm", c: "dimmed", children: u?.searchResults })
|
|
189
189
|
}
|
|
190
190
|
),
|
|
191
191
|
E.length ? /* @__PURE__ */ t(N, { cols: 10, spacing: 0, children: E.map((e) => /* @__PURE__ */ t(
|
|
@@ -201,7 +201,7 @@ const he = [
|
|
|
201
201
|
ue,
|
|
202
202
|
{
|
|
203
203
|
size: 100,
|
|
204
|
-
description:
|
|
204
|
+
description: u?.searchNoResults,
|
|
205
205
|
descriptionProps: {
|
|
206
206
|
fz: "sm"
|
|
207
207
|
}
|
|
@@ -217,14 +217,13 @@ const he = [
|
|
|
217
217
|
/* @__PURE__ */ t(
|
|
218
218
|
F,
|
|
219
219
|
{
|
|
220
|
-
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
|
|
221
220
|
py: 2,
|
|
222
221
|
px: 6,
|
|
223
222
|
pos: "sticky",
|
|
224
223
|
top: -1,
|
|
225
224
|
h: 23,
|
|
226
225
|
style: { zIndex: 1 },
|
|
227
|
-
children: /* @__PURE__ */ t(q, { fz: "xs", c: "dimmed", children:
|
|
226
|
+
children: /* @__PURE__ */ t(q, { fz: "xs", c: "dimmed", children: u?.emojiCategory?.[e.i] })
|
|
228
227
|
}
|
|
229
228
|
),
|
|
230
229
|
/* @__PURE__ */ t(N, { cols: 10, spacing: 0, children: e.e.map((o) => /* @__PURE__ */ t(
|
|
@@ -31,6 +31,7 @@ export type EmojiPickerLocales = {
|
|
|
31
31
|
searchNoResults?: string;
|
|
32
32
|
remove?: string;
|
|
33
33
|
icons?: string;
|
|
34
|
+
random?: string;
|
|
34
35
|
emojiCategory?: Record<string, string>;
|
|
35
36
|
};
|
|
36
37
|
export declare const EmojiPicker: ({ project, value, querySearch, children, onChange, position, popoverProps, showIcons, showColors, defaultActiveTab, showEmojis, withinPortal, locales: _locales, openWhen, triggerRegex, typingSeq, showRemoveButton, keepOpenOnRandom, }: PropsWithChildren<EmojiPickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmojiPicker.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgC,MAAM,OAAO,CAAC;AAGxE,OAAO,EAIL,gBAAgB,EAEhB,YAAY,EAEb,MAAM,eAAe,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