@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,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'] : ''} embed--appsContainer--${renderMode}"
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--appsForFlowsCards__${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,279 @@
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
+
65
+ .appsHeader {
66
+ width: 100%;
67
+ box-shadow: none;
68
+
69
+ .searchContainer {
70
+ width: calc(100% - 72px);
71
+ }
72
+ }
73
+
74
+ .appsForFlowsCards {
75
+ width: calc(100% - 40px);
76
+ // height: 100%;
77
+ display: grid;
78
+ --auto-grid-min-size: 268px;
79
+ grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
80
+ grid-gap: 8px;
81
+ grid-template-rows: repeat(auto-fill, minmax(105px, 1fr));
82
+ }
83
+ }
84
+
85
+ .appsHeader {
86
+ // box-shadow: 0px 1px 0px 0px #EFEFEF;
87
+ box-shadow: none;
88
+ width: 100%;
89
+
90
+ .appsHeaderTitle {
91
+ color: var(--black-and-grey-title-and-desc, #333);
92
+ font-family: Inter;
93
+ font-size: 16px;
94
+ font-style: normal;
95
+ font-weight: 500;
96
+ line-height: normal;
97
+ width: calc(100% - 24px);
98
+ margin-left: 24px;
99
+ margin-top: 16px;
100
+ display: flex;
101
+ flex-direction: row;
102
+ align-items: center;
103
+ justify-content: flex-start;
104
+ gap: 4px;
105
+ }
106
+
107
+ .searchContainer {
108
+ margin: auto;
109
+ margin-top: 17px;
110
+ margin-bottom: 8px;
111
+ border-radius: 8px;
112
+ border: 1px solid #F2F2F2;
113
+ background: #FFF;
114
+ padding: 12px;
115
+ width: calc(100% - 72px);
116
+ display: flex;
117
+ flex-direction: row;
118
+ align-items: center;
119
+ justify-content: flex-start;
120
+ gap: 10px;
121
+
122
+ input {
123
+ width: 100%;
124
+ outline: none;
125
+ border: none;
126
+ font-family: Inter;
127
+ font-size: 12px;
128
+ font-style: normal;
129
+ font-weight: 400;
130
+ line-height: normal;
131
+ color: #333;
132
+
133
+ &:focus {
134
+ outline: none;
135
+ }
136
+
137
+ &::placeholder {
138
+ color: #999;
139
+ font-family: Inter;
140
+ font-size: 12px;
141
+ font-style: normal;
142
+ font-weight: 400;
143
+ line-height: normal;
144
+ }
145
+ }
146
+
147
+ .clearCta {
148
+ cursor: pointer;
149
+ }
150
+ }
151
+ }
152
+
153
+
154
+ .appsForFlowsCards {
155
+ gap: 8px;
156
+ overflow: auto;
157
+ padding-top: 12px;
158
+ padding-bottom: 12px;
159
+ padding-left: 10px;
160
+ padding-right: 10px;
161
+ margin-top: 4px;
162
+ width: calc(100% - 46px);
163
+ // padding-right: 6px;
164
+ margin-left: 14px;
165
+ scrollbar-gutter: stable;
166
+ display: grid;
167
+ --auto-grid-min-size: 262px;
168
+ grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
169
+ grid-template-rows: repeat(auto-fill, 105px);
170
+ grid-gap: 8px;
171
+ flex: 1;
172
+
173
+ &::-webkit-scrollbar {
174
+ width: 5px;
175
+ }
176
+ /* Track */
177
+ &::-webkit-scrollbar-track {
178
+ background: transparent;
179
+ border-radius: 10px;
180
+ }
181
+
182
+ /* Handle */
183
+ &::-webkit-scrollbar-thumb {
184
+ background: #ededed;
185
+ border: 1px solid #e7e7e7;
186
+ border-radius: 10px;
187
+ }
188
+
189
+ /* Handle on hover */
190
+ &::-webkit-scrollbar-thumb:hover {
191
+ background: rgb(116, 116, 116);
192
+ }
193
+ }
194
+
195
+ .appsForFlowsCardsCompact {
196
+ display: flex;
197
+ flex-direction: column;
198
+ gap: 0;
199
+ width: calc(100% + 15px);
200
+ overflow-y: auto;
201
+ scrollbar-gutter: stable;
202
+ padding-bottom: 24px;
203
+ flex: 1;
204
+ margin-top: 16px;
205
+
206
+ &::-webkit-scrollbar {
207
+ width: 5px;
208
+ }
209
+ /* Track */
210
+ &::-webkit-scrollbar-track {
211
+ background: transparent;
212
+ border-radius: 10px;
213
+ }
214
+
215
+ /* Handle */
216
+ &::-webkit-scrollbar-thumb {
217
+ background: #ededed;
218
+ border: 1px solid #e7e7e7;
219
+ border-radius: 10px;
220
+ }
221
+
222
+ /* Handle on hover */
223
+ &::-webkit-scrollbar-thumb:hover {
224
+ background: rgb(116, 116, 116);
225
+ }
226
+ }
227
+
228
+ .compact-view {
229
+ max-width: 342px;
230
+ margin: 0px;
231
+ padding: 0 24px;
232
+ display: flex;
233
+ flex-direction: column;
234
+ align-items: flex-start;
235
+ justify-content: flex-start;
236
+ margin: 0 auto;
237
+ border: 1px solid #eeeeee;
238
+
239
+ .appsHeader {
240
+ .appsHeaderTitle {
241
+ color: var(--black-and-grey-title-and-desc, #333);
242
+ font-family: Inter;
243
+ font-size: 16px;
244
+ font-style: normal;
245
+ font-weight: 500;
246
+ line-height: normal;
247
+ margin-left: 0;
248
+ margin-top: 24px;
249
+ }
250
+ }
251
+
252
+ .searchContainer {
253
+ margin: 0;
254
+ border-radius: 8px;
255
+ border: 1px solid var(--Gray-6, #F2F2F2);
256
+ background: #FFF;
257
+ padding: 0 12px;
258
+ width: calc(100% - 24px) !important;
259
+ height: 40px;
260
+
261
+ .searchInput {
262
+ color: #333;
263
+ font-family: Inter;
264
+ font-size: 12px;
265
+ font-style: normal;
266
+ font-weight: 400;
267
+ line-height: normal;
268
+
269
+ &::placeholder {
270
+ color: var(--black-and-grey-draft-and-tooltip-desc, #999);
271
+ font-family: Inter;
272
+ font-size: 12px;
273
+ font-style: normal;
274
+ font-weight: 400;
275
+ line-height: normal;
276
+ }
277
+ }
278
+ }
279
+ }
@@ -0,0 +1,73 @@
1
+ import fuzzysort from 'fuzzysort';
2
+ import { html } from 'htm/preact';
3
+ import { useEffect, useState } from 'preact/hooks';
4
+
5
+ import { AppsForAuthConnection, BrandingApp } from '@/interfaces';
6
+ import { Search } from '@/components/Search';
7
+ import { truncate } from '@/utils/truncate';
8
+ import { Hint } from '@/components/Tooltip';
9
+
10
+ import styles from './styles.module.scss';
11
+
12
+ export const AppSelection = (props: {
13
+ apps: BrandingApp[];
14
+ handleAppSelect(appId: number): void;
15
+ }) => {
16
+ const { apps, handleAppSelect } = props;
17
+
18
+ const [filteredApps, setFilteredApps] = useState<BrandingApp[]>(apps);
19
+
20
+ const [query, setQuery] = useState('');
21
+
22
+ useEffect(() => {
23
+ setFilteredApps(apps);
24
+ }, [apps]);
25
+
26
+ useEffect(() => {
27
+ if (query) {
28
+ const filtered = fuzzysort
29
+ .go(query, apps, {
30
+ keys: ['name'],
31
+ scoreFn: (keysResult) => {
32
+ const nameResult = keysResult[0];
33
+ const tagsResult = keysResult[1];
34
+ // assign higher score to name result
35
+ const score = Math.max(
36
+ nameResult ? nameResult.score + 100 : -Infinity,
37
+ tagsResult ? tagsResult.score : -Infinity,
38
+ );
39
+ return score;
40
+ },
41
+ })
42
+ .map((el) => el.obj);
43
+ setFilteredApps(filtered);
44
+ } else {
45
+ setFilteredApps(apps);
46
+ }
47
+ }, [query]);
48
+
49
+ return html`
50
+ <div class=${styles.appSelection}>
51
+ <${Search}
52
+ placeholder="Search for an app"
53
+ onChange=${(val: string) => setQuery(val)}
54
+ >
55
+ <//>
56
+ <div class=${styles.template_grid}>
57
+ ${filteredApps.map(
58
+ (el) => html` <div
59
+ onclick=${() => handleAppSelect(el.id)}
60
+ class=${styles.appCard}
61
+ >
62
+ <div>
63
+ <img src=${el.icon_url} />
64
+ </div>
65
+ <${Hint} dismissOnClick=${false} position="top" deltaY=${0}>
66
+ <div data-hint="${el.name}">${truncate(el.name)}</div>
67
+ <//>
68
+ </div>`,
69
+ )}
70
+ </div>
71
+ </div>
72
+ `;
73
+ };
@@ -0,0 +1,67 @@
1
+ import { html } from 'htm/preact';
2
+
3
+ import { AppsForAuthConnection } from '@/interfaces';
4
+ import { Radio } from '@/components/RadioGroup/Radio';
5
+ import { AuthorizationTypes } from '@/types';
6
+
7
+ import styles from './styles.module.scss';
8
+ import { Footer } from './Footer';
9
+
10
+ const AUTH_NAMES: {
11
+ [key in AuthorizationTypes]: string;
12
+ } = {
13
+ 'OAuth2-1': 'Login to the app',
14
+ OAuth2: 'Login to the app',
15
+ APIKey: 'Provide an API Key',
16
+ Basic: 'Enter username and password',
17
+ BasicWithoutURL: 'Enter username and password',
18
+ BasicAndAPIKey: 'Enter username and password',
19
+ APIKeyWithURL: 'Provide an API Key',
20
+ APIKeySecret: 'Provide an API Key',
21
+ APIKeySecretRegion: 'Provide an API Key',
22
+ APISecret: 'Provide an API Key',
23
+ };
24
+
25
+ export const AuthTypeSelection = (props: {
26
+ selectedApp: AppsForAuthConnection;
27
+ selectedAuthTypeId: number;
28
+ hideBackButton?: boolean;
29
+ handleAuthTypeIdChange(id: number): void;
30
+ handleNav(): void;
31
+ }) => {
32
+ const {
33
+ selectedApp,
34
+ selectedAuthTypeId,
35
+ handleAuthTypeIdChange,
36
+ handleNav,
37
+ hideBackButton = false,
38
+ } = props;
39
+
40
+ const handleChange = (id: number) => {
41
+ handleAuthTypeIdChange(id);
42
+ };
43
+
44
+ return html`
45
+ <div class=${styles.auth_type_selection}>
46
+ <div class=${styles.method_selection}>
47
+ <div class=${styles.text}>
48
+ Select one of the following methods to provide access.
49
+ </div>
50
+ <div class=${styles.authlist}>
51
+ ${selectedApp.authorization_type.map(
52
+ (el) => html`
53
+ <${Radio}
54
+ id=${el.id}
55
+ value=${AUTH_NAMES[el.type] || el.type}
56
+ isChecked=${selectedAuthTypeId === el.id}
57
+ onChange=${handleChange}
58
+ />
59
+ `,
60
+ )}
61
+ </div>
62
+ <${Footer} hideBackButton=${hideBackButton} handleNav=${handleNav}
63
+ disableNext=${!selectedAuthTypeId} //>
64
+ </div>
65
+ </div>
66
+ `;
67
+ };
@@ -0,0 +1,32 @@
1
+ import { html } from 'htm/preact';
2
+ import { Button, ButtonTypes } from '@/components/Button';
3
+
4
+ import styles from './styles.module.scss';
5
+
6
+ export const Footer = (props: {
7
+ disableNext?: boolean;
8
+ hideBackButton?: boolean;
9
+ handleNav(direction: 'NEXT' | 'BACK'): void;
10
+ }) => {
11
+ const { handleNav, hideBackButton = false, disableNext = false } = props;
12
+
13
+ return html`
14
+ <div class=${styles.footer}>
15
+ <div class=${styles.buttons}>
16
+ ${!hideBackButton &&
17
+ html`
18
+ <${Button}
19
+ label="Back"
20
+ onClick=${() => handleNav('BACK')}
21
+ type=${ButtonTypes.SECONDARY}
22
+ ><//>
23
+ `}
24
+ <${Button}
25
+ label="Next"
26
+ onClick=${() => handleNav('NEXT')}
27
+ hasError=${disableNext}
28
+ ><//>
29
+ </div>
30
+ </div>
31
+ `;
32
+ };
@@ -0,0 +1,39 @@
1
+ import { html } from 'htm/preact';
2
+ import { ComponentChild } from 'preact';
3
+
4
+ import styles from './styles.module.scss';
5
+
6
+ export const Header = (props: {
7
+ children: ComponentChild;
8
+ handleCloseClick(): void;
9
+ }) => {
10
+ const { children, handleCloseClick } = props;
11
+
12
+ return html`
13
+ <div class=${styles.header}>
14
+ <div class=${styles.text}>${children}</div>
15
+ <div class=${styles.close} onclick=${handleCloseClick}>
16
+ <svg
17
+ width="20"
18
+ height="22"
19
+ viewBox="0 0 20 22"
20
+ fill="none"
21
+ xmlns="http://www.w3.org/2000/svg"
22
+ >
23
+ <path
24
+ d="M14.2426 16.1822L5.75732 6.86328"
25
+ stroke="#999999"
26
+ stroke-width="2"
27
+ stroke-linecap="round"
28
+ />
29
+ <path
30
+ d="M14.2426 6.86328L5.75732 16.1822"
31
+ stroke="#999999"
32
+ stroke-width="2"
33
+ stroke-linecap="round"
34
+ />
35
+ </svg>
36
+ </div>
37
+ </div>
38
+ `;
39
+ };
@@ -0,0 +1,27 @@
1
+ import { html, Component } from 'htm/preact';
2
+ import { Button } from '@/components/Button';
3
+ import { Header } from './Header';
4
+
5
+ import styles from './styles.module.scss';
6
+
7
+ export const PostAdditionPopup = (props: {
8
+ title: string;
9
+ iconUrl: string;
10
+ children?: Component;
11
+ handleCloseClick(): void;
12
+ }) => {
13
+ const { title, iconUrl, handleCloseClick, children } = props;
14
+
15
+ return html`
16
+ <div class=${styles.successModal}>
17
+ <${Header} handleCloseClick=${handleCloseClick} //>
18
+ <div class=${styles.contents}>
19
+ <img class=${styles.img} src=${iconUrl} />
20
+ <div class=${styles.title}>${title}</div>
21
+ <div class=${styles.text}>${children}</div>
22
+ <${Button} label="OK" onClick=${handleCloseClick} width="75px"
23
+ height="38px" //>
24
+ </div>
25
+ </div>
26
+ `;
27
+ };