@gravity-ui/page-constructor 3.9.0 → 3.9.2
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/CHANGELOG.md +14 -0
- package/build/cjs/utils/blocks.js +3 -3
- package/build/esm/utils/blocks.js +3 -3
- package/package.json +1 -1
- package/server/utils/blocks.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.9.2](https://github.com/gravity-ui/page-constructor/compare/v3.9.1...v3.9.2) (2023-06-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* regex to match child content on block tags ([#433](https://github.com/gravity-ui/page-constructor/issues/433)) ([a4d4129](https://github.com/gravity-ui/page-constructor/commit/a4d4129af7d1b82e149ee6ced215d5733ad1b2f7))
|
|
9
|
+
|
|
10
|
+
## [3.9.1](https://github.com/gravity-ui/page-constructor/compare/v3.9.0...v3.9.1) (2023-06-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* header description displaying with ssr ([#431](https://github.com/gravity-ui/page-constructor/issues/431)) ([9c094dc](https://github.com/gravity-ui/page-constructor/commit/9c094dc7550d483cedd6b5611e0902b0d7aa27e1))
|
|
16
|
+
|
|
3
17
|
## [3.9.0](https://github.com/gravity-ui/page-constructor/compare/v3.8.3...v3.9.0) (2023-06-27)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -38,6 +38,7 @@ const BLOCK_ELEMENTS = [
|
|
|
38
38
|
'th',
|
|
39
39
|
'td',
|
|
40
40
|
];
|
|
41
|
+
const BLOCK_ELEMENTS_REGEX = `<(${BLOCK_ELEMENTS.join('|')})[^>]*>`;
|
|
41
42
|
function getHeaderTag(size) {
|
|
42
43
|
switch (size) {
|
|
43
44
|
case 'l':
|
|
@@ -53,9 +54,8 @@ function getHeaderTag(size) {
|
|
|
53
54
|
}
|
|
54
55
|
exports.getHeaderTag = getHeaderTag;
|
|
55
56
|
function hasBlockTag(content) {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
return Boolean(blockTags);
|
|
57
|
+
const regex = new RegExp(BLOCK_ELEMENTS_REGEX, 'g');
|
|
58
|
+
return regex.test(content);
|
|
59
59
|
}
|
|
60
60
|
exports.hasBlockTag = hasBlockTag;
|
|
61
61
|
function getBlockKey(block, index) {
|
|
@@ -35,6 +35,7 @@ const BLOCK_ELEMENTS = [
|
|
|
35
35
|
'th',
|
|
36
36
|
'td',
|
|
37
37
|
];
|
|
38
|
+
const BLOCK_ELEMENTS_REGEX = `<(${BLOCK_ELEMENTS.join('|')})[^>]*>`;
|
|
38
39
|
export function getHeaderTag(size) {
|
|
39
40
|
switch (size) {
|
|
40
41
|
case 'l':
|
|
@@ -49,9 +50,8 @@ export function getHeaderTag(size) {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
export function hasBlockTag(content) {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
return Boolean(blockTags);
|
|
53
|
+
const regex = new RegExp(BLOCK_ELEMENTS_REGEX, 'g');
|
|
54
|
+
return regex.test(content);
|
|
55
55
|
}
|
|
56
56
|
export function getBlockKey(block, index) {
|
|
57
57
|
return `${block.type}-${index}`;
|
package/package.json
CHANGED
package/server/utils/blocks.js
CHANGED
|
@@ -38,6 +38,7 @@ const BLOCK_ELEMENTS = [
|
|
|
38
38
|
'th',
|
|
39
39
|
'td',
|
|
40
40
|
];
|
|
41
|
+
const BLOCK_ELEMENTS_REGEX = `<(${BLOCK_ELEMENTS.join('|')})[^>]*>`;
|
|
41
42
|
function getHeaderTag(size) {
|
|
42
43
|
switch (size) {
|
|
43
44
|
case 'l':
|
|
@@ -53,9 +54,8 @@ function getHeaderTag(size) {
|
|
|
53
54
|
}
|
|
54
55
|
exports.getHeaderTag = getHeaderTag;
|
|
55
56
|
function hasBlockTag(content) {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
return Boolean(blockTags);
|
|
57
|
+
const regex = new RegExp(BLOCK_ELEMENTS_REGEX, 'g');
|
|
58
|
+
return regex.test(content);
|
|
59
59
|
}
|
|
60
60
|
exports.hasBlockTag = hasBlockTag;
|
|
61
61
|
function getBlockKey(block, index) {
|