@evergis/react 4.0.63 → 4.0.65

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.
@@ -2,6 +2,7 @@ import { RemoteTaskStatus } from '@evergis/api';
2
2
  export interface LogDialogProps {
3
3
  isOpen: boolean;
4
4
  onClose: () => void;
5
+ onMinimize?: () => void;
5
6
  logs: string | null;
6
7
  status: RemoteTaskStatus;
7
8
  statusColors?: Record<RemoteTaskStatus, string>;
@@ -1,9 +1,12 @@
1
1
  import { RemoteTaskStatus } from '@evergis/api';
2
2
  interface UseTaskNotificationsParams {
3
3
  enabled: boolean;
4
+ suppressed: boolean;
4
5
  status: RemoteTaskStatus;
5
6
  lastMessage: string | null;
6
7
  openLog: () => void;
7
8
  }
8
- export declare const useTaskNotifications: ({ enabled, status, lastMessage, openLog, }: UseTaskNotificationsParams) => void;
9
+ export declare const useTaskNotifications: ({ enabled, suppressed, status, lastMessage, openLog, }: UseTaskNotificationsParams) => {
10
+ setNotificationDismissed: import('react').Dispatch<import('react').SetStateAction<boolean>>;
11
+ };
9
12
  export {};
@@ -0,0 +1,2 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const clampDescription: (text: string) => ReactNode;
package/dist/index.js CHANGED
@@ -5631,7 +5631,6 @@ const usePythonTask = () => {
5631
5631
  const [subscriptionId, setSubscriptionId] = React.useState(null);
5632
5632
  const [isLogDialogOpen, setIsLogDialogOpen] = React.useState(false);
5633
5633
  const [result, setResult] = React.useState(null);
5634
- const logRef = React.useRef(null);
5635
5634
  const reset = React.useCallback(() => {
5636
5635
  setStatus(api.RemoteTaskStatus.Unknown);
5637
5636
  setError(null);
@@ -5685,7 +5684,7 @@ const usePythonTask = () => {
5685
5684
  if (data?.taskId === newTaskId) {
5686
5685
  const isFinished = [api.RemoteTaskStatus.Completed, api.RemoteTaskStatus.Error].includes(data.status);
5687
5686
  setStatus(data.status);
5688
- setLog([logRef.current, data.log].filter(Boolean).join("\n"));
5687
+ setLog(prev => [prev, data.log].filter(Boolean).join(""));
5689
5688
  if (data.log)
5690
5689
  setLastMessage(data.log);
5691
5690
  setExecutionTime(Date.now() - start);
@@ -5731,9 +5730,6 @@ const usePythonTask = () => {
5731
5730
  const closeLog = React.useCallback(() => {
5732
5731
  setIsLogDialogOpen(false);
5733
5732
  }, []);
5734
- React.useEffect(() => {
5735
- logRef.current = log;
5736
- }, [log]);
5737
5733
  return {
5738
5734
  taskId,
5739
5735
  runTask,
@@ -6218,6 +6214,8 @@ const getAttributeByName = (name, attributes) => {
6218
6214
  : null;
6219
6215
  };
6220
6216
 
6217
+ const isEmptyElementValue = (value) => value === "" || value === null || value === undefined;
6218
+
6221
6219
  /**
6222
6220
  * Returns a value safe to render as a React child.
6223
6221
  *
@@ -6242,7 +6240,7 @@ const formatElementValue = ({ t, value, elementConfig, attributes, wrap, }) => {
6242
6240
  ? getAttributeByName(attributeName, attributes)
6243
6241
  : null;
6244
6242
  const { fontColor, fontSize, noUnits, tagView, bgColor, withDivider, radius, noMargin, } = options || {};
6245
- const valueOrDefault = value || defaultValue;
6243
+ const valueOrDefault = isEmptyElementValue(value) ? defaultValue : value;
6246
6244
  const resultValue = type === "attributeValue" && attribute?.type && attribute?.stringFormat
6247
6245
  ? formatAttributeValue({
6248
6246
  t,
@@ -6266,14 +6264,14 @@ const getAttributeValue = (element, attributes) => {
6266
6264
  return jsxRuntime.jsx(DashboardCheckbox, { title: attribute.alias || attribute.attributeName, checked: attribute.value });
6267
6265
  }
6268
6266
  if (Array.isArray(element?.attributeName)) {
6269
- const concatAttributes = element.attributeName.map((name) => attributes?.find(({ attributeName }) => attributeName === name)?.value || "");
6267
+ const concatAttributes = element.attributeName.map((name) => attributes?.find(({ attributeName }) => attributeName === name)?.value ?? "");
6270
6268
  value = concatAttributes.join(separator || ", ");
6271
6269
  }
6272
6270
  else {
6273
6271
  const rawValue = attribute?.value;
6274
- value = rawValue && typeof rawValue === "object"
6272
+ value = rawValue !== null && rawValue !== undefined && typeof rawValue === "object"
6275
6273
  ? JSON.stringify(rawValue)
6276
- : (rawValue || "");
6274
+ : (rawValue ?? "");
6277
6275
  }
6278
6276
  return typeof value === "string" && maxLength && maxLength < value.length ? (jsxRuntime.jsx(TextTrim, { maxLength: maxLength, wordBreak: wordBreak, expandable: expandable, lineBreak: lineBreak, children: value })) : (value);
6279
6277
  };
@@ -6482,7 +6480,7 @@ const useRenderContainer = ({ elementConfig, type, renderElement, renderBody, })
6482
6480
  return (jsxRuntime.jsx(OverrideContainer, { type: type, elementConfig: itemConfig, renderElement: item.render }, attribute));
6483
6481
  }
6484
6482
  }
6485
- if (!item.value && item.hideEmpty)
6483
+ if (isEmptyElementValue(item.value) && item.hideEmpty)
6486
6484
  return null;
6487
6485
  return renderBody(item, attribute);
6488
6486
  }, [getRenderContainerItem, elementConfig, attributes, type, renderBody]);
@@ -7641,17 +7639,17 @@ const STATUS_ICONS = {
7641
7639
  [api.RemoteTaskStatus.Unknown]: "play",
7642
7640
  };
7643
7641
 
7644
- const LogDialog = ({ isOpen, onClose, logs, status, statusColors }) => {
7642
+ const LogDialog = ({ isOpen, onClose, onMinimize, logs, status, statusColors }) => {
7645
7643
  const { t } = useGlobalContext();
7646
- const getStatusTitle = React.useCallback((status) => {
7647
- const translationKey = STATUS_TRANSLATION_KEYS[status] || STATUS_TRANSLATION_KEYS[api.RemoteTaskStatus.Unknown];
7648
- const defaultValue = STATUS_TITLES[status] || STATUS_TITLES[api.RemoteTaskStatus.Unknown];
7644
+ const getStatusTitle = React.useCallback((currentStatus) => {
7645
+ const translationKey = STATUS_TRANSLATION_KEYS[currentStatus] || STATUS_TRANSLATION_KEYS[api.RemoteTaskStatus.Unknown];
7646
+ const defaultValue = STATUS_TITLES[currentStatus] || STATUS_TITLES[api.RemoteTaskStatus.Unknown];
7649
7647
  return t(translationKey, { ns: "dashboard", defaultValue });
7650
7648
  }, [t]);
7651
- const getStatusColor = React.useCallback((status) => {
7652
- return statusColors?.[status] || STATUS_COLORS[status] || STATUS_COLORS[api.RemoteTaskStatus.Unknown];
7649
+ const getStatusColor = React.useCallback((currentStatus) => {
7650
+ return statusColors?.[currentStatus] || STATUS_COLORS[currentStatus] || STATUS_COLORS[api.RemoteTaskStatus.Unknown];
7653
7651
  }, [statusColors]);
7654
- return (jsxRuntime.jsxs(uilibGl.Dialog, { isOpen: isOpen, onCloseRequest: onClose, modal: true, maxWidth: "800px", minWidth: "600px", minHeight: "600px", children: [jsxRuntime.jsx(uilibGl.DialogTitle, { children: jsxRuntime.jsxs(uilibGl.Flex, { justifyContent: "space-between", alignItems: "center", children: [jsxRuntime.jsxs(uilibGl.Flex, { alignItems: "center", children: [jsxRuntime.jsx(uilibGl.FlexSpan, { marginRight: "1rem", children: t("taskLogs", { ns: "dashboard", defaultValue: "Логи выполнения задачи" }) }), jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: uilibGl.darkTheme, children: jsxRuntime.jsx(StatusBadge, { text: getStatusTitle(status), bgColor: getStatusColor(status) }) })] }), jsxRuntime.jsx(uilibGl.IconButton, { kind: "close", onClick: onClose })] }) }), jsxRuntime.jsx(uilibGl.DialogContent, { children: jsxRuntime.jsx(uilibGl.Flex, { flexDirection: "column", height: "100%", marginBottom: "2rem", children: jsxRuntime.jsx(LogTerminal, { log: logs || t("taskLogsEmpty", { ns: "dashboard", defaultValue: "Логи отсутствуют" }) }) }) })] }));
7652
+ return (jsxRuntime.jsxs(uilibGl.Dialog, { isOpen: isOpen, onCloseRequest: onClose, modal: true, maxWidth: "800px", minWidth: "600px", minHeight: "600px", children: [jsxRuntime.jsx(uilibGl.DialogTitle, { children: jsxRuntime.jsxs(uilibGl.Flex, { justifyContent: "space-between", alignItems: "center", children: [jsxRuntime.jsxs(uilibGl.Flex, { alignItems: "center", children: [jsxRuntime.jsx(uilibGl.FlexSpan, { marginRight: "1rem", children: t("taskLogs", { ns: "dashboard", defaultValue: "Логи выполнения задачи" }) }), jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: uilibGl.darkTheme, children: jsxRuntime.jsx(StatusBadge, { text: getStatusTitle(status), bgColor: getStatusColor(status) }) })] }), jsxRuntime.jsxs(uilibGl.Flex, { alignItems: "center", width: "auto", children: [onMinimize && jsxRuntime.jsx(uilibGl.IconButton, { kind: "rollup", onClick: onMinimize }), jsxRuntime.jsx(uilibGl.IconButton, { kind: "close", onClick: onClose })] })] }) }), jsxRuntime.jsx(uilibGl.DialogContent, { children: jsxRuntime.jsx(uilibGl.Flex, { flexDirection: "column", height: "100%", marginBottom: "2rem", children: jsxRuntime.jsx(LogTerminal, { log: logs || t("taskLogsEmpty", { ns: "dashboard", defaultValue: "Логи отсутствуют" }) }) }) })] }));
7655
7653
  };
7656
7654
 
7657
7655
  exports.ThemeName = void 0;
@@ -7714,19 +7712,32 @@ const buildFiltersFromResponse = (responseFilters, result) => {
7714
7712
  return Object.keys(filters).length ? filters : null;
7715
7713
  };
7716
7714
 
7715
+ const ClampedText = styled.div `
7716
+ display: -webkit-box;
7717
+ -webkit-line-clamp: 2;
7718
+ -webkit-box-orient: vertical;
7719
+ overflow: hidden;
7720
+ text-overflow: ellipsis;
7721
+ word-break: break-word;
7722
+ `;
7723
+ const clampDescription = (text) => React.createElement(ClampedText, null, text);
7724
+
7717
7725
  const RUN_ID_RADIX = 36;
7718
7726
  const RUN_ID_LENGTH = 8;
7719
7727
  const generateRunId = () => `task-${Date.now()}-${Math.random().toString(RUN_ID_RADIX).slice(2, RUN_ID_LENGTH)}`;
7720
- const useTaskNotifications = ({ enabled, status, lastMessage, openLog, }) => {
7728
+ const useTaskNotifications = ({ enabled, suppressed, status, lastMessage, openLog, }) => {
7721
7729
  const { t, notification } = useGlobalContext();
7722
7730
  const runIdRef = React.useRef(null);
7723
7731
  const prevStatusRef = React.useRef(api.RemoteTaskStatus.Unknown);
7732
+ const isVisibleRef = React.useRef(false);
7733
+ const [dismissed, setDismissed] = React.useState(false);
7724
7734
  React.useEffect(() => {
7725
7735
  if (!enabled) {
7726
7736
  if (runIdRef.current) {
7727
7737
  notification?.close(runIdRef.current);
7728
7738
  runIdRef.current = null;
7729
7739
  }
7740
+ isVisibleRef.current = false;
7730
7741
  prevStatusRef.current = status;
7731
7742
  return;
7732
7743
  }
@@ -7737,54 +7748,70 @@ const useTaskNotifications = ({ enabled, status, lastMessage, openLog, }) => {
7737
7748
  const isFreshRun = status === api.RemoteTaskStatus.Process && prevStatusRef.current !== api.RemoteTaskStatus.Process;
7738
7749
  if (isFreshRun) {
7739
7750
  runIdRef.current = generateRunId();
7751
+ isVisibleRef.current = false;
7752
+ setDismissed(false);
7740
7753
  }
7741
7754
  if (!runIdRef.current) {
7742
7755
  runIdRef.current = generateRunId();
7743
7756
  }
7744
7757
  const id = runIdRef.current;
7745
- const description = lastMessage || t("taskStarted", { ns: "dashboard", defaultValue: "Запуск задачи…" });
7746
- const button = t("details", { ns: "dashboard", defaultValue: "Подробнее" });
7758
+ const description = clampDescription(lastMessage || t("taskStarted", { ns: "dashboard", defaultValue: "Запуск задачи…" }));
7747
7759
  const base = {
7748
7760
  id,
7749
7761
  title: "",
7750
7762
  description,
7751
7763
  duration: Number.MAX_SAFE_INTEGER,
7752
- button,
7753
- buttonIcon: "info",
7754
- buttonColor: "primary",
7755
- onButtonClick: openLog,
7764
+ ...(lastMessage ? {
7765
+ button: t("details", { ns: "dashboard", defaultValue: "Подробнее" }),
7766
+ buttonIcon: "info",
7767
+ buttonColor: "primary",
7768
+ onButtonClick: openLog,
7769
+ } : {}),
7756
7770
  };
7771
+ let item = null;
7757
7772
  if (status === api.RemoteTaskStatus.Process) {
7758
- const item = {
7773
+ item = {
7759
7774
  ...base,
7760
7775
  title: t("taskInProgress", { ns: "dashboard", defaultValue: "Выполняется" }),
7761
7776
  progress: true,
7762
7777
  };
7763
- if (isFreshRun) {
7764
- notification?.add(item);
7765
- }
7766
- else {
7767
- notification?.update(item);
7768
- }
7769
7778
  }
7770
7779
  else if (status === api.RemoteTaskStatus.Completed) {
7771
- notification?.update({
7780
+ item = {
7772
7781
  ...base,
7773
7782
  title: t("taskCompleted", { ns: "dashboard", defaultValue: "Выполнено" }),
7774
7783
  success: true,
7775
7784
  progress: false,
7776
- });
7785
+ };
7777
7786
  }
7778
7787
  else if (status === api.RemoteTaskStatus.Error) {
7779
- notification?.update({
7788
+ item = {
7780
7789
  ...base,
7781
7790
  title: t("taskError", { ns: "dashboard", defaultValue: "Ошибка" }),
7782
7791
  error: true,
7783
7792
  progress: false,
7784
- });
7793
+ };
7794
+ }
7795
+ if (!item) {
7796
+ prevStatusRef.current = status;
7797
+ return;
7798
+ }
7799
+ if (suppressed || dismissed) {
7800
+ if (isVisibleRef.current) {
7801
+ notification?.close(id);
7802
+ isVisibleRef.current = false;
7803
+ }
7804
+ }
7805
+ else if (isVisibleRef.current) {
7806
+ notification?.update(item);
7807
+ }
7808
+ else {
7809
+ notification?.add(item);
7810
+ isVisibleRef.current = true;
7785
7811
  }
7786
7812
  prevStatusRef.current = status;
7787
- }, [enabled, status, lastMessage, openLog, t, notification]);
7813
+ }, [enabled, suppressed, dismissed, status, lastMessage, openLog, t, notification]);
7814
+ return { setNotificationDismissed: setDismissed };
7788
7815
  };
7789
7816
 
7790
7817
  const TaskContainer = React.memo(({ type, elementConfig, renderElement }) => {
@@ -7795,12 +7822,21 @@ const TaskContainer = React.memo(({ type, elementConfig, renderElement }) => {
7795
7822
  const { taskId, runTask, stopTask, status, openLog, loading, isLogDialogOpen, closeLog, log, lastMessage, result, } = usePythonTask();
7796
7823
  const { options } = elementConfig || {};
7797
7824
  const { title, relatedResources, center, icon, statusColors, responseFilters, useNotifications, } = options || {};
7798
- useTaskNotifications({
7825
+ const { setNotificationDismissed } = useTaskNotifications({
7799
7826
  enabled: !!useNotifications,
7827
+ suppressed: isLogDialogOpen,
7800
7828
  status,
7801
7829
  lastMessage,
7802
7830
  openLog,
7803
7831
  });
7832
+ const onCloseLog = React.useCallback(() => {
7833
+ setNotificationDismissed(true);
7834
+ closeLog();
7835
+ }, [closeLog, setNotificationDismissed]);
7836
+ const onMinimizeLog = React.useCallback(() => {
7837
+ setNotificationDismissed(false);
7838
+ closeLog();
7839
+ }, [closeLog, setNotificationDismissed]);
7804
7840
  React.useEffect(() => {
7805
7841
  const filtersToApply = buildFiltersFromResponse(responseFilters, result);
7806
7842
  if (filtersToApply)
@@ -7825,7 +7861,7 @@ const TaskContainer = React.memo(({ type, elementConfig, renderElement }) => {
7825
7861
  return runTask({ resourceId, parameters: newParams, script, fileName, methodName });
7826
7862
  }));
7827
7863
  }, [attributes, currentPage.filters, dataSources, ewktGeometry, layerInfo, projectDataSources, relatedResources, runTask, selectedFilters, stopTask, taskId]);
7828
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), jsxRuntime.jsxs(uilibGl.Flex, { justifyContent: center ? "center" : "flex-start", children: [jsxRuntime.jsx(StatusWaitingButton, { title: title || t("run", { ns: "dashboard", defaultValue: "Запуск" }), icon: icon, status: status, statusColors: statusColors, isWaiting: loading || !!taskId, isDisabled: !relatedResources?.length, onClick: onClick }), !!(log || taskId) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uilibGl.IconButton, { kind: "info", onClick: openLog }), jsxRuntime.jsx(LogDialog, { logs: log, status: status, statusColors: statusColors, isOpen: isLogDialogOpen, onClose: closeLog })] }))] })] }));
7864
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), jsxRuntime.jsxs(uilibGl.Flex, { justifyContent: center ? "center" : "flex-start", children: [jsxRuntime.jsx(StatusWaitingButton, { title: title || t("run", { ns: "dashboard", defaultValue: "Запуск" }), icon: icon, status: status, statusColors: statusColors, isWaiting: loading || !!taskId, isDisabled: !relatedResources?.length, onClick: onClick }), !!(log || taskId) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uilibGl.IconButton, { kind: "info", onClick: openLog }), jsxRuntime.jsx(LogDialog, { logs: log, status: status, statusColors: statusColors, isOpen: isLogDialogOpen, onClose: onCloseLog, onMinimize: useNotifications ? onMinimizeLog : undefined })] }))] })] }));
7829
7865
  });
7830
7866
 
7831
7867
  const EditContainer = ({ type, elementConfig, renderElement }) => {
@@ -9004,115 +9040,6 @@ const FeatureCardDefaultHeader = ({ noFeature }) => {
9004
9040
  return (jsxRuntime.jsx(DefaultHeaderWrapper, { withPadding: withPadding, height: height, children: jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: getThemeByName(themeName), children: jsxRuntime.jsx(Header, { "$overlay": overlay, "$isRow": !column, children: jsxRuntime.jsxs(HeaderFrontView, { isDefault: !column, children: [jsxRuntime.jsxs(HeaderContainer, { children: [jsxRuntime.jsx(HeaderLayerIcon, {}), jsxRuntime.jsx(HeaderTitle, { noFeature: noFeature })] }), jsxRuntime.jsx(FeatureCardButtons, {})] }) }) }) }));
9005
9041
  };
9006
9042
 
9007
- const HeaderWrapperMixin = styled.css `
9008
- ${Header} {
9009
- min-height: 5.25rem;
9010
- }
9011
-
9012
- ${HeaderContainer} {
9013
- max-width: 100%;
9014
- width: 100%;
9015
- }
9016
-
9017
- ${FeatureControls} {
9018
- max-width: calc(100% - 2rem);
9019
- width: calc(100% - 2rem);
9020
- margin-top: -0.5rem;
9021
- padding-top: 1rem;
9022
- border-radius: ${({ theme: { borderRadius } }) => borderRadius.medium};
9023
- }
9024
-
9025
- ${({ $fontColor }) => !!$fontColor && HeaderFontColorMixin};
9026
- `;
9027
- const HeaderIcon = styled(uilibGl.Flex) `
9028
- position: absolute;
9029
- top: 0;
9030
- right: 0;
9031
- align-items: center;
9032
- justify-content: center;
9033
- width: 7.625rem;
9034
- height: 100%;
9035
-
9036
- span[kind] {
9037
- width: 4rem;
9038
-
9039
- :after {
9040
- font-size: 4rem;
9041
- color: rgba(255, 255, 255, 0.36);
9042
- }
9043
- }
9044
-
9045
- span[kind]:after,
9046
- path,
9047
- line,
9048
- circle {
9049
- fill: rgba(255, 255, 255, 0.36);
9050
- }
9051
-
9052
- && > * {
9053
- display: flex;
9054
- align-items: center;
9055
- height: 100%;
9056
- }
9057
- `;
9058
- const BigIconHeaderMixin = styled.css `
9059
- ${HeaderIcon} {
9060
- min-width: 14rem;
9061
- right: -3rem;
9062
-
9063
- span[kind]:after {
9064
- font-size: 14rem;
9065
- }
9066
- }
9067
- `;
9068
- const WithPaddingHeaderMixin = styled.css `
9069
- ${Header} {
9070
- width: 100%;
9071
- margin: -0.5rem -0.5rem 0.5rem -0.5rem;
9072
- }
9073
- `;
9074
- const BottomBlurHeaderMixin = styled.css `
9075
- ${Header} {
9076
- margin-bottom: 0;
9077
-
9078
- &::after {
9079
- content: "";
9080
- position: absolute;
9081
- top: 0;
9082
- right: 0;
9083
- bottom: 0;
9084
- left: 0;
9085
- z-index: 11;
9086
- pointer-events: none;
9087
- background: ${({ theme: { palette } }) => palette.background};
9088
- mask-image: linear-gradient(to top, #000 0%, transparent 100%);
9089
- -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
9090
- }
9091
- }
9092
-
9093
- ${HeaderFrontView} {
9094
- z-index: 12;
9095
- }
9096
- `;
9097
- const BackgroundHeaderWrapper = styled.div `
9098
- ${Header} {
9099
- width: calc(100% + 1rem);
9100
- height: ${({ $height }) => $height ? `${$height}px` : "auto"};
9101
- margin: -1rem -1rem 1rem -1rem;
9102
- border-radius: 0.5rem;
9103
- background: ${({ $bgColor }) => $bgColor || "linear-gradient(96.55deg, #FFFCD3 0%, #B4DC47 100%)"};
9104
- overflow: hidden;
9105
- }
9106
-
9107
- ${HeaderWrapperMixin};
9108
-
9109
- ${({ $bigIcon }) => $bigIcon && BigIconHeaderMixin};
9110
-
9111
- ${({ $withPadding }) => $withPadding && WithPaddingHeaderMixin};
9112
-
9113
- ${({ $bottomBlur }) => $bottomBlur && BottomBlurHeaderMixin};
9114
- `;
9115
-
9116
9043
  const ImageContainerButton = styled(uilibGl.FlatButton) `
9117
9044
  min-height: 1.5rem;
9118
9045
  border-radius: ${({ theme: { borderRadius } }) => borderRadius.large};
@@ -10031,6 +9958,121 @@ const HeaderSlideshow = styled.div `
10031
9958
  }
10032
9959
  `;
10033
9960
 
9961
+ const HeaderWrapperMixin = styled.css `
9962
+ ${Header} {
9963
+ min-height: 5.25rem;
9964
+ }
9965
+
9966
+ ${HeaderContainer} {
9967
+ max-width: 100%;
9968
+ width: 100%;
9969
+ }
9970
+
9971
+ ${FeatureControls} {
9972
+ max-width: calc(100% - 2rem);
9973
+ width: calc(100% - 2rem);
9974
+ margin-top: -0.5rem;
9975
+ padding-top: 1rem;
9976
+ border-radius: ${({ theme: { borderRadius } }) => borderRadius.medium};
9977
+ }
9978
+
9979
+ ${({ $fontColor }) => !!$fontColor && HeaderFontColorMixin};
9980
+ `;
9981
+ const HeaderIcon = styled(uilibGl.Flex) `
9982
+ position: absolute;
9983
+ top: 0;
9984
+ right: 0;
9985
+ align-items: center;
9986
+ justify-content: center;
9987
+ width: 7.625rem;
9988
+ height: 100%;
9989
+
9990
+ span[kind] {
9991
+ width: 4rem;
9992
+
9993
+ :after {
9994
+ font-size: 4rem;
9995
+ color: rgba(255, 255, 255, 0.36);
9996
+ }
9997
+ }
9998
+
9999
+ span[kind]:after,
10000
+ path,
10001
+ line,
10002
+ circle {
10003
+ fill: rgba(255, 255, 255, 0.36);
10004
+ }
10005
+
10006
+ && > * {
10007
+ display: flex;
10008
+ align-items: center;
10009
+ height: 100%;
10010
+ }
10011
+ `;
10012
+ const BigIconHeaderMixin = styled.css `
10013
+ ${HeaderIcon} {
10014
+ min-width: 14rem;
10015
+ right: -3rem;
10016
+
10017
+ span[kind]:after {
10018
+ font-size: 14rem;
10019
+ }
10020
+ }
10021
+ `;
10022
+ const WithPaddingHeaderMixin = styled.css `
10023
+ ${Header} {
10024
+ width: 100%;
10025
+ margin: -0.5rem -0.5rem 0.5rem -0.5rem;
10026
+ }
10027
+ `;
10028
+ const BottomBlurHeaderMixin = styled.css `
10029
+ ${Header} {
10030
+ margin-bottom: 0;
10031
+
10032
+ &::before {
10033
+ -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
10034
+ mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
10035
+ }
10036
+ }
10037
+
10038
+ ${ImageContainerBg} {
10039
+ -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
10040
+ mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
10041
+ }
10042
+
10043
+ ${HeaderFrontView} {
10044
+ z-index: 12;
10045
+ }
10046
+ `;
10047
+ const BackgroundHeaderWrapper = styled.div `
10048
+ ${Header} {
10049
+ position: relative;
10050
+ width: calc(100% + 1rem);
10051
+ height: ${({ $height }) => $height ? `${$height}px` : "auto"};
10052
+ margin: -1rem -1rem 1rem -1rem;
10053
+ border-radius: 0.5rem;
10054
+ background: transparent;
10055
+ overflow: hidden;
10056
+
10057
+ &::before {
10058
+ content: "";
10059
+ position: absolute;
10060
+ inset: 0;
10061
+ z-index: 0;
10062
+ pointer-events: none;
10063
+ background: ${({ $bgColor }) => $bgColor || "linear-gradient(96.55deg, #FFFCD3 0%, #B4DC47 100%)"};
10064
+ }
10065
+ }
10066
+
10067
+ ${HeaderWrapperMixin};
10068
+
10069
+ ${({ $bigIcon }) => $bigIcon && BigIconHeaderMixin};
10070
+
10071
+ ${({ $withPadding }) => $withPadding && WithPaddingHeaderMixin};
10072
+
10073
+ ${({ $bottomBlur }) => $bottomBlur && BottomBlurHeaderMixin};
10074
+ `;
10075
+
10034
10076
  const FeatureCardBackgroundHeader = () => {
10035
10077
  const { themeName: pageThemeName } = useGlobalContext();
10036
10078
  const { config } = useWidgetConfig(exports.WidgetType.FeatureCard);
@@ -10286,8 +10328,6 @@ const ModalIcon = styled(uilibGl.IconButton) `
10286
10328
  }
10287
10329
  `;
10288
10330
 
10289
- const isEmptyElementValue = (value) => value === "" || value === null || value === undefined;
10290
-
10291
10331
  const isHiddenEmptyValue = ({ value, children, hideEmpty, renderElement, }) => {
10292
10332
  const valueElement = children?.find(item => item.id === "value");
10293
10333
  const renderedValue = valueElement ? renderElement({ id: "value" }) : null;