@integry/sdk 4.5.2 → 4.5.4

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.
Files changed (279) hide show
  1. package/.vscode/launch.json +2 -2
  2. package/THIRD_PARTY_LICENSES +0 -37
  3. package/dist/esm/index.csm.d.ts +12 -2
  4. package/dist/esm/index.csm.js +7262 -1
  5. package/dist/umd/index.umd.d.ts +9 -1
  6. package/dist/umd/index.umd.js +7262 -1
  7. package/jest.config.cjs +10 -0
  8. package/package.json +10 -4
  9. package/src/components/AddTagButton/index.ts +23 -0
  10. package/src/components/BasicSelect/index.ts +114 -0
  11. package/src/components/BasicSelect/styles.module.scss +44 -0
  12. package/src/components/Button/index.ts +94 -0
  13. package/src/components/Button/styles.module.scss +152 -0
  14. package/src/components/CheckboxGroup/Checkbox.ts +104 -0
  15. package/src/components/CheckboxGroup/index.ts +190 -0
  16. package/src/components/CheckboxGroup/styles.module.scss +63 -0
  17. package/src/components/CollapsedMenu/index.ts +101 -0
  18. package/src/components/CollapsedMenu/styles.module.scss +46 -0
  19. package/src/components/ConfigureFieldWrapper/index.ts +85 -0
  20. package/src/components/ConfigureFieldWrapper/styles.module.scss +57 -0
  21. package/src/components/EditableText/index.ts +121 -0
  22. package/src/components/EditableText/styles.module.scss +38 -0
  23. package/src/components/EditableTextArea/index.ts +143 -0
  24. package/src/components/EditableTextArea/styles.module.scss +91 -0
  25. package/src/components/ErrorMessage/index.ts +16 -0
  26. package/src/components/ErrorMessage/styles.module.scss +19 -0
  27. package/src/components/ErrorPage/index.ts +42 -0
  28. package/src/components/ErrorPage/styles.module.scss +26 -0
  29. package/src/components/Footer/index.ts +41 -0
  30. package/src/components/Footer/styles.module.scss +40 -0
  31. package/src/components/HTMLContent/index.tsx +275 -0
  32. package/src/components/HTMLContent/styles.module.scss +3 -0
  33. package/src/components/InfoBox/index.ts +48 -0
  34. package/src/components/InfoBox/styles.module.scss +21 -0
  35. package/src/components/Input/BaseInput/index.ts +170 -0
  36. package/src/components/Input/BaseInput/styles.module.scss +94 -0
  37. package/src/components/Input/DateInput/index.ts +103 -0
  38. package/src/components/Input/DateInput/styles.module.scss +50 -0
  39. package/src/components/Input/Input/index.ts +206 -0
  40. package/src/components/Input/Input/styles.module.scss +14 -0
  41. package/src/components/Input/PasswordInput/index.ts +164 -0
  42. package/src/components/Input/PasswordInput/styles.module.scss +37 -0
  43. package/src/components/Input/index.ts +7 -0
  44. package/src/components/Label/index.ts +61 -0
  45. package/src/components/Label/styles.module.scss +41 -0
  46. package/src/components/LargeLoader/index.ts +25 -0
  47. package/src/components/LargeLoader/styles.module.scss +16 -0
  48. package/src/components/Listbox/ListBoxItem.ts +57 -0
  49. package/src/components/Listbox/index.ts +479 -0
  50. package/src/components/Listbox/styles.module.scss +197 -0
  51. package/src/components/Loader/index.ts +25 -0
  52. package/src/components/Loader/styles.module.scss +16 -0
  53. package/src/components/MediaGallery/MediaGalleryModal.ts +82 -0
  54. package/src/components/MediaGallery/MediaSlider.ts +76 -0
  55. package/src/components/MediaGallery/index.ts +92 -0
  56. package/src/components/MediaGallery/styles.module.scss +156 -0
  57. package/src/components/MediaUpload/index.ts +233 -0
  58. package/src/components/MediaUpload/styles.module.scss +118 -0
  59. package/src/components/Modal/index.ts +87 -0
  60. package/src/components/Modal/styles.module.scss +441 -0
  61. package/src/components/MultipurposeField/Dropdown/ListBoxItem.tsx +58 -0
  62. package/src/components/MultipurposeField/Dropdown/index.tsx +981 -0
  63. package/src/components/MultipurposeField/Dropdown/styles.module.scss +208 -0
  64. package/src/components/MultipurposeField/TagMenu/index.ts +384 -0
  65. package/src/components/MultipurposeField/TagMenu/styles.module.scss +136 -0
  66. package/src/components/MultipurposeField/TagOptions/index.tsx +83 -0
  67. package/src/components/MultipurposeField/TagOptions/styles.module.scss +95 -0
  68. package/src/components/MultipurposeField/index.tsx +687 -0
  69. package/src/components/MultipurposeField/styles.module.scss +56 -0
  70. package/src/components/NewModal/index.ts +69 -0
  71. package/src/components/NewModal/styles.module.scss +70 -0
  72. package/src/components/OverflowTooltip/index.tsx +59 -0
  73. package/src/components/PopUp/ConfirmationPopUp/index.ts +58 -0
  74. package/src/components/PopUp/ConfirmationPopUp/styles.module.scss +49 -0
  75. package/src/components/PopUp/SuccessPopUp/index.ts +62 -0
  76. package/src/components/PopUp/SuccessPopUp/styles.module.scss +38 -0
  77. package/src/components/RadioGroup/Radio.ts +129 -0
  78. package/src/components/RadioGroup/index.ts +169 -0
  79. package/src/components/RadioGroup/styles.module.scss +81 -0
  80. package/src/components/Search/index.ts +69 -0
  81. package/src/components/Search/styles.module.scss +149 -0
  82. package/src/components/TabBar/Tab.ts +33 -0
  83. package/src/components/TabBar/index.ts +64 -0
  84. package/src/components/TabBar/styles.module.scss +43 -0
  85. package/src/components/Tag/index.ts +29 -0
  86. package/src/components/Tag/styles.module.scss +57 -0
  87. package/src/components/TextArea/index.ts +172 -0
  88. package/src/components/TextArea/styles.module.scss +70 -0
  89. package/src/components/TextContent/index.tsx +128 -0
  90. package/src/components/TextContent/styles.module.scss +6 -0
  91. package/src/components/ThreeDotLoader/index.ts +39 -0
  92. package/src/components/ThreeDotLoader/styles.module.scss +41 -0
  93. package/src/components/TimeInput/index.ts +129 -0
  94. package/src/components/TimeInput/styles.module.scss +16 -0
  95. package/src/components/Toggle/index.ts +34 -0
  96. package/src/components/Toggle/styles.module.scss +56 -0
  97. package/src/components/Toggle-v2/index.ts +40 -0
  98. package/src/components/Toggle-v2/styles.module.scss +86 -0
  99. package/src/components/Tooltip/index.ts +271 -0
  100. package/src/components/Tooltip/styles.module.scss +105 -0
  101. package/src/components/form/ObjectField/index.ts +364 -0
  102. package/src/components/form/ObjectField/styles.module.scss +103 -0
  103. package/src/components/form/index.ts +3 -0
  104. package/src/contexts/AppContext.ts +12 -0
  105. package/src/declaration.d.ts +7 -0
  106. package/src/extensions/HMAC.ts +25 -0
  107. package/src/extensions/IntegryAPIError.ts +19 -0
  108. package/src/features/common/AccountDropdown/index.ts +291 -0
  109. package/src/features/common/AccountDropdown/styles.module.scss +19 -0
  110. package/src/features/common/ActionForm/index.ts +1818 -0
  111. package/src/features/common/ActionForm/styles.module.scss +23 -0
  112. package/src/features/common/AppCard/index.ts +207 -0
  113. package/src/features/common/AppCard/styles.module.scss +117 -0
  114. package/src/features/common/AppCardCompact/index.ts +189 -0
  115. package/src/features/common/AppCardCompact/styles.module.scss +141 -0
  116. package/src/features/common/AuthSelector/index.ts +537 -0
  117. package/src/features/common/AuthSelector/styles.module.scss +161 -0
  118. package/src/features/common/AuthSelectorCompact/index.ts +706 -0
  119. package/src/features/common/AuthSelectorCompact/styles.module.scss +219 -0
  120. package/src/features/common/AuthSelectorDropdown/index.ts +704 -0
  121. package/src/features/common/AuthSelectorDropdown/styles.module.scss +361 -0
  122. package/src/features/common/DynamicField/index.ts +229 -0
  123. package/src/features/common/DynamicField/styles.module.scss +67 -0
  124. package/src/features/common/DynamicTypedField/index.ts +217 -0
  125. package/src/features/common/DynamicTypedField/styles.module.scss +67 -0
  126. package/src/features/common/FunctionForm/index.ts +862 -0
  127. package/src/features/common/FunctionForm/styles.module.scss +163 -0
  128. package/src/features/common/MappingUI/index.ts +649 -0
  129. package/src/features/common/MappingUI/styles.module.scss +121 -0
  130. package/src/features/common/MarketplaceAppCard/index.ts +279 -0
  131. package/src/features/common/MarketplaceAppCard/styles.module.scss +231 -0
  132. package/src/features/common/MarketplaceAppCardCompact/index.ts +283 -0
  133. package/src/features/common/MarketplaceAppCardCompact/styles.module.scss +255 -0
  134. package/src/features/common/NewMappingUI/index.ts +515 -0
  135. package/src/features/common/NewMappingUI/styles.module.scss +113 -0
  136. package/src/features/common/RequestAppWidget/RequestAppModal/index.ts +67 -0
  137. package/src/features/common/RequestAppWidget/RequestAppModal/styles.module.scss +23 -0
  138. package/src/features/common/RequestAppWidget/index.ts +48 -0
  139. package/src/features/common/RequestAppWidget/request-app-form.ts +89 -0
  140. package/src/features/common/RequestAppWidget/styles.module.scss +43 -0
  141. package/src/features/common/SectionField/index.ts +272 -0
  142. package/src/features/common/SectionField/styles.module.scss +67 -0
  143. package/src/features/common/Step/index.ts +827 -0
  144. package/src/features/common/Step/styles.module.scss +12 -0
  145. package/src/features/common/StepNavigation/CollapsedSteps.ts +125 -0
  146. package/src/features/common/StepNavigation/NavItem.ts +111 -0
  147. package/src/features/common/StepNavigation/index.ts +257 -0
  148. package/src/features/common/StepNavigation/styles.module.scss +117 -0
  149. package/src/features/common/Steps/index.ts +1139 -0
  150. package/src/features/common/Steps/styles.module.scss +314 -0
  151. package/src/features/containers/AppFlowContainer/AppFlowListing/compactStyles.module.scss +383 -0
  152. package/src/features/containers/AppFlowContainer/AppFlowListing/flow-instance.tsx +367 -0
  153. package/src/features/containers/AppFlowContainer/AppFlowListing/flowCard.tsx +194 -0
  154. package/src/features/containers/AppFlowContainer/AppFlowListing/flowCardCompact.tsx +389 -0
  155. package/src/features/containers/AppFlowContainer/AppFlowListing/flowInstanceCompact.tsx +577 -0
  156. package/src/features/containers/AppFlowContainer/AppFlowListing/index.tsx +83 -0
  157. package/src/features/containers/AppFlowContainer/AppFlowListing/styles.module.scss +212 -0
  158. package/src/features/containers/AppFlowContainer/AppFlowWrap/app-page-loader.tsx +45 -0
  159. package/src/features/containers/AppFlowContainer/AppFlowWrap/index.tsx +1081 -0
  160. package/src/features/containers/AppFlowContainer/AppFlowWrap/styles.module.scss +452 -0
  161. package/src/features/containers/AppFlowContainer/Authentication/index.ts +610 -0
  162. package/src/features/containers/AppFlowContainer/Authentication/styles.module.scss +468 -0
  163. package/src/features/containers/AppFlowContainer/index.ts +114 -0
  164. package/src/features/containers/AppPageContainer/AppPage/index.tsx +262 -0
  165. package/src/features/containers/AppPageContainer/AppPage/styles.module.scss +120 -0
  166. package/src/features/containers/AppPageContainer/IntegrationCard/index.ts +165 -0
  167. package/src/features/containers/AppPageContainer/IntegrationCard/styles.module.scss +81 -0
  168. package/src/features/containers/AppPageContainer/index.tsx +93 -0
  169. package/src/features/containers/AppPageContainer/styles.module.scss +0 -0
  170. package/src/features/containers/AppsForFlows/index.ts +161 -0
  171. package/src/features/containers/AppsForFlows/styles.module.scss +280 -0
  172. package/src/features/containers/AppsForFlowsCompact/index.ts +161 -0
  173. package/src/features/containers/AppsForFlowsCompact/styles.module.scss +279 -0
  174. package/src/features/containers/AuthSetupContainer/AppSelection.ts +73 -0
  175. package/src/features/containers/AuthSetupContainer/AuthTypeSelection.ts +67 -0
  176. package/src/features/containers/AuthSetupContainer/Footer.ts +32 -0
  177. package/src/features/containers/AuthSetupContainer/Header.ts +39 -0
  178. package/src/features/containers/AuthSetupContainer/PostAdditionPopup.ts +27 -0
  179. package/src/features/containers/AuthSetupContainer/index.ts +349 -0
  180. package/src/features/containers/AuthSetupContainer/styles.module.scss +229 -0
  181. package/src/features/containers/FlowSetupContainer/index.ts +390 -0
  182. package/src/features/containers/FlowSetupContainer/styles.module.scss +18 -0
  183. package/src/features/containers/MarkeplaceApps/index.ts +574 -0
  184. package/src/features/containers/MarkeplaceApps/styles.module.scss +559 -0
  185. package/src/features/containers/MarketplaceAppsCompact/index.ts +576 -0
  186. package/src/features/containers/MarketplaceAppsCompact/styles.module.scss +546 -0
  187. package/src/features/containers/MarketplaceAppsContainer/index.ts +83 -0
  188. package/src/features/containers/MarketplaceContainer/AppCard/index.ts +91 -0
  189. package/src/features/containers/MarketplaceContainer/AppCard/styles.module.scss +66 -0
  190. package/src/features/containers/MarketplaceContainer/AppListing/index.ts +34 -0
  191. package/src/features/containers/MarketplaceContainer/AppListing/styles.module.scss +10 -0
  192. package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/index.ts +132 -0
  193. package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/styles.module.scss +117 -0
  194. package/src/features/containers/MarketplaceContainer/index.ts +242 -0
  195. package/src/features/containers/MarketplaceContainer/styles.module.scss +84 -0
  196. package/src/features/containers/SDKContainer/index.ts +817 -0
  197. package/src/features/containers/SDKContainer/styles.module.scss +266 -0
  198. package/src/features/containers/SDKDebugContainer/index.ts +137 -0
  199. package/src/features/containers/SDKDebugContainer/styles.module.scss +37 -0
  200. package/src/features/containers/SDKFailedContainer/index.ts +117 -0
  201. package/src/features/containers/SDKFailedContainer/styles.module.scss +57 -0
  202. package/src/features/integrations/IntegrationRow/Icons.ts +77 -0
  203. package/src/features/integrations/IntegrationRow/index.ts +129 -0
  204. package/src/features/integrations/IntegrationRow/styles.module.scss +62 -0
  205. package/src/features/integrations/IntegrationsHeader/index.ts +34 -0
  206. package/src/features/integrations/IntegrationsHeader/styles.module.scss +47 -0
  207. package/src/features/integrations/IntegrationsList/index.ts +252 -0
  208. package/src/features/integrations/IntegrationsList/styles.module.scss +67 -0
  209. package/src/features/templates/Template/index.ts +295 -0
  210. package/src/features/templates/Template/styles.module.scss +226 -0
  211. package/src/features/templates/TemplatesView/index.ts +368 -0
  212. package/src/features/templates/TemplatesView/styles.module.scss +71 -0
  213. package/src/features/templates/TemplatesViewCompact/index.ts +364 -0
  214. package/src/features/templates/TemplatesViewCompact/styles.module.scss +141 -0
  215. package/src/hooks/useAutosizeTextArea.ts +22 -0
  216. package/src/hooks/useCustomRef.ts +13 -0
  217. package/src/hooks/useDebounce.ts +17 -0
  218. package/src/hooks/useElementResize.ts +40 -0
  219. package/src/hooks/useEventListener.ts +44 -0
  220. package/src/hooks/useHover.ts +40 -0
  221. package/src/hooks/useOnClickOutside.ts +32 -0
  222. package/src/index.ts +2051 -0
  223. package/src/index.umd.ts +13 -0
  224. package/src/interfaces/index.ts +924 -0
  225. package/src/modules/api/index.ts +1315 -0
  226. package/src/modules/api/responseHandler.ts +38 -0
  227. package/src/modules/event-emitter/index.ts +72 -0
  228. package/src/modules/event-emitter/runners/abstract.ts +21 -0
  229. package/src/modules/event-emitter/runners/default.ts +11 -0
  230. package/src/modules/event-emitter/runners/ntimes.ts +28 -0
  231. package/src/modules/event-emitter/types.ts +34 -0
  232. package/src/store/actionFunctions.ts +1573 -0
  233. package/src/store/index.ts +17 -0
  234. package/src/store/initialState.ts +58 -0
  235. package/src/stories/Button.stories.tsx +83 -0
  236. package/src/stories/Checkbox/Checkbox.stories.tsx +41 -0
  237. package/src/stories/Checkbox/CheckboxGroup.stories.tsx +46 -0
  238. package/src/stories/EditableText.stories.tsx +35 -0
  239. package/src/stories/Input/BaseInput.stories.tsx +48 -0
  240. package/src/stories/Input/DateInput.stories.tsx +28 -0
  241. package/src/stories/Input/Input.stories.tsx +24 -0
  242. package/src/stories/Input/PasswordInput.stories.tsx +26 -0
  243. package/src/stories/Introduction.stories.mdx +211 -0
  244. package/src/stories/Label.stories.tsx +27 -0
  245. package/src/stories/Listbox.stories.tsx +122 -0
  246. package/src/stories/Radio/Radio.stories.tsx +39 -0
  247. package/src/stories/Radio/RadioGroup.stories.tsx +46 -0
  248. package/src/stories/StepNavigation/NavItem.stories.tsx +31 -0
  249. package/src/stories/StepNavigation/StepNavigation.stories.tsx +50 -0
  250. package/src/stories/TabBar.stories.tsx +31 -0
  251. package/src/stories/TextArea.stories.tsx +23 -0
  252. package/src/stories/TimeInput.stories.tsx +37 -0
  253. package/src/stories/Toggle.stories.tsx +33 -0
  254. package/src/stories/assets/code-brackets.svg +1 -0
  255. package/src/stories/assets/colors.svg +1 -0
  256. package/src/stories/assets/comments.svg +1 -0
  257. package/src/stories/assets/direction.svg +1 -0
  258. package/src/stories/assets/flow.svg +1 -0
  259. package/src/stories/assets/plugin.svg +1 -0
  260. package/src/stories/assets/repo.svg +1 -0
  261. package/src/stories/assets/stackalt.svg +1 -0
  262. package/src/types/index.ts +293 -0
  263. package/src/types/store.ts +366 -0
  264. package/src/types/utils.ts +19 -0
  265. package/src/utils/ActivityOutputUtils.ts +163 -0
  266. package/src/utils/common.ts +20 -0
  267. package/src/utils/copyToClipboard.ts +24 -0
  268. package/src/utils/datetime.ts +101 -0
  269. package/src/utils/getUrlParam.ts +11 -0
  270. package/src/utils/isAuthMessage.ts +16 -0
  271. package/src/utils/isBrowser.ts +1 -0
  272. package/src/utils/jsonEncodeDecode.ts +15 -0
  273. package/src/utils/objectUtils.ts +116 -0
  274. package/src/utils/popup.ts +30 -0
  275. package/src/utils/searchJson.ts +51 -0
  276. package/src/utils/stepUtils.ts +45 -0
  277. package/src/utils/truncate.ts +6 -0
  278. package/test/setup.ts +1 -0
  279. package/vitest.config.ts +10 -0
@@ -0,0 +1,93 @@
1
+ import { html } from 'htm/preact';
2
+ import { useEffect, useContext } from 'preact/hooks';
3
+ import { connect } from 'unistore/preact';
4
+ import { Modal } from '@/components/Modal';
5
+ import { MarketplaceRenderModes, ViewStyles } from '@/types';
6
+ import { actionFunctions } from '@/store';
7
+ import AppContext from '@/contexts/AppContext';
8
+ import { StoreType } from '@/types/store';
9
+ import { UserConfig } from '@/interfaces';
10
+ import { AppPage } from './AppPage';
11
+ import styles from './styles.module.scss';
12
+
13
+ interface ContainerProps extends StoreType {
14
+ marketplaceId: string;
15
+ appId: string;
16
+ userConfig?: UserConfig;
17
+ renderMode: MarketplaceRenderModes;
18
+ }
19
+
20
+ const AppPageContainer = (props: ContainerProps) => {
21
+ const {
22
+ renderMode,
23
+ marketplaceId,
24
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
25
+ appId,
26
+ userConfig,
27
+ genericData,
28
+ } = props;
29
+ const context = useContext(AppContext);
30
+
31
+ useEffect(() => {
32
+ if (marketplaceId) {
33
+ context?.apiHandler
34
+ .getMarketplaceDetails({ marketplaceId })
35
+ .then((data) => {
36
+ if (data) {
37
+ props.setGenericData({
38
+ marketplaceDetail: data.meta
39
+ })
40
+ } else {
41
+ console.error(`Failed to fetch marketplace details`);
42
+ }
43
+ })
44
+ }
45
+ }, [marketplaceId]);
46
+
47
+ const handleCloseMarketplaceModal = () => {
48
+ props.setStoreState({
49
+ showMarketplaceModal: false,
50
+ });
51
+ };
52
+
53
+
54
+ return html`
55
+ <div class="${styles['integry-container']} ${'integry-container'}">
56
+ ${renderMode === MarketplaceRenderModes.INLINE &&
57
+ html`
58
+ <div
59
+ class="${styles.inlineSetup} ${'integry-container__marketplace--inline'}"
60
+ >
61
+ <${AppPage} />
62
+ </div>
63
+ `}
64
+ </div>
65
+ ${renderMode === MarketplaceRenderModes.MODAL &&
66
+ html`
67
+ <${Modal}
68
+ isOpen=${props.showMarketplaceModal}
69
+ onClose=${handleCloseMarketplaceModal}
70
+ className="marketplace-modal"
71
+ isCompact=${genericData.viewStyle === ViewStyles.COMPACT}
72
+ >
73
+ <div class="${styles.modalSetup} ${'integry-container__marketplace--modal'}">
74
+ <div class=${styles.modalHeader}>
75
+ <div class="${styles.modalTitle}">${userConfig?.marketplaceModalTitle || 'Marketplace'}</div>
76
+ </div>
77
+ <div class="${styles.modalContentWrap}">
78
+ <${AppPage} />
79
+ </div>
80
+ </div>
81
+ <//>
82
+ `}
83
+ `;
84
+ };
85
+
86
+ export default connect<ContainerProps, unknown, StoreType, unknown>(
87
+ [
88
+ 'userConfig',
89
+ 'genericData',
90
+ 'showMarketplaceModal',
91
+ ],
92
+ actionFunctions,
93
+ )(AppPageContainer);
@@ -0,0 +1,161 @@
1
+ import { html } from 'htm/preact';
2
+ import {
3
+ useEffect,
4
+ useState,
5
+ useContext
6
+ } from 'preact/hooks';
7
+
8
+ import { Loader } from '@/components/Loader';
9
+ import AppCard from '@/features/common/AppCard';
10
+ import AppCardCompact from '@/features/common/AppCardCompact';
11
+ import Footer from '@/components/Footer';
12
+
13
+ import { connect } from 'unistore/preact';
14
+ import { StoreType } from '@/types/store';
15
+ import { actionFunctions } from '@/store';
16
+ import AppContext from '@/contexts/AppContext';
17
+ import { ViewStyles } from '@/types';
18
+
19
+ import styles from './styles.module.scss';
20
+
21
+ const AppsForFlows = (props: any) => {
22
+ const { genericData, renderMode, userConfig } = props;
23
+ const context = useContext(AppContext);
24
+ const [apps, setApps] = useState<any[]>([]);
25
+ const [isFetchingApps, setIsFetchingApps] = useState<boolean>(true);
26
+ const [searchText, setSearchText] = useState<string>('');
27
+ const [totalApps, setTotalApps] = useState<number>(0);
28
+ const getApps = ({
29
+ nextURL = null,
30
+ currentApps = <any>[],
31
+ }) => {
32
+ setIsFetchingApps(true);
33
+ if(genericData.deploymentId && genericData.showTemplates) {
34
+ context?.apiHandler.getAdminApps({
35
+ bundleId: genericData.deploymentId,
36
+ nextURL,
37
+ }).then((appsResponse) => {
38
+ const { links } = appsResponse;
39
+ const tempApps = appsResponse.results.map((app: any) => ({
40
+ ...app,
41
+ }));
42
+
43
+ if (links.next) {
44
+ getApps({
45
+ nextURL: links.next,
46
+ currentApps: [...currentApps, ...tempApps],
47
+ });
48
+ } else {
49
+ setTotalApps(appsResponse.count || (tempApps || []).length);
50
+ setApps([...currentApps, ...tempApps]);
51
+ setIsFetchingApps(false);
52
+ }
53
+ }).catch((error) => {
54
+ // eslint-disable-next-line no-console
55
+ console.log('error', {error});
56
+ setIsFetchingApps(false);
57
+ });
58
+ }
59
+ else {
60
+ context?.apiHandler.getApps({
61
+ tags: userConfig.tags || [],
62
+ nextURL,
63
+ }).then((appsResponse) => {
64
+ const { links } = appsResponse;
65
+ const tempApps = appsResponse.results.map((app: any) => ({
66
+ ...app,
67
+ }));
68
+
69
+ if (links.next) {
70
+ getApps({
71
+ nextURL: links.next,
72
+ currentApps: [...currentApps, ...tempApps],
73
+ });
74
+ } else {
75
+ setTotalApps(appsResponse.count || (tempApps || []).length);
76
+ setApps([...currentApps, ...tempApps]);
77
+ setIsFetchingApps(false);
78
+ }
79
+ }).catch((error) => {
80
+ // eslint-disable-next-line no-console
81
+ console.log('error', {error});
82
+ setIsFetchingApps(false);
83
+ });
84
+ }
85
+ };
86
+ const filterApps = (inputString: string, items: any) => {
87
+ const cleanedInput = inputString.trim(); // Remove trailing spaces
88
+
89
+ if (cleanedInput === '') {
90
+ return items; // Return all items if cleanedInput is empty
91
+ }
92
+
93
+ const filteredItems = items.filter((item: any) =>
94
+ item.name.toLowerCase().includes(cleanedInput.toLowerCase())
95
+ );
96
+ return filteredItems;
97
+ }
98
+ useEffect(() => {
99
+ getApps({
100
+ currentApps: apps,
101
+ });
102
+ }, []);
103
+ return html`
104
+ <div id="embed--appsContainer" class="${renderMode === 'INLINE' ?
105
+ styles.appsContainerInline :
106
+ styles.appsContainer}
107
+ ${genericData.viewStyle === ViewStyles.COMPACT ? styles['compact-view'] : ''}"
108
+ style="${renderMode === 'INLINE' && props.showMarketplaceModal ? 'display: flex;' : ''}">
109
+ <div id="apps-header" class=${styles.appsHeader}>
110
+ <p id="appsHeaderTitle" class=${styles.appsHeaderTitle}>${userConfig.title || 'Apps'}${' '}${isFetchingApps ? html`<${Loader} />` : html`(${totalApps || apps.length})`}</p>
111
+ <div id="search-container" class=${styles.searchContainer}>
112
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
113
+ <path d="M14.7706 13.6638L11.148 10.0407C13.0421 7.59989 12.8712 4.06416 10.6303 1.82385C9.45395 0.647448 7.89024 0 6.2271 0C4.56335 0 2.99953 0.647997 1.82385 1.82385C0.647448 2.99965 0 4.56335 0 6.2271C0 7.89084 0.647996 9.45466 1.82385 10.6303C3.00025 11.8067 4.56396 12.4542 6.2271 12.4542C7.62663 12.4542 8.95411 11.9942 10.0413 11.1481L13.6638 14.7706C13.8168 14.9236 14.0167 14.9997 14.2172 14.9997C14.4172 14.9997 14.6177 14.9236 14.7706 14.7706C15.0765 14.4654 15.0765 13.9697 14.7706 13.6639L14.7706 13.6638ZM2.93043 9.52291C2.05038 8.64226 1.56482 7.47179 1.56482 6.22694C1.56482 4.98153 2.04978 3.81114 2.93043 2.93037C3.81049 2.04972 4.98156 1.56476 6.2264 1.56476C7.47124 1.56476 8.6422 2.04972 9.52297 2.93037C11.3409 4.74767 11.3409 7.705 9.52297 9.52276C8.64232 10.4034 7.47124 10.8884 6.2264 10.8884C4.98156 10.8884 3.8112 10.4034 2.93043 9.52276V9.52291Z" fill="#BDBDBD"/>
114
+ </svg>
115
+ <input
116
+ id="search-apps-flow-lifecycle"
117
+ class=${styles.searchInput}
118
+ placeholder="${userConfig.searchPlaceholder || 'Search for apps'}"
119
+ value=${searchText}
120
+ oninput=${(e: any) => {
121
+ setSearchText(e.target.value);
122
+ }}
123
+ />
124
+ ${searchText !== '' && html`
125
+ <svg class=${styles.clearCta} onclick=${() => {
126
+ setSearchText('');
127
+ }} xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">
128
+ <path d="M10.2426 10.2425L1.75732 1.75732" stroke="#333333" stroke-width="1.33333" stroke-linecap="round"/>
129
+ <path d="M10.2426 1.75732L1.75732 10.2425" stroke="#333333" stroke-width="1.33333" stroke-linecap="round"/>
130
+ </svg>`}
131
+ </div>
132
+ </div>
133
+ ${isFetchingApps && html`<div style="height: 300px;" />`}
134
+ ${!isFetchingApps && filterApps(searchText ,apps || []).length < 1 && html`
135
+ <div id="appsForFlowsCardsNoAppFound" class=${styles.appsForFlowsCardsNoAppFound}>
136
+ <svg width="100" height="100" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity="0.5"><path d="M52 100.38C77.9574 100.38 99 79.3378 99 53.3804C99 27.423 77.9574 6.38037 52 6.38037C26.0426 6.38037 5 27.423 5 53.3804C5 79.3378 26.0426 100.38 52 100.38Z" fill="#F9F9F9"></path><path d="M46.3186 16.7539V7.87435C46.3186 3.51833 42.7943 0 38.431 0H7.88758C3.52423 0 0 3.51833 0 7.87435V37.4451C0 41.8011 3.52423 45.3194 7.88758 45.3194H16.9499C19.0477 30.2409 31.1308 18.4293 46.3186 16.7539Z" fill="#EEEEEE"></path><path d="M16.9499 54.5339H7.88758C3.52423 54.5339 0 58.0523 0 62.4083V91.979C0 96.335 3.52423 99.8533 7.88758 99.8533H22.4041H38.431C42.7943 99.8533 46.3186 96.335 46.3186 91.979V83.0156C31.1308 81.3402 19.0477 69.5287 16.9499 54.5339Z" fill="#EEEEEE"></path><path d="M96.6648 80.2514L80.3023 63.9163C82.3161 59.6441 83.407 54.8692 83.407 49.9268C83.407 31.4974 68.4709 16.5864 50.0106 16.5864C48.7519 16.5864 47.5772 16.6702 46.3186 16.8377V22.3665V37.5289C46.3186 41.8849 42.7943 45.4032 38.431 45.4032H22.4041H16.9499C16.6982 46.9111 16.6143 48.4189 16.6143 50.0105C16.6143 51.6022 16.7821 53.11 16.9499 54.6179H38.431C42.7943 54.6179 46.3186 58.1362 46.3186 62.4922V76.9006V83.1833C47.4933 83.3509 48.7519 83.4346 50.0106 83.4346C55.0452 83.4346 59.7442 82.2619 64.0237 80.3352L80.3862 96.6703C84.8335 101.11 92.2176 101.11 96.6648 96.6703C101.112 91.9792 101.112 84.6912 96.6648 80.2514Z" fill="#E2E2E2"></path><path d="M38.4308 45.3194C42.7941 45.3194 46.3184 41.801 46.3184 37.445V22.2827V16.7539C31.1306 18.4293 19.0475 30.2408 16.9497 45.3194H22.4039H38.4308Z" fill="#C9C9C9"></path><path d="M46.3184 62.4083C46.3184 58.0523 42.7941 54.5339 38.4308 54.5339H16.9497C19.0475 69.6125 31.1306 81.424 46.3184 83.0994V76.8167V62.4083Z" fill="#C9C9C9"></path></g></svg>
137
+ ${searchText !== '' && html`<p>Sorry, we can't find the app you're looking for. Please try again with a different search term.</p>`}
138
+ ${searchText === '' && html`<p>Sorry, no apps found.</p>`}
139
+ </div>`}
140
+ ${!isFetchingApps && filterApps(searchText ,apps || []).length > 0 && html`
141
+ <div id="${`embed--appsForFlowsCardsComfortable__${renderMode}`}"
142
+ class="${props.genericData.viewStyle === ViewStyles.COMPACT ? styles.appsForFlowsCardsCompact : styles.appsForFlowsCards}">
143
+ ${filterApps(searchText ,apps || []).map((app: any) =>
144
+ html`
145
+ <${genericData.viewStyle === ViewStyles.COMPACT ? AppCardCompact : AppCard} key=${app.id} app=${app} onAppClick=${(e: any) => {
146
+ props.setGenericData({
147
+ app_id: e.id,
148
+ })
149
+ }} />
150
+ `)}
151
+ </div>`}
152
+ ${!isFetchingApps && html`<${Footer} style=${renderMode === 'INLINE' ? 'padding-top: 12px;' : 'padding-top: 12px; box-shadow: 0px -6px 10px 0px rgba(255, 255, 255, 0.8);'} />`}
153
+ </div>
154
+ `;
155
+
156
+ };
157
+
158
+ export default connect<StoreType, unknown, StoreType, unknown>(
159
+ ['genericData', 'userConfig', 'showMarketplaceModal'],
160
+ actionFunctions,
161
+ )(AppsForFlows);
@@ -0,0 +1,280 @@
1
+ .appsContainer {
2
+ * {
3
+ user-select: none;
4
+ }
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: flex-start;
8
+ justify-content: flex-start;
9
+ border-radius: 8px;
10
+ height: calc(100%);
11
+ padding-bottom: 0px;
12
+ min-height: 615px;
13
+ // min-height: 605px;
14
+ max-height: calc(100vh - 140px);
15
+ width: 100%;
16
+
17
+ .appsForFlowsCards {
18
+ height: calc(100vh - 272px);
19
+ max-height: 465px;
20
+ }
21
+
22
+ .appsHeader {
23
+ width: 100%;
24
+ }
25
+ }
26
+
27
+ .appsForFlowsCardsNoAppFound {
28
+ display: flex;
29
+ flex-direction: column;
30
+ align-items: center;
31
+ justify-content: flex-start;
32
+ width: 100%;
33
+ margin-top: 24px;
34
+ flex: 1;
35
+
36
+ p {
37
+ font-weight: 400;
38
+ font-size: 14px;
39
+ line-height: 24px;
40
+ text-align: center;
41
+ color: #999999;
42
+ max-width: 318px;
43
+ margin: 0px;
44
+ }
45
+ }
46
+
47
+ .appsContainerInline {
48
+ * {
49
+ user-select: none;
50
+ }
51
+
52
+ display: block;
53
+ flex-direction: column;
54
+ align-items: flex-start;
55
+ justify-content: flex-start;
56
+ border-radius: 8px;
57
+ height: calc(100%);
58
+ margin: auto;
59
+ min-height: 100%;
60
+ display: flex;
61
+ flex-direction: column;
62
+ align-items: flex-start;
63
+ justify-content: flex-start;
64
+ max-width: 730px;
65
+ border: 1px solid #eeeeee;
66
+
67
+ .appsHeader {
68
+ width: 100%;
69
+ box-shadow: none;
70
+
71
+ .searchContainer {
72
+ width: calc(100% - 75px);
73
+ }
74
+ }
75
+
76
+ .appsForFlowsCards {
77
+ width: calc(100% - 40px);
78
+ // height: 100%;
79
+ display: grid;
80
+ --auto-grid-min-size: 268px;
81
+ grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
82
+ grid-gap: 8px;
83
+ grid-template-rows: repeat(auto-fill, 83px);
84
+ }
85
+ }
86
+
87
+ .appsHeader {
88
+ // box-shadow: 0px 1px 0px 0px #EFEFEF;
89
+ box-shadow: none;
90
+ width: 100%;
91
+
92
+ .appsHeaderTitle {
93
+ color: var(--black-and-grey-title-and-desc, #333);
94
+ font-family: Inter;
95
+ font-size: 16px;
96
+ font-style: normal;
97
+ font-weight: 500;
98
+ line-height: normal;
99
+ width: calc(100% - 26px);
100
+ margin-left: 26px;
101
+ margin-top: 16px;
102
+ display: flex;
103
+ flex-direction: row;
104
+ align-items: center;
105
+ justify-content: flex-start;
106
+ gap: 4px;
107
+ }
108
+
109
+ .searchContainer {
110
+ // margin: auto;
111
+ margin-left: 24px;
112
+ margin-top: 17px;
113
+ margin-bottom: 8px;
114
+ border-radius: 8px;
115
+ border: 1px solid #F2F2F2;
116
+ background: #FFF;
117
+ padding: 12px;
118
+ width: calc(100% - 72px);
119
+ display: flex;
120
+ flex-direction: row;
121
+ align-items: center;
122
+ justify-content: flex-start;
123
+ gap: 10px;
124
+
125
+ input {
126
+ width: 100%;
127
+ outline: none;
128
+ border: none;
129
+ font-family: Inter;
130
+ font-size: 12px;
131
+ font-style: normal;
132
+ font-weight: 400;
133
+ line-height: normal;
134
+ color: #333;
135
+
136
+ &:focus {
137
+ outline: none;
138
+ }
139
+
140
+ &::placeholder {
141
+ color: #999;
142
+ font-family: Inter;
143
+ font-size: 12px;
144
+ font-style: normal;
145
+ font-weight: 400;
146
+ line-height: normal;
147
+ }
148
+ }
149
+
150
+ .clearCta {
151
+ cursor: pointer;
152
+ }
153
+ }
154
+ }
155
+
156
+
157
+ .appsForFlowsCards {
158
+ gap: 8px;
159
+ overflow: auto;
160
+ padding-top: 12px;
161
+ padding-bottom: 12px;
162
+ padding-left: 10px;
163
+ padding-right: 10px;
164
+ margin-top: 4px;
165
+ width: calc(100% - 46px);
166
+ // padding-right: 6px;
167
+ margin-left: 12px;
168
+ scrollbar-gutter: stable;
169
+ display: grid;
170
+ --auto-grid-min-size: 262px;
171
+ grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
172
+ grid-template-rows: repeat(auto-fill, 83px);
173
+ grid-gap: 8px;
174
+ flex: 1;
175
+
176
+ &::-webkit-scrollbar {
177
+ width: 5px;
178
+ }
179
+ /* Track */
180
+ &::-webkit-scrollbar-track {
181
+ background: transparent;
182
+ border-radius: 10px;
183
+ }
184
+
185
+ /* Handle */
186
+ &::-webkit-scrollbar-thumb {
187
+ background: #ededed;
188
+ border: 1px solid #e7e7e7;
189
+ border-radius: 10px;
190
+ }
191
+
192
+ /* Handle on hover */
193
+ &::-webkit-scrollbar-thumb:hover {
194
+ background: rgb(116, 116, 116);
195
+ }
196
+ }
197
+
198
+ .appsForFlowsCardsCompact {
199
+ display: flex;
200
+ flex-direction: column;
201
+ gap: 0;
202
+ width: calc(100% + 15px);
203
+ overflow-y: auto;
204
+ scrollbar-gutter: stable;
205
+ padding-bottom: 24px;
206
+ flex: 1;
207
+
208
+ &::-webkit-scrollbar {
209
+ width: 5px;
210
+ }
211
+ /* Track */
212
+ &::-webkit-scrollbar-track {
213
+ background: transparent;
214
+ border-radius: 10px;
215
+ }
216
+
217
+ /* Handle */
218
+ &::-webkit-scrollbar-thumb {
219
+ background: #ededed;
220
+ border: 1px solid #e7e7e7;
221
+ border-radius: 10px;
222
+ }
223
+
224
+ /* Handle on hover */
225
+ &::-webkit-scrollbar-thumb:hover {
226
+ background: rgb(116, 116, 116);
227
+ }
228
+ }
229
+
230
+ .compact-view {
231
+ max-width: 342px;
232
+ margin: 0px;
233
+ padding: 0 24px;
234
+ display: flex;
235
+ flex-direction: column;
236
+ align-items: flex-start;
237
+ justify-content: flex-start;
238
+ margin: 0 auto;
239
+
240
+ .appsHeader {
241
+ .appsHeaderTitle {
242
+ color: var(--black-and-grey-title-and-desc, #333);
243
+ font-family: Inter;
244
+ font-size: 16px;
245
+ font-style: normal;
246
+ font-weight: 500;
247
+ line-height: normal;
248
+ margin-left: 0;
249
+ margin-top: 24px;
250
+ }
251
+ }
252
+
253
+ .searchContainer {
254
+ margin: 0;
255
+ border-radius: 8px;
256
+ border: 1px solid var(--Gray-6, #F2F2F2);
257
+ background: #FFF;
258
+ padding: 0 12px;
259
+ width: calc(100% - 24px) !important;
260
+ height: 40px;
261
+
262
+ .searchInput {
263
+ color: #333;
264
+ font-family: Inter;
265
+ font-size: 12px;
266
+ font-style: normal;
267
+ font-weight: 400;
268
+ line-height: normal;
269
+
270
+ &::placeholder {
271
+ color: var(--black-and-grey-draft-and-tooltip-desc, #999);
272
+ font-family: Inter;
273
+ font-size: 12px;
274
+ font-style: normal;
275
+ font-weight: 400;
276
+ line-height: normal;
277
+ }
278
+ }
279
+ }
280
+ }