@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
@@ -137,4 +137,182 @@ Object {
137
137
  }
138
138
  `;
139
139
 
140
- exports[`rendering should render html 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-weight: 700;\\" class=\\"zw-style\\">hello world</span></p>"`;
140
+ exports[`parsing html should get value from b tag 1`] = `
141
+ Object {
142
+ "content": Array [
143
+ Object {
144
+ "content": Array [
145
+ Object {
146
+ "marks": Array [
147
+ Object {
148
+ "attrs": Object {
149
+ "value": "700",
150
+ },
151
+ "type": "font_weight",
152
+ },
153
+ ],
154
+ "text": "lorem",
155
+ "type": "text",
156
+ },
157
+ Object {
158
+ "text": " ipsum",
159
+ "type": "text",
160
+ },
161
+ ],
162
+ "type": "paragraph",
163
+ },
164
+ ],
165
+ "type": "doc",
166
+ }
167
+ `;
168
+
169
+ exports[`parsing html should get value from paragraph 1`] = `
170
+ Object {
171
+ "content": Array [
172
+ Object {
173
+ "content": Array [
174
+ Object {
175
+ "marks": Array [
176
+ Object {
177
+ "attrs": Object {
178
+ "value": "700",
179
+ },
180
+ "type": "font_weight",
181
+ },
182
+ ],
183
+ "text": "test",
184
+ "type": "text",
185
+ },
186
+ ],
187
+ "type": "paragraph",
188
+ },
189
+ ],
190
+ "type": "doc",
191
+ }
192
+ `;
193
+
194
+ exports[`parsing html should get value from rendered view 1`] = `
195
+ Object {
196
+ "content": Array [
197
+ Object {
198
+ "content": Array [
199
+ Object {
200
+ "marks": Array [
201
+ Object {
202
+ "attrs": Object {
203
+ "value": "700",
204
+ },
205
+ "type": "font_weight",
206
+ },
207
+ ],
208
+ "text": "lorem",
209
+ "type": "text",
210
+ },
211
+ Object {
212
+ "text": " ipsum",
213
+ "type": "text",
214
+ },
215
+ ],
216
+ "type": "paragraph",
217
+ },
218
+ ],
219
+ "type": "doc",
220
+ }
221
+ `;
222
+
223
+ exports[`parsing html should get value from strong tag 1`] = `
224
+ Object {
225
+ "content": Array [
226
+ Object {
227
+ "content": Array [
228
+ Object {
229
+ "marks": Array [
230
+ Object {
231
+ "attrs": Object {
232
+ "value": "700",
233
+ },
234
+ "type": "font_weight",
235
+ },
236
+ ],
237
+ "text": "lorem",
238
+ "type": "text",
239
+ },
240
+ Object {
241
+ "text": " ipsum",
242
+ "type": "text",
243
+ },
244
+ ],
245
+ "type": "paragraph",
246
+ },
247
+ ],
248
+ "type": "doc",
249
+ }
250
+ `;
251
+
252
+ exports[`parsing html should get value from text 1`] = `
253
+ Object {
254
+ "content": Array [
255
+ Object {
256
+ "content": Array [
257
+ Object {
258
+ "marks": Array [
259
+ Object {
260
+ "attrs": Object {
261
+ "value": "700",
262
+ },
263
+ "type": "font_weight",
264
+ },
265
+ ],
266
+ "text": "lorem",
267
+ "type": "text",
268
+ },
269
+ Object {
270
+ "text": " ipsum",
271
+ "type": "text",
272
+ },
273
+ ],
274
+ "type": "paragraph",
275
+ },
276
+ ],
277
+ "type": "doc",
278
+ }
279
+ `;
280
+
281
+ exports[`parsing html should merge paragraph and text settings 1`] = `
282
+ Object {
283
+ "content": Array [
284
+ Object {
285
+ "content": Array [
286
+ Object {
287
+ "marks": Array [
288
+ Object {
289
+ "attrs": Object {
290
+ "value": "700",
291
+ },
292
+ "type": "font_weight",
293
+ },
294
+ ],
295
+ "text": "lorem",
296
+ "type": "text",
297
+ },
298
+ Object {
299
+ "marks": Array [
300
+ Object {
301
+ "attrs": Object {
302
+ "value": "500",
303
+ },
304
+ "type": "font_weight",
305
+ },
306
+ ],
307
+ "text": " ipsum",
308
+ "type": "text",
309
+ },
310
+ ],
311
+ "type": "paragraph",
312
+ },
313
+ ],
314
+ "type": "doc",
315
+ }
316
+ `;
317
+
318
+ exports[`rendering should render html 1`] = `"<p class=\\"zw-style\\"><span style=\\"--zw-font-weight:700;\\" class=\\"zw-style\\">hello world</span></p>"`;
@@ -24,6 +24,122 @@ Object {
24
24
  }
25
25
  `;
26
26
 
27
- exports[`rendering should render all devices 1`] = `"<p class=\\"zw-style\\" style=\\"--zw-mobile-line-height: 1.21; --zw-tablet-line-height: 1.4; --zw-desktop-line-height: 1.6;\\">hello world</p>"`;
27
+ exports[`parsing html should get value from rendered view 1`] = `
28
+ Object {
29
+ "content": Array [
30
+ Object {
31
+ "attrs": Object {
32
+ "line_height": Object {
33
+ "desktop": "1.4",
34
+ "mobile": "1.2",
35
+ "tablet": null,
36
+ },
37
+ },
38
+ "content": Array [
39
+ Object {
40
+ "text": "test",
41
+ "type": "text",
42
+ },
43
+ ],
44
+ "type": "paragraph",
45
+ },
46
+ ],
47
+ "type": "doc",
48
+ }
49
+ `;
50
+
51
+ exports[`parsing html should get value from text in px units with font size 1`] = `
52
+ Object {
53
+ "content": Array [
54
+ Object {
55
+ "attrs": Object {
56
+ "line_height": Object {
57
+ "desktop": "1.20",
58
+ "mobile": "1.20",
59
+ "tablet": "1.20",
60
+ },
61
+ },
62
+ "content": Array [
63
+ Object {
64
+ "text": "test",
65
+ "type": "text",
66
+ },
67
+ ],
68
+ "type": "paragraph",
69
+ },
70
+ ],
71
+ "type": "doc",
72
+ }
73
+ `;
74
+
75
+ exports[`parsing html should get value from text in px units with no font size 1`] = `
76
+ Object {
77
+ "content": Array [
78
+ Object {
79
+ "attrs": Object {
80
+ "line_height": Object {
81
+ "desktop": "1.20",
82
+ "mobile": "1.20",
83
+ "tablet": "1.20",
84
+ },
85
+ },
86
+ "content": Array [
87
+ Object {
88
+ "text": "test",
89
+ "type": "text",
90
+ },
91
+ ],
92
+ "type": "paragraph",
93
+ },
94
+ ],
95
+ "type": "doc",
96
+ }
97
+ `;
98
+
99
+ exports[`parsing html should get value from text in relative units 1`] = `
100
+ Object {
101
+ "content": Array [
102
+ Object {
103
+ "attrs": Object {
104
+ "line_height": Object {
105
+ "desktop": "1.2",
106
+ "mobile": "1.2",
107
+ "tablet": "1.2",
108
+ },
109
+ },
110
+ "content": Array [
111
+ Object {
112
+ "text": "test",
113
+ "type": "text",
114
+ },
115
+ ],
116
+ "type": "paragraph",
117
+ },
118
+ ],
119
+ "type": "doc",
120
+ }
121
+ `;
122
+
123
+ exports[`parsing html should set null if no alignment 1`] = `
124
+ Object {
125
+ "content": Array [
126
+ Object {
127
+ "attrs": Object {
128
+ "line_height": null,
129
+ },
130
+ "content": Array [
131
+ Object {
132
+ "text": "test",
133
+ "type": "text",
134
+ },
135
+ ],
136
+ "type": "paragraph",
137
+ },
138
+ ],
139
+ "type": "doc",
140
+ }
141
+ `;
142
+
143
+ exports[`rendering should render all devices 1`] = `"<p class=\\"zw-style\\" style=\\"--zw-line-height-mobile:1.21;--zw-line-height-tablet:1.4;--zw-line-height-desktop:1.6;\\">hello world</p>"`;
28
144
 
29
- exports[`rendering should render only desktop 1`] = `"<p class=\\"zw-style\\" style=\\"--zw-desktop-line-height: 1.3;\\">hello world</p>"`;
145
+ exports[`rendering should render only desktop 1`] = `"<p class=\\"zw-style\\" style=\\"--zw-line-height-desktop:1.3;\\">hello world</p>"`;
@@ -241,6 +241,175 @@ Object {
241
241
  }
242
242
  `;
243
243
 
244
+ exports[`parsing html should get by fallback class 1`] = `
245
+ Object {
246
+ "content": Array [
247
+ Object {
248
+ "attrs": Object {
249
+ "alignment": null,
250
+ "preset": Object {
251
+ "id": "regular-2",
252
+ },
253
+ },
254
+ "content": Array [
255
+ Object {
256
+ "text": "lorem ipsum",
257
+ "type": "text",
258
+ },
259
+ ],
260
+ "type": "paragraph",
261
+ },
262
+ ],
263
+ "type": "doc",
264
+ }
265
+ `;
266
+
267
+ exports[`parsing html should get by heading tag 1`] = `
268
+ Object {
269
+ "content": Array [
270
+ Object {
271
+ "attrs": Object {
272
+ "alignment": null,
273
+ "level": 3,
274
+ "preset": Object {
275
+ "id": "h3",
276
+ },
277
+ },
278
+ "content": Array [
279
+ Object {
280
+ "text": "lorem ipsum",
281
+ "type": "text",
282
+ },
283
+ ],
284
+ "type": "heading",
285
+ },
286
+ ],
287
+ "type": "doc",
288
+ }
289
+ `;
290
+
291
+ exports[`parsing html should get by preset class 1`] = `
292
+ Object {
293
+ "content": Array [
294
+ Object {
295
+ "attrs": Object {
296
+ "alignment": null,
297
+ "preset": Object {
298
+ "id": "regular-2",
299
+ },
300
+ },
301
+ "content": Array [
302
+ Object {
303
+ "text": "lorem ipsum",
304
+ "type": "text",
305
+ },
306
+ ],
307
+ "type": "paragraph",
308
+ },
309
+ ],
310
+ "type": "doc",
311
+ }
312
+ `;
313
+
314
+ exports[`parsing html should set default preset to unstyled paragraph 1`] = `
315
+ Object {
316
+ "content": Array [
317
+ Object {
318
+ "attrs": Object {
319
+ "alignment": null,
320
+ "preset": Object {
321
+ "id": "regular-1",
322
+ },
323
+ },
324
+ "content": Array [
325
+ Object {
326
+ "text": "lorem ipsum",
327
+ "type": "text",
328
+ },
329
+ ],
330
+ "type": "paragraph",
331
+ },
332
+ ],
333
+ "type": "doc",
334
+ }
335
+ `;
336
+
337
+ exports[`parsing html should set null to list item 1`] = `
338
+ Object {
339
+ "content": Array [
340
+ Object {
341
+ "attrs": Object {
342
+ "bullet": Object {
343
+ "type": "disc",
344
+ },
345
+ },
346
+ "content": Array [
347
+ Object {
348
+ "content": Array [
349
+ Object {
350
+ "attrs": Object {
351
+ "alignment": null,
352
+ "preset": Object {
353
+ "id": "regular-1",
354
+ },
355
+ },
356
+ "content": Array [
357
+ Object {
358
+ "text": "lorem ipsum",
359
+ "type": "text",
360
+ },
361
+ ],
362
+ "type": "paragraph",
363
+ },
364
+ ],
365
+ "type": "listItem",
366
+ },
367
+ ],
368
+ "type": "list",
369
+ },
370
+ ],
371
+ "type": "doc",
372
+ }
373
+ `;
374
+
375
+ exports[`parsing html should set null to list item with preset 1`] = `
376
+ Object {
377
+ "content": Array [
378
+ Object {
379
+ "attrs": Object {
380
+ "bullet": Object {
381
+ "type": "disc",
382
+ },
383
+ },
384
+ "content": Array [
385
+ Object {
386
+ "content": Array [
387
+ Object {
388
+ "attrs": Object {
389
+ "alignment": null,
390
+ "preset": Object {
391
+ "id": "regular-1",
392
+ },
393
+ },
394
+ "content": Array [
395
+ Object {
396
+ "text": "lorem ipsum",
397
+ "type": "text",
398
+ },
399
+ ],
400
+ "type": "paragraph",
401
+ },
402
+ ],
403
+ "type": "listItem",
404
+ },
405
+ ],
406
+ "type": "list",
407
+ },
408
+ ],
409
+ "type": "doc",
410
+ }
411
+ `;
412
+
244
413
  exports[`remove preset customization should remove all attributes 1`] = `
245
414
  Object {
246
415
  "content": Array [
@@ -305,6 +474,6 @@ Object {
305
474
 
306
475
  exports[`render preset styles should render node without preset 1`] = `"<p class=\\"zw-style\\">test</p>"`;
307
476
 
308
- exports[`render preset styles should render preset class 1`] = `"<p class=\\"zw-style zw-preset--regular-1\\">test</p>"`;
477
+ exports[`render preset styles should render preset class 1`] = `"<p class=\\"zw-style zw ts-regular-1\\">test</p>"`;
309
478
 
310
- exports[`render preset styles should render styles 1`] = `" .zw-preset--regular-1 { --zw-preset-font-weight: var(--common-regular-1-font-weight, inherit); --zw-preset-mobile-font-size: var(--mobile-regular-1-font-size, inherit); --zw-preset-tablet-font-size: var(--tablet-regular-1-font-size, inherit); --zw-preset-desktop-font-size: var(--desktop-regular-1-font-size, inherit); }"`;
479
+ exports[`render preset styles should render styles 1`] = `" .zw.ts-regular-1 { --zw-preset-font-weight: var(--common-regular-1-font-weight, inherit); --zw-preset-mobile-font-size: var(--mobile-regular-1-font-size, inherit); --zw-preset-tablet-font-size: var(--tablet-regular-1-font-size, inherit); --zw-preset-desktop-font-size: var(--desktop-regular-1-font-size, inherit); }"`;