@gravity-ui/page-constructor 6.0.0-alpha.2 → 6.0.0-alpha.4

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 (34) hide show
  1. package/README.md +4 -0
  2. package/build/cjs/blocks/Slider/Slider.d.ts +3 -2
  3. package/build/cjs/blocks/Slider/schema.d.ts +20 -2
  4. package/build/cjs/blocks/Slider/schema.js +12 -1
  5. package/build/cjs/blocks/SliderOld/schema.d.ts +20 -2
  6. package/build/cjs/blocks/SliderOld/schema.js +12 -1
  7. package/build/cjs/blocks/index.d.ts +1 -0
  8. package/build/cjs/models/constructor-items/blocks.d.ts +1 -1
  9. package/build/cjs/text-transform/common.d.ts +4 -3
  10. package/build/cjs/text-transform/common.js +41 -18
  11. package/build/cjs/text-transform/config.d.ts +5 -2
  12. package/build/cjs/text-transform/config.js +45 -11
  13. package/build/cjs/text-transform/transformers.js +2 -2
  14. package/build/esm/blocks/Slider/Slider.d.ts +3 -2
  15. package/build/esm/blocks/Slider/Slider.js +4 -4
  16. package/build/esm/blocks/Slider/schema.d.ts +20 -2
  17. package/build/esm/blocks/Slider/schema.js +12 -1
  18. package/build/esm/blocks/SliderOld/schema.d.ts +20 -2
  19. package/build/esm/blocks/SliderOld/schema.js +12 -1
  20. package/build/esm/blocks/index.d.ts +1 -0
  21. package/build/esm/models/constructor-items/blocks.d.ts +1 -1
  22. package/build/esm/text-transform/common.d.ts +4 -3
  23. package/build/esm/text-transform/common.js +41 -18
  24. package/build/esm/text-transform/config.d.ts +5 -2
  25. package/build/esm/text-transform/config.js +45 -11
  26. package/build/esm/text-transform/transformers.js +2 -2
  27. package/package.json +1 -1
  28. package/schema/index.js +1 -1
  29. package/server/models/constructor-items/blocks.d.ts +1 -1
  30. package/server/text-transform/common.d.ts +4 -3
  31. package/server/text-transform/common.js +41 -18
  32. package/server/text-transform/config.d.ts +5 -2
  33. package/server/text-transform/config.js +45 -11
  34. package/server/text-transform/transformers.js +2 -2
package/README.md CHANGED
@@ -146,6 +146,10 @@ const post = {
146
146
 
147
147
  You can find more utilities in this [section](https://github.com/gravity-ui/page-constructor/tree/main/src/text-transform)
148
148
 
149
+ ### Detailed Documentation on Server Utilities and Transformers
150
+
151
+ For a comprehensive guide on using server utilities, including detailed explanations and advanced use cases, visit the [additional chapter on server utils usage](./docs/data-preparation.md).
152
+
149
153
  ### Custom blocks
150
154
 
151
155
  The page constructor lets you use blocks that are user-defined in their app. Blocks are regular React components.
@@ -1,8 +1,9 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { Swiper } from 'swiper/react';
2
+ import { Swiper as SwiperReact } from 'swiper/react';
3
3
  import { ClassNameProps, Refable, SliderProps as SliderParams } from '../../models';
4
4
  import 'swiper/swiper-bundle.css';
5
- export interface SliderProps extends Omit<SliderParams, 'children'>, Partial<Pick<Swiper, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
5
+ export type { Swiper, SwiperOptions } from 'swiper';
6
+ export interface SliderProps extends Omit<SliderParams, 'children'>, Partial<Pick<SwiperReact, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
6
7
  type?: string;
7
8
  anchorId?: string;
8
9
  dotsClassName?: string;
@@ -69,7 +69,16 @@ export declare const SliderProps: {
69
69
  type: string;
70
70
  patternProperties: {
71
71
  '.*': {
72
- type: string[];
72
+ oneOf: ({
73
+ type: string[];
74
+ additionalProperties?: undefined;
75
+ } | {
76
+ type: string;
77
+ additionalProperties: boolean;
78
+ } | {
79
+ type: string;
80
+ additionalProperties?: undefined;
81
+ })[];
73
82
  };
74
83
  };
75
84
  };
@@ -193,7 +202,16 @@ export declare const SliderBlock: {
193
202
  type: string;
194
203
  patternProperties: {
195
204
  '.*': {
196
- type: string[];
205
+ oneOf: ({
206
+ type: string[];
207
+ additionalProperties?: undefined;
208
+ } | {
209
+ type: string;
210
+ additionalProperties: boolean;
211
+ } | {
212
+ type: string;
213
+ additionalProperties?: undefined;
214
+ })[];
197
215
  };
198
216
  };
199
217
  };
@@ -21,7 +21,18 @@ const LoadableProps = {
21
21
  type: 'object',
22
22
  patternProperties: {
23
23
  '.*': {
24
- type: ['string', 'number', 'boolean'],
24
+ oneOf: [
25
+ {
26
+ type: ['string', 'number', 'boolean'],
27
+ },
28
+ {
29
+ type: 'object',
30
+ additionalProperties: true,
31
+ },
32
+ {
33
+ type: 'array',
34
+ },
35
+ ],
25
36
  },
26
37
  },
27
38
  },
@@ -60,7 +60,16 @@ export declare const SliderOldProps: {
60
60
  type: string;
61
61
  patternProperties: {
62
62
  '.*': {
63
- type: string[];
63
+ oneOf: ({
64
+ type: string[];
65
+ additionalProperties?: undefined;
66
+ } | {
67
+ type: string;
68
+ additionalProperties: boolean;
69
+ } | {
70
+ type: string;
71
+ additionalProperties?: undefined;
72
+ })[];
64
73
  };
65
74
  };
66
75
  };
@@ -176,7 +185,16 @@ export declare const SliderOldBlock: {
176
185
  type: string;
177
186
  patternProperties: {
178
187
  '.*': {
179
- type: string[];
188
+ oneOf: ({
189
+ type: string[];
190
+ additionalProperties?: undefined;
191
+ } | {
192
+ type: string;
193
+ additionalProperties: boolean;
194
+ } | {
195
+ type: string;
196
+ additionalProperties?: undefined;
197
+ })[];
180
198
  };
181
199
  };
182
200
  };
@@ -21,7 +21,18 @@ const LoadableProps = {
21
21
  type: 'object',
22
22
  patternProperties: {
23
23
  '.*': {
24
- type: ['string', 'number', 'boolean'],
24
+ oneOf: [
25
+ {
26
+ type: ['string', 'number', 'boolean'],
27
+ },
28
+ {
29
+ type: 'object',
30
+ additionalProperties: true,
31
+ },
32
+ {
33
+ type: 'array',
34
+ },
35
+ ],
25
36
  },
26
37
  },
27
38
  },
@@ -5,6 +5,7 @@ export { default as MediaBlock } from './Media/Media';
5
5
  export { default as MapBlock } from './Map/Map';
6
6
  export { default as SliderOldBlock } from './SliderOld/SliderOld';
7
7
  export { default as SliderBlock } from './Slider/Slider';
8
+ export type { Swiper, SwiperOptions } from './Slider/Slider';
8
9
  export { default as ExtendedFeaturesBlock } from './ExtendedFeatures/ExtendedFeatures';
9
10
  export { default as PromoFeaturesBlock } from './PromoFeaturesBlock/PromoFeaturesBlock';
10
11
  export { default as QuestionsBlock } from './Questions/Questions';
@@ -50,7 +50,7 @@ export interface LoadableProps {
50
50
  * @deprecated Will be moved to params
51
51
  */
52
52
  serviceId?: number;
53
- params?: Record<string, string | number | boolean>;
53
+ params?: Record<string, string | number | boolean | object>;
54
54
  }
55
55
  export interface LoadableChildren {
56
56
  loadable?: LoadableProps;
@@ -1,18 +1,19 @@
1
1
  import { MarkdownItPluginCb } from '@diplodoc/transform/lib/plugins/typings';
2
2
  import { Lang } from './types';
3
3
  export type ComplexItem = {
4
- [key: string]: string;
4
+ [key: string]: string | object;
5
5
  };
6
6
  export type Item = string | null | ComplexItem;
7
7
  export type Transformer = (text: string) => string;
8
8
  export type TransformerRaw = (lang: Lang, content: string, options: {
9
9
  plugins: MarkdownItPluginCb[];
10
+ renderInline?: boolean;
10
11
  }) => string;
11
12
  export type Parser<T = any> = (transformer: Transformer, block: T) => T;
12
13
  export declare const createItemsParser: (fields: string[]) => (transformer: Transformer, items: Item[]) => (string | {
13
- [x: string]: string;
14
+ [x: string]: string | object;
14
15
  } | null)[];
15
16
  export declare function yfmTransformer(lang: Lang, content: string, options?: {
16
17
  plugins?: MarkdownItPluginCb[];
17
- }): string;
18
+ }, renderInline?: boolean): string;
18
19
  export declare function typografTransformer(lang: Lang, content: string): string;
@@ -4,29 +4,52 @@ exports.typografTransformer = exports.yfmTransformer = exports.createItemsParser
4
4
  const tslib_1 = require("tslib");
5
5
  const plugins_1 = tslib_1.__importDefault(require("@diplodoc/transform/lib/plugins"));
6
6
  const utils_1 = require("./utils");
7
- const createItemsParser = (fields) => (transformer, items) => items.map((item) => {
8
- if (!item) {
9
- return item;
10
- }
11
- else if (typeof item === 'string') {
12
- return transformer(item);
13
- }
14
- else {
15
- return Object.assign(Object.assign({}, item), fields.reduce((acc, fieldName) => {
16
- if (item[fieldName]) {
17
- // eslint-disable-next-line no-param-reassign
18
- acc[fieldName] = transformer(item[fieldName]);
19
- }
20
- return acc;
21
- }, {}));
22
- }
23
- });
7
+ const createItemsParser = (fields) => (transformer, items) => {
8
+ const applyTransform = (itemLocal) => typeof itemLocal === 'string' ? transformer(itemLocal) : itemLocal;
9
+ return items.map((item) => {
10
+ if (!item) {
11
+ return item;
12
+ }
13
+ else if (typeof item === 'string') {
14
+ return transformer(item);
15
+ }
16
+ else {
17
+ return Object.assign(Object.assign({}, item), fields.reduce((acc, fieldName) => {
18
+ if (fieldName.includes('.')) {
19
+ const [firstProperty, secondProperty] = fieldName.split('.');
20
+ const root = item[firstProperty];
21
+ if (!root || typeof root !== 'object') {
22
+ return acc;
23
+ }
24
+ if (Array.isArray(root)) {
25
+ if (!acc[firstProperty]) {
26
+ // eslint-disable-next-line no-param-reassign
27
+ acc[firstProperty] = [];
28
+ }
29
+ // eslint-disable-next-line no-param-reassign
30
+ acc[firstProperty] = root.map((subItem) => (Object.assign(Object.assign({}, subItem), { [secondProperty]: applyTransform(subItem[secondProperty]) })));
31
+ }
32
+ else {
33
+ // eslint-disable-next-line no-param-reassign
34
+ acc[firstProperty] = Object.assign(Object.assign({}, root), { [secondProperty]: applyTransform(root[secondProperty]) });
35
+ }
36
+ }
37
+ else if (item[fieldName]) {
38
+ // eslint-disable-next-line no-param-reassign
39
+ acc[fieldName] = applyTransform(item[fieldName]);
40
+ }
41
+ return acc;
42
+ }, {}));
43
+ }
44
+ });
45
+ };
24
46
  exports.createItemsParser = createItemsParser;
25
- function yfmTransformer(lang, content, options = {}) {
47
+ function yfmTransformer(lang, content, options = {}, renderInline = false) {
26
48
  const { plugins = [] } = options;
27
49
  const { html } = (0, utils_1.fullTransform)(content, {
28
50
  lang,
29
51
  plugins: [...plugins_1.default, ...plugins],
52
+ renderInline,
30
53
  });
31
54
  return html;
32
55
  }
@@ -1,8 +1,8 @@
1
1
  import { TitleItemProps } from '../models';
2
- import { Parser, Transformer, TransformerRaw, typografTransformer, yfmTransformer } from './common';
2
+ import { Parser, Transformer, TransformerRaw, yfmTransformer } from './common';
3
3
  export declare const blockHeaderTransformer: ({
4
4
  fields: string[];
5
- transformer: typeof typografTransformer;
5
+ transformer: typeof yfmTransformer;
6
6
  parser: (transformer: Transformer, title: TitleItemProps | string) => string | {
7
7
  text: string;
8
8
  navTitle?: string | undefined;
@@ -14,15 +14,18 @@ export declare const blockHeaderTransformer: ({
14
14
  custom?: import("react").ReactNode;
15
15
  onClick?: (() => void) | undefined;
16
16
  };
17
+ renderInline: boolean;
17
18
  } | {
18
19
  fields: string[];
19
20
  transformer: typeof yfmTransformer;
20
21
  parser?: undefined;
22
+ renderInline?: undefined;
21
23
  })[];
22
24
  interface BlockConfig {
23
25
  transformer: TransformerRaw;
24
26
  fields?: string[];
25
27
  parser?: Parser;
28
+ renderInline?: boolean;
26
29
  }
27
30
  export type BlocksConfig = Record<string, BlockConfig | BlockConfig[]>;
28
31
  export declare const config: BlocksConfig;
@@ -6,10 +6,26 @@ exports.config = exports.blockHeaderTransformer = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  const models_1 = require("../models");
8
8
  const common_1 = require("./common");
9
- function parseTableBlock(transformer, content) {
9
+ function parseTableBlockLegend(transformer, content) {
10
10
  const legend = content === null || content === void 0 ? void 0 : content.legend;
11
11
  return Object.assign(Object.assign({}, (content || {})), { legend: legend && legend.map((string) => transformer(string)) });
12
12
  }
13
+ function parseTableBlockContent(transformer, content) {
14
+ const legend = content === null || content === void 0 ? void 0 : content.legend;
15
+ const tableContent = content === null || content === void 0 ? void 0 : content.content;
16
+ return Object.assign(Object.assign({}, (content || {})), { content: tableContent &&
17
+ tableContent.map((row, i) => row.map((cell, j) => {
18
+ if (legend) {
19
+ if (i === 0 || j === 0) {
20
+ return transformer(cell);
21
+ }
22
+ return cell;
23
+ }
24
+ else {
25
+ return transformer(cell);
26
+ }
27
+ })) });
28
+ }
13
29
  function parseFeatures(transformer, items) {
14
30
  return items.map((_a) => {
15
31
  var { title, text } = _a, rest = tslib_1.__rest(_a, ["title", "text"]);
@@ -84,8 +100,9 @@ function parseContentLayoutTitle(transformer, content) {
84
100
  exports.blockHeaderTransformer = [
85
101
  {
86
102
  fields: ['title'],
87
- transformer: common_1.typografTransformer,
103
+ transformer: common_1.yfmTransformer,
88
104
  parser: parseTitle,
105
+ renderInline: true,
89
106
  },
90
107
  {
91
108
  fields: ['description'],
@@ -142,26 +159,30 @@ exports.config = {
142
159
  ],
143
160
  [models_1.SubBlockType.Quote]: [
144
161
  {
145
- fields: ['text'],
146
- transformer: common_1.typografTransformer,
147
- },
148
- {
149
- fields: ['yfmText'],
162
+ fields: ['text', 'yfmText'],
150
163
  transformer: common_1.yfmTransformer,
164
+ renderInline: true,
151
165
  },
152
166
  ],
153
167
  [models_1.BlockType.ExtendedFeaturesBlock]: [
154
168
  ...exports.blockHeaderTransformer,
155
169
  {
156
170
  fields: ['items'],
157
- transformer: common_1.typografTransformer,
171
+ transformer: common_1.yfmTransformer,
158
172
  parser: (0, common_1.createItemsParser)(['title']),
173
+ renderInline: true,
159
174
  },
160
175
  {
161
176
  fields: ['items'],
162
177
  transformer: common_1.yfmTransformer,
163
178
  parser: (0, common_1.createItemsParser)(['text', 'additionalInfo']),
164
179
  },
180
+ {
181
+ fields: ['items'],
182
+ transformer: common_1.yfmTransformer,
183
+ parser: (0, common_1.createItemsParser)(['list.text']),
184
+ renderInline: true,
185
+ },
165
186
  ],
166
187
  [models_1.BlockType.PromoFeaturesBlock]: [
167
188
  ...exports.blockHeaderTransformer,
@@ -191,7 +212,8 @@ exports.config = {
191
212
  [models_1.BlockType.BannerBlock]: [
192
213
  {
193
214
  fields: ['title'],
194
- transformer: common_1.typografTransformer,
215
+ transformer: common_1.yfmTransformer,
216
+ renderInline: true,
195
217
  },
196
218
  {
197
219
  fields: ['subtitle'],
@@ -244,7 +266,13 @@ exports.config = {
244
266
  {
245
267
  fields: ['table'],
246
268
  transformer: common_1.yfmTransformer,
247
- parser: parseTableBlock,
269
+ parser: parseTableBlockLegend,
270
+ },
271
+ {
272
+ fields: ['table'],
273
+ transformer: common_1.yfmTransformer,
274
+ parser: parseTableBlockContent,
275
+ renderInline: true,
248
276
  },
249
277
  ],
250
278
  [models_1.BlockType.HeaderSliderBlock]: [
@@ -270,6 +298,11 @@ exports.config = {
270
298
  fields: ['description'],
271
299
  transformer: common_1.yfmTransformer,
272
300
  },
301
+ {
302
+ fields: ['overtitle', 'title'],
303
+ transformer: common_1.yfmTransformer,
304
+ renderInline: true,
305
+ },
273
306
  ],
274
307
  [models_1.BlockType.ContentLayoutBlock]: [
275
308
  {
@@ -323,7 +356,8 @@ exports.config = {
323
356
  [models_1.SubBlockType.PriceCard]: [
324
357
  {
325
358
  fields: ['title'],
326
- transformer: common_1.typografTransformer,
359
+ transformer: common_1.yfmTransformer,
360
+ renderInline: true,
327
361
  },
328
362
  {
329
363
  fields: ['list'],
@@ -22,10 +22,10 @@ function transformBlock(lang, blocksConfig, block, plugins) {
22
22
  if (blockConfig) {
23
23
  const configs = Array.isArray(blockConfig) ? blockConfig : [blockConfig];
24
24
  configs.forEach((transformConfig) => {
25
- const { fields, transformer: transformerRaw, parser } = transformConfig;
25
+ const { fields, transformer: transformerRaw, parser, renderInline } = transformConfig;
26
26
  const transformer = (content) =>
27
27
  // eslint-disable-next-line no-useless-call
28
- transformerRaw.call(null, lang, content, { plugins });
28
+ transformerRaw.call(null, lang, content, { plugins, renderInline });
29
29
  if (fields) {
30
30
  fields.forEach((field) => {
31
31
  if (block[field]) {
@@ -1,9 +1,10 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { Swiper } from 'swiper/react';
2
+ import { Swiper as SwiperReact } from 'swiper/react';
3
3
  import { ClassNameProps, Refable, SliderProps as SliderParams } from '../../models';
4
4
  import './Slider.css';
5
5
  import 'swiper/swiper-bundle.css';
6
- export interface SliderProps extends Omit<SliderParams, 'children'>, Partial<Pick<Swiper, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
6
+ export type { Swiper, SwiperOptions } from 'swiper';
7
+ export interface SliderProps extends Omit<SliderParams, 'children'>, Partial<Pick<SwiperReact, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
7
8
  type?: string;
8
9
  anchorId?: string;
9
10
  dotsClassName?: string;
@@ -1,6 +1,6 @@
1
1
  import React, { Fragment } from 'react';
2
- import SwiperCore, { A11y, Autoplay, Pagination } from 'swiper';
3
- import { Swiper, SwiperSlide } from 'swiper/react';
2
+ import Swiper, { A11y, Autoplay, Pagination } from 'swiper';
3
+ import { Swiper as SwiperReact, SwiperSlide } from 'swiper/react';
4
4
  import Anchor from '../../components/Anchor/Anchor';
5
5
  import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
6
6
  import Title from '../../components/Title/Title';
@@ -13,7 +13,7 @@ import { useSliderPagination } from './useSliderPagination';
13
13
  import './Slider.css';
14
14
  import 'swiper/swiper-bundle.css';
15
15
  const b = block('SliderBlock');
16
- SwiperCore.use([Autoplay, A11y, Pagination]);
16
+ Swiper.use([Autoplay, A11y, Pagination]);
17
17
  export const SliderBlock = ({ animated, title, description, type, anchorId, arrows = true, adaptive, autoplay: autoplayMs, dots = true, initialSlide = 0, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }) => {
18
18
  const { autoplay, isLocked, childrenCount, breakpoints, onSwiper, onImagesReady, onPrev, onNext, setIsLocked, } = useSlider({
19
19
  slidesToShow,
@@ -40,7 +40,7 @@ export const SliderBlock = ({ animated, title, description, type, anchorId, arro
40
40
  anchorId && React.createElement(Anchor, { id: anchorId }),
41
41
  React.createElement(Title, { title: title, subtitle: description, className: b('header', { 'no-description': !description }) }),
42
42
  React.createElement(AnimateBlock, { className: b('animate-slides'), animate: animated },
43
- React.createElement(Swiper, Object.assign({ className: b('slider', className), onSwiper: onSwiper, speed: 1000, autoplay: autoplay, autoHeight: adaptive, initialSlide: initialSlide, noSwiping: false, breakpoints: breakpoints, onSlideChange: onSlideChange, onSlideChangeTransitionStart: onSlideChangeTransitionStart, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onActiveIndexChange: onActiveIndexChange, onBreakpoint: onBreakpoint, onLock: () => setIsLocked(true), onUnlock: () => setIsLocked(false), onImagesReady: onImagesReady, watchSlidesVisibility: true, watchOverflow: true, a11y: {
43
+ React.createElement(SwiperReact, Object.assign({ className: b('slider', className), onSwiper: onSwiper, speed: 1000, autoplay: autoplay, autoHeight: adaptive, initialSlide: initialSlide, noSwiping: false, breakpoints: breakpoints, onSlideChange: onSlideChange, onSlideChangeTransitionStart: onSlideChangeTransitionStart, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onActiveIndexChange: onActiveIndexChange, onBreakpoint: onBreakpoint, onLock: () => setIsLocked(true), onUnlock: () => setIsLocked(false), onImagesReady: onImagesReady, watchSlidesVisibility: true, watchOverflow: true, a11y: {
44
44
  slideLabelMessage: '',
45
45
  paginationBulletMessage: i18n('dot-label', { index: '{{index}}' }),
46
46
  } }, paginationProps), React.Children.map(children, (elem, index) => (React.createElement(SwiperSlide, { className: b('slide'), key: index }, ({ isVisible }) => (React.createElement("div", { className: b('slide-item'), "aria-hidden": !isA11yControlHidden && !isVisible }, elem)))))),
@@ -69,7 +69,16 @@ export declare const SliderProps: {
69
69
  type: string;
70
70
  patternProperties: {
71
71
  '.*': {
72
- type: string[];
72
+ oneOf: ({
73
+ type: string[];
74
+ additionalProperties?: undefined;
75
+ } | {
76
+ type: string;
77
+ additionalProperties: boolean;
78
+ } | {
79
+ type: string;
80
+ additionalProperties?: undefined;
81
+ })[];
73
82
  };
74
83
  };
75
84
  };
@@ -193,7 +202,16 @@ export declare const SliderBlock: {
193
202
  type: string;
194
203
  patternProperties: {
195
204
  '.*': {
196
- type: string[];
205
+ oneOf: ({
206
+ type: string[];
207
+ additionalProperties?: undefined;
208
+ } | {
209
+ type: string;
210
+ additionalProperties: boolean;
211
+ } | {
212
+ type: string;
213
+ additionalProperties?: undefined;
214
+ })[];
197
215
  };
198
216
  };
199
217
  };
@@ -18,7 +18,18 @@ const LoadableProps = {
18
18
  type: 'object',
19
19
  patternProperties: {
20
20
  '.*': {
21
- type: ['string', 'number', 'boolean'],
21
+ oneOf: [
22
+ {
23
+ type: ['string', 'number', 'boolean'],
24
+ },
25
+ {
26
+ type: 'object',
27
+ additionalProperties: true,
28
+ },
29
+ {
30
+ type: 'array',
31
+ },
32
+ ],
22
33
  },
23
34
  },
24
35
  },
@@ -60,7 +60,16 @@ export declare const SliderOldProps: {
60
60
  type: string;
61
61
  patternProperties: {
62
62
  '.*': {
63
- type: string[];
63
+ oneOf: ({
64
+ type: string[];
65
+ additionalProperties?: undefined;
66
+ } | {
67
+ type: string;
68
+ additionalProperties: boolean;
69
+ } | {
70
+ type: string;
71
+ additionalProperties?: undefined;
72
+ })[];
64
73
  };
65
74
  };
66
75
  };
@@ -176,7 +185,16 @@ export declare const SliderOldBlock: {
176
185
  type: string;
177
186
  patternProperties: {
178
187
  '.*': {
179
- type: string[];
188
+ oneOf: ({
189
+ type: string[];
190
+ additionalProperties?: undefined;
191
+ } | {
192
+ type: string;
193
+ additionalProperties: boolean;
194
+ } | {
195
+ type: string;
196
+ additionalProperties?: undefined;
197
+ })[];
180
198
  };
181
199
  };
182
200
  };
@@ -18,7 +18,18 @@ const LoadableProps = {
18
18
  type: 'object',
19
19
  patternProperties: {
20
20
  '.*': {
21
- type: ['string', 'number', 'boolean'],
21
+ oneOf: [
22
+ {
23
+ type: ['string', 'number', 'boolean'],
24
+ },
25
+ {
26
+ type: 'object',
27
+ additionalProperties: true,
28
+ },
29
+ {
30
+ type: 'array',
31
+ },
32
+ ],
22
33
  },
23
34
  },
24
35
  },
@@ -5,6 +5,7 @@ export { default as MediaBlock } from './Media/Media';
5
5
  export { default as MapBlock } from './Map/Map';
6
6
  export { default as SliderOldBlock } from './SliderOld/SliderOld';
7
7
  export { default as SliderBlock } from './Slider/Slider';
8
+ export type { Swiper, SwiperOptions } from './Slider/Slider';
8
9
  export { default as ExtendedFeaturesBlock } from './ExtendedFeatures/ExtendedFeatures';
9
10
  export { default as PromoFeaturesBlock } from './PromoFeaturesBlock/PromoFeaturesBlock';
10
11
  export { default as QuestionsBlock } from './Questions/Questions';
@@ -50,7 +50,7 @@ export interface LoadableProps {
50
50
  * @deprecated Will be moved to params
51
51
  */
52
52
  serviceId?: number;
53
- params?: Record<string, string | number | boolean>;
53
+ params?: Record<string, string | number | boolean | object>;
54
54
  }
55
55
  export interface LoadableChildren {
56
56
  loadable?: LoadableProps;
@@ -1,18 +1,19 @@
1
1
  import { MarkdownItPluginCb } from '@diplodoc/transform/lib/plugins/typings';
2
2
  import { Lang } from './types';
3
3
  export type ComplexItem = {
4
- [key: string]: string;
4
+ [key: string]: string | object;
5
5
  };
6
6
  export type Item = string | null | ComplexItem;
7
7
  export type Transformer = (text: string) => string;
8
8
  export type TransformerRaw = (lang: Lang, content: string, options: {
9
9
  plugins: MarkdownItPluginCb[];
10
+ renderInline?: boolean;
10
11
  }) => string;
11
12
  export type Parser<T = any> = (transformer: Transformer, block: T) => T;
12
13
  export declare const createItemsParser: (fields: string[]) => (transformer: Transformer, items: Item[]) => (string | {
13
- [x: string]: string;
14
+ [x: string]: string | object;
14
15
  } | null)[];
15
16
  export declare function yfmTransformer(lang: Lang, content: string, options?: {
16
17
  plugins?: MarkdownItPluginCb[];
17
- }): string;
18
+ }, renderInline?: boolean): string;
18
19
  export declare function typografTransformer(lang: Lang, content: string): string;