@ebl-vue/editor-full 2.31.11 → 2.31.12
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/index.mjs +360 -319
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Editor/Editor.vue +22 -6
- package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +1 -1
- package/src/plugins/list/ListTabulator/index.ts +1 -1
- package/src/plugins/list/index.ts +118 -123
- package/src/plugins/list/styles/.cdx-list .css +168 -0
- package/src/plugins/list/utils/normalizeData.ts +0 -1
- package/src/plugins/list-bak/ListRenderer/ChecklistRenderer.ts +208 -0
- package/src/plugins/list-bak/ListRenderer/ListRenderer.ts +73 -0
- package/src/plugins/list-bak/ListRenderer/OrderedListRenderer.ts +123 -0
- package/src/plugins/list-bak/ListRenderer/UnorderedListRenderer.ts +123 -0
- package/src/plugins/list-bak/ListRenderer/index.ts +6 -0
- package/src/plugins/list-bak/ListTabulator/index.ts +1179 -0
- package/src/plugins/list-bak/index.ts +485 -0
- package/src/plugins/list-bak/styles/CssPrefix.ts +4 -0
- package/src/plugins/list-bak/styles/input.css +36 -0
- package/src/plugins/list-bak/styles/list.css +165 -0
- package/src/plugins/list-bak/types/Elements.ts +14 -0
- package/src/plugins/list-bak/types/ItemMeta.ts +40 -0
- package/src/plugins/list-bak/types/ListParams.ts +102 -0
- package/src/plugins/list-bak/types/ListRenderer.ts +6 -0
- package/src/plugins/list-bak/types/OlCounterType.ts +63 -0
- package/src/plugins/list-bak/types/index.ts +14 -0
- package/src/plugins/list-bak/utils/focusItem.ts +18 -0
- package/src/plugins/list-bak/utils/getChildItems.ts +40 -0
- package/src/plugins/list-bak/utils/getItemChildWrapper.ts +10 -0
- package/src/plugins/list-bak/utils/getItemContentElement.ts +10 -0
- package/src/plugins/list-bak/utils/getSiblings.ts +52 -0
- package/src/plugins/list-bak/utils/isLastItem.ts +9 -0
- package/src/plugins/list-bak/utils/itemHasSublist.ts +10 -0
- package/src/plugins/list-bak/utils/normalizeData.ts +84 -0
- package/src/plugins/list-bak/utils/removeChildWrapperIfEmpty.ts +31 -0
- package/src/plugins/list-bak/utils/renderToolboxInput.ts +105 -0
- package/src/plugins/list-bak/utils/stripNumbers.ts +7 -0
- package/src/plugins/list-bak/utils/type-guards.ts +8 -0
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ import EditorJS from '@ebl-vue/editorjs';
|
|
|
16
16
|
//import EditorJS from '../../../../editorjs/src/codex';
|
|
17
17
|
//window.VERSION="2.31.0"; //如果是用源码模式时,需要设置全局变量
|
|
18
18
|
|
|
19
|
-
import { onMounted, onUnmounted,
|
|
19
|
+
import { onMounted, onUnmounted, watch, inject } from 'vue';
|
|
20
20
|
import { toRaw } from 'vue';
|
|
21
21
|
import { IEblEditorSettings } from '../../types';
|
|
22
22
|
|
|
@@ -71,13 +71,13 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
71
71
|
}),
|
|
72
72
|
locale:{}
|
|
73
73
|
});
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
let editorData=toRaw(props.data);
|
|
75
|
+
let editorIsReady = false;
|
|
76
76
|
|
|
77
77
|
let editor: EditorJS | null = null;
|
|
78
78
|
const tunes = ['indent', 'blockAlignment'];
|
|
79
79
|
onMounted(() => {
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
editor = new EditorJS({
|
|
82
82
|
minHeight:100,
|
|
83
83
|
holder: 'holder',
|
|
@@ -105,7 +105,9 @@ onMounted(() => {
|
|
|
105
105
|
class: List,
|
|
106
106
|
inlineToolbar: true,
|
|
107
107
|
config: {
|
|
108
|
-
defaultStyle: '
|
|
108
|
+
defaultStyle: 'checklist',
|
|
109
|
+
|
|
110
|
+
maxLevel: 4,
|
|
109
111
|
}
|
|
110
112
|
},
|
|
111
113
|
h1: {
|
|
@@ -170,7 +172,7 @@ onMounted(() => {
|
|
|
170
172
|
userStore: props.userStore,
|
|
171
173
|
endpoints: {
|
|
172
174
|
byFile: EblEditorSettings?.fileUploadEndpoint,
|
|
173
|
-
byUrl: EblEditorSettings?.urlUploadEndpoint
|
|
175
|
+
//byUrl: EblEditorSettings?.urlUploadEndpoint
|
|
174
176
|
},
|
|
175
177
|
features: {
|
|
176
178
|
caption: false,
|
|
@@ -201,6 +203,7 @@ onMounted(() => {
|
|
|
201
203
|
emits("onChange", api, event);
|
|
202
204
|
},
|
|
203
205
|
onReady: () => {
|
|
206
|
+
editorIsReady = true;
|
|
204
207
|
new DragDrop("holder", props.readOnly, editor!, '1px solid #999');
|
|
205
208
|
const undoConfig = {
|
|
206
209
|
debounceTimer: 200,
|
|
@@ -214,6 +217,10 @@ onMounted(() => {
|
|
|
214
217
|
});
|
|
215
218
|
undo.initialize(editorData);
|
|
216
219
|
emits("onReady");
|
|
220
|
+
if (props.data && props.data.blocks && props.data.blocks.length > 0) {
|
|
221
|
+
editorData=toRaw(props.data);
|
|
222
|
+
editor!.render(editorData);
|
|
223
|
+
}
|
|
217
224
|
},
|
|
218
225
|
|
|
219
226
|
})
|
|
@@ -225,6 +232,15 @@ onUnmounted(() => {
|
|
|
225
232
|
}
|
|
226
233
|
});
|
|
227
234
|
|
|
235
|
+
watch(()=>props.data, (newVal, oldVal) => {
|
|
236
|
+
if (editor != null && editorIsReady) {
|
|
237
|
+
editorData=toRaw(newVal);
|
|
238
|
+
editor.render(editorData);
|
|
239
|
+
}
|
|
240
|
+
},{
|
|
241
|
+
deep:true
|
|
242
|
+
});
|
|
243
|
+
|
|
228
244
|
/**
|
|
229
245
|
* 验证是否为空 */
|
|
230
246
|
function validate() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { IconCheck } from '../../../icons';
|
|
1
2
|
import type { ChecklistItemMeta } from '../types/ItemMeta';
|
|
2
3
|
import type { ListConfig } from '../types/ListParams';
|
|
3
4
|
import { isEmpty, make } from '@editorjs/dom';
|
|
4
5
|
import { DefaultListCssClasses } from './ListRenderer';
|
|
5
6
|
import type { ListCssClasses, ListRendererInterface } from './ListRenderer';
|
|
6
7
|
import { CssPrefix } from '../styles/CssPrefix';
|
|
7
|
-
import { IconCheck } from "../../../icons";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Interface that represents all list used only in unordered list rendering
|
|
@@ -7,7 +7,7 @@ import { isHtmlElement } from '../utils/type-guards';
|
|
|
7
7
|
import { getContenteditableSlice, getCaretNodeAndOffset, isCaretAtStartOfInput } from '@editorjs/caret';
|
|
8
8
|
import { DefaultListCssClasses } from '../ListRenderer';
|
|
9
9
|
import type { PasteEvent } from '../types';
|
|
10
|
-
import type { API, BlockAPI, PasteConfig } from '@
|
|
10
|
+
import type { API, BlockAPI, PasteConfig } from '@ebl-vue/editorjs';
|
|
11
11
|
import type { ListParams } from '..';
|
|
12
12
|
import type { ChecklistItemMeta, ItemMeta, OrderedListItemMeta, UnorderedListItemMeta } from '../types/ItemMeta';
|
|
13
13
|
import type { ListRenderer } from '../types/ListRenderer';
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
import type { API, BlockAPI, PasteConfig, ToolboxConfig } from '@ebl-vue/editorjs';
|
|
2
2
|
import type {
|
|
3
3
|
BlockToolConstructorOptions,
|
|
4
|
-
|
|
4
|
+
MenuConfigItem,
|
|
5
5
|
ToolConfig
|
|
6
|
-
} from '@
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
} from '@ebl-vue/editorjs/types/tools';
|
|
7
|
+
import { IconListBulleted, IconListNumbered, IconChecklist } from '../../icons';
|
|
8
|
+
import { IconStartWith } from '../../icons';
|
|
9
9
|
import type { ListConfig, ListData, ListDataStyle, ListItem, OldListData } from './types/ListParams';
|
|
10
10
|
import ListTabulator from './ListTabulator';
|
|
11
11
|
import { CheckListRenderer, OrderedListRenderer, UnorderedListRenderer } from './ListRenderer';
|
|
12
12
|
import type { ListRenderer } from './types/ListRenderer';
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import { IconListBulleted, IconListNumbered, IconChecklist } from "../../icons";
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
import { renderToolboxInput } from './utils/renderToolboxInput';
|
|
14
|
+
import { OlCounterIconsMap, type OlCounterType, OlCounterTypesMap } from './types/OlCounterType';
|
|
19
15
|
|
|
20
16
|
/**
|
|
21
17
|
* Build styles
|
|
22
18
|
*/
|
|
23
19
|
import './styles/list.css';
|
|
24
20
|
import './styles/input.css';
|
|
25
|
-
|
|
21
|
+
import stripNumbers from './utils/stripNumbers';
|
|
26
22
|
import normalizeData from './utils/normalizeData';
|
|
27
23
|
import type { PasteEvent } from './types';
|
|
28
24
|
import type { OrderedListItemMeta } from './types/ItemMeta';
|
|
@@ -36,7 +32,6 @@ export type ListParams = BlockToolConstructorOptions<ListData | OldListData, Lis
|
|
|
36
32
|
* Default class of the component used in editor
|
|
37
33
|
*/
|
|
38
34
|
export default class EditorjsList {
|
|
39
|
-
defaultCounterTypes: OlCounterType[];
|
|
40
35
|
/**
|
|
41
36
|
* Notify core that read-only mode is supported
|
|
42
37
|
*/
|
|
@@ -179,7 +174,7 @@ export default class EditorjsList {
|
|
|
179
174
|
/**
|
|
180
175
|
* Default Counter type of the ordered list
|
|
181
176
|
*/
|
|
182
|
-
|
|
177
|
+
private defaultCounterTypes: OlCounterType[];
|
|
183
178
|
|
|
184
179
|
/**
|
|
185
180
|
* Tool's data
|
|
@@ -286,107 +281,107 @@ export default class EditorjsList {
|
|
|
286
281
|
* Creates Block Tune allowing to change the list style
|
|
287
282
|
* @returns array of tune configs
|
|
288
283
|
*/
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
284
|
+
public renderSettings(): MenuConfigItem[] {
|
|
285
|
+
const defaultTunes: MenuConfigItem[] = [
|
|
286
|
+
{
|
|
287
|
+
label: this.api.i18n.t('Unordered'),
|
|
288
|
+
icon: IconListBulleted,
|
|
289
|
+
closeOnActivate: true,
|
|
290
|
+
isActive: this.listStyle == 'unordered',
|
|
291
|
+
onActivate: () => {
|
|
292
|
+
this.listStyle = 'unordered';
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
label: this.api.i18n.t('Ordered'),
|
|
297
|
+
icon: IconListNumbered,
|
|
298
|
+
closeOnActivate: true,
|
|
299
|
+
isActive: this.listStyle == 'ordered',
|
|
300
|
+
onActivate: () => {
|
|
301
|
+
this.listStyle = 'ordered';
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
label: this.api.i18n.t('Checklist'),
|
|
306
|
+
icon: IconChecklist,
|
|
307
|
+
closeOnActivate: true,
|
|
308
|
+
isActive: this.listStyle == 'checklist',
|
|
309
|
+
onActivate: () => {
|
|
310
|
+
this.listStyle = 'checklist';
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
];
|
|
314
|
+
|
|
315
|
+
if (this.listStyle === 'ordered') {
|
|
316
|
+
const startWithElement = renderToolboxInput(
|
|
317
|
+
(index: string) => this.changeStartWith(Number(index)),
|
|
318
|
+
{
|
|
319
|
+
value: String((this.data.meta as OrderedListItemMeta).start ?? 1),
|
|
320
|
+
placeholder: '',
|
|
321
|
+
attributes: {
|
|
322
|
+
required: 'true',
|
|
323
|
+
},
|
|
324
|
+
sanitize: input => stripNumbers(input),
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
const orderedListTunes: MenuConfigItem[] = [
|
|
328
|
+
{
|
|
329
|
+
label: this.api.i18n.t('Start with'),
|
|
330
|
+
icon: IconStartWith,
|
|
331
|
+
children: {
|
|
332
|
+
items: [
|
|
333
|
+
{
|
|
334
|
+
element: startWithElement,
|
|
335
|
+
// @ts-expect-error ts(2820) can not use PopoverItem enum from editor.js types
|
|
336
|
+
type: 'html',
|
|
337
|
+
},
|
|
338
|
+
],
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
];
|
|
342
|
+
|
|
343
|
+
const orderedListCountersTunes: MenuConfigItem = {
|
|
344
|
+
label: this.api.i18n.t('Counter type'),
|
|
345
|
+
icon: OlCounterIconsMap.get((this.data.meta as OrderedListItemMeta).counterType!),
|
|
346
|
+
children: {
|
|
347
|
+
items: [],
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* For each counter type in OlCounterType create toolbox item
|
|
353
|
+
*/
|
|
354
|
+
OlCounterTypesMap.forEach((_, counterType: string) => {
|
|
355
|
+
const counterTypeValue = OlCounterTypesMap.get(counterType)! as OlCounterType;
|
|
356
|
+
|
|
357
|
+
if (!this.defaultCounterTypes.includes(counterTypeValue)) {
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
orderedListCountersTunes.children.items!.push({
|
|
362
|
+
title: this.api.i18n.t(counterType),
|
|
363
|
+
icon: OlCounterIconsMap.get(counterTypeValue),
|
|
364
|
+
isActive: (this.data.meta as OrderedListItemMeta).counterType === OlCounterTypesMap.get(counterType),
|
|
365
|
+
closeOnActivate: true,
|
|
366
|
+
onActivate: () => {
|
|
367
|
+
this.changeCounters(OlCounterTypesMap.get(counterType) as OlCounterType);
|
|
368
|
+
},
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Dont show Counter type tune if there is no valid counter types
|
|
374
|
+
*/
|
|
375
|
+
if (orderedListCountersTunes.children.items!.length > 1) {
|
|
376
|
+
orderedListTunes.push(orderedListCountersTunes);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// @ts-expect-error ts(2820) can not use PopoverItem enum from editor.js types
|
|
380
|
+
defaultTunes.push({ type: 'separator' }, ...orderedListTunes);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return defaultTunes;
|
|
384
|
+
}
|
|
390
385
|
|
|
391
386
|
/**
|
|
392
387
|
* On paste callback that is fired from Editor.
|
|
@@ -421,21 +416,21 @@ export default class EditorjsList {
|
|
|
421
416
|
* Changes ordered list counterType property value
|
|
422
417
|
* @param counterType - new value of the counterType value
|
|
423
418
|
*/
|
|
424
|
-
|
|
425
|
-
|
|
419
|
+
private changeCounters(counterType: OlCounterType): void {
|
|
420
|
+
this.list?.changeCounters(counterType);
|
|
426
421
|
|
|
427
|
-
|
|
428
|
-
|
|
422
|
+
(this.data.meta as OrderedListItemMeta).counterType = counterType;
|
|
423
|
+
}
|
|
429
424
|
|
|
430
425
|
/**
|
|
431
426
|
* Changes ordered list start property value
|
|
432
427
|
* @param index - new value of the start property
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
428
|
+
*/
|
|
429
|
+
private changeStartWith(index: number): void {
|
|
430
|
+
this.list?.changeStartWith(index);
|
|
436
431
|
|
|
437
|
-
|
|
438
|
-
|
|
432
|
+
(this.data.meta as OrderedListItemMeta).start = index;
|
|
433
|
+
}
|
|
439
434
|
|
|
440
435
|
/**
|
|
441
436
|
* This method allows changing tabulator respectfully to passed style
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
.cdx-list {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
outline: none;
|
|
5
|
+
display: grid;
|
|
6
|
+
counter-reset: item;
|
|
7
|
+
grid-gap: var(--spacing-s);
|
|
8
|
+
padding: var(--spacing-xs);
|
|
9
|
+
--spacing-s: 8px;
|
|
10
|
+
--spacing-xs: 6px;
|
|
11
|
+
--list-counter-type: numeric;
|
|
12
|
+
--radius-border: 5px;
|
|
13
|
+
--checkbox-background: #fff;
|
|
14
|
+
--color-border: #C9C9C9;
|
|
15
|
+
--color-bg-checked: #369FFF;
|
|
16
|
+
--line-height: 1.45em;
|
|
17
|
+
--color-bg-checked-hover: #0059AB;
|
|
18
|
+
--color-tick: #fff;
|
|
19
|
+
--size-checkbox: 1.2em;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.cdx-list__item {
|
|
23
|
+
line-height: var(--line-height);
|
|
24
|
+
display: grid;
|
|
25
|
+
grid-template-columns: auto 1fr;
|
|
26
|
+
grid-template-rows: auto auto;
|
|
27
|
+
grid-template-areas:
|
|
28
|
+
"checkbox content"
|
|
29
|
+
". child";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.cdx-list__item-children {
|
|
33
|
+
display: grid;
|
|
34
|
+
grid-area: child;
|
|
35
|
+
grid-gap: var(--spacing-s);
|
|
36
|
+
padding-top: var(--spacing-s);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.cdx-list__item [contenteditable]{
|
|
40
|
+
outline: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.cdx-list__item-content {
|
|
44
|
+
word-break: break-word;
|
|
45
|
+
white-space: pre-wrap;
|
|
46
|
+
grid-area: content;
|
|
47
|
+
padding-left: var(--spacing-s);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.cdx-list__item::before {
|
|
51
|
+
counter-increment: item;
|
|
52
|
+
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.cdx-list-ordered .cdx-list__item::before {
|
|
57
|
+
content: counters(item, ".", var(--list-counter-type)) ".";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.cdx-list-ordered {
|
|
61
|
+
counter-reset: item;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.cdx-list-unordered .cdx-list__item::before {
|
|
65
|
+
content: "•";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.cdx-list-checklist .cdx-list__item::before {
|
|
69
|
+
content: "";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.cdx-list__settings .cdx-settings-button {
|
|
73
|
+
width: 50%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.cdx-list__checkbox {
|
|
77
|
+
padding-top: calc((var(--line-height) - var(--size-checkbox)) / 2);
|
|
78
|
+
grid-area: checkbox;
|
|
79
|
+
width: var(--size-checkbox);
|
|
80
|
+
height: var(--size-checkbox);
|
|
81
|
+
display: -webkit-box;
|
|
82
|
+
display: -ms-flexbox;
|
|
83
|
+
display: flex;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.cdx-list__checkbox svg {
|
|
88
|
+
opacity: 0;
|
|
89
|
+
height: var(--size-checkbox);
|
|
90
|
+
width: var(--size-checkbox);
|
|
91
|
+
left: -1px;
|
|
92
|
+
top: -1px;
|
|
93
|
+
position: absolute;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (hover: hover) {
|
|
97
|
+
^.cdx-list__checkbox:not(.cdx-list__checkbox--no-hover):hover-check svg {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.cdx-list__checkbox--checked {
|
|
103
|
+
line-height: var(--line-height);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media (hover: hover) {
|
|
107
|
+
.cdx-list__checkbox--checked:not(.cdx-list__checkbox--checked--no-hover):hover .cdx-checklist__checkbox-check {
|
|
108
|
+
background: var(--color-bg-checked-hover);
|
|
109
|
+
border-color: var(--color-bg-checked-hover);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
^.cdx-list__checkbox--checked-check {
|
|
114
|
+
background: var(--color-bg-checked);
|
|
115
|
+
border-color: var(--color-bg-checked);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
^.cdx-list__checkbox--checked-check svg {
|
|
119
|
+
opacity: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
^.cdx-list__checkbox--checked-check svg path {
|
|
123
|
+
stroke: var(--color-tick);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
^.cdx-list__checkbox--checked-check::before {
|
|
127
|
+
opacity: 0;
|
|
128
|
+
visibility: visible;
|
|
129
|
+
-webkit-transform: scale(2.5);
|
|
130
|
+
transform: scale(2.5);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.cdx-list__checkbox-check {
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
display: inline-block;
|
|
136
|
+
position: relative;
|
|
137
|
+
margin: 0 auto;
|
|
138
|
+
width: var(--size-checkbox);
|
|
139
|
+
height: var(--size-checkbox);
|
|
140
|
+
-webkit-box-sizing: border-box;
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
border-radius: var(--radius-border);
|
|
143
|
+
border: 1px solid var(--color-border);
|
|
144
|
+
background: var(--checkbox-background);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.cdx-list__checkbox-check::before {
|
|
148
|
+
content: '';
|
|
149
|
+
position: absolute;
|
|
150
|
+
top: 0;
|
|
151
|
+
right: 0;
|
|
152
|
+
bottom: 0;
|
|
153
|
+
left: 0;
|
|
154
|
+
border-radius: 100%;
|
|
155
|
+
background-color: var(--color-bg-checked);
|
|
156
|
+
visibility: hidden;
|
|
157
|
+
pointer-events: none;
|
|
158
|
+
-webkit-transform: scale(1);
|
|
159
|
+
transform: scale(1);
|
|
160
|
+
-webkit-transition: opacity 400ms, -webkit-transform 400ms ease-out;
|
|
161
|
+
transition: opacity 400ms, -webkit-transform 400ms ease-out;
|
|
162
|
+
transition: transform 400ms ease-out, opacity 400ms;
|
|
163
|
+
transition: transform 400ms ease-out, opacity 400ms, -webkit-transform 400ms ease-out;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.cdx-list__checkbox-check--disabled {
|
|
167
|
+
pointer-events: none;
|
|
168
|
+
}
|
|
@@ -39,7 +39,6 @@ function instanceOfChecklistData(data: ListData | OldListData | OldChecklistData
|
|
|
39
39
|
* @returns - normalized data, ready to be used by Editorjs List tool
|
|
40
40
|
*/
|
|
41
41
|
export default function normalizeData(data: ListData | OldListData | OldChecklistData): ListData {
|
|
42
|
-
|
|
43
42
|
const normalizedDataItems: ListItem[] = [];
|
|
44
43
|
|
|
45
44
|
if (instanceOfOldListData(data)) {
|