@pushwoosh/dumb-components 1.0.45 → 1.0.47
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/RichMessageEditor/RichMessageEditor.js +42 -39
- package/index.d.ts +2 -0
- package/index.js +3 -1
- package/package.json +1 -1
|
@@ -71,44 +71,47 @@ export const RichMessageEditor = ({
|
|
|
71
71
|
onSelectionChange: onSelectionChange
|
|
72
72
|
}, ({
|
|
73
73
|
editor
|
|
74
|
-
}) =>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
74
|
+
}) => {
|
|
75
|
+
var _getDcByPath;
|
|
76
|
+
return React.createElement(FieldBox, {
|
|
77
|
+
title: title,
|
|
78
|
+
boxRef: rootRef,
|
|
79
|
+
actions: React.createElement(Collapse, {
|
|
80
|
+
expanded: isFocused
|
|
81
|
+
}, React.createElement(Horizontal, {
|
|
82
|
+
"$gap": 8
|
|
83
|
+
}, canUsePersonalization && React.createElement(ImSpan, {
|
|
84
|
+
onClick: () => insertDynamicContent(editor)
|
|
85
|
+
}, React.createElement(PersonalizationIcon, null), "Personalization"), canUseEmoji && React.createElement(ImSpan, {
|
|
86
|
+
onClick: () => showDropArea({
|
|
87
|
+
type: 'emoji'
|
|
88
|
+
})
|
|
89
|
+
}, React.createElement(EmojiIcon, null), "Emoji")))
|
|
90
|
+
}, React.createElement(SlateEditable, {
|
|
91
|
+
minHeight: minHeight,
|
|
92
|
+
onFocus: () => {
|
|
93
|
+
setIsFocused(true);
|
|
94
|
+
const {
|
|
95
|
+
selection
|
|
96
|
+
} = editor;
|
|
97
|
+
if (selection) {
|
|
98
|
+
onSelectionChange(selection);
|
|
99
|
+
}
|
|
97
100
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
})
|
|
101
|
+
}), showDrop && React.createElement(DropContent, {
|
|
102
|
+
top: showDrop.yValue,
|
|
103
|
+
left: showDrop.xValue
|
|
104
|
+
}, showDrop.type === 'personalization' && (renderDynamicContent === null || renderDynamicContent === void 0 ? void 0 : renderDynamicContent({
|
|
105
|
+
dc: ((_getDcByPath = getDcByPath(editor.children, showDrop.path)) === null || _getDcByPath === void 0 ? void 0 : _getDcByPath.dc) || {},
|
|
106
|
+
onChange: newDC => {
|
|
107
|
+
Transforms.setNodes(editor, {
|
|
108
|
+
dc: newDC
|
|
109
|
+
}, {
|
|
110
|
+
at: showDrop.path
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
})), showDrop.type === 'emoji' && React.createElement(EmojiPicker, {
|
|
114
|
+
onEmojiSelect: s => editor.insertText(s)
|
|
115
|
+
})));
|
|
116
|
+
});
|
|
114
117
|
};
|
package/index.d.ts
CHANGED
|
@@ -34,3 +34,5 @@ export { FieldBox } from './FieldBox';
|
|
|
34
34
|
export { NumberPicker } from './NumberPicker';
|
|
35
35
|
export { CodeEditor } from './CodeEditor';
|
|
36
36
|
export { EnhancedInput, SearchInput } from './EnhancedInput';
|
|
37
|
+
export { Chip } from './Chip';
|
|
38
|
+
export { RichMessageEditor, RichMessageViewer } from './RichMessageEditor';
|
package/index.js
CHANGED
|
@@ -33,4 +33,6 @@ export { NativeInput, NativeTextarea, NativeSelect } from './native';
|
|
|
33
33
|
export { FieldBox } from './FieldBox';
|
|
34
34
|
export { NumberPicker } from './NumberPicker';
|
|
35
35
|
export { CodeEditor } from './CodeEditor';
|
|
36
|
-
export { EnhancedInput, SearchInput } from './EnhancedInput';
|
|
36
|
+
export { EnhancedInput, SearchInput } from './EnhancedInput';
|
|
37
|
+
export { Chip } from './Chip';
|
|
38
|
+
export { RichMessageEditor, RichMessageViewer } from './RichMessageEditor';
|