@algorithm-shift/design-system 1.2.986 → 1.2.988
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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -36,6 +36,7 @@ interface ImageProps extends ElementProps {
|
|
|
36
36
|
enableUpload?: boolean;
|
|
37
37
|
onSuccess?: (data: { url: string; fileName: string }) => void;
|
|
38
38
|
axiosInstance?: typeof axios;
|
|
39
|
+
apiUrl?: string;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
type InputProperties = {
|
|
@@ -304,7 +305,7 @@ declare const _default$2: typeof Repeater;
|
|
|
304
305
|
|
|
305
306
|
declare const ButtonWrapper: ({ className, style, textContent, loadingText, loading, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
306
307
|
|
|
307
|
-
declare const ImageControl: ({ className, style, imageUrl, altText, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
|
|
308
|
+
declare const ImageControl: ({ className, style, imageUrl, altText, apiUrl, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
|
|
308
309
|
|
|
309
310
|
declare const Shape: ({ children, className, style }: ElementProps) => react_jsx_runtime.JSX.Element;
|
|
310
311
|
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ interface ImageProps extends ElementProps {
|
|
|
36
36
|
enableUpload?: boolean;
|
|
37
37
|
onSuccess?: (data: { url: string; fileName: string }) => void;
|
|
38
38
|
axiosInstance?: typeof axios;
|
|
39
|
+
apiUrl?: string;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
type InputProperties = {
|
|
@@ -304,7 +305,7 @@ declare const _default$2: typeof Repeater;
|
|
|
304
305
|
|
|
305
306
|
declare const ButtonWrapper: ({ className, style, textContent, loadingText, loading, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
306
307
|
|
|
307
|
-
declare const ImageControl: ({ className, style, imageUrl, altText, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
|
|
308
|
+
declare const ImageControl: ({ className, style, imageUrl, altText, apiUrl, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
|
|
308
309
|
|
|
309
310
|
declare const Shape: ({ children, className, style }: ElementProps) => react_jsx_runtime.JSX.Element;
|
|
310
311
|
|
package/dist/index.js
CHANGED
|
@@ -447,7 +447,7 @@ function useFileService(options) {
|
|
|
447
447
|
formData.append(key, value);
|
|
448
448
|
});
|
|
449
449
|
const axiosClient = options.axiosInstance ?? import_axios.default;
|
|
450
|
-
const apiUrl = "/fileservice/upload";
|
|
450
|
+
const apiUrl = options.apiUrl ?? "/fileservice/upload";
|
|
451
451
|
const result = await axiosClient.post(`${apiUrl}`, formData, {
|
|
452
452
|
withCredentials: true
|
|
453
453
|
});
|
|
@@ -519,6 +519,7 @@ var ImageControl = ({
|
|
|
519
519
|
style,
|
|
520
520
|
imageUrl,
|
|
521
521
|
altText = "Preview",
|
|
522
|
+
apiUrl,
|
|
522
523
|
...props
|
|
523
524
|
}) => {
|
|
524
525
|
const defaultImgClass = cn(
|
|
@@ -535,6 +536,7 @@ var ImageControl = ({
|
|
|
535
536
|
};
|
|
536
537
|
const { uploadFile } = useFileService({
|
|
537
538
|
axiosInstance: props.axiosInstance,
|
|
539
|
+
apiUrl,
|
|
538
540
|
onSuccess: async (result) => {
|
|
539
541
|
if (!result?.data?.url && !props.onSuccess) return;
|
|
540
542
|
props.onSuccess?.({ url: result.data.url || "", fileName: result.data.originalname || "" });
|
|
@@ -5153,8 +5155,15 @@ var StagesComponent = ({
|
|
|
5153
5155
|
triggerOnClick = false,
|
|
5154
5156
|
canvasMode = "desktop"
|
|
5155
5157
|
}) => {
|
|
5156
|
-
const [activeStage, setActiveStage] = (0, import_react33.useState)(
|
|
5158
|
+
const [activeStage, setActiveStage] = (0, import_react33.useState)("");
|
|
5157
5159
|
const [isCompleted, setIsCompleted] = (0, import_react33.useState)(false);
|
|
5160
|
+
(0, import_react33.useEffect)(() => {
|
|
5161
|
+
if (currentStage) {
|
|
5162
|
+
setActiveStage(currentStage);
|
|
5163
|
+
} else {
|
|
5164
|
+
setActiveStage(stages && stages.length > 0 ? stages[0][dataKey] : null);
|
|
5165
|
+
}
|
|
5166
|
+
}, [currentStage]);
|
|
5158
5167
|
const updateStage = (stageKey) => {
|
|
5159
5168
|
setActiveStage(stageKey);
|
|
5160
5169
|
onStageChange?.(stageKey);
|
|
@@ -5169,7 +5178,7 @@ var StagesComponent = ({
|
|
|
5169
5178
|
return;
|
|
5170
5179
|
}
|
|
5171
5180
|
if (currentIndex < stages.length - 1) {
|
|
5172
|
-
const nextStageObj = stages[currentIndex
|
|
5181
|
+
const nextStageObj = stages[currentIndex];
|
|
5173
5182
|
updateStage(nextStageObj[dataKey]);
|
|
5174
5183
|
return;
|
|
5175
5184
|
}
|