@zohodesk/dot 1.0.0-temp-72 → 1.0.0-temp-75
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/README.md +8 -0
- package/assets/Appearance/dark/mode/dotDarkMode.module.css +10 -0
- package/assets/Appearance/dark/themes/blue/blueDarkDotTheme.module.css +6 -0
- package/assets/Appearance/dark/themes/green/greenDarkDotTheme.module.css +6 -0
- package/assets/Appearance/dark/themes/orange/orangeDarkDotTheme.module.css +6 -0
- package/assets/Appearance/dark/themes/red/redDarkDotTheme.module.css +6 -0
- package/assets/Appearance/dark/themes/yellow/yellowDarkDotTheme.module.css +6 -0
- package/assets/Appearance/default/mode/dotDefaultMode.module.css +10 -0
- package/assets/Appearance/default/themes/blue/blueDefaultDotTheme.module.css +6 -0
- package/assets/Appearance/default/themes/green/greenDefaultDotTheme.module.css +6 -0
- package/assets/Appearance/default/themes/orange/orangeDefaultDotTheme.module.css +6 -0
- package/assets/Appearance/default/themes/red/redDefaultDotTheme.module.css +6 -0
- package/assets/Appearance/default/themes/yellow/yellowDefaultDotTheme.module.css +6 -0
- package/assets/Appearance/pureDark/mode/dotPureDarkMode.module.css +10 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkDotTheme.module.css +6 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkDotTheme.module.css +6 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkDotTheme.module.css +6 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkDotTheme.module.css +6 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkDotTheme.module.css +6 -0
- package/es/AttachmentViewer/Attachment.js +17 -0
- package/es/AttachmentViewer/AttachmentImage.js +85 -0
- package/es/AttachmentViewer/AttachmentViewer.js +562 -0
- package/es/AttachmentViewer/AttachmentViewer.module.css +346 -0
- package/es/AttachmentViewer/utils.js +107 -0
- package/es/common/dot_animation.module.css +27 -0
- package/es/common/dot_common.module.css +4 -0
- package/es/form/fields/TextEditor/TextEditor.js +4 -1
- package/images/audio_thumbnail.png +0 -0
- package/lib/AttachmentViewer/Attachment.js +28 -0
- package/lib/AttachmentViewer/AttachmentImage.js +129 -0
- package/lib/AttachmentViewer/AttachmentViewer.js +645 -0
- package/lib/AttachmentViewer/AttachmentViewer.module.css +346 -0
- package/lib/AttachmentViewer/utils.js +134 -0
- package/lib/common/dot_animation.module.css +27 -0
- package/lib/common/dot_common.module.css +4 -0
- package/lib/form/fields/TextEditor/TextEditor.js +4 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
In this Library, we Provide Some Basic Components to Build Your Application
|
|
4
4
|
|
|
5
|
+
# 1.0.0-beta.221
|
|
6
|
+
|
|
7
|
+
- editor fontsize prop added
|
|
8
|
+
|
|
9
|
+
# 1.0.0-beta.218 , # 1.0.0-beta.219, # 1.0.0-beta.220
|
|
10
|
+
|
|
11
|
+
- AttachmentViewer , AttachmentImage component added
|
|
12
|
+
|
|
5
13
|
# 1.0.0-beta.217
|
|
6
14
|
|
|
7
15
|
- TagsMultiSelect => boxSize prop added.
|
|
@@ -518,4 +518,14 @@
|
|
|
518
518
|
|
|
519
519
|
/* tagsmultiselect field */
|
|
520
520
|
--zdt_tagsmultiselectField_count_text: var(--dot_cadetblue);
|
|
521
|
+
|
|
522
|
+
/* attachment viewer */
|
|
523
|
+
--zdt_attachmentviewer_title_text: var(--dot_platinum);
|
|
524
|
+
--zdt_attachmentviewer_button_border: var(--dot_tuna);
|
|
525
|
+
--zdt_attachmentviewer_hover_border: var(--zdt_cta_grey_40_border);
|
|
526
|
+
--zdt_attachmentviewer_selected_border: var(--zdt_cta_primary_border);
|
|
527
|
+
--zdt_attachmentviewer_selected_after_bg: var(--dot_white);
|
|
528
|
+
--zdt_attachmentviewer_selected_box_shadow: rgba(0, 0, 0, 0.34);
|
|
529
|
+
--zdt_attachmentviewer_loader_border: #2a2e38;
|
|
530
|
+
--zdt_attachmentviewer_loader_border_top: #f3f3f3;
|
|
521
531
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: var(--dot_butterflyblue);
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #2469ff;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #1b212b;
|
|
13
|
+
--zdt_attachmentviewer_header_border: var(--dot_tuna);
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #1b212b;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(27 33 43 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #45a159;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #0e7c1c;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #1b212b;
|
|
13
|
+
--zdt_attachmentviewer_header_border: var(--dot_tuna);
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #1b212b;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(27 33 43 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: var(--dot_cadmiumorange);
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #a85100;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #1b212b;
|
|
13
|
+
--zdt_attachmentviewer_header_border: var(--dot_tuna);
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #1b212b;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(27 33 43 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #e94f4f;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #a81111;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #1b212b;
|
|
13
|
+
--zdt_attachmentviewer_header_border: var(--dot_tuna);
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #1b212b;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(27 33 43 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #d79835;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #9b6808;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #1b212b;
|
|
13
|
+
--zdt_attachmentviewer_header_border: var(--dot_tuna);
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #1b212b;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(27 33 43 / 40%);
|
|
10
16
|
}
|
|
@@ -518,4 +518,14 @@
|
|
|
518
518
|
|
|
519
519
|
/* tagsmultiselect field */
|
|
520
520
|
--zdt_tagsmultiselectField_count_text: var(--dot_shuttleGrey);
|
|
521
|
+
|
|
522
|
+
/* attachment viewer */
|
|
523
|
+
--zdt_attachmentviewer_title_text: var(--dot_white);
|
|
524
|
+
--zdt_attachmentviewer_button_border: var(--zdt_cta_grey_35_border);
|
|
525
|
+
--zdt_attachmentviewer_hover_border: var(--zdt_cta_grey_40_border);
|
|
526
|
+
--zdt_attachmentviewer_selected_border: var(--zdt_cta_primary_border);
|
|
527
|
+
--zdt_attachmentviewer_selected_after_bg: var(--dot_white);
|
|
528
|
+
--zdt_attachmentviewer_selected_box_shadow: rgba(0, 0, 0, 0.34);
|
|
529
|
+
--zdt_attachmentviewer_loader_border: #2a2e38;
|
|
530
|
+
--zdt_attachmentviewer_loader_border_top: #f3f3f3;
|
|
521
531
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #6cbbfc;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #2469ff;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #2c334d;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #42485f;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #2c334d;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(44 51 77 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: var(--dot_darkmint);
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #0e7526;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #0f2226;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #1a3439;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #0f2226;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(15 34 38 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #e57717;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #b25900;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #241e13;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #2e2b11;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #241e13;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(36 30 19 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #ff6363;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #ab1a18;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #220f1b;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #321f22;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #220f1b;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(34 15 27 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #e8b923;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #b59100;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #222412;
|
|
13
|
+
--zdt_attachmentviewer_header_border: rgba(255, 255, 255, 0.08);
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #222412;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(34 36 18 / 40%);
|
|
10
16
|
}
|
|
@@ -518,4 +518,14 @@
|
|
|
518
518
|
|
|
519
519
|
/* tagsmultiselect field */
|
|
520
520
|
--zdt_tagsmultiselectField_count_text: var(--dot_cadetblue);
|
|
521
|
+
|
|
522
|
+
/* attachment viewer */
|
|
523
|
+
--zdt_attachmentviewer_title_text: var(--dot_platinum);
|
|
524
|
+
--zdt_attachmentviewer_button_border: #161515;
|
|
525
|
+
--zdt_attachmentviewer_hover_border: var(--zdt_cta_grey_40_border);
|
|
526
|
+
--zdt_attachmentviewer_selected_border: var(--zdt_cta_primary_border);
|
|
527
|
+
--zdt_attachmentviewer_selected_after_bg: var(--dot_white);
|
|
528
|
+
--zdt_attachmentviewer_selected_box_shadow: rgba(0, 0, 0, 0.34);
|
|
529
|
+
--zdt_attachmentviewer_loader_border: #2a2e38;
|
|
530
|
+
--zdt_attachmentviewer_loader_border_top: #f3f3f3;
|
|
521
531
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: var(--dot_butterflyblue);
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #2469ff;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #101010;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #161515;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #101010;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(16 16 16 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #45a159;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #0e7c1c;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #101010;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #161515;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #101010;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(16 16 16 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: var(--dot_cadmiumorange);
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #a85100;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #101010;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #161515;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #101010;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(16 16 16 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #e94f4f;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #a81111;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #101010;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #161515;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #101010;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(16 16 16 / 40%);
|
|
10
16
|
}
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
--zdt_commonEmptyState_dark_description: var(--dot_white);
|
|
8
8
|
--zdt_commonEmptyState_dark_link: #d79835;
|
|
9
9
|
--zdt_commonEmptyState_dark_link_hover: #9b6808;
|
|
10
|
+
|
|
11
|
+
/* attachment viewer */
|
|
12
|
+
--zdt_attachmentviewer_header_bg: #101010;
|
|
13
|
+
--zdt_attachmentviewer_header_border: #161515;
|
|
14
|
+
--zdt_attachmentviewer_footer_bg: #101010;
|
|
15
|
+
--zdt_attachmentviewer_arrow_bg_hover: rgb(16 16 16 / 40%);
|
|
10
16
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const UNASSIGNED = 'Unassigned';
|
|
2
|
+
const BROWSER_SUPPORTED_FILES = ['pdf', 'text', 'txt', 'css', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'ico', 'sh', 'mp3', 'wav', 'ogg'];
|
|
3
|
+
export function isAudioFile(fileName) {
|
|
4
|
+
const extension = getExtensionFromFileName(fileName);
|
|
5
|
+
return /mp3|wav|ogg/i.test(extension);
|
|
6
|
+
}
|
|
7
|
+
export function getExtensionFromFileName(fileName) {
|
|
8
|
+
if (fileName && fileName.indexOf(".") !== -1) {
|
|
9
|
+
return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
export function isBrowserSupportedFile(fileName) {
|
|
15
|
+
const extension = getExtensionFromFileName(fileName);
|
|
16
|
+
return BROWSER_SUPPORTED_FILES.indexOf(extension) !== -1;
|
|
17
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* eslint-disable css-modules/no-unused-class */
|
|
2
|
+
|
|
3
|
+
/** * Libraries ** */
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import Image from '../Image/Image';
|
|
7
|
+
/** * CSS ** */
|
|
8
|
+
|
|
9
|
+
import style from './AttachmentViewer.module.css';
|
|
10
|
+
export default class AttachmentImage extends Component {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
this.imageEle = /*#__PURE__*/React.createRef();
|
|
14
|
+
this.state = {
|
|
15
|
+
isLoading: true
|
|
16
|
+
};
|
|
17
|
+
this.imgLoad = this.imgLoad.bind(this);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
componentDidMount() {
|
|
21
|
+
const {
|
|
22
|
+
isImage
|
|
23
|
+
} = this.props;
|
|
24
|
+
|
|
25
|
+
if (isImage) {
|
|
26
|
+
const image = this.imageEle.current;
|
|
27
|
+
image.addEventListener('load', this.imgLoad);
|
|
28
|
+
} else {
|
|
29
|
+
this.setState({
|
|
30
|
+
isLoading: false
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
imgLoad() {
|
|
36
|
+
this.setState({
|
|
37
|
+
isLoading: false
|
|
38
|
+
});
|
|
39
|
+
const {
|
|
40
|
+
onLoad
|
|
41
|
+
} = this.props;
|
|
42
|
+
onLoad && onLoad();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
render() {
|
|
46
|
+
const {
|
|
47
|
+
src,
|
|
48
|
+
onClick,
|
|
49
|
+
alt,
|
|
50
|
+
dataId,
|
|
51
|
+
id,
|
|
52
|
+
className,
|
|
53
|
+
isCover
|
|
54
|
+
} = this.props;
|
|
55
|
+
const {
|
|
56
|
+
isLoading
|
|
57
|
+
} = this.state;
|
|
58
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: `${style.spinLoad}`
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: style.loader
|
|
62
|
+
})) : null, /*#__PURE__*/React.createElement(Image, {
|
|
63
|
+
htmlId: id,
|
|
64
|
+
eleRef: this.imageEle,
|
|
65
|
+
dataId: dataId,
|
|
66
|
+
src: src,
|
|
67
|
+
onClick: onClick,
|
|
68
|
+
className: `${isLoading ? style.hide : ''} ${className}`,
|
|
69
|
+
alt: alt,
|
|
70
|
+
isCover: isCover
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
AttachmentImage.propTypes = {
|
|
76
|
+
alt: PropTypes.string,
|
|
77
|
+
className: PropTypes.string,
|
|
78
|
+
dataId: PropTypes.string,
|
|
79
|
+
id: PropTypes.string,
|
|
80
|
+
isCover: PropTypes.bool,
|
|
81
|
+
isImage: PropTypes.string,
|
|
82
|
+
onClick: PropTypes.func,
|
|
83
|
+
onLoad: PropTypes.func,
|
|
84
|
+
src: PropTypes.string
|
|
85
|
+
};
|