@integry/sdk 4.5.13 → 4.5.14
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/THIRD_PARTY_LICENSES +1 -1
- package/dist/esm/index.csm.js +1906 -1902
- package/dist/umd/index.umd.js +1906 -1902
- package/package.json +6 -2
- package/src/components/CollapsedMenu/index.ts +8 -5
- package/src/components/MultipurposeField/TagMenu/index.ts +1 -3
- package/src/components/MultipurposeField/index.tsx +1 -1
- package/src/features/common/StepNavigation/CollapsedSteps.ts +8 -2
- package/src/features/common/StepNavigation/index.ts +18 -14
- package/src/features/containers/MarkeplaceApps/index.ts +1 -1
- package/src/features/containers/MarketplaceAppsCompact/index.ts +1 -1
- package/src/hooks/useEventListener.ts +1 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@integry/sdk",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.14",
|
|
4
4
|
"description": "Integry SDK",
|
|
5
5
|
"main": "dist/umd/index.umd.js",
|
|
6
6
|
"module": "dist/esm/index.csm.js",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@babel/preset-env": "^7.26.7",
|
|
38
38
|
"@babel/preset-react": "^7.26.3",
|
|
39
39
|
"@jsdevtools/version-bump-prompt": "^6.1.0",
|
|
40
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
40
41
|
"@rollup/plugin-commonjs": "^18.0.0",
|
|
41
42
|
"@rollup/plugin-json": "^4.1.0",
|
|
42
43
|
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
@@ -92,13 +93,16 @@
|
|
|
92
93
|
"vitest": "^3.0.4"
|
|
93
94
|
},
|
|
94
95
|
"dependencies": {
|
|
96
|
+
"@preact/compat": "^18.3.1",
|
|
95
97
|
"@yaireo/tagify": "^4.21.1",
|
|
96
98
|
"classnames": "^2.3.1",
|
|
97
99
|
"fast-sort": "^3.2.1",
|
|
98
100
|
"fuzzysort": "^1.1.4",
|
|
99
101
|
"htm": "3.1.0",
|
|
100
102
|
"lit": "^3.2.1",
|
|
101
|
-
"preact": "10.2
|
|
103
|
+
"preact": "^10.26.2",
|
|
104
|
+
"react": "^18.3.1",
|
|
105
|
+
"react-dom": "^18.3.1",
|
|
102
106
|
"superstruct": "^0.15.2",
|
|
103
107
|
"unfetch": "^4.2.0",
|
|
104
108
|
"unistore": "^3.5.2"
|
|
@@ -26,7 +26,7 @@ const CollapsedMenu = (props: CollapsedMenuProps) => {
|
|
|
26
26
|
verticalIcon = false,
|
|
27
27
|
} = props;
|
|
28
28
|
|
|
29
|
-
const popupRef = useRef<HTMLDivElement>();
|
|
29
|
+
const popupRef = useRef<HTMLDivElement | null>(null);
|
|
30
30
|
|
|
31
31
|
const [open, setOpen] = useState(false);
|
|
32
32
|
|
|
@@ -85,10 +85,13 @@ const CollapsedMenu = (props: CollapsedMenuProps) => {
|
|
|
85
85
|
<div class=${styles.optionWrap}>
|
|
86
86
|
${options.map(
|
|
87
87
|
(el) =>
|
|
88
|
-
html`<div
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
html`<div
|
|
89
|
+
class=${styles.option}
|
|
90
|
+
onclick=${(event: any) => {
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
onClick(el);
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
92
95
|
${el.label}
|
|
93
96
|
</div>`,
|
|
94
97
|
)}
|
|
@@ -330,9 +330,7 @@ const FieldDropdown = (props: FieldMenuProps) => {
|
|
|
330
330
|
</div>`
|
|
331
331
|
: html` <div className="${styles.mappedFieldMenu}">
|
|
332
332
|
${tagsComponent
|
|
333
|
-
? html
|
|
334
|
-
dangerouslySetInnerHTML=${{ __html: tagsComponent }}
|
|
335
|
-
/>`
|
|
333
|
+
? html`${tagsComponent}`
|
|
336
334
|
: html`${Object.keys(
|
|
337
335
|
!isEditable ? searchJSON(tags, searchValue) : tags,
|
|
338
336
|
).length > 0
|
|
@@ -95,7 +95,7 @@ const MultipurposeField = (props: MultipurposeFieldProps) => {
|
|
|
95
95
|
const [tagify, setTagify] = useState<Tagify | null>(null);
|
|
96
96
|
const [defaultTagifyValue, setDefaultTagifyValue] = useState('');
|
|
97
97
|
|
|
98
|
-
const menuRef = useRef<HTMLDivElement>();
|
|
98
|
+
const menuRef = useRef<HTMLDivElement | null>(null);
|
|
99
99
|
const inputRef = useRef<HTMLInputElement>();
|
|
100
100
|
|
|
101
101
|
const handleTabKeyDown = (event: KeyboardEvent) => {
|
|
@@ -16,9 +16,15 @@ interface CollapsedStepsProps {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const CollapsedSteps = (props: CollapsedStepsProps) => {
|
|
19
|
-
const {
|
|
19
|
+
const {
|
|
20
|
+
steps,
|
|
21
|
+
currentStepIndex,
|
|
22
|
+
isPreviewMode,
|
|
23
|
+
changeStep,
|
|
24
|
+
isReadOnly = false,
|
|
25
|
+
} = props;
|
|
20
26
|
|
|
21
|
-
const collapseRef = useRef<HTMLDivElement>();
|
|
27
|
+
const collapseRef = useRef<HTMLDivElement | null>(null);
|
|
22
28
|
const dotsRef = useRef<HTMLDivElement>();
|
|
23
29
|
|
|
24
30
|
const [showCollapsed, setShowCollapsed] = useState(false);
|
|
@@ -23,7 +23,7 @@ interface ParsedStep {
|
|
|
23
23
|
const StepNavigation = (props: StepNavigationProps) => {
|
|
24
24
|
const MAX_STEP_WIDTH = 220;
|
|
25
25
|
|
|
26
|
-
const wrapRef = useRef<HTMLDivElement>();
|
|
26
|
+
const wrapRef = useRef<HTMLDivElement | null>(null);
|
|
27
27
|
const {
|
|
28
28
|
gotoStep,
|
|
29
29
|
stepState: {
|
|
@@ -59,10 +59,10 @@ const StepNavigation = (props: StepNavigationProps) => {
|
|
|
59
59
|
// console.log('step_width / MAX_WIDTH:', stepsToShow);
|
|
60
60
|
|
|
61
61
|
let itemIndex = -1;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
let stepsLength = steps.length;
|
|
63
|
+
if (isReadOnly) {
|
|
64
|
+
stepsLength = steps.length - 1;
|
|
65
|
+
}
|
|
66
66
|
|
|
67
67
|
if (stepsToShow <= stepsLength) {
|
|
68
68
|
// const canShowComfortably = Math.floor(stepsToShow);
|
|
@@ -140,15 +140,15 @@ const StepNavigation = (props: StepNavigationProps) => {
|
|
|
140
140
|
} else {
|
|
141
141
|
itemIndex += 1;
|
|
142
142
|
// check if more Visible steps can be added
|
|
143
|
-
|
|
143
|
+
composedArray.push({
|
|
144
144
|
type: 'VISIBLE',
|
|
145
145
|
steps: [{ ...steps[itemIndex], itemIndex }],
|
|
146
|
-
});
|
|
146
|
+
});
|
|
147
147
|
|
|
148
148
|
// console.log('Show first, last, collapsed steps in middle');
|
|
149
149
|
composedArray.push({
|
|
150
150
|
type: 'COLLAPSED',
|
|
151
|
-
steps: steps.slice(itemIndex+1, stepsLength).map((el) => {
|
|
151
|
+
steps: steps.slice(itemIndex + 1, stepsLength).map((el) => {
|
|
152
152
|
itemIndex += 1;
|
|
153
153
|
return { ...el, itemIndex };
|
|
154
154
|
}),
|
|
@@ -158,9 +158,7 @@ const StepNavigation = (props: StepNavigationProps) => {
|
|
|
158
158
|
// add the last step always for readOnly mode
|
|
159
159
|
composedArray.push({
|
|
160
160
|
type: 'VISIBLE',
|
|
161
|
-
steps: [
|
|
162
|
-
{ ...steps[stepsLength], itemIndex: stepsLength },
|
|
163
|
-
],
|
|
161
|
+
steps: [{ ...steps[stepsLength], itemIndex: stepsLength }],
|
|
164
162
|
});
|
|
165
163
|
}
|
|
166
164
|
}
|
|
@@ -188,7 +186,10 @@ const StepNavigation = (props: StepNavigationProps) => {
|
|
|
188
186
|
};
|
|
189
187
|
|
|
190
188
|
return html`
|
|
191
|
-
<div
|
|
189
|
+
<div
|
|
190
|
+
class="${styles.navigation} ${'integry-steps-navigation'}"
|
|
191
|
+
ref=${wrapRef}
|
|
192
|
+
>
|
|
192
193
|
${parsedSteps.map((parent) => {
|
|
193
194
|
if (parent.type === 'VISIBLE') {
|
|
194
195
|
return parent.steps.map(
|
|
@@ -212,7 +213,9 @@ const StepNavigation = (props: StepNavigationProps) => {
|
|
|
212
213
|
((context?.isPreviewMode &&
|
|
213
214
|
Number(currentStepIndex) !== el.itemIndex) ||
|
|
214
215
|
Number(currentStepIndex) < el.itemIndex)}
|
|
215
|
-
isLastStep=${isReadOnly
|
|
216
|
+
isLastStep=${isReadOnly
|
|
217
|
+
? el.itemIndex === steps.length - 1
|
|
218
|
+
: el.itemIndex === steps.length}
|
|
216
219
|
onClick=${() => changeStep(el.itemIndex)}
|
|
217
220
|
isReadOnly=${isReadOnly}
|
|
218
221
|
/>
|
|
@@ -233,7 +236,8 @@ const StepNavigation = (props: StepNavigationProps) => {
|
|
|
233
236
|
}
|
|
234
237
|
return html`<></>`;
|
|
235
238
|
})}
|
|
236
|
-
${parsedSteps.length > 0 &&
|
|
239
|
+
${parsedSteps.length > 0 &&
|
|
240
|
+
!isReadOnly &&
|
|
237
241
|
html`
|
|
238
242
|
<${NavItem}
|
|
239
243
|
label="Confirmation"
|
|
@@ -158,7 +158,7 @@ const MarketplaceApps = (props: any) => {
|
|
|
158
158
|
const [allowMultipleAuths, setAllowMultipleAuth] = useState<boolean>(true);
|
|
159
159
|
|
|
160
160
|
const DEBOUNCE_DELAY = 500;
|
|
161
|
-
const debounceTimeout = useRef<ReturnType<typeof setTimeout
|
|
161
|
+
const debounceTimeout = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
162
162
|
|
|
163
163
|
const getApps = ({
|
|
164
164
|
currentApps = <any>[],
|
|
@@ -161,7 +161,7 @@ const MarketplaceAppsCompact = (props: any) => {
|
|
|
161
161
|
const [allowMultipleAuths, setAllowMultipleAuth] = useState<boolean>(true);
|
|
162
162
|
|
|
163
163
|
const DEBOUNCE_DELAY = 500;
|
|
164
|
-
const debounceTimeout = useRef<ReturnType<typeof setTimeout
|
|
164
|
+
const debounceTimeout = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
165
165
|
|
|
166
166
|
const getApps = ({
|
|
167
167
|
currentApps = <any>[],
|
|
@@ -7,9 +7,7 @@ function useEventListener<T extends HTMLElement = HTMLDivElement>(
|
|
|
7
7
|
element?: RefObject<T>,
|
|
8
8
|
) {
|
|
9
9
|
// Create a ref that stores handler
|
|
10
|
-
const savedHandler
|
|
11
|
-
(event: Event) => void
|
|
12
|
-
>();
|
|
10
|
+
const savedHandler = useRef<((event: Event) => void) | null>(null);
|
|
13
11
|
|
|
14
12
|
useEffect(() => {
|
|
15
13
|
// Define the listening target
|