@fibery/ui-kit 1.13.0 → 1.15.0
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/package.json +7 -9
- package/src/antd/styles.ts +20 -3
- package/src/designSystem.ts +14 -11
- package/src/emoji-picker/app-icon-picker.tsx +54 -0
- package/src/emoji-picker/emoji-index.ts +8 -0
- package/src/emoji-picker/emoji-picker.tsx +77 -0
- package/src/emoji-picker/emoji.tsx +8 -0
- package/src/{emoji-mart → emoji-picker}/icon-emoji-picker.tsx +39 -17
- package/src/emoji-picker/index.tsx +5 -0
- package/src/emoji-picker/primitives/category.tsx +120 -0
- package/src/emoji-picker/primitives/content.tsx +48 -0
- package/src/emoji-picker/primitives/emoji.tsx +131 -0
- package/src/emoji-picker/primitives/footer.tsx +12 -0
- package/src/emoji-picker/primitives/grid.tsx +67 -0
- package/src/emoji-picker/primitives/header.tsx +11 -0
- package/src/emoji-picker/primitives/layout.ts +5 -0
- package/src/emoji-picker/primitives/root.tsx +89 -0
- package/src/emoji-picker/primitives/search-provider.tsx +22 -0
- package/src/emoji-picker/primitives/search.tsx +141 -0
- package/src/emoji-picker/primitives/skin-provider.tsx +27 -0
- package/src/emoji-picker/primitives/skin-tone.tsx +103 -0
- package/src/emoji-picker/stores/emoji-data-store.tsx +50 -0
- package/src/emoji-picker/stores/lazy-emoji-data-store.tsx +29 -0
- package/src/emoji-picker/stores/lazy-icon-data-store.tsx +55 -0
- package/src/emoji-picker/stores/static-emoji-data-store.tsx +16 -0
- package/src/emoji-picker/utils/emoji-set.ts +5 -0
- package/src/{emoji-mart → emoji-picker/utils}/emoji-support.ts +6 -10
- package/src/emoji-picker/utils/frequently.ts +82 -0
- package/src/emoji-picker/utils/load-emoji-data.ts +4 -0
- package/src/emoji-picker/utils/store.ts +40 -0
- package/src/icons/ast/AddAfter.ts +8 -0
- package/src/icons/ast/AddBefore.ts +8 -0
- package/src/icons/ast/ArrowBarLeft.ts +8 -0
- package/src/icons/ast/ArrowBarRight.ts +8 -0
- package/src/icons/ast/Columns2.ts +8 -0
- package/src/icons/ast/Columns4.ts +8 -0
- package/src/icons/ast/LineDivider.ts +8 -0
- package/src/icons/ast/index.tsx +7 -0
- package/src/icons/react/AddAfter.tsx +12 -0
- package/src/icons/react/AddBefore.tsx +12 -0
- package/src/icons/react/ArrowBarLeft.tsx +12 -0
- package/src/icons/react/ArrowBarRight.tsx +12 -0
- package/src/icons/react/Columns2.tsx +12 -0
- package/src/icons/react/Columns4.tsx +12 -0
- package/src/icons/react/LineDivider.tsx +12 -0
- package/src/icons/react/index.tsx +7 -0
- package/src/emoji-mart/app-icon-picker.tsx +0 -68
- package/src/emoji-mart/data/get-data.tsx +0 -58
- package/src/emoji-mart/emoji/emoji.tsx +0 -26
- package/src/emoji-mart/emoji/index.tsx +0 -24
- package/src/emoji-mart/emoji-index.ts +0 -5
- package/src/emoji-mart/emoji-mart.tsx +0 -216
- package/src/emoji-mart/emoji-picker.tsx +0 -78
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {makeEmojiData} from "@fibery/emoji-data";
|
|
2
|
+
import {Suspense, lazy, useEffect, useState} from "react";
|
|
3
|
+
import {getThemedUrl} from "../../AppIconWithFallback";
|
|
4
|
+
import {useThemeMode} from "../../ThemeProvider";
|
|
5
|
+
import {alignTheme} from "../../theme-settings";
|
|
6
|
+
import {EmojiDataStoreProvider, useEmojiDataStore} from "./emoji-data-store";
|
|
7
|
+
|
|
8
|
+
const EMPTY_DATA = {
|
|
9
|
+
aliases: {},
|
|
10
|
+
emojis: {},
|
|
11
|
+
categories: [],
|
|
12
|
+
compressed: false,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const LazyAppIcons = lazy(async () => {
|
|
16
|
+
const {default: appIcons} = await import("../../appIcons.json");
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
default: function EmojiDataStore({children}: React.PropsWithChildren) {
|
|
20
|
+
const emojiDataStore = useEmojiDataStore();
|
|
21
|
+
const themeMode = useThemeMode();
|
|
22
|
+
const alignedTheme = alignTheme(themeMode);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
// TODO: icons should be rendered as svg elements
|
|
26
|
+
const custom = appIcons.map((icon) => {
|
|
27
|
+
return {
|
|
28
|
+
...icon,
|
|
29
|
+
imageUrl: getThemedUrl(icon.file, alignedTheme),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
emojiDataStore.setCustom(custom);
|
|
34
|
+
}, [alignedTheme, emojiDataStore]);
|
|
35
|
+
|
|
36
|
+
return <>{children}</>;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const LazyIconDataStore: React.FC<
|
|
42
|
+
React.PropsWithChildren<{
|
|
43
|
+
fallback: React.ReactNode;
|
|
44
|
+
}>
|
|
45
|
+
> = ({fallback, children}) => {
|
|
46
|
+
const [emojiData] = useState(() => makeEmojiData(EMPTY_DATA));
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<EmojiDataStoreProvider data={emojiData}>
|
|
50
|
+
<Suspense fallback={fallback}>
|
|
51
|
+
<LazyAppIcons>{children}</LazyAppIcons>
|
|
52
|
+
</Suspense>
|
|
53
|
+
</EmojiDataStoreProvider>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {FC, ReactNode, useMemo} from "react";
|
|
2
|
+
import {makeEmojiData} from "@fibery/emoji-data";
|
|
3
|
+
import {getEmojiSet} from "../utils/emoji-set";
|
|
4
|
+
import {EmojiDataStoreProvider} from "./emoji-data-store";
|
|
5
|
+
import rawData from "@fibery/emoji-data/data/all.json";
|
|
6
|
+
|
|
7
|
+
// Static means "preloaded", "non-lazy" here
|
|
8
|
+
|
|
9
|
+
interface EmojiDataProviderProps {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const StaticEmojiDataStore: FC<EmojiDataProviderProps> = ({children}) => {
|
|
14
|
+
const emojiData = useMemo(() => makeEmojiData(rawData, {set: getEmojiSet()}), []);
|
|
15
|
+
return <EmojiDataStoreProvider data={emojiData}>{children}</EmojiDataStoreProvider>;
|
|
16
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// "hard-forked" from https://github.com/nolanlawson/emoji-picker-element/
|
|
2
2
|
const versionsAndTestEmoji = {
|
|
3
3
|
"🫸🏻": 15,
|
|
4
4
|
"🫠": 14,
|
|
@@ -16,7 +16,6 @@ const versionsAndTestEmoji = {
|
|
|
16
16
|
const FONT_FAMILY =
|
|
17
17
|
'"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",' +
|
|
18
18
|
'"Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif';
|
|
19
|
-
const rIC = typeof requestIdleCallback === "function" ? requestIdleCallback : setTimeout;
|
|
20
19
|
|
|
21
20
|
// only used in jest tests
|
|
22
21
|
const simulateCanvasError = false;
|
|
@@ -89,14 +88,11 @@ function determineEmojiSupportLevel() {
|
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
// Check which emojis we know for sure aren't supported, based on Unicode version level
|
|
92
|
-
let
|
|
91
|
+
let version: number;
|
|
92
|
+
|
|
93
93
|
export const detectEmojiSupportLevel = () => {
|
|
94
|
-
if (!
|
|
95
|
-
|
|
96
|
-
rIC(
|
|
97
|
-
() => resolve(determineEmojiSupportLevel()) // delay so ideally this can run while IDB is first populating
|
|
98
|
-
);
|
|
99
|
-
});
|
|
94
|
+
if (!version) {
|
|
95
|
+
version = determineEmojiSupportLevel();
|
|
100
96
|
}
|
|
101
|
-
return
|
|
97
|
+
return version;
|
|
102
98
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as store from "./store";
|
|
2
|
+
|
|
3
|
+
/** "hard-forked" as is from https://github.dev/missive/emoji-mart/blob/v3.0.1/src/utils/frequently.js */
|
|
4
|
+
|
|
5
|
+
const DEFAULTS = [
|
|
6
|
+
"+1",
|
|
7
|
+
"grinning",
|
|
8
|
+
"kissing_heart",
|
|
9
|
+
"heart_eyes",
|
|
10
|
+
"laughing",
|
|
11
|
+
"stuck_out_tongue_winking_eye",
|
|
12
|
+
"sweat_smile",
|
|
13
|
+
"joy",
|
|
14
|
+
"scream",
|
|
15
|
+
"disappointed",
|
|
16
|
+
"unamused",
|
|
17
|
+
"weary",
|
|
18
|
+
"sob",
|
|
19
|
+
"sunglasses",
|
|
20
|
+
"heart",
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
let frequently: Record<string, number>;
|
|
24
|
+
let defaults: Record<string, number> = {};
|
|
25
|
+
let initialized = false;
|
|
26
|
+
|
|
27
|
+
function init() {
|
|
28
|
+
initialized = true;
|
|
29
|
+
frequently = store.get("frequently");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function add(emojiId: string) {
|
|
33
|
+
if (!initialized) {
|
|
34
|
+
init();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!frequently) {
|
|
38
|
+
frequently = defaults;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!frequently[emojiId]) {
|
|
42
|
+
frequently[emojiId] = 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
frequently[emojiId] += 1;
|
|
46
|
+
|
|
47
|
+
store.set("last", emojiId);
|
|
48
|
+
store.set("frequently", frequently);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function get(perLine: number) {
|
|
52
|
+
if (!initialized) {
|
|
53
|
+
init();
|
|
54
|
+
}
|
|
55
|
+
if (!frequently) {
|
|
56
|
+
defaults = {};
|
|
57
|
+
|
|
58
|
+
const result = [];
|
|
59
|
+
|
|
60
|
+
for (let i = 0; i < perLine; i++) {
|
|
61
|
+
defaults[DEFAULTS[i]] = perLine - i;
|
|
62
|
+
result.push(DEFAULTS[i]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const quantity = perLine * 4;
|
|
69
|
+
const frequentlyKeys = Object.keys(frequently);
|
|
70
|
+
|
|
71
|
+
const sorted = frequentlyKeys.sort((a, b) => frequently[a] - frequently[b]).reverse();
|
|
72
|
+
const sliced = sorted.slice(0, quantity);
|
|
73
|
+
|
|
74
|
+
const last = store.get("last");
|
|
75
|
+
|
|
76
|
+
if (last && sliced.indexOf(last) === -1) {
|
|
77
|
+
sliced.pop();
|
|
78
|
+
sliced.push(last);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return sliced;
|
|
82
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** "hard-forked" as is from https://github.dev/missive/emoji-mart/blob/v3.0.1/src/utils/store.js */
|
|
2
|
+
|
|
3
|
+
const NAMESPACE = "emoji-mart";
|
|
4
|
+
|
|
5
|
+
const isLocalStorageSupported = typeof window !== "undefined" && "localStorage" in window;
|
|
6
|
+
|
|
7
|
+
export function update(state: {[key: string]: unknown}) {
|
|
8
|
+
for (const key in state) {
|
|
9
|
+
const value = state[key];
|
|
10
|
+
set(key, value);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function set(key: string, value: unknown) {
|
|
15
|
+
if (!isLocalStorageSupported) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
window.localStorage[`${NAMESPACE}.${key}`] = JSON.stringify(value);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
/* empty */
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function get(key: string) {
|
|
26
|
+
if (!isLocalStorageSupported) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const value = window.localStorage[`${NAMESPACE}.${key}`];
|
|
31
|
+
|
|
32
|
+
if (value) {
|
|
33
|
+
return JSON.parse(value);
|
|
34
|
+
}
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const AddAfter: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.25 3A2.25 2.25 0 0 0 2 5.25v9.5A2.25 2.25 0 0 0 4.25 17h3.5A2.25 2.25 0 0 0 10 14.75v-9.5A2.25 2.25 0 0 0 7.75 3h-3.5ZM3.5 5.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 .75.75v9.5a.75.75 0 0 1-.75.75h-3.5a.75.75 0 0 1-.75-.75v-9.5Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M15 7a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0v-1.5h-1.5a.75.75 0 0 1 0-1.5h1.5v-1.5A.75.75 0 0 1 15 7Z"},"children":[]}],"metadata":""}]},"name":"add-after"};
|
|
7
|
+
|
|
8
|
+
export default AddAfter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const AddBefore: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M12.25 3A2.25 2.25 0 0 0 10 5.25v9.5A2.25 2.25 0 0 0 12.25 17h3.5A2.25 2.25 0 0 0 18 14.75v-9.5A2.25 2.25 0 0 0 15.75 3h-3.5Zm-.75 2.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 .75.75v9.5a.75.75 0 0 1-.75.75h-3.5a.75.75 0 0 1-.75-.75v-9.5Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M5 7a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0v-1.5h-1.5a.75.75 0 0 1 0-1.5h1.5v-1.5A.75.75 0 0 1 5 7Z"},"children":[]}],"metadata":""}]},"name":"add-before"};
|
|
7
|
+
|
|
8
|
+
export default AddBefore;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const ArrowBarLeft: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"d":"M15.75 3.75a.75.75 0 0 0-1.5 0v12.5a.75.75 0 0 0 1.5 0V3.75ZM6.78 8.03a.75.75 0 0 0-1.06-1.06l-2.5 2.5a.75.75 0 0 0 0 1.06l2.5 2.5a.75.75 0 0 0 1.06-1.06l-1.22-1.22h5.69a.75.75 0 0 0 0-1.5H5.56l1.22-1.22Z"},"children":[]}],"metadata":""}]},"name":"arrow-bar-left"};
|
|
7
|
+
|
|
8
|
+
export default ArrowBarLeft;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const ArrowBarRight: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"d":"M5.5 16.25a.75.75 0 0 1-1.5 0V3.75a.75.75 0 0 1 1.5 0v12.5ZM14.03 13.03a.75.75 0 1 1-1.06-1.06l1.22-1.22H8.5a.75.75 0 0 1 0-1.5h5.69l-1.22-1.22a.75.75 0 0 1 1.06-1.06l2.5 2.5a.75.75 0 0 1 0 1.06l-2.5 2.5Z"},"children":[]}],"metadata":""}]},"name":"arrow-bar-right"};
|
|
7
|
+
|
|
8
|
+
export default ArrowBarRight;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const Columns2: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.25 4.5a.75.75 0 0 0-.75.75v9.5c0 .414.336.75.75.75h5v-11h-5Zm6.5 0v11h5a.75.75 0 0 0 .75-.75v-9.5a.75.75 0 0 0-.75-.75h-5ZM2 5.25A2.25 2.25 0 0 1 4.25 3h11.5A2.25 2.25 0 0 1 18 5.25v9.5A2.25 2.25 0 0 1 15.75 17H4.25A2.25 2.25 0 0 1 2 14.75v-9.5Z"},"children":[]}],"metadata":""}]},"name":"columns-2"};
|
|
7
|
+
|
|
8
|
+
export default Columns2;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const Columns4: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.25 4.5a.75.75 0 0 0-.75.75v9.5c0 .414.336.75.75.75H5.5v-11H4.25ZM7 4.5v11h2.25v-11H7Zm3.75 0v11H13v-11h-2.25Zm3.75 0v11h1.25a.75.75 0 0 0 .75-.75v-9.5a.75.75 0 0 0-.75-.75H14.5ZM2 5.25A2.25 2.25 0 0 1 4.25 3h11.5A2.25 2.25 0 0 1 18 5.25v9.5A2.25 2.25 0 0 1 15.75 17H4.25A2.25 2.25 0 0 1 2 14.75v-9.5Z"},"children":[]}],"metadata":""}]},"name":"columns-4"};
|
|
7
|
+
|
|
8
|
+
export default Columns4;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const LineDivider: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M2 10a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 10Z"},"children":[]}],"metadata":""}]},"name":"line-divider"};
|
|
7
|
+
|
|
8
|
+
export default LineDivider;
|
package/src/icons/ast/index.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// This icon file is generated automatically.
|
|
2
2
|
export { default as ActivityLog } from './ActivityLog';
|
|
3
3
|
export { default as Activity } from './Activity';
|
|
4
|
+
export { default as AddAfter } from './AddAfter';
|
|
5
|
+
export { default as AddBefore } from './AddBefore';
|
|
4
6
|
export { default as AddCompact } from './AddCompact';
|
|
5
7
|
export { default as AddGroup } from './AddGroup';
|
|
6
8
|
export { default as AddReactions } from './AddReactions';
|
|
@@ -19,6 +21,8 @@ export { default as AppTemplates } from './AppTemplates';
|
|
|
19
21
|
export { default as AppWebhooks } from './AppWebhooks';
|
|
20
22
|
export { default as AppWiki } from './AppWiki';
|
|
21
23
|
export { default as App } from './App';
|
|
24
|
+
export { default as ArrowBarLeft } from './ArrowBarLeft';
|
|
25
|
+
export { default as ArrowBarRight } from './ArrowBarRight';
|
|
22
26
|
export { default as ArrowBottom } from './ArrowBottom';
|
|
23
27
|
export { default as ArrowCollapseVertical } from './ArrowCollapseVertical';
|
|
24
28
|
export { default as ArrowCollapse } from './ArrowCollapse';
|
|
@@ -35,6 +39,8 @@ export { default as Checked } from './Checked';
|
|
|
35
39
|
export { default as ClearValue } from './ClearValue';
|
|
36
40
|
export { default as Close } from './Close';
|
|
37
41
|
export { default as ColorCoding } from './ColorCoding';
|
|
42
|
+
export { default as Columns2 } from './Columns2';
|
|
43
|
+
export { default as Columns4 } from './Columns4';
|
|
38
44
|
export { default as Columns } from './Columns';
|
|
39
45
|
export { default as Copy } from './Copy';
|
|
40
46
|
export { default as CopyUrl } from './CopyUrl';
|
|
@@ -77,6 +83,7 @@ export { default as Items } from './Items';
|
|
|
77
83
|
export { default as Jira } from './Jira';
|
|
78
84
|
export { default as LeftPanel } from './LeftPanel';
|
|
79
85
|
export { default as Levels } from './Levels';
|
|
86
|
+
export { default as LineDivider } from './LineDivider';
|
|
80
87
|
export { default as Lock } from './Lock';
|
|
81
88
|
export { default as Markdown } from './Markdown';
|
|
82
89
|
export { default as MenuCollapser } from './MenuCollapser';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import AddAfterSvg from '../ast/AddAfter';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const AddAfter = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={AddAfterSvg} />;
|
|
10
|
+
|
|
11
|
+
AddAfter.displayName = 'AddAfter';
|
|
12
|
+
export default AddAfter;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import AddBeforeSvg from '../ast/AddBefore';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const AddBefore = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={AddBeforeSvg} />;
|
|
10
|
+
|
|
11
|
+
AddBefore.displayName = 'AddBefore';
|
|
12
|
+
export default AddBefore;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import ArrowBarLeftSvg from '../ast/ArrowBarLeft';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const ArrowBarLeft = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={ArrowBarLeftSvg} />;
|
|
10
|
+
|
|
11
|
+
ArrowBarLeft.displayName = 'ArrowBarLeft';
|
|
12
|
+
export default ArrowBarLeft;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import ArrowBarRightSvg from '../ast/ArrowBarRight';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const ArrowBarRight = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={ArrowBarRightSvg} />;
|
|
10
|
+
|
|
11
|
+
ArrowBarRight.displayName = 'ArrowBarRight';
|
|
12
|
+
export default ArrowBarRight;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import Columns2Svg from '../ast/Columns2';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const Columns2 = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={Columns2Svg} />;
|
|
10
|
+
|
|
11
|
+
Columns2.displayName = 'Columns2';
|
|
12
|
+
export default Columns2;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import Columns4Svg from '../ast/Columns4';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const Columns4 = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={Columns4Svg} />;
|
|
10
|
+
|
|
11
|
+
Columns4.displayName = 'Columns4';
|
|
12
|
+
export default Columns4;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import LineDividerSvg from '../ast/LineDivider';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const LineDivider = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={LineDividerSvg} />;
|
|
10
|
+
|
|
11
|
+
LineDivider.displayName = 'LineDivider';
|
|
12
|
+
export default LineDivider;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// This icon file is generated automatically.
|
|
2
2
|
export { default as ActivityLog } from './ActivityLog';
|
|
3
3
|
export { default as Activity } from './Activity';
|
|
4
|
+
export { default as AddAfter } from './AddAfter';
|
|
5
|
+
export { default as AddBefore } from './AddBefore';
|
|
4
6
|
export { default as AddCompact } from './AddCompact';
|
|
5
7
|
export { default as AddGroup } from './AddGroup';
|
|
6
8
|
export { default as AddReactions } from './AddReactions';
|
|
@@ -19,6 +21,8 @@ export { default as AppTemplates } from './AppTemplates';
|
|
|
19
21
|
export { default as AppWebhooks } from './AppWebhooks';
|
|
20
22
|
export { default as AppWiki } from './AppWiki';
|
|
21
23
|
export { default as App } from './App';
|
|
24
|
+
export { default as ArrowBarLeft } from './ArrowBarLeft';
|
|
25
|
+
export { default as ArrowBarRight } from './ArrowBarRight';
|
|
22
26
|
export { default as ArrowBottom } from './ArrowBottom';
|
|
23
27
|
export { default as ArrowCollapseVertical } from './ArrowCollapseVertical';
|
|
24
28
|
export { default as ArrowCollapse } from './ArrowCollapse';
|
|
@@ -35,6 +39,8 @@ export { default as Checked } from './Checked';
|
|
|
35
39
|
export { default as ClearValue } from './ClearValue';
|
|
36
40
|
export { default as Close } from './Close';
|
|
37
41
|
export { default as ColorCoding } from './ColorCoding';
|
|
42
|
+
export { default as Columns2 } from './Columns2';
|
|
43
|
+
export { default as Columns4 } from './Columns4';
|
|
38
44
|
export { default as Columns } from './Columns';
|
|
39
45
|
export { default as Copy } from './Copy';
|
|
40
46
|
export { default as CopyUrl } from './CopyUrl';
|
|
@@ -77,6 +83,7 @@ export { default as Items } from './Items';
|
|
|
77
83
|
export { default as Jira } from './Jira';
|
|
78
84
|
export { default as LeftPanel } from './LeftPanel';
|
|
79
85
|
export { default as Levels } from './Levels';
|
|
86
|
+
export { default as LineDivider } from './LineDivider';
|
|
80
87
|
export { default as Lock } from './Lock';
|
|
81
88
|
export { default as Markdown } from './Markdown';
|
|
82
89
|
export { default as MenuCollapser } from './MenuCollapser';
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {forwardRef, useMemo} from "react";
|
|
2
|
-
import {getThemedUrl} from "../AppIconWithFallback";
|
|
3
|
-
import {useThemeMode} from "../ThemeProvider";
|
|
4
|
-
import appIcons from "../appIcons.json";
|
|
5
|
-
import {alignTheme} from "../theme-settings";
|
|
6
|
-
import {$TSFixMe} from "../tsfixme";
|
|
7
|
-
import type {EmojiDataProps} from "./data/get-data";
|
|
8
|
-
import {EmojiMartWrapper, NimblePicker, NimblePickerProps} from "./emoji-mart";
|
|
9
|
-
import {ColorPicker} from "../ColorPicker";
|
|
10
|
-
import {cardTypeColors} from "../designSystem";
|
|
11
|
-
|
|
12
|
-
const EMPTY_DATA = {
|
|
13
|
-
aliases: {},
|
|
14
|
-
emojis: {},
|
|
15
|
-
categories: [],
|
|
16
|
-
compressed: false,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type NimblePickerWithData = Omit<NimblePickerProps, keyof EmojiDataProps>;
|
|
20
|
-
|
|
21
|
-
export type AppIconPickerProps = {
|
|
22
|
-
borderless?: boolean;
|
|
23
|
-
color?: string;
|
|
24
|
-
getHoverColor?: (color: string) => string | undefined;
|
|
25
|
-
colors?: string[];
|
|
26
|
-
onColorSelect?: (c: $TSFixMe) => void;
|
|
27
|
-
} & NimblePickerWithData;
|
|
28
|
-
|
|
29
|
-
const i18n = {search: "Search icon...", notfound: "No Icons Found"};
|
|
30
|
-
|
|
31
|
-
export const AppIconPicker = forwardRef<HTMLDivElement, AppIconPickerProps>(function AppIconPicker(
|
|
32
|
-
{borderless = true, color, getHoverColor, colors = cardTypeColors, onColorSelect, ...pickerProps},
|
|
33
|
-
ref
|
|
34
|
-
) {
|
|
35
|
-
const themeMode = useThemeMode();
|
|
36
|
-
|
|
37
|
-
const alignedTheme = alignTheme(themeMode);
|
|
38
|
-
|
|
39
|
-
const customIcons = useMemo(
|
|
40
|
-
() =>
|
|
41
|
-
appIcons.map((icon) => {
|
|
42
|
-
return {
|
|
43
|
-
...icon,
|
|
44
|
-
imageUrl: getThemedUrl(icon.file, alignedTheme),
|
|
45
|
-
};
|
|
46
|
-
}),
|
|
47
|
-
[alignedTheme]
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<EmojiMartWrapper
|
|
52
|
-
ref={ref}
|
|
53
|
-
emojiHoverColor={color ? getHoverColor?.(color) : undefined}
|
|
54
|
-
borderless={borderless}
|
|
55
|
-
hideCategories
|
|
56
|
-
>
|
|
57
|
-
<NimblePicker custom={customIcons} i18n={i18n} {...pickerProps} data={EMPTY_DATA} showSkinTones={false} />
|
|
58
|
-
{onColorSelect ? (
|
|
59
|
-
<ColorPicker
|
|
60
|
-
colors={colors}
|
|
61
|
-
getSwatchHoverColor={getHoverColor}
|
|
62
|
-
color={color}
|
|
63
|
-
onChangeComplete={onColorSelect}
|
|
64
|
-
/>
|
|
65
|
-
) : null}
|
|
66
|
-
</EmojiMartWrapper>
|
|
67
|
-
);
|
|
68
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {detectEmojiSupportLevel} from "../emoji-support";
|
|
2
|
-
import type {Data} from "emoji-mart";
|
|
3
|
-
|
|
4
|
-
export type EmojiDataProps = {
|
|
5
|
-
native: boolean;
|
|
6
|
-
data: Data;
|
|
7
|
-
backgroundImageFn: (set: string) => string;
|
|
8
|
-
set: "apple" | "twitter";
|
|
9
|
-
sheetColumns: number;
|
|
10
|
-
sheetRows: number;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let promise: Promise<EmojiDataProps>;
|
|
14
|
-
|
|
15
|
-
const backgroundImageFn = (set: string) =>
|
|
16
|
-
`https://fibery-ui-public-assets.s3.eu-central-1.amazonaws.com/images/emoji-datasource-${set}-15_0_1-64.png`;
|
|
17
|
-
|
|
18
|
-
export const loadEmojiData = async () => {
|
|
19
|
-
const data = await import("@fibery/emoji-data/data/all.json");
|
|
20
|
-
return data.default;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const getAppleDataProps = async (): Promise<EmojiDataProps> => {
|
|
24
|
-
const [level, data] = await Promise.all([detectEmojiSupportLevel(), loadEmojiData()]);
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
native: level >= 14,
|
|
28
|
-
// type declarations between @fibery/emoji-data and emoji-mart conflict a bit but they are compatible
|
|
29
|
-
data: data as unknown as Data,
|
|
30
|
-
backgroundImageFn,
|
|
31
|
-
set: "apple",
|
|
32
|
-
sheetColumns: 61,
|
|
33
|
-
sheetRows: 61,
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
const getTwitterDataProps = async (): Promise<EmojiDataProps> => {
|
|
37
|
-
const data = await loadEmojiData();
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
native: false,
|
|
41
|
-
// type declarations between @fibery/emoji-data and emoji-mart conflict a bit but they are compatible
|
|
42
|
-
data: data as unknown as Data,
|
|
43
|
-
backgroundImageFn,
|
|
44
|
-
set: "twitter",
|
|
45
|
-
sheetColumns: 61,
|
|
46
|
-
sheetRows: 61,
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const isApple = () => /Mac|iPhone|iPad/.test(navigator.userAgent);
|
|
51
|
-
|
|
52
|
-
export const getEmojiDataProps = async () => {
|
|
53
|
-
if (!promise) {
|
|
54
|
-
promise = isApple() ? getAppleDataProps() : getTwitterDataProps();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return promise;
|
|
58
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {css} from "@linaria/core";
|
|
2
|
-
import {NimbleEmoji, NimbleEmojiProps} from "emoji-mart";
|
|
3
|
-
import {themeVars} from "../../designSystem";
|
|
4
|
-
|
|
5
|
-
const emojiWrapperCss = css`
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
|
|
9
|
-
& span.emoji-mart-emoji {
|
|
10
|
-
color: ${themeVars.textColor};
|
|
11
|
-
line-height: 1;
|
|
12
|
-
vertical-align: middle;
|
|
13
|
-
& span {
|
|
14
|
-
vertical-align: middle;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
export type EmojiMartEmojiProps = NimbleEmojiProps;
|
|
20
|
-
export const EmojiMartEmoji: React.FC<NimbleEmojiProps> = (props) => {
|
|
21
|
-
return (
|
|
22
|
-
<span className={emojiWrapperCss}>
|
|
23
|
-
<NimbleEmoji {...props} />
|
|
24
|
-
</span>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {lazy, Suspense} from "react";
|
|
2
|
-
import {EmojiDataProps, getEmojiDataProps} from "../data/get-data";
|
|
3
|
-
import {EmojiMartEmoji, type EmojiMartEmojiProps} from "./emoji";
|
|
4
|
-
|
|
5
|
-
type EmojiProps = Omit<EmojiMartEmojiProps, keyof EmojiDataProps>;
|
|
6
|
-
|
|
7
|
-
const LazyEmojiComponent = lazy(async () => {
|
|
8
|
-
const emojiDataProps = await getEmojiDataProps();
|
|
9
|
-
|
|
10
|
-
function Emoji(props: EmojiProps) {
|
|
11
|
-
return <EmojiMartEmoji {...props} {...emojiDataProps} />;
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
default: Emoji,
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const Emoji: React.FC<EmojiProps> = function EmojiOrLoader(props) {
|
|
19
|
-
return (
|
|
20
|
-
<Suspense fallback={<div style={{width: props.size, height: props.size}} />}>
|
|
21
|
-
<LazyEmojiComponent {...props} />
|
|
22
|
-
</Suspense>
|
|
23
|
-
);
|
|
24
|
-
};
|