@zipify/wysiwyg 2.1.1 → 2.2.0-0
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/cli.js +1 -1
- package/dist/wysiwyg.mjs +20 -5
- package/example/presets.js +24 -24
- package/lib/components/toolbar/controls/AlignmentControl.vue +7 -7
- package/lib/components/toolbar/controls/__tests__/AlignmentControl.test.js +3 -3
- package/lib/extensions/Alignment.js +9 -0
- package/lib/extensions/__tests__/Alignment.test.js +26 -2
- package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +45 -1
- package/lib/extensions/core/NodeProcessor.js +6 -0
- package/lib/extensions/core/__tests__/NodeProcessor.test.js +34 -0
- package/lib/extensions/core/__tests__/__snapshots__/NodeProcessor.test.js.snap +62 -0
- package/package.json +1 -1
package/dist/wysiwyg.mjs
CHANGED
|
@@ -23160,7 +23160,7 @@ var render$d = function __render__32() {
|
|
|
23160
23160
|
"options": _vm.$options.alignments
|
|
23161
23161
|
},
|
|
23162
23162
|
on: {
|
|
23163
|
-
"change": _vm.
|
|
23163
|
+
"change": _vm.toggle
|
|
23164
23164
|
},
|
|
23165
23165
|
scopedSlots: _vm._u([{
|
|
23166
23166
|
key: "option",
|
|
@@ -23240,16 +23240,20 @@ const __vue2_script$d = {
|
|
|
23240
23240
|
},
|
|
23241
23241
|
setup(_, { emit }) {
|
|
23242
23242
|
const editor = inject(InjectionTokens$1.EDITOR);
|
|
23243
|
-
const
|
|
23243
|
+
const alignment = editor.commands.getAlignment();
|
|
23244
|
+
const currentValue = computed(() => {
|
|
23245
|
+
var _a;
|
|
23246
|
+
return (_a = unref(alignment)) != null ? _a : "none";
|
|
23247
|
+
});
|
|
23244
23248
|
const isCustomized = editor.commands.isSettingCustomized(TextSettings.ALIGNMENT);
|
|
23245
|
-
function
|
|
23246
|
-
editor.chain().focus().
|
|
23249
|
+
function toggle(value) {
|
|
23250
|
+
editor.chain().focus().toggleAlignment(value).run();
|
|
23247
23251
|
emit("applied");
|
|
23248
23252
|
}
|
|
23249
23253
|
return {
|
|
23250
23254
|
currentValue,
|
|
23251
23255
|
isCustomized,
|
|
23252
|
-
|
|
23256
|
+
toggle
|
|
23253
23257
|
};
|
|
23254
23258
|
}
|
|
23255
23259
|
};
|
|
@@ -25251,9 +25255,15 @@ const Alignment = Extension.create({
|
|
|
25251
25255
|
],
|
|
25252
25256
|
addCommands() {
|
|
25253
25257
|
return {
|
|
25258
|
+
toggleAlignment: createCommand(({ commands: commands2 }, value) => {
|
|
25259
|
+
const currentValue = commands2.getAlignment();
|
|
25260
|
+
const isCurrentValue = unref(currentValue) === value;
|
|
25261
|
+
!isCurrentValue ? commands2.applyAlignment(value) : commands2.removeAlignment();
|
|
25262
|
+
}),
|
|
25254
25263
|
applyAlignment: createCommand(({ commands: commands2 }, value) => {
|
|
25255
25264
|
commands2.setBlockAttributes(this.name, { desktop: value, tablet: value, mobile: value });
|
|
25256
25265
|
}),
|
|
25266
|
+
removeAlignment: createCommand(({ commands: commands2 }) => commands2.removeBlockAttributes(this.name)),
|
|
25257
25267
|
getAlignment: createCommand(({ commands: commands2 }) => {
|
|
25258
25268
|
const attribute = commands2.getBlockAttributes(this.name, DEFAULTS$1);
|
|
25259
25269
|
const device = commands2.getDevice();
|
|
@@ -27325,6 +27335,11 @@ const NodeProcessor = Extension.create({
|
|
|
27325
27335
|
}
|
|
27326
27336
|
return Object.keys(attrs).length ? attrs : null;
|
|
27327
27337
|
})),
|
|
27338
|
+
removeBlockAttributes: createCommand(({ commands: commands2 }, names) => {
|
|
27339
|
+
for (const type of NodeTypes.blocks) {
|
|
27340
|
+
commands2.resetAttributes(type, names);
|
|
27341
|
+
}
|
|
27342
|
+
}),
|
|
27328
27343
|
applyMark: createCommand(({ state, commands: commands2 }, name, value) => {
|
|
27329
27344
|
const { tr, doc: doc2, schema } = state;
|
|
27330
27345
|
const { $from, $to } = tr.selection;
|
package/example/presets.js
CHANGED
|
@@ -7,7 +7,7 @@ export const PRESETS = [
|
|
|
7
7
|
'level': 1
|
|
8
8
|
},
|
|
9
9
|
'desktop': {
|
|
10
|
-
'alignment':
|
|
10
|
+
'alignment': null,
|
|
11
11
|
'line_height': '1.2',
|
|
12
12
|
'font_size': '40px'
|
|
13
13
|
},
|
|
@@ -19,12 +19,12 @@ export const PRESETS = [
|
|
|
19
19
|
'text_decoration': 'none'
|
|
20
20
|
},
|
|
21
21
|
'tablet': {
|
|
22
|
-
'alignment':
|
|
22
|
+
'alignment': null,
|
|
23
23
|
'line_height': '1.2',
|
|
24
24
|
'font_size': '40px'
|
|
25
25
|
},
|
|
26
26
|
'mobile': {
|
|
27
|
-
'alignment':
|
|
27
|
+
'alignment': null,
|
|
28
28
|
'line_height': '1.2',
|
|
29
29
|
'font_size': '28px'
|
|
30
30
|
}
|
|
@@ -37,7 +37,7 @@ export const PRESETS = [
|
|
|
37
37
|
'level': 2
|
|
38
38
|
},
|
|
39
39
|
'desktop': {
|
|
40
|
-
'alignment':
|
|
40
|
+
'alignment': null,
|
|
41
41
|
'line_height': '1.2',
|
|
42
42
|
'font_size': '32px'
|
|
43
43
|
},
|
|
@@ -49,12 +49,12 @@ export const PRESETS = [
|
|
|
49
49
|
'text_decoration': 'none'
|
|
50
50
|
},
|
|
51
51
|
'tablet': {
|
|
52
|
-
'alignment':
|
|
52
|
+
'alignment': null,
|
|
53
53
|
'line_height': '1.2',
|
|
54
54
|
'font_size': '32px'
|
|
55
55
|
},
|
|
56
56
|
'mobile': {
|
|
57
|
-
'alignment':
|
|
57
|
+
'alignment': null,
|
|
58
58
|
'line_height': '1.2',
|
|
59
59
|
'font_size': '24px'
|
|
60
60
|
}
|
|
@@ -67,7 +67,7 @@ export const PRESETS = [
|
|
|
67
67
|
'level': 3
|
|
68
68
|
},
|
|
69
69
|
'desktop': {
|
|
70
|
-
'alignment':
|
|
70
|
+
'alignment': null,
|
|
71
71
|
'line_height': '1.2',
|
|
72
72
|
'font_size': '28px'
|
|
73
73
|
},
|
|
@@ -79,12 +79,12 @@ export const PRESETS = [
|
|
|
79
79
|
'text_decoration': 'none'
|
|
80
80
|
},
|
|
81
81
|
'tablet': {
|
|
82
|
-
'alignment':
|
|
82
|
+
'alignment': null,
|
|
83
83
|
'line_height': '1.2',
|
|
84
84
|
'font_size': '28px'
|
|
85
85
|
},
|
|
86
86
|
'mobile': {
|
|
87
|
-
'alignment':
|
|
87
|
+
'alignment': null,
|
|
88
88
|
'line_height': '1.2',
|
|
89
89
|
'font_size': '20px'
|
|
90
90
|
}
|
|
@@ -97,7 +97,7 @@ export const PRESETS = [
|
|
|
97
97
|
'level': 4
|
|
98
98
|
},
|
|
99
99
|
'desktop': {
|
|
100
|
-
'alignment':
|
|
100
|
+
'alignment': null,
|
|
101
101
|
'line_height': '1.2',
|
|
102
102
|
'font_size': '24px'
|
|
103
103
|
},
|
|
@@ -109,12 +109,12 @@ export const PRESETS = [
|
|
|
109
109
|
'text_decoration': 'none'
|
|
110
110
|
},
|
|
111
111
|
'tablet': {
|
|
112
|
-
'alignment':
|
|
112
|
+
'alignment': null,
|
|
113
113
|
'line_height': '1.2',
|
|
114
114
|
'font_size': '24px'
|
|
115
115
|
},
|
|
116
116
|
'mobile': {
|
|
117
|
-
'alignment':
|
|
117
|
+
'alignment': null,
|
|
118
118
|
'line_height': '1.2',
|
|
119
119
|
'font_size': '18px'
|
|
120
120
|
}
|
|
@@ -124,7 +124,7 @@ export const PRESETS = [
|
|
|
124
124
|
'name': 'Link',
|
|
125
125
|
'hidden': true,
|
|
126
126
|
'desktop': {
|
|
127
|
-
'alignment':
|
|
127
|
+
'alignment': null,
|
|
128
128
|
'line_height': 'inherit',
|
|
129
129
|
'font_size': 'inherit'
|
|
130
130
|
},
|
|
@@ -136,12 +136,12 @@ export const PRESETS = [
|
|
|
136
136
|
'text_decoration': 'underline'
|
|
137
137
|
},
|
|
138
138
|
'tablet': {
|
|
139
|
-
'alignment':
|
|
139
|
+
'alignment': null,
|
|
140
140
|
'line_height': 'inherit',
|
|
141
141
|
'font_size': 'inherit'
|
|
142
142
|
},
|
|
143
143
|
'mobile': {
|
|
144
|
-
'alignment':
|
|
144
|
+
'alignment': null,
|
|
145
145
|
'line_height': 'inherit',
|
|
146
146
|
'font_size': 'inherit'
|
|
147
147
|
}
|
|
@@ -150,7 +150,7 @@ export const PRESETS = [
|
|
|
150
150
|
'id': 'regular-1',
|
|
151
151
|
'name': 'Regular',
|
|
152
152
|
'desktop': {
|
|
153
|
-
'alignment':
|
|
153
|
+
'alignment': null,
|
|
154
154
|
'line_height': '1.43',
|
|
155
155
|
'font_size': '18px'
|
|
156
156
|
},
|
|
@@ -162,12 +162,12 @@ export const PRESETS = [
|
|
|
162
162
|
'text_decoration': 'none'
|
|
163
163
|
},
|
|
164
164
|
'tablet': {
|
|
165
|
-
'alignment':
|
|
165
|
+
'alignment': null,
|
|
166
166
|
'line_height': '1.43',
|
|
167
167
|
'font_size': '18px'
|
|
168
168
|
},
|
|
169
169
|
'mobile': {
|
|
170
|
-
'alignment':
|
|
170
|
+
'alignment': null,
|
|
171
171
|
'line_height': '1.43',
|
|
172
172
|
'font_size': '18px'
|
|
173
173
|
}
|
|
@@ -177,7 +177,7 @@ export const PRESETS = [
|
|
|
177
177
|
'name': 'Regular 2',
|
|
178
178
|
'fallbackClass': 'zpa-regular2',
|
|
179
179
|
'desktop': {
|
|
180
|
-
'alignment':
|
|
180
|
+
'alignment': null,
|
|
181
181
|
'line_height': '1.43',
|
|
182
182
|
'font_size': '16px'
|
|
183
183
|
},
|
|
@@ -189,12 +189,12 @@ export const PRESETS = [
|
|
|
189
189
|
'text_decoration': 'none'
|
|
190
190
|
},
|
|
191
191
|
'tablet': {
|
|
192
|
-
'alignment':
|
|
192
|
+
'alignment': null,
|
|
193
193
|
'line_height': '1.43',
|
|
194
194
|
'font_size': '16px'
|
|
195
195
|
},
|
|
196
196
|
'mobile': {
|
|
197
|
-
'alignment':
|
|
197
|
+
'alignment': null,
|
|
198
198
|
'line_height': '1.43',
|
|
199
199
|
'font_size': '16px'
|
|
200
200
|
}
|
|
@@ -204,7 +204,7 @@ export const PRESETS = [
|
|
|
204
204
|
'name': 'Regular 3',
|
|
205
205
|
'fallbackClass': 'zpa-regular3',
|
|
206
206
|
'desktop': {
|
|
207
|
-
'alignment':
|
|
207
|
+
'alignment': null,
|
|
208
208
|
'line_height': '1.43',
|
|
209
209
|
'font_size': '12px'
|
|
210
210
|
},
|
|
@@ -216,12 +216,12 @@ export const PRESETS = [
|
|
|
216
216
|
'text_decoration': 'none'
|
|
217
217
|
},
|
|
218
218
|
'tablet': {
|
|
219
|
-
'alignment':
|
|
219
|
+
'alignment': null,
|
|
220
220
|
'line_height': '1.43',
|
|
221
221
|
'font_size': '12px'
|
|
222
222
|
},
|
|
223
223
|
'mobile': {
|
|
224
|
-
'alignment':
|
|
224
|
+
'alignment': null,
|
|
225
225
|
'line_height': '1.43',
|
|
226
226
|
'font_size': '12px'
|
|
227
227
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ButtonToggle :value="currentValue" :options="$options.alignments" @change="
|
|
2
|
+
<ButtonToggle :value="currentValue" :options="$options.alignments" @change="toggle">
|
|
3
3
|
<template #option="{ isActive, option, activate }">
|
|
4
4
|
<Button
|
|
5
5
|
class="zw-position--relative"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
-
import { inject } from 'vue';
|
|
27
|
+
import { inject, computed, unref } from 'vue';
|
|
28
28
|
import { InjectionTokens } from '../../../injectionTokens';
|
|
29
29
|
import { Alignments, TextSettings } from '../../../enums';
|
|
30
30
|
import { ButtonToggle, Button, Icon } from '../../base';
|
|
@@ -64,19 +64,19 @@ export default {
|
|
|
64
64
|
|
|
65
65
|
setup(_, { emit }) {
|
|
66
66
|
const editor = inject(InjectionTokens.EDITOR);
|
|
67
|
-
|
|
68
|
-
const currentValue =
|
|
67
|
+
const alignment = editor.commands.getAlignment();
|
|
68
|
+
const currentValue = computed(() => unref(alignment) ?? 'none');
|
|
69
69
|
const isCustomized = editor.commands.isSettingCustomized(TextSettings.ALIGNMENT);
|
|
70
70
|
|
|
71
|
-
function
|
|
72
|
-
editor.chain().focus().
|
|
71
|
+
function toggle(value) {
|
|
72
|
+
editor.chain().focus().toggleAlignment(value).run();
|
|
73
73
|
emit('applied');
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
return {
|
|
77
77
|
currentValue,
|
|
78
78
|
isCustomized,
|
|
79
|
-
|
|
79
|
+
toggle
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
};
|
|
@@ -14,7 +14,7 @@ const createEditor = ({ alignment, isSettingCustomized } = {}) => ({
|
|
|
14
14
|
getAlignment: () => ref(alignment),
|
|
15
15
|
isSettingCustomized: () => ref(isSettingCustomized ?? false),
|
|
16
16
|
focus: jest.fn().mockReturnThis(),
|
|
17
|
-
|
|
17
|
+
toggleAlignment: jest.fn().mockReturnThis(),
|
|
18
18
|
run: jest.fn()
|
|
19
19
|
},
|
|
20
20
|
|
|
@@ -60,7 +60,7 @@ describe('selection value', () => {
|
|
|
60
60
|
expect(buttonWrapper.props('value')).toBe(Alignments.RIGHT);
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
test('should
|
|
63
|
+
test('should toggle new value', () => {
|
|
64
64
|
const editor = createEditor({ alignment: Alignments.RIGHT });
|
|
65
65
|
const wrapper = createComponent({
|
|
66
66
|
editor,
|
|
@@ -76,7 +76,7 @@ describe('selection value', () => {
|
|
|
76
76
|
|
|
77
77
|
buttonWrapper.vm.$emit('change', Alignments.CENTER);
|
|
78
78
|
|
|
79
|
-
expect(editor.commands.
|
|
79
|
+
expect(editor.commands.toggleAlignment).toHaveBeenCalledWith(Alignments.CENTER);
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
82
|
|
|
@@ -51,6 +51,13 @@ export const Alignment = Extension.create({
|
|
|
51
51
|
|
|
52
52
|
addCommands() {
|
|
53
53
|
return {
|
|
54
|
+
toggleAlignment: createCommand(({ commands }, value) => {
|
|
55
|
+
const currentValue = commands.getAlignment();
|
|
56
|
+
const isCurrentValue = unref(currentValue) === value;
|
|
57
|
+
|
|
58
|
+
!isCurrentValue ? commands.applyAlignment(value) : commands.removeAlignment();
|
|
59
|
+
}),
|
|
60
|
+
|
|
54
61
|
applyAlignment: createCommand(({ commands }, value) => {
|
|
55
62
|
// const device = unref(commands.getDevice());
|
|
56
63
|
//
|
|
@@ -60,6 +67,8 @@ export const Alignment = Extension.create({
|
|
|
60
67
|
commands.setBlockAttributes(this.name, { desktop: value, tablet: value, mobile: value });
|
|
61
68
|
}),
|
|
62
69
|
|
|
70
|
+
removeAlignment: createCommand(({ commands }) => commands.removeBlockAttributes(this.name)),
|
|
71
|
+
|
|
63
72
|
getAlignment: createCommand(({ commands }) => {
|
|
64
73
|
const attribute = commands.getBlockAttributes(this.name, DEFAULTS);
|
|
65
74
|
const device = commands.getDevice();
|
|
@@ -70,8 +70,19 @@ describe('get value', () => {
|
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
describe('
|
|
74
|
-
test('should
|
|
73
|
+
describe('change value', () => {
|
|
74
|
+
test('should toggle value', () => {
|
|
75
|
+
const editor = createEditor({
|
|
76
|
+
content: createContent({ alignment: null })
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
editor.commands.selectAll();
|
|
80
|
+
editor.commands.toggleAlignment(Alignments.RIGHT);
|
|
81
|
+
|
|
82
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('should apply value', () => {
|
|
75
86
|
const editor = createEditor({
|
|
76
87
|
content: createContent({ alignment: null })
|
|
77
88
|
});
|
|
@@ -81,6 +92,19 @@ describe('apply value', () => {
|
|
|
81
92
|
|
|
82
93
|
expect(editor.getJSON()).toMatchSnapshot();
|
|
83
94
|
});
|
|
95
|
+
|
|
96
|
+
test('should remove value', () => {
|
|
97
|
+
const editor = createEditor({
|
|
98
|
+
content: createContent({
|
|
99
|
+
alignment: { desktop: Alignments.CENTER }
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
editor.commands.selectAll();
|
|
104
|
+
editor.commands.removeAlignment(TextSettings.ALIGNMENT);
|
|
105
|
+
|
|
106
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
107
|
+
});
|
|
84
108
|
});
|
|
85
109
|
|
|
86
110
|
describe('rendering', () => {
|
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`change value should apply value 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"content": Array [
|
|
6
|
+
Object {
|
|
7
|
+
"attrs": Object {
|
|
8
|
+
"alignment": Object {
|
|
9
|
+
"desktop": "right",
|
|
10
|
+
"mobile": "right",
|
|
11
|
+
"tablet": "right",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
"content": Array [
|
|
15
|
+
Object {
|
|
16
|
+
"text": "hello world",
|
|
17
|
+
"type": "text",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
"type": "paragraph",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
"type": "doc",
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
exports[`change value should remove value 1`] = `
|
|
28
|
+
Object {
|
|
29
|
+
"content": Array [
|
|
30
|
+
Object {
|
|
31
|
+
"attrs": Object {
|
|
32
|
+
"alignment": null,
|
|
33
|
+
},
|
|
34
|
+
"content": Array [
|
|
35
|
+
Object {
|
|
36
|
+
"text": "hello world",
|
|
37
|
+
"type": "text",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
"type": "paragraph",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
"type": "doc",
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
exports[`change value should toggle value 1`] = `
|
|
4
48
|
Object {
|
|
5
49
|
"content": Array [
|
|
6
50
|
Object {
|
|
@@ -37,6 +37,12 @@ export const NodeProcessor = Extension.create({
|
|
|
37
37
|
return Object.keys(attrs).length ? attrs : null;
|
|
38
38
|
})),
|
|
39
39
|
|
|
40
|
+
removeBlockAttributes: createCommand(({ commands }, names) => {
|
|
41
|
+
for (const type of NodeTypes.blocks) {
|
|
42
|
+
commands.resetAttributes(type, names);
|
|
43
|
+
}
|
|
44
|
+
}),
|
|
45
|
+
|
|
40
46
|
applyMark: createCommand(({ state, commands }, name, value) => {
|
|
41
47
|
const { tr, doc, schema } = state;
|
|
42
48
|
const { $from, $to } = tr.selection;
|
|
@@ -16,6 +16,9 @@ const MockLineHeight = Extension.create({
|
|
|
16
16
|
line_height: {
|
|
17
17
|
isRequired: false,
|
|
18
18
|
renderHTML: (attrs) => ({ style: `line-height: ${attrs.line_height}` })
|
|
19
|
+
},
|
|
20
|
+
alignment: {
|
|
21
|
+
isRequired: false
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
}
|
|
@@ -138,6 +141,37 @@ describe('block attributes', () => {
|
|
|
138
141
|
expect(editor.getJSON()).toMatchSnapshot();
|
|
139
142
|
});
|
|
140
143
|
|
|
144
|
+
test('should remove some attribute', () => {
|
|
145
|
+
const editor = createEditor({
|
|
146
|
+
content: createContent({
|
|
147
|
+
line_height: { mobile: '1.2' }
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
editor.commands.selectAll();
|
|
152
|
+
editor.commands.removeBlockAttributes(TextSettings.LINE_HEIGHT);
|
|
153
|
+
|
|
154
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test('should remove a few some attributes', () => {
|
|
158
|
+
const editor = createEditor({
|
|
159
|
+
content: createContent({
|
|
160
|
+
line_height: { mobile: '1.2' },
|
|
161
|
+
alignment: {
|
|
162
|
+
mobile: 'center',
|
|
163
|
+
tablet: 'center',
|
|
164
|
+
desktop: 'center'
|
|
165
|
+
}
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
editor.commands.selectAll();
|
|
170
|
+
editor.commands.removeBlockAttributes([TextSettings.LINE_HEIGHT, TextSettings.ALIGNMENT]);
|
|
171
|
+
|
|
172
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
173
|
+
});
|
|
174
|
+
|
|
141
175
|
test('should set attributes with defaults', () => {
|
|
142
176
|
const editor = createEditor({
|
|
143
177
|
content: createContent({ line_height: null })
|