@soul-refiner/design-system 2.14.116 → 2.14.117
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("styled-components"),o=require("../../../assets/custom_emoji_data.json.js"),i=require("react-window"),s=require("./utils.js"),n=require("./constants.js"),a=require("../../atoms/box/box.js");require("../../atoms/highlighter/highlighter.js"),require("../../atoms/typography/display.js"),require("../../atoms/typography/heading.js");var d=require("../../atoms/typography/paragraph.js");require("../../atoms/typography/typography.js"),require("../../atoms/countdown/countdown.js"),require("../../iconography/icon/icon.js"),require("../../../icons/basic/subtask.js");var l=require("../../../icons/basic/emoticon_add.js"),c=require("../../../icons/emoji/emoji_add.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../common/colors.js");var p=u(r),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("styled-components"),o=require("../../../assets/custom_emoji_data.json.js"),i=require("react-window"),s=require("./utils.js"),n=require("./constants.js"),a=require("../../atoms/box/box.js");require("../../atoms/highlighter/highlighter.js"),require("../../atoms/typography/display.js"),require("../../atoms/typography/heading.js");var d=require("../../atoms/typography/paragraph.js");require("../../atoms/typography/typography.js"),require("../../atoms/countdown/countdown.js"),require("../../iconography/icon/icon.js"),require("../../../icons/basic/subtask.js");var l=require("../../../icons/basic/emoticon_add.js"),c=require("../../../icons/emoji/emoji_add.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../common/colors.js");var p=u(r),g=u(t);const x={[n.CategoryId.FREQUENTLY]:"Frequently Used",[n.CategoryId.PEOPLE]:"Smile & People",[n.CategoryId.NATURE]:"Nature",[n.CategoryId.FOODS]:"Food & Drink",[n.CategoryId.ACTIVITY]:"Activity",[n.CategoryId.OBJECTS]:"Objects",[n.CategoryId.SYMBOLS]:"Symbols",[n.CategoryId.FLAGS]:"Flags"},h=g.default.div`
|
|
2
2
|
cursor: pointer;
|
|
3
|
-
`,m=
|
|
3
|
+
`,m=g.default.div`
|
|
4
4
|
position: relative;
|
|
5
5
|
display: inline-block;
|
|
6
|
-
`,f=
|
|
6
|
+
`,f=g.default.div`
|
|
7
7
|
z-index: 100;
|
|
8
8
|
width: 320px;
|
|
9
9
|
max-height: 450px;
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
display: flex;
|
|
16
16
|
flex-direction: column;
|
|
17
17
|
${({$sx:e})=>e||""}
|
|
18
|
-
`,y=
|
|
18
|
+
`,y=g.default.div`
|
|
19
19
|
padding: 6px 8px;
|
|
20
20
|
display: flex;
|
|
21
21
|
justify-content: center;
|
|
22
22
|
align-items: center;
|
|
23
23
|
border-bottom: 1px solid var(--color-grey-9);
|
|
24
|
-
`,j=
|
|
24
|
+
`,j=g.default.input`
|
|
25
25
|
width: 95%;
|
|
26
26
|
padding: 6px 0px 6px 6px;
|
|
27
27
|
border-radius: 6px;
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
border: 1px solid var(--color-primary-blue-2);
|
|
34
34
|
outline: none;
|
|
35
35
|
}
|
|
36
|
-
`,b=
|
|
36
|
+
`,b=g.default.div`
|
|
37
37
|
display: grid;
|
|
38
38
|
grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
|
|
39
39
|
gap: 6px;
|
|
40
40
|
width: 100%;
|
|
41
41
|
padding: 0 8px;
|
|
42
42
|
box-sizing: border-box;
|
|
43
|
-
`,v=
|
|
43
|
+
`,v=g.default.div`
|
|
44
44
|
width: ${n.TILE_SIZE}px;
|
|
45
45
|
height: ${n.TILE_SIZE}px;
|
|
46
46
|
cursor: pointer;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
position: relative;
|
|
51
51
|
|
|
52
52
|
${({$x:e,$y:r})=>void 0!==e&&void 0!==r&&`\n background-image: url(${n.SPRITE_URL});\n background-size: ${100*n.SPRITE_COLUMNS}% ${100*n.SPRITE_COLUMNS}%;\n background-position: ${e/(n.SPRITE_COLUMNS-1)*100}% ${r/(n.SPRITE_COLUMNS-1)*100}%;\n `}
|
|
53
|
-
`,E=
|
|
53
|
+
`,E=g.default(i.VariableSizeList)`
|
|
54
54
|
&::-webkit-scrollbar {
|
|
55
55
|
width: 6px;
|
|
56
56
|
}
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
|
|
63
63
|
scrollbar-width: thin;
|
|
64
64
|
scrollbar-color: var(--color-grey-9) transparent;
|
|
65
|
-
`,I=
|
|
65
|
+
`,I=g.default.div`
|
|
66
66
|
display: flex;
|
|
67
67
|
justify-content: space-around;
|
|
68
68
|
background: white;
|
|
69
69
|
border-top: 1px solid #ddd;
|
|
70
|
-
`,S=
|
|
70
|
+
`,S=g.default.button`
|
|
71
71
|
flex: 1;
|
|
72
72
|
padding: 8px 0;
|
|
73
73
|
font-size: 20px;
|
|
@@ -80,4 +80,4 @@
|
|
|
80
80
|
&:hover {
|
|
81
81
|
background: var(--color-grey-9);
|
|
82
82
|
}
|
|
83
|
-
`;exports.CustomEmojiPicker=({onSelect:r,onClickOutside:t,open:i,trigger:u,$pickersx:
|
|
83
|
+
`;exports.CustomEmojiPicker=({onSelect:r,onClickOutside:t,open:i,trigger:u,$pickersx:g})=>{const[$,C]=p.default.useState(n.CategoryId.FREQUENTLY),[k,w]=p.default.useState(""),[L,T]=p.default.useState(""),q=p.default.useRef(null),O=p.default.useRef(null),[R,P]=p.default.useState(!1),_=void 0!==i?i:R;p.default.useEffect(()=>{const e=e=>{q.current&&!q.current.contains(e.target)&&(void 0===i&&P(!1),t())};return _&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[_,i]),p.default.useEffect(()=>{const e=setTimeout(()=>{T(k)},300);return()=>{clearTimeout(e)}},[k]);const{categories:U,emojiMap:N}=p.default.useMemo(()=>s.preprocessEmojiData(o.default,n.FREQUENTLY_USED_IDS),[]),z=p.default.useMemo(()=>{if(!L.trim())return U;const e=L.toLowerCase(),r=[];for(const t of Object.values(N))(t.name.toLowerCase().includes(e)||t.keywords?.some(r=>r.toLowerCase().includes(e)))&&r.push(t);return{search:r}},[U,N,L]),M=p.default.useMemo(()=>{const e=Object.entries(z);return"search"in z?e.map(([e,r])=>({categoryId:e,emojis:r})):e.sort((e,r)=>e[0]===n.CategoryId.FREQUENTLY?-1:r[0]===n.CategoryId.FREQUENTLY?1:0).map(([e,r])=>({categoryId:e,emojis:r}))},[z]),F=p.default.memo(({index:t,style:o})=>{const i=M[t],s="search"===i.categoryId;return e.jsxs("div",{style:o,children:[e.jsx(d.P,{$color:"grey-5",sx:"padding: 8px;",$fontSize:14,children:s&&i.emojis.length>0?"Search Results":i.emojis.length>0?x[i.categoryId]||i.categoryId:null}),s&&0===i.emojis.length?e.jsxs(a.Box,{$dir:"column",$align:"center",sx:" height: 100%;",children:[e.jsx(a.Box,{sx:"margin-top:auto;",children:e.jsx(l.Emoticon,{size:24})}),e.jsx(d.P,{$bold:!0,children:"No emojis found."}),e.jsx(d.P,{$fontSize:10,sx:"margin-bottom: auto;",children:"Try using different keywords"})]}):e.jsx(b,{children:i.emojis.map(t=>e.jsx(v,{$x:t.coordinates?.x,$y:t.coordinates?.y,title:`:${t.id}`,onClick:()=>{r({id:t.id,name:t.name,native:t.skins?.[0]?.native||"",unified:t.skins?.[0]?.unified||""}),P(!1)},children:!t.coordinates&&t.skins[0].native},t.id))})]})});return e.jsxs(m,{ref:q,onMouseDown:e=>{e.stopPropagation()},onMouseUp:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:[e.jsx(h,{onClick:()=>P(e=>!e),style:{cursor:"pointer"},children:u??e.jsx(a.Box,{sx:"width: 28px; height: 28px;",$justify:"center",$align:"center",children:e.jsx(c.EmojiAdd,{size:32})})}),_&&e.jsxs(f,{$sx:g,children:[e.jsx(y,{children:e.jsx(j,{type:"text",placeholder:"Search…",value:k,onChange:e=>{w(e.target.value)}})}),e.jsx(E,{height:400,itemCount:M.length,itemSize:e=>{const r=M[e].emojis.length;return 36+38*Math.ceil(r/10)+12},width:"100%",ref:O,children:F}),e.jsx(I,{children:Object.entries(n.CATEGORY_ICONS).map(([r,t])=>e.jsx(S,{$active:$===r,onClick:()=>(e=>{const r=M.findIndex(r=>r.categoryId===e);-1!==r&&O.current&&(O.current.scrollToItem(r,"start"),C(e))})(r),children:t},r))})]})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji-picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/feedback/emojiPicker/emoji-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,
|
|
1
|
+
{"version":3,"file":"emoji-picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/feedback/emojiPicker/emoji-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAoPA,CAAC"}
|