@livetiles/reach-components-react 0.4.0-preview.208 → 0.4.0-preview.211
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/FilterContext.d.ts +2 -2
- package/ToolbarFilterPanel.d.ts +3 -1
- package/en.async.esm.esm.js +1 -0
- package/index.d.ts +4 -2
- package/index.esm2.js +58 -27
- package/index.umd.js +59 -27
- package/package.json +1 -1
package/FilterContext.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { IndexableFilterDefinition } from '@livetiles/reach/feature/content';
|
|
|
2
2
|
import { FC } from 'react';
|
|
3
3
|
export interface FilterProps {
|
|
4
4
|
filter: IndexableFilterDefinition;
|
|
5
|
-
onChange: (filter: Partial<IndexableFilterDefinition>) => void;
|
|
5
|
+
onChange: (filter: Partial<IndexableFilterDefinition> | null) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare const FilterContext: import("react").Context<FilterProps>;
|
|
8
8
|
export declare const FilterContextProvider: FC<{
|
|
9
9
|
filter: IndexableFilterDefinition;
|
|
10
|
-
onChange: (filter: Partial<IndexableFilterDefinition>) => void;
|
|
10
|
+
onChange: (filter: Partial<IndexableFilterDefinition> | null) => void;
|
|
11
11
|
}>;
|
package/ToolbarFilterPanel.d.ts
CHANGED
package/en.async.esm.esm.js
CHANGED
|
@@ -16,6 +16,7 @@ var en = {
|
|
|
16
16
|
"Generic.Restore": "Restore",
|
|
17
17
|
"Generic.Preview": "Preview",
|
|
18
18
|
"Generic.upload": "Upload",
|
|
19
|
+
"Generic.search": "Search",
|
|
19
20
|
"Generic.resetToDefault": "Reset to Default",
|
|
20
21
|
"Generic.bookmarks": "Bookmarks",
|
|
21
22
|
"Generic.error": "Something went wrong. Please reload the page and try again",
|
package/index.d.ts
CHANGED
|
@@ -746,10 +746,12 @@ declare const NewsItemPreviewContextProvider: FC<{
|
|
|
746
746
|
|
|
747
747
|
interface FilterProps {
|
|
748
748
|
filter: IndexableFilterDefinition;
|
|
749
|
-
onChange: (filter: Partial<IndexableFilterDefinition>) => void;
|
|
749
|
+
onChange: (filter: Partial<IndexableFilterDefinition> | null) => void;
|
|
750
750
|
}
|
|
751
751
|
|
|
752
|
-
declare const ToolbarFilterPanel: FC<FilterProps
|
|
752
|
+
declare const ToolbarFilterPanel: FC<FilterProps & {
|
|
753
|
+
hideClearAllFiltersButton?: boolean;
|
|
754
|
+
}>;
|
|
753
755
|
|
|
754
756
|
interface ChannelFilterProps {
|
|
755
757
|
channels?: string[];
|
package/index.esm2.js
CHANGED
|
@@ -81879,7 +81879,7 @@ var Inner$1$1 = _styled.span.withConfig({
|
|
|
81879
81879
|
displayName: "FileAttachmentList__Inner",
|
|
81880
81880
|
componentId: "sc-lwztxx-6"
|
|
81881
81881
|
})(templateObject_9$4$1 || (templateObject_9$4$1 = __makeTemplateObject$1(["\n display: inline-flex;\n\n ", "\n"], ["\n display: inline-flex;\n\n ", "\n"])), function (p) {
|
|
81882
|
-
return p.takeFullWidth ? css$2(templateObject_7$5$
|
|
81882
|
+
return p.takeFullWidth ? css$2(templateObject_7$5$2 || (templateObject_7$5$2 = __makeTemplateObject$1(["\n width: 100%;\n "], ["\n width: 100%;\n "]))) : css$2(templateObject_8$5$1 || (templateObject_8$5$1 = __makeTemplateObject$1(["\n width: calc(100% - 34px); // delete button size;\n "], ["\n width: calc(100% - 34px); // delete button size;\n "])));
|
|
81883
81883
|
});
|
|
81884
81884
|
|
|
81885
81885
|
var FileNameContainer = _styled.span.withConfig({
|
|
@@ -81921,7 +81921,7 @@ var WarningIcon$1 = _styled(Icon).withConfig({
|
|
|
81921
81921
|
return p.theme.palette.redDark;
|
|
81922
81922
|
});
|
|
81923
81923
|
|
|
81924
|
-
var templateObject_1$R$1, templateObject_2$y$1, templateObject_3$o$1, templateObject_4$g$1, templateObject_5$b$1, templateObject_6$9$1, templateObject_7$5$
|
|
81924
|
+
var templateObject_1$R$1, templateObject_2$y$1, templateObject_3$o$1, templateObject_4$g$1, templateObject_5$b$1, templateObject_6$9$1, templateObject_7$5$2, templateObject_8$5$1, templateObject_9$4$1, templateObject_10$1$2, templateObject_11$1$2, templateObject_12$8, templateObject_13$7, templateObject_14$7, templateObject_15$7, templateObject_16$7;
|
|
81925
81925
|
var FabNavigationPosition;
|
|
81926
81926
|
|
|
81927
81927
|
(function (FabNavigationPosition) {
|
|
@@ -82789,7 +82789,7 @@ var Search = function Search(props) {
|
|
|
82789
82789
|
className: classNames('search-field', props.className),
|
|
82790
82790
|
useLightTheme: props.useLightTheme
|
|
82791
82791
|
}, {
|
|
82792
|
-
children: [jsx$1(StyledTextField, {
|
|
82792
|
+
children: [jsx$1(StyledTextField$1, {
|
|
82793
82793
|
className: "search-input",
|
|
82794
82794
|
useLightTheme: props.useLightTheme,
|
|
82795
82795
|
default: true,
|
|
@@ -82850,7 +82850,7 @@ var Search = function Search(props) {
|
|
|
82850
82850
|
}
|
|
82851
82851
|
};
|
|
82852
82852
|
|
|
82853
|
-
var StyledTextField = _styled(TextField).withConfig({
|
|
82853
|
+
var StyledTextField$1 = _styled(TextField).withConfig({
|
|
82854
82854
|
displayName: "Search__StyledTextField",
|
|
82855
82855
|
componentId: "sc-17f35gt-0"
|
|
82856
82856
|
})(templateObject_3$j$1 || (templateObject_3$j$1 = __makeTemplateObject$1(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
@@ -87472,9 +87472,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
|
|
|
87472
87472
|
}), void 0);
|
|
87473
87473
|
};
|
|
87474
87474
|
|
|
87475
|
-
var version$1 = "0.4.0-preview.
|
|
87476
|
-
var buildId = "
|
|
87477
|
-
var commitId = "
|
|
87475
|
+
var version$1 = "0.4.0-preview.211";
|
|
87476
|
+
var buildId = "98387";
|
|
87477
|
+
var commitId = "4ace7b7b15e3e3894d78df895eb99b1c395eaac6";
|
|
87478
87478
|
var isCustomerBuild = false;
|
|
87479
87479
|
var buildInfo = {
|
|
87480
87480
|
version: version$1,
|
|
@@ -131835,7 +131835,7 @@ result.items.forEach(function(page){var _a;var node=convertToNavigationNode(page
|
|
|
131835
131835
|
// we don't want to add the same node again, instead we just need to
|
|
131836
131836
|
// append the children of the node
|
|
131837
131837
|
// we also know then that we don't have to traverse the tree further up and can stop
|
|
131838
|
-
var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===page.id){existingNode.isSearchMatch=true;}ensureChildren.apply(void 0,__spreadArray([existingNode],node.children||[]));break;}allNodesById[node.id]=node;if(!((_a=node.parent)===null||_a===void 0?void 0:_a.id)){break;}ensureChildren(node.parent,node);node=node.parent;}});onSearchResultChange(Object.values(allNodesById).filter(function(n){var _a;return !((_a=n.parent)===null||_a===void 0?void 0:_a.id);}));return [2/*return*/];}});});}function ensureChildren(parent){var _a;var children=[];for(var _i=1;_i<arguments.length;_i++){children[_i-1]=arguments[_i];}if(!parent.children){parent.children=[];}parent.children=parent.children.concat(children).sort(function(a,b){return a.position-b.position;});parent.firstChildId=(_a=parent.children[0])===null||_a===void 0?void 0:_a.id;}};var StyledSearchBox=_styled(SearchBox$1).withConfig({displayName:"PageTocSearch__StyledSearchBox",componentId:"sc-1enxv6b-0"})(templateObject_1$V||(templateObject_1$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);var templateObject_1$V;function filterChildren(page,activePage){if(!activePage){return true;}if(activePage.status===WorkflowStatus.deleted){return page.status===WorkflowStatus.deleted;}return page.status!==WorkflowStatus.deleted&&activePage.isUnlinked===page.isUnlinked;}var ExternalPagesLinkButton=function ExternalPagesLinkButton(_a){var item=_a.item,disabled=_a.disabled,onClick=_a.onClick,className=_a.className;var user=useCurrentUser();var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;if(!item.useExternalContent){return null;}var resourceKey="ExternalLinkButton.pages"+(!url?'.noUrl':'')+".navigateTo";return jsx$1(Tooltip,__assign({className:className,resourceKey:resourceKey,values:url?{url:url}:undefined,width:url?400:undefined},{children:jsx$1(StyledIconButton$4,{iconProps:{iconName:'NavigateExternalInline',styles:{root:{fontSize:fontSizeMedium+4+"px",height:fontSizeMedium+4+"px"}}},onClick:handleClick,disabled:disabled,"aria-label":formatMessage({id:resourceKey},url?{url:url}:undefined)},void 0)}),void 0);function handleClick(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(onClick){onClick(e);return [2/*return*/];}createPageClickHandler(item)(e);return [2/*return*/];});});}};var StyledIconButton$4=_styled(IconButton).withConfig({displayName:"ExternalPagesLinkButton__StyledIconButton",componentId:"sc-1n1ybv7-0"})(templateObject_1$U||(templateObject_1$U=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$U;var PageNode=function PageNode(_a){var node=_a.node,activePage=_a.activePage,navigationContext=_a.navigationContext,loadChildren=_a.loadChildren,basePath=_a.basePath,path=_a.path,className=_a.className,isRootNode=_a.isRootNode,hide=_a.hide,onPageSelected=_a.onPageSelected,selectedPageId=_a.selectedPageId;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var nodesContainNavigation=navigationContext==null;var _b=useState$2(null),lazyLoadedChildren=_b[0],setLazyLoadedChildren=_b[1];var children=lazyLoadedChildren||getChildren(node.id).filter(function(n){return filterChildren(n,activePage);});var _c=useState$2(undefined),forceShowChildren=_c[0],setForceShowChildren=_c[1];var showChildren=forceShowChildren||children&&forceShowChildren!==false&&(nodesContainNavigation||path.some(function(p){return p===node.id;})||(activePage===null||activePage===void 0?void 0:activePage.id)===node.id);var title=getTitle(node,user,formatMessage);var isSelectedPageNode=(activePage===null||activePage===void 0?void 0:activePage.id)===node.id||selectedPageId===node.id;var iconName=getIconName();var isExpanded=iconName==='ChevronDown';var isHighlighted=isSelectedPageNode||path.some(function(p){return p===node.id;});var appBasePath=basePath?buildPath(basePath):null;var isSearchMatch=node.isSearchMatch?'true':null;var isDocument=node.pageType===PageType.Document;var detailViewUrl=""+NewsService.getNewsRoute(appBasePath,node.id,title)+(node.useExternalContent?"?"+queryString.stringify({noRedirect:true}):'');return jsxs(Fragment,{children:[jsxs(NodeWrapper,__assign({isFirstLevel:isRootNode,hide:hide,className:className,isActive:isSelectedPageNode,"data-page-toc-node":true,"data-is-active":isSelectedPageNode},{children:[!!iconName?jsx$1(StyledIconButton$3,{iconProps:{iconName:iconName},onClick:function(){return __awaiter(void 0,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(!!(children===null||children===void 0?void 0:children.length))return [3/*break*/,2];_a=setLazyLoadedChildren;return [4/*yield*/,loadChildren(node.id)];case 1:_a.apply(void 0,[_b.sent()]);_b.label=2;case 2:setForceShowChildren(!showChildren);return [2/*return*/];}});});},isHighlighted:isHighlighted,isExpanded:isExpanded,ariaLabel:formatMessage({id:isExpanded?'AriaLabel.hideChildren':'AriaLabel.seeChildren'}),"data-toc-node-toggle-children":node.id},void 0):jsx$1(StyledIcon$3$1,{isHighlighted:isHighlighted},void 0),basePath?jsx$1(NodeTitleLink,__assign({onClick:createPageClickHandler(node,basePath,function(){return onPageSelected===null||onPageSelected===void 0?void 0:onPageSelected(node.id);},true),to:detailViewUrl,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):onPageSelected?jsx$1(NodeTitleButton,__assign({onClick:function(){return onPageSelected(node.id);},disabled:isDocument,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):jsx$1(NodeTitle,__assign({bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0),jsx$1(StyledExternalLinkButton,{item:node},void 0),jsx$1(StyledDocumentDownloadButton$1,{page:node,basePath:basePath},void 0)]}),void 0),children.length>0&&jsx$1(ChildrenList,__assign({hide:hide},{children:children.map(function(c){return jsx$1("li",{children:jsx$1(PageNode,{hide:!showChildren,basePath:basePath,node:c,activePage:activePage,navigationContext:navigationContext,loadChildren:loadChildren,path:path,isRootNode:false,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id);})}),void 0)]},void 0);function getIconName(){var _a;if(!nodesContainNavigation&&!node.firstChildId||nodesContainNavigation&&!((_a=node.children)===null||_a===void 0?void 0:_a.length)){return null;}if(showChildren){return 'ChevronDown';}return 'ChevronRight';}function getChildren(nodeId){if(nodesContainNavigation){return node.children||[];}if((activePage===null||activePage===void 0?void 0:activePage.id)===nodeId){return navigationContext.children||[];}var result=navigationContext.parent;while(result!=null&&result.id!==nodeId){result=result.parent;}return result?result.children:[];}};var NodeWrapper=_styled.div.withConfig({displayName:"PageTocNode__NodeWrapper",componentId:"sc-1ftr1ym-0"})(templateObject_3$p||(templateObject_3$p=__makeTemplateObject(["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"],["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"])),function(p){return p.hide&&'display: none;';},function(p){return !p.isFirstLevel&&css$2(templateObject_1$T||(templateObject_1$T=__makeTemplateObject(["\n padding-left: ","px;\n margin-top: ","px;\n "],["\n padding-left: ","px;\n margin-top: ","px;\n "])),spacingS,spacingS+5);},function(p){return p.isActive&&css$2(templateObject_2$z||(templateObject_2$z=__makeTemplateObject(["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "])),function(p){return p.theme.palette.neutralQuaternaryAlt;});},spacingXs,minScreenSize.small);var IconNormalSize=20;var IconLargeSize=26;var IconBubbleStyle=function IconBubbleStyle(isHighlighted){return css$2(templateObject_6$8||(templateObject_6$8=__makeTemplateObject(["\n ",";\n "],["\n ",";\n "])),isHighlighted?css$2(templateObject_4$g||(templateObject_4$g=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.accent;},function(p){return p.theme.palette.white;}):css$2(templateObject_5$e||(templateObject_5$e=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.neutralQuaternary;},function(p){return p.theme.palette.black;}));};var StyledIconButton$3=_styled(IconButton$1).withConfig({displayName:"PageTocNode__StyledIconButton",componentId:"sc-1ftr1ym-1"})(templateObject_8$5||(templateObject_8$5=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"])),IconLargeSize,IconLargeSize,IconLargeSize,function(p){return p.isExpanded&&css$2(templateObject_7$5||(templateObject_7$5=__makeTemplateObject(["\n i {\n transform: translate(0, 1px);\n }\n "],["\n i {\n transform: translate(0, 1px);\n }\n "])));},function(p){return IconBubbleStyle(p.isHighlighted);},minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledIcon$3$1=_styled(Icon).withConfig({displayName:"PageTocNode__StyledIcon",componentId:"sc-1ftr1ym-2"})(templateObject_9$3||(templateObject_9$3=__makeTemplateObject(["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"],["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"])),IconLargeSize,IconLargeSize,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize,function(p){return IconBubbleStyle(p.isHighlighted);});var NodeTitleStyle=css$2(templateObject_11$1$1||(templateObject_11$1$1=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"],["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"])),spacingM,fontSizeNormal,function(p){return p.theme.textColors.default;},function(p){return p.bold&&css$2(templateObject_10$2$1||(templateObject_10$2$1=__makeTemplateObject(["\n font-weight: bold;\n "],["\n font-weight: bold;\n "])));},minScreenSize.small,fontSizeSmall);var NodeTitleLink=_styled(NavLink).withConfig({displayName:"PageTocNode__NodeTitleLink",componentId:"sc-1ftr1ym-3"})(templateObject_12$1$1||(templateObject_12$1$1=__makeTemplateObject(["\n ",";\n\n && {\n color: ",";\n }\n"],["\n ",";\n\n && {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.textColors.default;});var NodeTitleButton=_styled(ActionButton).withConfig({displayName:"PageTocNode__NodeTitleButton",componentId:"sc-1ftr1ym-4"})(templateObject_13$1$1||(templateObject_13$1$1=__makeTemplateObject(["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"],["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.palette.neutralQuaternary;});var NodeTitle=_styled.div.withConfig({displayName:"PageTocNode__NodeTitle",componentId:"sc-1ftr1ym-5"})(templateObject_14$1$1||(templateObject_14$1$1=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),NodeTitleStyle);var ChildrenList=_styled.ul.withConfig({displayName:"PageTocNode__ChildrenList",componentId:"sc-1ftr1ym-6"})(templateObject_15$1$1||(templateObject_15$1$1=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"])),function(p){return p.hide&&'display: none;';},spacingS);var StyledExternalLinkButton=_styled(ExternalPagesLinkButton).withConfig({displayName:"PageTocNode__StyledExternalLinkButton",componentId:"sc-1ftr1ym-7"})(templateObject_16$1$1||(templateObject_16$1$1=__makeTemplateObject(["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"])),spacingS,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledDocumentDownloadButton$1=_styled(DocumentDownloadButton).withConfig({displayName:"PageTocNode__StyledDocumentDownloadButton",componentId:"sc-1ftr1ym-8"})(templateObject_17$1||(templateObject_17$1=__makeTemplateObject(["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"])),IconLargeSize,spacingS-5,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var templateObject_1$T,templateObject_2$z,templateObject_3$p,templateObject_4$g,templateObject_5$e,templateObject_6$8,templateObject_7$5,templateObject_8$5,templateObject_9$3,templateObject_10$2$1,templateObject_11$1$1,templateObject_12$1$1,templateObject_13$1$1,templateObject_14$1$1,templateObject_15$1$1,templateObject_16$1$1,templateObject_17$1;var PageTableOfContents$1=function PageTableOfContents(_a){var basePath=_a.basePath,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onPageSelected=_a.onPageSelected,className=_a.className,selectedPageId=_a.selectedPageId,isLoading=_a.isLoading,disableScrollableList=_a.disableScrollableList;var user=useCurrentUser();var _b=getRootNodes(),rootNodes=_b.rootNodes,path=_b.path;var _c=useState$2(),searchResult=_c[0],setSearchResult=_c[1];if(isLoading){return jsx$1(Spinner,{},void 0);}if(!rootNodes||(rootNodes===null||rootNodes===void 0?void 0:rootNodes.length)===0){return jsx$1(FormattedMessageWithStyle,{id:"ContentEditor.parentPage.emptyToc",tagName:"div",className:className},void 0);}var activePage=activePageId&&navigationContext.siblings.find(function(p){return p.id===activePageId;});var nodesToDisplay=sortPageNodesByGroupAndPosition(user.groups,(searchResult||rootNodes).filter(function(p){return filterChildren(p,activePage);}));return jsx$1(Fragment,{children:jsxs("div",__assign({className:className},{children:[jsx$1("div",__assign({"data-toc-search-container":true},{children:jsx$1(PageTocSearch,{onSearch:onSearch,onSearchResultChange:setSearchResult},void 0)}),void 0),searchResult&&!searchResult.length&&jsx$1(TocEmptyList,{icon:"Search",emptyMessageResources:['EmptySearchResult.info']},void 0),nodesToDisplay&&jsx$1(TocListContainer,__assign({"data-toc-scrollable-container":true,isScrollable:!disableScrollableList},{children:jsx$1(TocList,{children:nodesToDisplay.map(function(c){return jsx$1(ToCItem,{children:jsx$1(PageNode,{basePath:basePath,node:c,activePage:activePage,navigationContext:searchResult?null:navigationContext,loadChildren:loadChildren,path:path,isRootNode:true,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id+!!searchResult);})},void 0)}),void 0)]}),void 0)},void 0);function getRootNodes(){if(!(navigationContext===null||navigationContext===void 0?void 0:navigationContext.parent)){return {rootNodes:(navigationContext===null||navigationContext===void 0?void 0:navigationContext.siblings)||[],path:[]};}var path=[];var currentParent=navigationContext.parent;while(currentParent!=null&¤tParent.parent!=null){path.push(currentParent.id);currentParent=currentParent.parent;}return {rootNodes:(currentParent===null||currentParent===void 0?void 0:currentParent.children)||[],path:path};}};var TocEmptyList=_styled(EmptyList).withConfig({displayName:"PageTableOfContents__TocEmptyList",componentId:"sc-3llzkd-0"})(templateObject_1$S||(templateObject_1$S=__makeTemplateObject(["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"],["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"])),fontSizeLarger+10);var TocListContainer=_styled.div.withConfig({displayName:"PageTableOfContents__TocListContainer",componentId:"sc-3llzkd-1"})(templateObject_3$o||(templateObject_3$o=__makeTemplateObject(["\n padding-top: ","px;\n\n ","\n"],["\n padding-top: ","px;\n\n ","\n"])),spacingXs,function(p){return p.isScrollable&&css$2(templateObject_2$y||(templateObject_2$y=__makeTemplateObject(["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "],["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "])));});var TocList=_styled.ul.withConfig({displayName:"PageTableOfContents__TocList",componentId:"sc-3llzkd-2"})(templateObject_4$f||(templateObject_4$f=__makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n"],["\n list-style: none;\n padding: 0;\n margin: 0;\n"])));var ToCItem=_styled.li.withConfig({displayName:"PageTableOfContents__ToCItem",componentId:"sc-3llzkd-3"})(templateObject_5$d||(templateObject_5$d=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);_styled(PageTableOfContents$1).withConfig({displayName:"PageTableOfContents__StyledPageToC",componentId:"sc-3llzkd-4"})(templateObject_6$7$1||(templateObject_6$7$1=__makeTemplateObject(["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"],["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"])),spacingM,spacingM,spacingM);var templateObject_1$S,templateObject_2$y,templateObject_3$o,templateObject_4$f,templateObject_5$d,templateObject_6$7$1;var PageTableOfContentsDialog=function PageTableOfContentsDialog(_a){var isOpen=_a.isOpen,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onDismiss=_a.onDismiss,basePath=_a.basePath;var formatMessage=useIntl().formatMessage;if(!navigationContext){return null;}return jsx$1(MobileFullHeightDialog,__assign({hidden:!isOpen,modalProps:{className:'dialog-toc'},dialogContentProps:{type:DialogType.close},onDismiss:onDismiss,title:formatMessage({id:'Pages.pagesTableOfContents'})},{children:jsxs(DialogContent,__assign({className:"dialog-content-host","data-toc-dialog":true},{children:[jsx$1(DialogGlobalStyle,{},void 0),jsx$1(PageTableOfContents$1,{basePath:basePath,activePageId:activePageId,navigationContext:navigationContext,loadChildren:loadChildren,onSearch:onSearch,onPageSelected:onDismiss,disableScrollableList:true},void 0)]}),void 0)}),void 0);};var DialogContent=_styled.div.withConfig({displayName:"PageTableOfContentsDialog__DialogContent",componentId:"sc-z2sdu7-0"})(templateObject_1$R||(templateObject_1$R=__makeTemplateObject(["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"],["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle=createGlobalStyle(templateObject_2$x||(templateObject_2$x=__makeTemplateObject(["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"],["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$R,templateObject_2$x;function useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType){var searchPublishedPages=usePagesApi().searchPublishedPages;return function(pageSize,token){return searchPublishedPages({keywords:keywords,token:token,pageSize:pageSize,pageType:showPagesAndDocuments?undefined:pageType});};}var InlinePageListByKeywords=function InlinePageListByKeywords(_a){var keywords=_a.keywords,showDocuments=_a.showDocuments,showPages=_a.showPages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showPagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var defaultPageSize=10;var keywordsAsString=keywords===null||keywords===void 0?void 0:keywords.join('-');var _b=useItemLoaderWithPreFetch(defaultPageSize,useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType),[keywordsAsString]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsx$1(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};function useLoadPublishedItemsByPageId(pageId,showPagesAndDocuments,pageType){var getSubpages=usePagesApi().getSubpages;try{return function(pageSize,token){return getSubpages(pageId,{pageType:showPagesAndDocuments?undefined:pageType,token:token,pageSize:pageSize});};}catch(error){logger.error(error);return null;}}var defaultPageSize$1=10;var InlinePageListByPageId=function InlinePageListByPageId(_a){var pageId=_a.pageId,showPages=_a.showPages,showDocuments=_a.showDocuments;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showSubpagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var _b=useItemLoaderWithPreFetch(defaultPageSize$1,useLoadPublishedItemsByPageId(pageId,showSubpagesAndDocuments,pageType),[pageId]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsx$1(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};var defaultPageSize=10;// the inline page list should be auto-added on a page with no content
|
|
131838
|
+
var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===page.id){existingNode.isSearchMatch=true;}ensureChildren.apply(void 0,__spreadArray([existingNode],node.children||[]));break;}allNodesById[node.id]=node;if(!((_a=node.parent)===null||_a===void 0?void 0:_a.id)){break;}ensureChildren(node.parent,node);node=node.parent;}});onSearchResultChange(Object.values(allNodesById).filter(function(n){var _a;return !((_a=n.parent)===null||_a===void 0?void 0:_a.id);}));return [2/*return*/];}});});}function ensureChildren(parent){var _a;var children=[];for(var _i=1;_i<arguments.length;_i++){children[_i-1]=arguments[_i];}if(!parent.children){parent.children=[];}parent.children=parent.children.concat(children).sort(function(a,b){return a.position-b.position;});parent.firstChildId=(_a=parent.children[0])===null||_a===void 0?void 0:_a.id;}};var StyledSearchBox=_styled(SearchBox$1).withConfig({displayName:"PageTocSearch__StyledSearchBox",componentId:"sc-1enxv6b-0"})(templateObject_1$V||(templateObject_1$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);var templateObject_1$V;function filterChildren(page,activePage){if(!activePage){return true;}if(activePage.status===WorkflowStatus.deleted){return page.status===WorkflowStatus.deleted;}return page.status!==WorkflowStatus.deleted&&activePage.isUnlinked===page.isUnlinked;}var ExternalPagesLinkButton=function ExternalPagesLinkButton(_a){var item=_a.item,disabled=_a.disabled,onClick=_a.onClick,className=_a.className;var user=useCurrentUser();var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;if(!item.useExternalContent){return null;}var resourceKey="ExternalLinkButton.pages"+(!url?'.noUrl':'')+".navigateTo";return jsx$1(Tooltip,__assign({className:className,resourceKey:resourceKey,values:url?{url:url}:undefined,width:url?400:undefined},{children:jsx$1(StyledIconButton$4,{iconProps:{iconName:'NavigateExternalInline',styles:{root:{fontSize:fontSizeMedium+4+"px",height:fontSizeMedium+4+"px"}}},onClick:handleClick,disabled:disabled,"aria-label":formatMessage({id:resourceKey},url?{url:url}:undefined)},void 0)}),void 0);function handleClick(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(onClick){onClick(e);return [2/*return*/];}createPageClickHandler(item)(e);return [2/*return*/];});});}};var StyledIconButton$4=_styled(IconButton).withConfig({displayName:"ExternalPagesLinkButton__StyledIconButton",componentId:"sc-1n1ybv7-0"})(templateObject_1$U||(templateObject_1$U=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$U;var PageNode=function PageNode(_a){var node=_a.node,activePage=_a.activePage,navigationContext=_a.navigationContext,loadChildren=_a.loadChildren,basePath=_a.basePath,path=_a.path,className=_a.className,isRootNode=_a.isRootNode,hide=_a.hide,onPageSelected=_a.onPageSelected,selectedPageId=_a.selectedPageId;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var nodesContainNavigation=navigationContext==null;var _b=useState$2(null),lazyLoadedChildren=_b[0],setLazyLoadedChildren=_b[1];var children=lazyLoadedChildren||getChildren(node.id).filter(function(n){return filterChildren(n,activePage);});var _c=useState$2(undefined),forceShowChildren=_c[0],setForceShowChildren=_c[1];var showChildren=forceShowChildren||children&&forceShowChildren!==false&&(nodesContainNavigation||path.some(function(p){return p===node.id;})||(activePage===null||activePage===void 0?void 0:activePage.id)===node.id);var title=getTitle(node,user,formatMessage);var isSelectedPageNode=(activePage===null||activePage===void 0?void 0:activePage.id)===node.id||selectedPageId===node.id;var iconName=getIconName();var isExpanded=iconName==='ChevronDown';var isHighlighted=isSelectedPageNode||path.some(function(p){return p===node.id;});var appBasePath=basePath?buildPath(basePath):null;var isSearchMatch=node.isSearchMatch?'true':null;var isDocument=node.pageType===PageType.Document;var detailViewUrl=""+NewsService.getNewsRoute(appBasePath,node.id,title)+(node.useExternalContent?"?"+queryString.stringify({noRedirect:true}):'');return jsxs(Fragment,{children:[jsxs(NodeWrapper,__assign({isFirstLevel:isRootNode,hide:hide,className:className,isActive:isSelectedPageNode,"data-page-toc-node":true,"data-is-active":isSelectedPageNode},{children:[!!iconName?jsx$1(StyledIconButton$3,{iconProps:{iconName:iconName},onClick:function(){return __awaiter(void 0,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(!!(children===null||children===void 0?void 0:children.length))return [3/*break*/,2];_a=setLazyLoadedChildren;return [4/*yield*/,loadChildren(node.id)];case 1:_a.apply(void 0,[_b.sent()]);_b.label=2;case 2:setForceShowChildren(!showChildren);return [2/*return*/];}});});},isHighlighted:isHighlighted,isExpanded:isExpanded,ariaLabel:formatMessage({id:isExpanded?'AriaLabel.hideChildren':'AriaLabel.seeChildren'}),"data-toc-node-toggle-children":node.id},void 0):jsx$1(StyledIcon$3$1,{isHighlighted:isHighlighted},void 0),basePath?jsx$1(NodeTitleLink,__assign({onClick:createPageClickHandler(node,basePath,function(){return onPageSelected===null||onPageSelected===void 0?void 0:onPageSelected(node.id);},true),to:detailViewUrl,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):onPageSelected?jsx$1(NodeTitleButton,__assign({onClick:function(){return onPageSelected(node.id);},disabled:isDocument,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):jsx$1(NodeTitle,__assign({bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0),jsx$1(StyledExternalLinkButton,{item:node},void 0),jsx$1(StyledDocumentDownloadButton$1,{page:node,basePath:basePath},void 0)]}),void 0),children.length>0&&jsx$1(ChildrenList,__assign({hide:hide},{children:children.map(function(c){return jsx$1("li",{children:jsx$1(PageNode,{hide:!showChildren,basePath:basePath,node:c,activePage:activePage,navigationContext:navigationContext,loadChildren:loadChildren,path:path,isRootNode:false,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id);})}),void 0)]},void 0);function getIconName(){var _a;if(!nodesContainNavigation&&!node.firstChildId||nodesContainNavigation&&!((_a=node.children)===null||_a===void 0?void 0:_a.length)){return null;}if(showChildren){return 'ChevronDown';}return 'ChevronRight';}function getChildren(nodeId){if(nodesContainNavigation){return node.children||[];}if((activePage===null||activePage===void 0?void 0:activePage.id)===nodeId){return navigationContext.children||[];}var result=navigationContext.parent;while(result!=null&&result.id!==nodeId){result=result.parent;}return result?result.children:[];}};var NodeWrapper=_styled.div.withConfig({displayName:"PageTocNode__NodeWrapper",componentId:"sc-1ftr1ym-0"})(templateObject_3$p||(templateObject_3$p=__makeTemplateObject(["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"],["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"])),function(p){return p.hide&&'display: none;';},function(p){return !p.isFirstLevel&&css$2(templateObject_1$T||(templateObject_1$T=__makeTemplateObject(["\n padding-left: ","px;\n margin-top: ","px;\n "],["\n padding-left: ","px;\n margin-top: ","px;\n "])),spacingS,spacingS+5);},function(p){return p.isActive&&css$2(templateObject_2$z||(templateObject_2$z=__makeTemplateObject(["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "])),function(p){return p.theme.palette.neutralQuaternaryAlt;});},spacingXs,minScreenSize.small);var IconNormalSize=20;var IconLargeSize=26;var IconBubbleStyle=function IconBubbleStyle(isHighlighted){return css$2(templateObject_6$8||(templateObject_6$8=__makeTemplateObject(["\n ",";\n "],["\n ",";\n "])),isHighlighted?css$2(templateObject_4$g||(templateObject_4$g=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.accent;},function(p){return p.theme.palette.white;}):css$2(templateObject_5$e||(templateObject_5$e=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.neutralQuaternary;},function(p){return p.theme.palette.black;}));};var StyledIconButton$3=_styled(IconButton$1).withConfig({displayName:"PageTocNode__StyledIconButton",componentId:"sc-1ftr1ym-1"})(templateObject_8$5||(templateObject_8$5=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"])),IconLargeSize,IconLargeSize,IconLargeSize,function(p){return p.isExpanded&&css$2(templateObject_7$5$1||(templateObject_7$5$1=__makeTemplateObject(["\n i {\n transform: translate(0, 1px);\n }\n "],["\n i {\n transform: translate(0, 1px);\n }\n "])));},function(p){return IconBubbleStyle(p.isHighlighted);},minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledIcon$3$1=_styled(Icon).withConfig({displayName:"PageTocNode__StyledIcon",componentId:"sc-1ftr1ym-2"})(templateObject_9$3||(templateObject_9$3=__makeTemplateObject(["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"],["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"])),IconLargeSize,IconLargeSize,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize,function(p){return IconBubbleStyle(p.isHighlighted);});var NodeTitleStyle=css$2(templateObject_11$1$1||(templateObject_11$1$1=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"],["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"])),spacingM,fontSizeNormal,function(p){return p.theme.textColors.default;},function(p){return p.bold&&css$2(templateObject_10$2$1||(templateObject_10$2$1=__makeTemplateObject(["\n font-weight: bold;\n "],["\n font-weight: bold;\n "])));},minScreenSize.small,fontSizeSmall);var NodeTitleLink=_styled(NavLink).withConfig({displayName:"PageTocNode__NodeTitleLink",componentId:"sc-1ftr1ym-3"})(templateObject_12$1$1||(templateObject_12$1$1=__makeTemplateObject(["\n ",";\n\n && {\n color: ",";\n }\n"],["\n ",";\n\n && {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.textColors.default;});var NodeTitleButton=_styled(ActionButton).withConfig({displayName:"PageTocNode__NodeTitleButton",componentId:"sc-1ftr1ym-4"})(templateObject_13$1$1||(templateObject_13$1$1=__makeTemplateObject(["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"],["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.palette.neutralQuaternary;});var NodeTitle=_styled.div.withConfig({displayName:"PageTocNode__NodeTitle",componentId:"sc-1ftr1ym-5"})(templateObject_14$1$1||(templateObject_14$1$1=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),NodeTitleStyle);var ChildrenList=_styled.ul.withConfig({displayName:"PageTocNode__ChildrenList",componentId:"sc-1ftr1ym-6"})(templateObject_15$1$1||(templateObject_15$1$1=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"])),function(p){return p.hide&&'display: none;';},spacingS);var StyledExternalLinkButton=_styled(ExternalPagesLinkButton).withConfig({displayName:"PageTocNode__StyledExternalLinkButton",componentId:"sc-1ftr1ym-7"})(templateObject_16$1$1||(templateObject_16$1$1=__makeTemplateObject(["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"])),spacingS,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledDocumentDownloadButton$1=_styled(DocumentDownloadButton).withConfig({displayName:"PageTocNode__StyledDocumentDownloadButton",componentId:"sc-1ftr1ym-8"})(templateObject_17$1||(templateObject_17$1=__makeTemplateObject(["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"])),IconLargeSize,spacingS-5,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var templateObject_1$T,templateObject_2$z,templateObject_3$p,templateObject_4$g,templateObject_5$e,templateObject_6$8,templateObject_7$5$1,templateObject_8$5,templateObject_9$3,templateObject_10$2$1,templateObject_11$1$1,templateObject_12$1$1,templateObject_13$1$1,templateObject_14$1$1,templateObject_15$1$1,templateObject_16$1$1,templateObject_17$1;var PageTableOfContents$1=function PageTableOfContents(_a){var basePath=_a.basePath,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onPageSelected=_a.onPageSelected,className=_a.className,selectedPageId=_a.selectedPageId,isLoading=_a.isLoading,disableScrollableList=_a.disableScrollableList;var user=useCurrentUser();var _b=getRootNodes(),rootNodes=_b.rootNodes,path=_b.path;var _c=useState$2(),searchResult=_c[0],setSearchResult=_c[1];if(isLoading){return jsx$1(Spinner,{},void 0);}if(!rootNodes||(rootNodes===null||rootNodes===void 0?void 0:rootNodes.length)===0){return jsx$1(FormattedMessageWithStyle,{id:"ContentEditor.parentPage.emptyToc",tagName:"div",className:className},void 0);}var activePage=activePageId&&navigationContext.siblings.find(function(p){return p.id===activePageId;});var nodesToDisplay=sortPageNodesByGroupAndPosition(user.groups,(searchResult||rootNodes).filter(function(p){return filterChildren(p,activePage);}));return jsx$1(Fragment,{children:jsxs("div",__assign({className:className},{children:[jsx$1("div",__assign({"data-toc-search-container":true},{children:jsx$1(PageTocSearch,{onSearch:onSearch,onSearchResultChange:setSearchResult},void 0)}),void 0),searchResult&&!searchResult.length&&jsx$1(TocEmptyList,{icon:"Search",emptyMessageResources:['EmptySearchResult.info']},void 0),nodesToDisplay&&jsx$1(TocListContainer,__assign({"data-toc-scrollable-container":true,isScrollable:!disableScrollableList},{children:jsx$1(TocList,{children:nodesToDisplay.map(function(c){return jsx$1(ToCItem,{children:jsx$1(PageNode,{basePath:basePath,node:c,activePage:activePage,navigationContext:searchResult?null:navigationContext,loadChildren:loadChildren,path:path,isRootNode:true,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id+!!searchResult);})},void 0)}),void 0)]}),void 0)},void 0);function getRootNodes(){if(!(navigationContext===null||navigationContext===void 0?void 0:navigationContext.parent)){return {rootNodes:(navigationContext===null||navigationContext===void 0?void 0:navigationContext.siblings)||[],path:[]};}var path=[];var currentParent=navigationContext.parent;while(currentParent!=null&¤tParent.parent!=null){path.push(currentParent.id);currentParent=currentParent.parent;}return {rootNodes:(currentParent===null||currentParent===void 0?void 0:currentParent.children)||[],path:path};}};var TocEmptyList=_styled(EmptyList).withConfig({displayName:"PageTableOfContents__TocEmptyList",componentId:"sc-3llzkd-0"})(templateObject_1$S||(templateObject_1$S=__makeTemplateObject(["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"],["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"])),fontSizeLarger+10);var TocListContainer=_styled.div.withConfig({displayName:"PageTableOfContents__TocListContainer",componentId:"sc-3llzkd-1"})(templateObject_3$o||(templateObject_3$o=__makeTemplateObject(["\n padding-top: ","px;\n\n ","\n"],["\n padding-top: ","px;\n\n ","\n"])),spacingXs,function(p){return p.isScrollable&&css$2(templateObject_2$y||(templateObject_2$y=__makeTemplateObject(["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "],["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "])));});var TocList=_styled.ul.withConfig({displayName:"PageTableOfContents__TocList",componentId:"sc-3llzkd-2"})(templateObject_4$f||(templateObject_4$f=__makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n"],["\n list-style: none;\n padding: 0;\n margin: 0;\n"])));var ToCItem=_styled.li.withConfig({displayName:"PageTableOfContents__ToCItem",componentId:"sc-3llzkd-3"})(templateObject_5$d||(templateObject_5$d=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);_styled(PageTableOfContents$1).withConfig({displayName:"PageTableOfContents__StyledPageToC",componentId:"sc-3llzkd-4"})(templateObject_6$7$1||(templateObject_6$7$1=__makeTemplateObject(["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"],["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"])),spacingM,spacingM,spacingM);var templateObject_1$S,templateObject_2$y,templateObject_3$o,templateObject_4$f,templateObject_5$d,templateObject_6$7$1;var PageTableOfContentsDialog=function PageTableOfContentsDialog(_a){var isOpen=_a.isOpen,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onDismiss=_a.onDismiss,basePath=_a.basePath;var formatMessage=useIntl().formatMessage;if(!navigationContext){return null;}return jsx$1(MobileFullHeightDialog,__assign({hidden:!isOpen,modalProps:{className:'dialog-toc'},dialogContentProps:{type:DialogType.close},onDismiss:onDismiss,title:formatMessage({id:'Pages.pagesTableOfContents'})},{children:jsxs(DialogContent,__assign({className:"dialog-content-host","data-toc-dialog":true},{children:[jsx$1(DialogGlobalStyle,{},void 0),jsx$1(PageTableOfContents$1,{basePath:basePath,activePageId:activePageId,navigationContext:navigationContext,loadChildren:loadChildren,onSearch:onSearch,onPageSelected:onDismiss,disableScrollableList:true},void 0)]}),void 0)}),void 0);};var DialogContent=_styled.div.withConfig({displayName:"PageTableOfContentsDialog__DialogContent",componentId:"sc-z2sdu7-0"})(templateObject_1$R||(templateObject_1$R=__makeTemplateObject(["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"],["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle=createGlobalStyle(templateObject_2$x||(templateObject_2$x=__makeTemplateObject(["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"],["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$R,templateObject_2$x;function useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType){var searchPublishedPages=usePagesApi().searchPublishedPages;return function(pageSize,token){return searchPublishedPages({keywords:keywords,token:token,pageSize:pageSize,pageType:showPagesAndDocuments?undefined:pageType});};}var InlinePageListByKeywords=function InlinePageListByKeywords(_a){var keywords=_a.keywords,showDocuments=_a.showDocuments,showPages=_a.showPages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showPagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var defaultPageSize=10;var keywordsAsString=keywords===null||keywords===void 0?void 0:keywords.join('-');var _b=useItemLoaderWithPreFetch(defaultPageSize,useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType),[keywordsAsString]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsx$1(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};function useLoadPublishedItemsByPageId(pageId,showPagesAndDocuments,pageType){var getSubpages=usePagesApi().getSubpages;try{return function(pageSize,token){return getSubpages(pageId,{pageType:showPagesAndDocuments?undefined:pageType,token:token,pageSize:pageSize});};}catch(error){logger.error(error);return null;}}var defaultPageSize$1=10;var InlinePageListByPageId=function InlinePageListByPageId(_a){var pageId=_a.pageId,showPages=_a.showPages,showDocuments=_a.showDocuments;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showSubpagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var _b=useItemLoaderWithPreFetch(defaultPageSize$1,useLoadPublishedItemsByPageId(pageId,showSubpagesAndDocuments,pageType),[pageId]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsx$1(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};var defaultPageSize=10;// the inline page list should be auto-added on a page with no content
|
|
131839
131839
|
// by default pages and documents should be shown
|
|
131840
131840
|
// for this case the blockProps would be an empty object and
|
|
131841
131841
|
// we need to set the showPages and showDocuments to true
|
|
@@ -131856,8 +131856,8 @@ if(typeof C=='function'&&(C===Array||isArray(C.prototype)))C=undefined;else if(i
|
|
|
131856
131856
|
// https://github.com/tc39/proposal-flatMap
|
|
131857
131857
|
$$h({target:'Array',proto:true},{flatMap:function flatMap(callbackfn/* , thisArg */){var O=toObject(this);var sourceLen=toLength$c(O.length);var A;aFunction(callbackfn);A=arraySpeciesCreate(O,0);A.length=flattenIntoArray(A,O,O,sourceLen,0,1,callbackfn,arguments.length>1?arguments[1]:undefined);return A;}});// this method was added to unscopables after implementation
|
|
131858
131858
|
// in popular engines, so it's moved to a separate module
|
|
131859
|
-
var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));function useStreamItemsQuery(query,searchText,defaultPageSize,doNotLoadOnEmpty){if(defaultPageSize===void 0){defaultPageSize=30;}var client=useApolloClient();var user=useCurrentUser();var handleFatalError=useContext(ErrorContext).handleFatalError;var channels=useContext(LazySubscriptionContext).channels;var location=useLocation$1();var isUnreadOnlyView=!!parseQuery(location.search).unreadOnly;var _a=useState$2([]),items=_a[0],setItems=_a[1];var _b=useState$2({hasNextPage:true,skip:0}),queryState=_b[0],setQueryState=_b[1];var hasChannelsLoaded=channels!=null;useEffect$1(function(){if(doNotLoadOnEmpty&&(!searchText||(searchText===null||searchText===void 0?void 0:searchText.length)===0)){setItems([]);setQueryState({hasNextPage:true,skip:0});return;}if(hasChannelsLoaded){loadInitial();}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131860
|
-
},[isUnreadOnlyView,hasChannelsLoaded,searchText,doNotLoadOnEmpty,query]);var refreshCallback=useCallback(loadInitial,[hasChannelsLoaded,searchText,query]);return {items:items,setItems:setItems,loadMore:loadMore,pageInfo:queryState,refresh:refreshCallback};function convertProperties(items){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywords(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(channels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i));});}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function queryStreamItems(take,skip){var _a,_b;if(skip===void 0){skip=0;}return __awaiter(this,void 0,void 0,function(){var variables,result;return __generator(this,function(_c){switch(_c.label){case 0:variables={take:take,skip:skip,unreadOnly:isUnreadOnlyView,searchText:searchText};return [4/*yield*/,client.query({query:query,fetchPolicy:'no-cache',variables:variables})];case 1:result=_c.sent();if(((_a=result===null||result===void 0?void 0:result.errors)===null||_a===void 0?void 0:_a.length)>0){logger.error(result.errors[0]);handleFatalError({error:result.errors[0]});}return [2/*return*/,{stream:(_b=result===null||result===void 0?void 0:result.data)===null||_b===void 0?void 0:_b.stream,errors:result===null||result===void 0?void 0:result.errors}];}});});}function loadInitial(){var _a,_b;return __awaiter(this,void 0,void 0,function(){var _c,result,errors;return __generator(this,function(_d){switch(_d.label){case 0:return [4/*yield*/,queryStreamItems(defaultPageSize,0)];case 1:_c=_d.sent(),result=_c.stream,errors=_c.errors;setQueryState({hasNextPage:(_a=result===null||result===void 0?void 0:result.pageInfo)===null||_a===void 0?void 0:_a.hasNextPage,skip:defaultPageSize,errors:errors});setItems(convertProperties((_b=result===null||result===void 0?void 0:result.items)!==null&&_b!==void 0?_b:[]));return [2/*return*/];}});});}function loadMore(){return __awaiter(this,void 0,void 0,function(){var _a,result,errors;return __generator(this,function(_b){switch(_b.label){case 0:if(!queryState.hasNextPage||!queryState.skip){return [2/*return*/];}return [4/*yield*/,queryStreamItems(defaultPageSize,queryState.skip)];case 1:_a=_b.sent(),result=_a.stream,errors=_a.errors;setQueryState(function(state){var _a;return {hasNextPage:(_a=result===null||result===void 0?void 0:result.pageInfo)===null||_a===void 0?void 0:_a.hasNextPage,skip:state.skip+defaultPageSize,errors:errors};});setItems(function(state){var _a;return __spreadArray(__spreadArray([],state),convertProperties((_a=result===null||result===void 0?void 0:result.items)!==null&&_a!==void 0?_a:[]));});return [2/*return*/];}});});}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}var CHANNELS_OR_CONDITION=function CHANNELS_OR_CONDITION(channels){if(!channels){return '';}return "channels: { some: { in: ["+channels+"] } }";};var KEYWORDS_OR_CONDITION=function KEYWORDS_OR_CONDITION(keywords){if(!keywords){return '';}return "keywordIds: { some: { in: ["+keywords+"] } }";};var NEWS_QUERY=function NEWS_QUERY(includeAllItems,whereConditions){if(whereConditions===void 0){whereConditions='';}return gql(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"],["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"])),includeAllItems,whereConditions);};gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_4$2$1||(templateObject_4$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_1$6$1,templateObject_3$2$1,templateObject_4$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=useRef$1();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsx$1(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsx$1(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxs(Options,{children:[props.allowSelection&&jsx$1(SelectedIconOption,{children:jsx$1(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsx$1(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsx$1(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsx$1(Avatar,{upn:item.owner.userPrincipalName,size:PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled.h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled(IconButton$1).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled.div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled.div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled.div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled(Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=css$2(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled(Link$4).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled.a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsx$1(Option,{children:status===WorkflowStatus.approved?jsx$1("img",{style:{width:'20px'},alt:""},void 0):jsx$1(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsx$1(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$5$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$s,templateObject_7$m,templateObject_8$k,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxs(Fragment,{children:[jsx$1(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsx$1(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsx$1(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled.div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$4$1,templateObject_2$3$1;var EventDates=_styled.div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled.div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled.div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$L||(templateObject_4$L=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled(EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$3$1,templateObject_2$2$1,templateObject_3$13,templateObject_4$L,templateObject_5$D;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsx$1(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsx$1(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-callout'},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled(CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$2$1||(templateObject_1$2$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled(PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$2$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
|
|
131859
|
+
var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));var StreamKnownNewsState;(function(StreamKnownNewsState){StreamKnownNewsState["Unconfirmed"]="UNCONFIRMED";StreamKnownNewsState["Alert"]="ALERT";})(StreamKnownNewsState||(StreamKnownNewsState={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isNews(item){return item.type===StreamItemTypes.News;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));function useStreamItemsQuery(query,searchText,defaultPageSize,doNotLoadOnEmpty){if(defaultPageSize===void 0){defaultPageSize=30;}var client=useApolloClient();var user=useCurrentUser();var handleFatalError=useContext(ErrorContext).handleFatalError;var channels=useContext(LazySubscriptionContext).channels;var location=useLocation$1();var isUnreadOnlyView=!!parseQuery(location.search).unreadOnly;var _a=useState$2([]),items=_a[0],setItems=_a[1];var _b=useState$2({hasNextPage:true,skip:0}),queryState=_b[0],setQueryState=_b[1];var hasChannelsLoaded=channels!=null;useEffect$1(function(){if(doNotLoadOnEmpty&&(!searchText||(searchText===null||searchText===void 0?void 0:searchText.length)===0)){setItems([]);setQueryState({hasNextPage:true,skip:0});return;}if(hasChannelsLoaded){loadInitial();}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131860
|
+
},[isUnreadOnlyView,hasChannelsLoaded,searchText,doNotLoadOnEmpty,query]);var refreshCallback=useCallback(loadInitial,[hasChannelsLoaded,searchText,query]);return {items:items,setItems:setItems,loadMore:loadMore,pageInfo:queryState,refresh:refreshCallback};function convertProperties(items){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywords(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(channels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i)),getKnownNewsState(i));});}function getKnownNewsState(item){var _a,_b;if(!isNews(item)){return {};}var state=KnownNewsState.None;if((_a=item.knownNewsState)===null||_a===void 0?void 0:_a.includes(StreamKnownNewsState.Alert)){state|=KnownNewsState.Alert;}if((_b=item.knownNewsState)===null||_b===void 0?void 0:_b.includes(StreamKnownNewsState.Unconfirmed)){state|=KnownNewsState.Unconfirmed;}return {knownState:state};}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function queryStreamItems(take,skip){var _a,_b;if(skip===void 0){skip=0;}return __awaiter(this,void 0,void 0,function(){var variables,result;return __generator(this,function(_c){switch(_c.label){case 0:variables={take:take,skip:skip,unreadOnly:isUnreadOnlyView,searchText:searchText};return [4/*yield*/,client.query({query:query,fetchPolicy:'no-cache',variables:variables})];case 1:result=_c.sent();if(((_a=result===null||result===void 0?void 0:result.errors)===null||_a===void 0?void 0:_a.length)>0){logger.error(result.errors[0]);handleFatalError({error:result.errors[0]});}return [2/*return*/,{stream:(_b=result===null||result===void 0?void 0:result.data)===null||_b===void 0?void 0:_b.stream,errors:result===null||result===void 0?void 0:result.errors}];}});});}function loadInitial(){var _a,_b;return __awaiter(this,void 0,void 0,function(){var _c,result,errors;return __generator(this,function(_d){switch(_d.label){case 0:return [4/*yield*/,queryStreamItems(defaultPageSize,0)];case 1:_c=_d.sent(),result=_c.stream,errors=_c.errors;setQueryState({hasNextPage:(_a=result===null||result===void 0?void 0:result.pageInfo)===null||_a===void 0?void 0:_a.hasNextPage,skip:defaultPageSize,errors:errors});setItems(convertProperties((_b=result===null||result===void 0?void 0:result.items)!==null&&_b!==void 0?_b:[]));return [2/*return*/];}});});}function loadMore(){return __awaiter(this,void 0,void 0,function(){var _a,result,errors;return __generator(this,function(_b){switch(_b.label){case 0:if(!queryState.hasNextPage||!queryState.skip){return [2/*return*/];}return [4/*yield*/,queryStreamItems(defaultPageSize,queryState.skip)];case 1:_a=_b.sent(),result=_a.stream,errors=_a.errors;setQueryState(function(state){var _a;return {hasNextPage:(_a=result===null||result===void 0?void 0:result.pageInfo)===null||_a===void 0?void 0:_a.hasNextPage,skip:state.skip+defaultPageSize,errors:errors};});setItems(function(state){var _a;return __spreadArray(__spreadArray([],state),convertProperties((_a=result===null||result===void 0?void 0:result.items)!==null&&_a!==void 0?_a:[]));});return [2/*return*/];}});});}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}var CHANNELS_OR_CONDITION=function CHANNELS_OR_CONDITION(channels){if(!channels){return '';}return "channels: { some: { in: ["+channels+"] } }";};var KEYWORDS_OR_CONDITION=function KEYWORDS_OR_CONDITION(keywords){if(!keywords){return '';}return "keywordIds: { some: { in: ["+keywords+"] } }";};var NEWS_QUERY=function NEWS_QUERY(includeAllItems,whereConditions){if(whereConditions===void 0){whereConditions='';}return gql(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"],["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"])),includeAllItems,whereConditions);};gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_4$2$1||(templateObject_4$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_1$6$1,templateObject_3$2$1,templateObject_4$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=useRef$1();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsx$1(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsx$1(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxs(Options,{children:[props.allowSelection&&jsx$1(SelectedIconOption,{children:jsx$1(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsx$1(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsx$1(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsx$1(Avatar,{upn:item.owner.userPrincipalName,size:PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled.h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled(IconButton$1).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled.div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled.div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled.div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled(Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=css$2(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled(Link$4).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled.a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsx$1(Option,{children:status===WorkflowStatus.approved?jsx$1("img",{style:{width:'20px'},alt:""},void 0):jsx$1(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsx$1(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$5$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$s,templateObject_7$m,templateObject_8$k,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxs(Fragment,{children:[jsx$1(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsx$1(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsx$1(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled.div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$4$1,templateObject_2$3$1;var EventDates=_styled.div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled.div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled.div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$L||(templateObject_4$L=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled(EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$3$1,templateObject_2$2$1,templateObject_3$13,templateObject_4$L,templateObject_5$D;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsx$1(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsx$1(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-callout'},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled(CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$2$1||(templateObject_1$2$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled(PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$2$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
|
|
131861
131861
|
return null;});}function deletePermanently(type,ids){var itemIds=ids.join(',');return api.custom("editor/"+type+"/recyclebin?"+queryString.stringify({itemIds:itemIds})).delete();}function bulkSetStatus(type,items){return api.custom("editor/"+type).patch(items).then(function(response){return response.body().map(function(item){return item.data();});});}function setStatus(type,itemId,status,leaseId){return __awaiter(this,void 0,void 0,function(){var path,response,ex_1;return __generator(this,function(_a){switch(_a.label){case 0:path="editor/"+type+"/"+itemId+"/status";if(leaseId!=null){path+='?'+queryString.stringify({leaseId:leaseId});}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,api.custom(path).put(status)];case 2:response=_a.sent();return [2/*return*/,response.body().data()];case 3:ex_1=_a.sent();throw ex_1.response.statusCode===409?{account:ex_1.response.data}:ex_1;case 4:return [2/*return*/];}});});}function removeLease(itemId,leaseId){return api.custom("editor/"+itemId+"/lease?"+queryString.stringify({leaseId:leaseId})).delete();}function keepLeaseAlive(itemId,leaseId,token,subscriptionId){var _this=this;var expireLeaseToken=token;// every 10 seconds
|
|
131862
131862
|
var timer=setInterval(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:// update the lease
|
|
131863
131863
|
return [4/*yield*/,api.custom("editor/"+itemId+"/lease").put({leaseId:leaseId})];case 1:// update the lease
|
|
@@ -132926,7 +132926,7 @@ var Intro$1 = _styled.p.withConfig({
|
|
|
132926
132926
|
var Title$3 = _styled.span.withConfig({
|
|
132927
132927
|
displayName: "NewsCompactCard__Title",
|
|
132928
132928
|
componentId: "sc-16ovog0-5"
|
|
132929
|
-
})(templateObject_7$
|
|
132929
|
+
})(templateObject_7$5 || (templateObject_7$5 = __makeTemplateObject$l(["\n ", "\n display: inline-block;\n max-width: 100%;\n"], ["\n ", "\n display: inline-block;\n max-width: 100%;\n"])), TextStyle);
|
|
132930
132930
|
|
|
132931
132931
|
var TitleWrapper$1 = _styled.a.withConfig({
|
|
132932
132932
|
displayName: "NewsCompactCard__TitleWrapper",
|
|
@@ -132995,7 +132995,7 @@ var BannerHost = _styled.div.withConfig({
|
|
|
132995
132995
|
});
|
|
132996
132996
|
});
|
|
132997
132997
|
|
|
132998
|
-
var templateObject_1$i, templateObject_2$a, templateObject_3$a, templateObject_4$9, templateObject_5$8, templateObject_6$7, templateObject_7$
|
|
132998
|
+
var templateObject_1$i, templateObject_2$a, templateObject_3$a, templateObject_4$9, templateObject_5$8, templateObject_6$7, templateObject_7$5, templateObject_8$4, templateObject_9$2, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$2, templateObject_16$1;
|
|
132999
132999
|
|
|
133000
133000
|
var EmptyNewsList = function EmptyNewsList() {
|
|
133001
133001
|
return jsxs(Host$a, {
|
|
@@ -133221,7 +133221,7 @@ var StyledIcon$2 = _styled(Icon).withConfig({
|
|
|
133221
133221
|
var CommentsCount = _styled.span.withConfig({
|
|
133222
133222
|
displayName: "NewsList__CommentsCount",
|
|
133223
133223
|
componentId: "sc-1d0bzx1-5"
|
|
133224
|
-
})(templateObject_7$
|
|
133224
|
+
})(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject$l(["\n padding-left: 5px;\n font-size: 0.9rem;\n"], ["\n padding-left: 5px;\n font-size: 0.9rem;\n"])));
|
|
133225
133225
|
|
|
133226
133226
|
var ErrorContainer$1 = _styled.p.withConfig({
|
|
133227
133227
|
displayName: "NewsList__ErrorContainer",
|
|
@@ -133230,7 +133230,7 @@ var ErrorContainer$1 = _styled.p.withConfig({
|
|
|
133230
133230
|
return p.theme.palette.red;
|
|
133231
133231
|
}, spacingM);
|
|
133232
133232
|
|
|
133233
|
-
var templateObject_1$g, templateObject_2$8, templateObject_3$8, templateObject_4$8, templateObject_5$7, templateObject_6$6, templateObject_7$
|
|
133233
|
+
var templateObject_1$g, templateObject_2$8, templateObject_3$8, templateObject_4$8, templateObject_5$7, templateObject_6$6, templateObject_7$4, templateObject_8$3;
|
|
133234
133234
|
|
|
133235
133235
|
var ManageChannels = function ManageChannels(_a) {
|
|
133236
133236
|
var className = _a.className;
|
|
@@ -133460,7 +133460,7 @@ var NotificationButton = _styled.div.withConfig({
|
|
|
133460
133460
|
var ChannelToggle = _styled(ToggleWithLabel).withConfig({
|
|
133461
133461
|
displayName: "ManageChannels__ChannelToggle",
|
|
133462
133462
|
componentId: "sc-yyoxfw-6"
|
|
133463
|
-
})(templateObject_7$
|
|
133463
|
+
})(templateObject_7$3 || (templateObject_7$3 = __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);
|
|
133464
133464
|
|
|
133465
133465
|
var StyledIconButton = _styled(IconButton$1).withConfig({
|
|
133466
133466
|
displayName: "ManageChannels__StyledIconButton",
|
|
@@ -133469,7 +133469,7 @@ var StyledIconButton = _styled(IconButton$1).withConfig({
|
|
|
133469
133469
|
return p.theme.textColors.default;
|
|
133470
133470
|
});
|
|
133471
133471
|
|
|
133472
|
-
var templateObject_1$f, templateObject_2$7, templateObject_3$7, templateObject_4$7, templateObject_5$6, templateObject_6$5, templateObject_7$
|
|
133472
|
+
var templateObject_1$f, templateObject_2$7, templateObject_3$7, templateObject_4$7, templateObject_5$6, templateObject_6$5, templateObject_7$3, templateObject_8$2;
|
|
133473
133473
|
|
|
133474
133474
|
var NewsGridCard = function NewsGridCard(_a) {
|
|
133475
133475
|
var _b;
|
|
@@ -133589,7 +133589,7 @@ var Content$1 = _styled.div(templateObject_4$6 || (templateObject_4$6 = __makeTe
|
|
|
133589
133589
|
});
|
|
133590
133590
|
var MetaInfo = _styled.div(templateObject_5$5 || (templateObject_5$5 = __makeTemplateObject$l(["\n font-size: ", "px;\n"], ["\n font-size: ", "px;\n"])), fontSizeSmall);
|
|
133591
133591
|
var DateAndIcon = _styled.div(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject$l(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
133592
|
-
var PublishingDate = _styled(DateTime)(templateObject_7$
|
|
133592
|
+
var PublishingDate = _styled(DateTime)(templateObject_7$2 || (templateObject_7$2 = __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"])));
|
|
133593
133593
|
var NewsCardIcon = _styled.div(templateObject_8$1 || (templateObject_8$1 = __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"])));
|
|
133594
133594
|
var StyledIcon$1 = _styled(Icon)(templateObject_9$1 || (templateObject_9$1 = __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) {
|
|
133595
133595
|
return p.backgroundColor;
|
|
@@ -133604,7 +133604,7 @@ var KeywordsWrapper = _styled.div(templateObject_14$1 || (templateObject_14$1 =
|
|
|
133604
133604
|
return p.theme.palette.neutralTertiary;
|
|
133605
133605
|
});
|
|
133606
133606
|
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);
|
|
133607
|
-
var templateObject_1$e, templateObject_2$6, templateObject_3$6, templateObject_4$6, templateObject_5$5, templateObject_6$4, templateObject_7$
|
|
133607
|
+
var templateObject_1$e, templateObject_2$6, templateObject_3$6, templateObject_4$6, templateObject_5$5, templateObject_6$4, templateObject_7$2, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;
|
|
133608
133608
|
|
|
133609
133609
|
var ErrorContainer = function ErrorContainer() {
|
|
133610
133610
|
return jsx$1(Host$6, {
|
|
@@ -133868,7 +133868,7 @@ var HeroSlide = function HeroSlide(_a) {
|
|
|
133868
133868
|
var Host$4 = _styled.div.withConfig({
|
|
133869
133869
|
displayName: "HeroSlide__Host",
|
|
133870
133870
|
componentId: "sc-3yofth-0"
|
|
133871
|
-
})(templateObject_7 || (templateObject_7 = __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) {
|
|
133871
|
+
})(templateObject_7$1 || (templateObject_7$1 = __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) {
|
|
133872
133872
|
return p.width ? css$2(templateObject_1$b || (templateObject_1$b = __makeTemplateObject$l(["\n width: ", ";\n "], ["\n width: ", ";\n "])), p.width) : css$2(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject$l(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
|
|
133873
133873
|
}, function (p) {
|
|
133874
133874
|
return p.height ? css$2(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject$l(["\n height: ", ";\n "], ["\n height: ", ";\n "])), p.height) : css$2(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject$l(["\n height: 100%;\n "], ["\n height: 100%;\n "])));
|
|
@@ -133989,7 +133989,7 @@ var StyledDateTime = _styled(DateTime).withConfig({
|
|
|
133989
133989
|
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);
|
|
133990
133990
|
});
|
|
133991
133991
|
|
|
133992
|
-
var templateObject_1$b, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$3, templateObject_6$3, templateObject_7, templateObject_8, templateObject_9, templateObject_10, 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;
|
|
133992
|
+
var templateObject_1$b, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$3, templateObject_6$3, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10, 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;
|
|
133993
133993
|
|
|
133994
133994
|
var HeroPaging = function HeroPaging(_a) {
|
|
133995
133995
|
var items = _a.items,
|
|
@@ -134995,13 +134995,21 @@ var FilterContextProvider = function FilterContextProvider(_a) {
|
|
|
134995
134995
|
var ToolbarFilterPanel = function ToolbarFilterPanel(_a) {
|
|
134996
134996
|
var filter = _a.filter,
|
|
134997
134997
|
onChange = _a.onChange,
|
|
134998
|
-
children = _a.children
|
|
134998
|
+
children = _a.children,
|
|
134999
|
+
hideClearAllFiltersButton = _a.hideClearAllFiltersButton;
|
|
134999
135000
|
return jsx$1(FilterContextProvider, __assign$g({
|
|
135000
135001
|
filter: filter,
|
|
135001
135002
|
onChange: onChange
|
|
135002
135003
|
}, {
|
|
135003
|
-
children:
|
|
135004
|
-
children: children
|
|
135004
|
+
children: jsxs(Host$1, {
|
|
135005
|
+
children: [children, !hideClearAllFiltersButton && jsx$1(IconButton, {
|
|
135006
|
+
iconProps: {
|
|
135007
|
+
iconName: 'ChromeClose'
|
|
135008
|
+
},
|
|
135009
|
+
onClick: function () {
|
|
135010
|
+
return onChange(null);
|
|
135011
|
+
}
|
|
135012
|
+
}, void 0)]
|
|
135005
135013
|
}, void 0)
|
|
135006
135014
|
}), void 0);
|
|
135007
135015
|
};
|
|
@@ -135009,7 +135017,7 @@ var ToolbarFilterPanel = function ToolbarFilterPanel(_a) {
|
|
|
135009
135017
|
var Host$1 = _styled.div.withConfig({
|
|
135010
135018
|
displayName: "ToolbarFilterPanel__Host",
|
|
135011
135019
|
componentId: "sc-118p488-0"
|
|
135012
|
-
})(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject$l([""], [""])));
|
|
135020
|
+
})(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject$l(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
135013
135021
|
|
|
135014
135022
|
var templateObject_1$1;
|
|
135015
135023
|
|
|
@@ -135030,6 +135038,10 @@ var ChannelFilter = function ChannelFilter(_a) {
|
|
|
135030
135038
|
showChannels = _f[0],
|
|
135031
135039
|
setShowChannels = _f[1];
|
|
135032
135040
|
|
|
135041
|
+
var _g = useState$2(''),
|
|
135042
|
+
channelSearchTerm = _g[0],
|
|
135043
|
+
setChannelSearchTerm = _g[1];
|
|
135044
|
+
|
|
135033
135045
|
var availableChannels = (_b = channels === null || channels === void 0 ? void 0 : channels.map(function (c) {
|
|
135034
135046
|
return allChannels.find(function (channel) {
|
|
135035
135047
|
return channel.name === c;
|
|
@@ -135072,8 +135084,22 @@ var ChannelFilter = function ChannelFilter(_a) {
|
|
|
135072
135084
|
}
|
|
135073
135085
|
}, {
|
|
135074
135086
|
children: jsxs(Host, {
|
|
135075
|
-
children: [jsx$1(
|
|
135076
|
-
|
|
135087
|
+
children: [jsx$1(StyledTextField, {
|
|
135088
|
+
placeholder: formatMessage({
|
|
135089
|
+
id: 'Generic.search'
|
|
135090
|
+
}),
|
|
135091
|
+
iconProps: {
|
|
135092
|
+
iconName: 'Search'
|
|
135093
|
+
},
|
|
135094
|
+
onChange: function (_, value) {
|
|
135095
|
+
return setChannelSearchTerm(value.toLowerCase());
|
|
135096
|
+
}
|
|
135097
|
+
}, void 0), jsx$1(Channels, {
|
|
135098
|
+
children: availableChannels.filter(function (c) {
|
|
135099
|
+
var _a;
|
|
135100
|
+
|
|
135101
|
+
return (_a = getChannelDisplayName(availableChannels, c, user)) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(channelSearchTerm);
|
|
135102
|
+
}).map(function (c) {
|
|
135077
135103
|
var checked = isChannelSelected(c);
|
|
135078
135104
|
return jsx$1(StyledCheckbox, {
|
|
135079
135105
|
onRenderLabel: function () {
|
|
@@ -135154,6 +135180,11 @@ var ClearFilterButton = _styled(DefaultButton).withConfig({
|
|
|
135154
135180
|
componentId: "sc-1ju8xwz-5"
|
|
135155
135181
|
})(templateObject_6 || (templateObject_6 = __makeTemplateObject$l(["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"], ["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"])));
|
|
135156
135182
|
|
|
135157
|
-
var
|
|
135183
|
+
var StyledTextField = _styled(TextField).withConfig({
|
|
135184
|
+
displayName: "ChannelFilter__StyledTextField",
|
|
135185
|
+
componentId: "sc-1ju8xwz-6"
|
|
135186
|
+
})(templateObject_7 || (templateObject_7 = __makeTemplateObject$l(["\n padding-bottom: ", "px;\n"], ["\n padding-bottom: ", "px;\n"])), spacingS);
|
|
135187
|
+
|
|
135188
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
135158
135189
|
|
|
135159
135190
|
export { Avatar as A, ChannelFilter as C, EventDetail as E, ItemLayoutMode as I, ManageChannels as M, NewsDetail as N, PropTypes$2 as P, ReachContextProvider as R, ThemeContext$1 as T, UserDetails as U, _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
|
@@ -81737,7 +81737,7 @@
|
|
|
81737
81737
|
displayName: "FileAttachmentList__Inner",
|
|
81738
81738
|
componentId: "sc-lwztxx-6"
|
|
81739
81739
|
})(templateObject_9$4$1 || (templateObject_9$4$1 = __makeTemplateObject$1(["\n display: inline-flex;\n\n ", "\n"], ["\n display: inline-flex;\n\n ", "\n"])), function (p) {
|
|
81740
|
-
return p.takeFullWidth ? _styled.css(templateObject_7$5$
|
|
81740
|
+
return p.takeFullWidth ? _styled.css(templateObject_7$5$2 || (templateObject_7$5$2 = __makeTemplateObject$1(["\n width: 100%;\n "], ["\n width: 100%;\n "]))) : _styled.css(templateObject_8$5$1 || (templateObject_8$5$1 = __makeTemplateObject$1(["\n width: calc(100% - 34px); // delete button size;\n "], ["\n width: calc(100% - 34px); // delete button size;\n "])));
|
|
81741
81741
|
});
|
|
81742
81742
|
|
|
81743
81743
|
var FileNameContainer = _styled__default["default"].span.withConfig({
|
|
@@ -81779,7 +81779,7 @@
|
|
|
81779
81779
|
return p.theme.palette.redDark;
|
|
81780
81780
|
});
|
|
81781
81781
|
|
|
81782
|
-
var templateObject_1$R$1, templateObject_2$y$1, templateObject_3$o$1, templateObject_4$g$1, templateObject_5$b$1, templateObject_6$9$1, templateObject_7$5$
|
|
81782
|
+
var templateObject_1$R$1, templateObject_2$y$1, templateObject_3$o$1, templateObject_4$g$1, templateObject_5$b$1, templateObject_6$9$1, templateObject_7$5$2, templateObject_8$5$1, templateObject_9$4$1, templateObject_10$1$2, templateObject_11$1$2, templateObject_12$8, templateObject_13$7, templateObject_14$7, templateObject_15$7, templateObject_16$7;
|
|
81783
81783
|
var FabNavigationPosition;
|
|
81784
81784
|
|
|
81785
81785
|
(function (FabNavigationPosition) {
|
|
@@ -82647,7 +82647,7 @@
|
|
|
82647
82647
|
className: classNames('search-field', props.className),
|
|
82648
82648
|
useLightTheme: props.useLightTheme
|
|
82649
82649
|
}, {
|
|
82650
|
-
children: [jsxRuntime.jsx(StyledTextField, {
|
|
82650
|
+
children: [jsxRuntime.jsx(StyledTextField$1, {
|
|
82651
82651
|
className: "search-input",
|
|
82652
82652
|
useLightTheme: props.useLightTheme,
|
|
82653
82653
|
default: true,
|
|
@@ -82708,7 +82708,7 @@
|
|
|
82708
82708
|
}
|
|
82709
82709
|
};
|
|
82710
82710
|
|
|
82711
|
-
var StyledTextField = _styled__default["default"](officeUiFabricReact.TextField).withConfig({
|
|
82711
|
+
var StyledTextField$1 = _styled__default["default"](officeUiFabricReact.TextField).withConfig({
|
|
82712
82712
|
displayName: "Search__StyledTextField",
|
|
82713
82713
|
componentId: "sc-17f35gt-0"
|
|
82714
82714
|
})(templateObject_3$j$1 || (templateObject_3$j$1 = __makeTemplateObject$1(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
@@ -87330,9 +87330,9 @@
|
|
|
87330
87330
|
}), void 0);
|
|
87331
87331
|
};
|
|
87332
87332
|
|
|
87333
|
-
var version$1 = "0.4.0-preview.
|
|
87334
|
-
var buildId = "
|
|
87335
|
-
var commitId = "
|
|
87333
|
+
var version$1 = "0.4.0-preview.211";
|
|
87334
|
+
var buildId = "98387";
|
|
87335
|
+
var commitId = "4ace7b7b15e3e3894d78df895eb99b1c395eaac6";
|
|
87336
87336
|
var isCustomerBuild = false;
|
|
87337
87337
|
var buildInfo = {
|
|
87338
87338
|
version: version$1,
|
|
@@ -131709,7 +131709,7 @@
|
|
|
131709
131709
|
// we don't want to add the same node again, instead we just need to
|
|
131710
131710
|
// append the children of the node
|
|
131711
131711
|
// we also know then that we don't have to traverse the tree further up and can stop
|
|
131712
|
-
var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===page.id){existingNode.isSearchMatch=true;}ensureChildren.apply(void 0,__spreadArray([existingNode],node.children||[]));break;}allNodesById[node.id]=node;if(!((_a=node.parent)===null||_a===void 0?void 0:_a.id)){break;}ensureChildren(node.parent,node);node=node.parent;}});onSearchResultChange(Object.values(allNodesById).filter(function(n){var _a;return !((_a=n.parent)===null||_a===void 0?void 0:_a.id);}));return [2/*return*/];}});});}function ensureChildren(parent){var _a;var children=[];for(var _i=1;_i<arguments.length;_i++){children[_i-1]=arguments[_i];}if(!parent.children){parent.children=[];}parent.children=parent.children.concat(children).sort(function(a,b){return a.position-b.position;});parent.firstChildId=(_a=parent.children[0])===null||_a===void 0?void 0:_a.id;}};var StyledSearchBox=_styled__default["default"](officeUiFabricReact.SearchBox).withConfig({displayName:"PageTocSearch__StyledSearchBox",componentId:"sc-1enxv6b-0"})(templateObject_1$V||(templateObject_1$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);var templateObject_1$V;function filterChildren(page,activePage){if(!activePage){return true;}if(activePage.status===WorkflowStatus.deleted){return page.status===WorkflowStatus.deleted;}return page.status!==WorkflowStatus.deleted&&activePage.isUnlinked===page.isUnlinked;}var ExternalPagesLinkButton=function ExternalPagesLinkButton(_a){var item=_a.item,disabled=_a.disabled,onClick=_a.onClick,className=_a.className;var user=useCurrentUser();var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;if(!item.useExternalContent){return null;}var resourceKey="ExternalLinkButton.pages"+(!url?'.noUrl':'')+".navigateTo";return jsxRuntime.jsx(Tooltip,__assign({className:className,resourceKey:resourceKey,values:url?{url:url}:undefined,width:url?400:undefined},{children:jsxRuntime.jsx(StyledIconButton$4,{iconProps:{iconName:'NavigateExternalInline',styles:{root:{fontSize:fontSizeMedium+4+"px",height:fontSizeMedium+4+"px"}}},onClick:handleClick,disabled:disabled,"aria-label":formatMessage({id:resourceKey},url?{url:url}:undefined)},void 0)}),void 0);function handleClick(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(onClick){onClick(e);return [2/*return*/];}createPageClickHandler(item)(e);return [2/*return*/];});});}};var StyledIconButton$4=_styled__default["default"](IconButton).withConfig({displayName:"ExternalPagesLinkButton__StyledIconButton",componentId:"sc-1n1ybv7-0"})(templateObject_1$U||(templateObject_1$U=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$U;var PageNode=function PageNode(_a){var node=_a.node,activePage=_a.activePage,navigationContext=_a.navigationContext,loadChildren=_a.loadChildren,basePath=_a.basePath,path=_a.path,className=_a.className,isRootNode=_a.isRootNode,hide=_a.hide,onPageSelected=_a.onPageSelected,selectedPageId=_a.selectedPageId;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var nodesContainNavigation=navigationContext==null;var _b=React$d.useState(null),lazyLoadedChildren=_b[0],setLazyLoadedChildren=_b[1];var children=lazyLoadedChildren||getChildren(node.id).filter(function(n){return filterChildren(n,activePage);});var _c=React$d.useState(undefined),forceShowChildren=_c[0],setForceShowChildren=_c[1];var showChildren=forceShowChildren||children&&forceShowChildren!==false&&(nodesContainNavigation||path.some(function(p){return p===node.id;})||(activePage===null||activePage===void 0?void 0:activePage.id)===node.id);var title=getTitle(node,user,formatMessage);var isSelectedPageNode=(activePage===null||activePage===void 0?void 0:activePage.id)===node.id||selectedPageId===node.id;var iconName=getIconName();var isExpanded=iconName==='ChevronDown';var isHighlighted=isSelectedPageNode||path.some(function(p){return p===node.id;});var appBasePath=basePath?buildPath(basePath):null;var isSearchMatch=node.isSearchMatch?'true':null;var isDocument=node.pageType===PageType.Document;var detailViewUrl=""+NewsService.getNewsRoute(appBasePath,node.id,title)+(node.useExternalContent?"?"+queryString.stringify({noRedirect:true}):'');return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(NodeWrapper,__assign({isFirstLevel:isRootNode,hide:hide,className:className,isActive:isSelectedPageNode,"data-page-toc-node":true,"data-is-active":isSelectedPageNode},{children:[!!iconName?jsxRuntime.jsx(StyledIconButton$3,{iconProps:{iconName:iconName},onClick:function(){return __awaiter(void 0,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(!!(children===null||children===void 0?void 0:children.length))return [3/*break*/,2];_a=setLazyLoadedChildren;return [4/*yield*/,loadChildren(node.id)];case 1:_a.apply(void 0,[_b.sent()]);_b.label=2;case 2:setForceShowChildren(!showChildren);return [2/*return*/];}});});},isHighlighted:isHighlighted,isExpanded:isExpanded,ariaLabel:formatMessage({id:isExpanded?'AriaLabel.hideChildren':'AriaLabel.seeChildren'}),"data-toc-node-toggle-children":node.id},void 0):jsxRuntime.jsx(StyledIcon$3$1,{isHighlighted:isHighlighted},void 0),basePath?jsxRuntime.jsx(NodeTitleLink,__assign({onClick:createPageClickHandler(node,basePath,function(){return onPageSelected===null||onPageSelected===void 0?void 0:onPageSelected(node.id);},true),to:detailViewUrl,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):onPageSelected?jsxRuntime.jsx(NodeTitleButton,__assign({onClick:function(){return onPageSelected(node.id);},disabled:isDocument,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):jsxRuntime.jsx(NodeTitle,__assign({bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0),jsxRuntime.jsx(StyledExternalLinkButton,{item:node},void 0),jsxRuntime.jsx(StyledDocumentDownloadButton$1,{page:node,basePath:basePath},void 0)]}),void 0),children.length>0&&jsxRuntime.jsx(ChildrenList,__assign({hide:hide},{children:children.map(function(c){return jsxRuntime.jsx("li",{children:jsxRuntime.jsx(PageNode,{hide:!showChildren,basePath:basePath,node:c,activePage:activePage,navigationContext:navigationContext,loadChildren:loadChildren,path:path,isRootNode:false,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id);})}),void 0)]},void 0);function getIconName(){var _a;if(!nodesContainNavigation&&!node.firstChildId||nodesContainNavigation&&!((_a=node.children)===null||_a===void 0?void 0:_a.length)){return null;}if(showChildren){return 'ChevronDown';}return 'ChevronRight';}function getChildren(nodeId){if(nodesContainNavigation){return node.children||[];}if((activePage===null||activePage===void 0?void 0:activePage.id)===nodeId){return navigationContext.children||[];}var result=navigationContext.parent;while(result!=null&&result.id!==nodeId){result=result.parent;}return result?result.children:[];}};var NodeWrapper=_styled__default["default"].div.withConfig({displayName:"PageTocNode__NodeWrapper",componentId:"sc-1ftr1ym-0"})(templateObject_3$p||(templateObject_3$p=__makeTemplateObject(["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"],["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"])),function(p){return p.hide&&'display: none;';},function(p){return !p.isFirstLevel&&_styled.css(templateObject_1$T||(templateObject_1$T=__makeTemplateObject(["\n padding-left: ","px;\n margin-top: ","px;\n "],["\n padding-left: ","px;\n margin-top: ","px;\n "])),spacingS,spacingS+5);},function(p){return p.isActive&&_styled.css(templateObject_2$z||(templateObject_2$z=__makeTemplateObject(["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "])),function(p){return p.theme.palette.neutralQuaternaryAlt;});},spacingXs,minScreenSize.small);var IconNormalSize=20;var IconLargeSize=26;var IconBubbleStyle=function IconBubbleStyle(isHighlighted){return _styled.css(templateObject_6$8||(templateObject_6$8=__makeTemplateObject(["\n ",";\n "],["\n ",";\n "])),isHighlighted?_styled.css(templateObject_4$g||(templateObject_4$g=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.accent;},function(p){return p.theme.palette.white;}):_styled.css(templateObject_5$e||(templateObject_5$e=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.neutralQuaternary;},function(p){return p.theme.palette.black;}));};var StyledIconButton$3=_styled__default["default"](officeUiFabricReact.IconButton).withConfig({displayName:"PageTocNode__StyledIconButton",componentId:"sc-1ftr1ym-1"})(templateObject_8$5||(templateObject_8$5=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"])),IconLargeSize,IconLargeSize,IconLargeSize,function(p){return p.isExpanded&&_styled.css(templateObject_7$5||(templateObject_7$5=__makeTemplateObject(["\n i {\n transform: translate(0, 1px);\n }\n "],["\n i {\n transform: translate(0, 1px);\n }\n "])));},function(p){return IconBubbleStyle(p.isHighlighted);},minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledIcon$3$1=_styled__default["default"](officeUiFabricReact.Icon).withConfig({displayName:"PageTocNode__StyledIcon",componentId:"sc-1ftr1ym-2"})(templateObject_9$3||(templateObject_9$3=__makeTemplateObject(["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"],["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"])),IconLargeSize,IconLargeSize,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize,function(p){return IconBubbleStyle(p.isHighlighted);});var NodeTitleStyle=_styled.css(templateObject_11$1$1||(templateObject_11$1$1=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"],["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"])),spacingM,fontSizeNormal,function(p){return p.theme.textColors.default;},function(p){return p.bold&&_styled.css(templateObject_10$2$1||(templateObject_10$2$1=__makeTemplateObject(["\n font-weight: bold;\n "],["\n font-weight: bold;\n "])));},minScreenSize.small,fontSizeSmall);var NodeTitleLink=_styled__default["default"](ReactRouterDom.NavLink).withConfig({displayName:"PageTocNode__NodeTitleLink",componentId:"sc-1ftr1ym-3"})(templateObject_12$1$1||(templateObject_12$1$1=__makeTemplateObject(["\n ",";\n\n && {\n color: ",";\n }\n"],["\n ",";\n\n && {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.textColors.default;});var NodeTitleButton=_styled__default["default"](ActionButton).withConfig({displayName:"PageTocNode__NodeTitleButton",componentId:"sc-1ftr1ym-4"})(templateObject_13$1$1||(templateObject_13$1$1=__makeTemplateObject(["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"],["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.palette.neutralQuaternary;});var NodeTitle=_styled__default["default"].div.withConfig({displayName:"PageTocNode__NodeTitle",componentId:"sc-1ftr1ym-5"})(templateObject_14$1$1||(templateObject_14$1$1=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),NodeTitleStyle);var ChildrenList=_styled__default["default"].ul.withConfig({displayName:"PageTocNode__ChildrenList",componentId:"sc-1ftr1ym-6"})(templateObject_15$1$1||(templateObject_15$1$1=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"])),function(p){return p.hide&&'display: none;';},spacingS);var StyledExternalLinkButton=_styled__default["default"](ExternalPagesLinkButton).withConfig({displayName:"PageTocNode__StyledExternalLinkButton",componentId:"sc-1ftr1ym-7"})(templateObject_16$1$1||(templateObject_16$1$1=__makeTemplateObject(["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"])),spacingS,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledDocumentDownloadButton$1=_styled__default["default"](DocumentDownloadButton).withConfig({displayName:"PageTocNode__StyledDocumentDownloadButton",componentId:"sc-1ftr1ym-8"})(templateObject_17$1||(templateObject_17$1=__makeTemplateObject(["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"])),IconLargeSize,spacingS-5,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var templateObject_1$T,templateObject_2$z,templateObject_3$p,templateObject_4$g,templateObject_5$e,templateObject_6$8,templateObject_7$5,templateObject_8$5,templateObject_9$3,templateObject_10$2$1,templateObject_11$1$1,templateObject_12$1$1,templateObject_13$1$1,templateObject_14$1$1,templateObject_15$1$1,templateObject_16$1$1,templateObject_17$1;var PageTableOfContents$1=function PageTableOfContents(_a){var basePath=_a.basePath,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onPageSelected=_a.onPageSelected,className=_a.className,selectedPageId=_a.selectedPageId,isLoading=_a.isLoading,disableScrollableList=_a.disableScrollableList;var user=useCurrentUser();var _b=getRootNodes(),rootNodes=_b.rootNodes,path=_b.path;var _c=React$d.useState(),searchResult=_c[0],setSearchResult=_c[1];if(isLoading){return jsxRuntime.jsx(Spinner,{},void 0);}if(!rootNodes||(rootNodes===null||rootNodes===void 0?void 0:rootNodes.length)===0){return jsxRuntime.jsx(FormattedMessageWithStyle,{id:"ContentEditor.parentPage.emptyToc",tagName:"div",className:className},void 0);}var activePage=activePageId&&navigationContext.siblings.find(function(p){return p.id===activePageId;});var nodesToDisplay=sortPageNodesByGroupAndPosition(user.groups,(searchResult||rootNodes).filter(function(p){return filterChildren(p,activePage);}));return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",__assign({className:className},{children:[jsxRuntime.jsx("div",__assign({"data-toc-search-container":true},{children:jsxRuntime.jsx(PageTocSearch,{onSearch:onSearch,onSearchResultChange:setSearchResult},void 0)}),void 0),searchResult&&!searchResult.length&&jsxRuntime.jsx(TocEmptyList,{icon:"Search",emptyMessageResources:['EmptySearchResult.info']},void 0),nodesToDisplay&&jsxRuntime.jsx(TocListContainer,__assign({"data-toc-scrollable-container":true,isScrollable:!disableScrollableList},{children:jsxRuntime.jsx(TocList,{children:nodesToDisplay.map(function(c){return jsxRuntime.jsx(ToCItem,{children:jsxRuntime.jsx(PageNode,{basePath:basePath,node:c,activePage:activePage,navigationContext:searchResult?null:navigationContext,loadChildren:loadChildren,path:path,isRootNode:true,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id+!!searchResult);})},void 0)}),void 0)]}),void 0)},void 0);function getRootNodes(){if(!(navigationContext===null||navigationContext===void 0?void 0:navigationContext.parent)){return {rootNodes:(navigationContext===null||navigationContext===void 0?void 0:navigationContext.siblings)||[],path:[]};}var path=[];var currentParent=navigationContext.parent;while(currentParent!=null&¤tParent.parent!=null){path.push(currentParent.id);currentParent=currentParent.parent;}return {rootNodes:(currentParent===null||currentParent===void 0?void 0:currentParent.children)||[],path:path};}};var TocEmptyList=_styled__default["default"](EmptyList).withConfig({displayName:"PageTableOfContents__TocEmptyList",componentId:"sc-3llzkd-0"})(templateObject_1$S||(templateObject_1$S=__makeTemplateObject(["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"],["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"])),fontSizeLarger+10);var TocListContainer=_styled__default["default"].div.withConfig({displayName:"PageTableOfContents__TocListContainer",componentId:"sc-3llzkd-1"})(templateObject_3$o||(templateObject_3$o=__makeTemplateObject(["\n padding-top: ","px;\n\n ","\n"],["\n padding-top: ","px;\n\n ","\n"])),spacingXs,function(p){return p.isScrollable&&_styled.css(templateObject_2$y||(templateObject_2$y=__makeTemplateObject(["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "],["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "])));});var TocList=_styled__default["default"].ul.withConfig({displayName:"PageTableOfContents__TocList",componentId:"sc-3llzkd-2"})(templateObject_4$f||(templateObject_4$f=__makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n"],["\n list-style: none;\n padding: 0;\n margin: 0;\n"])));var ToCItem=_styled__default["default"].li.withConfig({displayName:"PageTableOfContents__ToCItem",componentId:"sc-3llzkd-3"})(templateObject_5$d||(templateObject_5$d=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);_styled__default["default"](PageTableOfContents$1).withConfig({displayName:"PageTableOfContents__StyledPageToC",componentId:"sc-3llzkd-4"})(templateObject_6$7$1||(templateObject_6$7$1=__makeTemplateObject(["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"],["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"])),spacingM,spacingM,spacingM);var templateObject_1$S,templateObject_2$y,templateObject_3$o,templateObject_4$f,templateObject_5$d,templateObject_6$7$1;var PageTableOfContentsDialog=function PageTableOfContentsDialog(_a){var isOpen=_a.isOpen,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onDismiss=_a.onDismiss,basePath=_a.basePath;var formatMessage=useIntl().formatMessage;if(!navigationContext){return null;}return jsxRuntime.jsx(MobileFullHeightDialog,__assign({hidden:!isOpen,modalProps:{className:'dialog-toc'},dialogContentProps:{type:officeUiFabricReact.DialogType.close},onDismiss:onDismiss,title:formatMessage({id:'Pages.pagesTableOfContents'})},{children:jsxRuntime.jsxs(DialogContent,__assign({className:"dialog-content-host","data-toc-dialog":true},{children:[jsxRuntime.jsx(DialogGlobalStyle,{},void 0),jsxRuntime.jsx(PageTableOfContents$1,{basePath:basePath,activePageId:activePageId,navigationContext:navigationContext,loadChildren:loadChildren,onSearch:onSearch,onPageSelected:onDismiss,disableScrollableList:true},void 0)]}),void 0)}),void 0);};var DialogContent=_styled__default["default"].div.withConfig({displayName:"PageTableOfContentsDialog__DialogContent",componentId:"sc-z2sdu7-0"})(templateObject_1$R||(templateObject_1$R=__makeTemplateObject(["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"],["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle=_styled.createGlobalStyle(templateObject_2$x||(templateObject_2$x=__makeTemplateObject(["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"],["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$R,templateObject_2$x;function useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType){var searchPublishedPages=usePagesApi().searchPublishedPages;return function(pageSize,token){return searchPublishedPages({keywords:keywords,token:token,pageSize:pageSize,pageType:showPagesAndDocuments?undefined:pageType});};}var InlinePageListByKeywords=function InlinePageListByKeywords(_a){var keywords=_a.keywords,showDocuments=_a.showDocuments,showPages=_a.showPages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showPagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var defaultPageSize=10;var keywordsAsString=keywords===null||keywords===void 0?void 0:keywords.join('-');var _b=useItemLoaderWithPreFetch(defaultPageSize,useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType),[keywordsAsString]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsxRuntime.jsx(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsxRuntime.jsx(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};function useLoadPublishedItemsByPageId(pageId,showPagesAndDocuments,pageType){var getSubpages=usePagesApi().getSubpages;try{return function(pageSize,token){return getSubpages(pageId,{pageType:showPagesAndDocuments?undefined:pageType,token:token,pageSize:pageSize});};}catch(error){logger.error(error);return null;}}var defaultPageSize$1=10;var InlinePageListByPageId=function InlinePageListByPageId(_a){var pageId=_a.pageId,showPages=_a.showPages,showDocuments=_a.showDocuments;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showSubpagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var _b=useItemLoaderWithPreFetch(defaultPageSize$1,useLoadPublishedItemsByPageId(pageId,showSubpagesAndDocuments,pageType),[pageId]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsxRuntime.jsx(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsxRuntime.jsx(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};var defaultPageSize=10;// the inline page list should be auto-added on a page with no content
|
|
131712
|
+
var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===page.id){existingNode.isSearchMatch=true;}ensureChildren.apply(void 0,__spreadArray([existingNode],node.children||[]));break;}allNodesById[node.id]=node;if(!((_a=node.parent)===null||_a===void 0?void 0:_a.id)){break;}ensureChildren(node.parent,node);node=node.parent;}});onSearchResultChange(Object.values(allNodesById).filter(function(n){var _a;return !((_a=n.parent)===null||_a===void 0?void 0:_a.id);}));return [2/*return*/];}});});}function ensureChildren(parent){var _a;var children=[];for(var _i=1;_i<arguments.length;_i++){children[_i-1]=arguments[_i];}if(!parent.children){parent.children=[];}parent.children=parent.children.concat(children).sort(function(a,b){return a.position-b.position;});parent.firstChildId=(_a=parent.children[0])===null||_a===void 0?void 0:_a.id;}};var StyledSearchBox=_styled__default["default"](officeUiFabricReact.SearchBox).withConfig({displayName:"PageTocSearch__StyledSearchBox",componentId:"sc-1enxv6b-0"})(templateObject_1$V||(templateObject_1$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);var templateObject_1$V;function filterChildren(page,activePage){if(!activePage){return true;}if(activePage.status===WorkflowStatus.deleted){return page.status===WorkflowStatus.deleted;}return page.status!==WorkflowStatus.deleted&&activePage.isUnlinked===page.isUnlinked;}var ExternalPagesLinkButton=function ExternalPagesLinkButton(_a){var item=_a.item,disabled=_a.disabled,onClick=_a.onClick,className=_a.className;var user=useCurrentUser();var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;if(!item.useExternalContent){return null;}var resourceKey="ExternalLinkButton.pages"+(!url?'.noUrl':'')+".navigateTo";return jsxRuntime.jsx(Tooltip,__assign({className:className,resourceKey:resourceKey,values:url?{url:url}:undefined,width:url?400:undefined},{children:jsxRuntime.jsx(StyledIconButton$4,{iconProps:{iconName:'NavigateExternalInline',styles:{root:{fontSize:fontSizeMedium+4+"px",height:fontSizeMedium+4+"px"}}},onClick:handleClick,disabled:disabled,"aria-label":formatMessage({id:resourceKey},url?{url:url}:undefined)},void 0)}),void 0);function handleClick(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(onClick){onClick(e);return [2/*return*/];}createPageClickHandler(item)(e);return [2/*return*/];});});}};var StyledIconButton$4=_styled__default["default"](IconButton).withConfig({displayName:"ExternalPagesLinkButton__StyledIconButton",componentId:"sc-1n1ybv7-0"})(templateObject_1$U||(templateObject_1$U=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$U;var PageNode=function PageNode(_a){var node=_a.node,activePage=_a.activePage,navigationContext=_a.navigationContext,loadChildren=_a.loadChildren,basePath=_a.basePath,path=_a.path,className=_a.className,isRootNode=_a.isRootNode,hide=_a.hide,onPageSelected=_a.onPageSelected,selectedPageId=_a.selectedPageId;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var nodesContainNavigation=navigationContext==null;var _b=React$d.useState(null),lazyLoadedChildren=_b[0],setLazyLoadedChildren=_b[1];var children=lazyLoadedChildren||getChildren(node.id).filter(function(n){return filterChildren(n,activePage);});var _c=React$d.useState(undefined),forceShowChildren=_c[0],setForceShowChildren=_c[1];var showChildren=forceShowChildren||children&&forceShowChildren!==false&&(nodesContainNavigation||path.some(function(p){return p===node.id;})||(activePage===null||activePage===void 0?void 0:activePage.id)===node.id);var title=getTitle(node,user,formatMessage);var isSelectedPageNode=(activePage===null||activePage===void 0?void 0:activePage.id)===node.id||selectedPageId===node.id;var iconName=getIconName();var isExpanded=iconName==='ChevronDown';var isHighlighted=isSelectedPageNode||path.some(function(p){return p===node.id;});var appBasePath=basePath?buildPath(basePath):null;var isSearchMatch=node.isSearchMatch?'true':null;var isDocument=node.pageType===PageType.Document;var detailViewUrl=""+NewsService.getNewsRoute(appBasePath,node.id,title)+(node.useExternalContent?"?"+queryString.stringify({noRedirect:true}):'');return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(NodeWrapper,__assign({isFirstLevel:isRootNode,hide:hide,className:className,isActive:isSelectedPageNode,"data-page-toc-node":true,"data-is-active":isSelectedPageNode},{children:[!!iconName?jsxRuntime.jsx(StyledIconButton$3,{iconProps:{iconName:iconName},onClick:function(){return __awaiter(void 0,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(!!(children===null||children===void 0?void 0:children.length))return [3/*break*/,2];_a=setLazyLoadedChildren;return [4/*yield*/,loadChildren(node.id)];case 1:_a.apply(void 0,[_b.sent()]);_b.label=2;case 2:setForceShowChildren(!showChildren);return [2/*return*/];}});});},isHighlighted:isHighlighted,isExpanded:isExpanded,ariaLabel:formatMessage({id:isExpanded?'AriaLabel.hideChildren':'AriaLabel.seeChildren'}),"data-toc-node-toggle-children":node.id},void 0):jsxRuntime.jsx(StyledIcon$3$1,{isHighlighted:isHighlighted},void 0),basePath?jsxRuntime.jsx(NodeTitleLink,__assign({onClick:createPageClickHandler(node,basePath,function(){return onPageSelected===null||onPageSelected===void 0?void 0:onPageSelected(node.id);},true),to:detailViewUrl,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):onPageSelected?jsxRuntime.jsx(NodeTitleButton,__assign({onClick:function(){return onPageSelected(node.id);},disabled:isDocument,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):jsxRuntime.jsx(NodeTitle,__assign({bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0),jsxRuntime.jsx(StyledExternalLinkButton,{item:node},void 0),jsxRuntime.jsx(StyledDocumentDownloadButton$1,{page:node,basePath:basePath},void 0)]}),void 0),children.length>0&&jsxRuntime.jsx(ChildrenList,__assign({hide:hide},{children:children.map(function(c){return jsxRuntime.jsx("li",{children:jsxRuntime.jsx(PageNode,{hide:!showChildren,basePath:basePath,node:c,activePage:activePage,navigationContext:navigationContext,loadChildren:loadChildren,path:path,isRootNode:false,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id);})}),void 0)]},void 0);function getIconName(){var _a;if(!nodesContainNavigation&&!node.firstChildId||nodesContainNavigation&&!((_a=node.children)===null||_a===void 0?void 0:_a.length)){return null;}if(showChildren){return 'ChevronDown';}return 'ChevronRight';}function getChildren(nodeId){if(nodesContainNavigation){return node.children||[];}if((activePage===null||activePage===void 0?void 0:activePage.id)===nodeId){return navigationContext.children||[];}var result=navigationContext.parent;while(result!=null&&result.id!==nodeId){result=result.parent;}return result?result.children:[];}};var NodeWrapper=_styled__default["default"].div.withConfig({displayName:"PageTocNode__NodeWrapper",componentId:"sc-1ftr1ym-0"})(templateObject_3$p||(templateObject_3$p=__makeTemplateObject(["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"],["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"])),function(p){return p.hide&&'display: none;';},function(p){return !p.isFirstLevel&&_styled.css(templateObject_1$T||(templateObject_1$T=__makeTemplateObject(["\n padding-left: ","px;\n margin-top: ","px;\n "],["\n padding-left: ","px;\n margin-top: ","px;\n "])),spacingS,spacingS+5);},function(p){return p.isActive&&_styled.css(templateObject_2$z||(templateObject_2$z=__makeTemplateObject(["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "])),function(p){return p.theme.palette.neutralQuaternaryAlt;});},spacingXs,minScreenSize.small);var IconNormalSize=20;var IconLargeSize=26;var IconBubbleStyle=function IconBubbleStyle(isHighlighted){return _styled.css(templateObject_6$8||(templateObject_6$8=__makeTemplateObject(["\n ",";\n "],["\n ",";\n "])),isHighlighted?_styled.css(templateObject_4$g||(templateObject_4$g=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.accent;},function(p){return p.theme.palette.white;}):_styled.css(templateObject_5$e||(templateObject_5$e=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.neutralQuaternary;},function(p){return p.theme.palette.black;}));};var StyledIconButton$3=_styled__default["default"](officeUiFabricReact.IconButton).withConfig({displayName:"PageTocNode__StyledIconButton",componentId:"sc-1ftr1ym-1"})(templateObject_8$5||(templateObject_8$5=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"])),IconLargeSize,IconLargeSize,IconLargeSize,function(p){return p.isExpanded&&_styled.css(templateObject_7$5$1||(templateObject_7$5$1=__makeTemplateObject(["\n i {\n transform: translate(0, 1px);\n }\n "],["\n i {\n transform: translate(0, 1px);\n }\n "])));},function(p){return IconBubbleStyle(p.isHighlighted);},minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledIcon$3$1=_styled__default["default"](officeUiFabricReact.Icon).withConfig({displayName:"PageTocNode__StyledIcon",componentId:"sc-1ftr1ym-2"})(templateObject_9$3||(templateObject_9$3=__makeTemplateObject(["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"],["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"])),IconLargeSize,IconLargeSize,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize,function(p){return IconBubbleStyle(p.isHighlighted);});var NodeTitleStyle=_styled.css(templateObject_11$1$1||(templateObject_11$1$1=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"],["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"])),spacingM,fontSizeNormal,function(p){return p.theme.textColors.default;},function(p){return p.bold&&_styled.css(templateObject_10$2$1||(templateObject_10$2$1=__makeTemplateObject(["\n font-weight: bold;\n "],["\n font-weight: bold;\n "])));},minScreenSize.small,fontSizeSmall);var NodeTitleLink=_styled__default["default"](ReactRouterDom.NavLink).withConfig({displayName:"PageTocNode__NodeTitleLink",componentId:"sc-1ftr1ym-3"})(templateObject_12$1$1||(templateObject_12$1$1=__makeTemplateObject(["\n ",";\n\n && {\n color: ",";\n }\n"],["\n ",";\n\n && {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.textColors.default;});var NodeTitleButton=_styled__default["default"](ActionButton).withConfig({displayName:"PageTocNode__NodeTitleButton",componentId:"sc-1ftr1ym-4"})(templateObject_13$1$1||(templateObject_13$1$1=__makeTemplateObject(["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"],["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.palette.neutralQuaternary;});var NodeTitle=_styled__default["default"].div.withConfig({displayName:"PageTocNode__NodeTitle",componentId:"sc-1ftr1ym-5"})(templateObject_14$1$1||(templateObject_14$1$1=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),NodeTitleStyle);var ChildrenList=_styled__default["default"].ul.withConfig({displayName:"PageTocNode__ChildrenList",componentId:"sc-1ftr1ym-6"})(templateObject_15$1$1||(templateObject_15$1$1=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"])),function(p){return p.hide&&'display: none;';},spacingS);var StyledExternalLinkButton=_styled__default["default"](ExternalPagesLinkButton).withConfig({displayName:"PageTocNode__StyledExternalLinkButton",componentId:"sc-1ftr1ym-7"})(templateObject_16$1$1||(templateObject_16$1$1=__makeTemplateObject(["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"])),spacingS,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledDocumentDownloadButton$1=_styled__default["default"](DocumentDownloadButton).withConfig({displayName:"PageTocNode__StyledDocumentDownloadButton",componentId:"sc-1ftr1ym-8"})(templateObject_17$1||(templateObject_17$1=__makeTemplateObject(["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"])),IconLargeSize,spacingS-5,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var templateObject_1$T,templateObject_2$z,templateObject_3$p,templateObject_4$g,templateObject_5$e,templateObject_6$8,templateObject_7$5$1,templateObject_8$5,templateObject_9$3,templateObject_10$2$1,templateObject_11$1$1,templateObject_12$1$1,templateObject_13$1$1,templateObject_14$1$1,templateObject_15$1$1,templateObject_16$1$1,templateObject_17$1;var PageTableOfContents$1=function PageTableOfContents(_a){var basePath=_a.basePath,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onPageSelected=_a.onPageSelected,className=_a.className,selectedPageId=_a.selectedPageId,isLoading=_a.isLoading,disableScrollableList=_a.disableScrollableList;var user=useCurrentUser();var _b=getRootNodes(),rootNodes=_b.rootNodes,path=_b.path;var _c=React$d.useState(),searchResult=_c[0],setSearchResult=_c[1];if(isLoading){return jsxRuntime.jsx(Spinner,{},void 0);}if(!rootNodes||(rootNodes===null||rootNodes===void 0?void 0:rootNodes.length)===0){return jsxRuntime.jsx(FormattedMessageWithStyle,{id:"ContentEditor.parentPage.emptyToc",tagName:"div",className:className},void 0);}var activePage=activePageId&&navigationContext.siblings.find(function(p){return p.id===activePageId;});var nodesToDisplay=sortPageNodesByGroupAndPosition(user.groups,(searchResult||rootNodes).filter(function(p){return filterChildren(p,activePage);}));return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",__assign({className:className},{children:[jsxRuntime.jsx("div",__assign({"data-toc-search-container":true},{children:jsxRuntime.jsx(PageTocSearch,{onSearch:onSearch,onSearchResultChange:setSearchResult},void 0)}),void 0),searchResult&&!searchResult.length&&jsxRuntime.jsx(TocEmptyList,{icon:"Search",emptyMessageResources:['EmptySearchResult.info']},void 0),nodesToDisplay&&jsxRuntime.jsx(TocListContainer,__assign({"data-toc-scrollable-container":true,isScrollable:!disableScrollableList},{children:jsxRuntime.jsx(TocList,{children:nodesToDisplay.map(function(c){return jsxRuntime.jsx(ToCItem,{children:jsxRuntime.jsx(PageNode,{basePath:basePath,node:c,activePage:activePage,navigationContext:searchResult?null:navigationContext,loadChildren:loadChildren,path:path,isRootNode:true,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id+!!searchResult);})},void 0)}),void 0)]}),void 0)},void 0);function getRootNodes(){if(!(navigationContext===null||navigationContext===void 0?void 0:navigationContext.parent)){return {rootNodes:(navigationContext===null||navigationContext===void 0?void 0:navigationContext.siblings)||[],path:[]};}var path=[];var currentParent=navigationContext.parent;while(currentParent!=null&¤tParent.parent!=null){path.push(currentParent.id);currentParent=currentParent.parent;}return {rootNodes:(currentParent===null||currentParent===void 0?void 0:currentParent.children)||[],path:path};}};var TocEmptyList=_styled__default["default"](EmptyList).withConfig({displayName:"PageTableOfContents__TocEmptyList",componentId:"sc-3llzkd-0"})(templateObject_1$S||(templateObject_1$S=__makeTemplateObject(["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"],["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"])),fontSizeLarger+10);var TocListContainer=_styled__default["default"].div.withConfig({displayName:"PageTableOfContents__TocListContainer",componentId:"sc-3llzkd-1"})(templateObject_3$o||(templateObject_3$o=__makeTemplateObject(["\n padding-top: ","px;\n\n ","\n"],["\n padding-top: ","px;\n\n ","\n"])),spacingXs,function(p){return p.isScrollable&&_styled.css(templateObject_2$y||(templateObject_2$y=__makeTemplateObject(["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "],["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "])));});var TocList=_styled__default["default"].ul.withConfig({displayName:"PageTableOfContents__TocList",componentId:"sc-3llzkd-2"})(templateObject_4$f||(templateObject_4$f=__makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n"],["\n list-style: none;\n padding: 0;\n margin: 0;\n"])));var ToCItem=_styled__default["default"].li.withConfig({displayName:"PageTableOfContents__ToCItem",componentId:"sc-3llzkd-3"})(templateObject_5$d||(templateObject_5$d=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);_styled__default["default"](PageTableOfContents$1).withConfig({displayName:"PageTableOfContents__StyledPageToC",componentId:"sc-3llzkd-4"})(templateObject_6$7$1||(templateObject_6$7$1=__makeTemplateObject(["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"],["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"])),spacingM,spacingM,spacingM);var templateObject_1$S,templateObject_2$y,templateObject_3$o,templateObject_4$f,templateObject_5$d,templateObject_6$7$1;var PageTableOfContentsDialog=function PageTableOfContentsDialog(_a){var isOpen=_a.isOpen,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onDismiss=_a.onDismiss,basePath=_a.basePath;var formatMessage=useIntl().formatMessage;if(!navigationContext){return null;}return jsxRuntime.jsx(MobileFullHeightDialog,__assign({hidden:!isOpen,modalProps:{className:'dialog-toc'},dialogContentProps:{type:officeUiFabricReact.DialogType.close},onDismiss:onDismiss,title:formatMessage({id:'Pages.pagesTableOfContents'})},{children:jsxRuntime.jsxs(DialogContent,__assign({className:"dialog-content-host","data-toc-dialog":true},{children:[jsxRuntime.jsx(DialogGlobalStyle,{},void 0),jsxRuntime.jsx(PageTableOfContents$1,{basePath:basePath,activePageId:activePageId,navigationContext:navigationContext,loadChildren:loadChildren,onSearch:onSearch,onPageSelected:onDismiss,disableScrollableList:true},void 0)]}),void 0)}),void 0);};var DialogContent=_styled__default["default"].div.withConfig({displayName:"PageTableOfContentsDialog__DialogContent",componentId:"sc-z2sdu7-0"})(templateObject_1$R||(templateObject_1$R=__makeTemplateObject(["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"],["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle=_styled.createGlobalStyle(templateObject_2$x||(templateObject_2$x=__makeTemplateObject(["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"],["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$R,templateObject_2$x;function useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType){var searchPublishedPages=usePagesApi().searchPublishedPages;return function(pageSize,token){return searchPublishedPages({keywords:keywords,token:token,pageSize:pageSize,pageType:showPagesAndDocuments?undefined:pageType});};}var InlinePageListByKeywords=function InlinePageListByKeywords(_a){var keywords=_a.keywords,showDocuments=_a.showDocuments,showPages=_a.showPages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showPagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var defaultPageSize=10;var keywordsAsString=keywords===null||keywords===void 0?void 0:keywords.join('-');var _b=useItemLoaderWithPreFetch(defaultPageSize,useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType),[keywordsAsString]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsxRuntime.jsx(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsxRuntime.jsx(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};function useLoadPublishedItemsByPageId(pageId,showPagesAndDocuments,pageType){var getSubpages=usePagesApi().getSubpages;try{return function(pageSize,token){return getSubpages(pageId,{pageType:showPagesAndDocuments?undefined:pageType,token:token,pageSize:pageSize});};}catch(error){logger.error(error);return null;}}var defaultPageSize$1=10;var InlinePageListByPageId=function InlinePageListByPageId(_a){var pageId=_a.pageId,showPages=_a.showPages,showDocuments=_a.showDocuments;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showSubpagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var _b=useItemLoaderWithPreFetch(defaultPageSize$1,useLoadPublishedItemsByPageId(pageId,showSubpagesAndDocuments,pageType),[pageId]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsxRuntime.jsx(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsxRuntime.jsx(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};var defaultPageSize=10;// the inline page list should be auto-added on a page with no content
|
|
131713
131713
|
// by default pages and documents should be shown
|
|
131714
131714
|
// for this case the blockProps would be an empty object and
|
|
131715
131715
|
// we need to set the showPages and showDocuments to true
|
|
@@ -131730,8 +131730,8 @@
|
|
|
131730
131730
|
// https://github.com/tc39/proposal-flatMap
|
|
131731
131731
|
$$h({target:'Array',proto:true},{flatMap:function flatMap(callbackfn/* , thisArg */){var O=toObject(this);var sourceLen=toLength$c(O.length);var A;aFunction(callbackfn);A=arraySpeciesCreate(O,0);A.length=flattenIntoArray(A,O,O,sourceLen,0,1,callbackfn,arguments.length>1?arguments[1]:undefined);return A;}});// this method was added to unscopables after implementation
|
|
131732
131732
|
// in popular engines, so it's moved to a separate module
|
|
131733
|
-
var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));function useStreamItemsQuery(query,searchText,defaultPageSize,doNotLoadOnEmpty){if(defaultPageSize===void 0){defaultPageSize=30;}var client=useApolloClient();var user=useCurrentUser();var handleFatalError=React$d.useContext(ErrorContext).handleFatalError;var channels=React$d.useContext(LazySubscriptionContext).channels;var location=ReactRouterDom.useLocation();var isUnreadOnlyView=!!parseQuery(location.search).unreadOnly;var _a=React$d.useState([]),items=_a[0],setItems=_a[1];var _b=React$d.useState({hasNextPage:true,skip:0}),queryState=_b[0],setQueryState=_b[1];var hasChannelsLoaded=channels!=null;React$d.useEffect(function(){if(doNotLoadOnEmpty&&(!searchText||(searchText===null||searchText===void 0?void 0:searchText.length)===0)){setItems([]);setQueryState({hasNextPage:true,skip:0});return;}if(hasChannelsLoaded){loadInitial();}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131734
|
-
},[isUnreadOnlyView,hasChannelsLoaded,searchText,doNotLoadOnEmpty,query]);var refreshCallback=React$d.useCallback(loadInitial,[hasChannelsLoaded,searchText,query]);return {items:items,setItems:setItems,loadMore:loadMore,pageInfo:queryState,refresh:refreshCallback};function convertProperties(items){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywords(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(channels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i));});}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function queryStreamItems(take,skip){var _a,_b;if(skip===void 0){skip=0;}return __awaiter(this,void 0,void 0,function(){var variables,result;return __generator(this,function(_c){switch(_c.label){case 0:variables={take:take,skip:skip,unreadOnly:isUnreadOnlyView,searchText:searchText};return [4/*yield*/,client.query({query:query,fetchPolicy:'no-cache',variables:variables})];case 1:result=_c.sent();if(((_a=result===null||result===void 0?void 0:result.errors)===null||_a===void 0?void 0:_a.length)>0){logger.error(result.errors[0]);handleFatalError({error:result.errors[0]});}return [2/*return*/,{stream:(_b=result===null||result===void 0?void 0:result.data)===null||_b===void 0?void 0:_b.stream,errors:result===null||result===void 0?void 0:result.errors}];}});});}function loadInitial(){var _a,_b;return __awaiter(this,void 0,void 0,function(){var _c,result,errors;return __generator(this,function(_d){switch(_d.label){case 0:return [4/*yield*/,queryStreamItems(defaultPageSize,0)];case 1:_c=_d.sent(),result=_c.stream,errors=_c.errors;setQueryState({hasNextPage:(_a=result===null||result===void 0?void 0:result.pageInfo)===null||_a===void 0?void 0:_a.hasNextPage,skip:defaultPageSize,errors:errors});setItems(convertProperties((_b=result===null||result===void 0?void 0:result.items)!==null&&_b!==void 0?_b:[]));return [2/*return*/];}});});}function loadMore(){return __awaiter(this,void 0,void 0,function(){var _a,result,errors;return __generator(this,function(_b){switch(_b.label){case 0:if(!queryState.hasNextPage||!queryState.skip){return [2/*return*/];}return [4/*yield*/,queryStreamItems(defaultPageSize,queryState.skip)];case 1:_a=_b.sent(),result=_a.stream,errors=_a.errors;setQueryState(function(state){var _a;return {hasNextPage:(_a=result===null||result===void 0?void 0:result.pageInfo)===null||_a===void 0?void 0:_a.hasNextPage,skip:state.skip+defaultPageSize,errors:errors};});setItems(function(state){var _a;return __spreadArray(__spreadArray([],state),convertProperties((_a=result===null||result===void 0?void 0:result.items)!==null&&_a!==void 0?_a:[]));});return [2/*return*/];}});});}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}var CHANNELS_OR_CONDITION=function CHANNELS_OR_CONDITION(channels){if(!channels){return '';}return "channels: { some: { in: ["+channels+"] } }";};var KEYWORDS_OR_CONDITION=function KEYWORDS_OR_CONDITION(keywords){if(!keywords){return '';}return "keywordIds: { some: { in: ["+keywords+"] } }";};var NEWS_QUERY=function NEWS_QUERY(includeAllItems,whereConditions){if(whereConditions===void 0){whereConditions='';}return gql(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"],["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"])),includeAllItems,whereConditions);};gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_4$2$1||(templateObject_4$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_1$6$1,templateObject_3$2$1,templateObject_4$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=React$d.useRef();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxRuntime.jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsxRuntime.jsx(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsxRuntime.jsx(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxRuntime.jsxs(Options,{children:[props.allowSelection&&jsxRuntime.jsx(SelectedIconOption,{children:jsxRuntime.jsx(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsxRuntime.jsx(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsxRuntime.jsx(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsxRuntime.jsx(Avatar,{upn:item.owner.userPrincipalName,size:officeUiFabricReact.PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled__default["default"].h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled__default["default"](officeUiFabricReact.IconButton).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled__default["default"].div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled__default["default"].div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled__default["default"].div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled__default["default"](Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=_styled.css(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled__default["default"](ReactRouterDom.Link).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled__default["default"].a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsxRuntime.jsx(Option,{children:status===WorkflowStatus.approved?jsxRuntime.jsx("img",{style:{width:'20px'},alt:""},void 0):jsxRuntime.jsx(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsxRuntime.jsx(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$5$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$s,templateObject_7$m,templateObject_8$k,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsxRuntime.jsx(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsxRuntime.jsx(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled__default["default"](ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled__default["default"].div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$4$1,templateObject_2$3$1;var EventDates=_styled__default["default"].div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled__default["default"].div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled__default["default"].div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled__default["default"](EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$L||(templateObject_4$L=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled__default["default"](EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$3$1,templateObject_2$2$1,templateObject_3$13,templateObject_4$L,templateObject_5$D;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=ReactRouterDom.useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsxRuntime.jsx(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsxRuntime.jsx(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsxRuntime.jsx(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-callout'},className:className,"data-button-create":type},{children:jsxRuntime.jsx(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled__default["default"](officeUiFabricReact.CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$2$1||(templateObject_1$2$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled__default["default"](officeUiFabricReact.PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$2$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=React$d.useContext(AuthenticationContext).onRequestToken;return React$d.useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
|
|
131733
|
+
var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));var StreamKnownNewsState;(function(StreamKnownNewsState){StreamKnownNewsState["Unconfirmed"]="UNCONFIRMED";StreamKnownNewsState["Alert"]="ALERT";})(StreamKnownNewsState||(StreamKnownNewsState={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isNews(item){return item.type===StreamItemTypes.News;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));function useStreamItemsQuery(query,searchText,defaultPageSize,doNotLoadOnEmpty){if(defaultPageSize===void 0){defaultPageSize=30;}var client=useApolloClient();var user=useCurrentUser();var handleFatalError=React$d.useContext(ErrorContext).handleFatalError;var channels=React$d.useContext(LazySubscriptionContext).channels;var location=ReactRouterDom.useLocation();var isUnreadOnlyView=!!parseQuery(location.search).unreadOnly;var _a=React$d.useState([]),items=_a[0],setItems=_a[1];var _b=React$d.useState({hasNextPage:true,skip:0}),queryState=_b[0],setQueryState=_b[1];var hasChannelsLoaded=channels!=null;React$d.useEffect(function(){if(doNotLoadOnEmpty&&(!searchText||(searchText===null||searchText===void 0?void 0:searchText.length)===0)){setItems([]);setQueryState({hasNextPage:true,skip:0});return;}if(hasChannelsLoaded){loadInitial();}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131734
|
+
},[isUnreadOnlyView,hasChannelsLoaded,searchText,doNotLoadOnEmpty,query]);var refreshCallback=React$d.useCallback(loadInitial,[hasChannelsLoaded,searchText,query]);return {items:items,setItems:setItems,loadMore:loadMore,pageInfo:queryState,refresh:refreshCallback};function convertProperties(items){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywords(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(channels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i)),getKnownNewsState(i));});}function getKnownNewsState(item){var _a,_b;if(!isNews(item)){return {};}var state=KnownNewsState.None;if((_a=item.knownNewsState)===null||_a===void 0?void 0:_a.includes(StreamKnownNewsState.Alert)){state|=KnownNewsState.Alert;}if((_b=item.knownNewsState)===null||_b===void 0?void 0:_b.includes(StreamKnownNewsState.Unconfirmed)){state|=KnownNewsState.Unconfirmed;}return {knownState:state};}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function queryStreamItems(take,skip){var _a,_b;if(skip===void 0){skip=0;}return __awaiter(this,void 0,void 0,function(){var variables,result;return __generator(this,function(_c){switch(_c.label){case 0:variables={take:take,skip:skip,unreadOnly:isUnreadOnlyView,searchText:searchText};return [4/*yield*/,client.query({query:query,fetchPolicy:'no-cache',variables:variables})];case 1:result=_c.sent();if(((_a=result===null||result===void 0?void 0:result.errors)===null||_a===void 0?void 0:_a.length)>0){logger.error(result.errors[0]);handleFatalError({error:result.errors[0]});}return [2/*return*/,{stream:(_b=result===null||result===void 0?void 0:result.data)===null||_b===void 0?void 0:_b.stream,errors:result===null||result===void 0?void 0:result.errors}];}});});}function loadInitial(){var _a,_b;return __awaiter(this,void 0,void 0,function(){var _c,result,errors;return __generator(this,function(_d){switch(_d.label){case 0:return [4/*yield*/,queryStreamItems(defaultPageSize,0)];case 1:_c=_d.sent(),result=_c.stream,errors=_c.errors;setQueryState({hasNextPage:(_a=result===null||result===void 0?void 0:result.pageInfo)===null||_a===void 0?void 0:_a.hasNextPage,skip:defaultPageSize,errors:errors});setItems(convertProperties((_b=result===null||result===void 0?void 0:result.items)!==null&&_b!==void 0?_b:[]));return [2/*return*/];}});});}function loadMore(){return __awaiter(this,void 0,void 0,function(){var _a,result,errors;return __generator(this,function(_b){switch(_b.label){case 0:if(!queryState.hasNextPage||!queryState.skip){return [2/*return*/];}return [4/*yield*/,queryStreamItems(defaultPageSize,queryState.skip)];case 1:_a=_b.sent(),result=_a.stream,errors=_a.errors;setQueryState(function(state){var _a;return {hasNextPage:(_a=result===null||result===void 0?void 0:result.pageInfo)===null||_a===void 0?void 0:_a.hasNextPage,skip:state.skip+defaultPageSize,errors:errors};});setItems(function(state){var _a;return __spreadArray(__spreadArray([],state),convertProperties((_a=result===null||result===void 0?void 0:result.items)!==null&&_a!==void 0?_a:[]));});return [2/*return*/];}});});}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}var CHANNELS_OR_CONDITION=function CHANNELS_OR_CONDITION(channels){if(!channels){return '';}return "channels: { some: { in: ["+channels+"] } }";};var KEYWORDS_OR_CONDITION=function KEYWORDS_OR_CONDITION(keywords){if(!keywords){return '';}return "keywordIds: { some: { in: ["+keywords+"] } }";};var NEWS_QUERY=function NEWS_QUERY(includeAllItems,whereConditions){if(whereConditions===void 0){whereConditions='';}return gql(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"],["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"])),includeAllItems,whereConditions);};gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_4$2$1||(templateObject_4$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_1$6$1,templateObject_3$2$1,templateObject_4$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=React$d.useRef();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxRuntime.jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsxRuntime.jsx(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsxRuntime.jsx(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxRuntime.jsxs(Options,{children:[props.allowSelection&&jsxRuntime.jsx(SelectedIconOption,{children:jsxRuntime.jsx(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsxRuntime.jsx(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsxRuntime.jsx(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsxRuntime.jsx(Avatar,{upn:item.owner.userPrincipalName,size:officeUiFabricReact.PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled__default["default"].h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled__default["default"](officeUiFabricReact.IconButton).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled__default["default"].div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled__default["default"].div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled__default["default"].div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled__default["default"](Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=_styled.css(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled__default["default"](ReactRouterDom.Link).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled__default["default"].a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsxRuntime.jsx(Option,{children:status===WorkflowStatus.approved?jsxRuntime.jsx("img",{style:{width:'20px'},alt:""},void 0):jsxRuntime.jsx(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsxRuntime.jsx(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$5$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$s,templateObject_7$m,templateObject_8$k,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsxRuntime.jsx(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsxRuntime.jsx(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled__default["default"](ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled__default["default"].div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$4$1,templateObject_2$3$1;var EventDates=_styled__default["default"].div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled__default["default"].div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled__default["default"].div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled__default["default"](EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$L||(templateObject_4$L=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled__default["default"](EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$3$1,templateObject_2$2$1,templateObject_3$13,templateObject_4$L,templateObject_5$D;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=ReactRouterDom.useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsxRuntime.jsx(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsxRuntime.jsx(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsxRuntime.jsx(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-callout'},className:className,"data-button-create":type},{children:jsxRuntime.jsx(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled__default["default"](officeUiFabricReact.CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$2$1||(templateObject_1$2$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled__default["default"](officeUiFabricReact.PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$2$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=React$d.useContext(AuthenticationContext).onRequestToken;return React$d.useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
|
|
131735
131735
|
return null;});}function deletePermanently(type,ids){var itemIds=ids.join(',');return api.custom("editor/"+type+"/recyclebin?"+queryString.stringify({itemIds:itemIds})).delete();}function bulkSetStatus(type,items){return api.custom("editor/"+type).patch(items).then(function(response){return response.body().map(function(item){return item.data();});});}function setStatus(type,itemId,status,leaseId){return __awaiter(this,void 0,void 0,function(){var path,response,ex_1;return __generator(this,function(_a){switch(_a.label){case 0:path="editor/"+type+"/"+itemId+"/status";if(leaseId!=null){path+='?'+queryString.stringify({leaseId:leaseId});}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,api.custom(path).put(status)];case 2:response=_a.sent();return [2/*return*/,response.body().data()];case 3:ex_1=_a.sent();throw ex_1.response.statusCode===409?{account:ex_1.response.data}:ex_1;case 4:return [2/*return*/];}});});}function removeLease(itemId,leaseId){return api.custom("editor/"+itemId+"/lease?"+queryString.stringify({leaseId:leaseId})).delete();}function keepLeaseAlive(itemId,leaseId,token,subscriptionId){var _this=this;var expireLeaseToken=token;// every 10 seconds
|
|
131736
131736
|
var timer=setInterval(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:// update the lease
|
|
131737
131737
|
return [4/*yield*/,api.custom("editor/"+itemId+"/lease").put({leaseId:leaseId})];case 1:// update the lease
|
|
@@ -132800,7 +132800,7 @@
|
|
|
132800
132800
|
var Title$3 = _styled__default["default"].span.withConfig({
|
|
132801
132801
|
displayName: "NewsCompactCard__Title",
|
|
132802
132802
|
componentId: "sc-16ovog0-5"
|
|
132803
|
-
})(templateObject_7$
|
|
132803
|
+
})(templateObject_7$5 || (templateObject_7$5 = __makeTemplateObject$l(["\n ", "\n display: inline-block;\n max-width: 100%;\n"], ["\n ", "\n display: inline-block;\n max-width: 100%;\n"])), TextStyle);
|
|
132804
132804
|
|
|
132805
132805
|
var TitleWrapper$1 = _styled__default["default"].a.withConfig({
|
|
132806
132806
|
displayName: "NewsCompactCard__TitleWrapper",
|
|
@@ -132869,7 +132869,7 @@
|
|
|
132869
132869
|
});
|
|
132870
132870
|
});
|
|
132871
132871
|
|
|
132872
|
-
var templateObject_1$i, templateObject_2$a, templateObject_3$a, templateObject_4$9, templateObject_5$8, templateObject_6$7, templateObject_7$
|
|
132872
|
+
var templateObject_1$i, templateObject_2$a, templateObject_3$a, templateObject_4$9, templateObject_5$8, templateObject_6$7, templateObject_7$5, templateObject_8$4, templateObject_9$2, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$2, templateObject_16$1;
|
|
132873
132873
|
|
|
132874
132874
|
var EmptyNewsList = function EmptyNewsList() {
|
|
132875
132875
|
return jsxRuntime.jsxs(Host$a, {
|
|
@@ -133095,7 +133095,7 @@
|
|
|
133095
133095
|
var CommentsCount = _styled__default["default"].span.withConfig({
|
|
133096
133096
|
displayName: "NewsList__CommentsCount",
|
|
133097
133097
|
componentId: "sc-1d0bzx1-5"
|
|
133098
|
-
})(templateObject_7$
|
|
133098
|
+
})(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject$l(["\n padding-left: 5px;\n font-size: 0.9rem;\n"], ["\n padding-left: 5px;\n font-size: 0.9rem;\n"])));
|
|
133099
133099
|
|
|
133100
133100
|
var ErrorContainer$1 = _styled__default["default"].p.withConfig({
|
|
133101
133101
|
displayName: "NewsList__ErrorContainer",
|
|
@@ -133104,7 +133104,7 @@
|
|
|
133104
133104
|
return p.theme.palette.red;
|
|
133105
133105
|
}, spacingM);
|
|
133106
133106
|
|
|
133107
|
-
var templateObject_1$g, templateObject_2$8, templateObject_3$8, templateObject_4$8, templateObject_5$7, templateObject_6$6, templateObject_7$
|
|
133107
|
+
var templateObject_1$g, templateObject_2$8, templateObject_3$8, templateObject_4$8, templateObject_5$7, templateObject_6$6, templateObject_7$4, templateObject_8$3;
|
|
133108
133108
|
|
|
133109
133109
|
var ManageChannels = function ManageChannels(_a) {
|
|
133110
133110
|
var className = _a.className;
|
|
@@ -133334,7 +133334,7 @@
|
|
|
133334
133334
|
var ChannelToggle = _styled__default["default"](ToggleWithLabel).withConfig({
|
|
133335
133335
|
displayName: "ManageChannels__ChannelToggle",
|
|
133336
133336
|
componentId: "sc-yyoxfw-6"
|
|
133337
|
-
})(templateObject_7$
|
|
133337
|
+
})(templateObject_7$3 || (templateObject_7$3 = __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);
|
|
133338
133338
|
|
|
133339
133339
|
var StyledIconButton = _styled__default["default"](officeUiFabricReact.IconButton).withConfig({
|
|
133340
133340
|
displayName: "ManageChannels__StyledIconButton",
|
|
@@ -133343,7 +133343,7 @@
|
|
|
133343
133343
|
return p.theme.textColors.default;
|
|
133344
133344
|
});
|
|
133345
133345
|
|
|
133346
|
-
var templateObject_1$f, templateObject_2$7, templateObject_3$7, templateObject_4$7, templateObject_5$6, templateObject_6$5, templateObject_7$
|
|
133346
|
+
var templateObject_1$f, templateObject_2$7, templateObject_3$7, templateObject_4$7, templateObject_5$6, templateObject_6$5, templateObject_7$3, templateObject_8$2;
|
|
133347
133347
|
|
|
133348
133348
|
var NewsGridCard = function NewsGridCard(_a) {
|
|
133349
133349
|
var _b;
|
|
@@ -133463,7 +133463,7 @@
|
|
|
133463
133463
|
});
|
|
133464
133464
|
var MetaInfo = _styled__default["default"].div(templateObject_5$5 || (templateObject_5$5 = __makeTemplateObject$l(["\n font-size: ", "px;\n"], ["\n font-size: ", "px;\n"])), fontSizeSmall);
|
|
133465
133465
|
var DateAndIcon = _styled__default["default"].div(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject$l(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
133466
|
-
var PublishingDate = _styled__default["default"](DateTime)(templateObject_7$
|
|
133466
|
+
var PublishingDate = _styled__default["default"](DateTime)(templateObject_7$2 || (templateObject_7$2 = __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"])));
|
|
133467
133467
|
var NewsCardIcon = _styled__default["default"].div(templateObject_8$1 || (templateObject_8$1 = __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"])));
|
|
133468
133468
|
var StyledIcon$1 = _styled__default["default"](officeUiFabricReact.Icon)(templateObject_9$1 || (templateObject_9$1 = __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) {
|
|
133469
133469
|
return p.backgroundColor;
|
|
@@ -133478,7 +133478,7 @@
|
|
|
133478
133478
|
return p.theme.palette.neutralTertiary;
|
|
133479
133479
|
});
|
|
133480
133480
|
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);
|
|
133481
|
-
var templateObject_1$e, templateObject_2$6, templateObject_3$6, templateObject_4$6, templateObject_5$5, templateObject_6$4, templateObject_7$
|
|
133481
|
+
var templateObject_1$e, templateObject_2$6, templateObject_3$6, templateObject_4$6, templateObject_5$5, templateObject_6$4, templateObject_7$2, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;
|
|
133482
133482
|
|
|
133483
133483
|
var ErrorContainer = function ErrorContainer() {
|
|
133484
133484
|
return jsxRuntime.jsx(Host$6, {
|
|
@@ -133742,7 +133742,7 @@
|
|
|
133742
133742
|
var Host$4 = _styled__default["default"].div.withConfig({
|
|
133743
133743
|
displayName: "HeroSlide__Host",
|
|
133744
133744
|
componentId: "sc-3yofth-0"
|
|
133745
|
-
})(templateObject_7 || (templateObject_7 = __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) {
|
|
133745
|
+
})(templateObject_7$1 || (templateObject_7$1 = __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) {
|
|
133746
133746
|
return p.width ? _styled.css(templateObject_1$b || (templateObject_1$b = __makeTemplateObject$l(["\n width: ", ";\n "], ["\n width: ", ";\n "])), p.width) : _styled.css(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject$l(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
|
|
133747
133747
|
}, function (p) {
|
|
133748
133748
|
return p.height ? _styled.css(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject$l(["\n height: ", ";\n "], ["\n height: ", ";\n "])), p.height) : _styled.css(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject$l(["\n height: 100%;\n "], ["\n height: 100%;\n "])));
|
|
@@ -133863,7 +133863,7 @@
|
|
|
133863
133863
|
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);
|
|
133864
133864
|
});
|
|
133865
133865
|
|
|
133866
|
-
var templateObject_1$b, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$3, templateObject_6$3, templateObject_7, templateObject_8, templateObject_9, templateObject_10, 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;
|
|
133866
|
+
var templateObject_1$b, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$3, templateObject_6$3, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10, 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;
|
|
133867
133867
|
|
|
133868
133868
|
var HeroPaging = function HeroPaging(_a) {
|
|
133869
133869
|
var items = _a.items,
|
|
@@ -134869,13 +134869,21 @@
|
|
|
134869
134869
|
var ToolbarFilterPanel = function ToolbarFilterPanel(_a) {
|
|
134870
134870
|
var filter = _a.filter,
|
|
134871
134871
|
onChange = _a.onChange,
|
|
134872
|
-
children = _a.children
|
|
134872
|
+
children = _a.children,
|
|
134873
|
+
hideClearAllFiltersButton = _a.hideClearAllFiltersButton;
|
|
134873
134874
|
return jsxRuntime.jsx(FilterContextProvider, __assign$g({
|
|
134874
134875
|
filter: filter,
|
|
134875
134876
|
onChange: onChange
|
|
134876
134877
|
}, {
|
|
134877
|
-
children: jsxRuntime.
|
|
134878
|
-
children: children
|
|
134878
|
+
children: jsxRuntime.jsxs(Host$1, {
|
|
134879
|
+
children: [children, !hideClearAllFiltersButton && jsxRuntime.jsx(IconButton, {
|
|
134880
|
+
iconProps: {
|
|
134881
|
+
iconName: 'ChromeClose'
|
|
134882
|
+
},
|
|
134883
|
+
onClick: function () {
|
|
134884
|
+
return onChange(null);
|
|
134885
|
+
}
|
|
134886
|
+
}, void 0)]
|
|
134879
134887
|
}, void 0)
|
|
134880
134888
|
}), void 0);
|
|
134881
134889
|
};
|
|
@@ -134883,7 +134891,7 @@
|
|
|
134883
134891
|
var Host$1 = _styled__default["default"].div.withConfig({
|
|
134884
134892
|
displayName: "ToolbarFilterPanel__Host",
|
|
134885
134893
|
componentId: "sc-118p488-0"
|
|
134886
|
-
})(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject$l([""], [""])));
|
|
134894
|
+
})(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject$l(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
134887
134895
|
|
|
134888
134896
|
var templateObject_1$1;
|
|
134889
134897
|
|
|
@@ -134904,6 +134912,10 @@
|
|
|
134904
134912
|
showChannels = _f[0],
|
|
134905
134913
|
setShowChannels = _f[1];
|
|
134906
134914
|
|
|
134915
|
+
var _g = React$d.useState(''),
|
|
134916
|
+
channelSearchTerm = _g[0],
|
|
134917
|
+
setChannelSearchTerm = _g[1];
|
|
134918
|
+
|
|
134907
134919
|
var availableChannels = (_b = channels === null || channels === void 0 ? void 0 : channels.map(function (c) {
|
|
134908
134920
|
return allChannels.find(function (channel) {
|
|
134909
134921
|
return channel.name === c;
|
|
@@ -134946,8 +134958,22 @@
|
|
|
134946
134958
|
}
|
|
134947
134959
|
}, {
|
|
134948
134960
|
children: jsxRuntime.jsxs(Host, {
|
|
134949
|
-
children: [jsxRuntime.jsx(
|
|
134950
|
-
|
|
134961
|
+
children: [jsxRuntime.jsx(StyledTextField, {
|
|
134962
|
+
placeholder: formatMessage({
|
|
134963
|
+
id: 'Generic.search'
|
|
134964
|
+
}),
|
|
134965
|
+
iconProps: {
|
|
134966
|
+
iconName: 'Search'
|
|
134967
|
+
},
|
|
134968
|
+
onChange: function (_, value) {
|
|
134969
|
+
return setChannelSearchTerm(value.toLowerCase());
|
|
134970
|
+
}
|
|
134971
|
+
}, void 0), jsxRuntime.jsx(Channels, {
|
|
134972
|
+
children: availableChannels.filter(function (c) {
|
|
134973
|
+
var _a;
|
|
134974
|
+
|
|
134975
|
+
return (_a = getChannelDisplayName(availableChannels, c, user)) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(channelSearchTerm);
|
|
134976
|
+
}).map(function (c) {
|
|
134951
134977
|
var checked = isChannelSelected(c);
|
|
134952
134978
|
return jsxRuntime.jsx(StyledCheckbox, {
|
|
134953
134979
|
onRenderLabel: function () {
|
|
@@ -135028,7 +135054,12 @@
|
|
|
135028
135054
|
componentId: "sc-1ju8xwz-5"
|
|
135029
135055
|
})(templateObject_6 || (templateObject_6 = __makeTemplateObject$l(["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"], ["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"])));
|
|
135030
135056
|
|
|
135031
|
-
var
|
|
135057
|
+
var StyledTextField = _styled__default["default"](officeUiFabricReact.TextField).withConfig({
|
|
135058
|
+
displayName: "ChannelFilter__StyledTextField",
|
|
135059
|
+
componentId: "sc-1ju8xwz-6"
|
|
135060
|
+
})(templateObject_7 || (templateObject_7 = __makeTemplateObject$l(["\n padding-bottom: ", "px;\n"], ["\n padding-bottom: ", "px;\n"])), spacingS);
|
|
135061
|
+
|
|
135062
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
135032
135063
|
|
|
135033
135064
|
/* @generated */
|
|
135034
135065
|
// prettier-ignore
|
|
@@ -150826,6 +150857,7 @@
|
|
|
150826
150857
|
"Generic.Restore": "Restore",
|
|
150827
150858
|
"Generic.Preview": "Preview",
|
|
150828
150859
|
"Generic.upload": "Upload",
|
|
150860
|
+
"Generic.search": "Search",
|
|
150829
150861
|
"Generic.resetToDefault": "Reset to Default",
|
|
150830
150862
|
"Generic.bookmarks": "Bookmarks",
|
|
150831
150863
|
"Generic.error": "Something went wrong. Please reload the page and try again",
|
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.211",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"react": "^16.14.0 || ^17",
|
|
7
7
|
"react-dom": "^16.14.0 || ^17",
|