@gravity-ui/page-constructor 8.7.0 → 8.8.0-alpha.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.
Files changed (35) hide show
  1. package/build/cjs/blocks/HeaderSlider/schema.d.ts +1 -3
  2. package/build/cjs/blocks/Hero/Hero.css +1 -1
  3. package/build/cjs/blocks/Slider/schema.d.ts +48 -52
  4. package/build/cjs/blocks/Slider/schema.js +1 -1
  5. package/build/cjs/blocks/Slider/schema.js.map +1 -1
  6. package/build/cjs/blocks/SliderOld/schema.d.ts +30 -34
  7. package/build/cjs/blocks/SliderOld/schema.js +1 -1
  8. package/build/cjs/blocks/SliderOld/schema.js.map +1 -1
  9. package/build/cjs/context/windowWidthContext/WindowWidthContext.js +6 -3
  10. package/build/cjs/context/windowWidthContext/WindowWidthContext.js.map +1 -1
  11. package/build/cjs/demo/ComponentsText.stories.js +1 -1
  12. package/build/cjs/demo/ComponentsText.stories.js.map +1 -1
  13. package/build/cjs/schema/constants.d.ts +81 -0
  14. package/build/cjs/sub-blocks/ImageCard/schema.d.ts +81 -0
  15. package/build/cjs/sub-blocks/ImageCard/schema.js +14 -0
  16. package/build/cjs/sub-blocks/ImageCard/schema.js.map +1 -1
  17. package/build/esm/blocks/HeaderSlider/schema.d.ts +1 -3
  18. package/build/esm/blocks/Hero/Hero.css +1 -1
  19. package/build/esm/blocks/Slider/schema.d.ts +48 -52
  20. package/build/esm/blocks/Slider/schema.js +1 -1
  21. package/build/esm/blocks/Slider/schema.js.map +1 -1
  22. package/build/esm/blocks/SliderOld/schema.d.ts +30 -34
  23. package/build/esm/blocks/SliderOld/schema.js +1 -1
  24. package/build/esm/blocks/SliderOld/schema.js.map +1 -1
  25. package/build/esm/context/windowWidthContext/WindowWidthContext.js +6 -3
  26. package/build/esm/context/windowWidthContext/WindowWidthContext.js.map +1 -1
  27. package/build/esm/demo/ComponentsText.stories.js +1 -1
  28. package/build/esm/demo/ComponentsText.stories.js.map +1 -1
  29. package/build/esm/schema/constants.d.ts +81 -0
  30. package/build/esm/sub-blocks/ImageCard/schema.d.ts +81 -0
  31. package/build/esm/sub-blocks/ImageCard/schema.js +14 -0
  32. package/build/esm/sub-blocks/ImageCard/schema.js.map +1 -1
  33. package/package.json +1 -1
  34. package/schema/index.js +1 -1
  35. package/widget/index.js +1 -1
@@ -1,30 +1,4 @@
1
1
  export declare const SliderProps: {
2
- dots: {
3
- type: string;
4
- };
5
- arrows: {
6
- type: string;
7
- };
8
- randomOrder: {
9
- type: string;
10
- };
11
- autoplay: {
12
- type: string;
13
- };
14
- type: {
15
- type: string;
16
- };
17
- adaptive: {
18
- type: string;
19
- };
20
- arrowSize: {
21
- type: string;
22
- };
23
- animated: {
24
- animated: {
25
- type: string;
26
- };
27
- };
28
2
  slidesToShow: {
29
3
  oneOf: ({
30
4
  type: string;
@@ -91,6 +65,30 @@ export declare const SliderProps: {
91
65
  $ref: string;
92
66
  };
93
67
  };
68
+ animated: {
69
+ type: string;
70
+ };
71
+ dots: {
72
+ type: string;
73
+ };
74
+ arrows: {
75
+ type: string;
76
+ };
77
+ randomOrder: {
78
+ type: string;
79
+ };
80
+ autoplay: {
81
+ type: string;
82
+ };
83
+ type: {
84
+ type: string;
85
+ };
86
+ adaptive: {
87
+ type: string;
88
+ };
89
+ arrowSize: {
90
+ type: string;
91
+ };
94
92
  };
95
93
  export declare const SliderBlock: {
96
94
  'slider-block': {
@@ -210,32 +208,6 @@ export declare const SliderBlock: {
210
208
  contentType: string;
211
209
  inputType: string;
212
210
  };
213
- dots: {
214
- type: string;
215
- };
216
- arrows: {
217
- type: string;
218
- };
219
- randomOrder: {
220
- type: string;
221
- };
222
- autoplay: {
223
- type: string;
224
- };
225
- type: {
226
- type: string;
227
- };
228
- adaptive: {
229
- type: string;
230
- };
231
- arrowSize: {
232
- type: string;
233
- };
234
- animated: {
235
- animated: {
236
- type: string;
237
- };
238
- };
239
211
  slidesToShow: {
240
212
  oneOf: ({
241
213
  type: string;
@@ -302,6 +274,30 @@ export declare const SliderBlock: {
302
274
  $ref: string;
303
275
  };
304
276
  };
277
+ animated: {
278
+ type: string;
279
+ };
280
+ dots: {
281
+ type: string;
282
+ };
283
+ arrows: {
284
+ type: string;
285
+ };
286
+ randomOrder: {
287
+ type: string;
288
+ };
289
+ autoplay: {
290
+ type: string;
291
+ };
292
+ type: {
293
+ type: string;
294
+ };
295
+ adaptive: {
296
+ type: string;
297
+ };
298
+ arrowSize: {
299
+ type: string;
300
+ };
305
301
  anchor: {
306
302
  type: string;
307
303
  additionalProperties: boolean;
@@ -73,7 +73,7 @@ export const SliderProps = {
73
73
  arrowSize: {
74
74
  type: 'number',
75
75
  },
76
- animated: AnimatableProps,
76
+ ...AnimatableProps,
77
77
  slidesToShow: sliderSizesObject,
78
78
  disclaimer: DisclaimerProps,
79
79
  loadable: LoadableProps,
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Slider/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,GACX,0CAAuC;AAExC,MAAM,aAAa,GAAG;IAClB,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,0DAA0D;YAC1D,0DAA0D;SAC7D;QACD;;WAEG;QACH,QAAQ,EAAE;YACN,IAAI,EAAE,QAAQ;SACjB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,iBAAiB,EAAE;gBACf,IAAI,EAAE;oBACF,KAAK,EAAE;wBACH;4BACI,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;yBACxC;wBACD;4BACI,IAAI,EAAE,QAAQ;4BACd,oBAAoB,EAAE,IAAI;yBAC7B;wBACD;4BACI,IAAI,EAAE,OAAO;yBAChB;qBACJ;iBACJ;aACJ;SACJ;KACJ;IACD,gEAAgE;IAChE,QAAQ,EAAE,IAAI;CACjB,CAAC;AAEF,MAAM,eAAe,GAAG;IACpB,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,UAAU,EAAE;QACR,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,MAAM;SACtB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACjB;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;KAClB;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,SAAS;KAClB;IACD,WAAW,EAAE;QACT,IAAI,EAAE,SAAS;KAClB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,QAAQ;KACjB;IACD,IAAI,EAAE;QACF,IAAI,EAAE,QAAQ;KACjB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,SAAS;KAClB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,QAAQ;KACjB;IACD,QAAQ,EAAE,eAAe;IACzB,YAAY,EAAE,iBAAiB;IAC/B,UAAU,EAAE,eAAe;IAC3B,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,kBAAkB;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,cAAc,EAAE;QACZ,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE;YACR,GAAG,cAAc;YACjB,GAAG,eAAe;YAClB,GAAG,WAAW;YACd,GAAG,gBAAgB;SACtB;KACJ;CACJ,CAAC","sourcesContent":["import {\n AnimatableProps,\n BlockBaseProps,\n BlockHeaderProps,\n ChildrenCardsProps,\n sliderSizesObject,\n textSize,\n} from '../../schema/validators/common';\n\nconst LoadableProps = {\n additionalProperties: false,\n required: ['source'],\n properties: {\n source: {\n type: 'string',\n // add loadable sources here if you use it in your project\n // enum: ['my-loadable-source-1', 'my-loadable-source-1'],\n },\n /**\n * @deprecated\n */\n minCount: {\n type: 'number',\n },\n params: {\n type: 'object',\n patternProperties: {\n '.*': {\n oneOf: [\n {\n type: ['string', 'number', 'boolean'],\n },\n {\n type: 'object',\n additionalProperties: true,\n },\n {\n type: 'array',\n },\n ],\n },\n },\n },\n },\n // remove it in your custom validator schema if you use loadable\n disabled: true,\n};\n\nconst DisclaimerProps = {\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: {\n type: 'string',\n contentType: 'text',\n },\n size: {\n type: 'string',\n enum: textSize,\n },\n },\n};\n\nexport const SliderProps = {\n dots: {\n type: 'boolean',\n },\n arrows: {\n type: 'boolean',\n },\n randomOrder: {\n type: 'boolean',\n },\n autoplay: {\n type: 'number',\n },\n type: {\n type: 'string',\n },\n adaptive: {\n type: 'boolean',\n },\n arrowSize: {\n type: 'number',\n },\n animated: AnimatableProps,\n slidesToShow: sliderSizesObject,\n disclaimer: DisclaimerProps,\n loadable: LoadableProps,\n children: ChildrenCardsProps,\n};\n\nexport const SliderBlock = {\n 'slider-block': {\n additionalProperties: false,\n required: [],\n properties: {\n ...BlockBaseProps,\n ...AnimatableProps,\n ...SliderProps,\n ...BlockHeaderProps,\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Slider/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,GACX,0CAAuC;AAExC,MAAM,aAAa,GAAG;IAClB,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,0DAA0D;YAC1D,0DAA0D;SAC7D;QACD;;WAEG;QACH,QAAQ,E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AE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE;YACR,GAAG,cAAc;YACjB,GAAG,eAAe;YAClB,GAAG,WAAW;YACd,GAAG,gBAAgB;SACtB;KACJ;CACJ,CAAC","sourcesContent":["import {\n AnimatableProps,\n BlockBaseProps,\n BlockHeaderProps,\n ChildrenCardsProps,\n sliderSizesObject,\n textSize,\n} from '../../schema/validators/common';\n\nconst LoadableProps = {\n additionalProperties: false,\n required: ['source'],\n properties: {\n source: {\n type: 'string',\n // add loadable sources here if you use it in your project\n // enum: ['my-loadable-source-1', 'my-loadable-source-1'],\n },\n /**\n * @deprecated\n */\n minCount: {\n type: 'number',\n },\n params: {\n type: 'object',\n patternProperties: {\n '.*': {\n oneOf: [\n {\n type: ['string', 'number', 'boolean'],\n },\n {\n type: 'object',\n additionalProperties: true,\n },\n {\n type: 'array',\n },\n ],\n },\n },\n },\n },\n // remove it in your custom validator schema if you use loadable\n disabled: true,\n};\n\nconst DisclaimerProps = {\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: {\n type: 'string',\n contentType: 'text',\n },\n size: {\n type: 'string',\n enum: textSize,\n },\n },\n};\n\nexport const SliderProps = {\n dots: {\n type: 'boolean',\n },\n arrows: {\n type: 'boolean',\n },\n randomOrder: {\n type: 'boolean',\n },\n autoplay: {\n type: 'number',\n },\n type: {\n type: 'string',\n },\n adaptive: {\n type: 'boolean',\n },\n arrowSize: {\n type: 'number',\n },\n ...AnimatableProps,\n slidesToShow: sliderSizesObject,\n disclaimer: DisclaimerProps,\n loadable: LoadableProps,\n children: ChildrenCardsProps,\n};\n\nexport const SliderBlock = {\n 'slider-block': {\n additionalProperties: false,\n required: [],\n properties: {\n ...BlockBaseProps,\n ...AnimatableProps,\n ...SliderProps,\n ...BlockHeaderProps,\n },\n },\n};\n"]}
@@ -1,21 +1,4 @@
1
1
  export declare const SliderOldProps: {
2
- dots: {
3
- type: string;
4
- };
5
- arrows: {
6
- type: string;
7
- };
8
- randomOrder: {
9
- type: string;
10
- };
11
- autoplay: {
12
- type: string;
13
- };
14
- animated: {
15
- animated: {
16
- type: string;
17
- };
18
- };
19
2
  slidesToShow: {
20
3
  oneOf: ({
21
4
  type: string;
@@ -82,6 +65,21 @@ export declare const SliderOldProps: {
82
65
  $ref: string;
83
66
  };
84
67
  };
68
+ animated: {
69
+ type: string;
70
+ };
71
+ dots: {
72
+ type: string;
73
+ };
74
+ arrows: {
75
+ type: string;
76
+ };
77
+ randomOrder: {
78
+ type: string;
79
+ };
80
+ autoplay: {
81
+ type: string;
82
+ };
85
83
  };
86
84
  /** @deprecated */
87
85
  export declare const SliderOldBlock: {
@@ -202,23 +200,6 @@ export declare const SliderOldBlock: {
202
200
  contentType: string;
203
201
  inputType: string;
204
202
  };
205
- dots: {
206
- type: string;
207
- };
208
- arrows: {
209
- type: string;
210
- };
211
- randomOrder: {
212
- type: string;
213
- };
214
- autoplay: {
215
- type: string;
216
- };
217
- animated: {
218
- animated: {
219
- type: string;
220
- };
221
- };
222
203
  slidesToShow: {
223
204
  oneOf: ({
224
205
  type: string;
@@ -285,6 +266,21 @@ export declare const SliderOldBlock: {
285
266
  $ref: string;
286
267
  };
287
268
  };
269
+ animated: {
270
+ type: string;
271
+ };
272
+ dots: {
273
+ type: string;
274
+ };
275
+ arrows: {
276
+ type: string;
277
+ };
278
+ randomOrder: {
279
+ type: string;
280
+ };
281
+ autoplay: {
282
+ type: string;
283
+ };
288
284
  anchor: {
289
285
  type: string;
290
286
  additionalProperties: boolean;
@@ -64,7 +64,7 @@ export const SliderOldProps = {
64
64
  autoplay: {
65
65
  type: 'number',
66
66
  },
67
- animated: AnimatableProps,
67
+ ...AnimatableProps,
68
68
  slidesToShow: sliderSizesObject,
69
69
  disclaimer: DisclaimerProps,
70
70
  loadable: LoadableProps,
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/SliderOld/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf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AAU,EAAE,eAAe;IAC3B,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,kBAAkB;CAC/B,CAAC;AAEF,kBAAkB;AAClB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,kBAAkB,EAAE;QAChB,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE;YACR,GAAG,cAAc;YACjB,GAAG,eAAe;YAClB,GAAG,cAAc;YACjB,GAAG,gBAAgB;SACtB;KACJ;CACJ,CAAC","sourcesContent":["import {\n AnimatableProps,\n BlockBaseProps,\n BlockHeaderProps,\n ChildrenCardsProps,\n sliderSizesObject,\n textSize,\n} from '../../schema/validators/common';\n\nconst LoadableProps = {\n additionalProperties: false,\n required: ['source'],\n properties: {\n source: {\n type: 'string',\n // add loadable sources here if you use it in your project\n // enum: ['my-loadable-source-1', 'my-loadable-source-1'],\n },\n /**\n * @deprecated\n */\n minCount: {\n type: 'number',\n },\n params: {\n type: 'object',\n patternProperties: {\n '.*': {\n oneOf: [\n {\n type: ['string', 'number', 'boolean'],\n },\n {\n type: 'object',\n additionalProperties: true,\n },\n {\n type: 'array',\n },\n ],\n },\n },\n },\n },\n // remove it in your custom validator schema if you use loadable\n disabled: true,\n};\n\nconst DisclaimerProps = {\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: {\n type: 'string',\n contentType: 'text',\n },\n size: {\n type: 'string',\n enum: textSize,\n },\n },\n};\n\nexport const SliderOldProps = {\n dots: {\n type: 'boolean',\n },\n arrows: {\n type: 'boolean',\n },\n randomOrder: {\n type: 'boolean',\n },\n autoplay: {\n type: 'number',\n },\n animated: AnimatableProps,\n slidesToShow: sliderSizesObject,\n disclaimer: DisclaimerProps,\n loadable: LoadableProps,\n children: ChildrenCardsProps,\n};\n\n/** @deprecated */\nexport const SliderOldBlock = {\n 'slider-old-block': {\n additionalProperties: false,\n required: [],\n properties: {\n ...BlockBaseProps,\n ...AnimatableProps,\n ...SliderOldProps,\n ...BlockHeaderProps,\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/SliderOld/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,GACX,0CAAuC;AAExC,MAAM,aAAa,GAAG;IAClB,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,0DAA0D;YAC1D,0DAA0D;SAC7D;QACD;;WAEG;QACH,QAAQ,EAAE;YACN,IAAI,EAAE,QAAQ;SACjB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,iBAAiB,EAAE;gBACf,IAAI,EAAE;oBACF,KAAK,EAAE;wBACH;4BACI,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;yBACxC;wBACD;4BACI,IAAI,EAAE,QAAQ;4BACd,oBAAoB,EAAE,IAAI;yBAC7B;wBACD;4BACI,IAAI,EAAE,OAAO;yBAChB;qBACJ;iBACJ;aACJ;SACJ;KACJ;IACD,gEAAgE;IAChE,QAAQ,EAAE,IAAI;CACjB,CAAC;AAEF,MAAM,eAAe,GAAG;IACpB,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,UAAU,EAAE;QACR,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,MAAM;SACtB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACjB;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;KAClB;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,SAAS;KAClB;IACD,WAAW,EAAE;QACT,IAAI,EAAE,SAAS;KAClB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,QAAQ;KACjB;IACD,GAAG,eAAe;IAClB,YAAY,EAAE,iBAAiB;IAC/B,UAAU,EAAE,eAAe;IAC3B,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,kBAAkB;CAC/B,CAAC;AAEF,kBAAkB;AAClB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,kBAAkB,EAAE;QAChB,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE;YACR,GAAG,cAAc;YACjB,GAAG,eAAe;YAClB,GAAG,cAAc;YACjB,GAAG,gBAAgB;SACtB;KACJ;CACJ,CAAC","sourcesContent":["import {\n AnimatableProps,\n BlockBaseProps,\n BlockHeaderProps,\n ChildrenCardsProps,\n sliderSizesObject,\n textSize,\n} from '../../schema/validators/common';\n\nconst LoadableProps = {\n additionalProperties: false,\n required: ['source'],\n properties: {\n source: {\n type: 'string',\n // add loadable sources here if you use it in your project\n // enum: ['my-loadable-source-1', 'my-loadable-source-1'],\n },\n /**\n * @deprecated\n */\n minCount: {\n type: 'number',\n },\n params: {\n type: 'object',\n patternProperties: {\n '.*': {\n oneOf: [\n {\n type: ['string', 'number', 'boolean'],\n },\n {\n type: 'object',\n additionalProperties: true,\n },\n {\n type: 'array',\n },\n ],\n },\n },\n },\n },\n // remove it in your custom validator schema if you use loadable\n disabled: true,\n};\n\nconst DisclaimerProps = {\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: {\n type: 'string',\n contentType: 'text',\n },\n size: {\n type: 'string',\n enum: textSize,\n },\n },\n};\n\nexport const SliderOldProps = {\n dots: {\n type: 'boolean',\n },\n arrows: {\n type: 'boolean',\n },\n randomOrder: {\n type: 'boolean',\n },\n autoplay: {\n type: 'number',\n },\n ...AnimatableProps,\n slidesToShow: sliderSizesObject,\n disclaimer: DisclaimerProps,\n loadable: LoadableProps,\n children: ChildrenCardsProps,\n};\n\n/** @deprecated */\nexport const SliderOldBlock = {\n 'slider-old-block': {\n additionalProperties: false,\n required: [],\n properties: {\n ...BlockBaseProps,\n ...AnimatableProps,\n ...SliderOldProps,\n ...BlockHeaderProps,\n },\n },\n};\n"]}
@@ -2,11 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import throttle from "lodash/throttle.js";
4
4
  import { BREAKPOINTS } from "../../constants.js";
5
- const DEFAULT_WIDTH = BREAKPOINTS.xl;
5
+ import { MobileContext } from "../mobileContext/index.js";
6
+ const DEFAULT_DESKTOP_WIDTH = BREAKPOINTS.xl;
7
+ const DEFAULT_MOBILE_WIDTH = BREAKPOINTS.sm;
6
8
  const UPDATE_FREQUENCY_MS = 100;
7
- export const WindowWidthContext = React.createContext(DEFAULT_WIDTH);
9
+ export const WindowWidthContext = React.createContext(DEFAULT_DESKTOP_WIDTH);
8
10
  export const WindowWidthProvider = ({ children }) => {
9
- const [windowWidth, setWindowWidth] = React.useState(DEFAULT_WIDTH);
11
+ const isMobile = React.useContext(MobileContext);
12
+ const [windowWidth, setWindowWidth] = React.useState(isMobile ? DEFAULT_MOBILE_WIDTH : DEFAULT_DESKTOP_WIDTH);
10
13
  React.useEffect(() => {
11
14
  const handleResize = throttle(() => {
12
15
  setWindowWidth(window.innerWidth);
@@ -1 +1 @@
1
- {"version":3,"file":"WindowWidthContext.js","sourceRoot":"../../../../src","sources":["context/windowWidthContext/WindowWidthContext.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,QAAQ,2BAAwB;AAEvC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,MAAM,aAAa,GAAG,WAAW,CAAC,EAAE,CAAC;AACrC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAS,aAAa,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAC,QAAQ,EAA0B,EAAE,EAAE;IACvE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEpE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,MAAM,YAAY,GAAG,QAAQ,CACzB,GAAG,EAAE;YACD,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACtC,CAAC,EACD,mBAAmB,EACnB,EAAC,OAAO,EAAE,IAAI,EAAC,CAClB,CAAC;QAEF,YAAY,EAAE,CAAC;QAEf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QAEjE,6CAA6C;QAC7C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,WAAW,YAAG,QAAQ,GAA+B,CAC5F,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport throttle from 'lodash/throttle';\n\nimport {BREAKPOINTS} from '../../constants';\n\nconst DEFAULT_WIDTH = BREAKPOINTS.xl;\nconst UPDATE_FREQUENCY_MS = 100;\n\nexport const WindowWidthContext = React.createContext<number>(DEFAULT_WIDTH);\n\nexport const WindowWidthProvider = ({children}: React.PropsWithChildren) => {\n const [windowWidth, setWindowWidth] = React.useState(DEFAULT_WIDTH);\n\n React.useEffect(() => {\n const handleResize = throttle(\n () => {\n setWindowWidth(window.innerWidth);\n },\n UPDATE_FREQUENCY_MS,\n {leading: true},\n );\n\n handleResize();\n\n window.addEventListener('resize', handleResize, {passive: true});\n\n // eslint-disable-next-line consistent-return\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return (\n <WindowWidthContext.Provider value={windowWidth}>{children}</WindowWidthContext.Provider>\n );\n};\n\nexport const useWindowWidth = () => React.useContext(WindowWidthContext);\n"]}
1
+ {"version":3,"file":"WindowWidthContext.js","sourceRoot":"../../../../src","sources":["context/windowWidthContext/WindowWidthContext.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,QAAQ,2BAAwB;AAEvC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,aAAa,EAAC,kCAAyB;AAE/C,MAAM,qBAAqB,GAAG,WAAW,CAAC,EAAE,CAAC;AAC7C,MAAM,oBAAoB,GAAG,WAAW,CAAC,EAAE,CAAC;AAC5C,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAS,qBAAqB,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAC,QAAQ,EAA0B,EAAE,EAAE;IACvE,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAChD,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAC1D,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,MAAM,YAAY,GAAG,QAAQ,CACzB,GAAG,EAAE;YACD,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACtC,CAAC,EACD,mBAAmB,EACnB,EAAC,OAAO,EAAE,IAAI,EAAC,CAClB,CAAC;QAEF,YAAY,EAAE,CAAC;QAEf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QAEjE,6CAA6C;QAC7C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,WAAW,YAAG,QAAQ,GAA+B,CAC5F,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport throttle from 'lodash/throttle';\n\nimport {BREAKPOINTS} from '../../constants';\nimport {MobileContext} from '../mobileContext';\n\nconst DEFAULT_DESKTOP_WIDTH = BREAKPOINTS.xl;\nconst DEFAULT_MOBILE_WIDTH = BREAKPOINTS.sm;\nconst UPDATE_FREQUENCY_MS = 100;\n\nexport const WindowWidthContext = React.createContext<number>(DEFAULT_DESKTOP_WIDTH);\n\nexport const WindowWidthProvider = ({children}: React.PropsWithChildren) => {\n const isMobile = React.useContext(MobileContext);\n const [windowWidth, setWindowWidth] = React.useState(\n isMobile ? DEFAULT_MOBILE_WIDTH : DEFAULT_DESKTOP_WIDTH,\n );\n\n React.useEffect(() => {\n const handleResize = throttle(\n () => {\n setWindowWidth(window.innerWidth);\n },\n UPDATE_FREQUENCY_MS,\n {leading: true},\n );\n\n handleResize();\n\n window.addEventListener('resize', handleResize, {passive: true});\n\n // eslint-disable-next-line consistent-return\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return (\n <WindowWidthContext.Provider value={windowWidth}>{children}</WindowWidthContext.Provider>\n );\n};\n\nexport const useWindowWidth = () => React.useContext(WindowWidthContext);\n"]}
@@ -17,5 +17,5 @@ const defaultTitleArgs = {
17
17
  subtitle: yfmTransform(titleData.default.subtitle),
18
18
  };
19
19
  const transformContentList = (item) => blockTransform(item);
20
- export const Default = () => (_jsxs("div", { style: { padding: '40px', display: 'flex', flexDirection: 'column', gap: '48px' }, children: [_jsxs("section", { children: [_jsx("strong", { children: "Title \u2014 default" }), _jsx(Title, { ...defaultTitleArgs })] }), _jsxs("section", { children: [_jsx("strong", { children: "Title \u2014 sizes (l \u2192 xs)" }), _jsx("div", { children: Object.entries(titleData.sizes).map(([size, props]) => (_jsx("div", { style: { paddingBottom: '32px' }, children: _jsx(Title, { ...defaultTitleArgs, title: props }) }, size))) })] }), _jsxs("section", { children: [_jsx("strong", { children: "Title \u2014 with link" }), _jsx(Title, { ...defaultTitleArgs, title: titleData.titleLink.title })] }), _jsxs("section", { children: [_jsx("strong", { children: "YFMWrapper" }), _jsx(YFMWrapper, { ...yfmWrapperData.default.content })] }), _jsxs("section", { children: [_jsx("strong", { children: "Author \u2014 column" }), _jsx(Author, { ...authorData.default.content })] }), _jsxs("section", { children: [_jsx("strong", { children: "Author \u2014 line" }), _jsx(Author, { ...authorData.default.content, type: AuthorType.Line })] }), _jsxs("section", { children: [_jsx("strong", { children: "ContentList \u2014 default" }), _jsx(ContentList, { ...transformContentList(contentListData.default) })] }), _jsxs("section", { children: [_jsx("strong", { children: "ContentList \u2014 without icon" }), _jsx(ContentList, { ...transformContentList(contentListData.withoutIcon) })] }), _jsxs("section", { children: [_jsx("strong", { children: "ContentList \u2014 sizes (s / m / l)" }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '16px' }, children: contentListData.sizes.map((item, index) => (_jsx(ContentList, { ...transformContentList(item) }, index))) })] }), _jsxs("section", { children: [_jsx("strong", { children: "MetaInfo" }), _jsx(MetaInfo, { ...metaInfoData.default.content })] })] }));
20
+ export const Default = () => (_jsxs("div", { style: { padding: '40px', display: 'flex', flexDirection: 'column', gap: '48px' }, children: [_jsxs("section", { children: [_jsx("strong", { children: "Title \u2014 default" }), _jsx(Title, { ...defaultTitleArgs })] }), _jsxs("section", { children: [_jsx("strong", { children: "Title \u2014 sizes (l \u2192 xs)" }), _jsx("div", { children: Object.entries(titleData.sizes).map(([size, props]) => (_jsx("div", { style: { paddingBottom: '32px' }, children: _jsx(Title, { ...defaultTitleArgs, title: props }) }, size))) })] }), _jsxs("section", { children: [_jsx("strong", { children: "Title \u2014 with link" }), _jsx(Title, { ...defaultTitleArgs, title: titleData.titleLink.title })] }), _jsxs("section", { children: [_jsx("strong", { children: "YFMWrapper" }), _jsx(YFMWrapper, { ...yfmWrapperData.default.content })] }), _jsxs("section", { children: [_jsx("strong", { children: "Author \u2014 column" }), _jsx(Author, { ...authorData.default })] }), _jsxs("section", { children: [_jsx("strong", { children: "Author \u2014 line" }), _jsx(Author, { ...authorData.default, type: AuthorType.Line })] }), _jsxs("section", { children: [_jsx("strong", { children: "ContentList \u2014 default" }), _jsx(ContentList, { ...transformContentList(contentListData.default) })] }), _jsxs("section", { children: [_jsx("strong", { children: "ContentList \u2014 without icon" }), _jsx(ContentList, { ...transformContentList(contentListData.withoutIcon) })] }), _jsxs("section", { children: [_jsx("strong", { children: "ContentList \u2014 sizes (s / m / l)" }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '16px' }, children: contentListData.sizes.map((item, index) => (_jsx(ContentList, { ...transformContentList(item) }, index))) })] }), _jsxs("section", { children: [_jsx("strong", { children: "MetaInfo" }), _jsx(MetaInfo, { ...metaInfoData.default.content })] })] }));
21
21
  //# sourceMappingURL=ComponentsText.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentsText.stories.js","sourceRoot":"../../../src","sources":["demo/ComponentsText.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,cAAc,EAAE,YAAY,EAAC,kCAA+B;AACpE,OAAO,MAAM,uCAAoC;AACjD,OAAO,WAAW,iDAA8C;AAChE,OAAO,QAAQ,2CAAwC;AACvD,OAAO,KAAK,qCAAkC;AAC9C,OAAO,UAAU,+CAA4C;AAC7D,OAAO,EAAC,UAAU,EAAgD,2BAAkB;AAEpF,O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U,CAAC,OAAO,CAAC,OAAO,GAAI,IACpC,EACV,8BACI,kDAA8B,EAC9B,KAAC,MAAM,OAAK,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,GAAI,IAC3D,EACV,8BACI,0DAAsC,EACtC,KAAC,WAAW,OAAK,oBAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,GAAI,IAC5D,EACV,8BACI,+DAA2C,EAC3C,KAAC,WAAW,OAAK,oBAAoB,CAAC,eAAe,CAAC,WAAW,CAAC,GAAI,IAChE,EACV,8BACI,oEAAgD,EAChD,cAAK,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAC,YAC9D,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACxC,KAAC,WAAW,OAAiB,oBAAoB,CAAC,IAAI,CAAC,IAArC,KAAK,CAAoC,CAC9D,CAAC,GACA,IACA,EACV,8BACI,wCAAyB,EACzB,KAAC,QAAQ,OAAK,YAAY,CAAC,OAAO,CAAC,OAAO,GAAI,IACxC,IACR,CACT,CAAC","sourcesContent":["import {Meta, StoryFn} from '@storybook/react';\n\nimport {blockTransform, yfmTransform} from '../../.storybook/utils';\nimport Author from '../components/Author/Author';\nimport ContentList from '../components/ContentList/ContentList';\nimport MetaInfo from '../components/MetaInfo/MetaInfo';\nimport Title from '../components/Title/Title';\nimport YFMWrapper from '../components/YFMWrapper/YFMWrapper';\nimport {AuthorType, ContentListProps, CustomBlock, TitleItemProps} from '../models';\n\nimport authorData from '../components/Author/__stories__/data.json';\nimport contentListData from '../components/ContentList/__stories__/data.json';\nimport metaInfoData from '../components/MetaInfo/__stories__/data.json';\nimport titleData from '../components/Title/__stories__/data.json';\nimport yfmWrapperData from '../components/YFMWrapper/__stories__/data.json';\n\nexport default {title: 'Lab/Tokenization/Components/Text'} as Meta;\n\nconst defaultTitleArgs = {\n title: titleData.default.title as TitleItemProps,\n subtitle: yfmTransform(titleData.default.subtitle),\n};\n\nconst transformContentList = (item: unknown) =>\n blockTransform(item as unknown as CustomBlock) as ContentListProps;\n\nexport const Default: StoryFn = () => (\n <div style={{padding: '40px', display: 'flex', flexDirection: 'column', gap: '48px'}}>\n <section>\n <strong>Title — default</strong>\n <Title {...defaultTitleArgs} />\n </section>\n <section>\n <strong>Title — sizes (l → xs)</strong>\n <div>\n {Object.entries(titleData.sizes).map(([size, props]) => (\n <div key={size} style={{paddingBottom: '32px'}}>\n <Title {...defaultTitleArgs} title={props as TitleItemProps} />\n </div>\n ))}\n </div>\n </section>\n <section>\n <strong>Title — with link</strong>\n <Title {...defaultTitleArgs} title={titleData.titleLink.title as TitleItemProps} />\n </section>\n <section>\n <strong>YFMWrapper</strong>\n <YFMWrapper {...yfmWrapperData.default.content} />\n </section>\n <section>\n <strong>Author — column</strong>\n <Author {...authorData.default.content} />\n </section>\n <section>\n <strong>Author — line</strong>\n <Author {...authorData.default.content} type={AuthorType.Line} />\n </section>\n <section>\n <strong>ContentList — default</strong>\n <ContentList {...transformContentList(contentListData.default)} />\n </section>\n <section>\n <strong>ContentList — without icon</strong>\n <ContentList {...transformContentList(contentListData.withoutIcon)} />\n </section>\n <section>\n <strong>ContentList — sizes (s / m / l)</strong>\n <div style={{display: 'flex', flexDirection: 'column', gap: '16px'}}>\n {contentListData.sizes.map((item, index) => (\n <ContentList key={index} {...transformContentList(item)} />\n ))}\n </div>\n </section>\n <section>\n <strong>MetaInfo</strong>\n <MetaInfo {...metaInfoData.default.content} />\n </section>\n </div>\n);\n"]}
1
+ {"version":3,"file":"ComponentsText.stories.js","sourceRoot":"../../../src","sources":["demo/ComponentsText.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,cAAc,EAAE,YAAY,EAAC,kCAA+B;AACpE,OAAO,MAAM,uCAAoC;AACjD,OAAO,WAAW,iDAA8C;AAChE,OAAO,QAAQ,2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B,KAAC,UAAU,OAAK,cAAc,CAAC,OAAO,CAAC,OAAO,GAAI,IAC5C,EACV,8BACI,oDAAgC,EAChC,KAAC,MAAM,OAAM,UAAU,CAAC,OAAuB,GAAI,IAC7C,EACV,8BACI,kDAA8B,EAC9B,KAAC,MAAM,OAAM,UAAU,CAAC,OAAuB,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,GAAI,IACpE,EACV,8BACI,0DAAsC,EACtC,KAAC,WAAW,OAAK,oBAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,GAAI,IAC5D,EACV,8BACI,+DAA2C,EAC3C,KAAC,WAAW,OAAK,oBAAoB,CAAC,eAAe,CAAC,WAAW,CAAC,GAAI,IAChE,EACV,8BACI,oEAAgD,EAChD,cAAK,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAC,YAC9D,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACxC,KAAC,WAAW,OAAiB,oBAAoB,CAAC,IAAI,CAAC,IAArC,KAAK,CAAoC,CAC9D,CAAC,GACA,IACA,EACV,8BACI,wCAAyB,EACzB,KAAC,QAAQ,OAAK,YAAY,CAAC,OAAO,CAAC,OAAO,GAAI,IACxC,IACR,CACT,CAAC","sourcesContent":["import {Meta, StoryFn} from '@storybook/react';\n\nimport {blockTransform, yfmTransform} from '../../.storybook/utils';\nimport Author from '../components/Author/Author';\nimport ContentList from '../components/ContentList/ContentList';\nimport MetaInfo from '../components/MetaInfo/MetaInfo';\nimport Title from '../components/Title/Title';\nimport YFMWrapper from '../components/YFMWrapper/YFMWrapper';\nimport {AuthorProps, AuthorType, ContentListProps, CustomBlock, TitleItemProps} from '../models';\n\nimport authorData from '../components/Author/__stories__/data.json';\nimport contentListData from '../components/ContentList/__stories__/data.json';\nimport metaInfoData from '../components/MetaInfo/__stories__/data.json';\nimport titleData from '../components/Title/__stories__/data.json';\nimport yfmWrapperData from '../components/YFMWrapper/__stories__/data.json';\n\nexport default {title: 'Lab/Tokenization/Components/Text'} as Meta;\n\nconst defaultTitleArgs = {\n title: titleData.default.title as TitleItemProps,\n subtitle: yfmTransform(titleData.default.subtitle),\n};\n\nconst transformContentList = (item: unknown) =>\n blockTransform(item as unknown as CustomBlock) as ContentListProps;\n\nexport const Default: StoryFn = () => (\n <div style={{padding: '40px', display: 'flex', flexDirection: 'column', gap: '48px'}}>\n <section>\n <strong>Title — default</strong>\n <Title {...defaultTitleArgs} />\n </section>\n <section>\n <strong>Title — sizes (l → xs)</strong>\n <div>\n {Object.entries(titleData.sizes).map(([size, props]) => (\n <div key={size} style={{paddingBottom: '32px'}}>\n <Title {...defaultTitleArgs} title={props as TitleItemProps} />\n </div>\n ))}\n </div>\n </section>\n <section>\n <strong>Title — with link</strong>\n <Title {...defaultTitleArgs} title={titleData.titleLink.title as TitleItemProps} />\n </section>\n <section>\n <strong>YFMWrapper</strong>\n <YFMWrapper {...yfmWrapperData.default.content} />\n </section>\n <section>\n <strong>Author — column</strong>\n <Author {...(authorData.default as AuthorProps)} />\n </section>\n <section>\n <strong>Author — line</strong>\n <Author {...(authorData.default as AuthorProps)} type={AuthorType.Line} />\n </section>\n <section>\n <strong>ContentList — default</strong>\n <ContentList {...transformContentList(contentListData.default)} />\n </section>\n <section>\n <strong>ContentList — without icon</strong>\n <ContentList {...transformContentList(contentListData.withoutIcon)} />\n </section>\n <section>\n <strong>ContentList — sizes (s / m / l)</strong>\n <div style={{display: 'flex', flexDirection: 'column', gap: '16px'}}>\n {contentListData.sizes.map((item, index) => (\n <ContentList key={index} {...transformContentList(item)} />\n ))}\n </div>\n </section>\n <section>\n <strong>MetaInfo</strong>\n <MetaInfo {...metaInfoData.default.content} />\n </section>\n </div>\n);\n"]}
@@ -49,6 +49,87 @@ export declare const cardSchemas: {
49
49
  urlTitle: {
50
50
  type: string;
51
51
  };
52
+ analyticsEvents: {
53
+ oneOf: ({
54
+ optionName: string;
55
+ type: string;
56
+ additionalProperties: {
57
+ type: string;
58
+ };
59
+ required: string[];
60
+ properties: {
61
+ name: {
62
+ type: string;
63
+ };
64
+ type: {
65
+ type: string;
66
+ };
67
+ counters: {
68
+ type: string;
69
+ additionalProperties: boolean;
70
+ required: never[];
71
+ properties: {
72
+ include: {
73
+ type: string;
74
+ items: {
75
+ type: string;
76
+ };
77
+ };
78
+ exclude: {
79
+ type: string;
80
+ items: {
81
+ type: string;
82
+ };
83
+ };
84
+ };
85
+ };
86
+ context: {
87
+ type: string;
88
+ };
89
+ };
90
+ items?: undefined;
91
+ } | {
92
+ type: string;
93
+ items: {
94
+ type: string;
95
+ additionalProperties: {
96
+ type: string;
97
+ };
98
+ required: string[];
99
+ properties: {
100
+ name: {
101
+ type: string;
102
+ };
103
+ type: {
104
+ type: string;
105
+ };
106
+ counters: {
107
+ type: string;
108
+ additionalProperties: boolean;
109
+ required: never[];
110
+ properties: {
111
+ include: {
112
+ type: string;
113
+ items: {
114
+ type: string;
115
+ };
116
+ };
117
+ exclude: {
118
+ type: string;
119
+ items: {
120
+ type: string;
121
+ };
122
+ };
123
+ };
124
+ };
125
+ context: {
126
+ type: string;
127
+ };
128
+ };
129
+ };
130
+ optionName: string;
131
+ })[];
132
+ };
52
133
  title?: {
53
134
  oneOf: ({
54
135
  type: string;
@@ -47,6 +47,87 @@ export declare const ImageCard: {
47
47
  urlTitle: {
48
48
  type: string;
49
49
  };
50
+ analyticsEvents: {
51
+ oneOf: ({
52
+ optionName: string;
53
+ type: string;
54
+ additionalProperties: {
55
+ type: string;
56
+ };
57
+ required: string[];
58
+ properties: {
59
+ name: {
60
+ type: string;
61
+ };
62
+ type: {
63
+ type: string;
64
+ };
65
+ counters: {
66
+ type: string;
67
+ additionalProperties: boolean;
68
+ required: never[];
69
+ properties: {
70
+ include: {
71
+ type: string;
72
+ items: {
73
+ type: string;
74
+ };
75
+ };
76
+ exclude: {
77
+ type: string;
78
+ items: {
79
+ type: string;
80
+ };
81
+ };
82
+ };
83
+ };
84
+ context: {
85
+ type: string;
86
+ };
87
+ };
88
+ items?: undefined;
89
+ } | {
90
+ type: string;
91
+ items: {
92
+ type: string;
93
+ additionalProperties: {
94
+ type: string;
95
+ };
96
+ required: string[];
97
+ properties: {
98
+ name: {
99
+ type: string;
100
+ };
101
+ type: {
102
+ type: string;
103
+ };
104
+ counters: {
105
+ type: string;
106
+ additionalProperties: boolean;
107
+ required: never[];
108
+ properties: {
109
+ include: {
110
+ type: string;
111
+ items: {
112
+ type: string;
113
+ };
114
+ };
115
+ exclude: {
116
+ type: string;
117
+ items: {
118
+ type: string;
119
+ };
120
+ };
121
+ };
122
+ };
123
+ context: {
124
+ type: string;
125
+ };
126
+ };
127
+ };
128
+ optionName: string;
129
+ })[];
130
+ };
50
131
  title?: {
51
132
  oneOf: ({
52
133
  type: string;
@@ -1,6 +1,7 @@
1
1
  import omit from "lodash/omit.js";
2
2
  import { BaseProps, CardBase, CardLayoutProps } from "../../schema/validators/common.js";
3
3
  import { ImageProps } from "../../schema/validators/components.js";
4
+ import { AnalyticsEventSchema } from "../../schema/validators/event.js";
4
5
  import { ContentBase } from "../Content/schema.js";
5
6
  const ImageCardBlockContentProps = omit(ContentBase, ['centered', 'colSizes', 'controlPosition']);
6
7
  export const ImageCard = {
@@ -30,6 +31,19 @@ export const ImageCard = {
30
31
  urlTitle: {
31
32
  type: 'string',
32
33
  },
34
+ analyticsEvents: {
35
+ oneOf: [
36
+ {
37
+ ...AnalyticsEventSchema,
38
+ optionName: 'single',
39
+ },
40
+ {
41
+ type: 'array',
42
+ items: AnalyticsEventSchema,
43
+ optionName: 'list',
44
+ },
45
+ ],
46
+ },
33
47
  },
34
48
  },
35
49
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/ImageCard/schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,uBAAoB;AAE/B,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAC,0CAAuC;AACpF,OAAO,EAAC,UAAU,EAAC,8CAA2C;AAC9D,OAAO,EAAC,WAAW,EAAC,6BAA0B;AAE9C,MAAM,0BAA0B,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAElG,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,EAAE;YACR,GAAG,SAAS;YACZ,GAAG,QAAQ;YACX,GAAG,eAAe;YAClB,GAAG,0BAA0B;YAC7B,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;aAC9B;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;aACnB;YACD,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;aACjB;YACD,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {BaseProps, CardBase, CardLayoutProps} from '../../schema/validators/common';\nimport {ImageProps} from '../../schema/validators/components';\nimport {ContentBase} from '../Content/schema';\n\nconst ImageCardBlockContentProps = omit(ContentBase, ['centered', 'colSizes', 'controlPosition']);\n\nexport const ImageCard = {\n 'image-card': {\n additionalProperties: false,\n required: ['image'],\n properties: {\n ...BaseProps,\n ...CardBase,\n ...CardLayoutProps,\n ...ImageCardBlockContentProps,\n image: ImageProps,\n direction: {\n type: 'string',\n enum: ['direct', 'reverse'],\n },\n margins: {\n type: 'string',\n enum: ['s', 'm'],\n },\n backgroundColor: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/ImageCard/schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,uBAAoB;AAE/B,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAC,0CAAuC;AACpF,OAAO,EAAC,UAAU,EAAC,8CAA2C;AAC9D,OAAO,EAAC,oBAAoB,EAAC,yCAAsC;AACnE,OAAO,EAAC,WAAW,EAAC,6BAA0B;AAE9C,MAAM,0BAA0B,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAElG,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,EAAE;YACR,GAAG,SAAS;YACZ,GAAG,QAAQ;YACX,GAAG,eAAe;YAClB,GAAG,0BAA0B;YAC7B,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;aAC9B;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;aACnB;YACD,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;aACjB;YACD,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB;YACD,eAAe,EAAE;gBACb,KAAK,EAAE;oBACH;wBACI,GAAG,oBAAoB;wBACvB,UAAU,EAAE,QAAQ;qBACvB;oBACD;wBACI,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,oBAAoB;wBAC3B,UAAU,EAAE,MAAM;qBACrB;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {BaseProps, CardBase, CardLayoutProps} from '../../schema/validators/common';\nimport {ImageProps} from '../../schema/validators/components';\nimport {AnalyticsEventSchema} from '../../schema/validators/event';\nimport {ContentBase} from '../Content/schema';\n\nconst ImageCardBlockContentProps = omit(ContentBase, ['centered', 'colSizes', 'controlPosition']);\n\nexport const ImageCard = {\n 'image-card': {\n additionalProperties: false,\n required: ['image'],\n properties: {\n ...BaseProps,\n ...CardBase,\n ...CardLayoutProps,\n ...ImageCardBlockContentProps,\n image: ImageProps,\n direction: {\n type: 'string',\n enum: ['direct', 'reverse'],\n },\n margins: {\n type: 'string',\n enum: ['s', 'm'],\n },\n backgroundColor: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n analyticsEvents: {\n oneOf: [\n {\n ...AnalyticsEventSchema,\n optionName: 'single',\n },\n {\n type: 'array',\n items: AnalyticsEventSchema,\n optionName: 'list',\n },\n ],\n },\n },\n },\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "8.7.0",
3
+ "version": "8.8.0-alpha.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",