@zohodesk/dot 1.0.0-temp-195 → 1.0.0-temp-193.11
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/.cli/UnValidatedFiles.html +1 -1
- package/es/ActionButton/ActionButton.module.css +192 -192
- package/es/AlphabeticList/AlphabeticList.module.css +57 -57
- package/es/AttachmentViewer/AttachmentViewer.module.css +352 -352
- package/es/ChannelIcon/ChannelIcon.module.css +225 -225
- package/es/FormAction/FormAction.module.css +100 -100
- package/es/IconButton/IconButton.module.css +22 -22
- package/es/TagWithIcon/TagWithIcon.module.css +66 -66
- package/es/avatar/AvatarIcon/AvatarIcon.module.css +58 -58
- package/es/common/dot_boxShadow.module.css +0 -2
- package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +92 -92
- package/es/form/fields/ValidationMessage/ValidationMessage.module.css +27 -27
- package/es/layout/SubtabLayout/SubtabLayout.module.css +164 -164
- package/es/list/Comment/Comment.module.css +29 -29
- package/es/list/Dot/Dot.module.css +15 -15
- package/es/list/ListLayout/ListLayout.module.css +79 -79
- package/es/list/Subject/Subject.module.css +34 -34
- package/es/list/Thread/Thread.module.css +42 -42
- package/es/v1/DotProvider/DotProvider.js +60 -0
- package/es/v1/DotProvider/hooks/useDotProvider.js +55 -0
- package/es/v1/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +94 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +3 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/green/Green_Dark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/green/Green_Light_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/red/Red_Dark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/red/Red_Light_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/green/Green_Dark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/green/Green_Light_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/red/Red_Dark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/red/Red_Light_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +1 -0
- package/es/v1/DotProvider/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +1 -0
- package/es/v1/DotProvider/props/defaultProps.js +11 -0
- package/es/v1/DotProvider/props/propTypes.js +16 -0
- package/es/v1/DotProvider/utils/assetPromiseHandlers.js +61 -0
- package/es/v1/DotProvider/utils/constants.js +14 -0
- package/es/v1/DotProvider/utils/errorValidation.js +14 -0
- package/es/v1/DotProvider/utils/getAssetsImportPromises.js +17 -0
- package/es/v1/DotProvider/utils/sizeAssetsConfig.js +12 -0
- package/es/v1/DotProvider/utils/themeAppearanceAssetsConfig.js +47 -0
- package/es/v1/DotProvider/utils/themeColorAssetsConfig.js +221 -0
- package/es/version2/GlobalNotification/GlobalNotification.module.css +177 -177
- package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +87 -87
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +132 -132
- package/lib/ActionButton/ActionButton.module.css +192 -192
- package/lib/AlphabeticList/AlphabeticList.module.css +57 -57
- package/lib/AttachmentViewer/AttachmentViewer.module.css +352 -352
- package/lib/ChannelIcon/ChannelIcon.module.css +225 -225
- package/lib/FormAction/FormAction.module.css +100 -100
- package/lib/IconButton/IconButton.module.css +22 -22
- package/lib/TagWithIcon/TagWithIcon.module.css +66 -66
- package/lib/avatar/AvatarIcon/AvatarIcon.module.css +58 -58
- package/lib/common/dot_boxShadow.module.css +0 -2
- package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +92 -92
- package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +27 -27
- package/lib/layout/SubtabLayout/SubtabLayout.module.css +164 -164
- package/lib/list/Comment/Comment.module.css +29 -29
- package/lib/list/Dot/Dot.module.css +15 -15
- package/lib/list/ListLayout/ListLayout.module.css +79 -79
- package/lib/list/Subject/Subject.module.css +34 -34
- package/lib/list/Thread/Thread.module.css +42 -42
- package/lib/v1/DotProvider/DotProvider.js +88 -0
- package/lib/v1/DotProvider/hooks/useDotProvider.js +83 -0
- package/lib/v1/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +113 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +7 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/green/Green_Dark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/green/Green_Light_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/red/Red_Dark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/red/Red_Light_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/green/Green_Dark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/green/Green_Light_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/red/Red_Dark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/red/Red_Light_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +3 -0
- package/lib/v1/DotProvider/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +3 -0
- package/lib/v1/DotProvider/props/defaultProps.js +20 -0
- package/lib/v1/DotProvider/props/propTypes.js +28 -0
- package/lib/v1/DotProvider/utils/assetPromiseHandlers.js +80 -0
- package/lib/v1/DotProvider/utils/constants.js +34 -0
- package/lib/v1/DotProvider/utils/errorValidation.js +22 -0
- package/lib/v1/DotProvider/utils/getAssetsImportPromises.js +22 -0
- package/lib/v1/DotProvider/utils/sizeAssetsConfig.js +31 -0
- package/lib/v1/DotProvider/utils/themeAppearanceAssetsConfig.js +69 -0
- package/lib/v1/DotProvider/utils/themeColorAssetsConfig.js +249 -0
- package/lib/version2/GlobalNotification/GlobalNotification.module.css +177 -177
- package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +87 -87
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +132 -132
- package/package.json +2 -2
- package/result.json +1 -1
- package/unittest/index.html +1 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
.varClass {
|
|
2
|
-
--icon_color: var(--zdt_thread_iconText);
|
|
3
|
-
}
|
|
4
|
-
.container {
|
|
5
|
-
composes: varClass;
|
|
6
|
-
position: relative;
|
|
7
|
-
color: var(--icon_color);
|
|
8
|
-
cursor: pointer;
|
|
9
|
-
}
|
|
10
|
-
.container:hover {
|
|
11
|
-
--icon_color: var(--zdt_thread_hover_iconText);
|
|
12
|
-
}
|
|
13
|
-
.count {
|
|
14
|
-
font-size: var(--zd_font_size9) ;
|
|
15
|
-
}
|
|
16
|
-
.align_left .count {
|
|
17
|
-
position: absolute;
|
|
18
|
-
line-height: normal;
|
|
19
|
-
top: var(--zd_size3) ;
|
|
20
|
-
}
|
|
21
|
-
[dir=ltr] .align_left .count {
|
|
22
|
-
text-align: left;
|
|
23
|
-
left: var(--zd_size8) ;
|
|
24
|
-
}
|
|
25
|
-
[dir=rtl] .align_left .count {
|
|
26
|
-
text-align: right;
|
|
27
|
-
right: var(--zd_size8) ;
|
|
28
|
-
}
|
|
29
|
-
.align_right {
|
|
30
|
-
composes: dInflex alignFend from '~@zohodesk/components/lib/common/common.module.css';
|
|
31
|
-
}
|
|
32
|
-
.align_right .count {
|
|
33
|
-
position: relative;
|
|
34
|
-
bottom: var(--zd_size2) ;
|
|
35
|
-
}
|
|
36
|
-
[dir=ltr] .align_right .count {
|
|
37
|
-
right: var(--zd_size5) ;
|
|
38
|
-
float: right;
|
|
39
|
-
}
|
|
40
|
-
[dir=rtl] .align_right .count {
|
|
41
|
-
left: var(--zd_size5) ;
|
|
42
|
-
float: left;
|
|
1
|
+
.varClass {
|
|
2
|
+
--icon_color: var(--zdt_thread_iconText);
|
|
3
|
+
}
|
|
4
|
+
.container {
|
|
5
|
+
composes: varClass;
|
|
6
|
+
position: relative;
|
|
7
|
+
color: var(--icon_color);
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
}
|
|
10
|
+
.container:hover {
|
|
11
|
+
--icon_color: var(--zdt_thread_hover_iconText);
|
|
12
|
+
}
|
|
13
|
+
.count {
|
|
14
|
+
font-size: var(--zd_font_size9) ;
|
|
15
|
+
}
|
|
16
|
+
.align_left .count {
|
|
17
|
+
position: absolute;
|
|
18
|
+
line-height: normal;
|
|
19
|
+
top: var(--zd_size3) ;
|
|
20
|
+
}
|
|
21
|
+
[dir=ltr] .align_left .count {
|
|
22
|
+
text-align: left;
|
|
23
|
+
left: var(--zd_size8) ;
|
|
24
|
+
}
|
|
25
|
+
[dir=rtl] .align_left .count {
|
|
26
|
+
text-align: right;
|
|
27
|
+
right: var(--zd_size8) ;
|
|
28
|
+
}
|
|
29
|
+
.align_right {
|
|
30
|
+
composes: dInflex alignFend from '~@zohodesk/components/lib/common/common.module.css';
|
|
31
|
+
}
|
|
32
|
+
.align_right .count {
|
|
33
|
+
position: relative;
|
|
34
|
+
bottom: var(--zd_size2) ;
|
|
35
|
+
}
|
|
36
|
+
[dir=ltr] .align_right .count {
|
|
37
|
+
right: var(--zd_size5) ;
|
|
38
|
+
float: right;
|
|
39
|
+
}
|
|
40
|
+
[dir=rtl] .align_right .count {
|
|
41
|
+
left: var(--zd_size5) ;
|
|
42
|
+
float: left;
|
|
43
43
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { useRef, useCallback, forwardRef } from "react";
|
|
2
|
+
import { defaultProps } from "./props/defaultProps";
|
|
3
|
+
import { propTypes } from "./props/propTypes";
|
|
4
|
+
import useDotProvider from "./hooks/useDotProvider";
|
|
5
|
+
const DotProvider = /*#__PURE__*/forwardRef((props, ref) => {
|
|
6
|
+
const {
|
|
7
|
+
ui_tag: Element = 'div',
|
|
8
|
+
ui_themeAppearance,
|
|
9
|
+
ui_themeColor,
|
|
10
|
+
ui_baseZoomUnit,
|
|
11
|
+
ui_baseFontUnit,
|
|
12
|
+
data_zoomUnitVariable,
|
|
13
|
+
data_fontUnitVariable,
|
|
14
|
+
data_themeAppearanceAttr,
|
|
15
|
+
data_themeColorAttr,
|
|
16
|
+
method_providerRef,
|
|
17
|
+
method_onAssetsDownloadSuccess,
|
|
18
|
+
method_getAssetsPromises,
|
|
19
|
+
children,
|
|
20
|
+
...rest
|
|
21
|
+
} = props;
|
|
22
|
+
const wrapperElementRef = useRef(null);
|
|
23
|
+
const getProviderElement = useCallback(() => {
|
|
24
|
+
if (typeof method_providerRef === 'function') {
|
|
25
|
+
return method_providerRef();
|
|
26
|
+
} else if (Element !== React.Fragment) {
|
|
27
|
+
return wrapperElementRef.current;
|
|
28
|
+
} else {
|
|
29
|
+
return document.documentElement;
|
|
30
|
+
}
|
|
31
|
+
}, [method_providerRef, Element]);
|
|
32
|
+
const getEleRef = useCallback(ele => {
|
|
33
|
+
wrapperElementRef.current = ele;
|
|
34
|
+
|
|
35
|
+
if (ref && typeof ref === 'function') {
|
|
36
|
+
ref(ele);
|
|
37
|
+
} else if (ref && typeof ref === 'object') {
|
|
38
|
+
ref.current = ele;
|
|
39
|
+
}
|
|
40
|
+
}, [ref]);
|
|
41
|
+
useDotProvider({
|
|
42
|
+
themeAppearance: ui_themeAppearance,
|
|
43
|
+
themeColor: ui_themeColor,
|
|
44
|
+
themeAppearanceAttr: data_themeAppearanceAttr,
|
|
45
|
+
themeColorAttr: data_themeColorAttr,
|
|
46
|
+
baseZoomUnit: ui_baseZoomUnit,
|
|
47
|
+
baseFontUnit: ui_baseFontUnit,
|
|
48
|
+
zoomUnitVariable: data_zoomUnitVariable,
|
|
49
|
+
fontUnitVariable: data_fontUnitVariable,
|
|
50
|
+
getProviderElement,
|
|
51
|
+
onAssetsDownloadSuccess: method_onAssetsDownloadSuccess,
|
|
52
|
+
getAssetsPromises: method_getAssetsPromises
|
|
53
|
+
});
|
|
54
|
+
return /*#__PURE__*/React.createElement(Element, { ...rest,
|
|
55
|
+
ref: getEleRef
|
|
56
|
+
}, children);
|
|
57
|
+
});
|
|
58
|
+
DotProvider.propTypes = propTypes;
|
|
59
|
+
DotProvider.defaultProps = defaultProps;
|
|
60
|
+
export default DotProvider;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
import useDownloadAssetsAndSetAttr from "./useDownloadAssetsAndSetAttr";
|
|
3
|
+
import '@zohodesk/components/assets/Contrast/lightContrastLightness.module.css';
|
|
4
|
+
import '@zohodesk/components/assets/Contrast/darkContrastLightness.module.css';
|
|
5
|
+
import '@zohodesk/components/assets/Contrast/pureDarkContrastLightness.module.css';
|
|
6
|
+
import '@zohodesk/variables/assets/colorVariables.module.css';
|
|
7
|
+
import '@zohodesk/variables/assets/dotVariables.module.css';
|
|
8
|
+
import '@zohodesk/components/es/common/basic.module.css';
|
|
9
|
+
import '@zohodesk/variables/lib/fontFamilyVariables.module.css';
|
|
10
|
+
import '@zohodesk/components/lib/common/boxShadow.module.css';
|
|
11
|
+
import "../../../common/dot_boxShadow.module.css";
|
|
12
|
+
|
|
13
|
+
function useDotProvider(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
themeAppearance,
|
|
16
|
+
themeColor,
|
|
17
|
+
baseZoomUnit,
|
|
18
|
+
baseFontUnit,
|
|
19
|
+
getProviderElement,
|
|
20
|
+
zoomUnitVariable,
|
|
21
|
+
fontUnitVariable,
|
|
22
|
+
themeAppearanceAttr,
|
|
23
|
+
themeColorAttr,
|
|
24
|
+
onAssetsDownloadSuccess,
|
|
25
|
+
getAssetsPromises
|
|
26
|
+
} = _ref;
|
|
27
|
+
const assetsPromises = useDownloadAssetsAndSetAttr({
|
|
28
|
+
themeAppearance,
|
|
29
|
+
themeColor,
|
|
30
|
+
baseZoomUnit,
|
|
31
|
+
baseFontUnit,
|
|
32
|
+
getProviderElement,
|
|
33
|
+
zoomUnitVariable,
|
|
34
|
+
fontUnitVariable,
|
|
35
|
+
themeAppearanceAttr,
|
|
36
|
+
themeColorAttr
|
|
37
|
+
});
|
|
38
|
+
const {
|
|
39
|
+
themeAppearancePromise,
|
|
40
|
+
themeColorPromise,
|
|
41
|
+
zoomSizePromise,
|
|
42
|
+
fontSizePromise
|
|
43
|
+
} = assetsPromises;
|
|
44
|
+
const allPromises = [...themeAppearancePromise, ...themeColorPromise, zoomSizePromise, fontSizePromise];
|
|
45
|
+
useLayoutEffect(() => {
|
|
46
|
+
Promise.all(allPromises).then(() => {
|
|
47
|
+
typeof onAssetsDownloadSuccess === 'function' && onAssetsDownloadSuccess();
|
|
48
|
+
}).catch(error => {
|
|
49
|
+
console.error('Error loading assets:', error);
|
|
50
|
+
});
|
|
51
|
+
typeof getAssetsPromises === 'function' && getAssetsPromises(assetsPromises);
|
|
52
|
+
}, [...allPromises]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default useDotProvider;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { useMemo, useLayoutEffect } from 'react';
|
|
2
|
+
import { getThemeAppearanceAssetPromise, getThemeColorAssetPromise, getZoomSizeAssetPromise, getFontSizeAssetPromise } from "../utils/assetPromiseHandlers";
|
|
3
|
+
export default function useDownloadAssetsAndSetAttr(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
themeAppearance,
|
|
6
|
+
themeColor,
|
|
7
|
+
baseZoomUnit,
|
|
8
|
+
baseFontUnit,
|
|
9
|
+
getProviderElement,
|
|
10
|
+
zoomUnitVariable,
|
|
11
|
+
fontUnitVariable,
|
|
12
|
+
themeAppearanceAttr,
|
|
13
|
+
themeColorAttr
|
|
14
|
+
} = _ref;
|
|
15
|
+
const themeAppearancePromise = useMemo(() => {
|
|
16
|
+
const themeAppearanceAssetPromise = getThemeAppearanceAssetPromise({
|
|
17
|
+
themeAppearance
|
|
18
|
+
});
|
|
19
|
+
return themeAppearanceAssetPromise;
|
|
20
|
+
}, [themeAppearance]);
|
|
21
|
+
const themeColorPromise = useMemo(() => {
|
|
22
|
+
const themeColorAssetPromise = getThemeColorAssetPromise({
|
|
23
|
+
themeAppearance,
|
|
24
|
+
themeColor
|
|
25
|
+
});
|
|
26
|
+
return themeColorAssetPromise;
|
|
27
|
+
}, [themeAppearance, themeColor]);
|
|
28
|
+
const modifiedZoomUnitWithSuffix = useMemo(() => {
|
|
29
|
+
return !isNaN(Number(baseZoomUnit)) ? `${Number(baseZoomUnit)}px` : baseZoomUnit;
|
|
30
|
+
}, [baseZoomUnit]);
|
|
31
|
+
const zoomSizePromise = useMemo(() => {
|
|
32
|
+
const assetPromise = getZoomSizeAssetPromise();
|
|
33
|
+
return assetPromise;
|
|
34
|
+
}, []);
|
|
35
|
+
const fontSizePromise = useMemo(() => {
|
|
36
|
+
const assetPromise = getFontSizeAssetPromise();
|
|
37
|
+
return assetPromise;
|
|
38
|
+
}, []);
|
|
39
|
+
const combinedPromise = {
|
|
40
|
+
themeAppearancePromise,
|
|
41
|
+
themeColorPromise,
|
|
42
|
+
zoomSizePromise,
|
|
43
|
+
fontSizePromise
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function setThemeAttribute() {
|
|
47
|
+
const themePromise = [...themeAppearancePromise, ...themeColorPromise];
|
|
48
|
+
Promise.all(themePromise).then(() => {
|
|
49
|
+
const providerElement = getProviderElement();
|
|
50
|
+
|
|
51
|
+
if (providerElement) {
|
|
52
|
+
providerElement.setAttribute(themeAppearanceAttr, themeAppearance);
|
|
53
|
+
providerElement.setAttribute(themeColorAttr, themeColor);
|
|
54
|
+
}
|
|
55
|
+
}).catch(error => {
|
|
56
|
+
console.error('Error on setting theme appearance and color attributes:', error);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function setZoomSizeAttribute() {
|
|
61
|
+
zoomSizePromise.then(() => {
|
|
62
|
+
const providerElement = getProviderElement();
|
|
63
|
+
|
|
64
|
+
if (providerElement) {
|
|
65
|
+
providerElement.style.setProperty(zoomUnitVariable, modifiedZoomUnitWithSuffix);
|
|
66
|
+
}
|
|
67
|
+
}).catch(error => {
|
|
68
|
+
console.error('Error on setting zoom-size property', error);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function setFontSizeAttribute() {
|
|
73
|
+
fontSizePromise.then(() => {
|
|
74
|
+
const providerElement = getProviderElement();
|
|
75
|
+
|
|
76
|
+
if (providerElement) {
|
|
77
|
+
providerElement.style.setProperty(fontUnitVariable, baseFontUnit);
|
|
78
|
+
}
|
|
79
|
+
}).catch(error => {
|
|
80
|
+
console.error('Error on setting font-size property', error);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
useLayoutEffect(() => {
|
|
85
|
+
setThemeAttribute();
|
|
86
|
+
}, [themeAppearanceAttr, themeColorAttr, themeAppearance, themeColor, getProviderElement]);
|
|
87
|
+
useLayoutEffect(() => {
|
|
88
|
+
setZoomSizeAttribute();
|
|
89
|
+
}, [zoomUnitVariable, modifiedZoomUnitWithSuffix, getProviderElement]);
|
|
90
|
+
useLayoutEffect(() => {
|
|
91
|
+
setFontSizeAttribute();
|
|
92
|
+
}, [fontUnitVariable, baseFontUnit, getProviderElement]);
|
|
93
|
+
return combinedPromise;
|
|
94
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/blue/blue_CTA_DarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/blue/blue_CTA_DarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/green/green_CTA_DarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/green/green_CTA_DarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/light/themes/green/green_CTA_LightTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/light/themes/green/green_CTA_LightModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/orange/orange_CTA_DarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/orange/orange_CTA_DarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/light/themes/orange/orange_CTA_LightTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/light/themes/orange/orange_CTA_LightModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/red/red_CTA_DarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/red/red_CTA_DarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/light/themes/red/red_CTA_LightTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/light/themes/red/red_CTA_LightModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/light/themes/yellow/yellow_CTA_LightTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/light/themes/yellow/yellow_CTA_LightModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkTheme.module.css';
|
|
2
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkModifyCategory.module.css';
|
|
3
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/dark/themes/blue/blue_DotTheme_DarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/light/themes/blue/blue_DotTheme_LightTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/pureDark/themes/blue/blue_DotTheme_PureDarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/dark/themes/green/green_DotTheme_DarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/light/themes/green/green_DotTheme_LightTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/pureDark/themes/green/green_DotTheme_PureDarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/dark/themes/orange/orange_DotTheme_DarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/light/themes/orange/orange_DotTheme_LightTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/pureDark/themes/orange/orange_DotTheme_PureDarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/dark/themes/red/red_DotTheme_DarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/light/themes/red/red_DotTheme_LightTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/pureDark/themes/red/red_DotTheme_PureDarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/dark/themes/yellow/yellow_DotTheme_DarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/light/themes/yellow/yellow_DotTheme_LightTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./../../../../../../../assets/Appearance/pureDark/themes/yellow/yellow_DotTheme_PureDarkTheme.module.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/dark/themes/blue/blue_SVGTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/light/themes/blue/blue_SVGTheme_LightTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/pureDark/themes/blue/blue_SVGTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/dark/themes/green/green_SVGTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/light/themes/green/green_SVGTheme_LightTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/pureDark/themes/green/green_SVGTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/dark/themes/orange/orange_SVGTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/light/themes/orange/orange_SVGTheme_LightTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/pureDark/themes/orange/orange_SVGTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/dark/themes/red/red_SVGTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/light/themes/red/red_SVGTheme_LightTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/pureDark/themes/red/red_SVGTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/dark/themes/yellow/yellow_SVGTheme_DarkTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/light/themes/yellow/yellow_SVGTheme_LightTheme.module.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@zohodesk/svg/assets/Appearance/pureDark/themes/yellow/yellow_SVGTheme_PureDarkTheme.module.css';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { THEME_APPEARANCE_LIGHT, THEME_COLOR_BLUE } from "../utils/constants";
|
|
2
|
+
export const defaultProps = {
|
|
3
|
+
ui_themeAppearance: THEME_APPEARANCE_LIGHT,
|
|
4
|
+
ui_themeColor: THEME_COLOR_BLUE,
|
|
5
|
+
ui_baseZoomUnit: '1px',
|
|
6
|
+
ui_baseFontUnit: '16px',
|
|
7
|
+
data_zoomUnitVariable: '--zd_baseUnit',
|
|
8
|
+
data_fontUnitVariable: '--zd_baseFontUnit',
|
|
9
|
+
data_themeAppearanceAttr: 'data-mode',
|
|
10
|
+
data_themeColorAttr: 'data-theme'
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { THEME_APPEARANCES, THEME_COLORS } from "../utils/constants";
|
|
3
|
+
export const propTypes = {
|
|
4
|
+
ui_themeAppearance: PropTypes.oneOf(THEME_APPEARANCES),
|
|
5
|
+
ui_themeColor: PropTypes.oneOf(THEME_COLORS),
|
|
6
|
+
ui_baseZoomUnit: PropTypes.string,
|
|
7
|
+
ui_baseFontUnit: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
8
|
+
data_zoomUnitVariable: PropTypes.string,
|
|
9
|
+
data_fontUnitVariable: PropTypes.string,
|
|
10
|
+
data_themeAppearanceAttr: PropTypes.string,
|
|
11
|
+
data_themeColorAttr: PropTypes.string,
|
|
12
|
+
method_providerRef: PropTypes.func,
|
|
13
|
+
method_onAssetsDownloadSuccess: PropTypes.func,
|
|
14
|
+
method_getAssetsPromises: PropTypes.func,
|
|
15
|
+
children: PropTypes.node
|
|
16
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getAssetsImportPromises } from "./getAssetsImportPromises";
|
|
2
|
+
import { assetImports as themeAppearanceImports, assetImportMapping as themeAppearanceMapping } from "./themeAppearanceAssetsConfig";
|
|
3
|
+
import { assetImports as themeColorImports, assetImportMapping as themeColorMapping } from "./themeColorAssetsConfig";
|
|
4
|
+
import { assetImports as sizeImports, assetImportMapping as sizeMapping } from "./sizeAssetsConfig";
|
|
5
|
+
import { errorValidation } from "./errorValidation";
|
|
6
|
+
import { LIBRARIES, THEME_APPEARANCES, THEME_COLORS } from "./constants";
|
|
7
|
+
export function getThemeAppearanceAssetPromise(_ref) {
|
|
8
|
+
let {
|
|
9
|
+
themeAppearance
|
|
10
|
+
} = _ref;
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
errorValidation({
|
|
14
|
+
options: THEME_APPEARANCES,
|
|
15
|
+
value: themeAppearance,
|
|
16
|
+
type: 'themeAppearance'
|
|
17
|
+
});
|
|
18
|
+
const assetImportKeys = [];
|
|
19
|
+
LIBRARIES.map(library => {
|
|
20
|
+
const assetImportKey = themeAppearanceMapping[library][themeAppearance];
|
|
21
|
+
assetImportKeys.push(assetImportKey);
|
|
22
|
+
});
|
|
23
|
+
return getAssetsImportPromises({
|
|
24
|
+
assetImportKeys: assetImportKeys,
|
|
25
|
+
assetImports: themeAppearanceImports
|
|
26
|
+
});
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.warn('Error: ', error);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function getThemeColorAssetPromise(_ref2) {
|
|
32
|
+
let {
|
|
33
|
+
themeAppearance,
|
|
34
|
+
themeColor
|
|
35
|
+
} = _ref2;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
errorValidation({
|
|
39
|
+
options: THEME_COLORS,
|
|
40
|
+
value: themeColor,
|
|
41
|
+
type: 'themeColor'
|
|
42
|
+
});
|
|
43
|
+
const assetImportKeys = [];
|
|
44
|
+
LIBRARIES.map(library => {
|
|
45
|
+
const assetImportKey = themeColorMapping[library][themeColor][themeAppearance];
|
|
46
|
+
assetImportKeys.push(assetImportKey);
|
|
47
|
+
});
|
|
48
|
+
return getAssetsImportPromises({
|
|
49
|
+
assetImportKeys: assetImportKeys,
|
|
50
|
+
assetImports: themeColorImports
|
|
51
|
+
});
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.warn('Error: ', error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function getZoomSizeAssetPromise() {
|
|
57
|
+
return sizeImports[sizeMapping.zoomSize]();
|
|
58
|
+
}
|
|
59
|
+
export function getFontSizeAssetPromise() {
|
|
60
|
+
return sizeImports[sizeMapping.fontSize]();
|
|
61
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const LIBRARY_COMPONENT = 'component';
|
|
2
|
+
export const LIBRARY_DOT = 'dot';
|
|
3
|
+
export const LIBRARY_SVG = 'svg';
|
|
4
|
+
export const THEME_APPEARANCE_LIGHT = 'light';
|
|
5
|
+
export const THEME_APPEARANCE_DARK = 'dark';
|
|
6
|
+
export const THEME_APPEARANCE_PURE_DARK = 'pureDark';
|
|
7
|
+
export const THEME_COLOR_BLUE = 'blue';
|
|
8
|
+
export const THEME_COLOR_GREEN = 'green';
|
|
9
|
+
export const THEME_COLOR_ORANGE = 'orange';
|
|
10
|
+
export const THEME_COLOR_RED = 'red';
|
|
11
|
+
export const THEME_COLOR_YELLOW = 'yellow';
|
|
12
|
+
export const LIBRARIES = [LIBRARY_COMPONENT, LIBRARY_DOT, LIBRARY_SVG];
|
|
13
|
+
export const THEME_APPEARANCES = [THEME_APPEARANCE_LIGHT, THEME_APPEARANCE_DARK, THEME_APPEARANCE_PURE_DARK];
|
|
14
|
+
export const THEME_COLORS = [THEME_COLOR_BLUE, THEME_COLOR_GREEN, THEME_COLOR_ORANGE, THEME_COLOR_RED, THEME_COLOR_YELLOW];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { THEME_APPEARANCES, THEME_COLORS } from "./constants";
|
|
2
|
+
export function errorValidation(_ref) {
|
|
3
|
+
let {
|
|
4
|
+
options,
|
|
5
|
+
value,
|
|
6
|
+
type
|
|
7
|
+
} = _ref;
|
|
8
|
+
|
|
9
|
+
if (!options.includes(value)) {
|
|
10
|
+
const themeAppearances = THEME_APPEARANCES.toString();
|
|
11
|
+
const themeColors = THEME_COLORS.toString();
|
|
12
|
+
console.error(`We do not support the '${value} ${type}'. Please provide valid '${type}' values or check spelling. DotProvider supports ${themeAppearances} appearance & ${themeColors} theme.`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function getAssetsImportPromises(_ref) {
|
|
2
|
+
let {
|
|
3
|
+
assetImportKeys,
|
|
4
|
+
assetImports
|
|
5
|
+
} = _ref;
|
|
6
|
+
const promises = [];
|
|
7
|
+
assetImportKeys.forEach(importKey => {
|
|
8
|
+
const assetURL = assetImports[importKey];
|
|
9
|
+
|
|
10
|
+
if (assetURL) {
|
|
11
|
+
promises.push(assetURL());
|
|
12
|
+
} else {
|
|
13
|
+
console.error(`Import not found for ${importKey} from ${assetImports}`);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return promises;
|
|
17
|
+
}
|