{"version":3,"sources":["assets/EPC_Logo_for_dark_bg_path.svg","assets/PCT_Logo_for_dark_bg_path.svg","debug/index.ts","theme.tsx","libs/material-ui.ts","utils/LoaderState.tsx","navigation.ts","store/ViewRegistry/ContentLinkDecorator.tsx","utils/SyncState.tsx","webapi.ts","viewmodels/EPCDataModel.tsx","store/ViewRegistry/items.ts","store/ViewRegistry/comments.ts","store/ViewRegistry/annotations.ts","store/ViewRegistry/notes.ts","store/ViewRegistry/markers.ts","store/ViewRegistry/linkedContents.ts","store/ViewRegistry/contentParagraphs.ts","store/ViewRegistry/index.ts","store/ViewRegistry/toolbar.ts","store/Search.ts","store/TableOfContents.ts","store/UserProfile.ts","store/Notes.ts","store/ContentLookup.ts","store/PdfJobs.ts","store/index.ts","store/Browser.ts","ressources.ts","components/test/TestPage.tsx","components/test/TestSideBar.tsx","components/test/TestFooter.tsx","components/test/TestToolbar.tsx","hardlinks.ts","utils/DraftJSUtils.tsx","utils/StyleFactory.tsx","components/appbar/editmenu/Common.tsx","components/appbar/editmenu/EditMenu.tsx","components/search/Goto.tsx","components/appbar/MainAppBar.tsx","components/notes/NotesToolbar.tsx","components/shared/Footer.tsx","components/product/ProductRedirect.tsx","components/content/TableOfContents.tsx","components/content/TableOfContentsPage.tsx","components/content/TableOfContentsSideBar.tsx","components/shared/ErrorContainer.tsx","components/shared/TwoColumn.tsx","components/shared/OneColumnGrid.tsx","components/content/NestedContentUtil.ts","components/content/ContentOutline/dnd.tsx","components/content/ContentHeader.tsx","utils/ScopeUtils.ts","components/content/ContentOutline/button.tsx","components/content/ContentOutline/ItemControl.tsx","components/shared/ModalDialog.tsx","components/content/ContentOutline/GroupControl.tsx","components/content/ContentOutline/UpdateItemForm.tsx","components/content/ContentOutline/UpdateGroupForm.tsx","components/content/ContentOutline/NewGroupForm.tsx","components/content/ContentOutline/NewItemForm.tsx","components/content/ContentOutline/NewCommentForm.tsx","components/content/ContentOutline/ContentOutline.tsx","utils/TextBuilder.tsx","components/edit/EditorReadOnlyContext.tsx","components/edit/Editor.tsx","components/content/Note.tsx","components/content/Annotation.tsx","components/content/ParagraphBuilder.tsx","components/content/ContentParagraph.tsx","components/content/Content.tsx","components/content/Comment.tsx","components/content/ContentOverview.tsx","components/content/ContentPage.tsx","components/content/ContentRedirect.tsx","components/notes/NotesPage.tsx","components/pdf/PdfJobsPage.tsx","components/lookups/ContentLookupPage.tsx","components/search/SearchPage.tsx","Settings/StylesPage.tsx","routes.tsx","serviceWorker.ts","index.tsx"],"names":["module","exports","__webpack_require__","p","isLoggingOn","channels","auth","ui","amazon-pay","levelToNumber","level","log","message","channel","channelLevel","now","Date","console","concat","toISOString","Colors","styles","app","$","display","flexDirection","alignItems","width","height","fontFamily","nav","flexShrink","header","mainPanel","flex","minHeight","sidebar","overflowY","color","main","padding","footer","link","textDecoration","cursor","link_noline","note","backgroundColor","page","maxWidth","tocSidebar","contentHeader","marginTop","marginBottom","contentHeader_Small","contentOutline_OtherScope","contentOutline_ActiveScope","container","listStyleType","margin","item","tbitem","marginLeft","marginRight","opacity","tbitem_active","fontWeight","tbitem_inactive","tbitem_separator","borderLeft","tbitem_hover","tbitem_inactive_hover","tbitem_style_icon","textAlign","style","_ConnectedMuiThemeProvider","props","Object","classCallCheck","this","possibleConstructorReturn","getPrototypeOf","call","Logging","productId","theme","createMuiTheme","palette","primary","dark","contrastText","secondary","typography","fontSize","shape","borderRadius","overrides","MuiTab","root","textTransform","label","MuiToolbar","paddingLeft","paddingRight","MuiCheckbox","MuiButton","MuiExpansionPanelSummary","&$expanded","content","MuiExpansionPanelDetails","react","core_styles","children","React","ConnectedMuiThemeProvide","connect","state","ownProps","userProfile","viewOptions","Icons","AccessAlarm","AccountBox","AccountCircle","ArrowDropDown","ArrowRight","Attachment","BorderColor","Check","CloudDownload","Close","ColorLens","Edit","FormatUnderlined","FilterFrames","InsertLink","LibraryBooks","MenuIcon","NavigateBefore","NavigateNext","Navigation","Note","Notifications","NotificationsActive","Person","QuestionAnswer","Refresh","Search","Settings","Shop","Visibility","LoaderStateUtil","createClass","key","value","isLoading","isLoaded","hasError","errorMessage","error","msg","response","status","statusText","request","toString","CircularProgress_default","a","getContentPageUrl","childLabel","getContentRedirectPageUrl","parKeyOrTag","encodeURIComponent","ContentLinkDecorator","strategy","findLinkEntities","component","_props$contentState$g","contentState","getEntity","entityKey","getData","parTag","Nav","ContentLinkDecorator_ContentLink","offsetkey","renderLink","block","callback","findEntityRanges","character","getType","ContentLink","href","history","context","router","data-offset-key","objectSpread","onClick","evt","currentTarget","isContentEditable","push","preventDefault","contextTypes","PropTypes","SyncStateUtil","isModified","isSyncing","isSynced","isConflict","prevState","statusCode","thisFetch","fetch","asJson","ok","json","Promise","resolve","reject","ensureOK","CustomerKind","InvoiceAddressType","LabelPartKey","LabelReferralType","Language","LayoutType","httpPost","url","data","method","headers","Accept","Content-Type","body","JSON","stringify","getCurrentUserProfile","dto","then","getUserProfilePreferences","patchAnnotation","patchNote","postNote","deleteNote","getContentRef","resolveCitation","LicenseUpgradeMode","OrderStatus","PaymentMethod","PdfDivisioningMode","PdfJobPageMode","PdfJobStatus","PeriodType","ReservedParagraphKeys","EntireContent","Title","Lost","SCAInitiator","SearchResultType","StyleLineType","TextBlockType","TypeOfContent","TypeOfContentSubType","TypeOfScope","TypeOfStickyNote","TypeOfUserRole","UserGlobalRole","UserProductRole","UserRoleSource","UserScopeRole","ViewMode","VisibilityOfStickyNote","emptyId","requestNestedContents","scopeIds","languages","force","dispatch","getState","contentLabels","commentLabels","gatherLabels","grp","i","groups","items","length","targetLabel","startsWith","viewRegistry","contents","_","contentsDto","labels","type","result","models","catch","commentsDto","WebApi","comment","actionCreators","resetViewRegistry","setViewRegistryMode","mode","requestContent","loaderState","model","linkedContentContainer","requestLinkedContent","getEditorState","rawContentState","decorator","Draft","createWithContent","createFromText","getContentState","e","getDraftState","draft","language","editor","syncState","getSynced","getTextState","text","getContent","externalLinkState","externalLink","titleState","title","paragraphs","map","par","segTextState","textState","defineProperty","blockType","getContentParagraph","annotations","annotation","getAnnotation","id","notes","stickyNotes","getNote","markers","marker","getMarker","isOptOut","getLoaded","labelInfo","typeOfContent","typeOfContentSubType","validFrom","validTill","dateOfDecision","isOutdated","friendlyLabel","parent","annoation","anchor","draftState","anchorState","start","end","scopeId","paragraphKey","isInline","optOut","isOutOfSync","outOfSync","annotationId","typeOfStickyNote","visibilityOfStickyNote","getMarker2","styleId","getComment","isTitleOutOfSync","titleOutOfSync","isDraftOutOfSync","draftOutOfSync","getLinkedContentGroup","isRoot","isGhost","hideHeader","breakSection","sortOrder","group","getLinkedContentItem","vm","hideBody","layoutType","targetTypeOfContent","paragraphOptOut","paragraphsOptOut","getBestLanguage","dictionary","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","Symbol","iterator","next","done","val","filter","Number","Any","err","return","addComment","editScopeId","editLanguage","customRef","debug","deleteComment","TypeError","onCommentDraftChanged","newEditorState","onCommentTitleChanged","newTitle","addCommentLanguage","updateComment","setTimeout","etag","getCurrentContent","alterCommentItem1","alter","alterCommentItem2","alterDraftState","alterTitleState","addAnnotation","parKey","inline","anchorLanguage","draftLanguage","deleteAnnotation","hideAnnotation","showAnnotation","addAnnotationLanguage","onAnnotationDraftChanged","updateAnnotationDraft","moveAnnotation","dir","par_","getModified","getEmpty","Model","c0","charAt","c1","Math","max","min","newAnchor","warn","reducer","action","newAnnotation","Items","addAnnotationItem","contentLabel","alterAnnotationItem1","isDeleting","isDeleted","newContentState","modified","equals","getSyncing","getError","alterAnchorState","alterAnnotationItem2","addNoteToContentLike","Custom","PrivateToScope","addNoteToAnnotation","hideNote","showNote","addNoteLanguage","onNoteDraftChanged","updateNoteDraft","updateNoteType","newNote","addNoteItem","alterNoteItem1","alterNoteItem2","deleteOrHideMarkers","selection","_loop","addMarker","newMarkers","markerId","deleteMarkerItem","addMarkerItem","handleOK","handleError","deleteItem","addItem","parentId","addNewCommentItem","tags","updateItem","moveItem","beforeSiblingId","toParentId","deleteGroup","addGroup","updateGroup","moveGroup","alterLinkedContentItem","linkedContentRoot","alterLinkedContentItem2","itemId","subgroup","newSubgroup","newItem","findLinkedContentItem","findItemId","pop","groupId","hideContentParagraph","showContentParagraph","setToolbar","toolbarTarget","updateToolbar","s","sa","toolbarSelection","toolbarAlignedSelection","resetToolbar","Comments","Annotations","Notes","Markers","ContentParagraphs","LinkedContents","requestResults","query","updateQuery","requestToc","tableOfContents","toc","updateViewOptions","payload","displayHidden","updateMode","profile","uiLanguage","displayScopeIds","refreshPreferences","setUILanguage","setContentLanguage","contentLanguage","setProduct","_getState$userProfile","roles","getReadableProductLanguages","setEditScope","setEditMode","readOnly","setUpdateMode","setDisplayHidden","updatePreferences","onError","reason","requestUserProfile","getLanguages","preferences","langs","toConsumableArray","unshift","getEditLanguage","scopes","scope","typeOfScope","Author","getReadableProducts","x","typeOfUserRole","Product","productRole","Undefined","productLanguage","getReadableScopeIds","Scope","scopeRole","getWriteableScopeIds","Contributor","Owner","listNotes","profileState","todos","closeNotes","setNotesIndex","index","makeNotePublicUpdate","UpdateNote","Public","makeNotePrivate","requestGroups","contentLookup","inquirePdfJobs","jobTimestamp","pdfJob","completed","listPdfJobs","pdfJobs","submitPdfJobs","options","reducers","isComplete","friendlyLabels","Debug","newState","Toolbar","notComplete","getLoading","fullName","newParagraphOptOut","search","skip","top","resultQuery","isVirtualized","canEnterUpdateMode","customer","licenses","includeExpiredContentInSearch","readerScopeIds","writerScopeIds","EN","readableLanguages","uilang","getUILanguage","DE","writableScopeIds","productIds","firstUse","displayName","emailAdresses","toolbarVisible","currentIndex","todo","browser","isMobile","is","submittedClient","routing","Router","ressources","epcapp","pctapp","common_open_link","common_error","common_ok","common_cancel","common_cannot_redirect_to_login","common_temporary","common_browser_not_supported","common_placeholder","common_placeholder_short","nav_home","nav_counter","nav_navigation","nav_edit","nav_pdf_generation","nav_admin","nav_faq","nav_account","products_my","content_body_add_annotation","content_outline_delete","content_outline_edit","content_outline_edit_title","content_outline_add_item","content_outline_add_comment","content_outline_add_group","content_outline_add_item_title","content_outline_new_comment_title","content_outline_add_group_title","content_outline_header","content_outline_citation","content_outline_title","content_outline_tags","content_outline_target","content_outline_item","content_outline_group","content_outline_hidden","content_outline_body_hidden","content_outline_header_hidden","content_outline_manual_break","content_outline_layout","content_outline_one_column","content_outline_two_column","content_outline_confirm_delete_item","content_outline_confirm_delete_group","edit_tb_hide_content","edit_tb_show_content","edit_tb_hide_content_par","edit_tb_show_content_par","edit_tb_delete_comment","edit_tb_hide_comment","edit_tb_show_comment","edit_tb_delete_annotation","edit_tb_hide_annotation","edit_tb_show_annotation","edit_tb_delete_note","edit_tb_hide_note","edit_tb_show_note","dropdown_profile","dropdown_account","dropdown_settings","dropdown_edit_account","dropdown_preferences","dropdown_savedItems","dropdown_logOut","sub_bar_toc","sub_bar_contents","sub_bar_notes","sub_bar_search","sub_bar_structure","sub_bar_annotation","sub_bar_show_hidden_elements","sub_bar_toolbox","sub_bar_change_editibility","sub_bar_select_scope","sub_bar_settings","sub_bar_show_last_pdf","sub_bar_create_new_pdf","sub_bar_preview_current_article","sub_bar_change_scope","sub_bar_change_content_language","sub_bar_change_content","sub_bar_overview_of_linkable_annotations","sub_bar_translation","appbar_faqs","appbar_notifications","appbar_login","appbar_account","appbar_logout","appbar_profile","appbar_settings","appbar_shop","appbar_ui_language","appbar_en","appbar_de","appbar_content_language","appbar_preferences","appbar_settings_styles","appbar_table_of_contents","appbar_index","appbar_notes","appbar_search","appbar_pdf_jobs","lookup_content_title_epc","lookup_content_title_pct","lookup_content_target","lookup_content_source","lookup_sections","lookup_articles","lookup_rules","lookup_protocols","edit_tb_ordered_list","edit_tb_unordered_list","edit_tb_increase_indentation","edit_tb_decrease_indentation","edit_tb_add_link","edit_tb_hide","edit_tb_show","edit_tb_delete","edit_tb_add_language","edit_tb_add_language_entry","edit_tb_move_annotation_left","edit_tb_move_annotation_right","edit_tb_add_note","edit_tb_add_inline_annotation","edit_tb_add_annotation","edit_tb_remove_formatting","edit_menu_select_editing_scope","edit_menu_confirm_annotation_hide","edit_menu_confirm_annotation_delete","edit_menu_confirm_note_hide","edit_menu_confirm_note_delete","edit_menu_confirm_paragraph_hide","edit_menu_citation_not_found","shop_learn_more","shop_order","shop_view_details","shop_goto","shop_select_license","shop_your_license","shop_sca_checkout_failure","shop_sca_profileupdate_failure","checkout_checkout","checkout_user_profile","checkout_license_step","checkout_address_step","checkout_eqe_step","checkout_payment_step","checkout_review_step","checkout_view_license","checkout_edit_address","checkout_edit_eqe","checkout_edit_payment","checkout_license","checkout_licenses","checkout_address","checkout_eqe_trainer_address","checkout_eqe_trainer_address_subheader","checkout_payment_details","checkout_payment_details_free_subheader","checkout_review_your_order","checkout_ok","checkout_back","checkout_next","checkout_cancel","checkout_place_order","checkout_law_firm_company","checkout_first_name","checkout_last_name","checkout_address_line_1","checkout_address_line_2","checkout_city","checkout_state_province_region","checkout_zip_postal_code","checkout_country","checkout_thank_you_for_order","checkout_your_order_number","checkout_training_law_firm","checkout_confirm_license","checkout_change_license","checkout_name","checkout_description","checkout_conditions","checkout_only_for_eqe","checkout_license_product","checkout_license_language","checkout_license_pricing","checkout_license_period","checkout_license_term","checkout_select_license","checkout_select","checkout_license_none","checkout_license_go_to_checkout","checkout_order_id","checkout_invoice_code","checkout_license_starts","checkout_license_ends","checkout_license_price","checkout_upgrade","checkout_upgrade_name","checkout_upgrade_date","checkout_upgrade_info","checkout_payment_method","checkout_purchase_on_account","checkout_amazon_pay","checkout_payment_consider_amazon_pay","checkout_payment_amazon_pay_already_setup","checkout_payment_cookies_amazon_pay","checkout_invoice_address","checkout_use_customer_address","checkout_use_eqe_trainer","checkout_enter_address","checkout_company_vat_id","checkout_review_order_summary","checkout_review_total","checkout_review_address","checkout_review_payment_details","checkout_review_payment_method","checkout_review_purchase_on_account","checkout_review_amazon_pay","checkout_review_amazon_pay_invoice_address","checkout_review_invoice_address","checkout_review_vat_id","checkout_review_not_specified","checkout_review_please_take_your","checkout_review_terms_and_conditions","checkout_review_privacy_policy","checkout_review_confirm_terms","checkout_review_confirm_cancellation_terms","checkout_eqe_candidate","checkout_eqe_candidate_subheader","checkout_confirm_eqe_candidate","checkout_eqe_candidate_info","checkout_common_no_vat_included","checkout_common_vat_included","checkout_common_free","checkout_common_for","checkout_common_until","checkout_common_day","checkout_common_days","checkout_common_week","checkout_common_weeks","checkout_common_month","checkout_common_months","checkout_common_year","checkout_common_years","checkout_common_fixed","checkout_common_unlimited","checkout_common_country","checkout_common_please_select","checkout_common_discount","checkout_common_apply","checkout_common_reset","content_outline_item_default","content_outline_item_onecolumn","content_outline_item_twocolumn","notes_title","notes_toolbar_title","search_title","search_search","search_annotation_to","search_results_for","search_nothing_found","search_page_of_pages","search_tip","search_see_faq","search_see_faq_link","pdfJobs_title","pdfJobs_date","pdfJobs_options","pdfJobs_status","pdfJobs_download","pdfJobs_submit","pdfJobs_status_completed","pdfJobs_status_failed","pdfJobs_status_started","pdfJobs_status_submitted","pdfJobs_submit_documentFontSize","pdfJobs_submit_pageMode","pdfJobs_submit_divisioningMode","pdfJobs_pageMode_sectionwiseNumberingWithClearPage","pdfJobs_pageMode_continuousNumberingWithoutClearPage","pdfJobs_divisioningMode_pageWithOverview","pdfJobs_divisioningMode_pageWithoutOverview","pdfJobs_divisioningMode_noPage","pdfJobs_do_include_notes","pdfJobs_with_notes","pdfJobs_print_on_demand","pdfJobs_print_on_demand_options","pdfJobs_yearly_license_required","pdfJobs_order_pod_header","pdfJobs_order_pod","settings_styles_title","settings_styles_none","settings_styles_preview","settings_styles_bold","settings_styles_italic","settings_styles_highlight","settings_styles_underline","settings_styles_strike","settings_styles_text_color","settings_styles_highlight_color","settings_styles_line_color","settings_styles_line_type","settings_styles_line_thickness","settings_styles_line_type_solid","settings_styles_line_type_dashed","settings_styles_line_type_dotted","settings_styles_line_type_double","settings_styles_thickness_1","settings_styles_thickness_2","settings_styles_thickness_3","settings_styles_apply","settings_styles_reset","settings_styles_restore","localized","en","de","TestPage","_React$Component","inherits","className","classes","TestSideBar","Paper_default","TestFooter","TestToolbar","HardLinks","DraftJSUtils","editorState","currentStyles","getCurrentInlineStyle","forEach","Modifier","removeInlineStyle","getSelection","EditorState","getFocusKey","getBlockForKey","types","getCurrentBlock","indexOf","delta","maxDepth","withAdjustment","adjustBlockDepthForContentState","selectionState","adjustment","startKey","getStartKey","endKey","getEndKey","blockMap","getBlockMap","blocks","toSeq","skipUntil","k","takeUntil","get","depth","getDepth","set","merge","selectionBefore","selectionAfter","sel","isCollapsed","anchorKey","getAnchorKey","currentContentBlock","getStartOffset","getEndOffset","getText","slice","trimStart","match","trimEnd","getIsBackward","update","mutability","contentStateWithEntity","createEntity","getLastCreatedEntityKey","contentStateWithLink","applyEntity","StyleFactory","forIcon","cssStyle","isBold","isItalic","fontStyle","isHighlighted","border","highlightColor","defaultHighlightColor","isUnderlined","lineType","borderBottom","lineThickness","lineColor","isStriked","textColor","cssStyles","getCssStyle","toUpperCase","PushPin","viewBox","fill","d","Commands","MakeOrderedList","MakeUnorderedList","IncList","DecList","SetStyle","EraseStyle","MakeContentLink","MoveLeft","MoveRight","Delete","Update","UpdateTitle","CopyToOwn","Hide","Show","Remove","NewAnnotation","NewInlineAnnotation","NewNote","AddLanguage","getListToolbarItems","render","FormatListNumbered_default","command","FormatListBulleted_default","FormatIndentIncrease_default","FormatIndentDecrease_default","getHideToolbarItems","VisibilityOff_default","getShowToolbarItems","Visibility_default","getNewNoteToolbarItems","canAddItem","tbitems","Common_PushPin","getNewParagraphElementToolbarItems","canAddInlineItem","AddComment_default","needsSelection","apply","getStyleToolbarItems","erase","FormatClear_default","Theme","symbol","name","commandArgs","composeToolbarItems","sepIdx","arguments","tblist","isSeperator","makeInactive","inactive","EditMenu","_this","scopeMenu","contentLinkMenu","_this2","disabled","getToolbarItems","editScopes","editScope","isOutlineMode","Toolbar_default","onMouseDown","Button_default","menuButton","variant","toggleOutlineMode","toggleDisplayHidden","toggleEditMode","handleScopeMenuOpen","Menu_default","anchorEl","open","onClose","handleScopeMenuClose","MenuItem_default","arg","handleScopeMenuClick","idx","renderItem","anchorOrigin","horizontal","vertical","handleContentLinkMenuClose","disableAutoFocus","disableAutoFocusItem","results","paragraphTag","handleContentLinkMenuClick","trim","setState","makeEntity","handleEditorChanged","_this3","hasSelection","ref","handleToolbarItemClick","target","opts","canEditBody","canEditObject","linkedContentItem","isLinkedContent","isContentHidden","isContentParagraphHidden","getContentTitleToolbarItems","getContentParagraphToolbarItems","elementScopeId","isHidden","isFallback","areLanguagesCompatible","Common","ChevronLeft_default","ChevronRight_default","DeleteForever_default","Add_default","replace","objectLanguage","handleEditorCommand","handleCommentCommand","handleAnnotationCommand","handleNoteCommand","handleContentCommand","_this4","_DraftJSUtils$getTrim","getTrimmedSelection","input","exact","take","includeExpired","refs","element","ReactDOM","setStyle","eraseStyle","toggleBlockType","adjustBlockDepth","handleAddLanguage","confirm","alignedSelection","removeAllInlineStyles","toggleInlineStyle","canAddInline","canRemove","ConnectedEditMenu","withStyles","linkedContentItemId","bindActionCreators","ViewRegistryStore","UserProfileStore","_Goto","errorInfo","componentStack","_this$props$userProfi","MainAppBar","window","clientConfig","activeTab","activeMenu","menuAnchorEl","isAdmin","role","Global","globalRole","Admin","anyEPCAccess","anyPCTAccess","AppBar_default","position","mainToolbar","MainAppBar_BrandLogo","brandLogo","Tabs_default","isSignedIn","onChange","Tab_default","tabStyle","switchProducts","brandLogoSmall","IconButton_default","aria-label","FormControlLabel_default","control","Switch_default","checked","toggleUpdateMode","Typography_default","handleProfile","location","assign","renderSettingsDropDown","renderAccountDropDown","subToolbar","renderSubToolbar","newProductId","handleClose","handleLogout","contentLanguages","lang","sessionStorage","clear","renderNavToolbar","renderEditToolbar","renderPdfToolbar","renderAdminToolbar","path","pathname","isTableOfContents","toLocaleLowerCase","isNotes","isLookUp","toLowerCase","menuButtonInactive","isPdfJobs","canDownloadPdf","DownloadPdf","BrandLogo","src","brandLogoImage_pct","brandLogoImage_epc","ConnectedMainAppBar","flexGrow","NotesToolbar","currentNote","i_of_n","toolbar","menuText","handlePrev","handleCurrent","handleNext","handleRefresh","renderDefault","handleIndexSet","navigateToContent","ConnectedNotesToolbar","NotesStore","Footer","year","getFullYear","enablePreviewFeatures","ConnectedFooter","background","ProductRedirectPage","params","Redirect","to","ConnectedProductRedirectPage","_TableOfContents","activeItem","scrollIntoView","prevProps","prevLabel","instance","smooth","domNode","behavior","renderToc","renderItems","ul","isActive","targetContentLabel","li","Link","childItems","TableOfContents","spacing","unit","TableOfContentsPage","ConnectedTableOfContentsPage","paper","TableOfContentsStore","TableOfContentsSideBar","ConnectedTableOfContentsSideBar","ErrorContainer","TwoColumn","off","OneColumnGrid","Grid_default","OneColumnItem","_React$Component2","xs","md","isSmall","OneColumn","ArtEPC","RuleEPC","ArtRFeesEPC","ArtProtArt69EPC","ArtProtLondonEPC","ArtProtRecogEPC","SecProtCentrEPC","ProtArt69EPC","ProtLondonEPC","ProtRecogEPC","ProtCentrEPC","ArtPCT","RulePCT","PC","dragItemTypes","dragSource","beginDrag","dragCollect","monitor","connectDragSource","isDragging","_GroupDragSource","_this$props","DragIndicator_default","GroupDragSource","DragSource","_ItemDragSource","_this$props2","ItemDragSource","dropTarget","drop","getItem","getItemType","beforeId","move","handleMove","canDrop","dropCollect","connectDropTarget","isOver","_GroupDropTarget","_this$props3","GroupDropTarget","DropTarget","_ItemDropTarget","_this$props4","ItemDropTarget","_DndContext","DndContext","DragDropContext","HTML5Backend","ContentHeader","labelClass","small","titleClass","tabIndex","onFocus","onFocusChanged","onBlur","ConnectedContentHeader","urlState","getScope","getRelativeScopeInfo","relativeToScopeId","cmp","firstId","secondId","first","second","compareScopes","isOtherScope","isLowerScope","isHigherScope","renderButton","ItemControl","hasFocus","_ScopeUtils$getRelati","ScopeUtils","cannotMove","isReadOnly","renderTitle","delete","titleStyle","mods","modsString","mod","Default","handleUpdate","handleDelete","GroupControl","hasNewItemFocus","hasNewGroupFocus","classNameNewItem","classNameNewGroup","ItemControl_ItemControl","newComment","handleNewChild","newGroup","_ModalDialog","Dialog_default","disableBackdropClick","disableEscapeKeyDown","scroll","layout","DialogTitle_default","DialogContent_default","DialogActions_default","onCancel","isOK","onOK","ModalDialog","breakpoints","up","maxHeight","overflow","stepper","form","buttons","justifyContent","button","UpdateItemForm","_UpdateItemForm","handleCancel","Checkbox_default","FormControl_default","InputLabel_default","htmlFor","Select_default","fullWidth","handleLayoutTypeChange","inputProps","UpdateGroupForm","_UpdateGroupForm","TextField_default","required","NewGroupForm","_NewGroupForm","NewItemForm","_NewItemForm","handleInputChanged","NewCommentForm","_NewCommentForm","ContentOutline","newItemForGroup","newCommentForGroup","newGroupForGroup","viewRegistry_loaderState","viewRegistry_productId","viewRegistry_label","viewRegistry_content","viewRegistry_linkedContentRoot","viewRegistry_friendlyLabels","renderHeader","handleUpdateItem","handleUpdateGroup","desc","handleNewGroup","handleNewItem","handleNewComment","ContentOutline_OutlineControl","ContentHeader_ContentHeader","split","ConnectedContentOutline","OutlineControl","GroupControl_GroupControl","TextBuilder","elements","full","offset","kind","last","len","RangeError","range","splice","range1","range2","range3","insert","txt1","txt2","EditorReadOnlyContext","Editor","FR","handleClick","handleFocus","handleBlur","renderBeforeEditor","getXmlLanguage","Provider","lib_Draft","stripPastedStyles","spellCheck","spellcheck","customStyleMap","placeholder","handleChange","onTab","handleTab","handleReturn","handleKeyCommand","renderAfterEditor","focus","acquireFocus","stopPropagation","isList","isCurrentBlockOfType","getFocusOffset","hasShift","shiftKey","insertSoftNewline","canEdit","customStyles","getCssStyles","Editor_Editor","handleDraftChange","handleDraftFocusChanged","ConnectedNote","Annotation","disableInline","peerHasFocus","User","shift","ConnectedAnnotation","ParagraphBuilder","tb","makeInsertion","renderParagraphItem","List","renderParagraphList","seg","x_","data-idx","renderSegmentMark","renderInlineAnnotation","textLength","getTxtIdxForAnchor","insertInlineAnnotation","startIdx","endIdx","makeRange","renderRange","elems","ranges","getElements","j","elem","FloatRight","Header","ContentParagraph","handleSelectionChange","bind","assertThisInitialized","handleSelectionStart","document","addEventListener","removeEventListener","annotationSpecs","ann","pb","insertInlineAnnotations","makeRangesOfMarkers","handleSelectionStateChanged","unselect","onSelectionChanged","rangeCount","section","getRangeAt","isRangeInside","anchorIdx","getBlockSpanIndex","anchorNode","anchorOffset","focusIdx","focusNode","focusOffset","parSelection","current","commonAncestorContainer","parentNode","node","textContent","nodeType","Node","TEXT_NODE","textOffset","child","childNodes","getTextLength","getTextOffset","getAttribute","nextElementSibling","ConnectedContentParagraph","paragraph","Content","nextProps","nextContext","modifed","OneColumnGrid_OneColumnGrid","OneColumnGrid_OneColumnItem","renderAnnotations","renderNotes","renderBody","renderAddFooterAnnotation","handleParagraphFocusChanged","titleLanguage","info","keys","lastPar","renderedPars","isEllipsis","parAnnotationsAside","parAnnotationsInline","renderedPar","sela","handleParagraphSelectionChanged","twocolumn","newFooterAnnotation","selectionAligned","pk","parKeys","isValidParKey","ConnectedContent","contentRef","annotationIds","includes","paragraphLanguage","contentProps","Content_Content","Comment","canEditTitle","hideTitle","wordWrap","wordBreak","handleTitleChange","handleTitleBlur","newTilte","ConnectedComment","disparch","_ContentOverview","index_es","defaultExpanded","expandIcon","ExpandMore_default","heading","renderGroup","g","ContentOverview","ContentPage","_prevent_reset","_ref","_ref2","scrollLabelIntoView","viewRegistry_isComplete","viewRegistry_mode","entries","stack","headerText","sort","y","localeCompare","subgrps","reverse","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","subgrp","_iteratorNormalCompletion3","_didIteratorError3","_iteratorError3","_step3","_iterator3","entry","_i","NCU","showOverview","ErrorContainer_ErrorContainer","scrollToChild","renderNestedGroups","getElementById","navigateToChild","inner","renderNestedItem","TwoColumn_TwoColumn","ConnectedContentPage","ContentRedirectPage","test","Self","parentLabel","sourceLabel","ChildContent","_this$state","ConnectedContentRedirectPage","NotesPage","activeNote","renderTodosByScope","scopeName","scopeLabel","renderTodosByLabel","group_notes","handleNavigate","renderTodo","find","isAuthorScope","draftContentState","DraftJS","makePublicUpdateNote","makePrivateNote","ConnectedNotesPage","PdfJobsPage","interval","documentFontSize","pageMode","SectionwiseNumberingWithClearPage","divisioningMode","PageWithOverview","pdfStickyNotes","printOnDemand","printOnDemandOrdering","setInterval","forceUpdate","clearInterval","recent","job","parse","submitted","canRequestPOD","PrintOnDemand","paddingTop","submitNewJob","parseInt","formatPageMode","ContinuousNumberingWithoutClearPage","formatDivisioningMode","NoPage","Table_default","TableHead_default","TableRow_default","TableCell_default","TableBody_default","token","downloadLink","downloadToken","origin","formatDateTime","formatTimeDiff","formatTime","formatOptions","processorStatusCode","formatStatus","downloadFilename","size","Completed","confirmPODOrder","Failed","Started","Submitted","pageModeText","divisioningModeText","pdfStickyNotesText","PageWithoutOverview","dateTimeString","locale","toLocaleString","dateTime","time","secs","mins","floor","ConnectedPdfJobsPage","PdfJobsStore","ContentLookupPage","_this$props$viewOptio","is_pct","renderGroupsByTypePCT","renderGroupsByTypeEPC","lookup","rules","prots","ProtPrivEPC","ProtStaffEPC","renderType","arts","targetName","ConnectedContentLookupPage","ContentLookupStore","SearchPage","maxPages","handleQueryChanged","onKeyDown","handleKeyDown","renderResults","newQuery","pageSize","more","pages","TablePagination_default","count","rowsPerPage","rowsPerPageOptions","onChangePage","handleChangePage","nextIconButtonProps","backIconButtonProps","labelDisplayedRows","renderPaginationInfo","displayTitleDe","displayTitleEn","highlightsDe","highlightsEn","linkLabel","linkTitle","linkTitleDe","linkTitleEn","ctrlKey","openResult","b","regexp","RegExp","parts","ConnectedSearchPage","SearchStore","tabRoot","minWidth","fontWeightRegular","_StylesPage","selectedStyleIdx","selectedStyle","noChanges","every","indicatorColor","scrollable","scrollButtons","sm","Card_default","CardContent_default","renderEditStyle","CardActions_default","restoreStyle","CardHeader_default","float","resetStyles","applyStyles","overriddenStyle","parentStyle","alterStyle","sourceStyle","styleType","getStyleType","hasTextColor","RadioGroup_default","handleStyleChange","Radio_default","renderHighlightMenu","renderUnderlineMenu","renderTextColorMenu","_this5","StylesPage_ColorSelectionMenu","selectedColor","colorChanged","_this6","StylesPage_ThicknessSelectionMenu","selectedThickness","thicknessChanged","thickness","Double","Solid","_this7","alteredStyle","isTab","ColorSelectionMenu","_this8","_this9","react_color_lib","hex","ThicknessSelectionMenu","_this12","_this13","selected","routeSpecs","RoutesComponent","once","es_Switch","Route","license","hasLicenseExpired","offer","routeSpec","createRouteElement","renderIncomplete","CheckBrowser","edge","firefox","chrome","safari","opera","alert","ConnectedRoutesComponent","routes","Boolean","hostname","baseUrl","getElementsByTagName","createBrowserHistory","basename","store","initialState","middleware","thunk","enhancers","rootReducer","combineReducers","createStore","compose","applyMiddleware","configureStore","initialReduxState","init","credentials","react_default","createElement","Fragment","CssBaseline_default","es","react_router_redux_es","navigator","serviceWorker","ready","registration","unregister"],"mappings":"6EAAAA,EAAAC,QAAiBC,EAAAC,EAAuB,2ECAxCH,EAAAC,QAAiBC,EAAAC,EAAuB,sTCGlCC,GAAc,EACdC,EAAqC,CACvCC,KAAQ,OACRC,GAAM,OACNC,aAAc,QAGX,SAASC,EAAcC,GAC1B,OAAQA,GACJ,IAAK,UAAW,OAAO,EACvB,IAAK,OAAQ,OAAO,EACpB,IAAK,UAAW,OAAO,EACvB,IAAK,QAAS,OAAO,EACrB,QAAS,OAAQ,GAIlB,SAASC,EAAIC,EAAiBC,EAAkBH,GACnDA,EAAQA,GAAS,OAEjB,IAAMI,EAAeT,EAASQ,GAE9B,GAAIT,GACAU,GACAL,EAAcK,IAAiBL,EAAcC,GAAQ,CACrD,IAAMK,EAAM,IAAIC,KAChBC,QAAQN,IAAR,GAAAO,OAAeH,EAAII,cAAnB,OAAAD,OAAsCL,GAAW,UAAjD,OAAAK,OAAgER,EAAhE,MAAAQ,OAA0EN,KCtBlF,IAAMQ,EACW,UADXA,EAEW,UAFXA,EAGmB,UAHnBA,EAKiB,UALjBA,EAMiB,UANjBA,EAOiB,UAPjBA,EAQiB,UARjBA,EASqB,UAwEdC,EAAS,CAElBC,IAAKC,EAAE,CACHC,QAAS,OACTC,cA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SAAwB1gC,EAAuB0uD,GAClD,IAAMC,EAAa,CACfC,KACA/xC,IAAwB7c,IAItB6uD,EAAY,GAMZC,EAAcC,aAAgBp2D,OAAAyH,EAAA,EAAAzH,CAAA,GAC7B2hB,GAD4B,CAE/BsC,QAASC,OAGb,OAAOmyC,aACHF,EACAJ,EACAO,KAAO/1B,WAAP,GAAQg2B,KAAeh2B,WAAf,EAAmBy1B,IAA3B35D,OAA2C65D,KwD5CrCM,CAAenvD,GADPygC,OAAe2uB,oBzEvBjChuD,GyE0Bc,SAACw9B,EAAoBywB,GAMnC,OALAA,EAAOA,GAAQ,GACfA,EAAI12D,OAAAyH,EAAA,EAAAzH,CAAA,GACG02D,EADH,CAEAC,YAAa,YAEVjuD,MAAMu9B,EAAOywB,GACftsD,KAAK,SAAAhF,GACF,GAAuB,KAAnBA,EAASC,OAAe,CACxB,IAAI2lC,EAAOlD,OAAOiC,SAASkB,SAC3BD,EAAOjlC,mBAAmBilC,GAC1BlD,OAAOiC,SAASC,OAAhB,wCAAA3tC,OAA+D2uC,IAEnE,OAAO5lC,KAKnBmhC,IAASlH,OACLu3B,EAAAlxD,EAAAmxD,cAACD,EAAAlxD,EAAMoxD,SAAP,KACIF,EAAAlxD,EAAAmxD,cAACE,EAAArxD,EAAD,MACAkxD,EAAAlxD,EAAAmxD,cAACG,EAAA,EAAD,CAAUlB,MAAOA,IACbc,EAAAlxD,EAAAmxD,cAACx0D,EAAD,KACIu0D,EAAAlxD,EAAAmxD,cAACI,EAAA,EAAD,CAAiB5vD,QAASA,GAASyuD,MAAOA,IACrCP,OAKjB1V,SAAS+H,eAAe,SDyEpB,kBAAmBsP,WACnBA,UAAUC,cAAcC,MAAMhtD,KAAK,SAAAitD,GAC/BA,EAAaC","file":"static/js/main.36e1682f.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/EPC_Logo_for_dark_bg_path.8484fa4d.svg\";","module.exports = __webpack_public_path__ + \"static/media/PCT_Logo_for_dark_bg_path.f67d1320.svg\";","export type Level = \"VERBOSE\" | \"INFO\" | \"WARNING\" | \"ERROR\";\r\nexport type Channel = \"auth\" | \"render\" | \"focus\" | \"store\" | \"selection\" | \"draft\" | \"ui\" | \"amazon-pay\";\r\n\r\nconst isLoggingOn = true;\r\nconst channels: { [key: string]: Level } = {\r\n \"auth\": \"INFO\",\r\n \"ui\": \"INFO\",\r\n \"amazon-pay\": \"INFO\"\r\n};\r\n\r\nexport function levelToNumber(level: Level) {\r\n switch (level) {\r\n case \"VERBOSE\": return 0;\r\n case \"INFO\": return 1;\r\n case \"WARNING\": return 2;\r\n case \"ERROR\": return 3;\r\n default: return -1;\r\n }\r\n}\r\n\r\nexport function log(message: string, channel: Channel, level?: Level) {\r\n level = level || \"INFO\";\r\n\r\n const channelLevel = channels[channel];\r\n\r\n if (isLoggingOn &&\r\n channelLevel &&\r\n levelToNumber(channelLevel) <= levelToNumber(level)) {\r\n const now = new Date();\r\n console.log(`${now.toISOString()} - ${channel || 'general'} - ${level}: ${message}`);\r\n }\r\n};\r\n\r\nexport function shallowEqual(objA: any, objB: any, compare?: (objA: any, objB: any, indexOrKey?: number | string) => (boolean | undefined), compareContext?: any): boolean {\r\n let ret = compare ? compare.call(compareContext, objA, objB) : void 0;\r\n\r\n if (ret !== void 0) {\r\n return !!ret;\r\n }\r\n\r\n if (objA === objB) {\r\n return true;\r\n }\r\n\r\n if (typeof objA !== \"object\" || !objA || typeof objB !== \"object\" || !objB) {\r\n return false;\r\n }\r\n\r\n let keysA = Object.keys(objA);\r\n let keysB = Object.keys(objB);\r\n\r\n if (keysA.length !== keysB.length) {\r\n return false;\r\n }\r\n\r\n let bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\r\n\r\n // Test for A's keys different from B.\r\n for (let idx = 0; idx < keysA.length; idx++) {\r\n let key = keysA[idx];\r\n\r\n if (!bHasOwnProperty(key)) {\r\n return false;\r\n }\r\n\r\n let valueA = objA[key];\r\n let valueB = objB[key];\r\n\r\n ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\r\n\r\n if (ret === false || (ret === void 0 && valueA !== valueB)) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';\r\nimport { ApplicationState } from './store';\r\nimport * as UserProfileStore from './store/UserProfile';\r\nimport * as Logging from './debug';\r\n\r\nconst Colors = {\r\n primaryDark: '#263238',\r\n primaryMain: '#37474f',\r\n primaryContrastText: '#ffffff',\r\n\r\n secondaryDark_epc: '#b30909',\r\n secondaryMain_epc: '#b71c1c',\r\n secondaryDark_pct: '#0d47a1',\r\n secondaryMain_pct: '#2196f3',\r\n secondaryContrastText: '#fafafa',\r\n};\r\n\r\nexport const getTheme = (productId: \"epc\" | \"pct\") => createMuiTheme({\r\n palette: {\r\n primary: {\r\n dark: Colors.primaryDark,\r\n main: Colors.primaryMain,\r\n contrastText: Colors.primaryContrastText,\r\n },\r\n secondary: {\r\n dark: productId == \"pct\" ? Colors.secondaryDark_pct : Colors.secondaryDark_epc,\r\n main: productId == \"pct\" ? Colors.secondaryMain_pct : Colors.secondaryMain_epc,\r\n contrastText: Colors.secondaryContrastText,\r\n },\r\n },\r\n typography: {\r\n fontSize: 14,\r\n },\r\n shape: {\r\n borderRadius: 0,\r\n },\r\n overrides: {\r\n MuiTab: {\r\n root: {\r\n textTransform: 'none'\r\n },\r\n label: {\r\n fontSize: '1rem',\r\n fontWeight: 400,\r\n }\r\n },\r\n MuiToolbar: {\r\n root: {\r\n paddingLeft: 32,\r\n paddingRight: 32,\r\n }\r\n },\r\n MuiCheckbox: {\r\n root: {\r\n height: \"auto\",\r\n }\r\n },\r\n MuiButton: {\r\n label: {\r\n fontWeight: 400,\r\n },\r\n // does not work!!!\r\n //disabled: {\r\n // color: \"rgba(255,255,255,0.26)\",\r\n //} \r\n },\r\n MuiExpansionPanelSummary: {\r\n root: {\r\n minHeight: \"32px\",\r\n '&$expanded': { minHeight: \"32px\", },\r\n },\r\n content: {\r\n margin: \"8px 0\",\r\n '&$expanded': { margin: \"8px 0\", },\r\n }\r\n },\r\n MuiExpansionPanelDetails: {\r\n root: {\r\n minHeight: \"32px\",\r\n margin: \"0px\",\r\n padding: \"0px\",\r\n }\r\n }\r\n }\r\n});\r\n\r\nexport const styles = {\r\n // root layout\r\n app: $({\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n alignItems: \"stretch\",\r\n width: \"100vm\",\r\n height: \"100vh\",\r\n fontFamily: \"Roboto, Helvetica, Arial, sans-serif\",\r\n }),\r\n nav: $({\r\n flexShrink: 0,\r\n }),\r\n header: $({\r\n flexShrink: 0,\r\n }),\r\n mainPanel: $({\r\n flex: 1,\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n minHeight: 0,// this is important to prevent an overflowing child from growing beyond its parent\r\n }),\r\n sidebar: $({\r\n flexShrink: 0,\r\n height: \"100%\", // this is important to prevent an this element from growing beyond its parent\r\n overflowY: \"auto\",\r\n color: '#999', //TODO !!!\r\n }),\r\n main: $({\r\n flex: 1,\r\n height: \"100%\", // this is important to prevent an this element from growing beyond its parent\r\n overflowY: \"auto\",\r\n padding: \"16px\",\r\n }),\r\n footer: $({\r\n flexShrink: 0,\r\n //backgroundColor: Colors.secondaryDark_epc,\r\n //color: Colors.secondaryContrastText,\r\n height: 36,\r\n padding: 8,\r\n }),\r\n\r\n // components\r\n link: $({\r\n color: '#3b5998',\r\n textDecoration: 'underline',\r\n cursor: \"pointer\"\r\n }),\r\n link_noline: $({\r\n color: '#3b5998',\r\n cursor: \"pointer\"\r\n }),\r\n note: $({\r\n color: '#333',\r\n backgroundColor: '#ffff7f',\r\n minHeight: '24px'\r\n }),\r\n\r\n // page layout\r\n page: $({\r\n maxWidth: 800,\r\n }),\r\n tocSidebar: $({\r\n width: 340,\r\n }),\r\n\r\n // content page layout\r\n\r\n contentHeader: $({\r\n marginTop: 16,\r\n marginBottom: 8\r\n }),\r\n\r\n contentHeader_Small: $({\r\n marginTop: 0,\r\n marginBottom: 4,\r\n display: \"inline-block\"\r\n }),\r\n\r\n contentOutline_OtherScope: $({\r\n color: \"#888\"\r\n }),\r\n\r\n contentOutline_ActiveScope: $({\r\n color: \"#000\"\r\n }),\r\n\r\n /*list-style-type: none;\r\n margin: 0;\r\n padding: 0;*/\r\n container: $({\r\n listStyleType: 'none',\r\n margin: 0,\r\n padding: 0\r\n }),\r\n item: $({\r\n display: 'block',\r\n }),\r\n\r\n // toolbar\r\n tbitem: $({\r\n display: \"inline-block\",\r\n cursor: \"pointer\",\r\n marginLeft: \"4px\",\r\n marginRight: \"4px\",\r\n padding: \"2px 0\",\r\n opacity: 0.66,\r\n }),\r\n tbitem_active: $({\r\n fontWeight: \"bold\",\r\n }),\r\n tbitem_inactive: $({\r\n opacity: 0.33,\r\n }),\r\n tbitem_separator: $({\r\n cursor: \"auto\",\r\n borderLeft: \"1px solid black\",\r\n width: \"1px\",\r\n height: \"1em\",\r\n }),\r\n tbitem_hover: $({\r\n opacity: 1.0,\r\n }),\r\n tbitem_inactive_hover: $({\r\n opacity: 1.0,\r\n }),\r\n tbitem_style_icon: $({\r\n textAlign: 'center',\r\n width: '2rem',\r\n }),\r\n};\r\n\r\n// ensure correct typings\r\nfunction $(style: React.CSSProperties): React.CSSProperties { return style; }\r\n\r\ntype ConnectedMuiThemeProviderProps = {\r\n productId?: string,\r\n children: any\r\n};\r\n\r\nclass _ConnectedMuiThemeProvider extends React.Component {\r\n constructor(props: ConnectedMuiThemeProviderProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n Logging.log(`ConnectedMuiThemeProvider.render: ${this.props.productId}`, \"render\", \"INFO\");\r\n const theme = getTheme(this.props.productId == \"pct\" ? \"pct\" : \"epc\");\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const ConnectedMuiThemeProvide = connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n productId: state.userProfile.viewOptions.productId\r\n }),\r\n)(_ConnectedMuiThemeProvider);\r\n","// styles, themes\r\n\r\n//export { /*Theme,*/ MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';\r\n//export { withStyles/*, StyledComponentProps*/ } from '@material-ui/core/styles';\r\n//export { default as createPalette } from '@material-ui/core/styles/createPalette';\r\n//export { default as createStyles } from '@material-ui/core/styles/createStyles';\r\n\r\n// components\r\n\r\nexport { default as AppBar } from '@material-ui/core/AppBar';\r\nexport { default as Badge } from '@material-ui/core/Badge';\r\nexport { default as Button } from '@material-ui/core/Button';\r\nexport { default as Card } from '@material-ui/core/Card';\r\nexport { default as CardActions } from '@material-ui/core/CardActions';\r\nexport { default as CardHeader } from '@material-ui/core/CardHeader';\r\nexport { default as CardContent } from '@material-ui/core/CardContent';\r\nexport { default as CardMedia } from '@material-ui/core/CardMedia';\r\nexport { default as Checkbox } from '@material-ui/core/Checkbox';\r\nexport { default as CircularProgress } from '@material-ui/core/CircularProgress';\r\nexport { default as CssBaseline } from '@material-ui/core/CssBaseline';\r\nexport { default as Dialog } from '@material-ui/core/Dialog';\r\nexport { default as DialogActions } from '@material-ui/core/DialogActions';\r\nexport { default as DialogContent } from '@material-ui/core/DialogContent';\r\nexport { default as DialogContentText } from '@material-ui/core/DialogContentText';\r\nexport { default as DialogTitle } from '@material-ui/core/DialogTitle';\r\nexport { default as FormControl } from '@material-ui/core/FormControl';\r\nexport { default as FormControlLabel } from '@material-ui/core/FormControlLabel';\r\nexport { default as FormLabel } from '@material-ui/core/FormLabel';\r\nexport { default as IconButton } from '@material-ui/core/IconButton';\r\nexport { default as InputLabel } from '@material-ui/core/InputLabel';\r\nexport { default as Hidden } from '@material-ui/core/Hidden';\r\nexport { default as Grid } from '@material-ui/core/Grid';\r\nexport { default as List } from '@material-ui/core/List';\r\nexport { default as ListItem } from '@material-ui/core/ListItem';\r\nexport { default as ListItemSecondaryAction } from '@material-ui/core/ListItemSecondaryAction';\r\nexport { default as ListItemText } from '@material-ui/core/ListItemText';\r\nexport { default as ListSubheader } from '@material-ui/core/ListSubheader';\r\nexport { default as Menu } from '@material-ui/core/Menu';\r\nexport { default as MenuItem } from '@material-ui/core/MenuItem';\r\nexport { default as MenuList } from '@material-ui/core/MenuList';\r\nexport { default as Modal } from '@material-ui/core/Modal';\r\nexport { default as Paper } from '@material-ui/core/Paper';\r\nexport { default as Pagination } from '@material-ui/core/TablePagination';\r\nexport { default as Radio } from '@material-ui/core/Radio';\r\nexport { default as RadioGroup } from '@material-ui/core/RadioGroup';\r\nexport { default as Select } from '@material-ui/core/Select';\r\nexport { default as Slide } from '@material-ui/core/Slide';\r\nexport { default as Step } from '@material-ui/core/Step';\r\nexport { default as StepLabel } from '@material-ui/core/StepLabel';\r\nexport { default as Stepper } from '@material-ui/core/Stepper';\r\nexport { default as Tab } from '@material-ui/core/Tab';\r\nexport { default as Tabs } from '@material-ui/core/Tabs';\r\nexport { default as Table } from '@material-ui/core/Table';\r\nexport { default as TableBody } from '@material-ui/core/TableBody';\r\nexport { default as TableCell } from '@material-ui/core/TableCell';\r\nexport { default as TableHead } from '@material-ui/core/TableHead';\r\nexport { default as TableRow } from '@material-ui/core/TableRow';\r\nexport { default as Switch } from '@material-ui/core/Switch';\r\nexport { default as TextField } from '@material-ui/core/TextField';\r\nexport { default as Toolbar } from '@material-ui/core/Toolbar';\r\nexport { default as Typography } from '@material-ui/core/Typography';\r\n\r\n// icons\r\n\r\nimport { default as AccessAlarm } from '@material-ui/icons/AccessAlarm';\r\nimport { default as AccountBox } from '@material-ui/icons/AccountBox';\r\nimport { default as AccountCircle } from '@material-ui/icons/AccountCircle';\r\nimport { default as ArrowDropDown } from '@material-ui/icons/ArrowDropDown';\r\nimport { default as ArrowRight } from '@material-ui/icons/ArrowRight';\r\nimport { default as Attachment } from '@material-ui/icons/Attachment';\r\nimport { default as BorderColor } from '@material-ui/icons/BorderColor';\r\nimport { default as Check } from '@material-ui/icons/Check';\r\nimport { default as Close } from '@material-ui/icons/Close';\r\nimport { default as CloudDownload } from '@material-ui/icons/CloudDownload';\r\nimport { default as ColorLens } from '@material-ui/icons/ColorLens';\r\nimport { default as Edit } from '@material-ui/icons/Edit';\r\nimport { default as FilterFrames } from '@material-ui/icons/FilterFrames';\r\nimport { default as FormatUnderlined } from '@material-ui/icons/FormatUnderlined';\r\nimport { default as InsertLink } from '@material-ui/icons/InsertLink';\r\nimport { default as LibraryBooks } from '@material-ui/icons/LibraryBooks';\r\nimport { default as MenuIcon } from '@material-ui/icons/Menu';\r\nimport { default as NavigateBefore } from '@material-ui/icons/NavigateBefore';\r\nimport { default as NavigateNext } from '@material-ui/icons/NavigateNext';\r\nimport { default as Navigation } from '@material-ui/icons/Navigation';\r\nimport { default as Note } from '@material-ui/icons/Note';\r\nimport { default as Notifications } from '@material-ui/icons/Notifications';\r\nimport { default as NotificationsActive } from '@material-ui/icons/NotificationsActive';\r\nimport { default as Person } from '@material-ui/icons/Person';\r\nimport { default as QuestionAnswer } from '@material-ui/icons/QuestionAnswer';\r\nimport { default as Refresh } from '@material-ui/icons/Refresh';\r\nimport { default as Search } from '@material-ui/icons/Search';\r\nimport { default as Settings } from '@material-ui/icons/Settings';\r\nimport { default as Shop } from '@material-ui/icons/Shop';\r\nimport { default as Visibility } from '@material-ui/icons/Visibility';\r\n\r\nexport const Icons = {\r\n AccessAlarm,\r\n AccountBox,\r\n AccountCircle,\r\n ArrowDropDown,\r\n ArrowRight,\r\n Attachment,\r\n BorderColor,\r\n Check,\r\n CloudDownload,\r\n Close,\r\n ColorLens,\r\n Edit,\r\n FormatUnderlined,\r\n FilterFrames,\r\n InsertLink,\r\n LibraryBooks,\r\n MenuIcon,\r\n NavigateBefore,\r\n NavigateNext,\r\n Navigation,\r\n Note,\r\n Notifications,\r\n NotificationsActive,\r\n Person,\r\n QuestionAnswer,\r\n Refresh,\r\n Search,\r\n Settings,\r\n Shop,\r\n Visibility,\r\n};\r\n\r\n// typography\r\n\r\n","import * as React from \"react\";\r\n\r\n// component dependencies\r\nimport { CircularProgress } from '../libs/material-ui';\r\n\r\n/** state for components that load and display data */\r\nexport interface LoaderState {\r\n isLoading: boolean;\r\n isLoaded: boolean;\r\n hasError: boolean;\r\n errorMessage: string | null;\r\n}\r\n\r\n/** utility for providing common loader states and for displaying loader states */\r\nexport class LoaderStateUtil {\r\n static getEmpty(): LoaderState {\r\n return {\r\n isLoading: false,\r\n isLoaded: false,\r\n hasError: false,\r\n errorMessage: null\r\n };\r\n }\r\n\r\n static getLoading(): LoaderState {\r\n return {\r\n isLoading: true,\r\n isLoaded: false,\r\n hasError: false,\r\n errorMessage: null\r\n };\r\n }\r\n\r\n static getLoaded(): LoaderState {\r\n return {\r\n isLoading: false,\r\n isLoaded: true,\r\n hasError: false,\r\n errorMessage: null\r\n };\r\n }\r\n\r\n /**\r\n * get loader state for an error, in particular, an axios error; see https://github.com/axios/axios\r\n * @param error\r\n */\r\n static getError(error: any): LoaderState {\r\n\r\n let msg = \"\";\r\n if (!error) {\r\n msg = \"An unexpected error occured.\"; // -> string resource\r\n } else if (error.response) {\r\n // this is an axios error returned in the response from the server\r\n console.log(error.response.status); \r\n msg = error.response.statusText;\r\n } else if (error.request) {\r\n // this is an axios error relating to a network problem\r\n console.log(error.request); \r\n msg = error.message;\r\n } else if (error.message) {\r\n // this is a generic error\r\n msg = error.message; \r\n } else if (error.toString) {\r\n // error is something that can be converted to a string\r\n msg = error.toString();\r\n } else {\r\n // error is something else\r\n msg = \"\" + error;\r\n }\r\n\r\n return {\r\n isLoading: false,\r\n isLoaded: false,\r\n hasError: true,\r\n errorMessage: msg\r\n };\r\n }\r\n\r\n static isLoaded(state: LoaderState) {\r\n return state && state.isLoaded;\r\n }\r\n\r\n /**\r\n * render default components for a loader state; the loaded state has no default\r\n * @param state the loader state; may be null\r\n */\r\n static renderDefault(state: LoaderState) {\r\n // TODO use fancier components\r\n if (LoaderStateUtil.isLoaded(state)) {\r\n return false; // there is no default for the loaded state\r\n } else if (state && state.isLoading) {\r\n return

loading...
;\r\n } else if (state && state.hasError) {\r\n return
Error: {state.errorMessage}
; \r\n } else {\r\n return

mounting...
;\r\n } \r\n }\r\n}","\r\nexport function getExternalLinkUrl(url: string) {\r\n return url;\r\n}\r\n\r\nexport function getPdfUrl(token: string) {\r\n return window.location.origin + `/download/pdf?token=${encodeURIComponent(token)}`;\r\n}\r\n\r\nexport function getRootPageUrl() {\r\n return `/`;\r\n}\r\n\r\n//export function getProductsPageUrl() {\r\n// return `/product`;\r\n//}\r\n\r\n//export function getLicensePageUrl() {\r\n// return `/product`;\r\n//}\r\n\r\nexport function getProductPageUrl(productId: string) {\r\n return `/product/${productId}`;\r\n}\r\n\r\nexport function getTableOfContentsPageUrl() {\r\n return `/toc`;\r\n} \r\n\r\nexport function getContentPageUrl(label: string, childLabel?: string) {\r\n return `/content/${label}` + (childLabel ? `/${childLabel}` : \"\");\r\n} \r\n\r\nexport function getContentRedirectPageUrl(label: string, parKeyOrTag: string | undefined) {\r\n if (parKeyOrTag)\r\n return `/redirect/${label}/${encodeURIComponent(parKeyOrTag)}`;\r\n else\r\n return `/redirect/${label}`;\r\n} \r\n\r\nexport function getNotesPageUrl() {\r\n return `/notes`;\r\n}\r\n\r\nexport function getSearchPageUrl() {\r\n return `/search`;\r\n}\r\n\r\nexport function getPdfJobsPageUrl() {\r\n return `/pdf`;\r\n} \r\n\r\nexport function getLookupPageUrl() {\r\n return `/lookup`;\r\n} \r\n\r\nexport function getCheckoutPageUrl() {\r\n return `/checkout`;\r\n}\r\n\r\nexport function getShopPageUrl() {\r\n return `/shop`;\r\n}\r\n\r\nexport function getProfilePageUrl() {\r\n return `/profile`;\r\n}\r\n\r\nexport function getPODOrderPageUrl(productId: string, jobTimestamp: string) {\r\n return `/shop/podorder/${productId}/${jobTimestamp}`;\r\n}\r\n","import * as React from \"react\";\r\nimport * as PropTypes from 'prop-types';\r\n\r\nimport * as Nav from \"../../navigation\";\r\nimport { styles } from \"../../theme\";\r\nimport * as WebApi from \"../../webapi\";\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\n\r\nimport {\r\n Editor, EditorState, ContentState, ContentBlock,\r\n CompositeDecorator,\r\n RichUtils, Modifier, convertFromRaw, convertToRaw, SelectionState\r\n} from \"draft-js\";\r\n\r\nimport { EditorReadOnlyContext } from '../../components/edit/EditorReadOnlyContext';\r\n\r\nexport const ContentLinkDecorator = (/*!productId: string*/) => ({\r\n strategy: findLinkEntities,\r\n component: (props: any) => renderLink(/*!productId, */props)\r\n});\r\n\r\nfunction findLinkEntities(block: ContentBlock, callback: (start: number, end: number) => void, contentState: ContentState) {\r\n block.findEntityRanges(\r\n (character) => {\r\n const entityKey = character.getEntity();\r\n return (\r\n entityKey !== null &&\r\n contentState.getEntity(entityKey).getType() == \"CONTENTLINK\"\r\n );\r\n },\r\n callback\r\n );\r\n}\r\n\r\nfunction renderLink(/*!productId: string, */props: any) {\r\n const { label, parTag } = props.contentState.getEntity(props.entityKey).getData();\r\n const href = Nav.getContentRedirectPageUrl(/*!productId, */label, parTag);\r\n const target = \"_self\";\r\n\r\n return ( //! productId={productId} \r\n \r\n {props.children}\r\n \r\n );\r\n}\r\n\r\ninterface ContentLinkProps {\r\n //productId: string,\r\n label: string,\r\n parTag?: string,\r\n offsetkey?: string,\r\n children?: React.ReactNode\r\n};\r\n\r\nclass ContentLink extends React.Component {\r\n // important!\r\n static contextTypes = {\r\n router: PropTypes.any,\r\n };\r\n\r\n constructor(props: ContentLinkProps) {\r\n super(props);\r\n }\r\n\r\n //shouldComponentUpdate(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): boolean {\r\n // return nextProps.label !== this.props.label ||\r\n // nextProps.productId !== this.props.productId ||\r\n // nextProps.offsetkey !== this.props.offsetkey ||\r\n // nextProps.children !== this.;\r\n //}\r\n\r\n render() {\r\n const href = Nav.getContentRedirectPageUrl(/*!this.props.productId, */this.props.label, this.props.parTag);\r\n const { history } = this.context.router;\r\n\r\n return (\r\n {\r\n let anchorObject = evt.currentTarget;\r\n if (!anchorObject.isContentEditable) {\r\n\r\n history.push(href);\r\n\r\n // check if content has body; \r\n\r\n ////TODO decide whether to navigate to content or open new tab with external url \r\n //// depending on whether content is in toc or linked by some content in toc\r\n\r\n //// for now, determine based on type of content \r\n //if (this.props.label.startsWith('EPC-A') || this.props.label.startsWith('EPC-RFees-A')) {\r\n // history.push(href);\r\n //}\r\n //else {\r\n // WebApi.searchRef({\r\n // productId: this.props.productId,\r\n // label: this.props.label,\r\n // type: Model.LabelReferralType.ChildContent\r\n // }).then(result => {\r\n // if (result.models.length == 0)\r\n // history.push(href);\r\n // else \r\n // history.push(Nav.getContentPageUrl(\r\n // this.props.productId,\r\n // result.models[0].sourceLabel!,\r\n // this.props.label,\r\n // ));\r\n // })\r\n // .catch(error => {\r\n // console.error(error);\r\n // history.push(href);\r\n // })\r\n //}\r\n }\r\n evt.preventDefault();\r\n }}>\r\n {this.props.children}\r\n \r\n );\r\n\r\n //const readOnly = true;\r\n\r\n //return (\r\n // !readOnly ?\r\n // \r\n // {this.props.children}\r\n // :\r\n // {\r\n // history.push(href);\r\n // evt.preventDefault();\r\n // }}>\r\n // {this.props.children}\r\n // \r\n //);\r\n\r\n\r\n // using EditorReadOnlyContext.Consumer causes too many update which move the cursor in the editor\r\n\r\n //return (\r\n // \r\n // {value => !value.readOnly ?\r\n // \r\n // {this.props.children}\r\n // :\r\n // {\r\n // history.push(href);\r\n // evt.preventDefault();\r\n // }}>\r\n // {this.props.children}\r\n // \r\n // }\r\n // \r\n //);\r\n }\r\n}","import * as React from \"react\";\r\n\r\n/** state for components that sync data */\r\nexport interface SyncState {\r\n isModified: boolean;\r\n isSyncing: boolean;\r\n isSynced: boolean;\r\n isConflict: boolean;\r\n hasError: boolean;\r\n errorMessage: string | null;\r\n}\r\n\r\n/** utility for providing common sync states and for displaying sync states */\r\nexport class SyncStateUtil {\r\n static getEmpty(): SyncState {\r\n return {\r\n isModified: false,\r\n isSyncing: false,\r\n isSynced: false,\r\n isConflict: false,\r\n hasError: false,\r\n errorMessage: null\r\n };\r\n }\r\n\r\n static getSyncing(prevState: SyncState): SyncState {\r\n return {\r\n ...prevState,\r\n isSyncing: true,\r\n isSynced: false,\r\n isConflict: false,\r\n hasError: false,\r\n errorMessage: null\r\n };\r\n }\r\n\r\n static getModified(prevState: SyncState): SyncState {\r\n return {\r\n ...prevState,\r\n isModified: true\r\n };\r\n }\r\n\r\n static getSynced(): SyncState {\r\n return {\r\n isModified: false,\r\n isSyncing: false,\r\n isSynced: true,\r\n isConflict: false,\r\n hasError: false,\r\n errorMessage: null\r\n };\r\n }\r\n\r\n /**\r\n * get sync state for an error, in particular, an axios error; see https://github.com/axios/axios\r\n * @param error\r\n */\r\n static getError(prevState: SyncState, error: any): SyncState {\r\n\r\n let msg = \"\";\r\n let isConflict = false;\r\n if (!error) {\r\n msg = \"An unexpected error occured.\"; // -> string resource\r\n } else if (error.response) {\r\n // this is an axios error returned in the response from the server\r\n msg = error.response.statusText;\r\n if (error.response.statusCode == 409)\r\n isConflict = true;\r\n } else if (error.request) {\r\n // this is an axios error relating to a network problem\r\n console.log(error.request); \r\n msg = error.message;\r\n } else if (error.message) {\r\n // this is a generic error\r\n msg = error.message; \r\n } else if (error.toString) {\r\n // error is something that can be converted to a string\r\n msg = error.toString();\r\n } else {\r\n // error is something else\r\n msg = \"\" + error;\r\n }\r\n\r\n return {\r\n ...prevState,\r\n isSyncing: false,\r\n isSynced: false,\r\n isConflict: isConflict,\r\n hasError: true,\r\n errorMessage: msg\r\n };\r\n }\r\n\r\n static removeError(prevState: SyncState): SyncState {\r\n return {\r\n ...prevState,\r\n isConflict: false,\r\n hasError: false,\r\n errorMessage: null\r\n };\r\n }\r\n\r\n static isSynced(state: SyncState) {\r\n return state && state.isSynced;\r\n }\r\n}","import * as _ from 'lodash';\r\nimport * as Model from './viewmodels/EPCDataModel';\r\n\r\ntype FetchType = (input: RequestInfo, init?: RequestInit) => Promise;\r\n\r\nlet thisFetch: FetchType = fetch;\r\n//let opt: qs.IStringifyOptions = { arrayFormat: \"repeat\" };\r\n\r\nexport function configureWebApi(nextFetch: FetchType) {\r\n thisFetch = nextFetch;\r\n}\r\n\r\nfunction asJson(response: Response) {\r\n if (response.ok) {\r\n return response.json() as Promise;\r\n }\r\n else {\r\n return new Promise((resolve, reject) => {\r\n reject(response.status + \": \" + response.statusText);\r\n });\r\n }\r\n}\r\n\r\nfunction ensureOK(response: Response): PromiseLike {\r\n return response.ok ? Promise.resolve() : Promise.reject(response.statusText);\r\n}\r\n\r\nfunction ensureStatus(response: Response, codes: number[]): PromiseLike {\r\n return _.includes(codes, response.status) ? Promise.resolve() : Promise.reject(response.statusText);\r\n}\r\n\r\nfunction setEnvHeader(init: RequestInit | undefined, env: string) {\r\n init = init || {};\r\n init = {\r\n ...init,\r\n headers: {\r\n ...init.headers,\r\n \"Environment\": env\r\n }\r\n };\r\n return init;\r\n}\r\n\r\nconst httpGet = (url: string) => thisFetch(url, {\r\n method: \"GET\",\r\n headers: {\r\n 'Accept': 'application/json',\r\n },\r\n});\r\n\r\nconst httpPost = (url: string, data: any) => thisFetch(url, {\r\n method: \"POST\",\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(data),\r\n});\r\n\r\nconst httpPut = (url: string, data: any) => thisFetch(url, {\r\n method: \"PUT\",\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(data)\r\n});\r\n\r\nconst httpPatch = (url: string, data: any) => thisFetch(url, {\r\n method: \"PATCH\",\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(data)\r\n});\r\n\r\nconst httpDelete = (url: string) => thisFetch(url, {\r\n method: \"DELETE\",\r\n headers: {\r\n 'Accept': 'application/json',\r\n },\r\n});\r\n\r\n// TableOfContentsController\r\nexport function getTableOfContents(dto: Model.TableOfContentsGetDto) {\r\n let url = `api/TableOfContents/Get`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\n// UserProfileController\r\nexport function getCurrentUserProfile(dto: Model.UserProfileGetCurrentDto) {\r\n let url = `api/UserProfile/GetCurrent`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function patchUserProfileSettings(dto: Model.UserProfilePatchSettingsDto) {\r\n let url = `api/UserProfile/PatchSettings`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function getUserProfilePreferences(dto: Model.UserProfileGetPreferencesDto) {\r\n let url = `api/UserProfile/GetPreferences`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function patchUserProfilePreferences(dto: Model.UserProfilePatchPreferencesDto) {\r\n let url = `api/UserProfile/PatchPreferences`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\n// ContentController\r\nexport function getContent(dto: Model.ContentGetDto) {\r\n let url = `api/Content/Get`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function getManyContents(dto: Model.ContentGetManyDto) {\r\n let url = `api/Content/GetMany`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\n// CommentController\r\nexport function getComment(dto: Model.CommentGetDto) {\r\n let url = `api/Comment/Get`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function getManyComments(dto: Model.CommentGetManyDto) {\r\n let url = `api/Comment/GetMany`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function postComment(dto: Model.CommentPostDto) {\r\n let url = `api/Comment/Post`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function copyComment(dto: Model.CommentCopyDto) {\r\n let url = `api/Comment/Copy`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function patchComment(dto: Model.CommentPatchDto) {\r\n let url = `api/Comment/Patch`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function deleteComment(dto: Model.CommentDeleteDto) {\r\n let url = `api/Comment/Delete`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\n// AnnotationController\r\nexport function patchAnnotation(dto: Model.AnnotationPatchDto) {\r\n let url = `api/Annotation/Patch`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function postAnnotation(dto: Model.AnnotationPostDto) {\r\n let url = `api/Annotation/Post`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function copyAnnotation(dto: Model.AnnotationCopyDto) {\r\n let url = `api/Annotation/Copy`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function deleteAnnotation(dto: Model.AnnotationDeleteDto) {\r\n let url = `api/Annotation/Delete`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function hideAnnotation(dto: Model.AnnotationHideDto) {\r\n let url = `api/Annotation/Hide`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function showAnnotation(dto: Model.AnnotationShowDto) {\r\n let url = `api/Annotation/Show`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\n// NoteController\r\nexport function patchNote(dto: Model.NotePatchDto) {\r\n let url = `api/Note/Patch`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function postNote(dto: Model.NotePostDto) {\r\n let url = `api/Note/Post`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function deleteNote(dto: Model.NoteDeleteDto) {\r\n let url = `api/Note/Delete`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function hideNote(dto: Model.NoteHideDto) {\r\n let url = `api/Note/Hide`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function showNote(dto: Model.NoteShowDto) {\r\n let url = `api/Note/Show`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function listNotes(dto: Model.NoteListDto) {\r\n let url = `api/Note/List`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\n// MarkerController\r\nexport function postMarker(dto: Model.MarkerPostDto) {\r\n let url = `api/Marker/Post`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function deleteMarker(dto: Model.MarkerDeleteDto) {\r\n let url = `api/Marker/Delete`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function hideMarker(dto: Model.MarkerHideDto) {\r\n let url = `api/Marker/Hide`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\n// LinkedContentController\r\nexport function getLinkedContent(dto: Model.LinkedContentGetDto) {\r\n let url = `api/LinkedContent/Get`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function postLinkedContentItem(dto: Model.LinkedContentPostItemDto) {\r\n let url = `api/LinkedContent/PostItem`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function postLinkedContentNewComment(dto: Model.LinkedContentPostNewCommentDto) {\r\n let url = `api/LinkedContent/PostNewComment`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function patchLinkedContentItem(dto: Model.LinkedContentPatchItemDto) {\r\n let url = `api/LinkedContent/PatchItem`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function moveLinkedContentItem(dto: Model.LinkedContentMoveItemDto) {\r\n let url = `api/LinkedContent/MoveItem`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function deleteLinkedContentItem(dto: Model.LinkedContentDeleteItemDto) {\r\n let url = `api/LinkedContent/DeleteItem`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function postLinkedContentGroup(dto: Model.LinkedContentPostGroupDto) {\r\n let url = `api/LinkedContent/PostGroup`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function patchLinkedContentGroup(dto: Model.LinkedContentPatchGroupDto) {\r\n let url = `api/LinkedContent/PatchGroup`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function moveLinkedContentGroup(dto: Model.LinkedContentMoveGroupDto) {\r\n let url = `api/LinkedContent/MoveGroup`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function deleteLinkedContentGroup(dto: Model.LinkedContentDeleteGroupDto) {\r\n let url = `api/LinkedContent/DeleteGroup`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function hideLinkedContentParagraph(dto: Model.LinkedContentHideParagraphDto) {\r\n let url = `api/LinkedContent/HideParagraph`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\nexport function showLinkedContentParagraph(dto: Model.LinkedContentShowParagraphDto) {\r\n let url = `api/LinkedContent/ShowParagraph`;\r\n return httpPost(url, dto).then(ensureOK);\r\n}\r\n\r\n//// LicenseController\r\n//export function getLicenseCustomer(dto: Model.LicenseGetCustomerDto) {\r\n// let url = `api/License/GetCustomer`;\r\n// return httpPost(url, dto).then(response => asJson(response));\r\n//}\r\n\r\n//export function patchLicenseCustomer(dto: Model.LicenseCreateOrPatchCustomerDto) {\r\n// let url = `api/License/PatchCustomer`;\r\n// return httpPost(url, dto).then(response => asJson(response));\r\n//}\r\n\r\n//export function getLicenseOffers(dto: Model.LicenseGetOffersDto) {\r\n// let url = `api/License/GetOffers`;\r\n// return httpPost(url, dto).then(response => asJson(response));\r\n//}\r\n\r\n//export function getLicenseCountries(dto: Model.LicenseGetCountriesDto) {\r\n// let url = `api/License/GetCountries`;\r\n// return httpPost(url, dto).then(response => asJson(response));\r\n//}\r\n\r\n//export function acquireLicenseSingleUser(dto: Model.LicenseAcquireSingleUserDto) {\r\n// let url = `api/License/AcquireSingleUser`;\r\n// return httpPost(url, dto).then(response => asJson(response));\r\n//}\r\n\r\n// ShopController\r\nexport function getShop(dto: Model.ShopGetDto) {\r\n let url = `api/Shop/Get`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function initShopSCA(dto: Model.ShopInitSCADto) {\r\n let url = `api/Shop/InitSCA`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function cancelShopSCA(dto: Model.ShopCancelSCADto) {\r\n let url = `api/Shop/ConfirmSCA`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function confirmShopSCA(dto: Model.ShopConfirmSCADto) {\r\n let url = `api/Shop/ConfirmSCA`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function placeShopOrder(dto: Model.ShopPlaceOrderDto) {\r\n let url = `api/Shop/PlaceOrder`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function finalizeShopOrder(dto: Model.ShopFinalizeOrderDto) {\r\n let url = `api/Shop/FinalizeOrder`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function getShopOrder(dto: Model.ShopGetOrderDto) {\r\n let url = `api/Shop/GetOrder`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\n// SearchController\r\n\r\nexport function searchContent(input: string) {\r\n let query = `?input=${input}`;\r\n\r\n let url = `api/Search/content?${query}`;\r\n return httpGet(url).then(response => asJson(response));\r\n}\r\n\r\nexport function lookupSearch(dto: Model.SearchQueryDto) {\r\n let url = `api/Lookup/Search`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\n//export function searchComment(input: string, productId: string, scopeIds: string[]) {\r\n// //let query = qs.stringify({ input, productId, scopeIds }, opt);\r\n// let query = ``;\r\n\r\n// let url = `api/Search/comment?${query}`;\r\n// return httpGet(url).then(response => asJson(response));\r\n//}\r\n\r\n// LookupController\r\nexport function getContentRef(dto: Model.SearchGetRefDto) {\r\n let url = `api/Lookup/GetContentRef`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function lookupForContent(dto: Model.LookupForContentDto) {\r\n let url = `api/Lookup/ForContent`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function resolveCitation(dto: Model.SearchGetCitationDto) {\r\n let url = `api/Lookup/ResolveCitation`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\n// PdfJobController\r\nexport function listPdfJobs(dto: Model.PdfJobListDto) {\r\n let url = `api/PdfJob/List`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function submitPdfJob(dto: Model.PdfJobSubmitDto) {\r\n let url = `api/PdfJob/Submit`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function inquirePdfJob(dto: Model.PdfJobInquireDto) {\r\n let url = `api/PdfJob/Inquire`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\nexport function orderPdfJobPOD(dto: Model.PdfJobPODOrderDto) {\r\n let url = `api/PdfJob/OrderPOD`;\r\n return httpPost(url, dto).then(response => asJson(response));\r\n}\r\n\r\n","/*** generated: 17.10.2019 16:53:34 ***/\r\n\r\n/*** AddLinkedContentDto ***/\r\nexport interface AddLinkedContentDto {\r\n /* ParentId */\r\n parentId?: string,\r\n /* TargetLabel */\r\n targetContentLabel?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Id */\r\n id?: string,\r\n /* HideBody */\r\n hideBody?: boolean,\r\n /* OptOut */\r\n optOut?: boolean,\r\n /* LayoutType */\r\n layoutType?: LayoutType\r\n}\r\n\r\n\r\n/*** AddLinkedContentGroupDto ***/\r\nexport interface AddLinkedContentGroupDto {\r\n /* ParentId */\r\n parentId?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Id */\r\n id?: string,\r\n /* Header */\r\n header?: string,\r\n /* HideHeader */\r\n hideHeader?: boolean,\r\n /* BreakSection */\r\n breakSection?: boolean,\r\n /* Language */\r\n language?: Language\r\n}\r\n\r\n\r\n/*** Address ***/\r\nexport interface Address {\r\n /* CompanyName */\r\n companyName?: string,\r\n /* FirstName */\r\n firstName?: string,\r\n /* LastName */\r\n lastName?: string,\r\n /* AddressLine1 */\r\n addressLine1: string,\r\n /* AddressLine2 */\r\n addressLine2?: string,\r\n /* City */\r\n city: string,\r\n /* State */\r\n state?: string,\r\n /* PostCode */\r\n postCode: string,\r\n /* CountryCode */\r\n countryCode: string\r\n}\r\n\r\n\r\n/*** AddressVM ***/\r\nexport interface AddressVM {\r\n /* Id */\r\n id: number,\r\n /* CompanyName */\r\n companyName?: string,\r\n /* FirstName */\r\n firstName?: string,\r\n /* LastName */\r\n lastName?: string,\r\n /* AddressLine1 */\r\n addressLine1: string,\r\n /* AddressLine2 */\r\n addressLine2?: string,\r\n /* City */\r\n city: string,\r\n /* State */\r\n state?: string,\r\n /* PostCode */\r\n postCode: string,\r\n /* CountryCode */\r\n countryCode: string\r\n}\r\n\r\n\r\n/*** AmazonPaySCAConfirmDto ***/\r\nexport interface AmazonPaySCAConfirmDto {\r\n /* AccessToken */\r\n accessToken?: string,\r\n /* BillingAgreementId */\r\n billingAgreementId?: string\r\n}\r\n\r\n\r\n/*** AmazonPaySCAConfirmResultDto ***/\r\nexport interface AmazonPaySCAConfirmResultDto {\r\n /* IsSuccess */\r\n isSuccess?: boolean,\r\n /* Message */\r\n message?: string\r\n}\r\n\r\n\r\n/*** Anchor ***/\r\nexport interface Anchor {\r\n /* TextBlock */\r\n textBlock?: number,\r\n /* Segment */\r\n segment?: number,\r\n /* TargetMD5 */\r\n targetMd5?: string,\r\n /* Start */\r\n start?: number,\r\n /* End */\r\n end?: number\r\n}\r\n\r\n\r\n/*** AnnotationCopyDto ***/\r\nexport interface AnnotationCopyDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* NewScopeId */\r\n newScopeId?: string,\r\n /* Language */\r\n language?: Language,\r\n /* NewLanguage */\r\n newLanguage?: Language,\r\n /* ActiveDraftLanguages */\r\n activeDraftLanguages: Language[],\r\n /* ActiveAnchorLanguage */\r\n activeAnchorLanguage: Language\r\n}\r\n\r\n\r\n/*** AnnotationCopyResultDto ***/\r\nexport interface AnnotationCopyResultDto {\r\n /* Model */\r\n model: AnnotationVM\r\n}\r\n\r\n\r\n/*** AnnotationDeleteDto ***/\r\nexport interface AnnotationDeleteDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string\r\n}\r\n\r\n\r\n/*** AnnotationHideDto ***/\r\nexport interface AnnotationHideDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* EditScopeId */\r\n editScopeId: string\r\n}\r\n\r\n\r\n/*** AnnotationPatchDto ***/\r\nexport interface AnnotationPatchDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* ETag */\r\n etag?: string,\r\n /* DraftLanguage */\r\n draftLanguage?: Language,\r\n /* AnchorLanguage */\r\n anchorLanguage?: Language,\r\n /* Draft */\r\n draft?: any,\r\n /* Anchor */\r\n anchor?: Anchor\r\n}\r\n\r\n\r\n/*** AnnotationPostDto ***/\r\nexport interface AnnotationPostDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* ParagraphKey */\r\n paragraphKey: string,\r\n /* DraftLanguage */\r\n draftLanguage: Language,\r\n /* Draft */\r\n draft: any,\r\n /* IsInline */\r\n isInline?: boolean,\r\n /* AnchorLanguage */\r\n anchorLanguage?: Language,\r\n /* Anchor */\r\n anchor?: Anchor\r\n}\r\n\r\n\r\n/*** AnnotationPostResultDto ***/\r\nexport interface AnnotationPostResultDto {\r\n /* Model */\r\n model: AnnotationVM\r\n}\r\n\r\n\r\n/*** AnnotationShowDto ***/\r\nexport interface AnnotationShowDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* EditScopeId */\r\n editScopeId: string\r\n}\r\n\r\n\r\n/*** AnnotationVM ***/\r\nexport interface AnnotationVM {\r\n /* Id */\r\n id?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* IsInline */\r\n isInline?: boolean,\r\n /* SortOrder */\r\n sortOrder?: string,\r\n /* Draft */\r\n draft?: LocalizedDraftVM,\r\n /* Anchor */\r\n anchor?: LocalizedAnchorVM,\r\n /* OptOut */\r\n optOut?: boolean,\r\n /* OutOfSync */\r\n outOfSync?: boolean\r\n}\r\n\r\n\r\n/*** ApplicationVM ***/\r\nexport interface ApplicationVM {\r\n /* Body */\r\n body?: any,\r\n /* Settings */\r\n settings?: any,\r\n /* Data */\r\n data?: any\r\n}\r\n\r\n\r\n/*** BookVM ***/\r\nexport interface BookVM {\r\n /* TableOfContent */\r\n tableOfContent?: TableOfContentVM,\r\n /* Contents */\r\n contents?: ContentVM[],\r\n /* Comments */\r\n comments?: CommentVM[],\r\n /* MissingContents */\r\n missingContents?: string[],\r\n /* MissingComments */\r\n missingComments?: string[],\r\n /* Settings */\r\n settings?: SettingsVM\r\n}\r\n\r\n\r\n/*** ClientAppVM ***/\r\nexport interface ClientAppVM {\r\n /* Settings */\r\n settings?: SettingsVM,\r\n /* Products */\r\n products?: ProductVM[],\r\n /* Tocs */\r\n tocs?: TableOfContentVM[],\r\n /* StartUpRoute */\r\n startUpRoute?: string\r\n}\r\n\r\n\r\n/*** CommentCopyDto ***/\r\nexport interface CommentCopyDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* NewCustomRef */\r\n newCustomRef?: string,\r\n /* NewScopeId */\r\n newScopeId?: string,\r\n /* Language */\r\n language?: Language,\r\n /* NewLanguage */\r\n newLanguage?: Language,\r\n /* ActiveLanguages */\r\n activeLanguages: Language[]\r\n}\r\n\r\n\r\n/*** CommentCopyResultDto ***/\r\nexport interface CommentCopyResultDto {\r\n /* Model */\r\n model: CommentVM\r\n}\r\n\r\n\r\n/*** CommentDeleteDto ***/\r\nexport interface CommentDeleteDto {\r\n /* Label */\r\n label: string,\r\n /* Force */\r\n force: boolean\r\n}\r\n\r\n\r\n/*** CommentGetDto ***/\r\nexport interface CommentGetDto {\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Label */\r\n label: string,\r\n /* Languages */\r\n languages: Language[]\r\n}\r\n\r\n\r\n/*** CommentGetManyDto ***/\r\nexport interface CommentGetManyDto {\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Labels */\r\n labels: string[],\r\n /* Languages */\r\n languages: Language[]\r\n}\r\n\r\n\r\n/*** CommentGetManyResultDto ***/\r\nexport interface CommentGetManyResultDto {\r\n /* Models */\r\n models: CommentVM[]\r\n}\r\n\r\n\r\n/*** CommentGetResultDto ***/\r\nexport interface CommentGetResultDto {\r\n /* Model */\r\n model: CommentVM\r\n}\r\n\r\n\r\n/*** CommentPatchDto ***/\r\nexport interface CommentPatchDto {\r\n /* Label */\r\n label: string,\r\n /* ETag */\r\n etag?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Title */\r\n title?: string,\r\n /* Draft */\r\n draft?: any,\r\n /* Tags */\r\n tags?: string[]\r\n}\r\n\r\n\r\n/*** CommentPostDto ***/\r\nexport interface CommentPostDto {\r\n /* ProductId */\r\n productId: string,\r\n /* ScopeId */\r\n scopeId: string,\r\n /* CustomRef */\r\n customRef?: string,\r\n /* Language */\r\n language: Language,\r\n /* Title */\r\n title: string,\r\n /* Draft */\r\n draft?: any,\r\n /* Tags */\r\n tags?: string[]\r\n}\r\n\r\n\r\n/*** CommentPostResultDto ***/\r\nexport interface CommentPostResultDto {\r\n /* Model */\r\n model: CommentVM\r\n}\r\n\r\n\r\n/*** CommentVM ***/\r\nexport interface CommentVM {\r\n /* Label */\r\n label?: string,\r\n /* ProductId */\r\n productId?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* IsMarkedForDeletion */\r\n isMarkedForDeletion?: boolean,\r\n /* TypeOfContent */\r\n typeOfContent?: TypeOfContent,\r\n /* Title */\r\n title?: LocalizedRawTextVM,\r\n /* Draft */\r\n draft?: LocalizedDraftVM,\r\n /* CustomRef */\r\n customRef?: string,\r\n /* StickyNotes */\r\n stickyNotes?: StickyNoteVM[],\r\n /* ETag */\r\n etag?: string,\r\n /* TitleOutOfSync */\r\n titleOutOfSync?: boolean,\r\n /* DraftOutOfSync */\r\n draftOutOfSync?: boolean,\r\n}\r\n\r\n\r\n/*** ContentGetDto ***/\r\nexport interface ContentGetDto {\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Label */\r\n label: string,\r\n /* Languages */\r\n languages: Language[]\r\n}\r\n\r\n\r\n/*** ContentGetManyDto ***/\r\nexport interface ContentGetManyDto {\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Labels */\r\n labels: string[],\r\n /* Languages */\r\n languages: Language[]\r\n}\r\n\r\n\r\n/*** ContentGetManyResultDto ***/\r\nexport interface ContentGetManyResultDto {\r\n /* Models */\r\n models: ContentVM[]\r\n}\r\n\r\n\r\n/*** ContentGetResultDto ***/\r\nexport interface ContentGetResultDto {\r\n /* Model */\r\n model: ContentVM\r\n}\r\n\r\n\r\n/*** ContentParagraphDto ***/\r\nexport interface ContentParagraphDto {\r\n /* Key */\r\n key?: string,\r\n /* Item */\r\n item?: string,\r\n /* Level */\r\n level?: number,\r\n /* BlockType */\r\n blockType?: TextBlockType,\r\n /* Text */\r\n text?: ParagraphText\r\n}\r\n\r\n\r\n/*** ContentParagraphRefDto ***/\r\nexport interface ContentParagraphRefDto {\r\n /* Start */\r\n Start?: number,\r\n /* Count */\r\n Count?: number,\r\n /* Text */\r\n Text?: string,\r\n /* LabelOrPrefix */\r\n LabelOrPrefix?: string,\r\n /* ParagraphTag */\r\n ParagraphTag?: string\r\n}\r\n\r\n\r\n/*** ContentParagraphVM ***/\r\nexport interface ContentParagraphVM {\r\n /* Key */\r\n key: string,\r\n /* Item */\r\n item?: string,\r\n /* Level */\r\n level: number,\r\n /* Text */\r\n text?: LocalizedParagraphTextVM,\r\n /* BlockType */\r\n blockType: TextBlockType\r\n}\r\n\r\n\r\n/*** ContentVM ***/\r\nexport interface ContentVM {\r\n /* Label */\r\n label?: string,\r\n /* ProductId */\r\n productId?: string,\r\n /* TypeOfContent */\r\n typeOfContent?: TypeOfContent,\r\n /* TypeOfContentSubType */\r\n typeOfContentSubType?: TypeOfContentSubType,\r\n /* ValidFrom */\r\n validFrom?: string,\r\n /* ValidTill */\r\n validTill?: string,\r\n /* DateOfDecision */\r\n dateOfDecision?: string,\r\n /* Title */\r\n title?: LocalizedRawTextVM,\r\n /* Paragraphs */\r\n paragraphs?: ContentParagraphVM[],\r\n /* ExternalLink */\r\n externalLink?: LocalizedExternalLinkVM,\r\n /* Replaces */\r\n replaces?: string[],\r\n /* IsOutdated */\r\n isOutdated?: boolean,\r\n /* FriendlyLabel */\r\n friendlyLabel?: string,\r\n /* Annotations */\r\n annotations?: AnnotationVM[],\r\n /* Markers */\r\n markers?: MarkerVM[],\r\n /* StickyNotes */\r\n stickyNotes?: StickyNoteVM[],\r\n /* LinkedContentContainer */\r\n linkedContentContainer?: LinkedContentContainerVM\r\n}\r\n\r\n\r\n/*** CountryVM ***/\r\nexport interface CountryVM {\r\n /* CountryCode */\r\n countryCode: string,\r\n /* CountryNameEN */\r\n countryNameEN: string,\r\n /* CountryNameDE */\r\n countryNameDE: string,\r\n /* NoTax */\r\n noTax: boolean,\r\n /* EBookTax */\r\n eBookTax: number\r\n}\r\n\r\n\r\n/*** CustomerDto ***/\r\nexport interface CustomerDto {\r\n /* CustomerLanguage */\r\n customerLanguage?: string,\r\n /* CustomerKind */\r\n customerKind?: CustomerKind,\r\n /* CustomerAddress */\r\n customerAddress?: Address,\r\n /* EQECandidate */\r\n eqeCandidate?: boolean,\r\n /* EQETrainerAddress */\r\n eqeTrainerAddress?: Address,\r\n /* PaymentDetails */\r\n paymentDetails?: PaymentDetailsDto,\r\n /* InvoiceAddressType */\r\n invoiceAddressType?: InvoiceAddressType,\r\n /* InvoiceAddress */\r\n invoiceAddress?: Address\r\n}\r\n\r\n\r\n/*** CustomerKind ***/\r\nexport enum CustomerKind {\r\n /* Natural */\r\n Natural = 0,\r\n /* Legal */\r\n Legal = 1\r\n}\r\n\r\n\r\n/*** CustomerVM ***/\r\nexport interface CustomerVM {\r\n /* Id */\r\n id: number,\r\n /* UserId */\r\n userId: string,\r\n /* Sandbox */\r\n sandbox: boolean,\r\n /* CustomerKind */\r\n customerKind: CustomerKind,\r\n /* CustomerLanguage */\r\n customerLanguage: string,\r\n /* CompanyVATId */\r\n companyVATId?: string,\r\n /* CustomerAddress */\r\n customerAddress: AddressVM,\r\n /* EQECandidate */\r\n eqeCandidate: boolean,\r\n /* EQETrainerAddress */\r\n eqeTrainerAddress?: AddressVM,\r\n /* InvoiceAddress */\r\n invoiceAddress: AddressVM,\r\n /* InvoiceAddressType */\r\n invoiceAddressType: InvoiceAddressType,\r\n /* PaymentDetails */\r\n paymentDetails: PaymentDetailsVM,\r\n /* LicenseSubscriptions */\r\n licenseSubscriptions: LicenseSubscriptionVM[]\r\n}\r\n\r\n\r\n/*** DeleteAnnotationDto ***/\r\nexport interface DeleteAnnotationDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string\r\n}\r\n\r\n\r\n/*** DeleteCommentDto ***/\r\nexport interface DeleteCommentDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* Label */\r\n label?: string,\r\n /* ETag */\r\n etag?: string\r\n}\r\n\r\n\r\n/*** DeleteManyMarkersDto ***/\r\nexport interface DeleteManyMarkersDto {\r\n /* Ids */\r\n ids?: string[],\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string\r\n}\r\n\r\n\r\n/*** DeleteMarkerDto ***/\r\nexport interface DeleteMarkerDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string\r\n}\r\n\r\n\r\n/*** DeleteStickyNoteDto ***/\r\nexport interface DeleteStickyNoteDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* TargetLabel */\r\n targetLabel?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string\r\n}\r\n\r\n\r\n/*** IContentLikeVM ***/\r\nexport interface IContentLikeVM {\r\n /* Label */\r\n Label?: string,\r\n /* ProductId */\r\n ProductId?: string,\r\n /* TypeOfContent */\r\n TypeOfContent?: TypeOfContent,\r\n /* Title */\r\n Title?: LocalizedRawTextVM\r\n}\r\n\r\n\r\n/*** InvoiceAddressType ***/\r\nexport enum InvoiceAddressType {\r\n /* CustomerAddress */\r\n CustomerAddress = 0,\r\n /* EQETrainerAddress */\r\n EQETrainerAddress = 1,\r\n /* OtherAddress */\r\n OtherAddress = 2\r\n}\r\n\r\n\r\n/*** LabelPartKey ***/\r\nexport enum LabelPartKey {\r\n /* Norm */\r\n Norm = 0,\r\n /* NormParagraph */\r\n NormParagraph = 1,\r\n /* CLKind */\r\n CLKind = 10,\r\n /* CLYear */\r\n CLYear = 11,\r\n /* CLNo */\r\n CLNo = 12,\r\n /* CLInterlocutory */\r\n CLInterlocutory = 13,\r\n /* CLPubOJYear */\r\n CLPubOJYear = 14,\r\n /* CLPubOJPage */\r\n CLPubOJPage = 15,\r\n /* GLPart */\r\n GLPart = 20,\r\n /* GLChapter */\r\n GLChapter = 21,\r\n /* GLSection */\r\n GLSection = 22,\r\n /* GLSubsections */\r\n GLSubsections = 23,\r\n /* OJYear */\r\n OJYear = 30,\r\n /* OJIssue */\r\n OJIssue = 31,\r\n /* OJPage */\r\n OJPage = 32,\r\n /* OJChapter */\r\n OJChapter = 33,\r\n /* OJSection */\r\n OJSection = 34,\r\n /* OJSubpage */\r\n OJSubpage = 35,\r\n /* CLBPart */\r\n CLBPart = 40,\r\n /* CLBChapter */\r\n CLBChapter = 41,\r\n /* CLBSection */\r\n CLBSection = 42,\r\n /* CLBSubsections */\r\n CLBSubsections = 43,\r\n /* NatLChapter */\r\n NatLChapter = 50,\r\n /* PCTAGChapter */\r\n PCTAGChapter = 100,\r\n /* PCTAGSection */\r\n PCTAGSection = 101,\r\n /* PCTAGParagraph */\r\n PCTAGParagraph = 102,\r\n /* PCTAIPart */\r\n PCTAIPart = 103,\r\n /* PCTAISection */\r\n PCTAISection = 104,\r\n /* PCTFormKind */\r\n PCTFormKind = 110,\r\n /* PCTFormNo */\r\n PCTFormNo = 111,\r\n /* PCTTocItem */\r\n PCTTocItem = 120\r\n}\r\n\r\n\r\n/*** LabelReferenceVM ***/\r\nexport interface LabelReferenceVM {\r\n /* RefType */\r\n refType?: LabelReferralType,\r\n /* TargetProductId */\r\n targetProductId?: string,\r\n /* TargetLabel */\r\n targetLabel?: string,\r\n /* SourceType */\r\n sourceType?: string,\r\n /* SourceProductId */\r\n sourceProductId?: string,\r\n /* SourceScopeId */\r\n sourceScopeId?: string,\r\n /* SourceLabel */\r\n sourceLabel?: string,\r\n /* CitationText */\r\n citationText?: string,\r\n /* IsValid */\r\n isValid?: boolean,\r\n /* IsComplete */\r\n isComplete?: boolean\r\n}\r\n\r\n\r\n/*** LabelReferralType ***/\r\nexport enum LabelReferralType {\r\n /* TargetContent */\r\n TargetContent = 0,\r\n /* ChildContent */\r\n ChildContent = 1,\r\n /* CitedInAnnotation */\r\n CitedInAnnotation = 2,\r\n /* CitedInComment */\r\n CitedInComment = 3,\r\n /* ContentReplaced */\r\n ContentReplaced = 4,\r\n /* ContentCiting */\r\n ContentCiting = 5,\r\n /* Self */\r\n Self = 6\r\n}\r\n\r\n\r\n/*** Language ***/\r\nexport enum Language {\r\n /* Any */\r\n Any = -1,\r\n /* EN */\r\n EN = 0,\r\n /* DE */\r\n DE = 1,\r\n /* FR */\r\n FR = 2\r\n}\r\n\r\n\r\n/*** LayoutType ***/\r\nexport enum LayoutType {\r\n /* Default */\r\n Default = 0,\r\n /* OneColumn */\r\n OneColumn = 1,\r\n /* TwoColumn */\r\n TwoColumn = 2\r\n}\r\n\r\n\r\n/*** LicenseAcquireSingleUser_LicenseOfferSelectionDto ***/\r\nexport interface LicenseAcquireSingleUser_LicenseOfferSelectionDto {\r\n /* LicenseOfferId */\r\n licenseOfferId: number,\r\n /* InvitationCode */\r\n invitationCode?: string\r\n}\r\n\r\n\r\n/*** LicenseAcquireSingleUserDto ***/\r\nexport interface LicenseAcquireSingleUserDto {\r\n /* LicenseOfferSelection */\r\n licenseOfferSelection: LicenseAcquireSingleUser_LicenseOfferSelectionDto,\r\n /* CustomerLanguage */\r\n customerLanguage?: string,\r\n /* CustomerKind */\r\n customerKind?: CustomerKind,\r\n /* CustomerAddress */\r\n customerAddress?: Address,\r\n /* EQECandidate */\r\n eqeCandidate?: boolean,\r\n /* EQETrainerAddress */\r\n eqeTrainerAddress?: Address,\r\n /* PaymentDetails */\r\n paymentDetails?: PaymentDetailsDto,\r\n /* InvoiceAddressType */\r\n invoiceAddressType?: InvoiceAddressType,\r\n /* InvoiceAddress */\r\n invoiceAddress?: Address\r\n}\r\n\r\n\r\n/*** LicenseAcquireSingleUserResultDto ***/\r\nexport interface LicenseAcquireSingleUserResultDto {\r\n /* IsOK */\r\n isOK: boolean,\r\n /* Result */\r\n result?: NewCustomerWithLicenseResultDto,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** LicenseCreateOrPatchCustomerDto ***/\r\nexport interface LicenseCreateOrPatchCustomerDto {\r\n /* CustomerLanguage */\r\n customerLanguage?: string,\r\n /* CustomerKind */\r\n customerKind?: CustomerKind,\r\n /* CustomerAddress */\r\n customerAddress?: Address,\r\n /* EQECandidate */\r\n eqeCandidate?: boolean,\r\n /* EQETrainerAddress */\r\n eqeTrainerAddress?: Address,\r\n /* PaymentDetails */\r\n paymentDetails?: PaymentDetailsDto,\r\n /* InvoiceAddressType */\r\n invoiceAddressType?: InvoiceAddressType,\r\n /* InvoiceAddress */\r\n invoiceAddress?: Address\r\n}\r\n\r\n\r\n/*** LicenseCreateOrPatchCustomerResultDto ***/\r\nexport interface LicenseCreateOrPatchCustomerResultDto {\r\n /* Model */\r\n model: CustomerVM\r\n}\r\n\r\n\r\n/*** LicenseGetCountriesDto ***/\r\nexport interface LicenseGetCountriesDto {\r\n /* UILanguage */\r\n uiLanguage?: string\r\n}\r\n\r\n\r\n/*** LicenseGetCountriesResultDto ***/\r\nexport interface LicenseGetCountriesResultDto {\r\n /* Models */\r\n models: CountryVM[]\r\n}\r\n\r\n\r\n/*** LicenseGetCustomerDto ***/\r\nexport class LicenseGetCustomerDto {\r\n}\r\n\r\n\r\n/*** LicenseGetCustomerResultDto ***/\r\nexport interface LicenseGetCustomerResultDto {\r\n /* Model */\r\n model?: CustomerVM\r\n}\r\n\r\n\r\n/*** LicenseGetOffersDto ***/\r\nexport interface LicenseGetOffersDto {\r\n /* InvitationCode */\r\n invitationCode?: string\r\n}\r\n\r\n\r\n/*** LicenseGetOffersResultDto ***/\r\nexport interface LicenseGetOffersResultDto {\r\n /* Models */\r\n models: LicenseOfferVM[],\r\n /* SelectedId */\r\n selectedId?: number\r\n}\r\n\r\n\r\n/*** LicenseOfferVM ***/\r\nexport interface LicenseOfferVM {\r\n /* Id */\r\n id: number,\r\n /* InvoiceCode */\r\n invoiceCode: string,\r\n /* NameDE */\r\n nameDE: string,\r\n /* NameEN */\r\n nameEN: string,\r\n /* DescriptionDE */\r\n descriptionDE: string,\r\n /* DescriptionEN */\r\n descriptionEN: string,\r\n /* OnlyByInvitation */\r\n onlyByInvitation: boolean,\r\n /* OnlyForEQECandidates */\r\n onlyForEQECandidates: boolean,\r\n /* IsRevoked */\r\n isRevoked: boolean,\r\n /* CanRenew */\r\n canRenew: boolean,\r\n /* AllowPdfOutput */\r\n allowPdfOutput: boolean,\r\n /* IsVirtualized */\r\n isVirtualized: boolean,\r\n /* OfferStarts */\r\n offerStarts?: string,\r\n /* OfferEnds */\r\n offerEnds?: string,\r\n /* PeriodType */\r\n periodType: PeriodType,\r\n /* PeriodAmount */\r\n periodAmount: number,\r\n /* PeriodTerm */\r\n periodTerm?: string,\r\n /* Languages */\r\n languages: string[],\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* ProductIds */\r\n productIds: string[],\r\n /* PaymentAmount */\r\n paymentAmount: number,\r\n /* Discount */\r\n discount?: number\r\n}\r\n\r\n\r\n/*** LicenseSubscriptionVM ***/\r\nexport interface LicenseSubscriptionVM {\r\n /* Id */\r\n id: number,\r\n /* CustomerId */\r\n customerId: number,\r\n /* OrderId */\r\n orderId?: number,\r\n /* IsRevoked */\r\n isRevoked: boolean,\r\n /* IsCanceled */\r\n isCanceled: boolean,\r\n /* AutoRenewal */\r\n autoRenewal: boolean,\r\n /* LicenseStarts */\r\n licenseStarts: string,\r\n /* LicenseEnds */\r\n licenseEnds: string,\r\n /* HasLicenseExpired */\r\n hasLicenseExpired: boolean,\r\n /* CurrentInvoiceDate */\r\n currentInvoiceDate?: string,\r\n /* NextInvoiceDate */\r\n nextInvoiceDate?: string,\r\n /* CurrentBillingCycle */\r\n currentBillingCycle?: string,\r\n /* NextBillingCycle */\r\n nextBillingCycle?: string,\r\n /* IndividualDiscount */\r\n individualDiscount?: number,\r\n /* LicenseOffer */\r\n offer: LicenseOfferVM,\r\n /* LicenseUpgradePath */\r\n upgradePath?: LicenseUpgradePathVM,\r\n /* AutoUpgrade */\r\n autoUpgrade?: boolean,\r\n /* UpgradePathId */\r\n upgradePathId?: number,\r\n /* UpgradeDate */\r\n upgradeDate?: string\r\n}\r\n\r\n\r\n/*** LicenseUpgradeMode ***/\r\nexport enum LicenseUpgradeMode {\r\n /* AtNextCycle */\r\n AtNextCycle = 0,\r\n /* AtExpiry */\r\n AtExpiry = 1,\r\n /* Immediately */\r\n Immediately = 2\r\n}\r\n\r\n\r\n/*** LicenseUpgradePathVM ***/\r\nexport interface LicenseUpgradePathVM {\r\n /* ToOffer */\r\n toOffer: LicenseOfferVM,\r\n /* UpgradeMode */\r\n upgradeMode: LicenseUpgradeMode\r\n}\r\n\r\n\r\n/*** LinkedContentContainerVM ***/\r\nexport interface LinkedContentContainerVM {\r\n /* Root */\r\n root?: LinkedContentGroupVM\r\n}\r\n\r\n\r\n/*** LinkedContentDeleteGroupDto ***/\r\nexport interface LinkedContentDeleteGroupDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id?: string\r\n}\r\n\r\n\r\n/*** LinkedContentDeleteItemDto ***/\r\nexport interface LinkedContentDeleteItemDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string\r\n}\r\n\r\n\r\n/*** LinkedContentGetDto ***/\r\nexport interface LinkedContentGetDto {\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Label */\r\n label: string,\r\n /* Languages */\r\n languages: Language[]\r\n}\r\n\r\n\r\n/*** LinkedContentGetResultDto ***/\r\nexport interface LinkedContentGetResultDto {\r\n /* Model */\r\n model: LinkedContentContainerVM\r\n}\r\n\r\n\r\n/*** LinkedContentGroupVM ***/\r\nexport interface LinkedContentGroupVM {\r\n /* Id */\r\n id?: string,\r\n /* IsGhost */\r\n isGhost?: boolean,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Header */\r\n header?: LocalizedRawTextVM,\r\n /* HideHeader */\r\n hideHeader?: boolean,\r\n /* BreakSection */\r\n breakSection?: boolean,\r\n /* OptOut */\r\n optOut?: boolean,\r\n /* Items */\r\n items?: LinkedContentVM[],\r\n /* Groups */\r\n groups?: LinkedContentGroupVM[],\r\n /* SortOrder */\r\n sortOrder?: string,\r\n /* IsRoot */\r\n isRoot?: boolean\r\n}\r\n\r\n\r\n/*** LinkedContentHideParagraphDto ***/\r\nexport interface LinkedContentHideParagraphDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* ParagraphKey */\r\n paragraphKey: string\r\n}\r\n\r\n\r\n/*** LinkedContentMoveGroupDto ***/\r\nexport interface LinkedContentMoveGroupDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id?: string,\r\n /* ToParentId */\r\n toParentId?: string,\r\n /* BeforeSiblingId */\r\n beforeSiblingId?: string\r\n}\r\n\r\n\r\n/*** LinkedContentMoveItemDto ***/\r\nexport interface LinkedContentMoveItemDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* ToParentId */\r\n toParentId?: string,\r\n /* BeforeSiblingId */\r\n beforeSiblingId?: string\r\n}\r\n\r\n\r\n/*** LinkedContentPatchGroupDto ***/\r\nexport interface LinkedContentPatchGroupDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Header */\r\n header?: string,\r\n /* HideHeader */\r\n hideHeader?: boolean,\r\n /* BreakSection */\r\n breakSection?: boolean,\r\n /* OptOut */\r\n optOut?: boolean\r\n}\r\n\r\n\r\n/*** LinkedContentPatchItemDto ***/\r\nexport interface LinkedContentPatchItemDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* HideBody */\r\n hideBody?: boolean,\r\n /* OptOut */\r\n optOut?: boolean,\r\n /* LayoutType */\r\n layoutType?: LayoutType\r\n}\r\n\r\n\r\n/*** LinkedContentPostGroupDto ***/\r\nexport interface LinkedContentPostGroupDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* ParentId */\r\n parentId?: string,\r\n /* Header */\r\n header?: string,\r\n /* Language */\r\n language?: Language\r\n}\r\n\r\n\r\n/*** LinkedContentPostItemDto ***/\r\nexport interface LinkedContentPostItemDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* ParentId */\r\n parentId?: string,\r\n /* TargetLabel */\r\n targetLabel: string\r\n}\r\n\r\n\r\n/*** LinkedContentPostNewCommentDto ***/\r\nexport interface LinkedContentPostNewCommentDto {\r\n /* ParentId */\r\n parentId?: string,\r\n /* Label */\r\n label: string,\r\n /* ProductId */\r\n productId: string,\r\n /* ScopeId */\r\n scopeId: string,\r\n /* CustomRef */\r\n customRef?: string,\r\n /* Language */\r\n language: Language,\r\n /* Title */\r\n title: string,\r\n /* Draft */\r\n draft?: any,\r\n /* Tags */\r\n tags?: string[]\r\n}\r\n\r\n\r\n/*** LinkedContentShowParagraphDto ***/\r\nexport interface LinkedContentShowParagraphDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* ParagraphKey */\r\n paragraphKey: string\r\n}\r\n\r\n\r\n/*** LinkedContentVM ***/\r\nexport interface LinkedContentVM {\r\n /* Id */\r\n id: string,\r\n /* ScopeId */\r\n scopeId: string,\r\n /* ContentLabel */\r\n contentLabel: string,\r\n /* TargetLabel */\r\n targetLabel: string,\r\n /* TargetTypeOfContent */\r\n targetTypeOfContent: TypeOfContent,\r\n /* FriendlyLabel */\r\n friendlyLabel?: LocalizedRawTextVM,\r\n /* FriendlyName */\r\n friendlyName?: LocalizedRawTextVM,\r\n /* HideBody */\r\n hideBody: boolean,\r\n /* LayoutType */\r\n layoutType: LayoutType,\r\n /* OptOut */\r\n optOut: boolean,\r\n /* ParagraphsOptOut */\r\n paragraphsOptOut: string[],\r\n /* SortOrder */\r\n sortOrder?: string\r\n}\r\n\r\n\r\n/*** LocalizedAnchorVM ***/\r\nexport interface LocalizedAnchorVM {\r\n /* Language */\r\n language?: Language,\r\n /* Anchor */\r\n anchor?: Anchor,\r\n /* IsFallbackLanguage */\r\n isFallbackLanguage?: boolean\r\n}\r\n\r\n\r\n/*** LocalizedDraftVM ***/\r\nexport interface LocalizedDraftVM {\r\n /* Language */\r\n language?: Language,\r\n /* ContentState */\r\n contentState?: any,\r\n /* IsFallbackLanguage */\r\n isFallbackLanguage?: boolean\r\n}\r\n\r\n\r\n/*** LocalizedExternalLinkVM ***/\r\nexport interface LocalizedExternalLinkVM {\r\n /* Language */\r\n language?: Language,\r\n /* Url */\r\n url?: string,\r\n /* IsFallbackLanguage */\r\n isFallbackLanguage?: boolean\r\n}\r\n\r\n\r\n/*** LocalizedParagraphTextVM ***/\r\nexport interface LocalizedParagraphTextVM {\r\n /* Language */\r\n language?: Language,\r\n /* Text */\r\n text?: string,\r\n /* IsFallbackLanguage */\r\n isFallbackLanguage?: boolean\r\n}\r\n\r\n\r\n/*** LocalizedRawTextVM ***/\r\nexport interface LocalizedRawTextVM {\r\n /* Language */\r\n language?: Language,\r\n /* Text */\r\n text?: string,\r\n /* IsFallbackLanguage */\r\n isFallbackLanguage?: boolean\r\n}\r\n\r\n\r\n/*** LocalizedStringVM ***/\r\nexport interface LocalizedStringVM {\r\n /* Language */\r\n language?: Language,\r\n /* Text */\r\n text?: string,\r\n /* IsFallbackLanguage */\r\n isFallbackLanguage?: boolean\r\n}\r\n\r\n\r\n/*** LookupForContentDto ***/\r\nexport interface LookupForContentDto {\r\n /* ProductId */\r\n productId: string,\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Languages */\r\n languages: Language[]\r\n}\r\n\r\n\r\n/*** LookupForContentResultDto ***/\r\nexport interface LookupForContentResultDto {\r\n /* Models */\r\n models: LookupGroupDto[]\r\n}\r\n\r\n\r\n/*** LookupGroupDto ***/\r\nexport interface LookupGroupDto {\r\n /* Name */\r\n name: string,\r\n /* Label */\r\n label: string,\r\n /* Type */\r\n type: TypeOfContent,\r\n /* Items */\r\n items: LookupItemDto[]\r\n}\r\n\r\n\r\n/*** LookupItemDto ***/\r\nexport interface LookupItemDto {\r\n /* Name */\r\n name: string,\r\n /* Label */\r\n label: string,\r\n /* Type */\r\n type: TypeOfContent\r\n}\r\n\r\n\r\n/*** MarkerDeleteDto ***/\r\nexport interface MarkerDeleteDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string\r\n}\r\n\r\n\r\n/*** MarkerHideDto ***/\r\nexport interface MarkerHideDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* EditScopeId */\r\n editScopeId: string\r\n}\r\n\r\n\r\n/*** MarkerPostDto ***/\r\nexport interface MarkerPostDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Anchor */\r\n anchor?: Anchor,\r\n /* StyleId */\r\n styleId?: string\r\n}\r\n\r\n\r\n/*** MarkerPostResultDto ***/\r\nexport interface MarkerPostResultDto {\r\n /* Model */\r\n model: MarkerVM\r\n}\r\n\r\n\r\n/*** MarkerVM ***/\r\nexport interface MarkerVM {\r\n /* Id */\r\n id?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Language */\r\n language?: Language,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* Anchor */\r\n anchor?: Anchor,\r\n /* StyleId */\r\n styleId?: string,\r\n /* OptOut */\r\n optOut?: boolean\r\n}\r\n\r\n\r\n/*** MoveLinkedContentDto ***/\r\nexport interface MoveLinkedContentDto {\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Id */\r\n id?: string,\r\n /* ToParentId */\r\n toParentId?: string,\r\n /* BeforeSiblingId */\r\n beforeSiblingId?: string\r\n}\r\n\r\n\r\n/*** MoveLinkedContentGroupDto ***/\r\nexport interface MoveLinkedContentGroupDto {\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Id */\r\n id?: string,\r\n /* ToParentId */\r\n toParentId?: string,\r\n /* BeforeSiblingId */\r\n beforeSiblingId?: string\r\n}\r\n\r\n\r\n/*** NewAnnotationDto ***/\r\nexport interface NewAnnotationDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Draft */\r\n draft?: any,\r\n /* Anchor */\r\n anchor?: Anchor,\r\n /* IsInline */\r\n isInline?: boolean,\r\n /* SortOrder */\r\n sortOrder?: string\r\n}\r\n\r\n\r\n/*** NewCommentDto ***/\r\nexport interface NewCommentDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* Label */\r\n label?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Title */\r\n title?: string,\r\n /* Draft */\r\n draft?: any,\r\n /* ETag */\r\n etag?: string\r\n}\r\n\r\n\r\n/*** NewContentDto ***/\r\nexport interface NewContentDto {\r\n /* Language */\r\n language?: Language,\r\n /* Label */\r\n label?: string,\r\n /* ProductId */\r\n productId?: string,\r\n /* TypeOfContent */\r\n typeOfContent?: TypeOfContent,\r\n /* TypeOfContentSubType */\r\n typeOfContentSubType?: TypeOfContentSubType,\r\n /* ValidFrom */\r\n validFrom?: string,\r\n /* ValidTill */\r\n validTill?: string,\r\n /* DateOfDecision */\r\n dateOfDecision?: string,\r\n /* DateOfPublication */\r\n dateOfPublication?: string,\r\n /* LabelParts */\r\n labelParts?: { [key: string]: string; },\r\n /* Title */\r\n title?: string,\r\n /* Paragraphs */\r\n paragraphs?: ContentParagraphDto[],\r\n /* RawText */\r\n rawText?: string,\r\n /* ExternalLink */\r\n externalLink?: string,\r\n /* Replaces */\r\n replaces?: string[],\r\n /* CitedBy */\r\n citedBy?: string[],\r\n /* IsStaged */\r\n isStaged?: boolean\r\n}\r\n\r\n\r\n/*** NewCustomerWithLicenseResult_CountryDto ***/\r\nexport interface NewCustomerWithLicenseResult_CountryDto {\r\n /* CountryCode */\r\n countryCode: string,\r\n /* CountryNameDE */\r\n countryNameDE: string,\r\n /* CountryNameEN */\r\n countryNameEN: string,\r\n /* NoTax */\r\n noTax: boolean,\r\n /* EBookTax */\r\n eBookTax?: number\r\n}\r\n\r\n\r\n/*** NewCustomerWithLicenseResult_InvoiceCodeDto ***/\r\nexport interface NewCustomerWithLicenseResult_InvoiceCodeDto {\r\n /* Code */\r\n code: string,\r\n /* PaymentAmount */\r\n paymentAmount: number,\r\n /* Discount */\r\n discount?: number\r\n}\r\n\r\n\r\n/*** NewCustomerWithLicenseResult_LicenseDto ***/\r\nexport interface NewCustomerWithLicenseResult_LicenseDto {\r\n /* Starts */\r\n starts: string,\r\n /* Ends */\r\n ends: string,\r\n /* AutoRenewal */\r\n autoRenewal: boolean\r\n}\r\n\r\n\r\n/*** NewCustomerWithLicenseResult_LicenseOfferDto ***/\r\nexport interface NewCustomerWithLicenseResult_LicenseOfferDto {\r\n /* InvoiceCode */\r\n invoiceCode: string,\r\n /* NameDE */\r\n nameDE: string,\r\n /* NameEN */\r\n nameEN: string,\r\n /* DescriptionDE */\r\n descriptionDE: string,\r\n /* DescriptionEN */\r\n descriptionEN: string,\r\n /* PeriodType */\r\n periodType: PeriodType,\r\n /* PeriodAmount */\r\n periodAmount: number,\r\n /* PeriodTerm */\r\n periodTerm?: string,\r\n /* OnlyForEQECandidates */\r\n onlyForEQECandidates: boolean,\r\n /* AllowPdfOutput */\r\n allowPdfOutput: boolean\r\n}\r\n\r\n\r\n/*** NewCustomerWithLicenseResultDto ***/\r\nexport interface NewCustomerWithLicenseResultDto {\r\n /* CustomerId */\r\n customerId: number,\r\n /* LicenseId */\r\n licenseId: number,\r\n /* OrderId */\r\n orderId: number,\r\n /* OrderStatus */\r\n orderStatus: OrderStatus,\r\n /* InvitationCodeUsed */\r\n invitationCodeUsed?: string,\r\n /* CustomerLanguage */\r\n customerLanguage: string,\r\n /* CustomerKind */\r\n customerKind: CustomerKind,\r\n /* CustomerAddress */\r\n customerAddress: Address,\r\n /* CustomerCountry */\r\n customerCountry: NewCustomerWithLicenseResult_CountryDto,\r\n /* EQECandidate */\r\n eqeCandidate: boolean,\r\n /* EQETrainerAddress */\r\n eqeTrainerAddress?: Address,\r\n /* InvoiceAddress */\r\n invoiceAddress?: Address,\r\n /* PaymentDetails */\r\n paymentDetails: PaymentDetailsDto,\r\n /* License */\r\n license: NewCustomerWithLicenseResult_LicenseDto,\r\n /* LicenseOffer */\r\n licenseOffer: NewCustomerWithLicenseResult_LicenseOfferDto,\r\n /* InvoiceCode */\r\n invoiceCode: NewCustomerWithLicenseResult_InvoiceCodeDto\r\n}\r\n\r\n\r\n/*** NewMarkerDto ***/\r\nexport interface NewMarkerDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Anchor */\r\n anchor?: Anchor,\r\n /* StyleId */\r\n styleId?: string\r\n}\r\n\r\n\r\n/*** NewStickyNoteDto ***/\r\nexport interface NewStickyNoteDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* TargetLabel */\r\n targetLabel?: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Draft */\r\n draft?: any,\r\n /* TypeOfStickyNote */\r\n typeOfStickyNote?: TypeOfStickyNote\r\n}\r\n\r\n\r\n/*** NoteDeleteDto ***/\r\nexport interface NoteDeleteDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string\r\n}\r\n\r\n\r\n/*** NoteHideDto ***/\r\nexport interface NoteHideDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* EditScopeId */\r\n editScopeId: string\r\n}\r\n\r\n\r\n/*** NoteListDto ***/\r\nexport interface NoteListDto {\r\n /* ProductId */\r\n productId?: string,\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* TypeOfStickyNote */\r\n typeOfStickyNote?: TypeOfStickyNote,\r\n /* Languages */\r\n languages: Language[],\r\n /* DisplayHidden */\r\n displayHidden?: boolean\r\n}\r\n\r\n\r\n/*** NoteListResultDto ***/\r\nexport interface NoteListResultDto {\r\n /* Models */\r\n models: TodoVM[]\r\n}\r\n\r\n\r\n/*** NotePatchDto ***/\r\nexport interface NotePatchDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* ETag */\r\n etag?: string,\r\n /* TypeOfStickyNote */\r\n typeOfStickyNote?: TypeOfStickyNote,\r\n /* VisibilityOfStickyNote */\r\n visibilityOfStickyNote?: VisibilityOfStickyNote,\r\n /* DraftLanguage */\r\n draftLanguage?: Language,\r\n /* Draft */\r\n draft?: any\r\n}\r\n\r\n\r\n/*** NotePostDto ***/\r\nexport interface NotePostDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* AnnotationId */\r\n annotationId?: string,\r\n /* TypeOfStickyNote */\r\n typeOfStickyNote: TypeOfStickyNote,\r\n /* VisibilityOfStickyNote */\r\n visibilityOfStickyNote: VisibilityOfStickyNote,\r\n /* DraftLanguage */\r\n draftLanguage: Language,\r\n /* Draft */\r\n draft: any\r\n}\r\n\r\n\r\n/*** NotePostResultDto ***/\r\nexport interface NotePostResultDto {\r\n /* Model */\r\n model: StickyNoteVM\r\n}\r\n\r\n\r\n/*** NoteShowDto ***/\r\nexport interface NoteShowDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Label */\r\n label: string,\r\n /* Id */\r\n id: string,\r\n /* EditScopeId */\r\n editScopeId: string\r\n}\r\n\r\n\r\n/*** OrderDto ***/\r\nexport interface OrderDto {\r\n /* LicenseOfferId */\r\n licenseOfferId: number,\r\n /* InvitationCode */\r\n invitationCode?: string,\r\n /* ExpectedDiscount */\r\n expectedDiscount?: number\r\n}\r\n\r\n\r\n/*** OrderStatus ***/\r\nexport enum OrderStatus {\r\n /* Open */\r\n Open = 0,\r\n /* Fullfilled */\r\n Fullfilled = 1,\r\n /* ConfirmedByEmail */\r\n ConfirmedByEmail = 2,\r\n /* Abandoned */\r\n Abandoned = 3,\r\n /* Failed */\r\n Failed = 4\r\n}\r\n\r\n\r\n/*** OrderVM ***/\r\nexport interface OrderVM {\r\n /* Id */\r\n id: number,\r\n /* UserId */\r\n userId: string,\r\n /* UserEmailAddress */\r\n userEmailAddress: string,\r\n /* LicenseOffer */\r\n licenseOffer: LicenseOfferVM\r\n}\r\n\r\n\r\n/*** ParagraphRef ***/\r\nexport interface ParagraphRef {\r\n /* Start */\r\n Start?: number,\r\n /* Count */\r\n Count?: number,\r\n /* Text */\r\n Text?: string,\r\n /* LabelOrPrefix */\r\n LabelOrPrefix?: string,\r\n /* ParagraphTag */\r\n ParagraphTag?: string\r\n}\r\n\r\n\r\n/*** ParagraphText ***/\r\nexport interface ParagraphText {\r\n /* Refs */\r\n Refs?: ParagraphRef[],\r\n /* Text */\r\n Text?: string,\r\n /* MD5 */\r\n MD5?: string,\r\n}\r\n\r\n\r\n/*** PaymentDetailsDto ***/\r\nexport interface PaymentDetailsDto {\r\n /* CompanyVATId */\r\n companyVATId?: string,\r\n /* PaymentMethod */\r\n paymentMethod: PaymentMethod,\r\n /* AmazonPay_AccessToken */\r\n amazonPay_AccessToken?: string,\r\n /* AmazonPay_BillingAgreementId */\r\n amazonPay_BillingAgreementId?: string\r\n}\r\n\r\n\r\n/*** PaymentDetailsVM ***/\r\nexport interface PaymentDetailsVM {\r\n /* CompanyVATId */\r\n companyVATId?: string,\r\n /* PaymentMethod */\r\n paymentMethod: PaymentMethod,\r\n /* AmazonPay_BillingAgreementId */\r\n amazonPay_BillingAgreementId?: string,\r\n /* AmazonPay_IsConfirmed */\r\n amazonPay_IsConfirmed?: boolean,\r\n /* AmazonPay_BillingAgreementId_Pending */\r\n amazonPay_BillingAgreementId_Pending?: string\r\n}\r\n\r\n\r\n/*** PaymentMethod ***/\r\nexport enum PaymentMethod {\r\n /* PurchaseOnAccount */\r\n PurchaseOnAccount = 0,\r\n /* AmazonPay */\r\n AmazonPay = 1\r\n}\r\n\r\n\r\n/*** PdfDivisioningMode ***/\r\nexport enum PdfDivisioningMode {\r\n /* PageWithOverview */\r\n PageWithOverview = 0,\r\n /* PageWithoutOverview */\r\n PageWithoutOverview = 1,\r\n /* NoPage */\r\n NoPage = 2\r\n}\r\n\r\n\r\n/*** PdfJobPODOrderDto ***/\r\nexport interface PdfJobPODOrderDto {\r\n /* JobTimestamp */\r\n jobTimestamp: string\r\n}\r\n\r\n\r\n/*** PdfJobPODOrderResultDto ***/\r\nexport interface PdfJobPODOrderResultDto {\r\n customerId: number,\r\n purchaseOrderId: number,\r\n orderStatus: OrderStatus,\r\n timestamp: string\r\n customerLanguage: string,\r\n customerKind: CustomerKind,\r\n customerAddress: Address,\r\n eqeCandidate: boolean,\r\n eqeTrainerAddress: Address,\r\n invoiceAddress: Address,\r\n userEmail: string\r\n}\r\n\r\n\r\n/*** PdfJobInquireDto ***/\r\nexport interface PdfJobInquireDto {\r\n /* JobTimestamp */\r\n jobTimestamp: string\r\n}\r\n\r\n\r\n/*** PdfJobInquireResultDto ***/\r\nexport interface PdfJobInquireResultDto {\r\n /* Model */\r\n model: PdfJobVM\r\n}\r\n\r\n\r\n/*** PdfJobListDto ***/\r\nexport interface PdfJobListDto {\r\n /* ProductId */\r\n productId: string\r\n}\r\n\r\n\r\n/*** PdfJobListResultDto ***/\r\nexport interface PdfJobListResultDto {\r\n /* Models */\r\n models: PdfJobVM[]\r\n}\r\n\r\n\r\n/*** PdfJobPageMode ***/\r\nexport enum PdfJobPageMode {\r\n /* SectionwiseNumberingWithClearPage */\r\n SectionwiseNumberingWithClearPage = 0,\r\n /* ContinuousNumberingWithoutClearPage */\r\n ContinuousNumberingWithoutClearPage = 1\r\n}\r\n\r\n\r\n/*** PdfJobStatus ***/\r\nexport enum PdfJobStatus {\r\n /* Submitted */\r\n Submitted = 0,\r\n /* Started */\r\n Started = 1,\r\n /* Completed */\r\n Completed = 2,\r\n /* Failed */\r\n Failed = 3\r\n}\r\n\r\n\r\n/*** PdfJobSubmitDto ***/\r\nexport interface PdfJobSubmitDto {\r\n /* ProductId */\r\n productId: string,\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Language */\r\n language: Language,\r\n /* DocumentFontSize */\r\n documentFontSize: number,\r\n /* PageMode */\r\n pageMode: PdfJobPageMode,\r\n /* DivisioningMode */\r\n divisioningMode: PdfDivisioningMode,\r\n /* PdfStickyNotes */\r\n pdfStickyNotes: boolean,\r\n /* PrintOnDemand */\r\n printOnDemand: boolean\r\n}\r\n\r\n\r\n/*** PdfJobSubmitResultDto ***/\r\nexport interface PdfJobSubmitResultDto {\r\n /* Model */\r\n model: PdfJobVM\r\n}\r\n\r\n\r\n/*** PdfJobVM ***/\r\nexport interface PdfJobVM {\r\n /* UserId */\r\n userId: string,\r\n /* JobTimestamp */\r\n jobTimestamp: string,\r\n /* ProductId */\r\n productId: string,\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Language */\r\n language: Language,\r\n /* DocumentFontSize */\r\n documentFontSize: number,\r\n /* PageMode */\r\n pageMode: PdfJobPageMode,\r\n /* DivisioningMode */\r\n divisioningMode: PdfDivisioningMode,\r\n /* PdfStickyNotes */\r\n pdfStickyNotes: boolean,\r\n /* PrintOnDemand */\r\n printOnDemand: boolean,\r\n /* Submitted */\r\n submitted: string,\r\n /* Completed */\r\n completed?: string,\r\n /* Status */\r\n status: PdfJobStatus,\r\n /* ProcessorStatusCode */\r\n processorStatusCode?: string,\r\n /* ProcessorStatusMessage */\r\n processorStatusMessage?: string,\r\n /* DownloadToken */\r\n downloadToken?: string,\r\n /* DownloadFilename */\r\n downloadFilename?: string\r\n}\r\n\r\n\r\n/*** PeriodType ***/\r\nexport enum PeriodType {\r\n /* Day */\r\n Day = 0,\r\n /* Week */\r\n Week = 1,\r\n /* Month */\r\n Month = 2,\r\n /* Year */\r\n Year = 3,\r\n /* FixedTerm */\r\n FixedTerm = 4,\r\n /* Unlimited */\r\n Unlimited = 5\r\n}\r\n\r\n\r\n/*** PreferencesVM ***/\r\nexport interface PreferencesVM {\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* Languages */\r\n languages?: Language[],\r\n /* Styles */\r\n styles?: StyleVM[]\r\n}\r\n\r\n\r\n/*** ProductVM ***/\r\nexport interface ProductVM {\r\n /* Id */\r\n id?: string,\r\n /* ETag */\r\n etag?: string,\r\n /* ProductId */\r\n productId?: string,\r\n /* Name */\r\n name?: LocalizedRawTextVM,\r\n /* AvailableLanguages */\r\n availableLanguages?: Language[]\r\n}\r\n\r\n\r\n/*** RemoveLinkedContentDto ***/\r\nexport interface RemoveLinkedContentDto {\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Id */\r\n id?: string\r\n}\r\n\r\n\r\n/*** RemoveLinkedContentGroupDto ***/\r\nexport interface RemoveLinkedContentGroupDto {\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Id */\r\n id?: string\r\n}\r\n\r\n\r\n/*** ReservedParagraphKeys ***/\r\nexport class ReservedParagraphKeys {\r\n /* EntireContent */\r\n static EntireContent = \"$content$\";\r\n /* Title */\r\n static Title = \"$title$\";\r\n /* Lost */\r\n static Lost = \"$lost$\";\r\n}\r\n\r\n\r\n/*** ReservedTextStyles ***/\r\nexport class ReservedTextStyles {\r\n}\r\n\r\n\r\n/*** ResolverResultVM ***/\r\nexport interface ResolverResultVM {\r\n /* ProductId */\r\n productId: string,\r\n /* Label */\r\n label: string,\r\n /* FriendlyLabel */\r\n friendlyLabel: string,\r\n /* TypeOfContent */\r\n typeOfContent: TypeOfContent,\r\n /* LabelParts */\r\n labelParts: { [key: string]: string; },\r\n /* ParagraphTag */\r\n paragraphTag?: string,\r\n /* ValidFrom */\r\n validFrom?: string,\r\n /* ValidTill */\r\n validTill?: string,\r\n /* Title */\r\n title?: LocalizedRawTextVM,\r\n /* Url */\r\n url?: LocalizedExternalLinkVM\r\n}\r\n\r\n\r\n/*** SCAInitiator ***/\r\nexport enum SCAInitiator {\r\n /* UpdateProfile */\r\n UpdateProfile = 0,\r\n /* CheckOut */\r\n CheckOut = 1\r\n}\r\n\r\n\r\n/*** ScopeVM ***/\r\nexport interface ScopeVM {\r\n /* Id */\r\n id: string,\r\n /* TypeOfScope */\r\n typeOfScope: TypeOfScope,\r\n /* Level */\r\n level: number,\r\n /* Label */\r\n label: string,\r\n /* Name */\r\n name?: string,\r\n /* OwnerId */\r\n ownerId?: string,\r\n /* IsVirtualized */\r\n isVirtualized?: boolean\r\n}\r\n\r\n\r\n/*** SearchDocumentVM ***/\r\nexport interface SearchDocumentVM {\r\n /* Id */\r\n id?: string,\r\n\r\n /* DisplayTitleEn */\r\n displayTitleEn?: string,\r\n /* DisplayTitleDe */\r\n displayTitleDe?: string,\r\n\r\n /* Type */\r\n type?: string,\r\n /* Label */\r\n label?: string,\r\n\r\n /* ProductId */\r\n productId?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* AnnotationId */\r\n annotationId?: string,\r\n\r\n /* ValidTill */\r\n validTill?: string,\r\n /* HasEn */\r\n hasEn?: boolean,\r\n /* HasDe */\r\n hasDe?: boolean,\r\n\r\n /* Relevance */\r\n relevance?: number,\r\n\r\n /* Score */\r\n score?: number,\r\n /* HighlightsEn */\r\n highlightsEn?: string[],\r\n /* HighlightsDe */\r\n highlightsDe?: string[],\r\n\r\n /* LinkLabel */\r\n linkLabel?: string,\r\n /* LinkTitleEn */\r\n linkTitleEn?: string,\r\n /* LinkTitleDe */\r\n linkTitleDe?: string,\r\n}\r\n\r\n\r\n/*** SearchGetCitationDto ***/\r\nexport interface SearchGetCitationDto {\r\n /* ProductId */\r\n productId?: string,\r\n /* Input */\r\n input: string,\r\n /* Exact */\r\n exact: boolean,\r\n /* Take */\r\n take: number,\r\n /* Languages */\r\n languages: Language[],\r\n /* IncludeExpired */\r\n includeExpired: boolean\r\n}\r\n\r\n\r\n/*** SearchGetCitationResultDto ***/\r\nexport interface SearchGetCitationResultDto {\r\n /* Models */\r\n models: ResolverResultVM[]\r\n}\r\n\r\n\r\n/*** SearchGetRefDto ***/\r\nexport interface SearchGetRefDto {\r\n /* Label */\r\n label: string,\r\n /* ParKeyOrTag */\r\n parKeyOrTag?: string,\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* Type */\r\n type?: LabelReferralType\r\n}\r\n\r\n\r\n/*** SearchGetRefResultDto ***/\r\nexport interface SearchGetRefResultDto {\r\n /* Models */\r\n models: LabelReferenceVM[]\r\n}\r\n\r\n\r\n/*** SearchOptions ***/\r\nexport interface SearchOptions {\r\n /* ProductIds */\r\n productIds?: string[],\r\n /* ScopeIds */\r\n scopeIds?: string[],\r\n /* Languages */\r\n languages?: Language[],\r\n /* ResultTypes */\r\n resultTypes?: SearchResultType[]\r\n}\r\n\r\n\r\n/*** SearchQueryDto ***/\r\nexport interface SearchQueryDto {\r\n /* Query */\r\n query: string,\r\n /* Top */\r\n top?: number,\r\n /* Skip */\r\n skip?: number,\r\n /* ProductIds */\r\n productIds?: string[],\r\n /* ScopeIds */\r\n scopeIds?: string[],\r\n /* Language */\r\n language: Language\r\n}\r\n\r\n\r\n/*** SearchQueryResultDto ***/\r\nexport interface SearchQueryResultDto {\r\n /* Models */\r\n models: SearchDocumentVM[]\r\n}\r\n\r\n\r\n/*** SearchResult ***/\r\nexport interface SearchResult {\r\n /* ResultType */\r\n resultType?: SearchResultType,\r\n /* IsFullTextResult */\r\n isFullTextResult?: boolean,\r\n /* ProductId */\r\n productId?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* Label */\r\n label?: string,\r\n /* FriendlyLabel */\r\n friendlyLabel?: string,\r\n /* Title */\r\n title?: LocalizedRawTextVM,\r\n /* NestedProductId */\r\n nestedProductId?: string,\r\n /* NestedLabel */\r\n nestedLabel?: string,\r\n /* NestedFriendlyLabel */\r\n nestedFriendlyLabel?: string,\r\n /* NestedTitle */\r\n nestedTitle?: LocalizedRawTextVM,\r\n /* AnnotationId */\r\n annotationId?: string,\r\n /* TextSample */\r\n textSample?: string\r\n}\r\n\r\n\r\n/*** SearchResultType ***/\r\nexport enum SearchResultType {\r\n /* Content */\r\n Content = 0,\r\n /* Comment */\r\n Comment = 1,\r\n /* Annotation */\r\n Annotation = 2,\r\n /* NestedContent */\r\n NestedContent = 3\r\n}\r\n\r\n\r\n/*** SectionVM ***/\r\nexport interface SectionVM {\r\n /* Content */\r\n content?: ContentVM,\r\n /* LinkedContents */\r\n linkedContents?: ContentVM[],\r\n /* LinkedComments */\r\n linkedComments?: CommentVM[],\r\n /* Settings */\r\n settings?: SettingsVM\r\n}\r\n\r\n\r\n/*** SegmentVM ***/\r\nexport interface SegmentVM {\r\n /* Anchor */\r\n anchor?: number,\r\n /* Number */\r\n number?: number\r\n}\r\n\r\n\r\n/*** SettingsVM ***/\r\nexport interface SettingsVM {\r\n /* User */\r\n user?: UserProfileVM,\r\n /* Preferences */\r\n preferences?: PreferencesVM\r\n}\r\n\r\n\r\n/*** ShopCancelSCADto ***/\r\nexport interface ShopCancelSCADto {\r\n /* Initiator */\r\n initiator: SCAInitiator,\r\n /* Argument */\r\n argument?: string\r\n}\r\n\r\n\r\n/*** ShopCancelSCAResultDto ***/\r\nexport interface ShopCancelSCAResultDto {\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopConfirmSCADto ***/\r\nexport interface ShopConfirmSCADto {\r\n /* Initiator */\r\n initiator: SCAInitiator,\r\n /* Argument */\r\n argument?: string\r\n}\r\n\r\n\r\n/*** ShopConfirmSCAResultDto ***/\r\nexport interface ShopConfirmSCAResultDto {\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopFinalizeOrderDto ***/\r\nexport interface ShopFinalizeOrderDto {\r\n /* OrderId */\r\n orderId: number\r\n}\r\n\r\n\r\n/*** ShopFinalizeOrderResultDto ***/\r\nexport interface ShopFinalizeOrderResultDto {\r\n /* Result */\r\n result?: NewCustomerWithLicenseResultDto,\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopGetCountriesDto ***/\r\nexport interface ShopGetCountriesDto {\r\n /* UILanguage */\r\n uiLanguage?: string\r\n}\r\n\r\n\r\n/*** ShopGetCountriesResultDto ***/\r\nexport interface ShopGetCountriesResultDto {\r\n /* Models */\r\n models?: CountryVM[],\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopGetCustomerDto ***/\r\nexport class ShopGetCustomerDto {\r\n}\r\n\r\n\r\n/*** ShopGetCustomerResultDto ***/\r\nexport interface ShopGetCustomerResultDto {\r\n /* Model */\r\n model?: CustomerVM,\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopGetDto ***/\r\nexport interface ShopGetDto {\r\n /* UILanguage */\r\n uiLanguage?: string,\r\n /* Code */\r\n code?: string\r\n}\r\n\r\n\r\n/*** ShopGetOffersDto ***/\r\nexport interface ShopGetOffersDto {\r\n /* InvitationCode */\r\n invitationCode?: string\r\n}\r\n\r\n\r\n/*** ShopGetOffersResultDto ***/\r\nexport interface ShopGetOffersResultDto {\r\n /* Models */\r\n models?: LicenseOfferVM[],\r\n /* SelectedId */\r\n selectedId?: number,\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopGetOrderDto ***/\r\nexport interface ShopGetOrderDto {\r\n /* OrderId */\r\n orderId: number\r\n}\r\n\r\n\r\n/*** ShopGetOrderResultDto ***/\r\nexport interface ShopGetOrderResultDto {\r\n /* Order */\r\n order?: OrderVM,\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopGetResultDto ***/\r\nexport interface ShopGetResultDto {\r\n /* Customer */\r\n customer?: CustomerVM,\r\n /* Countries */\r\n countries?: CountryVM[],\r\n /* Offers */\r\n offers?: LicenseOfferVM[],\r\n /* SelectedOfferId */\r\n selectedOfferId?: number,\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopInitSCADto ***/\r\nexport interface ShopInitSCADto {\r\n /* AccessToken */\r\n accessToken?: string,\r\n /* BillingAgreementId */\r\n billingAgreementId: string,\r\n /* Initiator */\r\n initiator: SCAInitiator,\r\n /* Argument */\r\n argument?: string\r\n}\r\n\r\n\r\n/*** ShopInitSCAResultDto ***/\r\nexport interface ShopInitSCAResultDto {\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopPlaceOrderDto ***/\r\nexport interface ShopPlaceOrderDto {\r\n /* Customer */\r\n customer: CustomerDto,\r\n /* Order */\r\n order: OrderDto\r\n}\r\n\r\n\r\n/*** ShopPlaceOrderResultDto ***/\r\nexport interface ShopPlaceOrderResultDto {\r\n /* Customer */\r\n customer?: CustomerVM,\r\n /* Order */\r\n order?: OrderVM,\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** ShopResultDto ***/\r\nexport interface ShopResultDto {\r\n /* IsSuccess */\r\n isSuccess: boolean,\r\n /* Error */\r\n error?: string\r\n}\r\n\r\n\r\n/*** StickyNoteVM ***/\r\nexport interface StickyNoteVM {\r\n /* Id */\r\n id?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* TargetLabel */\r\n targetLabel?: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* AnnotationId */\r\n annotationId?: string,\r\n /* Draft */\r\n draft?: LocalizedDraftVM,\r\n /* TypeOfStickyNote */\r\n typeOfStickyNote?: TypeOfStickyNote,\r\n /* VisibilityOfStickyNote */\r\n visibilityOfStickyNote?: VisibilityOfStickyNote,\r\n /* OptOut */\r\n optOut?: boolean\r\n}\r\n\r\n\r\n/*** StyleLineType ***/\r\nexport enum StyleLineType {\r\n /* Solid */\r\n Solid = 0,\r\n /* Dashed */\r\n Dashed = 1,\r\n /* Dotted */\r\n Dotted = 2,\r\n /* Double */\r\n Double = 3\r\n}\r\n\r\n\r\n/*** StyleVM ***/\r\nexport interface StyleVM {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* Name */\r\n name?: LocalizedRawTextVM,\r\n /* Symbol */\r\n symbol?: LocalizedRawTextVM,\r\n /* IsOverride */\r\n isOverride?: boolean,\r\n /* OverriddenStyle */\r\n overriddenStyle?: StyleVM,\r\n /* IsBold */\r\n isBold?: boolean,\r\n /* IsItalic */\r\n isItalic?: boolean,\r\n /* IsUnderlined */\r\n isUnderlined?: boolean,\r\n /* IsStriked */\r\n isStriked?: boolean,\r\n /* IsHighlighted */\r\n isHighlighted?: boolean,\r\n /* LineColor */\r\n lineColor?: string,\r\n /* TextColor */\r\n textColor?: string,\r\n /* HighlightColor */\r\n highlightColor?: string,\r\n /* LineThickness */\r\n lineThickness?: number,\r\n /* LineType */\r\n lineType?: StyleLineType\r\n}\r\n\r\n\r\n/*** TableOfContentItemVM ***/\r\nexport interface TableOfContentItemVM {\r\n /* Id */\r\n id?: string,\r\n /* Name */\r\n name?: LocalizedRawTextVM,\r\n /* TargetContentLabel */\r\n targetContentLabel?: string,\r\n /* ChildItems */\r\n childItems?: TableOfContentItemVM[]\r\n}\r\n\r\n\r\n/*** TableOfContentsGetDto ***/\r\nexport interface TableOfContentsGetDto {\r\n /* ProductId */\r\n productId: string,\r\n /* Languages */\r\n languages: Language[]\r\n}\r\n\r\n\r\n/*** TableOfContentsGetResultDto ***/\r\nexport interface TableOfContentsGetResultDto {\r\n /* Model */\r\n model: TableOfContentVM\r\n}\r\n\r\n\r\n/*** TableOfContentVM ***/\r\nexport interface TableOfContentVM {\r\n /* Id */\r\n id?: string,\r\n /* ETag */\r\n etag?: string,\r\n /* ProductId */\r\n productId?: string,\r\n /* Name */\r\n name?: LocalizedRawTextVM,\r\n /* Items */\r\n items?: TableOfContentItemVM[]\r\n}\r\n\r\n\r\n/*** TextBlock ***/\r\nexport interface TextBlock {\r\n /* Type */\r\n type?: TextBlockType,\r\n /* ListLevel */\r\n listLevel?: number,\r\n /* ListItem */\r\n listItem?: string,\r\n /* Text */\r\n text?: string,\r\n /* SegmentContinue */\r\n segmentContinue?: boolean,\r\n /* SegmentOffset */\r\n segmentOffset?: number,\r\n /* SegmentSingle */\r\n segmentSingle?: boolean,\r\n /* SegmentBreaks */\r\n segmentBreaks?: number[],\r\n /* Ranges */\r\n ranges?: TextRange[]\r\n}\r\n\r\n\r\n/*** TextBlockType ***/\r\nexport enum TextBlockType {\r\n /* Unstyled */\r\n Unstyled = 0,\r\n /* List */\r\n List = 1,\r\n /* FloatRight */\r\n FloatRight = 2,\r\n /* Header */\r\n Header = 3,\r\n /* Tabular */\r\n Tabular = 4\r\n}\r\n\r\n\r\n/*** TextFlow ***/\r\nexport interface TextFlow {\r\n /* Blocks */\r\n blocks?: TextBlock[],\r\n /* MD5 */\r\n md5?: string\r\n}\r\n\r\n\r\n/*** TextRange ***/\r\nexport interface TextRange {\r\n /* Offset */\r\n offset?: number,\r\n /* Length */\r\n length?: number,\r\n /* Style */\r\n style?: string,\r\n /* Data */\r\n data?: any\r\n}\r\n\r\n\r\n/*** TodoVM ***/\r\nexport interface TodoVM {\r\n /* ProductId */\r\n productId: string,\r\n /* ScopeId */\r\n scopeId: string,\r\n /* ScopeLabel */\r\n scopeLabel: string,\r\n /* ScopeName */\r\n scopeName?: string,\r\n /* Label */\r\n label: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* FriendlyLabel */\r\n friendlyLabel?: string,\r\n /* Id */\r\n id: string,\r\n /* UserDisplayName */\r\n userDisplayName?: string,\r\n /* DraftContentState */\r\n draftContentState?: any,\r\n /* Type */\r\n type: TypeOfStickyNote,\r\n /* OptOut */\r\n optOut: boolean\r\n}\r\n\r\n\r\n/*** TypeOfContent ***/\r\nexport enum TypeOfContent {\r\n /* ArtEPC */\r\n ArtEPC = 0,\r\n /* RuleEPC */\r\n RuleEPC = 1,\r\n /* ArtRFeesEPC */\r\n ArtRFeesEPC = 2,\r\n /* ArtProtArt69EPC */\r\n ArtProtArt69EPC = 3,\r\n /* SecProtCentrEPC */\r\n SecProtCentrEPC = 4,\r\n /* ArtProtRecogEPC */\r\n ArtProtRecogEPC = 5,\r\n /* ArtProtLondonEPC */\r\n ArtProtLondonEPC = 6,\r\n /* ProtArt69EPC */\r\n ProtArt69EPC = 103,\r\n /* ProtCentrEPC */\r\n ProtCentrEPC = 104,\r\n /* ProtRecogEPC */\r\n ProtRecogEPC = 105,\r\n /* ProtLondonEPC */\r\n ProtLondonEPC = 106,\r\n /* RPBAEPO */\r\n RPBAEPO = 107,\r\n /* RPEBAEPO */\r\n RPEBAEPO = 108,\r\n /* ProtStaffEPC */\r\n ProtStaffEPC = 109,\r\n /* ProtPrivEPC */\r\n ProtPrivEPC = 110,\r\n /* GLEPO */\r\n GLEPO = 10,\r\n /* CLEPO */\r\n CLEPO = 20,\r\n /* CLBEPO */\r\n CLBEPO = 21,\r\n /* OJEPO */\r\n OJEPO = 30,\r\n /* NatLEPO */\r\n NatLEPO = 40,\r\n /* ArtPCT */\r\n ArtPCT = 50,\r\n /* RulePCT */\r\n RulePCT = 51,\r\n /* PCTAdministrativeInstruction */\r\n PCTAdministrativeInstruction = 52,\r\n /* PCTAGInt */\r\n PCTAGInt = 53,\r\n /* PCTAGNat */\r\n PCTAGNat = 54,\r\n /* PCTISPEGL */\r\n PCTISPEGL = 55,\r\n /* PCTReservations */\r\n PCTReservations = 56,\r\n /* PCTROGL */\r\n PCTROGL = 57,\r\n /* PCTFees */\r\n PCTFees = 58,\r\n /* PCTForm */\r\n PCTForm = 60,\r\n /* PCTToc */\r\n PCTToc = 70,\r\n /* PC */\r\n PC = 200,\r\n /* Comment */\r\n Comment = 10000\r\n}\r\n\r\n\r\n/*** TypeOfContentSubType ***/\r\nexport enum TypeOfContentSubType {\r\n /* None */\r\n None = 0,\r\n /* CLEPO_G */\r\n CLEPO_G = 300,\r\n /* CLEPO_J */\r\n CLEPO_J = 301,\r\n /* CLEPO_T */\r\n CLEPO_T = 302,\r\n /* CLEPO_R */\r\n CLEPO_R = 303,\r\n /* CLEPO_D */\r\n CLEPO_D = 304,\r\n /* CLEPO_W */\r\n CLEPO_W = 305,\r\n /* OJEPO_DoAC */\r\n OJEPO_DoAC = 400,\r\n /* OJEPO_DoSCAC */\r\n OJEPO_DoSCAC = 401,\r\n /* OJEPO_DoP */\r\n OJEPO_DoP = 402,\r\n /* OJEPO_DoEBoA */\r\n OJEPO_DoEBoA = 403,\r\n /* OJEPO_DoPBoA */\r\n OJEPO_DoPBoA = 404,\r\n /* OJEPO_NoticeEPO */\r\n OJEPO_NoticeEPO = 410,\r\n /* OJEPO_NoticeP */\r\n OJEPO_NoticeP = 411,\r\n /* OJEPO_NoticeVP3 */\r\n OJEPO_NoticeVP3 = 412,\r\n /* OJEPO_NoticeVP5 */\r\n OJEPO_NoticeVP5 = 413,\r\n /* OJEPO_Other */\r\n OJEPO_Other = 414\r\n}\r\n\r\n\r\n/*** TypeOfScope ***/\r\nexport enum TypeOfScope {\r\n /* Master */\r\n Master = -1,\r\n /* Author */\r\n Author = 0,\r\n /* Organization */\r\n Organization = 1,\r\n /* User */\r\n User = 2\r\n}\r\n\r\n\r\n/*** TypeOfStickyNote ***/\r\nexport enum TypeOfStickyNote {\r\n /* Custom */\r\n Custom = 0,\r\n /* UpdateNote */\r\n UpdateNote = 1\r\n}\r\n\r\n\r\n/*** TypeOfUserRole ***/\r\nexport enum TypeOfUserRole {\r\n /* Undefined */\r\n Undefined = 0,\r\n /* Product */\r\n Product = 1,\r\n /* Scope */\r\n Scope = 2,\r\n /* Global */\r\n Global = 3,\r\n /* Environment */\r\n Environment = 4\r\n}\r\n\r\n\r\n/*** UpdateAnnotationDto ***/\r\nexport interface UpdateAnnotationDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Draft */\r\n draft?: any,\r\n /* Anchor */\r\n anchor?: Anchor,\r\n /* IsInline */\r\n isInline?: boolean,\r\n /* SortOrder */\r\n sortOrder?: string\r\n}\r\n\r\n\r\n/*** UpdateCommentDto ***/\r\nexport interface UpdateCommentDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* Label */\r\n label?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Title */\r\n title?: string,\r\n /* Draft */\r\n draft?: any,\r\n /* ETag */\r\n etag?: string\r\n}\r\n\r\n\r\n/*** UpdateContentDto ***/\r\nexport interface UpdateContentDto {\r\n /* Language */\r\n language?: Language,\r\n /* Label */\r\n label?: string,\r\n /* ProductId */\r\n productId?: string,\r\n /* TypeOfContent */\r\n typeOfContent?: TypeOfContent,\r\n /* TypeOfContentSubType */\r\n typeOfContentSubType?: TypeOfContentSubType,\r\n /* ValidFrom */\r\n validFrom?: string,\r\n /* ValidTill */\r\n validTill?: string,\r\n /* DateOfDecision */\r\n dateOfDecision?: string,\r\n /* DateOfPublication */\r\n dateOfPublication?: string,\r\n /* LabelParts */\r\n labelParts?: { [key: string]: string; },\r\n /* Title */\r\n title?: string,\r\n /* Paragraphs */\r\n paragraphs?: ContentParagraphDto[],\r\n /* RawText */\r\n rawText?: string,\r\n /* ExternalLink */\r\n externalLink?: string,\r\n /* Replaces */\r\n replaces?: string[],\r\n /* CitedBy */\r\n citedBy?: string[],\r\n /* IsStaged */\r\n isStaged?: boolean\r\n}\r\n\r\n\r\n/*** UpdateLinkedContentDto ***/\r\nexport interface UpdateLinkedContentDto {\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Id */\r\n id?: string,\r\n /* HideBody */\r\n hideBody?: boolean,\r\n /* OptOut */\r\n optOut?: boolean,\r\n /* LayoutType */\r\n layoutType?: LayoutType\r\n}\r\n\r\n\r\n/*** UpdateLinkedContentGroupDto ***/\r\nexport interface UpdateLinkedContentGroupDto {\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ContentLabel */\r\n contentLabel?: string,\r\n /* Id */\r\n id?: string,\r\n /* Header */\r\n header?: string,\r\n /* HideHeader */\r\n hideHeader?: boolean,\r\n /* BreakSection */\r\n breakSection?: boolean,\r\n /* Language */\r\n language?: Language\r\n}\r\n\r\n\r\n/*** UpdateStickyNoteDto ***/\r\nexport interface UpdateStickyNoteDto {\r\n /* Id */\r\n id?: string,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* TargetLabel */\r\n targetLabel?: string,\r\n /* ParagraphKey */\r\n paragraphKey?: string,\r\n /* ConcurrencyToken */\r\n concurrencyToken?: string,\r\n /* Language */\r\n language?: Language,\r\n /* Draft */\r\n draft?: any,\r\n /* TypeOfStickyNote */\r\n typeOfStickyNote?: TypeOfStickyNote\r\n}\r\n\r\n\r\n/*** UpdateUserDto ***/\r\nexport interface UpdateUserDto {\r\n /* NormalizedUserName */\r\n normalizedUserName?: string,\r\n /* ActiveLanguage */\r\n activeLanguage?: Language,\r\n /* ActiveScopeId */\r\n activeScopeId?: string,\r\n /* ViewMode */\r\n viewMode?: ViewMode\r\n}\r\n\r\n\r\n/*** UserGlobalRole ***/\r\nexport enum UserGlobalRole {\r\n /* Undefined */\r\n Undefined = 0,\r\n /* Login */\r\n Login = 1,\r\n /* AccountManager */\r\n AccountManager = 2,\r\n /* LicenseManager */\r\n LicenseManager = 3,\r\n /* Admin */\r\n Admin = 10,\r\n /* Virtualized */\r\n Virtualized = 99,\r\n /* UpdateMode */\r\n UpdateMode = 100\r\n}\r\n\r\n\r\n/*** UserLicenseVM ***/\r\nexport interface UserLicenseVM {\r\n /* LicenseId */\r\n licenseId?: string,\r\n /* IsExpired */\r\n isExpired?: boolean,\r\n /* AssignedOn */\r\n assignedOn?: string,\r\n /* ExpiredOn */\r\n expiredOn?: string,\r\n /* LastExpiryCheck */\r\n lastExpiryCheck?: string,\r\n /* Languages */\r\n languages?: Language[],\r\n /* ReadableProductIds */\r\n readableProductIds?: string[],\r\n /* WritableProductIds */\r\n writableProductIds?: string[],\r\n /* ReadableScopeIds */\r\n readableScopeIds?: string[],\r\n /* WritableScopeIds */\r\n writableScopeIds?: string[]\r\n}\r\n\r\n\r\n/*** UserProductRole ***/\r\nexport enum UserProductRole {\r\n /* Undefined */\r\n Undefined = 0,\r\n /* Reader */\r\n Reader = 1,\r\n /* Contributor */\r\n Contributor = 2,\r\n /* Owner */\r\n Owner = 3,\r\n /* DownloadPdf */\r\n DownloadPdf = 10,\r\n /* PrintOnDemand */\r\n PrintOnDemand = 11\r\n}\r\n\r\n\r\n/*** UserProfileGetCurrentDto ***/\r\nexport class UserProfileGetCurrentDto {\r\n}\r\n\r\n\r\n/*** UserProfileGetCurrentResultDto ***/\r\nexport interface UserProfileGetCurrentResultDto {\r\n /* Model */\r\n model: UserProfileVM\r\n}\r\n\r\n\r\n/*** UserProfileGetPreferencesDto ***/\r\nexport interface UserProfileGetPreferencesDto {\r\n /* ScopeIds */\r\n scopeIds: string[],\r\n /* UILanguage */\r\n uiLanguage?: string\r\n}\r\n\r\n\r\n/*** UserProfileGetPreferencesResultDto ***/\r\nexport interface UserProfileGetPreferencesResultDto {\r\n /* Model */\r\n model: PreferencesVM\r\n}\r\n\r\n\r\n/*** UserProfilePatchPreferences_StyleDto ***/\r\nexport interface UserProfilePatchPreferences_StyleDto {\r\n /* StyleId */\r\n styleId: string,\r\n /* IsBold */\r\n isBold?: boolean,\r\n /* IsItalic */\r\n isItalic?: boolean,\r\n /* IsUnderlined */\r\n isUnderlined?: boolean,\r\n /* IsStriked */\r\n isStriked?: boolean,\r\n /* IsHighlighted */\r\n isHighlighted?: boolean,\r\n /* LineColor */\r\n lineColor?: string,\r\n /* TextColor */\r\n textColor?: string,\r\n /* HighlightColor */\r\n highlightColor?: string,\r\n /* LineThickness */\r\n lineThickness?: number,\r\n /* LineType */\r\n lineType?: StyleLineType\r\n}\r\n\r\n\r\n/*** UserProfilePatchPreferencesDto ***/\r\nexport interface UserProfilePatchPreferencesDto {\r\n /* ScopeId */\r\n scopeId: string,\r\n /* Languages */\r\n languages?: Language[],\r\n /* Styles */\r\n styles?: UserProfilePatchPreferences_StyleDto[]\r\n}\r\n\r\n\r\n/*** UserProfilePatchSettingsDto ***/\r\nexport interface UserProfilePatchSettingsDto {\r\n /* FirstUse */\r\n firstUse?: boolean,\r\n /* ReadOnly */\r\n readOnly?: boolean,\r\n /* UpdateMode */\r\n updateMode?: boolean,\r\n /* EditScopeId */\r\n editScopeId?: string,\r\n /* UILanguage */\r\n uiLanguage?: string,\r\n /* ContentLanguage */\r\n contentLanguage?: Language,\r\n /* ProductId */\r\n productId?: string\r\n}\r\n\r\n\r\n/*** UserProfileVM ***/\r\nexport interface UserProfileVM {\r\n /* UserId */\r\n userId: string,\r\n /* FirstUse */\r\n firstUse?: boolean,\r\n /* DisplayName */\r\n displayName?: string,\r\n /* EmailAddresses */\r\n emailAdresses?: string[],\r\n /* ReadOnly */\r\n readOnly?: boolean,\r\n /* UpdateMode */\r\n updateMode?: boolean,\r\n /* EditScopeId */\r\n editScopeId?: string,\r\n /* UILanguage */\r\n uiLanguage?: string,\r\n /* ContentLanguage */\r\n contentLanguage?: Language,\r\n /* ProductId */\r\n productId?: string,\r\n /* Preferences */\r\n preferences?: PreferencesVM,\r\n /* Roles */\r\n roles?: UserRoleVM[],\r\n /* IsVirtualized */\r\n isVirtualized?: boolean,\r\n /* CanEnterUpdateMode */\r\n canEnterUpdateMode?: boolean,\r\n /* Scopes */\r\n scopes?: ScopeVM[],\r\n /* Customer */\r\n customer?: CustomerVM,\r\n /* Licenses */\r\n licenses?: LicenseSubscriptionVM[]\r\n}\r\n\r\n\r\n/*** UserRoleSource ***/\r\nexport enum UserRoleSource {\r\n /* Undefined */\r\n Undefined = 0,\r\n /* Default */\r\n Default = 1,\r\n /* License */\r\n License = 2,\r\n /* Static */\r\n Static = 3,\r\n /* Virtual */\r\n Virtual = 4\r\n}\r\n\r\n\r\n/*** UserRoleVM ***/\r\nexport interface UserRoleVM {\r\n /* TypeOfUserRole */\r\n typeOfUserRole?: TypeOfUserRole,\r\n /* ProductId */\r\n productId?: string,\r\n /* ProductLanguage */\r\n productLanguage?: Language,\r\n /* ProductRole */\r\n productRole?: UserProductRole,\r\n /* ScopeId */\r\n scopeId?: string,\r\n /* ScopeProductId */\r\n scopeProductId?: string,\r\n /* ScopeLanguage */\r\n scopeLanguage?: Language,\r\n /* ScopeRole */\r\n scopeRole?: UserScopeRole,\r\n /* GlobalRole */\r\n globalRole?: UserGlobalRole,\r\n /* Name */\r\n name?: string\r\n}\r\n\r\n\r\n/*** UserScopeRole ***/\r\nexport enum UserScopeRole {\r\n /* Undefined */\r\n Undefined = 0,\r\n /* Reader */\r\n Reader = 1,\r\n /* Contributor */\r\n Contributor = 2,\r\n /* Owner */\r\n Owner = 3\r\n}\r\n\r\n\r\n/*** ViewMode ***/\r\nexport enum ViewMode {\r\n /* View */\r\n View = 0,\r\n /* Edit */\r\n Edit = 1\r\n}\r\n\r\n\r\n/*** VisibilityOfStickyNote ***/\r\nexport enum VisibilityOfStickyNote {\r\n /* PrivateToScope */\r\n PrivateToScope = 0,\r\n /* Public */\r\n Public = 1\r\n}\r\n\r\n\r\n","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction } from '../';\r\nimport * as _ from 'lodash';\r\nimport * as Draft from \"draft-js\";\r\n//import iassign from 'immutable-assign';\r\n\r\nimport { ContentLinkDecorator } from './ContentLinkDecorator';\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\nimport { Language, LayoutType } from '../../viewmodels/EPCDataModel';\r\n\r\nimport { ViewRegistryState } from './';\r\nimport { ToolbarTarget } from './toolbar';\r\n\r\nexport const emptyId = \"\"; // Guid.Empty\r\n\r\nexport type ViewRegistryMode = 'Content' | 'ContentOutline' | 'SingleComment' | 'None';\r\n\r\nexport interface DraftState {\r\n syncState: SyncState,\r\n language: Model.Language,\r\n editor: Draft.EditorState\r\n}\r\n\r\nexport interface TextState {\r\n syncState: SyncState,\r\n language: Model.Language,\r\n text: string\r\n}\r\n\r\nexport interface ParagraphTextState extends TextState {\r\n}\r\n\r\nexport interface AnchorState {\r\n syncState: SyncState,\r\n language: Model.Language,\r\n start?: number,\r\n end?: number\r\n}\r\n\r\nexport interface LabelInfo {\r\n typeOfContent: Model.TypeOfContent,\r\n typeOfContentSubType: Model.TypeOfContentSubType,\r\n validFrom: string,\r\n validTill?: string,\r\n dateOfDecision?: string,\r\n //TODO labelParts\r\n}\r\n\r\nexport interface ContentParagraphItem {\r\n key: string,\r\n textState: { [language: number]: ParagraphTextState },\r\n item?: string,\r\n level: number,\r\n blockType: Model.TextBlockType,\r\n}\r\n\r\ninterface ContentLikeBase {\r\n loaderState: LoaderState,\r\n\r\n //! productId: string,\r\n label: string,\r\n\r\n titleState: { [language: number]: TextState },\r\n\r\n annotations: { [id: string]: AnnotationItem },\r\n notes: { [id: string]: NoteItem },\r\n}\r\n\r\nexport interface ContentItem extends ContentLikeBase {\r\n type: \"Content\",\r\n\r\n labelInfo?: LabelInfo,\r\n isOutdated: boolean,\r\n\r\n externalLinkState: { [language: number]: TextState },\r\n paragraphs: ContentParagraphItem[],\r\n\r\n //TODO should rather be compiled on client-side\r\n friendlyLabel: string,\r\n\r\n markers: { [id: string]: MarkerItem },\r\n};\r\n\r\nexport interface CommentItem extends ContentLikeBase {\r\n type: \"Comment\",\r\n\r\n scopeId: string,\r\n\r\n //TODO is this necessary?\r\n isDeleted?: boolean,\r\n\r\n draftState: { [language: number]: DraftState },\r\n\r\n isTitleOutOfSync?: boolean,\r\n isDraftOutOfSync?: boolean,\r\n};\r\n\r\nexport type ContentLikeItem = ContentItem | CommentItem;\r\n\r\nexport interface FriendlyLabelItem {\r\n //!productId: string,\r\n label: string,\r\n\r\n titleState: { [language: number]: TextState },\r\n friendlyLabel: string,\r\n fullName: string,\r\n}\r\n\r\nexport interface AnnotationItem {\r\n loaderState: LoaderState,\r\n\r\n id: string,\r\n label: string,\r\n //! productId: string,\r\n scopeId: string,\r\n paragraphKey: string,\r\n\r\n draftState: { [language: number]: DraftState },\r\n anchorState: { [language: number]: AnchorState },\r\n\r\n isInline: boolean,\r\n isDeleting?: boolean,\r\n isDeleted?: boolean,\r\n\r\n isOptOut?: boolean,\r\n isOutOfSync?: boolean,\r\n};\r\n\r\nexport interface NoteItem {\r\n loaderState: LoaderState,\r\n\r\n id: string,\r\n label: string,\r\n //! productId: string,\r\n scopeId: string,\r\n\r\n paragraphKey?: string,\r\n annotationId?: string,\r\n\r\n draftState: { [language: number]: DraftState },\r\n\r\n typeOfStickyNote: Model.TypeOfStickyNote,\r\n visibilityOfStickyNote: Model.VisibilityOfStickyNote,\r\n\r\n isDeleting?: boolean,\r\n isDeleted?: boolean,\r\n\r\n isOptOut?: boolean,\r\n};\r\n\r\nexport interface MarkerItem {\r\n loaderState: LoaderState,\r\n\r\n id: string,\r\n label: string,\r\n //! productId: string,\r\n scopeId: string,\r\n paragraphKey: string,\r\n\r\n language: Model.Language,\r\n\r\n anchorState: AnchorState,\r\n styleId: string,\r\n\r\n isOptOut?: boolean,\r\n}\r\n\r\nexport interface LinkedContentGroup {\r\n type: 'GROUP',\r\n id: string,\r\n scopeId: string,\r\n isRoot: boolean,\r\n isGhost: boolean,\r\n hideHeader: boolean,\r\n breakSection: boolean,\r\n header: string,\r\n optOut: boolean,\r\n sortOrder: string,\r\n items: { [id: string]: LinkedContentItem },\r\n groups: { [id: string]: LinkedContentGroup },\r\n}\r\n\r\nexport interface LinkedContentItem {\r\n type: 'ITEM',\r\n id: string,\r\n scopeId: string,\r\n hideBody: boolean,\r\n optOut: boolean,\r\n layoutType: Model.LayoutType,\r\n targetTypeOfContent: Model.TypeOfContent,\r\n targetLabel: string,\r\n sortOrder: string,\r\n paragraphOptOut: string[]\r\n}\r\n\r\n/** actions */\r\ninterface ResetAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RESET'\r\n}\r\n\r\ninterface CheckCompleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_CHECK_COMPLETE'\r\n}\r\n\r\ninterface SetModeAction extends AnyAction {\r\n type: 'VIEWREGISTRY_SET_MODE',\r\n mode: ViewRegistryMode,\r\n}\r\n\r\ninterface ReceiveLinkedContentAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_LINKEDCONTENT',\r\n model: Model.LinkedContentContainerVM,\r\n}\r\n\r\ninterface RequestContentAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_CONTENT',\r\n //! productId: string,\r\n label: string,\r\n scopeIds: string[],\r\n languages: Model.Language[]\r\n}\r\n\r\ninterface RequestNestedContentAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_NESTED_CONTENT',\r\n label: string\r\n}\r\n\r\ninterface RequestNestedCommentAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_NESTED_COMMENT',\r\n //! productId: string,\r\n label: string\r\n}\r\n\r\ninterface ReceiveContentAction extends AnyAction { type: 'VIEWREGISTRY_RECEIVE_CONTENT', content: Model.ContentVM }\r\ninterface ReceiveNestedContentAction extends AnyAction { type: 'VIEWREGISTRY_RECEIVE_NESTED_CONTENT', content: Model.ContentVM }\r\ninterface ReceiveNestedCommentAction extends AnyAction { type: 'VIEWREGISTRY_RECEIVE_NESTED_COMMENT', comment: Model.CommentVM }\r\n\r\ninterface ReceiveContentFailedAction extends AnyAction { type: 'VIEWREGISTRY_RECEIVE_CONTENT_FAILED', error: string }\r\ninterface ReceiveNestedContentFailedAction extends AnyAction { type: 'VIEWREGISTRY_RECEIVE_NESTED_CONTENT_FAILED', label: string, error: string }\r\ninterface ReceiveNestedCommentFailedAction extends AnyAction { type: 'VIEWREGISTRY_RECEIVE_NESTED_COMMENT_FAILED', label: string, error: string }\r\n\r\n/** union of all actions */\r\nexport type KnownAction =\r\n | ResetAction\r\n | CheckCompleteAction\r\n | SetModeAction\r\n | ReceiveLinkedContentAction\r\n | RequestContentAction\r\n | RequestNestedContentAction\r\n | RequestNestedCommentAction\r\n | ReceiveContentAction\r\n | ReceiveNestedContentAction\r\n | ReceiveNestedCommentAction\r\n | ReceiveContentFailedAction\r\n | ReceiveNestedContentFailedAction\r\n | ReceiveNestedCommentFailedAction\r\n\r\n/** actions creators will be available to all subscribing components */\r\n\r\nconst requestContent = (/*!productId: string, */label: string, scopeIds: string[], languages: Model.Language[], force: boolean): AppThunkAction => (dispatch, getState) => {\r\n let state = getState().viewRegistry;\r\n\r\n if (!force) {\r\n if ((state.loaderState.isLoaded || state.loaderState.isLoading) &&\r\n //! state.productId == productId &&\r\n state.label == label &&\r\n _.isEqual(state.scopeIds, scopeIds) &&\r\n _.isEqual(state.languages, languages))\r\n return;\r\n if (state.loaderState.hasError)\r\n return;\r\n }\r\n\r\n dispatch({ type: 'VIEWREGISTRY_RESET' });\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_CONTENT', /*!productId,*/ label, scopeIds, languages });\r\n\r\n const dto: Model.ContentGetDto = {\r\n //! productId,\r\n label,\r\n scopeIds,\r\n languages\r\n };\r\n\r\n WebApi.getContent(dto)\r\n .then(data => {\r\n const content = data.model;\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_CONTENT', content: content });\r\n\r\n let root = content.linkedContentContainer && content.linkedContentContainer.root;\r\n if (root) {\r\n // (re-)load all nested contents \r\n requestNestedContents(root, /*!productId,*/ scopeIds, languages, true)(dispatch, getState);\r\n }\r\n }).catch(error => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_CONTENT_FAILED', error: error });\r\n });\r\n}\r\n\r\nconst requestLinkedContent = (/*!productId: string, */label: string, scopeIds: string[], languages: Model.Language[]): AppThunkAction => (dispatch, getState) => {\r\n let state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentGetDto = {\r\n //! productId,\r\n label,\r\n scopeIds,\r\n languages\r\n };\r\n\r\n WebApi.getLinkedContent(dto)\r\n .then(data => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_LINKEDCONTENT', model: data.model });\r\n\r\n let root = data.model && data.model.root;\r\n if (root) {\r\n // only load missing nested contents \r\n requestNestedContents(root, /*!productId, */scopeIds, languages, false)(dispatch, getState);\r\n }\r\n dispatch({ type: 'VIEWREGISTRY_CHECK_COMPLETE' });\r\n\r\n }).catch(error => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_CONTENT_FAILED', error: error });\r\n });\r\n}\r\n\r\nconst requestNestedContents = (root: Model.LinkedContentGroupVM, /*!productId: string, */scopeIds: string[], languages: Model.Language[], force?: boolean): AppThunkAction => (dispatch, getState) => {\r\n let contentLabels: string[] = [];\r\n let commentLabels: string[] = [];\r\n gatherLabels(root, contentLabels, commentLabels);\r\n\r\n if (!force) {\r\n const state = getState().viewRegistry;\r\n for (let label in state.contents) {\r\n _.remove(contentLabels, label);\r\n }\r\n //for (let label in state.comments) {\r\n // _.remove(commentLabels, label);\r\n //}\r\n }\r\n\r\n if (contentLabels.length > 0) {\r\n // load nested contents\r\n const contentsDto: Model.ContentGetManyDto = {\r\n //! productId: productId,\r\n scopeIds: scopeIds,\r\n labels: contentLabels,\r\n languages: languages,\r\n };\r\n for (let i = 0; i < contentLabels.length; i++) {\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_NESTED_CONTENT', label: contentLabels[i] });\r\n }\r\n WebApi.getManyContents(contentsDto)\r\n .then(result => {\r\n for (let i = 0; i < result.models.length; i++) {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NESTED_CONTENT', content: result.models[i] });\r\n }\r\n dispatch({ type: 'VIEWREGISTRY_CHECK_COMPLETE' });\r\n }).catch(error => {\r\n for (let i = 0; i < contentLabels.length; i++) {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NESTED_CONTENT_FAILED', label: contentLabels[i], error: error });\r\n }\r\n dispatch({ type: 'VIEWREGISTRY_CHECK_COMPLETE' });\r\n });\r\n }\r\n\r\n if (commentLabels.length > 0) {\r\n // load nested comments\r\n const commentsDto: Model.CommentGetManyDto = {\r\n //! productId: productId,\r\n scopeIds: scopeIds,\r\n labels: commentLabels,\r\n languages: languages,\r\n };\r\n for (let i = 0; i < commentLabels.length; i++) {\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_NESTED_COMMENT', /*!productId: productId,*/ label: commentLabels[i] });\r\n }\r\n WebApi.getManyComments(commentsDto)\r\n .then(result => {\r\n for (let i = 0; i < result.models.length; i++) {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NESTED_COMMENT', comment: result.models[i] });\r\n }\r\n dispatch({ type: 'VIEWREGISTRY_CHECK_COMPLETE' });\r\n })\r\n .catch(error => {\r\n for (let i = 0; i < contentLabels.length; i++) {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NESTED_COMMENT_FAILED', label: commentLabels[i], error: error });\r\n }\r\n dispatch({ type: 'VIEWREGISTRY_CHECK_COMPLETE' });\r\n });\r\n }\r\n dispatch({ type: 'VIEWREGISTRY_CHECK_COMPLETE' });\r\n}\r\n\r\nexport const actionCreators = {\r\n\r\n resetViewRegistry: () => { type: 'VIEWREGISTRY_RESET' },\r\n\r\n setViewRegistryMode: (mode: ViewRegistryMode) => { type: 'VIEWREGISTRY_SET_MODE', mode: mode },\r\n\r\n requestContent: requestContent,\r\n\r\n requestLinkedContent: requestLinkedContent,\r\n}\r\n\r\nfunction gatherLabels(grp: Model.LinkedContentGroupVM, contentLabels: string[], commentLabels: string[]) {\r\n for (let i = 0; grp.groups && i < grp.items!.length; i++) {\r\n var label = grp.items![i].targetLabel!;\r\n if (label.startsWith(\"COMMENT\"))\r\n commentLabels.push(label);\r\n else\r\n contentLabels.push(label);\r\n }\r\n\r\n for (var i = 0; grp.groups && i < grp.groups!.length; i++) {\r\n gatherLabels(grp.groups![i], contentLabels, commentLabels);\r\n }\r\n}\r\n\r\nexport function getContentState(rawContentState: any): Draft.ContentState {\r\n return rawContentState ?\r\n Draft.convertFromRaw(rawContentState) :\r\n Draft.ContentState.createFromText(\"\");\r\n}\r\n\r\nexport function getEditorState(/*!productId: string, */rawContentState: any): Draft.EditorState {\r\n //const decorator = productId ? new Draft.CompositeDecorator([\r\n // ContentLinkDecorator(productId)\r\n //]) : undefined;\r\n\r\n const decorator = new Draft.CompositeDecorator([ContentLinkDecorator()])\r\n\r\n try {\r\n if (rawContentState)\r\n return Draft.EditorState.createWithContent(getContentState(rawContentState), decorator);\r\n else\r\n return Draft.EditorState.createWithContent(Draft.ContentState.createFromText(\"\"), decorator);\r\n } catch (e) {\r\n return Draft.EditorState.createWithContent(Draft.ContentState.createFromText(`could not load draft: ${e}`), decorator);\r\n }\r\n}\r\n\r\nexport function getDraftState(/*!productId: string, */draft: Model.LocalizedDraftVM): DraftState {\r\n return {\r\n language: draft.language!,\r\n editor: getEditorState(/*!productId, */draft.contentState!),\r\n syncState: SyncStateUtil.getSynced(),\r\n };\r\n}\r\n\r\nexport function getTextState(text: Model.LocalizedRawTextVM): TextState {\r\n return {\r\n language: text.language!,\r\n text: text.text!,\r\n syncState: SyncStateUtil.getSynced(),\r\n };\r\n}\r\n\r\nexport function getParagraphTextState(text: Model.LocalizedParagraphTextVM): ParagraphTextState {\r\n return {\r\n language: text.language!,\r\n text: text.text!,\r\n syncState: SyncStateUtil.getSynced(),\r\n };\r\n}\r\n\r\nexport function getUrlState(text: Model.LocalizedExternalLinkVM): TextState {\r\n return {\r\n language: text.language!,\r\n text: text.url!,\r\n syncState: SyncStateUtil.getSynced(),\r\n };\r\n}\r\n\r\nexport function getAnchorState(anchor: Model.LocalizedAnchorVM): AnchorState {\r\n return {\r\n language: anchor.language!,\r\n start: anchor.anchor!.start || 0,\r\n end: anchor.anchor!.end || 0,\r\n syncState: SyncStateUtil.getSynced(),\r\n };\r\n}\r\n\r\nexport function getContent(model: Model.ContentVM): ContentItem {\r\n let externalLinkState = getUrlState(model.externalLink!);\r\n let titleState = getTextState(model.title!);\r\n\r\n let paragraphs = (model.paragraphs || []).map(par => getContentParagraph(par));\r\n let annotations: { [id: string]: AnnotationItem } = {};\r\n for (let i = 0; model.annotations && i < model.annotations.length; i++) {\r\n let annotation = getAnnotation(model, model.annotations[i]);\r\n annotations[annotation.id] = annotation;\r\n }\r\n let notes: { [id: string]: NoteItem } = {};\r\n for (let i = 0; model.stickyNotes && i < model.stickyNotes.length; i++) {\r\n let note = getNote(model, model.stickyNotes[i]);\r\n notes[note.id] = note;\r\n }\r\n let markers: { [id: string]: MarkerItem } = {};\r\n for (let i = 0; model.markers && i < model.markers.length; i++) {\r\n let marker = getMarker(model, model.markers[i]);\r\n // important! filtee out-opted markers. Unhiding them may mess up the view.\r\n //TODO maybe add restore to default toolbar button?\r\n if (marker.isOptOut)\r\n continue;\r\n markers[marker.id] = marker;\r\n }\r\n\r\n let content: ContentItem = {\r\n type: 'Content',\r\n\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n\r\n //! productId: model.productId!,\r\n label: model.label!,\r\n labelInfo: {\r\n typeOfContent: model.typeOfContent!,\r\n typeOfContentSubType: model.typeOfContentSubType!,\r\n validFrom: model.validFrom!,\r\n validTill: model.validTill,\r\n dateOfDecision: model.dateOfDecision,\r\n //TODO labelParts\r\n },\r\n\r\n titleState: { [titleState.language]: titleState },\r\n externalLinkState: { [externalLinkState.language]: externalLinkState },\r\n\r\n paragraphs: paragraphs,\r\n\r\n isOutdated: model.isOutdated!,\r\n friendlyLabel: model.friendlyLabel!,\r\n\r\n annotations: annotations,\r\n notes: notes,\r\n markers: markers,\r\n };\r\n\r\n return content;\r\n}\r\n\r\nexport function getContentParagraph(par: Model.ContentParagraphVM): ContentParagraphItem {\r\n let segTextState = getParagraphTextState(par.text!);\r\n\r\n return {\r\n key: par.key!,\r\n textState: { [segTextState.language]: segTextState },\r\n item: par.item,\r\n level: par.level,\r\n blockType: par.blockType,\r\n };\r\n}\r\n\r\nexport function getAnnotation(parent: { /*!productId?: string,*/ label?: string }, annoation: Model.AnnotationVM): AnnotationItem {\r\n let draftState = getDraftState(/*!parent.productId!, */annoation.draft!);\r\n let anchorState = getAnchorState(annoation.anchor!);\r\n\r\n return {\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n\r\n id: annoation.id!,\r\n //!productId: parent.productId!,\r\n label: parent.label!,\r\n scopeId: annoation.scopeId!,\r\n paragraphKey: annoation.paragraphKey!,\r\n\r\n isInline: annoation.isInline!,\r\n\r\n draftState: { [draftState.language]: draftState },\r\n anchorState: { [anchorState.language]: anchorState },\r\n\r\n isOptOut: annoation.optOut || false,\r\n isOutOfSync: annoation.outOfSync || false\r\n };\r\n}\r\n\r\nexport function getNote(parent: { /*!productId?: string, */label?: string }, note: Model.StickyNoteVM): NoteItem {\r\n let draftState = getDraftState(/*!parent.productId!, */note.draft!);\r\n\r\n return {\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n\r\n id: note.id!,\r\n //!productId: parent.productId!,\r\n label: parent.label!,\r\n scopeId: note.scopeId!,\r\n\r\n paragraphKey: note.paragraphKey,\r\n annotationId: note.annotationId,\r\n\r\n draftState: { [draftState.language]: draftState },\r\n typeOfStickyNote: note.typeOfStickyNote!,\r\n visibilityOfStickyNote: note.visibilityOfStickyNote!,\r\n\r\n isOptOut: note.optOut || false,\r\n };\r\n}\r\n\r\nexport function getMarker(parent: Model.ContentVM, marker: Model.MarkerVM): MarkerItem {\r\n return getMarker2(/*!parent.productId!, */parent.label!, marker);\r\n}\r\n\r\nexport function getMarker2(/*!productId: string, */label: string, marker: Model.MarkerVM): MarkerItem {\r\n return {\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n\r\n id: marker.id!,\r\n //!productId: productId,\r\n label: label,\r\n scopeId: marker.scopeId!,\r\n paragraphKey: marker.paragraphKey!,\r\n\r\n language: marker.language!,\r\n anchorState: {\r\n start: marker.anchor!.start || 0,\r\n end: marker.anchor!.end || 0,\r\n language: marker.language!,\r\n syncState: SyncStateUtil.getSynced()\r\n },\r\n styleId: marker.styleId!,\r\n\r\n isOptOut: marker.optOut || false,\r\n };\r\n}\r\n\r\nexport function getComment(comment: Model.CommentVM): CommentItem {\r\n let draftState = getDraftState(/*!comment.productId!,*/ comment.draft!);\r\n let titleState = getTextState(comment.title!);\r\n\r\n let notes: { [id: string]: NoteItem } = {};\r\n for (let i = 0; comment.stickyNotes && i < comment.stickyNotes.length; i++) {\r\n let note = getNote(comment, comment.stickyNotes[i]);\r\n notes[note.id] = note;\r\n }\r\n\r\n return {\r\n type: 'Comment',\r\n\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n\r\n label: comment.label!,\r\n //!productId: comment.productId!,\r\n scopeId: comment.scopeId!,\r\n\r\n draftState: { [draftState.language]: draftState },\r\n titleState: { [titleState.language]: titleState },\r\n\r\n notes: notes,\r\n annotations: {},\r\n\r\n isTitleOutOfSync: comment.titleOutOfSync || false,\r\n isDraftOutOfSync: comment.draftOutOfSync || false\r\n };\r\n}\r\n\r\nexport function getLinkedContentGroup(model?: Model.LinkedContentGroupVM): LinkedContentGroup {\r\n if (!model) {\r\n return {\r\n type: \"GROUP\",\r\n id: emptyId,\r\n scopeId: \"\",\r\n isRoot: true,\r\n isGhost: false,\r\n hideHeader: true,\r\n breakSection: false,\r\n optOut: false,\r\n header: \"(Root)\",\r\n sortOrder: \"1\",\r\n items: {},\r\n groups: {},\r\n };\r\n }\r\n\r\n let group: LinkedContentGroup = {\r\n type: \"GROUP\",\r\n id: model.id!,\r\n scopeId: model.scopeId!,\r\n isRoot: model.isRoot || false,\r\n isGhost: model.isGhost || false,\r\n hideHeader: model.hideHeader || false,\r\n breakSection: model.breakSection || false,\r\n optOut: model.optOut || false,\r\n header: model.isRoot ? \"(Root)\" : (model.header!.text || \"\"),\r\n sortOrder: model.sortOrder!,\r\n items: {},\r\n groups: {},\r\n };\r\n\r\n for (let i = 0; model.items && i < model.items!.length; i++) {\r\n group.items[model.items[i].id!] = getLinkedContentItem(model.items[i]);\r\n }\r\n for (let i = 0; model.groups && i < model.groups!.length; i++) {\r\n group.groups[model.groups[i].id!] = getLinkedContentGroup(model.groups[i]);\r\n }\r\n\r\n return group;\r\n}\r\n\r\nexport function getLinkedContentItem(vm: Model.LinkedContentVM): LinkedContentItem {\r\n let item: LinkedContentItem = {\r\n type: \"ITEM\",\r\n id: vm.id,\r\n scopeId: vm.scopeId,\r\n hideBody: vm.hideBody,\r\n optOut: vm.optOut,\r\n layoutType: vm.layoutType,\r\n targetTypeOfContent: vm.targetTypeOfContent,\r\n targetLabel: vm.targetLabel,\r\n sortOrder: vm.sortOrder!,\r\n paragraphOptOut: vm.paragraphsOptOut,\r\n };\r\n return item;\r\n}\r\n\r\nexport function getBestLanguage(languages: Language[], dictionary: { [language: number]: T }) {\r\n // MUST correspond to EPC.Data.ObjectModels.Localized.Get\r\n\r\n for (let language of languages) {\r\n let val = dictionary[language];\r\n if (val !== undefined)\r\n return val;\r\n let key = _.keys(dictionary).filter(key => Number(key) === Language.Any)[0];\r\n if (key !== undefined)\r\n return dictionary[Number(key)];\r\n if (language === Language.Any)\r\n return _.values(dictionary)[0];\r\n }\r\n return undefined;\r\n //return _.values(dictionary)[0];\r\n}\r\n\r\nexport function isCommentLabel(label: string) {\r\n return label.startsWith('COMMENT');\r\n}\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer = (state: ViewRegistryState, action: KnownAction): ViewRegistryState => {\r\n\r\n switch (action.type) {\r\n\r\n // actions related to root content\r\n\r\n // TODO these should go the ViewRegistry.ts\r\n case 'VIEWREGISTRY_RESET':\r\n return {\r\n mode: 'None' as ViewRegistryMode,\r\n loaderState: LoaderStateUtil.getEmpty(),\r\n isComplete: false,\r\n\r\n contents: {},\r\n\r\n friendlyLabels: {},\r\n\r\n linkedContentRoot: getLinkedContentGroup(),\r\n };\r\n\r\n case 'VIEWREGISTRY_CHECK_COMPLETE': {\r\n let notComplete = _.find(state.contents, content => content.loaderState.isLoading);\r\n return {\r\n ...state,\r\n isComplete: !notComplete\r\n };\r\n }\r\n\r\n case 'VIEWREGISTRY_SET_MODE':\r\n return {\r\n ...state,\r\n mode: action.mode,\r\n };\r\n\r\n // * content\r\n\r\n case 'VIEWREGISTRY_REQUEST_CONTENT':\r\n return {\r\n ...state,\r\n\r\n loaderState: LoaderStateUtil.getLoading(),\r\n mode: 'Content' as ViewRegistryMode,\r\n\r\n //!productId: action.productId,\r\n label: action.label,\r\n scopeIds: action.scopeIds,\r\n languages: action.languages,\r\n };\r\n\r\n case 'VIEWREGISTRY_RECEIVE_CONTENT': {\r\n let content = getContent(action.content);\r\n let linkedContentRoot = getLinkedContentGroup(action.content.linkedContentContainer && action.content.linkedContentContainer.root);\r\n return {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [action.content.label!]: content\r\n },\r\n friendlyLabels: {\r\n ...state.friendlyLabels,\r\n [action.content.label!]: {\r\n //!productId: content.productId,\r\n label: content.label,\r\n titleState: content.titleState,\r\n friendlyLabel: content.friendlyLabel,\r\n fullName: content.friendlyLabel + \" - \" + getBestLanguage(state.languages!, content.titleState)!.text\r\n }\r\n },\r\n linkedContentRoot: linkedContentRoot,\r\n loaderState: LoaderStateUtil.getLoaded()\r\n };\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_CONTENT_FAILED':\r\n return { ...state, loaderState: LoaderStateUtil.getError(action.error) };\r\n\r\n // * linked contents\r\n\r\n case 'VIEWREGISTRY_RECEIVE_LINKEDCONTENT': {\r\n let linkedContentRoot = getLinkedContentGroup(action.model && action.model.root);\r\n return {\r\n ...state,\r\n linkedContentRoot: linkedContentRoot,\r\n };\r\n }\r\n\r\n // * nested content\r\n\r\n case 'VIEWREGISTRY_REQUEST_NESTED_CONTENT': {\r\n return {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [action.label]: {\r\n type: \"Content\",\r\n loaderState: LoaderStateUtil.getLoading(),\r\n //!productId: \"\",\r\n label: action.label!,\r\n titleState: {},\r\n externalLinkState: {},\r\n paragraphs: [],\r\n isOutdated: false,\r\n friendlyLabel: \"\",\r\n annotations: {},\r\n notes: {},\r\n markers: {},\r\n }\r\n },\r\n };\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NESTED_CONTENT': {\r\n const content = getContent(action.content);\r\n return {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [content.label]: content\r\n },\r\n friendlyLabels: {\r\n ...state.friendlyLabels,\r\n [content.label]: {\r\n //!productId: content.productId,\r\n label: content.label,\r\n titleState: content.titleState,\r\n friendlyLabel: content.friendlyLabel,\r\n fullName: content.friendlyLabel + \" - \" + getBestLanguage(state.languages!, content.titleState)!.text\r\n }\r\n },\r\n };\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NESTED_CONTENT_FAILED': {\r\n const content = state.contents[action.label];\r\n return {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [action.label]: {\r\n ...content,\r\n loaderState: LoaderStateUtil.getError(action.error)\r\n }\r\n },\r\n };\r\n }\r\n\r\n // * Comments\r\n\r\n case 'VIEWREGISTRY_REQUEST_NESTED_COMMENT': {\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [action.label]: {\r\n type: \"Comment\",\r\n loaderState: LoaderStateUtil.getLoading(),\r\n label: action.label,\r\n //!productId: action.productId,\r\n scopeId: \"\", // TODO derive from label; up to now, we don't need the scopeId while loading\r\n draftState: {},\r\n titleState: {},\r\n notes: {}\r\n } as CommentItem\r\n },\r\n };\r\n return newState;\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NESTED_COMMENT': {\r\n const comment = getComment(action.comment);\r\n return {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [action.comment.label!]: comment\r\n },\r\n friendlyLabels: {\r\n ...state.friendlyLabels,\r\n [comment.label]: {\r\n //!productId: comment.productId,\r\n label: comment.label,\r\n titleState: comment.titleState,\r\n friendlyLabel: \"Comment\", // LOCALIZE\r\n fullName: /*content.friendlyLabel + \" - \" +*/ getBestLanguage(state.languages!, comment.titleState)!.text\r\n }\r\n },\r\n };\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NESTED_COMMENT_FAILED': {\r\n const comment = state.contents[action.label];\r\n return {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [action.label]: {\r\n ...comment,\r\n loaderState: LoaderStateUtil.getError(action.error),\r\n draftState: {},\r\n titleState: {},\r\n } as CommentItem\r\n },\r\n };\r\n }\r\n\r\n default: const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};\r\n","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction } from '../';\r\nimport * as _ from 'lodash';\r\nimport * as Draft from \"draft-js\";\r\n\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport { ViewRegistryState } from './';\r\nimport * as Items from './items';\r\nimport { DraftState, TextState, CommentItem } from './items';\r\n\r\nconst delay = 100;\r\n\r\n/** actions */\r\n\r\n// add\r\n\r\ninterface ReceiveCommentAddAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_COMMENT_ADD',\r\n comment: Model.CommentVM,\r\n}\r\n\r\ninterface ReceiveCommentAddFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_COMMENT_ADD_FAILED',\r\n error: any\r\n}\r\n\r\n// delete\r\n\r\ninterface RequestCommentDeleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_COMMENT_DELETE',\r\n label: string,\r\n}\r\n\r\ninterface ReceiveCommentDeleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_COMMENT_DELETE',\r\n label: string,\r\n}\r\n\r\ninterface ReceiveCommentDeleteFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_COMMENT_DELETE_FAILED',\r\n label: string,\r\n error: any\r\n}\r\n\r\n// draft state\r\n\r\ninterface HandleCommentDraftChangedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_HANDLE_COMMENT_DRAFT_CHANGED',\r\n label: string,\r\n language: Model.Language,\r\n newEditorState: Draft.EditorState,\r\n}\r\n\r\n// title state\r\n\r\ninterface HandleCommentTitleChangedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_HANDLE_COMMENT_TITLE_CHANGED',\r\n label: string,\r\n language: Model.Language,\r\n newTitle: string\r\n}\r\n\r\n// add language\r\n\r\ninterface AddCommentLanguageAction extends AnyAction {\r\n type: 'VIEWREGISTRY_ADD_COMMENT_LANGUAGE',\r\n language: Model.Language,\r\n label: string,\r\n}\r\n\r\n// update\r\n\r\ninterface RequestCommentUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_COMMENT_UPDATE',\r\n language: Model.Language,\r\n label: string,\r\n draft: boolean,\r\n title: boolean,\r\n}\r\n\r\ninterface ReceiveCommentUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_COMMENT_UPDATE',\r\n language: Model.Language,\r\n label: string,\r\n draft: boolean,\r\n title: boolean,\r\n}\r\n\r\ninterface ReceiveCommentUpdateFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_COMMENT_UPDATE_FAILED',\r\n language: Model.Language,\r\n label: string,\r\n draft: boolean,\r\n title: boolean,\r\n error: any\r\n}\r\n\r\n\r\n/** union of all actions */\r\nexport type KnownAction =\r\n // add\r\n | ReceiveCommentAddAction\r\n | ReceiveCommentAddFailedAction\r\n // delete\r\n | RequestCommentDeleteAction\r\n | ReceiveCommentDeleteAction\r\n | ReceiveCommentDeleteFailedAction\r\n // draft state\r\n | HandleCommentDraftChangedAction\r\n // title state\r\n | HandleCommentTitleChangedAction\r\n // add language\r\n | AddCommentLanguageAction\r\n // update\r\n | RequestCommentUpdateAction\r\n | ReceiveCommentUpdateAction\r\n | ReceiveCommentUpdateFailedAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n\r\n // add\r\n\r\n addComment: (\r\n editScopeId: string,\r\n editLanguage: Model.Language,\r\n customRef: string | null): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState();\r\n const productId = state.userProfile.viewOptions.productId;\r\n let dto: Model.CommentPostDto = {\r\n productId: productId,\r\n scopeId: editScopeId,\r\n customRef: customRef || undefined,\r\n language: editLanguage,\r\n draft: Draft.convertToRaw(Draft.ContentState.createFromText(\"\")),\r\n title: \"\"\r\n };\r\n\r\n WebApi.postComment(dto)\r\n .then(result => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_COMMENT_ADD', comment: result.model });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_COMMENT_ADD_FAILED', error });\r\n });\r\n },\r\n\r\n // delete\r\n\r\n deleteComment: (label: string, force: boolean): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const comment = state.contents[label];\r\n if (comment.type != 'Comment')\r\n throw new TypeError();\r\n\r\n const dto: Model.CommentDeleteDto = {\r\n label: label,\r\n force: force\r\n };\r\n\r\n WebApi.deleteComment(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_COMMENT_DELETE', label });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_COMMENT_DELETE_FAILED', label, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_COMMENT_DELETE', label });\r\n },\r\n\r\n // draft state\r\n\r\n onCommentDraftChanged: (label: string, language: Model.Language, newEditorState: Draft.EditorState): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'VIEWREGISTRY_HANDLE_COMMENT_DRAFT_CHANGED', label, language, newEditorState });\r\n },\r\n\r\n // title state\r\n\r\n onCommentTitleChanged: (label: string, language: Model.Language, newTitle: string): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'VIEWREGISTRY_HANDLE_COMMENT_TITLE_CHANGED', label, language, newTitle });\r\n },\r\n\r\n // add language\r\n addCommentLanguage: (label: string, language: Model.Language): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'VIEWREGISTRY_ADD_COMMENT_LANGUAGE', label, language });\r\n },\r\n\r\n // update\r\n updateComment: (label: string, language: Model.Language, draft: boolean, title: boolean): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n const comment = state.contents[label];\r\n if (comment.type != 'Comment')\r\n throw new TypeError();\r\n\r\n const draftState = comment.draftState[language];\r\n const titleState = comment.titleState[language];\r\n\r\n const dto: Model.CommentPatchDto = {\r\n label: label,\r\n etag: '*',\r\n language: language,\r\n draft: draft ? Draft.convertToRaw(draftState.editor.getCurrentContent()) : undefined,\r\n title: title ? titleState.text : undefined\r\n };\r\n\r\n WebApi.patchComment(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_COMMENT_UPDATE', label, language, draft, title });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_COMMENT_UPDATE_FAILED', label, language, draft, title, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_COMMENT_UPDATE', label, language, draft, title });\r\n }, delay);\r\n },\r\n}\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer = (state: ViewRegistryState, action: KnownAction): ViewRegistryState => {\r\n\r\n switch (action.type) {\r\n\r\n // add\r\n\r\n case 'VIEWREGISTRY_RECEIVE_COMMENT_ADD': {\r\n state.contents = {\r\n ...state.contents,\r\n [action.comment.label!]: Items.getComment(action.comment)\r\n };\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_COMMENT_ADD_FAILED': {\r\n // TODO global error\r\n return state;\r\n }\r\n\r\n // delete\r\n\r\n case 'VIEWREGISTRY_REQUEST_COMMENT_DELETE': {\r\n return alterCommentItem1(state, action.label, comment => {\r\n return { ...comment, isDeleting: true, isDeleted: false };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_COMMENT_DELETE': {\r\n return alterCommentItem1(state, action.label, comment => {\r\n return { ...comment, isDeleting: false, isDeleted: true };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_COMMENT_DELETE_FAILED': {\r\n return alterCommentItem1(state, action.label, comment => {\r\n return { ...comment, isDeleting: false, isDeleted: false };\r\n });\r\n }\r\n\r\n // draft state\r\n\r\n case 'VIEWREGISTRY_HANDLE_COMMENT_DRAFT_CHANGED': {\r\n return alterDraftState(state, action.label, action.language, (draftState) => {\r\n const contentState = draftState.editor.getCurrentContent();\r\n const newContentState = action.newEditorState.getCurrentContent();\r\n const modified = !contentState.equals(newContentState);\r\n\r\n return {\r\n ...draftState,\r\n editor: action.newEditorState, \r\n syncState: modified ? SyncStateUtil.getModified(draftState.syncState) : draftState.syncState\r\n };\r\n });\r\n }\r\n\r\n // title state\r\n\r\n case 'VIEWREGISTRY_HANDLE_COMMENT_TITLE_CHANGED': {\r\n // TODO update contentLables\r\n return alterTitleState(state, action.label, action.language, (titleState) => {\r\n const modified = titleState.text !== action.newTitle;\r\n return {\r\n ...titleState,\r\n text: action.newTitle,\r\n syncState: modified ? SyncStateUtil.getModified(titleState.syncState) : titleState.syncState\r\n };\r\n });\r\n }\r\n\r\n // add language \r\n case 'VIEWREGISTRY_ADD_COMMENT_LANGUAGE': {\r\n return alterCommentItem1(state, action.label, (comment) => {\r\n return {\r\n ...comment,\r\n draftState: {\r\n ...comment.draftState,\r\n [action.language]: {\r\n language: action.language,\r\n editor: Items.getEditorState(undefined),\r\n syncState: SyncStateUtil.getModified(SyncStateUtil.getSynced())\r\n }\r\n },\r\n titleState: {\r\n ...comment.titleState,\r\n [action.language]: {\r\n language: action.language,\r\n text: \"\",\r\n syncState: SyncStateUtil.getModified(SyncStateUtil.getSynced())\r\n }\r\n },\r\n };\r\n });\r\n }\r\n\r\n // update\r\n case 'VIEWREGISTRY_REQUEST_COMMENT_UPDATE': {\r\n let newState = state;\r\n if (action.draft)\r\n newState = alterDraftState(newState, action.label, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getSyncing(draftState.syncState)\r\n };\r\n });\r\n if (action.title)\r\n newState = alterTitleState(newState, action.label, action.language, (titleState) => {\r\n return {\r\n ...titleState,\r\n syncState: SyncStateUtil.getSyncing(titleState.syncState)\r\n };\r\n });\r\n return newState;\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_COMMENT_UPDATE': {\r\n let newState = state;\r\n if (action.draft)\r\n newState = alterDraftState(newState, action.label, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getSynced()\r\n };\r\n });\r\n if (action.title)\r\n newState = alterTitleState(newState, action.label, action.language, (titleState) => {\r\n return {\r\n ...titleState,\r\n syncState: SyncStateUtil.getSynced()\r\n };\r\n });\r\n return newState;\r\n\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_COMMENT_UPDATE_FAILED': {\r\n let newState = state;\r\n if (action.draft)\r\n newState = alterDraftState(newState, action.label, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getError(draftState.syncState, action.error)\r\n };\r\n });\r\n if (action.title)\r\n newState = alterTitleState(newState, action.label, action.language, (titleState) => {\r\n return {\r\n ...titleState,\r\n syncState: SyncStateUtil.getError(titleState.syncState, action.error)\r\n };\r\n });\r\n return newState;\r\n }\r\n\r\n default: const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};\r\n\r\nfunction alterCommentItem1(state: ViewRegistryState, label: string,\r\n alter: (comment: CommentItem) => CommentItem): ViewRegistryState {\r\n\r\n const comment = state.contents[label];\r\n if (comment.type != 'Comment')\r\n throw new TypeError();\r\n\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: alter(comment)\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction alterCommentItem2(state: ViewRegistryState, label: string, language: Model.Language,\r\n alter: (comment: CommentItem, draftState: DraftState, titleState: TextState) => CommentItem): ViewRegistryState {\r\n\r\n const comment = state.contents[label];\r\n if (comment.type != 'Comment')\r\n throw new TypeError();\r\n\r\n const draftState = comment.draftState[language];\r\n const titleState = comment.titleState[language];\r\n\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: alter(comment, draftState, titleState)\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction alterDraftState(state: ViewRegistryState, label: string, language: Model.Language,\r\n alter: (draftState: DraftState) => DraftState): ViewRegistryState {\r\n\r\n return alterCommentItem2(state, label, language, (comment, draftState, titleState) => {\r\n return {\r\n ...comment,\r\n isDraftOutOfSync: false,\r\n draftState: {\r\n ...comment.draftState,\r\n [language]: alter(draftState)\r\n }\r\n };\r\n });\r\n}\r\n\r\nfunction alterTitleState(state: ViewRegistryState, label: string, language: Model.Language,\r\n alter: (titleState: TextState) => TextState): ViewRegistryState {\r\n\r\n return alterCommentItem2(state, label, language, (comment, draftState, titleState) => {\r\n return {\r\n ...comment,\r\n isTitleOutOfSync: false,\r\n titleState: {\r\n ...comment.titleState,\r\n [language]: alter(titleState)\r\n }\r\n };\r\n });\r\n}\r\n","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction } from '../';\r\nimport * as _ from 'lodash';\r\nimport * as Draft from \"draft-js\";\r\n\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport { ViewRegistryState } from './';\r\nimport * as Items from './items';\r\nimport { DraftState, AnchorState, ContentItem, AnnotationItem } from './items';\r\n\r\n/** actions */\r\n\r\n// add \r\n\r\ninterface ReceiveAnnotationAddAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ADD',\r\n annotation: Model.AnnotationVM,\r\n}\r\n\r\ninterface ReceiveAnnotationAddFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ADD_FAILED',\r\n label: string,\r\n parKey: string,\r\n error: any,\r\n}\r\n\r\n// delete\r\n\r\ninterface RequestAnnotationDeleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_ANNOTATION_DELETE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationDeleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_DELETE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationDeleteFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_DELETE_FAILED',\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// hide\r\n\r\ninterface RequestAnnotationHideAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_ANNOTATION_HIDE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationHideAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_HIDE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationHideFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_HIDE_FAILED',\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// show\r\n\r\ninterface RequestAnnotationShowAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_ANNOTATION_SHOW',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationShowAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_SHOW',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationShowFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_SHOW_FAILED',\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// draft state\r\n\r\ninterface HandleAnnotationDraftChangedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_HANDLE_ANNOTATION_DRAFT_CHANGED',\r\n label: string,\r\n id: string,\r\n language: Model.Language,\r\n newEditorState: Draft.EditorState,\r\n}\r\n\r\ninterface RequestAnnotationDraftUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_ANNOTATION_DRAFT_UPDATE',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationDraftUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_DRAFT_UPDATE',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationDraftUpdateFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_DRAFT_UPDATE_FAILED',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// anchor state\r\n\r\ninterface HandleAnnotationAnchorChangedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_HANDLE_ANNOTATION_ANCHOR_CHANGED',\r\n label: string,\r\n id: string,\r\n language: Model.Language,\r\n newAnchor: AnchorState\r\n}\r\n\r\ninterface RequestAnnotationAnchorUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_ANNOTATION_ANCHOR_UPDATE',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationAnchorUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ANCHOR_UPDATE',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveAnnotationAnchorUpdateFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ANCHOR_UPDATE_FAILED',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// add language\r\n\r\ninterface AddAnnotationLanguageAction extends AnyAction {\r\n type: 'VIEWREGISTRY_ADD_ANNOTATION_LANGUAGE',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\n\r\n/** union of all actions */\r\nexport type KnownAction =\r\n // add\r\n | ReceiveAnnotationAddAction\r\n | ReceiveAnnotationAddFailedAction\r\n // delete\r\n | RequestAnnotationDeleteAction\r\n | ReceiveAnnotationDeleteAction\r\n | ReceiveAnnotationDeleteFailedAction\r\n // hide\r\n | RequestAnnotationHideAction\r\n | ReceiveAnnotationHideAction\r\n | ReceiveAnnotationHideFailedAction\r\n // show\r\n | RequestAnnotationShowAction\r\n | ReceiveAnnotationShowAction\r\n | ReceiveAnnotationShowFailedAction\r\n // draft state\r\n | HandleAnnotationDraftChangedAction\r\n | RequestAnnotationDraftUpdateAction\r\n | ReceiveAnnotationDraftUpdateAction\r\n | ReceiveAnnotationDraftUpdateFailedAction\r\n // anchor state\r\n | HandleAnnotationAnchorChangedAction\r\n | RequestAnnotationAnchorUpdateAction\r\n | ReceiveAnnotationAnchorUpdateAction\r\n | ReceiveAnnotationAnchorUpdateFailedAction\r\n // add language\r\n | AddAnnotationLanguageAction;\r\n\r\nconst delay = 100;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n\r\n // add\r\n\r\n addAnnotation: (editScopeId: string, editLanguage: Model.Language, label: string, parKey: string, inline: boolean, anchorLanguage?: Model.Language, anchor?: number): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState();\r\n let dto: Model.AnnotationPostDto = {\r\n scopeId: editScopeId,\r\n label: label,\r\n paragraphKey: parKey,\r\n isInline: inline,\r\n draftLanguage: editLanguage,\r\n draft: Draft.convertToRaw(Draft.ContentState.createFromText(\"\")),\r\n anchorLanguage: anchorLanguage!,\r\n anchor: inline ? { end: anchor! } : undefined,\r\n };\r\n\r\n WebApi.postAnnotation(dto)\r\n .then(result => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ADD', annotation: result.model! });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ADD_FAILED', label, parKey, error });\r\n });\r\n },\r\n\r\n // delete\r\n\r\n deleteAnnotation: (label: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const annotation = state.contents[label].annotations[id];\r\n\r\n const dto: Model.AnnotationDeleteDto = {\r\n scopeId: annotation.scopeId,\r\n label: label,\r\n id: id\r\n };\r\n\r\n WebApi.deleteAnnotation(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_DELETE', label, id });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_DELETE_FAILED', label, id, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_ANNOTATION_DELETE', label, id });\r\n },\r\n\r\n // hide\r\n\r\n hideAnnotation: (editScopeId: string, label: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const annotation = state.contents[label].annotations[id];\r\n const mode = annotation.scopeId == editScopeId ? 'delete' : 'hide';\r\n\r\n const dto: Model.AnnotationHideDto = {\r\n scopeId: annotation.scopeId,\r\n label: label,\r\n id: id,\r\n editScopeId: editScopeId\r\n };\r\n\r\n WebApi.hideAnnotation(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_HIDE', label, id });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_HIDE_FAILED', label, id, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_ANNOTATION_HIDE', label, id });\r\n },\r\n\r\n // show\r\n\r\n showAnnotation: (editScopeId: string, label: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const annotation = state.contents[label].annotations[id];\r\n\r\n const dto: Model.AnnotationShowDto = {\r\n scopeId: annotation.scopeId,\r\n label: label,\r\n id: id,\r\n editScopeId: editScopeId\r\n };\r\n\r\n WebApi.showAnnotation(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_SHOW', label, id });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_SHOW_FAILED', label, id, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_ANNOTATION_SHOW', label, id });\r\n },\r\n\r\n // add language\r\n\r\n addAnnotationLanguage: (label: string, id: string, language: Model.Language): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'VIEWREGISTRY_ADD_ANNOTATION_LANGUAGE', label, id, language });\r\n },\r\n\r\n // draft state\r\n\r\n onAnnotationDraftChanged: (label: string, id: string, language: Model.Language, newEditorState: Draft.EditorState): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'VIEWREGISTRY_HANDLE_ANNOTATION_DRAFT_CHANGED', label, id, language, newEditorState });\r\n },\r\n\r\n updateAnnotationDraft: (label: string, id: string, language: Model.Language): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n const annotation = state.contents[label].annotations[id];\r\n const draftState = annotation.draftState[language];\r\n const contentState = draftState.editor.getCurrentContent();\r\n\r\n const dto: Model.AnnotationPatchDto = {\r\n scopeId: annotation.scopeId,\r\n label: label,\r\n id: id,\r\n etag: '*',\r\n draftLanguage: language,\r\n draft: Draft.convertToRaw(contentState)\r\n };\r\n\r\n WebApi.patchAnnotation(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_DRAFT_UPDATE', label, id, language });\r\n }).catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_DRAFT_UPDATE_FAILED', label, id, language, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_ANNOTATION_DRAFT_UPDATE', label, id, language });\r\n }, delay);\r\n },\r\n\r\n // anchor state\r\n\r\n //onAnnotationAnchorChanged: (label: string, id: string, language: Model.Language, newAnchor: AnchorState): AppThunkAction => (dispatch, getState) => {\r\n // dispatch({ type: 'VIEWREGISTRY_HANDLE_ANNOTATION_ANCHOR_CHANGED', label, id, language, newAnchor });\r\n //},\r\n\r\n //setAndUpdateAnnotationAnchor: (label: string, id: string, language: Model.Language, newAnchor: AnchorState): AppThunkAction => (dispatch, getState) => {\r\n\r\n // dispatch({ type: 'VIEWREGISTRY_HANDLE_ANNOTATION_ANCHOR_CHANGED', label, id, language, newAnchor });\r\n\r\n // setTimeout(() => {\r\n // const state = getState().viewRegistry;\r\n // const annotation = state.contents[label].annotations[id];\r\n\r\n // WebApi.patchAnnotation(annotation.productId, annotation.scopeId, label, id, {\r\n // etag: '*',\r\n // anchorLanguage: language,\r\n // anchor: { start: newAnchor.start, end: newAnchor.end, }\r\n // })\r\n // .then(() => {\r\n // dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ANCHOR_UPDATE', label, id, language });\r\n // })\r\n // .catch((error: any) => {\r\n // console.debug(\"error: \" + error);\r\n // dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ANCHOR_UPDATE_FAILED', label, id, language, error });\r\n // });\r\n\r\n // dispatch({ type: 'VIEWREGISTRY_REQUEST_ANNOTATION_ANCHOR_UPDATE', label, id, language });\r\n // }, delay);\r\n //},\r\n\r\n moveAnnotation: (label: string, id: string, language: Model.Language, dir: number): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const content = state.contents[label];\r\n if (content.type != 'Content')\r\n throw new TypeError();\r\n\r\n const annotation = state.contents[label].annotations[id];\r\n\r\n const anchorLanguage = language;\r\n const parKey = annotation.paragraphKey;\r\n\r\n const par = _.find(content.paragraphs, par_ => par_.key == parKey);\r\n if (!par) {\r\n console.warn(`move annotation ${id} failed because par key ${parKey} was not found on content ${label}.`);\r\n return;\r\n }\r\n\r\n const textState = par.textState[anchorLanguage];\r\n if (!textState) {\r\n console.warn(`move annotation ${id} failed because par ${parKey} on content ${label} has no text for language ${anchorLanguage}.`);\r\n return;\r\n }\r\n\r\n const anchor = annotation.anchorState[anchorLanguage] || {\r\n language: anchorLanguage,\r\n end: textState.text.length,\r\n syncState: SyncStateUtil.getModified(SyncStateUtil.getEmpty()),\r\n };\r\n\r\n console.debug(`move annotation ${id}-${Model.Language[anchorLanguage]}: ${anchor.end} ${dir}`);\r\n\r\n const text = textState.text;\r\n let end = (anchor.end !== undefined ? anchor.end : text.length) + dir;\r\n for (; end > 0 && end < text.length; end += dir) {\r\n\r\n let c0 = text.charAt(end - 1);\r\n let c1 = text.charAt(end);\r\n\r\n if ((c0 != \" \") && (c1 == \" \" || c1 == \",\" || c1 == \".\" || c1 == \";\" || c1 == \":\"))\r\n break;\r\n }\r\n end = Math.max(0, Math.min(end, text.length));\r\n\r\n let newAnchor = {\r\n ...anchor,\r\n end,\r\n syncState: SyncStateUtil.getModified(anchor.syncState)\r\n };\r\n\r\n dispatch({ type: 'VIEWREGISTRY_HANDLE_ANNOTATION_ANCHOR_CHANGED', label, id, language, newAnchor });\r\n\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n const annotation = state.contents[label].annotations[id];\r\n\r\n const dto: Model.AnnotationPatchDto = {\r\n scopeId: annotation.scopeId,\r\n label: label,\r\n id: id,\r\n etag: '*',\r\n anchorLanguage: language,\r\n anchor: { start: newAnchor.start, end: newAnchor.end, }\r\n };\r\n\r\n WebApi.patchAnnotation(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ANCHOR_UPDATE', label, id, language });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_ANNOTATION_ANCHOR_UPDATE_FAILED', label, id, language, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_ANNOTATION_ANCHOR_UPDATE', label, id, language });\r\n }, delay);\r\n }\r\n}\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer = (state: ViewRegistryState, action: KnownAction): ViewRegistryState => {\r\n\r\n switch (action.type) {\r\n\r\n // add\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_ADD': {\r\n const annotation = action.annotation;\r\n return addAnnotationItem(state, annotation.contentLabel!, annotation);\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_ADD_FAILED': {\r\n //???\r\n // TODO maybe show a global error message; perhaps in an error store?\r\n return state;\r\n }\r\n\r\n // delete\r\n\r\n case 'VIEWREGISTRY_REQUEST_ANNOTATION_DELETE': {\r\n return alterAnnotationItem1(state, action.label, action.id, annotation => {\r\n return { ...annotation, isDeleting: true };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_DELETE': {\r\n return alterAnnotationItem1(state, action.label, action.id, annotation => {\r\n return {\r\n ...annotation,\r\n isDeleting: false,\r\n isDeleted: true\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_DELETE_FAILED': {\r\n return alterAnnotationItem1(state, action.label, action.id, annotation => {\r\n return { ...annotation, isDeleting: false };\r\n });\r\n }\r\n\r\n // hide\r\n\r\n case 'VIEWREGISTRY_REQUEST_ANNOTATION_HIDE': {\r\n return alterAnnotationItem1(state, action.label, action.id, annotation => {\r\n return { ...annotation, isDeleting: true };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_HIDE': {\r\n return alterAnnotationItem1(state, action.label, action.id, annotation => {\r\n return {\r\n ...annotation,\r\n isDeleting: false,\r\n isOptOut: true\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_HIDE_FAILED': {\r\n return alterAnnotationItem1(state, action.label, action.id, annotation => {\r\n return { ...annotation, isDeleting: false };\r\n });\r\n }\r\n\r\n // show\r\n\r\n case 'VIEWREGISTRY_REQUEST_ANNOTATION_SHOW': {\r\n return state;\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_SHOW': {\r\n return alterAnnotationItem1(state, action.label, action.id, annotation => {\r\n return {\r\n ...annotation,\r\n isOptOut: false\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_SHOW_FAILED': {\r\n return state;\r\n }\r\n\r\n // draft state\r\n\r\n case 'VIEWREGISTRY_HANDLE_ANNOTATION_DRAFT_CHANGED': {\r\n return alterDraftState(state, action.label, action.id, action.language, (draftState) => {\r\n const contentState = draftState.editor.getCurrentContent();\r\n const newContentState = action.newEditorState.getCurrentContent();\r\n const modified = !contentState.equals(newContentState);\r\n\r\n return {\r\n ...draftState,\r\n editor: action.newEditorState,\r\n syncState: modified ? SyncStateUtil.getModified(draftState.syncState) : draftState.syncState\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_REQUEST_ANNOTATION_DRAFT_UPDATE': {\r\n return alterDraftState(state, action.label, action.id, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getSyncing(draftState.syncState)\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_DRAFT_UPDATE': {\r\n return alterDraftState(state, action.label, action.id, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getSynced()\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_DRAFT_UPDATE_FAILED': {\r\n return alterDraftState(state, action.label, action.id, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getError(draftState.syncState, action.error)\r\n };\r\n });\r\n }\r\n\r\n // anchor state\r\n\r\n case 'VIEWREGISTRY_HANDLE_ANNOTATION_ANCHOR_CHANGED': {\r\n return alterAnchorState(state, action.label, action.id, action.language, (anchorState) => {\r\n const modified = !_.isEqual(anchorState, action.newAnchor);\r\n return {\r\n ...anchorState,\r\n ...action.newAnchor,\r\n syncState: modified ? SyncStateUtil.getModified(anchorState.syncState) : anchorState.syncState\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_REQUEST_ANNOTATION_ANCHOR_UPDATE': {\r\n return alterAnchorState(state, action.label, action.id, action.language, (anchorState) => {\r\n return {\r\n ...anchorState,\r\n syncState: SyncStateUtil.getSyncing(anchorState.syncState)\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_ANCHOR_UPDATE': {\r\n return alterAnchorState(state, action.label, action.id, action.language, (anchorState) => {\r\n return {\r\n ...anchorState,\r\n syncState: SyncStateUtil.getSynced()\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_ANNOTATION_ANCHOR_UPDATE_FAILED': {\r\n return alterAnchorState(state, action.label, action.id, action.language, (anchorState) => {\r\n return {\r\n ...anchorState,\r\n syncState: SyncStateUtil.getError(anchorState.syncState, action.error)\r\n };\r\n });\r\n }\r\n\r\n // add language \r\n case 'VIEWREGISTRY_ADD_ANNOTATION_LANGUAGE': {\r\n return alterAnnotationItem1(state, action.label, action.id, (annotation) => {\r\n return {\r\n ...annotation,\r\n draftState: {\r\n ...annotation.draftState,\r\n [action.language]: {\r\n language: action.language,\r\n editor: Items.getEditorState(undefined),\r\n syncState: SyncStateUtil.getModified(SyncStateUtil.getSynced())\r\n }\r\n },\r\n };\r\n });\r\n }\r\n\r\n default: const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};\r\n\r\nfunction addAnnotationItem(state: ViewRegistryState, label: string, annotation: Model.AnnotationVM): ViewRegistryState {\r\n\r\n const content = state.contents[label];\r\n const newAnnotation = Items.getAnnotation(content, annotation);\r\n\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: {\r\n ...content,\r\n annotations: {\r\n ...content.annotations,\r\n [newAnnotation.id]: newAnnotation\r\n }\r\n }\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction alterAnnotationItem1(state: ViewRegistryState, label: string, id: string,\r\n alter: (annotation: AnnotationItem) => AnnotationItem): ViewRegistryState {\r\n\r\n const content = state.contents[label];\r\n const annotation = content.annotations[id];\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: {\r\n ...content,\r\n annotations: {\r\n ...content.annotations,\r\n [id]: alter(annotation)\r\n }\r\n }\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction alterAnnotationItem2(state: ViewRegistryState, label: string, id: string, language: Model.Language,\r\n alter: (annotation: AnnotationItem, draftState: DraftState, anchorState: AnchorState) => AnnotationItem): ViewRegistryState {\r\n\r\n const content = state.contents[label];\r\n const annotation = content.annotations[id];\r\n const draftState = annotation.draftState[language];\r\n const anchorState = annotation.anchorState[language];\r\n\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: {\r\n ...content,\r\n annotations: {\r\n ...content.annotations,\r\n [id]: alter(annotation, draftState, anchorState)\r\n }\r\n }\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction alterDraftState(state: ViewRegistryState, label: string, id: string, language: Model.Language,\r\n alter: (draftState: DraftState) => DraftState): ViewRegistryState {\r\n\r\n return alterAnnotationItem2(state, label, id, language, (annotation, draftState, anchorState) => {\r\n return {\r\n ...annotation,\r\n isDraftOutOfSync: false,\r\n draftState: {\r\n ...annotation.draftState,\r\n [language]: alter(draftState)\r\n }\r\n };\r\n });\r\n}\r\n\r\nfunction alterAnchorState(state: ViewRegistryState, label: string, id: string, language: Model.Language,\r\n alter: (anchorState: AnchorState) => AnchorState): ViewRegistryState {\r\n\r\n return alterAnnotationItem2(state, label, id, language, (annotation, draftState, anchorState) => {\r\n return {\r\n ...annotation,\r\n anchorState: {\r\n ...annotation.anchorState,\r\n [language]: alter(anchorState)\r\n }\r\n };\r\n });\r\n}\r\n","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction } from '../';\r\nimport * as _ from 'lodash';\r\nimport * as Draft from \"draft-js\";\r\n\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport { ViewRegistryState } from './';\r\nimport * as Items from './items';\r\nimport { DraftState, ContentItem, NoteItem } from './items';\r\nimport { TypeOfStickyNote } from '../../viewmodels/EPCDataModel';\r\n\r\n/** actions */\r\n\r\n// add \r\n\r\ninterface ReceiveNoteAddAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_ADD',\r\n note: Model.StickyNoteVM,\r\n}\r\n\r\ninterface ReceiveNoteAddFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_ADD_FAILED',\r\n label: string,\r\n parKey?: string,\r\n id?: string,\r\n error: any,\r\n}\r\n\r\n// delete\r\n\r\ninterface RequestNoteDeleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_NOTE_DELETE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteDeleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_DELETE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteDeleteFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_DELETE_FAILED',\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// hide\r\n\r\ninterface RequestNoteHideAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_NOTE_HIDE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteHideAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_HIDE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteHideFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_HIDE_FAILED',\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// show\r\n\r\ninterface RequestNoteShowAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_NOTE_SHOW',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteShowAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_SHOW',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteShowFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_SHOW_FAILED',\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// draft state\r\n\r\ninterface HandleNoteDraftChangedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_HANDLE_NOTE_DRAFT_CHANGED',\r\n label: string,\r\n id: string,\r\n language: Model.Language,\r\n newEditorState: Draft.EditorState,\r\n}\r\n\r\ninterface RequestNoteDraftUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_NOTE_DRAFT_UPDATE',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteDraftUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_DRAFT_UPDATE',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteDraftUpdateFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_DRAFT_UPDATE_FAILED',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// type\r\n\r\n// TODO visibility\r\n\r\ninterface RequestNoteTypeUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_NOTE_TYPE_UPDATE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveNoteTypeUpdateAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_TYPE_UPDATE',\r\n label: string,\r\n id: string,\r\n typeOfStickyNote: TypeOfStickyNote,\r\n}\r\n\r\ninterface ReceiveNoteTypeUpdateFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_NOTE_TYPE_UPDATE_FAILED',\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// add language\r\n\r\ninterface AddNoteLanguageAction extends AnyAction {\r\n type: 'VIEWREGISTRY_ADD_NOTE_LANGUAGE',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\n/** union of all actions */\r\nexport type KnownAction =\r\n // add\r\n | ReceiveNoteAddAction\r\n | ReceiveNoteAddFailedAction\r\n // delete\r\n | RequestNoteDeleteAction\r\n | ReceiveNoteDeleteAction\r\n | ReceiveNoteDeleteFailedAction\r\n // hide\r\n | RequestNoteHideAction\r\n | ReceiveNoteHideAction\r\n | ReceiveNoteHideFailedAction\r\n // show\r\n | RequestNoteShowAction\r\n | ReceiveNoteShowAction\r\n | ReceiveNoteShowFailedAction\r\n // draft state\r\n | HandleNoteDraftChangedAction\r\n | RequestNoteDraftUpdateAction\r\n | ReceiveNoteDraftUpdateAction\r\n | ReceiveNoteDraftUpdateFailedAction\r\n // type\r\n | RequestNoteTypeUpdateAction\r\n | ReceiveNoteTypeUpdateAction\r\n | ReceiveNoteTypeUpdateFailedAction\r\n // add language\r\n | AddNoteLanguageAction;\r\n\r\nconst delay = 100;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n\r\n // add\r\n\r\n addNoteToContentLike: (editScopeId: string, editLanguage: Model.Language, label: string, parKey?: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState();\r\n let dto: Model.NotePostDto = {\r\n scopeId: editScopeId,\r\n label: label,\r\n paragraphKey: parKey,\r\n typeOfStickyNote: Model.TypeOfStickyNote.Custom,\r\n visibilityOfStickyNote: Model.VisibilityOfStickyNote.PrivateToScope,\r\n draftLanguage: editLanguage,\r\n draft: Draft.convertToRaw(Draft.ContentState.createFromText(\"\")),\r\n };\r\n\r\n WebApi.postNote(dto)\r\n .then(result => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_ADD', note: result.model! });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_ADD_FAILED', label, parKey, error });\r\n });\r\n },\r\n\r\n addNoteToAnnotation: (editScopeId: string, editLanguage: Model.Language, label: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState();\r\n\r\n let dto: Model.NotePostDto = {\r\n scopeId: editScopeId,\r\n label: label,\r\n annotationId: id,\r\n typeOfStickyNote: Model.TypeOfStickyNote.Custom,\r\n visibilityOfStickyNote: Model.VisibilityOfStickyNote.PrivateToScope,\r\n draftLanguage: editLanguage,\r\n draft: Draft.convertToRaw(Draft.ContentState.createFromText(\"\")),\r\n };\r\n\r\n WebApi.postNote(dto)\r\n .then(result => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_ADD', note: result.model! });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_ADD_FAILED', label, id, error });\r\n });\r\n },\r\n\r\n // delete\r\n\r\n deleteNote: (label: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const note = state.contents[label].notes[id];\r\n\r\n let dto: Model.NoteDeleteDto = {\r\n scopeId: note.scopeId,\r\n label: label,\r\n id: id,\r\n };\r\n\r\n WebApi.deleteNote(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_DELETE', label, id });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_DELETE_FAILED', label, id, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_NOTE_DELETE', label, id });\r\n },\r\n\r\n // hide\r\n\r\n hideNote: (editScopeId: string, label: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const note = state.contents[label].notes[id];\r\n\r\n let dto: Model.NoteHideDto = {\r\n scopeId: note.scopeId,\r\n label: label,\r\n id: id,\r\n editScopeId: editScopeId\r\n };\r\n\r\n WebApi.hideNote(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_HIDE', label, id });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_HIDE_FAILED', label, id, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_NOTE_HIDE', label, id });\r\n },\r\n\r\n // show\r\n\r\n showNote: (editScopeId: string, label: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const note = state.contents[label].notes[id];\r\n\r\n let dto: Model.NoteShowDto = {\r\n scopeId: note.scopeId,\r\n label: label,\r\n id: id,\r\n editScopeId: editScopeId\r\n };\r\n\r\n WebApi.showNote(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_SHOW', label, id });\r\n })\r\n .catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_SHOW_FAILED', label, id, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_NOTE_SHOW', label, id });\r\n },\r\n\r\n // add language\r\n\r\n addNoteLanguage: (label: string, id: string, language: Model.Language): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'VIEWREGISTRY_ADD_NOTE_LANGUAGE', label, id, language });\r\n },\r\n\r\n // draft state\r\n\r\n onNoteDraftChanged: (label: string, id: string, language: Model.Language, newEditorState: Draft.EditorState): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'VIEWREGISTRY_HANDLE_NOTE_DRAFT_CHANGED', label, id, language, newEditorState });\r\n },\r\n\r\n updateNoteDraft: (label: string, id: string, language: Model.Language): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n const note = state.contents[label].notes[id];\r\n const draftState = note.draftState[language];\r\n const contentState = draftState.editor.getCurrentContent();\r\n\r\n let dto: Model.NotePatchDto = {\r\n scopeId: note.scopeId,\r\n label: label,\r\n id: id,\r\n etag: '*',\r\n draftLanguage: language,\r\n draft: Draft.convertToRaw(contentState)\r\n };\r\n\r\n WebApi.patchNote(dto).then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_DRAFT_UPDATE', label, id, language });\r\n }).catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_DRAFT_UPDATE_FAILED', label, id, language, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_NOTE_DRAFT_UPDATE', label, id, language });\r\n }, delay);\r\n },\r\n\r\n // type\r\n updateNoteType: (label: string, id: string, typeOfStickyNote: Model.TypeOfStickyNote): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n const note = state.contents[label].notes[id];\r\n\r\n let dto: Model.NotePatchDto = {\r\n scopeId: note.scopeId,\r\n label: label,\r\n id: id,\r\n etag: '*',\r\n typeOfStickyNote: typeOfStickyNote\r\n };\r\n\r\n WebApi.patchNote(dto).then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_TYPE_UPDATE', label, id, typeOfStickyNote });\r\n }).catch((error: any) => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_NOTE_TYPE_UPDATE_FAILED', label, id, error });\r\n });\r\n\r\n dispatch({ type: 'VIEWREGISTRY_REQUEST_NOTE_TYPE_UPDATE', label, id });\r\n }, delay);\r\n },\r\n}\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer = (state: ViewRegistryState, action: KnownAction): ViewRegistryState => {\r\n\r\n switch (action.type) {\r\n\r\n // add\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_ADD': {\r\n const note = action.note;\r\n return addNoteItem(state, note.targetLabel!, note);\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_ADD_FAILED': {\r\n //???\r\n // TODO maybe show a global error message; perhaps in an error store?\r\n return state;\r\n }\r\n\r\n // delete\r\n\r\n case 'VIEWREGISTRY_REQUEST_NOTE_DELETE': {\r\n return alterNoteItem1(state, action.label, action.id, note => {\r\n return { ...note, isDeleting: true };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_DELETE': {\r\n return alterNoteItem1(state, action.label, action.id, note => {\r\n return { ...note, isDeleting: false, isDeleted: true };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_DELETE_FAILED': {\r\n return alterNoteItem1(state, action.label, action.id, note => {\r\n return { ...note, isDeleting: false, isDeleted: false };\r\n });\r\n }\r\n\r\n // hide\r\n\r\n case 'VIEWREGISTRY_REQUEST_NOTE_HIDE': {\r\n return alterNoteItem1(state, action.label, action.id, note => {\r\n return { ...note, isDeleting: true };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_HIDE': {\r\n return alterNoteItem1(state, action.label, action.id, note => {\r\n return { ...note, isDeleting: false, isOptOut: true, isDeleted: false };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_HIDE_FAILED': {\r\n return alterNoteItem1(state, action.label, action.id, note => {\r\n return { ...note, isDeleting: false };\r\n });\r\n }\r\n\r\n // show\r\n\r\n case 'VIEWREGISTRY_REQUEST_NOTE_SHOW': {\r\n return state;\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_SHOW': {\r\n return alterNoteItem1(state, action.label, action.id, note => {\r\n return { ...note, isOptOut: false, isDeleting: false, isDeleted: false};\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_SHOW_FAILED': {\r\n return state;\r\n\r\n }\r\n\r\n // draft state\r\n\r\n case 'VIEWREGISTRY_HANDLE_NOTE_DRAFT_CHANGED': {\r\n return alterDraftState(state, action.label, action.id, action.language, (draftState) => {\r\n const contentState = draftState.editor.getCurrentContent();\r\n const newContentState = action.newEditorState.getCurrentContent();\r\n const modified = !contentState.equals(newContentState);\r\n\r\n return {\r\n ...draftState,\r\n editor: action.newEditorState,\r\n syncState: modified ? SyncStateUtil.getModified(draftState.syncState) : draftState.syncState\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_REQUEST_NOTE_DRAFT_UPDATE': {\r\n return alterDraftState(state, action.label, action.id, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getSyncing(draftState.syncState)\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_DRAFT_UPDATE': {\r\n return alterDraftState(state, action.label, action.id, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getSynced()\r\n };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_DRAFT_UPDATE_FAILED': {\r\n return alterDraftState(state, action.label, action.id, action.language, (draftState) => {\r\n return {\r\n ...draftState,\r\n syncState: SyncStateUtil.getError(draftState.syncState, action.error)\r\n };\r\n });\r\n }\r\n\r\n // type\r\n\r\n case 'VIEWREGISTRY_REQUEST_NOTE_TYPE_UPDATE': {\r\n return state;\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_TYPE_UPDATE': {\r\n return alterNoteItem1(state, action.label, action.id, note => {\r\n return { ...note, typeOfStickyNote: action.typeOfStickyNote };\r\n });\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_NOTE_TYPE_UPDATE_FAILED': {\r\n return state;\r\n }\r\n\r\n // add language \r\n case 'VIEWREGISTRY_ADD_NOTE_LANGUAGE': {\r\n return alterNoteItem1(state, action.label, action.id, (note) => {\r\n return {\r\n ...note,\r\n draftState: {\r\n ...note.draftState,\r\n [action.language]: {\r\n language: action.language,\r\n editor: Items.getEditorState(undefined),\r\n syncState: SyncStateUtil.getModified(SyncStateUtil.getSynced())\r\n }\r\n },\r\n };\r\n });\r\n }\r\n\r\n default: const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};\r\n\r\nfunction addNoteItem(state: ViewRegistryState, label: string, note: Model.StickyNoteVM): ViewRegistryState {\r\n\r\n const content = state.contents[label];\r\n const newNote = Items.getNote(content, note);\r\n\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: {\r\n ...content,\r\n notes: {\r\n ...content.notes,\r\n [newNote.id]: newNote\r\n }\r\n }\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction alterNoteItem1(state: ViewRegistryState, label: string, id: string,\r\n alter: (note: NoteItem) => NoteItem): ViewRegistryState {\r\n\r\n const content = state.contents[label];\r\n const note = content.notes[id];\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: {\r\n ...content,\r\n notes: {\r\n ...content.notes,\r\n [id]: alter(note)\r\n }\r\n }\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction alterNoteItem2(state: ViewRegistryState, label: string, id: string, language: Model.Language,\r\n alter: (note: NoteItem, draftState: DraftState) => NoteItem): ViewRegistryState {\r\n\r\n const content = state.contents[label];\r\n const note = content.notes[id];\r\n const draftState = note.draftState[language];\r\n\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: {\r\n ...content,\r\n notes: {\r\n ...content.notes,\r\n [id]: alter(note, draftState)\r\n }\r\n }\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction alterDraftState(state: ViewRegistryState, label: string, id: string, language: Model.Language,\r\n alter: (draftState: DraftState) => DraftState): ViewRegistryState {\r\n\r\n return alterNoteItem2(state, label, id, language, (note, draftState) => {\r\n return {\r\n ...note,\r\n draftState: {\r\n ...note.draftState,\r\n [language]: alter(draftState)\r\n }\r\n };\r\n });\r\n}\r\n","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction } from '../';\r\nimport * as _ from 'lodash';\r\nimport * as Draft from \"draft-js\";\r\n\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport { ViewRegistryState } from './';\r\nimport * as Items from './items';\r\nimport { AnchorState, ContentItem, MarkerItem } from './items';\r\nimport { SelectionState } from './toolbar';\r\n\r\n/** actions */\r\n\r\n// delete\r\n\r\ninterface RequestMarkerDeleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_MARKER_DELETE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveMarkerDeleteAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_MARKER_DELETE',\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveMarkerDeleteFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_MARKER_DELETE_FAILED',\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n// add\r\n\r\ninterface RequestMarkerAddAction extends AnyAction {\r\n type: 'VIEWREGISTRY_REQUEST_MARKER_ADD',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n}\r\n\r\ninterface ReceiveMarkerAddAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_MARKER_ADD',\r\n marker: MarkerItem,\r\n}\r\n\r\ninterface ReceiveMarkerAddFailedAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_MARKER_ADD_FAILED',\r\n language: Model.Language,\r\n label: string,\r\n id: string,\r\n error: any\r\n}\r\n\r\n/** union of all actions */\r\nexport type KnownAction =\r\n // delete\r\n | RequestMarkerDeleteAction\r\n | ReceiveMarkerDeleteAction\r\n | ReceiveMarkerDeleteFailedAction\r\n // draft state\r\n | RequestMarkerAddAction\r\n | ReceiveMarkerAddAction\r\n | ReceiveMarkerAddFailedAction;\r\n\r\nconst delay = 100;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n\r\n // delete\r\n\r\n deleteOrHideMarkers: (editScopeId: string, label: string, language: Model.Language, parKey: string, selection: SelectionState): AppThunkAction => (dispatch, getState) => {\r\n\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n const content = state.contents[label];\r\n if (content.type != 'Content')\r\n throw new TypeError();\r\n const markers = _.values(content.markers).filter(marker => marker.language == language);\r\n\r\n for (let i = 0; i < markers.length; i++) {\r\n const marker = markers[i];\r\n const anchor = marker.anchorState;\r\n\r\n if (marker.paragraphKey !== parKey)\r\n continue;\r\n\r\n if (anchor.end === undefined || anchor.start === undefined || anchor.end < selection.start || selection.end < anchor.start)\r\n continue;\r\n\r\n if (editScopeId == marker.scopeId) {\r\n\r\n const dto: Model.MarkerDeleteDto = {\r\n scopeId: marker.scopeId,\r\n label: label,\r\n id: marker.id\r\n };\r\n\r\n WebApi.deleteMarker(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_MARKER_DELETE', label, id: marker.id });\r\n })\r\n .catch((error: any) => {\r\n // TODO what to do if an error occurs?\r\n console.debug(\"error: \" + error);\r\n });\r\n }\r\n else {\r\n const dto: Model.MarkerHideDto = {\r\n scopeId: marker.scopeId,\r\n label: label,\r\n id: marker.id,\r\n editScopeId: editScopeId\r\n };\r\n\r\n WebApi.hideMarker(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_MARKER_DELETE', label, id: marker.id });\r\n })\r\n .catch((error: any) => {\r\n // TODO what to do if an error occurs?\r\n console.debug(\"error: \" + error);\r\n });\r\n }\r\n }\r\n }, delay);\r\n },\r\n\r\n // add\r\n\r\n addMarker: (editScopeId: string, label: string, language: Model.Language, parKey: string, selection: SelectionState, styleId: string): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n\r\n const state = getState().viewRegistry;\r\n const content = state.contents[label];\r\n\r\n const dto: Model.MarkerPostDto = {\r\n scopeId: editScopeId,\r\n label: label,\r\n paragraphKey: parKey,\r\n language: language,\r\n styleId: styleId,\r\n anchor: { start: selection.start, end: selection.end }\r\n };\r\n\r\n WebApi.postMarker(dto)\r\n .then(result => {\r\n dispatch({\r\n type: 'VIEWREGISTRY_RECEIVE_MARKER_ADD',\r\n marker: Items.getMarker2(label, result.model!)\r\n });\r\n }).catch((error: any) => {\r\n // TODO what to do if an error occurs?\r\n console.debug(\"error: \" + error);\r\n });\r\n }, delay);\r\n },\r\n}\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer = (state: ViewRegistryState, action: KnownAction): ViewRegistryState => {\r\n\r\n switch (action.type) {\r\n\r\n // delete\r\n\r\n case 'VIEWREGISTRY_REQUEST_MARKER_DELETE': {\r\n //???\r\n return state;\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_MARKER_DELETE': {\r\n return deleteMarkerItem(state, action.label, action.id);\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_MARKER_DELETE_FAILED': {\r\n //???\r\n // TODO maybe show a global error message; perhaps in an error store?\r\n return state;\r\n }\r\n\r\n // add\r\n\r\n case 'VIEWREGISTRY_REQUEST_MARKER_ADD': {\r\n //???\r\n return state;\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_MARKER_ADD': {\r\n const marker = action.marker;\r\n return addMarkerItem(state, marker.label, marker);\r\n }\r\n\r\n case 'VIEWREGISTRY_RECEIVE_MARKER_ADD_FAILED': {\r\n //???\r\n // TODO maybe show a global error message; perhaps in an error store?\r\n return state;\r\n }\r\n\r\n default: const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};\r\n\r\nfunction deleteMarkerItem(state: ViewRegistryState, label: string, id: string): ViewRegistryState {\r\n\r\n const content = state.contents[label];\r\n if (content.type != 'Content')\r\n throw new TypeError();\r\n\r\n // TODO is there a more elegant way?\r\n let newMarkers: { [id: string]: MarkerItem } = {};\r\n for (let markerId in content.markers) {\r\n if (markerId != id) {\r\n newMarkers[markerId] = content.markers[markerId];\r\n }\r\n }\r\n\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: {\r\n ...content,\r\n markers: newMarkers\r\n }\r\n }\r\n };\r\n return newState;\r\n}\r\n\r\nfunction addMarkerItem(state: ViewRegistryState, label: string, marker: MarkerItem): ViewRegistryState {\r\n\r\n const content = state.contents[label];\r\n if (content.type != 'Content')\r\n throw new TypeError();\r\n\r\n let newState = {\r\n ...state,\r\n contents: {\r\n ...state.contents,\r\n [label]: {\r\n ...content,\r\n markers: {\r\n ...content.markers,\r\n [marker.id]: marker\r\n }\r\n }\r\n }\r\n };\r\n return newState;\r\n}\r\n","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction, ApplicationState } from '../';\r\nimport * as _ from 'lodash';\r\n\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport { ViewRegistryState } from './';\r\nimport * as Items from './items';\r\nimport { LinkedContentGroup, LinkedContentItem } from './items';\r\n\r\nconst delay = 100;\r\n\r\nfunction handleOK(dispatch: (action: Items.KnownAction) => void, getState: () => ApplicationState) {\r\n const state = getState().viewRegistry;\r\n Items.actionCreators.requestLinkedContent(state.label!, state.scopeIds!, state.languages!)(dispatch, getState);\r\n}\r\n\r\nfunction handleError(error: any, dispatch: (action: Items.KnownAction) => void, getState: () => ApplicationState) {\r\n // TODO what to do if an error occurs?\r\n console.debug(\"error: \" + error);\r\n}\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n\r\n // item\r\n\r\n deleteItem: (scopeId: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentDeleteItemDto = {\r\n label: state.label!,\r\n scopeId: scopeId,\r\n id: id,\r\n };\r\n\r\n WebApi.deleteLinkedContentItem(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n\r\n addItem: (scopeId: string, targetLabel: string, parentId?: string): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentPostItemDto = {\r\n label: state.label!,\r\n scopeId: scopeId,\r\n targetLabel: targetLabel,\r\n parentId: parentId,\r\n };\r\n\r\n WebApi.postLinkedContentItem(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n\r\n addNewCommentItem: (\r\n editScopeId: string,\r\n editLanguage: Model.Language,\r\n productId: string,\r\n label: string,\r\n parentId: string,\r\n customRef: string | null,\r\n title: string,\r\n tags: string[]): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentPostNewCommentDto = {\r\n scopeId: editScopeId,\r\n language: editLanguage,\r\n productId: productId,\r\n label: label,\r\n parentId: parentId,\r\n customRef: customRef || undefined,\r\n title: title,\r\n tags: tags,\r\n };\r\n\r\n WebApi.postLinkedContentNewComment(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n\r\n updateItem: (\r\n editScopeId: string,\r\n scopeId: string,\r\n id: string,\r\n hideBody?: boolean,\r\n optOut?: boolean,\r\n layoutType?: Model.LayoutType,\r\n ): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentPatchItemDto = {\r\n label: state.label!,\r\n scopeId: editScopeId, // we need to update the container according to editScopeId NOT item.scopeId\r\n id: id,\r\n layoutType: layoutType,\r\n optOut: optOut,\r\n hideBody: hideBody,\r\n };\r\n\r\n WebApi.patchLinkedContentItem(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n\r\n moveItem: (scopeId: string, id: string, beforeSiblingId?: string, toParentId?: string): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentMoveItemDto = {\r\n label: state.label!,\r\n scopeId: scopeId,\r\n id: id,\r\n beforeSiblingId,\r\n toParentId\r\n };\r\n\r\n WebApi.moveLinkedContentItem(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n\r\n // group\r\n deleteGroup: (scopeId: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentDeleteGroupDto = {\r\n label: state.label!,\r\n scopeId: scopeId,\r\n id: id,\r\n };\r\n\r\n WebApi.deleteLinkedContentGroup(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n\r\n addGroup: (scopeId: string, header: string, language: Model.Language, parentId?: string): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentPostGroupDto = {\r\n label: state.label!,\r\n scopeId: scopeId,\r\n header: header,\r\n language: language,\r\n parentId: parentId\r\n };\r\n\r\n WebApi.postLinkedContentGroup(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n\r\n updateGroup: (\r\n editScopeId: string,\r\n scopeId: string,\r\n id: string,\r\n language: Model.Language,\r\n header?: string,\r\n hideHeader?: boolean,\r\n optOut?: boolean,\r\n breakSection?: boolean,\r\n ): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentPatchGroupDto = {\r\n label: state.label!,\r\n scopeId: editScopeId, // we need to update the container according to editScopeId NOT item.scopeId\r\n id: id,\r\n language: language,\r\n header: header,\r\n breakSection: breakSection,\r\n hideHeader: hideHeader,\r\n optOut: optOut,\r\n };\r\n\r\n WebApi.patchLinkedContentGroup(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n\r\n moveGroup: (scopeId: string, id: string, beforeSiblingId?: string, toParentId?: string): AppThunkAction => (dispatch, getState) => {\r\n setTimeout(() => {\r\n\r\n const state = getState().viewRegistry;\r\n\r\n const dto: Model.LinkedContentMoveGroupDto = {\r\n label: state.label!,\r\n scopeId: scopeId,\r\n id: id,\r\n beforeSiblingId,\r\n toParentId\r\n };\r\n\r\n WebApi.moveLinkedContentGroup(dto)\r\n .then(() => { handleOK(dispatch, getState); })\r\n .catch((error: any) => { handleError(error, dispatch, getState); });\r\n\r\n }, delay);\r\n },\r\n}\r\n\r\nexport function alterLinkedContentItem(state: ViewRegistryState, id: string, alter: (item: LinkedContentItem) => LinkedContentItem): ViewRegistryState {\r\n return {\r\n ...state,\r\n linkedContentRoot: alterLinkedContentItem2(state.linkedContentRoot, id, alter)\r\n };\r\n}\r\n\r\nexport function alterLinkedContentItem2(group: LinkedContentGroup, itemId: string, alter: (item: LinkedContentItem) => LinkedContentItem): LinkedContentGroup {\r\n\r\n for (let id in group.groups) {\r\n let subgroup = group.groups[id];\r\n let newSubgroup = alterLinkedContentItem2(subgroup, itemId, alter);\r\n if (subgroup !== newSubgroup) {\r\n return {\r\n ...group,\r\n groups: {\r\n ...group.groups,\r\n [id]: newSubgroup\r\n }\r\n };\r\n }\r\n }\r\n\r\n for (let id in group.items) {\r\n let item = group.items[id];\r\n if (item.id == itemId) {\r\n let newItem = alter(item);\r\n return {\r\n ...group,\r\n items: {\r\n ...group.items,\r\n [id]: newItem\r\n }\r\n };\r\n }\r\n }\r\n\r\n return group;\r\n}\r\n\r\n\r\nexport function findLinkedContentItem(root: LinkedContentGroup, findItemId: string): LinkedContentItem | null {\r\n if (!root || !findItemId)\r\n return null;\r\n\r\n let groups = [root];\r\n\r\n while (groups.length > 0) {\r\n let group = groups.pop()!;\r\n for (let groupId in group.groups) {\r\n groups.push(group.groups[groupId]);\r\n }\r\n for (let itemId in group.items) {\r\n if (itemId == findItemId)\r\n return group.items[itemId];\r\n }\r\n }\r\n return null;\r\n}","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction } from '../';\r\nimport * as _ from 'lodash';\r\nimport * as Draft from \"draft-js\";\r\n\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport { ViewRegistryState } from './';\r\nimport * as Items from './items';\r\nimport { ContentItem, ContentParagraphItem } from './items';\r\nimport { alterLinkedContentItem } from './linkedContents';\r\n\r\n/** actions */\r\n\r\ninterface ReceiveContentParagraphHideAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_CONTENTPARAGRAPH_HIDE',\r\n label: string,\r\n id: string,\r\n paragraphKey: string,\r\n}\r\n\r\ninterface ReceiveContentParagraphShowAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RECEIVE_CONTENTPARAGRAPH_SHOW',\r\n id: string,\r\n paragraphKey: string,\r\n}\r\n\r\n/** union of all actions */\r\nexport type KnownAction =\r\n | ReceiveContentParagraphHideAction\r\n | ReceiveContentParagraphShowAction;\r\n\r\nconst delay = 100;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n\r\n // hide\r\n\r\n hideContentParagraph: (scopeId: string, id: string, paragraphKey: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const label = state.label!;\r\n const content = state.contents[label];\r\n if (content.type != 'Content')\r\n throw new TypeError();\r\n\r\n const dto: Model.LinkedContentHideParagraphDto = {\r\n scopeId: scopeId,\r\n label: label,\r\n id: id,\r\n paragraphKey: paragraphKey,\r\n };\r\n\r\n WebApi.hideLinkedContentParagraph(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_CONTENTPARAGRAPH_HIDE', label, id, paragraphKey });\r\n })\r\n .catch((error: any) => {\r\n console.error(error);\r\n });\r\n },\r\n\r\n // show\r\n\r\n showContentParagraph: (scopeId: string, id: string, paragraphKey: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().viewRegistry;\r\n const label = state.label!;\r\n const content = state.contents[label];\r\n if (content.type != 'Content')\r\n throw new TypeError();\r\n\r\n const dto: Model.LinkedContentHideParagraphDto = {\r\n scopeId: scopeId,\r\n label: label,\r\n id: id,\r\n paragraphKey: paragraphKey,\r\n };\r\n\r\n WebApi.showLinkedContentParagraph(dto)\r\n .then(() => {\r\n dispatch({ type: 'VIEWREGISTRY_RECEIVE_CONTENTPARAGRAPH_SHOW', label, id, paragraphKey });\r\n })\r\n .catch((error: any) => {\r\n console.error(error);\r\n });\r\n },\r\n}\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer = (state: ViewRegistryState, action: KnownAction): ViewRegistryState => {\r\n\r\n switch (action.type) {\r\n\r\n // hide\r\n case 'VIEWREGISTRY_RECEIVE_CONTENTPARAGRAPH_HIDE': {\r\n return alterLinkedContentItem(state, action.id, item => {\r\n let newParagraphOptOut = _.union(item.paragraphOptOut, [action.paragraphKey])\r\n return {\r\n ...item,\r\n paragraphOptOut: newParagraphOptOut\r\n };\r\n });\r\n }\r\n\r\n // show\r\n\r\n case 'VIEWREGISTRY_RECEIVE_CONTENTPARAGRAPH_SHOW': {\r\n return alterLinkedContentItem(state, action.id, item => {\r\n let newParagraphOptOut = _.without(item.paragraphOptOut, action.paragraphKey)\r\n return {\r\n ...item,\r\n paragraphOptOut: newParagraphOptOut\r\n };\r\n });\r\n }\r\n\r\n default: const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};\r\n\r\n//function alterContentParagraphItem(state: ViewRegistryState, label: string, paragraphKey: string,\r\n// alter: (par: ContentParagraphItem) => ContentParagraphItem) {\r\n\r\n// const content = state.contents[label];\r\n// const idx = _.findIndex(content.paragraphs, p => p.key === paragraphKey);\r\n// if (idx < 0) {\r\n// console.error(`no such parKey in ${label}: ${paragraphKey}`);\r\n// return state;\r\n// }\r\n// let newPars = [...content.paragraphs];\r\n// newPars[idx] = alter(newPars[idx]);\r\n\r\n// let newState = {\r\n// ...state,\r\n// contents: {\r\n// ...state.contents,\r\n// [label]: {\r\n// ...content,\r\n// paragraphs: newPars\r\n// }\r\n// }\r\n// };\r\n// return newState;\r\n//}","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction } from '../';\r\nimport * as _ from 'lodash';\r\nimport * as Draft from \"draft-js\";\r\n\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\nimport * as Debug from '../../debug';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport * as Items from './items';\r\nimport * as Toolbar from './toolbar';\r\nimport * as Comments from './comments';\r\nimport * as Annotations from './annotations';\r\nimport * as Notes from './notes';\r\nimport * as Markers from './markers';\r\nimport * as LinkedContents from './linkedContents';\r\nimport * as ContentParagraphs from './contentParagraphs';\r\n\r\n//// re-exports\r\n//export {\r\n// ViewRegistryMode,\r\n// ContentItem, FriendlyLabelItem, ContentParagraphItem,\r\n// AnnotationItem, AnchorState, CommentItem, NoteItem, MarkerItem,\r\n// LinkedContentGroup, LinkedContentItem,\r\n// ContentLikeItem,\r\n// getBestLanguage, isCommentLabel,\r\n//} from './items';\r\n//export { findLinkedContentItem } from './linkedContents';\r\n//export { ContentToolbarTarget, AnnotationEditorTarget, CommentEditorTarget, NoteEditorTarget, ToolbarTarget, SelectionState } from './toolbar';\r\n\r\n/** ViewRegistry state maintained in the redux store */\r\nexport interface ViewRegistryState {\r\n mode: Items.ViewRegistryMode,\r\n loaderState: LoaderState,\r\n isComplete: boolean,\r\n\r\n //! productId?: string,\r\n label?: string,\r\n scopeIds?: string[],\r\n languages?: Model.Language[],\r\n\r\n contents: { [label: string]: Items.ContentLikeItem },\r\n //comments: { [label: string]: Items.CommentItem },\r\n\r\n friendlyLabels: { [label: string]: Items.FriendlyLabelItem },\r\n\r\n linkedContentRoot: Items.LinkedContentGroup,\r\n\r\n toolbarTarget?: Toolbar.ToolbarTarget,\r\n toolbarSelection?: Toolbar.SelectionState,\r\n toolbarAlignedSelection?: Toolbar.SelectionState,\r\n //...\r\n}\r\n\r\n/** union of all actions */\r\ntype KnownAction =\r\n | Items.KnownAction\r\n | Toolbar.KnownAction\r\n | Comments.KnownAction\r\n | Annotations.KnownAction\r\n | Notes.KnownAction\r\n | Markers.KnownAction\r\n | ContentParagraphs.KnownAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n ...Items.actionCreators,\r\n ...Toolbar.actionCreators,\r\n ...Comments.actionCreators,\r\n ...Annotations.actionCreators,\r\n ...Notes.actionCreators,\r\n ...Markers.actionCreators,\r\n ...ContentParagraphs.actionCreators,\r\n ...LinkedContents.actionCreators, // doesn't have own actions / reducers\r\n};\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer: Reducer = (state: ViewRegistryState | undefined, action: KnownAction) => {\r\n\r\n state = state || {\r\n mode: 'None',\r\n loaderState: LoaderStateUtil.getEmpty(),\r\n isComplete: false,\r\n\r\n contents: {},\r\n\r\n friendlyLabels: {},\r\n\r\n linkedContentRoot: Items.getLinkedContentGroup(),\r\n };\r\n\r\n Debug.log(`ViewRegistryState.reducer ${action.type}`, \"store\");\r\n\r\n state = Items.reducer(state, action as Items.KnownAction);\r\n state = Toolbar.reducer(state, action as Toolbar.KnownAction);\r\n state = Comments.reducer(state, action as Comments.KnownAction);\r\n state = Annotations.reducer(state, action as Annotations.KnownAction);\r\n state = Notes.reducer(state, action as Notes.KnownAction);\r\n state = Markers.reducer(state, action as Markers.KnownAction);\r\n state = ContentParagraphs.reducer(state, action as ContentParagraphs.KnownAction);\r\n\r\n return state;\r\n};","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction, ApplicationState } from '../';\r\nimport * as _ from 'lodash';\r\nimport * as Draft from \"draft-js\";\r\n\r\nimport { LoaderState, LoaderStateUtil } from '../../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../../utils/SyncState';\r\nimport * as WebApi from '../../webapi';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport { ViewRegistryState } from './';\r\nimport { DraftJSUtils } from '../../utils/DraftJSUtils';\r\n\r\nexport interface SelectionState {\r\n start: number,\r\n end: number,\r\n}\r\n\r\nexport interface ContentToolbarTarget {\r\n type: 'CONTENT_TOOLBAR_TARGET'\r\n label: string,\r\n parKey: string,\r\n language: Model.Language,\r\n\r\n linkedContentItemId: string | null,\r\n}\r\n\r\nexport interface CommentEditorTarget {\r\n type: 'COMMENT_EDITOR_TARGET'\r\n label: string,\r\n draftLanguage: Model.Language,\r\n\r\n linkedContentItemId: string | null,\r\n}\r\n\r\nexport interface AnnotationEditorTarget {\r\n type: 'ANNOTATION_EDITOR_TARGET'\r\n label: string,\r\n id: string,\r\n draftLanguage: Model.Language,\r\n anchorLanguage: Model.Language,\r\n}\r\n\r\nexport interface NoteEditorTarget {\r\n type: 'NOTE_EDITOR_TARGET'\r\n productId: string,\r\n label: string,\r\n id: string,\r\n draftLanguage: Model.Language,\r\n}\r\n\r\nexport type ToolbarTarget =\r\n | CommentEditorTarget\r\n | ContentToolbarTarget\r\n | AnnotationEditorTarget\r\n | NoteEditorTarget;\r\n\r\n/** actions */\r\ninterface SetToolbarAction extends AnyAction {\r\n type: 'VIEWREGISTRY_SET_TOOLBAR',\r\n toolbarTarget: ToolbarTarget\r\n}\r\n\r\ninterface UpdateSelectionToolbarAction extends AnyAction {\r\n type: 'VIEWREGISTRY_UPDATE_SELECTION_TOOLBAR',\r\n toolbarTarget: ToolbarTarget,\r\n toolbarSelection?: SelectionState,\r\n toolbarAlignedSelection?: SelectionState, \r\n}\r\n\r\ninterface ResetToolbarAction extends AnyAction {\r\n type: 'VIEWREGISTRY_RESET_TOOLBAR',\r\n toolbarTarget?: ToolbarTarget\r\n}\r\n\r\n/** union of all actions */\r\nexport type KnownAction =\r\n | SetToolbarAction\r\n | UpdateSelectionToolbarAction\r\n | ResetToolbarAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n\r\n setToolbar: (toolbarTarget: ToolbarTarget) => {\r\n type: \"VIEWREGISTRY_SET_TOOLBAR\", toolbarTarget\r\n },\r\n\r\n updateToolbar: (toolbarTarget: ToolbarTarget, s: SelectionState | undefined, sa: SelectionState | undefined) => {\r\n type: \"VIEWREGISTRY_UPDATE_SELECTION_TOOLBAR\", toolbarTarget,\r\n toolbarSelection: s, toolbarAlignedSelection: sa\r\n },\r\n\r\n resetToolbar: (toolbarTarget?: ToolbarTarget) => {\r\n type: \"VIEWREGISTRY_RESET_TOOLBAR\", toolbarTarget\r\n },\r\n}\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer = (state: ViewRegistryState, action: KnownAction): ViewRegistryState => {\r\n\r\n switch (action.type) {\r\n\r\n case 'VIEWREGISTRY_SET_TOOLBAR': {\r\n return {\r\n ...state,\r\n toolbarTarget: action.toolbarTarget,\r\n toolbarSelection: undefined,\r\n toolbarAlignedSelection: undefined,\r\n };\r\n }\r\n\r\n case 'VIEWREGISTRY_UPDATE_SELECTION_TOOLBAR': {\r\n if (state.toolbarTarget && _.isEqual(state.toolbarTarget, action.toolbarTarget))\r\n return {\r\n ...state,\r\n toolbarTarget: action.toolbarTarget,\r\n toolbarSelection: action.toolbarSelection,\r\n toolbarAlignedSelection: action.toolbarAlignedSelection,\r\n };\r\n return state;\r\n }\r\n\r\n case 'VIEWREGISTRY_RESET_TOOLBAR': {\r\n if (state.toolbarTarget && (!action.toolbarTarget || _.isEqual(state.toolbarTarget, action.toolbarTarget)))\r\n return {\r\n ...state,\r\n toolbarTarget: undefined,\r\n toolbarSelection: undefined,\r\n toolbarAlignedSelection: undefined,\r\n };\r\n return state;\r\n }\r\n\r\n default: const exhaustiveCheck: never = action;\r\n }\r\n\r\n return state;\r\n};","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { LoaderState, LoaderStateUtil } from '../utils/LoaderState';\r\nimport { AppThunkAction } from './';\r\nimport { SearchResult } from '../viewmodels/EPCDataModel';\r\nimport * as Model from '../viewmodels/EPCDataModel';\r\nimport * as WebApi from '../webapi';\r\n\r\n/** Search state maintained in the redux store */\r\nexport interface SearchState {\r\n loaderState: LoaderState,\r\n query: Model.SearchQueryDto,\r\n result?: Model.SearchQueryResultDto,\r\n resultQuery?: string\r\n}\r\n\r\n/** actions */\r\ninterface UpdateQueryAction extends AnyAction { type: 'SEARCH_UPDATE_QUERY', query: Model.SearchQueryDto }\r\ninterface RequestResultsAction extends AnyAction { type: 'SEARCH_REQUEST_RESULTS', query: Model.SearchQueryDto }\r\ninterface ReceiveResultsAction extends AnyAction { type: 'SEARCH_RECEIVE_RESULTS', query: Model.SearchQueryDto, result: Model.SearchQueryResultDto }\r\ninterface ReceiveResultsFailedAction extends AnyAction { type: 'SEARCH_RECEIVE_RESULTS_FAILED', error: string }\r\n//...\r\n\r\n/** union of all actions */\r\ntype KnownAction = UpdateQueryAction | RequestResultsAction | ReceiveResultsAction | ReceiveResultsFailedAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n requestResults: (dto: Model.SearchQueryDto): AppThunkAction => (dispatch, getState) => {\r\n\r\n let fetchTask = WebApi.lookupSearch(dto)\r\n .then(data => {\r\n dispatch({ type: 'SEARCH_RECEIVE_RESULTS', query: dto, result: data });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'SEARCH_RECEIVE_RESULTS_FAILED', error: error });\r\n });\r\n\r\n dispatch({ type: 'SEARCH_REQUEST_RESULTS', query: dto });\r\n },\r\n\r\n updateQuery: (dto: Model.SearchQueryDto): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'SEARCH_UPDATE_QUERY', query: dto });\r\n },\r\n //...\r\n};\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer: Reducer = (state: SearchState | undefined, action: KnownAction) => {\r\n // ensure existing/default state\r\n state = state || {\r\n loaderState: LoaderStateUtil.getEmpty(), // initial state is empty\r\n query: { query: \"\", language: Model.Language.Any, skip: 0, top: 20 },\r\n result: undefined,\r\n };\r\n\r\n switch (action.type) {\r\n case 'SEARCH_UPDATE_QUERY':\r\n return { ...state, ...action };\r\n case 'SEARCH_REQUEST_RESULTS':\r\n return { ...state, loaderState: LoaderStateUtil.getLoading(), ...action };\r\n case 'SEARCH_RECEIVE_RESULTS':\r\n return { ...state, loaderState: LoaderStateUtil.getLoaded(), resultQuery: action.query.query, ...action };\r\n case 'SEARCH_RECEIVE_RESULTS_FAILED':\r\n return { ...state, loaderState: LoaderStateUtil.getError(action.error) };\r\n default:\r\n // the following line guarantees that every action in the KnownAction union has been covered by a case above\r\n const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { LoaderState, LoaderStateUtil } from '../utils/LoaderState';\r\nimport { AppThunkAction } from './';\r\nimport * as _ from 'lodash';\r\nimport * as Model from '../viewmodels/EPCDataModel';\r\nimport * as WebApi from '../webapi';\r\n\r\n/** TableOfContents state maintained in the redux store */\r\nexport interface TableOfContentsState extends Model.TableOfContentVM {\r\n productId?: string,\r\n scopeIds?: string[],\r\n languages?: Model.Language[],\r\n\r\n loaderState: LoaderState,\r\n}\r\n\r\n/** actions */\r\ninterface RequestTocAction extends AnyAction {\r\n type: 'TABLEOFCONTENTS_REQUEST_TOC',\r\n productId: string,\r\n languages: Model.Language[]\r\n}\r\ninterface ReceiveTocAction extends AnyAction { type: 'TABLEOFCONTENTS_RECEIVE_TOC', toc: Model.TableOfContentVM }\r\ninterface ReceiveTocFailedAction extends AnyAction { type: 'TABLEOFCONTENTS_RECEIVE_TOC_FAILED', error: string }\r\n//...\r\n\r\n/** union of all actions */\r\ntype KnownAction = RequestTocAction | ReceiveTocAction | ReceiveTocFailedAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n requestToc: (productId: string, force?: boolean): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().tableOfContents;\r\n const profileState = getState().userProfile;\r\n\r\n const languages = profileState.viewOptions.languages;\r\n\r\n if (!force) {\r\n if ((state.loaderState.isLoaded || state.loaderState.isLoading || state.loaderState.hasError) &&\r\n state.productId == productId &&\r\n _.isEqual(state.languages, languages))\r\n return;\r\n }\r\n\r\n //if (!force) {\r\n // // TODO check languages\r\n // if (state.loaderState.hasError)\r\n // return;\r\n // if (state.loaderState.isLoaded && state.productId == productId)\r\n // return;\r\n // if (state.loaderState.isLoading && state.loadingProductId == productId)\r\n // return;\r\n //}\r\n\r\n const dto: Model.TableOfContentsGetDto = {\r\n productId, languages\r\n };\r\n\r\n let fetchTask = WebApi.getTableOfContents(dto)\r\n .then(data => {\r\n dispatch({ type: 'TABLEOFCONTENTS_RECEIVE_TOC', toc: data.model });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'TABLEOFCONTENTS_RECEIVE_TOC_FAILED', error: error });\r\n });\r\n\r\n dispatch({ type: 'TABLEOFCONTENTS_REQUEST_TOC', productId, languages });\r\n },\r\n //...\r\n};\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer: Reducer = (state: TableOfContentsState | undefined, action: KnownAction) => {\r\n state = state || {\r\n loaderState: LoaderStateUtil.getEmpty()\r\n };\r\n\r\n switch (action.type) {\r\n case 'TABLEOFCONTENTS_REQUEST_TOC':\r\n return { ...state, loaderState: LoaderStateUtil.getLoading(), productId: action.productId, languages: action.languages };\r\n case 'TABLEOFCONTENTS_RECEIVE_TOC':\r\n return { ...state, loaderState: LoaderStateUtil.getLoaded(), ...action.toc };\r\n case 'TABLEOFCONTENTS_RECEIVE_TOC_FAILED':\r\n return { ...state, loaderState: LoaderStateUtil.getError(action.error) };\r\n default:\r\n const exhaustiveCheck: never = action;\r\n }\r\n\r\n return state;\r\n};","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { LoaderState, LoaderStateUtil } from '../utils/LoaderState';\r\nimport { AppThunkAction } from './';\r\nimport * as _ from 'lodash';\r\nimport * as WebApi from '../webapi';\r\nimport * as Debug from '../debug';\r\n\r\nimport * as Model from '../viewmodels/EPCDataModel';\r\nimport { UILanguage } from '../ressources';\r\nimport { Language, PreferencesVM } from '../viewmodels/EPCDataModel';\r\n\r\n/** view settings maintained in the redux store */\r\n\r\nexport interface ViewOptions {\r\n readOnly: boolean,\r\n updateMode: boolean,\r\n displayHidden: boolean,\r\n includeExpiredContentInSearch: boolean,\r\n\r\n displayScopeIds: string[],\r\n readerScopeIds: string[],\r\n writerScopeIds: string[],\r\n editScopeId: string | null,\r\n scopes: Model.ScopeVM[],\r\n\r\n uiLanguage: UILanguage,\r\n contentLanguage: Language,\r\n editLanguage: Model.Language,\r\n languages: Language[],\r\n productId: string,\r\n}\r\n\r\nexport interface UserProfileState {\r\n\r\n loaderState: LoaderState,\r\n\r\n viewOptions: ViewOptions,\r\n\r\n roles: Model.UserRoleVM[],\r\n isVirtualized: boolean,\r\n canEnterUpdateMode: boolean,\r\n\r\n customer: Model.CustomerVM | null,\r\n licenses: Model.LicenseSubscriptionVM[],\r\n\r\n /* FirstUse */\r\n firstUse?: boolean,\r\n /* DisplayName */\r\n displayName?: string,\r\n /* EmailAddresses */\r\n emailAdresses?: string[],\r\n /* Preferences */\r\n preferences?: Model.PreferencesVM,\r\n}\r\n\r\n/** action for loading / patching the user profile / settings */\r\ninterface UpdateViewOptions extends Model.UserProfilePatchSettingsDto {\r\n uiLanguage?: UILanguage, // override uiLanguage?:string\r\n updateMode?: boolean,\r\n displayHidden?: boolean // not saved in user profile, only for local session\r\n}\r\n\r\ntype UpdatePreferences = Model.UserProfilePatchPreferencesDto;\r\n\r\ninterface UpdateViewOptionsAction extends AnyAction { type: 'UserProfile:Update:ViewOptions', payload: UpdateViewOptions }\r\n\r\ninterface RefreshPreferencesAction extends AnyAction { type: 'UserProfile:Refresh:Preferences', payload: PreferencesVM }\r\ninterface UpdatePreferencesAction extends AnyAction { type: 'UserProfile:Update:Preferences' }\r\n\r\ninterface RequestUserProfileAction extends AnyAction { type: 'UserProfile:Request' }\r\ninterface ReceiveUserProfileAction extends AnyAction { type: 'UserProfile:Receive', profile: Model.UserProfileVM }\r\ninterface ReceiveUserProfileFailedAction extends AnyAction { type: 'UserProfile:Receive:UserProfile:Failed', error: string }\r\n\r\n/** union of all actions */\r\ntype KnownAction =\r\n | UpdateViewOptionsAction\r\n | RefreshPreferencesAction\r\n | UpdatePreferencesAction\r\n | RequestUserProfileAction\r\n | ReceiveUserProfileAction\r\n | ReceiveUserProfileFailedAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\n\r\nconst updateViewOptions = (payload: UpdateViewOptions): AppThunkAction => (dispatch, getState) => {\r\n\r\n dispatch({ type: 'UserProfile:Update:ViewOptions', payload });\r\n\r\n const userProfile = getState().userProfile;\r\n\r\n let dto = { ...payload };\r\n dto.displayHidden = undefined;\r\n WebApi.patchUserProfileSettings(dto)\r\n .then(() => {\r\n if (payload.updateMode !== undefined) {\r\n WebApi.getCurrentUserProfile({})\r\n .then(data => {\r\n dispatch({ type: 'UserProfile:Receive', profile: data.model });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'UserProfile:Receive:UserProfile:Failed', error: error });\r\n });\r\n dispatch({ type: 'UserProfile:Request' });\r\n }\r\n // if UI language changed, load preferences in new language\r\n else if (payload.uiLanguage) {\r\n WebApi.getUserProfilePreferences({ uiLanguage: payload.uiLanguage!, scopeIds: userProfile.viewOptions.displayScopeIds })\r\n .then(result => {\r\n dispatch({ type: 'UserProfile:Refresh:Preferences', payload: result.model });\r\n });\r\n }\r\n });\r\n}\r\n\r\nconst refreshPreferences = (): AppThunkAction => (dispatch, getState) => {\r\n const userProfile = getState().userProfile;\r\n const viewOptions = userProfile.viewOptions;\r\n WebApi.getUserProfilePreferences({ uiLanguage: viewOptions.uiLanguage, scopeIds: viewOptions.displayScopeIds })\r\n .then(result => {\r\n dispatch({ type: 'UserProfile:Refresh:Preferences', payload: result.model });\r\n });\r\n}\r\n\r\nexport const actionCreators = {\r\n\r\n // setter should cause sync with server\r\n setUILanguage: (uiLanguage: UILanguage): AppThunkAction => (dispatch, getState) => {\r\n updateViewOptions({ uiLanguage: uiLanguage })(dispatch, getState);\r\n },\r\n setContentLanguage: (contentLanguage: Model.Language): AppThunkAction => (dispatch, getState) => {\r\n updateViewOptions({ contentLanguage: contentLanguage })(dispatch, getState);\r\n },\r\n setProduct: (productId: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const { roles, viewOptions } = getState().userProfile;\r\n const languages = getReadableProductLanguages(roles, productId);\r\n\r\n if (!_.includes(languages, viewOptions.contentLanguage)) {\r\n updateViewOptions({ productId: productId, contentLanguage: languages[0] })(dispatch, getState);\r\n }\r\n else {\r\n updateViewOptions({ productId: productId })(dispatch, getState);\r\n }\r\n },\r\n setEditScope: (editScopeId: string): AppThunkAction => (dispatch, getState) => {\r\n updateViewOptions({ editScopeId: editScopeId })(dispatch, getState);\r\n },\r\n setEditMode: (readOnly: boolean): AppThunkAction => (dispatch, getState) => {\r\n updateViewOptions({ readOnly: readOnly })(dispatch, getState);\r\n },\r\n setUpdateMode: (updateMode: boolean): AppThunkAction => (dispatch, getState) => {\r\n updateViewOptions({ updateMode: updateMode })(dispatch, getState);\r\n },\r\n setDisplayHidden: (displayHidden: boolean): AppThunkAction => (dispatch, getState) => {\r\n updateViewOptions({ displayHidden: displayHidden })(dispatch, getState);\r\n },\r\n\r\n refreshPreferences: refreshPreferences,\r\n\r\n updatePreferences: (dto: UpdatePreferences, onError?: (reason: string) => void): AppThunkAction => (dispatch, getState) => {\r\n WebApi.patchUserProfilePreferences(dto)\r\n .then(result => {\r\n refreshPreferences()(dispatch, getState);\r\n })\r\n .catch(reason => onError && onError(reason));\r\n dispatch({ type: 'UserProfile:Update:Preferences' });\r\n },\r\n\r\n requestUserProfile: (): AppThunkAction => (dispatch, getState) => {\r\n\r\n let fetchTask = WebApi.getCurrentUserProfile({})\r\n .then(data => {\r\n dispatch({ type: 'UserProfile:Receive', profile: data.model });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'UserProfile:Receive:UserProfile:Failed', error: error });\r\n });\r\n\r\n dispatch({ type: 'UserProfile:Request' });\r\n },\r\n};\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer: Reducer = (state: UserProfileState | undefined, action: KnownAction) => {\r\n // ensure existing/default state\r\n state = state || {\r\n loaderState: LoaderStateUtil.getEmpty(),\r\n\r\n roles: [],\r\n isVirtualized: false,\r\n canEnterUpdateMode: false,\r\n\r\n customer: null,\r\n licenses: [],\r\n\r\n viewOptions: {\r\n readOnly: false,\r\n displayHidden: false,\r\n updateMode: false,\r\n includeExpiredContentInSearch: false,\r\n\r\n displayScopeIds: [],\r\n readerScopeIds: [],\r\n writerScopeIds: [],\r\n editScopeId: null,\r\n scopes: [],\r\n\r\n uiLanguage: \"EN\", // TODO use browser locale\r\n contentLanguage: Model.Language.EN,\r\n editLanguage: Model.Language.Any,\r\n languages: [],\r\n //TODO\r\n productId: \"epc\",\r\n },\r\n };\r\n\r\n Debug.log(`UserProfileState.reducer ${action.type}`, \"store\");\r\n\r\n switch (action.type) {\r\n case 'UserProfile:Update:ViewOptions': {\r\n let viewOptions = { ...state.viewOptions, ...action.payload }\r\n return {\r\n ...state,\r\n viewOptions: {\r\n ...viewOptions,\r\n languages: getLanguages(viewOptions.contentLanguage, state.preferences),\r\n editLanguage: getEditLanguage(viewOptions.editScopeId, viewOptions.scopes, viewOptions.contentLanguage),\r\n }\r\n };\r\n }\r\n\r\n case 'UserProfile:Refresh:Preferences': {\r\n return {\r\n ...state,\r\n preferences: action.payload\r\n };\r\n }\r\n\r\n case 'UserProfile:Update:Preferences':\r\n return { ...state };\r\n\r\n case 'UserProfile:Request':\r\n return { ...state, loaderState: LoaderStateUtil.getLoading() };\r\n\r\n case 'UserProfile:Receive': {\r\n const scopes = action.profile.scopes!;\r\n const readableLanguages = getReadableProductLanguages(action.profile.roles);\r\n\r\n let uiLanguage = getUILanguage(action.profile.uiLanguage);\r\n\r\n let contentLanguage = action.profile.contentLanguage;\r\n if (contentLanguage === undefined)\r\n contentLanguage = action.profile.preferences!.languages![0];\r\n if (!_.includes(readableLanguages, contentLanguage) && !_.includes(readableLanguages, Model.Language.Any))\r\n contentLanguage = _.first(readableLanguages);\r\n if (contentLanguage === undefined || contentLanguage === Model.Language.Any)\r\n contentLanguage = uiLanguage === \"DE\" ? Language.DE : Language.EN;\r\n\r\n const writableScopeIds = getWriteableScopeIds(action.profile.roles);\r\n const editScopeId = (_.includes(writableScopeIds, action.profile.editScopeId) ?\r\n action.profile.editScopeId :\r\n writableScopeIds[0]) || null;\r\n\r\n const productIds = getReadableProducts(action.profile.roles);\r\n const productId = (action.profile.productId && _.includes(productIds, action.profile.productId)) ?\r\n action.profile.productId :\r\n productIds[0] || \"epc\";\r\n\r\n let newState: UserProfileState = {\r\n ...state,\r\n\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n\r\n roles: action.profile.roles!,\r\n isVirtualized: action.profile.isVirtualized || false,\r\n canEnterUpdateMode: action.profile.canEnterUpdateMode || false,\r\n\r\n customer: action.profile.customer || null,\r\n licenses: action.profile.licenses || [],\r\n\r\n firstUse: action.profile.firstUse,\r\n displayName: action.profile.displayName!,\r\n emailAdresses: action.profile.emailAdresses!,\r\n preferences: action.profile.preferences!,\r\n\r\n viewOptions: {\r\n readOnly: action.profile.readOnly !== undefined ? action.profile.readOnly : true,\r\n displayHidden: false,\r\n updateMode: action.profile.updateMode || false,\r\n includeExpiredContentInSearch: false,\r\n\r\n displayScopeIds: getReadableScopeIds(action.profile.roles),\r\n readerScopeIds: getReadableScopeIds(action.profile.roles),\r\n writerScopeIds: getWriteableScopeIds(action.profile.roles),\r\n editScopeId: editScopeId,\r\n scopes: action.profile.scopes!,\r\n\r\n uiLanguage: uiLanguage,\r\n contentLanguage: contentLanguage,\r\n editLanguage: getEditLanguage(editScopeId, scopes, contentLanguage),\r\n languages: getLanguages(contentLanguage, action.profile.preferences),\r\n\r\n productId: productId\r\n }\r\n };\r\n return newState;\r\n }\r\n case 'UserProfile:Receive:UserProfile:Failed':\r\n return { ...state, loaderState: LoaderStateUtil.getError(action.error) };\r\n\r\n default:\r\n // the following line guarantees that every action in the KnownAction union has been covered by a case above\r\n const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};\r\n\r\nexport function getUILanguage(uilang: string | undefined): UILanguage {\r\n switch (uilang) {\r\n case \"EN\":\r\n case \"DE\": return uilang;\r\n default: return \"EN\";\r\n }\r\n}\r\n\r\nexport function getLanguages(contentLanguage?: Model.Language, preferences?: Model.PreferencesVM) {\r\n let langs = preferences ? [...preferences.languages!] : [];\r\n if (contentLanguage !== undefined)\r\n langs.unshift(contentLanguage);\r\n return langs;\r\n}\r\n\r\nexport function getEditLanguage(scopeId: string | null, scopes: Model.ScopeVM[], contentLanguage: Model.Language) {\r\n // TODO what if a user can read a language which he cannot write?\r\n\r\n if (scopeId == null) {\r\n console.error(`Edit scope id is null.`);\r\n return Model.Language.Any;\r\n }\r\n const scope = _.find(scopes, s => s.id == scopeId);\r\n if (!scope) {\r\n console.error(`No such scope: ${scopeId}`);\r\n return Model.Language.Any;\r\n }\r\n // IMPORTANT: only the author scope is multi-lingual, all other scopes have the invariant language 'Any'\r\n return scope.typeOfScope == Model.TypeOfScope.Author ? contentLanguage : Model.Language.Any;\r\n}\r\n\r\nexport function getReadableProducts(roles?: Model.UserRoleVM[]) {\r\n return (roles && roles.filter(x =>\r\n x.typeOfUserRole == Model.TypeOfUserRole.Product &&\r\n x.productRole != Model.UserProductRole.Undefined\r\n ).map(x => x.productId)) || [];\r\n}\r\n\r\nexport function getReadableProductLanguages(roles?: Model.UserRoleVM[], productId?: string) {\r\n return (roles && roles.filter(x =>\r\n x.typeOfUserRole == Model.TypeOfUserRole.Product &&\r\n (!productId || x.productId === productId) &&\r\n x.productRole != Model.UserProductRole.Undefined\r\n ).map(x => x.productLanguage!)) || [];\r\n}\r\n\r\nexport function getReadableScopeIds(roles?: Model.UserRoleVM[]) {\r\n return (roles && roles.filter(x =>\r\n x.typeOfUserRole == Model.TypeOfUserRole.Scope &&\r\n x.scopeRole != Model.UserScopeRole.Undefined\r\n ).map(x => x.scopeId!)) || [];\r\n}\r\n\r\nexport function getWriteableScopeIds(roles?: Model.UserRoleVM[]) {\r\n return (roles && roles.filter(x =>\r\n x.typeOfUserRole == Model.TypeOfUserRole.Scope && (\r\n x.scopeRole == Model.UserScopeRole.Contributor ||\r\n x.scopeRole == Model.UserScopeRole.Owner\r\n )).map(x => x.scopeId!)) || [];\r\n}\r\n","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { LoaderState, LoaderStateUtil } from '../utils/LoaderState';\r\nimport { AppThunkAction } from './';\r\nimport * as _ from 'lodash';\r\nimport * as Model from '../viewmodels/EPCDataModel';\r\nimport * as WebApi from '../webapi';\r\n\r\n/** Notes state maintained in the redux store */\r\nexport interface NotesState {\r\n productId?: string,\r\n scopeIds?: string[],\r\n languages?: Model.Language[],\r\n\r\n todos?: Model.TodoVM[],\r\n currentIndex: number | null,\r\n\r\n toolbarVisible: boolean,\r\n\r\n loaderState: LoaderState,\r\n}\r\n\r\n/** actions */\r\ninterface RequestNotesAction extends AnyAction {\r\n type: 'NOTES_REQUEST_TODOS',\r\n productId: string,\r\n scopeIds: string[],\r\n languages: Model.Language[]\r\n}\r\n\r\ninterface ReceiveNotesAction extends AnyAction {\r\n type: 'NOTES_RECEIVE_TODOS',\r\n todos: Model.TodoVM[]\r\n}\r\n\r\ninterface ReceiveNotesFailedAction extends AnyAction {\r\n type: 'NOTES_RECEIVE_TODOS_FAILED',\r\n error: string\r\n}\r\n\r\ninterface CloseNotesAction extends AnyAction {\r\n type: 'NOTES_CLOSE_TODOS'\r\n}\r\n\r\ninterface SetNotesIndexAction extends AnyAction {\r\n type: 'NOTES_SET_TODOS_INDEX',\r\n index: number | null\r\n}\r\n\r\ninterface ReceiveChangeNoteTypeAction extends AnyAction {\r\n type: 'NOTES_RECEIVE_TODOS_CHANGE_TYPE',\r\n productId: string,\r\n label: string,\r\n scopeId: string,\r\n id: string,\r\n typeOfStickyNote: Model.TypeOfStickyNote,\r\n visibilityOfStickyNote: Model.VisibilityOfStickyNote\r\n}\r\n\r\ninterface ReceiveDeleteNoteAction extends AnyAction {\r\n type: 'NOTES_RECEIVE_TODOS_DELETE',\r\n label: string,\r\n scopeId: string,\r\n id: string,\r\n}\r\n\r\n/** union of all actions */\r\ntype KnownAction = RequestNotesAction | ReceiveNotesAction | ReceiveNotesFailedAction\r\n | CloseNotesAction | SetNotesIndexAction | ReceiveChangeNoteTypeAction | ReceiveDeleteNoteAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n listNotes: (productId: string, scopeIds: string[], force?: boolean): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().notes;\r\n const profileState = getState().userProfile;\r\n const languages = profileState.viewOptions.languages;\r\n const displayHidden = profileState.viewOptions.displayHidden;\r\n\r\n if (!force) {\r\n if ((state.loaderState.isLoaded || state.loaderState.isLoading) &&\r\n state.productId == productId &&\r\n _.isEqual(state.scopeIds, scopeIds) &&\r\n _.isEqual(state.languages, languages))\r\n return;\r\n if (state.loaderState.hasError)\r\n return;\r\n }\r\n\r\n const dto: Model.NoteListDto = {\r\n productId,\r\n scopeIds,\r\n languages,\r\n displayHidden\r\n };\r\n\r\n let fetchTask = WebApi.listNotes(dto)\r\n .then(result => {\r\n dispatch({ type: 'NOTES_RECEIVE_TODOS', todos: result.models });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'NOTES_RECEIVE_TODOS_FAILED', error: error });\r\n });\r\n\r\n dispatch({ type: 'NOTES_REQUEST_TODOS', productId, scopeIds, languages });\r\n },\r\n closeNotes: (): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'NOTES_CLOSE_TODOS' });\r\n },\r\n setNotesIndex: (index: number, callback?: (index: number | null) => void): AppThunkAction => (dispatch, getState) => {\r\n const { notes } = getState();\r\n\r\n if (notes.todos == undefined || notes.todos.length == 0) {\r\n dispatch({ type: 'NOTES_SET_TODOS_INDEX', index: null });\r\n callback && callback(null);\r\n }\r\n else {\r\n index = (index + notes.todos.length) % notes.todos.length; // handle -1 correctly\r\n dispatch({ type: 'NOTES_SET_TODOS_INDEX', index });\r\n callback && callback(index);\r\n }\r\n },\r\n makeNotePublicUpdate: (label: string, scopeId: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const dto: Model.NotePatchDto = {\r\n label,\r\n scopeId,\r\n id,\r\n typeOfStickyNote: Model.TypeOfStickyNote.UpdateNote,\r\n visibilityOfStickyNote: Model.VisibilityOfStickyNote.Public\r\n };\r\n\r\n let fetchTask = WebApi.patchNote({ ...dto, etag: \"*\" })\r\n .then(result => {\r\n dispatch({ type: 'NOTES_RECEIVE_TODOS_CHANGE_TYPE', ...(dto as any) });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n });\r\n },\r\n makeNotePrivate: (label: string, scopeId: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const dto: Model.NotePatchDto = {\r\n label,\r\n scopeId,\r\n id,\r\n typeOfStickyNote: Model.TypeOfStickyNote.Custom,\r\n visibilityOfStickyNote: Model.VisibilityOfStickyNote.PrivateToScope\r\n };\r\n\r\n let fetchTask = WebApi.patchNote({ ...dto, etag: \"*\" })\r\n .then(result => {\r\n dispatch({ type: 'NOTES_RECEIVE_TODOS_CHANGE_TYPE', ...(dto as any) });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n });\r\n },\r\n\r\n deleteNote: (label: string, scopeId: string, id: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const dto: Model.NoteDeleteDto = {\r\n label,\r\n scopeId,\r\n id\r\n };\r\n\r\n let fetchTask = WebApi.deleteNote({ ...dto })\r\n .then(result => {\r\n dispatch({ type: 'NOTES_RECEIVE_TODOS_DELETE', ...(dto as any) });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n });\r\n },\r\n //...\r\n};\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer: Reducer = (state: NotesState | undefined, action: KnownAction) => {\r\n // ensure existing/default state\r\n state = state || {\r\n loaderState: LoaderStateUtil.getEmpty(),\r\n toolbarVisible: false,\r\n currentIndex: null\r\n };\r\n\r\n switch (action.type) {\r\n case 'NOTES_REQUEST_TODOS':\r\n return {\r\n ...state,\r\n loaderState: LoaderStateUtil.getLoading(),\r\n productId: action.productId,\r\n scopeIds: action.scopeIds,\r\n languages: action.languages\r\n };\r\n case 'NOTES_RECEIVE_TODOS':\r\n return {\r\n ...state,\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n todos: action.todos,\r\n toolbarVisible: true,\r\n currentIndex: null\r\n };\r\n case 'NOTES_RECEIVE_TODOS_FAILED':\r\n return {\r\n ...state,\r\n loaderState: LoaderStateUtil.getError(action.error),\r\n };\r\n case 'NOTES_CLOSE_TODOS':\r\n return {\r\n ...state,\r\n toolbarVisible: false\r\n };\r\n case 'NOTES_SET_TODOS_INDEX':\r\n return {\r\n ...state,\r\n currentIndex: action.index\r\n };\r\n case 'NOTES_RECEIVE_TODOS_CHANGE_TYPE': {\r\n const todos = state.todos!.map(todo => {\r\n if (todo.id == action.id) {\r\n return { ...todo, type: action.typeOfStickyNote }\r\n }\r\n else {\r\n return todo;\r\n }\r\n });\r\n\r\n return {\r\n ...state,\r\n todos,\r\n currentIndex: action.index\r\n };\r\n }\r\n case 'NOTES_RECEIVE_TODOS_DELETE': {\r\n const todos = state.todos!.filter(todo => todo.id != action.id);\r\n return {\r\n ...state,\r\n todos,\r\n currentIndex: action.index\r\n };\r\n }\r\n\r\n default:\r\n // the following line guarantees that every action in the KnownAction union has been covered by a case above\r\n const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { LoaderState, LoaderStateUtil } from '../utils/LoaderState';\r\nimport { AppThunkAction } from './';\r\nimport * as _ from 'lodash';\r\nimport * as Model from '../viewmodels/EPCDataModel';\r\nimport { lookupForContent } from '../webapi';\r\n\r\n/** ContentLookup state maintained in the redux store */\r\nexport interface ContentLookupState {\r\n productId?: string,\r\n scopeIds?: string[],\r\n languages?: Model.Language[],\r\n\r\n loaderState: LoaderState,\r\n groups?: Model.LookupGroupDto[],\r\n}\r\n\r\n/** actions */\r\ninterface RequestGroupsAction extends AnyAction { type: 'CONTENTLOOKUP_REQUEST_GROUPS', productId: string, scopeIds: string[], languages: Model.Language[] }\r\ninterface ReceiveGroupsAction extends AnyAction { type: 'CONTENTLOOKUP_RECEIVE_GROUPS', productId: string, scopeIds: string[], languages: Model.Language[], groups: Model.LookupGroupDto[] }\r\ninterface ReceiveGoupsFailedAction extends AnyAction { type: 'CONTENTLOOKUP_RECEIVE_GROUPS_FAILED', error: string }\r\n//...\r\n\r\n/** union of all actions */\r\ntype KnownAction = RequestGroupsAction | ReceiveGroupsAction | ReceiveGoupsFailedAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n requestGroups: (productId: string, scopeIds: string[], languages: Model.Language[], force?: boolean): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().contentLookup;\r\n const profileState = getState().userProfile;\r\n const languages = profileState.viewOptions.languages;\r\n\r\n if (!force) {\r\n if ((state.loaderState.isLoaded || state.loaderState.isLoading) &&\r\n state.productId == productId &&\r\n _.isEqual(state.scopeIds, scopeIds) &&\r\n _.isEqual(state.languages, languages))\r\n return;\r\n if (state.loaderState.hasError)\r\n return;\r\n }\r\n\r\n let fetchTask = lookupForContent({ productId, scopeIds, languages })\r\n .then(result => {\r\n dispatch({ type: 'CONTENTLOOKUP_RECEIVE_GROUPS', groups: result.models, productId, scopeIds, languages });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'CONTENTLOOKUP_RECEIVE_GROUPS_FAILED', error: error });\r\n });\r\n\r\n dispatch({ type: 'CONTENTLOOKUP_REQUEST_GROUPS', productId, scopeIds, languages });\r\n },\r\n //...\r\n};\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer: Reducer = (state: ContentLookupState | undefined, action: KnownAction) => {\r\n // ensure existing/default state\r\n state = state || {\r\n loaderState: LoaderStateUtil.getEmpty(),\r\n };\r\n\r\n switch (action.type) {\r\n case 'CONTENTLOOKUP_REQUEST_GROUPS':\r\n return {\r\n ...state,\r\n loaderState: LoaderStateUtil.getLoading(),\r\n productId: action.productId,\r\n scopeIds: action.scopeIds,\r\n languages: action.languages, \r\n };\r\n case 'CONTENTLOOKUP_RECEIVE_GROUPS':\r\n return {\r\n ...state,\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n groups: action.groups,\r\n productId: action.productId,\r\n scopeIds: action.scopeIds,\r\n languages: action.languages, \r\n };\r\n case 'CONTENTLOOKUP_RECEIVE_GROUPS_FAILED':\r\n return {\r\n ...state,\r\n loaderState: LoaderStateUtil.getError(action.error)\r\n };\r\n default:\r\n // the following line guarantees that every action in the KnownAction union has been covered by a case above\r\n const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { LoaderState, LoaderStateUtil } from '../utils/LoaderState';\r\nimport { AppThunkAction } from './';\r\nimport * as _ from 'lodash';\r\nimport * as Model from '../viewmodels/EPCDataModel';\r\nimport * as WebApi from '../webapi';\r\n\r\n/** PdfJobs state maintained in the redux store */\r\nexport interface PdfJobState extends Model.PdfJobVM {\r\n submittedClient?: string,\r\n}\r\n\r\nexport interface PdfJobsState {\r\n productId?: string,\r\n pdfJobs: { [key: string]: PdfJobState },\r\n\r\n loaderState: LoaderState,\r\n}\r\n\r\nexport interface PdfJobOptions {\r\n documentFontSize: number,\r\n pageMode: Model.PdfJobPageMode,\r\n divisioningMode: Model.PdfDivisioningMode,\r\n pdfStickyNotes: boolean,\r\n printOnDemand: boolean,\r\n}\r\n\r\n/** actions */\r\ninterface RequestPdfJobsListAction extends AnyAction {\r\n type: 'PdfJobs:List:Request',\r\n payload: {\r\n productId: string\r\n }\r\n}\r\n\r\ninterface ReceivePdfJobsListAction extends AnyAction {\r\n type: 'PdfJobs:List:Receive',\r\n payload: {\r\n pdfJobs: { [key: string]: PdfJobState },\r\n }\r\n}\r\n\r\ninterface ReceivePdfJobsListFailedAction extends AnyAction {\r\n type: 'PdfJobs:List:Receive:Failed',\r\n error: string\r\n}\r\n\r\n\r\ninterface RequestPdfJobsSubmitAction extends AnyAction {\r\n type: 'PdfJobs:Submit:Request',\r\n payload: {\r\n productId: string,\r\n scopeIds: string[],\r\n language: Model.Language\r\n } & PdfJobOptions\r\n}\r\n\r\ninterface ReceivePdfJobsSubmitAction extends AnyAction {\r\n type: 'PdfJobs:Submit:Receive',\r\n payload: {\r\n pdfJob: PdfJobState\r\n }\r\n}\r\n\r\ninterface ReceivePdfJobsSubmitFailedAction extends AnyAction {\r\n type: 'PdfJobs:Submit:Receive:Failed',\r\n error: string\r\n}\r\n\r\ninterface RequestPdfJobsInquireAction extends AnyAction {\r\n type: 'PdfJobs:Inquire:Request',\r\n payload: {\r\n jobTimestamp: string,\r\n }\r\n}\r\n\r\ninterface ReceivePdfJobsInquireAction extends AnyAction {\r\n type: 'PdfJobs:Inquire:Receive',\r\n payload: {\r\n pdfJob: PdfJobState\r\n }\r\n}\r\n\r\ninterface ReceivePdfJobsInquireFailedAction extends AnyAction {\r\n type: 'PdfJobs:Inquire:Receive:Failed',\r\n error: string\r\n}\r\n\r\n/** union of all actions */\r\ntype KnownAction =\r\n | RequestPdfJobsListAction\r\n | ReceivePdfJobsListAction\r\n | ReceivePdfJobsListFailedAction\r\n | RequestPdfJobsSubmitAction\r\n | ReceivePdfJobsSubmitAction\r\n | ReceivePdfJobsSubmitFailedAction\r\n | RequestPdfJobsInquireAction\r\n | ReceivePdfJobsInquireAction\r\n | ReceivePdfJobsInquireFailedAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nconst timeout = 5 * 1000;\r\n\r\nconst inquirePdfJobs = (jobTimestamp: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const dto: Model.PdfJobInquireDto = {\r\n jobTimestamp: jobTimestamp\r\n };\r\n\r\n let fetchTask = WebApi.inquirePdfJob(dto)\r\n .then(result => {\r\n dispatch({ type: 'PdfJobs:Inquire:Receive', payload: { pdfJob: result.model } });\r\n\r\n if (!result.model.completed) {\r\n setTimeout(() => {\r\n inquirePdfJobs(jobTimestamp)(dispatch, getState);\r\n }, timeout);\r\n }\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'PdfJobs:Inquire:Receive:Failed', error: error });\r\n });\r\n\r\n dispatch({ type: 'PdfJobs:Inquire:Request', payload: { ...dto } });\r\n};\r\n \r\n\r\nexport const actionCreators = {\r\n listPdfJobs: (productId: string, force?: boolean): AppThunkAction => (dispatch, getState) => {\r\n\r\n const state = getState().pdfJobs;\r\n\r\n if (!force) {\r\n if ((state.loaderState.isLoaded || state.loaderState.isLoading) &&\r\n state.productId == productId)\r\n return;\r\n if (state.loaderState.hasError)\r\n return;\r\n }\r\n\r\n const dto: Model.PdfJobListDto = {\r\n productId: productId\r\n };\r\n\r\n let fetchTask = WebApi.listPdfJobs(dto)\r\n .then(result => {\r\n\r\n let pdfJobs: { [key: string]: PdfJobState } = {};\r\n\r\n for (var i = 0; i < result.models.length; i++) {\r\n let model = result.models[i];\r\n pdfJobs[model.jobTimestamp] = model;\r\n if (!model.completed) {\r\n setTimeout(() => {\r\n inquirePdfJobs(model.jobTimestamp)(dispatch, getState);\r\n }, timeout);\r\n }\r\n }\r\n\r\n dispatch({ type: 'PdfJobs:List:Receive', payload: { pdfJobs } });\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'PdfJobs:List:Receive:Failed', error: error });\r\n });\r\n\r\n dispatch({ type: 'PdfJobs:List:Request', payload: { productId } });\r\n },\r\n\r\n submitPdfJobs: (productId: string, scopeIds: string[], language: Model.Language, options: PdfJobOptions): AppThunkAction => (dispatch, getState) => {\r\n\r\n const dto: Model.PdfJobSubmitDto = {\r\n productId: productId,\r\n scopeIds: scopeIds,\r\n language: language,\r\n ...options,\r\n };\r\n\r\n let fetchTask = WebApi.submitPdfJob(dto)\r\n .then(result => {\r\n dispatch({ type: 'PdfJobs:Submit:Receive', payload: { pdfJob: result.model } });\r\n setTimeout(() => {\r\n inquirePdfJobs(result.model.jobTimestamp)(dispatch, getState);\r\n }, timeout);\r\n })\r\n .catch(error => {\r\n console.debug(\"error: \" + error);\r\n dispatch({ type: 'PdfJobs:Submit:Receive:Failed', error: error });\r\n });\r\n\r\n dispatch({ type: 'PdfJobs:Submit:Request', payload: { ...dto } });\r\n },\r\n //...\r\n};\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer: Reducer = (state: PdfJobsState | undefined, action: KnownAction) => {\r\n // ensure existing/default state\r\n state = state || {\r\n pdfJobs: {},\r\n loaderState: LoaderStateUtil.getEmpty()\r\n };\r\n\r\n switch (action.type) {\r\n case 'PdfJobs:List:Request':\r\n return {\r\n ...state,\r\n ...action.payload,\r\n loaderState: LoaderStateUtil.getLoading(),\r\n };\r\n case 'PdfJobs:List:Receive':\r\n return {\r\n ...state,\r\n ...action.payload,\r\n loaderState: LoaderStateUtil.getLoaded(),\r\n };\r\n case 'PdfJobs:List:Receive:Failed':\r\n return {\r\n ...state,\r\n loaderState: LoaderStateUtil.getError(action.error),\r\n };\r\n\r\n // TODO\r\n case 'PdfJobs:Submit:Request':\r\n return {\r\n ...state,\r\n \r\n };\r\n case 'PdfJobs:Submit:Receive':\r\n return {\r\n ...state,\r\n pdfJobs: {\r\n ...state.pdfJobs,\r\n [action.payload.pdfJob.jobTimestamp]: {\r\n ...action.payload.pdfJob,\r\n submittedClient: new Date(Date.now()).toISOString()\r\n }\r\n }\r\n };\r\n case 'PdfJobs:Submit:Receive:Failed':\r\n return {\r\n ...state,\r\n };\r\n\r\n // TODO\r\n case 'PdfJobs:Inquire:Request':\r\n return {\r\n ...state,\r\n };\r\n case 'PdfJobs:Inquire:Receive':\r\n return {\r\n ...state,\r\n pdfJobs: {\r\n ...state.pdfJobs,\r\n [action.payload.pdfJob.jobTimestamp]: action.payload.pdfJob\r\n }\r\n };\r\n case 'PdfJobs:Inquire:Receive:Failed':\r\n return {\r\n ...state,\r\n };\r\n\r\n default:\r\n // the following line guarantees that every action in the KnownAction union has been covered by a case above\r\n const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};","import {\r\n Reducer, AnyAction,\r\n createStore, applyMiddleware, compose, combineReducers,\r\n Store, StoreEnhancerStoreCreator, ReducersMapObject\r\n} from 'redux';\r\nimport thunk from 'redux-thunk';\r\nimport * as Router from 'react-router-redux';\r\nimport { History } from 'history';\r\n\r\nimport * as ViewRegistry from './ViewRegistry';\r\nimport * as Search from './Search';\r\nimport * as TableOfContents from './TableOfContents';\r\nimport * as UserProfile from './UserProfile';\r\nimport * as Notes from './Notes';\r\nimport * as ContentLookup from './ContentLookup';\r\nimport * as Browser from './Browser';\r\nimport * as PdfJobs from './PdfJobs';\r\n\r\n// The top-level state object\r\nexport interface ApplicationState {\r\n viewRegistry: ViewRegistry.ViewRegistryState,\r\n search: Search.SearchState,\r\n tableOfContents: TableOfContents.TableOfContentsState,\r\n userProfile: UserProfile.UserProfileState,\r\n notes: Notes.NotesState,\r\n contentLookup: ContentLookup.ContentLookupState,\r\n browser: Browser.BrowserState,\r\n pdfJobs: PdfJobs.PdfJobsState,\r\n //...\r\n\r\n routing: Router.RouterState\r\n}\r\n\r\n// Whenever an action is dispatched, Redux will update each top-level application state property using\r\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\r\n// acts on the corresponding ApplicationState property type.\r\nexport const reducers = {\r\n viewRegistry: ViewRegistry.reducer as Reducer,\r\n search: Search.reducer as Reducer,\r\n tableOfContents: TableOfContents.reducer as Reducer,\r\n userProfile: UserProfile.reducer as Reducer,\r\n notes: Notes.reducer as Reducer,\r\n contentLookup: ContentLookup.reducer as Reducer,\r\n browser: Browser.reducer as Reducer,\r\n pdfJobs: PdfJobs.reducer as Reducer,\r\n //...\r\n\r\n routing: Router.routerReducer as Reducer\r\n};\r\n\r\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\r\n// correctly typed to match your store.\r\nexport interface AppThunkAction {\r\n (dispatch: (action: TAction) => void, getState: () => ApplicationState): void;\r\n}\r\n\r\nexport function configureStore(history: History, initialState?: ApplicationState) {\r\n const middleware = [\r\n thunk,\r\n Router.routerMiddleware(history)\r\n ];\r\n\r\n // In development, use the browser's Redux dev tools extension if installed\r\n const enhancers = [];\r\n const isDevelopment = process.env.NODE_ENV === 'development';\r\n if (isDevelopment && typeof window !== 'undefined' && (window as any).devToolsExtension) {\r\n enhancers.push((window as any).devToolsExtension());\r\n }\r\n\r\n const rootReducer = combineReducers({\r\n ...reducers,\r\n routing: Router.routerReducer\r\n });\r\n\r\n return createStore(\r\n rootReducer,\r\n initialState,\r\n compose(applyMiddleware(...middleware), ...enhancers)\r\n ) as Store;\r\n}","import { Action, AnyAction, Reducer } from 'redux';\r\nimport { AppThunkAction } from './';\r\nimport * as _ from 'lodash';\r\nimport * as is from 'is_js';\r\n\r\n/** ContentLookup state maintained in the redux store */\r\nexport interface BrowserState {\r\n isMobile: boolean\r\n}\r\n\r\n/** actions */\r\ninterface SetBrowserAction extends AnyAction { type: 'SET_BROWSER_ACTION', payload: BrowserState }\r\n//...\r\n\r\n/** union of all actions */\r\ntype KnownAction = SetBrowserAction;\r\n\r\n/** actions creators will be available to all subscribing components */\r\nexport const actionCreators = {\r\n setBrowser: (payload: BrowserState): AppThunkAction => (dispatch, getState) => {\r\n dispatch({ type: 'SET_BROWSER_ACTION', payload });\r\n },\r\n //...\r\n};\r\n\r\n/**\r\n * Reducer to process an action and return a new state - the current state must no be mutated.\r\n * @param state current state, may be undefined\r\n * @param action action to process\r\n */\r\nexport const reducer: Reducer = (state: BrowserState | undefined, action: KnownAction) => {\r\n // ensure existing/default state\r\n state = state || {\r\n isMobile: is.mobile()\r\n };\r\n\r\n switch (action.type) {\r\n case 'SET_BROWSER_ACTION':\r\n return {\r\n ...state,\r\n ...action.payload\r\n };\r\n default:\r\n // the following line guarantees that every action in the KnownAction union has been covered by a case above\r\n //const exhaustiveCheck: never = action;\r\n }\r\n\r\n // for unrecognized actions (or actions with no effect), return existing/default state\r\n return state;\r\n};","// define localized ressources; EN and DE for now\r\n\r\nexport interface LocalizedRessource { \"EN\": string, \"DE\": string }\r\nexport type UILanguage = keyof LocalizedRessource;\r\n\r\nexport const ressources = {\r\n\r\n // common\r\n epcapp: $(\"EPC.App\", \"EPC.App\"),\r\n pctapp: $(\"PCT.App\", \"PCT.App\"),\r\n\r\n content: $(\"Content\", \"Inhalt\"),\r\n comment: $(\"Comment\", \"Kommentar\"),\r\n annotation: $(\"Annotation\", \"Anmerkung\"),\r\n\r\n common_open_link: $(\"open...\", \"öffnen...\"),\r\n common_error: $(\"An error occurred...\", \"Es ist ein Fehler aufgetreten...\"),\r\n common_ok: $(\"OK\", \"OK\"),\r\n common_cancel: $(\"cancel\", \"abbrechen\"),\r\n common_cannot_redirect_to_login: $(\"Cannot redirect to login page. Redirect timed out after 30 seconds.\", \"Die Umleitung zur Login-Seite ist fehlgeschlagen. Die Zeit für die Umleitung is nach 30 Sekunden abgelaufen.\"),\r\n common_temporary: $(\"No license assigned. Changes are temporary and will be deleted each night.\", \"Keine Lizenz zugewiesen. Änderungen sind temporär und werden nachts gelöscht.\"),\r\n\r\n common_browser_not_supported: $('Your browser is not supported. Please upgrade to a recent version of Google Chrome, Microsoft Edge, or Firefox. You can continue, but errors and unexpected behavior may occur.', 'Ihr Browser wird nicht unterstützt. Bitte verwenden Sie eine aktuelle Version von Google Chrome, Microsoft Edge oder Firefox. Sie können fortfahren - jedoch können Fehler und unerwartetes Verhalten auftreten.'),\r\n\r\n common_placeholder: $(\"Type something here...\", \"Hier eingeben...\"),\r\n common_placeholder_short: $(\"...\", \"...\"),\r\n\r\n // navigation\r\n nav_home: $(\"Home\", \"Home\"),\r\n nav_counter: $(\"Counter\", \"Zähler\"),\r\n nav_navigation: $(\"Navigation\", \"Navigation\"),\r\n nav_edit: $(\"Edit\", \"Bearbeiten\"),\r\n nav_pdf_generation: $(\"PDF-Generation\", \"PDF-Erzeugung\"),\r\n nav_admin: $(\"Admin\", \"Admin\"),\r\n nav_faq: $(\"FAQ\", \"FAQ\"),\r\n nav_account: $(\"Account\", \"Konto\"),\r\n\r\n // products\r\n products_my: $(\"My Products\", \"Meine Produkte\"),\r\n\r\n // content\r\n content_body_add_annotation: $(\"+ new annotation\", \"+ neue Anmerkung\"),\r\n\r\n // content outline\r\n content_outline_delete: $(\"delete\", \"löschen\"),\r\n content_outline_edit: $(\"edit\", \"ändern\"),\r\n content_outline_edit_title: $(\"Edit\", \"Ändern\"),\r\n content_outline_add_item: $(\"+ linked content\", \"+ verknüpfter Inhalt\"),\r\n content_outline_add_comment: $(\"+ new comment\", \"+ neuer Kommentar\"),\r\n content_outline_add_group: $(\"+ group for linked content\", \"+ Gruppe für verknüpften Inhalt\"),\r\n content_outline_add_item_title: $(\"New Linked Content\", \"Neuer verknüpfter Inhalt\"),\r\n content_outline_new_comment_title: $(\"New Comment\", \"Neuer Kommentar\"),\r\n content_outline_add_group_title: $(\"New Group\", \"Neue Gruppe\"),\r\n content_outline_header: $(\"title\", \"Titel\"),\r\n content_outline_citation: $(\"citation\", \"Verweis\"),\r\n content_outline_title: $(\"title\", \"Titel\"),\r\n content_outline_tags: $(\"tags (separate with ';')\", \"Tags (mit ';' trennen)\"),\r\n content_outline_target: $(\"target\", \"Ziel\"),\r\n content_outline_item: $(\"content\", \"Inhalt\"),\r\n content_outline_group: $(\"group\", \"Gruppe\"),\r\n content_outline_hidden: $(\"hidden\", \"ausgeblendet\"),\r\n content_outline_body_hidden: $(\"title only\", \"nur Titel\"),\r\n content_outline_header_hidden: $(\"title hidden\", \"Titel ausgeblendet\"),\r\n content_outline_manual_break: $(\"manual break\", \"manueller Umbruch\"),\r\n content_outline_layout: $(\"Layout\", \"Anordnung\"),\r\n content_outline_one_column: $(\"one column\", \"einspaltig\"),\r\n content_outline_two_column: $(\"two column\", \"zweispaltig\"),\r\n content_outline_confirm_delete_item: $(\"Delete linked content\", \"verknüpften Inhalt löschen\"),\r\n content_outline_confirm_delete_group: $(\"Delete group for linked content\", \"Gruppe für verknüpften Inhalt löschen\"),\r\n\r\n // edit toolbar\r\n edit_tb_hide_content: $(\"hide linked content\", \"verknüpften Inhalt ausblenden\"),\r\n edit_tb_show_content: $(\"show linked content\", \"verknüpften Inhalt einblenden\"),\r\n edit_tb_hide_content_par: $(\"hide paragraph\", \"Absatz ausblenden\"),\r\n edit_tb_show_content_par: $(\"show paragraph\", \"Absatz einblenden\"),\r\n edit_tb_delete_comment: $(\"delete comment\", \"Kommentar löschen\"),\r\n edit_tb_hide_comment: $(\"hide comment\", \"Kommentar ausblenden\"),\r\n edit_tb_show_comment: $(\"show comment\", \"Kommentar einblenden\"),\r\n edit_tb_delete_annotation: $(\"delete annotation\", \"Anmerkung löschen\"),\r\n edit_tb_hide_annotation: $(\"hide annotation\", \"Anmerkung ausblenden\"),\r\n edit_tb_show_annotation: $(\"show annotation\", \"Anmerkung einblenden\"),\r\n edit_tb_delete_note: $(\"delete note\", \"Notiz löschen\"),\r\n edit_tb_hide_note: $(\"hide note\", \"Notiz ausblenden\"),\r\n edit_tb_show_note: $(\"show note\", \"Notiz einblenden\"),\r\n\r\n //dropdown\r\n dropdown_profile: $(\"Profile\", \"Profil\"),\r\n dropdown_account: $(\"My Account\", \"Mein Konto\"),\r\n dropdown_settings: $(\"Settings\", \"Einstellungen\"),\r\n dropdown_edit_account: $(\"Edit Account\", \"Konto Bearbeiten\"),\r\n dropdown_preferences: $(\"Preferences\", \"Preferences\"),\r\n dropdown_savedItems: $(\"Saved Items\", \"Gespeicherte Artikel\"),\r\n dropdown_logOut: $(\"Log Out\", \"Log Out\"),\r\n\r\n //sub bar of navigation\r\n sub_bar_toc: $(\"Table of Contents\", \"Inhaltsverzeichnis\"),\r\n sub_bar_contents: $(\"Linked Contents\", \"Verknüpfte Inhalte\"),\r\n sub_bar_notes: $(\"Notes\", \"Notizen\"),\r\n sub_bar_search: $(\"Search\", \"Suche\"),\r\n\r\n //sub bar of edit\r\n sub_bar_structure: $(\"Structure\", \"Gliederung\"),\r\n sub_bar_annotation: $(\"Add linkable annotation\", \"Verknüpfbare Anmerkung hinzufügen\"),\r\n sub_bar_show_hidden_elements: $(\"Show all\", \"Alles anzeigen\"),\r\n sub_bar_toolbox: $(\"Toolbox\", \"Toolbox\"),\r\n sub_bar_change_editibility: $(\"Editable\", \"Editierbar\"),\r\n sub_bar_select_scope: $(\"Select scope\", \"Bereich auswählen\"),\r\n\r\n //sub bar of pdf generation\r\n sub_bar_settings: $(\"Settings\", \"Einstellungen\"),\r\n sub_bar_show_last_pdf: $(\"Show last PDF\", \"Letztes PDF anzeigen\"),\r\n sub_bar_create_new_pdf: $(\"Create new PDF\", \"Neues PDF erzeugen\"),\r\n sub_bar_preview_current_article: $(\"Preview current article\", \"Vorschau für aktuellen Artikel\"),\r\n\r\n //sub bar of admin page\r\n sub_bar_change_scope: $(\"Change scope\", \"Bereichswechsel\"),\r\n sub_bar_change_content_language: $(\"Change content language\", \"Inhaltssprache wechseln\"),\r\n sub_bar_change_content: $(\"Change content\", \"Inhalt ändern\"),\r\n sub_bar_overview_of_linkable_annotations: $(\"Overview of linkable annotations\", \"Überblick verknüpfbarer Anmerkungen\"),\r\n sub_bar_translation: $(\"Translation\", \"Übersetzung\"),\r\n\r\n // appbar (main app bar)\r\n appbar_faqs: $(\"FAQs\", \"FAQs\"),\r\n appbar_notifications: $(\"Notifications\", \"Benachrichtigungen\"),\r\n appbar_login: $(\"Login\", \"Login\"),\r\n appbar_account: $(\"Account\", \"Konto\"),\r\n appbar_logout: $(\"Logout\", \"Logout\"),\r\n appbar_profile: $(\"Profile\", \"Profil\"),\r\n appbar_settings: $(\"Settings\", \"Einstellungen\"),\r\n appbar_shop: $(\"Shop\", \"Shop\"),\r\n appbar_ui_language: $(\"UI Language\", \"Menüsprache\"),\r\n appbar_en: $(\"EN\", \"EN\"),\r\n appbar_de: $(\"DE\", \"DE\"),\r\n appbar_content_language: $(\"Content Language\", \"Inhaltssprache\"),\r\n appbar_preferences: $(\"Preferences\", \"Einstellungen\"),\r\n appbar_settings_styles: $(\"Marking Styles\", \"Markierungsstile\"),\r\n appbar_table_of_contents: $(\"Table of Contents\", \"Inhaltsverzeichnis\"),\r\n appbar_index: $(\"Index\", \"Index\"),\r\n appbar_notes: $(\"Notes\", \"Notizen\"),\r\n appbar_search: $(\"Search\", \"Suche\"),\r\n appbar_pdf_jobs: $(\"PDF Jobs\", \"PDF-Aufträge\"),\r\n\r\n // lookup_content\r\n lookup_content_title_epc: $(\"Rules and Protocols\", \"Regeln und Protokolle\"),\r\n lookup_content_title_pct: $(\"Articles and Rules\", \"Artikel und Regeln\"),\r\n lookup_content_target: $(\"Target\", \"Ziel\"),\r\n lookup_content_source: $(\"Source\", \"Quelle\"),\r\n lookup_sections: $(\"Sections\", \"Abschnitte\"),\r\n lookup_articles: $(\"Articles\", \"Artikel\"),\r\n lookup_rules: $(\"Rules\", \"Regeln\"),\r\n lookup_protocols: $(\"Protocols\", \"Protokolle\"),\r\n\r\n\r\n // edit_tb (edit toolbar)\r\n edit_tb_ordered_list: $(\"sorted list\", \"Geordnete Liste\"),\r\n edit_tb_unordered_list: $(\"random list\", \"Ungeordnete Liste\"),\r\n edit_tb_increase_indentation: $(\"increase indentation (TAB)\", \"Einrückung vergrößern (TAB)\"),\r\n edit_tb_decrease_indentation: $(\"decrease indentation (SHIFT+TAB)\", \"Einrückung verkleinern (SHIFT+TAB)\"),\r\n edit_tb_add_link: $(\"create link\", \"Verknüpfung erstellen\"),\r\n edit_tb_hide: $(\"hide\", \"ausblenden\"),\r\n edit_tb_show: $(\"display\", \"einblenden\"),\r\n edit_tb_delete: $(\"delete\", \"löschen\"),\r\n edit_tb_add_language: $(\"add LANG\", \"LANG hinzufügen\"),\r\n edit_tb_add_language_entry: $(\"add entry for LANG\", \"Eintrag für LANG hinzufügen\"),\r\n edit_tb_move_annotation_left: $(\"move annotation to left (SHIFT+TAB)\", \"Anmerkung nach links verschieben (SHIFT+TAB)\"),\r\n edit_tb_move_annotation_right: $(\"move annotation to right (TAB)\", \"Anmerkung nach rechts verschieben (TAB)\"),\r\n edit_tb_add_note: $(\"add note\", \"Notitz hinzufügen\"),\r\n edit_tb_add_inline_annotation: $(\"add inline-annotation\", \"Inline-Anmerkung hinzufügen\"),\r\n edit_tb_add_annotation: $(\"add annotation\", \"Anmerkung hinzufügen\"),\r\n edit_tb_remove_formatting: $(\"remove formatting\", \"Formattierung löschen\"),\r\n\r\n // edit_menu (edit menu)\r\n edit_menu_select_editing_scope: $(\"select editing scope\", \"Bearbeitungsbereich auswählen\"),\r\n edit_menu_confirm_annotation_hide: $(\"Annotation will be hidden from this view but not deleted. Are you sure?\", \"Anmerkung wird in dieser Ansicht ausgeblendet, aber nicht gelöscht. Sind Sie sicher?\"),\r\n edit_menu_confirm_annotation_delete: $(\"Annotation will be deleted. Are you sure?\", \"Anmerkung wird gelöscht. Sind Sie sicher?\"),\r\n edit_menu_confirm_note_hide: $(\"Note will be hidden from this view but not deleted. Are you sure?\", \"Notiz wird in dieser Ansicht ausgeblendet, aber nicht gelöscht. Sind Sie sicher?\"),\r\n edit_menu_confirm_note_delete: $(\"Note will be deleted. Are you sure?\", \"Notiz wird gelöscht. Sind Sie sicher?\"),\r\n edit_menu_confirm_paragraph_hide: $(\"Content paragraph will be hidden from this linked content. Are you sure?\", \"Der Inhaltsabsatz wird aus diesem verknüpften Inhalt ausgeblendet. Sind Sie sicher?\"),\r\n\r\n edit_menu_citation_not_found: $(\"not found\", \"nicht gefunden\"),\r\n\r\n // shop\r\n shop_learn_more: $(\"Learn More\", \"Mehr erfahren\"),\r\n shop_order: $(\"Order\", \"Bestellen\"),\r\n shop_view_details: $(\"View details\", \"Details anzeigen\"),\r\n shop_goto: $(\"Open\", \"Öffnen\"),\r\n shop_select_license: $(\"Select PRODUCT license\", \"Lizenz für PRODUCT auswählen\"),\r\n shop_your_license: $(\"Your PRODUCT license\", \"Ihre Lizenz für PRODUCT\"),\r\n shop_sca_checkout_failure: $(\"There was a problem with your payment. Your order hasn't been placed, and you haven't been charged.\", \"Beim Zahlungsvorgang ist ein Problem aufgetreten. Ihre Bestellung wurde nicht aufgegeben und Ihr Konto nicht belastet.\"),\r\n shop_sca_profileupdate_failure: $(\"Something's wrong with your payment method. The previous payment method will be used.\", \"Mit dieser Zahlungsart ist ein Problem aufgetreten. Die vorherige Zahlungsart wird weiterhin verwendet.\"),\r\n\r\n // checkout (checkout dialog)\r\n checkout_checkout: $(\"Checkout\", \"Kaufabwicklung\"),\r\n checkout_user_profile: $(\"User Profile\", \"Nutzerprofil\"),\r\n\r\n checkout_license_step: $(\"License\", \"Lizenz\"),\r\n checkout_address_step: $(\"Address\", \"Adresse\"),\r\n checkout_eqe_step: $(\"EQE Candidate\", \"EEP-Kandidat\"),\r\n checkout_payment_step: $(\"Payment\", \"Zahlung\"),\r\n checkout_review_step: $(\"Review order\", \"Bestellung prüfen\"),\r\n\r\n checkout_view_license: $(\"License\", \"Lizenz\"),\r\n checkout_edit_address: $(\"Address\", \"Adresse\"),\r\n checkout_edit_eqe: $(\"EQE Trainer Address / Status\", \"EQE Ausbilder / Status\"),\r\n checkout_edit_payment: $(\"Payment Information\", \"Zahlungsinformationen\"),\r\n\r\n checkout_license: $(\"License\", \"Lizenz\"),\r\n checkout_licenses: $(\"Licenses\", \"Lizenzen\"),\r\n checkout_address: $(\"Address\", \"Adresse\"),\r\n checkout_eqe_trainer_address: $(\"Adress EQE Training Employer\", \"Adresse EEP Ausbildungsstelle\"),\r\n checkout_eqe_trainer_address_subheader: $(\"Please, make your candidate status plausible by providing the adress of your EQE training employer.\", \"Bitte machen Sie Ihren Kandidatenstatus durch Angabe der Adresse Ihrer Ausbildungsstelle für die Europäische Eignungsprüfung plausibel.\"),\r\n checkout_payment_details: $(\"Payment information\", \"Zahlungsinformationen\"),\r\n checkout_payment_details_free_subheader: $(\"The license you selected is free. You may already enter payment information for possible later use or just leave the defaults.\", \"Sie haben eine kostenlose Lizenz ausgewählt. Sie können bereits Zahlungsinformationen für eine mögliche spätere Verwendung angeben oder keine Angaben machen.\"),\r\n checkout_review_your_order: $(\"Review your order\", \"Überprüfen Sie Ihre Bestellung\"),\r\n\r\n checkout_ok: $(\"OK\", \"OK\"),\r\n checkout_back: $(\"Back\", \"Zurück\"),\r\n checkout_next: $(\"Next\", \"Weiter\"),\r\n checkout_cancel: $(\"Cancel\", \"Abbrechen\"),\r\n checkout_place_order: $(\"Place order\", \"Bestellung aufgeben\"),\r\n\r\n checkout_law_firm_company: $(\"Law firm / Company\", \"Kanzlei / Unternehmen\"),\r\n checkout_first_name: $(\"First name\", \"Vorname\"),\r\n checkout_last_name: $(\"Last name\", \"Nachname\"),\r\n checkout_address_line_1: $(\"Address line 1\", \"Adresszeile 1\"),\r\n checkout_address_line_2: $(\"Address line 2\", \"Adresszeile 2\"),\r\n checkout_city: $(\"City\", \"Stadt\"),\r\n checkout_state_province_region: $(\"State/Province/Region\", \"Bundesstaat/Provinz/Region\"),\r\n checkout_zip_postal_code: $(\"Zip / Postal code\", \"Postleitzahl\"),\r\n checkout_country: $(\"Country\", \"Land\"),\r\n\r\n checkout_thank_you_for_order: $(\"Thank you for your order.\", \"Vielen Dank für Ihre Bestellung.\"),\r\n checkout_your_order_number: $(\"Your order number is #PLACEHOLDER. We have sent your order confirmation via e-mail.\", \"Ihre Bestellnummer ist #PLACEHOLDER. Wir haben Ihnen Ihre Bestellbestätigung per E-Mail geschickt.\"),\r\n checkout_training_law_firm: $(\"Training law firm / company\", \"Kanzlei / Unternehmen der Ausbildung\"),\r\n checkout_confirm_license: $(\"Confirm License\", \"Lizenz bestätigen\"),\r\n checkout_change_license: $(\"change...\", \"ändern...\"),\r\n checkout_name: $(\"Name\", \"Name\"),\r\n checkout_description: $(\"Description\", \"Beschreibung\"),\r\n checkout_conditions: $(\"Conditions\", \"Bedingungen\"),\r\n checkout_only_for_eqe: $(\"You need to be a candidate preparing for the European Qualifying Examination.\", \"Sie müssen ein Kandidat sein, der sich auf die Europäische Eignungsprüfung vorbereitet.\"),\r\n checkout_license_product: $(\"Product\", \"Produkt\"),\r\n checkout_license_language: $(\"Language\", \"Sprache\"),\r\n checkout_license_pricing: $(\"Pricing\", \"Preise\"),\r\n checkout_license_period: $(\"Period\", \"Zeitraum\"),\r\n checkout_license_term: $(\"Term\", \"Laufzeit\"),\r\n checkout_select_license: $(\"Select License\", \"Lizenz auswählen\"),\r\n checkout_select: $(\"select\", \"auswählen\"),\r\n\r\n checkout_license_none: $(\"No active license.\", \"keine aktive Lizenz.\"),\r\n checkout_license_go_to_checkout: $(\"Acquire license\", \"Lizenz erwerben\"),\r\n checkout_order_id: $(\"Order Number\", \"Bestellnummer\"),\r\n checkout_invoice_code: $(\"Code\", \"Code\"),\r\n checkout_license_starts: $(\"License Start\", \"Lizenzbegin\"),\r\n checkout_license_ends: $(\"License End\", \"Lizenzablauf\"),\r\n checkout_license_price: $(\"Price\", \"Preis\"),\r\n checkout_upgrade: $(\"Upgrade\", \"Upgrade\"),\r\n checkout_upgrade_name: $(\"To\", \"Auf\"),\r\n checkout_upgrade_date: $(\"On\", \"Am\"),\r\n\r\n checkout_upgrade_info: $(\r\n \"If you want to change from monthly to yearly payments or if you have another request regarding your license, please contact us via email (support@ipappify.de).\",\r\n \"Wenn Sie von monatlicher auf jährliche Zahlung wechseln wollen oder ein anderes Anliegen bezüglich Ihrer Lizenz haben, kontaktieren Sie uns bitte per Email (support@ipappify.de).\"),\r\n\r\n checkout_payment_method: $(\"Payment method\", \"Zahlungsmethode\"),\r\n checkout_purchase_on_account: $(\"purchase on account (invoice by email payable by credit card / bank transfer)\", \"Kauf auf Rechnung (Rechnung per Email zahlbar mit Kreditkarte / Überweisung)\"),\r\n checkout_amazon_pay: $(\"recurrent payment with Amazon Pay\", \"Abonnementzahlung mit Amazon Pay\"),\r\n\r\n checkout_payment_consider_amazon_pay: $(\r\n \"Consider selecting Amazon Pay to set up automatic recurrent payment via your usual Amazon account and to avoid manual payments.\",\r\n \"Wählen Sie Amazon Pay aus, um eine automatisch Abonnementzahlung über Ihr gewohntes Amazon-Konto einzurichten und manuelle Zahlungen zu vermeiden.\"),\r\n\r\n checkout_payment_amazon_pay_already_setup: $(\r\n \"Payment via Amazon Pay is setup with the billing agreement no. #BANO. You can review your billing agreements at 'https://pay.amazon.com'. You can use the Amazon Pay button below to setup a new billing agreement, for instance with a different Amazon account. The current billing agreement is then closed.\",\r\n \"Die Zahlung über Amazon Pay ist mit der Händlervertragsnummer #BANO eingerichtet. Sie können Ihre Händlerverträge unter 'https://pay.amazon.com' einsehen. Sie können den Amazon Pay Button benutzen, um einen neuen Händlervertrag z.B. mit einem anderen Amazon Konto einzurichten. Der bestehende Händlervertrag wird dann storniert.\"),\r\n\r\n checkout_payment_cookies_amazon_pay: $(\r\n \"To setup Amazon Pay, cookies from Amazon Pay (third party cookies) and popups need to be allowed in the browser settings.\",\r\n \"Um Amazon Pay einzurichten, müssen Cookies von Amazon Pay (Third-Party Cookies) und Popups in den Browsereinstellungen zugelassen sein.\"),\r\n\r\n checkout_invoice_address: $(\"Invoice address\", \"Rechnungsadresse\"),\r\n checkout_use_customer_address: $(\"use customer address\", \"Kundenadresse verwenden\"),\r\n checkout_use_eqe_trainer: $(\"use EQE training address\", \"EEP Ausbildungsstellenadresse verwenden\"),\r\n checkout_enter_address: $(\"enter invoice address\", \"Rechnungsadresse eingeben\"),\r\n checkout_company_vat_id: $(\"Company VAT-Id.\", \"Unternehmen Ust-Id.\"),\r\n\r\n // checkout_review (review step in checkout dialog)\r\n checkout_review_order_summary: $(\"Order summary\", \"Bestellübersicht\"),\r\n checkout_review_total: $(\"Total\", \"Gesamt\"),\r\n checkout_review_address: $(\"Address\", \"Adresse\"),\r\n checkout_review_payment_details: $(\"Payment details\", \"Zahlungsdetails\"),\r\n checkout_review_payment_method: $(\"Payment method\", \"Zahlungsmethode\"),\r\n checkout_review_purchase_on_account: $(\"purchase on account\", \"Kauf auf Rechnung\"),\r\n checkout_review_amazon_pay: $(\"Amazon Pay\", \"Amazon Pay\"),\r\n checkout_review_amazon_pay_invoice_address: $(\"as selected in Amazon Pay\", \"wie bei Amazon Pay ausgewählt\"),\r\n checkout_review_invoice_address: $(\"Invoice address\", \"Rechnungsadresse\"),\r\n checkout_review_vat_id: $(\"VAT-Id.\", \"Ust-Id.\"),\r\n checkout_review_not_specified: $(\"not specified\", \"nicht angegeben\"),\r\n checkout_review_please_take_your: $(\"Please, take your time to read the terms and conditions, the cancellation terms, and the privacy policy:\", \"Bitte nehmen Sie sich die Zeit, die Nutzungsbedingungen, die Widerrufsbelehrung und die Datenschutzerklärung zu lesen:\"),\r\n checkout_review_terms_and_conditions: $(\"Terms and conditions and cancellation terms\", \"Nutzungsbedingungen und Widerrufsbelehrung\"),\r\n checkout_review_privacy_policy: $(\"Privacy policy\", \"Datenschutzerklärung\"),\r\n checkout_review_confirm_terms: $(\"I have read the terms and conditions and the privacy policy and agree to them.\", \"Ich habe die Nutzungsbedingungen und die Datenschutzerklärung gelesen und akzeptiere sie.\"),\r\n checkout_review_confirm_cancellation_terms: $(\"I have read the cancellation terms and agree to them.\", \"Ich habe die Widerrufsbelehrung gelesen und akzeptiere sie.\"),\r\n //checkout_review_confirm_news_letter: $(\"I want to receive a news letter from IP.appify GmbH.\", \"Ich per Email über weiter Angebote der IP.appify GmbH informiert werden.\"),\r\n\r\n checkout_eqe_candidate: $(\"EQE Candidate\", \"EEP-Kandidat\"),\r\n checkout_eqe_candidate_subheader: $(\"Please, confirm your candidate status in order to be eligible for special student offers.\", \"Bitte bestätigen Sie Ihren Kandidatenstatus um die speziellen Angebote für Studenten nutzen zu können.\"),\r\n checkout_confirm_eqe_candidate: $(\"I confirm that I am an EQE candidate.\", \"Ich bestätige, dass ich ein EEP-Kandidat bin.\"),\r\n checkout_eqe_candidate_info: $(\r\n \"You may retain your status as an EQE candidate even after sitting the EQE until receiving the official confirmation of passing the main exam.\",\r\n \"Sie dürfen Ihren Status als EEP-Kandidat auch nach Schreiben der EEP beibehalten, bis Sie die offizielle Bestätigung über das Bestehen der Hauptprüfung erhalten haben.\"),\r\n\r\n // checkout_common (shared controls in checkout dialog)\r\n checkout_common_no_vat_included: $(\"no VAT included\", \"keine Mwst. enthalten\"),\r\n checkout_common_vat_included: $(\"VAT included\", \"Mwst. enthalten\"),\r\n checkout_common_free: $(\"FREE\", \"KOSTENLOS\"),\r\n checkout_common_for: $(\"for\", \"für\"),\r\n checkout_common_until: $(\"until\", \"bis\"),\r\n checkout_common_day: $(\"day\", \"Tag\"),\r\n checkout_common_days: $(\"days\", \"Tage\"),\r\n checkout_common_week: $(\"week\", \"Woche\"),\r\n checkout_common_weeks: $(\"weeks\", \"Wochen\"),\r\n checkout_common_month: $(\"month\", \"Monat\"),\r\n checkout_common_months: $(\"months\", \"Monate\"),\r\n checkout_common_year: $(\"year\", \"Jahr\"),\r\n checkout_common_years: $(\"years\", \"Jahre\"),\r\n checkout_common_fixed: $(\"fixed term\", \"fester Zeitraum\"),\r\n checkout_common_unlimited: $(\"unlimited\", \"unbegrenzt\"),\r\n checkout_common_country: $(\"Country\", \"Land\"),\r\n checkout_common_please_select: $(\"Please, select\", \"Bitte wählen Sie\"),\r\n checkout_common_discount: $(\"discount included\", \"Rabatt berücksichtigt\"),\r\n\r\n checkout_common_apply: $(\"Apply Changes\", \"Änderungen anwenden\"),\r\n checkout_common_reset: $(\"Reset Changes\", \"Änderungen zurücksetzen\"),\r\n\r\n // content_outline_item\r\n content_outline_item_default: $(\"Default\", \"Standard\"),\r\n content_outline_item_onecolumn: $(\"One Column\", \"Einspaltig\"),\r\n content_outline_item_twocolumn: $(\"Two Column\", \"Zweispaltig\"),\r\n\r\n // notes (notes page)\r\n notes_title: $(\"Notes\", \"Notizen\"),\r\n notes_toolbar_title: $(\"Note Assistant\", \"Notizassistent\"),\r\n\r\n // search (search page)\r\n search_title: $(\"Full-Text Search\", \"Volltextsuche\"),\r\n search_search: $(\"search\", \"suchen\"),\r\n search_annotation_to: $(\"Annotation to:\", \"Anmerkung zu:\"),\r\n search_results_for: $(\"Results for:\", \"Ergebnisse für:\"),\r\n search_nothing_found: $(\"Nothing found...\", \"Nichts gefunden...\"),\r\n search_page_of_pages: $(\"of\", \"von\"),\r\n search_tip: $(\"Tip: Add quotes to search for a specific combination of terms, e.g. \\\"OJ 2021, A3\\\"\", \"Tipp: Fügen Sie Anführungszeichen hinzu, um nach einer konkreten Begriffskombination zu suchen, z.B. \\\"ABl 2021, A3\\\"\"),\r\n search_see_faq: $(\"see also FAQs\", \"siehe auch FAQs\"),\r\n search_see_faq_link: $(\"https://www.epcapp.net/en/faq#search\", \"https://www.epcapp.net/de/faq#search\"),\r\n\r\n //search_*: $(\"Note Assistant\", \"Notizassistent\"),\r\n\r\n // pdf\r\n pdfJobs_title: $(\"PDF Jobs\", \"PDF-Aufträge\"),\r\n pdfJobs_date: $(\"Date\", \"Datum\"),\r\n pdfJobs_options: $(\"Options\", \"Optionen\"),\r\n pdfJobs_status: $(\"Status\", \"Status\"),\r\n pdfJobs_download: $(\"Download\", \"Download\"),\r\n pdfJobs_submit: $(\"Generate new PDF\", \"Neues PDF erstellen\"),\r\n\r\n pdfJobs_status_completed: $(\"completed\", \"abgeschlossen\"),\r\n pdfJobs_status_failed: $(\"failed (support has been informed)\", \"fehlgeschlagen (der Support wurde benachrichtigt)\"),\r\n pdfJobs_status_started: $(\"started\", \"gestartet\"),\r\n pdfJobs_status_submitted: $(\"submitted\", \"übermittelt\"),\r\n\r\n pdfJobs_submit_documentFontSize: $(\"font size\", \"Schriftgröße\"),\r\n pdfJobs_submit_pageMode: $(\"blank pages and page numbering\", \"Leerseiten und Seitennummerierung\"),\r\n pdfJobs_submit_divisioningMode: $(\"separation pages between parts/chapters\", \"Trennseiten zwischen Teilen/Kapiteln\"),\r\n\r\n pdfJobs_pageMode_sectionwiseNumberingWithClearPage: $(\"blank pages + articlewise numbering\", \"Leerseiten + artikelweise Nummerierung\"),\r\n pdfJobs_pageMode_continuousNumberingWithoutClearPage: $(\"no blank pages + continuous numbering\", \"keine Leerseiten + durchgehende Nummerierung\"),\r\n\r\n pdfJobs_divisioningMode_pageWithOverview: $(\"part/chapter overviews\", \"Teil/Kapitel Übersichten\"),\r\n pdfJobs_divisioningMode_pageWithoutOverview: $(\"part/chapter pages\", \"Teil-/Kapitelseiten\"),\r\n pdfJobs_divisioningMode_noPage: $(\"no part/chapter pages\", \"keine Teil-/Kapitelseiten\"),\r\n\r\n pdfJobs_do_include_notes: $(\"with update notes\", \"mit Update-Notizen\"),\r\n pdfJobs_with_notes: $(\"with update notes\", \"mit Update-Notizen\"),\r\n pdfJobs_print_on_demand: $(\"print on demand\", \"Print-On-Demand\"),\r\n pdfJobs_print_on_demand_options: $(\"print on demand (25.4 x 17.8 cm)\", \"Print-On-Demand (25,4 x 17,8 cm)\"),\r\n pdfJobs_yearly_license_required: $(\"A yearly license is required to generate and order POD books.\", \"Zum Erzeugen und Bestellen eines POD-Buchs wird eine Jahreslizenz benötigt.\"),\r\n pdfJobs_order_pod_header: $(\"Print on demand\", \"Print-On-Demand\"),\r\n pdfJobs_order_pod: $(\"Order Book\", \"Buch bestellen\"),\r\n\r\n // settings_styles\r\n settings_styles_title: $(\"Marking Styles\", \"Markierungsstile\"),\r\n settings_styles_none: $(\"no marking styles loaded\", \"keine Markierungsstile geladen\"),\r\n settings_styles_preview: $(\"Preview\", \"Vorschau\"),\r\n\r\n settings_styles_bold: $(\"Bold\", \"Fett\"),\r\n settings_styles_italic: $(\"Italic\", \"Kursiv\"),\r\n settings_styles_highlight: $(\"Highlight\", \"Highlight\"),\r\n settings_styles_underline: $(\"Underline\", \"Unterstreichung\"),\r\n settings_styles_strike: $(\"Striked Out\", \"Durchgestrichen\"),\r\n settings_styles_text_color: $(\"Text Color\", \"Textfarbe\"),\r\n\r\n settings_styles_highlight_color: $(\"Highlight Color\", \"Highlight-Farbe\"),\r\n settings_styles_line_color: $(\"Line Color\", \"Linienfarbe\"),\r\n settings_styles_line_type: $(\"Line Type\", \"Linientyp\"),\r\n settings_styles_line_thickness: $(\"Line Thickness\", \"Liniendicke\"),\r\n\r\n settings_styles_line_type_solid: $(\"Solid\", \"Durchgehend\"),\r\n settings_styles_line_type_dashed: $(\"Dashed\", \"Gestrichelt\"),\r\n settings_styles_line_type_dotted: $(\"Dotted\", \"Gepunktet\"),\r\n settings_styles_line_type_double: $(\"Double\", \"Doppelt\"),\r\n\r\n settings_styles_thickness_1: $(\"1 Pixel\", \"1 Pixel\"),\r\n settings_styles_thickness_2: $(\"2 Pixels\", \"2 Pixel\"),\r\n settings_styles_thickness_3: $(\"3 Pixels\", \"3 Pixel\"),\r\n\r\n settings_styles_apply: $(\"Apply Changes\", \"Änderungen anwenden\"),\r\n settings_styles_reset: $(\"Reset Changes\", \"Änderungen zurücksetzen\"),\r\n settings_styles_restore: $(\"Restore Default\", \"Default wiederherstellen\"),\r\n};\r\n\r\nexport type RessourcesKeys = keyof typeof ressources;\r\n\r\nexport function localized(uilang: UILanguage) {\r\n return (key: RessourcesKeys) => ressources[key][uilang];\r\n}\r\n\r\nfunction $(en: string, de: string) {\r\n return { EN: en, DE: de };\r\n}\r\n","import * as React from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { render } from 'react-dom';\r\n\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Paper } from '../../libs/material-ui';\r\n\r\ntype TestPageProps = RouteComponentProps<{}> & StyledComponentProps;\r\n\r\nexport class TestPage extends React.Component {\r\n constructor(props: TestPageProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n return
\r\n

Page!!!

\r\n\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n
;\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\n\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Paper, Slide } from '../../libs/material-ui';\r\n\r\ntype TestSideBarProps = RouteComponentProps<{}> & StyledComponentProps;\r\n\r\nexport class TestSideBar extends React.Component {\r\n constructor(props: TestSideBarProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n return (\r\n \r\n SideBar!!!\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n

This is a test component.

\r\n
\r\n );\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\n\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Paper } from '../../libs/material-ui';\r\n\r\ntype TestFooterProps = RouteComponentProps<{}> & StyledComponentProps;\r\n\r\nexport class TestFooter extends React.Component {\r\n constructor(props: TestFooterProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n return (\r\n \r\n
\r\n © IP.appify GmbH 2018\r\n
\r\n
\r\n );\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\n\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Paper } from '../../libs/material-ui';\r\n\r\ntype TestToolbarProps = RouteComponentProps<{}> & StyledComponentProps;\r\n\r\nexport class TestToolbar extends React.Component {\r\n constructor(props: TestToolbarProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n return (\r\n \r\n

Toolbar!

\r\n
\r\n );\r\n }\r\n}\r\n","export const HardLinks = {\r\n www_FAQ_en: \"https://www.epcapp.net/en/faq\",\r\n www_FAQ_de: \"https://www.epcapp.net/de/faq\",\r\n www_terms_en: \"https://www.epcapp.net/en/legal/terms-and-conditions\",\r\n www_terms_de: \"https://www.epcapp.net/de/rechtliches/nutzungsbedingungen\",\r\n www_privacy_en: \"https://www.epcapp.net/en/legal/privacy-policy\",\r\n www_privacy_de: \"https://www.epcapp.net/de/rechtliches/datenschutz\",\r\n www_offers_en: \"https://www.epcapp.net/en/prices\",\r\n www_offers_de: \"https://www.epcapp.net/de/preise\",\r\n}","import {\r\n Editor, EditorState, ContentState, SelectionState,\r\n ContentBlock, DraftBlockType,\r\n CompositeDecorator, RichUtils, Modifier,\r\n DraftEntityType, DraftEntityMutability,\r\n convertFromRaw, convertToRaw\r\n} from \"draft-js\";\r\n\r\nexport class DraftJSUtils {\r\n\r\n public static removeAllInlineStyles(editorState: EditorState): EditorState {\r\n let currentStyles = editorState.getCurrentInlineStyle();\r\n let contentState = editorState.getCurrentContent();\r\n\r\n currentStyles.forEach((style) => {\r\n contentState = Modifier.removeInlineStyle(\r\n contentState,\r\n editorState.getSelection(),\r\n style!\r\n );\r\n });\r\n\r\n return EditorState.push(editorState, contentState, 'change-inline-style');\r\n }\r\n\r\n public static getCurrentBlock(editorState: EditorState): ContentBlock {\r\n let contentState = editorState.getCurrentContent();\r\n let sel = editorState.getSelection();\r\n let key = sel.getFocusKey();\r\n let block = contentState.getBlockForKey(key);\r\n return block;\r\n }\r\n\r\n public static isCurrentBlockOfType(editorState: EditorState, types: DraftBlockType[]): boolean {\r\n let block = DraftJSUtils.getCurrentBlock(editorState);\r\n let type = block.getType();\r\n return types.indexOf(type) >= 0;\r\n }\r\n\r\n //public static setBlock(editorState: EditorState, block: ContentBlock): EditorState {\r\n // let contentState = editorState.getCurrentContent();\r\n // let key = block.getKey();\r\n // //contentState.setIn([\"\"])\r\n\r\n // //return EditorState.push(editorState, contentState, '');\r\n // return editorState;\r\n //}\r\n\r\n public static adjustBlockDepth(editorState: EditorState, delta: number, maxDepth: number): EditorState {\r\n\r\n let content = editorState.getCurrentContent();\r\n let selection = editorState.getSelection();\r\n\r\n let withAdjustment = DraftJSUtils.adjustBlockDepthForContentState(\r\n content,\r\n selection,\r\n delta,\r\n maxDepth\r\n );\r\n\r\n return EditorState.push(editorState, withAdjustment, 'adjust-depth');\r\n }\r\n\r\n public static adjustBlockDepthForContentState(\r\n contentState: ContentState,\r\n selectionState: SelectionState,\r\n adjustment: number,\r\n maxDepth: number): ContentState {\r\n\r\n let startKey = selectionState.getStartKey();\r\n let endKey = selectionState.getEndKey();\r\n let blockMap = contentState.getBlockMap();\r\n\r\n let blocks = blockMap\r\n .toSeq()\r\n .skipUntil((_, k) => k === startKey)\r\n .takeUntil((_, k) => k === endKey)\r\n .concat([[endKey, blockMap.get(endKey)]])\r\n .map(block => {\r\n let depth = block!.getDepth() + adjustment;\r\n depth = Math.max(0, Math.min(depth, maxDepth));\r\n\r\n return block!.getType() == \"ordered-list-item\" || block!.getType() == \"unordered-list-item\" ?\r\n block!.set('depth', depth) as ContentBlock :\r\n block!;\r\n });\r\n\r\n blockMap = blockMap.merge(blocks);\r\n\r\n return contentState.merge({\r\n blockMap,\r\n selectionBefore: selectionState,\r\n selectionAfter: selectionState,\r\n }) as ContentState;\r\n }\r\n\r\n public static getTrimmedSelection(editorState: EditorState) {\r\n let sel = editorState.getSelection();\r\n if (sel == null || sel.isCollapsed())\r\n return { selection: null, text: \"\" };\r\n\r\n let anchorKey = sel.getAnchorKey();\r\n let currentContent = editorState.getCurrentContent();\r\n let currentContentBlock = currentContent.getBlockForKey(anchorKey);\r\n let start = sel.getStartOffset();\r\n let end = sel.getEndOffset();\r\n let text = currentContentBlock.getText().slice(start, end);\r\n\r\n // remove leading/trailing whitespaces/punctuation from selection.\r\n\r\n // see https://draftjs.org/docs/api-reference-selection-state.html\r\n // Use Immutable Map API to set properties.\r\n // anchorKey\r\n // anchorOffset\r\n // focusKey\r\n // focusOffset\r\n // isBackward\r\n // hasFocus\r\n\r\n let trimStart = text.match(\"^[ \\\\.\\\\-!?;,]*\")![0];\r\n let trimEnd = text.match(\"[ \\\\.\\\\-!?;,]*$\")![0];\r\n\r\n if (trimEnd.length > 0) {\r\n if (!sel.getIsBackward())\r\n sel = sel.update(\"focusOffset\", val => val - trimEnd.length) as any;\r\n else\r\n sel = sel.update(\"anchorOffset\", val => val - trimEnd.length) as any;\r\n }\r\n\r\n if (trimStart.length > 0) {\r\n if (!sel.getIsBackward())\r\n sel = sel.update(\"anchorOffset\", val => val + trimStart.length) as any;\r\n else\r\n sel = sel.update(\"focusOffset\", val => val + trimStart.length) as any;\r\n }\r\n\r\n start = sel.getStartOffset();\r\n end = sel.getEndOffset();\r\n text = currentContentBlock.getText().slice(start, end);\r\n\r\n return { selection: sel, text: text };\r\n }\r\n\r\n public static makeEntity(editorState: EditorState, selection: SelectionState, type: DraftEntityType, mutability: DraftEntityMutability, data?: Object) {\r\n let contentState = editorState.getCurrentContent();\r\n let contentStateWithEntity = contentState.createEntity(type, mutability, data);\r\n //\"CONTENTLINK\",\r\n //\"IMMUTABLE\", // \"SEGMENTED\"\r\n //{ label: label }\r\n\r\n let entityKey = contentStateWithEntity.getLastCreatedEntityKey();\r\n let contentStateWithLink = Modifier.applyEntity(\r\n contentStateWithEntity,\r\n selection,\r\n entityKey\r\n );\r\n\r\n let newEditorState = EditorState.push(editorState, contentStateWithLink, \"apply-entity\");\r\n return newEditorState;\r\n }\r\n}","import * as React from \"react\";\r\n\r\nimport { Map, List, Iterable, Seq, Set } from \"immutable\";\r\nimport {\r\n StyleVM, StyleLineType\r\n} from \"../viewmodels/EPCDataModel\"\r\n\r\n\r\nexport class StyleFactory {\r\n\r\n static defaultHighlightColor = \"#fff68f\";\r\n\r\n static getCssStyle(style: StyleVM | undefined, forIcon?: boolean): React.CSSProperties {\r\n let cssStyle: React.CSSProperties = {};\r\n if (!style)\r\n return cssStyle;\r\n\r\n if (style.isBold) {\r\n cssStyle.fontWeight = \"bold\";\r\n }\r\n else if (style.isItalic) {\r\n cssStyle.fontStyle = \"italic\";\r\n }\r\n else if (style.isHighlighted) {\r\n if (forIcon) {\r\n cssStyle.border = \"3px solid \" + (style.highlightColor || StyleFactory.defaultHighlightColor);\r\n cssStyle.borderRadius = 3;\r\n }\r\n else {\r\n cssStyle.backgroundColor = style.highlightColor || StyleFactory.defaultHighlightColor;\r\n }\r\n }\r\n else if (style.isUnderlined) {\r\n let lineType = StyleLineType[style.lineType || 0];\r\n //cssStyle.borderBottom = `${style.lineThickness || 1}px ${lineType} ${style.lineColor || 'currentColor'}`;\r\n cssStyle.borderBottom = `${style.lineThickness || 1}px solid ${style.lineColor || 'currentColor'}`;\r\n }\r\n else if (style.isStriked) {\r\n cssStyle.textDecoration = \"line-through\";\r\n /* IE AND EDGE DO NOT SUPPORT LINE COLOR!!!\r\n if (style.lineColor)\r\n cssStyle.textDecorationColor = style.lineColor;\r\n */\r\n }\r\n\r\n if (style.textColor) {\r\n cssStyle.color = style.textColor;\r\n }\r\n\r\n //if (style.isBold)\r\n // cssStyle.fontWeight = \"bold\";\r\n //else if (style.isItalic)\r\n // cssStyle.fontStyle = \"italic\";\r\n //else if (style.textColor)\r\n // cssStyle.color = style.textColor;\r\n //else if (style.isHighlighted) {\r\n\r\n // if (forIcon) {\r\n // cssStyle.border = \"3px solid \" + (style.highlightColor || \"yellow\");\r\n // cssStyle.borderRadius = 3;\r\n // }\r\n // else {\r\n // cssStyle.backgroundColor = style.highlightColor || \"yellow\";\r\n // }\r\n //}\r\n //else if (style.isStriked) {\r\n // cssStyle.textDecoration = \"line-through\";\r\n // /* IE AND EDGE DO NOT SUPPORT LINE COLOR!!!\r\n // if (style.lineColor)\r\n // cssStyle.textDecorationColor = style.lineColor;\r\n // */\r\n //}\r\n //else if (style.isUnderlined) {\r\n\r\n // /* DOES NOT WORK IN IE AND EDGE!!!\r\n // cssStyle.textDecoration = \"underline\";\r\n // if (style.lineColor)\r\n // cssStyle.textDecorationColor = style.lineColor;\r\n // */\r\n\r\n // if (style.lineColor)\r\n // cssStyle.borderBottom = \"thin solid \" + style.lineColor;\r\n // else\r\n // cssStyle.borderBottom = \"thin solid currentColor\";\r\n //}\r\n\r\n return cssStyle;\r\n }\r\n\r\n static getCssStyles(styles: StyleVM[], forIcon?: boolean) {\r\n let cssStyles: { [key: string]: React.CSSProperties } = {};\r\n\r\n for (let i = 0; i < styles.length; i++) {\r\n let style = styles[i];\r\n let cssStyle = StyleFactory.getCssStyle(style, forIcon);\r\n cssStyles[\"STYLE-\" + style.id!.toUpperCase()] = cssStyle;\r\n }\r\n\r\n return cssStyles;\r\n }\r\n}","//RESSOURCE edit_tb\r\n\r\nimport * as React from \"react\";\r\n\r\nimport { StyleFactory } from \"../../../utils/StyleFactory\";\r\nimport { ToolbarItem } from './EditMenu';\r\n\r\nimport AccessAlarm from '@material-ui/icons/AccessAlarm';\r\n\r\n//import List from '@material-ui/icons/List';\r\nimport Add from '@material-ui/icons/Add';\r\nimport FormatListNumbered from '@material-ui/icons/FormatListNumbered';\r\nimport FormatListBulleted from '@material-ui/icons/FormatListBulleted';\r\nimport FormatIndentDecrease from '@material-ui/icons/FormatIndentDecrease';\r\nimport FormatIndentIncrease from '@material-ui/icons/FormatIndentIncrease';\r\nimport VisibilityOff from '@material-ui/icons/VisibilityOff';\r\nimport Visibility from '@material-ui/icons/Visibility';\r\nimport DeleteForever from '@material-ui/icons/DeleteForever';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport FormatClear from '@material-ui/icons/FormatClear';\r\nimport LocationOn from '@material-ui/icons/LocationOn'; // TODO find real pin\r\nimport Note from '@material-ui/icons/Note';\r\nimport AddComment from '@material-ui/icons/AddComment';\r\nimport NoteAdd from '@material-ui/icons/NoteAdd'; // may be for comments?\r\n\r\nimport { localized, UILanguage } from \"../../../ressources\";\r\nimport * as Theme from \"../../../theme\";\r\n\r\nimport * as Model from \"../../../viewmodels/EPCDataModel\";\r\n\r\nconst PushPin = () => (\r\n \r\n \r\n \r\n);\r\n\r\nexport const makeContentLinkItem = \"makeContentLinkItem\";\r\n\r\nexport class Commands {\r\n // list commands\r\n static MakeOrderedList = \"make-ordered-list\";\r\n static MakeUnorderedList = \"make-unordered-list\";\r\n static IncList = \"inc-list\";\r\n static DecList = \"dec-list\";\r\n\r\n // styles\r\n static SetStyle = \"set-style\";\r\n static EraseStyle = \"erase-style\";\r\n\r\n // content link\r\n static MakeContentLink = \"make-content-link\";\r\n\r\n // inline\r\n static MoveLeft = \"move-left\";\r\n static MoveRight = \"move-right\";\r\n\r\n // modify element\r\n static Delete = \"delete\";\r\n static Update = \"update\";\r\n static UpdateTitle = \"update-title\";\r\n\r\n // scope\r\n static CopyToOwn = \"copy-to-own\";\r\n static Hide = \"hide\";\r\n static Show = \"show\";\r\n\r\n // linked content\r\n static Remove = \"remove\";\r\n\r\n // new elements\r\n static NewAnnotation = \"new-annotation\";\r\n static NewInlineAnnotation = \"new-inline-annotation\";\r\n static NewNote = \"new-note\";\r\n\r\n // language\r\n static AddLanguage = \"add-language\";\r\n}\r\n\r\nexport const getListToolbarItems = (uilang: UILanguage): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n return [\r\n {\r\n render: () => ,//1., // TODO use better symbol\r\n title: $('edit_tb_ordered_list'),\r\n command: Commands.MakeOrderedList\r\n },\r\n {\r\n render: () => , //,\r\n title: $('edit_tb_unordered_list'),\r\n command: Commands.MakeUnorderedList\r\n },\r\n {\r\n render: () => ,//,\r\n title: $('edit_tb_increase_indentation'),\r\n command: Commands.IncList\r\n },\r\n {\r\n render: () => , //,\r\n title: $('edit_tb_decrease_indentation'),\r\n command: Commands.DecList\r\n }\r\n ];\r\n};\r\n\r\nexport const getContentLinkToolbarItems = (uilang: UILanguage): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n return [\r\n {\r\n render: () => #, // \r\n title: $('edit_tb_add_link'),\r\n command: Commands.MakeContentLink,\r\n needsSelection: true,\r\n ref: makeContentLinkItem\r\n }\r\n ];\r\n};\r\n\r\nexport const getHideToolbarItems = (uilang: UILanguage): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n return [\r\n { // \r\n render: () => ( {$('edit_tb_hide')}),\r\n title: $('edit_tb_hide'),\r\n command: Commands.Hide\r\n }\r\n ];\r\n};\r\n\r\nexport const getShowToolbarItems = (uilang: UILanguage): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n return [\r\n { // \r\n render: () => ( {$('edit_tb_show')}),\r\n title: $('edit_tb_show'),\r\n command: Commands.Show\r\n }\r\n ];\r\n};\r\n\r\nexport const getDeleteToolbarItems = (uilang: UILanguage): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n return [\r\n { // \r\n render: () => ( {$('edit_tb_delete')}),\r\n title: $('edit_tb_delete'),\r\n command: Commands.Delete\r\n }\r\n ];\r\n};\r\n\r\nexport const getAddLanguageItems = (uilang: UILanguage, language: Model.Language): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n return [\r\n {\r\n render: () => ( {$('edit_tb_add_language').replace(\"LANG\", Model.Language[language])}),\r\n title: $('edit_tb_add_language_entry').replace(\"LANG\", Model.Language[language]),\r\n command: Commands.AddLanguage\r\n }\r\n ];\r\n};\r\n\r\n//export const getLowerScopeToolbarItems = (uilang: UILanguage, kind: string, isHidden: boolean): ToolbarItem[] => [\r\n// {\r\n// render: () => (),\r\n// title: `${kind} als eigene übernehmen`,\r\n// command: Commands.CopyToOwn\r\n// },\r\n// isHidden ? {\r\n// render: () => ( ausblenden),\r\n// title: `${title}`,\r\n// command: Commands.Show\r\n// } : {\r\n// render: () => ( ausblenden),\r\n// title: `${title}`,\r\n// command: Commands.Hide\r\n// }\r\n//];\r\n\r\nexport const getInlineToolbarItems = (uilang: UILanguage): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n return [\r\n { // \r\n render: () => ,\r\n title: $('edit_tb_move_annotation_left'),\r\n command: Commands.MoveLeft\r\n },\r\n { // \r\n render: () => ,\r\n title: $('edit_tb_move_annotation_right'),\r\n command: Commands.MoveRight\r\n }\r\n ];\r\n}\r\n\r\nexport const getNewNoteToolbarItems = (uilang: UILanguage, canAddItem: boolean): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n\r\n let tbitems: ToolbarItem[] = [];\r\n if (canAddItem) {\r\n tbitems.push(\r\n {\r\n //className: \"glyphicon glyphicon-pushpin\", \r\n render: () => , //,\r\n title: $('edit_tb_add_note'),\r\n command: Commands.NewNote\r\n },\r\n );\r\n }\r\n\r\n return tbitems;\r\n}\r\n\r\nexport const getNewParagraphElementToolbarItems = (uilang: UILanguage, canAddItem: boolean, canAddInlineItem: boolean): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n\r\n let tbitems: ToolbarItem[] = [];\r\n\r\n if (canAddInlineItem) {\r\n tbitems.push(\r\n { // \r\n render: () => ([]),\r\n title: $('edit_tb_add_inline_annotation'),\r\n needsSelection: true,\r\n command: Commands.NewInlineAnnotation\r\n },\r\n );\r\n }\r\n\r\n if (canAddItem) {\r\n tbitems.push(\r\n {\r\n //className: \"glyphicon glyphicon-comment\",\r\n render: () => ,\r\n title: $('edit_tb_add_annotation'),\r\n command: Commands.NewAnnotation\r\n },\r\n );\r\n }\r\n\r\n tbitems.push(...getNewNoteToolbarItems(uilang, canAddItem));\r\n\r\n return tbitems;\r\n}\r\n\r\nexport const getStyleToolbarItems = (uilang: UILanguage, styles: Model.StyleVM[]): ToolbarItem[] => {\r\n const $ = localized(uilang);\r\n\r\n let erase: ToolbarItem = {\r\n render: () => ,//(),\r\n title: $('edit_tb_remove_formatting'),\r\n command: Commands.EraseStyle,\r\n needsSelection: true,\r\n };\r\n\r\n return styles\r\n .map(style => {\r\n return {\r\n className: \"\",\r\n cssStyle: {\r\n ...StyleFactory.getCssStyle(style, true),\r\n ...Theme.styles.tbitem_style_icon,\r\n },\r\n content: style.symbol ? style.symbol.text : \"??\",\r\n title: style.name ? style.name.text : \"\",\r\n id: Commands.SetStyle + \"-\" + style.id,\r\n command: Commands.SetStyle,\r\n commandArgs: { styleId: style.id },\r\n needsSelection: true,\r\n } as ToolbarItem;\r\n }).concat([erase]);\r\n}\r\n\r\nexport function composeToolbarItems(...tblists: ToolbarItem[][]) {\r\n let tbitems: ToolbarItem[] = [];\r\n let sepIdx = 0;\r\n for (let i = 0; i < tblists.length; i++) {\r\n let tblist = tblists[i];\r\n if (tblist.length == 0)\r\n continue;\r\n if (i > 0) {\r\n tbitems.push({ isSeperator: true, id: `sep-${sepIdx}` });\r\n sepIdx++;\r\n }\r\n tbitems = tbitems.concat(tblist);\r\n }\r\n return tbitems;\r\n}\r\n\r\nexport function makeInactive(tblist: ToolbarItem[], inactive: boolean): ToolbarItem[] {\r\n return !inactive ? (tblist || []) : (tblist || []).map(tbitem => ({ ...tbitem, inactive: true }));\r\n}\r\n\r\nexport function makeActive(tblist: ToolbarItem[], active: boolean): ToolbarItem[] {\r\n return active ? (tblist || []) : (tblist || []).map(tbitem => ({ ...tbitem, inactive: false }));\r\n}","//RESSOURCE edit_menu\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as _ from 'lodash';\r\nimport * as Logging from '../../../debug';\r\nimport * as WebApi from '../../../webapi';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../../ressources\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../../store';\r\nimport * as UserProfileStore from '../../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../../store/ViewRegistry';\r\nimport {\r\n ContentItem, AnnotationItem, CommentItem, NoteItem,\r\n LinkedContentGroup, LinkedContentItem, ViewRegistryMode\r\n} from '../../../store/ViewRegistry/items';\r\nimport {\r\n SelectionState, ToolbarTarget, CommentEditorTarget, AnnotationEditorTarget, ContentToolbarTarget\r\n} from '../../../store/ViewRegistry/toolbar';\r\nimport { findLinkedContentItem } from '../../../store/ViewRegistry/linkedContents';\r\n\r\n// component dependencies\r\nimport * as Draft from 'draft-js';\r\nimport { Tab, Tabs, Toolbar, Button, Menu, MenuItem, Icons } from '../../../libs/material-ui';\r\nimport { DraftJSUtils } from '../../../utils/DraftJSUtils';\r\n\r\n// data model dependencies\r\nimport * as Model from \"../../../viewmodels/EPCDataModel\";\r\nimport * as Common from './Common';\r\nimport { SyncStateUtil } from '../../../utils/SyncState';\r\nimport { Commands, getContentLinkToolbarItems, composeToolbarItems } from './Common';\r\nimport { ReservedParagraphKeys } from '../../../viewmodels/EPCDataModel';\r\nimport { compose, bindActionCreators } from 'redux';\r\n\r\n//const getStyles = (theme: Theme) => ({\r\n// menuButton: {\r\n// textTransform: 'none',\r\n// fontSize: 15\r\n// },\r\n// other: {\r\n\r\n// }\r\n//});\r\n\r\nconst getStyles = (theme: Theme) => ({\r\n menuButton: {\r\n textTransform: 'none',\r\n fontSize: 15\r\n } as any,\r\n});\r\n\r\ntype EditMenuProps =\r\n {\r\n disabled?: boolean,\r\n\r\n toolbarTarget?: ToolbarTarget,\r\n toolbarSelection?: SelectionState,\r\n toolbarAlignedSelection?: SelectionState,\r\n\r\n editorState?: Draft.EditorState,\r\n\r\n comment?: CommentItem,\r\n content?: ContentItem,\r\n annotation?: AnnotationItem,\r\n note?: NoteItem,\r\n linkedContentItem?: LinkedContentItem,\r\n\r\n mode: ViewRegistryMode,\r\n viewOptions: UserProfileStore.ViewOptions,\r\n styles: Model.StyleVM[],\r\n }\r\n & typeof ViewRegistryStore.actionCreators\r\n & typeof UserProfileStore.actionCreators\r\n & StyledComponentProps;\r\n\r\nexport interface ToolbarItem {\r\n type?: \"button\" | \"control\",\r\n render?: () => JSX.Element[] | JSX.Element | null | false,\r\n className?: string,\r\n cssStyle?: React.CSSProperties,\r\n content?: string,\r\n title?: string,\r\n\r\n canToggle?: boolean,\r\n inactive?: boolean,\r\n needsSelection?: boolean,\r\n\r\n id?: string,\r\n ref?: string,\r\n command?: string,\r\n commandArgs?: any,\r\n\r\n isSeperator?: boolean\r\n}\r\n\r\ntype handled = 'handled' | 'not-handled';\r\n\r\ninterface ScopeMenuState {\r\n anchorEl?: HTMLElement,\r\n}\r\n\r\ninterface ContentLinkMenuState {\r\n anchorEl?: HTMLElement,\r\n results?: Model.ResolverResultVM[],\r\n selection?: Draft.SelectionState\r\n}\r\n\r\ninterface EditMenuState {\r\n scopeMenu: ScopeMenuState,\r\n contentLinkMenu: ContentLinkMenuState,\r\n}\r\n\r\nexport class EditMenu extends React.Component {\r\n\r\n constructor(props: EditMenuProps) {\r\n super(props);\r\n\r\n this.state = {\r\n scopeMenu: {},\r\n contentLinkMenu: {}\r\n }\r\n }\r\n\r\n public render() {\r\n\r\n Logging.log(`EditMenu.render`, \"render\");\r\n\r\n const classes = this.props.classes || {};\r\n\r\n const uilang = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uilang);\r\n\r\n const disabled = !!this.props.disabled;\r\n const tbitems = this.getToolbarItems();\r\n\r\n const writableScopeIds = this.props.viewOptions.writerScopeIds;\r\n const readableScopeIds = this.props.viewOptions.readerScopeIds;\r\n const scopes = this.props.viewOptions.scopes;\r\n\r\n const editScopes = scopes.filter(scope => _.includes(writableScopeIds, scope.id!));\r\n const editScopeId = this.props.viewOptions.editScopeId;\r\n const editScope = _.find(editScopes, scope => scope.id === editScopeId);\r\n\r\n const readOnly = this.props.viewOptions.readOnly;\r\n const displayHidden = this.props.viewOptions.displayHidden;\r\n\r\n const isOutlineMode = this.props.mode == 'ContentOutline';\r\n\r\n return (\r\n
\r\n { evt.preventDefault(); }}>\r\n\r\n \r\n\r\n {\r\n //\r\n }\r\n\r\n \r\n\r\n \r\n\r\n {writableScopeIds.length > 1 &&\r\n
\r\n \r\n this.handleScopeMenuClose()}>\r\n {$('edit_menu_select_editing_scope')}\r\n {scopes && scopes.filter(scope => _.includes(writableScopeIds, scope.id)).map(scope =>\r\n this.handleScopeMenuClick(scope.id!)}>\r\n {editScopeId == scope.id && }\r\n {scope.name || scope.label}\r\n \r\n )}\r\n \r\n
\r\n }\r\n\r\n\r\n {!disabled && (\r\n
\r\n\r\n {tbitems && tbitems.map((tbitem, idx) => this.renderItem(tbitem, idx))}\r\n\r\n this.handleContentLinkMenuClose()}\r\n disableAutoFocus disableAutoFocusItem>\r\n\r\n {this.state.contentLinkMenu.results && this.state.contentLinkMenu.results.map(result =>\r\n this.handleContentLinkMenuClick(result.productId!, result.label!, result.paragraphTag)}>\r\n {result.friendlyLabel}{result.friendlyLabel != null && result.friendlyLabel.trim() != \"\" ? \" - \" : \"\"}{result.title && result.title.text}\r\n \r\n )}\r\n {(!this.state.contentLinkMenu.results || this.state.contentLinkMenu.results.length == 0) && (\r\n \r\n {$('edit_menu_citation_not_found')}\r\n \r\n )}\r\n \r\n
\r\n )}\r\n\r\n
\r\n
\r\n );\r\n }\r\n\r\n handleScopeMenuOpen(evt: React.MouseEvent) {\r\n this.setState({\r\n scopeMenu: {\r\n anchorEl: evt.currentTarget\r\n }\r\n });\r\n };\r\n\r\n handleScopeMenuClick(scopeId: string) {\r\n\r\n this.props.setEditScope(scopeId);\r\n\r\n this.setState({\r\n scopeMenu: {\r\n anchorEl: undefined\r\n }\r\n });\r\n };\r\n\r\n handleScopeMenuClose() {\r\n this.setState({\r\n scopeMenu: {\r\n anchorEl: undefined\r\n }\r\n });\r\n };\r\n\r\n handleContentLinkMenuClick(productId: string, label: string, parTag?: string) {\r\n\r\n if (!this.state.contentLinkMenu.selection)\r\n return;\r\n if (!this.props.toolbarTarget)\r\n return;\r\n if (this.props.toolbarTarget.type != 'COMMENT_EDITOR_TARGET' && this.props.toolbarTarget.type != 'ANNOTATION_EDITOR_TARGET')\r\n return;\r\n\r\n const selection = this.state.contentLinkMenu.selection;\r\n const editorState = this.props.editorState!;\r\n\r\n if (selection) {\r\n let newEditorState = DraftJSUtils.makeEntity(editorState, selection, \"CONTENTLINK\", \"IMMUTABLE\", { label: label, parTag: parTag });\r\n this.handleEditorChanged(newEditorState);\r\n }\r\n\r\n // close the menu\r\n this.setState({\r\n contentLinkMenu: {}\r\n });\r\n };\r\n\r\n handleContentLinkMenuClose() {\r\n this.setState({\r\n contentLinkMenu: {}\r\n });\r\n };\r\n\r\n toggleEditMode() {\r\n const readOnly = this.props.viewOptions.readOnly;\r\n this.props.setEditMode(!readOnly);\r\n };\r\n\r\n toggleOutlineMode() {\r\n if (this.props.mode == 'Content')\r\n this.props.setViewRegistryMode('ContentOutline');\r\n else if (this.props.mode == 'ContentOutline')\r\n this.props.setViewRegistryMode('Content');\r\n };\r\n\r\n toggleDisplayHidden() {\r\n const displayHidden = this.props.viewOptions.displayHidden;\r\n this.props.setDisplayHidden(!displayHidden);\r\n };\r\n\r\n renderItem(tbitem: ToolbarItem, idx: number) {\r\n\r\n const hasSelection =\r\n (this.props.editorState && !this.props.editorState.getSelection().isCollapsed()) || // selection in draft editor\r\n !!this.props.toolbarSelection; // selection in paragraph text\r\n\r\n let className = \"tbitem\";\r\n if (tbitem.inactive || (!hasSelection && tbitem.needsSelection))\r\n className += \" tbitem-inactive\";\r\n if (tbitem.isSeperator)\r\n className += \" tbitem-separator\";\r\n if (tbitem.className)\r\n className += \" \" + tbitem.className;\r\n\r\n let content = tbitem.render ? tbitem.render() : (tbitem.content || \"\");\r\n\r\n if (tbitem.type == \"control\") {\r\n let style: React.CSSProperties = tbitem.cssStyle ? { ...tbitem.cssStyle } : {};\r\n style.display = \"inline-block\";\r\n return (\r\n
{content}
\r\n );\r\n }\r\n else {\r\n if (!tbitem.inactive) {\r\n return (\r\n this.handleToolbarItemClick(evt, tbitem)}>{content}\r\n );\r\n }\r\n else {\r\n return (\r\n { evt.preventDefault(); }}>{content}\r\n );\r\n }\r\n }\r\n }\r\n\r\n getToolbarItems(): ToolbarItem[] {\r\n if (!this.props.toolbarTarget)\r\n return [];\r\n\r\n const target = this.props.toolbarTarget;\r\n\r\n const mode = this.props.mode;\r\n const uilang = this.props.viewOptions.uiLanguage;\r\n const styles = this.props.styles;\r\n const editorState = this.props.editorState;\r\n\r\n const opts = this.props.viewOptions;\r\n const editScopeId = opts.editScopeId;\r\n const editLanguage = opts.editLanguage;\r\n\r\n let isReadOnly = opts.readOnly;\r\n let canEditBody = !!editScopeId && !opts.readOnly;\r\n let canEditObject = !!editScopeId && !opts.readOnly;\r\n\r\n switch (target.type) {\r\n case 'CONTENT_TOOLBAR_TARGET': {\r\n const content = this.props.content!;\r\n const hasSelection = !!this.props.toolbarSelection;\r\n const parKey = target.parKey!;\r\n const isRoot = !this.props.linkedContentItem;\r\n const isLinkedContent = !!this.props.linkedContentItem;\r\n const isContentHidden = !!(this.props.linkedContentItem && this.props.linkedContentItem.optOut);\r\n const isContentParagraphHidden = !!(this.props.linkedContentItem && _.includes(this.props.linkedContentItem.paragraphOptOut, parKey));\r\n\r\n if (parKey == Model.ReservedParagraphKeys.Title)\r\n return EditMenu.getContentTitleToolbarItems(mode, uilang, canEditBody, canEditObject, isRoot, isContentHidden);\r\n else\r\n return EditMenu.getContentParagraphToolbarItems(mode, uilang, styles, target.parKey, hasSelection, canEditBody, canEditObject, isContentParagraphHidden, isLinkedContent);\r\n }\r\n case 'COMMENT_EDITOR_TARGET':\r\n case 'ANNOTATION_EDITOR_TARGET':\r\n case 'NOTE_EDITOR_TARGET': {\r\n\r\n let elementScopeId =\r\n (this.props.comment && this.props.comment.scopeId) ||\r\n (this.props.annotation && this.props.annotation.scopeId) ||\r\n (this.props.note && this.props.note.scopeId) || \"empty\";\r\n\r\n const isHidden =\r\n (this.props.linkedContentItem && !!this.props.linkedContentItem.optOut) ||\r\n (this.props.annotation && this.props.annotation.isOptOut) ||\r\n (this.props.note && this.props.note.isOptOut) || false;\r\n\r\n let isInline = this.props.annotation && this.props.annotation.isInline || false;\r\n let isFallback = !this.areLanguagesCompatible(target.draftLanguage, editLanguage);\r\n\r\n canEditBody = canEditBody && elementScopeId === editScopeId;\r\n\r\n let items = [\r\n Common.makeInactive(Common.getStyleToolbarItems(uilang, styles), !canEditBody),\r\n Common.makeInactive(Common.getListToolbarItems(uilang), !canEditBody)\r\n ];\r\n\r\n if (canEditObject && target.type != 'NOTE_EDITOR_TARGET')\r\n items.push(Common.makeInactive(Common.getContentLinkToolbarItems(uilang), !canEditBody));\r\n\r\n if (isInline)\r\n items.push(Common.makeInactive(Common.getInlineToolbarItems(uilang), !canEditBody));\r\n\r\n if (canEditObject && target.type != 'NOTE_EDITOR_TARGET')\r\n items.push(Common.getNewNoteToolbarItems(uilang, true));\r\n\r\n // TODO \r\n if (target.type != 'COMMENT_EDITOR_TARGET') {\r\n if (canEditObject && elementScopeId !== editScopeId)\r\n items.push(isHidden ?\r\n Common.getShowToolbarItems(uilang) :\r\n Common.getHideToolbarItems(uilang));\r\n\r\n if (canEditObject && elementScopeId === editScopeId)\r\n items.push(Common.getDeleteToolbarItems(uilang));\r\n }\r\n\r\n if (isFallback /*&& !(this.props.note && this.props.note.typeOfStickyNote === Model.TypeOfStickyNote.UpdateNote)*/)\r\n items.push(Common.getAddLanguageItems(uilang, editLanguage));\r\n\r\n return composeToolbarItems(...items);\r\n }\r\n\r\n //case 'COMMENT_EDITOR_TARGET': {\r\n // const comment = this.props.comment!;\r\n // const isHidden = !this.props.linkedContentItem || !!this.props.linkedContentItem.optOut;\r\n // const isFallback = !this.areLanguagesCompatible(target.draftLanguage, editLanguage);\r\n // canEditBody = canEditBody && comment.scopeId == editScopeId && !comment.isDeleting;\r\n // return EditMenu.getCommentToolbarItems(mode, uilang, editLanguage, styles, canEditBody, canEditObject, isHidden, isFallback);\r\n //}\r\n //case 'ANNOTATION_EDITOR_TARGET': {\r\n // const annotation = this.props.annotation!;\r\n // const isFallback = !this.areLanguagesCompatible(target.draftLanguage, editLanguage);\r\n // canEditBody = canEditBody && annotation.scopeId == editScopeId && !annotation.isDeleting;\r\n // return EditMenu.getAnnotationToolbarItems(mode, uilang, editLanguage, styles, canEditBody, canEditObject, annotation.isInline, !!annotation.isOptOut, isFallback);\r\n //}\r\n //case 'NOTE_EDITOR_TARGET': {\r\n // const note = this.props.note!;\r\n // const isFallback = !this.areLanguagesCompatible(target.draftLanguage, editLanguage);\r\n // canEditBody = canEditBody && note.scopeId == editScopeId && !note.isDeleting;\r\n // return EditMenu.getNoteToolbarItems(mode, uilang, editLanguage, styles, canEditBody, canEditObject, !!note.isOptOut, isFallback);\r\n //}\r\n default:\r\n return [];\r\n }\r\n }\r\n\r\n private areLanguagesCompatible(objectLanguage: Model.Language, editLanguage: Model.Language) {\r\n return objectLanguage === Model.Language.Any ||\r\n editLanguage === Model.Language.Any ||\r\n objectLanguage === editLanguage;\r\n }\r\n\r\n //static getCommentToolbarItems(\r\n // mode: ViewRegistryStore.ViewRegistryMode,\r\n // uilang: UILanguage,\r\n // editLang: Model.Language,\r\n // styles: Model.StyleVM[],\r\n // canEditBody: boolean,\r\n // canEditObject: boolean,\r\n // isHidden: boolean,\r\n // isFallback: boolean,\r\n //): ToolbarItem[] {\r\n\r\n // const canRemove = mode == 'Content' && canEditObject;\r\n // const canDelete = mode == 'SingleComment' && canEditObject;\r\n\r\n // const $ = localized(uilang);\r\n\r\n // let tbitems = Common.composeToolbarItems(\r\n // Common.makeInactive(Common.getStyleToolbarItems(uilang, styles), !canEditBody),\r\n // Common.makeInactive(Common.getListToolbarItems(uilang), !canEditBody),\r\n // Common.makeInactive(Common.getContentLinkToolbarItems(uilang), !canEditBody),\r\n // canRemove ? (isHidden ?\r\n // Common.getShowToolbarItems(uilang, $('edit_tb_show_comment')) :\r\n // Common.getHideToolbarItems(uilang, $('edit_tb_hide_comment'))\r\n // ) : [],\r\n // canDelete ? Common.getDeleteToolbarItems(uilang, $('edit_tb_delete_comment')) : [],\r\n // isFallback ? Common.getAddLanguageItems(uilang, editLang) : [],\r\n // );\r\n\r\n // return tbitems;\r\n //}\r\n\r\n //static getAnnotationToolbarItems(\r\n // mode: ViewRegistryStore.ViewRegistryMode,\r\n // uilang: UILanguage,\r\n // editLang: Model.Language,\r\n // styles: Model.StyleVM[],\r\n // canEditBody: boolean,\r\n // canEditObject: boolean,\r\n // isInline: boolean,\r\n // isHidden: boolean,\r\n // isFallback: boolean,\r\n //): ToolbarItem[] {\r\n\r\n // const canDelete = canEditBody;\r\n // const canRemove = !canDelete && canEditObject;\r\n\r\n // const $ = localized(uilang);\r\n\r\n // let tbitems = Common.composeToolbarItems(\r\n // Common.makeInactive(Common.getStyleToolbarItems(uilang, styles), !canEditBody),\r\n // Common.makeInactive(Common.getListToolbarItems(uilang), !canEditBody),\r\n // Common.makeInactive(Common.getContentLinkToolbarItems(uilang), !canEditBody),\r\n // isInline ? Common.makeInactive(Common.getInlineToolbarItems(uilang), !canEditBody) : [],\r\n // canEditObject ? Common.getNewNoteToolbarItems(uilang, true) : [],\r\n // canRemove ? (isHidden ?\r\n // Common.getShowToolbarItems(uilang, $('edit_tb_show_annotation')) :\r\n // Common.getHideToolbarItems(uilang, $('edit_tb_hide_annotation'))\r\n // ) : [],\r\n // canDelete ? Common.getDeleteToolbarItems(uilang, $('edit_tb_delete_annotation')) : [],\r\n // isFallback ? Common.getAddLanguageItems(uilang, editLang) : [],\r\n // );\r\n\r\n // return tbitems;\r\n //}\r\n\r\n //static getNoteToolbarItems(\r\n // mode: ViewRegistryStore.ViewRegistryMode,\r\n // uilang: UILanguage,\r\n // editLang: Model.Language,\r\n // styles: Model.StyleVM[],\r\n // canEditBody: boolean,\r\n // canEditObject: boolean,\r\n // isHidden: boolean,\r\n // isFallback: boolean,\r\n //): ToolbarItem[] {\r\n\r\n // const canDelete = canEditBody;\r\n // const canRemove = !canDelete && canEditObject;\r\n\r\n // const $ = localized(uilang);\r\n\r\n // let tbitems = Common.composeToolbarItems(\r\n // Common.makeInactive(Common.getStyleToolbarItems(uilang, styles), !canEditBody || isFallback),\r\n // Common.makeInactive(Common.getListToolbarItems(uilang), !canEditBody || isFallback),\r\n // canRemove ? (isHidden ?\r\n // Common.getShowToolbarItems(uilang, $('edit_tb_show_note')) :\r\n // Common.getHideToolbarItems(uilang, $('edit_tb_hide_note'))\r\n // ) : [],\r\n // canDelete ? Common.getDeleteToolbarItems(uilang, $('edit_tb_delete_note')) : [],\r\n // isFallback ? Common.getAddLanguageItems(uilang, editLang) : []\r\n // );\r\n\r\n // return tbitems;\r\n //}\r\n\r\n static getContentTitleToolbarItems(\r\n mode: ViewRegistryMode,\r\n uilang: UILanguage,\r\n canEditBody: boolean,\r\n canEditObject: boolean,\r\n isRoot: boolean,\r\n isHidden: boolean,\r\n ): ToolbarItem[] {\r\n\r\n const $ = localized(uilang);\r\n\r\n const canRemove = !isRoot && canEditObject;\r\n\r\n let tbitems = Common.composeToolbarItems(\r\n Common.makeInactive(Common.getNewParagraphElementToolbarItems(uilang, true, false), !canEditBody),\r\n //canRemove ? (isHidden ?\r\n // Common.getShowToolbarItems(uilang, $('edit_tb_show_content')) :\r\n // Common.getHideToolbarItems(uilang, $('edit_tb_hide_content'))\r\n //) : [],\r\n );\r\n\r\n return tbitems;\r\n }\r\n\r\n static getContentParagraphToolbarItems(\r\n mode: ViewRegistryMode,\r\n uilang: UILanguage,\r\n styles: Model.StyleVM[],\r\n parKey: string,\r\n hasSelection: boolean,\r\n canEditBody: boolean,\r\n canEditObject: boolean,\r\n isHidden: boolean,\r\n isLinkedContent: boolean\r\n ): ToolbarItem[] {\r\n\r\n const canAddInline = parKey != Model.ReservedParagraphKeys.Title;\r\n const canRemove = canEditObject && parKey != Model.ReservedParagraphKeys.Title && isLinkedContent;\r\n\r\n const $ = localized(uilang);\r\n\r\n let tbitems = Common.composeToolbarItems(\r\n Common.makeInactive(Common.getStyleToolbarItems(uilang, styles), !canEditObject || !hasSelection), //TODO canEditBody (not if readonly) or canEditObject (even if readonly)\r\n Common.makeInactive(Common.getNewParagraphElementToolbarItems(uilang, true, canAddInline), !canEditBody),\r\n canRemove ? (isHidden ?\r\n Common.getShowToolbarItems(uilang) :\r\n Common.getHideToolbarItems(uilang)\r\n ) : [],\r\n );\r\n\r\n return tbitems;\r\n }\r\n\r\n handleEditorChanged(newEditorState: Draft.EditorState) {\r\n const toolbarTarget = this.props.toolbarTarget;\r\n if (!toolbarTarget)\r\n return;\r\n\r\n switch (toolbarTarget.type) {\r\n case 'COMMENT_EDITOR_TARGET':\r\n this.props.onCommentDraftChanged(toolbarTarget.label, toolbarTarget.draftLanguage, newEditorState);\r\n break;\r\n case 'ANNOTATION_EDITOR_TARGET':\r\n this.props.onAnnotationDraftChanged(toolbarTarget.label, toolbarTarget.id, toolbarTarget.draftLanguage, newEditorState);\r\n break;\r\n case 'NOTE_EDITOR_TARGET':\r\n this.props.onNoteDraftChanged(toolbarTarget.label, toolbarTarget.id, toolbarTarget.draftLanguage, newEditorState);\r\n break;\r\n default:\r\n }\r\n }\r\n\r\n handleAddLanguage(language: Model.Language) {\r\n const toolbarTarget = this.props.toolbarTarget;\r\n if (!toolbarTarget)\r\n return;\r\n\r\n switch (toolbarTarget.type) {\r\n case 'COMMENT_EDITOR_TARGET':\r\n this.props.addCommentLanguage(toolbarTarget.label, language);\r\n break;\r\n case 'ANNOTATION_EDITOR_TARGET':\r\n this.props.addAnnotationLanguage(toolbarTarget.label, toolbarTarget.id, language);\r\n break;\r\n case 'NOTE_EDITOR_TARGET':\r\n this.props.addNoteLanguage(toolbarTarget.label, toolbarTarget.id, language);\r\n break;\r\n default:\r\n }\r\n }\r\n\r\n handleToolbarClick(evt: React.MouseEvent) {\r\n evt.preventDefault();\r\n }\r\n\r\n handleToolbarItemClick(evt: React.MouseEvent, tbitem: ToolbarItem) {\r\n evt.preventDefault();\r\n\r\n if (!tbitem.command)\r\n return;\r\n\r\n if (this.handleEditorCommand(tbitem.command, tbitem.commandArgs) == 'handled')\r\n return;\r\n if (this.handleCommentCommand(tbitem.command, tbitem.commandArgs) == 'handled')\r\n return;\r\n if (this.handleAnnotationCommand(tbitem.command, tbitem.commandArgs) == 'handled')\r\n return;\r\n if (this.handleNoteCommand(tbitem.command, tbitem.commandArgs) == 'handled')\r\n return;\r\n if (this.handleContentCommand(tbitem.command, tbitem.commandArgs) == 'handled')\r\n return;\r\n // ...\r\n }\r\n\r\n handleEditorCommand(command: string, commandArgs: any): handled {\r\n\r\n if (!this.props.toolbarTarget)\r\n return 'not-handled';\r\n\r\n if (this.props.toolbarTarget.type != 'COMMENT_EDITOR_TARGET' &&\r\n this.props.toolbarTarget.type != 'ANNOTATION_EDITOR_TARGET' &&\r\n this.props.toolbarTarget.type != 'NOTE_EDITOR_TARGET')\r\n return 'not-handled';\r\n\r\n const editorState = this.props.editorState!;\r\n\r\n switch (command) {\r\n case Common.Commands.MakeContentLink: {\r\n const { selection, text } = DraftJSUtils.getTrimmedSelection(editorState);\r\n if (!selection || selection.isCollapsed())\r\n return \"handled\";\r\n\r\n const dto: Model.SearchGetCitationDto = {\r\n productId: this.props.viewOptions.productId,\r\n input: text,\r\n exact: true,\r\n take: 5,\r\n languages: this.props.viewOptions.languages,\r\n includeExpired: this.props.viewOptions.includeExpiredContentInSearch\r\n };\r\n\r\n WebApi.resolveCitation(dto).then(result => {\r\n let ref = this.refs[Common.makeContentLinkItem];\r\n if (!ref)\r\n return;\r\n\r\n let element = ReactDOM.findDOMNode(ref) as HTMLElement;\r\n if (!element)\r\n return;\r\n\r\n this.setState({\r\n contentLinkMenu: { anchorEl: element, results: result.models, selection }\r\n });\r\n });\r\n\r\n return \"handled\";\r\n }\r\n\r\n case Common.Commands.SetStyle:\r\n this.handleEditorChanged(this.setStyle(editorState, commandArgs.styleId));\r\n return \"handled\";\r\n case Common.Commands.EraseStyle:\r\n this.handleEditorChanged(this.eraseStyle(editorState));\r\n return \"handled\";\r\n\r\n case Common.Commands.MakeOrderedList:\r\n this.handleEditorChanged(Draft.RichUtils.toggleBlockType(editorState, \"ordered-list-item\"));\r\n return \"handled\";\r\n case Common.Commands.MakeUnorderedList:\r\n this.handleEditorChanged(Draft.RichUtils.toggleBlockType(editorState, \"unordered-list-item\"));\r\n return \"handled\";\r\n case Common.Commands.IncList:\r\n this.handleEditorChanged(DraftJSUtils.adjustBlockDepth(editorState, 1, 4));\r\n return \"handled\";\r\n case Common.Commands.DecList:\r\n this.handleEditorChanged(DraftJSUtils.adjustBlockDepth(editorState, -1, 4));\r\n return \"handled\";\r\n\r\n case Common.Commands.AddLanguage: {\r\n this.handleAddLanguage(this.props.viewOptions.editLanguage);\r\n return \"handled\";\r\n }\r\n\r\n default:\r\n return \"not-handled\";\r\n }\r\n }\r\n\r\n handleCommentCommand(command: string, commandArgs: any): handled {\r\n\r\n if (!this.props.toolbarTarget)\r\n return 'not-handled';\r\n\r\n if (this.props.toolbarTarget.type != 'COMMENT_EDITOR_TARGET')\r\n return 'not-handled';\r\n\r\n const comment = this.props.comment!;\r\n\r\n const editScopeId = this.props.viewOptions.editScopeId;\r\n const editLanguage = this.props.viewOptions.editLanguage;\r\n if (!editScopeId || editLanguage === undefined)\r\n return \"handled\";\r\n\r\n switch (command) {\r\n\r\n\r\n //case Common.Commands.Hide: // hide a comment from a higher scope in the (active) edit scope (i.e. mark linked content item as opt-out)\r\n\r\n // // TODO\r\n // if (confirm(\"Comment will be hidden from this view but not deleted. Are you sure?\")) {\r\n // //this.props.deleteComment(this.props.toolbarTarget.label, true);\r\n // }\r\n // return \"handled\";\r\n\r\n //case Common.Commands.Show: // show a comment from a higher scope in the (active) edit scope (i.e. remove opt-out mark from linked content item)\r\n // // TODO\r\n // //this.props.deleteComment(this.props.toolbarTarget.label, true);\r\n // return \"handled\";\r\n\r\n //case Common.Commands.Remove: // remove a comment from the (active) edit scope (i.e. delete linked content item)\r\n // // TODO\r\n // if (confirm(\"Comment will be removed from this view but not deleted. Are you sure?\")) {\r\n // //this.props.deleteComment(this.props.toolbarTarget.label, true);\r\n // }\r\n // return \"handled\";\r\n\r\n //case Common.Commands.Delete: // delete the comment itself (i.e. delete the comment document from the database)\r\n // // TODO\r\n // if (confirm(\"Comment will be deleted. Are you sure?\")) {\r\n // this.props.deleteComment(this.props.toolbarTarget.label, true);\r\n // }\r\n // return \"handled\";\r\n\r\n case Common.Commands.NewNote: {\r\n const target = this.props.toolbarTarget as CommentEditorTarget;\r\n this.props.addNoteToContentLike(editScopeId, editLanguage, target.label);\r\n return \"handled\";\r\n }\r\n\r\n default:\r\n return \"not-handled\";\r\n }\r\n }\r\n\r\n handleAnnotationCommand(command: string, commandArgs: any): handled {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n\r\n if (!this.props.toolbarTarget)\r\n return 'not-handled';\r\n\r\n if (this.props.toolbarTarget.type != 'ANNOTATION_EDITOR_TARGET')\r\n return 'not-handled';\r\n\r\n const annotation = this.props.annotation!;\r\n\r\n const editScopeId = this.props.viewOptions.editScopeId;\r\n const editLanguage = this.props.viewOptions.editLanguage;\r\n if (!editScopeId || editLanguage === undefined)\r\n return \"handled\";\r\n\r\n switch (command) {\r\n\r\n case Common.Commands.Hide:\r\n if (confirm($('edit_menu_confirm_annotation_hide'))) {\r\n if (annotation.scopeId == editScopeId) {\r\n console.error(\"cannot hide annotation: annotation.scopeId == editScopeId\");\r\n return \"handled\";\r\n }\r\n this.props.hideAnnotation(editScopeId, this.props.toolbarTarget.label, this.props.toolbarTarget.id);\r\n }\r\n return \"handled\";\r\n\r\n case Common.Commands.Show:\r\n if (annotation.scopeId == editScopeId) {\r\n console.error(\"cannot show annotation: annotation.scopeId == editScopeId\");\r\n return \"handled\";\r\n }\r\n this.props.showAnnotation(editScopeId, this.props.toolbarTarget.label, this.props.toolbarTarget.id);\r\n return \"handled\";\r\n\r\n case Common.Commands.Delete:\r\n if (confirm($('edit_menu_confirm_annotation_delete'))) {\r\n if (annotation.scopeId != editScopeId) {\r\n console.error(\"cannot delete annotation: annotation.scopeId != editScopeId\");\r\n return \"handled\";\r\n }\r\n this.props.deleteAnnotation(this.props.toolbarTarget.label, this.props.toolbarTarget.id);\r\n }\r\n return \"handled\";\r\n\r\n case Common.Commands.MoveLeft: {\r\n const target = this.props.toolbarTarget as AnnotationEditorTarget;\r\n this.props.moveAnnotation(target.label, target.id, target.anchorLanguage, -1);\r\n return 'handled';\r\n }\r\n\r\n case Common.Commands.MoveRight: {\r\n const target = this.props.toolbarTarget as AnnotationEditorTarget;\r\n this.props.moveAnnotation(target.label, target.id, target.anchorLanguage, +1);\r\n return 'handled';\r\n }\r\n\r\n case Common.Commands.NewNote: {\r\n this.props.addNoteToAnnotation(editScopeId, editLanguage, annotation.label, annotation.id);\r\n return 'handled';\r\n }\r\n\r\n default:\r\n return \"not-handled\";\r\n }\r\n }\r\n\r\n handleNoteCommand(command: string, commandArgs: any): handled {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n\r\n if (!this.props.toolbarTarget)\r\n return 'not-handled';\r\n\r\n if (this.props.toolbarTarget.type != 'NOTE_EDITOR_TARGET')\r\n return 'not-handled';\r\n\r\n const note = this.props.note!;\r\n\r\n const editScopeId = this.props.viewOptions.editScopeId;\r\n if (!editScopeId)\r\n return \"handled\";\r\n\r\n switch (command) {\r\n\r\n case Common.Commands.Hide:\r\n if (confirm($('edit_menu_confirm_note_hide'))) {\r\n if (note.scopeId == editScopeId) {\r\n console.error(\"cannot hide note: annotation.scopeId == editScopeId\");\r\n return \"handled\";\r\n }\r\n this.props.hideNote(editScopeId, this.props.toolbarTarget.label, this.props.toolbarTarget.id);\r\n }\r\n return \"handled\";\r\n\r\n case Common.Commands.Show:\r\n if (note.scopeId == editScopeId) {\r\n console.error(\"cannot show note: annotation.scopeId == editScopeId\");\r\n return \"handled\";\r\n }\r\n this.props.showNote(editScopeId, this.props.toolbarTarget.label, this.props.toolbarTarget.id);\r\n return \"handled\";\r\n\r\n case Common.Commands.Delete:\r\n if (confirm($('edit_menu_confirm_note_delete'))) {\r\n if (note.scopeId != editScopeId) {\r\n console.error(\"cannot delete note: annotation.scopeId != editScopeId\");\r\n return \"handled\";\r\n }\r\n this.props.deleteNote(this.props.toolbarTarget.label, this.props.toolbarTarget.id);\r\n }\r\n return \"handled\";\r\n\r\n default:\r\n return \"not-handled\";\r\n }\r\n }\r\n\r\n handleContentCommand(command: string, commandArgs: any): handled {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n\r\n if (!this.props.toolbarTarget)\r\n return 'not-handled';\r\n\r\n if (this.props.toolbarTarget.type != 'CONTENT_TOOLBAR_TARGET')\r\n return 'not-handled';\r\n\r\n const target = this.props.toolbarTarget as ContentToolbarTarget;\r\n const selection = this.props.toolbarSelection;\r\n const alignedSelection = this.props.toolbarAlignedSelection;\r\n\r\n const editScopeId = this.props.viewOptions.editScopeId;\r\n const editLanguage = this.props.viewOptions.editLanguage;\r\n if (!editScopeId || editLanguage === undefined)\r\n return \"handled\";\r\n\r\n\r\n switch (command) {\r\n\r\n case Common.Commands.SetStyle:\r\n if (alignedSelection)\r\n this.props.addMarker(editScopeId, target.label, target.language, target.parKey, alignedSelection, commandArgs.styleId as string);\r\n else if (selection)\r\n this.props.addMarker(editScopeId, target.label, target.language, target.parKey, selection, commandArgs.styleId as string);\r\n return \"handled\";\r\n\r\n case Common.Commands.EraseStyle:\r\n if (selection)\r\n this.props.deleteOrHideMarkers(editScopeId, target.label, target.language, target.parKey, selection);\r\n return \"handled\";\r\n\r\n case Common.Commands.NewAnnotation:\r\n this.props.addAnnotation(editScopeId, editLanguage, target.label, target.parKey, false);\r\n return \"handled\";\r\n\r\n case Common.Commands.NewInlineAnnotation:\r\n if (selection)\r\n this.props.addAnnotation(editScopeId, editLanguage, target.label, target.parKey, true, target.language, selection.end);\r\n return \"handled\";\r\n\r\n case Common.Commands.NewNote:\r\n this.props.addNoteToContentLike(editScopeId, editLanguage, target.label, target.parKey);\r\n return \"handled\";\r\n\r\n case Common.Commands.Hide:\r\n if (!this.props.linkedContentItem) // only paragraphs of linked content items can be shown / hidden\r\n return \"handled\";\r\n\r\n // distinguish between content paragraph and whole content (parKey == Model.ReservedParagraphKeys.Title)\r\n if (target.parKey != ReservedParagraphKeys.Title) {\r\n if (confirm($('edit_menu_confirm_paragraph_hide'))) {\r\n this.props.hideContentParagraph(editScopeId, this.props.linkedContentItem.id, target.parKey);\r\n }\r\n }\r\n else {\r\n // TODO remove/hide linked content item\r\n }\r\n return \"handled\";\r\n\r\n case Common.Commands.Show:\r\n if (!this.props.linkedContentItem) // only paragraphs of linked content items can be shown / hidden\r\n return \"handled\";\r\n\r\n // distinguish between content paragraph and whole content (parKey == Model.ReservedParagraphKeys.Title)\r\n if (target.parKey != ReservedParagraphKeys.Title) {\r\n this.props.showContentParagraph(editScopeId, this.props.linkedContentItem.id, target.parKey);\r\n }\r\n else {\r\n // TODO show linked content item\r\n }\r\n return \"handled\";\r\n\r\n default:\r\n return \"not-handled\";\r\n }\r\n }\r\n\r\n setStyle(editorState: Draft.EditorState, styleId: string) {\r\n let newEditorState = DraftJSUtils.removeAllInlineStyles(editorState);\r\n newEditorState = Draft.RichUtils.toggleInlineStyle(newEditorState, \"STYLE-\" + styleId.toUpperCase());\r\n return newEditorState;\r\n }\r\n\r\n eraseStyle(editorState: Draft.EditorState) {\r\n let newEditorState = DraftJSUtils.removeAllInlineStyles(editorState);\r\n return newEditorState;\r\n }\r\n}\r\n\r\n// Wire up the React component to the Redux store\r\nexport const ConnectedEditMenu = withStyles(getStyles)(\r\n connect(\r\n // Selects which state properties are merged into the component's props\r\n (state: ApplicationState, ownProps: { disabled?: boolean }) => {\r\n\r\n const viewRegistry = state.viewRegistry;\r\n const toolbarTarget = viewRegistry.toolbarTarget;\r\n const toolbarSelection = viewRegistry.toolbarSelection;\r\n const toolbarAlignedSelection = viewRegistry.toolbarAlignedSelection;\r\n const editorState = toolbarTarget ? getEditorState(toolbarTarget, viewRegistry) : undefined;\r\n\r\n const content = toolbarTarget && (toolbarTarget.type == 'CONTENT_TOOLBAR_TARGET' || toolbarTarget.type == 'NOTE_EDITOR_TARGET' || toolbarTarget.type == 'ANNOTATION_EDITOR_TARGET') ? viewRegistry.contents[toolbarTarget.label] as ContentItem : undefined;\r\n const annotation = toolbarTarget && toolbarTarget.type == 'ANNOTATION_EDITOR_TARGET' ? viewRegistry.contents[toolbarTarget.label].annotations[toolbarTarget.id] : undefined;\r\n const comment = toolbarTarget && toolbarTarget.type == 'COMMENT_EDITOR_TARGET' ? viewRegistry.contents[toolbarTarget.label] as CommentItem : undefined;\r\n\r\n const note = toolbarTarget && toolbarTarget.type == 'NOTE_EDITOR_TARGET' ? viewRegistry.contents[toolbarTarget.label].notes[toolbarTarget.id] : undefined;\r\n\r\n const linkedContentItemId = toolbarTarget && (toolbarTarget.type == 'CONTENT_TOOLBAR_TARGET' || toolbarTarget.type == 'COMMENT_EDITOR_TARGET') ?\r\n toolbarTarget.linkedContentItemId : null;\r\n\r\n let linkedContentItem: LinkedContentItem | undefined;\r\n if (linkedContentItemId) {\r\n linkedContentItem = findLinkedContentItem(viewRegistry.linkedContentRoot, linkedContentItemId) || undefined;\r\n }\r\n\r\n return {\r\n toolbarTarget,\r\n toolbarSelection,\r\n toolbarAlignedSelection,\r\n\r\n editorState,\r\n\r\n comment,\r\n content,\r\n annotation,\r\n note,\r\n linkedContentItem,\r\n\r\n mode: state.viewRegistry.mode,\r\n viewOptions: state.userProfile.viewOptions,\r\n styles: state.userProfile.preferences && state.userProfile.preferences.styles || [],\r\n };\r\n },\r\n // Selects which action creators are merged into the component's props\r\n dispatch => bindActionCreators({ ...ViewRegistryStore.actionCreators, ...UserProfileStore.actionCreators }, dispatch)\r\n )(EditMenu)\r\n);\r\n\r\nfunction getEditorState(toolbarTarget: ToolbarTarget, state: ViewRegistryStore.ViewRegistryState) {\r\n try {\r\n switch (toolbarTarget.type) {\r\n case 'COMMENT_EDITOR_TARGET': {\r\n const comment = state.contents[toolbarTarget.label];\r\n if (comment.type != 'Comment')\r\n throw new TypeError();\r\n return comment.draftState[toolbarTarget.draftLanguage].editor;\r\n }\r\n case 'ANNOTATION_EDITOR_TARGET':\r\n return state\r\n .contents[toolbarTarget.label]\r\n .annotations[toolbarTarget.id]\r\n .draftState[toolbarTarget.draftLanguage]\r\n .editor;\r\n case 'NOTE_EDITOR_TARGET':\r\n return state\r\n .contents[toolbarTarget.label]\r\n .notes[toolbarTarget.id]\r\n .draftState[toolbarTarget.draftLanguage]\r\n .editor;\r\n\r\n default:\r\n return undefined;\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n return undefined;\r\n }\r\n}","//RESSOURCE content_outline\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../debug';\r\nimport * as WebApi from '../../webapi';\r\nimport * as _ from 'lodash';\r\n\r\n// ressources\r\nimport { localized } from \"../../ressources\";\r\nimport { styles } from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\n// component dependencies\r\nimport { Button } from '@material-ui/core';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\";\r\n\r\ntype GotoProps =\r\n {\r\n userProfile: UserProfileStore.UserProfileState\r\n }\r\n & StyledComponentProps;\r\n\r\ninterface GotoState {\r\n}\r\n\r\nexport class _Goto extends React.Component {\r\n\r\n constructor(props: GotoProps) {\r\n super(props);\r\n\r\n this.state = {\r\n };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n const { uiLanguage, productId } = this.props.userProfile.viewOptions;\r\n const classes = this.props.classes || {};\r\n\r\n return (\r\n
{productId}
\r\n );\r\n }\r\n}\r\n\r\nexport const Goto = connect(\r\n (state: ApplicationState) => ({\r\n userProfile: state.userProfile,\r\n })\r\n)(_Goto);\r\n\r\n","//RESSOURCE appbar\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as _ from 'lodash';\r\nimport * as Logging from '../../debug';\r\n\r\nimport { ClientConfig } from '../../config';\r\nconst clientConfig = (window as any).clientConfig as ClientConfig;\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\n\r\n// navigation dependencies\r\nimport * as Nav from '../../navigation';\r\nimport { HardLinks } from '../../hardlinks';\r\n\r\n// component dependencies\r\nimport {\r\n AppBar, Toolbar, Tabs, Tab, Typography, Button, IconButton, Icons,\r\n Menu, MenuItem, Checkbox, Switch, FormControlLabel\r\n} from '../../libs/material-ui';\r\nimport { ConnectedEditMenu } from './editmenu/EditMenu';\r\nimport { Goto } from '../search/Goto';\r\n\r\n// model dependencies\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\nimport * as Utils from '../../viewmodels/utils';\r\nimport { UserRoleVM } from '../../viewmodels/EPCDataModel';\r\nimport { bindActionCreators } from 'redux';\r\n\r\nimport { default as brandLogoImage_epc } from '../../assets/EPC_Logo_for_dark_bg_path.svg';\r\nimport { default as brandLogoImage_pct } from '../../assets/PCT_Logo_for_dark_bg_path.svg';\r\n\r\nconst _anchorOrigin = undefined;\r\n\r\nconst getStyles = (theme: Theme) => ({\r\n root: {\r\n flexGrow: 1,\r\n },\r\n mainToolbar: {\r\n backgroundColor: theme.palette.primary.dark,\r\n },\r\n subToolbar: {\r\n backgroundColor: theme.palette.primary.main,\r\n },\r\n brandLogo: {\r\n width: 100,\r\n height: 28,\r\n },\r\n brandLogoSmall: {\r\n width: 100 * 0.66,\r\n height: 28 * 0.66,\r\n },\r\n flex: {\r\n flexGrow: 1,\r\n },\r\n menuButton: {\r\n color: theme.palette.primary.contrastText,\r\n textTransform: 'none'\r\n } as any,\r\n menuButtonInactive: {\r\n opacity: 0.7, // where to find in theme?\r\n },\r\n tabStyle: {\r\n fontSize: 15,\r\n }\r\n});\r\n\r\ntype MainAppBarProps =\r\n typeof UserProfileStore.actionCreators\r\n & RouteComponentProps<{}>\r\n & StyledComponentProps\r\n & {\r\n userProfile: UserProfileStore.UserProfileState\r\n };\r\n\r\ninterface MainAppBarState {\r\n activeTab: \"nav\" | \"edit\" | \"pdf\" | \"admin\",\r\n activeMenu: \"none\" | \"notification\" | \"account\" | \"settings\",\r\n menuAnchorEl: HTMLElement | null\r\n};\r\n\r\nclass MainAppBar extends React.Component {\r\n\r\n constructor(props: MainAppBarProps) {\r\n super(props);\r\n\r\n this.state = {\r\n activeTab: \"edit\",\r\n activeMenu: \"none\",\r\n menuAnchorEl: null\r\n };\r\n }\r\n\r\n private isSignedIn() { return this.props.userProfile.loaderState.isLoaded; }\r\n\r\n public render() {\r\n const classes = this.props.classes || {};\r\n const uilang = this.props.userProfile.viewOptions.uiLanguage;\r\n const $ = localized(uilang);\r\n const { productId } = this.props.userProfile.viewOptions;\r\n\r\n const isAdmin = _.find(this.props.userProfile.roles, (role: Model.UserRoleVM) =>\r\n role.typeOfUserRole == Model.TypeOfUserRole.Global &&\r\n role.globalRole == Model.UserGlobalRole.Admin\r\n );\r\n\r\n const canEnterUpdateMode = this.props.userProfile.canEnterUpdateMode;\r\n const updateMode = this.props.userProfile.viewOptions.updateMode;\r\n\r\n const productIds = UserProfileStore.getReadableProducts(this.props.userProfile.roles);\r\n\r\n const anyEPCAccess = _.includes(productIds, \"epc\");//this.props.userProfile.roles.filter;\r\n const anyPCTAccess = _.includes(productIds, \"pct\");//this.props.userProfile.licenses.filter(l => Utils.isLicenseValid(l) && Utils.hasLicenseProduct(l, 'pct')).length > 0;\r\n\r\n return (\r\n \r\n \r\n \r\n\r\n this.setState({ activeTab: value })}\r\n >\r\n {$('nav_navigation')}} value=\"nav\" />\r\n {$('nav_edit')}} value=\"edit\" />\r\n {$('nav_pdf_generation')}} value=\"pdf\" />\r\n {isAdmin &&\r\n {$('nav_admin')}} value=\"admin\" />\r\n }\r\n \r\n\r\n
\r\n\r\n\r\n {productId === 'pct' && anyEPCAccess && (\r\n \r\n )}\r\n {productId === 'epc' && anyPCTAccess && (\r\n \r\n )}\r\n\r\n {\r\n // open in new window\r\n window.open(uilang == 'DE' ? HardLinks.www_FAQ_de : HardLinks.www_FAQ_en, '_blank');\r\n }}>\r\n \r\n \r\n\r\n {this.isSignedIn() ? (\r\n \r\n {/* notifications}\r\n \r\n this.setState({ activeMenu: 'notification', menuAnchorEl: evt.currentTarget })}\r\n >\r\n \r\n \r\n this.handleClose()}\r\n >\r\n this.handleClose()}>XXX\r\n this.handleClose()}>YYY\r\n this.handleClose()}>ZZZ\r\n \r\n */}\r\n\r\n {canEnterUpdateMode &&\r\n this.toggleUpdateMode()} />}\r\n label={Update Mode} />\r\n }\r\n\r\n {/* user profile */}\r\n \r\n\r\n window.location.assign(Nav.getShopPageUrl())/*this.props.history.push(Nav.getShopPageUrl())*/}>\r\n \r\n \r\n\r\n {/* settings */}\r\n {this.renderSettingsDropDown(classes)}\r\n\r\n {/* account */}\r\n {this.renderAccountDropDown(classes)}\r\n \r\n ) : (\r\n \r\n )}\r\n
\r\n\r\n
\r\n {this.renderSubToolbar()}\r\n
\r\n
\r\n );\r\n }\r\n\r\n toggleUpdateMode() {\r\n const updateMode = this.props.userProfile.viewOptions.updateMode;\r\n this.props.setUpdateMode(!updateMode);\r\n }\r\n\r\n switchProducts(newProductId: string) {\r\n this.props.history.push(Nav.getProductPageUrl(newProductId));\r\n }\r\n\r\n private renderAccountDropDown(classes: Partial>) {\r\n const uiLanguage = this.props.userProfile.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n return \r\n this.setState({ activeMenu: 'account', menuAnchorEl: evt.currentTarget })}>\r\n \r\n \r\n this.handleClose()}>\r\n {this.props.userProfile.displayName}\r\n\r\n this.handleLogout()}>{$('appbar_logout')}\r\n \r\n ; // this.handleProfile()}>{$('appbar_profile')}\r\n }\r\n\r\n private renderSettingsDropDown(classes: Partial>) {\r\n const uiLanguage = this.props.userProfile.viewOptions.uiLanguage;\r\n const contentLanguage = this.props.userProfile.viewOptions.contentLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n let contentLanguages = this.props.userProfile.roles\r\n .filter(role => role.typeOfUserRole == Model.TypeOfUserRole.Product)\r\n .map(role => role.productLanguage!);\r\n\r\n contentLanguages = _.uniq(contentLanguages);\r\n if (_.includes(contentLanguages, Model.Language.Any))\r\n contentLanguages = [Model.Language.EN, Model.Language.DE];\r\n\r\n return \r\n this.setState({ activeMenu: 'settings', menuAnchorEl: evt.currentTarget })}>\r\n \r\n \r\n this.handleClose()}>\r\n {\r\n /* TODO use RadioGroup or Select\r\n {$('appbar_ui_language')}:\r\n { this.props.setUILanguage('EN'); this.handleClose(); }}>{$('appbar_en')}\r\n { this.props.setUILanguage('DE'); this.handleClose(); }}>{$('appbar_de')}\r\n */}\r\n\r\n { {\r\n this.props.history.push('/settings/styles');\r\n this.handleClose();\r\n }}>{$('appbar_settings_styles')}}\r\n\r\n {$('appbar_content_language')}:\r\n {\r\n contentLanguages.map(lang => (\r\n {\r\n this.props.setContentLanguage(lang);\r\n this.props.setUILanguage(Model.Language[lang] as UILanguage);\r\n this.handleClose();\r\n }}>\r\n \r\n {Model.Language[lang]}\r\n \r\n ))\r\n }\r\n {/* { this.props.setContentLanguage(Model.Language.EN); this.handleClose(); }}>\r\n {$('appbar_en')}\r\n \r\n { this.props.setContentLanguage(Model.Language.DE); this.handleClose(); }}>\r\n {$('appbar_de')}\r\n */}\r\n \r\n ;\r\n }\r\n\r\n private handleLogout() {\r\n window.sessionStorage.clear();\r\n //window.close();\r\n //window.location.reload(true);\r\n window.location.assign(\"AzureADB2C/Account/SignOut\");\r\n\r\n this.handleClose();\r\n }\r\n\r\n private handleProfile() {\r\n window.location.assign(Nav.getProfilePageUrl());\r\n //this.props.history.push(Nav.getProfilePageUrl());\r\n this.handleClose();\r\n }\r\n\r\n private handleClose(): void {\r\n return this.setState({ activeMenu: 'none', menuAnchorEl: null });\r\n }\r\n\r\n renderSubToolbar() {\r\n\r\n switch (this.state.activeTab) {\r\n case \"nav\": return this.renderNavToolbar();\r\n case \"edit\": return this.renderEditToolbar();\r\n case \"pdf\": return this.renderPdfToolbar();\r\n case \"admin\": return this.renderAdminToolbar();\r\n default: const exhaustiveCheck: never = this.state.activeTab;\r\n }\r\n return false;\r\n }\r\n\r\n renderNavToolbar() {\r\n const classes = this.props.classes || {};\r\n const { history } = this.props;\r\n\r\n const path = window.location.pathname;\r\n const { productId } = this.props.userProfile.viewOptions;\r\n\r\n // see routes.tsx\r\n const isTableOfContents = path.toLocaleLowerCase() == `/toc`;\r\n const isNotes = path.toLocaleLowerCase() == `/notes`;\r\n const isLookUp = path.toLocaleLowerCase() == `/lookup`;\r\n\r\n const uilang = this.props.userProfile.viewOptions.uiLanguage;\r\n const $ = localized(uilang);\r\n\r\n const disabled = !this.isSignedIn();\r\n\r\n const is_pct = productId.toLowerCase() == \"pct\";\r\n\r\n return (\r\n
\r\n { evt.preventDefault(); }}>\r\n\r\n \r\n\r\n {\r\n \r\n }\r\n\r\n \r\n\r\n \r\n\r\n {false && clientConfig.enablePreviewFeatures && }\r\n\r\n \r\n
\r\n );\r\n }\r\n\r\n renderEditToolbar() {\r\n const { history } = this.props;\r\n const uilang = this.props.userProfile.viewOptions.uiLanguage;\r\n const $ = localized(uilang);\r\n const pathname = this.props.location.pathname.toLowerCase();\r\n const disabled = !this.isSignedIn() || !pathname.startsWith(\"/content/\");\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n renderPdfToolbar() {\r\n const classes = this.props.classes || {};\r\n const { history } = this.props;\r\n const path = window.location.pathname;\r\n const uilang = this.props.userProfile.viewOptions.uiLanguage;\r\n const $ = localized(uilang);\r\n const { productId } = this.props.userProfile.viewOptions;\r\n\r\n // see routes.tsx\r\n const isPdfJobs = path.toLocaleLowerCase() == `/pdf`;\r\n\r\n const canDownloadPdf = _.find(this.props.userProfile.roles,\r\n (role: UserRoleVM) =>\r\n role.typeOfUserRole == Model.TypeOfUserRole.Product &&\r\n (role.productRole == Model.UserProductRole.DownloadPdf || role.productRole == Model.UserProductRole.Owner) &&\r\n role.productId === productId\r\n );\r\n\r\n const disabled = !this.isSignedIn() || !canDownloadPdf;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n renderAdminToolbar() {\r\n const { history } = this.props;\r\n const uilang = this.props.userProfile.viewOptions.uiLanguage;\r\n const $ = localized(uilang);\r\n\r\n const isAdmin = _.find(this.props.userProfile.roles, (role: Model.UserRoleVM) =>\r\n role.typeOfUserRole == Model.TypeOfUserRole.Global &&\r\n role.globalRole == Model.UserGlobalRole.Admin\r\n );\r\n\r\n const disabled = !this.isSignedIn() || !isAdmin;\r\n\r\n return disabled ? false : (\r\n \r\n renderAdminToolbar\r\n \r\n );\r\n }\r\n}\r\n\r\nconst BrandLogo = (props: { uiLanguage: UILanguage, className?: string, productId: string }) => {\r\n const $ = localized(props.uiLanguage);\r\n if (props.productId == \"pct\")\r\n return ;\r\n else\r\n return ;\r\n};\r\n\r\nexport const ConnectedMainAppBar = withStyles(getStyles)(\r\n connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n userProfile: state.userProfile,\r\n }),\r\n dispatch => bindActionCreators(UserProfileStore.actionCreators, dispatch)\r\n )(MainAppBar)\r\n);","import * as React from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\n\r\n// component dependencies\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Paper, Button, Checkbox, FormControlLabel, Typography, Toolbar } from '../../libs/material-ui';\r\nimport { Icons } from '../../libs/material-ui';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\nimport * as MyTheme from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as NotesStore from '../../store/Notes';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\n// navigation dependencies\r\nimport * as Nav from '../../navigation';\r\n\r\n// data model dependencies\r\nimport { TodoVM, StyleVM, TypeOfStickyNote } from \"../../viewmodels/EPCDataModel\";\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\n\r\nconst getStyles = (theme: Theme) => ({\r\n toolbar: {\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n menuText: {\r\n color: theme.palette.primary.contrastText,\r\n textTransform: 'none',\r\n marginLeft: \"8px\",\r\n marginRight: \"8px\"\r\n } as any,\r\n menuButton: {\r\n color: theme.palette.primary.contrastText,\r\n textTransform: 'none'\r\n } as any,\r\n menuButtonInactive: {\r\n opacity: 0.7, // where to find in theme?\r\n }\r\n});\r\n\r\ntype NotesToolbarProps =\r\n {\r\n notes: NotesStore.NotesState,\r\n viewOptions: UserProfileStore.ViewOptions,\r\n styles: StyleVM[],\r\n }\r\n & typeof NotesStore.actionCreators\r\n & typeof UserProfileStore.actionCreators\r\n & StyledComponentProps\r\n & RouteComponentProps<{}>;\r\n\r\nexport class NotesToolbar extends React.Component {\r\n constructor(props: NotesToolbarProps) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n const displayHidden = this.props.viewOptions.displayHidden;\r\n\r\n const classes = this.props.classes || {};\r\n\r\n if (!this.props.notes.toolbarVisible) {\r\n return false;\r\n }\r\n else if (!LoaderStateUtil.isLoaded(this.props.notes.loaderState)) {\r\n return LoaderStateUtil.renderDefault(this.props.notes.loaderState);\r\n }\r\n else {\r\n const currentNote = this.props.notes.currentIndex !== null && this.props.notes.todos ?\r\n this.props.notes.todos[this.props.notes.currentIndex] :\r\n null;\r\n\r\n const i_of_n = this.props.notes.currentIndex !== null && this.props.notes.todos ?\r\n `${this.props.notes.currentIndex + 1}/${this.props.notes.todos.length}` :\r\n null;\r\n\r\n return (\r\n
\r\n \r\n {$('notes_toolbar_title')}\r\n {this.props.notes.todos && this.props.notes.todos.length > 0 && (\r\n \r\n \r\n {currentNote &&\r\n \r\n }\r\n \r\n {/* this.handleUpdatesOnly(value)} />}\r\n label={$('checkout_review_confirm_terms')}\r\n />*/}\r\n\r\n \r\n )}\r\n\r\n this.toggleDisplayHidden()}>\r\n {$('sub_bar_show_hidden_elements')}\r\n \r\n\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n }\r\n\r\n toggleDisplayHidden() {\r\n const displayHidden = this.props.viewOptions.displayHidden;\r\n this.props.setDisplayHidden(!displayHidden);\r\n this.handleRefresh();\r\n }\r\n\r\n handleClose() {\r\n this.props.closeNotes();\r\n }\r\n\r\n handleRefresh() {\r\n const { viewOptions } = this.props;\r\n const { productId } = viewOptions;\r\n this.props.listNotes(productId, viewOptions.readerScopeIds, true);\r\n }\r\n\r\n handlePrev() {\r\n if (this.props.notes!.currentIndex === null)\r\n this.props.setNotesIndex(-1, index => this.handleIndexSet(index));\r\n else\r\n this.props.setNotesIndex(this.props.notes!.currentIndex - 1, index => this.handleIndexSet(index));\r\n }\r\n\r\n handleNext() {\r\n if (this.props.notes!.currentIndex === null)\r\n this.props.setNotesIndex(0, index => this.handleIndexSet(index));\r\n else\r\n this.props.setNotesIndex(this.props.notes!.currentIndex + 1, index => this.handleIndexSet(index));\r\n }\r\n\r\n handleIndexSet(index: null | number) {\r\n if (index !== null && this.props.notes.todos) {\r\n const label = this.props.notes.todos[index].label;\r\n const parKey = this.props.notes.todos[index].paragraphKey;\r\n this.navigateToContent(label, parKey);\r\n }\r\n }\r\n\r\n handleCurrent(label: string, parKey: string | undefined) {\r\n this.navigateToContent(label, parKey);\r\n }\r\n\r\n navigateToContent(label: string, parKey:string | undefined) {\r\n const { history } = this.props;\r\n\r\n history.push(Nav.getContentRedirectPageUrl(label, parKey));\r\n }\r\n}\r\n\r\nexport const ConnectedNotesToolbar = withStyles(getStyles)(connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n notes: state.notes,\r\n viewOptions: state.userProfile.viewOptions,\r\n styles: state.userProfile.preferences!.styles!,\r\n }),\r\n dispatch => ({\r\n ...bindActionCreators(NotesStore.actionCreators, dispatch),\r\n ...bindActionCreators(UserProfileStore.actionCreators, dispatch)\r\n })\r\n)(NotesToolbar));","import * as React from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { ApplicationState } from '../../store';\r\nimport * as BrowserStore from '../../store/Browser';\r\n\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Paper } from '../../libs/material-ui';\r\n\r\nimport { ClientConfig } from '../../config';\r\nconst clientConfig = (window as any).clientConfig as ClientConfig;\r\n\r\nconst getStyles = (theme: Theme) => ({\r\n root: {\r\n color: theme.palette.secondary.contrastText,\r\n background: theme.palette.secondary.dark\r\n }\r\n});\r\n\r\ntype FooterProps = {\r\n browser: BrowserStore.BrowserState\r\n}\r\n & RouteComponentProps<{}>\r\n & StyledComponentProps;\r\n\r\nclass Footer extends React.Component {\r\n constructor(props: FooterProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n const year = new Date(Date.now()).getFullYear();\r\n const classes = this.props.classes || {};\r\n return this.props.browser.isMobile ?\r\n false : (\r\n \r\n © IP.appify GmbH 2018-{year}\r\n {clientConfig.enablePreviewFeatures && PREVIEW}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const ConnectedFooter = withStyles(getStyles)(connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n /*account: state.account, */browser: state.browser\r\n }),\r\n)(Footer));\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { bindActionCreators } from 'redux';\r\nimport { RouteComponentProps, Redirect } from 'react-router-dom';\r\nimport * as Debug from '../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as Nav from \"../../navigation\";\r\n\r\n// localized ressources\r\nimport { localized } from \"../../ressources\"\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\";\r\nimport * as WebApi from \"../../webapi\";\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\n\r\nconst linktarget = \"_self\";\r\ntype ProductRedirectPageProps = RouteComponentProps<{}>\r\n & { viewOptions: UserProfileStore.ViewOptions }\r\n & typeof UserProfileStore.actionCreators;\r\n\r\ninterface ProductRedirectPageState {\r\n parentLabel?: string,\r\n loaderState: LoaderState, \r\n};\r\n\r\nclass ProductRedirectPage extends React.Component {\r\n\r\n constructor(props: ProductRedirectPageProps) {\r\n super(props);\r\n this.state = { loaderState: LoaderStateUtil.getLoading() };\r\n }\r\n\r\n componentDidMount() {\r\n let { productId } = this.props.match.params as any;\r\n\r\n // catch incorrect paths\r\n if (this.props.match.path == '/content/epc')\r\n productId = 'epc';\r\n else if (this.props.match.path == '/content/pct')\r\n productId = 'pct';\r\n\r\n this.props.setProduct(productId);\r\n }\r\n\r\n render() {\r\n return ;\r\n }\r\n}\r\n\r\nexport const ConnectedProductRedirectPage = connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n viewOptions: state.userProfile.viewOptions,\r\n }),\r\n dispatch => bindActionCreators(UserProfileStore.actionCreators, dispatch)\r\n)(ProductRedirectPage);","import * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport * as H from 'history';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { styles } from '../../theme';\r\n\r\n// navigation dependencies\r\nimport * as Nav from '../../navigation';\r\n\r\n// component dependencies\r\nimport { Link } from 'react-router-dom';\r\nimport { Paper, Typography } from '../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport { TableOfContentVM, TableOfContentItemVM } from \"../../viewmodels/EPCDataModel\";\r\n\r\nconst getStyles = (theme: Theme) => ({\r\n ul: {\r\n paddingLeft: theme.spacing.unit * 1,\r\n },\r\n li: {\r\n marginTop: theme.spacing.unit * 1,\r\n marginBottom: theme.spacing.unit * 1,\r\n listStyleType: 'none'\r\n },\r\n a: {\r\n ...styles.link_noline,\r\n }\r\n});\r\n\r\ntype TableOfContentsProps =\r\n {\r\n toc: TableOfContentVM,\r\n label?: string,\r\n history: H.History,\r\n fullwidth?: boolean\r\n }\r\n & StyledComponentProps;\r\n\r\nclass _TableOfContents extends React.Component {\r\n\r\n constructor(props: TableOfContentsProps) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n const label = this.props.label;\r\n\r\n if (label) {\r\n if (this.refs.activeItem) {\r\n this.scrollIntoView(this.refs.activeItem, false);\r\n }\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: TableOfContentsProps, prevState: {}) {\r\n const label = this.props.label;\r\n const prevLabel = prevProps.label;\r\n\r\n if (label && label != prevLabel) {\r\n if (this.refs.activeItem) {\r\n this.scrollIntoView(this.refs.activeItem, true);\r\n }\r\n }\r\n }\r\n\r\n scrollIntoView(instance: React.ReactInstance, smooth: boolean) {\r\n let domNode = ReactDOM.findDOMNode(instance);\r\n if (domNode) {\r\n (domNode as Element).scrollIntoView({\r\n behavior: smooth ? 'smooth' : 'auto',\r\n block: 'center',\r\n inline: 'center'\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n return this.renderToc(this.props.toc);\r\n }\r\n\r\n renderToc(toc: TableOfContentVM) {\r\n return (\r\n \r\n {toc.name!.text}\r\n {this.renderItems(toc, toc.items, 0)}\r\n \r\n );\r\n }\r\n\r\n renderItems(toc: TableOfContentVM, items: TableOfContentItemVM[] | undefined, level: number): JSX.Element | boolean {\r\n const classes = this.props.classes || {};\r\n\r\n if (!items || items.length == 0)\r\n return false;\r\n\r\n return (\r\n
    \r\n {items.map(item => this.renderItem(toc, item, level + 1))}\r\n
\r\n );\r\n }\r\n\r\n renderItem(toc: TableOfContentVM, item: TableOfContentItemVM, level: number): JSX.Element {\r\n const classes = this.props.classes || {};\r\n\r\n const productId = this.props.toc.productId!;\r\n const label = this.props.label;\r\n const { history } = this.props;\r\n\r\n const isActive = label && label == item.targetContentLabel;\r\n\r\n return item.targetContentLabel && !isActive ? (\r\n
  • \r\n \r\n {item.name!.text}\r\n \r\n {this.renderItems(toc, item.childItems, level)}\r\n
  • \r\n ) : (\r\n
  • \r\n {item.name!.text}\r\n {this.renderItems(toc, item.childItems, level)}\r\n
  • \r\n );\r\n }\r\n}\r\n\r\nexport const TableOfContents = withStyles(getStyles)(_TableOfContents);","import * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as TableOfContentsStore from '../../store/TableOfContents';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\n// component dependencies\r\nimport { TableOfContents } from './TableOfContents';\r\n\r\n// data model dependencies\r\nimport { TableOfContentVM, TableOfContentItemVM } from \"../../viewmodels/EPCDataModel\";\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\n\r\nconst getStyles = (theme: Theme) => ({\r\n root: {\r\n backgroundColor: theme.palette.background.paper,\r\n },\r\n main: {\r\n padding: theme.spacing.unit * 2,\r\n },\r\n});\r\n\r\ntype TableOfContentsPageProps =\r\n {\r\n tableOfContents: TableOfContentsStore.TableOfContentsState,\r\n userProfile: UserProfileStore.UserProfileState,\r\n }\r\n & typeof TableOfContentsStore.actionCreators\r\n & StyledComponentProps\r\n & RouteComponentProps<{}>;\r\n\r\nclass TableOfContentsPage extends React.Component {\r\n\r\n constructor(props: TableOfContentsPageProps) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n const { productId } = this.props.userProfile.viewOptions;\r\n // the store takes care of loading \r\n this.props.requestToc(productId);\r\n }\r\n\r\n componentDidUpdate(prevProps: TableOfContentsPageProps, prevState: {}) {\r\n const { productId } = this.props.userProfile.viewOptions;\r\n // the store takes care of loading \r\n this.props.requestToc(productId);\r\n }\r\n\r\n render() {\r\n const classes = this.props.classes || {};\r\n\r\n if (!LoaderStateUtil.isLoaded(this.props.tableOfContents.loaderState)) {\r\n return LoaderStateUtil.renderDefault(this.props.tableOfContents.loaderState);\r\n }\r\n else {\r\n return (\r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n );\r\n }\r\n }\r\n}\r\n\r\nexport const ConnectedTableOfContentsPage = withStyles(getStyles)(connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n tableOfContents: state.tableOfContents,\r\n userProfile: state.userProfile\r\n }),\r\n dispatch => bindActionCreators(TableOfContentsStore.actionCreators, dispatch)\r\n)(TableOfContentsPage));","import * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as TableOfContentsStore from '../../store/TableOfContents';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as BrowserStore from '../../store/Browser';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\";\r\nimport { styles } from \"../../theme\";\r\n\r\n// component dependencies\r\nimport { Paper } from '../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport { TableOfContentVM, TableOfContentItemVM } from \"../../viewmodels/EPCDataModel\";\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\nimport { TableOfContents } from './TableOfContents';\r\n\r\ntype TableOfContentsSideBarProps =\r\n {\r\n tableOfContents: TableOfContentsStore.TableOfContentsState,\r\n userProfile: UserProfileStore.UserProfileState,\r\n browser: BrowserStore.BrowserState,\r\n }\r\n & typeof TableOfContentsStore.actionCreators\r\n & StyledComponentProps\r\n & RouteComponentProps<{}>;\r\n\r\nconst getStyles = (theme: Theme) => ({\r\n root: {\r\n ...styles.tocSidebar,\r\n padding: theme.spacing.unit * 1,\r\n },\r\n});\r\n\r\nclass TableOfContentsSideBar extends React.Component {\r\n\r\n constructor(props: TableOfContentsSideBarProps) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n const { productId } = this.props.userProfile.viewOptions;\r\n\r\n // the store takes care of loading \r\n this.props.requestToc(productId);\r\n }\r\n\r\n componentDidUpdate(prevProps: TableOfContentsSideBarProps, prevState: {}) {\r\n const { productId } = this.props.userProfile.viewOptions;\r\n\r\n // the store takes care of loading \r\n this.props.requestToc(productId);\r\n }\r\n\r\n render() {\r\n const classes = this.props.classes || {};\r\n const { label } = this.props.match.params as any;\r\n\r\n if (this.props.browser.isMobile) {\r\n return false;\r\n }\r\n else if (!LoaderStateUtil.isLoaded(this.props.tableOfContents.loaderState)) {\r\n return LoaderStateUtil.renderDefault(this.props.tableOfContents.loaderState);\r\n }\r\n else {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n}\r\n\r\nexport const ConnectedTableOfContentsSideBar = withStyles(getStyles)(connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n tableOfContents: state.tableOfContents,\r\n userProfile: state.userProfile,\r\n browser: state.browser\r\n }),\r\n dispatch => bindActionCreators(TableOfContentsStore.actionCreators, dispatch)\r\n)(TableOfContentsSideBar));","import * as React from 'react';\r\n\r\ninterface ErrorContainerProps {\r\n children: React.ReactChild,\r\n};\r\n\r\ninterface ErrorContainerState {\r\n hasError: boolean,\r\n error?: Error,\r\n errorInfo?: React.ErrorInfo\r\n};\r\n\r\nexport class ErrorContainer extends React.Component {\r\n\r\n constructor(props: ErrorContainerProps) {\r\n super(props);\r\n this.state = { hasError: false };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n this.setState({ hasError: true, error, errorInfo });\r\n }\r\n\r\n render() {\r\n return this.state.hasError ? (\r\n
    \r\n {this.state.error!.message}\r\n
    \r\n ) : (\r\n this.props.children\r\n );\r\n }\r\n}","import * as React from 'react';\r\n\r\n// localized ressources\r\nimport { styles } from \"../../theme\"\r\n\r\ninterface TwoColumnProps extends React.Props {\r\n off?: boolean\r\n}\r\n\r\nexport class TwoColumn extends React.Component {\r\n\r\n constructor(props: TwoColumnProps) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return (\r\n
    \r\n {this.props.children}\r\n
    \r\n );\r\n }\r\n}","import * as React from 'react';\r\n\r\n// localized ressources\r\nimport { styles } from \"../../theme\"\r\n\r\n// component dependencies\r\nimport { Grid } from '../../libs/material-ui';\r\n\r\ninterface OneColumnGridProps extends React.Props {\r\n}\r\n\r\nexport class OneColumnGrid extends React.Component {\r\n\r\n constructor(props: OneColumnGridProps) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n // spacing={16}\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n\r\ninterface OneColumnItemProps extends React.Props {\r\n xs?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12,\r\n md?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12,\r\n}\r\n\r\nexport class OneColumnItem extends React.Component {\r\n\r\n constructor(props: OneColumnItemProps) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}","import * as Model from \"../../viewmodels/EPCDataModel\"\r\nimport { LinkedContentGroup, LinkedContentItem } from '../../store/ViewRegistry/items';\r\nimport * as _ from 'lodash';\r\n\r\nexport interface Entry {\r\n type: \"break\" | \"header\" | \"small\" | \"large\",\r\n item?: LinkedContentItem,\r\n headerText?: string\r\n}\r\n\r\nexport interface Group {\r\n type: \"small\" | \"large\" | null,\r\n entries: Entry[]\r\n}\r\n\r\nexport function group(root: LinkedContentGroup, displayHidden: boolean) {\r\n\r\n let entries: Entry[] = [];\r\n\r\n let stack = [root];\r\n while (stack.length > 0) {\r\n let grp = stack.pop()!;\r\n\r\n if (grp != root && grp.optOut && !displayHidden)\r\n continue;\r\n\r\n if (grp.breakSection)\r\n entries.push({ type: \"break\" });\r\n\r\n if (!grp.hideHeader && grp.header && grp.header != \"\") {\r\n entries.push({ type: \"header\", headerText: grp.header });\r\n }\r\n \r\n let items = _.values(grp.items);\r\n items.sort((x, y) => x.sortOrder.localeCompare(y.sortOrder));\r\n\r\n for (let item of items) {\r\n if (isSmall(item)) {\r\n entries.push({ type: \"small\", item: item });\r\n }\r\n else {\r\n entries.push({ type: \"large\", item: item });\r\n }\r\n }\r\n\r\n let subgrps = _.values(grp.groups);\r\n subgrps.sort((x, y) => x.sortOrder.localeCompare(y.sortOrder));\r\n subgrps.reverse();\r\n\r\n for (let subgrp of subgrps) {\r\n stack.push(subgrp);\r\n }\r\n }\r\n if (entries.length == 0)\r\n return [];\r\n\r\n let group: Group | null = null;\r\n let groups: Group[] = [];\r\n\r\n // process entries in reverse order to make sure that headers are placed in the group following the header\r\n entries = entries.reverse();\r\n for (let entry of entries) {\r\n if (group == null || entry.type == \"break\" || (entry.type != \"header\" && group.type != null && group.type != entry.type)) {\r\n group = {\r\n entries: [entry],\r\n type: entry.type == \"header\" || entry.type == \"break\" ? null : entry.type\r\n };\r\n groups.push(group);\r\n }\r\n else {\r\n if (group.type == null && (entry.type == \"small\" ||\r\n entry.type == \"large\"))\r\n group.type = entry.type;\r\n group.entries.push(entry);\r\n }\r\n }\r\n\r\n if (group && group.type == null)\r\n group.type = \"large\";\r\n groups.reverse();\r\n for (let group of groups) {\r\n group.entries.reverse();\r\n }\r\n\r\n return groups;\r\n}\r\n\r\nfunction isSmall(item: LinkedContentItem) {\r\n\r\n if (item.layoutType == Model.LayoutType.OneColumn)\r\n return false;\r\n else if (item.layoutType == Model.LayoutType.TwoColumn)\r\n return true;\r\n\r\n switch (item.targetTypeOfContent) {\r\n case Model.TypeOfContent.ArtEPC:\r\n case Model.TypeOfContent.RuleEPC:\r\n case Model.TypeOfContent.ArtRFeesEPC:\r\n case Model.TypeOfContent.ArtProtArt69EPC:\r\n case Model.TypeOfContent.ArtProtLondonEPC:\r\n case Model.TypeOfContent.ArtProtRecogEPC:\r\n case Model.TypeOfContent.SecProtCentrEPC:\r\n case Model.TypeOfContent.ProtArt69EPC:\r\n case Model.TypeOfContent.ProtLondonEPC:\r\n case Model.TypeOfContent.ProtRecogEPC:\r\n case Model.TypeOfContent.ProtCentrEPC:\r\n case Model.TypeOfContent.ArtPCT:\r\n case Model.TypeOfContent.RulePCT:\r\n case Model.TypeOfContent.PC:\r\n return false;\r\n default:\r\n return true;\r\n }\r\n}","import * as React from 'react';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\n\r\nimport DragIndicator from '@material-ui/icons/DragIndicator';\r\n\r\nimport {\r\n ConnectDragSource,\r\n DragDropContext,\r\n DragSource,\r\n DragSourceSpec,\r\n DragSourceCollector,\r\n DragSourceConnector,\r\n DragSourceMonitor,\r\n DragElementWrapper,\r\n ConnectDropTarget,\r\n DropTarget,\r\n DropTargetConnector,\r\n DropTargetMonitor,\r\n ClientOffset,\r\n DropTargetSpec\r\n} from 'react-dnd';\r\n\r\nimport * as HTML5Backend from 'react-dnd-html5-backend';\r\n\r\nexport interface Move {\r\n scopeId: string,\r\n id: string,\r\n type: \"item\" | \"group\",\r\n toParentId: string,\r\n beforeSiblingId: string\r\n}\r\n\r\nconst dragItemTypes = {\r\n Item: 'item',\r\n Group: 'group'\r\n};\r\n\r\nconst dragSource = {\r\n beginDrag(props: any) {\r\n return {\r\n id: props.id,\r\n scopeId: props.scopeId,\r\n };\r\n }\r\n};\r\n\r\nfunction dragCollect(connect: DragSourceConnector, monitor: DragSourceMonitor) {\r\n return {\r\n connectDragSource: connect.dragSource(),\r\n isDragging: monitor.isDragging()\r\n }\r\n}\r\n\r\ninterface DragSourceProps extends React.Props {\r\n id: string,\r\n scopeId: string,\r\n connectDragSource: any,\r\n isDragging: any\r\n}\r\n\r\nclass _GroupDragSource extends React.Component {\r\n render() {\r\n const { connectDragSource, isDragging } = this.props;\r\n return connectDragSource(\r\n
    \r\n \r\n {this.props.children}\r\n
    \r\n );\r\n }\r\n}\r\nexport const GroupDragSource = DragSource(dragItemTypes.Group, dragSource, dragCollect)(_GroupDragSource);\r\n\r\nclass _ItemDragSource extends React.Component {\r\n render() {\r\n const { connectDragSource, isDragging } = this.props;\r\n return connectDragSource(\r\n
    \r\n \r\n {this.props.children}\r\n
    \r\n );\r\n }\r\n}\r\nexport const ItemDragSource = DragSource(dragItemTypes.Item, dragSource, dragCollect)(_ItemDragSource);\r\n\r\nconst dropTarget = {\r\n drop(props: any, monitor: DropTargetMonitor, component: React.Component) {\r\n let item = monitor.getItem() as any;\r\n let type = monitor.getItemType() as any;\r\n\r\n console.log(\"drop \" + item.id + \" in \" + props.parentId + \" before \" + props.beforeId);\r\n\r\n let move: Move = {\r\n scopeId: item.scopeId,\r\n id: item.id,\r\n type: type,\r\n toParentId: props.parentId,\r\n beforeSiblingId: props.beforeId\r\n };\r\n props.handleMove(move);\r\n },\r\n canDrop(props: any, monitor: DropTargetMonitor) {\r\n let item = monitor.getItem() as any;\r\n let type = monitor.getItemType() as any;\r\n // TODO make sure groups are not dropped below one of their descendents\r\n if (type == 'group') {\r\n }\r\n return true;\r\n }\r\n};\r\n\r\nfunction dropCollect(connect: DropTargetConnector, monitor: DropTargetMonitor) {\r\n return {\r\n connectDropTarget: connect.dropTarget(),\r\n isOver: monitor.isOver()\r\n };\r\n}\r\n\r\ninterface DropTargetProps extends React.Props {\r\n parentId?: string,\r\n beforeId?: string,\r\n connectDropTarget?: any,\r\n isOver?: any,\r\n handleMove?: (move: Move) => void\r\n}\r\n\r\nclass _GroupDropTarget extends React.Component {\r\n render() {\r\n const { connectDropTarget, isOver } = this.props;\r\n return connectDropTarget(\r\n
    \r\n {isOver && (
    )}\r\n {this.props.children}\r\n
    \r\n );\r\n }\r\n}\r\nexport const GroupDropTarget = DropTarget(dragItemTypes.Group, dropTarget, dropCollect)(_GroupDropTarget);\r\n\r\nclass _ItemDropTarget extends React.Component {\r\n render() {\r\n const { connectDropTarget, isOver } = this.props;\r\n return connectDropTarget(\r\n
    \r\n {isOver && (
    )}\r\n {this.props.children}\r\n
    \r\n );\r\n }\r\n}\r\nexport const ItemDropTarget = DropTarget(dragItemTypes.Item, dropTarget, dropCollect)(_ItemDropTarget);\r\n\r\n\r\nclass _DndContext extends React.Component {\r\n\r\n constructor(props: {}) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return (\r\n
    \r\n {this.props.children}\r\n
    \r\n );\r\n }\r\n}\r\nexport const DndContext = DragDropContext(HTML5Backend)(_DndContext);\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../debug';\r\nimport * as _ from 'lodash';\r\n\r\n// ressources\r\nimport { localized, UILanguage } from \"../../ressources\";\r\nimport { styles } from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\n\r\n// navigation dependencies\r\nimport * as Nav from '../../navigation';\r\n\r\n// component dependencies\r\nimport { Link } from 'react-router-dom';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\nimport * as Model from \"../../viewmodels/EPCDataModel\"\r\nimport { NoteItem, getBestLanguage } from '../../store/ViewRegistry/items';\r\n\r\nconst linktarget = \"_self\";\r\nconst externaltarget = \"_blank\";\r\n\r\ntype ContentHeaderProps =\r\n {\r\n uiLanguage: UILanguage,\r\n label: string,\r\n title: string,\r\n url: string,\r\n friendlyLabel: string,\r\n small: boolean,\r\n isOptOut: boolean,\r\n onFocusChanged(hasFocus: boolean): void,\r\n }\r\n & StyledComponentProps;\r\n\r\nexport class ContentHeader extends React.Component {\r\n\r\n constructor(props: ContentHeaderProps) {\r\n super(props); \r\n }\r\n\r\n //shouldComponentUpdate(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean {\r\n // let modifed = !_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState);\r\n // Debug.log(`ContentHeader.shouldComponentUpdate (${modifed})`);\r\n\r\n // let shallowEquals = Debug.shallowEqual(this.props, nextProps);\r\n\r\n // return modifed;\r\n //}\r\n\r\n render() {\r\n Debug.log(`ContentHeader.render: ${this.props.label}`, \"render\");\r\n\r\n const $ = localized(this.props.uiLanguage);\r\n\r\n // TODO format header based on cc.typeOfContent\r\n\r\n let labelClass = this.props.small ? \"bold\" : \"h2\";\r\n let titleClass = this.props.small ? \"\" : \"h3\";\r\n\r\n if (this.props.isOptOut) {\r\n labelClass += \" opted-out\";\r\n titleClass += \" opted-out\";\r\n }\r\n\r\n return (\r\n
    \r\n
    this.props.onFocusChanged(true)}\r\n onBlur={() => this.props.onFocusChanged(false)}\r\n >\r\n {/**/}\r\n {this.props.friendlyLabel}\r\n {this.props.url && {$('common_open_link')}}\r\n
    \r\n {this.props.title}\r\n
    \r\n
    \r\n );\r\n }\r\n}\r\n\r\nexport const ConnectedContentHeader = connect(\r\n (state: ApplicationState, ownProps: {\r\n label: string,\r\n small: boolean,\r\n isOptOut: boolean,\r\n onFocusChanged(hasFocus: boolean): void,\r\n }) => {\r\n\r\n const content = state.viewRegistry.contents[ownProps.label]!;\r\n if (content.type != 'Content')\r\n throw new TypeError(); \r\n\r\n const { languages } = state.userProfile.viewOptions;\r\n\r\n const titleState = getBestLanguage(languages, content.titleState)!;\r\n const titleLanguage = titleState.language;\r\n const urlState = getBestLanguage(languages, content.externalLinkState)!;\r\n\r\n return {\r\n uiLanguage: state.userProfile.viewOptions.uiLanguage,\r\n label: ownProps.label,\r\n title: titleState.text,\r\n url: urlState.text,\r\n friendlyLabel: content.friendlyLabel,\r\n small: ownProps.small,\r\n isOptOut: ownProps.isOptOut,\r\n onFocusChanged: ownProps.onFocusChanged,\r\n } as ContentHeaderProps;\r\n }\r\n)(ContentHeader);","import * as Model from '../viewmodels/EPCDataModel';\r\nimport { ViewOptions } from '../store/UserProfile';\r\nimport * as _ from 'lodash';\r\n\r\nexport function getScope(scopeId: string | undefined | null, scopes: Model.ScopeVM[]) {\r\n return scopeId ? _.first(scopes.filter(scope => scope.id == scopeId)) : undefined;\r\n}\r\n\r\nexport function compareScopes(firstId: string | undefined | null, secondId: string | undefined | null, scopes: Model.ScopeVM[]) {\r\n let first = getScope(firstId, scopes);\r\n let second = getScope(secondId, scopes);\r\n if (!first || !second)\r\n return undefined;\r\n let cmp = (first.typeOfScope) - (second.typeOfScope);\r\n if (cmp != 0)\r\n return cmp;\r\n else\r\n return first.level - second.level;\r\n}\r\n\r\nexport interface RelativeScopeInfo {\r\n editScopeId: string | null,\r\n relativeToScopeId: string | null,\r\n scopes: Model.ScopeVM[],\r\n isOtherScope: boolean,\r\n /** author (0) is LOWER than user (2) */\r\n isLowerScope: boolean,\r\n /** user (2) is HIGHER than author (0) */\r\n isHigherScope: boolean,\r\n}\r\n\r\nexport function getRelativeScopeInfo(viewOptions: ViewOptions, relativeToScopeId: string) {\r\n const editScopeId = viewOptions.editScopeId;\r\n const scopes = viewOptions.scopes;\r\n const cmp = compareScopes(editScopeId, relativeToScopeId, scopes);\r\n const isOtherScope = editScopeId != relativeToScopeId;\r\n const isLowerScope = cmp !== undefined && cmp < 0;\r\n const isHigherScope = cmp !== undefined && cmp > 0;\r\n\r\n let info: RelativeScopeInfo = {\r\n editScopeId,\r\n relativeToScopeId,\r\n scopes,\r\n isOtherScope,\r\n isLowerScope,\r\n isHigherScope,\r\n };\r\n\r\n return info;\r\n}","import * as React from 'react';\r\n\r\nexport function renderButton(element: JSX.Element, onClick: () => void) {\r\n return (\r\n \r\n {element}\r\n \r\n );\r\n}","//RESSOURCE content_outline_item\r\n\r\nimport * as React from 'react';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as ScopeUtils from '../../../utils/ScopeUtils';\r\n\r\n// ressources\r\nimport { localized } from \"../../../ressources\";\r\nimport { styles } from \"../../../theme\";\r\n\r\n// component dependencies\r\nimport * as Dnd from './dnd';\r\nimport { renderButton } from './button';\r\n\r\n// data model dependencies\r\nimport * as UserProfileStore from '../../../store/UserProfile';\r\nimport { LinkedContentGroup, LinkedContentItem, FriendlyLabelItem } from '../../../store/ViewRegistry/items';\r\nimport { LayoutType } from \"../../../viewmodels/EPCDataModel\";\r\n\r\ninterface ItemControlProps extends React.Props {\r\n item: LinkedContentItem,\r\n\r\n viewOptions: UserProfileStore.ViewOptions,\r\n\r\n friendlyLabels: { [label: string]: FriendlyLabelItem },\r\n\r\n handleMove: (move: Dnd.Move) => void,\r\n handleDelete: (element: LinkedContentItem | LinkedContentGroup) => void,\r\n handleUpdate: (element: LinkedContentItem | LinkedContentGroup) => void,\r\n}\r\n\r\ninterface ItemControlState {\r\n hasFocus: boolean,\r\n}\r\n\r\nexport class ItemControl extends React.Component {\r\n\r\n constructor(props: ItemControlProps) {\r\n super(props);\r\n\r\n this.state = {\r\n hasFocus: false,\r\n };\r\n }\r\n\r\n render() {\r\n const item = this.props.item;\r\n\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n const isActive = this.state.hasFocus;\r\n\r\n let className = \"contentoutline-element\";\r\n if (isActive)\r\n className += \" active\";\r\n\r\n const { editScopeId, isOtherScope, isLowerScope, isHigherScope } =\r\n ScopeUtils.getRelativeScopeInfo(this.props.viewOptions, item.scopeId);\r\n\r\n const cannotMove = isOtherScope;\r\n const isReadOnly = isLowerScope;\r\n\r\n const friendlyLabel = this.props.friendlyLabels[item.targetLabel];\r\n\r\n // TODO use displayedScopeIds ?\r\n if (isLowerScope)\r\n return false;\r\n\r\n return (\r\n
    this.setState({ hasFocus: true })}\r\n onBlur={evt => this.setState({ hasFocus: false })}\r\n >\r\n \r\n {cannotMove ?\r\n this.renderTitle(isOtherScope) :\r\n \r\n {this.renderTitle(isOtherScope)}\r\n \r\n }\r\n \r\n\r\n {isActive && !isReadOnly && (\r\n
    \r\n {!isOtherScope && renderButton({$('content_outline_delete')}, () => this.delete())}\r\n {renderButton({$('content_outline_edit')}, () => this.update())}\r\n
    \r\n )}\r\n\r\n {/*isActive && (\r\n
    \r\n
    \r\n \r\n
    \r\n\r\n {(isOtherScope &&\r\n
    \r\n \r\n
    )}\r\n\r\n
    \r\n \r\n
    \r\n
    \r\n )*/}\r\n
    \r\n );\r\n }\r\n\r\n renderTitle(isOtherScope: boolean) {\r\n\r\n const titleStyle = isOtherScope ? styles.contentOutline_OtherScope : styles.contentOutline_ActiveScope;\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n const item = this.props.item;\r\n const scope = ScopeUtils.getScope(item.scopeId, this.props.viewOptions.scopes);\r\n\r\n const friendlyLabel = this.props.friendlyLabels[item.targetLabel];\r\n \r\n const mods = [\r\n $('content_outline_item'),\r\n //scope ? (scope.name || scope.label) : \"\",\r\n item.optOut ? $('content_outline_hidden') : \"\",\r\n item.hideBody ? $('content_outline_body_hidden') : \"\",\r\n item.layoutType == LayoutType.OneColumn ? $('content_outline_one_column') :\r\n item.layoutType == LayoutType.TwoColumn ? $('content_outline_two_column') :\r\n \"\",\r\n ];\r\n\r\n const modsString = _.join(mods.filter(mod => mod != \"\"), \", \");\r\n\r\n return {friendlyLabel && friendlyLabel.fullName}{modsString != \"\" ? ` (${modsString})` : \"\"};\r\n }\r\n\r\n toLayoutType(val: string): LayoutType {\r\n switch (val) {\r\n case \"Default\": return LayoutType.Default;\r\n case \"OneColumn\": return LayoutType.OneColumn;\r\n case \"TwoColumn\": return LayoutType.TwoColumn;\r\n default: return LayoutType.Default;\r\n }\r\n }\r\n\r\n update() {\r\n this.props.handleUpdate(this.props.item);\r\n }\r\n\r\n delete() {\r\n this.props.handleDelete(this.props.item);\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { RouteComponentProps } from 'react-router';\r\n\r\n// ressources\r\nimport { localized, UILanguage } from \"../../ressources\";\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport {\r\n Modal, Paper, Typography, Button,\r\n Dialog, DialogTitle, DialogContent, DialogActions\r\n} from '../../libs/material-ui';\r\n\r\ntype ModalDialogProps = {\r\n uiLanguage: UILanguage,\r\n title: string,\r\n open: boolean,\r\n variant: 'small' | 'medium' | 'large',\r\n isOK: boolean,\r\n onOK: () => void,\r\n onCancel: () => void,\r\n} & StyledComponentProps;\r\n\r\nconst getStyles = (maxWidth: number) => (theme: Theme) => ({\r\n layout: {\r\n width: 'auto',\r\n marginLeft: theme.spacing.unit * 2,\r\n marginRight: theme.spacing.unit * 2,\r\n [theme.breakpoints.up(maxWidth + theme.spacing.unit * 2 * 2)]: {\r\n width: maxWidth,\r\n marginLeft: 'auto',\r\n marginRight: 'auto',\r\n },\r\n },\r\n paper: {\r\n marginTop: theme.spacing.unit * 3,\r\n marginBottom: theme.spacing.unit * 3,\r\n maxHeight: `calc(100vh - ${theme.spacing.unit * 6}px)`,\r\n padding: theme.spacing.unit * 2,\r\n overflow: 'auto',\r\n [theme.breakpoints.up(maxWidth + theme.spacing.unit * 3 * 2)]: {\r\n marginTop: theme.spacing.unit * 6,\r\n marginBottom: theme.spacing.unit * 6,\r\n maxHeight: `calc(100vh - ${theme.spacing.unit * 12}px)`,\r\n padding: theme.spacing.unit * 3,\r\n },\r\n },\r\n stepper: {\r\n padding: `${theme.spacing.unit * 3}px 0 ${theme.spacing.unit * 5}px`,\r\n },\r\n form: {\r\n padding: `${theme.spacing.unit * 3}px 0 ${theme.spacing.unit * 5}px`,\r\n },\r\n buttons: {\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n },\r\n button: {\r\n marginTop: theme.spacing.unit * 3,\r\n marginLeft: theme.spacing.unit,\r\n },\r\n});\r\n\r\nclass _ModalDialog extends React.Component {\r\n constructor(props: ModalDialogProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n const $ = localized(this.props.uiLanguage);\r\n\r\n // className={classes.layout}\r\n\r\n const classes = this.props.classes || {}; // maxWidth=\"lg\"\r\n return (\r\n \r\n\r\n \r\n {this.props.title}\r\n \r\n {/*\r\n \r\n {steps.map(label => (\r\n \r\n {label}\r\n \r\n ))}\r\n \r\n */}\r\n \r\n {this.props.children}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport const ModalDialog = withStyles(getStyles(400))(_ModalDialog);","//RESSOURCE content_outline_group\r\n\r\nimport * as React from 'react';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as ScopeUtils from '../../../utils/ScopeUtils';\r\n\r\n// ressources\r\nimport { localized } from \"../../../ressources\";\r\nimport { styles } from \"../../../theme\";\r\n\r\n// component dependencies\r\nimport * as Dnd from './dnd';\r\nimport { ItemControl } from './ItemControl';\r\nimport { renderButton } from './button';\r\n\r\n// data model dependencies\r\nimport * as UserProfileStore from '../../../store/UserProfile';\r\nimport { LinkedContentGroup, LinkedContentItem, FriendlyLabelItem } from '../../../store/ViewRegistry/items';\r\n\r\n\r\ninterface GroupControlProps extends React.Props {\r\n group: LinkedContentGroup,\r\n\r\n viewOptions: UserProfileStore.ViewOptions,\r\n\r\n friendlyLabels: { [label: string]: FriendlyLabelItem },\r\n \r\n handleMove: (move: Dnd.Move) => void,\r\n handleDelete: (element: LinkedContentItem | LinkedContentGroup) => void,\r\n handleUpdate: (element: LinkedContentItem | LinkedContentGroup) => void,\r\n handleNewChild: (group: LinkedContentGroup, type: \"item\" | \"group\" | \"comment\") => void,\r\n}\r\n\r\ninterface GroupControlState {\r\n hasFocus: boolean,\r\n hasNewItemFocus: boolean,\r\n hasNewGroupFocus: boolean,\r\n}\r\n\r\nexport class GroupControl extends React.Component {\r\n\r\n constructor(props: GroupControlProps) {\r\n super(props);\r\n\r\n this.state = {\r\n hasFocus: false,\r\n hasNewItemFocus: false,\r\n hasNewGroupFocus: false,\r\n };\r\n }\r\n\r\n render(): false | JSX.Element {\r\n\r\n const group = this.props.group;\r\n\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n const isActive = this.state.hasFocus;\r\n const isNewItemActive = this.state.hasNewItemFocus;\r\n const isNewGroupActive = this.state.hasNewGroupFocus;\r\n\r\n let className = \"contentoutline-element\";\r\n if (isActive)\r\n className += \" active\";\r\n\r\n let classNameNewItem = \"contentoutline-element\";\r\n if (isNewItemActive)\r\n classNameNewItem += \" active\";\r\n\r\n let classNameNewGroup = \"contentoutline-element\";\r\n if (isNewGroupActive)\r\n classNameNewGroup += \" active\";\r\n\r\n const items = _.sortBy(_.values(group.items), item => item.sortOrder);\r\n const groups = _.sortBy(_.values(group.groups), group => group.sortOrder);\r\n\r\n const { editScopeId, isOtherScope, isLowerScope, isHigherScope } =\r\n ScopeUtils.getRelativeScopeInfo(this.props.viewOptions, group.scopeId);\r\n\r\n const cannotMove = isOtherScope || group.isRoot;\r\n const isReadOnly = isLowerScope || group.isRoot;\r\n\r\n // TODO use displayedScopeIds ?\r\n if (isLowerScope)\r\n return false;\r\n\r\n return (\r\n
    \r\n
    this.setState({ hasFocus: true })}\r\n onBlur={evt => this.setState({ hasFocus: false })}\r\n >\r\n {isReadOnly ?\r\n this.renderTitle(isOtherScope) :\r\n \r\n {cannotMove ?\r\n this.renderTitle(isOtherScope) :\r\n \r\n {this.renderTitle(isOtherScope)}\r\n \r\n }\r\n \r\n }\r\n\r\n {isActive && !isReadOnly && (\r\n
    \r\n {!isOtherScope && renderButton({$('content_outline_delete')}, () => this.delete())}\r\n {renderButton({$('content_outline_edit')}, () => this.update())}\r\n
    \r\n )}\r\n
    \r\n\r\n
      \r\n {items.map((item) => (\r\n
    • \r\n \r\n
    • \r\n ))}\r\n\r\n {!isLowerScope && // cannot add or drop elements from lower (author) to higher (user) scope\r\n
    • \r\n
      this.setState({ hasNewItemFocus: true })}\r\n onBlur={evt => this.setState({ hasNewItemFocus: false })}\r\n >\r\n \r\n {renderButton({$('content_outline_add_item')}, () => this.newItem())}\r\n {renderButton({$('content_outline_add_comment')}, () => this.newComment())} \r\n\r\n {/*isNewItemActive &&\r\n this.newItem(label)} lessEqualScopeId={scope.scopeId} />\r\n */}\r\n \r\n
      \r\n
    • \r\n }\r\n
    \r\n\r\n
      \r\n {groups.map((grp) => (\r\n
    • \r\n \r\n
    • \r\n ))}\r\n\r\n {!isLowerScope && // cannot add or drop elements lower (author) to higher (user) scope\r\n
    • \r\n
      this.setState({ hasNewGroupFocus: true })}\r\n onBlur={evt => this.setState({ hasNewGroupFocus: false })}\r\n >\r\n \r\n {renderButton({$('content_outline_add_group')}, () => this.newGroup())}\r\n\r\n {/*isNewGroupActive &&\r\n
      \r\n
      \r\n \r\n this.setState({ newGroupHeader: evt.currentTarget.value })} />\r\n
      \r\n {renderButton(hinzufügen, () => this.newGroup())}\r\n
      \r\n */}\r\n
      \r\n
      \r\n
    • \r\n }\r\n
    \r\n
    \r\n );\r\n }\r\n\r\n renderTitle(isOtherScope: boolean) {\r\n\r\n const titleStyle = isOtherScope ? styles.contentOutline_OtherScope : styles.contentOutline_ActiveScope;\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n const group = this.props.group;\r\n const scope = ScopeUtils.getScope(group.scopeId, this.props.viewOptions.scopes);\r\n\r\n const mods = [\r\n $('content_outline_group'),\r\n //scope ? (scope.name || scope.label) : \"\",\r\n group.optOut ? $('content_outline_hidden') : \"\",\r\n group.hideHeader ? $('content_outline_header_hidden') : \"\",\r\n group.breakSection ? $('content_outline_manual_break') : \"\",\r\n ];\r\n\r\n const modsString = _.join(mods.filter(mod => mod != \"\"), \", \");\r\n\r\n return {group.header}{modsString != \"\" ? ` (${modsString})` : \"\"};\r\n }\r\n\r\n update() {\r\n this.props.handleUpdate(this.props.group);\r\n }\r\n\r\n delete() {\r\n this.props.handleDelete(this.props.group);\r\n }\r\n\r\n newItem() {\r\n this.props.handleNewChild(this.props.group, 'item');\r\n }\r\n\r\n newComment() {\r\n this.props.handleNewChild(this.props.group, 'comment');\r\n }\r\n\r\n newGroup() {\r\n this.props.handleNewChild(this.props.group, 'group');\r\n }\r\n}","//RESSOURCE content_outline_item\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as ScopeUtils from '../../../utils/ScopeUtils';\r\n\r\n// ressources\r\nimport { localized, UILanguage } from \"../../../ressources\";\r\nimport { styles } from \"../../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../../store';\r\nimport * as ViewRegistryStore from '../../../store/ViewRegistry';\r\n\r\n// component dependencies\r\nimport { ModalDialog } from '../../shared/ModalDialog';\r\nimport {\r\n Grid, Typography, TextField, FormControlLabel, Checkbox,\r\n RadioGroup, Radio, FormControl, InputLabel, MenuItem, Select\r\n} from '../../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../../utils/LoaderState\";\r\nimport { LinkedContentGroup, LinkedContentItem, FriendlyLabelItem } from '../../../store/ViewRegistry/items';\r\nimport { ViewOptions } from '../../../store/UserProfile';\r\nimport { LayoutType } from '../../../viewmodels/EPCDataModel';\r\n\r\nexport interface ItemModifier {\r\n hideBody?: boolean,\r\n optOut?: boolean,\r\n layoutType?: LayoutType,\r\n}\r\n\r\ntype UpdateItemFormProps =\r\n {\r\n viewOptions: ViewOptions,\r\n open: boolean,\r\n item: LinkedContentItem,\r\n friendlyLabels: { [label: string]: FriendlyLabelItem },\r\n onCancel: () => void,\r\n onOK: (mod: ItemModifier) => void\r\n }\r\n & StyledComponentProps;\r\n\r\ninterface UpdateItemFormState extends ItemModifier {\r\n\r\n};\r\n\r\nclass _UpdateItemForm extends React.Component {\r\n\r\n constructor(props: UpdateItemFormProps) {\r\n super(props);\r\n this.state = {};\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n\r\n const { editScopeId, isOtherScope, isLowerScope, isHigherScope } =\r\n ScopeUtils.getRelativeScopeInfo(this.props.viewOptions, this.props.item.scopeId);\r\n\r\n const optOut = this.state.optOut !== undefined ? this.state.optOut : this.props.item.optOut;\r\n const hideBody = this.state.hideBody !== undefined ? this.state.hideBody : this.props.item.hideBody;\r\n const layoutType = this.state.layoutType !== undefined ? this.state.layoutType : this.props.item.layoutType;\r\n\r\n const friendlyLabel = this.props.friendlyLabels[this.props.item.targetLabel];\r\n\r\n return (\r\n this.handleCancel()}\r\n onOK={() => this.handleOK()}\r\n >\r\n \r\n \r\n this.setState({ optOut: value })} />\r\n }\r\n label={$('content_outline_hidden')}\r\n />\r\n \r\n \r\n this.setState({ hideBody: value })} />\r\n }\r\n label={$('content_outline_body_hidden')}\r\n />\r\n \r\n \r\n\r\n \r\n {$('content_outline_layout')}\r\n this.handleLayoutTypeChange(evt.target.value)}\r\n inputProps={{\r\n id: 'layoutType'\r\n }}\r\n >\r\n {$('content_outline_item_default')}\r\n {$('content_outline_item_onecolumn')}\r\n {$('content_outline_item_twocolumn')}\r\n \r\n \r\n\r\n\r\n {/*\r\n this.handleLayoutTypeChange(evt, value)}\r\n >\r\n } label={$('content_outline_item_default')} />\r\n } label={$('content_outline_item_onecolumn')} />\r\n } label={$('content_outline_item_twocolumn')} />\r\n */}\r\n \r\n \r\n\r\n {/*\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n label=\"Use this address for payment details\"\r\n />\r\n \r\n */}\r\n \r\n );\r\n }\r\n\r\n handleLayoutTypeChange(value: string) {\r\n let typedValue = value as keyof typeof LayoutType;\r\n let layoutType: LayoutType = LayoutType[typedValue];\r\n this.setState({ layoutType });\r\n }\r\n\r\n handleOK() {\r\n this.props.onOK({ ...this.state });\r\n }\r\n\r\n handleCancel() {\r\n this.props.onCancel();\r\n }\r\n}\r\n\r\nexport const UpdateItemForm = _UpdateItemForm;","//RESSOURCE content_outline_group\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as ScopeUtils from '../../../utils/ScopeUtils';\r\n\r\n// ressources\r\nimport { localized, UILanguage } from \"../../../ressources\";\r\nimport { styles } from \"../../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../../store';\r\nimport * as ViewRegistryStore from '../../../store/ViewRegistry';\r\n\r\n// component dependencies\r\nimport { ModalDialog } from '../../shared/ModalDialog';\r\nimport {\r\n Grid, Typography, TextField, FormControlLabel, Checkbox,\r\n RadioGroup, Radio, FormControl, InputLabel, Select\r\n} from '../../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../../utils/LoaderState\";\r\nimport { ViewOptions } from '../../../store/UserProfile';\r\nimport { LinkedContentGroup } from '../../../store/ViewRegistry/items';\r\nimport { LayoutType } from '../../../viewmodels/EPCDataModel';\r\n\r\nexport interface GroupModifier {\r\n header?: string,\r\n hideHeader?: boolean,\r\n optOut?: boolean,\r\n breakSection?: boolean,\r\n}\r\n\r\ntype UpdateGroupFormProps =\r\n {\r\n viewOptions: ViewOptions,\r\n open: boolean,\r\n group: LinkedContentGroup,\r\n onCancel: () => void,\r\n onOK: (mod: GroupModifier) => void\r\n }\r\n & StyledComponentProps;\r\n\r\ninterface UpdateGroupFormState extends GroupModifier {\r\n\r\n};\r\n\r\nclass _UpdateGroupForm extends React.Component {\r\n\r\n constructor(props: UpdateGroupFormProps) {\r\n super(props);\r\n this.state = {};\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n\r\n const { editScopeId, isOtherScope, isLowerScope, isHigherScope } =\r\n ScopeUtils.getRelativeScopeInfo(this.props.viewOptions, this.props.group.scopeId);\r\n\r\n const header = this.state.header !== undefined ? this.state.header : this.props.group.header;\r\n const optOut = this.state.optOut !== undefined ? this.state.optOut : this.props.group.optOut;\r\n const hideHeader = this.state.hideHeader !== undefined ? this.state.hideHeader : this.props.group.hideHeader;\r\n const breakSection = this.state.breakSection !== undefined ? this.state.breakSection : this.props.group.breakSection;\r\n\r\n return (\r\n this.handleCancel()}\r\n onOK={() => this.handleOK()}\r\n >\r\n \r\n \r\n this.setState({ header: evt.target.value })}\r\n />\r\n \r\n \r\n this.setState({ optOut: value })} />\r\n }\r\n label={$('content_outline_hidden')}\r\n />\r\n \r\n \r\n this.setState({ hideHeader: value })} />\r\n }\r\n label={$('content_outline_header_hidden')}\r\n />\r\n \r\n \r\n this.setState({ breakSection: value })} />\r\n }\r\n label={$('content_outline_manual_break')}\r\n />\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n isOK() {\r\n const header = this.state.header !== undefined ? this.state.header : this.props.group.header;\r\n return header != \"\";\r\n }\r\n\r\n handleOK() {\r\n this.props.onOK({ ...this.state });\r\n }\r\n\r\n handleCancel() {\r\n this.props.onCancel();\r\n }\r\n}\r\n\r\nexport const UpdateGroupForm = _UpdateGroupForm;","//RESSOURCE content_outline_group\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as ScopeUtils from '../../../utils/ScopeUtils';\r\n\r\n// ressources\r\nimport { localized, UILanguage } from \"../../../ressources\";\r\nimport { styles } from \"../../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../../store';\r\nimport * as ViewRegistryStore from '../../../store/ViewRegistry';\r\n\r\n// component dependencies\r\nimport { ModalDialog } from '../../shared/ModalDialog';\r\nimport {\r\n Grid, Typography, TextField, FormControlLabel, Checkbox,\r\n RadioGroup, Radio, FormControl, InputLabel, Select\r\n} from '../../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../../utils/LoaderState\";\r\nimport { ViewOptions } from '../../../store/UserProfile';\r\nimport { LinkedContentGroup } from '../../../store/ViewRegistry/items';\r\nimport { LayoutType } from '../../../viewmodels/EPCDataModel';\r\n\r\nexport interface NewGroupDesc {\r\n header: string,\r\n}\r\n\r\ntype NewGroupFormProps =\r\n {\r\n viewOptions: ViewOptions,\r\n open: boolean,\r\n group: LinkedContentGroup,\r\n onCancel: () => void,\r\n onOK: (mod: NewGroupDesc) => void\r\n }\r\n & StyledComponentProps;\r\n\r\ninterface NewGroupFormState extends NewGroupDesc {\r\n};\r\n\r\nclass _NewGroupForm extends React.Component {\r\n\r\n constructor(props: NewGroupFormProps) {\r\n super(props);\r\n this.state = { header: \"\" };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n\r\n const { editScopeId, isOtherScope, isLowerScope, isHigherScope } =\r\n ScopeUtils.getRelativeScopeInfo(this.props.viewOptions, this.props.group.scopeId);\r\n\r\n return (\r\n this.handleCancel()}\r\n onOK={() => this.handleOK()}\r\n >\r\n \r\n \r\n this.setState({ header: evt.target.value })}\r\n />\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n isOK() {\r\n return this.state.header != \"\";\r\n }\r\n\r\n handleOK() {\r\n this.props.onOK({ ...this.state });\r\n }\r\n\r\n handleCancel() {\r\n this.props.onCancel();\r\n }\r\n}\r\n\r\nexport const NewGroupForm = _NewGroupForm;","//RESSOURCE content_outline_item\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as ScopeUtils from '../../../utils/ScopeUtils';\r\nimport * as WebApi from '../../../webapi';\r\n\r\n// ressources\r\nimport { localized, UILanguage } from \"../../../ressources\";\r\nimport { styles } from \"../../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../../store';\r\nimport * as ViewRegistryStore from '../../../store/ViewRegistry';\r\n\r\n// component dependencies\r\nimport { ModalDialog } from '../../shared/ModalDialog';\r\nimport {\r\n Grid, Typography, TextField, FormControlLabel, Checkbox,\r\n RadioGroup, Radio, FormControl, InputLabel, Select, MenuItem\r\n} from '../../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../../utils/LoaderState\";\r\nimport { ViewOptions } from '../../../store/UserProfile';\r\nimport { LinkedContentGroup } from '../../../store/ViewRegistry/items';\r\nimport { LayoutType, SearchGetCitationDto, ResolverResultVM } from '../../../viewmodels/EPCDataModel';\r\n\r\nexport interface NewItemDesc {\r\n targetLabel: string,\r\n}\r\n\r\ntype NewItemFormProps =\r\n {\r\n viewOptions: ViewOptions,\r\n open: boolean,\r\n productId: string,\r\n group: LinkedContentGroup,\r\n onCancel: () => void,\r\n onOK: (mod: NewItemDesc) => void\r\n }\r\n & StyledComponentProps;\r\n\r\ninterface NewItemFormState extends NewItemDesc {\r\n input: string,\r\n results: ResolverResultVM[],\r\n};\r\n\r\nclass _NewItemForm extends React.Component {\r\n\r\n constructor(props: NewItemFormProps) {\r\n super(props);\r\n this.state = { targetLabel: \"\", input: \"\", results: [] };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n\r\n const { editScopeId, isOtherScope, isLowerScope, isHigherScope } =\r\n ScopeUtils.getRelativeScopeInfo(this.props.viewOptions, this.props.group.scopeId);\r\n\r\n return (\r\n this.handleCancel()}\r\n onOK={() => this.handleOK()}\r\n >\r\n \r\n \r\n this.handleInputChanged(evt.target.value)}\r\n />\r\n \r\n {this.state.results && this.state.results.length > 0 &&\r\n \r\n \r\n {$('content_outline_target')}\r\n this.setState({ targetLabel: evt.target.value })}\r\n inputProps={{\r\n id: 'targetLabel'\r\n }}\r\n >\r\n {this.state.results.map(result => (\r\n {result.friendlyLabel} - {result.title && result.title.text}\r\n ))}\r\n \r\n \r\n \r\n }\r\n \r\n \r\n );\r\n }\r\n\r\n isOK() {\r\n return this.state.targetLabel != \"\";\r\n }\r\n\r\n handleOK() {\r\n this.props.onOK({ targetLabel: this.state.targetLabel });\r\n }\r\n\r\n handleCancel() {\r\n this.props.onCancel();\r\n }\r\n\r\n handleInputChanged(value: string) {\r\n if (value && value != this.state.input && value.length >= 3) {\r\n const dto: SearchGetCitationDto = {\r\n productId: this.props.productId,\r\n input: value,\r\n exact: false,\r\n take: 20,\r\n languages: this.props.viewOptions.languages,\r\n includeExpired: this.props.viewOptions.includeExpiredContentInSearch\r\n };\r\n\r\n WebApi.resolveCitation(dto).then(result => {\r\n this.setState(state => ({\r\n results: state.input == value ? result.models : state.results\r\n }));\r\n });\r\n }\r\n this.setState({ input: value });\r\n }\r\n}\r\n\r\nexport const NewItemForm = _NewItemForm;","//RESSOURCE content_outline_item\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as ScopeUtils from '../../../utils/ScopeUtils';\r\nimport * as WebApi from '../../../webapi';\r\n\r\n// ressources\r\nimport { localized, UILanguage } from \"../../../ressources\";\r\nimport { styles } from \"../../../theme\";\r\n\r\n// component dependencies\r\nimport { ModalDialog } from '../../shared/ModalDialog';\r\nimport {\r\n Grid, Typography, TextField, FormControlLabel, Checkbox,\r\n RadioGroup, Radio, FormControl, InputLabel, Select, MenuItem\r\n} from '../../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../../utils/LoaderState\";\r\nimport { ViewOptions } from '../../../store/UserProfile';\r\nimport { LinkedContentGroup } from '../../../store/ViewRegistry/items';\r\nimport { LayoutType, SearchGetCitationDto, ResolverResultVM } from '../../../viewmodels/EPCDataModel';\r\n\r\nexport interface NewCommentDesc {\r\n title: string,\r\n tags: string\r\n}\r\n\r\ntype NewCommentFormProps =\r\n {\r\n viewOptions: ViewOptions,\r\n open: boolean,\r\n productId: string,\r\n group: LinkedContentGroup,\r\n onCancel: () => void,\r\n onOK: (mod: NewCommentDesc) => void\r\n }\r\n & StyledComponentProps;\r\n\r\ninterface NewCommentFormState extends NewCommentDesc {\r\n};\r\n\r\nclass _NewCommentForm extends React.Component {\r\n\r\n constructor(props: NewCommentFormProps) {\r\n super(props);\r\n this.state = { title: \"\", tags: \"\" };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n\r\n const { editScopeId, isOtherScope, isLowerScope, isHigherScope } =\r\n ScopeUtils.getRelativeScopeInfo(this.props.viewOptions, this.props.group.scopeId);\r\n\r\n return (\r\n this.handleCancel()}\r\n onOK={() => this.handleOK()}\r\n >\r\n \r\n \r\n this.setState({ title: evt.target.value })}\r\n />\r\n \r\n \r\n this.setState({ tags: evt.target.value })}\r\n />\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n isOK() {\r\n return this.state.title != \"\";\r\n }\r\n\r\n handleOK() {\r\n this.props.onOK({ ...this.state });\r\n }\r\n\r\n handleCancel() {\r\n this.props.onCancel();\r\n }\r\n}\r\n\r\nexport const NewCommentForm = _NewCommentForm;","//RESSOURCE content_outline\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../../debug';\r\nimport * as _ from 'lodash';\r\n\r\n// ressources\r\nimport { localized } from \"../../../ressources\";\r\nimport { styles } from \"../../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../../store';\r\nimport * as TableOfContentsStore from '../../../store/TableOfContents';\r\nimport * as UserProfileStore from '../../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../../store/ViewRegistry';\r\n\r\n// component dependencies\r\nimport * as Dnd from './dnd';\r\nimport { ContentHeader } from '../ContentHeader';\r\nimport { ErrorContainer } from '../../shared/ErrorContainer';\r\nimport { GroupControl } from './GroupControl';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../../utils/LoaderState\";\r\nimport {\r\n LinkedContentGroup, LinkedContentItem, ContentItem, FriendlyLabelItem,\r\n getBestLanguage\r\n} from '../../../store/ViewRegistry/items';\r\nimport { UpdateItemForm, ItemModifier } from './UpdateItemForm';\r\nimport { UpdateGroupForm, GroupModifier } from './UpdateGroupForm';\r\nimport { NewGroupForm, NewGroupDesc } from './NewGroupForm';\r\nimport { NewItemForm, NewItemDesc } from './NewItemForm';\r\nimport { NewCommentForm, NewCommentDesc } from './NewCommentForm';\r\nimport { bindActionCreators } from 'redux';\r\n\r\ntype ContentOutlineProps =\r\n {\r\n userProfile: UserProfileStore.UserProfileState,\r\n\r\n viewRegistry_loaderState: LoaderState,\r\n viewRegistry_productId?: string,\r\n viewRegistry_label?: string,\r\n viewRegistry_content?: ContentItem,\r\n viewRegistry_linkedContentRoot?: LinkedContentGroup,\r\n viewRegistry_friendlyLabels: { [label: string]: FriendlyLabelItem },\r\n }\r\n & typeof ViewRegistryStore.actionCreators\r\n & StyledComponentProps;\r\n\r\ninterface ContentOutlineState {\r\n deleteItem: LinkedContentItem | null,\r\n deleteGroup: LinkedContentGroup | null,\r\n updateItem: LinkedContentItem | null,\r\n updateGroup: LinkedContentGroup | null,\r\n newItemForGroup: LinkedContentGroup | null,\r\n newCommentForGroup: LinkedContentGroup | null,\r\n newGroupForGroup: LinkedContentGroup | null,\r\n}\r\n\r\nexport class ContentOutline extends React.Component {\r\n\r\n constructor(props: ContentOutlineProps) {\r\n super(props);\r\n\r\n this.state = {\r\n deleteItem: null,\r\n deleteGroup: null,\r\n updateItem: null,\r\n updateGroup: null,\r\n newItemForGroup: null,\r\n newCommentForGroup: null,\r\n newGroupForGroup: null,\r\n };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n const loaderState = this.props.viewRegistry_loaderState;\r\n if (!LoaderStateUtil.isLoaded(this.props.userProfile.loaderState) ||\r\n !LoaderStateUtil.isLoaded(loaderState)) {\r\n return LoaderStateUtil.renderDefault(loaderState);\r\n }\r\n\r\n const uiLanguage = this.props.userProfile.viewOptions.uiLanguage;\r\n\r\n const productId = this.props.viewRegistry_productId!;\r\n const label = this.props.viewRegistry_label!;\r\n const content = this.props.viewRegistry_content!;\r\n const linkedContentRoot = this.props.viewRegistry_linkedContentRoot!;\r\n const friendlyLabels = this.props.viewRegistry_friendlyLabels!;\r\n\r\n const updateItem = this.state.updateItem;\r\n const updateGroup = this.state.updateGroup;\r\n const newGroupForGroup = this.state.newGroupForGroup;\r\n const newItemForGroup = this.state.newItemForGroup;\r\n const newCommentForGroup = this.state.newCommentForGroup;\r\n\r\n Debug.log(`ContentOutlinePage.render (${label})`, \"render\");\r\n\r\n return (\r\n
    \r\n\r\n {this.renderHeader()}\r\n\r\n {updateItem &&\r\n this.setState({ updateItem: null })}\r\n onOK={mod => this.handleUpdateItem(updateItem, mod)} />\r\n }\r\n\r\n {updateGroup &&\r\n this.setState({ updateGroup: null })}\r\n onOK={mod => this.handleUpdateGroup(updateGroup, mod)} />\r\n }\r\n\r\n {newGroupForGroup &&\r\n this.setState({ newGroupForGroup: null })}\r\n onOK={desc => this.handleNewGroup(newGroupForGroup, desc)} />\r\n }\r\n\r\n {newItemForGroup &&\r\n this.setState({ newItemForGroup: null })}\r\n onOK={desc => this.handleNewItem(newItemForGroup, desc)} />\r\n }\r\n\r\n {newCommentForGroup && \r\n this.setState({ newCommentForGroup: null })}\r\n onOK={desc => this.handleNewComment(newCommentForGroup, desc)} />\r\n }\r\n\r\n this.handleMove(move)}\r\n handleDelete={element => this.handleDelete(element)}\r\n handleUpdate={element => this.handleUpdate(element)}\r\n handleNewChild={(group, type) => this.handleNewChild(group, type)}\r\n />\r\n
    \r\n );\r\n }\r\n\r\n renderHeader() {\r\n const { languages } = this.props.userProfile.viewOptions;\r\n\r\n const uiLanguage = this.props.userProfile.viewOptions.uiLanguage;\r\n\r\n const content = this.props.viewRegistry_content!;\r\n const isSmall = false;\r\n\r\n const titleState = getBestLanguage(languages, content.titleState)!;\r\n const titleLanguage = titleState.language;\r\n const urlState = getBestLanguage(languages, content.externalLinkState)!;\r\n\r\n return { return; }} />;\r\n }\r\n\r\n handleMove(move: Dnd.Move) {\r\n if (move.type == \"group\")\r\n this.props.moveGroup(move.scopeId, move.id, move.beforeSiblingId, move.toParentId);\r\n else\r\n this.props.moveItem(move.scopeId, move.id, move.beforeSiblingId, move.toParentId);\r\n }\r\n\r\n handleDelete(element: LinkedContentItem | LinkedContentGroup) {\r\n const uiLanguage = this.props.userProfile.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n if (element.type == 'ITEM') {\r\n if (confirm($('content_outline_confirm_delete_item'))) {\r\n this.props.deleteItem(element.scopeId, element.id);\r\n }\r\n } else if (element.type == 'GROUP') {\r\n if (confirm($('content_outline_confirm_delete_group'))) {\r\n this.props.deleteGroup(element.scopeId, element.id);\r\n }\r\n }\r\n }\r\n\r\n handleUpdate(element: LinkedContentItem | LinkedContentGroup) {\r\n if (element.type == 'ITEM') {\r\n this.setState({ updateItem: element });\r\n } else if (element.type == 'GROUP') {\r\n this.setState({ updateGroup: element });\r\n }\r\n }\r\n\r\n handleNewChild(group: LinkedContentGroup, type: \"item\" | \"group\" | \"comment\") {\r\n if (type == 'item') {\r\n this.setState({ newItemForGroup: group });\r\n } else if (type == 'comment') {\r\n this.setState({ newCommentForGroup: group });\r\n } else if (type == 'group') {\r\n this.setState({ newGroupForGroup: group });\r\n }\r\n }\r\n\r\n handleUpdateItem(item: LinkedContentItem, mod: ItemModifier) {\r\n if (item && mod) {\r\n this.props.updateItem(\r\n this.props.userProfile.viewOptions.editScopeId!,\r\n item.scopeId,\r\n item.id,\r\n mod.hideBody,\r\n mod.optOut,\r\n mod.layoutType\r\n );\r\n }\r\n this.setState({ updateItem: null });\r\n }\r\n\r\n handleUpdateGroup(group: LinkedContentGroup, mod: GroupModifier) {\r\n if (group && mod) {\r\n this.props.updateGroup(\r\n this.props.userProfile.viewOptions.editScopeId!,\r\n group.scopeId,\r\n group.id,\r\n this.props.userProfile.viewOptions.editLanguage,\r\n mod.header,\r\n mod.hideHeader,\r\n mod.optOut,\r\n mod.breakSection,\r\n );\r\n }\r\n this.setState({ updateGroup: null });\r\n }\r\n\r\n handleNewGroup(parent: LinkedContentGroup, desc: NewGroupDesc) {\r\n if (parent && desc) {\r\n this.props.addGroup(\r\n this.props.userProfile.viewOptions.editScopeId!,\r\n desc.header,\r\n this.props.userProfile.viewOptions.editLanguage,\r\n parent.id,\r\n );\r\n }\r\n this.setState({ newGroupForGroup: null });\r\n }\r\n\r\n handleNewItem(parent: LinkedContentGroup, desc: NewItemDesc) {\r\n if (parent && desc) {\r\n this.props.addItem(\r\n this.props.userProfile.viewOptions.editScopeId!,\r\n desc.targetLabel,\r\n parent.id,\r\n );\r\n }\r\n this.setState({ newItemForGroup: null });\r\n }\r\n\r\n handleNewComment(parent: LinkedContentGroup, desc: NewCommentDesc) {\r\n if (parent && desc) {\r\n let tags = (desc.tags || \"\").split(/;/);\r\n this.props.addNewCommentItem(\r\n this.props.userProfile.viewOptions.editScopeId!,\r\n this.props.userProfile.viewOptions.editLanguage,\r\n this.props.viewRegistry_productId!,\r\n this.props.viewRegistry_label!,\r\n parent.id,\r\n null,\r\n desc.title,\r\n tags\r\n );\r\n }\r\n this.setState({ newCommentForGroup: null });\r\n }\r\n}\r\n\r\nexport const ConnectedContentOutline = connect(\r\n (state: ApplicationState) => ({\r\n userProfile: state.userProfile,\r\n viewRegistry_loaderState: state.viewRegistry.loaderState,\r\n viewRegistry_productId: state.userProfile.viewOptions.productId,\r\n viewRegistry_label: state.viewRegistry.label,\r\n viewRegistry_content: state.viewRegistry.label ? state.viewRegistry.contents[state.viewRegistry.label] as ContentItem : undefined,\r\n viewRegistry_linkedContentRoot: state.viewRegistry.linkedContentRoot,\r\n viewRegistry_friendlyLabels: state.viewRegistry.friendlyLabels,\r\n }),\r\n dispatch => bindActionCreators(ViewRegistryStore.actionCreators, dispatch)\r\n)(ContentOutline);\r\n\r\n\r\ninterface OutlineControlProps extends React.Props {\r\n content: ContentItem,\r\n viewOptions: UserProfileStore.ViewOptions,\r\n\r\n root: LinkedContentGroup,\r\n\r\n friendlyLabels: { [label: string]: FriendlyLabelItem },\r\n \r\n handleMove: (move: Dnd.Move) => void,\r\n handleDelete: (element: LinkedContentItem | LinkedContentGroup) => void,\r\n handleUpdate: (element: LinkedContentItem | LinkedContentGroup) => void,\r\n handleNewChild: (group: LinkedContentGroup, type: \"item\" | \"group\" | \"comment\") => void,\r\n}\r\n\r\ninterface OutlineControlState {\r\n activeId?: string\r\n}\r\n\r\nclass OutlineControl extends React.Component {\r\n\r\n constructor(props: OutlineControlProps) {\r\n super(props);\r\n\r\n this.state = {};\r\n }\r\n\r\n render(): false | JSX.Element {\r\n let cnt = this.props.content;\r\n let root = this.props.root;\r\n return (\r\n \r\n
    \r\n
      \r\n \r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n}","import * as _ from 'lodash';\r\n\r\nexport interface TextRange {\r\n offset: number,\r\n length?: number,\r\n text: string,\r\n data: any,\r\n kind: \"insert\" | \"range\"\r\n}\r\n\r\nexport class TextBuilder {\r\n elements: TextRange[];\r\n\r\n constructor(text: string) {\r\n\r\n let full: TextRange = {\r\n offset: 0,\r\n length: text.length,\r\n text: text,\r\n data: null,\r\n kind: \"range\"\r\n };\r\n\r\n this.elements = [full];\r\n }\r\n\r\n makeRange(offset: number, length: number, data: any) {\r\n\r\n let last = _.last(this.elements)!;\r\n let len = last.offset + (last.length || 0);\r\n if (offset + length > len) {\r\n throw new RangeError(\"Cannot add range at position \" + offset.toString() + \" with length \" + length + \" when text length is \" + len.toString() + \".\");\r\n }\r\n\r\n for (let i = 0; i < this.elements.length; i++) {\r\n let element = this.elements[i];\r\n if (element.kind == \"insert\")\r\n continue;\r\n\r\n if (offset <= element.offset && offset + length >= element.offset + element.length!) {\r\n let range = { ...element };\r\n range.data = data;\r\n\r\n this.elements.splice(i, 1, range);\r\n\r\n //this.elements = this.elements\r\n // .remove(i)\r\n // .insert(i, range);\r\n }\r\n else if (offset <= element.offset && offset + length > element.offset) {\r\n let range1 = { ...element };\r\n let range2 = { ...element };\r\n\r\n range1.data = data;\r\n range1.length = offset + length - element.offset;\r\n range1.text = element.text.slice(0, range1.length);\r\n\r\n range2.offset = element.offset + range1.length;\r\n range2.length = element.length! - range1.length;\r\n range2.text = element.text.slice(range1.length, element.length);\r\n\r\n //this.elements = this.elements\r\n // .remove(i)\r\n // .insert(i, range1)\r\n // .insert(i + 1, range2);\r\n\r\n this.elements.splice(i, 1, range1, range2);\r\n }\r\n else if (offset < element.offset + element.length! && offset + length >= element.offset + element.length!) {\r\n let range1 = { ...element };\r\n let range2 = { ...element };\r\n\r\n range1.length = offset - element.offset;\r\n range1.text = element.text.slice(0, range1.length);\r\n\r\n range2.data = data;\r\n range2.offset = element.offset + range1.length;\r\n range2.length = element.length! - range1.length;\r\n range2.text = element.text.slice(range1.length, element.length);\r\n\r\n //this.elements = this.elements\r\n // .remove(i)\r\n // .insert(i, range1)\r\n // .insert(i + 1, range2);\r\n this.elements.splice(i, 1, range1, range2);\r\n }\r\n else if (offset > element.offset && offset + length < element.offset + element.length!) {\r\n let range1 = { ...element };\r\n let range2 = { ...element };\r\n let range3 = { ...element };\r\n\r\n range1.length = offset - element.offset;\r\n range1.text = element.text.slice(0, range1.length);\r\n\r\n range2.data = data;\r\n range2.offset = element.offset + range1.length;\r\n range2.length = offset + length - element.offset - range1.length;\r\n range2.text = element.text.slice(range1.length, range1.length + range2.length);\r\n\r\n range3.offset = element.offset + range1.length + range2.length\r\n range3.length = element.length! - range1.length - range2.length;\r\n range3.text = element.text.slice(range1.length + range2.length, element.length);\r\n\r\n //this.elements = this.elements\r\n // .remove(i)\r\n // .insert(i, range1)\r\n // .insert(i + 1, range2)\r\n // .insert(i + 2, range3);\r\n this.elements.splice(i, 1, range1, range2, range3);\r\n\r\n }\r\n }\r\n }\r\n\r\n makeInsertion(offset: number, data: any) {\r\n\r\n if (offset === undefined || offset === null) {\r\n throw new TypeError(\"'offset' must not be undefined.\");\r\n }\r\n\r\n let insert: TextRange = {\r\n offset: offset,\r\n data: data,\r\n text: \"\",\r\n kind: \"insert\"\r\n };\r\n\r\n let i = 0;\r\n\r\n let last = _.last(this.elements)!;\r\n let len = last.offset + (last.length || 0);\r\n if (offset > len) {\r\n throw new RangeError(\"Cannot insert at position \" + offset.toString() + \" when text length is \" + len.toString() + \".\");\r\n }\r\n\r\n // either insert at end, directly before a range or within a range\r\n for (; i < this.elements.length; i++) {\r\n let element = this.elements[i];\r\n if (element.kind == \"range\") {\r\n // insert directly before range\r\n if (offset == element.offset) {\r\n //this.elements = this.elements.insert(i, insert);\r\n this.elements.splice(i, 0, insert);\r\n return;\r\n }\r\n // or within range\r\n else if (offset > element.offset && offset < element.offset + element.length!) {\r\n let idx = offset - element.offset;\r\n let txt1: TextRange = {\r\n offset: element.offset,\r\n length: idx,\r\n text: element.text.slice(0, idx),\r\n data: element.data,\r\n kind: \"range\"\r\n };\r\n let txt2: TextRange = {\r\n offset: element.offset + idx,\r\n length: element.text.length - idx,\r\n text: element.text.slice(idx, element.text.length),\r\n data: element.data,\r\n kind: \"range\"\r\n };\r\n\r\n //this.elements = this.elements\r\n // .remove(i)\r\n // .insert(i, txt1)\r\n // .insert(i + 1, insert)\r\n // .insert(i + 2, txt2);\r\n this.elements.splice(i, 1, txt1, insert, txt2);\r\n\r\n return;\r\n }\r\n }\r\n }\r\n\r\n // insert at end\r\n //this.elements = this.elements.insert(i + 1, insert);\r\n this.elements.push(insert);\r\n }\r\n\r\n getElements(): TextRange[] {\r\n return this.elements;\r\n }\r\n}","import * as React from \"react\";\r\n\r\n/** enable the content link decorator to detect whether the surrounding editor is read only. */\r\nexport const EditorReadOnlyContext = React.createContext({ readOnly: true });","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\n\r\n// localized ressources\r\nimport { localized } from \"../../ressources\"\r\nimport * as Debug from \"../../debug\"\r\n\r\n// component dependencies\r\nimport * as Draft from \"draft-js\";\r\nimport { DraftJSUtils } from \"../../utils/DraftJSUtils\";\r\nimport { EditorReadOnlyContext } from './EditorReadOnlyContext';\r\n\r\n//import { ContentLinkDecorator, ReadOnlyContentLinkDecorator } from \"./ContentLinkDecorator\";\r\n\r\n// data model dependencies\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\n\r\ntype EditorProps =\r\n {\r\n className?: string,\r\n\r\n editorState: Draft.EditorState,\r\n\r\n readOnly: boolean,\r\n language?: Model.Language,\r\n spellcheck: boolean,\r\n placeholder: string,\r\n styles: { [key: string]: React.CSSProperties },\r\n\r\n renderBeforeEditor?(): React.ReactNode,\r\n renderAfterEditor?(): React.ReactNode,\r\n\r\n onChange(newEditorState: Draft.EditorState): void,\r\n onFocusChanged(hasFocus: boolean): void,\r\n onTab?(editorState: Draft.EditorState, shift: boolean): 'handled' | 'not-handled',\r\n }\r\n & StyledComponentProps;\r\n\r\ninterface EditorState {\r\n}\r\n\r\nexport class Editor extends React.Component {\r\n\r\n constructor(props: EditorProps) {\r\n super(props);\r\n }\r\n\r\n getXmlLanguage(language: Model.Language | undefined) {\r\n switch (language) {\r\n case Model.Language.DE: return \"de\";\r\n case Model.Language.EN: return \"en\";\r\n case Model.Language.FR: return \"fr\";\r\n default: return undefined;\r\n }\r\n }\r\n\r\n render() {\r\n if (!this.props.editorState) {\r\n return false;\r\n }\r\n return (\r\n
    this.handleClick(evt)}\r\n onFocus={evt => this.handleFocus(evt)}\r\n onBlur={evt => this.handleBlur(evt)}>\r\n\r\n {this.props.renderBeforeEditor && this.props.renderBeforeEditor()}\r\n\r\n
    \r\n \r\n this.handleChange(evt)}\r\n onTab={evt => this.handleTab(evt)}\r\n handleReturn={evt => this.handleReturn(evt)}\r\n handleKeyCommand={evt => this.handleKeyCommand(evt)}\r\n />\r\n \r\n
    \r\n\r\n {this.props.renderAfterEditor && this.props.renderAfterEditor()}\r\n\r\n
    \r\n );\r\n }\r\n\r\n handleChange(newEditorState: Draft.EditorState) {\r\n this.props.onChange(newEditorState);\r\n }\r\n\r\n acquireFocus() {\r\n if (this.refs && this.refs.editor)\r\n (this.refs.editor as any).focus();\r\n }\r\n\r\n handleClick(evt: React.SyntheticEvent<{}>) {\r\n this.acquireFocus();\r\n evt.stopPropagation();\r\n }\r\n\r\n handleFocus(evt: React.SyntheticEvent<{}>) {\r\n Debug.log(\"Editor.handleFocus\", \"focus\");\r\n if (this.props.onFocusChanged)\r\n this.props.onFocusChanged(true);\r\n evt.stopPropagation();\r\n }\r\n\r\n handleBlur(evt: React.SyntheticEvent<{}>) {\r\n Debug.log(\"Editor.handleBlur\", \"focus\");\r\n if (this.props.onFocusChanged)\r\n this.props.onFocusChanged(false);\r\n }\r\n\r\n handleKeyCommand(command: string): \"handled\" | \"not-handled\" {\r\n\r\n const editorState = this.props.editorState;\r\n\r\n if (command == \"backspace\") {\r\n let sel = editorState.getSelection();\r\n let isList = DraftJSUtils.isCurrentBlockOfType(editorState, [\"ordered-list-item\", \"unordered-list-item\"]);\r\n\r\n // remove list and convert to unstyled block\r\n if (sel.isCollapsed() && sel.getFocusOffset() == 0 && isList) {\r\n\r\n let type = DraftJSUtils.getCurrentBlock(editorState).getType();\r\n let newEditorState = Draft.RichUtils.toggleBlockType(editorState, type);\r\n this.handleChange(newEditorState);\r\n return \"handled\";\r\n }\r\n }\r\n\r\n return \"not-handled\";\r\n }\r\n\r\n handleTab(evt: React.KeyboardEvent<{}>) {\r\n\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n const editorState = this.props.editorState;\r\n const hasShift = evt.shiftKey;\r\n\r\n if (this.props.onTab && this.props.onTab(editorState, hasShift) == 'handled')\r\n return;\r\n\r\n // adjust list level\r\n if (DraftJSUtils.isCurrentBlockOfType(editorState, [\"ordered-list-item\", \"unordered-list-item\"])) {\r\n if (hasShift) {\r\n let newEditorState = DraftJSUtils.adjustBlockDepth(editorState, -1, 4);\r\n this.handleChange(newEditorState);\r\n }\r\n else {\r\n let newEditorState = DraftJSUtils.adjustBlockDepth(editorState, +1, 4);\r\n this.handleChange(newEditorState);\r\n }\r\n }\r\n }\r\n\r\n handleReturn(evt: React.KeyboardEvent<{}>): \"handled\" | \"not-handled\" {\r\n\r\n const editorState = this.props.editorState;\r\n const hasShift = evt.shiftKey;\r\n\r\n const text = DraftJSUtils.getCurrentBlock(editorState).getText();\r\n\r\n // add a soft break if shift is pressed\r\n if (hasShift) {\r\n let newEditorState = Draft.RichUtils.insertSoftNewline(editorState);\r\n this.handleChange(newEditorState);\r\n return \"handled\";\r\n }\r\n // TODO make unordered list\r\n //else if (text.startsWith(\"-\")) {\r\n // let newEditorState = RichUtils.toggleBlockType(this.state.editorState, \"unordered-list-item\");\r\n // this.handleChange(newEditorState);\r\n // return \"handled\";\r\n //}\r\n\r\n return \"not-handled\";\r\n }\r\n}","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../debug';\r\nimport * as _ from 'lodash';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\nimport { NoteItem, getBestLanguage } from '../../store/ViewRegistry/items';\r\nimport { NoteEditorTarget } from '../../store/ViewRegistry/toolbar';\r\n\r\n// component dependencies\r\nimport * as Styles from \"../../theme\"\r\nimport * as Draft from \"draft-js\";\r\nimport { Editor } from \"../edit/Editor\"\r\nimport { StyleFactory } from '../../utils/StyleFactory';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\";\r\nimport { SyncStateUtil, SyncState } from \"../../utils/SyncState\";\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\nimport { Paper } from '../../libs/material-ui';\r\nimport { bindActionCreators } from 'redux';\r\n\r\nconst linktarget = \"_self\";\r\n\r\nexport interface NoteSpecs {\r\n id: string,\r\n label: string,\r\n optOut: boolean,\r\n}\r\n\r\ntype NoteProps =\r\n {\r\n note: NoteItem,\r\n styles: Model.StyleVM[],\r\n viewOptions: UserProfileStore.ViewOptions,\r\n }\r\n & NoteSpecs\r\n & typeof ViewRegistryStore.actionCreators\r\n & StyledComponentProps;\r\n\r\ninterface NoteState {\r\n hasFocus: boolean\r\n}\r\n\r\nexport class Note extends React.Component {\r\n\r\n constructor(props: NoteProps) {\r\n super(props);\r\n this.state = { hasFocus: false };\r\n }\r\n\r\n //shouldComponentUpdate(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean {\r\n // let modifed = !_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState);\r\n // Debug.log(`Note.shouldComponentUpdate (${modifed})`);\r\n\r\n // let shallowEquals = Debug.shallowEqual(this.props, nextProps);\r\n\r\n // return modifed;\r\n //}\r\n\r\n render() {\r\n\r\n const note = this.props.note;\r\n const styles = this.props.styles;\r\n const viewOptions = this.props.viewOptions;\r\n\r\n const $ = localized(viewOptions.uiLanguage); \r\n\r\n const editScopeId = viewOptions.editScopeId;\r\n const canEditBody = this.canEdit(viewOptions, note);\r\n const isDeleted = !!note.isDeleted;\r\n\r\n if (isDeleted)\r\n return false;\r\n if (note.isOptOut && !viewOptions.displayHidden)\r\n return false;\r\n\r\n Debug.log(`Note.render: ${note.label}/${note.id}`, \"render\");\r\n\r\n const customStyles = StyleFactory.getCssStyles(styles);\r\n\r\n const draft = getBestLanguage(viewOptions.languages, note.draftState)!;\r\n const isFallback = draft.language !== viewOptions.editLanguage;\r\n\r\n let className = \"note tbowner\";\r\n if (!canEditBody)\r\n className += \" note-readonly\";\r\n if (isFallback)\r\n className += \" note-fallback\"; //TODO\r\n if (note.isOptOut)\r\n className += \" opted-out\";\r\n\r\n if (note.typeOfStickyNote == Model.TypeOfStickyNote.UpdateNote)\r\n className += \" note-update\";\r\n else if (note.scopeId == \"000000c9-14ec-4ad8-aca0-ef6dc1e9cfc8\" ||\r\n note.scopeId == \"000000c8-14ec-4ad8-aca0-ef6dc1e9cfc8\" ||\r\n note.scopeId == \"000000c7-14ec-4ad8-aca0-ef6dc1e9cfc8\" ||\r\n note.scopeId == \"000000c6-14ec-4ad8-aca0-ef6dc1e9cfc8\")\r\n className += \" note-author\";\r\n\r\n if (this.state.hasFocus)\r\n className += \" note-focus tbowner-active\";\r\n if (draft.syncState.isModified)\r\n className += \" note-modified\";\r\n if (draft.syncState.hasError)\r\n className += \" note-error\";\r\n\r\n const editorState = draft.editor;\r\n\r\n return (\r\n
    \r\n \r\n this.handleDraftChange(newEditorState)}\r\n onFocusChanged={hasFocus => this.handleDraftFocusChanged(hasFocus)}\r\n />\r\n \r\n
    \r\n );\r\n }\r\n\r\n canEdit(opts: UserProfileStore.ViewOptions, note: NoteItem) {\r\n const editScopeId = opts.editScopeId;\r\n const editLanguage = opts.editLanguage;\r\n return !!editScopeId &&\r\n note.scopeId == editScopeId &&\r\n !opts.readOnly &&\r\n !note.isDeleting &&\r\n (editScopeId == \"000000c6-14ec-4ad8-aca0-ef6dc1e9cfc8\" || editScopeId == \"000000c8-14ec-4ad8-aca0-ef6dc1e9cfc8\" || note.typeOfStickyNote !== Model.TypeOfStickyNote.UpdateNote);\r\n }\r\n\r\n handleDraftChange(newEditorState: Draft.EditorState) {\r\n const opts = this.props.viewOptions;\r\n\r\n const note = this.props.note;\r\n const draftState = getBestLanguage(opts.languages, note.draftState)!;\r\n const language = draftState.language;\r\n\r\n // can also be caused by focus change \r\n Debug.log(`Note.handleDraftChange`, \"draft\");\r\n\r\n this.props.onNoteDraftChanged(note.label, note.id, language, newEditorState);\r\n }\r\n\r\n handleDraftFocusChanged(hasFocus: boolean) {\r\n const opts = this.props.viewOptions;\r\n\r\n const note = this.props.note;\r\n const draftState = getBestLanguage(opts.languages, note.draftState)!;\r\n const language = draftState.language;\r\n\r\n Debug.log(`Note.handleDraftFocusChanged(${hasFocus}, ${note.label}, ${note.id}, ${note.annotationId})`, \"focus\");\r\n\r\n const target = {\r\n type: 'NOTE_EDITOR_TARGET',\r\n label: note.label,\r\n id: note.id,\r\n draftLanguage: language,\r\n } as NoteEditorTarget;\r\n\r\n if (hasFocus) {\r\n this.props.setToolbar(target);\r\n }\r\n else {\r\n this.props.resetToolbar(target);\r\n }\r\n\r\n if (!hasFocus && draftState.syncState.isModified) {\r\n this.props.updateNoteDraft(note.label, note.id, language);\r\n }\r\n\r\n this.setState({ hasFocus });\r\n }\r\n}\r\n\r\nexport const ConnectedNote = connect(\r\n (state: ApplicationState, ownProps: NoteSpecs) => {\r\n\r\n const note = state.viewRegistry.contents[ownProps.label].notes[ownProps.id];\r\n\r\n return {\r\n ...ownProps,\r\n note: note,\r\n viewOptions: state.userProfile.viewOptions,\r\n styles: state.userProfile.preferences!.styles!,\r\n };\r\n },\r\n dispatch => bindActionCreators(ViewRegistryStore.actionCreators, dispatch)\r\n)(Note);","import * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../debug';\r\nimport * as ScopeUtils from '../../utils/ScopeUtils';\r\nimport * as _ from 'lodash';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\nimport { AnnotationItem, NoteItem, AnchorState, getBestLanguage } from '../../store/ViewRegistry/items';\r\nimport { AnnotationEditorTarget } from '../../store/ViewRegistry/toolbar';\r\n\r\n// component dependencies\r\nimport * as Draft from \"draft-js\";\r\nimport { Editor } from \"../edit/Editor\"\r\nimport { StyleFactory } from '../../utils/StyleFactory';\r\nimport { ConnectedNote } from \"./Note\";\r\nimport { Icons } from '../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\nimport { SyncStateUtil, SyncState } from \"../../utils/SyncState\"\r\nimport * as Model from \"../../viewmodels/EPCDataModel\"\r\n\r\nconst linktarget = \"_self\";\r\n\r\nexport interface AnnotationSpecs {\r\n id: string,\r\n label: string,\r\n optOut: boolean,\r\n\r\n peerHasFocus?: boolean,\r\n disableInline?: boolean,\r\n\r\n /** language of paragraph for which this annotation is rendered */\r\n anchorLanguage: Model.Language,\r\n\r\n anchor?: AnchorState | null,\r\n}\r\n\r\ntype AnnotationProps =\r\n {\r\n annotation: AnnotationItem,\r\n //notes: NoteItem[],\r\n notes: { [id: string]: NoteItem },\r\n styles: Model.StyleVM[],\r\n viewOptions: UserProfileStore.ViewOptions,\r\n }\r\n & AnnotationSpecs\r\n & typeof ViewRegistryStore.actionCreators\r\n & StyledComponentProps;\r\n\r\ninterface AnnoationState {\r\n hasFocus: boolean\r\n}\r\n\r\nexport class Annotation extends React.Component {\r\n\r\n constructor(props: AnnotationProps) {\r\n super(props);\r\n this.state = { hasFocus: false };\r\n }\r\n\r\n //shouldComponentUpdate(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean {\r\n // let modifed = !_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState);\r\n // Debug.log(`Annotation.shouldComponentUpdate (${modifed})`);\r\n\r\n // // update is caused by notes since 'notes: NoteItem[]' is recreated by projection\r\n // let shallowEquals = Debug.shallowEqual(this.props, nextProps);\r\n\r\n // return modifed;\r\n //}\r\n\r\n render() {\r\n const annotation = this.props.annotation;\r\n const styles = this.props.styles;\r\n const viewOptions = this.props.viewOptions;\r\n const $ = localized(viewOptions.uiLanguage);\r\n\r\n const notes = _.values(this.props.notes).filter(val => val.annotationId == annotation.id);\r\n\r\n const scope = ScopeUtils.getScope(annotation.scopeId, viewOptions.scopes);\r\n const editScopeId = viewOptions.editScopeId;\r\n const canEditBody = this.canEdit(viewOptions, annotation);\r\n const isDeleted = !!annotation.isDeleted;\r\n\r\n const isInline = annotation.isInline && !this.props.disableInline;\r\n\r\n if (isDeleted)\r\n return false;\r\n\r\n\r\n Debug.log(`Annotation.render: ${annotation.label}/${annotation.id} (isInline=${annotation.isInline})`, \"render\");\r\n\r\n const customStyles = StyleFactory.getCssStyles(styles);\r\n\r\n const draft = getBestLanguage(viewOptions.languages, annotation.draftState)!;\r\n const isFallback = draft.language !== viewOptions.editLanguage;\r\n\r\n let className = \"annotation tbowner\";\r\n if (annotation.isInline && !this.props.disableInline)\r\n className += \" annotation-inline\";\r\n if (this.props.peerHasFocus)\r\n className += \" annotation-peerfocus\";\r\n if (!canEditBody)\r\n className += \" annotation-readonly\";\r\n if (isFallback)\r\n className += \" annotation-fallback\"; //TODO\r\n if (annotation.isOptOut)\r\n className += \" opted-out\";\r\n if (scope && scope.typeOfScope == Model.TypeOfScope.User)\r\n className += \" annotation-personal\";\r\n if (scope && scope.typeOfScope == Model.TypeOfScope.Author && scope.level > 1) // TODO use extra property\r\n {\r\n className += \" annotation-update\";\r\n if (annotation.isOutOfSync)\r\n className += \" annotation-outofsync\";\r\n }\r\n\r\n if (this.state.hasFocus)\r\n className += \" annotation-focus tbowner-active\";\r\n if (draft.syncState.isModified)\r\n className += \" annotation-modified\";\r\n if (draft.syncState.hasError)\r\n className += \" annotation-error\";\r\n\r\n const editorState = draft.editor;\r\n\r\n //
    \r\n\r\n // TODO render notes on inline annoations!?\r\n\r\n return (\r\n
    \r\n this.renderBeforeEditor()}\r\n renderAfterEditor={() => this.renderAfterEditor()}\r\n onChange={newEditorState => this.handleDraftChange(newEditorState)}\r\n onFocusChanged={hasFocus => this.handleDraftFocusChanged(hasFocus)}\r\n onTab={(editorState, shift) => this.handleTab(editorState, shift)}\r\n />\r\n {!isInline && notes.map(note => (\r\n \r\n ))}\r\n {false && isInline && notes.length > 0 && (\r\n { evt.preventDefault(); prompt(\"huhu\"); }} />\r\n )}\r\n
    \r\n );\r\n //
    \r\n }\r\n\r\n renderBeforeEditor() {\r\n const annotation = this.props.annotation;\r\n return annotation.isInline &&\r\n [;\r\n }\r\n\r\n renderAfterEditor() {\r\n const annotation = this.props.annotation;\r\n return annotation.isInline &&\r\n ];\r\n }\r\n\r\n canEdit(opts: UserProfileStore.ViewOptions, annotation: AnnotationItem) {\r\n const editScopeId = opts.editScopeId;\r\n return !!editScopeId && !opts.readOnly && annotation.scopeId == editScopeId && !annotation.isDeleting;\r\n }\r\n\r\n handleDraftChange(newEditorState: Draft.EditorState) {\r\n const viewOptions = this.props.viewOptions;\r\n const annotation = this.props.annotation;\r\n const draftState = getBestLanguage(viewOptions.languages, annotation.draftState)!;\r\n const language = draftState.language;\r\n\r\n // can also be caused by focus change \r\n Debug.log(`Annotation.handleDraftChange`, \"draft\");\r\n\r\n this.props.onAnnotationDraftChanged(annotation.label, annotation.id, language, newEditorState);\r\n }\r\n\r\n handleDraftFocusChanged(hasFocus: boolean) {\r\n const viewOptions = this.props.viewOptions;\r\n const annotation = this.props.annotation;\r\n const draftState = getBestLanguage(viewOptions.languages, annotation.draftState)!;\r\n const language = draftState.language;\r\n\r\n Debug.log(`Annotation.handleDraftFocusChanged(${hasFocus}, ${annotation.label}, ${annotation.paragraphKey}, ${annotation.id}, ${annotation.isInline})`, \"focus\");\r\n\r\n const target = {\r\n type: 'ANNOTATION_EDITOR_TARGET',\r\n label: annotation.label,\r\n id: annotation.id,\r\n draftLanguage: language,\r\n anchorLanguage: this.props.anchorLanguage,\r\n } as AnnotationEditorTarget;\r\n\r\n if (hasFocus) {\r\n this.props.setToolbar(target);\r\n }\r\n else {\r\n this.props.resetToolbar(target);\r\n }\r\n\r\n if (!hasFocus && draftState.syncState.isModified) {\r\n this.props.updateAnnotationDraft(annotation.label, annotation.id, language);\r\n }\r\n\r\n this.setState({ hasFocus });\r\n }\r\n\r\n handleTab(editorState: Draft.EditorState, shift: boolean): 'handled' | 'not-handled' {\r\n if (this.props.annotation.isInline && !this.props.disableInline) {\r\n this.props.moveAnnotation(this.props.label, this.props.id, this.props.anchorLanguage, shift ? -1 : +1);\r\n return 'handled';\r\n }\r\n return 'not-handled';\r\n }\r\n}\r\n\r\nexport const ConnectedAnnotation = connect(\r\n (state: ApplicationState, ownProps: AnnotationSpecs) => {\r\n const content = state.viewRegistry.contents[ownProps.label];\r\n const annotation = content.annotations[ownProps.id];\r\n const notes = content.notes; //_.values(content.notes).filter(val => val.annotationId == annotation.id);\r\n return {\r\n ...ownProps,\r\n annotation: annotation,\r\n notes: notes,\r\n viewOptions: state.userProfile.viewOptions,\r\n styles: state.userProfile.preferences!.styles!,\r\n };\r\n },\r\n dispatch => bindActionCreators(ViewRegistryStore.actionCreators, dispatch)\r\n)(Annotation);","import * as React from \"react\";\r\nimport { Map, List, Iterable, Seq, Set } from \"immutable\";\r\nimport * as _ from 'lodash';\r\n\r\nimport { TextBuilder, TextRange } from \"../../utils/TextBuilder\";\r\nimport { StyleFactory } from \"../../utils/StyleFactory\";\r\n\r\nimport * as Model from \"../../viewmodels/EPCDataModel\"\r\n\r\nimport { ConnectedAnnotation, AnnotationSpecs } from \"./Annotation\";\r\nimport { MarkerItem, AnchorState } from \"../../store/ViewRegistry/items\";\r\n\r\ninterface ItemRenderer {\r\n render: (text?: string, offset?: number, length?: number) => JSX.Element | false\r\n}\r\n\r\ninterface MarkerSpecs {\r\n //id: string,\r\n //label: string,\r\n //productId: string,\r\n //scopeId: string,\r\n //paragraphKey: string,\r\n\r\n //language: Model.Language,\r\n\r\n anchorState: AnchorState,\r\n styleId: string,\r\n\r\n //isOptOut?: boolean,\r\n}\r\n\r\nexport class ParagraphBuilder {\r\n\r\n tb: TextBuilder;\r\n text: string;\r\n type: Model.TextBlockType;\r\n\r\n renderParagraphItem(item: string) {\r\n return {item} ;\r\n }\r\n\r\n renderParagraphList() {\r\n return • ;\r\n }\r\n\r\n renderSegmentMark(seg: number) {\r\n return {seg + 1};\r\n }\r\n\r\n renderInlineAnnotation(annotation: AnnotationSpecs) {\r\n return (\r\n
    \r\n \r\n
    \r\n );\r\n }\r\n\r\n renderRange(text: string, offset: number, length: number, styleId: string, styles: Model.StyleVM[]) {\r\n const style = _.find(styles, x_ => x_.id == styleId);\r\n const cssStyle = StyleFactory.getCssStyle(style);\r\n return {text};\r\n }\r\n\r\n insertSegmentMark(tb: TextBuilder, offset: number, seg: number) {\r\n tb.makeInsertion(offset, { render: () => this.renderSegmentMark(seg) });\r\n }\r\n\r\n insertInlineAnnotation(tb: TextBuilder, offset: number, annotation: AnnotationSpecs) {\r\n tb.makeInsertion(offset, { render: () => this.renderInlineAnnotation(annotation) });\r\n }\r\n\r\n getTxtIdxForAnchor(anchor: { end?: number }, textLength: number) {\r\n return anchor && anchor.end !== undefined ? anchor.end : textLength;\r\n }\r\n\r\n constructor(item: string, blockType: Model.TextBlockType, level: number, text: string) {\r\n\r\n this.text = text;\r\n this.tb = new TextBuilder(text);\r\n this.type = blockType;\r\n\r\n // render par item\r\n if (item)\r\n this.tb.makeInsertion(0, { render: () => this.renderParagraphItem(item) });\r\n else if (blockType == Model.TextBlockType.List)\r\n this.tb.makeInsertion(0, { render: () => this.renderParagraphList() });\r\n\r\n //// render segment marks\r\n //for (let j = 0; j < segments.length; j++) {\r\n // const segment = segments[j];\r\n // // do not render a segment mark at the end of the paragraph\r\n // try {\r\n // if (segment.anchor! < this.text.length)\r\n // this.insertSegmentMark(this.tb, segment.anchor!, segment.number!);\r\n // } catch (e) {\r\n // console.error(e);\r\n // }\r\n //}\r\n }\r\n\r\n insertInlineAnnotations(annotations: AnnotationSpecs[]) {\r\n for (let i = 0; i < annotations.length; i++) {\r\n try {\r\n const annotation = annotations[i];\r\n const anchor = annotation.anchor!;\r\n const offset = this.getTxtIdxForAnchor(anchor, this.text.length);\r\n\r\n this.insertInlineAnnotation(this.tb, offset, annotation);\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }\r\n }\r\n\r\n makeRangesOfMarkers(markers: MarkerSpecs[], styles: Model.StyleVM[]) {\r\n for (let i = 0; i < markers.length; i++) {\r\n const marker = markers[i];\r\n const anchor = marker.anchorState;\r\n if (anchor.start === undefined || anchor.end === undefined || anchor.start == anchor.end) {\r\n console.warn(\"marker with empty anchor.\");\r\n continue;\r\n }\r\n if (marker.styleId === undefined) {\r\n console.warn(\"marker has no style.\");\r\n continue;\r\n }\r\n\r\n const startIdx = anchor.start;\r\n const endIdx = anchor.end;\r\n const styleId = marker.styleId;\r\n\r\n try {\r\n this.tb.makeRange(startIdx, endIdx - startIdx, {\r\n render: (text: string, offset: number, length: number) => this.renderRange(text, offset, length, styleId, styles)\r\n });\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }\r\n }\r\n\r\n render(): JSX.Element {\r\n\r\n let elems: JSX.Element[] = [];\r\n\r\n const ranges = this.tb.getElements();\r\n for (let j = 0; j < ranges.length; j++) {\r\n const range = ranges[j];\r\n\r\n if (range.data) {\r\n let elem = (range.data as ItemRenderer).render(range.text, range.offset, range.length);\r\n if (elem)\r\n elems.push(elem);\r\n } else {\r\n let elem = {range.text};\r\n elems.push(elem);\r\n }\r\n }\r\n\r\n let style: React.CSSProperties = {};\r\n if (this.type == Model.TextBlockType.FloatRight)\r\n style.textAlign = \"right\";\r\n if (this.type == Model.TextBlockType.Header)\r\n style.fontWeight = \"bold\";\r\n\r\n return (\r\n
    \r\n
    \r\n {elems}\r\n
    \r\n
    \r\n );\r\n }\r\n\r\n}","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../debug';\r\nimport * as _ from 'lodash';\r\n\r\n// localized ressources\r\nimport { localized } from \"../../ressources\";\r\nimport { styles } from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as TableOfContentsStore from '../../store/TableOfContents';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\nimport { MarkerItem, ContentParagraphItem } from '../../store/ViewRegistry/items';\r\nimport { SelectionState } from '../../store/ViewRegistry/toolbar';\r\n\r\n// component dependencies\r\nimport { StyleFactory } from \"../../utils/StyleFactory\";\r\nimport { ParagraphBuilder } from \"./ParagraphBuilder\";\r\nimport { ConnectedAnnotation, AnnotationSpecs } from \"./Annotation\";\r\nimport { ParagraphRef, MarkerRef, AnnotationRef } from \"./Content\";\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\";\r\nimport { SyncState, SyncStateUtil } from \"../../utils/SyncState\";\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\n\r\nexport interface ContentParagraphProps {\r\n productId: string,\r\n label: string,\r\n editScopeId: string | null,\r\n paragraphKey: string,\r\n\r\n language: Model.Language,\r\n\r\n styles: Model.StyleVM[],\r\n viewOptions: UserProfileStore.ViewOptions,\r\n\r\n canEdit: boolean,\r\n\r\n noNewAnnotations?: boolean,\r\n noNewStickyNote?: boolean,\r\n\r\n focussedAnnotationId?: string,\r\n\r\n markers: MarkerRef[],\r\n annotations: AnnotationRef[],\r\n\r\n onFocusChanged(hasFocus: boolean): void,\r\n onSelectionChanged(selection: SelectionState | undefined, selectionAligned: SelectionState | undefined): void,\r\n\r\n par: ContentParagraphItem,\r\n isOptOut: boolean\r\n}\r\n\r\nexport interface ContentParagraphState {\r\n hasFocus: boolean,\r\n hasSelection: boolean,\r\n}\r\n\r\n/** edit something using draft-js\r\n * @description Important: derived classes need to set the state in the construtor. BaseEditorState can be obtained via initStateFromProps.\r\n */\r\nexport class ContentParagraph extends React.Component {\r\n\r\n constructor(props: ContentParagraphProps) {\r\n super(props);\r\n\r\n // here we can't use lambdas since we need to detach the same function when dismounting\r\n this.handleSelectionChange = this.handleSelectionChange.bind(this);\r\n this.handleSelectionStart = this.handleSelectionStart.bind(this);\r\n\r\n this.state = { hasFocus: false, hasSelection: false };\r\n }\r\n\r\n componentDidMount() {\r\n document.addEventListener(\"selectionchange\", this.handleSelectionChange);\r\n document.addEventListener(\"selectstart\", this.handleSelectionStart);\r\n }\r\n\r\n componentWillUnmount() {\r\n document.removeEventListener(\"selectionchange\", this.handleSelectionChange);\r\n document.removeEventListener(\"selectstart\", this.handleSelectionStart);\r\n }\r\n\r\n //shouldComponentUpdate(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean {\r\n // let modifed = !_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState);\r\n // Debug.log(`ContentParagraph.shouldComponentUpdate (${modifed})`);\r\n\r\n // // update is caused by notes since 'notes: NoteItem[]' is recreated by projection\r\n // let shallowEquals = Debug.shallowEqual(this.props, nextProps);\r\n\r\n // return modifed;\r\n //}\r\n\r\n render() {\r\n\r\n Debug.log(`ContentParagraph.render: ${this.props.label}/${this.props.par.key}`, \"render\");\r\n\r\n const par = this.props.par;\r\n const textState = par.textState[this.props.language];\r\n const styles = this.props.styles;\r\n\r\n let annotationSpecs = this.props.annotations.map(ann => ({\r\n id: ann.id,\r\n label: ann.label,\r\n anchorLanguage: ann.anchorLanguage,\r\n anchor: ann.anchorState,\r\n disableInline: false,\r\n optOut: false,\r\n peerHasFocus: false,\r\n } as AnnotationSpecs));\r\n\r\n let pb = new ParagraphBuilder(\r\n par.item!,\r\n par.blockType!,\r\n par.level!,\r\n textState.text);\r\n\r\n pb.insertInlineAnnotations(annotationSpecs);\r\n pb.makeRangesOfMarkers(this.props.markers, styles);\r\n\r\n let body = pb.render();\r\n\r\n let style: React.CSSProperties = { paddingLeft: this.props.par.level! * 10 };\r\n\r\n //if (this.state.hasSelection)\r\n // style.backgroundColor = \"#ccf\";\r\n\r\n let className = \"content\";\r\n\r\n if (this.props.isOptOut)\r\n className += \" opted-out\";\r\n\r\n return (\r\n
    this.handleFocus()} onBlur={() => this.handleBlur()}>\r\n {body}\r\n
    \r\n );\r\n }\r\n\r\n handleFocus() {\r\n this.props.onFocusChanged(true);\r\n this.setState({ hasFocus: true, hasSelection: false });\r\n }\r\n\r\n handleBlur() {\r\n this.props.onFocusChanged(false);\r\n this.setState({ hasFocus: false, hasSelection: false });\r\n }\r\n\r\n handleSelectionChange(evt: Event) {\r\n this.handleSelectionStateChanged();\r\n }\r\n\r\n handleSelectionStart(evt: Event) {\r\n // IE hack\r\n setTimeout(() => {\r\n this.handleSelectionStateChanged();\r\n }, 50);\r\n //setTimeout(() => {\r\n // this.handleSelectionStateChanged();\r\n //}, 500);\r\n }\r\n\r\n handleSelectionStateChanged() {\r\n\r\n if (!this.state.hasFocus) {\r\n if (this.state.hasSelection)\r\n this.setState({ hasSelection: false });\r\n return;\r\n }\r\n\r\n const unselect = () => {\r\n this.props.onSelectionChanged(undefined, undefined);\r\n if (this.state.hasSelection)\r\n this.setState({ hasSelection: false });\r\n };\r\n\r\n const selection = getSelection();\r\n if (!selection || selection.isCollapsed || selection.rangeCount < 1) {\r\n return unselect();\r\n }\r\n\r\n const section = this.refs.section as HTMLDivElement;\r\n const range = selection.getRangeAt(0);\r\n if (!this.isRangeInside(range, section)) {\r\n return unselect();\r\n }\r\n\r\n const textState = this.props.par.textState[this.props.language];\r\n const text = textState.text;\r\n\r\n let anchorIdx = this.getBlockSpanIndex(section, selection.anchorNode as Element, selection.anchorOffset);\r\n if (anchorIdx == null)\r\n anchorIdx = text.length;\r\n let focusIdx = this.getBlockSpanIndex(section, selection.focusNode as Element, selection.focusOffset);\r\n if (focusIdx == null)\r\n focusIdx = text.length;\r\n\r\n if (anchorIdx < 0 || focusIdx < 0) {\r\n console.warn(\"cannot determine offsets (\" + anchorIdx + \"-\" + focusIdx + \"; text=\" + selection.toString() + \")\");\r\n Debug.log(`ContentParagraph.handleSelectionStateChanged: WARNING cannot determine offsets (${anchorIdx}-${focusIdx}; text=${selection.toString()})`, \"selection\");\r\n return unselect();\r\n }\r\n else if (anchorIdx == focusIdx) {\r\n console.debug(\"selection effectively collapsed (\" + anchorIdx + \"-\" + focusIdx + \"; text=\" + selection.toString() + \")\");\r\n Debug.log(`ContentParagraph.handleSelectionStateChanged: selection effectively collapsed (${anchorIdx}-${focusIdx}; text=${selection.toString()})`, \"selection\");\r\n return unselect();\r\n }\r\n\r\n let startIdx = Math.min(anchorIdx, focusIdx);\r\n let endIdx = Math.max(anchorIdx, focusIdx);\r\n\r\n const parSelection: SelectionState = { start: startIdx, end: endIdx };\r\n\r\n while (startIdx < text.length && text[startIdx] == \" \") {\r\n startIdx++;\r\n }\r\n while (endIdx - 1 >= 0 && text[endIdx - 1] == \" \") {\r\n endIdx--;\r\n }\r\n\r\n Debug.log(`ContentParagraph.handleSelectionStateChanged(${parSelection.start}-${parSelection.end})`, \"selection\");\r\n\r\n this.props.onSelectionChanged(parSelection, endIdx <= startIdx ? undefined : { start: startIdx, end: endIdx });\r\n this.setState({ hasSelection: true });\r\n }\r\n\r\n private isRangeInside(range: Range, section: Element) {\r\n let current: Node | null = range.commonAncestorContainer;\r\n while (current && section != current) {\r\n current = current.parentNode;\r\n }\r\n return section == current;\r\n }\r\n\r\n private getTextLength(node: Node) {\r\n return node.textContent ? node.textContent.length : 0;\r\n }\r\n\r\n private getTextOffset(node: Element, offset: number): number {\r\n if (offset == 0) {\r\n return 0;\r\n }\r\n else if (node.nodeType == Node.TEXT_NODE) {\r\n return offset;\r\n }\r\n else {\r\n let textOffset = 0;\r\n for (let i = 0; i < offset; i++) {\r\n let child = node.childNodes[i];\r\n textOffset += this.getTextLength(child);\r\n }\r\n return textOffset\r\n }\r\n }\r\n\r\n private getBlockSpanIndex(container: HTMLDivElement, node: Element, offset: number): number {\r\n\r\n if (node == container)\r\n return -1;\r\n\r\n let textOffset = this.getTextOffset(node, offset);\r\n\r\n // !!! this depends on the implementation of ParagraphBuilder !!!\r\n while ((node.parentNode as Element).className != \"p\") {\r\n node = node.parentNode as Element;\r\n }\r\n\r\n let idx = node.getAttribute(\"data-idx\");\r\n\r\n while (idx == null && node.nextElementSibling) {\r\n node = node.nextElementSibling;\r\n idx = node.getAttribute(\"data-idx\");\r\n textOffset = 0;\r\n }\r\n\r\n return idx != null ? (Number(idx) + textOffset) : -1;\r\n }\r\n}\r\n\r\nexport const ConnectedContentParagraph = connect(\r\n (state: ApplicationState, ownProps: {\r\n label: string,\r\n editScopeId: string | null,\r\n paragraphKey: string,\r\n\r\n language: Model.Language,\r\n\r\n styles: Model.StyleVM[],\r\n viewOptions: UserProfileStore.ViewOptions,\r\n\r\n canEdit: boolean,\r\n isOptOut: boolean,\r\n\r\n noNewAnnotations?: boolean,\r\n noNewStickyNote?: boolean,\r\n\r\n focussedAnnotationId?: string,\r\n\r\n markers: MarkerRef[],\r\n annotations: AnnotationRef[],\r\n\r\n onFocusChanged(hasFocus: boolean): void,\r\n onSelectionChanged(selection: SelectionState | undefined, selectionAligned: SelectionState | undefined): void,\r\n }) => {\r\n\r\n const content = state.viewRegistry.contents[ownProps.label]!;\r\n if (content.type != 'Content')\r\n throw new TypeError(); \r\n\r\n const paragraph = content.paragraphs.filter(par => par.key == ownProps.paragraphKey)[0];\r\n\r\n return {\r\n ...ownProps,\r\n par: paragraph,\r\n } as ContentParagraphProps;\r\n }\r\n)(ContentParagraph);\r\n","import * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Modal } from '../../libs/material-ui';\r\nimport * as _ from 'lodash';\r\nimport * as Debug from '../../debug';\r\n\r\n// localized ressources\r\nimport { localized } from \"../../ressources\"\r\nimport { styles } from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\nimport {\r\n ContentItem, ContentParagraphItem, AnnotationItem, NoteItem, MarkerItem,\r\n LinkedContentItem, AnchorState, getBestLanguage\r\n} from '../../store/ViewRegistry/items';\r\nimport { findLinkedContentItem } from '../../store/ViewRegistry/linkedContents';\r\nimport { ContentToolbarTarget } from '../../store/ViewRegistry/toolbar';\r\n\r\n// component dependencies\r\nimport { TwoColumn } from '../shared/TwoColumn';\r\nimport { OneColumnGrid, OneColumnItem } from '../shared/OneColumnGrid';\r\nimport { ConnectedContentHeader } from \"./ContentHeader\";\r\nimport { ConnectedContentParagraph } from \"./ContentParagraph\";\r\nimport { ConnectedAnnotation, AnnotationSpecs } from \"./Annotation\";\r\nimport { ConnectedNote } from \"./Note\";\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\";\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\nimport { Dictionary } from 'lodash';\r\nimport { SyncStateUtil } from '../../utils/SyncState';\r\nimport { SelectionState } from '../../store/ViewRegistry/toolbar';\r\nimport { Language } from '../../viewmodels/EPCDataModel';\r\nimport { ViewOptions } from '../../store/UserProfile';\r\nimport { CSSProperties } from '@material-ui/core/styles/withStyles';\r\n\r\nimport { renderButton } from './ContentOutline/button';\r\n\r\nconst linktarget = \"_self\";\r\n\r\ntype ContentProps =\r\n {\r\n loaderState: LoaderState,\r\n\r\n label: string,\r\n small: boolean,\r\n hideBody: boolean,\r\n isOptOut: boolean,\r\n linkedContentItemId: string | null,\r\n isHighlighted: boolean,\r\n\r\n isOutdated: boolean,\r\n\r\n header: HeaderRef | null,\r\n body: BodyRef | null,\r\n paragraphs: ParagraphRef[] | null,\r\n\r\n viewOptions: UserProfileStore.ViewOptions,\r\n styles: Model.StyleVM[],\r\n\r\n //content: ContentItem,\r\n //userProfile: UserProfileStore.UserProfileState,\r\n }\r\n & typeof ViewRegistryStore.actionCreators\r\n & StyledComponentProps;\r\n\r\nexport class Content extends React.Component {\r\n\r\n constructor(props: ContentProps) {\r\n super(props);\r\n }\r\n\r\n shouldComponentUpdate(nextProps: Readonly, nextContext: any): boolean {\r\n let modifed = !_.isEqual(this.props, nextProps);\r\n Debug.log(`Content.shouldComponentUpdate (${nextProps.label}, ${modifed})`, \"render\");\r\n return modifed;\r\n }\r\n\r\n render() {\r\n\r\n const loaderState = this.props.loaderState;\r\n if (!LoaderStateUtil.isLoaded(loaderState)) {\r\n return LoaderStateUtil.renderDefault(loaderState);\r\n }\r\n\r\n const header = this.props.header;\r\n const body = this.props.body;\r\n const paragraphs = this.props.paragraphs || [];\r\n const isHighlighted = this.props.isHighlighted;\r\n\r\n if (!header || !body) {\r\n return LoaderStateUtil.renderDefault(LoaderStateUtil.getLoading());\r\n }\r\n\r\n Debug.log(`Content.render: ${header.label}`, \"render\");\r\n\r\n const isOutdated = this.props.isOutdated;\r\n const isSmall = this.props.small;\r\n const md = isSmall ? 12 : 6;\r\n const xs = 12;\r\n\r\n const opts = this.props.viewOptions;\r\n const editScopeId = opts.editScopeId;\r\n const canEdit = !!editScopeId && !opts.readOnly;\r\n const displayHidden = opts.displayHidden;\r\n\r\n let style: React.CSSProperties = { fontStyle: isOutdated ? 'italic' : undefined };\r\n if (isHighlighted) {\r\n //style.background = \"#ffffcf\";\r\n style.border = \"solid yellow 2px\"; \r\n }\r\n\r\n return (\r\n
    \r\n\r\n
    \r\n\r\n
    \r\n \r\n \r\n {this.renderHeader(header)}\r\n \r\n \r\n {this.renderAnnotations(canEdit, header.annotations, false, isSmall ? undefined : styles.contentHeader) /* use title language? does not seem to matter. */}\r\n \r\n \r\n \r\n \r\n {this.renderNotes(canEdit, header.notes, !isSmall)}\r\n \r\n \r\n
    \r\n\r\n {this.props.hideBody ? false : this.renderBody(body, paragraphs)}\r\n\r\n
    \r\n \r\n \r\n {this.renderAnnotations(canEdit, body.annotations, !isSmall) /* there is no body language */}\r\n {this.renderAddFooterAnnotation(canEdit)}\r\n \r\n \r\n
    \r\n\r\n
    \r\n
    \r\n );\r\n }\r\n\r\n renderHeader(header: HeaderRef) {\r\n\r\n return this.handleParagraphFocusChanged(Model.ReservedParagraphKeys.Title, header.titleLanguage, hasFocus)} />;\r\n }\r\n\r\n renderBody(body: BodyRef, paragraphs: ParagraphRef[]): JSX.Element[] | false {\r\n\r\n const isSmall = this.props.small;\r\n const isOptOut = this.props.isOptOut;\r\n const md = isSmall ? 12 : 6;\r\n const xs = 12;\r\n\r\n const viewOptions = this.props.viewOptions;\r\n const editScopeId = viewOptions.editScopeId;\r\n const canEdit = !!editScopeId && !viewOptions.readOnly;\r\n\r\n if (!paragraphs || paragraphs.length == 0) {\r\n console.info(`Content ${body.label} has no body.`);\r\n return false;\r\n }\r\n\r\n let keys = paragraphs.map(paragraph => paragraph.key);\r\n if (_.uniq(keys).length != keys.length) {\r\n console.warn(`${body.label}: paragraph keys not unique: ${keys}`);\r\n }\r\n\r\n let firstPar = 0;\r\n let lastPar = paragraphs.length - 1;\r\n let singlePar = paragraphs.length == 1;\r\n\r\n let renderedPars: JSX.Element[] = [];\r\n let isEllipsis = false;\r\n\r\n for (let i = firstPar; i <= lastPar; i++) {\r\n const paragraph = paragraphs[i];\r\n\r\n if (paragraph.isOptOut && !viewOptions.displayHidden) {\r\n if (!isEllipsis) {\r\n isEllipsis = true;\r\n\r\n renderedPars.push(\r\n
    \r\n ...\r\n
    \r\n );\r\n }\r\n }\r\n else {\r\n isEllipsis = false;\r\n\r\n let parAnnotationsAside = paragraph.annotations.filter(ann => !ann.isInline);\r\n let parAnnotationsInline = paragraph.annotations.filter(ann => ann.isInline);\r\n\r\n let renderedPar = (\r\n
    \r\n \r\n \r\n this.handleParagraphFocusChanged(paragraph.key, paragraph.language, hasFocus)}\r\n onSelectionChanged={(sel, sela) => this.handleParagraphSelectionChanged(paragraph.key, paragraph.language, sel, sela)}\r\n />\r\n \r\n \r\n {this.renderAnnotations(canEdit, parAnnotationsAside, false)}\r\n \r\n \r\n \r\n \r\n {this.renderNotes(canEdit, paragraph.notes, !isSmall)}\r\n \r\n \r\n
    \r\n );\r\n renderedPars.push(renderedPar);\r\n }\r\n }\r\n\r\n return renderedPars;\r\n }\r\n\r\n renderAnnotations(canEdit: boolean, annotations: AnnotationRef[], twocolumn: boolean, style?: React.CSSProperties) {\r\n const xs = 12;\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n renderNotes(canEdit: boolean, notes: NoteRef[], twocolumn: boolean) {\r\n const xs = 12;\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n renderAddFooterAnnotation(canEdit: boolean) {\r\n const $ = localized(this.props.viewOptions.uiLanguage);\r\n return canEdit && renderButton({$('content_body_add_annotation')}, () => this.newFooterAnnotation());\r\n }\r\n\r\n newFooterAnnotation() {\r\n const editScopeId = this.props.viewOptions.editScopeId;\r\n const editLanguage = this.props.viewOptions.editLanguage;\r\n if (!editScopeId || editLanguage === undefined)\r\n return;\r\n this.props.addAnnotation(editScopeId, editLanguage, this.props.label, Model.ReservedParagraphKeys.EntireContent, false);\r\n }\r\n\r\n handleParagraphFocusChanged(parKey: string, language: Model.Language, hasFocus: boolean) {\r\n const header = this.props.header!;\r\n const target = {\r\n type: 'CONTENT_TOOLBAR_TARGET',\r\n label: header.label,\r\n parKey: parKey,\r\n language: language,\r\n linkedContentItemId: this.props.linkedContentItemId,\r\n } as ContentToolbarTarget;\r\n\r\n if (hasFocus) {\r\n this.props.setToolbar(target);\r\n }\r\n else {\r\n this.props.resetToolbar(target);\r\n }\r\n }\r\n\r\n handleParagraphSelectionChanged(parKey: string, language: Model.Language, selection: SelectionState | undefined, selectionAligned: SelectionState | undefined) {\r\n const header = this.props.header!;\r\n\r\n console.log(`handleParagraphSelectionChanged: ${selection}`);\r\n\r\n const target = {\r\n type: 'CONTENT_TOOLBAR_TARGET',\r\n label: header.label,\r\n parKey: parKey,\r\n language: language,\r\n linkedContentItemId: this.props.linkedContentItemId,\r\n } as ContentToolbarTarget;\r\n\r\n if (!!selection)\r\n console.log(`${selection.start}-${selection.end}`);\r\n\r\n this.props.updateToolbar(target, selection, selectionAligned);\r\n }\r\n\r\n static isValidParKey(pk: string, parKeys: string[]) {\r\n return pk == Model.ReservedParagraphKeys.Title ||\r\n pk == Model.ReservedParagraphKeys.EntireContent ||\r\n _.includes(parKeys, pk);\r\n }\r\n\r\n static getParagraphKey(value: { paragraphKey?: string }, parKeys: string[]) {\r\n return value.paragraphKey && Content.isValidParKey(value.paragraphKey!, parKeys) ?\r\n value.paragraphKey :\r\n Model.ReservedParagraphKeys.Lost;\r\n }\r\n}\r\n\r\ntype _ConnectedContentProps = {\r\n label: string,\r\n small: boolean,\r\n hideBody: boolean,\r\n isOptOut: boolean,\r\n isHighlighted: boolean,\r\n linkedContentItemId: string | null,\r\n viewOptions: ViewOptions,\r\n styles: Model.StyleVM[],\r\n content: ContentItem,\r\n linkedContentItem?: LinkedContentItem\r\n}\r\n & typeof ViewRegistryStore.actionCreators\r\n & StyledComponentProps;\r\n\r\nconst _ConnectedContent = (props: _ConnectedContentProps): JSX.Element => {\r\n\r\n Debug.log(`_ConnectedContent.render (${props.label})`, \"render\");\r\n\r\n const { viewOptions, styles, content } = props;\r\n\r\n if (!content || !LoaderStateUtil.isLoaded(content.loaderState)) {\r\n let contentProps: ContentProps & { content?: ContentItem, linkedContentItem?: LinkedContentItem } = {\r\n ...props,\r\n\r\n loaderState: content && content.loaderState || LoaderStateUtil.getEmpty(),\r\n\r\n isOutdated: false,\r\n isHighlighted: props.isHighlighted,\r\n\r\n header: null,\r\n body: null,\r\n paragraphs: null,\r\n\r\n viewOptions: viewOptions,\r\n styles: styles\r\n };\r\n\r\n // important! remove content item from properties to avoid unnecessary re-renders\r\n contentProps.content = undefined;\r\n contentProps.linkedContentItem = undefined;\r\n\r\n return ;\r\n }\r\n else {\r\n const contentRef = {\r\n label: content.label,\r\n };\r\n\r\n const displayHidden = props.viewOptions.displayHidden;\r\n const parKeys = content.paragraphs.map(paragraph => paragraph.key);\r\n const titleState = getBestLanguage(viewOptions.languages, content.titleState)!;\r\n\r\n const annotationIds = _.values(content.annotations).map(a => a.id);\r\n\r\n const header: HeaderRef = {\r\n ...contentRef,\r\n titleLanguage: (titleState && titleState.language) || Model.Language.Any,\r\n small: props.small,\r\n annotations: _.values(content.annotations)\r\n .filter(annotation => annotation.paragraphKey == Model.ReservedParagraphKeys.Title)\r\n .filter(annotation => !annotation.isOptOut || displayHidden)\r\n .map(annotation => ({\r\n ...contentRef,\r\n id: annotation.id,\r\n anchorState: null,\r\n anchorLanguage: Model.Language.Any,\r\n isInline: false,\r\n notes: _.values(content.notes)\r\n .filter(note => note.annotationId == annotation.id)\r\n .filter(note => !note.isOptOut || displayHidden)\r\n .map(note => ({\r\n ...contentRef,\r\n id: note.id,\r\n }))\r\n })),\r\n notes: _.values(content.notes)\r\n .filter(note => note.paragraphKey == Model.ReservedParagraphKeys.Title)\r\n .filter(note => !annotationIds.includes(note.annotationId || \"xxx\"))\r\n .filter(note => !note.isOptOut || displayHidden)\r\n .map(note => ({\r\n ...contentRef,\r\n id: note.id,\r\n }))\r\n };\r\n\r\n const body: BodyRef = {\r\n ...contentRef,\r\n hideBody: props.hideBody,\r\n annotations: _.values(content.annotations)\r\n .filter(annotation =>\r\n annotation.paragraphKey == Model.ReservedParagraphKeys.EntireContent ||\r\n annotation.paragraphKey == Model.ReservedParagraphKeys.Lost/* ||\r\n !_.includes(parKeys, annotation.paragraphKey)*/)\r\n .filter(annotation => !annotation.isOptOut || displayHidden)\r\n .map(annotation => ({\r\n ...contentRef,\r\n id: annotation.id,\r\n isInline: false,\r\n anchorState: null,\r\n anchorLanguage: Model.Language.Any,\r\n notes: _.values(content.notes)\r\n .filter(note => note.annotationId == annotation.id)\r\n .filter(note => !note.isOptOut || displayHidden)\r\n .map(note => ({\r\n ...contentRef,\r\n id: note.id,\r\n }))\r\n })),\r\n notes: _.values(content.notes)\r\n .filter(note =>\r\n note.paragraphKey == Model.ReservedParagraphKeys.EntireContent ||\r\n note.paragraphKey == Model.ReservedParagraphKeys.Lost /*||\r\n !_.includes(parKeys, note.paragraphKey)*/)\r\n .filter(note => !note.isOptOut || displayHidden)\r\n .map(note => ({\r\n ...contentRef,\r\n id: note.id,\r\n }))\r\n }\r\n\r\n const paragraphs: ParagraphRef[] = content.paragraphs.map(paragraph => {\r\n const paragraphLanguage = getBestLanguage(viewOptions.languages, paragraph.textState)!.language;\r\n return {\r\n ...contentRef,\r\n key: paragraph.key,\r\n language: paragraphLanguage,\r\n isOptOut: !!(props.linkedContentItem && _.includes(props.linkedContentItem.paragraphOptOut, paragraph.key)),\r\n markers: _.values(content.markers)\r\n .filter(marker => marker.paragraphKey == paragraph.key)\r\n .filter(marker => marker.language == paragraphLanguage)\r\n .map(marker => ({\r\n ...contentRef,\r\n id: marker.id,\r\n anchorState: marker.anchorState,\r\n styleId: marker.styleId,\r\n })),\r\n annotations: _.values(content.annotations)\r\n .filter(marker => marker.paragraphKey == paragraph.key)\r\n .filter(annotation => !annotation.isOptOut || displayHidden)\r\n .map(annotation => ({\r\n ...contentRef,\r\n id: annotation.id,\r\n anchorState: annotation.anchorState[paragraphLanguage],\r\n anchorLanguage: paragraphLanguage,\r\n isInline: annotation.isInline,\r\n notes: _.values(content.notes)\r\n .filter(note => note.annotationId == annotation.id)\r\n .filter(note => !note.isOptOut || displayHidden)\r\n .map(note => ({\r\n ...contentRef,\r\n id: note.id,\r\n }))\r\n })),\r\n notes: _.values(content.notes)\r\n .filter(note => note.paragraphKey == paragraph.key)\r\n .filter(note => !note.isOptOut || displayHidden)\r\n .map(note => ({\r\n ...contentRef,\r\n id: note.id,\r\n }))\r\n }\r\n });\r\n\r\n let contentProps: ContentProps & { content?: ContentItem, linkedContentItem?: LinkedContentItem } = {\r\n ...props,\r\n\r\n loaderState: content.loaderState,\r\n\r\n isOutdated: content.isOutdated,\r\n isHighlighted: props.isHighlighted,\r\n\r\n header,\r\n body,\r\n paragraphs,\r\n\r\n viewOptions: viewOptions,\r\n styles: styles\r\n };\r\n\r\n // important! remove content item from properties to avoid unnecessary re-renders\r\n contentProps.content = undefined;\r\n contentProps.linkedContentItem = undefined;\r\n\r\n return ;\r\n }\r\n};\r\n\r\nexport const ConnectedContent = connect(\r\n (state: ApplicationState, ownProps: {\r\n label: string,\r\n small: boolean,\r\n hideBody: boolean,\r\n isOptOut: boolean,\r\n linkedContentItemId: string | null,\r\n isHighlighted: boolean\r\n }) => {\r\n\r\n //Debug.log(`ConnectedContent.mapToProps (${ownProps.label})`);\r\n\r\n // project the content such that changed in annotations / notes / maybe marks won't trigger a full re-render of the content\r\n // HACK see shouldComponentUpdate\r\n\r\n const viewOptions = state.userProfile.viewOptions;\r\n const styles = (state.userProfile.preferences && state.userProfile.preferences.styles) || [];\r\n const content = state.viewRegistry.contents[ownProps.label] as ContentItem;\r\n\r\n let linkedContentItem: LinkedContentItem | undefined;\r\n if (ownProps.linkedContentItemId) {\r\n linkedContentItem = findLinkedContentItem(state.viewRegistry.linkedContentRoot, ownProps.linkedContentItemId) || undefined;\r\n }\r\n\r\n return {\r\n ...ownProps,\r\n viewOptions,\r\n styles,\r\n content,\r\n linkedContentItem,\r\n };\r\n },\r\n dispatch => bindActionCreators(ViewRegistryStore.actionCreators, dispatch)\r\n)(_ConnectedContent);\r\n\r\ninterface ContentRef {\r\n label: string,\r\n}\r\n\r\nexport interface HeaderRef extends ContentRef {\r\n titleLanguage: Model.Language,\r\n small: boolean,\r\n annotations: AnnotationRef[],\r\n notes: NoteRef[],\r\n}\r\n\r\nexport interface BodyRef extends ContentRef {\r\n hideBody: boolean,\r\n annotations: AnnotationRef[],\r\n notes: NoteRef[],\r\n}\r\n\r\nexport interface ParagraphRef extends ContentRef {\r\n key: string,\r\n language: Model.Language,\r\n markers: MarkerRef[],\r\n annotations: AnnotationRef[],\r\n notes: NoteRef[],\r\n isOptOut: boolean,\r\n}\r\n\r\nexport interface MarkerRef {\r\n id: string,\r\n styleId: string,\r\n anchorState: AnchorState,\r\n}\r\n\r\nexport interface AnnotationRef extends ContentRef {\r\n id: string,\r\n isInline: boolean,\r\n anchorState: AnchorState | null,\r\n anchorLanguage: Model.Language,\r\n notes: NoteRef[],\r\n}\r\n\r\nexport interface NoteRef extends ContentRef {\r\n id: string,\r\n}\r\n\r\n","import * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../debug';\r\nimport * as ScopeUtils from '../../utils/ScopeUtils';\r\nimport * as _ from 'lodash';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\nimport { CommentItem, getBestLanguage } from '../../store/ViewRegistry/items';\r\nimport { CommentEditorTarget } from '../../store/ViewRegistry/toolbar';\r\n\r\n// component dependencies\r\nimport * as Draft from \"draft-js\";\r\nimport { Editor } from \"../edit/Editor\"\r\nimport { StyleFactory } from '../../utils/StyleFactory';\r\nimport { OneColumnGrid, OneColumnItem } from '../shared/OneColumnGrid';\r\nimport { ConnectedNote } from \"./Note\";\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\nimport { SyncStateUtil, SyncState } from \"../../utils/SyncState\"\r\nimport * as Model from \"../../viewmodels/EPCDataModel\"\r\n\r\nconst linktarget = \"_self\";\r\n\r\ntype CommentProps =\r\n {\r\n label: string,\r\n small: boolean,\r\n isOptOut: boolean,\r\n isHighlighted: boolean,\r\n\r\n linkedContentItemId: string | null,\r\n\r\n comment: CommentItem,\r\n userProfile: UserProfileStore.UserProfileState\r\n }\r\n & typeof ViewRegistryStore.actionCreators\r\n & StyledComponentProps;\r\n\r\ninterface CommentState {\r\n hasFocus: boolean\r\n}\r\n\r\nexport class Comment extends React.Component {\r\n\r\n constructor(props: CommentProps) {\r\n super(props);\r\n this.state = { hasFocus: false };\r\n }\r\n\r\n //shouldComponentUpdate(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean {\r\n // let modifed = !_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState);\r\n // Debug.log(`Comment.shouldComponentUpdate (${modifed})`);\r\n\r\n // let shallowEquals = Debug.shallowEqual(this.props, nextProps);\r\n\r\n // return modifed;\r\n //}\r\n\r\n render() {\r\n const xs = 12;\r\n\r\n if (!LoaderStateUtil.isLoaded(this.props.userProfile.loaderState) ||\r\n !LoaderStateUtil.isLoaded(this.props.comment.loaderState)) {\r\n return LoaderStateUtil.renderDefault(this.props.comment.loaderState);\r\n }\r\n\r\n Debug.log(`Comment.render: ${this.props.comment.label}`, \"render\");\r\n\r\n const comment = this.props.comment;\r\n const styles = this.props.userProfile.preferences!.styles!;\r\n const viewOptions = this.props.userProfile.viewOptions;\r\n const $ = localized(viewOptions.uiLanguage);\r\n\r\n const notes = _.values(comment.notes);\r\n\r\n const scope = ScopeUtils.getScope(comment.scopeId, viewOptions.scopes);\r\n const editScopeId = viewOptions.editScopeId;\r\n const canEditBody = this.canEdit(viewOptions, comment);\r\n const isDeleted = !!comment.isDeleted;\r\n const isHighlighted = this.props.isHighlighted;\r\n\r\n if (isDeleted)\r\n return false;\r\n\r\n const customStyles = StyleFactory.getCssStyles(styles);\r\n\r\n const draft = getBestLanguage(viewOptions.languages, comment.draftState)!;\r\n const isFallback = draft.language !== viewOptions.editLanguage;\r\n\r\n let className = \"comment tbowner\";\r\n if (!canEditBody)\r\n className += \" comment-readonly\";\r\n if (isFallback)\r\n className += \" comment-fallback\"; //TODO\r\n if (this.props.isOptOut)\r\n className += \" opted-out\";\r\n if (scope && scope.typeOfScope == Model.TypeOfScope.User)\r\n className += \" comment-personal\";\r\n if (scope && scope.typeOfScope == Model.TypeOfScope.Author && scope.level > 1) // TODO use extra property\r\n {\r\n className += \" comment-update\";\r\n if (comment.isDraftOutOfSync)\r\n className += \" comment-outofsync\";\r\n }\r\n\r\n if (this.state.hasFocus)\r\n className += \" comment-focus tbowner-active\";\r\n if (draft.syncState.isModified)\r\n className += \" comment-modified\";\r\n if (draft.syncState.hasError)\r\n className += \" comment-error\";\r\n\r\n let style: React.CSSProperties = { };\r\n if (isHighlighted) {\r\n //style.background = \"#ffffcf\";\r\n style.border = \"solid yellow 2px\";\r\n }\r\n\r\n const editorState = draft.editor;\r\n\r\n return (\r\n
    \r\n\r\n {this.renderTitle()}\r\n\r\n
    \r\n this.handleDraftChange(newEditorState)}\r\n onFocusChanged={hasFocus => this.handleDraftFocusChanged(hasFocus)}\r\n />\r\n
    \r\n \r\n
    \r\n );\r\n }\r\n\r\n renderTitle() {\r\n\r\n const comment = this.props.comment;\r\n const viewOptions = this.props.userProfile.viewOptions;\r\n\r\n const title = getBestLanguage(viewOptions.languages, comment.titleState)!;\r\n const isFallback = title.language !== viewOptions.editLanguage;\r\n\r\n const scope = ScopeUtils.getScope(comment.scopeId, viewOptions.scopes);\r\n const editScopeId = viewOptions.editScopeId;\r\n const canEditTitle = this.canEdit(viewOptions, comment);\r\n\r\n //TODO is there a property in the db?\r\n const hideTitle = title.text == null && !canEditTitle;\r\n\r\n let className = \"comment bold\";\r\n if (!canEditTitle)\r\n className += \" comment-readonly\";\r\n if (isFallback)\r\n className += \" comment-fallback\"; //TODO\r\n if (this.props.isOptOut)\r\n className += \" opted-out\";\r\n if (this.state.hasFocus)\r\n className += \" comment-focus tbowner-active\";\r\n if (title.syncState.isModified)\r\n className += \" comment-modified\";\r\n if (title.syncState.hasError)\r\n className += \" comment-error\";\r\n if (scope && scope.typeOfScope == Model.TypeOfScope.Author && scope.level > 1) // TODO use extra property\r\n {\r\n if (comment.isTitleOutOfSync)\r\n className += \" comment-outofsync\";\r\n }\r\n\r\n if (hideTitle) {\r\n return false;\r\n }\r\n else if (!canEditTitle) {\r\n return (\r\n
    \r\n {title.text}\r\n
    \r\n );\r\n }\r\n else {\r\n return (\r\n
    \r\n this.handleTitleChange(evt)}\r\n onBlur={evt => this.handleTitleBlur()} />\r\n
    \r\n );\r\n }\r\n }\r\n\r\n private canEdit(opts: UserProfileStore.ViewOptions, comment: CommentItem) {\r\n const editScopeId = opts.editScopeId;\r\n const editLanguage = opts.editLanguage;\r\n return !!editScopeId &&\r\n !opts.readOnly &&\r\n comment.scopeId == editScopeId;\r\n }\r\n\r\n handleDraftChange(newEditorState: Draft.EditorState) {\r\n\r\n const viewOptions = this.props.userProfile.viewOptions;\r\n const comment = this.props.comment;\r\n const draftState = getBestLanguage(viewOptions.languages, comment.draftState)!;\r\n const language = draftState.language;\r\n\r\n // can also be caused by focus change \r\n Debug.log(`Comment.handleDraftChange`, \"draft\");\r\n\r\n this.props.onCommentDraftChanged(comment.label, language, newEditorState);\r\n }\r\n\r\n handleDraftFocusChanged(hasFocus: boolean) {\r\n\r\n const viewOptions = this.props.userProfile.viewOptions;\r\n const comment = this.props.comment;\r\n //const titleState = ViewRegistryStore.getFirstLanguage(comment.titleState);\r\n const draftState = getBestLanguage(viewOptions.languages, comment.draftState)!;\r\n const language = draftState.language;\r\n\r\n Debug.log(`Comment.handleDraftFocusChanged(${hasFocus}, ${comment.label})`, \"focus\");\r\n\r\n const target = {\r\n type: 'COMMENT_EDITOR_TARGET',\r\n label: comment.label,\r\n draftLanguage: language,\r\n } as CommentEditorTarget;\r\n\r\n if (hasFocus) {\r\n this.props.setToolbar(target);\r\n }\r\n else {\r\n this.props.resetToolbar(target);\r\n }\r\n\r\n if (!hasFocus && draftState.syncState.isModified) {\r\n this.props.updateComment(comment.label, language, true, false);\r\n }\r\n\r\n this.setState({ hasFocus });\r\n }\r\n\r\n handleTitleChange(evt: React.ChangeEvent) {\r\n const viewOptions = this.props.userProfile.viewOptions;\r\n const comment = this.props.comment;\r\n const titleState = getBestLanguage(viewOptions.languages, comment.titleState)!;\r\n const language = titleState.language;\r\n\r\n const newTilte = evt.target.value;\r\n\r\n this.props.onCommentTitleChanged(comment.label, language, newTilte);\r\n }\r\n\r\n handleTitleBlur() {\r\n const viewOptions = this.props.userProfile.viewOptions;\r\n const comment = this.props.comment;\r\n const titleState = getBestLanguage(viewOptions.languages, comment.titleState)!;\r\n const language = titleState.language;\r\n\r\n if (titleState.syncState.isModified) {\r\n this.props.updateComment(comment.label, language, false, true);\r\n }\r\n }\r\n}\r\n\r\nexport const ConnectedComment = connect(\r\n (state: ApplicationState, ownProps: {\r\n label: string,\r\n small: boolean,\r\n isOptOut: boolean,\r\n linkedContentItemId: string | null,\r\n isHighlighted: boolean,\r\n }) => {\r\n const comment = state.viewRegistry.contents[ownProps.label];\r\n\r\n if (comment === undefined)\r\n return {\r\n ...ownProps,\r\n comment: {\r\n type: \"Comment\",\r\n loaderState: LoaderStateUtil.getEmpty(),\r\n syncState: SyncStateUtil.getEmpty(),\r\n } as any as CommentItem, // TODO\r\n userProfile: state.userProfile\r\n };\r\n else if (comment.type != 'Comment')\r\n throw new TypeError();\r\n else\r\n return {\r\n ...ownProps,\r\n comment: comment,\r\n userProfile: state.userProfile\r\n };\r\n },\r\n disparch => bindActionCreators(ViewRegistryStore.actionCreators, disparch)\r\n)(Comment);","//RESSOURCE content_outline\r\n\r\nimport * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../debug';\r\nimport * as _ from 'lodash';\r\n\r\n// ressources\r\nimport { localized } from \"../../ressources\";\r\nimport { styles } from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as TableOfContentsStore from '../../store/TableOfContents';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\n\r\n// component dependencies\r\nimport { ErrorContainer } from '../shared/ErrorContainer';\r\nimport { Typography, ExpansionPanel, ExpansionPanelSummary, ExpansionPanelDetails } from '@material-ui/core';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\";\r\nimport {\r\n LinkedContentGroup, LinkedContentItem, ContentItem, FriendlyLabelItem,\r\n getBestLanguage\r\n} from '../../store/ViewRegistry/items';\r\n\r\ntype ContentOverviewProps =\r\n {\r\n userProfile: UserProfileStore.UserProfileState,\r\n\r\n viewRegistry_loaderState: LoaderState,\r\n viewRegistry_productId?: string,\r\n viewRegistry_label?: string,\r\n viewRegistry_content?: ContentItem,\r\n viewRegistry_linkedContentRoot?: LinkedContentGroup,\r\n viewRegistry_friendlyLabels: { [label: string]: FriendlyLabelItem },\r\n\r\n onClick?: (label: string) => void\r\n }\r\n & StyledComponentProps;\r\n\r\ninterface ContentOverviewState {\r\n}\r\n\r\nexport class _ContentOverview extends React.Component {\r\n\r\n constructor(props: ContentOverviewProps) {\r\n super(props);\r\n\r\n this.state = {\r\n };\r\n }\r\n\r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n const loaderState = this.props.viewRegistry_loaderState;\r\n if (!LoaderStateUtil.isLoaded(this.props.userProfile.loaderState) ||\r\n !LoaderStateUtil.isLoaded(loaderState)) {\r\n return LoaderStateUtil.renderDefault(loaderState);\r\n }\r\n\r\n const uiLanguage = this.props.userProfile.viewOptions.uiLanguage;\r\n\r\n const productId = this.props.viewRegistry_productId!;\r\n const label = this.props.viewRegistry_label!;\r\n const content = this.props.viewRegistry_content!;\r\n const linkedContentRoot = this.props.viewRegistry_linkedContentRoot;\r\n const friendlyLabels = this.props.viewRegistry_friendlyLabels!;\r\n\r\n Debug.log(`ContentOverview.render (${label})`, \"render\");\r\n\r\n if (!linkedContentRoot || (linkedContentRoot.items == {} && linkedContentRoot.groups == {}))\r\n return false;\r\n\r\n const classes = this.props.classes || {};\r\n\r\n return (\r\n \r\n }\r\n id=\"panel1a-header\"\r\n >\r\n Overview\r\n \r\n \r\n
      \r\n {this.renderGroup(linkedContentRoot)}\r\n
    \r\n
    \r\n
    \r\n );\r\n\r\n /*
    \r\n {this.renderHeader()}\r\n
      \r\n {this.renderGroup(linkedContentRoot)}\r\n
    \r\n
    */\r\n }\r\n\r\n renderGroup(group: LinkedContentGroup) {\r\n\r\n const items = _.sortBy(_.values(group.items), item => item.sortOrder);\r\n const groups = _.sortBy(_.values(group.groups), group => group.sortOrder);\r\n\r\n return (\r\n \r\n {items.map(i => this.renderItem(i, group.id))}\r\n {groups.map(g => this.renderGroup(g))}\r\n \r\n );\r\n }\r\n\r\n renderItem(item: LinkedContentItem, groupId: string) {\r\n\r\n const friendlyLabels = this.props.viewRegistry_friendlyLabels || {};\r\n const friendlyLabel = friendlyLabels[item.targetLabel];\r\n\r\n if (item.optOut && !this.props.userProfile.viewOptions.displayHidden)\r\n return false;\r\n\r\n return (\r\n
  • \r\n {\r\n if (this.props.onClick)\r\n this.props.onClick(item.targetLabel);\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n }}>\r\n \r\n {(friendlyLabel && friendlyLabel.fullName) || \"loading...\"}\r\n \r\n \r\n
  • \r\n );\r\n }\r\n\r\n renderHeader() {\r\n const { languages } = this.props.userProfile.viewOptions;\r\n const uiLanguage = this.props.userProfile.viewOptions.uiLanguage;\r\n\r\n return

    Overview:

    ;\r\n }\r\n}\r\n\r\nexport const ContentOverview = connect(\r\n (state: ApplicationState) => ({\r\n userProfile: state.userProfile,\r\n viewRegistry_loaderState: state.viewRegistry.loaderState,\r\n viewRegistry_productId: state.userProfile.viewOptions.productId,\r\n viewRegistry_label: state.viewRegistry.label,\r\n viewRegistry_content: state.viewRegistry.label ? state.viewRegistry.contents[state.viewRegistry.label] as ContentItem : undefined,\r\n viewRegistry_linkedContentRoot: state.viewRegistry.linkedContentRoot,\r\n viewRegistry_friendlyLabels: state.viewRegistry.friendlyLabels,\r\n })\r\n)(_ContentOverview);","import * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as Debug from '../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as Nav from \"../../navigation\";\r\n\r\n// localized ressources\r\nimport { localized } from \"../../ressources\"\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as TableOfContentsStore from '../../store/TableOfContents';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\nimport * as ViewRegistryStore from '../../store/ViewRegistry';\r\n\r\n// component dependencies\r\nimport { ErrorContainer } from '../shared/ErrorContainer';\r\nimport { TwoColumn } from '../shared/TwoColumn';\r\nimport { OneColumnGrid, OneColumnItem } from '../shared/OneColumnGrid';\r\nimport * as NCU from \"./NestedContentUtil\";\r\nimport { ConnectedContentOutline } from \"./ContentOutline\";\r\nimport { ConnectedContent } from \"./Content\";\r\nimport { ConnectedComment } from \"./Comment\";\r\nimport { ContentOverview } from \"./ContentOverview\";\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\";\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\nimport { group } from './NestedContentUtil';\r\nimport { LinkedContentItem, ViewRegistryMode, LinkedContentGroup } from '../../store/ViewRegistry/items';\r\nimport { bindActionCreators } from 'redux';\r\n\r\nconst linktarget = \"_self\";\r\n\r\ntype ContentPageProps =\r\n {\r\n tableOfContents: TableOfContentsStore.TableOfContentsState,\r\n userProfile: UserProfileStore.UserProfileState,\r\n\r\n viewRegistry_mode: ViewRegistryMode,\r\n viewRegistry_loaderState: LoaderState,\r\n viewRegistry_isComplete: boolean,\r\n viewRegistry_label?: string,\r\n viewRegistry_linkedContentRoot?: LinkedContentGroup\r\n }\r\n & typeof ViewRegistryStore.actionCreators\r\n & StyledComponentProps\r\n & RouteComponentProps<{}>;\r\n\r\ninterface ContentPageState {\r\n childLabel?: string\r\n};\r\n\r\nexport class ContentPage extends React.Component {\r\n\r\n constructor(props: ContentPageProps) {\r\n super(props);\r\n\r\n this.state = {};\r\n }\r\n\r\n componentDidMount() {\r\n const { label, childLabel } = this.props.match.params as any;\r\n // the store takes care of loading \r\n if (this.props.userProfile.loaderState.isLoaded) {\r\n let scopeIds = this.props.userProfile.viewOptions.readerScopeIds;\r\n let langs = this.props.userProfile.viewOptions.languages;\r\n this.props.requestContent(label, scopeIds, langs, false);\r\n }\r\n\r\n // user friendly label as soon as the root content is loaded\r\n document.title = `EPC.app - ${label}`;\r\n }\r\n\r\n componentDidUpdate(prevProps: ContentPageProps, prevState: ContentPageState) {\r\n const { label, childLabel } = this.props.match.params as any;\r\n // the store takes care of loading \r\n if (this.props.userProfile.loaderState.isLoaded) {\r\n let scopeIds = this.props.userProfile.viewOptions.readerScopeIds;\r\n let langs = this.props.userProfile.viewOptions.languages;\r\n this.props.requestContent(label, scopeIds, langs, false);\r\n }\r\n\r\n if (childLabel && this.state.childLabel != childLabel) {\r\n // check if all nested contents / comments are loaded\r\n this.scrollLabelIntoView(childLabel);\r\n }\r\n }\r\n\r\n scrollLabelIntoView(childLabel: any) {\r\n if (this.props.viewRegistry_loaderState.isLoaded &&\r\n this.props.viewRegistry_isComplete) {\r\n if (this.refs.activeItem && ReactDOM.findDOMNode(this.refs.activeItem)) {\r\n this.scrollIntoView(this.refs.activeItem, true);\r\n this.setState({ childLabel: childLabel });\r\n }\r\n }\r\n }\r\n\r\n _prevent_reset: boolean = false;\r\n\r\n componentWillUnmount() {\r\n if (!this._prevent_reset)\r\n this.props.resetViewRegistry();\r\n }\r\n \r\n scrollIntoView(instance: React.ReactInstance, smooth: boolean) {\r\n let domNode = ReactDOM.findDOMNode(instance);\r\n if (domNode) {\r\n (domNode as Element).scrollIntoView({\r\n behavior: smooth ? 'smooth' : 'auto',\r\n block: 'center',\r\n inline: 'center'\r\n });\r\n }\r\n }\r\n \r\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\r\n console.error(error.message + \"\\r\\n\" + errorInfo.componentStack);\r\n }\r\n\r\n render() {\r\n\r\n const loaderState = this.props.viewRegistry_loaderState;\r\n if (!LoaderStateUtil.isLoaded(this.props.userProfile.loaderState) ||\r\n !LoaderStateUtil.isLoaded(this.props.tableOfContents.loaderState) ||\r\n !LoaderStateUtil.isLoaded(loaderState)) {\r\n return LoaderStateUtil.renderDefault(loaderState);\r\n }\r\n\r\n const mode = this.props.viewRegistry_mode;\r\n const label = this.props.viewRegistry_label!;\r\n const linkedContentRoot = this.props.viewRegistry_linkedContentRoot!;\r\n const { childLabel } = this.props.match.params as any;\r\n\r\n Debug.log(`ContentPage.render: ${label}`, \"render\");\r\n\r\n let groups = NCU.group(linkedContentRoot!, this.props.userProfile.viewOptions.displayHidden);\r\n\r\n const showOverview = label.toUpperCase().startsWith(\"PCT-TOC-\");\r\n\r\n return mode == 'ContentOutline' ? (\r\n
    \r\n \r\n \r\n \r\n
    \r\n ) : (\r\n
    \r\n \r\n \r\n \r\n\r\n {showOverview && this.scrollToChild(childLabel, true)} />}\r\n\r\n {this.renderNestedGroups(groups)}\r\n
    \r\n );\r\n }\r\n\r\n navigateToChild(childLabel: string) {\r\n this._prevent_reset = true;\r\n\r\n const label = this.props.viewRegistry_label!;\r\n const url = Nav.getContentPageUrl(label, childLabel);\r\n this.props.history.push(url);\r\n }\r\n\r\n scrollToChild(childLabel: string, smooth: boolean) {\r\n const child = document.getElementById(childLabel);\r\n if (child) {\r\n child.scrollIntoView({\r\n behavior: smooth ? 'smooth' : 'auto',\r\n block: 'center',\r\n inline: 'center'\r\n });\r\n }\r\n //const children = document.getElementsByName(childLabel);\r\n //if (children.length > 0) {\r\n // children[0].scrollIntoView({\r\n // behavior: smooth ? 'smooth' : 'auto',\r\n // block: 'center',\r\n // inline: 'center'\r\n // });\r\n //}\r\n else {\r\n this.navigateToChild(childLabel);\r\n }\r\n }\r\n\r\n renderNestedGroups(groups: NCU.Group[]) {\r\n if (!groups || groups.length == 0)\r\n return false;\r\n\r\n let elements: JSX.Element[] = [];\r\n\r\n for (let i = 0; i < groups.length; i++) {\r\n\r\n elements.push(
    );\r\n\r\n let group = groups[i];\r\n let entries = group.entries;\r\n\r\n if (group.type == \"small\") {\r\n let inner: JSX.Element[] = [];\r\n\r\n for (let j = 0; j < entries.length; j++) {\r\n let entry = entries[j];\r\n if (entry.type == \"break\") {\r\n }\r\n else if (entry.type == \"header\") {\r\n inner.push(

    {entry.headerText}

    );\r\n }\r\n else {\r\n inner.push(this.renderNestedItem(entry.item!, true));\r\n }\r\n }\r\n\r\n elements.push(\r\n \r\n \r\n \r\n {inner}\r\n \r\n \r\n \r\n );\r\n }\r\n else {\r\n for (let j = 0; j < entries.length; j++) {\r\n let entry = entries[j];\r\n if (entry.type == \"break\") {\r\n }\r\n else if (entry.type == \"header\") {\r\n //elements.push(

    {entry.headerText}

    );\r\n elements.push(\r\n \r\n \r\n \r\n

    {entry.headerText}

    \r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n else {\r\n elements.push(this.renderNestedItem(entry.item!, false));\r\n }\r\n }\r\n }\r\n }\r\n\r\n return elements;\r\n }\r\n\r\n renderNestedItem(item: LinkedContentItem, small: boolean) {\r\n const { childLabel } = this.props.match.params as any;\r\n\r\n if (item.optOut && !this.props.userProfile.viewOptions.displayHidden)\r\n return ;\r\n\r\n return (\r\n \r\n {\r\n item.targetLabel.startsWith(\"COMMENT-\") ?\r\n :\r\n \r\n }\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const ConnectedContentPage = connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n tableOfContents: state.tableOfContents,\r\n userProfile: state.userProfile,\r\n\r\n viewRegistry_mode: state.viewRegistry.mode,\r\n viewRegistry_loaderState: state.viewRegistry.loaderState,\r\n viewRegistry_isComplete: state.viewRegistry.isComplete,\r\n viewRegistry_label: state.viewRegistry.label,\r\n viewRegistry_linkedContentRoot: state.viewRegistry.linkedContentRoot,\r\n }),\r\n dispatch => bindActionCreators(ViewRegistryStore.actionCreators, dispatch)\r\n)(ContentPage);\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps, Redirect } from 'react-router-dom';\r\nimport * as Debug from '../../debug';\r\nimport * as _ from 'lodash';\r\nimport * as Nav from \"../../navigation\";\r\n\r\n// localized ressources\r\nimport { localized } from \"../../ressources\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\";\r\nimport * as WebApi from \"../../webapi\";\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\n\r\nconst linktarget = \"_self\";\r\ntype ContentRedirectPageProps = RouteComponentProps<{}> & { viewOptions: UserProfileStore.ViewOptions };\r\n\r\ninterface ContentRedirectPageState {\r\n parentLabel?: string,\r\n childLabel?: string,\r\n loaderState: LoaderState,\r\n};\r\n\r\nclass ContentRedirectPage extends React.Component {\r\n\r\n constructor(props: ContentRedirectPageProps) {\r\n super(props);\r\n this.state = { loaderState: LoaderStateUtil.getLoading() };\r\n }\r\n\r\n componentDidMount() {\r\n const { label, parKeyOrTag } = this.props.match.params as any;\r\n\r\n //TODO decide whether to navigate to content or open new tab with external url \r\n // depending on whether content is in toc or linked by some content in toc\r\n\r\n // for now, determine based on type of content \r\n\r\n const articleEPC = /EPC-A\\d{3}\\w*--\\d{8}/;\r\n const rfessEPC = /EPC-RFees-A\\d{3}\\w*--\\d{8}/;\r\n const tocPCT = /PCT-TOC-\\w{6}--\\w+/;\r\n\r\n if (articleEPC.test(label) || rfessEPC.test(label) || tocPCT.test(label)) {\r\n this.setState({ loaderState: LoaderStateUtil.getLoaded() });\r\n }\r\n else if (label.startsWith('EPC-A') || label.startsWith('EPC-RFees-A') || label.startsWith('PCT-TOC')) {\r\n WebApi.getContentRef({\r\n scopeIds: this.props.viewOptions.readerScopeIds,\r\n label: label,\r\n parKeyOrTag: parKeyOrTag,\r\n type: Model.LabelReferralType.Self\r\n }).then(result => {\r\n if (result.models.length == 0)\r\n this.setState({ loaderState: LoaderStateUtil.getLoaded() });\r\n else\r\n this.setState({ parentLabel: result.models[0].sourceLabel!, loaderState: LoaderStateUtil.getLoaded() });\r\n }).catch(error => {\r\n console.error(error);\r\n this.setState({ loaderState: LoaderStateUtil.getLoaded() });\r\n });\r\n }\r\n else {\r\n WebApi.getContentRef({\r\n scopeIds: this.props.viewOptions.readerScopeIds,\r\n label: label,\r\n parKeyOrTag: parKeyOrTag,\r\n type: Model.LabelReferralType.ChildContent\r\n }).then(result => {\r\n if (result.models.length == 0)\r\n this.setState({ loaderState: LoaderStateUtil.getLoaded() });\r\n else\r\n this.setState({ parentLabel: result.models[0].sourceLabel!, childLabel: result.models[0].targetLabel, loaderState: LoaderStateUtil.getLoaded() });\r\n }).catch(error => {\r\n console.error(error);\r\n this.setState({ loaderState: LoaderStateUtil.getLoaded() });\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n const { label } = this.props.match.params as any;\r\n const { loaderState, parentLabel, childLabel } = this.state;\r\n\r\n if (!LoaderStateUtil.isLoaded(loaderState)) {\r\n return LoaderStateUtil.renderDefault(loaderState);\r\n }\r\n\r\n return parentLabel ?\r\n :\r\n ;\r\n }\r\n}\r\n\r\nexport const ConnectedContentRedirectPage = connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n viewOptions: state.userProfile.viewOptions,\r\n })\r\n)(ContentRedirectPage);","//RESSOURCE notes\r\n\r\nimport * as React from 'react';\r\nimport * as DraftJS from 'draft-js';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport * as _ from 'lodash';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Grid, Button } from '../../libs/material-ui';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\nimport * as Theme from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as NotesStore from '../../store/Notes';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\n// navigation dependencies\r\nimport * as Nav from '../../navigation';\r\n\r\n// component dependencies\r\nimport { NavLink } from 'react-router-dom';\r\nimport { Typography, Paper } from '../../libs/material-ui';\r\nimport { Icons } from '../../libs/material-ui';\r\nimport { Editor } from '../edit/Editor';\r\nimport { StyleFactory } from '../../utils/StyleFactory';\r\n\r\n// data model dependencies\r\nimport { TodoVM, StyleVM, TypeOfStickyNote, VisibilityOfStickyNote, TypeOfScope } from \"../../viewmodels/EPCDataModel\";\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\n\r\ntype NotesPageProps =\r\n {\r\n notes: NotesStore.NotesState,\r\n viewOptions: UserProfileStore.ViewOptions,\r\n styles: StyleVM[],\r\n }\r\n & typeof NotesStore.actionCreators\r\n & StyledComponentProps\r\n & RouteComponentProps<{}>;\r\n\r\ninterface NotesPageState {\r\n activeNote: TodoVM | null\r\n}\r\n\r\nclass NotesPage extends React.Component {\r\n\r\n constructor(props: NotesPageProps) {\r\n super(props);\r\n this.state = { activeNote: null };\r\n }\r\n\r\n componentDidMount() {\r\n const { viewOptions } = this.props;\r\n const { productId } = viewOptions;\r\n // the store takes care of loading \r\n this.props.listNotes(productId, viewOptions.readerScopeIds, true);\r\n this.setState({ activeNote: null });\r\n }\r\n\r\n componentDidUpdate(prevProps: NotesPageProps, prevState: {}) {\r\n const { viewOptions } = this.props;\r\n const { productId } = viewOptions;\r\n // the store takes care of loading \r\n this.props.listNotes(productId, viewOptions.readerScopeIds);\r\n }\r\n\r\n render() {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n if (!LoaderStateUtil.isLoaded(this.props.notes.loaderState)) {\r\n return LoaderStateUtil.renderDefault(this.props.notes.loaderState);\r\n }\r\n else {\r\n return (\r\n
    \r\n {$('notes_title')}:\r\n \r\n {this.renderTodosByScope(this.props.notes.todos!)}\r\n \r\n
    \r\n );\r\n }\r\n }\r\n\r\n renderTodosByScope(notes: TodoVM[]) {\r\n let groups = _.groupBy(notes, value => value.scopeName || value.scopeLabel);\r\n return (\r\n \r\n {_.keys(groups).map(key => {\r\n return (\r\n \r\n \r\n {key}\r\n \r\n {this.renderTodosByLabel(groups[key])}\r\n \r\n );\r\n })}\r\n \r\n );\r\n }\r\n\r\n renderTodosByLabel(notes: TodoVM[]) {\r\n const { history } = this.props;\r\n const { displayHidden } = this.props.viewOptions;\r\n let groups = _.groupBy(notes, value => value.label); // TODO include paragraph keys\r\n return (\r\n \r\n {_.keys(groups).map(label => {\r\n\r\n const group = groups[label]\r\n const group_notes = group.filter(todo => !todo.optOut || displayHidden);\r\n if (group_notes.length == 0)\r\n return false;\r\n\r\n const parKey = undefined; // TODO!!!\r\n\r\n const friendlyLabel = group[0].friendlyLabel; \r\n\r\n return (\r\n \r\n \r\n {\r\n //{label}\r\n }\r\n \r\n \r\n {group_notes.map(todo => this.renderTodo(todo))}\r\n \r\n );\r\n })}\r\n \r\n );\r\n }\r\n\r\n handleNavigate(label: string, parKey: string | undefined) {\r\n\r\n const index = _.findIndex(this.props.notes.todos, note => note.label == label);\r\n if (index !== null && index !== undefined) {\r\n this.props.setNotesIndex(index);\r\n }\r\n\r\n const { history } = this.props;\r\n history.push(Nav.getContentRedirectPageUrl(label, parKey));\r\n }\r\n\r\n renderTodo(todo: TodoVM) {\r\n\r\n const editScopeId = this.props.viewOptions.editScopeId;\r\n const editScope = this.props.viewOptions.scopes.find(scope => scope.id === this.props.viewOptions.editScopeId);\r\n const isAuthorScope = editScope && editScope.typeOfScope === TypeOfScope.Author;\r\n\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n let className = \"note\";\r\n\r\n if (todo.optOut)\r\n className += \" opted-out\";\r\n\r\n if (todo.type == TypeOfStickyNote.UpdateNote)\r\n className += \" note-update\";\r\n else if (todo.scopeId == \"000000c9-14ec-4ad8-aca0-ef6dc1e9cfc8\" ||\r\n todo.scopeId == \"000000c8-14ec-4ad8-aca0-ef6dc1e9cfc8\" ||\r\n todo.scopeId == \"000000c7-14ec-4ad8-aca0-ef6dc1e9cfc8\" ||\r\n todo.scopeId == \"000000c6-14ec-4ad8-aca0-ef6dc1e9cfc8\")\r\n className += \" note-author\";\r\n\r\n const contentState = todo.draftContentState ?\r\n DraftJS.convertFromRaw(todo.draftContentState) :\r\n DraftJS.ContentState.createFromText(\"...\");\r\n\r\n const editorState = DraftJS.EditorState.createWithContent(contentState);\r\n const customStyles = StyleFactory.getCssStyles(this.props.styles);\r\n\r\n return (\r\n \r\n \r\n { return; }}\r\n onFocusChanged={hasFocus => this.handleFocus(todo, hasFocus)}\r\n />\r\n {this.state.activeNote == todo && isAuthorScope && todo.scopeId == editScopeId && (\r\n \r\n {todo.type == TypeOfStickyNote.Custom &&\r\n \r\n }\r\n {todo.type == TypeOfStickyNote.UpdateNote &&\r\n \r\n }\r\n \r\n )}\r\n {this.state.activeNote == todo && todo.scopeId == editScopeId && (\r\n \r\n )}\r\n \r\n \r\n );\r\n }\r\n\r\n makePrivateNote(todo: TodoVM) {\r\n this.props.makeNotePrivate(todo.label, todo.scopeId, todo.id);\r\n }\r\n\r\n makePublicUpdateNote(todo: TodoVM) {\r\n this.props.makeNotePublicUpdate(todo.label, todo.scopeId, todo.id);\r\n }\r\n\r\n deleteNote(todo: TodoVM) {\r\n this.props.deleteNote(todo.label, todo.scopeId, todo.id);\r\n }\r\n\r\n handleFocus(todo: TodoVM, hasFocus: boolean) {\r\n if (hasFocus) {\r\n this.setState({ activeNote: todo });\r\n }\r\n }\r\n}\r\n\r\nexport const ConnectedNotesPage = connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n notes: state.notes,\r\n viewOptions: state.userProfile.viewOptions,\r\n styles: state.userProfile.preferences!.styles!,\r\n }),\r\n dispatch => bindActionCreators(NotesStore.actionCreators, dispatch)\r\n)(NotesPage);","//RESSOURCE pdfJobs\r\n\r\nimport * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport * as _ from 'lodash';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, StyledComponentProps } from '@material-ui/core/styles';\r\nimport {\r\n Grid, Button,\r\n Table, TableHead, TableRow, TableBody, TableCell,\r\n FormControl, FormControlLabel, InputLabel, Select, Checkbox, MenuItem,\r\n} from '../../libs/material-ui';\r\nimport * as DraftJS from 'draft-js';\r\nimport * as Nav from '../../navigation';\r\n\r\nimport * as WebApi from '../../webapi';\r\n\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\nimport * as Theme from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as PdfJobsStore from '../../store/PdfJobs';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\n// component dependencies\r\nimport { Typography, Paper } from '../../libs/material-ui';\r\nimport { Icons } from '../../libs/material-ui';\r\n\r\n// data model dependencies\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\nimport { UserRoleVM } from '../../viewmodels/EPCDataModel';\r\nimport { PdfJobVM, PdfJobStatus, PdfJobPageMode, PdfDivisioningMode } from \"../../viewmodels/EPCDataModel\";\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\nimport { HardLinks } from '../../hardlinks';\r\n\r\ntype PdfJobsPageProps =\r\n {\r\n userProfile: UserProfileStore.UserProfileState,\r\n viewOptions: UserProfileStore.ViewOptions,\r\n pdfJobs: PdfJobsStore.PdfJobsState,\r\n }\r\n & typeof PdfJobsStore.actionCreators\r\n & StyledComponentProps\r\n & RouteComponentProps<{}>;\r\n\r\ninterface PdfJobsPageState extends PdfJobsStore.PdfJobOptions {\r\n printOnDemandOrdering: boolean\r\n};\r\n\r\nconst eta = 6 * 60 * 1000;\r\n\r\nclass PdfJobsPage extends React.Component {\r\n\r\n private interval: any;\r\n\r\n constructor(props: PdfJobsPageProps) {\r\n super(props);\r\n\r\n this.state = {\r\n documentFontSize: 10,\r\n pageMode: PdfJobPageMode.SectionwiseNumberingWithClearPage,\r\n divisioningMode: PdfDivisioningMode.PageWithOverview,\r\n pdfStickyNotes: false,\r\n printOnDemand: false,\r\n printOnDemandOrdering: false\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const { viewOptions } = this.props;\r\n const { productId } = viewOptions;\r\n\r\n // the store takes care of loading \r\n this.props.listPdfJobs(productId);\r\n\r\n this.interval = setInterval(() => {\r\n this.forceUpdate();\r\n }, 1000);\r\n }\r\n\r\n componentDidUpdate(prevProps: PdfJobsPageProps, prevState: {}) {\r\n const { viewOptions } = this.props;\r\n const { productId } = viewOptions;\r\n\r\n // the store takes care of loading \r\n this.props.listPdfJobs(productId);\r\n }\r\n\r\n componentWillUnmount() {\r\n clearInterval(this.interval);\r\n }\r\n\r\n render() {\r\n\r\n const { viewOptions } = this.props;\r\n const { productId, uiLanguage } = viewOptions;\r\n const $ = localized(uiLanguage);\r\n\r\n if (!LoaderStateUtil.isLoaded(this.props.pdfJobs.loaderState)) {\r\n return LoaderStateUtil.renderDefault(this.props.pdfJobs.loaderState);\r\n }\r\n else {\r\n let pdfJobs = _.orderBy(\r\n _.values(this.props.pdfJobs.pdfJobs),\r\n [\"jobTimestamp\"],\r\n [\"desc\"]);\r\n\r\n let recent = pdfJobs.filter(job =>\r\n !job.completed &&\r\n Date.now() - Date.parse(job.submittedClient || job.submitted) < 5 * 60 * 1000\r\n );\r\n\r\n const canRequestPOD = _.find(this.props.userProfile.roles,\r\n (role: UserRoleVM) =>\r\n role.typeOfUserRole == Model.TypeOfUserRole.Product &&\r\n (role.productRole == Model.UserProductRole.PrintOnDemand || role.productRole == Model.UserProductRole.Owner) &&\r\n role.productId === productId\r\n );\r\n\r\n return (\r\n
    \r\n {$('pdfJobs_title')}:\r\n \r\n \r\n 0}\r\n onClick={() => this.submitNewJob()}\r\n >\r\n {$('pdfJobs_submit')}\r\n \r\n \r\n \r\n \r\n {$('pdfJobs_submit_documentFontSize')}\r\n \r\n \r\n \r\n \r\n \r\n {$('pdfJobs_submit_pageMode')}\r\n \r\n \r\n \r\n \r\n \r\n {$('pdfJobs_submit_divisioningMode')}\r\n \r\n \r\n \r\n \r\n this.setState({ pdfStickyNotes: value })} />}\r\n />\r\n {$('pdfJobs_print_on_demand')}}\r\n disabled={!canRequestPOD}\r\n title={canRequestPOD ? \"\" : $('pdfJobs_yearly_license_required')}\r\n control={ this.setState({ printOnDemand: value })} />}\r\n />\r\n \r\n\r\n \r\n \r\n \r\n \r\n {/*Id\r\n Submitted*/}\r\n {$('pdfJobs_date')}\r\n {$('pdfJobs_options')}\r\n {$('pdfJobs_status')}\r\n {$('pdfJobs_download')}\r\n {$('pdfJobs_order_pod_header')}\r\n \r\n \r\n \r\n {pdfJobs.map(job => {\r\n let downloadLink = job.downloadToken && Nav.getPdfUrl(job.downloadToken);\r\n let submitted = job.submittedClient || job.submitted;\r\n return (\r\n \r\n {/*{job.jobTimestamp}\r\n {this.formatDateTime(job.submitted!)}*/}\r\n \r\n {job.completed ?\r\n this.formatDateTime(job.completed) :\r\n (this.formatTimeDiff(submitted) + \" / ca. \" + this.formatTime(eta))}\r\n \r\n {this.formatOptions(job.documentFontSize, job.pageMode, job.divisioningMode, job.pdfStickyNotes, job.printOnDemand)}\r\n {this.formatStatus(job.status)}\r\n \r\n {downloadLink && {job.downloadFilename}}\r\n \r\n \r\n {job.printOnDemand &&\r\n this.confirmPODOrder(job)}\r\n >{$('pdfJobs_order_pod')}}\r\n \r\n \r\n );\r\n })}\r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n }\r\n\r\n submitNewJob() {\r\n const { viewOptions } = this.props;\r\n const { productId, readerScopeIds, contentLanguage } = viewOptions;\r\n\r\n this.props.submitPdfJobs(productId, readerScopeIds, contentLanguage, {\r\n documentFontSize: this.state.documentFontSize,\r\n pageMode: this.state.pageMode,\r\n divisioningMode: this.state.divisioningMode,\r\n pdfStickyNotes: this.state.pdfStickyNotes,\r\n printOnDemand: this.state.printOnDemand\r\n });\r\n }\r\n\r\n confirmPODOrder(job: Model.PdfJobVM) {\r\n //var gendate = this.formatDateTime(job.completed!);\r\n //// TODO LOC\r\n //var prompt = (\"Please, confirm that you want to order a print on demand book from the pdf generated on GENDATE. \" +\r\n // \"You will receive an email with an offer including the price and shipping costs as well as payment details.\")\r\n // .replace(\"GENDATE\", gendate!);\r\n //if (!window.confirm(prompt))\r\n // return;\r\n //this.submitPODOrder(job);\r\n\r\n const url = Nav.getPODOrderPageUrl(job.productId, job.jobTimestamp);\r\n window.location.assign(url);\r\n //this.props.history.push(url);\r\n }\r\n\r\n //submitPODOrder(job: Model.PdfJobVM) {\r\n // let dto: Model.PdfJobPODOrderDto = {\r\n // jobTimestamp: job.jobTimestamp\r\n // };\r\n // WebApi.orderPdfJobPOD(dto)\r\n // .then(result => {\r\n // // TODO LOC\r\n // window.alert(\"Submitted print on demand order with number ORDERID.\".replace(\"ORDERID\", result.purchaseOrderId.toString()));\r\n // this.setState({ printOnDemandOrdering: false });\r\n // })\r\n // .catch(error => {\r\n // // TODO LOC\r\n // window.alert(\"Failed to submit print on demand order.\");\r\n // console.debug(\"error: \" + error);\r\n // this.setState({ printOnDemandOrdering: false });\r\n // });\r\n\r\n // this.setState({ printOnDemandOrdering: true });\r\n //}\r\n\r\n formatStatus(status: PdfJobStatus): string {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n switch (status) {\r\n case PdfJobStatus.Completed: return $('pdfJobs_status_completed');\r\n case PdfJobStatus.Failed: return $('pdfJobs_status_failed');\r\n case PdfJobStatus.Started: return $('pdfJobs_status_started');\r\n case PdfJobStatus.Submitted: return $('pdfJobs_status_submitted');\r\n default: return \"n/a\";\r\n }\r\n }\r\n\r\n formatOptions(documentFontSize: number, pageMode: PdfJobPageMode, divisioningMode: PdfDivisioningMode, pdfStickyNotes: boolean, printOnDemand: boolean) {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n if (printOnDemand)\r\n return $('pdfJobs_print_on_demand_options');\r\n\r\n let pageModeText = this.formatPageMode(pageMode);\r\n let divisioningModeText = this.formatDivisioningMode(divisioningMode);\r\n let pdfStickyNotesText = pdfStickyNotes ? (\", \" + $('pdfJobs_with_notes')) : \"\";\r\n\r\n return `${documentFontSize} pt, ${pageModeText}, ${divisioningModeText}${pdfStickyNotesText}`;\r\n }\r\n\r\n formatPageMode(pageMode: PdfJobPageMode) {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n switch (pageMode) {\r\n case PdfJobPageMode.SectionwiseNumberingWithClearPage: return $('pdfJobs_pageMode_sectionwiseNumberingWithClearPage');\r\n case PdfJobPageMode.ContinuousNumberingWithoutClearPage: return $('pdfJobs_pageMode_continuousNumberingWithoutClearPage');\r\n default: return \"???\";\r\n }\r\n }\r\n\r\n formatDivisioningMode(divisioningMode: PdfDivisioningMode) {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n switch (divisioningMode) {\r\n case PdfDivisioningMode.PageWithOverview: return $('pdfJobs_divisioningMode_pageWithOverview');\r\n case PdfDivisioningMode.PageWithoutOverview: return $('pdfJobs_divisioningMode_pageWithoutOverview');\r\n case PdfDivisioningMode.NoPage: return $('pdfJobs_divisioningMode_noPage');\r\n default: return \"???\";\r\n }\r\n }\r\n\r\n formatDateTime(dateTimeString: string) {\r\n try {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const locale = uiLanguage.toLowerCase();\r\n let dateTime = new Date(dateTimeString);\r\n return dateTime.toLocaleString(locale);\r\n } catch (e) {\r\n\r\n }\r\n }\r\n\r\n formatTimeDiff(dateTimeString: string) {\r\n try {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const locale = uiLanguage.toLowerCase();\r\n let dateTime = Date.parse(dateTimeString);\r\n return this.formatTime(Date.now() - dateTime);\r\n } catch (e) {\r\n return undefined;\r\n }\r\n }\r\n\r\n private formatTime(time: number) {\r\n if (time < 0)\r\n return \"??:??\";\r\n let secs = time / 1000;\r\n let mins = Math.floor(secs / 60);\r\n secs = Math.floor(secs % 60);\r\n return mins.toString() + ':' + (secs < 10 ? '0' : '') + secs.toString();\r\n }\r\n}\r\n\r\nexport const ConnectedPdfJobsPage = connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n pdfJobs: state.pdfJobs,\r\n userProfile: state.userProfile,\r\n viewOptions: state.userProfile.viewOptions,\r\n }),\r\n dispatch => bindActionCreators(PdfJobsStore.actionCreators, dispatch)\r\n)(PdfJobsPage);","//RESSOURCE lookup_content\r\n\r\nimport * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport * as _ from 'lodash';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { withStyles, StyledComponentProps } from '@material-ui/core/styles';\r\nimport {\r\n Grid, Button,\r\n Table, TableBody, TableHead, TableRow, TableCell\r\n\r\n} from '../../libs/material-ui';\r\nimport * as DraftJS from 'draft-js';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\nimport * as Theme from \"../../theme\";\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../../store';\r\nimport * as ContentLookupStore from '../../store/ContentLookup';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\n// navigation dependencies\r\nimport * as Nav from '../../navigation';\r\n\r\n// component dependencies\r\nimport { Link } from 'react-router-dom';\r\nimport { Typography, Paper } from '../../libs/material-ui';\r\nimport { Icons } from '../../libs/material-ui';\r\nimport { Editor } from '../edit/Editor';\r\nimport { StyleFactory } from '../../utils/StyleFactory';\r\n\r\n// data model dependencies\r\nimport * as Model from \"../../viewmodels/EPCDataModel\";\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\n\r\ntype ContentLookupPageProps =\r\n {\r\n contentLookup: ContentLookupStore.ContentLookupState,\r\n viewOptions: UserProfileStore.ViewOptions,\r\n }\r\n & typeof ContentLookupStore.actionCreators\r\n & StyledComponentProps\r\n & RouteComponentProps<{}>;\r\n\r\nclass ContentLookupPage extends React.Component {\r\n\r\n constructor(props: ContentLookupPageProps) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n const { viewOptions } = this.props;\r\n const { productId } = viewOptions;\r\n // the store takes care of loading \r\n this.props.requestGroups(productId, viewOptions.readerScopeIds, viewOptions.languages);\r\n }\r\n\r\n componentDidUpdate(prevProps: ContentLookupPageProps, prevState: {}) {\r\n const { viewOptions } = this.props;\r\n const { productId } = viewOptions;\r\n // the store takes care of loading \r\n this.props.requestGroups(productId, viewOptions.readerScopeIds, viewOptions.languages);\r\n }\r\n\r\n render() {\r\n const { uiLanguage, productId } = this.props.viewOptions;\r\n const $ = localized(uiLanguage);\r\n\r\n const is_pct = productId.toLowerCase() == \"pct\";\r\n\r\n if (!LoaderStateUtil.isLoaded(this.props.contentLookup.loaderState)) {\r\n return LoaderStateUtil.renderDefault(this.props.contentLookup.loaderState);\r\n }\r\n else {\r\n return (\r\n
    \r\n {is_pct ? $('lookup_content_title_pct') : $('lookup_content_title_epc')}:\r\n \r\n {is_pct ?\r\n this.renderGroupsByTypePCT(this.props.contentLookup.groups!) :\r\n this.renderGroupsByTypeEPC(this.props.contentLookup.groups!)}\r\n \r\n
    \r\n );\r\n }\r\n }\r\n\r\n renderGroupsByTypeEPC(lookup: Model.LookupGroupDto[]) {\r\n let types = _.groupBy(lookup, value => value.type);\r\n if (!types) return false;\r\n\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n const rules = types[Model.TypeOfContent.RuleEPC.toString()];\r\n const prots = _.concat(\r\n types[Model.TypeOfContent.ProtArt69EPC.toString()],\r\n types[Model.TypeOfContent.ProtCentrEPC.toString()],\r\n types[Model.TypeOfContent.ProtLondonEPC.toString()],\r\n types[Model.TypeOfContent.ProtPrivEPC.toString()],\r\n types[Model.TypeOfContent.ProtRecogEPC.toString()],\r\n types[Model.TypeOfContent.ProtStaffEPC.toString()],\r\n );\r\n\r\n return (\r\n \r\n {this.renderType(\"rules\", $('lookup_rules'), $('lookup_articles'), rules)}\r\n {this.renderType(\"prots\", $('lookup_protocols'), $('lookup_articles'), prots)}\r\n \r\n );\r\n }\r\n\r\n renderGroupsByTypePCT(lookup: Model.LookupGroupDto[]) {\r\n let types = _.groupBy(lookup, value => value.type);\r\n if (!types) return false;\r\n\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n const arts = types[Model.TypeOfContent.ArtPCT.toString()];\r\n const rules = types[Model.TypeOfContent.RulePCT.toString()];\r\n\r\n return (\r\n \r\n {this.renderType(\"arts\", $('lookup_articles'), $('lookup_sections'), arts)}\r\n {this.renderType(\"rules\", $('lookup_rules'), $('lookup_sections'), rules)}\r\n \r\n );\r\n }\r\n\r\n private renderType(key: string, name: string, targetName: string, type: Model.LookupGroupDto[]): JSX.Element {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n if (!type || type.length == 0)\r\n return
    ;\r\n\r\n return (\r\n \r\n \r\n {name}\r\n {targetName}\r\n \r\n \r\n \r\n {type.map(group => (group && \r\n \r\n {group.name}\r\n \r\n \r\n {group.items.map(item => (\r\n {item.name}\r\n ))}\r\n \r\n ))}\r\n \r\n
    );\r\n }\r\n}\r\n\r\nexport const ConnectedContentLookupPage = connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n contentLookup: state.contentLookup,\r\n viewOptions: state.userProfile.viewOptions,\r\n }),\r\n dispatch => bindActionCreators(ContentLookupStore.actionCreators, dispatch)\r\n)(ContentLookupPage);","import * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport * as _ from 'lodash';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { render } from 'react-dom';\r\nimport { withStyles, StyledComponentProps } from '@material-ui/core/styles';\r\nimport { Grid, Button, TextField, Typography, Pagination } from '../../libs/material-ui';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"../../ressources\"\r\nimport * as Theme from \"../../theme\";\r\n\r\nimport * as Nav from '../../navigation';\r\n\r\nimport { ApplicationState } from '../../store';\r\nimport * as SearchStore from '../../store/Search';\r\nimport * as UserProfileStore from '../../store/UserProfile';\r\n\r\nimport * as Model from '../../viewmodels/EPCDataModel';\r\n\r\nimport { LoaderStateUtil, LoaderState } from \"../../utils/LoaderState\"\r\nimport { LabelDisplayedRowsArgs } from '@material-ui/core/TablePagination';\r\n\r\ntype SearchPageProps =\r\n {\r\n search: SearchStore.SearchState,\r\n viewOptions: UserProfileStore.ViewOptions,\r\n }\r\n & typeof SearchStore.actionCreators\r\n & StyledComponentProps\r\n & RouteComponentProps<{}>;\r\n\r\ninterface SearchPageState {\r\n maxPages: number\r\n}\r\n\r\n/*\r\n this.setState({ nextInput: evt.target.value })} />\r\n */\r\nexport class SearchPage extends React.Component {\r\n\r\n constructor(props: SearchPageProps) {\r\n super(props);\r\n\r\n this.state = { maxPages: 1 };\r\n }\r\n\r\n public render() {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n return (\r\n
    \r\n {$('search_title')}:\r\n \r\n \r\n this.handleQueryChanged(evt.target.value)}\r\n onKeyDown={(evt) => this.handleKeyDown(evt)}\r\n />\r\n \r\n\r\n \r\n this.search(0)}\r\n >\r\n {$('search_search')}\r\n \r\n \r\n\r\n \r\n {$(\"search_tip\")} ({$(\"search_see_faq\")}).\r\n \r\n\r\n \r\n {this.renderResults()}\r\n
    \r\n );\r\n }\r\n\r\n handleQueryChanged(newQuery: string) {\r\n this.props.updateQuery({ ...this.props.search.query, query: newQuery });\r\n }\r\n\r\n handleKeyDown(evt: any) {\r\n if (evt.key == \"Enter\" || evt.key == \"\\u000d\") {\r\n this.search(0);\r\n }\r\n }\r\n\r\n search(page?: number) {\r\n if (this.props.search.query.query == \"\")\r\n return;\r\n\r\n const { productId, contentLanguage } = this.props.viewOptions;\r\n\r\n let dto: Model.SearchQueryDto = {\r\n ...this.props.search.query,\r\n productIds: [productId],\r\n language: Model.Language.Any //contentLanguage\r\n };\r\n\r\n if (dto.query != this.props.search.resultQuery) {\r\n dto.skip = 0;\r\n }\r\n else if (page !== undefined) {\r\n dto.skip = page * dto.top!;\r\n }\r\n\r\n this.props.requestResults(dto);\r\n }\r\n\r\n renderResults() {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n const { search } = this.props;\r\n if (search.loaderState.isLoading || search.loaderState.hasError)\r\n return LoaderStateUtil.renderDefault(search.loaderState);\r\n\r\n if (search.loaderState.isLoaded) {\r\n\r\n const result = search.result;\r\n if (result != null && result.models.length > 0) {\r\n result.models.forEach(function (model) {\r\n console.log(`${model.label}`);\r\n });\r\n\r\n const pageSize = search.query.top || 20;\r\n const page = (search.query.skip || 0) / 20;\r\n const more = result.models.length == pageSize;\r\n const pages = page + (more ? 2 : 1); //this.state.maxPages > page ? this.state.maxPages : (page + (more ? 2 : 1));\r\n\r\n return (\r\n \r\n {/**/}\r\n {/* this.handleChangePage(p)}*/}\r\n {/* nextIconButtonProps={{ disabled: !more }}*/}\r\n {/* backIconButtonProps={{ disabled: page == 0 }}*/}\r\n {/* labelDisplayedRows={(p) => this.renderPaginationInfo(p, more)}*/}\r\n {/* variant=\"footer\"*/}\r\n {/* />*/}\r\n {/**/}\r\n \r\n {$('search_results_for') + \" \" + search.resultQuery}\r\n \r\n\r\n {result.models.map(model => {\r\n return (\r\n \r\n \r\n {this.renderItem(model)}\r\n \r\n \r\n );\r\n })}\r\n\r\n \r\n this.handleChangePage(p)}\r\n nextIconButtonProps={{ disabled: !more }}\r\n backIconButtonProps={{ disabled: page == 0 }}\r\n labelDisplayedRows={(p) => this.renderPaginationInfo(p, more)}\r\n variant=\"footer\"\r\n />\r\n \r\n {/**/}\r\n {/* {$('search_results_for') + \" \" + search.resultQuery}*/}\r\n {/**/}\r\n \r\n );\r\n }\r\n else {\r\n return (\r\n \r\n \r\n {$('search_results_for') + \" \" + search.resultQuery}\r\n \r\n \r\n {$('search_nothing_found')}\r\n \r\n \r\n );\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n renderPaginationInfo(p: LabelDisplayedRowsArgs, more: boolean): React.ReactNode {\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n return {p.page + 1}{\" \" + $('search_page_of_pages') + \" \"}{more ? \"?\" : p.count};\r\n }\r\n\r\n handleChangePage(page: number) {\r\n this.search(page);\r\n }\r\n\r\n renderItem(model: Model.SearchDocumentVM) {\r\n const typeContent = \"Content\";\r\n const typeComment = \"Comment\";\r\n const typeAnnotation = \"Annotation\";\r\n\r\n const uiLanguage = this.props.viewOptions.uiLanguage;\r\n const $ = localized(uiLanguage);\r\n\r\n let title = (this.props.viewOptions.contentLanguage == Model.Language.DE ? model.displayTitleDe : model.displayTitleEn) || model.displayTitleEn || model.displayTitleDe || \"n/a\";\r\n let body = (this.props.viewOptions.contentLanguage == Model.Language.DE ? model.highlightsDe : model.highlightsEn) || model.highlightsEn || model.highlightsDe || [];\r\n\r\n let link =\r\n model.linkLabel == null ? Nav.getContentRedirectPageUrl(model.label!, undefined) :\r\n model.label == model.linkLabel ? Nav.getContentPageUrl(model.label!, model.label!) :\r\n Nav.getContentPageUrl(model.linkLabel!, model.label!);\r\n\r\n let linkTitle = (this.props.viewOptions.contentLanguage == Model.Language.DE ? model.linkTitleDe : model.linkTitleEn) || model.linkTitleEn || model.linkTitleDe || \"n/a\";\r\n\r\n if (model.type == typeAnnotation) {\r\n title = $('search_annotation_to') + \" \" + title;\r\n }\r\n\r\n return (\r\n
    \r\n {linkTitle}\r\n \r\n {\r\n if (!evt.ctrlKey) {\r\n evt.preventDefault();\r\n this.openResult(link);\r\n }\r\n }}>{title}\r\n \r\n {body && body.map(b => this.renderBody(b))}\r\n
    \r\n );\r\n }\r\n\r\n openResult(link: string) {\r\n const { history } = this.props;\r\n if (link != null)\r\n history.push(link);\r\n }\r\n\r\n renderBody(body: string) {\r\n\r\n const regexp: RegExp = new RegExp('');\r\n const parts = body.split(regexp);\r\n const o = 0; //body.startsWith(\"\") ? 1 : 0;\r\n\r\n return {parts.map((s, i) => {s})};\r\n }\r\n}\r\n\r\n// Wire up the React component to the Redux store\r\nexport const ConnectedSearchPage = connect(\r\n // Selects which state properties are merged into the component's props\r\n (state: ApplicationState, ownProps: {}) => ({\r\n search: state.search,\r\n viewOptions: state.userProfile.viewOptions\r\n }),\r\n // Selects which action creators are merged into the component's props\r\n dispatch => bindActionCreators(SearchStore.actionCreators, dispatch)\r\n)(SearchPage);\r\n","//RESSOURCE settings_styles\r\nimport * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport * as _ from 'lodash';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage, RessourcesKeys } from '../ressources';\r\n\r\n// store dependencies\r\nimport { ApplicationState } from '../store';\r\nimport * as UserProfileStore from '../store/UserProfile';\r\n\r\n// component dependencies\r\nimport { withStyles, Theme, StyledComponentProps } from '@material-ui/core/styles';\r\nimport {\r\n Grid, Typography, Icons,\r\n Tabs, Tab,\r\n Paper,\r\n FormControl, FormControlLabel, RadioGroup, Radio, Button,\r\n Menu, MenuItem, Checkbox,\r\n Card, CardActions, CardContent, CardHeader\r\n} from '../libs/material-ui';\r\nimport { SketchPicker } from 'react-color';\r\n\r\n// data model dependencies\r\nimport { LoaderState, LoaderStateUtil } from '../utils/LoaderState';\r\nimport { SyncState, SyncStateUtil } from '../utils/SyncState';\r\nimport * as Model from '../viewmodels/EPCDataModel';\r\n\r\n// utils\r\nimport { StyleFactory } from '../utils/StyleFactory'\r\n\r\n\r\nconst styles = (theme: Theme) => ({\r\n root: {\r\n flexGrow: 1,\r\n },\r\n tabRoot: {\r\n //textTransform: 'initial',\r\n minWidth: 72,\r\n fontWeight: theme.typography.fontWeightRegular,\r\n marginRight: theme.spacing.unit * 4,\r\n },\r\n});\r\n\r\n\r\ninterface Style extends Model.StyleVM {\r\n modified: boolean\r\n};\r\n\r\ntype StylesPageReady = 'ready' | 'not:ready';\r\n\r\ntype StylesPageProps =\r\n {\r\n status: StylesPageReady,\r\n uiLanguage?: UILanguage,\r\n scopes?: Model.ScopeVM[],\r\n writerScopeIds?: string[],\r\n readerScopeIds?: string[],\r\n styles?: Model.StyleVM[],\r\n }\r\n & typeof UserProfileStore.actionCreators\r\n & StyledComponentProps;\r\n\r\ninterface StylesPageState {\r\n scope?: Model.ScopeVM,\r\n styles: Style[],\r\n selectedStyleIdx: number,\r\n error: string | null\r\n}\r\n\r\ntype StyleType = 'bold' | 'italic' | 'highlight' | 'underlined' | 'striked';\r\n\r\nclass _StylesPage extends React.Component {\r\n\r\n constructor(props: StylesPageProps) {\r\n super(props);\r\n\r\n if (props.status == 'not:ready') {\r\n this.state = { styles: [], selectedStyleIdx: 0, error: null };\r\n }\r\n else {\r\n const writerScopeIds = props.writerScopeIds;\r\n let scope = _.first(props.scopes!\r\n .filter(scope => scope.typeOfScope == Model.TypeOfScope.User)\r\n .filter(scope => _.includes(writerScopeIds, scope.id)));\r\n\r\n this.state = {\r\n scope: scope,\r\n styles: props.styles!.map(style => ({ ...style, modified: false })),\r\n selectedStyleIdx: 0,\r\n error: null\r\n };\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n // user friendly label as soon as the root content is loaded\r\n document.title = `EPC.app - Styles`;\r\n\r\n if (this.props.status == 'not:ready') {\r\n this.props.refreshPreferences();\r\n }\r\n }\r\n\r\n componentWillReceiveProps(nextProps: StylesPageProps) {\r\n if (nextProps.status == 'ready' && (this.props.status != 'ready' || nextProps.styles !== this.props.styles)) {\r\n this.setState({\r\n styles: nextProps.styles!.map(style => ({ ...style, modified: false })),\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n if (this.props.status == 'not:ready') {\r\n return (\r\n
    \r\n {LoaderStateUtil.renderDefault(LoaderStateUtil.getLoading())}\r\n
    \r\n );\r\n }\r\n\r\n const uiLanguage = this.props.uiLanguage!;\r\n const $ = localized(uiLanguage);\r\n\r\n if (this.state.styles.length == 0) {\r\n return (\r\n
    \r\n {$('settings_styles_title')}:\r\n {$('settings_styles_none')}:\r\n
    \r\n );\r\n }\r\n else if (!this.state.scope) {\r\n return (\r\n
    \r\n {$('settings_styles_title')}:\r\n {$('settings_styles_none')}:\r\n
    \r\n );\r\n }\r\n\r\n const selectedStyle = this.state.styles[this.state.selectedStyleIdx];\r\n const noChanges = this.state.styles.every(style => !style.modified);\r\n\r\n return (\r\n
    \r\n {$('settings_styles_title')} ({this.state.scope.name || this.state.scope.label}):\r\n\r\n \r\n {\r\n if (this.props.status == 'not:ready') return;\r\n const selectedStyleIdx = _.findIndex(this.state.styles, (style: Model.StyleVM) => style.id === value) || 0;\r\n this.setState({ selectedStyleIdx });\r\n }}\r\n indicatorColor=\"primary\"\r\n textColor=\"primary\"\r\n scrollable fullWidth\r\n scrollButtons=\"auto\"\r\n >\r\n {this.state.styles.map(style => (\r\n {style.name!.text + (style.modified ? '*' : '')}} />\r\n ))}\r\n \r\n\r\n \r\n \r\n \r\n \r\n {this.renderEditStyle()}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {$('settings_styles_preview')}\r\n \r\n \r\n \r\n Lorem ipsum dolor sit amet, consetetur \r\n adipscing elitr, sed diam nonumy eirmod\r\n  tempor invidunt ut labore et dolore.\r\n \r\n \r\n \r\n {this.state.error && (\r\n \r\n this.state.error\r\n \r\n )}\r\n \r\n
    \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n\r\n applyStyles() {\r\n if (this.props.status == 'not:ready' || !this.state.scope) return;\r\n\r\n var modified = this.state.styles.filter(style => style.modified);\r\n if (modified.length == 0)\r\n return;\r\n\r\n this.setState({ error: null })\r\n\r\n this.props.updatePreferences!({\r\n scopeId: this.state.scope.id,\r\n styles: modified.map(style => ({\r\n styleId: style.id!,\r\n isBold: style.isBold,\r\n isItalic: style.isItalic,\r\n isUnderlined: style.isUnderlined,\r\n isHighlighted: style.isHighlighted,\r\n isStriked: style.isStriked,\r\n lineColor: style.lineColor,\r\n textColor: style.textColor,\r\n highlightColor: style.highlightColor,\r\n lineThickness: style.lineThickness,\r\n lineType: style.lineType,\r\n }))\r\n }, (error) => this.setState({ error }));\r\n }\r\n\r\n resetStyles() {\r\n if (this.props.status == 'not:ready') return;\r\n this.setState({\r\n styles: this.props.styles!.map(style => ({ ...style, modified: false }))\r\n });\r\n }\r\n\r\n restoreStyle() {\r\n if (this.props.status == 'not:ready') return;\r\n const selectedStyle = this.state.styles[this.state.selectedStyleIdx];\r\n\r\n if (selectedStyle.overriddenStyle) {\r\n // restore to overrriden style\r\n var parentStyle = selectedStyle.overriddenStyle;\r\n this.alterStyle(style => ({\r\n ...style,\r\n isBold: parentStyle.isBold,\r\n isItalic: parentStyle.isItalic,\r\n isUnderlined: parentStyle.isUnderlined,\r\n isStriked: parentStyle.isStriked,\r\n isHighlighted: parentStyle.isHighlighted,\r\n lineColor: parentStyle.lineColor,\r\n textColor: parentStyle.textColor,\r\n highlightColor: parentStyle.highlightColor,\r\n lineThickness: parentStyle.lineThickness,\r\n lineType: parentStyle.lineType,\r\n modified: true,\r\n }));\r\n } else {\r\n // reset style\r\n var sourceStyle = _.find(this.props.styles, style => style.id == selectedStyle.id);\r\n if (sourceStyle) {\r\n let styles = [... this.state.styles];\r\n styles[this.state.selectedStyleIdx] = { ...sourceStyle, modified: false };\r\n }\r\n }\r\n }\r\n\r\n private renderEditStyle() {\r\n if (this.props.status == 'not:ready') return;\r\n\r\n const $ = localized(this.props.uiLanguage!);\r\n\r\n const selectedStyle = this.state.styles[this.state.selectedStyleIdx];\r\n const styleType = this.getStyleType(selectedStyle);\r\n\r\n const hasTextColor = !!selectedStyle.textColor/* && styleType != 'highlight'*/;\r\n\r\n return (\r\n \r\n this.handleStyleChange(value as StyleType)}>\r\n } label={$('settings_styles_bold')} />\r\n } label={$('settings_styles_italic')} />\r\n } label={$('settings_styles_highlight')} />\r\n\r\n {styleType == 'highlight' && this.renderHighlightMenu()}\r\n\r\n } label={$('settings_styles_underline')} />\r\n {styleType == 'underlined' && this.renderUnderlineMenu()}\r\n\r\n } label={$('settings_styles_strike')} />\r\n\r\n this.alterStyle(style => ({ ...style, textColor: checked ? '#000' : undefined }))} />}\r\n label={$('settings_styles_text_color')} />\r\n {hasTextColor && (this.renderTextColorMenu())}\r\n \r\n \r\n );\r\n }\r\n\r\n renderHighlightMenu() {\r\n if (this.props.status == 'not:ready') return;\r\n\r\n const $ = localized(this.props.uiLanguage!);\r\n\r\n const selectedStyle = this.state.styles[this.state.selectedStyleIdx];\r\n return (\r\n
    \r\n this.alterStyle(style => ({ ...style, highlightColor: color }))}\r\n />\r\n
    \r\n );\r\n }\r\n\r\n renderUnderlineMenu() {\r\n if (this.props.status == 'not:ready') return;\r\n\r\n const $ = localized(this.props.uiLanguage!);\r\n\r\n const selectedStyle = this.state.styles[this.state.selectedStyleIdx];\r\n return (\r\n
    \r\n this.alterStyle(style => ({ ...style, lineColor: color }))}\r\n />\r\n {/* this.alterStyle(style => ({\r\n ...style,\r\n lineType: lineType,\r\n lineThickness: lineType == Model.StyleLineType.Double ? 3 : style.lineThickness\r\n }))}\r\n />*/}\r\n this.alterStyle(style => ({\r\n ...style,\r\n lineThickness: thickness,\r\n lineType: thickness < 3 && style.lineType == Model.StyleLineType.Double ? Model.StyleLineType.Solid : style.lineType\r\n }))}\r\n />\r\n
    \r\n );\r\n }\r\n\r\n renderTextColorMenu() {\r\n if (this.props.status == 'not:ready') return;\r\n\r\n const $ = localized(this.props.uiLanguage!);\r\n\r\n const selectedStyle = this.state.styles[this.state.selectedStyleIdx];\r\n return (\r\n
    \r\n this.alterStyle(style => ({ ...style, textColor: color }))}\r\n />\r\n
    \r\n );\r\n }\r\n\r\n alterStyle(alter: (style: Style) => Style) {\r\n const selectedStyle = this.state.styles[this.state.selectedStyleIdx];\r\n let alteredStyle = alter(selectedStyle);\r\n alteredStyle.modified = true;\r\n let styles = [...this.state.styles];\r\n styles[this.state.selectedStyleIdx] = alteredStyle;\r\n this.setState({ styles: styles });\r\n }\r\n\r\n handleStyleChange(styleType: StyleType) {\r\n this.alterStyle(style => ({\r\n ...style,\r\n isBold: styleType == 'bold',\r\n isItalic: styleType == 'italic',\r\n isHighlighted: styleType == 'highlight',\r\n isUnderlined: styleType == 'underlined',\r\n isStriked: styleType == 'striked',\r\n }));\r\n }\r\n\r\n getStyleType(style: Model.StyleVM): StyleType {\r\n if (style.isBold) return 'bold';\r\n else if (style.isItalic) return 'italic';\r\n else if (style.isHighlighted) return 'highlight';\r\n else if (style.isUnderlined) return 'underlined';\r\n else if (style.isStriked) return 'striked';\r\n else return 'bold';\r\n }\r\n\r\n getCssStyle(style: Model.StyleVM, isTab: boolean): React.CSSProperties {\r\n let cssStyle = StyleFactory.getCssStyle(style);\r\n if (isTab)\r\n cssStyle.fontSize = '1rem';\r\n return cssStyle;\r\n }\r\n}\r\n\r\ninterface MenuState {\r\n anchorEl: HTMLElement | null\r\n}\r\n\r\ninterface ColorSelectionMenuProps {\r\n uiLanguage: UILanguage,\r\n selectedColor: string,\r\n colorChanged: (selectedColor: string) => void,\r\n label: string\r\n}\r\n\r\nclass ColorSelectionMenu extends React.Component\r\n{\r\n constructor(props: ColorSelectionMenuProps) {\r\n super(props);\r\n this.state = { anchorEl: null };\r\n }\r\n\r\n render() {\r\n const $ = localized(this.props.uiLanguage);\r\n return (\r\n \r\n \r\n this.setState({ anchorEl: null })}>\r\n this.props.colorChanged(evt.hex)} />\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\ninterface LineTypeSelectionMenuProps {\r\n uiLanguage: UILanguage,\r\n selectedLineType: Model.StyleLineType,\r\n lineTypeChanged: (lineType: Model.StyleLineType) => void,\r\n label: string\r\n}\r\n\r\nclass LineTypeSelectionMenu extends React.Component\r\n{\r\n constructor(props: LineTypeSelectionMenuProps) {\r\n super(props);\r\n this.state = { anchorEl: null };\r\n }\r\n\r\n render() {\r\n const $ = localized(this.props.uiLanguage);\r\n return (\r\n \r\n \r\n this.setState({ anchorEl: null })}>\r\n this.handleClick(Model.StyleLineType.Solid)} selected={this.props.selectedLineType == Model.StyleLineType.Solid}>{$('settings_styles_line_type_solid')}\r\n this.handleClick(Model.StyleLineType.Dashed)} selected={this.props.selectedLineType == Model.StyleLineType.Dashed}>{$('settings_styles_line_type_dashed')}\r\n this.handleClick(Model.StyleLineType.Dotted)} selected={this.props.selectedLineType == Model.StyleLineType.Dotted}>{$('settings_styles_line_type_dotted')}\r\n this.handleClick(Model.StyleLineType.Double)} selected={this.props.selectedLineType == Model.StyleLineType.Double}>{$('settings_styles_line_type_double')}\r\n \r\n \r\n );\r\n }\r\n\r\n private handleClick(lineType: Model.StyleLineType) {\r\n this.props.lineTypeChanged(lineType);\r\n this.setState({ anchorEl: null });\r\n }\r\n}\r\n\r\ninterface ThicknessSelectionMenuProps {\r\n uiLanguage: UILanguage,\r\n selectedThickness: number,\r\n thicknessChanged: (thickness: number) => void,\r\n label: string\r\n}\r\n\r\nclass ThicknessSelectionMenu extends React.Component\r\n{\r\n constructor(props: ThicknessSelectionMenuProps) {\r\n super(props);\r\n this.state = { anchorEl: null };\r\n }\r\n\r\n render() {\r\n const $ = localized(this.props.uiLanguage);\r\n return (\r\n \r\n \r\n this.setState({ anchorEl: null })}>\r\n this.handleClick(1)} selected={this.props.selectedThickness == 1}>{$('settings_styles_thickness_1')}\r\n this.handleClick(2)} selected={this.props.selectedThickness == 2}>{$('settings_styles_thickness_2')}\r\n this.handleClick(3)} selected={this.props.selectedThickness == 3}>{$('settings_styles_thickness_3')}\r\n \r\n \r\n );\r\n }\r\n\r\n private handleClick(thickness: number) {\r\n this.props.thicknessChanged(thickness);\r\n this.setState({ anchorEl: null });\r\n }\r\n}\r\n\r\nexport const StylesPage = withStyles(styles)(_StylesPage);\r\n\r\nexport const ConnectedStylesPage = withStyles(styles)(connect(\r\n (state: ApplicationState, ownProps: {}) => (\r\n !state.userProfile.preferences || !state.userProfile.preferences.styles ?\r\n { status: 'not:ready' as StylesPageReady } :\r\n {\r\n status: 'ready' as StylesPageReady,\r\n uiLanguage: state.userProfile.viewOptions.uiLanguage,\r\n scopes: state.userProfile.viewOptions.scopes,\r\n writerScopeIds: state.userProfile.viewOptions.writerScopeIds,\r\n readerScopeIds: state.userProfile.viewOptions.readerScopeIds,\r\n styles: state.userProfile.preferences!.styles!,\r\n }\r\n ),\r\n dispatch => bindActionCreators(UserProfileStore.actionCreators, dispatch)\r\n)(_StylesPage));","import * as React from 'react';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { Route, RouteComponentProps, Switch, Redirect } from 'react-router-dom';\r\nimport { withStyles, StyledComponentProps } from '@material-ui/core/styles';\r\nimport * as _ from 'lodash';\r\nimport * as Logging from './debug';\r\nimport * as is from 'is_js';\r\nimport * as Nav from './navigation';\r\n\r\n// localized ressources\r\nimport { localized, UILanguage } from \"./ressources\"\r\nimport { styles } from './theme';\r\n\r\n// store dependencies\r\nimport { ApplicationState } from './store';\r\nimport * as UserProfileStore from './store/UserProfile';\r\n\r\n// component dependencie\r\nimport { CircularProgress } from './libs/material-ui';\r\n\r\nimport { NotImplementedPage } from './components/shared/NotImplementedPage';\r\n\r\nimport { TestPage } from './components/test/TestPage';\r\nimport { TestSideBar } from './components/test/TestSideBar';\r\nimport { TestFooter } from './components/test/TestFooter';\r\nimport { TestToolbar } from './components/test/TestToolbar';\r\n\r\nimport { ConnectedMainAppBar } from './components/appbar/MainAppBar';\r\n\r\nimport { ConnectedNotificationToolbar } from './components/notifications/NotificationsToolbar';\r\nimport { ConnectedNotesToolbar } from './components/notes/NotesToolbar';\r\n\r\nimport { ConnectedFooter } from './components/shared/Footer';\r\n\r\nimport { ConnectedSignIn } from './components/signin/SignInPage';\r\n\r\nimport { ConnectedProductRedirectPage } from './components/product/ProductRedirect';\r\nimport { ConnectedTableOfContentsPage } from './components/content/TableOfContentsPage';\r\nimport { ConnectedTableOfContentsSideBar } from './components/content/TableOfContentsSideBar';\r\nimport { ConnectedContentPage } from './components/content/ContentPage';\r\nimport { ConnectedContentRedirectPage } from './components/content/ContentRedirect';\r\nimport { ConnectedNotesPage } from './components/notes/NotesPage';\r\nimport { ConnectedPdfJobsPage } from './components/pdf/PdfJobsPage';\r\nimport { ConnectedContentLookupPage } from './components/lookups/ContentLookupPage';\r\nimport { ConnectedSearchPage } from './components/search/SearchPage';\r\n\r\nimport { ConnectedStylesPage } from './Settings';\r\n\r\n// data model dependencies\r\nimport { LoaderStateUtil, LoaderState } from './utils/LoaderState';\r\nimport * as Model from './viewmodels/EPCDataModel';\r\n\r\n/** defines layout components for route paths */\r\nconst routeSpecs: RouteSpec[] = [\r\n // real routes to be implemented\r\n { path: '/', main: ConnectedTableOfContentsPage, footer: ConnectedFooter },\r\n\r\n //TODO remove\r\n { path: '/test', main: TestPage, sidebar: TestSideBar, toolbar: TestToolbar, footer: TestFooter },\r\n\r\n //{ path: '/product', main: ConnectedProductsPage }, // product overview\r\n { path: '/product/:productId', main: ConnectedProductRedirectPage }, // product details + licenses\r\n\r\n // table of content for product\r\n { path: '/toc', main: ConnectedTableOfContentsPage }, \r\n\r\n\r\n // content\r\n { path: '/content/:label', main: ConnectedContentPage, sidebar: ConnectedTableOfContentsSideBar, toolbar: ConnectedNotesToolbar },\r\n { path: '/content/:label/:childLabel', main: ConnectedContentPage },\r\n\r\n // backward compatibility for old bookmarks (before 09/2019)\r\n { path: '/content/epc/:label', main: ConnectedContentPage, sidebar: ConnectedTableOfContentsSideBar, toolbar: ConnectedNotesToolbar },\r\n { path: '/content/epc/:label/:childLabel', main: ConnectedContentPage },\r\n\r\n // catch incorrect paths\r\n { path: '/content/epc', main: ConnectedProductRedirectPage }, \r\n { path: '/content/pct', main: ConnectedProductRedirectPage }, \r\n\r\n // notes for product\r\n { path: '/notes', main: ConnectedNotesPage, toolbar: ConnectedNotesToolbar },\r\n\r\n { path: '/search', main: ConnectedSearchPage, toolbar: ConnectedNotesToolbar },\r\n\r\n { path: '/pdf', main: ConnectedPdfJobsPage }, // notes for product\r\n\r\n { path: '/lookup', main: ConnectedContentLookupPage }, // notes for product\r\n\r\n { path: '/redirect/:label', main: ConnectedContentRedirectPage, sidebar: ConnectedTableOfContentsSideBar, toolbar: ConnectedNotesToolbar }, // content\r\n { path: '/redirect/:label/:parKeyOrTag', main: ConnectedContentRedirectPage, sidebar: ConnectedTableOfContentsSideBar, toolbar: ConnectedNotesToolbar }, // content\r\n\r\n { path: '/settings', },\r\n { path: '/settings/languages', },\r\n { path: '/settings/styles', main: ConnectedStylesPage },\r\n\r\n // moved to blazor\r\n //{ path: '/shop', main: ShopPage, footer: false },\r\n //{ path: '/shop/sca/up/:result', main: SCAPage },\r\n //{ path: '/shop/sca/co/:orderId/:result', main: SCAPage },\r\n //{ path: '/shop/completed/co/:orderId', main: ShopPage },\r\n\r\n // moved to blazor\r\n //{ path: '/profile', main: NotImplementedPage, sidebar: ProfileSideBar },\r\n //{ path: '/profile/license', main: ViewLicensePage },\r\n //{ path: '/profile/address', main: EditAddressPage },\r\n //{ path: '/profile/eqe', main: EditEQEPage },\r\n //{ path: '/profile/payment', main: EditPaymentPage },\r\n];\r\n\r\n// reverse order so a later (more specific) route can override a previous (less specific) route\r\nrouteSpecs.reverse();\r\n\r\ntype RoutesComponentProps =\r\n {\r\n // BUG-FIX this causes too many updates: userProfile: UserProfileStore.UserProfileState,\r\n\r\n // TODO include subscription id in UserProfileVM and check here whether it changed\r\n loaderState: LoaderState,\r\n uiLanguage: UILanguage,\r\n customer: Model.CustomerVM | null,\r\n licenses: Model.LicenseSubscriptionVM[],\r\n }\r\n & typeof UserProfileStore.actionCreators\r\n & RouteComponentProps<{}>;\r\n\r\n// TODO move to store\r\ninterface RoutesComponentState {\r\n once: boolean,\r\n}\r\n\r\n/** root layout using flex boxes\r\n * see https://css-tricks.com/snippets/css/a-guide-to-flexbox/ */\r\nclass RoutesComponent extends React.Component {\r\n\r\n constructor(props: RoutesComponentProps) {\r\n super(props);\r\n this.state = { once: false };\r\n }\r\n\r\n componentDidMount() {\r\n this.props.requestUserProfile();\r\n this.once();\r\n }\r\n\r\n componentWillReceiveProps(nextProps: Readonly, nextContext: any) {\r\n setTimeout(() => this.once(), 50);\r\n }\r\n\r\n renderIncomplete(children?: React.ReactNode) {\r\n return (\r\n
    \r\n
    \r\n \r\n {/**/}\r\n \r\n \r\n
    \r\n
    \r\n
    \r\n {children}\r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n\r\n render() {\r\n //const checkout = \"/checkout/\";\r\n const pathname = window.location && window.location.pathname;\r\n\r\n Logging.log(`RoutesComponent.render`, \"render\");\r\n\r\n // TODO display error page with retry button\r\n if (!LoaderStateUtil.isLoaded(this.props.loaderState)) {\r\n return this.renderIncomplete(\r\n this.props.loaderState.hasError ?\r\n
    ERROR: {this.props.loaderState.errorMessage}
    :\r\n

    signing in...
    \r\n );\r\n }\r\n else if (\r\n !this.props.licenses ||\r\n this.props.licenses.length == 0 ||\r\n _.every(this.props.licenses!, (license: Model.LicenseSubscriptionVM) =>\r\n license.hasLicenseExpired || license.offer == null || license.offer.productIds.length == 0 || license.offer.productIds[0] == 'ipt')) {\r\n\r\n\r\n //let code = pathname.toLowerCase().startsWith(checkout) ? pathname.substr(checkout.length) : undefined;\r\n\r\n window.location.assign(Nav.getShopPageUrl());\r\n return

    loading...
    ;\r\n\r\n //if (!pathname.startsWith('/shop'))\r\n //return \r\n\r\n /*return this.renderIncomplete(\r\n \r\n \r\n \r\n \r\n \r\n \r\n );*/\r\n }\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n {/**/}\r\n \r\n \r\n
    \r\n\r\n \r\n {routeSpecs\r\n .filter(routeSpec => routeSpec.toolbar !== undefined)\r\n .map(routeSpec => createRouteElement(routeSpec.path, routeSpec.exact, routeSpec.toolbar!, styles.header))}\r\n \r\n\r\n
    \r\n \r\n {routeSpecs\r\n .filter(routeSpec => routeSpec.sidebar !== undefined)\r\n .map(routeSpec => createRouteElement(routeSpec.path, routeSpec.exact, routeSpec.sidebar!, styles.sidebar))}\r\n \r\n \r\n {routeSpecs\r\n .filter(routeSpec => routeSpec.main !== undefined)\r\n .map(routeSpec => createRouteElement(routeSpec.path, routeSpec.exact, routeSpec.main!, styles.main))}\r\n \r\n
    \r\n \r\n {routeSpecs\r\n .filter(routeSpec => routeSpec.footer !== undefined)\r\n .map(routeSpec => createRouteElement(routeSpec.path, routeSpec.exact, routeSpec.footer!, styles.footer))}\r\n \r\n
    \r\n );\r\n }\r\n\r\n private once() {\r\n if (LoaderStateUtil.isLoaded(this.props.loaderState) && !this.state.once) {\r\n this.CheckBrowser(this.props.uiLanguage);\r\n this.setState({ once: true });\r\n }\r\n }\r\n\r\n private CheckBrowser(uiLanguage: UILanguage) {\r\n const $ = localized(uiLanguage);\r\n\r\n const edge = is.edge() as boolean;\r\n const firefox = is.firefox() as boolean;\r\n const chrome = is.chrome() as boolean;\r\n const safari = is.safari() as boolean;\r\n const opera = is.opera() as boolean;\r\n if (!edge && !firefox && !chrome && !safari && !opera) {\r\n alert($('common_browser_not_supported'));\r\n }\r\n }\r\n}\r\n\r\nconst ConnectedRoutesComponent = connect(\r\n (state: ApplicationState, ownProps: {}) => ({\r\n loaderState: state.userProfile.loaderState,\r\n uiLanguage: state.userProfile.viewOptions.uiLanguage,\r\n customer: state.userProfile.customer,\r\n licenses: state.userProfile.licenses,\r\n\r\n //authStatus: state.auth.status,\r\n //authErrorCode: state.auth.errorCode,\r\n //authErrorMessage: state.auth.errorMessage,\r\n }),\r\n dispatch => bindActionCreators(UserProfileStore.actionCreators, dispatch)\r\n)(RoutesComponent);\r\n\r\nexport const routes = (\r\n \r\n);\r\n\r\n//// error page\r\n//type ErrorPageProps =\r\n// {\r\n// //loaderState: LoaderState,\r\n// //uiLanguage: UILanguage,\r\n// //customer: Model.CustomerVM | null,\r\n// //licenses: Model.LicenseVM[],\r\n\r\n// authStatus: AuthStore.AuthStatus,\r\n// authErrorCode: string | null,\r\n// authErrorMessage: string | null,\r\n// }\r\n// & typeof UserProfileStore.actionCreators\r\n// & RouteComponentProps<{}>;\r\n\r\n//class ErrorPage extends React.Component {\r\n\r\n// constructor(props: ErrorPageProps) {\r\n// super(props);\r\n// }\r\n\r\n// renderIncomplete(children?: React.ReactNode) {\r\n// return (\r\n//
    \r\n//
    \r\n// \r\n//
    \r\n//
    \r\n//
    \r\n// {children}\r\n//
    \r\n//
    \r\n//
    \r\n// );\r\n// }\r\n\r\n// render() {\r\n// // TODO display error page with retry button\r\n// if (this.props.authStatus == 'failed') {\r\n// return this.renderIncomplete(\r\n//
    \r\n// ErrorCode: {this.props.authErrorCode}\r\n// ErrorMessage: {this.props.authErrorMessage}\r\n//
    \r\n// );\r\n// }\r\n// else {\r\n// return this.renderIncomplete(\r\n//
    \r\n// \r\n//
    \r\n// );\r\n// }\r\n// }\r\n//}\r\n\r\n//const ConnectedErrorPage = connect(\r\n// (state: ApplicationState, ownProps: {}) => ({\r\n// //loaderState: state.userProfile.loaderState,\r\n// //uiLanguage: state.userProfile.viewOptions.uiLanguage,\r\n// //customer: state.userProfile.customer,\r\n// //licenses: state.userProfile.licenses,\r\n\r\n// authStatus: state.auth.status,\r\n// authErrorCode: state.auth.errorCode,\r\n// authErrorMessage: state.auth.errorMessage,\r\n// }),\r\n// dispatch => bindActionCreators(AuthStore.actionCreators, dispatch)\r\n//)(ErrorPage);\r\n\r\n//export const errorPage = (\r\n// \r\n//);\r\n\r\n/** Remarks: false will unset an element which was set on a previous level */\r\ntype RouteElement =\r\n | React.ComponentType>\r\n | React.ComponentType\r\n | false;\r\n\r\ninterface RouteSpec {\r\n path: string,\r\n exact?: boolean,\r\n toolbar?: RouteElement,\r\n sidebar?: RouteElement,\r\n main?: RouteElement,\r\n footer?: RouteElement,\r\n}\r\n\r\nfunction createRouteElement(path: string, exact: boolean | undefined, element: RouteElement, style?: React.CSSProperties) {\r\n if (element === false) {\r\n return
    }>
    \r\n } else if (element == undefined) {\r\n return false;\r\n } else {\r\n return \r\n }\r\n}\r\n\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read http://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\ntype Config = {\r\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\r\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\r\n};\r\n\r\nexport function register(config?: Config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(\r\n (process as { env: { [key: string]: string } }).env.PUBLIC_URL,\r\n window.location.href\r\n );\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string, config?: Config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import 'bootstrap/dist/css/bootstrap.css';\r\nimport 'roboto-fontface/css/roboto/roboto-fontface.css';\r\n//import 'materialize-css/dist/css/materialize.css'; // messes up material-ui\r\nimport 'material-design-icons/iconfont/material-icons.css';\r\nimport 'react-virtualized/styles.css';\r\nimport 'draft-js/dist/Draft.css';\r\nimport './index.css';\r\n\r\nimport * as Debug from './debug';\r\nimport { ClientConfig } from './config';\r\n\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Provider } from 'react-redux';\r\nimport { ConnectedRouter } from 'react-router-redux'; // MUST be version 5.0.0+!\r\nimport { createBrowserHistory } from 'history';\r\n\r\nimport { ConnectedMuiThemeProvide } from './theme';\r\nimport { CssBaseline } from './libs/material-ui';\r\n\r\nimport { configureStore } from './store';\r\n\r\nimport * as WebApi from './webapi';\r\n\r\nimport { routes } from './routes';\r\n\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\r\nconst history = createBrowserHistory({ basename: baseUrl! });\r\n\r\n// get client config\r\nconst clientConfig = (window as any).clientConfig as ClientConfig;\r\n\r\nconst initialState = (window as any).initialReduxState;\r\nconst store = configureStore(history, initialState);\r\n\r\nconst authFetch = (input: RequestInfo, init?: RequestInit): Promise => {\r\n init = init || {};\r\n init = {\r\n ...init,\r\n credentials: 'include',\r\n };\r\n return fetch(input, init)\r\n .then(response => {\r\n if (response.status == 401) {\r\n let path = window.location.pathname;\r\n path = encodeURIComponent(path);\r\n window.location.assign(`/AzureADB2C/Account/SignIn?ReturnUrl=${path}`);\r\n }\r\n return response;\r\n });\r\n};\r\n\r\nWebApi.configureWebApi(authFetch);\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n {routes}\r\n \r\n \r\n \r\n ,\r\n document.getElementById('root'));\r\n\r\nimport * as serviceWorker from './serviceWorker';\r\nserviceWorker.unregister();\r\n\r\n\r\n"],"sourceRoot":""}