@pushwoosh/smart-components-kit 1.0.27 → 1.0.29

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.
@@ -1,8 +1,10 @@
1
- import { type FC } from 'react';
1
+ import { type FC, type ReactNode } from 'react';
2
+ import { type RenderDynamicContentProps } from './types';
2
3
  type DynamicContentPickerProps = {
3
4
  applicationCode: string;
4
5
  text: string;
5
6
  title?: string;
7
+ renderDynamicContent?: (props: RenderDynamicContentProps) => ReactNode;
6
8
  };
7
9
  export declare const DynamicContentPicker: FC<DynamicContentPickerProps>;
8
10
  export {};
@@ -22,7 +22,8 @@ const reducer = (state, action) => {
22
22
  export const DynamicContentPicker = ({
23
23
  applicationCode,
24
24
  text,
25
- title
25
+ title,
26
+ renderDynamicContent
26
27
  }) => {
27
28
  var _middlewareData$arrow, _middlewareData$arrow2;
28
29
  const arrowRef = useRef(null);
@@ -72,7 +73,16 @@ export const DynamicContentPicker = ({
72
73
  }))))), !!activeVar && React.createElement("div", {
73
74
  ref: refs.setFloating,
74
75
  style: floatingStyles
75
- }, React.createElement(VariedDynamicContentPickerFormSmart, {
76
+ }, renderDynamicContent ? renderDynamicContent({
77
+ activeVar,
78
+ onChange: newDC => dispatch({
79
+ type: 'set',
80
+ key: activeVar,
81
+ value: newDC
82
+ }),
83
+ onClose: () => setActiveVar(undefined),
84
+ update
85
+ }) : React.createElement(VariedDynamicContentPickerFormSmart, {
76
86
  key: activeVar,
77
87
  applicationCode: applicationCode,
78
88
  initialDc: state[activeVar],
@@ -1 +1,8 @@
1
+ import { type VariedDynamicContent } from '../DynamicContentPickerForm/types';
1
2
  export type ArrowDirection = 'top' | 'bottom' | 'left' | 'right';
3
+ export type RenderDynamicContentProps = {
4
+ activeVar: string;
5
+ onChange: (newDC: VariedDynamicContent) => void;
6
+ onClose: () => void;
7
+ update: () => void;
8
+ };
@@ -21,7 +21,7 @@ export const LanguagesSelectForm = ({
21
21
  return languageItems.filter(lang => {
22
22
  return lang.name.toLowerCase().includes(search.toLowerCase());
23
23
  });
24
- }, [allLanguageItems, search, showAllLanguages]);
24
+ }, [allLanguageItems, search, showAllLanguages, langs]);
25
25
  return React.createElement(Vertical, {
26
26
  "$gap": 8
27
27
  }, React.createElement(SearchInput, {
@@ -77,13 +77,8 @@ export const OpenActionsSummary = ({
77
77
  };
78
78
  return React.createElement(Vertical, {
79
79
  "$gap": 8
80
- }, React.createElement(Text, {
81
- "$variant": "h4",
82
- "$uppercase": true
83
- }, "On click actions"), React.createElement(Vertical, {
84
- "$gap": 8
85
- }, !openActions ? React.createElement(Spinner, {
80
+ }, openActions ? React.createElement(React.Fragment, null, hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'follow the Deep link'), Object.entries(platformsDeeplinkUrls).map(([platformKey, url]) => renderPlatformDeepLink(+platformKey, url)), allPlatformsDeeplinkUrl && hasCustomPlatformsDeeplink && renderPlatformDeepLink('Other platforms', allPlatformsDeeplinkUrl), allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'follow the Deep link', allPlatformsDeeplinkUrl), !allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'open home page in application'), webPageUrl && renderInfoBlock('web', 'open URL in browser', webPageUrl), webPageUrl && safariUrl && renderInfoBlock('Safari', 'open URL in Safari browser', safariUrl), !webPageUrl && renderInfoBlock('web', 'open home page in browser'), showRichmedia && renderRichmedia(showRichmedia)) : React.createElement(Spinner, {
86
81
  color: Color.MAIN,
87
82
  size: "medium"
88
- }) : React.createElement(React.Fragment, null, hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'follow the Deep link'), Object.entries(platformsDeeplinkUrls).map(([platformKey, url]) => renderPlatformDeepLink(+platformKey, url)), allPlatformsDeeplinkUrl && hasCustomPlatformsDeeplink && renderPlatformDeepLink('Other platforms', allPlatformsDeeplinkUrl), allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'follow the Deep link', allPlatformsDeeplinkUrl), !allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'open home page in application'), webPageUrl && renderInfoBlock('web', 'open URL in browser', webPageUrl), webPageUrl && safariUrl && renderInfoBlock('Safari', 'open URL in Safari browser', safariUrl), !webPageUrl && renderInfoBlock('web', 'open home page in browser'), showRichmedia && renderRichmedia(showRichmedia))));
83
+ }));
89
84
  };
package/package.json CHANGED
@@ -51,5 +51,5 @@
51
51
  "engines": {
52
52
  "node": ">= 18"
53
53
  },
54
- "version": "1.0.27"
54
+ "version": "1.0.29"
55
55
  }