@gravity-ui/page-constructor 4.58.0 → 4.59.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.
@@ -4,7 +4,8 @@
4
4
  align-items: baseline;
5
5
  }
6
6
  .pc-links__link {
7
- margin-top: 0px;
7
+ /* stylelint-disable-next-line declaration-no-important */
8
+ margin-top: 0px !important;
8
9
  }
9
10
  .pc-links_size_s {
10
11
  gap: 8px;
@@ -83,7 +83,7 @@ const YandexForm = (props) => {
83
83
  try {
84
84
  const parsed = JSON.parse(data);
85
85
  const height = parsed['iframe-height'];
86
- const { message, name } = parsed;
86
+ const { message, name, redirectUrl } = parsed;
87
87
  if (name !== `form${id}`) {
88
88
  return;
89
89
  }
@@ -91,7 +91,10 @@ const YandexForm = (props) => {
91
91
  iframeRef.current.height = `${height}px`;
92
92
  onLoad === null || onLoad === void 0 ? void 0 : onLoad();
93
93
  }
94
- if (message === 'sent') {
94
+ if (message === 'sent' || redirectUrl) {
95
+ // event with redirectUrl is comming when form with redirect is used
96
+ // otherwise, message: 'sent' is not comming on such sort of forms
97
+ // to catch this event and handle analytics redirectUrl is added to condition
95
98
  handleSubmit();
96
99
  }
97
100
  }
@@ -4,7 +4,8 @@
4
4
  align-items: baseline;
5
5
  }
6
6
  .pc-links__link {
7
- margin-top: 0px;
7
+ /* stylelint-disable-next-line declaration-no-important */
8
+ margin-top: 0px !important;
8
9
  }
9
10
  .pc-links_size_s {
10
11
  gap: 8px;
@@ -79,7 +79,7 @@ const YandexForm = (props) => {
79
79
  try {
80
80
  const parsed = JSON.parse(data);
81
81
  const height = parsed['iframe-height'];
82
- const { message, name } = parsed;
82
+ const { message, name, redirectUrl } = parsed;
83
83
  if (name !== `form${id}`) {
84
84
  return;
85
85
  }
@@ -87,7 +87,10 @@ const YandexForm = (props) => {
87
87
  iframeRef.current.height = `${height}px`;
88
88
  onLoad === null || onLoad === void 0 ? void 0 : onLoad();
89
89
  }
90
- if (message === 'sent') {
90
+ if (message === 'sent' || redirectUrl) {
91
+ // event with redirectUrl is comming when form with redirect is used
92
+ // otherwise, message: 'sent' is not comming on such sort of forms
93
+ // to catch this event and handle analytics redirectUrl is added to condition
91
94
  handleSubmit();
92
95
  }
93
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "4.58.0",
3
+ "version": "4.59.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {