通用评论

1
  1. {"version":3,"sources":["../../../src/components/Editor/Emoji.js"],"names":["Emoji","onClick","content","curPage","i","length","push","emoji","map","page","index","item","value","prefixUrl","ext","title","display"],"mappings":";;;;;;;;;;;;AAAA;;;;AAEA;;;;AACA;;;;AACA;AACA;;AAEA;;AAEA,IAAMA,QAAQ,SAARA,KAAQ,OAAiB;AAAA,MAAdC,QAAc,QAAdA,OAAc;;AAC7B,MAAMC,UAAU,EAAhB;AACA,MAAIC,UAAU,EAAd;AACA,OAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAI,GAApB,EAAyBA,GAAzB,EAA8B;AAC5B,QAAID,QAAQE,MAAR,GAAiB,EAArB,EAAyB;AACvBF,cAAQG,IAAR,CAAaC,gBAAMH,CAAN,CAAb;AACD,KAFD,MAEO;AACLF,cAAQI,IAAR,CAAaH,OAAb;AACAA,gBAAU,EAAV;AACD;AACF;AACD,MAAIA,QAAQE,MAAR,GAAiB,CAArB,EAAwB;AACtBH,YAAQI,IAAR,CAAaH,OAAb;AACD;AACD,SACE;AAAA;AAAA;AACGD,YAAQM,GAAR,CAAY,UAACC,IAAD,EAAOC,KAAP;AAAA,aACX;AAAA;AAAA,UAAK,KAAKA,KAAV,EAAiB,WAAU,OAA3B;AACGD,aAAKD,GAAL,CAAS,UAACG,IAAD,EAAOD,KAAP;AAAA,iBACR;AAAA;AAAA,cAAK,WAAU,MAAf,EAAsB,KAAKC,KAAKC,KAAhC;AACE,oDAAM,WAAU,QAAhB,GADF;AAEE;AACE,wBAAQC,gBAAR,GAAoBF,KAAKC,KAAzB,SAAkCD,KAAKG,GADzC;AAEE,mBAAKH,KAAKI,KAFZ;AAGE,qBAAO,EAAEC,SAAS,cAAX,EAHT;AAIE,uBAAS;AAAA,uBAAMf,SAAQU,KAAKI,KAAb,CAAN;AAAA;AAJX;AAFF,WADQ;AAAA,SAAT;AADH,OADW;AAAA,KAAZ;AADH,GADF;AAmBD,CAjCD;;kBAmCef,K","file":"Emoji.js","sourcesContent":["import React from \"react\";\r\nimport { Carousel } from \"antd\";\r\nimport emoji, { prefixUrl } from \"../../emoji\";\r\nimport \"./Emoji.css\";\r\n// 每页 20 5*4\r\n// 共 20 * 3 = 60 (实际是 54)\r\n\r\n// class Emoji\r\n\r\nconst Emoji = ({ onClick }) => {\r\n const content = [];\r\n let curPage = [];\r\n for (let i = 0; i < 115; i++) {\r\n if (curPage.length < 20) {\r\n curPage.push(emoji[i]);\r\n } else {\r\n content.push(curPage);\r\n curPage = [];\r\n }\r\n }\r\n if (curPage.length > 0) {\r\n content.push(curPage);\r\n }\r\n return (\r\n <Carousel>\r\n {content.map((page, index) => (\r\n <div key={index} className=\"emoji\">\r\n {page.map((item, index) => (\r\n <div className=\"item\" key={item.value}>\r\n <span className=\"helper\" />\r\n <img\r\n src={`${prefixUrl}${item.value}.${item.ext}`}\r\n alt={item.title}\r\n style={{ display: \"inline-block\" }}\r\n onClick={() => onClick(item.title)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n ))}\r\n </Carousel>\r\n );\r\n};\r\n\r\nexport default Emoji;\r\n"]}