@livetiles/reach-components-react 0.4.0-preview.268 → 0.4.0-preview.269
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/AuthorFilter.d.ts +3 -0
- package/index.d.ts +5 -2
- package/index.esm.js +1 -1
- package/index.esm2.js +125 -23
- package/index.umd.js +125 -22
- package/package.json +1 -1
package/AuthorFilter.d.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -793,7 +793,10 @@ declare const KeywordsFilter: FC<{
|
|
|
793
793
|
className?: string;
|
|
794
794
|
}>;
|
|
795
795
|
|
|
796
|
-
declare const AuthorToolbarFilter: FC;
|
|
796
|
+
declare const AuthorToolbarFilter: FC;
|
|
797
|
+
declare const AuthorFilter: FC<{
|
|
798
|
+
className?: string;
|
|
799
|
+
}>;
|
|
797
800
|
|
|
798
801
|
interface ToolbarFilterModalProps extends FilterProps {
|
|
799
802
|
isOpen?: boolean;
|
|
@@ -809,4 +812,4 @@ interface VerticalFilterPanelProps extends FilterProps {
|
|
|
809
812
|
}
|
|
810
813
|
declare const VerticalFilterPanel: FC<VerticalFilterPanelProps>;
|
|
811
814
|
|
|
812
|
-
export { AuthorToolbarFilter, Avatar, Props as AvatarProps, ChannelFilter, ChannelFilterProps, ChannelToolbarFilter, ClearAllFiltersButton, ClearAllFiltersButtonProps, EventDetail, EventDetailProps, FilterProps, ItemLayoutMode, KeywordsFilter, KeywordsToolbarFilter, LibNewsFilterDefinition, ManageChannels, ManageChannelsProps, NewsDetail, NewsDetailPreview, NewsDetailPreviewProps, NewsDetailProps, NewsEditorDashboard, NewsEditorDashboardProps, NewsGrid, NewsGridProps, NewsHero, NewsHeroProps, NewsItemContextProvider, NewsItemPreviewContextProvider, NewsList, NewsListProps, PageDetail, PageDetailProps, PublishableItem, PublishingDateFilter, PublishingDateToolbarFilter, ReachContextProps, ReachContextProvider, Toolbar, ToolbarChannelSelector, ToolbarChannelSelectorOption, ToolbarChannelSelectorProps, ToolbarCloseButton, ToolbarCloseButtonProps, ToolbarFilterModal, ToolbarFilterModalButton, ToolbarFilterModalProps, ToolbarFilterPanel, ToolbarIconButton, ToolbarIconButtonProps, ToolbarManageNewsItemButton, ToolbarMarkAllEventsAsReadButton, ToolbarMarkAllItemsAsReadButtonProps, ToolbarMarkAllNewsAsReadButton, ToolbarNewsLanguageSelector, ToolbarProps, ToolbarSearchProps, UserDetails, UserDetailsProps, VerticalFilterPanel, VerticalFilterPanelProps, useCurrentUser };
|
|
815
|
+
export { AuthorFilter, AuthorToolbarFilter, Avatar, Props as AvatarProps, ChannelFilter, ChannelFilterProps, ChannelToolbarFilter, ClearAllFiltersButton, ClearAllFiltersButtonProps, EventDetail, EventDetailProps, FilterProps, ItemLayoutMode, KeywordsFilter, KeywordsToolbarFilter, LibNewsFilterDefinition, ManageChannels, ManageChannelsProps, NewsDetail, NewsDetailPreview, NewsDetailPreviewProps, NewsDetailProps, NewsEditorDashboard, NewsEditorDashboardProps, NewsGrid, NewsGridProps, NewsHero, NewsHeroProps, NewsItemContextProvider, NewsItemPreviewContextProvider, NewsList, NewsListProps, PageDetail, PageDetailProps, PublishableItem, PublishingDateFilter, PublishingDateToolbarFilter, ReachContextProps, ReachContextProvider, Toolbar, ToolbarChannelSelector, ToolbarChannelSelectorOption, ToolbarChannelSelectorProps, ToolbarCloseButton, ToolbarCloseButtonProps, ToolbarFilterModal, ToolbarFilterModalButton, ToolbarFilterModalProps, ToolbarFilterPanel, ToolbarIconButton, ToolbarIconButtonProps, ToolbarManageNewsItemButton, ToolbarMarkAllEventsAsReadButton, ToolbarMarkAllItemsAsReadButtonProps, ToolbarMarkAllNewsAsReadButton, ToolbarNewsLanguageSelector, ToolbarProps, ToolbarSearchProps, UserDetails, UserDetailsProps, VerticalFilterPanel, VerticalFilterPanelProps, useCurrentUser };
|
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { O as AuthorToolbarFilter, A as Avatar, D as ChannelFilter, F as ChannelToolbarFilter, J as ClearAllFiltersButton, E as EventDetail, I as ItemLayoutMode, K as KeywordsFilter, L as KeywordsToolbarFilter, M as ManageChannels, N as NewsDetail, x as NewsDetailPreview, l as NewsEditorDashboard, i as NewsGrid, k as NewsHero, t as NewsItemContextProvider, y as NewsItemPreviewContextProvider, h as NewsList, g as PageDetail, H as PublishingDateFilter, G as PublishingDateToolbarFilter, R as ReachContextProvider, n as Toolbar, p as ToolbarChannelSelector, s as ToolbarCloseButton, B as ToolbarFilterModal, C as ToolbarFilterModalButton, z as ToolbarFilterPanel, o as ToolbarIconButton, w as ToolbarManageNewsItemButton, q as ToolbarMarkAllEventsAsReadButton, r as ToolbarMarkAllNewsAsReadButton, v as ToolbarNewsLanguageSelector, U as UserDetails, V as VerticalFilterPanel, j as useCurrentUser } from './index.esm2.js';
|
|
1
|
+
export { Q as AuthorFilter, O as AuthorToolbarFilter, A as Avatar, D as ChannelFilter, F as ChannelToolbarFilter, J as ClearAllFiltersButton, E as EventDetail, I as ItemLayoutMode, K as KeywordsFilter, L as KeywordsToolbarFilter, M as ManageChannels, N as NewsDetail, x as NewsDetailPreview, l as NewsEditorDashboard, i as NewsGrid, k as NewsHero, t as NewsItemContextProvider, y as NewsItemPreviewContextProvider, h as NewsList, g as PageDetail, H as PublishingDateFilter, G as PublishingDateToolbarFilter, R as ReachContextProvider, n as Toolbar, p as ToolbarChannelSelector, s as ToolbarCloseButton, B as ToolbarFilterModal, C as ToolbarFilterModalButton, z as ToolbarFilterPanel, o as ToolbarIconButton, w as ToolbarManageNewsItemButton, q as ToolbarMarkAllEventsAsReadButton, r as ToolbarMarkAllNewsAsReadButton, v as ToolbarNewsLanguageSelector, U as UserDetails, V as VerticalFilterPanel, j as useCurrentUser } from './index.esm2.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'react';
|
package/index.esm2.js
CHANGED
|
@@ -87518,9 +87518,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
|
|
|
87518
87518
|
}), void 0);
|
|
87519
87519
|
};
|
|
87520
87520
|
|
|
87521
|
-
var version$1 = "0.4.0-preview.
|
|
87522
|
-
var buildId = "
|
|
87523
|
-
var commitId = "
|
|
87521
|
+
var version$1 = "0.4.0-preview.269";
|
|
87522
|
+
var buildId = "99811";
|
|
87523
|
+
var commitId = "7e755e5768d5f7b05d9c66fab05df1ace00b249c";
|
|
87524
87524
|
var isCustomerBuild = false;
|
|
87525
87525
|
var buildInfo = {
|
|
87526
87526
|
version: version$1,
|
|
@@ -131867,12 +131867,12 @@ $$3({target:'Array',proto:true,forced:String(test)===String(test.reverse())},{re
|
|
|
131867
131867
|
if(isArray$2(this))this.length=this.length;return nativeReverse.call(this);}});var CommentList=function CommentList(_a){var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,items=_a.items,groupIds=_a.groupIds,isLoading=_a.isLoading,onCommentDeleted=_a.onCommentDeleted,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,noItemsYetStringResourceKey=_a.noItemsYetStringResourceKey,getHashtagFilterRoute=_a.getHashtagFilterRoute,onReply=_a.onReply,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var _b=useState$2(true),isDialogHidden=_b[0],setIsDialogHidden=_b[1];var commentRef=useRef$1(null);var deleteComment=useCommentApi().deleteComment;var showError=useNotificationContext().showError;return jsxs("div",__assign({className:classNames(className,'comment-list'),"data-list":"comments"},{children:[jsx$1(ConfirmDialog,{onClose:function(){return setIsDialogHidden(true);},onConfirm:handleDelete,showDialog:!isDialogHidden,titleResourceKey:"Comment.delete.title",infoResourceKey:"Comment.delete.description"},void 0),jsx$1(OpacityAnimation,__assign({leaveDuration:500},{children:items!=null&&items.map(function(comment){var _a;var showAutoTranslate=comment.sender.id!==user.id;return jsx$1(CommentDisplay,{readOnly:readOnly,scope:scope,message:comment,showDelete:canDelete(comment),showEdit:canEdit(comment),onDelete:showDialog,showAutoTranslate:showAutoTranslate,mentionSearchHandler:mentionSearchHandler,type:type,baseAttachmentPath:baseAttachmentPath,getHashtagFilterRoute:getHashtagFilterRoute,highlight:comment.isUnread,isInitialLiked:comment.isLiked,onReply:onReply,replyCount:comment.threadId==null?(_a=comment.statistics)===null||_a===void 0?void 0:_a.replyCount:null},comment.receivedDateTime+comment.sender.id);})}),void 0),items!=null&&items.length===0&&!isLoading&&jsx$1("p",__assign({className:"ms-font-m ms-fontColor-neutralSecondary"},{children:jsx$1(FormattedMessage$1,{id:noItemsYetStringResourceKey},void 0)}),void 0)]}),void 0);function handleDelete(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(commentRef.current==null){return [2/*return*/];}onCommentDeleted&&onCommentDeleted(commentRef.current);_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,deleteComment(type,commentRef.current.conversationScope,commentRef.current.parentItemId,commentRef.current.id)];case 2:_a.sent();return [3/*break*/,4];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function showDialog(comment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){commentRef.current=comment;setIsDialogHidden(false);return [2/*return*/];});});}function canDelete(comment){return canEdit(comment)||hasMinRoleInAllGroups(GroupRoles.Admin,user,groupIds);}function canEdit(comment){return comment.sender&&comment.sender.id===user.id;}};var CreateCommentWithAttachments=function CreateCommentWithAttachments(props){var ignoreRef=useRef$1(false);useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var _a=useState$2(createId()),attachmentContainerId=_a[0],setAttachmentContainerId=_a[1];var _b=useAttachmentUploader([],attachmentContainerId,props.baseAttachmentPath),attachments=_b[0],handleAttachmentsAdded=_b[1],clearAttachments=_b[2],deletedAttachmentUrls=_b[3],onDeleteAttachment=_b[4];return jsx$1(CreateComment,__assign({},props,{onPost:handlePost,onAttachmentsChanged:handleAttachmentsAdded,attachments:attachments,deletedAttachmentUrls:deletedAttachmentUrls,onDeleteAttachment:onDeleteAttachment,allowAttachments:!!props.baseAttachmentPath,allowKeywords:props.allowKeywords,placeHolderStringResourceKey:props.placeHolderStringResourceKey,placeHolderStringResourceValues:props.placeHolderStringResourceValues}),void 0);function handlePost(message,keywords){return __awaiter(this,void 0,void 0,function(){var newAttachments;return __generator(this,function(_a){switch(_a.label){case 0:newAttachments=__spreadArray([],attachments);clearAttachments();return [4/*yield*/,props.onPost(message,attachmentContainerId,newAttachments,keywords)];case 1:_a.sent();if(!ignoreRef.current){setAttachmentContainerId(createId());}return [2/*return*/];}});});}};var SortOrder;(function(SortOrder){SortOrder[SortOrder["Asc"]=0]="Asc";SortOrder[SortOrder["Desc"]=1]="Desc";})(SortOrder||(SortOrder={}));var PagedCommentsSection=function PagedCommentsSection(_a){var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,itemId=_a.itemId,groupIds=_a.groupIds,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,scope=_a.scope,_b=_a.initialPageSize,initialPageSize=_b===void 0?2:_b,_c=_a.pageSize,pageSize=_c===void 0?5:_c,mentionSearchHandler=_a.mentionSearchHandler,initialComments=_a.initialComments,onCommentAdded=_a.onCommentAdded,onCommentDeleted=_a.onCommentDeleted,noItemsYetStringResourceKey=_a.noItemsYetStringResourceKey,autoFocusReplyField=_a.autoFocusReplyField,getHashtagFilterRoute=_a.getHashtagFilterRoute,buttons=_a.buttons,threadId=_a.threadId,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues,showReplyBox=_a.showReplyBox,title=_a.title,onThreadReply=_a.onThreadReply,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var createComment=useCommentApi().createComment;var user=useCurrentUser();var features=useFeatures();var history=useHistory();var location=useLocation$1();var formatMessage=useIntl().formatMessage;var showError=useNotificationContext().showError;var _d=useState$2((initialComments===null||initialComments===void 0?void 0:initialComments.items.length)===0||type!==ItemResourceTypes.Posts||showReplyBox),showNewComment=_d[0],setShowNewComment=_d[1];var _e=useState$2(),commentToReplyTo=_e[0],setCommentToReplyTo=_e[1];var _f=useState$2(autoFocusReplyField),autoFocusNewCommentInput=_f[0],setAutoFocusNewCommentInput=_f[1];var preventLoading=readOnly&&!loadInReadOnlyMode;var _g=usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId),comments=_g[0],isLoading=_g[1],hasNextPage=_g[2],loadNextPage=_g[3],setComments=_g[4],hasMoreUnreadComments=_g[5];var commentIdsString=(comments!==null&&comments!==void 0?comments:[]).map(function(c){return c.id;}).join(',');useEffect$1(function(){var _a;if(commentIdsString.length>0&&((_a=location.state)===null||_a===void 0?void 0:_a.parentCommentId)){if(autoFocusNewCommentInput){return;}var commentContainer=document.getElementById(location.state.parentCommentId);commentContainer===null||commentContainer===void 0?void 0:commentContainer.scrollIntoView(true);history.replace(__assign(__assign({},location),{state:__assign(__assign({},location.state),{parentCommentId:null})}));}// comments changes implicitly 'validates' location state changes
|
|
131868
131868
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131869
131869
|
},[commentIdsString]);var showSpinner=!preventLoading&&isLoading;var showLoadMore=!preventLoading&&hasNextPage&&!isLoading;var showComments=!preventLoading&&(comments===null||comments===void 0?void 0:comments.length)>0;return jsxs("div",__assign({className:className},{children:[jsxs(TitleAndSpinner,{children:[title,showSpinner&&jsx$1(StyledSpinner$1,{},void 0)]},void 0),showLoadMore&&jsx$1(LoadMoreContainer,__assign({"data-load-more-comments-container":true,"data-show-highlight":hasMoreUnreadComments,highlight:hasMoreUnreadComments},{children:jsx$1(LoadMore,{text:formatMessage({id:type===ItemResourceTypes.Posts||threadId!=null?'Post.comments.loadMore':'Comment.loadMore'}),onClick:function(){return loadNextPage();},iconProps:{iconName:'ScrollUpDown'},"data-load-more-comments":true},void 0)}),void 0),showComments&&jsx$1(CommentList,{scope:ConversationScope.Public,items:comments,groupIds:groupIds,isLoading:isLoading,onCommentDeleted:handleCommentDeleted,mentionSearchHandler:mentionSearchHandler,type:type,baseAttachmentPath:baseAttachmentPath,noItemsYetStringResourceKey:noItemsYetStringResourceKey,getHashtagFilterRoute:getHashtagFilterRoute,onReply:handleOnReply,readOnly:readOnly},void 0),!showNewComment&&jsx$1(ReplyButton,{iconProps:{iconName:'Reply'},text:formatMessage({id:'Post.comments.addReply'}),onClick:showNewCommentInput,"data-add-comment":true},void 0),showNewComment&&jsxs(Fragment,{children:[jsx$1(NewComment// the key is required to autofocus the reply field when replying to comments
|
|
131870
|
-
,{readOnly:readOnly,onPost:handleCommentCreated,mentionSearchHandler:mentionSearchHandler,autoFocus:autoFocusNewCommentInput,focusAfterPost:!env.isNativeMobileApp,baseAttachmentPath:baseAttachmentPath,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,content:getContent(),allowSaveWithoutContent:true,saveOnCtrlEnter:true},commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentId),!readOnly&&buttons]},void 0)]}),void 0);function getContent(){var _a;return ((_a=commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentSender)===null||_a===void 0?void 0:_a.id)&&commentToReplyTo.commentSender.id!==user.id?constructUserMention(commentToReplyTo.commentSender):null;}function handleOnReply(commentId,commentSender){if(features.replyToComments){history.replace(__assign(__assign({},location),{state:{parentCommentId:"Comment-"+commentId}}));onThreadReply===null||onThreadReply===void 0?void 0:onThreadReply(commentId);setCommentToReplyTo({commentId:commentId,commentSender:commentSender});return;}showNewCommentInput();setCommentToReplyTo({commentId:commentId,commentSender:commentSender});setAutoFocusNewCommentInput(true);}function showNewCommentInput(){if(user.isPublicUser){triggerEvent(PromptPublicUserLoginAction.create());return;}setShowNewComment(true);}function handleCommentDeleted(comment){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:setComments(function(stateComments){return stateComments.filter(function(c){return c.id!==comment.id;});});onCommentDeleted===null||onCommentDeleted===void 0?void 0:onCommentDeleted(comment);_a=!threadId;if(!_a)return [3/*break*/,2];return [4/*yield*/,refreshStatistics(itemId,{commentCount:-1})];case 1:_a=_b.sent();_b.label=2;case 2:return [2/*return*/];}});});}function handleCommentCreated(commentDelta,attachmentContainerId,attachments){return __awaiter(this,void 0,void 0,function(){var newComment,comment_1,_a,error_1;return __generator(this,function(_b){switch(_b.label){case 0:newComment={id:null,parentItemId:itemId,content:commentDelta.content,conversationScope:scope,sender:user,receivedDateTime:moment.utc().toISOString(),attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId,isUnread:false};setComments(function(stateComments){return __spreadArray(__spreadArray([],stateComments),[newComment]);});onCommentAdded===null||onCommentAdded===void 0?void 0:onCommentAdded();_b.label=1;case 1:_b.trys.push([1,5,6,7]);return [4/*yield*/,createComment(type,scope,itemId,__assign(__assign({},commentDelta),{attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId}))];case 2:comment_1=_b.sent();_a=!threadId;if(!_a)return [3/*break*/,4];return [4/*yield*/,refreshStatistics(itemId,{commentCount:1})];case 3:_a=_b.sent();_b.label=4;case 4:setComments(function(stateComments){var _a;return update$2(stateComments,(_a={},_a[stateComments.length-1]={$merge:{id:comment_1.id,fileAccessToken:comment_1.fileAccessToken}},_a));});return [3/*break*/,7];case 5:error_1=_b.sent();logger.error(error_1);showError('Comment.errorMessage');return [3/*break*/,7];case 6:setAutoFocusNewCommentInput(false);setCommentToReplyTo(null);return [7/*endfinally*/];case 7:return [2/*return*/];}});});}};var TitleAndSpinner=_styled.div.withConfig({displayName:"PagedCommentsSection__TitleAndSpinner",componentId:"sc-1f3hft1-0"})(templateObject_1$1d||(templateObject_1$1d=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var ReplyButton=_styled(ActionButton).withConfig({displayName:"PagedCommentsSection__ReplyButton",componentId:"sc-1f3hft1-1"})(templateObject_2$I||(templateObject_2$I=__makeTemplateObject(["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"],["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"])),function(p){return p.theme.palette.accent;});var NewComment=_styled(CreateCommentWithAttachments).withConfig({displayName:"PagedCommentsSection__NewComment",componentId:"sc-1f3hft1-2"})(templateObject_3$u||(templateObject_3$u=__makeTemplateObject(["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"],["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"])));var LoadMoreContainer=_styled.div.withConfig({displayName:"PagedCommentsSection__LoadMoreContainer",componentId:"sc-1f3hft1-3"})(templateObject_5$i||(templateObject_5$i=__makeTemplateObject(["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"],["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"])),function(p){return p.highlight&&css$2(templateObject_4$j||(templateObject_4$j=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var LoadMore=_styled(ActionButton).withConfig({displayName:"PagedCommentsSection__LoadMore",componentId:"sc-1f3hft1-4"})(templateObject_6$b||(templateObject_6$b=__makeTemplateObject(["\n && {\n text-align: left;\n }\n"],["\n && {\n text-align: left;\n }\n"])));var StyledSpinner$1=_styled(Spinner).withConfig({displayName:"PagedCommentsSection__StyledSpinner",componentId:"sc-1f3hft1-5"})(templateObject_7$6||(templateObject_7$6=__makeTemplateObject(["\n margin: 0 auto;\n padding: 15px 0;\n"],["\n margin: 0 auto;\n padding: 15px 0;\n"])));function usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId){var _a=useState$2(function(){return __spreadArray([],(initialComments===null||initialComments===void 0?void 0:initialComments.items)||[]).reverse();}),comments=_a[0],setComments=_a[1];var _b=useState$2({token:initialComments===null||initialComments===void 0?void 0:initialComments.paginationToken,hasMoreUnreadComments:initialComments===null||initialComments===void 0?void 0:initialComments.hasMoreUnreadComments}),nextPageInfos=_b[0],setNextPageInfos=_b[1];var _c=useState$2(!initialComments),isLoading=_c[0],setIsLoading=_c[1];var pullToRefreshContext=useContext(PullToRefreshContext);var _d=useCommentApi(),listComments=_d.listComments,getCommentReplies=_d.getCommentReplies;// the context can be null, in case we are in the editor
|
|
131870
|
+
,{readOnly:readOnly,onPost:handleCommentCreated,mentionSearchHandler:mentionSearchHandler,autoFocus:autoFocusNewCommentInput,focusAfterPost:!env.isNativeMobileApp,baseAttachmentPath:baseAttachmentPath,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,content:getContent(),allowSaveWithoutContent:true,saveOnCtrlEnter:true},commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentId),!readOnly&&buttons]},void 0)]}),void 0);function getContent(){var _a;return ((_a=commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentSender)===null||_a===void 0?void 0:_a.id)&&commentToReplyTo.commentSender.id!==user.id?constructUserMention(commentToReplyTo.commentSender):null;}function handleOnReply(commentId,commentSender){if(features.replyToComments){history.replace(__assign(__assign({},location),{state:{parentCommentId:"Comment-"+commentId}}));onThreadReply===null||onThreadReply===void 0?void 0:onThreadReply(commentId);setCommentToReplyTo({commentId:commentId,commentSender:commentSender});return;}showNewCommentInput();setCommentToReplyTo({commentId:commentId,commentSender:commentSender});setAutoFocusNewCommentInput(true);}function showNewCommentInput(){if(user.isPublicUser){triggerEvent(PromptPublicUserLoginAction.create());return;}setShowNewComment(true);}function handleCommentDeleted(comment){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:setComments(function(stateComments){return stateComments.filter(function(c){return c.id!==comment.id;});});onCommentDeleted===null||onCommentDeleted===void 0?void 0:onCommentDeleted(comment);_a=!threadId;if(!_a)return [3/*break*/,2];return [4/*yield*/,refreshStatistics(itemId,{commentCount:-1})];case 1:_a=_b.sent();_b.label=2;case 2:return [2/*return*/];}});});}function handleCommentCreated(commentDelta,attachmentContainerId,attachments){return __awaiter(this,void 0,void 0,function(){var newComment,comment_1,_a,error_1;return __generator(this,function(_b){switch(_b.label){case 0:newComment={id:null,parentItemId:itemId,content:commentDelta.content,conversationScope:scope,sender:user,receivedDateTime:moment.utc().toISOString(),attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId,isUnread:false};setComments(function(stateComments){return __spreadArray(__spreadArray([],stateComments),[newComment]);});onCommentAdded===null||onCommentAdded===void 0?void 0:onCommentAdded();_b.label=1;case 1:_b.trys.push([1,5,6,7]);return [4/*yield*/,createComment(type,scope,itemId,__assign(__assign({},commentDelta),{attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId}))];case 2:comment_1=_b.sent();_a=!threadId;if(!_a)return [3/*break*/,4];return [4/*yield*/,refreshStatistics(itemId,{commentCount:1})];case 3:_a=_b.sent();_b.label=4;case 4:setComments(function(stateComments){var _a;return update$2(stateComments,(_a={},_a[stateComments.length-1]={$merge:{id:comment_1.id,fileAccessToken:comment_1.fileAccessToken}},_a));});return [3/*break*/,7];case 5:error_1=_b.sent();logger.error(error_1);showError('Comment.errorMessage');return [3/*break*/,7];case 6:setAutoFocusNewCommentInput(false);setCommentToReplyTo(null);return [7/*endfinally*/];case 7:return [2/*return*/];}});});}};var TitleAndSpinner=_styled.div.withConfig({displayName:"PagedCommentsSection__TitleAndSpinner",componentId:"sc-1f3hft1-0"})(templateObject_1$1d||(templateObject_1$1d=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var ReplyButton=_styled(ActionButton).withConfig({displayName:"PagedCommentsSection__ReplyButton",componentId:"sc-1f3hft1-1"})(templateObject_2$I||(templateObject_2$I=__makeTemplateObject(["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"],["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"])),function(p){return p.theme.palette.accent;});var NewComment=_styled(CreateCommentWithAttachments).withConfig({displayName:"PagedCommentsSection__NewComment",componentId:"sc-1f3hft1-2"})(templateObject_3$u||(templateObject_3$u=__makeTemplateObject(["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"],["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"])));var LoadMoreContainer=_styled.div.withConfig({displayName:"PagedCommentsSection__LoadMoreContainer",componentId:"sc-1f3hft1-3"})(templateObject_5$i||(templateObject_5$i=__makeTemplateObject(["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"],["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"])),function(p){return p.highlight&&css$2(templateObject_4$j||(templateObject_4$j=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var LoadMore=_styled(ActionButton).withConfig({displayName:"PagedCommentsSection__LoadMore",componentId:"sc-1f3hft1-4"})(templateObject_6$b||(templateObject_6$b=__makeTemplateObject(["\n && {\n text-align: left;\n }\n"],["\n && {\n text-align: left;\n }\n"])));var StyledSpinner$1=_styled(Spinner).withConfig({displayName:"PagedCommentsSection__StyledSpinner",componentId:"sc-1f3hft1-5"})(templateObject_7$6$1||(templateObject_7$6$1=__makeTemplateObject(["\n margin: 0 auto;\n padding: 15px 0;\n"],["\n margin: 0 auto;\n padding: 15px 0;\n"])));function usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId){var _a=useState$2(function(){return __spreadArray([],(initialComments===null||initialComments===void 0?void 0:initialComments.items)||[]).reverse();}),comments=_a[0],setComments=_a[1];var _b=useState$2({token:initialComments===null||initialComments===void 0?void 0:initialComments.paginationToken,hasMoreUnreadComments:initialComments===null||initialComments===void 0?void 0:initialComments.hasMoreUnreadComments}),nextPageInfos=_b[0],setNextPageInfos=_b[1];var _c=useState$2(!initialComments),isLoading=_c[0],setIsLoading=_c[1];var pullToRefreshContext=useContext(PullToRefreshContext);var _d=useCommentApi(),listComments=_d.listComments,getCommentReplies=_d.getCommentReplies;// the context can be null, in case we are in the editor
|
|
131871
131871
|
var refreshToken=pullToRefreshContext===null||pullToRefreshContext===void 0?void 0:pullToRefreshContext.refreshToken;var refreshUserDetails=useRefreshUserDetails();var isValid=true;useEffect$1(function(){if(!isValid||preventLoading){return undefined;}if(!initialComments||refreshToken){// pass the pageToken explicitly since it's possible that the nextPageTokenState has not been updated yet
|
|
131872
131872
|
loadNextPage(null,initialPageSize,!!initialComments).then(function(){return null;},logger.error);}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131873
131873
|
return function(){isValid=false;};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131874
131874
|
},[initialComments,itemId,refreshToken]);return [comments,isLoading,!!(nextPageInfos===null||nextPageInfos===void 0?void 0:nextPageInfos.token),loadNextPage,setComments,nextPageInfos.hasMoreUnreadComments];function loadNextPage(nextPageTokenOverride,pageSizeOverride,doNotSetIsLoading){return __awaiter(this,void 0,void 0,function(){var token,nextPage,_a;return __generator(this,function(_b){switch(_b.label){case 0:if(!isValid){return [2/*return*/];}if(!doNotSetIsLoading){setIsLoading(true);}token=nextPageTokenOverride!==undefined?nextPageTokenOverride:nextPageInfos===null||nextPageInfos===void 0?void 0:nextPageInfos.token;if(!(threadId!=null))return [3/*break*/,2];return [4/*yield*/,getCommentReplies(type,scope,itemId,threadId,{sortOrder:SortOrder.Desc,pageSize:pageSizeOverride!==null&&pageSizeOverride!==void 0?pageSizeOverride:pageSize,token:token})];case 1:_a=_b.sent();return [3/*break*/,4];case 2:return [4/*yield*/,listComments(type,scope,itemId,{sortOrder:SortOrder.Desc,pageSize:pageSizeOverride!==null&&pageSizeOverride!==void 0?pageSizeOverride:pageSize,token:token})];case 3:_a=_b.sent();_b.label=4;case 4:nextPage=_a;if(isValid){setIsLoading(false);setComments(function(stateComments){return token!=null?__spreadArray(__spreadArray([],__spreadArray([],nextPage.items).reverse()),stateComments):nextPage.items.reverse();});// refresh the unread count every time we load a new page of comments
|
|
131875
|
-
refreshUserDetails();setNextPageInfos({token:nextPage.paginationToken,hasMoreUnreadComments:nextPage.hasMoreUnreadComments});}return [2/*return*/];}});});}}var templateObject_1$1d,templateObject_2$I,templateObject_3$u,templateObject_4$j,templateObject_5$i,templateObject_6$b,templateObject_7$6;var PublicUserFullAccessButton=function PublicUserFullAccessButton(_a){var user=_a.user,onClick=_a.onClick,descriptionResourceKeyPrefix=_a.descriptionResourceKeyPrefix,descriptionValues=_a.descriptionValues,className=_a.className;var formatMessage=useIntl().formatMessage;var history=useHistory();var location=useLocation$1();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var shouldRegister=user.subscription.allowSelfRegistration&&user.authenticationType!==AuthenticationType.public;return jsxs("div",__assign({className:className},{children:[jsx$1(PublicUserButtonFocusStyle,{},void 0),descriptionResourceKeyPrefix&&jsx$1(Description$1,{id:descriptionResourceKeyPrefix+"."+(shouldRegister?'register':'login'),values:descriptionValues,tagName:"p"},void 0),jsx$1(PrimaryButton,{"data-public-access-button":true,text:formatMessage({id:shouldRegister?'SelfRegistration.register':'Subscription.login.caption'}),onClick:handleOnClick},void 0)]}),void 0);function handleOnClick(){onClick===null||onClick===void 0?void 0:onClick();if(shouldRegister){history.push({pathname:buildPath('/register')});}else {history.push({pathname:'/logout',search:queryString.stringify({source:getAppUrl()+buildPath("/login?"+queryString.stringify({source:location.pathname}))})});}}};var PublicUserButtonFocusStyle=createGlobalStyle(templateObject_1$1c||(templateObject_1$1c=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return applyFocusStyle("\n button[data-public-access-button]:focus::after {\n outline-color: "+p.theme.palette.accent+" !important;\n outline-offset: 2px;\n }\n ");});var Description$1=_styled(FormattedMessageWithStyle).withConfig({displayName:"PublicUserFullAccessButton__Description",componentId:"sc-tjhzmp-0"})(templateObject_2$H||(templateObject_2$H=__makeTemplateObject(["\n margin-top: 0;\n color: ",";\n"],["\n margin-top: 0;\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1c,templateObject_2$H;var PublishableItemComments=function PublishableItemComments(_a){var item=_a.item,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,type=_a.type,onThreadReply=_a.onThreadReply,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var container=useRef$1();var location=useLocation$1();var searchAccountsByItemId=useAccountApi().searchAccountsByItemId;var user=useCurrentUser();useEffect$1(function(){// scroll comments container into view if there is the corresponding hash in the path.
|
|
131875
|
+
refreshUserDetails();setNextPageInfos({token:nextPage.paginationToken,hasMoreUnreadComments:nextPage.hasMoreUnreadComments});}return [2/*return*/];}});});}}var templateObject_1$1d,templateObject_2$I,templateObject_3$u,templateObject_4$j,templateObject_5$i,templateObject_6$b,templateObject_7$6$1;var PublicUserFullAccessButton=function PublicUserFullAccessButton(_a){var user=_a.user,onClick=_a.onClick,descriptionResourceKeyPrefix=_a.descriptionResourceKeyPrefix,descriptionValues=_a.descriptionValues,className=_a.className;var formatMessage=useIntl().formatMessage;var history=useHistory();var location=useLocation$1();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var shouldRegister=user.subscription.allowSelfRegistration&&user.authenticationType!==AuthenticationType.public;return jsxs("div",__assign({className:className},{children:[jsx$1(PublicUserButtonFocusStyle,{},void 0),descriptionResourceKeyPrefix&&jsx$1(Description$1,{id:descriptionResourceKeyPrefix+"."+(shouldRegister?'register':'login'),values:descriptionValues,tagName:"p"},void 0),jsx$1(PrimaryButton,{"data-public-access-button":true,text:formatMessage({id:shouldRegister?'SelfRegistration.register':'Subscription.login.caption'}),onClick:handleOnClick},void 0)]}),void 0);function handleOnClick(){onClick===null||onClick===void 0?void 0:onClick();if(shouldRegister){history.push({pathname:buildPath('/register')});}else {history.push({pathname:'/logout',search:queryString.stringify({source:getAppUrl()+buildPath("/login?"+queryString.stringify({source:location.pathname}))})});}}};var PublicUserButtonFocusStyle=createGlobalStyle(templateObject_1$1c||(templateObject_1$1c=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return applyFocusStyle("\n button[data-public-access-button]:focus::after {\n outline-color: "+p.theme.palette.accent+" !important;\n outline-offset: 2px;\n }\n ");});var Description$1=_styled(FormattedMessageWithStyle).withConfig({displayName:"PublicUserFullAccessButton__Description",componentId:"sc-tjhzmp-0"})(templateObject_2$H||(templateObject_2$H=__makeTemplateObject(["\n margin-top: 0;\n color: ",";\n"],["\n margin-top: 0;\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1c,templateObject_2$H;var PublishableItemComments=function PublishableItemComments(_a){var item=_a.item,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,type=_a.type,onThreadReply=_a.onThreadReply,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var container=useRef$1();var location=useLocation$1();var searchAccountsByItemId=useAccountApi().searchAccountsByItemId;var user=useCurrentUser();useEffect$1(function(){// scroll comments container into view if there is the corresponding hash in the path.
|
|
131876
131876
|
// HACK: a regular anchor does not work, because content is rendered
|
|
131877
131877
|
// dynamically and the comments might not be in DOM at the right time.
|
|
131878
131878
|
// TODO: Try to avoid this.
|
|
@@ -132989,7 +132989,7 @@ var Intro$1 = _styled.p.withConfig({
|
|
|
132989
132989
|
var Title$3 = _styled.span.withConfig({
|
|
132990
132990
|
displayName: "NewsCompactCard__Title",
|
|
132991
132991
|
componentId: "sc-16ovog0-5"
|
|
132992
|
-
})(templateObject_7$
|
|
132992
|
+
})(templateObject_7$6 || (templateObject_7$6 = __makeTemplateObject$l(["\n ", "\n display: inline-block;\n max-width: 100%;\n"], ["\n ", "\n display: inline-block;\n max-width: 100%;\n"])), TextStyle);
|
|
132993
132993
|
|
|
132994
132994
|
var TitleWrapper$1 = _styled.a.withConfig({
|
|
132995
132995
|
displayName: "NewsCompactCard__TitleWrapper",
|
|
@@ -133058,7 +133058,7 @@ var BannerHost = _styled.div.withConfig({
|
|
|
133058
133058
|
});
|
|
133059
133059
|
});
|
|
133060
133060
|
|
|
133061
|
-
var templateObject_1$p, templateObject_2$g, templateObject_3$d, templateObject_4$c, templateObject_5$a, templateObject_6$9, templateObject_7$
|
|
133061
|
+
var templateObject_1$p, templateObject_2$g, templateObject_3$d, templateObject_4$c, templateObject_5$a, templateObject_6$9, templateObject_7$6, templateObject_8$5, templateObject_9$3, templateObject_10$3, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$2, templateObject_16$1;
|
|
133062
133062
|
|
|
133063
133063
|
var EmptyNewsList = function EmptyNewsList() {
|
|
133064
133064
|
return jsxs(Host$d, {
|
|
@@ -133285,7 +133285,7 @@ var StyledIcon$2 = _styled(Icon).withConfig({
|
|
|
133285
133285
|
var CommentsCount = _styled.span.withConfig({
|
|
133286
133286
|
displayName: "NewsList__CommentsCount",
|
|
133287
133287
|
componentId: "sc-1d0bzx1-5"
|
|
133288
|
-
})(templateObject_7$
|
|
133288
|
+
})(templateObject_7$5 || (templateObject_7$5 = __makeTemplateObject$l(["\n padding-left: 5px;\n font-size: 0.9rem;\n"], ["\n padding-left: 5px;\n font-size: 0.9rem;\n"])));
|
|
133289
133289
|
|
|
133290
133290
|
var ErrorContainer$1 = _styled.p.withConfig({
|
|
133291
133291
|
displayName: "NewsList__ErrorContainer",
|
|
@@ -133294,7 +133294,7 @@ var ErrorContainer$1 = _styled.p.withConfig({
|
|
|
133294
133294
|
return p.theme.palette.red;
|
|
133295
133295
|
}, spacingM);
|
|
133296
133296
|
|
|
133297
|
-
var templateObject_1$n, templateObject_2$e, templateObject_3$b, templateObject_4$b, templateObject_5$9, templateObject_6$8, templateObject_7$
|
|
133297
|
+
var templateObject_1$n, templateObject_2$e, templateObject_3$b, templateObject_4$b, templateObject_5$9, templateObject_6$8, templateObject_7$5, templateObject_8$4;
|
|
133298
133298
|
|
|
133299
133299
|
var ManageChannels = function ManageChannels(_a) {
|
|
133300
133300
|
var className = _a.className;
|
|
@@ -133524,7 +133524,7 @@ var NotificationButton = _styled.div.withConfig({
|
|
|
133524
133524
|
var ChannelToggle = _styled(ToggleWithLabel).withConfig({
|
|
133525
133525
|
displayName: "ManageChannels__ChannelToggle",
|
|
133526
133526
|
componentId: "sc-yyoxfw-6"
|
|
133527
|
-
})(templateObject_7$
|
|
133527
|
+
})(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject$l(["\n && {\n margin: ", "px 0;\n\n label {\n font-weight: normal;\n padding: 0;\n }\n\n .ms-Toggle-innerContainer {\n align-self: flex-start;\n }\n }\n"], ["\n && {\n margin: ", "px 0;\n\n label {\n font-weight: normal;\n padding: 0;\n }\n\n .ms-Toggle-innerContainer {\n align-self: flex-start;\n }\n }\n"])), spacingXxs);
|
|
133528
133528
|
|
|
133529
133529
|
var StyledIconButton = _styled(IconButton$1).withConfig({
|
|
133530
133530
|
displayName: "ManageChannels__StyledIconButton",
|
|
@@ -133533,7 +133533,7 @@ var StyledIconButton = _styled(IconButton$1).withConfig({
|
|
|
133533
133533
|
return p.theme.textColors.default;
|
|
133534
133534
|
});
|
|
133535
133535
|
|
|
133536
|
-
var templateObject_1$m, templateObject_2$d, templateObject_3$a, templateObject_4$a, templateObject_5$8, templateObject_6$7, templateObject_7$
|
|
133536
|
+
var templateObject_1$m, templateObject_2$d, templateObject_3$a, templateObject_4$a, templateObject_5$8, templateObject_6$7, templateObject_7$4, templateObject_8$3;
|
|
133537
133537
|
|
|
133538
133538
|
var NewsGridCard = function NewsGridCard(_a) {
|
|
133539
133539
|
var _b;
|
|
@@ -133653,7 +133653,7 @@ var Content$1 = _styled.div(templateObject_4$9 || (templateObject_4$9 = __makeTe
|
|
|
133653
133653
|
});
|
|
133654
133654
|
var MetaInfo = _styled.div(templateObject_5$7 || (templateObject_5$7 = __makeTemplateObject$l(["\n font-size: ", "px;\n"], ["\n font-size: ", "px;\n"])), fontSizeSmall);
|
|
133655
133655
|
var DateAndIcon = _styled.div(templateObject_6$6 || (templateObject_6$6 = __makeTemplateObject$l(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
133656
|
-
var PublishingDate = _styled(DateTime)(templateObject_7$
|
|
133656
|
+
var PublishingDate = _styled(DateTime)(templateObject_7$3 || (templateObject_7$3 = __makeTemplateObject$l(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n align-self: center;\n"], ["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n align-self: center;\n"])));
|
|
133657
133657
|
var NewsCardIcon = _styled.div(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject$l(["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"], ["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"])));
|
|
133658
133658
|
var StyledIcon$1 = _styled(Icon)(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject$l(["\n font-size: ", "px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ", "px;\n cursor: pointer;\n\n background-color: ", ";\n color: ", ";\n"], ["\n font-size: ", "px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ", "px;\n cursor: pointer;\n\n background-color: ", ";\n color: ", ";\n"])), fontSizeSmaller, spacingXs, function (p) {
|
|
133659
133659
|
return p.backgroundColor;
|
|
@@ -133668,7 +133668,7 @@ var KeywordsWrapper = _styled.div(templateObject_14$1 || (templateObject_14$1 =
|
|
|
133668
133668
|
return p.theme.palette.neutralTertiary;
|
|
133669
133669
|
});
|
|
133670
133670
|
var StyledChannels$1 = _styled(ChannelList$1)(templateObject_15$1 || (templateObject_15$1 = __makeTemplateObject$l(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), spacingS, spacingM);
|
|
133671
|
-
var templateObject_1$l, templateObject_2$c, templateObject_3$9, templateObject_4$9, templateObject_5$7, templateObject_6$6, templateObject_7$
|
|
133671
|
+
var templateObject_1$l, templateObject_2$c, templateObject_3$9, templateObject_4$9, templateObject_5$7, templateObject_6$6, templateObject_7$3, templateObject_8$2, templateObject_9$2, templateObject_10$2, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;
|
|
133672
133672
|
|
|
133673
133673
|
var ErrorContainer = function ErrorContainer() {
|
|
133674
133674
|
return jsx$1(Host$9, {
|
|
@@ -133933,7 +133933,7 @@ var HeroSlide = function HeroSlide(_a) {
|
|
|
133933
133933
|
var Host$7 = _styled.div.withConfig({
|
|
133934
133934
|
displayName: "HeroSlide__Host",
|
|
133935
133935
|
componentId: "sc-3yofth-0"
|
|
133936
|
-
})(templateObject_7$
|
|
133936
|
+
})(templateObject_7$2 || (templateObject_7$2 = __makeTemplateObject$l(["\n position: relative;\n\n ", "\n\n ", "\n \n ", "\n \n ", "\n"], ["\n position: relative;\n\n ", "\n\n ", "\n \n ", "\n \n ", "\n"])), function (p) {
|
|
133937
133937
|
return p.width ? css$2(templateObject_1$i || (templateObject_1$i = __makeTemplateObject$l(["\n width: ", ";\n "], ["\n width: ", ";\n "])), p.width) : css$2(templateObject_2$a || (templateObject_2$a = __makeTemplateObject$l(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
|
|
133938
133938
|
}, function (p) {
|
|
133939
133939
|
return p.height ? css$2(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject$l(["\n height: ", ";\n "], ["\n height: ", ";\n "])), p.height) : css$2(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject$l(["\n height: 100%;\n "], ["\n height: 100%;\n "])));
|
|
@@ -134054,7 +134054,7 @@ var StyledDateTime = _styled(DateTime).withConfig({
|
|
|
134054
134054
|
return p.color ? css$2(templateObject_31 || (templateObject_31 = __makeTemplateObject$l(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.color) : css$2(templateObject_32 || (templateObject_32 = __makeTemplateObject$l(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.theme.textColors.default);
|
|
134055
134055
|
});
|
|
134056
134056
|
|
|
134057
|
-
var templateObject_1$i, templateObject_2$a, templateObject_3$7, templateObject_4$7, templateObject_5$5, templateObject_6$5, templateObject_7$
|
|
134057
|
+
var templateObject_1$i, templateObject_2$a, templateObject_3$7, templateObject_4$7, templateObject_5$5, templateObject_6$5, templateObject_7$2, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33;
|
|
134058
134058
|
|
|
134059
134059
|
var HeroPaging = function HeroPaging(_a) {
|
|
134060
134060
|
var items = _a.items,
|
|
@@ -135510,7 +135510,7 @@ var Channels = _styled.div.withConfig({
|
|
|
135510
135510
|
var StyledCheckbox$1 = _styled(Checkbox).withConfig({
|
|
135511
135511
|
displayName: "ChannelFilter__StyledCheckbox",
|
|
135512
135512
|
componentId: "sc-1ju8xwz-6"
|
|
135513
|
-
})(templateObject_7 || (templateObject_7 = __makeTemplateObject$l(["\n padding: ", "px 0;\n\n label {\n max-width: 100%;\n }\n\n &:first-child {\n padding-top: 0;\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n"], ["\n padding: ", "px 0;\n\n label {\n max-width: 100%;\n }\n\n &:first-child {\n padding-top: 0;\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n"])), spacingS - 2);
|
|
135513
|
+
})(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject$l(["\n padding: ", "px 0;\n\n label {\n max-width: 100%;\n }\n\n &:first-child {\n padding-top: 0;\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n"], ["\n padding: ", "px 0;\n\n label {\n max-width: 100%;\n }\n\n &:first-child {\n padding-top: 0;\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n"])), spacingS - 2);
|
|
135514
135514
|
|
|
135515
135515
|
var StyledChannelTitle = _styled(ChannelTitle).withConfig({
|
|
135516
135516
|
displayName: "ChannelFilter__StyledChannelTitle",
|
|
@@ -135527,7 +135527,7 @@ var StyledToggleAllButtons = _styled(ToggleAllButtons).withConfig({
|
|
|
135527
135527
|
componentId: "sc-1ju8xwz-9"
|
|
135528
135528
|
})(templateObject_10 || (templateObject_10 = __makeTemplateObject$l(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])));
|
|
135529
135529
|
|
|
135530
|
-
var templateObject_1$5, templateObject_2$4, templateObject_3$2, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
135530
|
+
var templateObject_1$5, templateObject_2$4, templateObject_3$2, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10;
|
|
135531
135531
|
|
|
135532
135532
|
function toInteger(dirtyNumber) {
|
|
135533
135533
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
@@ -138345,7 +138345,7 @@ var PublishingDateFilter = function PublishingDateFilter(_a) {
|
|
|
138345
138345
|
return jsxs("div", __assign$g({
|
|
138346
138346
|
className: className
|
|
138347
138347
|
}, {
|
|
138348
|
-
children: [jsx$1(SubTitle$
|
|
138348
|
+
children: [jsx$1(SubTitle$2, {
|
|
138349
138349
|
children: jsx$1(FormattedMessage$1, {
|
|
138350
138350
|
id: "FilterPanel.publishingDate"
|
|
138351
138351
|
}, void 0)
|
|
@@ -138486,7 +138486,7 @@ var DateShortcuts = _styled.div.withConfig({
|
|
|
138486
138486
|
return p.theme.palette.themePrimary;
|
|
138487
138487
|
});
|
|
138488
138488
|
|
|
138489
|
-
var SubTitle$
|
|
138489
|
+
var SubTitle$2 = _styled.p.withConfig({
|
|
138490
138490
|
displayName: "PublishingDateFilter__SubTitle",
|
|
138491
138491
|
componentId: "sc-zv88cu-3"
|
|
138492
138492
|
})(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject$l(["\n font-weight: bold;\n margin-bottom: ", "px;\n"], ["\n font-weight: bold;\n margin-bottom: ", "px;\n"])), spacingXs + 2);
|
|
@@ -138551,7 +138551,7 @@ var KeywordsFilter = function KeywordsFilter(_a) {
|
|
|
138551
138551
|
return jsxs("div", __assign$g({
|
|
138552
138552
|
className: className
|
|
138553
138553
|
}, {
|
|
138554
|
-
children: [jsx$1(SubTitle, {
|
|
138554
|
+
children: [jsx$1(SubTitle$1, {
|
|
138555
138555
|
children: jsx$1(FormattedMessage$1, {
|
|
138556
138556
|
id: "Keywords.title"
|
|
138557
138557
|
}, void 0)
|
|
@@ -138600,7 +138600,7 @@ var StyledKeywordPicker = _styled(KeywordPicker).withConfig({
|
|
|
138600
138600
|
componentId: "sc-1aoeg5i-0"
|
|
138601
138601
|
})(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n overflow: hidden;\n\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\n padding: 0 4px;\n\n div:last-child {\n margin-bottom: 0;\n }\n }\n"], ["\n margin-bottom: ", "px;\n overflow: hidden;\n\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\n padding: 0 4px;\n\n div:last-child {\n margin-bottom: 0;\n }\n }\n"])), spacingM);
|
|
138602
138602
|
|
|
138603
|
-
var SubTitle = _styled.p.withConfig({
|
|
138603
|
+
var SubTitle$1 = _styled.p.withConfig({
|
|
138604
138604
|
displayName: "KeywordsFilter__SubTitle",
|
|
138605
138605
|
componentId: "sc-1aoeg5i-1"
|
|
138606
138606
|
})(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject$l(["\n font-weight: bold;\n margin-bottom: ", "px;\n"], ["\n font-weight: bold;\n margin-bottom: ", "px;\n"])), spacingXs + 2);
|
|
@@ -138855,7 +138855,109 @@ var StyledAvatar = _styled(Avatar).withConfig({
|
|
|
138855
138855
|
componentId: "sc-cnx0p9-5"
|
|
138856
138856
|
})(templateObject_6 || (templateObject_6 = __makeTemplateObject$l(["\n .ms-Persona-primaryText {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 105px;\n }\n"], ["\n .ms-Persona-primaryText {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 105px;\n }\n"])));
|
|
138857
138857
|
|
|
138858
|
-
var
|
|
138858
|
+
var cachedUserAccounts = null;
|
|
138859
|
+
var AuthorFilter = function AuthorFilter(_a) {
|
|
138860
|
+
var _b;
|
|
138861
|
+
|
|
138862
|
+
var className = _a.className;
|
|
138863
|
+
var searchAccounts = useAccountApi().searchAccounts;
|
|
138864
|
+
var showError = useNotificationContext().showError;
|
|
138865
|
+
|
|
138866
|
+
var _c = useContext(FilterContext),
|
|
138867
|
+
filter = _c.filter,
|
|
138868
|
+
onChange = _c.onChange;
|
|
138869
|
+
|
|
138870
|
+
var selectedUsers = (cachedUserAccounts === null || cachedUserAccounts === void 0 ? void 0 : cachedUserAccounts.filter(function (a) {
|
|
138871
|
+
var _a;
|
|
138872
|
+
|
|
138873
|
+
return (_a = filter === null || filter === void 0 ? void 0 : filter.authors) === null || _a === void 0 ? void 0 : _a.includes(a.userPrincipalName);
|
|
138874
|
+
})) || ((_b = filter === null || filter === void 0 ? void 0 : filter.authors) === null || _b === void 0 ? void 0 : _b.map(function (a) {
|
|
138875
|
+
return {
|
|
138876
|
+
displayName: a,
|
|
138877
|
+
userPrincipalName: a
|
|
138878
|
+
};
|
|
138879
|
+
})) || [];
|
|
138880
|
+
return jsxs("div", __assign$g({
|
|
138881
|
+
className: className
|
|
138882
|
+
}, {
|
|
138883
|
+
children: [jsx$1(SubTitle, __assign$g({
|
|
138884
|
+
htmlFor: "author-filter"
|
|
138885
|
+
}, {
|
|
138886
|
+
children: jsx$1(FormattedMessage$1, {
|
|
138887
|
+
id: "FilterPanel.author"
|
|
138888
|
+
}, void 0)
|
|
138889
|
+
}), void 0), jsx$1(PeoplePicker, {
|
|
138890
|
+
accountType: AccountType.User,
|
|
138891
|
+
allowMailItems: true,
|
|
138892
|
+
localOnly: true,
|
|
138893
|
+
includePendingInvitationUsers: false,
|
|
138894
|
+
includePendingRegistrationUsers: false,
|
|
138895
|
+
selectionMode: SelectionMode.multiple,
|
|
138896
|
+
selectedItems: selectedUsers,
|
|
138897
|
+
onChange: function (accounts) {
|
|
138898
|
+
var newSelectedAccounts = accounts.length > 0 ? accounts : null;
|
|
138899
|
+
onChange(__assign$g(__assign$g({}, filter), {
|
|
138900
|
+
authors: newSelectedAccounts === null || newSelectedAccounts === void 0 ? void 0 : newSelectedAccounts.map(function (a) {
|
|
138901
|
+
return a.userPrincipalName;
|
|
138902
|
+
})
|
|
138903
|
+
}));
|
|
138904
|
+
cachedUserAccounts = newSelectedAccounts;
|
|
138905
|
+
},
|
|
138906
|
+
onEmptyInputFocus: function () {
|
|
138907
|
+
return getUsers();
|
|
138908
|
+
},
|
|
138909
|
+
placeholderStringResourceKey: "Generic.peoplePicker.placeholder",
|
|
138910
|
+
inputId: "author-filter"
|
|
138911
|
+
}, void 0)]
|
|
138912
|
+
}), void 0);
|
|
138913
|
+
|
|
138914
|
+
function getUsers() {
|
|
138915
|
+
return __awaiter$b(this, void 0, void 0, function () {
|
|
138916
|
+
|
|
138917
|
+
return __generator$b(this, function (_b) {
|
|
138918
|
+
switch (_b.label) {
|
|
138919
|
+
case 0:
|
|
138920
|
+
_b.trys.push([0, 2,, 3]);
|
|
138921
|
+
|
|
138922
|
+
return [4
|
|
138923
|
+
/*yield*/
|
|
138924
|
+
, searchAccounts({
|
|
138925
|
+
search: '',
|
|
138926
|
+
type: AccountType.User,
|
|
138927
|
+
includePendingInvitationUsers: false,
|
|
138928
|
+
includePendingRegistrationUsers: false,
|
|
138929
|
+
localOnly: true,
|
|
138930
|
+
excludeApiUsers: true
|
|
138931
|
+
})];
|
|
138932
|
+
|
|
138933
|
+
case 1:
|
|
138934
|
+
return [2
|
|
138935
|
+
/*return*/
|
|
138936
|
+
, _b.sent()];
|
|
138937
|
+
|
|
138938
|
+
case 2:
|
|
138939
|
+
_b.sent();
|
|
138940
|
+
showError('Generic.error');
|
|
138941
|
+
return [3
|
|
138942
|
+
/*break*/
|
|
138943
|
+
, 3];
|
|
138944
|
+
|
|
138945
|
+
case 3:
|
|
138946
|
+
return [2
|
|
138947
|
+
/*return*/
|
|
138948
|
+
, []];
|
|
138949
|
+
}
|
|
138950
|
+
});
|
|
138951
|
+
});
|
|
138952
|
+
}
|
|
138953
|
+
};
|
|
138954
|
+
|
|
138955
|
+
var SubTitle = _styled.label.withConfig({
|
|
138956
|
+
displayName: "AuthorFilter__SubTitle",
|
|
138957
|
+
componentId: "sc-cnx0p9-6"
|
|
138958
|
+
})(templateObject_7 || (templateObject_7 = __makeTemplateObject$l(["\n display: block;\n font-weight: bold;\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n display: block;\n font-weight: bold;\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), spacingS + 4, spacingXs + 2);
|
|
138959
|
+
|
|
138960
|
+
var templateObject_1$1, templateObject_2$1, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
138859
138961
|
|
|
138860
138962
|
// `SameValue` abstract operation
|
|
138861
138963
|
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
@@ -139180,4 +139282,4 @@ var ToolbarFilterModalButton = function ToolbarFilterModalButton(_a) {
|
|
|
139180
139282
|
}
|
|
139181
139283
|
};
|
|
139182
139284
|
|
|
139183
|
-
export { Avatar as A, ToolbarFilterModal as B, ToolbarFilterModalButton as C, ChannelFilter as D, EventDetail as E, ChannelToolbarFilter as F, PublishingDateToolbarFilter as G, PublishingDateFilter as H, ItemLayoutMode as I, ClearAllFiltersButton as J, KeywordsFilter as K, KeywordsToolbarFilter as L, ManageChannels as M, NewsDetail as N, AuthorToolbarFilter as O, PropTypes$2 as P, ReachContextProvider as R, ThemeContext$1 as T, UserDetails as U, VerticalFilterPanel as V, _assertThisInitialized$b as _, commonjsGlobal$7 as a, _setPrototypeOf$6 as b, commonjsRequire as c, _defineProperty$p as d, _extends$9 as e, minScreenSize as f, PageDetail as g, NewsList as h, NewsGrid as i, useCurrentUser as j, NewsHero as k, NewsEditorDashboard as l, moment$1 as m, Toolbar$1 as n, ToolbarIconButton as o, ToolbarChannelSelector as p, ToolbarMarkAllEventsAsReadButton as q, ToolbarMarkAllNewsAsReadButton as r, ToolbarCloseButton as s, NewsItemContextProvider as t, useWindowSize$2 as u, ToolbarNewsLanguageSelector as v, ToolbarManageNewsItemButton as w, NewsDetailPreview as x, NewsItemPreviewContextProvider as y, ToolbarFilterPanel as z };
|
|
139285
|
+
export { Avatar as A, ToolbarFilterModal as B, ToolbarFilterModalButton as C, ChannelFilter as D, EventDetail as E, ChannelToolbarFilter as F, PublishingDateToolbarFilter as G, PublishingDateFilter as H, ItemLayoutMode as I, ClearAllFiltersButton as J, KeywordsFilter as K, KeywordsToolbarFilter as L, ManageChannels as M, NewsDetail as N, AuthorToolbarFilter as O, PropTypes$2 as P, AuthorFilter as Q, ReachContextProvider as R, ThemeContext$1 as T, UserDetails as U, VerticalFilterPanel as V, _assertThisInitialized$b as _, commonjsGlobal$7 as a, _setPrototypeOf$6 as b, commonjsRequire as c, _defineProperty$p as d, _extends$9 as e, minScreenSize as f, PageDetail as g, NewsList as h, NewsGrid as i, useCurrentUser as j, NewsHero as k, NewsEditorDashboard as l, moment$1 as m, Toolbar$1 as n, ToolbarIconButton as o, ToolbarChannelSelector as p, ToolbarMarkAllEventsAsReadButton as q, ToolbarMarkAllNewsAsReadButton as r, ToolbarCloseButton as s, NewsItemContextProvider as t, useWindowSize$2 as u, ToolbarNewsLanguageSelector as v, ToolbarManageNewsItemButton as w, NewsDetailPreview as x, NewsItemPreviewContextProvider as y, ToolbarFilterPanel as z };
|
package/index.umd.js
CHANGED
|
@@ -87374,9 +87374,9 @@
|
|
|
87374
87374
|
}), void 0);
|
|
87375
87375
|
};
|
|
87376
87376
|
|
|
87377
|
-
var version$1 = "0.4.0-preview.
|
|
87378
|
-
var buildId = "
|
|
87379
|
-
var commitId = "
|
|
87377
|
+
var version$1 = "0.4.0-preview.269";
|
|
87378
|
+
var buildId = "99811";
|
|
87379
|
+
var commitId = "7e755e5768d5f7b05d9c66fab05df1ace00b249c";
|
|
87380
87380
|
var isCustomerBuild = false;
|
|
87381
87381
|
var buildInfo = {
|
|
87382
87382
|
version: version$1,
|
|
@@ -131739,12 +131739,12 @@
|
|
|
131739
131739
|
if(isArray$2(this))this.length=this.length;return nativeReverse.call(this);}});var CommentList=function CommentList(_a){var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,items=_a.items,groupIds=_a.groupIds,isLoading=_a.isLoading,onCommentDeleted=_a.onCommentDeleted,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,noItemsYetStringResourceKey=_a.noItemsYetStringResourceKey,getHashtagFilterRoute=_a.getHashtagFilterRoute,onReply=_a.onReply,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var _b=React$d.useState(true),isDialogHidden=_b[0],setIsDialogHidden=_b[1];var commentRef=React$d.useRef(null);var deleteComment=useCommentApi().deleteComment;var showError=useNotificationContext().showError;return jsxRuntime.jsxs("div",__assign({className:classNames(className,'comment-list'),"data-list":"comments"},{children:[jsxRuntime.jsx(ConfirmDialog,{onClose:function(){return setIsDialogHidden(true);},onConfirm:handleDelete,showDialog:!isDialogHidden,titleResourceKey:"Comment.delete.title",infoResourceKey:"Comment.delete.description"},void 0),jsxRuntime.jsx(OpacityAnimation,__assign({leaveDuration:500},{children:items!=null&&items.map(function(comment){var _a;var showAutoTranslate=comment.sender.id!==user.id;return jsxRuntime.jsx(CommentDisplay,{readOnly:readOnly,scope:scope,message:comment,showDelete:canDelete(comment),showEdit:canEdit(comment),onDelete:showDialog,showAutoTranslate:showAutoTranslate,mentionSearchHandler:mentionSearchHandler,type:type,baseAttachmentPath:baseAttachmentPath,getHashtagFilterRoute:getHashtagFilterRoute,highlight:comment.isUnread,isInitialLiked:comment.isLiked,onReply:onReply,replyCount:comment.threadId==null?(_a=comment.statistics)===null||_a===void 0?void 0:_a.replyCount:null},comment.receivedDateTime+comment.sender.id);})}),void 0),items!=null&&items.length===0&&!isLoading&&jsxRuntime.jsx("p",__assign({className:"ms-font-m ms-fontColor-neutralSecondary"},{children:jsxRuntime.jsx(FormattedMessage$1,{id:noItemsYetStringResourceKey},void 0)}),void 0)]}),void 0);function handleDelete(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(commentRef.current==null){return [2/*return*/];}onCommentDeleted&&onCommentDeleted(commentRef.current);_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,deleteComment(type,commentRef.current.conversationScope,commentRef.current.parentItemId,commentRef.current.id)];case 2:_a.sent();return [3/*break*/,4];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function showDialog(comment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){commentRef.current=comment;setIsDialogHidden(false);return [2/*return*/];});});}function canDelete(comment){return canEdit(comment)||hasMinRoleInAllGroups(GroupRoles.Admin,user,groupIds);}function canEdit(comment){return comment.sender&&comment.sender.id===user.id;}};var CreateCommentWithAttachments=function CreateCommentWithAttachments(props){var ignoreRef=React$d.useRef(false);React$d.useEffect(function(){return function(){ignoreRef.current=true;};},[]);var _a=React$d.useState(createId()),attachmentContainerId=_a[0],setAttachmentContainerId=_a[1];var _b=useAttachmentUploader([],attachmentContainerId,props.baseAttachmentPath),attachments=_b[0],handleAttachmentsAdded=_b[1],clearAttachments=_b[2],deletedAttachmentUrls=_b[3],onDeleteAttachment=_b[4];return jsxRuntime.jsx(CreateComment,__assign({},props,{onPost:handlePost,onAttachmentsChanged:handleAttachmentsAdded,attachments:attachments,deletedAttachmentUrls:deletedAttachmentUrls,onDeleteAttachment:onDeleteAttachment,allowAttachments:!!props.baseAttachmentPath,allowKeywords:props.allowKeywords,placeHolderStringResourceKey:props.placeHolderStringResourceKey,placeHolderStringResourceValues:props.placeHolderStringResourceValues}),void 0);function handlePost(message,keywords){return __awaiter(this,void 0,void 0,function(){var newAttachments;return __generator(this,function(_a){switch(_a.label){case 0:newAttachments=__spreadArray([],attachments);clearAttachments();return [4/*yield*/,props.onPost(message,attachmentContainerId,newAttachments,keywords)];case 1:_a.sent();if(!ignoreRef.current){setAttachmentContainerId(createId());}return [2/*return*/];}});});}};var SortOrder;(function(SortOrder){SortOrder[SortOrder["Asc"]=0]="Asc";SortOrder[SortOrder["Desc"]=1]="Desc";})(SortOrder||(SortOrder={}));var PagedCommentsSection=function PagedCommentsSection(_a){var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,itemId=_a.itemId,groupIds=_a.groupIds,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,scope=_a.scope,_b=_a.initialPageSize,initialPageSize=_b===void 0?2:_b,_c=_a.pageSize,pageSize=_c===void 0?5:_c,mentionSearchHandler=_a.mentionSearchHandler,initialComments=_a.initialComments,onCommentAdded=_a.onCommentAdded,onCommentDeleted=_a.onCommentDeleted,noItemsYetStringResourceKey=_a.noItemsYetStringResourceKey,autoFocusReplyField=_a.autoFocusReplyField,getHashtagFilterRoute=_a.getHashtagFilterRoute,buttons=_a.buttons,threadId=_a.threadId,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues,showReplyBox=_a.showReplyBox,title=_a.title,onThreadReply=_a.onThreadReply,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var createComment=useCommentApi().createComment;var user=useCurrentUser();var features=useFeatures();var history=ReactRouterDom.useHistory();var location=ReactRouterDom.useLocation();var formatMessage=useIntl().formatMessage;var showError=useNotificationContext().showError;var _d=React$d.useState((initialComments===null||initialComments===void 0?void 0:initialComments.items.length)===0||type!==ItemResourceTypes.Posts||showReplyBox),showNewComment=_d[0],setShowNewComment=_d[1];var _e=React$d.useState(),commentToReplyTo=_e[0],setCommentToReplyTo=_e[1];var _f=React$d.useState(autoFocusReplyField),autoFocusNewCommentInput=_f[0],setAutoFocusNewCommentInput=_f[1];var preventLoading=readOnly&&!loadInReadOnlyMode;var _g=usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId),comments=_g[0],isLoading=_g[1],hasNextPage=_g[2],loadNextPage=_g[3],setComments=_g[4],hasMoreUnreadComments=_g[5];var commentIdsString=(comments!==null&&comments!==void 0?comments:[]).map(function(c){return c.id;}).join(',');React$d.useEffect(function(){var _a;if(commentIdsString.length>0&&((_a=location.state)===null||_a===void 0?void 0:_a.parentCommentId)){if(autoFocusNewCommentInput){return;}var commentContainer=document.getElementById(location.state.parentCommentId);commentContainer===null||commentContainer===void 0?void 0:commentContainer.scrollIntoView(true);history.replace(__assign(__assign({},location),{state:__assign(__assign({},location.state),{parentCommentId:null})}));}// comments changes implicitly 'validates' location state changes
|
|
131740
131740
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131741
131741
|
},[commentIdsString]);var showSpinner=!preventLoading&&isLoading;var showLoadMore=!preventLoading&&hasNextPage&&!isLoading;var showComments=!preventLoading&&(comments===null||comments===void 0?void 0:comments.length)>0;return jsxRuntime.jsxs("div",__assign({className:className},{children:[jsxRuntime.jsxs(TitleAndSpinner,{children:[title,showSpinner&&jsxRuntime.jsx(StyledSpinner$1,{},void 0)]},void 0),showLoadMore&&jsxRuntime.jsx(LoadMoreContainer,__assign({"data-load-more-comments-container":true,"data-show-highlight":hasMoreUnreadComments,highlight:hasMoreUnreadComments},{children:jsxRuntime.jsx(LoadMore,{text:formatMessage({id:type===ItemResourceTypes.Posts||threadId!=null?'Post.comments.loadMore':'Comment.loadMore'}),onClick:function(){return loadNextPage();},iconProps:{iconName:'ScrollUpDown'},"data-load-more-comments":true},void 0)}),void 0),showComments&&jsxRuntime.jsx(CommentList,{scope:ConversationScope.Public,items:comments,groupIds:groupIds,isLoading:isLoading,onCommentDeleted:handleCommentDeleted,mentionSearchHandler:mentionSearchHandler,type:type,baseAttachmentPath:baseAttachmentPath,noItemsYetStringResourceKey:noItemsYetStringResourceKey,getHashtagFilterRoute:getHashtagFilterRoute,onReply:handleOnReply,readOnly:readOnly},void 0),!showNewComment&&jsxRuntime.jsx(ReplyButton,{iconProps:{iconName:'Reply'},text:formatMessage({id:'Post.comments.addReply'}),onClick:showNewCommentInput,"data-add-comment":true},void 0),showNewComment&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(NewComment// the key is required to autofocus the reply field when replying to comments
|
|
131742
|
-
,{readOnly:readOnly,onPost:handleCommentCreated,mentionSearchHandler:mentionSearchHandler,autoFocus:autoFocusNewCommentInput,focusAfterPost:!env.isNativeMobileApp,baseAttachmentPath:baseAttachmentPath,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,content:getContent(),allowSaveWithoutContent:true,saveOnCtrlEnter:true},commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentId),!readOnly&&buttons]},void 0)]}),void 0);function getContent(){var _a;return ((_a=commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentSender)===null||_a===void 0?void 0:_a.id)&&commentToReplyTo.commentSender.id!==user.id?constructUserMention(commentToReplyTo.commentSender):null;}function handleOnReply(commentId,commentSender){if(features.replyToComments){history.replace(__assign(__assign({},location),{state:{parentCommentId:"Comment-"+commentId}}));onThreadReply===null||onThreadReply===void 0?void 0:onThreadReply(commentId);setCommentToReplyTo({commentId:commentId,commentSender:commentSender});return;}showNewCommentInput();setCommentToReplyTo({commentId:commentId,commentSender:commentSender});setAutoFocusNewCommentInput(true);}function showNewCommentInput(){if(user.isPublicUser){triggerEvent(PromptPublicUserLoginAction.create());return;}setShowNewComment(true);}function handleCommentDeleted(comment){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:setComments(function(stateComments){return stateComments.filter(function(c){return c.id!==comment.id;});});onCommentDeleted===null||onCommentDeleted===void 0?void 0:onCommentDeleted(comment);_a=!threadId;if(!_a)return [3/*break*/,2];return [4/*yield*/,refreshStatistics(itemId,{commentCount:-1})];case 1:_a=_b.sent();_b.label=2;case 2:return [2/*return*/];}});});}function handleCommentCreated(commentDelta,attachmentContainerId,attachments){return __awaiter(this,void 0,void 0,function(){var newComment,comment_1,_a,error_1;return __generator(this,function(_b){switch(_b.label){case 0:newComment={id:null,parentItemId:itemId,content:commentDelta.content,conversationScope:scope,sender:user,receivedDateTime:moment.utc().toISOString(),attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId,isUnread:false};setComments(function(stateComments){return __spreadArray(__spreadArray([],stateComments),[newComment]);});onCommentAdded===null||onCommentAdded===void 0?void 0:onCommentAdded();_b.label=1;case 1:_b.trys.push([1,5,6,7]);return [4/*yield*/,createComment(type,scope,itemId,__assign(__assign({},commentDelta),{attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId}))];case 2:comment_1=_b.sent();_a=!threadId;if(!_a)return [3/*break*/,4];return [4/*yield*/,refreshStatistics(itemId,{commentCount:1})];case 3:_a=_b.sent();_b.label=4;case 4:setComments(function(stateComments){var _a;return update$2(stateComments,(_a={},_a[stateComments.length-1]={$merge:{id:comment_1.id,fileAccessToken:comment_1.fileAccessToken}},_a));});return [3/*break*/,7];case 5:error_1=_b.sent();logger.error(error_1);showError('Comment.errorMessage');return [3/*break*/,7];case 6:setAutoFocusNewCommentInput(false);setCommentToReplyTo(null);return [7/*endfinally*/];case 7:return [2/*return*/];}});});}};var TitleAndSpinner=_styled__default["default"].div.withConfig({displayName:"PagedCommentsSection__TitleAndSpinner",componentId:"sc-1f3hft1-0"})(templateObject_1$1d||(templateObject_1$1d=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var ReplyButton=_styled__default["default"](ActionButton).withConfig({displayName:"PagedCommentsSection__ReplyButton",componentId:"sc-1f3hft1-1"})(templateObject_2$I||(templateObject_2$I=__makeTemplateObject(["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"],["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"])),function(p){return p.theme.palette.accent;});var NewComment=_styled__default["default"](CreateCommentWithAttachments).withConfig({displayName:"PagedCommentsSection__NewComment",componentId:"sc-1f3hft1-2"})(templateObject_3$u||(templateObject_3$u=__makeTemplateObject(["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"],["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"])));var LoadMoreContainer=_styled__default["default"].div.withConfig({displayName:"PagedCommentsSection__LoadMoreContainer",componentId:"sc-1f3hft1-3"})(templateObject_5$i||(templateObject_5$i=__makeTemplateObject(["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"],["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"])),function(p){return p.highlight&&_styled.css(templateObject_4$j||(templateObject_4$j=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var LoadMore=_styled__default["default"](ActionButton).withConfig({displayName:"PagedCommentsSection__LoadMore",componentId:"sc-1f3hft1-4"})(templateObject_6$b||(templateObject_6$b=__makeTemplateObject(["\n && {\n text-align: left;\n }\n"],["\n && {\n text-align: left;\n }\n"])));var StyledSpinner$1=_styled__default["default"](Spinner).withConfig({displayName:"PagedCommentsSection__StyledSpinner",componentId:"sc-1f3hft1-5"})(templateObject_7$6||(templateObject_7$6=__makeTemplateObject(["\n margin: 0 auto;\n padding: 15px 0;\n"],["\n margin: 0 auto;\n padding: 15px 0;\n"])));function usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId){var _a=React$d.useState(function(){return __spreadArray([],(initialComments===null||initialComments===void 0?void 0:initialComments.items)||[]).reverse();}),comments=_a[0],setComments=_a[1];var _b=React$d.useState({token:initialComments===null||initialComments===void 0?void 0:initialComments.paginationToken,hasMoreUnreadComments:initialComments===null||initialComments===void 0?void 0:initialComments.hasMoreUnreadComments}),nextPageInfos=_b[0],setNextPageInfos=_b[1];var _c=React$d.useState(!initialComments),isLoading=_c[0],setIsLoading=_c[1];var pullToRefreshContext=React$d.useContext(PullToRefreshContext);var _d=useCommentApi(),listComments=_d.listComments,getCommentReplies=_d.getCommentReplies;// the context can be null, in case we are in the editor
|
|
131742
|
+
,{readOnly:readOnly,onPost:handleCommentCreated,mentionSearchHandler:mentionSearchHandler,autoFocus:autoFocusNewCommentInput,focusAfterPost:!env.isNativeMobileApp,baseAttachmentPath:baseAttachmentPath,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,content:getContent(),allowSaveWithoutContent:true,saveOnCtrlEnter:true},commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentId),!readOnly&&buttons]},void 0)]}),void 0);function getContent(){var _a;return ((_a=commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentSender)===null||_a===void 0?void 0:_a.id)&&commentToReplyTo.commentSender.id!==user.id?constructUserMention(commentToReplyTo.commentSender):null;}function handleOnReply(commentId,commentSender){if(features.replyToComments){history.replace(__assign(__assign({},location),{state:{parentCommentId:"Comment-"+commentId}}));onThreadReply===null||onThreadReply===void 0?void 0:onThreadReply(commentId);setCommentToReplyTo({commentId:commentId,commentSender:commentSender});return;}showNewCommentInput();setCommentToReplyTo({commentId:commentId,commentSender:commentSender});setAutoFocusNewCommentInput(true);}function showNewCommentInput(){if(user.isPublicUser){triggerEvent(PromptPublicUserLoginAction.create());return;}setShowNewComment(true);}function handleCommentDeleted(comment){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:setComments(function(stateComments){return stateComments.filter(function(c){return c.id!==comment.id;});});onCommentDeleted===null||onCommentDeleted===void 0?void 0:onCommentDeleted(comment);_a=!threadId;if(!_a)return [3/*break*/,2];return [4/*yield*/,refreshStatistics(itemId,{commentCount:-1})];case 1:_a=_b.sent();_b.label=2;case 2:return [2/*return*/];}});});}function handleCommentCreated(commentDelta,attachmentContainerId,attachments){return __awaiter(this,void 0,void 0,function(){var newComment,comment_1,_a,error_1;return __generator(this,function(_b){switch(_b.label){case 0:newComment={id:null,parentItemId:itemId,content:commentDelta.content,conversationScope:scope,sender:user,receivedDateTime:moment.utc().toISOString(),attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId,isUnread:false};setComments(function(stateComments){return __spreadArray(__spreadArray([],stateComments),[newComment]);});onCommentAdded===null||onCommentAdded===void 0?void 0:onCommentAdded();_b.label=1;case 1:_b.trys.push([1,5,6,7]);return [4/*yield*/,createComment(type,scope,itemId,__assign(__assign({},commentDelta),{attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId}))];case 2:comment_1=_b.sent();_a=!threadId;if(!_a)return [3/*break*/,4];return [4/*yield*/,refreshStatistics(itemId,{commentCount:1})];case 3:_a=_b.sent();_b.label=4;case 4:setComments(function(stateComments){var _a;return update$2(stateComments,(_a={},_a[stateComments.length-1]={$merge:{id:comment_1.id,fileAccessToken:comment_1.fileAccessToken}},_a));});return [3/*break*/,7];case 5:error_1=_b.sent();logger.error(error_1);showError('Comment.errorMessage');return [3/*break*/,7];case 6:setAutoFocusNewCommentInput(false);setCommentToReplyTo(null);return [7/*endfinally*/];case 7:return [2/*return*/];}});});}};var TitleAndSpinner=_styled__default["default"].div.withConfig({displayName:"PagedCommentsSection__TitleAndSpinner",componentId:"sc-1f3hft1-0"})(templateObject_1$1d||(templateObject_1$1d=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var ReplyButton=_styled__default["default"](ActionButton).withConfig({displayName:"PagedCommentsSection__ReplyButton",componentId:"sc-1f3hft1-1"})(templateObject_2$I||(templateObject_2$I=__makeTemplateObject(["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"],["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"])),function(p){return p.theme.palette.accent;});var NewComment=_styled__default["default"](CreateCommentWithAttachments).withConfig({displayName:"PagedCommentsSection__NewComment",componentId:"sc-1f3hft1-2"})(templateObject_3$u||(templateObject_3$u=__makeTemplateObject(["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"],["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"])));var LoadMoreContainer=_styled__default["default"].div.withConfig({displayName:"PagedCommentsSection__LoadMoreContainer",componentId:"sc-1f3hft1-3"})(templateObject_5$i||(templateObject_5$i=__makeTemplateObject(["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"],["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"])),function(p){return p.highlight&&_styled.css(templateObject_4$j||(templateObject_4$j=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var LoadMore=_styled__default["default"](ActionButton).withConfig({displayName:"PagedCommentsSection__LoadMore",componentId:"sc-1f3hft1-4"})(templateObject_6$b||(templateObject_6$b=__makeTemplateObject(["\n && {\n text-align: left;\n }\n"],["\n && {\n text-align: left;\n }\n"])));var StyledSpinner$1=_styled__default["default"](Spinner).withConfig({displayName:"PagedCommentsSection__StyledSpinner",componentId:"sc-1f3hft1-5"})(templateObject_7$6$1||(templateObject_7$6$1=__makeTemplateObject(["\n margin: 0 auto;\n padding: 15px 0;\n"],["\n margin: 0 auto;\n padding: 15px 0;\n"])));function usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId){var _a=React$d.useState(function(){return __spreadArray([],(initialComments===null||initialComments===void 0?void 0:initialComments.items)||[]).reverse();}),comments=_a[0],setComments=_a[1];var _b=React$d.useState({token:initialComments===null||initialComments===void 0?void 0:initialComments.paginationToken,hasMoreUnreadComments:initialComments===null||initialComments===void 0?void 0:initialComments.hasMoreUnreadComments}),nextPageInfos=_b[0],setNextPageInfos=_b[1];var _c=React$d.useState(!initialComments),isLoading=_c[0],setIsLoading=_c[1];var pullToRefreshContext=React$d.useContext(PullToRefreshContext);var _d=useCommentApi(),listComments=_d.listComments,getCommentReplies=_d.getCommentReplies;// the context can be null, in case we are in the editor
|
|
131743
131743
|
var refreshToken=pullToRefreshContext===null||pullToRefreshContext===void 0?void 0:pullToRefreshContext.refreshToken;var refreshUserDetails=useRefreshUserDetails();var isValid=true;React$d.useEffect(function(){if(!isValid||preventLoading){return undefined;}if(!initialComments||refreshToken){// pass the pageToken explicitly since it's possible that the nextPageTokenState has not been updated yet
|
|
131744
131744
|
loadNextPage(null,initialPageSize,!!initialComments).then(function(){return null;},logger.error);}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131745
131745
|
return function(){isValid=false;};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131746
131746
|
},[initialComments,itemId,refreshToken]);return [comments,isLoading,!!(nextPageInfos===null||nextPageInfos===void 0?void 0:nextPageInfos.token),loadNextPage,setComments,nextPageInfos.hasMoreUnreadComments];function loadNextPage(nextPageTokenOverride,pageSizeOverride,doNotSetIsLoading){return __awaiter(this,void 0,void 0,function(){var token,nextPage,_a;return __generator(this,function(_b){switch(_b.label){case 0:if(!isValid){return [2/*return*/];}if(!doNotSetIsLoading){setIsLoading(true);}token=nextPageTokenOverride!==undefined?nextPageTokenOverride:nextPageInfos===null||nextPageInfos===void 0?void 0:nextPageInfos.token;if(!(threadId!=null))return [3/*break*/,2];return [4/*yield*/,getCommentReplies(type,scope,itemId,threadId,{sortOrder:SortOrder.Desc,pageSize:pageSizeOverride!==null&&pageSizeOverride!==void 0?pageSizeOverride:pageSize,token:token})];case 1:_a=_b.sent();return [3/*break*/,4];case 2:return [4/*yield*/,listComments(type,scope,itemId,{sortOrder:SortOrder.Desc,pageSize:pageSizeOverride!==null&&pageSizeOverride!==void 0?pageSizeOverride:pageSize,token:token})];case 3:_a=_b.sent();_b.label=4;case 4:nextPage=_a;if(isValid){setIsLoading(false);setComments(function(stateComments){return token!=null?__spreadArray(__spreadArray([],__spreadArray([],nextPage.items).reverse()),stateComments):nextPage.items.reverse();});// refresh the unread count every time we load a new page of comments
|
|
131747
|
-
refreshUserDetails();setNextPageInfos({token:nextPage.paginationToken,hasMoreUnreadComments:nextPage.hasMoreUnreadComments});}return [2/*return*/];}});});}}var templateObject_1$1d,templateObject_2$I,templateObject_3$u,templateObject_4$j,templateObject_5$i,templateObject_6$b,templateObject_7$6;var PublicUserFullAccessButton=function PublicUserFullAccessButton(_a){var user=_a.user,onClick=_a.onClick,descriptionResourceKeyPrefix=_a.descriptionResourceKeyPrefix,descriptionValues=_a.descriptionValues,className=_a.className;var formatMessage=useIntl().formatMessage;var history=ReactRouterDom.useHistory();var location=ReactRouterDom.useLocation();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var shouldRegister=user.subscription.allowSelfRegistration&&user.authenticationType!==AuthenticationType.public;return jsxRuntime.jsxs("div",__assign({className:className},{children:[jsxRuntime.jsx(PublicUserButtonFocusStyle,{},void 0),descriptionResourceKeyPrefix&&jsxRuntime.jsx(Description$1,{id:descriptionResourceKeyPrefix+"."+(shouldRegister?'register':'login'),values:descriptionValues,tagName:"p"},void 0),jsxRuntime.jsx(officeUiFabricReact.PrimaryButton,{"data-public-access-button":true,text:formatMessage({id:shouldRegister?'SelfRegistration.register':'Subscription.login.caption'}),onClick:handleOnClick},void 0)]}),void 0);function handleOnClick(){onClick===null||onClick===void 0?void 0:onClick();if(shouldRegister){history.push({pathname:buildPath('/register')});}else {history.push({pathname:'/logout',search:queryString.stringify({source:getAppUrl()+buildPath("/login?"+queryString.stringify({source:location.pathname}))})});}}};var PublicUserButtonFocusStyle=_styled.createGlobalStyle(templateObject_1$1c||(templateObject_1$1c=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return applyFocusStyle("\n button[data-public-access-button]:focus::after {\n outline-color: "+p.theme.palette.accent+" !important;\n outline-offset: 2px;\n }\n ");});var Description$1=_styled__default["default"](FormattedMessageWithStyle).withConfig({displayName:"PublicUserFullAccessButton__Description",componentId:"sc-tjhzmp-0"})(templateObject_2$H||(templateObject_2$H=__makeTemplateObject(["\n margin-top: 0;\n color: ",";\n"],["\n margin-top: 0;\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1c,templateObject_2$H;var PublishableItemComments=function PublishableItemComments(_a){var item=_a.item,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,type=_a.type,onThreadReply=_a.onThreadReply,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var container=React$d.useRef();var location=ReactRouterDom.useLocation();var searchAccountsByItemId=useAccountApi().searchAccountsByItemId;var user=useCurrentUser();React$d.useEffect(function(){// scroll comments container into view if there is the corresponding hash in the path.
|
|
131747
|
+
refreshUserDetails();setNextPageInfos({token:nextPage.paginationToken,hasMoreUnreadComments:nextPage.hasMoreUnreadComments});}return [2/*return*/];}});});}}var templateObject_1$1d,templateObject_2$I,templateObject_3$u,templateObject_4$j,templateObject_5$i,templateObject_6$b,templateObject_7$6$1;var PublicUserFullAccessButton=function PublicUserFullAccessButton(_a){var user=_a.user,onClick=_a.onClick,descriptionResourceKeyPrefix=_a.descriptionResourceKeyPrefix,descriptionValues=_a.descriptionValues,className=_a.className;var formatMessage=useIntl().formatMessage;var history=ReactRouterDom.useHistory();var location=ReactRouterDom.useLocation();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var shouldRegister=user.subscription.allowSelfRegistration&&user.authenticationType!==AuthenticationType.public;return jsxRuntime.jsxs("div",__assign({className:className},{children:[jsxRuntime.jsx(PublicUserButtonFocusStyle,{},void 0),descriptionResourceKeyPrefix&&jsxRuntime.jsx(Description$1,{id:descriptionResourceKeyPrefix+"."+(shouldRegister?'register':'login'),values:descriptionValues,tagName:"p"},void 0),jsxRuntime.jsx(officeUiFabricReact.PrimaryButton,{"data-public-access-button":true,text:formatMessage({id:shouldRegister?'SelfRegistration.register':'Subscription.login.caption'}),onClick:handleOnClick},void 0)]}),void 0);function handleOnClick(){onClick===null||onClick===void 0?void 0:onClick();if(shouldRegister){history.push({pathname:buildPath('/register')});}else {history.push({pathname:'/logout',search:queryString.stringify({source:getAppUrl()+buildPath("/login?"+queryString.stringify({source:location.pathname}))})});}}};var PublicUserButtonFocusStyle=_styled.createGlobalStyle(templateObject_1$1c||(templateObject_1$1c=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return applyFocusStyle("\n button[data-public-access-button]:focus::after {\n outline-color: "+p.theme.palette.accent+" !important;\n outline-offset: 2px;\n }\n ");});var Description$1=_styled__default["default"](FormattedMessageWithStyle).withConfig({displayName:"PublicUserFullAccessButton__Description",componentId:"sc-tjhzmp-0"})(templateObject_2$H||(templateObject_2$H=__makeTemplateObject(["\n margin-top: 0;\n color: ",";\n"],["\n margin-top: 0;\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1c,templateObject_2$H;var PublishableItemComments=function PublishableItemComments(_a){var item=_a.item,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,type=_a.type,onThreadReply=_a.onThreadReply,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var container=React$d.useRef();var location=ReactRouterDom.useLocation();var searchAccountsByItemId=useAccountApi().searchAccountsByItemId;var user=useCurrentUser();React$d.useEffect(function(){// scroll comments container into view if there is the corresponding hash in the path.
|
|
131748
131748
|
// HACK: a regular anchor does not work, because content is rendered
|
|
131749
131749
|
// dynamically and the comments might not be in DOM at the right time.
|
|
131750
131750
|
// TODO: Try to avoid this.
|
|
@@ -132861,7 +132861,7 @@
|
|
|
132861
132861
|
var Title$3 = _styled__default["default"].span.withConfig({
|
|
132862
132862
|
displayName: "NewsCompactCard__Title",
|
|
132863
132863
|
componentId: "sc-16ovog0-5"
|
|
132864
|
-
})(templateObject_7$
|
|
132864
|
+
})(templateObject_7$6 || (templateObject_7$6 = __makeTemplateObject$l(["\n ", "\n display: inline-block;\n max-width: 100%;\n"], ["\n ", "\n display: inline-block;\n max-width: 100%;\n"])), TextStyle);
|
|
132865
132865
|
|
|
132866
132866
|
var TitleWrapper$1 = _styled__default["default"].a.withConfig({
|
|
132867
132867
|
displayName: "NewsCompactCard__TitleWrapper",
|
|
@@ -132930,7 +132930,7 @@
|
|
|
132930
132930
|
});
|
|
132931
132931
|
});
|
|
132932
132932
|
|
|
132933
|
-
var templateObject_1$p, templateObject_2$g, templateObject_3$d, templateObject_4$c, templateObject_5$a, templateObject_6$9, templateObject_7$
|
|
132933
|
+
var templateObject_1$p, templateObject_2$g, templateObject_3$d, templateObject_4$c, templateObject_5$a, templateObject_6$9, templateObject_7$6, templateObject_8$5, templateObject_9$3, templateObject_10$3, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$2, templateObject_16$1;
|
|
132934
132934
|
|
|
132935
132935
|
var EmptyNewsList = function EmptyNewsList() {
|
|
132936
132936
|
return jsxRuntime.jsxs(Host$d, {
|
|
@@ -133157,7 +133157,7 @@
|
|
|
133157
133157
|
var CommentsCount = _styled__default["default"].span.withConfig({
|
|
133158
133158
|
displayName: "NewsList__CommentsCount",
|
|
133159
133159
|
componentId: "sc-1d0bzx1-5"
|
|
133160
|
-
})(templateObject_7$
|
|
133160
|
+
})(templateObject_7$5 || (templateObject_7$5 = __makeTemplateObject$l(["\n padding-left: 5px;\n font-size: 0.9rem;\n"], ["\n padding-left: 5px;\n font-size: 0.9rem;\n"])));
|
|
133161
133161
|
|
|
133162
133162
|
var ErrorContainer$1 = _styled__default["default"].p.withConfig({
|
|
133163
133163
|
displayName: "NewsList__ErrorContainer",
|
|
@@ -133166,7 +133166,7 @@
|
|
|
133166
133166
|
return p.theme.palette.red;
|
|
133167
133167
|
}, spacingM);
|
|
133168
133168
|
|
|
133169
|
-
var templateObject_1$n, templateObject_2$e, templateObject_3$b, templateObject_4$b, templateObject_5$9, templateObject_6$8, templateObject_7$
|
|
133169
|
+
var templateObject_1$n, templateObject_2$e, templateObject_3$b, templateObject_4$b, templateObject_5$9, templateObject_6$8, templateObject_7$5, templateObject_8$4;
|
|
133170
133170
|
|
|
133171
133171
|
var ManageChannels = function ManageChannels(_a) {
|
|
133172
133172
|
var className = _a.className;
|
|
@@ -133396,7 +133396,7 @@
|
|
|
133396
133396
|
var ChannelToggle = _styled__default["default"](ToggleWithLabel).withConfig({
|
|
133397
133397
|
displayName: "ManageChannels__ChannelToggle",
|
|
133398
133398
|
componentId: "sc-yyoxfw-6"
|
|
133399
|
-
})(templateObject_7$
|
|
133399
|
+
})(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject$l(["\n && {\n margin: ", "px 0;\n\n label {\n font-weight: normal;\n padding: 0;\n }\n\n .ms-Toggle-innerContainer {\n align-self: flex-start;\n }\n }\n"], ["\n && {\n margin: ", "px 0;\n\n label {\n font-weight: normal;\n padding: 0;\n }\n\n .ms-Toggle-innerContainer {\n align-self: flex-start;\n }\n }\n"])), spacingXxs);
|
|
133400
133400
|
|
|
133401
133401
|
var StyledIconButton = _styled__default["default"](officeUiFabricReact.IconButton).withConfig({
|
|
133402
133402
|
displayName: "ManageChannels__StyledIconButton",
|
|
@@ -133405,7 +133405,7 @@
|
|
|
133405
133405
|
return p.theme.textColors.default;
|
|
133406
133406
|
});
|
|
133407
133407
|
|
|
133408
|
-
var templateObject_1$m, templateObject_2$d, templateObject_3$a, templateObject_4$a, templateObject_5$8, templateObject_6$7, templateObject_7$
|
|
133408
|
+
var templateObject_1$m, templateObject_2$d, templateObject_3$a, templateObject_4$a, templateObject_5$8, templateObject_6$7, templateObject_7$4, templateObject_8$3;
|
|
133409
133409
|
|
|
133410
133410
|
var NewsGridCard = function NewsGridCard(_a) {
|
|
133411
133411
|
var _b;
|
|
@@ -133525,7 +133525,7 @@
|
|
|
133525
133525
|
});
|
|
133526
133526
|
var MetaInfo = _styled__default["default"].div(templateObject_5$7 || (templateObject_5$7 = __makeTemplateObject$l(["\n font-size: ", "px;\n"], ["\n font-size: ", "px;\n"])), fontSizeSmall);
|
|
133527
133527
|
var DateAndIcon = _styled__default["default"].div(templateObject_6$6 || (templateObject_6$6 = __makeTemplateObject$l(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
133528
|
-
var PublishingDate = _styled__default["default"](DateTime)(templateObject_7$
|
|
133528
|
+
var PublishingDate = _styled__default["default"](DateTime)(templateObject_7$3 || (templateObject_7$3 = __makeTemplateObject$l(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n align-self: center;\n"], ["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n align-self: center;\n"])));
|
|
133529
133529
|
var NewsCardIcon = _styled__default["default"].div(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject$l(["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"], ["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"])));
|
|
133530
133530
|
var StyledIcon$1 = _styled__default["default"](officeUiFabricReact.Icon)(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject$l(["\n font-size: ", "px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ", "px;\n cursor: pointer;\n\n background-color: ", ";\n color: ", ";\n"], ["\n font-size: ", "px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ", "px;\n cursor: pointer;\n\n background-color: ", ";\n color: ", ";\n"])), fontSizeSmaller, spacingXs, function (p) {
|
|
133531
133531
|
return p.backgroundColor;
|
|
@@ -133540,7 +133540,7 @@
|
|
|
133540
133540
|
return p.theme.palette.neutralTertiary;
|
|
133541
133541
|
});
|
|
133542
133542
|
var StyledChannels$1 = _styled__default["default"](ChannelList$1)(templateObject_15$1 || (templateObject_15$1 = __makeTemplateObject$l(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), spacingS, spacingM);
|
|
133543
|
-
var templateObject_1$l, templateObject_2$c, templateObject_3$9, templateObject_4$9, templateObject_5$7, templateObject_6$6, templateObject_7$
|
|
133543
|
+
var templateObject_1$l, templateObject_2$c, templateObject_3$9, templateObject_4$9, templateObject_5$7, templateObject_6$6, templateObject_7$3, templateObject_8$2, templateObject_9$2, templateObject_10$2, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;
|
|
133544
133544
|
|
|
133545
133545
|
var ErrorContainer = function ErrorContainer() {
|
|
133546
133546
|
return jsxRuntime.jsx(Host$9, {
|
|
@@ -133805,7 +133805,7 @@
|
|
|
133805
133805
|
var Host$7 = _styled__default["default"].div.withConfig({
|
|
133806
133806
|
displayName: "HeroSlide__Host",
|
|
133807
133807
|
componentId: "sc-3yofth-0"
|
|
133808
|
-
})(templateObject_7$
|
|
133808
|
+
})(templateObject_7$2 || (templateObject_7$2 = __makeTemplateObject$l(["\n position: relative;\n\n ", "\n\n ", "\n \n ", "\n \n ", "\n"], ["\n position: relative;\n\n ", "\n\n ", "\n \n ", "\n \n ", "\n"])), function (p) {
|
|
133809
133809
|
return p.width ? _styled.css(templateObject_1$i || (templateObject_1$i = __makeTemplateObject$l(["\n width: ", ";\n "], ["\n width: ", ";\n "])), p.width) : _styled.css(templateObject_2$a || (templateObject_2$a = __makeTemplateObject$l(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
|
|
133810
133810
|
}, function (p) {
|
|
133811
133811
|
return p.height ? _styled.css(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject$l(["\n height: ", ";\n "], ["\n height: ", ";\n "])), p.height) : _styled.css(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject$l(["\n height: 100%;\n "], ["\n height: 100%;\n "])));
|
|
@@ -133926,7 +133926,7 @@
|
|
|
133926
133926
|
return p.color ? _styled.css(templateObject_31 || (templateObject_31 = __makeTemplateObject$l(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.color) : _styled.css(templateObject_32 || (templateObject_32 = __makeTemplateObject$l(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.theme.textColors.default);
|
|
133927
133927
|
});
|
|
133928
133928
|
|
|
133929
|
-
var templateObject_1$i, templateObject_2$a, templateObject_3$7, templateObject_4$7, templateObject_5$5, templateObject_6$5, templateObject_7$
|
|
133929
|
+
var templateObject_1$i, templateObject_2$a, templateObject_3$7, templateObject_4$7, templateObject_5$5, templateObject_6$5, templateObject_7$2, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33;
|
|
133930
133930
|
|
|
133931
133931
|
var HeroPaging = function HeroPaging(_a) {
|
|
133932
133932
|
var items = _a.items,
|
|
@@ -135382,7 +135382,7 @@
|
|
|
135382
135382
|
var StyledCheckbox$1 = _styled__default["default"](officeUiFabricReact.Checkbox).withConfig({
|
|
135383
135383
|
displayName: "ChannelFilter__StyledCheckbox",
|
|
135384
135384
|
componentId: "sc-1ju8xwz-6"
|
|
135385
|
-
})(templateObject_7 || (templateObject_7 = __makeTemplateObject$l(["\n padding: ", "px 0;\n\n label {\n max-width: 100%;\n }\n\n &:first-child {\n padding-top: 0;\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n"], ["\n padding: ", "px 0;\n\n label {\n max-width: 100%;\n }\n\n &:first-child {\n padding-top: 0;\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n"])), spacingS - 2);
|
|
135385
|
+
})(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject$l(["\n padding: ", "px 0;\n\n label {\n max-width: 100%;\n }\n\n &:first-child {\n padding-top: 0;\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n"], ["\n padding: ", "px 0;\n\n label {\n max-width: 100%;\n }\n\n &:first-child {\n padding-top: 0;\n }\n\n &:last-child {\n padding-bottom: 0;\n }\n"])), spacingS - 2);
|
|
135386
135386
|
|
|
135387
135387
|
var StyledChannelTitle = _styled__default["default"](ChannelTitle).withConfig({
|
|
135388
135388
|
displayName: "ChannelFilter__StyledChannelTitle",
|
|
@@ -135399,7 +135399,7 @@
|
|
|
135399
135399
|
componentId: "sc-1ju8xwz-9"
|
|
135400
135400
|
})(templateObject_10 || (templateObject_10 = __makeTemplateObject$l(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])));
|
|
135401
135401
|
|
|
135402
|
-
var templateObject_1$5, templateObject_2$4, templateObject_3$2, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
135402
|
+
var templateObject_1$5, templateObject_2$4, templateObject_3$2, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10;
|
|
135403
135403
|
|
|
135404
135404
|
function toInteger(dirtyNumber) {
|
|
135405
135405
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
@@ -138217,7 +138217,7 @@
|
|
|
138217
138217
|
return jsxRuntime.jsxs("div", __assign$g({
|
|
138218
138218
|
className: className
|
|
138219
138219
|
}, {
|
|
138220
|
-
children: [jsxRuntime.jsx(SubTitle$
|
|
138220
|
+
children: [jsxRuntime.jsx(SubTitle$2, {
|
|
138221
138221
|
children: jsxRuntime.jsx(FormattedMessage$1, {
|
|
138222
138222
|
id: "FilterPanel.publishingDate"
|
|
138223
138223
|
}, void 0)
|
|
@@ -138358,7 +138358,7 @@
|
|
|
138358
138358
|
return p.theme.palette.themePrimary;
|
|
138359
138359
|
});
|
|
138360
138360
|
|
|
138361
|
-
var SubTitle$
|
|
138361
|
+
var SubTitle$2 = _styled__default["default"].p.withConfig({
|
|
138362
138362
|
displayName: "PublishingDateFilter__SubTitle",
|
|
138363
138363
|
componentId: "sc-zv88cu-3"
|
|
138364
138364
|
})(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject$l(["\n font-weight: bold;\n margin-bottom: ", "px;\n"], ["\n font-weight: bold;\n margin-bottom: ", "px;\n"])), spacingXs + 2);
|
|
@@ -138423,7 +138423,7 @@
|
|
|
138423
138423
|
return jsxRuntime.jsxs("div", __assign$g({
|
|
138424
138424
|
className: className
|
|
138425
138425
|
}, {
|
|
138426
|
-
children: [jsxRuntime.jsx(SubTitle, {
|
|
138426
|
+
children: [jsxRuntime.jsx(SubTitle$1, {
|
|
138427
138427
|
children: jsxRuntime.jsx(FormattedMessage$1, {
|
|
138428
138428
|
id: "Keywords.title"
|
|
138429
138429
|
}, void 0)
|
|
@@ -138472,7 +138472,7 @@
|
|
|
138472
138472
|
componentId: "sc-1aoeg5i-0"
|
|
138473
138473
|
})(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n overflow: hidden;\n\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\n padding: 0 4px;\n\n div:last-child {\n margin-bottom: 0;\n }\n }\n"], ["\n margin-bottom: ", "px;\n overflow: hidden;\n\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\n padding: 0 4px;\n\n div:last-child {\n margin-bottom: 0;\n }\n }\n"])), spacingM);
|
|
138474
138474
|
|
|
138475
|
-
var SubTitle = _styled__default["default"].p.withConfig({
|
|
138475
|
+
var SubTitle$1 = _styled__default["default"].p.withConfig({
|
|
138476
138476
|
displayName: "KeywordsFilter__SubTitle",
|
|
138477
138477
|
componentId: "sc-1aoeg5i-1"
|
|
138478
138478
|
})(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject$l(["\n font-weight: bold;\n margin-bottom: ", "px;\n"], ["\n font-weight: bold;\n margin-bottom: ", "px;\n"])), spacingXs + 2);
|
|
@@ -138727,7 +138727,109 @@
|
|
|
138727
138727
|
componentId: "sc-cnx0p9-5"
|
|
138728
138728
|
})(templateObject_6 || (templateObject_6 = __makeTemplateObject$l(["\n .ms-Persona-primaryText {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 105px;\n }\n"], ["\n .ms-Persona-primaryText {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 105px;\n }\n"])));
|
|
138729
138729
|
|
|
138730
|
-
var
|
|
138730
|
+
var cachedUserAccounts = null;
|
|
138731
|
+
var AuthorFilter = function AuthorFilter(_a) {
|
|
138732
|
+
var _b;
|
|
138733
|
+
|
|
138734
|
+
var className = _a.className;
|
|
138735
|
+
var searchAccounts = useAccountApi().searchAccounts;
|
|
138736
|
+
var showError = useNotificationContext().showError;
|
|
138737
|
+
|
|
138738
|
+
var _c = React$d.useContext(FilterContext),
|
|
138739
|
+
filter = _c.filter,
|
|
138740
|
+
onChange = _c.onChange;
|
|
138741
|
+
|
|
138742
|
+
var selectedUsers = (cachedUserAccounts === null || cachedUserAccounts === void 0 ? void 0 : cachedUserAccounts.filter(function (a) {
|
|
138743
|
+
var _a;
|
|
138744
|
+
|
|
138745
|
+
return (_a = filter === null || filter === void 0 ? void 0 : filter.authors) === null || _a === void 0 ? void 0 : _a.includes(a.userPrincipalName);
|
|
138746
|
+
})) || ((_b = filter === null || filter === void 0 ? void 0 : filter.authors) === null || _b === void 0 ? void 0 : _b.map(function (a) {
|
|
138747
|
+
return {
|
|
138748
|
+
displayName: a,
|
|
138749
|
+
userPrincipalName: a
|
|
138750
|
+
};
|
|
138751
|
+
})) || [];
|
|
138752
|
+
return jsxRuntime.jsxs("div", __assign$g({
|
|
138753
|
+
className: className
|
|
138754
|
+
}, {
|
|
138755
|
+
children: [jsxRuntime.jsx(SubTitle, __assign$g({
|
|
138756
|
+
htmlFor: "author-filter"
|
|
138757
|
+
}, {
|
|
138758
|
+
children: jsxRuntime.jsx(FormattedMessage$1, {
|
|
138759
|
+
id: "FilterPanel.author"
|
|
138760
|
+
}, void 0)
|
|
138761
|
+
}), void 0), jsxRuntime.jsx(PeoplePicker, {
|
|
138762
|
+
accountType: AccountType.User,
|
|
138763
|
+
allowMailItems: true,
|
|
138764
|
+
localOnly: true,
|
|
138765
|
+
includePendingInvitationUsers: false,
|
|
138766
|
+
includePendingRegistrationUsers: false,
|
|
138767
|
+
selectionMode: officeUiFabricReact.SelectionMode.multiple,
|
|
138768
|
+
selectedItems: selectedUsers,
|
|
138769
|
+
onChange: function (accounts) {
|
|
138770
|
+
var newSelectedAccounts = accounts.length > 0 ? accounts : null;
|
|
138771
|
+
onChange(__assign$g(__assign$g({}, filter), {
|
|
138772
|
+
authors: newSelectedAccounts === null || newSelectedAccounts === void 0 ? void 0 : newSelectedAccounts.map(function (a) {
|
|
138773
|
+
return a.userPrincipalName;
|
|
138774
|
+
})
|
|
138775
|
+
}));
|
|
138776
|
+
cachedUserAccounts = newSelectedAccounts;
|
|
138777
|
+
},
|
|
138778
|
+
onEmptyInputFocus: function () {
|
|
138779
|
+
return getUsers();
|
|
138780
|
+
},
|
|
138781
|
+
placeholderStringResourceKey: "Generic.peoplePicker.placeholder",
|
|
138782
|
+
inputId: "author-filter"
|
|
138783
|
+
}, void 0)]
|
|
138784
|
+
}), void 0);
|
|
138785
|
+
|
|
138786
|
+
function getUsers() {
|
|
138787
|
+
return __awaiter$b(this, void 0, void 0, function () {
|
|
138788
|
+
|
|
138789
|
+
return __generator$b(this, function (_b) {
|
|
138790
|
+
switch (_b.label) {
|
|
138791
|
+
case 0:
|
|
138792
|
+
_b.trys.push([0, 2,, 3]);
|
|
138793
|
+
|
|
138794
|
+
return [4
|
|
138795
|
+
/*yield*/
|
|
138796
|
+
, searchAccounts({
|
|
138797
|
+
search: '',
|
|
138798
|
+
type: AccountType.User,
|
|
138799
|
+
includePendingInvitationUsers: false,
|
|
138800
|
+
includePendingRegistrationUsers: false,
|
|
138801
|
+
localOnly: true,
|
|
138802
|
+
excludeApiUsers: true
|
|
138803
|
+
})];
|
|
138804
|
+
|
|
138805
|
+
case 1:
|
|
138806
|
+
return [2
|
|
138807
|
+
/*return*/
|
|
138808
|
+
, _b.sent()];
|
|
138809
|
+
|
|
138810
|
+
case 2:
|
|
138811
|
+
_b.sent();
|
|
138812
|
+
showError('Generic.error');
|
|
138813
|
+
return [3
|
|
138814
|
+
/*break*/
|
|
138815
|
+
, 3];
|
|
138816
|
+
|
|
138817
|
+
case 3:
|
|
138818
|
+
return [2
|
|
138819
|
+
/*return*/
|
|
138820
|
+
, []];
|
|
138821
|
+
}
|
|
138822
|
+
});
|
|
138823
|
+
});
|
|
138824
|
+
}
|
|
138825
|
+
};
|
|
138826
|
+
|
|
138827
|
+
var SubTitle = _styled__default["default"].label.withConfig({
|
|
138828
|
+
displayName: "AuthorFilter__SubTitle",
|
|
138829
|
+
componentId: "sc-cnx0p9-6"
|
|
138830
|
+
})(templateObject_7 || (templateObject_7 = __makeTemplateObject$l(["\n display: block;\n font-weight: bold;\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n display: block;\n font-weight: bold;\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), spacingS + 4, spacingXs + 2);
|
|
138831
|
+
|
|
138832
|
+
var templateObject_1$1, templateObject_2$1, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
138731
138833
|
|
|
138732
138834
|
// `SameValue` abstract operation
|
|
138733
138835
|
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
@@ -218309,6 +218411,7 @@
|
|
|
218309
218411
|
'default': EmojiPicker
|
|
218310
218412
|
});
|
|
218311
218413
|
|
|
218414
|
+
exports.AuthorFilter = AuthorFilter;
|
|
218312
218415
|
exports.AuthorToolbarFilter = AuthorToolbarFilter;
|
|
218313
218416
|
exports.Avatar = Avatar;
|
|
218314
218417
|
exports.ChannelFilter = ChannelFilter;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livetiles/reach-components-react",
|
|
3
3
|
"description": "Provides React components to consume LiveTiles Reach data",
|
|
4
|
-
"version": "0.4.0-preview.
|
|
4
|
+
"version": "0.4.0-preview.269",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"react": "^16.14.0 || ^17",
|
|
7
7
|
"react-dom": "^16.14.0 || ^17",
|