@zipify/wysiwyg 1.0.0-dev.4 → 1.0.0-dev.42

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 (217) hide show
  1. package/.editorconfig +1 -1
  2. package/.eslintignore +1 -0
  3. package/.eslintrc.js +2 -2
  4. package/.github/dependabot.yaml +1 -0
  5. package/.lintstagedrc +2 -2
  6. package/.release-it.json +3 -2
  7. package/.stylelintignore +1 -0
  8. package/.stylelintrc +0 -4
  9. package/README.md +5 -3
  10. package/config/jest/setupTests.js +7 -4
  11. package/config/vite/lib.config.js +31 -0
  12. package/config/vite/settings.js +9 -0
  13. package/config/webpack/example.config.js +2 -0
  14. package/config/webpack/lib.config.js +43 -0
  15. package/config/webpack/loaders/style-loader.js +3 -1
  16. package/config/webpack/loaders/svg-loader.js +1 -1
  17. package/dist/wysiwyg.css +1 -0
  18. package/dist/wysiwyg.mjs +18198 -0
  19. package/example/ExampleApp.vue +52 -33
  20. package/example/example.js +25 -2
  21. package/example/pageBlocks.js +31 -0
  22. package/example/presets.js +4 -2
  23. package/lib/Wysiwyg.vue +42 -22
  24. package/lib/__tests__/utils/withComponentContext.js +1 -1
  25. package/lib/assets/icons/alignment-center.svg +3 -0
  26. package/lib/assets/icons/alignment-justify.svg +3 -0
  27. package/lib/assets/icons/alignment-left.svg +3 -0
  28. package/lib/assets/icons/alignment-right.svg +3 -0
  29. package/lib/assets/icons/arrow.svg +3 -0
  30. package/lib/assets/icons/background-color.svg +3 -0
  31. package/lib/assets/icons/case-style.svg +3 -0
  32. package/lib/assets/icons/font-color.svg +5 -0
  33. package/lib/assets/icons/italic.svg +3 -0
  34. package/lib/assets/icons/line-height.svg +3 -0
  35. package/lib/assets/icons/link.svg +3 -0
  36. package/lib/assets/icons/list-circle.svg +3 -0
  37. package/lib/assets/icons/list-decimal.svg +3 -0
  38. package/lib/assets/icons/list-disc.svg +3 -0
  39. package/lib/assets/icons/list-latin.svg +3 -0
  40. package/lib/assets/icons/list-roman.svg +3 -0
  41. package/lib/assets/icons/list-square.svg +3 -0
  42. package/lib/assets/icons/remove-format.svg +3 -0
  43. package/lib/assets/icons/reset-styles.svg +3 -0
  44. package/lib/assets/icons/strike-through.svg +3 -0
  45. package/lib/assets/icons/superscript.svg +3 -0
  46. package/lib/assets/icons/underline.svg +3 -0
  47. package/lib/assets/icons/unlink.svg +3 -0
  48. package/lib/components/base/Button.vue +22 -2
  49. package/lib/components/base/Checkbox.vue +89 -0
  50. package/lib/components/base/FieldLabel.vue +2 -1
  51. package/lib/components/base/Icon.vue +19 -11
  52. package/lib/components/base/Modal.vue +1 -2
  53. package/lib/components/base/NumberField.vue +2 -2
  54. package/lib/components/base/Range.vue +1 -1
  55. package/lib/components/base/ScrollView.vue +2 -2
  56. package/lib/components/base/TextField.vue +106 -0
  57. package/lib/components/base/__tests__/Icon.test.js +6 -13
  58. package/lib/components/base/__tests__/Modal.test.js +8 -2
  59. package/lib/components/base/__tests__/TextField.test.js +57 -0
  60. package/lib/components/base/__tests__/__snapshots__/TextField.test.js.snap +9 -0
  61. package/lib/components/base/colorPicker/ColorPicker.vue +1 -1
  62. package/lib/components/base/colorPicker/composables/__tests__/usePickerApi.test.js +1 -1
  63. package/lib/components/base/colorPicker/composables/usePickerApi.js +1 -1
  64. package/lib/components/base/colorPicker/composables/usePickerHotkeys.js +3 -2
  65. package/lib/components/base/composables/__tests__/useActivatedListener.test.js +1 -1
  66. package/lib/components/base/composables/__tests__/useDeselectionLock.test.js +1 -1
  67. package/lib/components/base/composables/__tests__/useElementRef.test.js +1 -1
  68. package/lib/components/base/composables/__tests__/useModalToggler.test.js +1 -1
  69. package/lib/components/base/composables/__tests__/useNumberValue.test.js +1 -1
  70. package/lib/components/base/composables/__tests__/useScrollView.test.js +1 -1
  71. package/lib/components/base/composables/__tests__/useTempValue.test.js +1 -1
  72. package/lib/components/base/composables/index.js +1 -0
  73. package/lib/components/base/composables/useActivatedListener.js +1 -1
  74. package/lib/components/base/composables/useDeselectionLock.js +1 -1
  75. package/lib/components/base/composables/useElementRef.js +1 -1
  76. package/lib/components/base/composables/useModalToggler.js +1 -1
  77. package/lib/components/base/composables/useScrollView.js +1 -1
  78. package/lib/components/base/composables/useTempValue.js +1 -1
  79. package/lib/components/base/composables/useValidator.js +19 -0
  80. package/lib/components/base/dropdown/Dropdown.vue +16 -4
  81. package/lib/components/base/dropdown/DropdownActivator.vue +19 -3
  82. package/lib/components/base/dropdown/DropdownGroup.vue +1 -1
  83. package/lib/components/base/dropdown/DropdownMenu.vue +1 -1
  84. package/lib/components/base/dropdown/DropdownOption.vue +1 -1
  85. package/lib/components/base/dropdown/__tests__/DropdownActivator.test.js +1 -1
  86. package/lib/components/base/dropdown/__tests__/DropdownMenu.test.js +1 -1
  87. package/lib/components/base/dropdown/__tests__/DropdownOption.test.js +1 -1
  88. package/lib/components/base/dropdown/composables/__tests__/useActiveOptionManager.test.js +1 -1
  89. package/lib/components/base/dropdown/composables/__tests__/useDropdownEntityTitle.test.js +1 -1
  90. package/lib/components/base/dropdown/composables/useActiveOptionManager.js +1 -1
  91. package/lib/components/base/dropdown/composables/useDropdownEntityTitle.js +1 -1
  92. package/lib/components/base/index.js +3 -1
  93. package/lib/components/toolbar/Toolbar.vue +49 -9
  94. package/lib/components/toolbar/ToolbarDivider.vue +1 -1
  95. package/lib/components/toolbar/ToolbarFull.vue +10 -2
  96. package/lib/components/toolbar/__tests__/Toolbar.test.js +8 -1
  97. package/lib/components/toolbar/controls/AlignmentControl.vue +1 -1
  98. package/lib/components/toolbar/controls/AlignmentDeviceControl.vue +1 -1
  99. package/lib/components/toolbar/controls/BackgroundColorControl.vue +1 -1
  100. package/lib/components/toolbar/controls/CaseStyleControl.vue +1 -1
  101. package/lib/components/toolbar/controls/FontColorControl.vue +1 -1
  102. package/lib/components/toolbar/controls/FontFamilyControl.vue +1 -1
  103. package/lib/components/toolbar/controls/FontSizeControl.vue +8 -1
  104. package/lib/components/toolbar/controls/FontWeightControl.vue +1 -1
  105. package/lib/components/toolbar/controls/ItalicControl.vue +1 -1
  106. package/lib/components/toolbar/controls/LineHeightControl.vue +1 -1
  107. package/lib/components/toolbar/controls/ListControl.vue +2 -6
  108. package/lib/components/toolbar/controls/RemoveFormatControl.vue +1 -1
  109. package/lib/components/toolbar/controls/StrikeThroughControl.vue +1 -1
  110. package/lib/components/toolbar/controls/StylePresetControl.vue +1 -1
  111. package/lib/components/toolbar/controls/SuperscriptControl.vue +1 -1
  112. package/lib/components/toolbar/controls/UnderlineControl.vue +2 -2
  113. package/lib/components/toolbar/controls/__tests__/AlignmentControl.test.js +1 -1
  114. package/lib/components/toolbar/controls/__tests__/AlignmentDeviceControl.test.js +1 -1
  115. package/lib/components/toolbar/controls/__tests__/BackgroundColorControl.test.js +1 -1
  116. package/lib/components/toolbar/controls/__tests__/CaseStyleControl.test.js +1 -1
  117. package/lib/components/toolbar/controls/__tests__/FontColorControl.test.js +1 -1
  118. package/lib/components/toolbar/controls/__tests__/FontFamilyControl.test.js +1 -1
  119. package/lib/components/toolbar/controls/__tests__/FontSizeControl.test.js +1 -1
  120. package/lib/components/toolbar/controls/__tests__/FontWeightControl.test.js +1 -1
  121. package/lib/components/toolbar/controls/__tests__/ItalicControl.test.js +1 -1
  122. package/lib/components/toolbar/controls/__tests__/LineHeightControl.test.js +1 -1
  123. package/lib/components/toolbar/controls/__tests__/ListControl.test.js +1 -1
  124. package/lib/components/toolbar/controls/__tests__/StrikeThroughControl.test.js +1 -1
  125. package/lib/components/toolbar/controls/__tests__/StylePresetControl.test.js +1 -1
  126. package/lib/components/toolbar/controls/__tests__/UnderlineControl.test.js +5 -1
  127. package/lib/components/toolbar/controls/composables/useRecentFonts.js +1 -1
  128. package/lib/components/toolbar/controls/index.js +1 -0
  129. package/lib/components/toolbar/controls/link/LinkControl.vue +152 -0
  130. package/lib/components/toolbar/controls/link/LinkControlApply.vue +35 -0
  131. package/lib/components/toolbar/controls/link/LinkControlHeader.vue +67 -0
  132. package/lib/components/toolbar/controls/link/composables/index.js +1 -0
  133. package/lib/components/toolbar/controls/link/composables/useLink.js +61 -0
  134. package/lib/components/toolbar/controls/link/destination/LinkControlDestination.vue +103 -0
  135. package/lib/components/toolbar/controls/link/destination/LinkControlPageBlock.vue +54 -0
  136. package/lib/components/toolbar/controls/link/destination/LinkControlUrl.vue +52 -0
  137. package/lib/components/toolbar/controls/link/destination/index.js +1 -0
  138. package/lib/components/toolbar/controls/link/index.js +1 -0
  139. package/lib/composables/__tests__/useEditor.test.js +15 -6
  140. package/lib/composables/useEditor.js +13 -8
  141. package/lib/composables/useToolbar.js +14 -29
  142. package/lib/directives/outClick.js +20 -4
  143. package/lib/enums/LinkDestinations.js +4 -0
  144. package/lib/enums/LinkTargets.js +4 -0
  145. package/lib/enums/TextSettings.js +3 -1
  146. package/lib/enums/index.js +2 -0
  147. package/lib/extensions/Alignment.js +22 -4
  148. package/lib/extensions/BackgroundColor.js +17 -2
  149. package/lib/extensions/DeviceManager.js +2 -5
  150. package/lib/extensions/FontColor.js +17 -2
  151. package/lib/extensions/FontFamily.js +27 -3
  152. package/lib/extensions/FontSize.js +29 -4
  153. package/lib/extensions/FontStyle.js +24 -3
  154. package/lib/extensions/FontWeight.js +34 -2
  155. package/lib/extensions/LineHeight.js +30 -4
  156. package/lib/extensions/Link.js +101 -0
  157. package/lib/extensions/StylePreset.js +38 -15
  158. package/lib/extensions/TextDecoration.js +30 -4
  159. package/lib/extensions/__tests__/Alignment.test.js +32 -5
  160. package/lib/extensions/__tests__/BackgroundColor.test.js +39 -4
  161. package/lib/extensions/__tests__/CaseStyle.test.js +4 -3
  162. package/lib/extensions/__tests__/FontColor.test.js +39 -4
  163. package/lib/extensions/__tests__/FontFamily.test.js +60 -6
  164. package/lib/extensions/__tests__/FontSize.test.js +40 -5
  165. package/lib/extensions/__tests__/FontStyle.test.js +47 -4
  166. package/lib/extensions/__tests__/FontWeight.test.js +67 -4
  167. package/lib/extensions/__tests__/LineHeight.test.js +51 -5
  168. package/lib/extensions/__tests__/StylePreset.test.js +144 -6
  169. package/lib/extensions/__tests__/TextDecoration.test.js +88 -4
  170. package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +70 -2
  171. package/lib/extensions/__tests__/__snapshots__/BackgroundColor.test.js.snap +121 -1
  172. package/lib/extensions/__tests__/__snapshots__/FontColor.test.js.snap +109 -1
  173. package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +179 -1
  174. package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +132 -2
  175. package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +142 -1
  176. package/lib/extensions/__tests__/__snapshots__/FontWeight.test.js.snap +179 -1
  177. package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +118 -2
  178. package/lib/extensions/__tests__/__snapshots__/StylePreset.test.js.snap +171 -2
  179. package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +300 -3
  180. package/lib/extensions/core/CopyPasteProcessor.js +10 -0
  181. package/lib/extensions/core/NodeProcessor.js +1 -1
  182. package/lib/extensions/core/TextProcessor.js +10 -0
  183. package/lib/extensions/core/__tests__/NodeProcessor.test.js +4 -3
  184. package/lib/extensions/core/__tests__/SelectionProcessor.test.js +9 -6
  185. package/lib/extensions/core/__tests__/TextProcessor.test.js +139 -10
  186. package/lib/extensions/core/__tests__/__snapshots__/TextProcessor.test.js.snap +26 -0
  187. package/lib/extensions/core/index.js +11 -2
  188. package/lib/extensions/core/plugins/PastePlugin.js +48 -0
  189. package/lib/extensions/core/plugins/ProseMirrorPlugin.js +20 -0
  190. package/lib/extensions/core/plugins/index.js +1 -0
  191. package/lib/extensions/index.js +41 -33
  192. package/lib/extensions/list/List.js +35 -1
  193. package/lib/extensions/list/__tests__/List.test.js +117 -8
  194. package/lib/extensions/list/__tests__/__snapshots__/List.test.js.snap +481 -0
  195. package/lib/injectionTokens.js +2 -1
  196. package/lib/services/ContentNormalizer.js +157 -0
  197. package/lib/services/ContextWidnow.js +23 -0
  198. package/lib/services/Storage.js +1 -13
  199. package/lib/services/__tests__/ContentNormalizer.test.js +74 -0
  200. package/lib/services/__tests__/FavoriteColors.test.js +20 -0
  201. package/lib/services/__tests__/JsonSerializer.test.js +23 -0
  202. package/lib/services/__tests__/Storage.test.js +79 -0
  203. package/lib/services/index.js +2 -0
  204. package/lib/styles/content.css +96 -9
  205. package/lib/styles/helpers/offsets.css +16 -0
  206. package/lib/styles/variables.css +6 -0
  207. package/lib/utils/__tests__/__snapshots__/renderInlineSetting.test.js.snap +4 -4
  208. package/lib/utils/__tests__/convertColor.test.js +19 -0
  209. package/lib/utils/__tests__/createKeyboardShortcut.test.js +25 -0
  210. package/lib/utils/__tests__/renderInlineSetting.test.js +26 -0
  211. package/lib/utils/convertColor.js +7 -0
  212. package/lib/utils/importIcon.js +13 -0
  213. package/lib/utils/index.js +2 -0
  214. package/lib/utils/renderInlineSetting.js +2 -2
  215. package/package.json +21 -16
  216. package/lib/assets/icons.svg +0 -69
  217. package/lib/composables/__tests__/useToolbar.test.js +0 -56
@@ -25,4 +25,112 @@ Object {
25
25
  }
26
26
  `;
27
27
 
28
- exports[`rendering should render html 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-color: green;\\" class=\\"zw-style\\">hello world</span></p>"`;
28
+ exports[`parsing html should get value from paragraph 1`] = `
29
+ Object {
30
+ "content": Array [
31
+ Object {
32
+ "content": Array [
33
+ Object {
34
+ "marks": Array [
35
+ Object {
36
+ "attrs": Object {
37
+ "value": "#FF0000",
38
+ },
39
+ "type": "font_color",
40
+ },
41
+ ],
42
+ "text": "test",
43
+ "type": "text",
44
+ },
45
+ ],
46
+ "type": "paragraph",
47
+ },
48
+ ],
49
+ "type": "doc",
50
+ }
51
+ `;
52
+
53
+ exports[`parsing html should get value from parsed view 1`] = `
54
+ Object {
55
+ "content": Array [
56
+ Object {
57
+ "content": Array [
58
+ Object {
59
+ "text": "lorem ipsum",
60
+ "type": "text",
61
+ },
62
+ ],
63
+ "type": "paragraph",
64
+ },
65
+ ],
66
+ "type": "doc",
67
+ }
68
+ `;
69
+
70
+ exports[`parsing html should get value from text 1`] = `
71
+ Object {
72
+ "content": Array [
73
+ Object {
74
+ "content": Array [
75
+ Object {
76
+ "marks": Array [
77
+ Object {
78
+ "attrs": Object {
79
+ "value": "#FF0000",
80
+ },
81
+ "type": "font_color",
82
+ },
83
+ ],
84
+ "text": "lorem",
85
+ "type": "text",
86
+ },
87
+ Object {
88
+ "text": " ipsum",
89
+ "type": "text",
90
+ },
91
+ ],
92
+ "type": "paragraph",
93
+ },
94
+ ],
95
+ "type": "doc",
96
+ }
97
+ `;
98
+
99
+ exports[`parsing html should merge paragraph and text settings 1`] = `
100
+ Object {
101
+ "content": Array [
102
+ Object {
103
+ "content": Array [
104
+ Object {
105
+ "marks": Array [
106
+ Object {
107
+ "attrs": Object {
108
+ "value": "#000000",
109
+ },
110
+ "type": "font_color",
111
+ },
112
+ ],
113
+ "text": "lorem",
114
+ "type": "text",
115
+ },
116
+ Object {
117
+ "marks": Array [
118
+ Object {
119
+ "attrs": Object {
120
+ "value": "#FF0000",
121
+ },
122
+ "type": "font_color",
123
+ },
124
+ ],
125
+ "text": " ipsum",
126
+ "type": "text",
127
+ },
128
+ ],
129
+ "type": "paragraph",
130
+ },
131
+ ],
132
+ "type": "doc",
133
+ }
134
+ `;
135
+
136
+ exports[`rendering should render html 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-color:green;\\" class=\\"zw-style\\">hello world</span></p>"`;
@@ -155,4 +155,182 @@ Object {
155
155
  }
156
156
  `;
157
157
 
158
- exports[`rendering should render html 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-family: Bungee;\\" class=\\"zw-style\\">hello world</span></p>"`;
158
+ exports[`parsing html should get parse font name with quotes 1`] = `
159
+ Object {
160
+ "content": Array [
161
+ Object {
162
+ "content": Array [
163
+ Object {
164
+ "text": "hello ",
165
+ "type": "text",
166
+ },
167
+ Object {
168
+ "marks": Array [
169
+ Object {
170
+ "attrs": Object {
171
+ "value": "Josefin Slab",
172
+ },
173
+ "type": "font_family",
174
+ },
175
+ ],
176
+ "text": "world",
177
+ "type": "text",
178
+ },
179
+ ],
180
+ "type": "paragraph",
181
+ },
182
+ ],
183
+ "type": "doc",
184
+ }
185
+ `;
186
+
187
+ exports[`parsing html should get set default if undefined font 1`] = `
188
+ Object {
189
+ "content": Array [
190
+ Object {
191
+ "content": Array [
192
+ Object {
193
+ "marks": Array [
194
+ Object {
195
+ "attrs": Object {
196
+ "value": "Lato",
197
+ },
198
+ "type": "font_family",
199
+ },
200
+ ],
201
+ "text": "lorem",
202
+ "type": "text",
203
+ },
204
+ Object {
205
+ "text": " ipsum",
206
+ "type": "text",
207
+ },
208
+ ],
209
+ "type": "paragraph",
210
+ },
211
+ ],
212
+ "type": "doc",
213
+ }
214
+ `;
215
+
216
+ exports[`parsing html should get value from paragraph 1`] = `
217
+ Object {
218
+ "content": Array [
219
+ Object {
220
+ "content": Array [
221
+ Object {
222
+ "marks": Array [
223
+ Object {
224
+ "attrs": Object {
225
+ "value": "Lato",
226
+ },
227
+ "type": "font_family",
228
+ },
229
+ ],
230
+ "text": "test",
231
+ "type": "text",
232
+ },
233
+ ],
234
+ "type": "paragraph",
235
+ },
236
+ ],
237
+ "type": "doc",
238
+ }
239
+ `;
240
+
241
+ exports[`parsing html should get value from rendered view 1`] = `
242
+ Object {
243
+ "content": Array [
244
+ Object {
245
+ "content": Array [
246
+ Object {
247
+ "marks": Array [
248
+ Object {
249
+ "attrs": Object {
250
+ "value": "Lato",
251
+ },
252
+ "type": "font_family",
253
+ },
254
+ ],
255
+ "text": "lorem",
256
+ "type": "text",
257
+ },
258
+ Object {
259
+ "text": " ipsum",
260
+ "type": "text",
261
+ },
262
+ ],
263
+ "type": "paragraph",
264
+ },
265
+ ],
266
+ "type": "doc",
267
+ }
268
+ `;
269
+
270
+ exports[`parsing html should get value from text 1`] = `
271
+ Object {
272
+ "content": Array [
273
+ Object {
274
+ "content": Array [
275
+ Object {
276
+ "marks": Array [
277
+ Object {
278
+ "attrs": Object {
279
+ "value": "Lato",
280
+ },
281
+ "type": "font_family",
282
+ },
283
+ ],
284
+ "text": "lorem",
285
+ "type": "text",
286
+ },
287
+ Object {
288
+ "text": " ipsum",
289
+ "type": "text",
290
+ },
291
+ ],
292
+ "type": "paragraph",
293
+ },
294
+ ],
295
+ "type": "doc",
296
+ }
297
+ `;
298
+
299
+ exports[`parsing html should merge paragraph and text settings 1`] = `
300
+ Object {
301
+ "content": Array [
302
+ Object {
303
+ "content": Array [
304
+ Object {
305
+ "marks": Array [
306
+ Object {
307
+ "attrs": Object {
308
+ "value": "Roboto",
309
+ },
310
+ "type": "font_family",
311
+ },
312
+ ],
313
+ "text": "lorem",
314
+ "type": "text",
315
+ },
316
+ Object {
317
+ "marks": Array [
318
+ Object {
319
+ "attrs": Object {
320
+ "value": "Lato",
321
+ },
322
+ "type": "font_family",
323
+ },
324
+ ],
325
+ "text": " ipsum",
326
+ "type": "text",
327
+ },
328
+ ],
329
+ "type": "paragraph",
330
+ },
331
+ ],
332
+ "type": "doc",
333
+ }
334
+ `;
335
+
336
+ exports[`rendering should render html 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-family:&quot;Bungee&quot;;\\" class=\\"zw-style\\">hello world</span></p>"`;
@@ -135,6 +135,136 @@ Object {
135
135
  }
136
136
  `;
137
137
 
138
- exports[`rendering should render all devices 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-mobile-font-size: 12px; --zw-tablet-font-size: 14px; --zw-desktop-font-size: 16px;\\" class=\\"zw-style\\">hello world</span></p>"`;
138
+ exports[`parsing html should get value from paragraph 1`] = `
139
+ Object {
140
+ "content": Array [
141
+ Object {
142
+ "content": Array [
143
+ Object {
144
+ "marks": Array [
145
+ Object {
146
+ "attrs": Object {
147
+ "desktop": "24",
148
+ "mobile": "24",
149
+ "tablet": "24",
150
+ },
151
+ "type": "font_size",
152
+ },
153
+ ],
154
+ "text": "test",
155
+ "type": "text",
156
+ },
157
+ ],
158
+ "type": "paragraph",
159
+ },
160
+ ],
161
+ "type": "doc",
162
+ }
163
+ `;
164
+
165
+ exports[`parsing html should get value from rendered view 1`] = `
166
+ Object {
167
+ "content": Array [
168
+ Object {
169
+ "content": Array [
170
+ Object {
171
+ "marks": Array [
172
+ Object {
173
+ "attrs": Object {
174
+ "desktop": "30",
175
+ "mobile": "24",
176
+ "tablet": null,
177
+ },
178
+ "type": "font_size",
179
+ },
180
+ ],
181
+ "text": "lorem",
182
+ "type": "text",
183
+ },
184
+ Object {
185
+ "text": " ipsum",
186
+ "type": "text",
187
+ },
188
+ ],
189
+ "type": "paragraph",
190
+ },
191
+ ],
192
+ "type": "doc",
193
+ }
194
+ `;
195
+
196
+ exports[`parsing html should get value from text 1`] = `
197
+ Object {
198
+ "content": Array [
199
+ Object {
200
+ "content": Array [
201
+ Object {
202
+ "marks": Array [
203
+ Object {
204
+ "attrs": Object {
205
+ "desktop": "24",
206
+ "mobile": "24",
207
+ "tablet": "24",
208
+ },
209
+ "type": "font_size",
210
+ },
211
+ ],
212
+ "text": "lorem",
213
+ "type": "text",
214
+ },
215
+ Object {
216
+ "text": " ipsum",
217
+ "type": "text",
218
+ },
219
+ ],
220
+ "type": "paragraph",
221
+ },
222
+ ],
223
+ "type": "doc",
224
+ }
225
+ `;
226
+
227
+ exports[`parsing html should merge paragraph and text settings 1`] = `
228
+ Object {
229
+ "content": Array [
230
+ Object {
231
+ "content": Array [
232
+ Object {
233
+ "marks": Array [
234
+ Object {
235
+ "attrs": Object {
236
+ "desktop": "20",
237
+ "mobile": "20",
238
+ "tablet": "20",
239
+ },
240
+ "type": "font_size",
241
+ },
242
+ ],
243
+ "text": "lorem",
244
+ "type": "text",
245
+ },
246
+ Object {
247
+ "marks": Array [
248
+ Object {
249
+ "attrs": Object {
250
+ "desktop": "24",
251
+ "mobile": "24",
252
+ "tablet": "24",
253
+ },
254
+ "type": "font_size",
255
+ },
256
+ ],
257
+ "text": " ipsum",
258
+ "type": "text",
259
+ },
260
+ ],
261
+ "type": "paragraph",
262
+ },
263
+ ],
264
+ "type": "doc",
265
+ }
266
+ `;
267
+
268
+ exports[`rendering should render all devices 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-size-mobile:12px;--zw-font-size-tablet:14px;--zw-font-size-desktop:16px;\\" class=\\"zw-style\\">hello world</span></p>"`;
139
269
 
140
- exports[`rendering should render only desktop 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-desktop-font-size: 14px;\\" class=\\"zw-style\\">hello world</span></p>"`;
270
+ exports[`rendering should render only desktop 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-size-desktop:14px;\\" class=\\"zw-style\\">hello world</span></p>"`;
@@ -84,4 +84,145 @@ Object {
84
84
  }
85
85
  `;
86
86
 
87
- exports[`rendering should render html 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-style: italic;\\" class=\\"zw-style\\">hello world</span></p>"`;
87
+ exports[`parsing html should get value from i tag 1`] = `
88
+ Object {
89
+ "content": Array [
90
+ Object {
91
+ "content": Array [
92
+ Object {
93
+ "marks": Array [
94
+ Object {
95
+ "attrs": Object {
96
+ "italic": true,
97
+ },
98
+ "type": "font_style",
99
+ },
100
+ ],
101
+ "text": "lorem",
102
+ "type": "text",
103
+ },
104
+ Object {
105
+ "text": " ipsum",
106
+ "type": "text",
107
+ },
108
+ ],
109
+ "type": "paragraph",
110
+ },
111
+ ],
112
+ "type": "doc",
113
+ }
114
+ `;
115
+
116
+ exports[`parsing html should get value from paragraph 1`] = `
117
+ Object {
118
+ "content": Array [
119
+ Object {
120
+ "content": Array [
121
+ Object {
122
+ "marks": Array [
123
+ Object {
124
+ "attrs": Object {
125
+ "italic": true,
126
+ },
127
+ "type": "font_style",
128
+ },
129
+ ],
130
+ "text": "test",
131
+ "type": "text",
132
+ },
133
+ ],
134
+ "type": "paragraph",
135
+ },
136
+ ],
137
+ "type": "doc",
138
+ }
139
+ `;
140
+
141
+ exports[`parsing html should get value from rendered view 1`] = `
142
+ Object {
143
+ "content": Array [
144
+ Object {
145
+ "content": Array [
146
+ Object {
147
+ "marks": Array [
148
+ Object {
149
+ "attrs": Object {
150
+ "italic": true,
151
+ },
152
+ "type": "font_style",
153
+ },
154
+ ],
155
+ "text": "lorem",
156
+ "type": "text",
157
+ },
158
+ Object {
159
+ "text": " ipsum",
160
+ "type": "text",
161
+ },
162
+ ],
163
+ "type": "paragraph",
164
+ },
165
+ ],
166
+ "type": "doc",
167
+ }
168
+ `;
169
+
170
+ exports[`parsing html should get value from text 1`] = `
171
+ Object {
172
+ "content": Array [
173
+ Object {
174
+ "content": Array [
175
+ Object {
176
+ "marks": Array [
177
+ Object {
178
+ "attrs": Object {
179
+ "italic": true,
180
+ },
181
+ "type": "font_style",
182
+ },
183
+ ],
184
+ "text": "lorem",
185
+ "type": "text",
186
+ },
187
+ Object {
188
+ "text": " ipsum",
189
+ "type": "text",
190
+ },
191
+ ],
192
+ "type": "paragraph",
193
+ },
194
+ ],
195
+ "type": "doc",
196
+ }
197
+ `;
198
+
199
+ exports[`parsing html should merge paragraph and text settings 1`] = `
200
+ Object {
201
+ "content": Array [
202
+ Object {
203
+ "content": Array [
204
+ Object {
205
+ "text": "lorem",
206
+ "type": "text",
207
+ },
208
+ Object {
209
+ "marks": Array [
210
+ Object {
211
+ "attrs": Object {
212
+ "italic": true,
213
+ },
214
+ "type": "font_style",
215
+ },
216
+ ],
217
+ "text": " ipsum",
218
+ "type": "text",
219
+ },
220
+ ],
221
+ "type": "paragraph",
222
+ },
223
+ ],
224
+ "type": "doc",
225
+ }
226
+ `;
227
+
228
+ exports[`rendering should render html 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-style:italic;\\" class=\\"zw-style\\">hello world</span></p>"`;