@doyourjob/gravity-ui-page-constructor 5.31.291 → 5.31.293

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.
@@ -87,10 +87,14 @@ unpredictable css rules order in build */
87
87
  }
88
88
  .pc-partner-header-block__logo {
89
89
  display: block;
90
+ width: 250px;
91
+ height: 130px;
90
92
  }
91
93
  @media (min-width: 769px) {
92
94
  .pc-partner-header-block__logo--bottom {
93
95
  display: none;
96
+ width: 250px;
97
+ height: 130px;
94
98
  }
95
99
  }
96
100
  .pc-partner-header-block__logo-container {
@@ -82,7 +82,7 @@ export declare const subBlockMap: {
82
82
  "feed-card": import("react").MemoExoticComponent<({ url, image, title, type, description, info, place }: import("./models").FeedCardProps) => JSX.Element>;
83
83
  "event-person-card": (props: import("./models").EventPersonCardProps) => JSX.Element;
84
84
  "attachment-card": import("react").MemoExoticComponent<({ url, title, date, time, items, label, column, border, }: import("./models").AttachmentCardProps) => JSX.Element>;
85
- "feed-partner": ({ url, label, level, levelColorText, levelColorBackground, background, image, title, subtitle, className, tags, jumpOnHover, }: import("./models").FeedPartnerProps) => JSX.Element;
85
+ "feed-partner": ({ url, label, level, levelColorText, levelColorBackground, background, image, imageScale, title, subtitle, className, tags, jumpOnHover, }: import("./models").FeedPartnerProps) => JSX.Element;
86
86
  "case-study-card": import("react").MemoExoticComponent<(props: import("./models").CaseStudyCardProps) => JSX.Element>;
87
87
  "story-card": import("react").FC<import("./models").StoryCardProps>;
88
88
  "mini-case-card": import("react").FC<import("./models").MiniCaseCardProps>;
@@ -204,12 +204,8 @@ export interface FeedPartnerProps extends ClassNameProps {
204
204
  levelColorBackground?: string;
205
205
  background?: string;
206
206
  url: string;
207
- image?: string | {
208
- src: string;
209
- width?: number;
210
- height?: number;
211
- vertical?: 'center' | 'bottom' | 'top';
212
- };
207
+ image?: string;
208
+ imageScale?: number;
213
209
  title?: string;
214
210
  subtitle?: string;
215
211
  tags?: string[];
@@ -518,31 +518,12 @@ export declare const cardSchemas: {
518
518
  type: string;
519
519
  };
520
520
  image: {
521
- oneOf: ({
522
- type: string;
523
- additionalProperties?: undefined;
524
- required?: undefined;
525
- properties?: undefined;
526
- } | {
527
- type: string;
528
- additionalProperties: boolean;
529
- required: string[];
530
- properties: {
531
- src: {
532
- type: string;
533
- };
534
- width: {
535
- type: string;
536
- };
537
- height: {
538
- type: string;
539
- };
540
- vertical: {
541
- type: string;
542
- enum: string[];
543
- };
544
- };
545
- })[];
521
+ type: string;
522
+ };
523
+ imageScale: {
524
+ type: string;
525
+ minimum: number;
526
+ maximum: number;
546
527
  };
547
528
  title: {
548
529
  type: string;
@@ -28,7 +28,7 @@ unpredictable css rules order in build */
28
28
  display: flex;
29
29
  justify-content: space-between;
30
30
  align-items: flex-start;
31
- min-height: 80px;
31
+ height: 80px;
32
32
  gap: 16px;
33
33
  flex-wrap: wrap;
34
34
  }
@@ -49,6 +49,8 @@ unpredictable css rules order in build */
49
49
  .pc-feed-partner__image {
50
50
  display: block;
51
51
  object-fit: contain;
52
+ max-width: 90%;
53
+ max-height: 90%;
52
54
  }
53
55
  .pc-feed-partner__content {
54
56
  position: relative;
@@ -1,3 +1,3 @@
1
1
  import { FeedPartnerProps } from '../../models';
2
- declare const FeedPartner: ({ url, label, level, levelColorText, levelColorBackground, background, image, title, subtitle, className, tags, jumpOnHover, }: FeedPartnerProps) => JSX.Element;
2
+ declare const FeedPartner: ({ url, label, level, levelColorText, levelColorBackground, background, image, imageScale, title, subtitle, className, tags, jumpOnHover, }: FeedPartnerProps) => JSX.Element;
3
3
  export default FeedPartner;
@@ -6,43 +6,21 @@ const uikit_1 = require("@gravity-ui/uikit");
6
6
  const components_1 = require("../../components");
7
7
  const utils_1 = require("../../utils");
8
8
  const b = (0, utils_1.block)('feed-partner');
9
- const FeedPartner = ({ url, label, level, levelColorText, levelColorBackground, background, image, title, subtitle, className, tags, jumpOnHover, }) => {
9
+ const FeedPartner = ({ url, label, level, levelColorText, levelColorBackground, background, image, imageScale, title, subtitle, className, tags, jumpOnHover, }) => {
10
10
  const levelStyles = (0, react_1.useMemo)(() => ({ 'background-color': levelColorBackground, color: levelColorText }), [levelColorBackground, levelColorText]);
11
11
  const backgroundStyles = (0, react_1.useMemo)(() => ({ background: background }), [background]);
12
- const imageData = (0, react_1.useMemo)(() => {
13
- if (!image)
14
- return {};
15
- if (typeof image === 'string') {
16
- return { src: image };
17
- }
12
+ const styles = (0, react_1.useMemo)(() => {
18
13
  const style = {};
19
- if (image.width)
20
- style.width = `${image.width}px`;
21
- if (image.height)
22
- style.height = `${image.height}px`;
23
- if (image.vertical) {
24
- switch (image.vertical) {
25
- case 'center': {
26
- style.alignSelf = 'center';
27
- break;
28
- }
29
- case 'bottom': {
30
- style.alignSelf = 'flex-end';
31
- break;
32
- }
33
- case 'top':
34
- default:
35
- style.alignSelf = 'flex-start';
36
- }
37
- }
38
- return { src: image.src, style };
39
- }, [image]);
14
+ if (imageScale)
15
+ style.width = `${imageScale * 100}%`;
16
+ return style;
17
+ }, [imageScale]);
40
18
  return (react_1.default.createElement(components_1.RouterLink, { href: url },
41
19
  react_1.default.createElement(uikit_1.Link, { href: url, className: b({ jumpOnHover, border: 'line' }, className) },
42
20
  background && react_1.default.createElement("div", { className: b('background'), style: backgroundStyles }),
43
21
  react_1.default.createElement("div", { className: b('content') },
44
22
  react_1.default.createElement("div", { className: b('head') },
45
- image && (react_1.default.createElement(components_1.Image, Object.assign({ className: b('image'), containerClassName: b('container-image') }, imageData, { alt: "logo" }))),
23
+ image && (react_1.default.createElement(components_1.Image, { className: b('image'), containerClassName: b('container-image'), src: image, style: styles, alt: "logo" })),
46
24
  level && (react_1.default.createElement("div", { className: b('level'), style: levelStyles }, level))),
47
25
  react_1.default.createElement("div", { className: b('wrap') },
48
26
  label && react_1.default.createElement("div", { className: b('label') }, label),
@@ -22,31 +22,12 @@ export declare const FeedPartner: {
22
22
  type: string;
23
23
  };
24
24
  image: {
25
- oneOf: ({
26
- type: string;
27
- additionalProperties?: undefined;
28
- required?: undefined;
29
- properties?: undefined;
30
- } | {
31
- type: string;
32
- additionalProperties: boolean;
33
- required: string[];
34
- properties: {
35
- src: {
36
- type: string;
37
- };
38
- width: {
39
- type: string;
40
- };
41
- height: {
42
- type: string;
43
- };
44
- vertical: {
45
- type: string;
46
- enum: string[];
47
- };
48
- };
49
- })[];
25
+ type: string;
26
+ };
27
+ imageScale: {
28
+ type: string;
29
+ minimum: number;
30
+ maximum: number;
50
31
  };
51
32
  title: {
52
33
  type: string;
@@ -19,31 +19,11 @@ exports.FeedPartner = {
19
19
  }, background: {
20
20
  type: 'string',
21
21
  }, image: {
22
- oneOf: [
23
- {
24
- type: 'string',
25
- },
26
- {
27
- type: 'object',
28
- additionalProperties: false,
29
- required: ['src'],
30
- properties: {
31
- src: {
32
- type: 'string',
33
- },
34
- width: {
35
- type: 'number',
36
- },
37
- height: {
38
- type: 'number',
39
- },
40
- vertical: {
41
- type: 'string',
42
- enum: ['center', 'bottom', 'top'],
43
- },
44
- },
45
- },
46
- ],
22
+ type: 'string',
23
+ }, imageScale: {
24
+ type: 'number',
25
+ minimum: 0,
26
+ maximum: 1,
47
27
  }, title: {
48
28
  type: 'string',
49
29
  }, subtitle: {
@@ -87,10 +87,14 @@ unpredictable css rules order in build */
87
87
  }
88
88
  .pc-partner-header-block__logo {
89
89
  display: block;
90
+ width: 250px;
91
+ height: 130px;
90
92
  }
91
93
  @media (min-width: 769px) {
92
94
  .pc-partner-header-block__logo--bottom {
93
95
  display: none;
96
+ width: 250px;
97
+ height: 130px;
94
98
  }
95
99
  }
96
100
  .pc-partner-header-block__logo-container {
@@ -82,7 +82,7 @@ export declare const subBlockMap: {
82
82
  "feed-card": import("react").MemoExoticComponent<({ url, image, title, type, description, info, place }: import("./models").FeedCardProps) => JSX.Element>;
83
83
  "event-person-card": (props: import("./models").EventPersonCardProps) => JSX.Element;
84
84
  "attachment-card": import("react").MemoExoticComponent<({ url, title, date, time, items, label, column, border, }: import("./models").AttachmentCardProps) => JSX.Element>;
85
- "feed-partner": ({ url, label, level, levelColorText, levelColorBackground, background, image, title, subtitle, className, tags, jumpOnHover, }: import("./models").FeedPartnerProps) => JSX.Element;
85
+ "feed-partner": ({ url, label, level, levelColorText, levelColorBackground, background, image, imageScale, title, subtitle, className, tags, jumpOnHover, }: import("./models").FeedPartnerProps) => JSX.Element;
86
86
  "case-study-card": import("react").MemoExoticComponent<(props: import("./models").CaseStudyCardProps) => JSX.Element>;
87
87
  "story-card": import("react").FC<import("./models").StoryCardProps>;
88
88
  "mini-case-card": import("react").FC<import("./models").MiniCaseCardProps>;
@@ -204,12 +204,8 @@ export interface FeedPartnerProps extends ClassNameProps {
204
204
  levelColorBackground?: string;
205
205
  background?: string;
206
206
  url: string;
207
- image?: string | {
208
- src: string;
209
- width?: number;
210
- height?: number;
211
- vertical?: 'center' | 'bottom' | 'top';
212
- };
207
+ image?: string;
208
+ imageScale?: number;
213
209
  title?: string;
214
210
  subtitle?: string;
215
211
  tags?: string[];
@@ -518,31 +518,12 @@ export declare const cardSchemas: {
518
518
  type: string;
519
519
  };
520
520
  image: {
521
- oneOf: ({
522
- type: string;
523
- additionalProperties?: undefined;
524
- required?: undefined;
525
- properties?: undefined;
526
- } | {
527
- type: string;
528
- additionalProperties: boolean;
529
- required: string[];
530
- properties: {
531
- src: {
532
- type: string;
533
- };
534
- width: {
535
- type: string;
536
- };
537
- height: {
538
- type: string;
539
- };
540
- vertical: {
541
- type: string;
542
- enum: string[];
543
- };
544
- };
545
- })[];
521
+ type: string;
522
+ };
523
+ imageScale: {
524
+ type: string;
525
+ minimum: number;
526
+ maximum: number;
546
527
  };
547
528
  title: {
548
529
  type: string;
@@ -28,7 +28,7 @@ unpredictable css rules order in build */
28
28
  display: flex;
29
29
  justify-content: space-between;
30
30
  align-items: flex-start;
31
- min-height: 80px;
31
+ height: 80px;
32
32
  gap: 16px;
33
33
  flex-wrap: wrap;
34
34
  }
@@ -49,6 +49,8 @@ unpredictable css rules order in build */
49
49
  .pc-feed-partner__image {
50
50
  display: block;
51
51
  object-fit: contain;
52
+ max-width: 90%;
53
+ max-height: 90%;
52
54
  }
53
55
  .pc-feed-partner__content {
54
56
  position: relative;
@@ -1,4 +1,4 @@
1
1
  import { FeedPartnerProps } from '../../models';
2
2
  import './FeedPartner.css';
3
- declare const FeedPartner: ({ url, label, level, levelColorText, levelColorBackground, background, image, title, subtitle, className, tags, jumpOnHover, }: FeedPartnerProps) => JSX.Element;
3
+ declare const FeedPartner: ({ url, label, level, levelColorText, levelColorBackground, background, image, imageScale, title, subtitle, className, tags, jumpOnHover, }: FeedPartnerProps) => JSX.Element;
4
4
  export default FeedPartner;
@@ -4,43 +4,21 @@ import { Image, RouterLink } from '../../components';
4
4
  import { block } from '../../utils';
5
5
  import './FeedPartner.css';
6
6
  const b = block('feed-partner');
7
- const FeedPartner = ({ url, label, level, levelColorText, levelColorBackground, background, image, title, subtitle, className, tags, jumpOnHover, }) => {
7
+ const FeedPartner = ({ url, label, level, levelColorText, levelColorBackground, background, image, imageScale, title, subtitle, className, tags, jumpOnHover, }) => {
8
8
  const levelStyles = useMemo(() => ({ 'background-color': levelColorBackground, color: levelColorText }), [levelColorBackground, levelColorText]);
9
9
  const backgroundStyles = useMemo(() => ({ background: background }), [background]);
10
- const imageData = useMemo(() => {
11
- if (!image)
12
- return {};
13
- if (typeof image === 'string') {
14
- return { src: image };
15
- }
10
+ const styles = useMemo(() => {
16
11
  const style = {};
17
- if (image.width)
18
- style.width = `${image.width}px`;
19
- if (image.height)
20
- style.height = `${image.height}px`;
21
- if (image.vertical) {
22
- switch (image.vertical) {
23
- case 'center': {
24
- style.alignSelf = 'center';
25
- break;
26
- }
27
- case 'bottom': {
28
- style.alignSelf = 'flex-end';
29
- break;
30
- }
31
- case 'top':
32
- default:
33
- style.alignSelf = 'flex-start';
34
- }
35
- }
36
- return { src: image.src, style };
37
- }, [image]);
12
+ if (imageScale)
13
+ style.width = `${imageScale * 100}%`;
14
+ return style;
15
+ }, [imageScale]);
38
16
  return (React.createElement(RouterLink, { href: url },
39
17
  React.createElement(Link, { href: url, className: b({ jumpOnHover, border: 'line' }, className) },
40
18
  background && React.createElement("div", { className: b('background'), style: backgroundStyles }),
41
19
  React.createElement("div", { className: b('content') },
42
20
  React.createElement("div", { className: b('head') },
43
- image && (React.createElement(Image, Object.assign({ className: b('image'), containerClassName: b('container-image') }, imageData, { alt: "logo" }))),
21
+ image && (React.createElement(Image, { className: b('image'), containerClassName: b('container-image'), src: image, style: styles, alt: "logo" })),
44
22
  level && (React.createElement("div", { className: b('level'), style: levelStyles }, level))),
45
23
  React.createElement("div", { className: b('wrap') },
46
24
  label && React.createElement("div", { className: b('label') }, label),
@@ -22,31 +22,12 @@ export declare const FeedPartner: {
22
22
  type: string;
23
23
  };
24
24
  image: {
25
- oneOf: ({
26
- type: string;
27
- additionalProperties?: undefined;
28
- required?: undefined;
29
- properties?: undefined;
30
- } | {
31
- type: string;
32
- additionalProperties: boolean;
33
- required: string[];
34
- properties: {
35
- src: {
36
- type: string;
37
- };
38
- width: {
39
- type: string;
40
- };
41
- height: {
42
- type: string;
43
- };
44
- vertical: {
45
- type: string;
46
- enum: string[];
47
- };
48
- };
49
- })[];
25
+ type: string;
26
+ };
27
+ imageScale: {
28
+ type: string;
29
+ minimum: number;
30
+ maximum: number;
50
31
  };
51
32
  title: {
52
33
  type: string;
@@ -16,31 +16,11 @@ export const FeedPartner = {
16
16
  }, background: {
17
17
  type: 'string',
18
18
  }, image: {
19
- oneOf: [
20
- {
21
- type: 'string',
22
- },
23
- {
24
- type: 'object',
25
- additionalProperties: false,
26
- required: ['src'],
27
- properties: {
28
- src: {
29
- type: 'string',
30
- },
31
- width: {
32
- type: 'number',
33
- },
34
- height: {
35
- type: 'number',
36
- },
37
- vertical: {
38
- type: 'string',
39
- enum: ['center', 'bottom', 'top'],
40
- },
41
- },
42
- },
43
- ],
19
+ type: 'string',
20
+ }, imageScale: {
21
+ type: 'number',
22
+ minimum: 0,
23
+ maximum: 1,
44
24
  }, title: {
45
25
  type: 'string',
46
26
  }, subtitle: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doyourjob/gravity-ui-page-constructor",
3
- "version": "5.31.291",
3
+ "version": "5.31.293",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {