@crmchatreactcomponent/quick-messages 0.0.1
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/README.md +30 -0
- package/dist/__tests__/EmojiPickerWrapper.test.d.ts +1 -0
- package/dist/__tests__/MessageConfigsPanel.test.d.ts +1 -0
- package/dist/__tests__/MessageConfigsPanelModalWrapper.test.d.ts +1 -0
- package/dist/__tests__/MessagesEditTable.test.d.ts +1 -0
- package/dist/__tests__/QuickMessages.test.d.ts +1 -0
- package/dist/__tests__/helper/helper.d.ts +1 -0
- package/dist/components/EmojiPickerWrapper.d.ts +9 -0
- package/dist/components/MessageConfigsPanel.d.ts +9 -0
- package/dist/components/MessageConfigsPanelModalWrapper.d.ts +9 -0
- package/dist/components/MessagesEditTable.d.ts +13 -0
- package/dist/components/QuickMessages.d.ts +12 -0
- package/dist/context/AntdApiContext.d.ts +11 -0
- package/dist/context/I18nContext.d.ts +6 -0
- package/dist/hooks/useIsDark.d.ts +1 -0
- package/dist/i18n/genI18nEnum.d.ts +5 -0
- package/dist/i18n/init.d.ts +2 -0
- package/dist/i18n/langs.d.ts +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.es.js +3834 -0
- package/dist/index.umd.js +183 -0
- package/dist/stories/EmojiPickerWrapper.stories.d.ts +7 -0
- package/dist/stories/MessageConfigsPanel.stories.d.ts +7 -0
- package/dist/stories/MessageConfigsPanelModalWrapper.stories.d.ts +7 -0
- package/dist/stories/MessagesEditTable.stories.d.ts +7 -0
- package/dist/stories/QuickMessages.stories.d.ts +9 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/utils.d.ts +3 -0
- package/package.json +93 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## Expanding the ESLint configuration
|
|
11
|
+
|
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
13
|
+
|
|
14
|
+
- Configure the top-level `parserOptions` property like this:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
export default {
|
|
18
|
+
// other rules...
|
|
19
|
+
parserOptions: {
|
|
20
|
+
ecmaVersion: 'latest',
|
|
21
|
+
sourceType: 'module',
|
|
22
|
+
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
23
|
+
tsconfigRootDir: __dirname,
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
|
29
|
+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
|
30
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sleep(ms: number): Promise<unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
type EmojiPickerWrapperProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onSelect?: (emoji: string) => void;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const EmojiPickerWrapper: FC<EmojiPickerWrapperProps>;
|
|
9
|
+
export default EmojiPickerWrapper;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { MessagesEditTableProps } from "../components/MessagesEditTable";
|
|
3
|
+
import { MessagesGroupType } from "../types";
|
|
4
|
+
export type MessageConfigsPanelProps = {
|
|
5
|
+
data: MessagesGroupType[];
|
|
6
|
+
onChange: (data: MessagesGroupType[]) => void;
|
|
7
|
+
} & Pick<MessagesEditTableProps, "tableHeight" | "limitation">;
|
|
8
|
+
declare const MessageConfigsPanel: FC<MessageConfigsPanelProps>;
|
|
9
|
+
export default MessageConfigsPanel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { MessageConfigsPanelProps } from "../components/MessageConfigsPanel";
|
|
3
|
+
type MessageConfigsPanelDrawerWrapperProps = {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (bool: boolean) => void;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
} & MessageConfigsPanelProps;
|
|
8
|
+
declare const MessageConfigsPanelModalWrapper: FC<MessageConfigsPanelDrawerWrapperProps>;
|
|
9
|
+
export default MessageConfigsPanelModalWrapper;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { MessagesRecordType } from "../types";
|
|
3
|
+
export type MessagesEditTableProps = {
|
|
4
|
+
data: MessagesRecordType[];
|
|
5
|
+
onChange: (data: MessagesRecordType[]) => void;
|
|
6
|
+
tableHeight?: number | string;
|
|
7
|
+
limitation?: {
|
|
8
|
+
title?: number;
|
|
9
|
+
content?: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare const MessagesEditTable: FC<MessagesEditTableProps>;
|
|
13
|
+
export default MessagesEditTable;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { MessageConfigsPanelProps } from "../components/MessageConfigsPanel";
|
|
3
|
+
import { MessagesRecordType, SlotType } from "../types";
|
|
4
|
+
export type QuickMessagesProps = {
|
|
5
|
+
onSelect?: (message: MessagesRecordType) => void;
|
|
6
|
+
displayTitleMaxLength?: number;
|
|
7
|
+
displayMaxLength?: number;
|
|
8
|
+
SlotContentPrefixSlot?: SlotType;
|
|
9
|
+
SlotContentSuffixSlot?: SlotType;
|
|
10
|
+
} & MessageConfigsPanelProps;
|
|
11
|
+
declare const QuickMessages: FC<QuickMessagesProps>;
|
|
12
|
+
export default QuickMessages;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import type { MessageInstance } from "antd/es/message/interface";
|
|
3
|
+
import type { HookAPI } from "antd/es/modal/useModal";
|
|
4
|
+
export type AntdApiContextType = {
|
|
5
|
+
messageApi: MessageInstance;
|
|
6
|
+
modalApi: HookAPI;
|
|
7
|
+
};
|
|
8
|
+
export declare const AntdApiContext: import("react").Context<AntdApiContextType | null>;
|
|
9
|
+
export declare function AntdApiContextProviderCmp(props: {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsDark(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const localeTransitions: {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import EmojiPickerWrapper from "./components/EmojiPickerWrapper";
|
|
2
|
+
import MessageConfigsPanel from "./components/MessageConfigsPanel";
|
|
3
|
+
import MessageConfigsPanelModalWrapper from "./components/MessageConfigsPanelModalWrapper";
|
|
4
|
+
import MessagesEditTable from "./components/MessagesEditTable";
|
|
5
|
+
import QuickMessages from "./components/QuickMessages";
|
|
6
|
+
export * from "./types";
|
|
7
|
+
export * from "./context/AntdApiContext";
|
|
8
|
+
export * from "./context/I18nContext";
|
|
9
|
+
export { EmojiPickerWrapper, MessageConfigsPanel, MessageConfigsPanelModalWrapper, MessagesEditTable, QuickMessages, };
|