@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.
- package/.vscode/launch.json +2 -2
- package/THIRD_PARTY_LICENSES +0 -37
- package/dist/esm/index.csm.d.ts +12 -2
- package/dist/esm/index.csm.js +7262 -1
- package/dist/umd/index.umd.d.ts +9 -1
- package/dist/umd/index.umd.js +7262 -1
- package/jest.config.cjs +10 -0
- package/package.json +10 -4
- package/src/components/AddTagButton/index.ts +23 -0
- package/src/components/BasicSelect/index.ts +114 -0
- package/src/components/BasicSelect/styles.module.scss +44 -0
- package/src/components/Button/index.ts +94 -0
- package/src/components/Button/styles.module.scss +152 -0
- package/src/components/CheckboxGroup/Checkbox.ts +104 -0
- package/src/components/CheckboxGroup/index.ts +190 -0
- package/src/components/CheckboxGroup/styles.module.scss +63 -0
- package/src/components/CollapsedMenu/index.ts +101 -0
- package/src/components/CollapsedMenu/styles.module.scss +46 -0
- package/src/components/ConfigureFieldWrapper/index.ts +85 -0
- package/src/components/ConfigureFieldWrapper/styles.module.scss +57 -0
- package/src/components/EditableText/index.ts +121 -0
- package/src/components/EditableText/styles.module.scss +38 -0
- package/src/components/EditableTextArea/index.ts +143 -0
- package/src/components/EditableTextArea/styles.module.scss +91 -0
- package/src/components/ErrorMessage/index.ts +16 -0
- package/src/components/ErrorMessage/styles.module.scss +19 -0
- package/src/components/ErrorPage/index.ts +42 -0
- package/src/components/ErrorPage/styles.module.scss +26 -0
- package/src/components/Footer/index.ts +41 -0
- package/src/components/Footer/styles.module.scss +40 -0
- package/src/components/HTMLContent/index.tsx +275 -0
- package/src/components/HTMLContent/styles.module.scss +3 -0
- package/src/components/InfoBox/index.ts +48 -0
- package/src/components/InfoBox/styles.module.scss +21 -0
- package/src/components/Input/BaseInput/index.ts +170 -0
- package/src/components/Input/BaseInput/styles.module.scss +94 -0
- package/src/components/Input/DateInput/index.ts +103 -0
- package/src/components/Input/DateInput/styles.module.scss +50 -0
- package/src/components/Input/Input/index.ts +206 -0
- package/src/components/Input/Input/styles.module.scss +14 -0
- package/src/components/Input/PasswordInput/index.ts +164 -0
- package/src/components/Input/PasswordInput/styles.module.scss +37 -0
- package/src/components/Input/index.ts +7 -0
- package/src/components/Label/index.ts +61 -0
- package/src/components/Label/styles.module.scss +41 -0
- package/src/components/LargeLoader/index.ts +25 -0
- package/src/components/LargeLoader/styles.module.scss +16 -0
- package/src/components/Listbox/ListBoxItem.ts +57 -0
- package/src/components/Listbox/index.ts +479 -0
- package/src/components/Listbox/styles.module.scss +197 -0
- package/src/components/Loader/index.ts +25 -0
- package/src/components/Loader/styles.module.scss +16 -0
- package/src/components/MediaGallery/MediaGalleryModal.ts +82 -0
- package/src/components/MediaGallery/MediaSlider.ts +76 -0
- package/src/components/MediaGallery/index.ts +92 -0
- package/src/components/MediaGallery/styles.module.scss +156 -0
- package/src/components/MediaUpload/index.ts +233 -0
- package/src/components/MediaUpload/styles.module.scss +118 -0
- package/src/components/Modal/index.ts +87 -0
- package/src/components/Modal/styles.module.scss +441 -0
- package/src/components/MultipurposeField/Dropdown/ListBoxItem.tsx +58 -0
- package/src/components/MultipurposeField/Dropdown/index.tsx +981 -0
- package/src/components/MultipurposeField/Dropdown/styles.module.scss +208 -0
- package/src/components/MultipurposeField/TagMenu/index.ts +384 -0
- package/src/components/MultipurposeField/TagMenu/styles.module.scss +136 -0
- package/src/components/MultipurposeField/TagOptions/index.tsx +83 -0
- package/src/components/MultipurposeField/TagOptions/styles.module.scss +95 -0
- package/src/components/MultipurposeField/index.tsx +687 -0
- package/src/components/MultipurposeField/styles.module.scss +56 -0
- package/src/components/NewModal/index.ts +69 -0
- package/src/components/NewModal/styles.module.scss +70 -0
- package/src/components/OverflowTooltip/index.tsx +59 -0
- package/src/components/PopUp/ConfirmationPopUp/index.ts +58 -0
- package/src/components/PopUp/ConfirmationPopUp/styles.module.scss +49 -0
- package/src/components/PopUp/SuccessPopUp/index.ts +62 -0
- package/src/components/PopUp/SuccessPopUp/styles.module.scss +38 -0
- package/src/components/RadioGroup/Radio.ts +129 -0
- package/src/components/RadioGroup/index.ts +169 -0
- package/src/components/RadioGroup/styles.module.scss +81 -0
- package/src/components/Search/index.ts +69 -0
- package/src/components/Search/styles.module.scss +149 -0
- package/src/components/TabBar/Tab.ts +33 -0
- package/src/components/TabBar/index.ts +64 -0
- package/src/components/TabBar/styles.module.scss +43 -0
- package/src/components/Tag/index.ts +29 -0
- package/src/components/Tag/styles.module.scss +57 -0
- package/src/components/TextArea/index.ts +172 -0
- package/src/components/TextArea/styles.module.scss +70 -0
- package/src/components/TextContent/index.tsx +128 -0
- package/src/components/TextContent/styles.module.scss +6 -0
- package/src/components/ThreeDotLoader/index.ts +39 -0
- package/src/components/ThreeDotLoader/styles.module.scss +41 -0
- package/src/components/TimeInput/index.ts +129 -0
- package/src/components/TimeInput/styles.module.scss +16 -0
- package/src/components/Toggle/index.ts +34 -0
- package/src/components/Toggle/styles.module.scss +56 -0
- package/src/components/Toggle-v2/index.ts +40 -0
- package/src/components/Toggle-v2/styles.module.scss +86 -0
- package/src/components/Tooltip/index.ts +271 -0
- package/src/components/Tooltip/styles.module.scss +105 -0
- package/src/components/form/ObjectField/index.ts +364 -0
- package/src/components/form/ObjectField/styles.module.scss +103 -0
- package/src/components/form/index.ts +3 -0
- package/src/contexts/AppContext.ts +12 -0
- package/src/declaration.d.ts +7 -0
- package/src/extensions/HMAC.ts +25 -0
- package/src/extensions/IntegryAPIError.ts +19 -0
- package/src/features/common/AccountDropdown/index.ts +291 -0
- package/src/features/common/AccountDropdown/styles.module.scss +19 -0
- package/src/features/common/ActionForm/index.ts +1818 -0
- package/src/features/common/ActionForm/styles.module.scss +23 -0
- package/src/features/common/AppCard/index.ts +207 -0
- package/src/features/common/AppCard/styles.module.scss +117 -0
- package/src/features/common/AppCardCompact/index.ts +189 -0
- package/src/features/common/AppCardCompact/styles.module.scss +141 -0
- package/src/features/common/AuthSelector/index.ts +537 -0
- package/src/features/common/AuthSelector/styles.module.scss +161 -0
- package/src/features/common/AuthSelectorCompact/index.ts +706 -0
- package/src/features/common/AuthSelectorCompact/styles.module.scss +219 -0
- package/src/features/common/AuthSelectorDropdown/index.ts +704 -0
- package/src/features/common/AuthSelectorDropdown/styles.module.scss +361 -0
- package/src/features/common/DynamicField/index.ts +229 -0
- package/src/features/common/DynamicField/styles.module.scss +67 -0
- package/src/features/common/DynamicTypedField/index.ts +217 -0
- package/src/features/common/DynamicTypedField/styles.module.scss +67 -0
- package/src/features/common/FunctionForm/index.ts +862 -0
- package/src/features/common/FunctionForm/styles.module.scss +163 -0
- package/src/features/common/MappingUI/index.ts +649 -0
- package/src/features/common/MappingUI/styles.module.scss +121 -0
- package/src/features/common/MarketplaceAppCard/index.ts +279 -0
- package/src/features/common/MarketplaceAppCard/styles.module.scss +231 -0
- package/src/features/common/MarketplaceAppCardCompact/index.ts +283 -0
- package/src/features/common/MarketplaceAppCardCompact/styles.module.scss +255 -0
- package/src/features/common/NewMappingUI/index.ts +515 -0
- package/src/features/common/NewMappingUI/styles.module.scss +113 -0
- package/src/features/common/RequestAppWidget/RequestAppModal/index.ts +67 -0
- package/src/features/common/RequestAppWidget/RequestAppModal/styles.module.scss +23 -0
- package/src/features/common/RequestAppWidget/index.ts +48 -0
- package/src/features/common/RequestAppWidget/request-app-form.ts +89 -0
- package/src/features/common/RequestAppWidget/styles.module.scss +43 -0
- package/src/features/common/SectionField/index.ts +272 -0
- package/src/features/common/SectionField/styles.module.scss +67 -0
- package/src/features/common/Step/index.ts +827 -0
- package/src/features/common/Step/styles.module.scss +12 -0
- package/src/features/common/StepNavigation/CollapsedSteps.ts +125 -0
- package/src/features/common/StepNavigation/NavItem.ts +111 -0
- package/src/features/common/StepNavigation/index.ts +257 -0
- package/src/features/common/StepNavigation/styles.module.scss +117 -0
- package/src/features/common/Steps/index.ts +1139 -0
- package/src/features/common/Steps/styles.module.scss +314 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/compactStyles.module.scss +383 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/flow-instance.tsx +367 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowCard.tsx +194 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowCardCompact.tsx +389 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowInstanceCompact.tsx +577 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/index.tsx +83 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/styles.module.scss +212 -0
- package/src/features/containers/AppFlowContainer/AppFlowWrap/app-page-loader.tsx +45 -0
- package/src/features/containers/AppFlowContainer/AppFlowWrap/index.tsx +1081 -0
- package/src/features/containers/AppFlowContainer/AppFlowWrap/styles.module.scss +452 -0
- package/src/features/containers/AppFlowContainer/Authentication/index.ts +610 -0
- package/src/features/containers/AppFlowContainer/Authentication/styles.module.scss +468 -0
- package/src/features/containers/AppFlowContainer/index.ts +114 -0
- package/src/features/containers/AppPageContainer/AppPage/index.tsx +262 -0
- package/src/features/containers/AppPageContainer/AppPage/styles.module.scss +120 -0
- package/src/features/containers/AppPageContainer/IntegrationCard/index.ts +165 -0
- package/src/features/containers/AppPageContainer/IntegrationCard/styles.module.scss +81 -0
- package/src/features/containers/AppPageContainer/index.tsx +93 -0
- package/src/features/containers/AppPageContainer/styles.module.scss +0 -0
- package/src/features/containers/AppsForFlows/index.ts +161 -0
- package/src/features/containers/AppsForFlows/styles.module.scss +280 -0
- package/src/features/containers/AppsForFlowsCompact/index.ts +161 -0
- package/src/features/containers/AppsForFlowsCompact/styles.module.scss +279 -0
- package/src/features/containers/AuthSetupContainer/AppSelection.ts +73 -0
- package/src/features/containers/AuthSetupContainer/AuthTypeSelection.ts +67 -0
- package/src/features/containers/AuthSetupContainer/Footer.ts +32 -0
- package/src/features/containers/AuthSetupContainer/Header.ts +39 -0
- package/src/features/containers/AuthSetupContainer/PostAdditionPopup.ts +27 -0
- package/src/features/containers/AuthSetupContainer/index.ts +349 -0
- package/src/features/containers/AuthSetupContainer/styles.module.scss +229 -0
- package/src/features/containers/FlowSetupContainer/index.ts +390 -0
- package/src/features/containers/FlowSetupContainer/styles.module.scss +18 -0
- package/src/features/containers/MarkeplaceApps/index.ts +574 -0
- package/src/features/containers/MarkeplaceApps/styles.module.scss +559 -0
- package/src/features/containers/MarketplaceAppsCompact/index.ts +576 -0
- package/src/features/containers/MarketplaceAppsCompact/styles.module.scss +546 -0
- package/src/features/containers/MarketplaceAppsContainer/index.ts +83 -0
- package/src/features/containers/MarketplaceContainer/AppCard/index.ts +91 -0
- package/src/features/containers/MarketplaceContainer/AppCard/styles.module.scss +66 -0
- package/src/features/containers/MarketplaceContainer/AppListing/index.ts +34 -0
- package/src/features/containers/MarketplaceContainer/AppListing/styles.module.scss +10 -0
- package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/index.ts +132 -0
- package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/styles.module.scss +117 -0
- package/src/features/containers/MarketplaceContainer/index.ts +242 -0
- package/src/features/containers/MarketplaceContainer/styles.module.scss +84 -0
- package/src/features/containers/SDKContainer/index.ts +817 -0
- package/src/features/containers/SDKContainer/styles.module.scss +266 -0
- package/src/features/containers/SDKDebugContainer/index.ts +137 -0
- package/src/features/containers/SDKDebugContainer/styles.module.scss +37 -0
- package/src/features/containers/SDKFailedContainer/index.ts +117 -0
- package/src/features/containers/SDKFailedContainer/styles.module.scss +57 -0
- package/src/features/integrations/IntegrationRow/Icons.ts +77 -0
- package/src/features/integrations/IntegrationRow/index.ts +129 -0
- package/src/features/integrations/IntegrationRow/styles.module.scss +62 -0
- package/src/features/integrations/IntegrationsHeader/index.ts +34 -0
- package/src/features/integrations/IntegrationsHeader/styles.module.scss +47 -0
- package/src/features/integrations/IntegrationsList/index.ts +252 -0
- package/src/features/integrations/IntegrationsList/styles.module.scss +67 -0
- package/src/features/templates/Template/index.ts +295 -0
- package/src/features/templates/Template/styles.module.scss +226 -0
- package/src/features/templates/TemplatesView/index.ts +368 -0
- package/src/features/templates/TemplatesView/styles.module.scss +71 -0
- package/src/features/templates/TemplatesViewCompact/index.ts +364 -0
- package/src/features/templates/TemplatesViewCompact/styles.module.scss +141 -0
- package/src/hooks/useAutosizeTextArea.ts +22 -0
- package/src/hooks/useCustomRef.ts +13 -0
- package/src/hooks/useDebounce.ts +17 -0
- package/src/hooks/useElementResize.ts +40 -0
- package/src/hooks/useEventListener.ts +44 -0
- package/src/hooks/useHover.ts +40 -0
- package/src/hooks/useOnClickOutside.ts +32 -0
- package/src/index.ts +2051 -0
- package/src/index.umd.ts +13 -0
- package/src/interfaces/index.ts +924 -0
- package/src/modules/api/index.ts +1315 -0
- package/src/modules/api/responseHandler.ts +38 -0
- package/src/modules/event-emitter/index.ts +72 -0
- package/src/modules/event-emitter/runners/abstract.ts +21 -0
- package/src/modules/event-emitter/runners/default.ts +11 -0
- package/src/modules/event-emitter/runners/ntimes.ts +28 -0
- package/src/modules/event-emitter/types.ts +34 -0
- package/src/store/actionFunctions.ts +1573 -0
- package/src/store/index.ts +17 -0
- package/src/store/initialState.ts +58 -0
- package/src/stories/Button.stories.tsx +83 -0
- package/src/stories/Checkbox/Checkbox.stories.tsx +41 -0
- package/src/stories/Checkbox/CheckboxGroup.stories.tsx +46 -0
- package/src/stories/EditableText.stories.tsx +35 -0
- package/src/stories/Input/BaseInput.stories.tsx +48 -0
- package/src/stories/Input/DateInput.stories.tsx +28 -0
- package/src/stories/Input/Input.stories.tsx +24 -0
- package/src/stories/Input/PasswordInput.stories.tsx +26 -0
- package/src/stories/Introduction.stories.mdx +211 -0
- package/src/stories/Label.stories.tsx +27 -0
- package/src/stories/Listbox.stories.tsx +122 -0
- package/src/stories/Radio/Radio.stories.tsx +39 -0
- package/src/stories/Radio/RadioGroup.stories.tsx +46 -0
- package/src/stories/StepNavigation/NavItem.stories.tsx +31 -0
- package/src/stories/StepNavigation/StepNavigation.stories.tsx +50 -0
- package/src/stories/TabBar.stories.tsx +31 -0
- package/src/stories/TextArea.stories.tsx +23 -0
- package/src/stories/TimeInput.stories.tsx +37 -0
- package/src/stories/Toggle.stories.tsx +33 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/types/index.ts +293 -0
- package/src/types/store.ts +366 -0
- package/src/types/utils.ts +19 -0
- package/src/utils/ActivityOutputUtils.ts +163 -0
- package/src/utils/common.ts +20 -0
- package/src/utils/copyToClipboard.ts +24 -0
- package/src/utils/datetime.ts +101 -0
- package/src/utils/getUrlParam.ts +11 -0
- package/src/utils/isAuthMessage.ts +16 -0
- package/src/utils/isBrowser.ts +1 -0
- package/src/utils/jsonEncodeDecode.ts +15 -0
- package/src/utils/objectUtils.ts +116 -0
- package/src/utils/popup.ts +30 -0
- package/src/utils/searchJson.ts +51 -0
- package/src/utils/stepUtils.ts +45 -0
- package/src/utils/truncate.ts +6 -0
- package/test/setup.ts +1 -0
- package/vitest.config.ts +10 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { html } from 'htm/preact';
|
|
2
|
+
import { useEffect, useRef, useState } from 'preact/hooks';
|
|
3
|
+
import { useOnClickOutside } from '@/hooks/useOnClickOutside';
|
|
4
|
+
// import useHover from '@/hooks/useHover';
|
|
5
|
+
import useAutosizeTextArea from '@/hooks/useAutosizeTextArea';
|
|
6
|
+
import styles from './styles.module.scss';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
interface EditableTextAreaProps {
|
|
10
|
+
value: string;
|
|
11
|
+
handleChange?: (value: string) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
keepEditingOn?: boolean;
|
|
14
|
+
isContentEditable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* EditableText component
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
const EditableTextArea = (props: EditableTextAreaProps) => {
|
|
22
|
+
const { value, handleChange = () => null, placeholder = 'Enter text here...', keepEditingOn = false, isContentEditable = false } = props;
|
|
23
|
+
|
|
24
|
+
const [isEditing, setIsEditing] = useState(keepEditingOn || false);
|
|
25
|
+
const [editValue, setEditValue] = useState('');
|
|
26
|
+
const textAreaRef = useRef<HTMLTextAreaElement | null>(null);
|
|
27
|
+
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
28
|
+
const contentEditableRef = useRef<HTMLDivElement | null>(null);
|
|
29
|
+
const lastSavedValueRef = useRef<string>(value || '');
|
|
30
|
+
|
|
31
|
+
// const isHovered = useHover(containerRef, isEditing);
|
|
32
|
+
|
|
33
|
+
useAutosizeTextArea(textAreaRef.current, editValue);
|
|
34
|
+
|
|
35
|
+
const determineChangedValue = () => {
|
|
36
|
+
const latestVal = editValue.trim() || '';
|
|
37
|
+
if (latestVal !== lastSavedValueRef.current) {
|
|
38
|
+
handleChange(latestVal);
|
|
39
|
+
lastSavedValueRef.current = latestVal;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
useOnClickOutside(containerRef, () => {
|
|
44
|
+
if (isEditing || keepEditingOn) {
|
|
45
|
+
setIsEditing(false);
|
|
46
|
+
determineChangedValue();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// If released key is our target key then set to false
|
|
51
|
+
const upHandler = ({ key }: { key: string }): void => {
|
|
52
|
+
if (key === 'Enter') {
|
|
53
|
+
// we need to set editable to false
|
|
54
|
+
setIsEditing(false);
|
|
55
|
+
// determineChangedValue();
|
|
56
|
+
} else if (key === 'Escape') {
|
|
57
|
+
setIsEditing(false);
|
|
58
|
+
// revert to original value
|
|
59
|
+
// determineChangedValue();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (textAreaRef && textAreaRef.current && isEditing === true) {
|
|
65
|
+
textAreaRef.current.focus();
|
|
66
|
+
if (textAreaRef && textAreaRef.current) {
|
|
67
|
+
textAreaRef.current?.addEventListener('keyup', upHandler);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Remove event listeners on cleanup
|
|
71
|
+
return () => {
|
|
72
|
+
if (textAreaRef && textAreaRef.current) {
|
|
73
|
+
textAreaRef.current.removeEventListener('keyup', upHandler);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}, [isEditing, textAreaRef]);
|
|
77
|
+
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (value !== editValue) {
|
|
80
|
+
setEditValue(value);
|
|
81
|
+
}
|
|
82
|
+
}, [value]);
|
|
83
|
+
|
|
84
|
+
const handleEditClick = (e: MouseEvent) => {
|
|
85
|
+
if (e.currentTarget instanceof HTMLButtonElement) {
|
|
86
|
+
setIsEditing((prev) => !prev);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
|
+
const handleTextAreaChange = (evt: any) => {
|
|
92
|
+
const val = evt.target?.value;
|
|
93
|
+
console.info('changed', value);
|
|
94
|
+
setEditValue(val);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return html`
|
|
98
|
+
<div ref=${containerRef} class=${styles.editableTextWrapper}>
|
|
99
|
+
${isContentEditable ? html`
|
|
100
|
+
<div class="${styles.editableContentWrap}">
|
|
101
|
+
<span contentEditable=${true}
|
|
102
|
+
dangerouslySetInnerHTML=${{
|
|
103
|
+
__html: value,
|
|
104
|
+
}}
|
|
105
|
+
ref=${contentEditableRef}
|
|
106
|
+
onBlur=${(e: any) => { setEditValue(e.currentTarget?.textContent || '') }}
|
|
107
|
+
class="${styles.editContentSpan}"
|
|
108
|
+
oninput=${(e: any) => { setEditValue(e.currentTarget?.textContent || '') }}
|
|
109
|
+
/>
|
|
110
|
+
${!editValue && html`
|
|
111
|
+
<span class="${styles.placeholder}" onclick=${(e: any) => { contentEditableRef.current?.focus() }}>${placeholder}</span>
|
|
112
|
+
`}
|
|
113
|
+
<button class="${styles.contentEditButton}" onclick=${(e: any) => { contentEditableRef.current?.focus() }}>
|
|
114
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
115
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.838837 15.9777C0.795063 16 0.728973 16 0.662884 16L0.662875 15.9999C0.50922 15.9999 0.333276 15.9339 0.201097 15.8019C0.0251438 15.6262 -0.0409457 15.3631 0.0251438 15.1437L1.36583 10.5588C1.45425 10.3171 1.58556 10.0763 1.76151 9.9006L11.2107 0.444147C11.8037 -0.148049 12.7925 -0.148049 13.3856 0.444147L15.5605 2.61583C15.8464 2.90034 16 3.27402 16 3.69052C16 4.10702 15.8464 4.50211 15.5605 4.78751L6.08987 14.244C5.91392 14.4419 5.67274 14.5731 5.43069 14.639L0.838837 15.9777ZM12.1323 6.36906L9.64921 3.88966L3.12354 10.4055L5.60667 12.8849L12.1323 6.36906ZM12.1762 1.36628C12.2199 1.32257 12.286 1.30029 12.3298 1.30029C12.3959 1.30029 12.4397 1.32257 12.4834 1.36628L14.6584 3.53796C14.7022 3.60395 14.7245 3.66994 14.7245 3.69137C14.7245 3.71365 14.7245 3.80107 14.6584 3.84477L13.0774 5.42511L10.5942 2.94571L12.1762 1.36628ZM4.42044 13.5431L2.4429 11.5685L1.63013 14.3547L4.42044 13.5431Z" fill="#4250F0"/>
|
|
116
|
+
</svg>
|
|
117
|
+
</button>
|
|
118
|
+
</div>
|
|
119
|
+
` : html `
|
|
120
|
+
${(isEditing || keepEditingOn)
|
|
121
|
+
? html`
|
|
122
|
+
<textarea rows="1" class=${styles.input}
|
|
123
|
+
placeholder="${placeholder}"
|
|
124
|
+
ref=${textAreaRef}
|
|
125
|
+
value=${editValue}
|
|
126
|
+
oninput=${handleTextAreaChange}
|
|
127
|
+
/>
|
|
128
|
+
`
|
|
129
|
+
: html` <div class=${styles.value}>${editValue}</div> `}
|
|
130
|
+
${(!isEditing || keepEditingOn) &&
|
|
131
|
+
html`
|
|
132
|
+
<button class=${styles.editButton} onclick=${handleEditClick}>
|
|
133
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
134
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.838837 15.9777C0.795063 16 0.728973 16 0.662884 16L0.662875 15.9999C0.50922 15.9999 0.333276 15.9339 0.201097 15.8019C0.0251438 15.6262 -0.0409457 15.3631 0.0251438 15.1437L1.36583 10.5588C1.45425 10.3171 1.58556 10.0763 1.76151 9.9006L11.2107 0.444147C11.8037 -0.148049 12.7925 -0.148049 13.3856 0.444147L15.5605 2.61583C15.8464 2.90034 16 3.27402 16 3.69052C16 4.10702 15.8464 4.50211 15.5605 4.78751L6.08987 14.244C5.91392 14.4419 5.67274 14.5731 5.43069 14.639L0.838837 15.9777ZM12.1323 6.36906L9.64921 3.88966L3.12354 10.4055L5.60667 12.8849L12.1323 6.36906ZM12.1762 1.36628C12.2199 1.32257 12.286 1.30029 12.3298 1.30029C12.3959 1.30029 12.4397 1.32257 12.4834 1.36628L14.6584 3.53796C14.7022 3.60395 14.7245 3.66994 14.7245 3.69137C14.7245 3.71365 14.7245 3.80107 14.6584 3.84477L13.0774 5.42511L10.5942 2.94571L12.1762 1.36628ZM4.42044 13.5431L2.4429 11.5685L1.63013 14.3547L4.42044 13.5431Z" fill="#4250F0"/>
|
|
135
|
+
</svg>
|
|
136
|
+
</button>
|
|
137
|
+
`}
|
|
138
|
+
`}
|
|
139
|
+
</div>
|
|
140
|
+
`;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export { EditableTextArea, EditableTextAreaProps };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
.editableTextWrapper {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: flex-start;
|
|
4
|
+
width: 100%;
|
|
5
|
+
.input,
|
|
6
|
+
.value {
|
|
7
|
+
display: block;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
font-size: inherit;
|
|
11
|
+
line-height: inherit;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
.input {
|
|
16
|
+
flex: 1;
|
|
17
|
+
overflow: visible;
|
|
18
|
+
font-family: inherit;
|
|
19
|
+
font-size: inherit;
|
|
20
|
+
line-height: inherit;
|
|
21
|
+
color: inherit;
|
|
22
|
+
&:focus {
|
|
23
|
+
outline-offset: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
.input,
|
|
27
|
+
.editButton {
|
|
28
|
+
border: 0;
|
|
29
|
+
outline: 0;
|
|
30
|
+
background: none;
|
|
31
|
+
box-shadow: none;
|
|
32
|
+
text-shadow: none;
|
|
33
|
+
}
|
|
34
|
+
.editButton {
|
|
35
|
+
display: flex;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
align-items: center;
|
|
38
|
+
margin-left: 4px;
|
|
39
|
+
}
|
|
40
|
+
textarea {
|
|
41
|
+
resize: none;
|
|
42
|
+
transition: border-color 150ms ease;
|
|
43
|
+
&::placeholder {
|
|
44
|
+
font-family: inherit;
|
|
45
|
+
font-style: normal;
|
|
46
|
+
font-weight: 400;
|
|
47
|
+
font-size: 16px;
|
|
48
|
+
line-height: 30px;
|
|
49
|
+
color: #E2E0DB;
|
|
50
|
+
}
|
|
51
|
+
::-webkit-scrollbar {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.editableContentWrap {
|
|
56
|
+
.editContentSpan {
|
|
57
|
+
align-items: center;
|
|
58
|
+
font-size: inherit;
|
|
59
|
+
line-height: inherit;
|
|
60
|
+
margin: 0;
|
|
61
|
+
padding: 0;
|
|
62
|
+
font-family: inherit;
|
|
63
|
+
color: inherit;
|
|
64
|
+
&:focus {
|
|
65
|
+
outline-offset: 0;
|
|
66
|
+
}
|
|
67
|
+
border: 0;
|
|
68
|
+
outline: 0;
|
|
69
|
+
background: none;
|
|
70
|
+
box-shadow: none;
|
|
71
|
+
text-shadow: none;
|
|
72
|
+
}
|
|
73
|
+
.placeholder {
|
|
74
|
+
font-family: inherit;
|
|
75
|
+
font-style: normal;
|
|
76
|
+
font-weight: 400;
|
|
77
|
+
font-size: 16px;
|
|
78
|
+
line-height: 30px;
|
|
79
|
+
color: #E2E0DB;
|
|
80
|
+
}
|
|
81
|
+
.contentEditButton {
|
|
82
|
+
border: 0;
|
|
83
|
+
outline: 0;
|
|
84
|
+
background: none;
|
|
85
|
+
box-shadow: none;
|
|
86
|
+
text-shadow: none;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
margin-left: 10px;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FunctionComponent } from 'preact';
|
|
2
|
+
import { html } from 'htm/preact';
|
|
3
|
+
|
|
4
|
+
import styles from './styles.module.scss';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ErrorMessage component
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
const ErrorMessage: FunctionComponent = (props) => {
|
|
11
|
+
const { children } = props;
|
|
12
|
+
|
|
13
|
+
return html` <div class=${styles.errorMessage}>${children}</div> `;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { ErrorMessage };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.errorMessage {
|
|
2
|
+
margin-top: 4px;
|
|
3
|
+
font-size: 12px;
|
|
4
|
+
color: #f05c42;
|
|
5
|
+
font-family: inherit;
|
|
6
|
+
font-style: normal;
|
|
7
|
+
font-weight: normal;
|
|
8
|
+
line-height: 15px;
|
|
9
|
+
padding-left: 3px;
|
|
10
|
+
padding-top: 3px;
|
|
11
|
+
p {
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
color: #f05c42;
|
|
14
|
+
font-family: inherit;
|
|
15
|
+
font-style: normal;
|
|
16
|
+
font-weight: normal;
|
|
17
|
+
line-height: 15px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { html } from 'htm/preact';
|
|
2
|
+
import { StructError } from 'superstruct';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
|
|
5
|
+
import styles from './styles.module.scss';
|
|
6
|
+
|
|
7
|
+
interface ErrorPageProps {
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
errorPayload: Error | StructError | null;
|
|
11
|
+
onDismiss?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* ErrorPage component
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
const ErrorPage = (props: ErrorPageProps) => {
|
|
19
|
+
const { title, description, errorPayload, onDismiss = null } = props;
|
|
20
|
+
|
|
21
|
+
return html`
|
|
22
|
+
<div class="${styles.errorPageWrapper}">
|
|
23
|
+
<div class=${styles.errorTitle}>${title}</div>
|
|
24
|
+
<div class=${styles.errorDescription}>${description}</div>
|
|
25
|
+
${errorPayload &&
|
|
26
|
+
html`
|
|
27
|
+
<div class=${styles.errorContainer}>
|
|
28
|
+
<pre class=${styles.errorPayload}>${errorPayload.message}</pre>
|
|
29
|
+
<pre class=${styles.errorPayload}>${errorPayload.stack}</pre>
|
|
30
|
+
</div>
|
|
31
|
+
`}
|
|
32
|
+
${onDismiss &&
|
|
33
|
+
html`
|
|
34
|
+
<div>
|
|
35
|
+
<${Button} label="Dismiss" onClick=${onDismiss} />
|
|
36
|
+
</div>
|
|
37
|
+
`}
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { ErrorPage, ErrorPageProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.errorPageWrapper {
|
|
2
|
+
font-family: monospace;
|
|
3
|
+
border: 1px solid red;
|
|
4
|
+
padding: 30px;
|
|
5
|
+
.errorTitle {
|
|
6
|
+
color: rgb(182, 23, 23);
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
line-height: 20px;
|
|
10
|
+
margin-bottom: 8px;
|
|
11
|
+
}
|
|
12
|
+
.errorDescription {
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
margin-bottom: 18px;
|
|
15
|
+
}
|
|
16
|
+
.errorContainer {
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
background: #ffebeb;
|
|
19
|
+
padding: 4px;
|
|
20
|
+
margin-bottom: 20px;
|
|
21
|
+
}
|
|
22
|
+
.errorPayload {
|
|
23
|
+
margin: 0;
|
|
24
|
+
padding: 8px 12px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { html } from 'htm/preact';
|
|
2
|
+
import { connect } from 'unistore/preact';
|
|
3
|
+
import { StoreType } from '@/types/store';
|
|
4
|
+
import { actionFunctions } from '@/store/actionFunctions';
|
|
5
|
+
|
|
6
|
+
import styles from './styles.module.scss';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
type SelectProps = {
|
|
10
|
+
style: string;
|
|
11
|
+
} & StoreType;
|
|
12
|
+
|
|
13
|
+
const Footer = (props: SelectProps) => {
|
|
14
|
+
const {
|
|
15
|
+
style = '',
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
return html`
|
|
19
|
+
<div id="embed--footer" class=${styles.embedPreviewFooter} style=${style}>
|
|
20
|
+
<span class=${styles.embedPreviewFooterDesc}>
|
|
21
|
+
Powered by <a class=${styles.embedPreviewFooterCTA} target="_blank" href="https://integry.ai/?utm_source=${props.genericData?.customerAppName}&utm_medium=sdk" rel="noreferrer"><svg style="margin-left: 4px; margin-right: 2px;" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
22
|
+
<path d="M5.9833 11.961V11.961C5.39389 11.961 4.91162 11.479 4.91162 10.8899V1.07111C4.91162 0.481989 5.39389 0 5.9833 0C6.5727 0 7.05492 0.481989 7.05492 1.07111V10.8899C7.05492 11.479 6.5727 11.961 5.9833 11.961" fill="#F05C42"/>
|
|
23
|
+
<path d="M11.9668 5.98046V5.98046C11.9668 6.56958 11.4846 7.05162 10.8951 7.05162H1.07167C0.482268 7.05162 0 6.56958 0 5.98046C0 5.39134 0.482268 4.9093 1.07167 4.9093H10.8951C11.4846 4.9093 11.9668 5.39134 11.9668 5.98046" fill="#FCC700"/>
|
|
24
|
+
<path d="M10.2143 1.75164V1.75164C10.6311 2.16822 10.6311 2.84988 10.2143 3.26646L3.26807 10.2094C2.85129 10.626 2.1693 10.626 1.75252 10.2094C1.33575 9.79278 1.33575 9.11116 1.75252 8.69459L8.69876 1.75164C9.11554 1.33506 9.79753 1.33506 10.2143 1.75164" fill="#3BB568"/>
|
|
25
|
+
<path d="M1.75252 1.75164V1.75164C2.1693 1.33506 2.85129 1.33506 3.26807 1.75164L10.2143 8.69459C10.6311 9.11116 10.6311 9.79278 10.2143 10.2094C9.79753 10.626 9.11554 10.626 8.69876 10.2094L1.75252 3.26646C1.33575 2.84988 1.33575 2.16827 1.75252 1.75164" fill="#509CF6"/>
|
|
26
|
+
</svg>Integry</a>. </span>
|
|
27
|
+
<a class=${styles.embedPreviewFooterCTA} target="_blank" href="https://www.integry.ai/security-policy" rel="noreferrer">
|
|
28
|
+
Privacy Policy
|
|
29
|
+
<!--<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 13 13" fill="none"><path d="M12.0007 4.99975V11.5001C12.0007 12.6006 11.1038 13 10.5008 13H1.49993C0.399356 13 0 12.1032 0 11.5001V2.49924C0 1.39867 0.896835 0.999311 1.49993 0.999311H7.50027C7.77651 0.999311 8.00024 1.22304 8.00024 1.49929C8.00024 1.77553 7.77651 1.99926 7.50027 1.99926H1.49993C1.27494 2.00551 0.99995 2.09676 0.99995 2.49924V11.5001C1.0062 11.7251 1.09745 12 1.49993 12H10.5008C10.7257 11.9938 11.0007 11.9032 11.0007 11.5001V4.99975C11.0007 4.72351 11.2245 4.49978 11.5007 4.49978C11.777 4.49978 12.0007 4.72351 12.0007 4.99975ZM12.5 0H9.50018C9.22394 0 9.00021 0.223733 9.00021 0.499975C9.00021 0.776218 9.22394 0.999951 9.50018 0.999951H11.2263L5.15912 6.63407C4.95726 6.82219 4.94539 7.13842 5.13287 7.34092C5.23162 7.44716 5.36536 7.50029 5.49911 7.50029C5.62098 7.50029 5.74284 7.45654 5.83972 7.36654L12 1.64682V3.49985C12 3.77609 12.2238 3.99983 12.5 3.99983C12.7763 3.99983 13 3.77609 13 3.49985V0.499999C13 0.223757 12.7763 2.40314e-05 12.5 2.40314e-05L12.5 0Z" fill="#4250F0"></path>
|
|
30
|
+
</svg>-->
|
|
31
|
+
</a>
|
|
32
|
+
</div>
|
|
33
|
+
`;
|
|
34
|
+
};
|
|
35
|
+
export default connect<SelectProps, null, StoreType, unknown>(
|
|
36
|
+
[
|
|
37
|
+
'genericData',
|
|
38
|
+
],
|
|
39
|
+
actionFunctions,
|
|
40
|
+
)(Footer);
|
|
41
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.embedPreviewFooter {
|
|
2
|
+
padding-bottom: 12px;
|
|
3
|
+
padding-top: 12px;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
gap: 4px;
|
|
9
|
+
width: 100%;
|
|
10
|
+
box-shadow: 0px -6px 10px 0px rgba(255, 255, 255, 0.8);
|
|
11
|
+
|
|
12
|
+
.embedPreviewFooterDesc {
|
|
13
|
+
color: var(--black-and-grey-draft-and-tooltip-desc, #999);
|
|
14
|
+
font-family: Inter;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
line-height: normal;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: flex-start;
|
|
23
|
+
// gap: 2px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.embedPreviewFooterCTA {
|
|
27
|
+
// color: var(--theme-accent-blue-1, #4250f0);
|
|
28
|
+
color: var(--black-and-grey-draft-and-tooltip-desc, #999);
|
|
29
|
+
font-family: Inter;
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
line-height: normal;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: row;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: flex-start;
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
}
|
|
40
|
+
}
|