@ecomcx/ecomweb-content 0.0.0-stage → 1.15.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/LICENSE +21 -0
- package/README.md +178 -2
- package/dist/bindings.d.ts +19 -0
- package/dist/bindings.js +44 -0
- package/dist/block.d.ts +58 -0
- package/dist/block.js +60 -0
- package/dist/embed.d.ts +23 -0
- package/dist/embed.js +63 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/migrate.d.ts +2 -0
- package/dist/migrate.js +19 -0
- package/dist/normalize.d.ts +25 -0
- package/dist/normalize.js +147 -0
- package/dist/schema.d.ts +31 -0
- package/dist/schema.js +173 -0
- package/dist/style.d.ts +132 -0
- package/dist/style.js +523 -0
- package/dist/text.d.ts +9 -0
- package/dist/text.js +30 -0
- package/dist/types.d.ts +36 -0
- package/dist/types.js +6 -0
- package/dist/url.d.ts +7 -0
- package/dist/url.js +21 -0
- package/fixtures/all-core-nodes.json +782 -0
- package/fixtures/attr-coercion.json +219 -0
- package/fixtures/basic-blocks.json +414 -0
- package/fixtures/bindings-lock.json +33 -0
- package/fixtures/block-extras.json +131 -0
- package/fixtures/block-styles.json +316 -0
- package/fixtures/dynamic-blocks.json +316 -0
- package/fixtures/editor-output-nulls.json +112 -0
- package/fixtures/empty-and-newer.json +12 -0
- package/fixtures/invalid-structure.json +145 -0
- package/fixtures/layout-blocks.json +238 -0
- package/fixtures/legacy-html-string.json +17 -0
- package/fixtures/legacy-tiptap-doc.json +41 -0
- package/fixtures/plugin-blocks-preserved.json +155 -0
- package/fixtures/style-layout-effects.json +47 -0
- package/fixtures/synced-pattern.json +80 -0
- package/package.json +44 -4
- package/style.css +169 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "block-extras",
|
|
3
|
+
"note": "Thuộc tính chung (1.10): biến thể kiểu blockStyle, neo anchor (cắt khoảng trắng), class riêng className (tối đa 5, bỏ trùng, bỏ class không hợp lệ) — mọi khối, kể cả khối plugin",
|
|
4
|
+
"input": {
|
|
5
|
+
"version": 1,
|
|
6
|
+
"blocks": [
|
|
7
|
+
{
|
|
8
|
+
"id": "main",
|
|
9
|
+
"type": "richtext",
|
|
10
|
+
"data": {
|
|
11
|
+
"type": "doc",
|
|
12
|
+
"content": [
|
|
13
|
+
{
|
|
14
|
+
"type": "table",
|
|
15
|
+
"attrs": {
|
|
16
|
+
"blockStyle": "stripes",
|
|
17
|
+
"anchor": " bang-gia ",
|
|
18
|
+
"className": "pricing pricing x\"y -ok"
|
|
19
|
+
},
|
|
20
|
+
"content": [
|
|
21
|
+
{
|
|
22
|
+
"type": "tableRow",
|
|
23
|
+
"content": [
|
|
24
|
+
{
|
|
25
|
+
"type": "tableCell",
|
|
26
|
+
"content": [
|
|
27
|
+
{
|
|
28
|
+
"type": "paragraph"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "paragraph",
|
|
38
|
+
"attrs": {
|
|
39
|
+
"blockStyle": "Bad Style",
|
|
40
|
+
"anchor": "1abc",
|
|
41
|
+
"className": "<script>"
|
|
42
|
+
},
|
|
43
|
+
"content": [
|
|
44
|
+
{
|
|
45
|
+
"type": "text",
|
|
46
|
+
"text": "x"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "image",
|
|
52
|
+
"attrs": {
|
|
53
|
+
"src": "/a.png",
|
|
54
|
+
"blockStyle": "rounded",
|
|
55
|
+
"className": "a b c d e f g"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "demo/hero",
|
|
60
|
+
"attrs": {
|
|
61
|
+
"anchor": "hero",
|
|
62
|
+
"blockStyle": "dark"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"expected": {
|
|
71
|
+
"version": 1,
|
|
72
|
+
"blocks": [
|
|
73
|
+
{
|
|
74
|
+
"id": "main",
|
|
75
|
+
"type": "richtext",
|
|
76
|
+
"data": {
|
|
77
|
+
"type": "doc",
|
|
78
|
+
"content": [
|
|
79
|
+
{
|
|
80
|
+
"type": "table",
|
|
81
|
+
"attrs": {
|
|
82
|
+
"blockStyle": "stripes",
|
|
83
|
+
"anchor": "bang-gia",
|
|
84
|
+
"className": "pricing -ok"
|
|
85
|
+
},
|
|
86
|
+
"content": [
|
|
87
|
+
{
|
|
88
|
+
"type": "tableRow",
|
|
89
|
+
"content": [
|
|
90
|
+
{
|
|
91
|
+
"type": "tableCell",
|
|
92
|
+
"content": [
|
|
93
|
+
{
|
|
94
|
+
"type": "paragraph"
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"type": "paragraph",
|
|
104
|
+
"content": [
|
|
105
|
+
{
|
|
106
|
+
"type": "text",
|
|
107
|
+
"text": "x"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"type": "image",
|
|
113
|
+
"attrs": {
|
|
114
|
+
"src": "/a.png",
|
|
115
|
+
"blockStyle": "rounded",
|
|
116
|
+
"className": "a b c d e"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"type": "demo/hero",
|
|
121
|
+
"attrs": {
|
|
122
|
+
"anchor": "hero",
|
|
123
|
+
"blockStyle": "dark"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "block-styles",
|
|
3
|
+
"note": "Kiểu dáng khối (1.7, kiểu chữ 1.8): attrs.style của mọi khối — dạng gọn thành theo khổ (base/tablet/mobile), thứ tự khoá cố định, bỏ giá trị không hợp lệ (độ dài lạ, CSS chèn, khổ lạ, chuỗi thay cho object)",
|
|
4
|
+
"input": {
|
|
5
|
+
"version": 1,
|
|
6
|
+
"blocks": [
|
|
7
|
+
{
|
|
8
|
+
"id": "main",
|
|
9
|
+
"type": "richtext",
|
|
10
|
+
"data": {
|
|
11
|
+
"type": "doc",
|
|
12
|
+
"content": [
|
|
13
|
+
{
|
|
14
|
+
"type": "group",
|
|
15
|
+
"attrs": {
|
|
16
|
+
"style": {
|
|
17
|
+
"padding": {
|
|
18
|
+
"base": "xl",
|
|
19
|
+
"tablet": "lg",
|
|
20
|
+
"mobile": {
|
|
21
|
+
"top": "md",
|
|
22
|
+
"bottom": "md",
|
|
23
|
+
"left": "1e9px"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"color": {
|
|
27
|
+
"background": "#0f172a",
|
|
28
|
+
"text": "white"
|
|
29
|
+
},
|
|
30
|
+
"radius": "12px",
|
|
31
|
+
"hide": [
|
|
32
|
+
"tv",
|
|
33
|
+
"mobile"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"content": [
|
|
38
|
+
{
|
|
39
|
+
"type": "heading",
|
|
40
|
+
"attrs": {
|
|
41
|
+
"level": "2",
|
|
42
|
+
"style": {
|
|
43
|
+
"fontSize": {
|
|
44
|
+
"base": "3xl",
|
|
45
|
+
"mobile": "2xl"
|
|
46
|
+
},
|
|
47
|
+
"textAlign": {
|
|
48
|
+
"base": "center",
|
|
49
|
+
"mobile": "left"
|
|
50
|
+
},
|
|
51
|
+
"fontWeight": 800,
|
|
52
|
+
"lineHeight": "1.2"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"content": [
|
|
56
|
+
{
|
|
57
|
+
"type": "text",
|
|
58
|
+
"text": "Tiêu đề"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "paragraph",
|
|
66
|
+
"attrs": {
|
|
67
|
+
"style": {
|
|
68
|
+
"margin": "auto",
|
|
69
|
+
"maxWidth": "640px",
|
|
70
|
+
"width": "calc(100%)"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"content": [
|
|
74
|
+
{
|
|
75
|
+
"type": "text",
|
|
76
|
+
"text": "Đoạn"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "columns",
|
|
82
|
+
"attrs": {
|
|
83
|
+
"style": {
|
|
84
|
+
"gap": {
|
|
85
|
+
"base": "xl",
|
|
86
|
+
"mobile": "sm"
|
|
87
|
+
},
|
|
88
|
+
"border": {
|
|
89
|
+
"width": "1px",
|
|
90
|
+
"style": "dashed",
|
|
91
|
+
"color": "rgb(0,0,0)"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"content": [
|
|
96
|
+
{
|
|
97
|
+
"type": "column",
|
|
98
|
+
"content": [
|
|
99
|
+
{
|
|
100
|
+
"type": "paragraph"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"type": "column",
|
|
106
|
+
"content": [
|
|
107
|
+
{
|
|
108
|
+
"type": "paragraph"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "demo/hero",
|
|
116
|
+
"attrs": {
|
|
117
|
+
"title": "x",
|
|
118
|
+
"style": {
|
|
119
|
+
"padding": "red;}body{display:none"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"type": "image",
|
|
125
|
+
"attrs": {
|
|
126
|
+
"src": "/a.png",
|
|
127
|
+
"style": "padding:10px"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"type": "paragraph",
|
|
132
|
+
"attrs": {
|
|
133
|
+
"style": {
|
|
134
|
+
"textTransform": "uppercase",
|
|
135
|
+
"fontStyle": "italic",
|
|
136
|
+
"letterSpacing": {
|
|
137
|
+
"base": "0.1em",
|
|
138
|
+
"mobile": "2px"
|
|
139
|
+
},
|
|
140
|
+
"textDecoration": "line-through",
|
|
141
|
+
"fontFamily": "heading",
|
|
142
|
+
"minHeight": {
|
|
143
|
+
"base": "50vh",
|
|
144
|
+
"mobile": "auto"
|
|
145
|
+
},
|
|
146
|
+
"fontWeight": "950"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"content": [
|
|
150
|
+
{
|
|
151
|
+
"type": "text",
|
|
152
|
+
"text": "Kiểu chữ"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"expected": {
|
|
162
|
+
"version": 1,
|
|
163
|
+
"blocks": [
|
|
164
|
+
{
|
|
165
|
+
"id": "main",
|
|
166
|
+
"type": "richtext",
|
|
167
|
+
"data": {
|
|
168
|
+
"type": "doc",
|
|
169
|
+
"content": [
|
|
170
|
+
{
|
|
171
|
+
"type": "group",
|
|
172
|
+
"attrs": {
|
|
173
|
+
"style": {
|
|
174
|
+
"padding": {
|
|
175
|
+
"base": "xl",
|
|
176
|
+
"tablet": "lg",
|
|
177
|
+
"mobile": {
|
|
178
|
+
"top": "md",
|
|
179
|
+
"bottom": "md"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"color": {
|
|
183
|
+
"text": "white",
|
|
184
|
+
"background": "#0f172a"
|
|
185
|
+
},
|
|
186
|
+
"radius": "12px",
|
|
187
|
+
"hide": [
|
|
188
|
+
"mobile"
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"content": [
|
|
193
|
+
{
|
|
194
|
+
"type": "heading",
|
|
195
|
+
"attrs": {
|
|
196
|
+
"level": 2,
|
|
197
|
+
"style": {
|
|
198
|
+
"fontSize": {
|
|
199
|
+
"base": "3xl",
|
|
200
|
+
"mobile": "2xl"
|
|
201
|
+
},
|
|
202
|
+
"lineHeight": {
|
|
203
|
+
"base": 1.2
|
|
204
|
+
},
|
|
205
|
+
"fontWeight": "800",
|
|
206
|
+
"textAlign": {
|
|
207
|
+
"base": "center",
|
|
208
|
+
"mobile": "left"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"content": [
|
|
213
|
+
{
|
|
214
|
+
"type": "text",
|
|
215
|
+
"text": "Tiêu đề"
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"type": "paragraph",
|
|
223
|
+
"attrs": {
|
|
224
|
+
"style": {
|
|
225
|
+
"margin": {
|
|
226
|
+
"base": "auto"
|
|
227
|
+
},
|
|
228
|
+
"maxWidth": {
|
|
229
|
+
"base": "640px"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"content": [
|
|
234
|
+
{
|
|
235
|
+
"type": "text",
|
|
236
|
+
"text": "Đoạn"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"type": "columns",
|
|
242
|
+
"attrs": {
|
|
243
|
+
"style": {
|
|
244
|
+
"gap": {
|
|
245
|
+
"base": "xl",
|
|
246
|
+
"mobile": "sm"
|
|
247
|
+
},
|
|
248
|
+
"border": {
|
|
249
|
+
"width": "1px",
|
|
250
|
+
"style": "dashed",
|
|
251
|
+
"color": "rgb(0,0,0)"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"content": [
|
|
256
|
+
{
|
|
257
|
+
"type": "column",
|
|
258
|
+
"content": [
|
|
259
|
+
{
|
|
260
|
+
"type": "paragraph"
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"type": "column",
|
|
266
|
+
"content": [
|
|
267
|
+
{
|
|
268
|
+
"type": "paragraph"
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"type": "demo/hero",
|
|
276
|
+
"attrs": {
|
|
277
|
+
"title": "x"
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"type": "image",
|
|
282
|
+
"attrs": {
|
|
283
|
+
"src": "/a.png"
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"type": "paragraph",
|
|
288
|
+
"attrs": {
|
|
289
|
+
"style": {
|
|
290
|
+
"minHeight": {
|
|
291
|
+
"base": "50vh",
|
|
292
|
+
"mobile": "auto"
|
|
293
|
+
},
|
|
294
|
+
"fontFamily": "heading",
|
|
295
|
+
"letterSpacing": {
|
|
296
|
+
"base": "0.1em",
|
|
297
|
+
"mobile": "2px"
|
|
298
|
+
},
|
|
299
|
+
"fontStyle": "italic",
|
|
300
|
+
"textDecoration": "line-through",
|
|
301
|
+
"textTransform": "uppercase"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"content": [
|
|
305
|
+
{
|
|
306
|
+
"type": "text",
|
|
307
|
+
"text": "Kiểu chữ"
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
}
|