@zipify/wysiwyg 1.0.0-dev.16 → 1.0.0-dev.19

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.
Files changed (100) hide show
  1. package/.github/dependabot.yaml +1 -0
  2. package/dist/wysiwyg.css +293 -12
  3. package/dist/wysiwyg.js +1 -1
  4. package/example/ExampleApp.vue +6 -2
  5. package/example/pageBlocks.js +31 -0
  6. package/example/presets.js +2 -2
  7. package/lib/Wysiwyg.vue +16 -6
  8. package/lib/assets/icons/link.svg +3 -0
  9. package/lib/assets/icons/unlink.svg +3 -0
  10. package/lib/components/base/Button.vue +21 -1
  11. package/lib/components/base/Checkbox.vue +89 -0
  12. package/lib/components/base/FieldLabel.vue +2 -1
  13. package/lib/components/base/Icon.vue +2 -2
  14. package/lib/components/base/Modal.vue +0 -1
  15. package/lib/components/base/TextField.vue +106 -0
  16. package/lib/components/base/__tests__/TextField.test.js +57 -0
  17. package/lib/components/base/__tests__/__snapshots__/TextField.test.js.snap +9 -0
  18. package/lib/components/base/composables/index.js +1 -0
  19. package/lib/components/base/composables/useValidator.js +19 -0
  20. package/lib/components/base/dropdown/Dropdown.vue +15 -3
  21. package/lib/components/base/dropdown/DropdownActivator.vue +19 -3
  22. package/lib/components/base/index.js +3 -1
  23. package/lib/components/toolbar/Toolbar.vue +48 -8
  24. package/lib/components/toolbar/ToolbarFull.vue +10 -2
  25. package/lib/components/toolbar/__tests__/Toolbar.test.js +6 -0
  26. package/lib/components/toolbar/controls/FontSizeControl.vue +7 -0
  27. package/lib/components/toolbar/controls/UnderlineControl.vue +2 -2
  28. package/lib/components/toolbar/controls/__tests__/UnderlineControl.test.js +4 -0
  29. package/lib/components/toolbar/controls/index.js +1 -0
  30. package/lib/components/toolbar/controls/link/LinkControl.vue +152 -0
  31. package/lib/components/toolbar/controls/link/LinkControlApply.vue +35 -0
  32. package/lib/components/toolbar/controls/link/LinkControlHeader.vue +67 -0
  33. package/lib/components/toolbar/controls/link/composables/index.js +1 -0
  34. package/lib/components/toolbar/controls/link/composables/useLink.js +61 -0
  35. package/lib/components/toolbar/controls/link/destination/LinkControlDestination.vue +103 -0
  36. package/lib/components/toolbar/controls/link/destination/LinkControlPageBlock.vue +54 -0
  37. package/lib/components/toolbar/controls/link/destination/LinkControlUrl.vue +52 -0
  38. package/lib/components/toolbar/controls/link/destination/index.js +1 -0
  39. package/lib/components/toolbar/controls/link/index.js +1 -0
  40. package/lib/composables/__tests__/useEditor.test.js +2 -2
  41. package/lib/composables/useEditor.js +4 -5
  42. package/lib/composables/useToolbar.js +15 -19
  43. package/lib/enums/LinkDestinations.js +4 -0
  44. package/lib/enums/LinkTargets.js +4 -0
  45. package/lib/enums/TextSettings.js +3 -1
  46. package/lib/enums/index.js +2 -0
  47. package/lib/extensions/Alignment.js +18 -6
  48. package/lib/extensions/BackgroundColor.js +14 -6
  49. package/lib/extensions/FontColor.js +14 -6
  50. package/lib/extensions/FontFamily.js +25 -8
  51. package/lib/extensions/FontSize.js +26 -13
  52. package/lib/extensions/FontStyle.js +23 -13
  53. package/lib/extensions/FontWeight.js +22 -14
  54. package/lib/extensions/LineHeight.js +11 -3
  55. package/lib/extensions/Link.js +101 -0
  56. package/lib/extensions/StylePreset.js +4 -2
  57. package/lib/extensions/TextDecoration.js +27 -12
  58. package/lib/extensions/__tests__/Alignment.test.js +11 -5
  59. package/lib/extensions/__tests__/BackgroundColor.test.js +11 -5
  60. package/lib/extensions/__tests__/CaseStyle.test.js +3 -5
  61. package/lib/extensions/__tests__/FontColor.test.js +11 -5
  62. package/lib/extensions/__tests__/FontFamily.test.js +32 -7
  63. package/lib/extensions/__tests__/FontSize.test.js +11 -5
  64. package/lib/extensions/__tests__/FontStyle.test.js +11 -5
  65. package/lib/extensions/__tests__/FontWeight.test.js +11 -5
  66. package/lib/extensions/__tests__/LineHeight.test.js +11 -5
  67. package/lib/extensions/__tests__/StylePreset.test.js +70 -6
  68. package/lib/extensions/__tests__/TextDecoration.test.js +27 -5
  69. package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +26 -2
  70. package/lib/extensions/__tests__/__snapshots__/BackgroundColor.test.js.snap +30 -1
  71. package/lib/extensions/__tests__/__snapshots__/FontColor.test.js.snap +18 -1
  72. package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +88 -1
  73. package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +33 -2
  74. package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +25 -4
  75. package/lib/extensions/__tests__/__snapshots__/FontWeight.test.js.snap +30 -1
  76. package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +26 -2
  77. package/lib/extensions/__tests__/__snapshots__/StylePreset.test.js.snap +6 -2
  78. package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +93 -3
  79. package/lib/extensions/core/CopyPasteProcessor.js +10 -0
  80. package/lib/extensions/core/TextProcessor.js +10 -0
  81. package/lib/extensions/core/__tests__/NodeProcessor.test.js +3 -5
  82. package/lib/extensions/core/__tests__/SelectionProcessor.test.js +3 -5
  83. package/lib/extensions/core/__tests__/TextProcessor.test.js +138 -12
  84. package/lib/extensions/core/__tests__/__snapshots__/TextProcessor.test.js.snap +26 -0
  85. package/lib/extensions/core/index.js +11 -2
  86. package/lib/extensions/core/plugins/PastePlugin.js +48 -0
  87. package/lib/extensions/core/plugins/ProseMirrorPlugin.js +20 -0
  88. package/lib/extensions/core/plugins/index.js +1 -0
  89. package/lib/extensions/index.js +41 -34
  90. package/lib/extensions/list/__tests__/List.test.js +3 -5
  91. package/lib/extensions/list/__tests__/__snapshots__/List.test.js.snap +45 -15
  92. package/lib/injectionTokens.js +2 -1
  93. package/lib/services/ContentNormalizer.js +62 -20
  94. package/lib/services/__tests__/ContentNormalizer.test.js +40 -7
  95. package/lib/styles/content.css +96 -9
  96. package/lib/styles/helpers/offsets.css +16 -0
  97. package/lib/styles/variables.css +6 -0
  98. package/lib/utils/__tests__/__snapshots__/renderInlineSetting.test.js.snap +4 -4
  99. package/lib/utils/renderInlineSetting.js +1 -1
  100. package/package.json +11 -9
@@ -1,29 +1,120 @@
1
- import { Editor, Mark } from '@tiptap/vue-2';
1
+ import { Editor, Mark, Extension } from '@tiptap/vue-2';
2
2
  import { NodeFactory } from '../../../__tests__/utils';
3
- import { CORE_EXTENSIONS } from '../index';
4
3
  import { ContentNormalizer } from '../../../services';
4
+ import { NodeTypes, TextSettings } from '../../../enums';
5
+ import { buildCoreExtensions } from '../index';
6
+
7
+ const MockFontSize = Mark.create({
8
+ name: TextSettings.FONT_SIZE,
9
+
10
+ addAttributes: () => ({
11
+ value: { default: null }
12
+ }),
13
+
14
+ renderHTML: () => ['span', {}, 0]
15
+ });
5
16
 
6
17
  const MockFontWeight = Mark.create({
7
- name: 'font_weight',
18
+ name: TextSettings.FONT_WEIGHT,
8
19
 
9
20
  addAttributes: () => ({
10
- value: { required: true }
21
+ value: { default: null }
11
22
  }),
12
23
 
13
- renderHTML(context) {
14
- const { value } = context.HTMLAttributes;
24
+ renderHTML: () => ['span', {}, 0]
25
+ });
26
+
27
+ const MockAlignment = Extension.create({
28
+ name: TextSettings.ALIGNMENT,
15
29
 
16
- return ['span', { style: `font-weight: ${value}` }, 0];
17
- }
30
+ addGlobalAttributes: () => [
31
+ {
32
+ types: [NodeTypes.PARAGRAPH, NodeTypes.HEADING],
33
+ attributes: {
34
+ [TextSettings.ALIGNMENT]: {
35
+ default: null,
36
+ renderHTML: () => ({})
37
+ }
38
+ }
39
+ }
40
+ ]
18
41
  });
19
42
 
20
- function createEditor({ content }) {
21
- const normalizer = new ContentNormalizer();
43
+ const MockBackgroundColor = Mark.create({
44
+ name: TextSettings.BACKGROUND_COLOR,
45
+
46
+ addAttributes: () => ({
47
+ value: { default: null }
48
+ }),
49
+
50
+ renderHTML: () => ['span', {}, 0]
51
+ });
52
+
53
+ const MockFontColor = Mark.create({
54
+ name: TextSettings.FONT_COLOR,
55
+
56
+ addAttributes: () => ({
57
+ value: { default: null }
58
+ }),
59
+
60
+ renderHTML: () => ['span', {}, 0]
61
+ });
62
+
63
+ const MockFontFamily = Mark.create({
64
+ name: TextSettings.FONT_FAMILY,
65
+
66
+ addAttributes: () => ({
67
+ value: { default: null }
68
+ }),
69
+
70
+ renderHTML: () => ['span', {}, 0]
71
+ });
72
+
73
+ const MockFontStyle = Mark.create({
74
+ name: TextSettings.FONT_STYLE,
75
+
76
+ addAttributes: () => ({
77
+ value: { default: null }
78
+ }),
79
+
80
+ renderHTML: () => ['span', {}, 0]
81
+ });
82
+
83
+ const MockTextDecoration = Mark.create({
84
+ name: TextSettings.TEXT_DECORATION,
85
+
86
+ addAttributes: () => ({
87
+ value: { default: null }
88
+ }),
22
89
 
90
+ renderHTML: () => ['span', {}, 0]
91
+ });
92
+
93
+ const MockSuperscript = Mark.create({
94
+ name: TextSettings.SUPERSCRIPT,
95
+
96
+ addAttributes: () => ({
97
+ value: { default: null }
98
+ }),
99
+
100
+ renderHTML: () => ['span', {}, 0]
101
+ });
102
+
103
+ function createEditor({ content }) {
23
104
  return new Editor({
24
- content: normalizer.normalize(content),
105
+ content: ContentNormalizer.normalize(content),
25
106
  element: document.createElement('div'),
26
- extensions: CORE_EXTENSIONS.concat(MockFontWeight)
107
+ extensions: buildCoreExtensions().concat(
108
+ MockFontSize,
109
+ MockFontWeight,
110
+ MockAlignment,
111
+ MockBackgroundColor,
112
+ MockFontColor,
113
+ MockFontFamily,
114
+ MockFontStyle,
115
+ MockTextDecoration,
116
+ MockSuperscript
117
+ )
27
118
  });
28
119
  }
29
120
 
@@ -62,3 +153,38 @@ describe('transform text', () => {
62
153
  expect(editor.getJSON()).toMatchSnapshot();
63
154
  });
64
155
  });
156
+
157
+ describe('selected text', () => {
158
+ test('should return selected text', () => {
159
+ const editor = createEditor({
160
+ content: NodeFactory.doc([
161
+ NodeFactory.paragraph('hello world')
162
+ ])
163
+ });
164
+
165
+ editor.commands.setTextSelection({ from: 5, to: 11 });
166
+
167
+ expect(editor.commands.getSelectedText()).toEqual('o worl');
168
+ });
169
+ });
170
+
171
+ describe('unset marks', () => {
172
+ test('should reset all marks', () => {
173
+ const editor = createEditor({
174
+ content: NodeFactory.doc([
175
+ NodeFactory.paragraph([
176
+ NodeFactory.text('hello world', [
177
+ NodeFactory.mark('font_weight', { value: '700' })
178
+ ])
179
+ ])
180
+ ])
181
+ });
182
+
183
+ editor.chain()
184
+ .selectAll()
185
+ .unsetMarks(TextSettings.marks)
186
+ .run();
187
+
188
+ expect(editor.getJSON()).toMatchSnapshot();
189
+ });
190
+ });
@@ -4,6 +4,9 @@ exports[`transform text should keep text marks 1`] = `
4
4
  Object {
5
5
  "content": Array [
6
6
  Object {
7
+ "attrs": Object {
8
+ "alignment": null,
9
+ },
7
10
  "content": Array [
8
11
  Object {
9
12
  "marks": Array [
@@ -29,6 +32,9 @@ exports[`transform text should transform selected text 1`] = `
29
32
  Object {
30
33
  "content": Array [
31
34
  Object {
35
+ "attrs": Object {
36
+ "alignment": null,
37
+ },
32
38
  "content": Array [
33
39
  Object {
34
40
  "text": "hELLO world",
@@ -41,3 +47,23 @@ Object {
41
47
  "type": "doc",
42
48
  }
43
49
  `;
50
+
51
+ exports[`unset marks should reset all marks 1`] = `
52
+ Object {
53
+ "content": Array [
54
+ Object {
55
+ "attrs": Object {
56
+ "alignment": null,
57
+ },
58
+ "content": Array [
59
+ Object {
60
+ "text": "hello world",
61
+ "type": "text",
62
+ },
63
+ ],
64
+ "type": "paragraph",
65
+ },
66
+ ],
67
+ "type": "doc",
68
+ }
69
+ `;
@@ -1,17 +1,26 @@
1
1
  import Document from '@tiptap/extension-document';
2
2
  import Paragraph from '@tiptap/extension-paragraph';
3
3
  import Text from '@tiptap/extension-text';
4
+ import Placeholder from '@tiptap/extension-placeholder';
5
+ import History from '@tiptap/extension-history';
4
6
  import { NodeProcessor } from './NodeProcessor';
5
7
  import { TextProcessor } from './TextProcessor';
6
8
  import { SelectionProcessor } from './SelectionProcessor';
9
+ import { CopyPasteProcessor } from './CopyPasteProcessor';
7
10
 
8
- export const CORE_EXTENSIONS = [
11
+ export const buildCoreExtensions = () => [
9
12
  Document,
10
13
  Paragraph.configure({
11
14
  HTMLAttributes: { class: 'zw-style' }
12
15
  }),
13
16
  Text,
17
+ Placeholder.configure({
18
+ placeholder: 'Type your text here...',
19
+ emptyNodeClass: 'zw-wysiwyg__placeholder'
20
+ }),
21
+ History,
14
22
  NodeProcessor,
15
23
  TextProcessor,
16
- SelectionProcessor
24
+ SelectionProcessor,
25
+ CopyPasteProcessor
17
26
  ];
@@ -0,0 +1,48 @@
1
+ import { ContentNormalizer } from '../../../services';
2
+ import { ProseMirrorPlugin } from './ProseMirrorPlugin';
3
+
4
+ export class PastePlugin extends ProseMirrorPlugin {
5
+ buildProps() {
6
+ return {
7
+ transformPastedHTML: ContentNormalizer.normalize,
8
+ handlePaste: this._handlePaste.bind(this)
9
+ };
10
+ }
11
+
12
+ _handlePaste(view, _, slice) {
13
+ const transaction = this._insertPastedContent(view, slice)
14
+ .scrollIntoView()
15
+ .setMeta('paste', true)
16
+ .setMeta('uiEvent', 'paste');
17
+
18
+ view.dispatch(transaction);
19
+
20
+ return true;
21
+ }
22
+
23
+ _insertPastedContent({ state, input }, slice) {
24
+ if (!this._isSingleNode(slice)) {
25
+ return state.tr.replaceSelection(slice);
26
+ }
27
+
28
+ const { $from, $to } = state.selection;
29
+ const isSingleNodeReplacing = $from.sharedDepth($to.pos) === $from.depth;
30
+
31
+ if (!isSingleNodeReplacing) {
32
+ return state.tr.replaceSelection(slice);
33
+ }
34
+
35
+ const selectionSize = Math.abs($from.pos - $to.pos);
36
+ const { nodeSize } = $to.path.reverse().find((step) => typeof step === 'object');
37
+
38
+ if (nodeSize - selectionSize > 5) {
39
+ return state.tr.replaceSelection(slice);
40
+ }
41
+
42
+ return state.tr.replaceSelectionWith(slice.content.firstChild, input.shiftKey);
43
+ }
44
+
45
+ _isSingleNode({ openStart, openEnd, content }) {
46
+ return openStart === 1 && openEnd === 1 && content.childCount === 1;
47
+ }
48
+ }
@@ -0,0 +1,20 @@
1
+ import { Plugin, PluginKey } from 'prosemirror-state';
2
+
3
+ export class ProseMirrorPlugin {
4
+ static create(options) {
5
+ const plugin = new this(options || {});
6
+
7
+ return new Plugin({
8
+ key: new PluginKey(this.name),
9
+ props: plugin.buildProps()
10
+ });
11
+ }
12
+
13
+ constructor(options) {
14
+ this.options = options;
15
+ }
16
+
17
+ buildProps() {
18
+ return {};
19
+ }
20
+ }
@@ -0,0 +1 @@
1
+ export { PastePlugin } from './PastePlugin';
@@ -1,5 +1,3 @@
1
- import History from '@tiptap/extension-history';
2
- import { CORE_EXTENSIONS } from './core';
3
1
  import { FontFamily } from './FontFamily';
4
2
  import { StylePreset } from './StylePreset';
5
3
  import { FontWeight } from './FontWeight';
@@ -13,38 +11,47 @@ import { CaseStyle } from './CaseStyle';
13
11
  import { Alignment } from './Alignment';
14
12
  import { LineHeight } from './LineHeight';
15
13
  import { List } from './list';
14
+ import { Link } from './Link';
16
15
  import { Superscript } from './Superscript';
16
+ import { buildCoreExtensions } from './core';
17
17
 
18
- export { CORE_EXTENSIONS };
18
+ export function buildExtensions(options) {
19
+ const getPresetById = (id) => options.presetsRef.value.find((preset) => preset.id === id);
20
+ const defaultPreset = getPresetById(options.defaultPresetId);
19
21
 
20
- export const getExtensions = (options) => CORE_EXTENSIONS.concat([
21
- History,
22
- StylePreset.configure({
23
- presetsRef: options.presetsRef,
24
- defaultId: options.defaultPresetId,
25
- baseClass: options.basePresetClass,
26
- makeVariable: options.makePresetVariable
27
- }),
28
- List.configure({
29
- baseClass: options.baseListClass
30
- }),
31
- DeviceManager.configure({
32
- deviceRef: options.deviceRef
33
- }),
34
- FontFamily.configure({
35
- fonts: options.fonts
36
- }),
37
- FontWeight,
38
- FontSize.configure({
39
- minSize: options.minFontSize,
40
- maxSize: options.maxFontSize
41
- }),
42
- FontColor,
43
- BackgroundColor,
44
- FontStyle,
45
- TextDecoration,
46
- CaseStyle,
47
- Superscript,
48
- Alignment,
49
- LineHeight
50
- ]);
22
+ return buildCoreExtensions(options).concat([
23
+ StylePreset.configure({
24
+ presetsRef: options.presetsRef,
25
+ defaultId: options.defaultPresetId,
26
+ baseClass: options.basePresetClass,
27
+ makeVariable: options.makePresetVariable
28
+ }),
29
+ List.configure({
30
+ baseClass: options.baseListClass
31
+ }),
32
+ DeviceManager.configure({
33
+ deviceRef: options.deviceRef
34
+ }),
35
+ FontFamily.configure({
36
+ fonts: options.fonts,
37
+ defaultFont: defaultPreset.common.font_family
38
+ }),
39
+ FontWeight,
40
+ FontSize.configure({
41
+ minSize: options.minFontSize,
42
+ maxSize: options.maxFontSize
43
+ }),
44
+ FontColor,
45
+ BackgroundColor,
46
+ FontStyle,
47
+ TextDecoration,
48
+ CaseStyle,
49
+ Superscript,
50
+ Alignment,
51
+ LineHeight,
52
+ Link.configure({
53
+ preset: options.linkPreset,
54
+ basePresetClass: options.basePresetClass,
55
+ pageBlocks: options.pageBlocks
56
+ })]);
57
+ }
@@ -2,18 +2,16 @@ import { Editor } from '@tiptap/vue-2';
2
2
  import { ref } from '@vue/composition-api';
3
3
  import { NodeFactory } from '../../../__tests__/utils';
4
4
  import { ListTypes } from '../../../enums';
5
- import { CORE_EXTENSIONS } from '../../core';
6
5
  import { StylePreset } from '../../StylePreset';
7
6
  import { List } from '../List';
8
7
  import { ContentNormalizer } from '../../../services';
8
+ import { buildCoreExtensions } from '../../core';
9
9
 
10
10
  function createEditor({ content }) {
11
- const normalizer = new ContentNormalizer();
12
-
13
11
  return new Editor({
14
- content: normalizer.normalize(content),
12
+ content: ContentNormalizer.normalize(content),
15
13
  element: document.createElement('div'),
16
- extensions: CORE_EXTENSIONS.concat(
14
+ extensions: buildCoreExtensions().concat(
17
15
  List.configure({
18
16
  baseClass: 'zw-list--'
19
17
  }),
@@ -92,7 +92,9 @@ Object {
92
92
  "content": Array [
93
93
  Object {
94
94
  "attrs": Object {
95
- "preset": null,
95
+ "preset": Object {
96
+ "id": "regular-1",
97
+ },
96
98
  },
97
99
  "content": Array [
98
100
  Object {
@@ -104,7 +106,9 @@ Object {
104
106
  },
105
107
  Object {
106
108
  "attrs": Object {
107
- "preset": null,
109
+ "preset": Object {
110
+ "id": "regular-1",
111
+ },
108
112
  },
109
113
  "content": Array [
110
114
  Object {
@@ -221,7 +225,9 @@ Object {
221
225
  "content": Array [
222
226
  Object {
223
227
  "attrs": Object {
224
- "preset": null,
228
+ "preset": Object {
229
+ "id": "regular-1",
230
+ },
225
231
  },
226
232
  "content": Array [
227
233
  Object {
@@ -256,7 +262,9 @@ Object {
256
262
  "content": Array [
257
263
  Object {
258
264
  "attrs": Object {
259
- "preset": null,
265
+ "preset": Object {
266
+ "id": "regular-1",
267
+ },
260
268
  },
261
269
  "content": Array [
262
270
  Object {
@@ -291,7 +299,9 @@ Object {
291
299
  "content": Array [
292
300
  Object {
293
301
  "attrs": Object {
294
- "preset": null,
302
+ "preset": Object {
303
+ "id": "regular-1",
304
+ },
295
305
  },
296
306
  "content": Array [
297
307
  Object {
@@ -326,7 +336,9 @@ Object {
326
336
  "content": Array [
327
337
  Object {
328
338
  "attrs": Object {
329
- "preset": null,
339
+ "preset": Object {
340
+ "id": "regular-1",
341
+ },
330
342
  },
331
343
  "content": Array [
332
344
  Object {
@@ -361,7 +373,9 @@ Object {
361
373
  "content": Array [
362
374
  Object {
363
375
  "attrs": Object {
364
- "preset": null,
376
+ "preset": Object {
377
+ "id": "regular-1",
378
+ },
365
379
  },
366
380
  "content": Array [
367
381
  Object {
@@ -396,7 +410,9 @@ Object {
396
410
  "content": Array [
397
411
  Object {
398
412
  "attrs": Object {
399
- "preset": null,
413
+ "preset": Object {
414
+ "id": "regular-1",
415
+ },
400
416
  },
401
417
  "content": Array [
402
418
  Object {
@@ -431,7 +447,9 @@ Object {
431
447
  "content": Array [
432
448
  Object {
433
449
  "attrs": Object {
434
- "preset": null,
450
+ "preset": Object {
451
+ "id": "regular-1",
452
+ },
435
453
  },
436
454
  "content": Array [
437
455
  Object {
@@ -466,7 +484,9 @@ Object {
466
484
  "content": Array [
467
485
  Object {
468
486
  "attrs": Object {
469
- "preset": null,
487
+ "preset": Object {
488
+ "id": "regular-1",
489
+ },
470
490
  },
471
491
  "content": Array [
472
492
  Object {
@@ -501,7 +521,9 @@ Object {
501
521
  "content": Array [
502
522
  Object {
503
523
  "attrs": Object {
504
- "preset": null,
524
+ "preset": Object {
525
+ "id": "regular-1",
526
+ },
505
527
  },
506
528
  "content": Array [
507
529
  Object {
@@ -536,7 +558,9 @@ Object {
536
558
  "content": Array [
537
559
  Object {
538
560
  "attrs": Object {
539
- "preset": null,
561
+ "preset": Object {
562
+ "id": "regular-1",
563
+ },
540
564
  },
541
565
  "content": Array [
542
566
  Object {
@@ -571,7 +595,9 @@ Object {
571
595
  "content": Array [
572
596
  Object {
573
597
  "attrs": Object {
574
- "preset": null,
598
+ "preset": Object {
599
+ "id": "regular-1",
600
+ },
575
601
  },
576
602
  "content": Array [
577
603
  Object {
@@ -606,7 +632,9 @@ Object {
606
632
  "content": Array [
607
633
  Object {
608
634
  "attrs": Object {
609
- "preset": null,
635
+ "preset": Object {
636
+ "id": "regular-1",
637
+ },
610
638
  },
611
639
  "content": Array [
612
640
  Object {
@@ -641,7 +669,9 @@ Object {
641
669
  "content": Array [
642
670
  Object {
643
671
  "attrs": Object {
644
- "preset": null,
672
+ "preset": Object {
673
+ "id": "regular-1",
674
+ },
645
675
  },
646
676
  "content": Array [
647
677
  Object {
@@ -3,5 +3,6 @@ export const InjectionTokens = Object.freeze({
3
3
  FONT_SIZES: Symbol('fontSizes'),
4
4
  EDITOR: Symbol('editor'),
5
5
  LOCAL_STORAGE: Symbol('localStorage'),
6
- FAVORITE_COLORS: Symbol('favoriteColors')
6
+ FAVORITE_COLORS: Symbol('favoriteColors'),
7
+ PAGE_BLOCKS: Symbol('pageBlocks')
7
8
  });