@antscorp/antsomi-ui 2.0.119 → 3.0.0-beta.2
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/es/components/atoms/Alert/Alert.d.ts +1 -1
- package/es/components/atoms/Checkbox/Checkbox.d.ts +1 -1
- package/es/components/atoms/Eyedropper/styled.d.ts +1 -1
- package/es/components/atoms/FloatButton/index.d.ts +6 -1
- package/es/components/atoms/Input/Input.d.ts +1 -0
- package/es/components/atoms/Input/styled.d.ts +2 -0
- package/es/components/atoms/NotificationStatus/NotificationStatus.d.ts +1 -1
- package/es/components/atoms/Popover/Popover.d.ts +1 -1
- package/es/components/atoms/PreviewTabs/styled.d.ts +3 -1
- package/es/components/atoms/Radio/index.d.ts +2 -2
- package/es/components/atoms/Segmented/Segmented.d.ts +1 -1
- package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.js +10 -1
- package/es/components/atoms/Space/Space.d.ts +1 -0
- package/es/components/atoms/Steps/styled.d.ts +3 -1
- package/es/components/atoms/Switch/styled.d.ts +1 -1
- package/es/components/atoms/Tag/Tag.d.ts +3 -2
- package/es/components/molecules/AccessDenied/styled.d.ts +3 -1
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +123 -114
- package/es/components/molecules/AddDynamicContent/styled.d.ts +3 -2
- package/es/components/molecules/ApplyPopupContent/styled.d.ts +3 -1
- package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.js +5 -3
- package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.d.ts +1 -1
- package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.js +1 -1
- package/es/components/molecules/CalendarSelection/components/RangePicker/styled.d.ts +12 -2
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +1 -1
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.d.ts +6 -2
- package/es/components/molecules/CalendarSelection/styled.d.ts +1 -1
- package/es/components/molecules/DatePicker/DatePicker.d.ts +73 -7
- package/es/components/molecules/DatePicker/DatePicker.js +7 -6
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +46 -26
- package/es/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +20 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +2 -2
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +2 -0
- package/es/components/molecules/DatePickerV2/index.js +7 -3
- package/es/components/molecules/DisplayFormat/styled.d.ts +2 -1
- package/es/components/molecules/DrawerDetail/DrawerDetail.js +3 -4
- package/es/components/molecules/DrawerDetail/styled.d.ts +3 -1
- package/es/components/molecules/DrawerDetail/types.d.ts +1 -1
- package/es/components/molecules/EditingList/styled.d.ts +6 -2
- package/es/components/molecules/EmojiCollections/CommonCollection/index.js +1 -1
- package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
- package/es/components/molecules/EmptyData/styled.d.ts +3 -1
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +26 -8
- package/es/components/molecules/FontSizeInput/styled.d.ts +1 -1
- package/es/components/molecules/ImageEditor/styled.d.ts +3 -1
- package/es/components/molecules/InputSelectAttribute/index.js +2 -2
- package/es/components/molecules/ItemNotFound/styled.d.ts +3 -1
- package/es/components/molecules/MatchAnySelect/MatchesAnySelect.js +5 -6
- package/es/components/molecules/MatchAnySelect/styled.d.ts +3 -7
- package/es/components/molecules/Modal/Modal.d.ts +1 -1
- package/es/components/molecules/Popconfirm/Popconfirm.d.ts +1 -1
- package/es/components/molecules/PreviewModal/styled.d.ts +3 -1
- package/es/components/molecules/ProcessLoading/styled.d.ts +3 -1
- package/es/components/molecules/RadioGroup/styled.d.ts +1 -1
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +3 -1
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +6 -2
- package/es/components/molecules/SearchPopover/styled.d.ts +1 -0
- package/es/components/molecules/Select/styled.d.ts +3 -1
- package/es/components/molecules/SelectAccount/AccountList.js +2 -2
- package/es/components/molecules/SelectAccount/AccountListOnlyOne.js +2 -2
- package/es/components/molecules/SelectAccount/hook/useGetAbstractUsers.d.ts +2 -2
- package/es/components/molecules/SelectAccount/styled.d.ts +1 -1
- package/es/components/molecules/Tabs/Tabs.d.ts +1 -1
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +1 -1
- package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +1 -1
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.d.ts +3 -1
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +2 -2
- package/es/components/molecules/TemplateSaveAs/styled.d.ts +3 -1
- package/es/components/molecules/Tree/Tree.d.ts +2 -4
- package/es/components/molecules/Tree/styled.d.ts +3 -7
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +1 -1
- package/es/components/molecules/UnsubscribePreview/components/styled.d.ts +6 -3
- package/es/components/molecules/UploadImage/index.js +3 -2
- package/es/components/molecules/VirtualizedMenu/config.js +3 -1
- package/es/components/organism/AccountProfile/components/AccountSetting/styled.d.ts +2 -2
- package/es/components/organism/ActivityTimeline/components/List/styled.d.ts +3 -1
- package/es/components/organism/ActivityTimeline/components/Slide/styled.d.ts +1 -1
- package/es/components/organism/ActivityTimeline/styled.d.ts +6 -2
- package/es/components/organism/AlgorithmsSetting/index.js +3 -3
- package/es/components/organism/AlgorithmsSetting/styled.d.ts +1 -1
- package/es/components/organism/BasicLogin/components/ChooseMethod/styled.d.ts +3 -1
- package/es/components/organism/BasicLogin/components/WidgetLayout/styled.d.ts +3 -1
- package/es/components/organism/BasicLogin/styled.d.ts +9 -6
- package/es/components/organism/ContentSources/Settings.js +40 -41
- package/es/components/organism/DataTable/components/ModifyColumn/styled.d.ts +6 -2
- package/es/components/organism/DataTable/components/Pagination/styled.d.ts +3 -1
- package/es/components/organism/DataTable/components/Table/index.d.ts +1 -1
- package/es/components/organism/DataTable/components/Table/styled.d.ts +2 -2
- package/es/components/organism/DataTable/components/Toolbar/GroupByPopover.d.ts +1 -1
- package/es/components/organism/DataTable/components/Toolbar/styled.d.ts +15 -5
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +7 -5
- package/es/components/organism/DataTable/styled/index.d.ts +6 -2
- package/es/components/organism/DataTable/types/index.d.ts +2 -1
- package/es/components/organism/DataTable/types/toolbar.d.ts +1 -1
- package/es/components/organism/Filter/components/FilterCondition/index.js +1 -1
- package/es/components/organism/Filter/components/FilterCondition/styled.d.ts +3 -1
- package/es/components/organism/Filter/styled.d.ts +12 -4
- package/es/components/organism/FilterSetting/components/common/InputArray/index.js +2 -2
- package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.d.ts +2 -1
- package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.js +4 -4
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.d.ts +0 -1
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.js +3 -1
- package/es/components/organism/FilterSetting/components/common/TextTreeSelect/index.d.ts +1 -1
- package/es/components/organism/FilterSetting/components/common/TextTreeSelect/index.js +2 -2
- package/es/components/organism/Help/queries/useGetListUser.js +4 -1
- package/es/components/organism/Help/styled.d.ts +3 -4
- package/es/components/organism/LeftMenu/components/HomeMenu/styled.d.ts +4 -2
- package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.js +1 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/styled.d.ts +3 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.d.ts +6 -2
- package/es/components/organism/LeftMenu/hooks/usePermission.d.ts +1 -1
- package/es/components/organism/LeftMenu/styled.d.ts +6 -2
- package/es/components/organism/Login/Login.js +12 -3
- package/es/components/organism/Login/components/ChooseMethod/styled.d.ts +3 -1
- package/es/components/organism/Login/components/VerifyAccount/styled.d.ts +1 -3
- package/es/components/organism/Login/components/WidgetLayout/styled.d.ts +3 -1
- package/es/components/organism/Login/styled.d.ts +9 -6
- package/es/components/organism/Login/types/index.d.ts +2 -0
- package/es/components/organism/ModifyColumnModal/styled.d.ts +6 -2
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.d.ts +3 -1
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.d.ts +3 -1
- package/es/components/organism/PreviewTemplateModal/styled.d.ts +1 -1
- package/es/components/organism/SQLGeneration/components/styled.d.ts +2 -1
- package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +2 -2
- package/es/components/organism/TextEditor/styled.d.ts +3 -1
- package/es/components/organism/TicketEditor/styled.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useFetchAccountPermission.js +4 -1
- package/es/components/organism/TicketEditorV2/queries/useGetDetailTicket.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useGetListComments.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useGetListUser.js +4 -1
- package/es/components/organism/TicketEditorV2/styled.d.ts +1 -1
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/styled.d.ts +3 -1
- package/es/components/template/Layout/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/components/BlankTemplate/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/components/Empty/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +2 -3
- package/es/components/template/TemplateListing/styled/index.d.ts +3 -1
- package/es/providers/ConfigProvider/ConfigProvider.d.ts +4 -0
- package/es/providers/ConfigProvider/ConfigProvider.js +2 -3
- package/es/providers/ConfigProvider/GlobalStyle.d.ts +2 -2
- package/es/providers/ConfigProvider/GlobalStyle.js +67 -64
- package/es/queries/AI/index.d.ts +3 -3
- package/es/queries/AI/useSqlGeneration.d.ts +3 -3
- package/es/queries/AI/useSqlGeneration.js +2 -2
- package/es/queries/Account/useGetAccountList.d.ts +3 -3
- package/es/queries/Account/useGetAccountList.js +2 -1
- package/es/queries/BusinessObject/useGetBODetail.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListAllEvents.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListBO.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListEventAttr.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListPromotionCodeAttr.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListSourceByEvent.d.ts +1 -1
- package/es/queries/CustomFunction/useCustomFunction.d.ts +3 -3
- package/es/queries/CustomFunction/useCustomFunction.js +8 -4
- package/es/queries/DataTable/index.d.ts +25 -25
- package/es/queries/DataTable/index.js +26 -19
- package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.d.ts +1 -1
- package/es/queries/LeftMenu/index.d.ts +9 -9
- package/es/queries/LeftMenu/index.js +4 -6
- package/es/queries/Permission/index.d.ts +2 -2
- package/es/queries/PromotionPool/useGetListPromotionPool.d.ts +1 -1
- package/es/queries/TemplateListing/index.d.ts +5 -5
- package/es/queries/TemplateListing/index.js +28 -14
- package/es/queries/ThirdParty/useGetEventTrackingAttributes.d.ts +1 -1
- package/es/queries/ThirdParty/useGetListFallbackBO.d.ts +1 -1
- package/es/queries/ThirdParty/useStoreSavedMedia.d.ts +1 -1
- package/es/queries/ThirdParty/useStoreSavedMedia.js +1 -0
- package/es/queries/Unsubscribe/useGetUnsubscribeList.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeList.js +2 -2
- package/es/queries/Unsubscribe/useGetUnsubscribeListByIdentifier.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.js +2 -2
- package/es/queries/Unsubscribe/useGetUnsubscribePreferences.d.ts +1 -1
- package/es/queries/User/index.d.ts +1 -1
- package/es/queries/User/index.js +11 -7
- package/es/queries/User/userGetUserInfo.js +6 -3
- package/es/utils/color.d.ts +2 -0
- package/es/utils/color.js +30 -0
- package/package.json +40 -47
|
@@ -7,8 +7,8 @@ import { unsubscribeServices, } from '../../services/Unsubscribe';
|
|
|
7
7
|
import { QUERY_KEYS } from '../../constants';
|
|
8
8
|
export const useGetUnsubscribeList = ({ args, options }, infos) => useQuery({
|
|
9
9
|
queryKey: [QUERY_KEYS.GET_UNSUBSCRIBE_LIST, args, options, infos],
|
|
10
|
-
queryFn: async () =>
|
|
11
|
-
|
|
10
|
+
queryFn: async () => {
|
|
11
|
+
const data = await unsubscribeServices.getUnsubscribeList(args, infos);
|
|
12
12
|
if (!data)
|
|
13
13
|
return [];
|
|
14
14
|
const unsubscribedList = data?.entries[0] || [];
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetUnsubscribeListByIdentifierArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribeListByIdentifierProps {
|
|
4
4
|
args: TGetUnsubscribeListByIdentifierArgs;
|
|
5
|
-
options?: UseQueryOptions<any, Error, any>;
|
|
5
|
+
options?: Omit<UseQueryOptions<any, Error, any>, 'queryKey' | 'queryFn'>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGetUnsubscribeListByIdentifier: ({ args, options }: UseGetUnsubscribeListByIdentifierProps, infos: TUnsubscribePayloadInfo) => import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { TGetUnsubscribeListPermissionArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribeListPermissionProps {
|
|
4
4
|
args: TGetUnsubscribeListPermissionArgs;
|
|
5
|
-
options?: UseQueryOptions<any, Error, any>;
|
|
5
|
+
options?: Omit<UseQueryOptions<any, Error, any>, 'queryKey' | 'queryFn'>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGetUnsubscribeListPermission: ({ args, options }: UseGetUnsubscribeListPermissionProps, infos: TUnsubscribePayloadInfo) => import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
8
8
|
export {};
|
|
@@ -6,8 +6,8 @@ import { unsubscribeServices, } from '../../services/Unsubscribe';
|
|
|
6
6
|
import { QUERY_KEYS } from '../../constants';
|
|
7
7
|
export const useGetUnsubscribeListPermission = ({ args, options }, infos) => useQuery({
|
|
8
8
|
queryKey: [QUERY_KEYS.GET_UNSUBSCRIBE_LIST_PERMISSION, args, options, infos],
|
|
9
|
-
queryFn: async () =>
|
|
10
|
-
|
|
9
|
+
queryFn: async () => {
|
|
10
|
+
const data = await unsubscribeServices.getUnsubscribeListPermission(args, infos);
|
|
11
11
|
if (!data)
|
|
12
12
|
return [];
|
|
13
13
|
const unsubscribedList = data?.entries[0] || [];
|
|
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|
|
2
2
|
import { GetUnsubscribePreferencesArgs, TUnsubscribePayloadInfo } from '../../services/Unsubscribe';
|
|
3
3
|
interface UseGetUnsubscribePreferencesProps {
|
|
4
4
|
args: GetUnsubscribePreferencesArgs;
|
|
5
|
-
options?: UseQueryOptions<any, Error, any>;
|
|
5
|
+
options?: Omit<UseQueryOptions<any, Error, any>, 'queryKey' | 'queryFn'>;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* React Query hook to get unsubscribe preferences by given identifier
|
|
@@ -5,4 +5,4 @@ export type TUseGetLoggedUser = {
|
|
|
5
5
|
args: TGetLoggedUserArgs;
|
|
6
6
|
options?: UseQueryOptions<LoggedUser, any, LoggedUser, any[]>;
|
|
7
7
|
};
|
|
8
|
-
export declare const useGetLoggedUser: (params: TUseGetLoggedUser) => import("@tanstack/react-query").UseQueryResult<LoggedUser
|
|
8
|
+
export declare const useGetLoggedUser: (params: TUseGetLoggedUser) => import("@tanstack/react-query").UseQueryResult<NoInfer<LoggedUser>, any>;
|
package/es/queries/User/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
1
2
|
import { useQuery } from '@tanstack/react-query';
|
|
2
3
|
import i18next from '@antscorp/antsomi-ui/es/locales/i18n';
|
|
3
4
|
// Services
|
|
@@ -6,15 +7,18 @@ import { PORTAL_KEYS, QUERY_KEYS } from '../../constants';
|
|
|
6
7
|
import { UserAndPortalDefaultConfig } from '../../utils/portal';
|
|
7
8
|
export const useGetLoggedUser = (params) => {
|
|
8
9
|
const { args, options } = params;
|
|
9
|
-
|
|
10
|
+
const query = useQuery({
|
|
10
11
|
queryKey: [QUERY_KEYS.GET_LOGGED_USER, args],
|
|
11
12
|
queryFn: () => userServices.getLoggedUser(args),
|
|
12
|
-
onSuccess(data) {
|
|
13
|
-
UserAndPortalDefaultConfig.setPartial({
|
|
14
|
-
[PORTAL_KEYS.USER_LANGUAGE]: data.language,
|
|
15
|
-
});
|
|
16
|
-
i18next.changeLanguage(`${data.language || 'en'}`.toLowerCase());
|
|
17
|
-
},
|
|
18
13
|
...options,
|
|
19
14
|
});
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (query.data) {
|
|
17
|
+
UserAndPortalDefaultConfig.setPartial({
|
|
18
|
+
[PORTAL_KEYS.USER_LANGUAGE]: query.data.language,
|
|
19
|
+
});
|
|
20
|
+
i18next.changeLanguage(`${query.data.language || 'en'}`.toLowerCase());
|
|
21
|
+
}
|
|
22
|
+
}, [query.data]);
|
|
23
|
+
return query;
|
|
20
24
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
1
2
|
import { useQuery } from '@tanstack/react-query';
|
|
2
3
|
import { getUserInfo } from '../../services/User';
|
|
3
4
|
import { UserAndPortalDefaultConfig } from '../../utils/portal';
|
|
@@ -19,10 +20,12 @@ export const useGetUserInfo = (appConfig) => {
|
|
|
19
20
|
enabled,
|
|
20
21
|
queryKey,
|
|
21
22
|
queryFn: () => getUserInfo(getUserInfoParams),
|
|
22
|
-
onSuccess: data => {
|
|
23
|
-
UserAndPortalDefaultConfig.set(data.portal, data.user);
|
|
24
|
-
},
|
|
25
23
|
});
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (query.data) {
|
|
26
|
+
UserAndPortalDefaultConfig.set(query.data.portal, query.data.user);
|
|
27
|
+
}
|
|
28
|
+
}, [query.data]);
|
|
26
29
|
return {
|
|
27
30
|
data: query.data,
|
|
28
31
|
isLoading: query.isFetching,
|
package/es/utils/color.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ColorInput } from 'tinycolor2';
|
|
1
2
|
export declare const isDarkColor: (hexcolor: any, alpha?: number) => boolean;
|
|
2
3
|
export declare const hexWithAlpha: (color: ColorResult) => string;
|
|
3
4
|
/**
|
|
@@ -8,3 +9,4 @@ export declare const hexWithAlpha: (color: ColorResult) => string;
|
|
|
8
9
|
*/
|
|
9
10
|
export declare const hexToRgb: (hexCode: string) => [number, number, number];
|
|
10
11
|
export declare const generateHeatMapColor: (value: number, maxValue: number, rgbColor: [number, number, number]) => string;
|
|
12
|
+
export declare function interpolateHSL(colorStart: ColorInput, colorEnd: ColorInput, factor?: number): string;
|
package/es/utils/color.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import tinycolor from 'tinycolor2';
|
|
1
2
|
export const isDarkColor = (hexcolor, alpha) => {
|
|
2
3
|
if (alpha) {
|
|
3
4
|
if (alpha < 0.5) {
|
|
@@ -59,3 +60,32 @@ export const generateHeatMapColor = (value, maxValue, rgbColor) => {
|
|
|
59
60
|
// Return the RGBA color as a string
|
|
60
61
|
return `rgba(${baseRed},${baseGreen},${baseBlue},${normalizedValue})`;
|
|
61
62
|
};
|
|
63
|
+
export function interpolateHSL(colorStart, colorEnd, factor = 0.5) {
|
|
64
|
+
// Convert inputs to tinycolor instances
|
|
65
|
+
const start = tinycolor(colorStart);
|
|
66
|
+
const end = tinycolor(colorEnd);
|
|
67
|
+
// Extract HSL objects
|
|
68
|
+
const hslStart = start.toHsl();
|
|
69
|
+
const hslEnd = end.toHsl();
|
|
70
|
+
// Constrain the factor between 0 and 1
|
|
71
|
+
const t = Math.max(0, Math.min(1, factor));
|
|
72
|
+
// Interpolate Hue (using shortest circular distance)
|
|
73
|
+
let h1 = hslStart.h;
|
|
74
|
+
let h2 = hslEnd.h;
|
|
75
|
+
if (Math.abs(h2 - h1) > 180) {
|
|
76
|
+
if (h2 > h1) {
|
|
77
|
+
h1 += 360;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
h2 += 360;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
console.log('test');
|
|
84
|
+
const h = (h1 + (h2 - h1) * t) % 360;
|
|
85
|
+
// Interpolate Saturation, Lightness, and Alpha linearly
|
|
86
|
+
const s = hslStart.s + (hslEnd.s - hslStart.s) * t;
|
|
87
|
+
const l = hslStart.l + (hslEnd.l - hslStart.l) * t;
|
|
88
|
+
const a = (hslStart.a ?? 1) + ((hslEnd.a ?? 1) - (hslStart.a ?? 1)) * t;
|
|
89
|
+
// Return formatted CSS color string
|
|
90
|
+
return tinycolor({ h, s, l, a }).toRgbString();
|
|
91
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "",
|
|
7
|
+
"files": [
|
|
8
|
+
"es",
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
5
11
|
"sideEffects": [
|
|
6
12
|
"dist/*",
|
|
7
13
|
"es/**/style/*",
|
|
@@ -10,14 +16,10 @@
|
|
|
10
16
|
"**/*.scss",
|
|
11
17
|
"**/*.less"
|
|
12
18
|
],
|
|
13
|
-
"files": [
|
|
14
|
-
"es",
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
19
|
"main": "es/index.js",
|
|
18
20
|
"module": "es/index.js",
|
|
19
|
-
"unpkg": "dist/index.js",
|
|
20
21
|
"types": "es/index.d.ts",
|
|
22
|
+
"unpkg": "dist/index.js",
|
|
21
23
|
"scripts": {
|
|
22
24
|
"prepublishOnly": "yarn && yarn build:es",
|
|
23
25
|
"build:es": "npm run clean && npm run copy-files && npm run ts-compile",
|
|
@@ -25,9 +27,10 @@
|
|
|
25
27
|
"dev": "vite",
|
|
26
28
|
"build:dist": "webpack --config webpack.build.js",
|
|
27
29
|
"build": "npm run clean && npm run build:es && npm run build:dist",
|
|
28
|
-
"
|
|
29
|
-
"lint": "
|
|
30
|
-
"
|
|
30
|
+
"lint": "oxlint src/",
|
|
31
|
+
"lint:fix": "oxlint --fix src/",
|
|
32
|
+
"format": "oxfmt --write src/",
|
|
33
|
+
"format:check": "oxfmt --check src/",
|
|
31
34
|
"storybook": "storybook dev -p 6006",
|
|
32
35
|
"build-storybook": "storybook build",
|
|
33
36
|
"serve-storybook": "serve storybook-static",
|
|
@@ -38,29 +41,14 @@
|
|
|
38
41
|
"ts-compile": "tsc -p tsconfig.esm.json",
|
|
39
42
|
"copy-files": "copyfiles -u 1 \"src/**/*.json\" \"src/**/*.svg\" \"src/**/*.png\" \"src/**/*.scss\" es",
|
|
40
43
|
"icons:export": "sh -e scripts/generate-export-icon.sh",
|
|
41
|
-
"icons:format": "
|
|
44
|
+
"icons:format": "oxfmt --write \"src/components/icons/*.tsx\"",
|
|
42
45
|
"icons:update": "sh -e scripts/update-icons.sh",
|
|
43
46
|
"translate:init": "tsx scripts/translate/goolge-sheet-gen.ts"
|
|
44
47
|
},
|
|
45
|
-
"husky": {
|
|
46
|
-
"hooks": {
|
|
47
|
-
"pre-commit": "lint-staged"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"lint-staged": {
|
|
51
|
-
"*.{ts,tsx,js,jsx}": [
|
|
52
|
-
"yarn lint:fix"
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
"author": "",
|
|
56
|
-
"license": "MIT",
|
|
57
|
-
"browserslist": [
|
|
58
|
-
">0.2%",
|
|
59
|
-
"not dead",
|
|
60
|
-
"not op_mini all"
|
|
61
|
-
],
|
|
62
48
|
"dependencies": {
|
|
63
|
-
"@ant-design/
|
|
49
|
+
"@ant-design/colors": "^7.2.1",
|
|
50
|
+
"@ant-design/cssinjs": "^1.23.0",
|
|
51
|
+
"@ant-design/icons": "^5.6.1",
|
|
64
52
|
"@antscorp/icons": "^0.27.63",
|
|
65
53
|
"@antscorp/image-editor": "1.0.2",
|
|
66
54
|
"@antscorp/processing-notification": "^1.0.3",
|
|
@@ -76,8 +64,9 @@
|
|
|
76
64
|
"@fortawesome/free-solid-svg-icons": "6.1.1",
|
|
77
65
|
"@fortawesome/react-fontawesome": "0.2.0",
|
|
78
66
|
"@swiper/core": "^0.0.21",
|
|
79
|
-
"@tanstack/react-query": "
|
|
80
|
-
"@tanstack/react-query-devtools": "
|
|
67
|
+
"@tanstack/react-query": "^5.62.0",
|
|
68
|
+
"@tanstack/react-query-devtools": "^5.62.0",
|
|
69
|
+
"@tanstack/react-table": "^8.20.5",
|
|
81
70
|
"@tinymce/tinymce-react": "^3.7.0",
|
|
82
71
|
"@tiptap/core": "3.10.2",
|
|
83
72
|
"@tiptap/extension-link": "3.10.2",
|
|
@@ -94,14 +83,14 @@
|
|
|
94
83
|
"@yaireo/tagify": "4.31.2",
|
|
95
84
|
"ace-builds": "1.4.14",
|
|
96
85
|
"animate.css": "^4.1.1",
|
|
97
|
-
"antd": "5
|
|
86
|
+
"antd": "^5",
|
|
98
87
|
"axios": "^1.4.0",
|
|
99
88
|
"babel-plugin-file-loader": "^2.0.0",
|
|
100
89
|
"bignumber.js": "9.1.2",
|
|
101
90
|
"commander": "^12.1.0",
|
|
102
91
|
"currency-formatter": "1.5.9",
|
|
103
92
|
"d3-interpolate": "^3.0.1",
|
|
104
|
-
"dayjs": "^1
|
|
93
|
+
"dayjs": "^1",
|
|
105
94
|
"deepmerge": "^4.3.1",
|
|
106
95
|
"fabric": "^5.3.0",
|
|
107
96
|
"font-awesome": "4.7.0",
|
|
@@ -160,7 +149,6 @@
|
|
|
160
149
|
"devDependencies": {
|
|
161
150
|
"@antscorp/antsomi-constants": "1.0.8-beta.1",
|
|
162
151
|
"@antscorp/antsomi-locales": "^1.0.92",
|
|
163
|
-
"@antscorp/eslint-config-antsomi": "1.0.4",
|
|
164
152
|
"@babel/cli": "^7.23.4",
|
|
165
153
|
"@babel/core": "^7.21.3",
|
|
166
154
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
@@ -205,8 +193,6 @@
|
|
|
205
193
|
"@types/tinycolor2": "^1.4.6",
|
|
206
194
|
"@types/uniqid": "^5.3.4",
|
|
207
195
|
"@types/yaireo__tagify": "^4.27.0",
|
|
208
|
-
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
|
209
|
-
"@typescript-eslint/parser": "^5.55.0",
|
|
210
196
|
"@vitejs/plugin-react": "^4.3.1",
|
|
211
197
|
"@vitest/coverage-v8": "^2.0.5",
|
|
212
198
|
"@vitest/ui": "^2.0.5",
|
|
@@ -221,16 +207,6 @@
|
|
|
221
207
|
"css-loader": "^7.1.2",
|
|
222
208
|
"date-fns": "^2.29.3",
|
|
223
209
|
"esbuild-loader": "^4.0.2",
|
|
224
|
-
"eslint": "^8.36.0",
|
|
225
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
226
|
-
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
227
|
-
"eslint-config-prettier": "^8.8.0",
|
|
228
|
-
"eslint-plugin-import": "^2.27.5",
|
|
229
|
-
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
230
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
231
|
-
"eslint-plugin-react": "^7.32.2",
|
|
232
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
233
|
-
"eslint-plugin-storybook": "^9.1.10",
|
|
234
210
|
"file-loader": "^6.2.0",
|
|
235
211
|
"googleapis": "^142.0.0",
|
|
236
212
|
"husky": "^8.0.3",
|
|
@@ -238,9 +214,10 @@
|
|
|
238
214
|
"jsdom": "^24.1.1",
|
|
239
215
|
"lint-staged": "^13.2.0",
|
|
240
216
|
"mini-css-extract-plugin": "^2.7.5",
|
|
217
|
+
"oxfmt": "^0.56.0",
|
|
218
|
+
"oxlint": "^1.71.0",
|
|
241
219
|
"postcss": "^8.4.41",
|
|
242
220
|
"postcss-loader": "^8.1.1",
|
|
243
|
-
"prettier": "^3.3.3",
|
|
244
221
|
"react": "18.2.0",
|
|
245
222
|
"react-dom": "18.2.0",
|
|
246
223
|
"react-i18next": "11.16.7",
|
|
@@ -272,5 +249,21 @@
|
|
|
272
249
|
"react": ">=16.9.0",
|
|
273
250
|
"react-dom": ">=16.9.0",
|
|
274
251
|
"react-router-dom": ">= 5.1.0"
|
|
275
|
-
}
|
|
252
|
+
},
|
|
253
|
+
"husky": {
|
|
254
|
+
"hooks": {
|
|
255
|
+
"pre-commit": "lint-staged"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"lint-staged": {
|
|
259
|
+
"*.{ts,tsx,js,jsx}": [
|
|
260
|
+
"oxlint --fix",
|
|
261
|
+
"oxfmt --write"
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
"browserslist": [
|
|
265
|
+
">0.2%",
|
|
266
|
+
"not dead",
|
|
267
|
+
"not op_mini all"
|
|
268
|
+
]
|
|
276
269
|
}
|