@pushwoosh/dumb-components 1.0.62 → 1.0.64
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/Chip/Chip.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const Chip: React.ForwardRefExoticComponent<{
|
|
|
3
3
|
$variant?: import("./Chip.types").ChipVariant;
|
|
4
4
|
$selected?: boolean;
|
|
5
5
|
$onClose?: React.HTMLAttributes<HTMLDivElement>["onClick"];
|
|
6
|
+
as?: string;
|
|
6
7
|
} & {
|
|
7
8
|
children?: React.ReactNode | undefined;
|
|
8
9
|
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
package/Chip/Chip.js
CHANGED
|
@@ -6,6 +6,7 @@ export const Chip = forwardRef(({
|
|
|
6
6
|
$selected,
|
|
7
7
|
$onClose,
|
|
8
8
|
children,
|
|
9
|
+
as,
|
|
9
10
|
...rest
|
|
10
11
|
}, ref) => {
|
|
11
12
|
return React.createElement(ChipStyled, {
|
|
@@ -13,6 +14,7 @@ export const Chip = forwardRef(({
|
|
|
13
14
|
"$variant": $variant,
|
|
14
15
|
"$selected": $selected,
|
|
15
16
|
"$closeable": !!$onClose,
|
|
17
|
+
as: as,
|
|
16
18
|
...rest
|
|
17
19
|
}, children, $onClose && React.createElement(CloseIcon, {
|
|
18
20
|
size: "small",
|
package/Chip/Chip.types.d.ts
CHANGED
|
@@ -25,7 +25,8 @@ export const RichMessageEditor = ({
|
|
|
25
25
|
const [isFocused, setIsFocused] = useState(false);
|
|
26
26
|
const {
|
|
27
27
|
refs,
|
|
28
|
-
floatingStyles
|
|
28
|
+
floatingStyles,
|
|
29
|
+
update
|
|
29
30
|
} = useFloating({
|
|
30
31
|
middleware: [offset(8), autoPlacement({
|
|
31
32
|
allowedPlacements: ['left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']
|
|
@@ -125,7 +126,8 @@ export const RichMessageEditor = ({
|
|
|
125
126
|
} else {
|
|
126
127
|
insertDynamicContent(editor, newDC);
|
|
127
128
|
}
|
|
128
|
-
}
|
|
129
|
+
},
|
|
130
|
+
update
|
|
129
131
|
})), showDrop.type === 'emoji' && React.createElement(EmojiPicker, {
|
|
130
132
|
onEmojiSelect: s => editor.insertText(s)
|
|
131
133
|
})));
|
|
@@ -8,6 +8,11 @@ export type DropValueEmoji = {
|
|
|
8
8
|
type: 'emoji';
|
|
9
9
|
};
|
|
10
10
|
export type DropValue = DropValueEmoji | DropValuePersonalization;
|
|
11
|
+
export type RenderDynamicContentProps = {
|
|
12
|
+
dc?: DynamicContent;
|
|
13
|
+
onChange: (newDC: DynamicContent) => void;
|
|
14
|
+
update: () => void;
|
|
15
|
+
};
|
|
11
16
|
export type RichMessageEditorProps = {
|
|
12
17
|
title: ReactNode;
|
|
13
18
|
initialValue: string;
|
|
@@ -17,8 +22,5 @@ export type RichMessageEditorProps = {
|
|
|
17
22
|
canUsePersonalization?: boolean;
|
|
18
23
|
canUseEmoji?: boolean;
|
|
19
24
|
onBlur?: () => void;
|
|
20
|
-
renderDynamicContent?: (props:
|
|
21
|
-
dc?: DynamicContent;
|
|
22
|
-
onChange: (newDC: DynamicContent) => void;
|
|
23
|
-
}) => ReactNode;
|
|
25
|
+
renderDynamicContent?: (props: RenderDynamicContentProps) => ReactNode;
|
|
24
26
|
};
|