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

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.
@@ -204,7 +204,12 @@ export interface FeedPartnerProps extends ClassNameProps {
204
204
  levelColorBackground?: string;
205
205
  background?: string;
206
206
  url: string;
207
- image?: string;
207
+ image?: string | {
208
+ src: string;
209
+ width?: number;
210
+ height?: number;
211
+ vertical?: 'center' | 'bottom' | 'top';
212
+ };
208
213
  title?: string;
209
214
  subtitle?: string;
210
215
  tags?: string[];
@@ -518,7 +518,31 @@ export declare const cardSchemas: {
518
518
  type: string;
519
519
  };
520
520
  image: {
521
- type: string;
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
+ })[];
522
546
  };
523
547
  title: {
524
548
  type: string;
@@ -40,8 +40,15 @@ unpredictable css rules order in build */
40
40
  background-color: var(--g-color-base-background);
41
41
  color: var(--g-color-base-brand);
42
42
  }
43
+ .pc-feed-partner__container-image {
44
+ flex: 1;
45
+ height: 100%;
46
+ display: flex;
47
+ align-items: flex-start;
48
+ }
43
49
  .pc-feed-partner__image {
44
50
  display: block;
51
+ object-fit: contain;
45
52
  }
46
53
  .pc-feed-partner__content {
47
54
  position: relative;
@@ -9,12 +9,40 @@ const b = (0, utils_1.block)('feed-partner');
9
9
  const FeedPartner = ({ url, label, level, levelColorText, levelColorBackground, background, image, 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
+ }
18
+ 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]);
12
40
  return (react_1.default.createElement(components_1.RouterLink, { href: url },
13
41
  react_1.default.createElement(uikit_1.Link, { href: url, className: b({ jumpOnHover, border: 'line' }, className) },
14
42
  background && react_1.default.createElement("div", { className: b('background'), style: backgroundStyles }),
15
43
  react_1.default.createElement("div", { className: b('content') },
16
44
  react_1.default.createElement("div", { className: b('head') },
17
- image && react_1.default.createElement(components_1.Image, { className: b('image'), src: image, alt: "logo" }),
45
+ image && (react_1.default.createElement(components_1.Image, Object.assign({ className: b('image'), containerClassName: b('container-image') }, imageData, { alt: "logo" }))),
18
46
  level && (react_1.default.createElement("div", { className: b('level'), style: levelStyles }, level))),
19
47
  react_1.default.createElement("div", { className: b('wrap') },
20
48
  label && react_1.default.createElement("div", { className: b('label') }, label),
@@ -22,7 +22,31 @@ export declare const FeedPartner: {
22
22
  type: string;
23
23
  };
24
24
  image: {
25
- type: string;
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
+ })[];
26
50
  };
27
51
  title: {
28
52
  type: string;
@@ -19,7 +19,31 @@ exports.FeedPartner = {
19
19
  }, background: {
20
20
  type: 'string',
21
21
  }, image: {
22
- type: 'string',
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
+ ],
23
47
  }, title: {
24
48
  type: 'string',
25
49
  }, subtitle: {
@@ -204,7 +204,12 @@ export interface FeedPartnerProps extends ClassNameProps {
204
204
  levelColorBackground?: string;
205
205
  background?: string;
206
206
  url: string;
207
- image?: string;
207
+ image?: string | {
208
+ src: string;
209
+ width?: number;
210
+ height?: number;
211
+ vertical?: 'center' | 'bottom' | 'top';
212
+ };
208
213
  title?: string;
209
214
  subtitle?: string;
210
215
  tags?: string[];
@@ -518,7 +518,31 @@ export declare const cardSchemas: {
518
518
  type: string;
519
519
  };
520
520
  image: {
521
- type: string;
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
+ })[];
522
546
  };
523
547
  title: {
524
548
  type: string;
@@ -40,8 +40,15 @@ unpredictable css rules order in build */
40
40
  background-color: var(--g-color-base-background);
41
41
  color: var(--g-color-base-brand);
42
42
  }
43
+ .pc-feed-partner__container-image {
44
+ flex: 1;
45
+ height: 100%;
46
+ display: flex;
47
+ align-items: flex-start;
48
+ }
43
49
  .pc-feed-partner__image {
44
50
  display: block;
51
+ object-fit: contain;
45
52
  }
46
53
  .pc-feed-partner__content {
47
54
  position: relative;
@@ -7,12 +7,40 @@ const b = block('feed-partner');
7
7
  const FeedPartner = ({ url, label, level, levelColorText, levelColorBackground, background, image, 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
+ }
16
+ 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]);
10
38
  return (React.createElement(RouterLink, { href: url },
11
39
  React.createElement(Link, { href: url, className: b({ jumpOnHover, border: 'line' }, className) },
12
40
  background && React.createElement("div", { className: b('background'), style: backgroundStyles }),
13
41
  React.createElement("div", { className: b('content') },
14
42
  React.createElement("div", { className: b('head') },
15
- image && React.createElement(Image, { className: b('image'), src: image, alt: "logo" }),
43
+ image && (React.createElement(Image, Object.assign({ className: b('image'), containerClassName: b('container-image') }, imageData, { alt: "logo" }))),
16
44
  level && (React.createElement("div", { className: b('level'), style: levelStyles }, level))),
17
45
  React.createElement("div", { className: b('wrap') },
18
46
  label && React.createElement("div", { className: b('label') }, label),
@@ -22,7 +22,31 @@ export declare const FeedPartner: {
22
22
  type: string;
23
23
  };
24
24
  image: {
25
- type: string;
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
+ })[];
26
50
  };
27
51
  title: {
28
52
  type: string;
@@ -16,7 +16,31 @@ export const FeedPartner = {
16
16
  }, background: {
17
17
  type: 'string',
18
18
  }, image: {
19
- type: 'string',
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
+ ],
20
44
  }, title: {
21
45
  type: 'string',
22
46
  }, subtitle: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doyourjob/gravity-ui-page-constructor",
3
- "version": "5.31.290",
3
+ "version": "5.31.291",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {