@kaizen/components 2.0.4 → 2.0.6
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/cjs/src/RichTextEditor/RichTextEditor/RichTextEditor.cjs +9 -24
- package/dist/cjs/src/RichTextEditor/RichTextEditor/RichTextEditor.module.scss.cjs +1 -1
- package/dist/cjs/src/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/ToolbarControls.cjs +51 -0
- package/dist/cjs/src/RichTextEditor/RichTextEditor/utils/controlmap.cjs +44 -10
- package/dist/cjs/src/SingleSelect/SingleSelect.cjs +2 -0
- package/dist/cjs/src/Tile/InformationTile/InformationTile.cjs +2 -0
- package/dist/cjs/src/Tile/MultiActionTile/MultiActionTile.cjs +2 -0
- package/dist/cjs/src/Tile/TileGrid/TileGrid.cjs +2 -0
- package/dist/esm/src/RichTextEditor/RichTextEditor/RichTextEditor.mjs +10 -25
- package/dist/esm/src/RichTextEditor/RichTextEditor/RichTextEditor.module.scss.mjs +1 -1
- package/dist/esm/src/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/ToolbarControls.mjs +43 -0
- package/dist/esm/src/RichTextEditor/RichTextEditor/utils/controlmap.mjs +44 -10
- package/dist/esm/src/SingleSelect/SingleSelect.mjs +2 -0
- package/dist/esm/src/Tile/InformationTile/InformationTile.mjs +2 -0
- package/dist/esm/src/Tile/MultiActionTile/MultiActionTile.mjs +2 -0
- package/dist/esm/src/Tile/TileGrid/TileGrid.mjs +2 -0
- package/dist/styles.css +7 -16
- package/dist/types/RichTextEditor/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/dist/types/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/ToolbarControls.d.ts +12 -0
- package/dist/types/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/index.d.ts +1 -0
- package/dist/types/RichTextEditor/RichTextEditor/utils/controlmap.d.ts +1 -1
- package/dist/types/SingleSelect/SingleSelect.d.ts +2 -0
- package/dist/types/Tile/InformationTile/InformationTile.d.ts +2 -0
- package/dist/types/Tile/MultiActionTile/MultiActionTile.d.ts +2 -0
- package/dist/types/Tile/TileGrid/TileGrid.d.ts +2 -0
- package/locales/ar.json +37 -1
- package/locales/bg.json +37 -1
- package/locales/cs.json +37 -1
- package/locales/cy.json +37 -1
- package/locales/da.json +37 -1
- package/locales/de.json +37 -1
- package/locales/el.json +37 -1
- package/locales/en-GB.json +37 -1
- package/locales/en.json +37 -1
- package/locales/es-419.json +37 -1
- package/locales/es.json +37 -1
- package/locales/et.json +37 -1
- package/locales/fi.json +37 -1
- package/locales/fr-CA.json +37 -1
- package/locales/fr.json +37 -1
- package/locales/he.json +37 -1
- package/locales/hi.json +37 -1
- package/locales/ht.json +37 -1
- package/locales/hu.json +37 -1
- package/locales/id.json +37 -1
- package/locales/it.json +37 -1
- package/locales/ja.json +37 -1
- package/locales/km-KH.json +37 -1
- package/locales/ko.json +37 -1
- package/locales/lt.json +37 -1
- package/locales/lv.json +37 -1
- package/locales/mi.json +37 -1
- package/locales/ms.json +37 -1
- package/locales/nb.json +37 -1
- package/locales/nl.json +37 -1
- package/locales/pl.json +37 -1
- package/locales/pt-BR.json +37 -1
- package/locales/pt.json +37 -1
- package/locales/ro.json +37 -1
- package/locales/ru.json +37 -1
- package/locales/si-LK.json +37 -1
- package/locales/sk.json +37 -1
- package/locales/sr.json +37 -1
- package/locales/sv.json +37 -1
- package/locales/th.json +37 -1
- package/locales/tl.json +37 -1
- package/locales/tr.json +37 -1
- package/locales/uk.json +37 -1
- package/locales/vi.json +37 -1
- package/locales/zh-TW.json +37 -1
- package/locales/zh.json +37 -1
- package/package.json +1 -1
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.module.scss +8 -20
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.spec.tsx +4 -4
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.tsx +12 -30
- package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.module.scss +0 -1
- package/src/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/ToolbarControls.tsx +62 -0
- package/src/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/index.ts +1 -0
- package/src/RichTextEditor/RichTextEditor/utils/controlmap.tsx +46 -9
- package/src/RichTextEditor/utils/commands/fixtures/data.json +1 -1
- package/src/RichTextEditor/utils/commands/listIsActive.spec.ts +2 -2
- package/src/SingleSelect/SingleSelect.tsx +2 -0
- package/src/SingleSelect/_docs/SingleSelect--api-specification.mdx +4 -2
- package/src/SingleSelect/_docs/SingleSelect--usage-guidelines.mdx +10 -2
- package/src/SingleSelect/_docs/SingleSelect.stickersheet.stories.tsx +1 -1
- package/src/SingleSelect/_docs/SingleSelect.stories.tsx +1 -1
- package/src/Tile/InformationTile/InformationTile.tsx +2 -0
- package/src/Tile/InformationTile/_docs/InformationTile.mdx +3 -1
- package/src/Tile/InformationTile/_docs/InformationTile.stickersheet.stories.tsx +1 -1
- package/src/Tile/InformationTile/_docs/InformationTile.stories.tsx +1 -1
- package/src/Tile/MultiActionTile/MultiActionTile.tsx +2 -0
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.mdx +3 -1
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.stickersheet.stories.tsx +1 -1
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.stories.tsx +1 -1
- package/src/Tile/TileGrid/TileGrid.tsx +2 -0
- package/src/Tile/TileGrid/_docs/TileGrid.mdx +3 -1
- package/src/Tile/TileGrid/_docs/TileGrid.stickersheet.stories.tsx +1 -1
- package/src/Tile/TileGrid/_docs/TileGrid.stories.tsx +1 -1
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css +0 -4
|
@@ -24,10 +24,7 @@ var ProseMirrorKeymap = require('prosemirror-keymap');
|
|
|
24
24
|
var ProseMirrorHistory = require('prosemirror-history');
|
|
25
25
|
require('prosemirror-schema-list');
|
|
26
26
|
var schema = require('./schema.cjs');
|
|
27
|
-
var
|
|
28
|
-
var Toolbar = require('./subcomponents/Toolbar/Toolbar.cjs');
|
|
29
|
-
var ToolbarSection = require('./subcomponents/ToolbarSection/ToolbarSection.cjs');
|
|
30
|
-
var controlmap = require('./utils/controlmap.cjs');
|
|
27
|
+
var ToolbarControls = require('./subcomponents/ToolbarControls/ToolbarControls.cjs');
|
|
31
28
|
var inputrules = require('./utils/inputrules.cjs');
|
|
32
29
|
var keymap = require('./utils/keymap.cjs');
|
|
33
30
|
var RichTextEditor_module = require('./RichTextEditor.module.scss.cjs');
|
|
@@ -130,7 +127,6 @@ var RichTextEditor = function (_a) {
|
|
|
130
127
|
var editorRef = useRichTextEditorResult[0],
|
|
131
128
|
editorState = useRichTextEditorResult[1],
|
|
132
129
|
dispatchTransaction = useRichTextEditorResult[2];
|
|
133
|
-
var controlMap = controlmap.buildControlMap(schema$1, editorState, controls);
|
|
134
130
|
// @todo: Fix if possible - avoiding breaking in eslint upgrade
|
|
135
131
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
136
132
|
React.useEffect(function () {
|
|
@@ -144,25 +140,14 @@ var RichTextEditor = function (_a) {
|
|
|
144
140
|
labelText: labelText
|
|
145
141
|
}), React__default.default.createElement("div", {
|
|
146
142
|
className: classnames__default.default(RichTextEditor_module.editorWrapper, RichTextEditor_module[status])
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
return React__default.default.createElement(ToggleIconButton.ToggleIconButton, {
|
|
156
|
-
key: controlKeyIndex,
|
|
157
|
-
icon: controlConfig.icon,
|
|
158
|
-
disabled: controlConfig.disabled,
|
|
159
|
-
label: controlConfig.label,
|
|
160
|
-
isActive: controlConfig.isActive,
|
|
161
|
-
onClick: function () {
|
|
162
|
-
return dispatchTransaction(controlConfig.action);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}));
|
|
143
|
+
}, React__default.default.createElement("div", {
|
|
144
|
+
className: RichTextEditor_module.toolbarWrapper
|
|
145
|
+
}, React__default.default.createElement(ToolbarControls.ToolbarControls, {
|
|
146
|
+
editorId: editorId,
|
|
147
|
+
controls: controls,
|
|
148
|
+
editorState: editorState,
|
|
149
|
+
schema: schema$1,
|
|
150
|
+
dispatchTransaction: dispatchTransaction
|
|
166
151
|
})), React__default.default.createElement("div", tslib.__assign({
|
|
167
152
|
id: editorId,
|
|
168
153
|
ref: editorRef,
|
|
@@ -4,8 +4,8 @@ var styles = {
|
|
|
4
4
|
"editor": "RichTextEditor-module_editor__pVKqW",
|
|
5
5
|
"hasToolbar": "RichTextEditor-module_hasToolbar__EBxnG",
|
|
6
6
|
"editorLabel": "RichTextEditor-module_editorLabel__om-dJ",
|
|
7
|
+
"toolbarWrapper": "RichTextEditor-module_toolbarWrapper__wkBl-",
|
|
7
8
|
"editorWrapper": "RichTextEditor-module_editorWrapper__5q3mG",
|
|
8
|
-
"toolbar": "RichTextEditor-module_toolbar__ceLvw",
|
|
9
9
|
"error": "RichTextEditor-module_error__Xugz8",
|
|
10
10
|
"caution": "RichTextEditor-module_caution__6q0z6",
|
|
11
11
|
"rows1": "RichTextEditor-module_rows1__DDEf4",
|
package/dist/cjs/src/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/ToolbarControls.cjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var i18nReactIntl = require('@cultureamp/i18n-react-intl');
|
|
5
|
+
var controlmap = require('../../utils/controlmap.cjs');
|
|
6
|
+
var ToggleIconButton = require('../ToggleIconButton/ToggleIconButton.cjs');
|
|
7
|
+
var Toolbar = require('../Toolbar/Toolbar.cjs');
|
|
8
|
+
var ToolbarSection = require('../ToolbarSection/ToolbarSection.cjs');
|
|
9
|
+
function _interopDefault(e) {
|
|
10
|
+
return e && e.__esModule ? e : {
|
|
11
|
+
default: e
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
15
|
+
var ToolbarControls = function (_a) {
|
|
16
|
+
var editorId = _a.editorId,
|
|
17
|
+
controls = _a.controls,
|
|
18
|
+
editorState = _a.editorState,
|
|
19
|
+
schema = _a.schema,
|
|
20
|
+
dispatchTransaction = _a.dispatchTransaction;
|
|
21
|
+
var controlMap = controlmap.useControlMap(schema, editorState, controls);
|
|
22
|
+
var formatMessage = i18nReactIntl.useIntl().formatMessage;
|
|
23
|
+
var handleControlClick = React.useCallback(function (action) {
|
|
24
|
+
dispatchTransaction(action);
|
|
25
|
+
}, [dispatchTransaction]);
|
|
26
|
+
if (controlMap.length <= 0) return null;
|
|
27
|
+
return React__default.default.createElement(Toolbar.Toolbar, {
|
|
28
|
+
"aria-controls": editorId,
|
|
29
|
+
"aria-label": formatMessage({
|
|
30
|
+
id: 'kz.rte.toolbar.aria_label',
|
|
31
|
+
defaultMessage: 'Text formatting',
|
|
32
|
+
description: 'Label for the text formatting toolbar in a Rich Text Editor'
|
|
33
|
+
})
|
|
34
|
+
}, controlMap.map(function (section, index) {
|
|
35
|
+
return React__default.default.createElement(ToolbarSection.ToolbarSection, {
|
|
36
|
+
key: index
|
|
37
|
+
}, section.map(function (controlConfig, controlKeyIndex) {
|
|
38
|
+
return React__default.default.createElement(ToggleIconButton.ToggleIconButton, {
|
|
39
|
+
key: controlKeyIndex,
|
|
40
|
+
icon: controlConfig.icon,
|
|
41
|
+
disabled: controlConfig.disabled,
|
|
42
|
+
label: controlConfig.label,
|
|
43
|
+
isActive: controlConfig.isActive,
|
|
44
|
+
onClick: function () {
|
|
45
|
+
return handleControlClick(controlConfig.action);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}));
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
exports.ToolbarControls = ToolbarControls;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var tslib = require('tslib');
|
|
4
4
|
var React = require('react');
|
|
5
|
+
var i18nReactIntl = require('@cultureamp/i18n-react-intl');
|
|
5
6
|
var Icon = require('../../../Icon/Icon.cjs');
|
|
6
7
|
var listIsActive = require('../../utils/commands/listIsActive.cjs');
|
|
7
8
|
var markIsActive = require('../../utils/commands/markIsActive.cjs');
|
|
@@ -170,8 +171,9 @@ var filterToolbarControls = function (groupedControls) {
|
|
|
170
171
|
});
|
|
171
172
|
};
|
|
172
173
|
/** Builds an array of object used to map control configuration to rte toolbar buttons */
|
|
173
|
-
var
|
|
174
|
+
var useControlMap = function (schema, editorState, controls) {
|
|
174
175
|
var _a, _b;
|
|
176
|
+
var formatMessage = i18nReactIntl.useIntl().formatMessage;
|
|
175
177
|
if (!controls) return [];
|
|
176
178
|
var controlGroupIndex = createControlGroupIndex(controls);
|
|
177
179
|
var toolbarControls = createInitialControls(controlGroupIndex);
|
|
@@ -182,7 +184,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
182
184
|
toolbarControls[groupIndex].push({
|
|
183
185
|
isActive: markIsActive.markIsActive(editorState, type),
|
|
184
186
|
action: createToggleMarkCommand(type),
|
|
185
|
-
label:
|
|
187
|
+
label: formatMessage({
|
|
188
|
+
id: 'kz.rte.bold',
|
|
189
|
+
defaultMessage: 'Bold',
|
|
190
|
+
description: 'Label for the "Bold" button in a text editor'
|
|
191
|
+
}),
|
|
186
192
|
icon: React__default.default.createElement(Icon.Icon, {
|
|
187
193
|
name: "format_bold",
|
|
188
194
|
isPresentational: true
|
|
@@ -195,7 +201,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
195
201
|
toolbarControls[groupIndex].push({
|
|
196
202
|
isActive: markIsActive.markIsActive(editorState, type),
|
|
197
203
|
action: createToggleMarkCommand(type),
|
|
198
|
-
label:
|
|
204
|
+
label: formatMessage({
|
|
205
|
+
id: 'kz.rte.italic',
|
|
206
|
+
defaultMessage: 'Italic',
|
|
207
|
+
description: 'Label for the "Italic" button in a text editor'
|
|
208
|
+
}),
|
|
199
209
|
icon: React__default.default.createElement(Icon.Icon, {
|
|
200
210
|
name: "format_italic",
|
|
201
211
|
isPresentational: true
|
|
@@ -208,7 +218,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
208
218
|
toolbarControls[groupIndex].push({
|
|
209
219
|
isActive: markIsActive.markIsActive(editorState, type),
|
|
210
220
|
action: createToggleMarkCommand(type),
|
|
211
|
-
label:
|
|
221
|
+
label: formatMessage({
|
|
222
|
+
id: 'kz.rte.underline',
|
|
223
|
+
defaultMessage: 'Underline',
|
|
224
|
+
description: 'Label for the "Underline" button in a text editor'
|
|
225
|
+
}),
|
|
212
226
|
icon: React__default.default.createElement(Icon.Icon, {
|
|
213
227
|
name: "format_underlined",
|
|
214
228
|
isPresentational: true
|
|
@@ -221,7 +235,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
221
235
|
toolbarControls[groupIndex].push({
|
|
222
236
|
action: createToggleListCommand(type),
|
|
223
237
|
isActive: listIsActive.listIsActive(editorState, type, listNodes),
|
|
224
|
-
label:
|
|
238
|
+
label: formatMessage({
|
|
239
|
+
id: 'kz.rte.bullet_list',
|
|
240
|
+
defaultMessage: 'Bullet list',
|
|
241
|
+
description: 'Label for the "Bullet list" button in a text editor'
|
|
242
|
+
}),
|
|
225
243
|
icon: React__default.default.createElement(Icon.Icon, {
|
|
226
244
|
name: "format_list_bulleted",
|
|
227
245
|
isPresentational: true,
|
|
@@ -235,7 +253,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
235
253
|
toolbarControls[groupIndex].push({
|
|
236
254
|
action: createToggleListCommand(type),
|
|
237
255
|
isActive: listIsActive.listIsActive(editorState, type, listNodes),
|
|
238
|
-
label:
|
|
256
|
+
label: formatMessage({
|
|
257
|
+
id: 'kz.rte.numbered_list',
|
|
258
|
+
defaultMessage: 'Numbered list',
|
|
259
|
+
description: 'Label for the "Numbered list" button in a text editor'
|
|
260
|
+
}),
|
|
239
261
|
icon: React__default.default.createElement(Icon.Icon, {
|
|
240
262
|
name: "format_list_numbered",
|
|
241
263
|
isPresentational: true,
|
|
@@ -249,7 +271,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
249
271
|
action: createLiftListCommand(),
|
|
250
272
|
disabled: liftListIsDisabled(editorState),
|
|
251
273
|
isActive: false,
|
|
252
|
-
label:
|
|
274
|
+
label: formatMessage({
|
|
275
|
+
id: 'kz.rte.decrease_indent',
|
|
276
|
+
defaultMessage: 'Decrease indent',
|
|
277
|
+
description: 'Label for the "Decrease indent" button in a text editor'
|
|
278
|
+
}),
|
|
253
279
|
icon: React__default.default.createElement(Icon.Icon, {
|
|
254
280
|
name: "format_indent_decrease",
|
|
255
281
|
isPresentational: true,
|
|
@@ -259,7 +285,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
259
285
|
action: createIndentListCommand(),
|
|
260
286
|
disabled: indentListIsDisabled(editorState),
|
|
261
287
|
isActive: false,
|
|
262
|
-
label:
|
|
288
|
+
label: formatMessage({
|
|
289
|
+
id: 'kz.rte.increase_indent',
|
|
290
|
+
defaultMessage: 'Increase indent',
|
|
291
|
+
description: 'Label for the "Increase indent" button in a text editor'
|
|
292
|
+
}),
|
|
263
293
|
icon: React__default.default.createElement(Icon.Icon, {
|
|
264
294
|
name: "format_indent_increase",
|
|
265
295
|
isPresentational: true,
|
|
@@ -274,7 +304,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
274
304
|
action: createToggleMarkCommand(type),
|
|
275
305
|
disabled: editorState.selection.empty,
|
|
276
306
|
isActive: false,
|
|
277
|
-
label:
|
|
307
|
+
label: formatMessage({
|
|
308
|
+
id: 'kz.rte.link',
|
|
309
|
+
defaultMessage: 'Link',
|
|
310
|
+
description: 'Label for the "Link" button in a text editor that allows the creation of hyperlinks in the text'
|
|
311
|
+
}),
|
|
278
312
|
icon: React__default.default.createElement(Icon.Icon, {
|
|
279
313
|
name: "add_link",
|
|
280
314
|
isPresentational: true
|
|
@@ -283,4 +317,4 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
283
317
|
}
|
|
284
318
|
return filterToolbarControls(toolbarControls);
|
|
285
319
|
};
|
|
286
|
-
exports.
|
|
320
|
+
exports.useControlMap = useControlMap;
|
|
@@ -31,6 +31,8 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
31
31
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
+
* @deprecated SingleSelect is deprecated in v3 and will be replaced in v4.
|
|
35
|
+
*
|
|
34
36
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896474/Select Guidance} |
|
|
35
37
|
* {@link https://cultureamp.design/?path=/docs/components-select--docs Storybook}
|
|
36
38
|
*/
|
|
@@ -11,6 +11,8 @@ function _interopDefault(e) {
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
+
* @deprecated InformationTile is deprecated in v3 and will be removed in v4.
|
|
15
|
+
*
|
|
14
16
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#InformationTile%3A Guidance} |
|
|
15
17
|
* {@link https://cultureamp.design/?path=/docs/components-tiles-informationtile--docs Storybook}
|
|
16
18
|
*/
|
|
@@ -22,6 +22,8 @@ var renderActions = function (primaryAction, secondaryAction) {
|
|
|
22
22
|
}, secondaryAction))), React__default.default.createElement(Button.Button, tslib.__assign({}, primaryAction)));
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
+
* @deprecated MultiActionTile is deprecated in v3 and will be removed in v4.
|
|
26
|
+
*
|
|
25
27
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#MultiActionTile.1 Guidance} |
|
|
26
28
|
* {@link https://cultureamp.design/?path=/docs/components-tiles-multiactiontile--docs Storybook}
|
|
27
29
|
*/
|
|
@@ -13,6 +13,8 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
13
13
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
+
* @deprecated TileGrid is deprecated in v3 and will be removed in v4.
|
|
17
|
+
*
|
|
16
18
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#TileGrid Guidance} |
|
|
17
19
|
* {@link https://cultureamp.design/storybook/?path=/docs/components-tiles-tilegrid--docs Storybook}
|
|
18
20
|
*/
|
|
@@ -22,10 +22,7 @@ import * as ProseMirrorKeymap from 'prosemirror-keymap';
|
|
|
22
22
|
import * as ProseMirrorHistory from 'prosemirror-history';
|
|
23
23
|
import 'prosemirror-schema-list';
|
|
24
24
|
import { createSchemaFromControls } from './schema.mjs';
|
|
25
|
-
import {
|
|
26
|
-
import { Toolbar } from './subcomponents/Toolbar/Toolbar.mjs';
|
|
27
|
-
import { ToolbarSection } from './subcomponents/ToolbarSection/ToolbarSection.mjs';
|
|
28
|
-
import { buildControlMap } from './utils/controlmap.mjs';
|
|
25
|
+
import { ToolbarControls } from './subcomponents/ToolbarControls/ToolbarControls.mjs';
|
|
29
26
|
import { buildInputRules } from './utils/inputrules.mjs';
|
|
30
27
|
import { buildKeymap } from './utils/keymap.mjs';
|
|
31
28
|
import styles from './RichTextEditor.module.scss.mjs';
|
|
@@ -98,7 +95,6 @@ const RichTextEditor = /*#__PURE__*/function () {
|
|
|
98
95
|
var editorRef = useRichTextEditorResult[0],
|
|
99
96
|
editorState = useRichTextEditorResult[1],
|
|
100
97
|
dispatchTransaction = useRichTextEditorResult[2];
|
|
101
|
-
var controlMap = buildControlMap(schema, editorState, controls);
|
|
102
98
|
// @todo: Fix if possible - avoiding breaking in eslint upgrade
|
|
103
99
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
104
100
|
useEffect(function () {
|
|
@@ -112,26 +108,15 @@ const RichTextEditor = /*#__PURE__*/function () {
|
|
|
112
108
|
labelText: labelText
|
|
113
109
|
})), /*#__PURE__*/React.createElement("div", {
|
|
114
110
|
className: classnames(styles.editorWrapper, styles[status])
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
key: controlKeyIndex,
|
|
125
|
-
icon: controlConfig.icon,
|
|
126
|
-
disabled: controlConfig.disabled,
|
|
127
|
-
label: controlConfig.label,
|
|
128
|
-
isActive: controlConfig.isActive,
|
|
129
|
-
onClick: function () {
|
|
130
|
-
return dispatchTransaction(controlConfig.action);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}));
|
|
134
|
-
}))), /*#__PURE__*/React.createElement("div", __assign({
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: styles.toolbarWrapper
|
|
113
|
+
}, /*#__PURE__*/React.createElement(ToolbarControls, {
|
|
114
|
+
editorId: editorId,
|
|
115
|
+
controls: controls,
|
|
116
|
+
editorState: editorState,
|
|
117
|
+
schema: schema,
|
|
118
|
+
dispatchTransaction: dispatchTransaction
|
|
119
|
+
})), /*#__PURE__*/React.createElement("div", __assign({
|
|
135
120
|
id: editorId,
|
|
136
121
|
ref: editorRef,
|
|
137
122
|
className: classnames(styles.editor, styles["rows".concat(rows)], classNameOverride, controls != null && controls.length > 0 && styles.hasToolbar)
|
|
@@ -2,8 +2,8 @@ var styles = {
|
|
|
2
2
|
"editor": "RichTextEditor-module_editor__pVKqW",
|
|
3
3
|
"hasToolbar": "RichTextEditor-module_hasToolbar__EBxnG",
|
|
4
4
|
"editorLabel": "RichTextEditor-module_editorLabel__om-dJ",
|
|
5
|
+
"toolbarWrapper": "RichTextEditor-module_toolbarWrapper__wkBl-",
|
|
5
6
|
"editorWrapper": "RichTextEditor-module_editorWrapper__5q3mG",
|
|
6
|
-
"toolbar": "RichTextEditor-module_toolbar__ceLvw",
|
|
7
7
|
"error": "RichTextEditor-module_error__Xugz8",
|
|
8
8
|
"caution": "RichTextEditor-module_caution__6q0z6",
|
|
9
9
|
"rows1": "RichTextEditor-module_rows1__DDEf4",
|
package/dist/esm/src/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/ToolbarControls.mjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useIntl } from '@cultureamp/i18n-react-intl';
|
|
3
|
+
import { useControlMap } from '../../utils/controlmap.mjs';
|
|
4
|
+
import { ToggleIconButton } from '../ToggleIconButton/ToggleIconButton.mjs';
|
|
5
|
+
import { Toolbar } from '../Toolbar/Toolbar.mjs';
|
|
6
|
+
import { ToolbarSection } from '../ToolbarSection/ToolbarSection.mjs';
|
|
7
|
+
var ToolbarControls = function (_a) {
|
|
8
|
+
var editorId = _a.editorId,
|
|
9
|
+
controls = _a.controls,
|
|
10
|
+
editorState = _a.editorState,
|
|
11
|
+
schema = _a.schema,
|
|
12
|
+
dispatchTransaction = _a.dispatchTransaction;
|
|
13
|
+
var controlMap = useControlMap(schema, editorState, controls);
|
|
14
|
+
var formatMessage = useIntl().formatMessage;
|
|
15
|
+
var handleControlClick = useCallback(function (action) {
|
|
16
|
+
dispatchTransaction(action);
|
|
17
|
+
}, [dispatchTransaction]);
|
|
18
|
+
if (controlMap.length <= 0) return null;
|
|
19
|
+
return /*#__PURE__*/React.createElement(Toolbar, {
|
|
20
|
+
"aria-controls": editorId,
|
|
21
|
+
"aria-label": formatMessage({
|
|
22
|
+
id: 'kz.rte.toolbar.aria_label',
|
|
23
|
+
defaultMessage: 'Text formatting',
|
|
24
|
+
description: 'Label for the text formatting toolbar in a Rich Text Editor'
|
|
25
|
+
})
|
|
26
|
+
}, controlMap.map(function (section, index) {
|
|
27
|
+
return /*#__PURE__*/React.createElement(ToolbarSection, {
|
|
28
|
+
key: index
|
|
29
|
+
}, section.map(function (controlConfig, controlKeyIndex) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(ToggleIconButton, {
|
|
31
|
+
key: controlKeyIndex,
|
|
32
|
+
icon: controlConfig.icon,
|
|
33
|
+
disabled: controlConfig.disabled,
|
|
34
|
+
label: controlConfig.label,
|
|
35
|
+
isActive: controlConfig.isActive,
|
|
36
|
+
onClick: function () {
|
|
37
|
+
return handleControlClick(controlConfig.action);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}));
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
export { ToolbarControls };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __assign } from 'tslib';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useIntl } from '@cultureamp/i18n-react-intl';
|
|
3
4
|
import { Icon } from '../../../Icon/Icon.mjs';
|
|
4
5
|
import { listIsActive } from '../../utils/commands/listIsActive.mjs';
|
|
5
6
|
import { markIsActive } from '../../utils/commands/markIsActive.mjs';
|
|
@@ -141,8 +142,9 @@ var filterToolbarControls = function (groupedControls) {
|
|
|
141
142
|
});
|
|
142
143
|
};
|
|
143
144
|
/** Builds an array of object used to map control configuration to rte toolbar buttons */
|
|
144
|
-
var
|
|
145
|
+
var useControlMap = function (schema, editorState, controls) {
|
|
145
146
|
var _a, _b;
|
|
147
|
+
var formatMessage = useIntl().formatMessage;
|
|
146
148
|
if (!controls) return [];
|
|
147
149
|
var controlGroupIndex = createControlGroupIndex(controls);
|
|
148
150
|
var toolbarControls = createInitialControls(controlGroupIndex);
|
|
@@ -153,7 +155,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
153
155
|
toolbarControls[groupIndex].push({
|
|
154
156
|
isActive: markIsActive(editorState, type),
|
|
155
157
|
action: createToggleMarkCommand(type),
|
|
156
|
-
label:
|
|
158
|
+
label: formatMessage({
|
|
159
|
+
id: 'kz.rte.bold',
|
|
160
|
+
defaultMessage: 'Bold',
|
|
161
|
+
description: 'Label for the "Bold" button in a text editor'
|
|
162
|
+
}),
|
|
157
163
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
158
164
|
name: "format_bold",
|
|
159
165
|
isPresentational: true
|
|
@@ -166,7 +172,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
166
172
|
toolbarControls[groupIndex].push({
|
|
167
173
|
isActive: markIsActive(editorState, type),
|
|
168
174
|
action: createToggleMarkCommand(type),
|
|
169
|
-
label:
|
|
175
|
+
label: formatMessage({
|
|
176
|
+
id: 'kz.rte.italic',
|
|
177
|
+
defaultMessage: 'Italic',
|
|
178
|
+
description: 'Label for the "Italic" button in a text editor'
|
|
179
|
+
}),
|
|
170
180
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
171
181
|
name: "format_italic",
|
|
172
182
|
isPresentational: true
|
|
@@ -179,7 +189,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
179
189
|
toolbarControls[groupIndex].push({
|
|
180
190
|
isActive: markIsActive(editorState, type),
|
|
181
191
|
action: createToggleMarkCommand(type),
|
|
182
|
-
label:
|
|
192
|
+
label: formatMessage({
|
|
193
|
+
id: 'kz.rte.underline',
|
|
194
|
+
defaultMessage: 'Underline',
|
|
195
|
+
description: 'Label for the "Underline" button in a text editor'
|
|
196
|
+
}),
|
|
183
197
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
184
198
|
name: "format_underlined",
|
|
185
199
|
isPresentational: true
|
|
@@ -192,7 +206,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
192
206
|
toolbarControls[groupIndex].push({
|
|
193
207
|
action: createToggleListCommand(type),
|
|
194
208
|
isActive: listIsActive(editorState, type, listNodes),
|
|
195
|
-
label:
|
|
209
|
+
label: formatMessage({
|
|
210
|
+
id: 'kz.rte.bullet_list',
|
|
211
|
+
defaultMessage: 'Bullet list',
|
|
212
|
+
description: 'Label for the "Bullet list" button in a text editor'
|
|
213
|
+
}),
|
|
196
214
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
197
215
|
name: "format_list_bulleted",
|
|
198
216
|
isPresentational: true,
|
|
@@ -206,7 +224,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
206
224
|
toolbarControls[groupIndex].push({
|
|
207
225
|
action: createToggleListCommand(type),
|
|
208
226
|
isActive: listIsActive(editorState, type, listNodes),
|
|
209
|
-
label:
|
|
227
|
+
label: formatMessage({
|
|
228
|
+
id: 'kz.rte.numbered_list',
|
|
229
|
+
defaultMessage: 'Numbered list',
|
|
230
|
+
description: 'Label for the "Numbered list" button in a text editor'
|
|
231
|
+
}),
|
|
210
232
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
211
233
|
name: "format_list_numbered",
|
|
212
234
|
isPresentational: true,
|
|
@@ -220,7 +242,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
220
242
|
action: createLiftListCommand(),
|
|
221
243
|
disabled: liftListIsDisabled(editorState),
|
|
222
244
|
isActive: false,
|
|
223
|
-
label:
|
|
245
|
+
label: formatMessage({
|
|
246
|
+
id: 'kz.rte.decrease_indent',
|
|
247
|
+
defaultMessage: 'Decrease indent',
|
|
248
|
+
description: 'Label for the "Decrease indent" button in a text editor'
|
|
249
|
+
}),
|
|
224
250
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
225
251
|
name: "format_indent_decrease",
|
|
226
252
|
isPresentational: true,
|
|
@@ -230,7 +256,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
230
256
|
action: createIndentListCommand(),
|
|
231
257
|
disabled: indentListIsDisabled(editorState),
|
|
232
258
|
isActive: false,
|
|
233
|
-
label:
|
|
259
|
+
label: formatMessage({
|
|
260
|
+
id: 'kz.rte.increase_indent',
|
|
261
|
+
defaultMessage: 'Increase indent',
|
|
262
|
+
description: 'Label for the "Increase indent" button in a text editor'
|
|
263
|
+
}),
|
|
234
264
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
235
265
|
name: "format_indent_increase",
|
|
236
266
|
isPresentational: true,
|
|
@@ -245,7 +275,11 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
245
275
|
action: createToggleMarkCommand(type),
|
|
246
276
|
disabled: editorState.selection.empty,
|
|
247
277
|
isActive: false,
|
|
248
|
-
label:
|
|
278
|
+
label: formatMessage({
|
|
279
|
+
id: 'kz.rte.link',
|
|
280
|
+
defaultMessage: 'Link',
|
|
281
|
+
description: 'Label for the "Link" button in a text editor that allows the creation of hyperlinks in the text'
|
|
282
|
+
}),
|
|
249
283
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
250
284
|
name: "add_link",
|
|
251
285
|
isPresentational: true
|
|
@@ -254,4 +288,4 @@ var buildControlMap = function (schema, editorState, controls) {
|
|
|
254
288
|
}
|
|
255
289
|
return filterToolbarControls(toolbarControls);
|
|
256
290
|
};
|
|
257
|
-
export {
|
|
291
|
+
export { useControlMap };
|
|
@@ -22,6 +22,8 @@ import { transformSelectItemToCollectionElement } from './utils/transformSelectI
|
|
|
22
22
|
import styles from './SingleSelect.module.scss.mjs';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
+
* @deprecated SingleSelect is deprecated in v3 and will be replaced in v4.
|
|
26
|
+
*
|
|
25
27
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896474/Select Guidance} |
|
|
26
28
|
* {@link https://cultureamp.design/?path=/docs/components-select--docs Storybook}
|
|
27
29
|
*/
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { GenericTile } from '../subcomponents/GenericTile/GenericTile.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated InformationTile is deprecated in v3 and will be removed in v4.
|
|
7
|
+
*
|
|
6
8
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#InformationTile%3A Guidance} |
|
|
7
9
|
* {@link https://cultureamp.design/?path=/docs/components-tiles-informationtile--docs Storybook}
|
|
8
10
|
*/
|
|
@@ -14,6 +14,8 @@ var renderActions = function (primaryAction, secondaryAction) {
|
|
|
14
14
|
}, secondaryAction)))), /*#__PURE__*/React.createElement(Button, __assign({}, primaryAction)));
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
+
* @deprecated MultiActionTile is deprecated in v3 and will be removed in v4.
|
|
18
|
+
*
|
|
17
19
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#MultiActionTile.1 Guidance} |
|
|
18
20
|
* {@link https://cultureamp.design/?path=/docs/components-tiles-multiactiontile--docs Storybook}
|
|
19
21
|
*/
|
|
@@ -4,6 +4,8 @@ import classnames from 'classnames';
|
|
|
4
4
|
import styles from './TileGrid.module.scss.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* @deprecated TileGrid is deprecated in v3 and will be removed in v4.
|
|
8
|
+
*
|
|
7
9
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#TileGrid Guidance} |
|
|
8
10
|
* {@link https://cultureamp.design/storybook/?path=/docs/components-tiles-tilegrid--docs Storybook}
|
|
9
11
|
*/
|
package/dist/styles.css
CHANGED
|
@@ -8094,7 +8094,6 @@
|
|
|
8094
8094
|
@layer kz-components {
|
|
8095
8095
|
.Toolbar-module_toolbar__ooRzV {
|
|
8096
8096
|
display: block;
|
|
8097
|
-
border-bottom: 2px solid var(--color-gray-500, #878792);
|
|
8098
8097
|
}
|
|
8099
8098
|
}
|
|
8100
8099
|
/** THIS IS AN AUTOGENERATED FILE **/
|
|
@@ -8250,6 +8249,9 @@
|
|
|
8250
8249
|
margin-bottom: var(--spacing-6, 0.375rem);
|
|
8251
8250
|
display: inline-block;
|
|
8252
8251
|
}
|
|
8252
|
+
.RichTextEditor-module_toolbarWrapper__wkBl- {
|
|
8253
|
+
border-bottom: inherit;
|
|
8254
|
+
}
|
|
8253
8255
|
/* stylelint-disable no-descending-specificity */
|
|
8254
8256
|
.RichTextEditor-module_editorWrapper__5q3mG {
|
|
8255
8257
|
position: relative;
|
|
@@ -8262,23 +8264,16 @@
|
|
|
8262
8264
|
.RichTextEditor-module_editorWrapper__5q3mG:hover, .RichTextEditor-module_editorWrapper__5q3mG:focus-within {
|
|
8263
8265
|
border-color: var(--color-gray-600, #524e56);
|
|
8264
8266
|
}
|
|
8265
|
-
.RichTextEditor-module_editorWrapper__5q3mG
|
|
8266
|
-
border-color: var(--color-gray-600, #524e56);
|
|
8267
|
-
}
|
|
8268
|
-
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_error__Xugz8,
|
|
8269
|
-
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_error__Xugz8 .RichTextEditor-module_toolbar__ceLvw {
|
|
8267
|
+
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_error__Xugz8 {
|
|
8270
8268
|
border-color: var(--color-red-500, #c93b55);
|
|
8271
8269
|
}
|
|
8272
|
-
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_error__Xugz8:hover
|
|
8273
|
-
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_error__Xugz8:hover .RichTextEditor-module_toolbar__ceLvw {
|
|
8270
|
+
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_error__Xugz8:hover {
|
|
8274
8271
|
border-color: var(--color-red-600, #a82433);
|
|
8275
8272
|
}
|
|
8276
|
-
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_caution__6q0z6
|
|
8277
|
-
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_caution__6q0z6 .RichTextEditor-module_toolbar__ceLvw {
|
|
8273
|
+
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_caution__6q0z6 {
|
|
8278
8274
|
border-color: var(--color-yellow-600, #c68600);
|
|
8279
8275
|
}
|
|
8280
|
-
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_caution__6q0z6:hover
|
|
8281
|
-
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_caution__6q0z6:hover .RichTextEditor-module_toolbar__ceLvw {
|
|
8276
|
+
.RichTextEditor-module_editorWrapper__5q3mG.RichTextEditor-module_caution__6q0z6:hover {
|
|
8282
8277
|
border-color: var(--color-yellow-700, #876400);
|
|
8283
8278
|
}
|
|
8284
8279
|
.RichTextEditor-module_editor__pVKqW.RichTextEditor-module_rows1__DDEf4 > .ProseMirror {
|
|
@@ -11484,10 +11479,6 @@
|
|
|
11484
11479
|
}
|
|
11485
11480
|
|
|
11486
11481
|
@layer kz-components {
|
|
11487
|
-
ul {
|
|
11488
|
-
padding-inline-start: 0;
|
|
11489
|
-
}
|
|
11490
|
-
|
|
11491
11482
|
.ListItem-module_listItem__xGr6A {
|
|
11492
11483
|
font-family: var(--typography-paragraph-body-font-family);
|
|
11493
11484
|
font-weight: var(--typography-paragraph-body-font-weight);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { OverrideClassName } from "../../types/OverrideClassName";
|
|
3
|
+
import type { EditorContentArray, EditorRows, ToolbarItems } from '../types';
|
|
4
4
|
import { ProseMirrorState } from '../utils/prosemirror';
|
|
5
5
|
type BaseRichTextEditorProps = {
|
|
6
6
|
id?: string;
|
package/dist/types/RichTextEditor/RichTextEditor/subcomponents/ToolbarControls/ToolbarControls.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolbarItems } from '../../../types';
|
|
2
|
+
import type { CommandOrTransaction } from '../../../utils/core';
|
|
3
|
+
import type { ProseMirrorModel, ProseMirrorState } from '../../../utils/prosemirror';
|
|
4
|
+
type ToolbarControlsProps = {
|
|
5
|
+
editorId: string;
|
|
6
|
+
controls?: ToolbarItems[];
|
|
7
|
+
editorState: ProseMirrorState.EditorState;
|
|
8
|
+
schema: ProseMirrorModel.Schema<any, any>;
|
|
9
|
+
dispatchTransaction: (commandOrTransaction: CommandOrTransaction) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const ToolbarControls: ({ editorId, controls, editorState, schema, dispatchTransaction, }: ToolbarControlsProps) => JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ToolbarControls';
|
|
@@ -9,5 +9,5 @@ type ToolbarControl = {
|
|
|
9
9
|
action: ProseMirrorState.Command;
|
|
10
10
|
};
|
|
11
11
|
/** Builds an array of object used to map control configuration to rte toolbar buttons */
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const useControlMap: (schema: ProseMirrorModel.Schema, editorState: ProseMirrorState.EditorState, controls?: ToolbarItems[]) => ToolbarControl[][];
|
|
13
13
|
export {};
|