@crmchatreactcomponent/quick-messages 0.0.7 → 0.0.8
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/context/I18nContext.d.ts +2 -0
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { i18n } from "i18next";
|
|
2
3
|
export type I18nContextType = NonNullable<unknown>;
|
|
3
4
|
export declare const I18nContext: import("react").Context<{} | null>;
|
|
4
5
|
export declare function I18nContextCmp(props: {
|
|
5
6
|
children: ReactNode;
|
|
7
|
+
i18n?: i18n;
|
|
6
8
|
}): import("react").JSX.Element;
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o, jsxs as h, Fragment as ee } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as me, useMemo as D, useState as $, useEffect as E, createContext as ve, useRef as xe } from "react";
|
|
3
|
-
import { ConfigProvider as St, theme as jt, Popover as Ce, Space as C, message as $t, Modal as Te, Table as _,
|
|
3
|
+
import { ConfigProvider as St, theme as jt, Popover as Ce, Space as C, message as $t, Modal as Te, Table as _, Button as T, Flex as z, Empty as Se, Input as U, Popconfirm as kt, Menu as At, Alert as wt, ColorPicker as Pt, Tooltip as Dt } from "antd";
|
|
4
4
|
import Ot, { EmojiStyle as Mt, Theme as te } from "emoji-picker-react";
|
|
5
5
|
import { useTranslation as I, I18nextProvider as Et } from "react-i18next";
|
|
6
6
|
import { uniqBy as It } from "lodash-es";
|
|
@@ -1421,7 +1421,7 @@ Ct.init({
|
|
|
1421
1421
|
});
|
|
1422
1422
|
const mo = ve(null);
|
|
1423
1423
|
function Io(e) {
|
|
1424
|
-
return /* @__PURE__ */ o(Et, { i18n: Ct, defaultNS: "common", children: /* @__PURE__ */ o(mo.Provider, { value: {}, children: e.children }) });
|
|
1424
|
+
return /* @__PURE__ */ o(Et, { i18n: e.i18n || Ct, defaultNS: "common", children: /* @__PURE__ */ o(mo.Provider, { value: {}, children: e.children }) });
|
|
1425
1425
|
}
|
|
1426
1426
|
export {
|
|
1427
1427
|
ke as AntdApiContext,
|
package/dist/index.umd.js
CHANGED
|
@@ -68,4 +68,4 @@
|
|
|
68
68
|
&:active {
|
|
69
69
|
opacity: 0.6;
|
|
70
70
|
}
|
|
71
|
-
`;function zn(e){const t=b.useMemo(()=>{var s,d;const r=bt(e.data.color),n=r.isDark(),a=n?(s=r.lighten(.2))==null?void 0:s.hex():(d=r.darken(.15))==null?void 0:d.hex();return{$textColor:n?"#fff":"#333",$backgroundColor:e.data.color,$hoverColor:a}},[e.data.color]);return o.jsx(Fn,{...t,$active:e.active,"data-id":e.data.id,onClick:e.onClick,title:e.data.title,children:Z(e.data.title,e.displayTitleMaxLength)})}/*! This file was generated by vite-i18n-gen-resources-type check https://github.com/CRMChatReactComponent/vite-i18n-gen-resources-type. Please do not modify. */var we=(e=>(e.ZH_CN="zh-CN",e.EN_US="en-US",e))(we||{});const Oe="Are you sure to delete it?",De="No data available",Ee="Select a Group first",Ie="Create a Group",Ne="Edit Group",Le="Create Group",Ge="Title",He="Color",_e="Save",Fe="Create",ze="Quick Messages Configs",Be="Created Successfully",qe="Cannot be saved: title already existing",Ke="Cannot be saved: title is empty",We="Cannot be saved: content is empty",Ue="Content",Ve="Import from Clipboard",Bn=Object.freeze(Object.defineProperty({__proto__:null,addNewGroup:Ie,cannotSavedMessageCuzContentEmpty:We,cannotSavedMessageCuzLabelEmpty:Ke,cannotSavedMessageCuzLabelExisted:qe,colorFieldName:He,confirmDelete:Oe,content:Ue,create:Fe,createGroup:Le,createSuccessfully:Be,default:{confirmDelete:Oe,noData:De,selectAGroupFirst:Ee,addNewGroup:Ie,editGroup:Ne,createGroup:Le,titleFieldName:Ge,colorFieldName:He,save:_e,create:Fe,quickMessageConfigs:ze,createSuccessfully:Be,cannotSavedMessageCuzLabelExisted:qe,cannotSavedMessageCuzLabelEmpty:Ke,cannotSavedMessageCuzContentEmpty:We,content:Ue,delete:"Delete",importFromClipboard:Ve},editGroup:Ne,importFromClipboard:Ve,noData:De,quickMessageConfigs:ze,save:_e,selectAGroupFirst:Ee,titleFieldName:Ge},Symbol.toStringTag,{value:"Module"})),Ye="确定删除吗?",Je="没有数据",Xe="请在左侧选择一个分组",Qe="添加一个分组",Ze="编辑分组",Re="新建分组",et="标题",tt="颜色",rt="保存",nt="创建",ot="快捷消息配置",at="创建成功",st="无法保存: 标题重复",it="无法保存: 标题不能为空",lt="无法保存: 内容不能为空",ct="内容",ut="从剪切板导入",dt=Object.entries(Object.assign({"./locales/en-US/common.json":Bn,"./locales/zh-CN/common.json":Object.freeze(Object.defineProperty({__proto__:null,addNewGroup:Qe,cannotSavedMessageCuzContentEmpty:lt,cannotSavedMessageCuzLabelEmpty:it,cannotSavedMessageCuzLabelExisted:st,colorFieldName:tt,confirmDelete:Ye,content:ct,create:nt,createGroup:Re,createSuccessfully:at,default:{confirmDelete:Ye,noData:Je,selectAGroupFirst:Xe,addNewGroup:Qe,editGroup:Ze,createGroup:Re,titleFieldName:et,colorFieldName:tt,save:rt,create:nt,quickMessageConfigs:ot,createSuccessfully:at,cannotSavedMessageCuzLabelExisted:st,cannotSavedMessageCuzLabelEmpty:it,cannotSavedMessageCuzContentEmpty:lt,content:ct,delete:"删除",importFromClipboard:ut},editGroup:Ze,importFromClipboard:ut,noData:Je,quickMessageConfigs:ot,save:rt,selectAGroupFirst:Xe,titleFieldName:et},Symbol.toStringTag,{value:"Module"}))})).reduce((e,t)=>{const[r,n]=t,a=r.match(/\/locales\/([\w-]+)\//),s=r.match(/\/([\w-_]+)\.json$/);return s&&a?(e[a[1]]=e[a[1]]||{},e[a[1]][s[1]]=n.default):console.error(`无法解析文件名称 path:${r}`),e},{}),pt=yt.createInstance();pt.init({lng:we.ZH_CN,debug:!1,ns:Object.keys(dt),resources:dt});const ft=b.createContext(null);function qn(e){return o.jsx(M.I18nextProvider,{i18n:pt,defaultNS:"common",children:o.jsx(ft.Provider,{value:{},children:e.children})})}f.AntdApiContext=F,f.AntdApiContextProviderCmp=Tt,f.EmojiPickerWrapper=mt,f.I18nContext=ft,f.I18nContextCmp=qn,f.MessageConfigsPanel=Ae,f.MessageConfigsPanelModalWrapper=Pe,f.MessagesEditTable=je,f.QuickMessages=_n,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
71
|
+
`;function zn(e){const t=b.useMemo(()=>{var s,d;const r=bt(e.data.color),n=r.isDark(),a=n?(s=r.lighten(.2))==null?void 0:s.hex():(d=r.darken(.15))==null?void 0:d.hex();return{$textColor:n?"#fff":"#333",$backgroundColor:e.data.color,$hoverColor:a}},[e.data.color]);return o.jsx(Fn,{...t,$active:e.active,"data-id":e.data.id,onClick:e.onClick,title:e.data.title,children:Z(e.data.title,e.displayTitleMaxLength)})}/*! This file was generated by vite-i18n-gen-resources-type check https://github.com/CRMChatReactComponent/vite-i18n-gen-resources-type. Please do not modify. */var we=(e=>(e.ZH_CN="zh-CN",e.EN_US="en-US",e))(we||{});const Oe="Are you sure to delete it?",De="No data available",Ee="Select a Group first",Ie="Create a Group",Ne="Edit Group",Le="Create Group",Ge="Title",He="Color",_e="Save",Fe="Create",ze="Quick Messages Configs",Be="Created Successfully",qe="Cannot be saved: title already existing",Ke="Cannot be saved: title is empty",We="Cannot be saved: content is empty",Ue="Content",Ve="Import from Clipboard",Bn=Object.freeze(Object.defineProperty({__proto__:null,addNewGroup:Ie,cannotSavedMessageCuzContentEmpty:We,cannotSavedMessageCuzLabelEmpty:Ke,cannotSavedMessageCuzLabelExisted:qe,colorFieldName:He,confirmDelete:Oe,content:Ue,create:Fe,createGroup:Le,createSuccessfully:Be,default:{confirmDelete:Oe,noData:De,selectAGroupFirst:Ee,addNewGroup:Ie,editGroup:Ne,createGroup:Le,titleFieldName:Ge,colorFieldName:He,save:_e,create:Fe,quickMessageConfigs:ze,createSuccessfully:Be,cannotSavedMessageCuzLabelExisted:qe,cannotSavedMessageCuzLabelEmpty:Ke,cannotSavedMessageCuzContentEmpty:We,content:Ue,delete:"Delete",importFromClipboard:Ve},editGroup:Ne,importFromClipboard:Ve,noData:De,quickMessageConfigs:ze,save:_e,selectAGroupFirst:Ee,titleFieldName:Ge},Symbol.toStringTag,{value:"Module"})),Ye="确定删除吗?",Je="没有数据",Xe="请在左侧选择一个分组",Qe="添加一个分组",Ze="编辑分组",Re="新建分组",et="标题",tt="颜色",rt="保存",nt="创建",ot="快捷消息配置",at="创建成功",st="无法保存: 标题重复",it="无法保存: 标题不能为空",lt="无法保存: 内容不能为空",ct="内容",ut="从剪切板导入",dt=Object.entries(Object.assign({"./locales/en-US/common.json":Bn,"./locales/zh-CN/common.json":Object.freeze(Object.defineProperty({__proto__:null,addNewGroup:Qe,cannotSavedMessageCuzContentEmpty:lt,cannotSavedMessageCuzLabelEmpty:it,cannotSavedMessageCuzLabelExisted:st,colorFieldName:tt,confirmDelete:Ye,content:ct,create:nt,createGroup:Re,createSuccessfully:at,default:{confirmDelete:Ye,noData:Je,selectAGroupFirst:Xe,addNewGroup:Qe,editGroup:Ze,createGroup:Re,titleFieldName:et,colorFieldName:tt,save:rt,create:nt,quickMessageConfigs:ot,createSuccessfully:at,cannotSavedMessageCuzLabelExisted:st,cannotSavedMessageCuzLabelEmpty:it,cannotSavedMessageCuzContentEmpty:lt,content:ct,delete:"删除",importFromClipboard:ut},editGroup:Ze,importFromClipboard:ut,noData:Je,quickMessageConfigs:ot,save:rt,selectAGroupFirst:Xe,titleFieldName:et},Symbol.toStringTag,{value:"Module"}))})).reduce((e,t)=>{const[r,n]=t,a=r.match(/\/locales\/([\w-]+)\//),s=r.match(/\/([\w-_]+)\.json$/);return s&&a?(e[a[1]]=e[a[1]]||{},e[a[1]][s[1]]=n.default):console.error(`无法解析文件名称 path:${r}`),e},{}),pt=yt.createInstance();pt.init({lng:we.ZH_CN,debug:!1,ns:Object.keys(dt),resources:dt});const ft=b.createContext(null);function qn(e){return o.jsx(M.I18nextProvider,{i18n:e.i18n||pt,defaultNS:"common",children:o.jsx(ft.Provider,{value:{},children:e.children})})}f.AntdApiContext=F,f.AntdApiContextProviderCmp=Tt,f.EmojiPickerWrapper=mt,f.I18nContext=ft,f.I18nContextCmp=qn,f.MessageConfigsPanel=Ae,f.MessageConfigsPanelModalWrapper=Pe,f.MessagesEditTable=je,f.QuickMessages=_n,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|