@progress/kendo-react-editor 4.14.0-dev.202201140931 → 4.14.1-dev.202201181415
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/cdn/js/kendo-react-editor.js +1 -1
- package/dist/es/config/toolsSettings.d.ts +8 -0
- package/dist/es/config/toolsSettings.js +4 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tools/lists-styled.d.ts +5 -0
- package/dist/es/tools/lists-styled.js +308 -0
- package/dist/es/tools/main.d.ts +12 -2
- package/dist/es/tools/main.js +30 -2
- package/dist/npm/config/toolsSettings.d.ts +8 -0
- package/dist/npm/config/toolsSettings.js +10 -7
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tools/lists-styled.d.ts +5 -0
- package/dist/npm/tools/lists-styled.js +310 -0
- package/dist/npm/tools/main.d.ts +12 -2
- package/dist/npm/tools/main.js +30 -2
- package/dist/systemjs/kendo-react-editor.js +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var React = require("react");
|
|
15
|
+
var kendo_editor_common_1 = require("@progress/kendo-editor-common");
|
|
16
|
+
var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
17
|
+
var toolsSettings_1 = require("./../config/toolsSettings");
|
|
18
|
+
var rootListDepth = function (pos, nodes) {
|
|
19
|
+
// Get the depth of the nearest ancestor list
|
|
20
|
+
var bulletList = nodes.bulletList, orderedList = nodes.orderedList, listItem = nodes.listItem;
|
|
21
|
+
var depth;
|
|
22
|
+
for (var i = pos.depth - 1; i > 0; i--) {
|
|
23
|
+
var node = pos.node(i);
|
|
24
|
+
if (node.type === bulletList || node.type === orderedList) {
|
|
25
|
+
depth = i;
|
|
26
|
+
}
|
|
27
|
+
if (node.type !== bulletList && node.type !== orderedList && node.type !== listItem) {
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return depth;
|
|
32
|
+
};
|
|
33
|
+
var getListLiftTarget = function (schema, resPos, options) {
|
|
34
|
+
// This will return (depth - 1) for root list parent of a list.
|
|
35
|
+
var target = resPos.depth;
|
|
36
|
+
var bulletList = schema.nodes[options.bulletList];
|
|
37
|
+
var orderedList = schema.nodes[options.orderedList];
|
|
38
|
+
var listItem = schema.nodes[options.listItem];
|
|
39
|
+
for (var i = resPos.depth; i > 0; i--) {
|
|
40
|
+
var node = resPos.node(i);
|
|
41
|
+
if (node.type === bulletList || node.type === orderedList) {
|
|
42
|
+
target = i;
|
|
43
|
+
}
|
|
44
|
+
if (node.type !== bulletList && node.type !== orderedList && node.type !== listItem) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return target - 1;
|
|
49
|
+
};
|
|
50
|
+
function liftSelectionList(state, tr, options) {
|
|
51
|
+
// The function will list paragraphs in selection out to level 1 below root list.
|
|
52
|
+
var _a = state.selection, from = _a.from, to = _a.to;
|
|
53
|
+
var _b = state.schema.nodes, paragraph = _b.paragraph, heading = _b.heading;
|
|
54
|
+
var listCol = [];
|
|
55
|
+
tr.doc.nodesBetween(from, to, function (node, pos) {
|
|
56
|
+
if (node.type === paragraph || node.type === heading) {
|
|
57
|
+
listCol.push({ node: node, pos: pos });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
for (var i = listCol.length - 1; i >= 0; i--) {
|
|
61
|
+
var block = listCol[i];
|
|
62
|
+
var start = tr.doc.resolve(tr.mapping.map(block.pos));
|
|
63
|
+
if (start.depth > 0) {
|
|
64
|
+
var end = void 0;
|
|
65
|
+
if (block.node.textContent && block.node.textContent.length > 0) {
|
|
66
|
+
end = tr.doc.resolve(tr.mapping.map(block.pos + block.node.textContent.length));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
end = tr.doc.resolve(tr.mapping.map(block.pos + 1));
|
|
70
|
+
}
|
|
71
|
+
var range = start.blockRange(end);
|
|
72
|
+
if (range) {
|
|
73
|
+
tr.lift(range, getListLiftTarget(state.schema, start, options));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return tr;
|
|
78
|
+
}
|
|
79
|
+
function toggleListCommand(options) {
|
|
80
|
+
return function (state, dispatch, view) {
|
|
81
|
+
if (!view) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
state = view.state;
|
|
85
|
+
var listNode = state.schema.nodes[options.listType];
|
|
86
|
+
var _a = state.selection, $from = _a.$from, $to = _a.$to;
|
|
87
|
+
var parent = $from.node(-2);
|
|
88
|
+
var grandgrandParent = $from.node(-3);
|
|
89
|
+
var isRangeOfSingleType = isRangeOfType(state.doc, $from, $to, listNode);
|
|
90
|
+
if (((parent && parent.type === listNode) ||
|
|
91
|
+
(grandgrandParent && grandgrandParent.type === listNode)) &&
|
|
92
|
+
isRangeOfSingleType) {
|
|
93
|
+
// Untoggles list
|
|
94
|
+
return liftListItems(options)(state, dispatch);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// Wraps selection in list and converts list type e.g. bullet_list -> ordered_list if needed
|
|
98
|
+
if (!isRangeOfSingleType) {
|
|
99
|
+
liftListItems(options)(state, dispatch);
|
|
100
|
+
state = view.state;
|
|
101
|
+
}
|
|
102
|
+
return wrapInList(listNode, options.listAttrs)(state, dispatch);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function liftListItem(state, selection, tr, nodeType) {
|
|
107
|
+
var listItemNodeType = nodeType || state.schema.nodes.listItem;
|
|
108
|
+
var $from = selection.$from, $to = selection.$to;
|
|
109
|
+
var range = $from.blockRange($to, function (node) { return node.childCount && node.firstChild.type === listItemNodeType; });
|
|
110
|
+
if (!range || range.depth < 2 || $from.node(range.depth - 1).type !== listItemNodeType) {
|
|
111
|
+
return tr;
|
|
112
|
+
}
|
|
113
|
+
var end = range.end;
|
|
114
|
+
var endOfList = $to.end(range.depth);
|
|
115
|
+
if (end < endOfList) {
|
|
116
|
+
tr.step(new kendo_editor_common_1.ReplaceAroundStep(end - 1, endOfList, end, endOfList, new kendo_editor_common_1.Slice(kendo_editor_common_1.Fragment.from(listItemNodeType.create(undefined, range.parent.copy())), 1, 0), 1, true));
|
|
117
|
+
range = new kendo_editor_common_1.NodeRange(tr.doc.resolve($from.pos), tr.doc.resolve(endOfList), range.depth);
|
|
118
|
+
}
|
|
119
|
+
return tr.lift(range, kendo_editor_common_1.liftTarget(range)).scrollIntoView();
|
|
120
|
+
}
|
|
121
|
+
function liftFollowingList(state, from, to, rootListDepthNum, tr, listItem) {
|
|
122
|
+
// Function will lift list item following selection to level-1.
|
|
123
|
+
if (!listItem) {
|
|
124
|
+
listItem = state.schema.nodes.listItem;
|
|
125
|
+
}
|
|
126
|
+
var lifted = false;
|
|
127
|
+
tr.doc.nodesBetween(from, to, function (node, pos) {
|
|
128
|
+
if (!lifted && node.type === listItem && pos > from) {
|
|
129
|
+
lifted = true;
|
|
130
|
+
var listDepth = rootListDepthNum + 3;
|
|
131
|
+
while (listDepth > rootListDepthNum + 2) {
|
|
132
|
+
var start = tr.doc.resolve(tr.mapping.map(pos));
|
|
133
|
+
listDepth = start.depth;
|
|
134
|
+
var end = tr.doc.resolve(tr.mapping.map(pos + node.textContent.length));
|
|
135
|
+
var sel = new kendo_editor_common_1.TextSelection(start, end);
|
|
136
|
+
tr = liftListItem(state, sel, tr, listItem);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return tr;
|
|
141
|
+
}
|
|
142
|
+
function isRangeOfType(doc, $from, $to, nodeType) {
|
|
143
|
+
// Step through block-nodes between $from and $to and returns false if a node is
|
|
144
|
+
// found that isn't of the specified type
|
|
145
|
+
return getAncestorNodesBetween(doc, $from, $to).filter(function (node) { return node.type !== nodeType; }).length === 0;
|
|
146
|
+
}
|
|
147
|
+
function getAncestorNodesBetween(doc, $from, $to) {
|
|
148
|
+
// Returns all top-level ancestor-nodes between $from and $to
|
|
149
|
+
var nodes = Array();
|
|
150
|
+
var maxDepth = findAncestorPosition(doc, $from).depth;
|
|
151
|
+
var current = doc.resolve($from.start(maxDepth));
|
|
152
|
+
while (current.pos <= $to.start($to.depth)) {
|
|
153
|
+
var depth = Math.min(current.depth, maxDepth);
|
|
154
|
+
var node = current.node(depth);
|
|
155
|
+
if (node) {
|
|
156
|
+
nodes.push(node);
|
|
157
|
+
}
|
|
158
|
+
if (depth === 0) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
var next = doc.resolve(current.after(depth));
|
|
162
|
+
if (next.start(depth) >= doc.nodeSize - 2) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
if (next.depth !== current.depth) {
|
|
166
|
+
next = doc.resolve(next.pos + 2);
|
|
167
|
+
}
|
|
168
|
+
if (next.depth) {
|
|
169
|
+
current = doc.resolve(next.start(next.depth));
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
current = doc.resolve(next.end(next.depth));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return nodes;
|
|
176
|
+
}
|
|
177
|
+
function findAncestorPosition(doc, pos) {
|
|
178
|
+
// Traverse the document until an "ancestor" is found. Any nestable block can be an ancestor.
|
|
179
|
+
var nestableBlocks = ['blockquote', 'bulletList', 'orderedList'];
|
|
180
|
+
if (pos.depth === 1) {
|
|
181
|
+
return pos;
|
|
182
|
+
}
|
|
183
|
+
var node = pos.node(pos.depth);
|
|
184
|
+
var newPos = pos;
|
|
185
|
+
while (pos.depth >= 1) {
|
|
186
|
+
pos = doc.resolve(pos.before(pos.depth));
|
|
187
|
+
node = pos.node(pos.depth);
|
|
188
|
+
if (node && nestableBlocks.indexOf(node.type.name) !== -1) {
|
|
189
|
+
newPos = pos;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return newPos;
|
|
193
|
+
}
|
|
194
|
+
function liftListItems(options) {
|
|
195
|
+
return function (state, dispatch) {
|
|
196
|
+
var tr = state.tr;
|
|
197
|
+
var _a = state.selection, $from = _a.$from, $to = _a.$to;
|
|
198
|
+
tr.doc.nodesBetween($from.pos, $to.pos, function (node, pos) {
|
|
199
|
+
// Following condition will ensure that block types `paragraph`, `heading`, `codeBlock`, `blockquote`, `div` are lifted.
|
|
200
|
+
// isTextblock is true for paragraph, heading, codeBlock.
|
|
201
|
+
if (node.isTextblock || node.type.name === 'blockquote' || node.type.name === 'div') {
|
|
202
|
+
var sel = new kendo_editor_common_1.NodeSelection(tr.doc.resolve(tr.mapping.map(pos)));
|
|
203
|
+
var range = sel.$from.blockRange(sel.$to);
|
|
204
|
+
if (!range || sel.$from.parent.type !== state.schema.nodes[options.listItem]) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
var target = range && kendo_editor_common_1.liftTarget(range);
|
|
208
|
+
if (target === undefined || target === null) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
tr.lift(range, target);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
if (dispatch) {
|
|
215
|
+
dispatch(tr);
|
|
216
|
+
}
|
|
217
|
+
return true;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function wrapInList(nodeType, attrs) {
|
|
221
|
+
if (attrs === void 0) { attrs = {}; }
|
|
222
|
+
return kendo_editor_common_1.autoJoin(kendo_editor_common_1.wrapInList(nodeType, attrs), function (before, after) { return before.type === after.type && before.type === nodeType; });
|
|
223
|
+
}
|
|
224
|
+
var toggleList = function (state, dispatch, view, options, command) {
|
|
225
|
+
var listType = options.listType;
|
|
226
|
+
var selection = state.selection;
|
|
227
|
+
var fromNode = selection.$from.node(selection.$from.depth - 2);
|
|
228
|
+
var endNode = selection.$to.node(selection.$to.depth - 2);
|
|
229
|
+
if (!fromNode || fromNode.type.name !== listType || (!endNode || endNode.type.name !== listType)) {
|
|
230
|
+
return toggleListCommand(options)(state, dispatch, view);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
var nodes = view.state.schema.nodes;
|
|
234
|
+
var listNodes = {
|
|
235
|
+
bulletList: nodes[options.bulletList],
|
|
236
|
+
orderedList: nodes[options.orderedList],
|
|
237
|
+
listItem: nodes[options.listItem]
|
|
238
|
+
};
|
|
239
|
+
var depth = rootListDepth(selection.$to, listNodes);
|
|
240
|
+
var tr = liftFollowingList(state, selection.$to.pos, selection.$to.end(depth), depth, view.state.tr, listNodes.listItem);
|
|
241
|
+
tr = liftSelectionList(state, tr, options);
|
|
242
|
+
tr.setMeta('commandName', command);
|
|
243
|
+
dispatch(tr);
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
var parentNode = function (state, nodeType) {
|
|
248
|
+
var _a = state.selection, from = _a.from, to = _a.to;
|
|
249
|
+
var result = null;
|
|
250
|
+
state.doc.nodesBetween(from, to, function (node) {
|
|
251
|
+
result = result || (node.type === nodeType ? node : null);
|
|
252
|
+
return !result;
|
|
253
|
+
});
|
|
254
|
+
return result;
|
|
255
|
+
};
|
|
256
|
+
var reListStyle = /list\-style\-type:\s?([\w-]+)/;
|
|
257
|
+
var getListStyle = function (node) {
|
|
258
|
+
var style = node.attrs.style;
|
|
259
|
+
var listStyle = reListStyle.exec(style);
|
|
260
|
+
return (listStyle && listStyle[1]) || '';
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* @hidden
|
|
264
|
+
*/
|
|
265
|
+
exports.ListTool = function (props) {
|
|
266
|
+
var isActive = false;
|
|
267
|
+
var view = props.view;
|
|
268
|
+
var types = toolsSettings_1.listsTypes;
|
|
269
|
+
var listType = props.listType;
|
|
270
|
+
var items = (props.items || []).slice();
|
|
271
|
+
var ol, ul;
|
|
272
|
+
if (view) {
|
|
273
|
+
var state = view.state;
|
|
274
|
+
var nodes = state && state.schema.nodes;
|
|
275
|
+
ol = nodes && parentNode(state, nodes[types.orderedList]);
|
|
276
|
+
ul = nodes && parentNode(state, nodes[types.bulletList]);
|
|
277
|
+
if (listType === types.orderedList) {
|
|
278
|
+
isActive = Boolean(ol && !ul);
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
isActive = Boolean(!ol && ul);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
var onButtonClick = function (_event) {
|
|
285
|
+
if (view) {
|
|
286
|
+
toggleList(view.state, view.dispatch, view, __assign({ listType: listType }, types, { listAttrs: {} }), 'InsertList');
|
|
287
|
+
view.focus();
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
var onItemClick = function (event) {
|
|
291
|
+
if (view) {
|
|
292
|
+
var listAttrs = event.item.style ? { style: 'list-style-type: ' + event.item.style + ';' } : {};
|
|
293
|
+
var currentList = ol || ul;
|
|
294
|
+
if (currentList && getListStyle(currentList) !== event.item.style) {
|
|
295
|
+
var pos = view.state.selection.$head.posAtIndex(0, -2) - 1;
|
|
296
|
+
view.dispatch(view.state.tr.setNodeMarkup(pos, view.state.schema.nodes[listType], { style: 'list-style-type: ' + event.item.style + ';' }));
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
toggleList(view.state, view.dispatch, view, __assign({ listType: listType }, types, { listAttrs: listAttrs }), 'InsertList');
|
|
300
|
+
}
|
|
301
|
+
view.focus();
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
if (isActive && (ol || ul)) {
|
|
305
|
+
var listStyleType_1 = getListStyle(ol || ul);
|
|
306
|
+
items = listStyleType_1 ? items.map(function (i) { return (__assign({}, i, { selected: i.style === listStyleType_1 })); }) : items;
|
|
307
|
+
}
|
|
308
|
+
return (React.createElement("span", { onMouseDown: function (e) { e.preventDefault(); } },
|
|
309
|
+
React.createElement(kendo_react_buttons_1.SplitButton, { textField: "text", items: items, icon: props.icon, onButtonClick: onButtonClick, onItemClick: onItemClick, buttonClass: isActive ? 'k-state-selected k-selected' : '' })));
|
|
310
|
+
};
|
package/dist/npm/tools/main.d.ts
CHANGED
|
@@ -375,16 +375,26 @@ export declare namespace EditorTools {
|
|
|
375
375
|
function createListTool(settings: EditorToolsSettings.ListSettings): React.ComponentClass<ListToolProps, React.ComponentState>;
|
|
376
376
|
const OrderedList_base: React.ComponentClass<ListToolProps, any>;
|
|
377
377
|
/**
|
|
378
|
-
* The OrderedList tool component.
|
|
378
|
+
* The basic OrderedList tool component. Will render a button which applies `<ol>` HTML element.
|
|
379
379
|
*/
|
|
380
380
|
class OrderedList extends OrderedList_base {
|
|
381
381
|
}
|
|
382
382
|
const UnorderedList_base: React.ComponentClass<ListToolProps, any>;
|
|
383
383
|
/**
|
|
384
|
-
* The UnorderedList tool component.
|
|
384
|
+
* The basic UnorderedList tool component. Will render a button which applies `<ul>` HTML element.
|
|
385
385
|
*/
|
|
386
386
|
class UnorderedList extends UnorderedList_base {
|
|
387
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* The BulletedList tool component.
|
|
390
|
+
* Will render a SplitButton which applies `<ol>` HTML element with predefined styles - disc and square.
|
|
391
|
+
*/
|
|
392
|
+
const BulletedList: (props: any) => JSX.Element;
|
|
393
|
+
/**
|
|
394
|
+
* The NumberedList tool component.
|
|
395
|
+
* Will render a SplitButton which applies `<ul>` HTML element with predefined styles - upper-roman, lower-roman, upper-latin and lower-latin.
|
|
396
|
+
*/
|
|
397
|
+
const NumberedList: (props: any) => JSX.Element;
|
|
388
398
|
/**
|
|
389
399
|
* The props for the Outdent tool component of the Editor.
|
|
390
400
|
*/
|
package/dist/npm/tools/main.js
CHANGED
|
@@ -46,6 +46,7 @@ var pdf_1 = require("./pdf");
|
|
|
46
46
|
var selectAll_1 = require("./selectAll");
|
|
47
47
|
var cleanFormatting_1 = require("./cleanFormatting");
|
|
48
48
|
var findReplace_1 = require("./findReplace");
|
|
49
|
+
var lists_styled_1 = require("./lists-styled");
|
|
49
50
|
/**
|
|
50
51
|
* Represents a wrapping namespace for the tool components, props, and functions of the Editor.
|
|
51
52
|
*/
|
|
@@ -385,7 +386,7 @@ var EditorTools;
|
|
|
385
386
|
function createListTool(settings) { return lists_1.ListToolNS.createListTool(settings); }
|
|
386
387
|
EditorTools.createListTool = createListTool;
|
|
387
388
|
/**
|
|
388
|
-
* The OrderedList tool component.
|
|
389
|
+
* The basic OrderedList tool component. Will render a button which applies `<ol>` HTML element.
|
|
389
390
|
*/
|
|
390
391
|
var OrderedList = /** @class */ (function (_super) {
|
|
391
392
|
__extends(OrderedList, _super);
|
|
@@ -396,7 +397,7 @@ var EditorTools;
|
|
|
396
397
|
}(createListTool(toolsSettings_1.EditorToolsSettings.orderedList)));
|
|
397
398
|
EditorTools.OrderedList = OrderedList;
|
|
398
399
|
/**
|
|
399
|
-
* The UnorderedList tool component.
|
|
400
|
+
* The basic UnorderedList tool component. Will render a button which applies `<ul>` HTML element.
|
|
400
401
|
*/
|
|
401
402
|
var UnorderedList = /** @class */ (function (_super) {
|
|
402
403
|
__extends(UnorderedList, _super);
|
|
@@ -406,6 +407,33 @@ var EditorTools;
|
|
|
406
407
|
return UnorderedList;
|
|
407
408
|
}(createListTool(toolsSettings_1.EditorToolsSettings.bulletList)));
|
|
408
409
|
EditorTools.UnorderedList = UnorderedList;
|
|
410
|
+
/**
|
|
411
|
+
* The BulletedList tool component.
|
|
412
|
+
* Will render a SplitButton which applies `<ol>` HTML element with predefined styles - disc and square.
|
|
413
|
+
*/
|
|
414
|
+
EditorTools.BulletedList = function (props) {
|
|
415
|
+
var ulItems = [
|
|
416
|
+
{ icon: 'list-unordered', text: 'Disc', style: 'disc' },
|
|
417
|
+
// { icon: 'list-unordered-circle', text: 'Circle', style: 'circle' },
|
|
418
|
+
{ icon: 'list-unordered-square', text: 'Square', style: 'square' }
|
|
419
|
+
];
|
|
420
|
+
return (React.createElement(lists_styled_1.ListTool, __assign({ listType: toolsSettings_1.EditorToolsSettings.bulletList.listType, items: ulItems, icon: "list-unordered" }, props)));
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* The NumberedList tool component.
|
|
424
|
+
* Will render a SplitButton which applies `<ul>` HTML element with predefined styles - upper-roman, lower-roman, upper-latin and lower-latin.
|
|
425
|
+
*/
|
|
426
|
+
EditorTools.NumberedList = function (props) {
|
|
427
|
+
var olItems = [
|
|
428
|
+
{ icon: 'list-ordered', text: 'Decimal' },
|
|
429
|
+
// { icon: 'list-leading-zero', text: 'Decimal with leading zero', styleType: 'decimal-leading-zero' },
|
|
430
|
+
{ icon: 'list-roman-upper', text: 'Upper roman', style: 'upper-roman' },
|
|
431
|
+
{ icon: 'list-roman-lower', text: 'Lower roman', style: 'lower-roman' },
|
|
432
|
+
{ icon: 'list-latin-big', text: 'Upper latin', style: 'upper-latin' },
|
|
433
|
+
{ icon: 'list-latin-small', text: 'Lower latin', style: 'lower-latin' }
|
|
434
|
+
];
|
|
435
|
+
return (React.createElement(lists_styled_1.ListTool, __assign({ listType: toolsSettings_1.EditorToolsSettings.orderedList.listType, items: olItems, icon: "list-ordered" }, props)));
|
|
436
|
+
};
|
|
409
437
|
/**
|
|
410
438
|
* Creates the Outdent tool component of the Editor.
|
|
411
439
|
*
|