@visns-studio/visns-components 4.7.12 → 4.8.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/package.json +1 -1
- package/src/components/crm/Field.jsx +30 -1
package/package.json
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
76
76
|
},
|
|
77
77
|
"name": "@visns-studio/visns-components",
|
|
78
|
-
"version": "4.
|
|
78
|
+
"version": "4.8.1",
|
|
79
79
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
80
80
|
"main": "src/index.js",
|
|
81
81
|
"files": [
|
|
@@ -1141,12 +1141,41 @@ function Field({
|
|
|
1141
1141
|
'code',
|
|
1142
1142
|
],
|
|
1143
1143
|
toolbar:
|
|
1144
|
-
'undo redo | blocks | ' +
|
|
1144
|
+
'insertTextDropdown | undo redo | blocks | ' +
|
|
1145
1145
|
'bold italic forecolor | alignleft aligncenter ' +
|
|
1146
1146
|
'alignright alignjustify | bullist numlist outdent indent | ' +
|
|
1147
1147
|
'removeformat | table',
|
|
1148
1148
|
content_style:
|
|
1149
1149
|
'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }',
|
|
1150
|
+
setup: (editor) => {
|
|
1151
|
+
// Check if insertText exists and is an array of objects
|
|
1152
|
+
if (
|
|
1153
|
+
settings.insertText &&
|
|
1154
|
+
Array.isArray(settings.insertText) &&
|
|
1155
|
+
settings.insertText.length > 0
|
|
1156
|
+
) {
|
|
1157
|
+
editor.ui.registry.addMenuButton(
|
|
1158
|
+
'insertTextDropdown',
|
|
1159
|
+
{
|
|
1160
|
+
text: 'Insert Text',
|
|
1161
|
+
fetch: (callback) => {
|
|
1162
|
+
const items =
|
|
1163
|
+
settings.insertText.map(
|
|
1164
|
+
(textObj) => ({
|
|
1165
|
+
type: 'menuitem',
|
|
1166
|
+
text: textObj.text,
|
|
1167
|
+
onAction: () =>
|
|
1168
|
+
editor.insertContent(
|
|
1169
|
+
textObj.content
|
|
1170
|
+
),
|
|
1171
|
+
})
|
|
1172
|
+
);
|
|
1173
|
+
callback(items);
|
|
1174
|
+
},
|
|
1175
|
+
}
|
|
1176
|
+
);
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1150
1179
|
}}
|
|
1151
1180
|
/>
|
|
1152
1181
|
);
|