@gravity-ui/page-constructor 4.17.0 → 4.18.1
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/build/cjs/blocks/HeaderSlider/HeaderSlider.css +3 -0
- package/build/cjs/blocks/Slider/Slider.css +4 -1
- package/build/cjs/editor/components/AddBlock/AddBlock.js +1 -1
- package/build/cjs/text-transform/utils.d.ts +2 -0
- package/build/cjs/text-transform/utils.js +7 -26
- package/build/esm/blocks/HeaderSlider/HeaderSlider.css +3 -0
- package/build/esm/blocks/Slider/Slider.css +4 -1
- package/build/esm/editor/components/AddBlock/AddBlock.js +1 -1
- package/build/esm/text-transform/utils.d.ts +2 -0
- package/build/esm/text-transform/utils.js +5 -25
- package/package.json +1 -1
- package/server/text-transform/utils.d.ts +2 -0
- package/server/text-transform/utils.js +7 -26
- package/widget/index.js +1 -1
|
@@ -46,6 +46,9 @@ unpredictable css rules order in build */
|
|
|
46
46
|
padding-left: 0;
|
|
47
47
|
padding-right: 0;
|
|
48
48
|
}
|
|
49
|
+
.pc-header-slider-block__item-content .pc-header-block__container-fluid {
|
|
50
|
+
padding-left: 24px;
|
|
51
|
+
}
|
|
49
52
|
.pc-header-slider-block .slick-track .slick-slide {
|
|
50
53
|
max-width: 100%;
|
|
51
54
|
}
|
|
@@ -373,7 +373,10 @@ unpredictable css rules order in build */
|
|
|
373
373
|
padding-left: 0;
|
|
374
374
|
}
|
|
375
375
|
.pc-SliderBlock_type_header-card.pc-SliderBlock:not(.pc-SliderBlock_type_header-card_one-slide) .slick-slide {
|
|
376
|
-
|
|
376
|
+
/* stylelint-disable declaration-no-important */
|
|
377
|
+
padding-right: 0 !important;
|
|
378
|
+
padding-left: 0 !important;
|
|
379
|
+
/* stylelint-enable declaration-no-important */
|
|
377
380
|
}
|
|
378
381
|
.pc-SliderBlock_type_header-card.pc-SliderBlock:not(.pc-SliderBlock_type_header-card_one-slide) .slick-slide:last-child {
|
|
379
382
|
padding-right: 0;
|
|
@@ -17,7 +17,7 @@ const AddBlock = ({ onAdd, className }) => {
|
|
|
17
17
|
.toLocaleLowerCase()
|
|
18
18
|
.startsWith(search.toLocaleLowerCase())), [search]);
|
|
19
19
|
return (react_1.default.createElement("div", { className: b(null, className), ref: ref },
|
|
20
|
-
react_1.default.createElement("button", { className: b('button'), onClick: () => {
|
|
20
|
+
react_1.default.createElement("button", { className: b('button'), type: "button", onClick: () => {
|
|
21
21
|
setIsOpened(!isOpened);
|
|
22
22
|
setSearch('');
|
|
23
23
|
} },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Options, Output } from '@doc-tools/transform';
|
|
2
2
|
import sanitize from 'sanitize-html';
|
|
3
3
|
import { Lang } from '../utils/configure';
|
|
4
|
+
import AddRuleOptions = typograf.AddRuleOptions;
|
|
4
5
|
export declare enum TransformType {
|
|
5
6
|
Text = "text",
|
|
6
7
|
Html = "html"
|
|
@@ -14,6 +15,7 @@ export declare const typografConfig: {
|
|
|
14
15
|
disabled: string[];
|
|
15
16
|
};
|
|
16
17
|
export declare const sanitizeStripOptions: sanitize.IOptions;
|
|
18
|
+
export declare function addTypografRules(options: AddRuleOptions[]): void;
|
|
17
19
|
export declare function typograf(text: string, lang?: Lang): string;
|
|
18
20
|
export declare function sanitizeHtml(html: string, options?: sanitize.IOptions): string;
|
|
19
21
|
export declare function typografToHTML(text: string, lang: Lang, allowedTags?: string[]): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.typografEntity = exports.fullTransform = exports.transformMarkdown = exports.typografToText = exports.typografToHTML = exports.sanitizeHtml = exports.typograf = exports.sanitizeStripOptions = exports.typografConfig = exports.DEFAULT_ALLOWED_TAGS = exports.TransformType = void 0;
|
|
3
|
+
exports.typografEntity = exports.fullTransform = exports.transformMarkdown = exports.typografToText = exports.typografToHTML = exports.sanitizeHtml = exports.typograf = exports.addTypografRules = exports.sanitizeStripOptions = exports.typografConfig = exports.DEFAULT_ALLOWED_TAGS = exports.TransformType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const transform_1 = tslib_1.__importDefault(require("@doc-tools/transform"));
|
|
6
6
|
const sanitize_html_1 = tslib_1.__importDefault(require("sanitize-html"));
|
|
@@ -37,31 +37,12 @@ exports.sanitizeStripOptions = {
|
|
|
37
37
|
allowedTags: [],
|
|
38
38
|
allowedAttributes: {},
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
handler: function (text, settings, context) {
|
|
47
|
-
const { prefs: { htmlEntity: { type = '' } = {} } = {} } = context;
|
|
48
|
-
let symbols;
|
|
49
|
-
switch (type) {
|
|
50
|
-
case 'digit':
|
|
51
|
-
symbols = '®|©|™';
|
|
52
|
-
break;
|
|
53
|
-
case 'name':
|
|
54
|
-
symbols = '®|©|™';
|
|
55
|
-
break;
|
|
56
|
-
default:
|
|
57
|
-
symbols = '®|©|™';
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
const symbolsRegex = new RegExp(`(?<!<sup>\\s*)(${symbols})|(${symbols})(?!\\s*<\\/sup>)`, 'gi');
|
|
61
|
-
return text.replace(symbolsRegex, '<sup>$1</sup>');
|
|
62
|
-
},
|
|
63
|
-
htmlAttrs: false,
|
|
64
|
-
});
|
|
40
|
+
function addTypografRules(options) {
|
|
41
|
+
options.forEach((option) => {
|
|
42
|
+
typograf_1.default.addRule(option);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
exports.addTypografRules = addTypografRules;
|
|
65
46
|
function enableRules(tp) {
|
|
66
47
|
const { disabled, enabled } = exports.typografConfig;
|
|
67
48
|
enabled.forEach((rule) => tp.enableRule(rule));
|
|
@@ -46,6 +46,9 @@ unpredictable css rules order in build */
|
|
|
46
46
|
padding-left: 0;
|
|
47
47
|
padding-right: 0;
|
|
48
48
|
}
|
|
49
|
+
.pc-header-slider-block__item-content .pc-header-block__container-fluid {
|
|
50
|
+
padding-left: 24px;
|
|
51
|
+
}
|
|
49
52
|
.pc-header-slider-block .slick-track .slick-slide {
|
|
50
53
|
max-width: 100%;
|
|
51
54
|
}
|
|
@@ -373,7 +373,10 @@ unpredictable css rules order in build */
|
|
|
373
373
|
padding-left: 0;
|
|
374
374
|
}
|
|
375
375
|
.pc-SliderBlock_type_header-card.pc-SliderBlock:not(.pc-SliderBlock_type_header-card_one-slide) .slick-slide {
|
|
376
|
-
|
|
376
|
+
/* stylelint-disable declaration-no-important */
|
|
377
|
+
padding-right: 0 !important;
|
|
378
|
+
padding-left: 0 !important;
|
|
379
|
+
/* stylelint-enable declaration-no-important */
|
|
377
380
|
}
|
|
378
381
|
.pc-SliderBlock_type_header-card.pc-SliderBlock:not(.pc-SliderBlock_type_header-card_one-slide) .slick-slide:last-child {
|
|
379
382
|
padding-right: 0;
|
|
@@ -15,7 +15,7 @@ const AddBlock = ({ onAdd, className }) => {
|
|
|
15
15
|
.toLocaleLowerCase()
|
|
16
16
|
.startsWith(search.toLocaleLowerCase())), [search]);
|
|
17
17
|
return (React.createElement("div", { className: b(null, className), ref: ref },
|
|
18
|
-
React.createElement("button", { className: b('button'), onClick: () => {
|
|
18
|
+
React.createElement("button", { className: b('button'), type: "button", onClick: () => {
|
|
19
19
|
setIsOpened(!isOpened);
|
|
20
20
|
setSearch('');
|
|
21
21
|
} },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Options, Output } from '@doc-tools/transform';
|
|
2
2
|
import sanitize from 'sanitize-html';
|
|
3
3
|
import { Lang } from '../utils/configure';
|
|
4
|
+
import AddRuleOptions = typograf.AddRuleOptions;
|
|
4
5
|
export declare enum TransformType {
|
|
5
6
|
Text = "text",
|
|
6
7
|
Html = "html"
|
|
@@ -14,6 +15,7 @@ export declare const typografConfig: {
|
|
|
14
15
|
disabled: string[];
|
|
15
16
|
};
|
|
16
17
|
export declare const sanitizeStripOptions: sanitize.IOptions;
|
|
18
|
+
export declare function addTypografRules(options: AddRuleOptions[]): void;
|
|
17
19
|
export declare function typograf(text: string, lang?: Lang): string;
|
|
18
20
|
export declare function sanitizeHtml(html: string, options?: sanitize.IOptions): string;
|
|
19
21
|
export declare function typografToHTML(text: string, lang: Lang, allowedTags?: string[]): string;
|
|
@@ -34,31 +34,11 @@ export const sanitizeStripOptions = {
|
|
|
34
34
|
allowedTags: [],
|
|
35
35
|
allowedAttributes: {},
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//@ts-ignore
|
|
43
|
-
handler: function (text, settings, context) {
|
|
44
|
-
const { prefs: { htmlEntity: { type = '' } = {} } = {} } = context;
|
|
45
|
-
let symbols;
|
|
46
|
-
switch (type) {
|
|
47
|
-
case 'digit':
|
|
48
|
-
symbols = '®|©|™';
|
|
49
|
-
break;
|
|
50
|
-
case 'name':
|
|
51
|
-
symbols = '®|©|™';
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
symbols = '®|©|™';
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
const symbolsRegex = new RegExp(`(?<!<sup>\\s*)(${symbols})|(${symbols})(?!\\s*<\\/sup>)`, 'gi');
|
|
58
|
-
return text.replace(symbolsRegex, '<sup>$1</sup>');
|
|
59
|
-
},
|
|
60
|
-
htmlAttrs: false,
|
|
61
|
-
});
|
|
37
|
+
export function addTypografRules(options) {
|
|
38
|
+
options.forEach((option) => {
|
|
39
|
+
Typograf.addRule(option);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
62
42
|
function enableRules(tp) {
|
|
63
43
|
const { disabled, enabled } = typografConfig;
|
|
64
44
|
enabled.forEach((rule) => tp.enableRule(rule));
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Options, Output } from '@doc-tools/transform';
|
|
2
2
|
import sanitize from 'sanitize-html';
|
|
3
3
|
import { Lang } from '../utils/configure';
|
|
4
|
+
import AddRuleOptions = typograf.AddRuleOptions;
|
|
4
5
|
export declare enum TransformType {
|
|
5
6
|
Text = "text",
|
|
6
7
|
Html = "html"
|
|
@@ -14,6 +15,7 @@ export declare const typografConfig: {
|
|
|
14
15
|
disabled: string[];
|
|
15
16
|
};
|
|
16
17
|
export declare const sanitizeStripOptions: sanitize.IOptions;
|
|
18
|
+
export declare function addTypografRules(options: AddRuleOptions[]): void;
|
|
17
19
|
export declare function typograf(text: string, lang?: Lang): string;
|
|
18
20
|
export declare function sanitizeHtml(html: string, options?: sanitize.IOptions): string;
|
|
19
21
|
export declare function typografToHTML(text: string, lang: Lang, allowedTags?: string[]): string;
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.typografEntity = exports.fullTransform = exports.transformMarkdown = exports.typografToText = exports.typografToHTML = exports.sanitizeHtml = exports.typograf = exports.sanitizeStripOptions = exports.typografConfig = exports.DEFAULT_ALLOWED_TAGS = exports.TransformType = void 0;
|
|
17
|
+
exports.typografEntity = exports.fullTransform = exports.transformMarkdown = exports.typografToText = exports.typografToHTML = exports.sanitizeHtml = exports.typograf = exports.addTypografRules = exports.sanitizeStripOptions = exports.typografConfig = exports.DEFAULT_ALLOWED_TAGS = exports.TransformType = void 0;
|
|
18
18
|
const transform_1 = __importDefault(require("@doc-tools/transform"));
|
|
19
19
|
const sanitize_html_1 = __importDefault(require("sanitize-html"));
|
|
20
20
|
const typograf_1 = __importDefault(require("typograf"));
|
|
@@ -50,31 +50,12 @@ exports.sanitizeStripOptions = {
|
|
|
50
50
|
allowedTags: [],
|
|
51
51
|
allowedAttributes: {},
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
handler: function (text, settings, context) {
|
|
60
|
-
const { prefs: { htmlEntity: { type = '' } = {} } = {} } = context;
|
|
61
|
-
let symbols;
|
|
62
|
-
switch (type) {
|
|
63
|
-
case 'digit':
|
|
64
|
-
symbols = '®|©|™';
|
|
65
|
-
break;
|
|
66
|
-
case 'name':
|
|
67
|
-
symbols = '®|©|™';
|
|
68
|
-
break;
|
|
69
|
-
default:
|
|
70
|
-
symbols = '®|©|™';
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
const symbolsRegex = new RegExp(`(?<!<sup>\\s*)(${symbols})|(${symbols})(?!\\s*<\\/sup>)`, 'gi');
|
|
74
|
-
return text.replace(symbolsRegex, '<sup>$1</sup>');
|
|
75
|
-
},
|
|
76
|
-
htmlAttrs: false,
|
|
77
|
-
});
|
|
53
|
+
function addTypografRules(options) {
|
|
54
|
+
options.forEach((option) => {
|
|
55
|
+
typograf_1.default.addRule(option);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
exports.addTypografRules = addTypografRules;
|
|
78
59
|
function enableRules(tp) {
|
|
79
60
|
const { disabled, enabled } = exports.typografConfig;
|
|
80
61
|
enabled.forEach((rule) => tp.enableRule(rule));
|