@zohodesk/dot 1.0.0-temp-228.2 → 1.0.0-temp-230
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 +24 -0
- package/es/ActionButton/ActionButton.module.css +12 -11
- package/es/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +47 -60
- package/es/AlphabeticList/AlphabeticList.module.css +7 -8
- package/es/Attachment/Attachment.module.css +9 -10
- package/es/AttachmentViewer/AttachmentViewer.js +57 -7
- package/es/AttachmentViewer/AttachmentViewer.module.css +25 -46
- package/es/AttachmentViewer/props/defaultProps.js +2 -1
- package/es/AttachmentViewer/props/propTypes.js +3 -1
- package/es/AudioPlayer/AudioPlayer.module.css +5 -8
- package/es/DotProvider/DotProvider.js +2 -0
- package/es/DotProvider/__tests__/DotProvider.spec.js +106 -0
- package/es/DotProvider/hooks/useDotProvider.js +4 -2
- package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +44 -15
- package/es/DotProvider/props/defaultProps.js +2 -0
- package/es/DotProvider/props/propTypes.js +1 -0
- package/es/Drawer/Drawer.module.css +17 -64
- package/es/FormAction/FormAction.module.css +20 -54
- package/es/ImportantNotes/ImportantNotes.module.css +2 -9
- package/es/Link/Link.js +4 -3
- package/es/Link/props/propTypes.js +1 -0
- package/es/Message/Message.module.css +3 -16
- package/es/MessageBanner/MessageBanner.module.css +4 -13
- package/es/Separator/Separator.module.css +2 -1
- package/es/TagWithIcon/TagWithIcon.module.css +5 -8
- package/es/ToastMessage/ToastMessage.module.css +16 -30
- package/es/Upload/Upload.module.css +7 -9
- package/es/alert/AlertHeader/AlertHeader.module.css +11 -25
- package/es/alert/AlertLookup/AlertLookup.module.css +9 -10
- package/es/avatar/AvatarCollision/AvatarCollision.module.css +1 -1
- package/es/avatar/AvatarWithTeam/AvatarWithTeam.module.css +1 -1
- package/es/dropdown/ToggleDropDown/ToggleDropDown.module.css +16 -16
- package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +7 -9
- package/es/emptystate/EditionPage/EditionPage.css +7 -4
- package/es/errorstate/EmptyStates.module.css +7 -8
- package/es/errorstate/Inconvenience/Inconvenience.module.css +2 -5
- package/es/errorstate/NoRequestFound/NoRequestFound.module.css +1 -1
- package/es/errorstate/PermissionPlay/PermissionPlay.module.css +5 -4
- package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.module.css +1 -1
- package/es/errorstate/UnableToProcess/UnableToProcess.module.css +1 -1
- package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.module.css +1 -1
- package/es/errorstate/WillBack/WillBack.module.css +6 -4
- package/es/form/fields/Fields.module.css +23 -68
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.module.css +11 -16
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.module.css +1 -4
- package/es/form/fields/TextEditor/TextEditor.module.css +40 -66
- package/es/form/fields/TextEditorWrapper/TextEditorWrapper.module.css +2 -7
- package/es/form/fields/ValidationMessage/ValidationMessage.module.css +4 -3
- package/es/layout/SetupDetailLayout/SetupDetailLayout.module.css +14 -36
- package/es/layout/SubtabLayout/SubtabLayout.module.css +33 -46
- package/es/list/BluePrintStatus/BluePrintStatus.module.css +1 -4
- package/es/list/Comment/Comment.module.css +2 -1
- package/es/list/Dot/Dot.module.css +4 -2
- package/es/list/GridStencils/GridStencils.module.css +7 -9
- package/es/list/ListLayout/ListLayout.module.css +7 -4
- package/es/list/ListStencils/ListStencils.module.css +14 -15
- package/es/list/SecondaryText/SecondaryText.module.css +4 -13
- package/es/list/SentimentStatus/SentimentStatus.module.css +2 -4
- package/es/list/TagNew/TagNew.module.css +3 -2
- package/es/list/listCommon.module.css +3 -7
- package/es/list/status/StatusDropdown/StatusDropdown.module.css +17 -17
- package/es/list/status/StatusListItem/StatusListItem.module.css +10 -18
- package/es/lookup/EmptyPage/LookupEmptyPage.module.css +4 -3
- package/es/lookup/Lookup/Lookup.module.css +2 -2
- package/es/lookup/header/Search/LookupSearch.module.css +10 -23
- package/es/lookup/header/TicketHeader/TicketHeader.module.css +3 -2
- package/es/lookup/header/ViewDropDown/ViewDropDown.module.css +8 -12
- package/es/lookup/header/lookupHeaderCommon.module.css +8 -7
- package/es/lookup/header/lookupHeaderCommonResponsive.module.css +2 -6
- package/es/setup/header/Button/HeaderButton.module.css +2 -4
- package/es/setup/header/Link/HeaderLink.module.css +3 -9
- package/es/setup/header/Search/Search.module.css +2 -10
- package/es/setup/header/Views/Views.module.css +1 -4
- package/es/setup/helptips/Description/HelpTipsDescription.module.css +2 -1
- package/es/setup/helptips/Link/HelpTipsLink.module.css +2 -2
- package/es/setup/helptips/ListGroup/ListGroup.module.css +2 -6
- package/es/setup/table/TableData/SetupTableData.module.css +2 -4
- package/es/setup/table/TableHead/SetupTableHead.module.css +1 -6
- package/es/setup/table/TableRow/SetupTableRow.module.css +2 -7
- package/es/version2/GlobalNotification/GlobalNotification.module.css +7 -12
- package/es/version2/errorstate/V2_ErrorStates.module.css +5 -5
- package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +8 -23
- package/es/version2/lookup/AlertLookup/AlertLookupNew.module.css +9 -10
- package/es/version2/lookup/alertLookupCommonNew.module.css +6 -4
- package/es/version2/notification/DesktopNotification/DesktopNotification.module.css +8 -11
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +10 -22
- package/lib/ActionButton/ActionButton.module.css +12 -11
- package/lib/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +47 -60
- package/lib/AlphabeticList/AlphabeticList.module.css +7 -8
- package/lib/Attachment/Attachment.module.css +9 -10
- package/lib/AttachmentViewer/AttachmentViewer.js +94 -37
- package/lib/AttachmentViewer/AttachmentViewer.module.css +25 -46
- package/lib/AttachmentViewer/props/defaultProps.js +2 -1
- package/lib/AttachmentViewer/props/propTypes.js +3 -1
- package/lib/AudioPlayer/AudioPlayer.module.css +5 -8
- package/lib/DotProvider/DotProvider.js +3 -1
- package/lib/DotProvider/__tests__/DotProvider.spec.js +216 -0
- package/lib/DotProvider/hooks/useDotProvider.js +4 -2
- package/lib/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +46 -15
- package/lib/DotProvider/props/defaultProps.js +3 -0
- package/lib/DotProvider/props/propTypes.js +1 -0
- package/lib/Drawer/Drawer.module.css +17 -64
- package/lib/FormAction/FormAction.module.css +20 -54
- package/lib/ImportantNotes/ImportantNotes.module.css +2 -9
- package/lib/Link/Link.js +4 -3
- package/lib/Link/props/propTypes.js +1 -0
- package/lib/Message/Message.module.css +3 -16
- package/lib/MessageBanner/MessageBanner.module.css +4 -13
- package/lib/Separator/Separator.module.css +2 -1
- package/lib/TagWithIcon/TagWithIcon.module.css +5 -8
- package/lib/ToastMessage/ToastMessage.module.css +16 -30
- package/lib/Upload/Upload.module.css +7 -9
- package/lib/alert/AlertHeader/AlertHeader.module.css +11 -25
- package/lib/alert/AlertLookup/AlertLookup.module.css +9 -10
- package/lib/avatar/AvatarCollision/AvatarCollision.module.css +1 -1
- package/lib/avatar/AvatarWithTeam/AvatarWithTeam.module.css +1 -1
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.module.css +16 -16
- package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +7 -9
- package/lib/emptystate/EditionPage/EditionPage.css +7 -4
- package/lib/errorstate/EmptyStates.module.css +7 -8
- package/lib/errorstate/Inconvenience/Inconvenience.module.css +2 -5
- package/lib/errorstate/NoRequestFound/NoRequestFound.module.css +1 -1
- package/lib/errorstate/PermissionPlay/PermissionPlay.module.css +5 -4
- package/lib/errorstate/RequestUrlNotFound/RequestUrlNotFound.module.css +1 -1
- package/lib/errorstate/UnableToProcess/UnableToProcess.module.css +1 -1
- package/lib/errorstate/UnauthorizedLogin/UnauthorizedLogin.module.css +1 -1
- package/lib/errorstate/WillBack/WillBack.module.css +6 -4
- package/lib/form/fields/Fields.module.css +23 -68
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.module.css +11 -16
- package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.module.css +1 -4
- package/lib/form/fields/TextEditor/TextEditor.module.css +40 -66
- package/lib/form/fields/TextEditorWrapper/TextEditorWrapper.module.css +2 -7
- package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +4 -3
- package/lib/layout/SetupDetailLayout/SetupDetailLayout.module.css +14 -36
- package/lib/layout/SubtabLayout/SubtabLayout.module.css +33 -46
- package/lib/list/BluePrintStatus/BluePrintStatus.module.css +1 -4
- package/lib/list/Comment/Comment.module.css +2 -1
- package/lib/list/Dot/Dot.module.css +4 -2
- package/lib/list/GridStencils/GridStencils.module.css +7 -9
- package/lib/list/ListLayout/ListLayout.module.css +7 -4
- package/lib/list/ListStencils/ListStencils.module.css +14 -15
- package/lib/list/SecondaryText/SecondaryText.module.css +4 -13
- package/lib/list/SentimentStatus/SentimentStatus.module.css +2 -4
- package/lib/list/TagNew/TagNew.module.css +3 -2
- package/lib/list/listCommon.module.css +3 -7
- package/lib/list/status/StatusDropdown/StatusDropdown.module.css +17 -17
- package/lib/list/status/StatusListItem/StatusListItem.module.css +10 -18
- package/lib/lookup/EmptyPage/LookupEmptyPage.module.css +4 -3
- package/lib/lookup/Lookup/Lookup.module.css +2 -2
- package/lib/lookup/header/Search/LookupSearch.module.css +10 -23
- package/lib/lookup/header/TicketHeader/TicketHeader.module.css +3 -2
- package/lib/lookup/header/ViewDropDown/ViewDropDown.module.css +8 -12
- package/lib/lookup/header/lookupHeaderCommon.module.css +8 -7
- package/lib/lookup/header/lookupHeaderCommonResponsive.module.css +2 -6
- package/lib/setup/header/Button/HeaderButton.module.css +2 -4
- package/lib/setup/header/Link/HeaderLink.module.css +3 -9
- package/lib/setup/header/Search/Search.module.css +2 -10
- package/lib/setup/header/Views/Views.module.css +1 -4
- package/lib/setup/helptips/Description/HelpTipsDescription.module.css +2 -1
- package/lib/setup/helptips/Link/HelpTipsLink.module.css +2 -2
- package/lib/setup/helptips/ListGroup/ListGroup.module.css +2 -6
- package/lib/setup/table/TableData/SetupTableData.module.css +2 -4
- package/lib/setup/table/TableHead/SetupTableHead.module.css +1 -6
- package/lib/setup/table/TableRow/SetupTableRow.module.css +2 -7
- package/lib/version2/GlobalNotification/GlobalNotification.module.css +7 -12
- package/lib/version2/errorstate/V2_ErrorStates.module.css +5 -5
- package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +8 -23
- package/lib/version2/lookup/AlertLookup/AlertLookupNew.module.css +9 -10
- package/lib/version2/lookup/alertLookupCommonNew.module.css +6 -4
- package/lib/version2/notification/DesktopNotification/DesktopNotification.module.css +8 -11
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +10 -22
- package/package.json +14 -14
|
@@ -86,21 +86,19 @@
|
|
|
86
86
|
width: var(--zd_size40) ;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
padding: var(--zd_size5)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
[dir=rtl] .medium .attachright {
|
|
94
|
-
padding: var(--zd_size5) var(--zd_size10) var(--zd_size5) var(--zd_size25) ;
|
|
89
|
+
.medium .attachright {
|
|
90
|
+
padding-block: var(--zd_size5) ;
|
|
91
|
+
padding-inline: var(--zd_size10) var(--zd_size25) ;
|
|
95
92
|
}
|
|
96
93
|
|
|
97
94
|
.small .attachright {
|
|
98
|
-
padding:
|
|
95
|
+
padding-block:0 ;
|
|
96
|
+
padding-inline: var(--zd_size10) ;
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
.footer {
|
|
102
100
|
font-size: 0 ;
|
|
103
|
-
margin-
|
|
101
|
+
margin-block-start: var(--zd_size3) ;
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
.medium .atatchName {
|
|
@@ -183,7 +181,8 @@
|
|
|
183
181
|
height: 2px;
|
|
184
182
|
/* Variable:Ignore */
|
|
185
183
|
width: 2px;
|
|
184
|
+
margin-inline: var(--zd_size6) ;
|
|
185
|
+
margin-block:0 ;
|
|
186
186
|
background-color: var(--zdt_dot_text);
|
|
187
187
|
border-radius: 50%;
|
|
188
|
-
|
|
189
|
-
}
|
|
188
|
+
}
|
|
@@ -48,6 +48,47 @@ export default class AttachmentViewer extends Component {
|
|
|
48
48
|
this.handleMenuValidation = this.handleMenuValidation.bind(this);
|
|
49
49
|
this.getPreviewIconData = this.getPreviewIconData.bind(this);
|
|
50
50
|
this.renderIframe = this.renderIframe.bind(this);
|
|
51
|
+
this.updateItem = this.updateItem.bind(this);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
updateItem(idOrIndex, changes) {
|
|
55
|
+
if (!changes || typeof changes !== 'object') {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const {
|
|
60
|
+
data
|
|
61
|
+
} = this.state;
|
|
62
|
+
const targetIdx = typeof idOrIndex === 'number' ? idOrIndex : data.findIndex(item => item && item.id === idOrIndex);
|
|
63
|
+
|
|
64
|
+
if (targetIdx < 0 || targetIdx >= data.length) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this.setState(prevState => {
|
|
69
|
+
const nextData = prevState.data.slice();
|
|
70
|
+
nextData[targetIdx] = { ...nextData[targetIdx],
|
|
71
|
+
...changes
|
|
72
|
+
};
|
|
73
|
+
let nextDataList = prevState.dataList;
|
|
74
|
+
|
|
75
|
+
if (targetIdx < prevState.dataList.length) {
|
|
76
|
+
nextDataList = prevState.dataList.slice();
|
|
77
|
+
nextDataList[targetIdx] = { ...nextDataList[targetIdx],
|
|
78
|
+
...changes
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
data: nextData,
|
|
84
|
+
dataList: nextDataList
|
|
85
|
+
};
|
|
86
|
+
}, () => {
|
|
87
|
+
if (this.state.selectedIndex === targetIdx) {
|
|
88
|
+
this.handleMenuValidation();
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return true;
|
|
51
92
|
}
|
|
52
93
|
|
|
53
94
|
isImageFileType(fileName) {
|
|
@@ -80,8 +121,9 @@ export default class AttachmentViewer extends Component {
|
|
|
80
121
|
selectedIndex
|
|
81
122
|
} = this.state;
|
|
82
123
|
let indexChanged = previewObj.selectedIndex != prevProps.previewObj.selectedIndex;
|
|
124
|
+
const attachmentPreviewUrlChanged = previewObj.previewData[0]?.viewUrl !== prevState.data[0]?.viewUrl; // Triggers an update if the previewed attachment is edited by the Attachment Annotator.
|
|
83
125
|
|
|
84
|
-
if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged) {
|
|
126
|
+
if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged || attachmentPreviewUrlChanged) {
|
|
85
127
|
let objChanged = previewObj.previewData.some((value, index) => {
|
|
86
128
|
return shallowDiff(value, prevProps.previewObj[index]);
|
|
87
129
|
});
|
|
@@ -100,7 +142,7 @@ export default class AttachmentViewer extends Component {
|
|
|
100
142
|
}
|
|
101
143
|
}
|
|
102
144
|
|
|
103
|
-
if (prevState.selectedIndex != selectedIndex) {
|
|
145
|
+
if (prevState.selectedIndex != selectedIndex || attachmentPreviewUrlChanged) {
|
|
104
146
|
this.handleMenuValidation();
|
|
105
147
|
}
|
|
106
148
|
}
|
|
@@ -424,9 +466,10 @@ export default class AttachmentViewer extends Component {
|
|
|
424
466
|
$ui_weight: "semibold"
|
|
425
467
|
}, previewUnsupportedText), downloadUrl ? /*#__PURE__*/React.createElement(Link, {
|
|
426
468
|
href: downloadUrl,
|
|
469
|
+
download: true,
|
|
470
|
+
downloadName: name,
|
|
427
471
|
className: style.downloadLink,
|
|
428
|
-
hasReload: true
|
|
429
|
-
download: true
|
|
472
|
+
hasReload: true
|
|
430
473
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
431
474
|
palette: "primaryFilled",
|
|
432
475
|
text: downloadText
|
|
@@ -449,7 +492,9 @@ export default class AttachmentViewer extends Component {
|
|
|
449
492
|
i18nKeys,
|
|
450
493
|
isActive,
|
|
451
494
|
dataId,
|
|
452
|
-
customProps
|
|
495
|
+
customProps,
|
|
496
|
+
showCount,
|
|
497
|
+
renderCustomIcons
|
|
453
498
|
} = this.props;
|
|
454
499
|
const {
|
|
455
500
|
avatarProps = {}
|
|
@@ -495,7 +540,7 @@ export default class AttachmentViewer extends Component {
|
|
|
495
540
|
"data-title": selectedAttachment.name,
|
|
496
541
|
dataId: "attachName",
|
|
497
542
|
id: ariaId
|
|
498
|
-
}, selectedAttachment.name), /*#__PURE__*/React.createElement(Box, {
|
|
543
|
+
}, selectedAttachment.name), showCount && /*#__PURE__*/React.createElement(Box, {
|
|
499
544
|
flexible: true,
|
|
500
545
|
className: style.count,
|
|
501
546
|
dataId: "attachCountContainer"
|
|
@@ -507,7 +552,11 @@ export default class AttachmentViewer extends Component {
|
|
|
507
552
|
align: uptoTablet ? 'bottom' : 'center',
|
|
508
553
|
wrap: "wrap",
|
|
509
554
|
isCover: false
|
|
510
|
-
},
|
|
555
|
+
}, typeof renderCustomIcons === 'function' && renderCustomIcons({
|
|
556
|
+
selectedAttachment,
|
|
557
|
+
selectedIndex,
|
|
558
|
+
totalLen
|
|
559
|
+
}), canZoom ? isZoomed ? /*#__PURE__*/React.createElement("div", {
|
|
511
560
|
className: uptoTablet ? style.mobileMenu : style.menu,
|
|
512
561
|
onClick: this.zoomOut.bind(this, selectedIndex),
|
|
513
562
|
"data-id": "zoomOut",
|
|
@@ -555,6 +604,7 @@ export default class AttachmentViewer extends Component {
|
|
|
555
604
|
className: uptoTablet ? style.mobileMenu : style.menu
|
|
556
605
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
557
606
|
href: downloadUrl,
|
|
607
|
+
downloadName: selectedAttachment.name,
|
|
558
608
|
target: "_parent",
|
|
559
609
|
hasReload: true,
|
|
560
610
|
download: true,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
.header {
|
|
2
|
-
height: var(--
|
|
2
|
+
height: var(--zd_size48) ;
|
|
3
3
|
position: relative;
|
|
4
4
|
z-index: 1;
|
|
5
|
+
padding-block:0 ;
|
|
6
|
+
padding-inline: var(--zd_size15) ;
|
|
5
7
|
composes: alignVertical from '~@zohodesk/components/es/common/common.module.css';
|
|
6
8
|
background-color: var(--zdt_attachmentviewer_header_bg);
|
|
7
|
-
padding: 0 var(--zd_size15) ;
|
|
8
9
|
border-bottom: 1px solid var(--zdt_attachmentviewer_header_border);
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -22,9 +23,10 @@
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
.count {
|
|
26
|
+
padding-block:0 ;
|
|
27
|
+
padding-inline: var(--zd_size10) ;
|
|
25
28
|
position: absolute;
|
|
26
29
|
composes: xMiddle from '~@zohodesk/components/es/common/common.module.css';
|
|
27
|
-
padding: 0 var(--zd_size10) ;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
.title,
|
|
@@ -33,29 +35,21 @@
|
|
|
33
35
|
font-size: var(--zd_font_size15) ;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
padding-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[dir=rtl] .menuBar {
|
|
41
|
-
padding-right: var(--zd_size5) ;
|
|
38
|
+
.menuBar {
|
|
39
|
+
padding-inline-start: var(--zd_size5) ;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
.mbleMenuBar {
|
|
43
|
+
margin-block-start: var(--zd_size8) ;
|
|
45
44
|
align-self: baseline;
|
|
46
|
-
margin-top: var(--zd_size8) ;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
margin-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
[dir=rtl] .menu+.menu {
|
|
54
|
-
margin-right: var(--zd_size22) ;
|
|
47
|
+
.menu+.menu {
|
|
48
|
+
margin-inline-start: var(--zd_size22) ;
|
|
55
49
|
}
|
|
56
50
|
|
|
57
51
|
.mobileMenu+.mobileMenu {
|
|
58
|
-
margin-
|
|
52
|
+
margin-block-end: var(--zd_size22) ;
|
|
59
53
|
}
|
|
60
54
|
|
|
61
55
|
.menuIcon {
|
|
@@ -85,9 +79,10 @@
|
|
|
85
79
|
}
|
|
86
80
|
|
|
87
81
|
.preview {
|
|
82
|
+
margin-block: var(--zd_size20) ;
|
|
83
|
+
margin-inline:0 ;
|
|
88
84
|
composes: posrel from '~@zohodesk/components/es/common/common.module.css';
|
|
89
85
|
text-align: center;
|
|
90
|
-
margin: var(--zd_size20) 0 ;
|
|
91
86
|
}
|
|
92
87
|
|
|
93
88
|
.zoomIn {
|
|
@@ -128,15 +123,8 @@
|
|
|
128
123
|
width: 100% ;
|
|
129
124
|
overflow: hidden;
|
|
130
125
|
transition: height var(--zd_transition3);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
[dir=ltr] .footer {
|
|
135
|
-
padding-right: var(--zd_size68)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
[dir=rtl] .footer {
|
|
139
|
-
padding-left: var(--zd_size68)
|
|
126
|
+
padding-inline-end: var(--zd_size68) ;
|
|
127
|
+
background-color: var(--zdt_attachmentviewer_footer_bg);
|
|
140
128
|
}
|
|
141
129
|
|
|
142
130
|
.footerHeight {
|
|
@@ -148,7 +136,8 @@
|
|
|
148
136
|
}
|
|
149
137
|
|
|
150
138
|
.listContainer {
|
|
151
|
-
padding:
|
|
139
|
+
padding-block:0 ;
|
|
140
|
+
padding-inline: var(--zd_size18) ;
|
|
152
141
|
}
|
|
153
142
|
|
|
154
143
|
.imgItem {
|
|
@@ -168,12 +157,8 @@
|
|
|
168
157
|
border-color: var(--zdt_attachmentviewer_hover_border);
|
|
169
158
|
}
|
|
170
159
|
|
|
171
|
-
|
|
172
|
-
margin-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
[dir=rtl] .imgItem+.imgItem {
|
|
176
|
-
margin-right: var(--zd_size12) ;
|
|
160
|
+
.imgItem+.imgItem {
|
|
161
|
+
margin-inline-start: var(--zd_size12) ;
|
|
177
162
|
}
|
|
178
163
|
|
|
179
164
|
.image, .crsrPointer {
|
|
@@ -335,21 +320,15 @@
|
|
|
335
320
|
|
|
336
321
|
.author {
|
|
337
322
|
max-width: var(--zd_size200) ;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
[dir=ltr] .author {
|
|
341
|
-
padding-left: var(--zd_size15) ;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
[dir=rtl] .author {
|
|
345
|
-
padding-right: var(--zd_size15) ;
|
|
323
|
+
padding-inline-start: var(--zd_size15) ;
|
|
346
324
|
}
|
|
347
325
|
|
|
348
326
|
.authorName {
|
|
327
|
+
margin-block:0 ;
|
|
328
|
+
margin-inline: var(--zd_size10) ;
|
|
349
329
|
font-size: var(--zd_font_size15) ;
|
|
350
330
|
color: var(--zdt_attachmentviewer_title_text);
|
|
351
331
|
composes: dotted from '~@zohodesk/components/es/common/common.module.css';
|
|
352
|
-
margin: 0 var(--zd_size10) ;
|
|
353
332
|
}
|
|
354
333
|
|
|
355
334
|
.btn {
|
|
@@ -361,7 +340,7 @@
|
|
|
361
340
|
}
|
|
362
341
|
|
|
363
342
|
.fileTypeImg {
|
|
364
|
-
margin-
|
|
343
|
+
margin-block-end: var(--zd_size30) ;
|
|
365
344
|
}
|
|
366
345
|
|
|
367
346
|
.previewNone {
|
|
@@ -373,7 +352,7 @@
|
|
|
373
352
|
|
|
374
353
|
.downloadLink {
|
|
375
354
|
display: inline-block;
|
|
376
|
-
padding-
|
|
355
|
+
padding-block-start: var(--zd_size15) ;
|
|
377
356
|
}
|
|
378
357
|
|
|
379
358
|
.previewIconDiv {
|
|
@@ -385,4 +364,4 @@
|
|
|
385
364
|
color: var(--zdt_attachmentviewer_title_text);
|
|
386
365
|
padding: var(--zd_size2) ;
|
|
387
366
|
margin: auto ;
|
|
388
|
-
}
|
|
367
|
+
}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.dragtag {
|
|
8
|
-
margin:
|
|
8
|
+
margin-block:0 ;
|
|
9
|
+
margin-inline: var(--zd_size10) ;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.audioHid {
|
|
@@ -24,12 +25,8 @@
|
|
|
24
25
|
font-size: var(--zd_font_size11) ;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
margin-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
[dir=rtl] .timerBox {
|
|
32
|
-
margin-right: var(--zd_size6) ;
|
|
28
|
+
.timerBox {
|
|
29
|
+
margin-inline-start: var(--zd_size6) ;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
.rightBox,
|
|
@@ -143,4 +140,4 @@ input::-moz-focus-inner, input::-moz-focus-outer {
|
|
|
143
140
|
border-radius: 4px;
|
|
144
141
|
}
|
|
145
142
|
|
|
146
|
-
/* End of audio range styles */
|
|
143
|
+
/* End of audio range styles */
|
|
@@ -13,6 +13,7 @@ const DotProvider = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
13
13
|
baseFontUnit,
|
|
14
14
|
zoomUnitVariable,
|
|
15
15
|
fontUnitVariable,
|
|
16
|
+
excludeFeatures,
|
|
16
17
|
themeAppearanceAttr,
|
|
17
18
|
themeColorAttr,
|
|
18
19
|
providerRef,
|
|
@@ -49,6 +50,7 @@ const DotProvider = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
49
50
|
baseFontUnit: baseFontUnit,
|
|
50
51
|
zoomUnitVariable: zoomUnitVariable,
|
|
51
52
|
fontUnitVariable: fontUnitVariable,
|
|
53
|
+
excludeFeatures: excludeFeatures,
|
|
52
54
|
getProviderElement,
|
|
53
55
|
onAssetsDownloadSuccess: onAssetsDownloadSuccess,
|
|
54
56
|
getAssetsPromises: getAssetsPromises
|
|
@@ -196,5 +196,111 @@ describe('DotProvider Unit-Test', () => {
|
|
|
196
196
|
zoomSizePromise: expect.any(Promise)
|
|
197
197
|
}));
|
|
198
198
|
});
|
|
199
|
+
test('should not set zoom CSS variable when zoom is excluded', async () => {
|
|
200
|
+
const {
|
|
201
|
+
container
|
|
202
|
+
} = render( /*#__PURE__*/React.createElement(DotProvider, {
|
|
203
|
+
id: "dot-provider",
|
|
204
|
+
excludeFeatures: ['zoom'],
|
|
205
|
+
baseZoomUnit: "2px"
|
|
206
|
+
}, "This is a DotProvider component"));
|
|
207
|
+
await waitFor(() => {});
|
|
208
|
+
const el = container.querySelector('#dot-provider');
|
|
209
|
+
expect(el.style.getPropertyValue('--zd_baseUnit')).toBe('');
|
|
210
|
+
});
|
|
211
|
+
test('should still set font CSS variable when zoom is excluded', async () => {
|
|
212
|
+
const {
|
|
213
|
+
container
|
|
214
|
+
} = render( /*#__PURE__*/React.createElement(DotProvider, {
|
|
215
|
+
id: "dot-provider",
|
|
216
|
+
excludeFeatures: ['zoom'],
|
|
217
|
+
baseFontUnit: "18px"
|
|
218
|
+
}, "This is a DotProvider component"));
|
|
219
|
+
await waitFor(() => {
|
|
220
|
+
const el = container.querySelector('#dot-provider');
|
|
221
|
+
expect(el.style.getPropertyValue('--zd_baseFontUnit')).toBe('18px');
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
test('should not set font CSS variable when font is excluded', async () => {
|
|
225
|
+
const {
|
|
226
|
+
container
|
|
227
|
+
} = render( /*#__PURE__*/React.createElement(DotProvider, {
|
|
228
|
+
id: "dot-provider",
|
|
229
|
+
excludeFeatures: ['font'],
|
|
230
|
+
baseFontUnit: "18px"
|
|
231
|
+
}, "This is a DotProvider component"));
|
|
232
|
+
await waitFor(() => {});
|
|
233
|
+
const el = container.querySelector('#dot-provider');
|
|
234
|
+
expect(el.style.getPropertyValue('--zd_baseFontUnit')).toBe('');
|
|
235
|
+
});
|
|
236
|
+
test('should still set zoom CSS variable when font is excluded', async () => {
|
|
237
|
+
const {
|
|
238
|
+
container
|
|
239
|
+
} = render( /*#__PURE__*/React.createElement(DotProvider, {
|
|
240
|
+
id: "dot-provider",
|
|
241
|
+
excludeFeatures: ['font'],
|
|
242
|
+
baseZoomUnit: "2px"
|
|
243
|
+
}, "This is a DotProvider component"));
|
|
244
|
+
await waitFor(() => {
|
|
245
|
+
const el = container.querySelector('#dot-provider');
|
|
246
|
+
expect(el.style.getPropertyValue('--zd_baseUnit')).toBe('2px');
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
test('should not set zoom or font CSS variables when both are excluded', async () => {
|
|
250
|
+
const {
|
|
251
|
+
container
|
|
252
|
+
} = render( /*#__PURE__*/React.createElement(DotProvider, {
|
|
253
|
+
id: "dot-provider",
|
|
254
|
+
excludeFeatures: ['font', 'zoom'],
|
|
255
|
+
baseZoomUnit: "2px",
|
|
256
|
+
baseFontUnit: "18px"
|
|
257
|
+
}, "This is a DotProvider component"));
|
|
258
|
+
await waitFor(() => {});
|
|
259
|
+
const el = container.querySelector('#dot-provider');
|
|
260
|
+
expect(el.style.getPropertyValue('--zd_baseUnit')).toBe('');
|
|
261
|
+
expect(el.style.getPropertyValue('--zd_baseFontUnit')).toBe('');
|
|
262
|
+
});
|
|
263
|
+
test('getAssetsPromises should expose resolved promises when features are excluded', async () => {
|
|
264
|
+
const mockFunc = jest.fn();
|
|
265
|
+
render( /*#__PURE__*/React.createElement(DotProvider, {
|
|
266
|
+
excludeFeatures: ['font', 'zoom'],
|
|
267
|
+
getAssetsPromises: mockFunc
|
|
268
|
+
}, "This is a DotProvider component"));
|
|
269
|
+
await waitFor(() => {});
|
|
270
|
+
expect(mockFunc).toHaveBeenCalledWith(expect.objectContaining({
|
|
271
|
+
zoomSizePromise: expect.any(Promise),
|
|
272
|
+
fontSizePromise: expect.any(Promise)
|
|
273
|
+
}));
|
|
274
|
+
const {
|
|
275
|
+
zoomSizePromise,
|
|
276
|
+
fontSizePromise
|
|
277
|
+
} = mockFunc.mock.calls[0][0];
|
|
278
|
+
await expect(zoomSizePromise).resolves.toBeUndefined();
|
|
279
|
+
await expect(fontSizePromise).resolves.toBeUndefined();
|
|
280
|
+
});
|
|
281
|
+
test('onAssetsDownloadSuccess should still fire when font and zoom are excluded', async () => {
|
|
282
|
+
const mockFunc = jest.fn();
|
|
283
|
+
render( /*#__PURE__*/React.createElement(DotProvider, {
|
|
284
|
+
excludeFeatures: ['font', 'zoom'],
|
|
285
|
+
onAssetsDownloadSuccess: mockFunc
|
|
286
|
+
}, "This is a DotProvider component"));
|
|
287
|
+
await waitFor(() => {
|
|
288
|
+
expect(mockFunc).toHaveBeenCalled();
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
test('should not set theme attributes when theme is excluded', async () => {
|
|
292
|
+
const {
|
|
293
|
+
container
|
|
294
|
+
} = render( /*#__PURE__*/React.createElement(DotProvider, {
|
|
295
|
+
id: "dot-provider",
|
|
296
|
+
excludeFeatures: ['theme'],
|
|
297
|
+
themeAppearance: "dark",
|
|
298
|
+
themeColor: "orange"
|
|
299
|
+
}, "This is a DotProvider component"));
|
|
300
|
+
await waitFor(() => {});
|
|
301
|
+
const el = container.querySelector('#dot-provider');
|
|
302
|
+
expect(el.getAttribute('data-mode')).toBeNull();
|
|
303
|
+
expect(el.getAttribute('data-theme')).toBeNull();
|
|
304
|
+
});
|
|
199
305
|
}); // need to check error handling cases
|
|
200
306
|
// onAssetsDownloadSuccess not called verification
|
|
@@ -20,6 +20,7 @@ function useDotProvider(_ref) {
|
|
|
20
20
|
getProviderElement,
|
|
21
21
|
zoomUnitVariable,
|
|
22
22
|
fontUnitVariable,
|
|
23
|
+
excludeFeatures,
|
|
23
24
|
themeAppearanceAttr,
|
|
24
25
|
themeColorAttr,
|
|
25
26
|
onAssetsDownloadSuccess,
|
|
@@ -33,6 +34,7 @@ function useDotProvider(_ref) {
|
|
|
33
34
|
getProviderElement,
|
|
34
35
|
zoomUnitVariable,
|
|
35
36
|
fontUnitVariable,
|
|
37
|
+
excludeFeatures,
|
|
36
38
|
themeAppearanceAttr,
|
|
37
39
|
themeColorAttr
|
|
38
40
|
});
|
|
@@ -42,15 +44,15 @@ function useDotProvider(_ref) {
|
|
|
42
44
|
zoomSizePromise,
|
|
43
45
|
fontSizePromise
|
|
44
46
|
} = assetsPromises;
|
|
45
|
-
const allPromises = [...themeAppearancePromise, ...themeColorPromise, zoomSizePromise, fontSizePromise];
|
|
46
47
|
useLayoutEffect(() => {
|
|
48
|
+
const allPromises = [...themeAppearancePromise, ...themeColorPromise, zoomSizePromise, fontSizePromise];
|
|
47
49
|
Promise.all(allPromises).then(() => {
|
|
48
50
|
typeof onAssetsDownloadSuccess === 'function' && onAssetsDownloadSuccess();
|
|
49
51
|
}).catch(error => {
|
|
50
52
|
console.error('Error loading assets:', error);
|
|
51
53
|
});
|
|
52
54
|
typeof getAssetsPromises === 'function' && getAssetsPromises(assetsPromises);
|
|
53
|
-
}, [
|
|
55
|
+
}, [themeAppearancePromise, themeColorPromise, zoomSizePromise, fontSizePromise]);
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
export default useDotProvider;
|
|
@@ -12,33 +12,50 @@ export default function useDownloadAssetsAndSetAttr(_ref) {
|
|
|
12
12
|
getProviderElement,
|
|
13
13
|
zoomUnitVariable,
|
|
14
14
|
fontUnitVariable,
|
|
15
|
+
excludeFeatures,
|
|
15
16
|
themeAppearanceAttr,
|
|
16
17
|
themeColorAttr
|
|
17
18
|
} = _ref;
|
|
19
|
+
const excluded = useMemo(() => new Set(excludeFeatures), [excludeFeatures]);
|
|
20
|
+
const needTheme = !excluded.has('theme');
|
|
21
|
+
const needZoom = !excluded.has('zoom');
|
|
22
|
+
const needFont = !excluded.has('font');
|
|
18
23
|
const themeAppearancePromise = useMemo(() => {
|
|
19
|
-
|
|
24
|
+
if (!needTheme) {
|
|
25
|
+
return [Promise.resolve()];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return getThemeAppearanceAssetPromise({
|
|
20
29
|
themeAppearance
|
|
21
30
|
});
|
|
22
|
-
|
|
23
|
-
}, [themeAppearance]);
|
|
31
|
+
}, [themeAppearance, needTheme]);
|
|
24
32
|
const themeColorPromise = useMemo(() => {
|
|
25
|
-
|
|
33
|
+
if (!needTheme) {
|
|
34
|
+
return [Promise.resolve()];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return getThemeColorAssetPromise({
|
|
26
38
|
themeAppearance,
|
|
27
39
|
themeColor
|
|
28
40
|
});
|
|
29
|
-
|
|
30
|
-
}, [themeAppearance, themeColor]);
|
|
41
|
+
}, [themeAppearance, themeColor, needTheme]);
|
|
31
42
|
const modifiedZoomUnitWithSuffix = useMemo(() => {
|
|
32
43
|
return !isNaN(Number(baseZoomUnit)) ? `${Number(baseZoomUnit)}px` : baseZoomUnit;
|
|
33
44
|
}, [baseZoomUnit]);
|
|
34
45
|
const zoomSizePromise = useMemo(() => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
if (!needZoom) {
|
|
47
|
+
return Promise.resolve();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return getZoomSizeAssetPromise();
|
|
51
|
+
}, [needZoom]);
|
|
38
52
|
const fontSizePromise = useMemo(() => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
if (!needFont) {
|
|
54
|
+
return Promise.resolve();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return getFontSizeAssetPromise();
|
|
58
|
+
}, [needFont]);
|
|
42
59
|
const combinedPromise = {
|
|
43
60
|
themeAppearancePromise,
|
|
44
61
|
themeColorPromise,
|
|
@@ -47,6 +64,10 @@ export default function useDownloadAssetsAndSetAttr(_ref) {
|
|
|
47
64
|
};
|
|
48
65
|
|
|
49
66
|
function setThemeAttribute() {
|
|
67
|
+
if (!needTheme) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
50
71
|
const themePromise = [...themeAppearancePromise, ...themeColorPromise];
|
|
51
72
|
Promise.all(themePromise).then(() => {
|
|
52
73
|
const providerElement = getProviderElement();
|
|
@@ -61,6 +82,10 @@ export default function useDownloadAssetsAndSetAttr(_ref) {
|
|
|
61
82
|
}
|
|
62
83
|
|
|
63
84
|
function setZoomSizeAttribute() {
|
|
85
|
+
if (!needZoom) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
64
89
|
zoomSizePromise.then(() => {
|
|
65
90
|
const providerElement = getProviderElement();
|
|
66
91
|
|
|
@@ -73,6 +98,10 @@ export default function useDownloadAssetsAndSetAttr(_ref) {
|
|
|
73
98
|
}
|
|
74
99
|
|
|
75
100
|
function setFontSizeAttribute() {
|
|
101
|
+
if (!needFont) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
76
105
|
fontSizePromise.then(() => {
|
|
77
106
|
const providerElement = getProviderElement();
|
|
78
107
|
|
|
@@ -86,12 +115,12 @@ export default function useDownloadAssetsAndSetAttr(_ref) {
|
|
|
86
115
|
|
|
87
116
|
useLayoutEffect(() => {
|
|
88
117
|
setThemeAttribute();
|
|
89
|
-
}, [themeAppearanceAttr, themeColorAttr, themeAppearance, themeColor, getProviderElement]);
|
|
118
|
+
}, [themeAppearanceAttr, themeColorAttr, themeAppearance, themeColor, getProviderElement, needTheme]);
|
|
90
119
|
useLayoutEffect(() => {
|
|
91
120
|
setZoomSizeAttribute();
|
|
92
|
-
}, [zoomUnitVariable, modifiedZoomUnitWithSuffix, getProviderElement]);
|
|
121
|
+
}, [zoomUnitVariable, modifiedZoomUnitWithSuffix, zoomSizePromise, getProviderElement, needZoom]);
|
|
93
122
|
useLayoutEffect(() => {
|
|
94
123
|
setFontSizeAttribute();
|
|
95
|
-
}, [fontUnitVariable, baseFontUnit, getProviderElement]);
|
|
124
|
+
}, [fontUnitVariable, baseFontUnit, fontSizePromise, getProviderElement, needFont]);
|
|
96
125
|
return combinedPromise;
|
|
97
126
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { THEME_APPEARANCE_LIGHT, THEME_COLOR_BLUE } from "../utils/constants";
|
|
2
|
+
import { DUMMY_ARRAY } from '@zohodesk/utils/es/constantProps/constant';
|
|
2
3
|
export const defaultProps = {
|
|
3
4
|
themeAppearance: THEME_APPEARANCE_LIGHT,
|
|
4
5
|
themeColor: THEME_COLOR_BLUE,
|
|
@@ -6,6 +7,7 @@ export const defaultProps = {
|
|
|
6
7
|
baseFontUnit: '16px',
|
|
7
8
|
zoomUnitVariable: '--zd_baseUnit',
|
|
8
9
|
fontUnitVariable: '--zd_baseFontUnit',
|
|
10
|
+
excludeFeatures: DUMMY_ARRAY,
|
|
9
11
|
themeAppearanceAttr: 'data-mode',
|
|
10
12
|
themeColorAttr: 'data-theme'
|
|
11
13
|
};
|
|
@@ -7,6 +7,7 @@ export const propTypes = {
|
|
|
7
7
|
baseFontUnit: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
8
8
|
zoomUnitVariable: PropTypes.string,
|
|
9
9
|
fontUnitVariable: PropTypes.string,
|
|
10
|
+
excludeFeatures: PropTypes.arrayOf(PropTypes.string),
|
|
10
11
|
themeAppearanceAttr: PropTypes.string,
|
|
11
12
|
themeColorAttr: PropTypes.string,
|
|
12
13
|
providerRef: PropTypes.func,
|