@ecomcx/ecomweb-content 0.0.0-stage → 1.14.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.
@@ -0,0 +1,219 @@
1
+ {
2
+ "name": "attr-coercion",
3
+ "note": "Thuộc tính khối lõi sai kiểu được ép (chuỗi số → số, kẹp min/max) hoặc bỏ (không hợp lệ)",
4
+ "input": {
5
+ "version": 1,
6
+ "blocks": [
7
+ {
8
+ "id": "main",
9
+ "type": "richtext",
10
+ "data": {
11
+ "type": "doc",
12
+ "content": [
13
+ {
14
+ "type": "heading",
15
+ "attrs": {
16
+ "level": "3"
17
+ },
18
+ "content": [
19
+ {
20
+ "type": "text",
21
+ "text": "a"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "type": "heading",
27
+ "attrs": {
28
+ "level": 9
29
+ },
30
+ "content": [
31
+ {
32
+ "type": "text",
33
+ "text": "b"
34
+ }
35
+ ]
36
+ },
37
+ {
38
+ "type": "paragraph",
39
+ "attrs": {
40
+ "textAlign": "middle"
41
+ },
42
+ "content": [
43
+ {
44
+ "type": "text",
45
+ "text": "c"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "type": "gallery",
51
+ "attrs": {
52
+ "columns": "10",
53
+ "images": []
54
+ }
55
+ },
56
+ {
57
+ "type": "taskList",
58
+ "content": [
59
+ {
60
+ "type": "taskItem",
61
+ "attrs": {
62
+ "checked": "true"
63
+ },
64
+ "content": [
65
+ {
66
+ "type": "paragraph",
67
+ "content": [
68
+ {
69
+ "type": "text",
70
+ "text": "d"
71
+ }
72
+ ]
73
+ }
74
+ ]
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "type": "image",
80
+ "attrs": {
81
+ "src": "/a.jpg",
82
+ "width": "640.5",
83
+ "height": "abc",
84
+ "align": "diagonal"
85
+ }
86
+ },
87
+ {
88
+ "type": "orderedList",
89
+ "attrs": {
90
+ "start": 2.6
91
+ },
92
+ "content": [
93
+ {
94
+ "type": "listItem",
95
+ "content": [
96
+ {
97
+ "type": "paragraph",
98
+ "content": [
99
+ {
100
+ "type": "text",
101
+ "text": "e"
102
+ }
103
+ ]
104
+ }
105
+ ]
106
+ }
107
+ ]
108
+ }
109
+ ]
110
+ }
111
+ }
112
+ ]
113
+ },
114
+ "expected": {
115
+ "version": 1,
116
+ "blocks": [
117
+ {
118
+ "id": "main",
119
+ "type": "richtext",
120
+ "data": {
121
+ "type": "doc",
122
+ "content": [
123
+ {
124
+ "type": "heading",
125
+ "attrs": {
126
+ "level": 3
127
+ },
128
+ "content": [
129
+ {
130
+ "type": "text",
131
+ "text": "a"
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ "type": "heading",
137
+ "attrs": {
138
+ "level": 6
139
+ },
140
+ "content": [
141
+ {
142
+ "type": "text",
143
+ "text": "b"
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ "type": "paragraph",
149
+ "content": [
150
+ {
151
+ "type": "text",
152
+ "text": "c"
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ "type": "gallery",
158
+ "attrs": {
159
+ "columns": 6,
160
+ "images": []
161
+ }
162
+ },
163
+ {
164
+ "type": "taskList",
165
+ "content": [
166
+ {
167
+ "type": "taskItem",
168
+ "attrs": {
169
+ "checked": true
170
+ },
171
+ "content": [
172
+ {
173
+ "type": "paragraph",
174
+ "content": [
175
+ {
176
+ "type": "text",
177
+ "text": "d"
178
+ }
179
+ ]
180
+ }
181
+ ]
182
+ }
183
+ ]
184
+ },
185
+ {
186
+ "type": "image",
187
+ "attrs": {
188
+ "src": "/a.jpg",
189
+ "width": 640.5
190
+ }
191
+ },
192
+ {
193
+ "type": "orderedList",
194
+ "attrs": {
195
+ "start": 3
196
+ },
197
+ "content": [
198
+ {
199
+ "type": "listItem",
200
+ "content": [
201
+ {
202
+ "type": "paragraph",
203
+ "content": [
204
+ {
205
+ "type": "text",
206
+ "text": "e"
207
+ }
208
+ ]
209
+ }
210
+ ]
211
+ }
212
+ ]
213
+ }
214
+ ]
215
+ }
216
+ }
217
+ ]
218
+ }
219
+ }
@@ -0,0 +1,414 @@
1
+ {
2
+ "name": "basic-blocks",
3
+ "note": "Bộ khối cơ bản (1.9, chân bảng 1.11): mục lục, ảnh bìa, nhiều nút, khoảng trống, ảnh + chữ, trích dẫn nổi bật, chi tiết, HTML tuỳ chỉnh, mạng xã hội, văn bản định dạng sẵn — ép kiểu (\"70\" → 70, \"false\" → false), kẹp (maxLevel ≤ 4, width ≤ 80), bỏ giá trị ngoài danh sách (contentAlign \"middle\", size \"huge\")",
4
+ "input": {
5
+ "version": 1,
6
+ "blocks": [
7
+ {
8
+ "id": "main",
9
+ "type": "richtext",
10
+ "data": {
11
+ "type": "doc",
12
+ "content": [
13
+ {
14
+ "type": "tableOfContents",
15
+ "attrs": {
16
+ "title": "Mục lục",
17
+ "maxLevel": "9"
18
+ }
19
+ },
20
+ {
21
+ "type": "cover",
22
+ "attrs": {
23
+ "src": "/uploads/hero.jpg",
24
+ "mediaId": 12,
25
+ "alt": "Ảnh bìa",
26
+ "overlay": "#000000",
27
+ "opacity": "70",
28
+ "minHeight": "60vh",
29
+ "contentAlign": "middle",
30
+ "fixed": "true"
31
+ },
32
+ "content": [
33
+ {
34
+ "type": "heading",
35
+ "attrs": {
36
+ "level": 1
37
+ },
38
+ "content": [
39
+ {
40
+ "type": "text",
41
+ "text": "Chào mừng"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "type": "buttons",
47
+ "attrs": {
48
+ "align": "center"
49
+ },
50
+ "content": [
51
+ {
52
+ "type": "button",
53
+ "attrs": {
54
+ "text": "Bắt đầu",
55
+ "href": "/bat-dau"
56
+ }
57
+ },
58
+ {
59
+ "type": "button",
60
+ "attrs": {
61
+ "text": "Tìm hiểu",
62
+ "href": "/gioi-thieu",
63
+ "variant": "outline"
64
+ }
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "type": "spacer",
72
+ "attrs": {
73
+ "height": "xl"
74
+ }
75
+ },
76
+ {
77
+ "type": "mediaText",
78
+ "attrs": {
79
+ "src": "/uploads/a.jpg",
80
+ "position": "right",
81
+ "width": "120",
82
+ "verticalAlign": "top",
83
+ "stack": "false"
84
+ },
85
+ "content": [
86
+ {
87
+ "type": "paragraph",
88
+ "content": [
89
+ {
90
+ "type": "text",
91
+ "text": "Chữ cạnh ảnh"
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ "type": "pullquote",
99
+ "attrs": {
100
+ "citation": "Ai đó"
101
+ },
102
+ "content": [
103
+ {
104
+ "type": "text",
105
+ "text": "Trích dẫn nổi bật"
106
+ }
107
+ ]
108
+ },
109
+ {
110
+ "type": "details",
111
+ "attrs": {
112
+ "summary": "Câu hỏi?",
113
+ "open": 1
114
+ },
115
+ "content": [
116
+ {
117
+ "type": "paragraph",
118
+ "content": [
119
+ {
120
+ "type": "text",
121
+ "text": "Trả lời"
122
+ }
123
+ ]
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "type": "customHtml",
129
+ "attrs": {
130
+ "html": "<div class=\"x\">HTML</div>"
131
+ }
132
+ },
133
+ {
134
+ "type": "socialLinks",
135
+ "attrs": {
136
+ "links": [
137
+ {
138
+ "service": "facebook",
139
+ "url": "https://facebook.com/x"
140
+ },
141
+ {
142
+ "service": "zalo",
143
+ "url": "https://zalo.me/0900"
144
+ }
145
+ ],
146
+ "size": "huge",
147
+ "align": "center"
148
+ }
149
+ },
150
+ {
151
+ "type": "preformatted",
152
+ "content": [
153
+ {
154
+ "type": "text",
155
+ "text": " giữ khoảng trắng"
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "type": "table",
161
+ "attrs": {
162
+ "footer": "true",
163
+ "fixed": 1
164
+ },
165
+ "content": [
166
+ {
167
+ "type": "tableRow",
168
+ "content": [
169
+ {
170
+ "type": "tableCell",
171
+ "content": [
172
+ {
173
+ "type": "paragraph",
174
+ "content": [
175
+ {
176
+ "type": "text",
177
+ "text": "Hàng"
178
+ }
179
+ ]
180
+ }
181
+ ]
182
+ }
183
+ ]
184
+ },
185
+ {
186
+ "type": "tableRow",
187
+ "content": [
188
+ {
189
+ "type": "tableCell",
190
+ "content": [
191
+ {
192
+ "type": "paragraph",
193
+ "content": [
194
+ {
195
+ "type": "text",
196
+ "text": "Tổng"
197
+ }
198
+ ]
199
+ }
200
+ ]
201
+ }
202
+ ]
203
+ }
204
+ ]
205
+ }
206
+ ]
207
+ }
208
+ }
209
+ ]
210
+ },
211
+ "expected": {
212
+ "version": 1,
213
+ "blocks": [
214
+ {
215
+ "id": "main",
216
+ "type": "richtext",
217
+ "data": {
218
+ "type": "doc",
219
+ "content": [
220
+ {
221
+ "type": "tableOfContents",
222
+ "attrs": {
223
+ "title": "Mục lục",
224
+ "maxLevel": 4
225
+ }
226
+ },
227
+ {
228
+ "type": "cover",
229
+ "attrs": {
230
+ "src": "/uploads/hero.jpg",
231
+ "mediaId": 12,
232
+ "alt": "Ảnh bìa",
233
+ "overlay": "#000000",
234
+ "opacity": 70,
235
+ "minHeight": "60vh",
236
+ "fixed": true
237
+ },
238
+ "content": [
239
+ {
240
+ "type": "heading",
241
+ "attrs": {
242
+ "level": 1
243
+ },
244
+ "content": [
245
+ {
246
+ "type": "text",
247
+ "text": "Chào mừng"
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ "type": "buttons",
253
+ "attrs": {
254
+ "align": "center"
255
+ },
256
+ "content": [
257
+ {
258
+ "type": "button",
259
+ "attrs": {
260
+ "text": "Bắt đầu",
261
+ "href": "/bat-dau"
262
+ }
263
+ },
264
+ {
265
+ "type": "button",
266
+ "attrs": {
267
+ "text": "Tìm hiểu",
268
+ "href": "/gioi-thieu",
269
+ "variant": "outline"
270
+ }
271
+ }
272
+ ]
273
+ }
274
+ ]
275
+ },
276
+ {
277
+ "type": "spacer",
278
+ "attrs": {
279
+ "height": "xl"
280
+ }
281
+ },
282
+ {
283
+ "type": "mediaText",
284
+ "attrs": {
285
+ "src": "/uploads/a.jpg",
286
+ "position": "right",
287
+ "width": 80,
288
+ "verticalAlign": "top",
289
+ "stack": false
290
+ },
291
+ "content": [
292
+ {
293
+ "type": "paragraph",
294
+ "content": [
295
+ {
296
+ "type": "text",
297
+ "text": "Chữ cạnh ảnh"
298
+ }
299
+ ]
300
+ }
301
+ ]
302
+ },
303
+ {
304
+ "type": "pullquote",
305
+ "attrs": {
306
+ "citation": "Ai đó"
307
+ },
308
+ "content": [
309
+ {
310
+ "type": "text",
311
+ "text": "Trích dẫn nổi bật"
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ "type": "details",
317
+ "attrs": {
318
+ "summary": "Câu hỏi?"
319
+ },
320
+ "content": [
321
+ {
322
+ "type": "paragraph",
323
+ "content": [
324
+ {
325
+ "type": "text",
326
+ "text": "Trả lời"
327
+ }
328
+ ]
329
+ }
330
+ ]
331
+ },
332
+ {
333
+ "type": "customHtml",
334
+ "attrs": {
335
+ "html": "<div class=\"x\">HTML</div>"
336
+ }
337
+ },
338
+ {
339
+ "type": "socialLinks",
340
+ "attrs": {
341
+ "links": [
342
+ {
343
+ "service": "facebook",
344
+ "url": "https://facebook.com/x"
345
+ },
346
+ {
347
+ "service": "zalo",
348
+ "url": "https://zalo.me/0900"
349
+ }
350
+ ],
351
+ "align": "center"
352
+ }
353
+ },
354
+ {
355
+ "type": "preformatted",
356
+ "content": [
357
+ {
358
+ "type": "text",
359
+ "text": " giữ khoảng trắng"
360
+ }
361
+ ]
362
+ },
363
+ {
364
+ "type": "table",
365
+ "attrs": {
366
+ "footer": true
367
+ },
368
+ "content": [
369
+ {
370
+ "type": "tableRow",
371
+ "content": [
372
+ {
373
+ "type": "tableCell",
374
+ "content": [
375
+ {
376
+ "type": "paragraph",
377
+ "content": [
378
+ {
379
+ "type": "text",
380
+ "text": "Hàng"
381
+ }
382
+ ]
383
+ }
384
+ ]
385
+ }
386
+ ]
387
+ },
388
+ {
389
+ "type": "tableRow",
390
+ "content": [
391
+ {
392
+ "type": "tableCell",
393
+ "content": [
394
+ {
395
+ "type": "paragraph",
396
+ "content": [
397
+ {
398
+ "type": "text",
399
+ "text": "Tổng"
400
+ }
401
+ ]
402
+ }
403
+ ]
404
+ }
405
+ ]
406
+ }
407
+ ]
408
+ }
409
+ ]
410
+ }
411
+ }
412
+ ]
413
+ }
414
+ }