@shzlx/ui-default 4.58.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/api.ts +61 -0
- package/backendlib/builder.ts +182 -0
- package/backendlib/markdown-it-imsize.ts +235 -0
- package/backendlib/markdown-it-katex.ts +139 -0
- package/backendlib/markdown-it-media.ts +163 -0
- package/backendlib/markdown-it-xss.ts +200 -0
- package/backendlib/markdown.js +64 -0
- package/backendlib/misc.ts +54 -0
- package/backendlib/template.ts +279 -0
- package/breakpoints.json +5 -0
- package/components/DOMAttachedObject.ts +128 -0
- package/components/autocomplete/AssignSelectAutoComplete.tsx +22 -0
- package/components/autocomplete/CustomSelectAutoComplete.tsx +23 -0
- package/components/autocomplete/DomainSelectAutoComplete.tsx +18 -0
- package/components/autocomplete/FileSelectAutoComplete.tsx +26 -0
- package/components/autocomplete/LanguageSelectAutoComplete.tsx +24 -0
- package/components/autocomplete/ProblemSelectAutoComplete.tsx +18 -0
- package/components/autocomplete/UserSelectAutoComplete.tsx +23 -0
- package/components/autocomplete/components/AssignSelectAutoComplete.tsx +118 -0
- package/components/autocomplete/components/DomainSelectAutoComplete.tsx +53 -0
- package/components/autocomplete/components/FileSelectAutoComplete.tsx +50 -0
- package/components/autocomplete/components/LanguageSelectAutoComplete.tsx +48 -0
- package/components/autocomplete/components/ProblemSelectAutoComplete.tsx +54 -0
- package/components/autocomplete/components/UserSelectAutoComplete.tsx +54 -0
- package/components/autocomplete/domainselectautocomplete.page.styl +6 -0
- package/components/autocomplete/index.tsx +110 -0
- package/components/autocomplete/problemselectautocomplete.page.styl +6 -0
- package/components/autocomplete/userselectautocomplete.page.styl +6 -0
- package/components/browser-update.page.ts +27 -0
- package/components/calendar/calendar.page.styl +129 -0
- package/components/calendar/index.js +367 -0
- package/components/clipboard.page.ts +23 -0
- package/components/contest/contest.page.styl +119 -0
- package/components/contest/contest.page.ts +23 -0
- package/components/contest/contest_sidebar.page.styl +21 -0
- package/components/contest/problem-contest-bg.png +0 -0
- package/components/contest/problem-contest-bg@2x.png +0 -0
- package/components/customFont.page.tsx +90 -0
- package/components/datepicker/datepicker.page.tsx +94 -0
- package/components/dialog/DomDialog.ts +145 -0
- package/components/dialog/dialog.page.styl +40 -0
- package/components/dialog/index.tsx +285 -0
- package/components/discussion/CommentBox.js +103 -0
- package/components/discussion/collapsible.page.styl +40 -0
- package/components/discussion/collapsible.page.tsx +62 -0
- package/components/discussion/comments.page.styl +142 -0
- package/components/discussion/comments.page.tsx +192 -0
- package/components/discussion/discussion.page.styl +17 -0
- package/components/discussion/history.page.tsx +81 -0
- package/components/discussion/reaction.page.styl +30 -0
- package/components/discussion/reaction.page.tsx +103 -0
- package/components/drop/drop.page.styl +40 -0
- package/components/dropdown/Dropdown.js +50 -0
- package/components/dropdown/dropdown.page.styl +33 -0
- package/components/dropdown/dropdown.page.ts +8 -0
- package/components/editor/cmeditor.page.ts +23 -0
- package/components/editor/cmeditor.styl +10 -0
- package/components/editor/index.tsx +293 -0
- package/components/editor/mdeditor.ts +60 -0
- package/components/editor/textareaHandler.ts +29 -0
- package/components/footer/footer.page.styl +94 -0
- package/components/footer/footer.page.ts +26 -0
- package/components/form/button.page.default.styl +59 -0
- package/components/form/button.page.styl +36 -0
- package/components/form/checkbox.page.styl +89 -0
- package/components/form/form.page.styl +200 -0
- package/components/form/form.page.ts +20 -0
- package/components/form/multiSelectCheckbox.page.js +46 -0
- package/components/form/radiobox.page.styl +62 -0
- package/components/form/select.page.styl +29 -0
- package/components/form/textbox.page.styl +79 -0
- package/components/form/textbox.page.ts +21 -0
- package/components/form/var.inc.styl +14 -0
- package/components/header/header.page.styl +79 -0
- package/components/highlighter/code-example.js +111 -0
- package/components/highlighter/highlighter.page.styl +99 -0
- package/components/highlighter/highlighter.page.ts +72 -0
- package/components/highlighter/meta.js +15 -0
- package/components/highlighter/prismjs.js +122 -0
- package/components/hint.page.styl +9 -0
- package/components/hint.ts +19 -0
- package/components/hitokoto/index.page.js +21 -0
- package/components/hotkey/hotkey.page.js +83 -0
- package/components/katex/katex.page.js +26 -0
- package/components/katex/katex.page.styl +2 -0
- package/components/languageselect.tsx +94 -0
- package/components/loader/loader.page.styl +40 -0
- package/components/mantine.page.tsx +39 -0
- package/components/marker/Marker.js +192 -0
- package/components/marker/MarkerReactive.js +55 -0
- package/components/marker/marker.page.js +8 -0
- package/components/marker/marker.page.styl +57 -0
- package/components/media/media.page.js +46 -0
- package/components/menu/menu-heading.page.js +28 -0
- package/components/menu/menu.page.js +18 -0
- package/components/menu/menu.page.styl +68 -0
- package/components/message/index.page.ts +166 -0
- package/components/message/worker.ts +110 -0
- package/components/messagepad/DialogueListItem.page.styl +28 -0
- package/components/messagepad/DialogueListItemComponent.jsx +39 -0
- package/components/messagepad/Message.page.styl +64 -0
- package/components/messagepad/MessageComponent.jsx +33 -0
- package/components/messagepad/MessagePad.page.styl +99 -0
- package/components/messagepad/MessagePadDialogueContentContainer.jsx +104 -0
- package/components/messagepad/MessagePadDialogueListContainer.jsx +49 -0
- package/components/messagepad/MessagePadInputContainer.jsx +100 -0
- package/components/messagepad/index.jsx +49 -0
- package/components/messagepad/reducers/activeId.ts +36 -0
- package/components/messagepad/reducers/dialogues.js +53 -0
- package/components/messagepad/reducers/index.ts +14 -0
- package/components/messagepad/reducers/inputs.js +43 -0
- package/components/messagepad/reducers/isPosting.ts +49 -0
- package/components/monaco/index.ts +178 -0
- package/components/monaco/languages/markdown.ts +97 -0
- package/components/monaco/languages/typescript.ts +45 -0
- package/components/monaco/languages/yaml.ts +22 -0
- package/components/monaco/loader.ts +96 -0
- package/components/monaco/monaco.styl +30 -0
- package/components/monaco/nls.js +31 -0
- package/components/monaco/schema/problemconfig.ts +123 -0
- package/components/navigation/hamburgers.page.styl +87 -0
- package/components/navigation/nav-logo-small_dark.png +0 -0
- package/components/navigation/navigation.page.js +203 -0
- package/components/navigation/navigation.page.styl +211 -0
- package/components/notification/index.ts +105 -0
- package/components/notification/notification.page.js +14 -0
- package/components/notification/notification.page.styl +84 -0
- package/components/nprogress.page.styl +50 -0
- package/components/omnisearch/index.page.tsx +124 -0
- package/components/omnisearch/omnibar.page.styl +138 -0
- package/components/pager/pager.page.styl +57 -0
- package/components/preview/preview.page.ts +187 -0
- package/components/problem/create.page.js +12 -0
- package/components/problem/list.page.js +9 -0
- package/components/problem/rp.page.styl +4 -0
- package/components/problem/tag.page.styl +84 -0
- package/components/problemconfig/BasicForm.tsx +92 -0
- package/components/problemconfig/ProblemConfigEditor.tsx +170 -0
- package/components/problemconfig/ProblemConfigForm.tsx +140 -0
- package/components/problemconfig/ProblemConfigTree.tsx +163 -0
- package/components/problemconfig/ProblemType.tsx +165 -0
- package/components/problemconfig/index.tsx +91 -0
- package/components/problemconfig/reducer/config.ts +173 -0
- package/components/problemconfig/reducer/index.ts +11 -0
- package/components/problemconfig/reducer/testdata.ts +16 -0
- package/components/problemconfig/tree/AddTestcase.tsx +137 -0
- package/components/problemconfig/tree/SelectionManager.tsx +140 -0
- package/components/problemconfig/tree/SubtaskSettings.tsx +180 -0
- package/components/problemconfig/tree/Testcase.tsx +98 -0
- package/components/profile/backgrounds/1.jpg +0 -0
- package/components/profile/backgrounds/10.jpg +0 -0
- package/components/profile/backgrounds/11.jpg +0 -0
- package/components/profile/backgrounds/12.jpg +0 -0
- package/components/profile/backgrounds/13.jpg +0 -0
- package/components/profile/backgrounds/14.jpg +0 -0
- package/components/profile/backgrounds/15.jpg +0 -0
- package/components/profile/backgrounds/16.jpg +0 -0
- package/components/profile/backgrounds/17.jpg +0 -0
- package/components/profile/backgrounds/18.jpg +0 -0
- package/components/profile/backgrounds/19.jpg +0 -0
- package/components/profile/backgrounds/2.jpg +0 -0
- package/components/profile/backgrounds/20.jpg +0 -0
- package/components/profile/backgrounds/21.jpg +0 -0
- package/components/profile/backgrounds/3.jpg +0 -0
- package/components/profile/backgrounds/4.jpg +0 -0
- package/components/profile/backgrounds/5.jpg +0 -0
- package/components/profile/backgrounds/6.jpg +0 -0
- package/components/profile/backgrounds/7.jpg +0 -0
- package/components/profile/backgrounds/8.jpg +0 -0
- package/components/profile/backgrounds/9.jpg +0 -0
- package/components/profile/backgrounds/gen_thumbnails.sh +7 -0
- package/components/profile/backgrounds/thumbnail/1.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/10.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/11.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/12.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/13.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/14.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/15.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/16.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/17.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/18.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/19.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/2.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/20.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/21.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/3.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/4.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/5.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/6.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/7.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/8.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/9.jpg +0 -0
- package/components/profile/profile.page.styl +23 -0
- package/components/react/DomComponent.tsx +14 -0
- package/components/react/IconComponent.tsx +20 -0
- package/components/record/record.page.styl +26 -0
- package/components/rotator/index.js +75 -0
- package/components/rotator/rotator.page.styl +20 -0
- package/components/scratchpad/DataInput.page.styl +17 -0
- package/components/scratchpad/DataInputComponent.jsx +45 -0
- package/components/scratchpad/Editor.page.styl +13 -0
- package/components/scratchpad/Panel.page.styl +18 -0
- package/components/scratchpad/PanelButton.page.styl +15 -0
- package/components/scratchpad/PanelButtonComponent.jsx +19 -0
- package/components/scratchpad/PanelComponent.jsx +25 -0
- package/components/scratchpad/ScratchpadEditorContainer.tsx +137 -0
- package/components/scratchpad/ScratchpadPretestContainer.jsx +57 -0
- package/components/scratchpad/ScratchpadRecordsContainer.jsx +45 -0
- package/components/scratchpad/ScratchpadRecordsRowContainer.jsx +83 -0
- package/components/scratchpad/ScratchpadSettings.tsx +48 -0
- package/components/scratchpad/ScratchpadToolbarContainer.jsx +190 -0
- package/components/scratchpad/Tab.page.styl +24 -0
- package/components/scratchpad/Toolbar.page.styl +53 -0
- package/components/scratchpad/ToolbarComponent.jsx +85 -0
- package/components/scratchpad/index.tsx +132 -0
- package/components/scratchpad/reducers/editor.ts +24 -0
- package/components/scratchpad/reducers/index.ts +17 -0
- package/components/scratchpad/reducers/pretest.ts +34 -0
- package/components/scratchpad/reducers/records.ts +40 -0
- package/components/scratchpad/reducers/state.ts +10 -0
- package/components/scratchpad/reducers/ui.ts +152 -0
- package/components/scratchpad/scratchpad.page.styl +55 -0
- package/components/scratchpad/var.inc.styl +2 -0
- package/components/selectUser.tsx +16 -0
- package/components/signin/signInDialog.page.js +84 -0
- package/components/signin/signin_dialog.page.styl +57 -0
- package/components/smoothscroll/smoothscroll.page.js +44 -0
- package/components/socket/index.ts +68 -0
- package/components/star/star.page.styl +20 -0
- package/components/star/star.page.ts +58 -0
- package/components/sticky/sticky.page.js +66 -0
- package/components/tab/Tab.js +168 -0
- package/components/tab/tab.page.js +9 -0
- package/components/tab/tab.page.styl +105 -0
- package/components/tab/var.inc.styl +3 -0
- package/components/table/StyledTable.js +51 -0
- package/components/table/styledTable.page.js +8 -0
- package/components/table/table.page.styl +73 -0
- package/components/time/time.page.js +47 -0
- package/components/tooltip/Tooltip.js +49 -0
- package/components/tooltip/tooltip.page.js +29 -0
- package/components/tooltip/tooltip.page.styl +69 -0
- package/components/training/training.page.styl +25 -0
- package/components/upload.tsx +103 -0
- package/components/vote/vote.page.js +43 -0
- package/components/zipDownloader/index.ts +157 -0
- package/constant/domain.js +21 -0
- package/constant/message.js +5 -0
- package/constant/record.js +52 -0
- package/context.ts +11 -0
- package/entry.js +72 -0
- package/hydro.ts +112 -0
- package/index.ts +226 -0
- package/lazyload.ts +69 -0
- package/locales/en.yaml +71 -0
- package/locales/ko.yaml +823 -0
- package/locales/zh.yaml +1137 -0
- package/locales/zh_TW.yaml +1133 -0
- package/misc/Page.ts +49 -0
- package/misc/PageLoader.js +31 -0
- package/misc/float.styl +14 -0
- package/misc/grid.styl +1048 -0
- package/misc/immersive-background.jpg +0 -0
- package/misc/immersive-background@2x.jpg +0 -0
- package/misc/immersive.styl +23 -0
- package/misc/nothing.styl +13 -0
- package/misc/puzzled_twd2.svg +1 -0
- package/misc/section.styl +105 -0
- package/misc/slideout.styl +46 -0
- package/misc/structure.styl +158 -0
- package/misc/textalign.styl +11 -0
- package/misc/typography.styl +485 -0
- package/package.json +148 -0
- package/polyfill.ts +90 -0
- package/postcss.config.js +15 -0
- package/sentry.ts +26 -0
- package/service-worker.ts +265 -0
- package/setting.yaml +98 -0
- package/templates/about.html +14 -0
- package/templates/bsod.html +35 -0
- package/templates/components/comments_discussion.html +165 -0
- package/templates/components/comments_solution.html +171 -0
- package/templates/components/contest.html +12 -0
- package/templates/components/form.html +214 -0
- package/templates/components/home.html +20 -0
- package/templates/components/homework.html +8 -0
- package/templates/components/md_hint.html +39 -0
- package/templates/components/noscript_note.html +15 -0
- package/templates/components/nothing.html +6 -0
- package/templates/components/paginator.html +25 -0
- package/templates/components/problem.html +33 -0
- package/templates/components/record.html +21 -0
- package/templates/components/sidemenu.html +11 -0
- package/templates/components/user.html +49 -0
- package/templates/contest_balloon.html +48 -0
- package/templates/contest_clarification.html +103 -0
- package/templates/contest_detail.html +56 -0
- package/templates/contest_edit.html +259 -0
- package/templates/contest_main.html +146 -0
- package/templates/contest_manage.html +80 -0
- package/templates/contest_print.html +27 -0
- package/templates/contest_problemlist.html +231 -0
- package/templates/contest_scoreboard.html +46 -0
- package/templates/contest_scoreboard_download_html.html +71 -0
- package/templates/contest_user.html +47 -0
- package/templates/discussion_create.html +28 -0
- package/templates/discussion_detail.html +149 -0
- package/templates/discussion_edit.html +30 -0
- package/templates/discussion_main_or_node.html +47 -0
- package/templates/domain_base.html +26 -0
- package/templates/domain_create.html +55 -0
- package/templates/domain_dashboard.html +45 -0
- package/templates/domain_edit.html +6 -0
- package/templates/domain_group.html +51 -0
- package/templates/domain_join.html +47 -0
- package/templates/domain_join_applications.html +67 -0
- package/templates/domain_permission.html +66 -0
- package/templates/domain_role.html +71 -0
- package/templates/domain_user.html +86 -0
- package/templates/domain_user_raw.html +5 -0
- package/templates/error.html +25 -0
- package/templates/home_domain.html +64 -0
- package/templates/home_files.html +16 -0
- package/templates/home_messages.html +9 -0
- package/templates/home_security.html +224 -0
- package/templates/home_settings.html +21 -0
- package/templates/homework_detail.html +82 -0
- package/templates/homework_edit.html +138 -0
- package/templates/homework_files.html +24 -0
- package/templates/homework_main.html +76 -0
- package/templates/layout/basic.html +27 -0
- package/templates/layout/home_base.html +13 -0
- package/templates/layout/html5.html +74 -0
- package/templates/layout/immersive.html +22 -0
- package/templates/layout/mail.html +31 -0
- package/templates/layout/simple.html +4 -0
- package/templates/layout/wiki_base.html +16 -0
- package/templates/main.html +22 -0
- package/templates/manage_base.html +24 -0
- package/templates/manage_config.html +6 -0
- package/templates/manage_dashboard.html +27 -0
- package/templates/manage_script.html +56 -0
- package/templates/manage_setting.html +6 -0
- package/templates/manage_user_import.html +23 -0
- package/templates/manage_user_priv.html +76 -0
- package/templates/partials/category.html +19 -0
- package/templates/partials/contest.html +3 -0
- package/templates/partials/contest_balloon.html +37 -0
- package/templates/partials/contest_sidebar.html +150 -0
- package/templates/partials/contest_sidebar_management.html +56 -0
- package/templates/partials/contest_user.html +19 -0
- package/templates/partials/discussion_edit_form.html +45 -0
- package/templates/partials/discussion_list.html +50 -0
- package/templates/partials/discussion_nodes_widget.html +17 -0
- package/templates/partials/files.html +49 -0
- package/templates/partials/footer.html +108 -0
- package/templates/partials/hamburger.html +7 -0
- package/templates/partials/header_mobile.html +12 -0
- package/templates/partials/homepage/bulletin.html +7 -0
- package/templates/partials/homepage/contest.html +48 -0
- package/templates/partials/homepage/discussion.html +13 -0
- package/templates/partials/homepage/discussion_nodes.html +4 -0
- package/templates/partials/homepage/error.html +5 -0
- package/templates/partials/homepage/hitokoto.html +6 -0
- package/templates/partials/homepage/homework.html +45 -0
- package/templates/partials/homepage/problem_search.html +13 -0
- package/templates/partials/homepage/ranking.html +39 -0
- package/templates/partials/homepage/recent_problems.html +17 -0
- package/templates/partials/homepage/starred_problems.html +15 -0
- package/templates/partials/homepage/suggestion.html +34 -0
- package/templates/partials/homepage/training.html +50 -0
- package/templates/partials/homework.html +3 -0
- package/templates/partials/homework_default_penalty_rules.yaml +6 -0
- package/templates/partials/homework_sidebar.html +93 -0
- package/templates/partials/login_dialog.html +56 -0
- package/templates/partials/manage_user_priv.html +78 -0
- package/templates/partials/nav.html +138 -0
- package/templates/partials/problem-sidebar-information.html +25 -0
- package/templates/partials/problem.html +2 -0
- package/templates/partials/problem_category_dialog.html +43 -0
- package/templates/partials/problem_default.md +26 -0
- package/templates/partials/problem_description.html +33 -0
- package/templates/partials/problem_files.html +63 -0
- package/templates/partials/problem_list.html +68 -0
- package/templates/partials/problem_lucky.html +10 -0
- package/templates/partials/problem_sidebar.html +14 -0
- package/templates/partials/problem_sidebar_contest.html +43 -0
- package/templates/partials/problem_sidebar_homework.html +42 -0
- package/templates/partials/problem_sidebar_normal.html +152 -0
- package/templates/partials/problem_stat.html +3 -0
- package/templates/partials/scoreboard.html +79 -0
- package/templates/partials/setting.html +92 -0
- package/templates/partials/training_default.json +14 -0
- package/templates/partials/training_detail.html +153 -0
- package/templates/partials/user.html +2 -0
- package/templates/partials/user_detail/activity.html +18 -0
- package/templates/partials/user_detail/solution.html +29 -0
- package/templates/problem_config.html +39 -0
- package/templates/problem_detail.html +150 -0
- package/templates/problem_edit.html +111 -0
- package/templates/problem_files.html +91 -0
- package/templates/problem_hack.html +41 -0
- package/templates/problem_import.html +58 -0
- package/templates/problem_main.html +100 -0
- package/templates/problem_solution.html +55 -0
- package/templates/problem_statistics.html +96 -0
- package/templates/problem_submit.html +40 -0
- package/templates/ranking.html +81 -0
- package/templates/record_detail.html +134 -0
- package/templates/record_detail_status.html +93 -0
- package/templates/record_detail_summary.html +19 -0
- package/templates/record_main.html +142 -0
- package/templates/record_main_tr.html +35 -0
- package/templates/status.html +75 -0
- package/templates/training_detail.html +120 -0
- package/templates/training_edit.html +68 -0
- package/templates/training_files.html +64 -0
- package/templates/training_main.html +107 -0
- package/templates/user_changemail_mail.html +6 -0
- package/templates/user_changemail_mail_sent.html +9 -0
- package/templates/user_delete_pending.html +10 -0
- package/templates/user_detail.html +181 -0
- package/templates/user_login.html +46 -0
- package/templates/user_logout.html +13 -0
- package/templates/user_lostpass.html +27 -0
- package/templates/user_lostpass_mail.html +6 -0
- package/templates/user_lostpass_mail_sent.html +9 -0
- package/templates/user_lostpass_with_code.html +29 -0
- package/templates/user_register.html +22 -0
- package/templates/user_register_mail.html +6 -0
- package/templates/user_register_mail_sent.html +9 -0
- package/templates/user_register_with_code.html +35 -0
- package/templates/user_sudo.html +54 -0
- package/templates/user_sudo_redirect.html +18 -0
- package/templates/wiki_help.html +189 -0
- package/theme/bp6-compat.css +48 -0
- package/theme/dark.styl +397 -0
- package/theme/default.js +33 -0
- package/typed.d.ts +20 -0
- package/utils/base.ts +209 -0
- package/utils/base64.js +104 -0
- package/utils/db.ts +32 -0
- package/utils/index.ts +73 -0
- package/utils/loadReactRedux.ts +32 -0
- package/utils/mediaQuery.ts +13 -0
- package/utils/pjax.js +148 -0
- package/utils/slide.ts +57 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
.nav--placeholder
|
|
2
|
+
height: $nav-item-height
|
|
3
|
+
|
|
4
|
+
.nav
|
|
5
|
+
position: relative
|
|
6
|
+
left: 0
|
|
7
|
+
top: 0
|
|
8
|
+
width: 100%
|
|
9
|
+
height: rem($nav-item-height)
|
|
10
|
+
font-size: rem($font-size-secondary)
|
|
11
|
+
transition: background .2s
|
|
12
|
+
transition-timing-function: ease-out-cubic
|
|
13
|
+
z-index: 500
|
|
14
|
+
background: rgba(#FFF, 0.98)
|
|
15
|
+
|
|
16
|
+
.nav__item
|
|
17
|
+
color: $text-1-color
|
|
18
|
+
&.nav--active
|
|
19
|
+
border-color: $nav-item-active-color
|
|
20
|
+
&:before
|
|
21
|
+
box-shadow: 0 0 30px $nav-item-active-color,
|
|
22
|
+
0 0 30px $nav-item-active-color
|
|
23
|
+
&:hover
|
|
24
|
+
border-color: $nav-item-hover-color
|
|
25
|
+
background: #F8F8F8
|
|
26
|
+
&:before
|
|
27
|
+
box-shadow: none
|
|
28
|
+
|
|
29
|
+
.nav__item--round
|
|
30
|
+
border-color: $primary-color
|
|
31
|
+
color: $primary-color
|
|
32
|
+
|
|
33
|
+
&:hover
|
|
34
|
+
background-color: $primary-color
|
|
35
|
+
color: #FFF
|
|
36
|
+
|
|
37
|
+
&:visited, &:active
|
|
38
|
+
color: $primary-color
|
|
39
|
+
|
|
40
|
+
.hasjs &
|
|
41
|
+
position: fixed
|
|
42
|
+
|
|
43
|
+
.nojs &
|
|
44
|
+
box-shadow: 0 0 10px rgba(#000, 0.4)
|
|
45
|
+
margin-bottom: rem(-($nav-item-height))
|
|
46
|
+
overflow: hidden
|
|
47
|
+
|
|
48
|
+
.nav > .row
|
|
49
|
+
transition: max-width .5s ease-out-cubic
|
|
50
|
+
|
|
51
|
+
.nav--shadow
|
|
52
|
+
position: fixed
|
|
53
|
+
left: 0
|
|
54
|
+
top: 0
|
|
55
|
+
width: 100%
|
|
56
|
+
height: rem($nav-item-height)
|
|
57
|
+
z-index: 300
|
|
58
|
+
transition: box-shadow .2s
|
|
59
|
+
transition-timing-function: ease-out-cubic
|
|
60
|
+
box-shadow: 0 0 6px rgba(#000, 0.3)
|
|
61
|
+
|
|
62
|
+
.nojs &
|
|
63
|
+
display: none
|
|
64
|
+
|
|
65
|
+
.nav__list, .nav__list-item
|
|
66
|
+
list-style: none
|
|
67
|
+
|
|
68
|
+
.nav__list--main
|
|
69
|
+
float: left
|
|
70
|
+
|
|
71
|
+
.nav__item
|
|
72
|
+
display: block
|
|
73
|
+
line-height: rem($nav-item-height - 6)
|
|
74
|
+
padding: rem(0 20px 3px 20px)
|
|
75
|
+
border-top: 3px solid transparent
|
|
76
|
+
color: #000
|
|
77
|
+
transition: border-color .2s, background .2s, color .2s
|
|
78
|
+
transition-timing-function: ease-out-cubic
|
|
79
|
+
position: relative
|
|
80
|
+
|
|
81
|
+
&:before
|
|
82
|
+
content: ''
|
|
83
|
+
position: absolute
|
|
84
|
+
left: 0
|
|
85
|
+
top: -1px
|
|
86
|
+
width: 100%
|
|
87
|
+
height: 1px
|
|
88
|
+
|
|
89
|
+
&:visited, &:active
|
|
90
|
+
color: #000
|
|
91
|
+
|
|
92
|
+
&.nav--active
|
|
93
|
+
border-color: $nav-item-active-immersive-color
|
|
94
|
+
&:before
|
|
95
|
+
box-shadow: 0 0 30px #FFF,
|
|
96
|
+
0 0 30px #FFF,
|
|
97
|
+
0 0 30px #FFF
|
|
98
|
+
|
|
99
|
+
&:hover
|
|
100
|
+
text-decoration: none
|
|
101
|
+
border-color: lighten($nav-item-hover-color, 60%)
|
|
102
|
+
background: rgba(#FFF, 0.3)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
.nav__list--secondary
|
|
106
|
+
float: right
|
|
107
|
+
|
|
108
|
+
.nav__item--round
|
|
109
|
+
display: block
|
|
110
|
+
line-height: rem($nav-item-round-height - 2 * $nav-item-round-border)
|
|
111
|
+
margin: rem((($nav-item-height - $nav-item-round-height) / 2) 0)
|
|
112
|
+
padding: rem(0 25px)
|
|
113
|
+
border-radius: rem($nav-item-round-height / 2)
|
|
114
|
+
color: #FFF
|
|
115
|
+
border: $nav-item-round-border solid #FFF
|
|
116
|
+
transition: background .2s, color .2s, border-color .2s
|
|
117
|
+
transition-timing-function: ease-out-cubic
|
|
118
|
+
|
|
119
|
+
&:visited, &:active
|
|
120
|
+
color: #FFF
|
|
121
|
+
|
|
122
|
+
&:hover
|
|
123
|
+
text-decoration: none
|
|
124
|
+
background: #FFF
|
|
125
|
+
color: #666
|
|
126
|
+
|
|
127
|
+
.nav__list-item
|
|
128
|
+
float: left
|
|
129
|
+
|
|
130
|
+
.nav__list--main .nav__item--round
|
|
131
|
+
margin-right: rem(5px)
|
|
132
|
+
|
|
133
|
+
.nav__list--secondary .nav__item--round
|
|
134
|
+
margin-left: rem(5px)
|
|
135
|
+
|
|
136
|
+
.nav__logo
|
|
137
|
+
display: block
|
|
138
|
+
height: rem($nav-logo-height)
|
|
139
|
+
margin: rem((($nav-item-height - $nav-logo-height) / 2) 5px)
|
|
140
|
+
|
|
141
|
+
&:hover
|
|
142
|
+
text-decoration: none
|
|
143
|
+
|
|
144
|
+
+mobile()
|
|
145
|
+
display: none
|
|
146
|
+
|
|
147
|
+
// For Mobile: show a slideout vertical arranged menu
|
|
148
|
+
+mobile()
|
|
149
|
+
|
|
150
|
+
.nav .columns
|
|
151
|
+
padding: 0
|
|
152
|
+
|
|
153
|
+
.nav--shadow
|
|
154
|
+
display: none
|
|
155
|
+
|
|
156
|
+
.nav.slideout-menu
|
|
157
|
+
background: #1D1F20
|
|
158
|
+
|
|
159
|
+
.nav__list
|
|
160
|
+
float: none
|
|
161
|
+
|
|
162
|
+
.nav__list-item
|
|
163
|
+
float: none
|
|
164
|
+
|
|
165
|
+
.nav__item,
|
|
166
|
+
.nav__item--round,
|
|
167
|
+
.nav .dropdown-target.menu .menu__link
|
|
168
|
+
line-height: rem($nav-item-height - 6)
|
|
169
|
+
padding: rem(0 20px 3px 20px)
|
|
170
|
+
border: 0
|
|
171
|
+
border-left: 3px solid transparent
|
|
172
|
+
margin: 0
|
|
173
|
+
border-radius: 0
|
|
174
|
+
background: none
|
|
175
|
+
|
|
176
|
+
.icon
|
|
177
|
+
line-height: inherit
|
|
178
|
+
|
|
179
|
+
&.nav--active
|
|
180
|
+
border-color: $nav-item-active-color
|
|
181
|
+
|
|
182
|
+
&:visited, &:active
|
|
183
|
+
background: none
|
|
184
|
+
color: #FFF
|
|
185
|
+
|
|
186
|
+
&:hover
|
|
187
|
+
border-color: $nav-item-hover-color
|
|
188
|
+
background: rgba(#FFF, 0.10)
|
|
189
|
+
color: #FFF
|
|
190
|
+
|
|
191
|
+
.nav__item
|
|
192
|
+
&:before
|
|
193
|
+
left: -2px
|
|
194
|
+
top: 0
|
|
195
|
+
height: 100%
|
|
196
|
+
width: 1px
|
|
197
|
+
|
|
198
|
+
.nav .dropdown-target.menu
|
|
199
|
+
display: block
|
|
200
|
+
background: none
|
|
201
|
+
border: 0
|
|
202
|
+
box-shadow: none
|
|
203
|
+
|
|
204
|
+
.menu__link
|
|
205
|
+
padding-left: rem(35px)
|
|
206
|
+
|
|
207
|
+
.menu__seperator
|
|
208
|
+
display: none
|
|
209
|
+
|
|
210
|
+
.nav__list--secondary
|
|
211
|
+
border-top: 1px solid #666
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { MantineProvider } from '@mantine/core';
|
|
2
|
+
import { Notifications, notifications } from '@mantine/notifications';
|
|
3
|
+
import $ from 'jquery';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { theme } from 'vj/components/mantine.page';
|
|
6
|
+
import { tpl, zIndexManager } from 'vj/utils/base';
|
|
7
|
+
|
|
8
|
+
document.body.append(tpl(
|
|
9
|
+
React.createElement(MantineProvider, { theme },
|
|
10
|
+
React.createElement(Notifications, { position: 'bottom-left', zIndex: 99999 }),
|
|
11
|
+
), true),
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
interface NotificationOptions {
|
|
15
|
+
avatar?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
message: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
duration?: number;
|
|
20
|
+
action?: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default class Notification {
|
|
24
|
+
type: string;
|
|
25
|
+
action: any;
|
|
26
|
+
$dom: JQuery<HTMLElement>;
|
|
27
|
+
$n: JQuery<HTMLElement>;
|
|
28
|
+
duration: number;
|
|
29
|
+
autoHideTimer?: NodeJS.Timeout;
|
|
30
|
+
|
|
31
|
+
constructor({
|
|
32
|
+
avatar, title, message, type = '', duration = 3000, action,
|
|
33
|
+
}: NotificationOptions) {
|
|
34
|
+
this.type = type;
|
|
35
|
+
if (avatar) this.type += ' avatar';
|
|
36
|
+
if (title) this.type += ' title';
|
|
37
|
+
this.action = action || (() => { });
|
|
38
|
+
this.$dom = $(tpl`<div class="notification ${this.type} hide"></div>`);
|
|
39
|
+
if (avatar) $(tpl`<img width="32" height="32" class="avatar" src="${avatar}"></img>`).appendTo(this.$dom);
|
|
40
|
+
const content = message.split('\n').map((line) => tpl`<p>${line}</p>`).join('');
|
|
41
|
+
if (title) {
|
|
42
|
+
$(tpl`<div class="notification-content"><h2>${title}</h2>${{ templateRaw: true, html: content }}</div>`).appendTo(this.$dom);
|
|
43
|
+
} else $(`<div>${content}</div>`).appendTo(this.$dom);
|
|
44
|
+
this.$dom.on('click', this.handleClick.bind(this));
|
|
45
|
+
this.$n = this.$dom
|
|
46
|
+
.css('z-index', zIndexManager.getNext())
|
|
47
|
+
.appendTo(document.body);
|
|
48
|
+
this.$n.width(); // force reflow
|
|
49
|
+
this.duration = duration;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
handleClick() {
|
|
53
|
+
this.action();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
show(autohide = true) {
|
|
57
|
+
this.$n.removeClass('hide');
|
|
58
|
+
if (this.duration && autohide) this.autoHideTimer = setTimeout(this.hide.bind(this), this.duration);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
hide() {
|
|
62
|
+
this.$n.addClass('hide');
|
|
63
|
+
setTimeout(() => this.$n.remove(), 200);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static success(message: string, duration?: number) {
|
|
67
|
+
return notifications.show({
|
|
68
|
+
title: message,
|
|
69
|
+
color: '#238551',
|
|
70
|
+
message: '',
|
|
71
|
+
icon: React.createElement('i', { className: 'icon icon-check' }),
|
|
72
|
+
autoClose: duration,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static info(message: string, duration?: number) {
|
|
77
|
+
return notifications.show({
|
|
78
|
+
title: message,
|
|
79
|
+
color: '#2d72d2',
|
|
80
|
+
message: '',
|
|
81
|
+
icon: React.createElement('i', { className: 'icon icon-info--circle' }),
|
|
82
|
+
autoClose: duration,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static warn(message: string, duration?: number) {
|
|
87
|
+
return notifications.show({
|
|
88
|
+
title: message,
|
|
89
|
+
color: '#fbb360',
|
|
90
|
+
message: '',
|
|
91
|
+
icon: React.createElement('i', { className: 'icon icon-warning' }),
|
|
92
|
+
autoClose: duration,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
static error(message: string, duration?: number) {
|
|
97
|
+
return notifications.show({
|
|
98
|
+
title: message,
|
|
99
|
+
color: '#cd4246',
|
|
100
|
+
message: '',
|
|
101
|
+
icon: React.createElement('i', { className: 'icon icon-close--circle' }),
|
|
102
|
+
autoClose: duration,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Notification from 'vj/components/notification/index';
|
|
2
|
+
import { AutoloadPage } from 'vj/misc/Page';
|
|
3
|
+
import { i18n } from 'vj/utils';
|
|
4
|
+
|
|
5
|
+
export default new AutoloadPage('notificationPage', (pagename) => {
|
|
6
|
+
const message = i18n(`Hint::Page::${pagename}`);
|
|
7
|
+
const item = localStorage.getItem(`hint.${message}`);
|
|
8
|
+
if (message !== `Hint::Page::${pagename}` && !item) {
|
|
9
|
+
Notification.info(message, message.length * 500);
|
|
10
|
+
localStorage.setItem(`hint.${message}`, true);
|
|
11
|
+
}
|
|
12
|
+
const text = new URL(window.location.href).searchParams.get('notification');
|
|
13
|
+
if (text) Notification.success(text);
|
|
14
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.notification
|
|
2
|
+
position: fixed
|
|
3
|
+
left: rem(20px)
|
|
4
|
+
bottom: rem(20px)
|
|
5
|
+
padding: rem(10px)
|
|
6
|
+
border-radius: rem(2px)
|
|
7
|
+
background: rgba(#222, 0.9)
|
|
8
|
+
color: #FFF
|
|
9
|
+
font-size: rem($font-size-secondary)
|
|
10
|
+
transition: transform .2s, opacity .2s
|
|
11
|
+
transition-timing-function: ease-out-cubic
|
|
12
|
+
z-index: 1000 // managed
|
|
13
|
+
line-height: rem(20px)
|
|
14
|
+
box-shadow: 0 4px 10px rgba(#000, 0.4)
|
|
15
|
+
min-width: rem(150px)
|
|
16
|
+
|
|
17
|
+
img
|
|
18
|
+
border-radius: 50%
|
|
19
|
+
|
|
20
|
+
&.hide
|
|
21
|
+
opacity: 0
|
|
22
|
+
transform: translateY(20px) scale(0.9)
|
|
23
|
+
|
|
24
|
+
&.avatar
|
|
25
|
+
display: flex
|
|
26
|
+
align-items: center
|
|
27
|
+
|
|
28
|
+
.avatar
|
|
29
|
+
display: inline-block
|
|
30
|
+
vertical-align: top
|
|
31
|
+
margin-right: rem(10px)
|
|
32
|
+
|
|
33
|
+
&:before
|
|
34
|
+
display: inline-block
|
|
35
|
+
font-family: $icon-font-name !important
|
|
36
|
+
margin-right: rem(10px)
|
|
37
|
+
font-size: rem($font-size-icon)
|
|
38
|
+
line-height: 1
|
|
39
|
+
vertical-align: top
|
|
40
|
+
margin-top: rem((20px - $font-size-icon) / 2)
|
|
41
|
+
|
|
42
|
+
&.avatar:before
|
|
43
|
+
display: none !important
|
|
44
|
+
|
|
45
|
+
for key, value in $notification-color
|
|
46
|
+
&.{key}
|
|
47
|
+
border-left: 5px solid value
|
|
48
|
+
&:before
|
|
49
|
+
color: value
|
|
50
|
+
|
|
51
|
+
for key, value in $notification-icon
|
|
52
|
+
&:not(.avatar).{key}:before
|
|
53
|
+
content: value
|
|
54
|
+
|
|
55
|
+
+mobile()
|
|
56
|
+
.notification
|
|
57
|
+
padding: rem(20px 15px)
|
|
58
|
+
left: 0
|
|
59
|
+
width: 100%
|
|
60
|
+
min-width: auto
|
|
61
|
+
bottom: 0
|
|
62
|
+
|
|
63
|
+
.notification-content
|
|
64
|
+
float: right
|
|
65
|
+
margin-top: rem(7px)
|
|
66
|
+
margin-left: rem(10px)
|
|
67
|
+
margin-right: rem(15px)
|
|
68
|
+
|
|
69
|
+
h2
|
|
70
|
+
color: #FFFFFF
|
|
71
|
+
|
|
72
|
+
p
|
|
73
|
+
margin-top: rem(7px);
|
|
74
|
+
font-size: larger
|
|
75
|
+
|
|
76
|
+
@media print {
|
|
77
|
+
.notification {
|
|
78
|
+
display: none !important
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.mantine-notifications-close-button:hover {
|
|
83
|
+
background-color: rgba(0, 0, 0, 0.1) !important;
|
|
84
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
$spinner-size = 18px
|
|
2
|
+
$spinner-margin = ($nav-item-height - $spinner-size) / 2
|
|
3
|
+
|
|
4
|
+
#nprogress
|
|
5
|
+
pointer-events: none
|
|
6
|
+
|
|
7
|
+
#nprogress .bar
|
|
8
|
+
background: $nprogress-color
|
|
9
|
+
position: fixed
|
|
10
|
+
top: $nav-item-height
|
|
11
|
+
z-index: 99
|
|
12
|
+
left: 0
|
|
13
|
+
width: 100%
|
|
14
|
+
height: 2px
|
|
15
|
+
+mobile()
|
|
16
|
+
margin-top: rem(10px)
|
|
17
|
+
|
|
18
|
+
#nprogress .peg
|
|
19
|
+
display: none
|
|
20
|
+
|
|
21
|
+
#nprogress .spinner
|
|
22
|
+
display: block
|
|
23
|
+
position: fixed
|
|
24
|
+
z-index: 99999
|
|
25
|
+
top: rem($spinner-margin)
|
|
26
|
+
right: rem($spinner-margin)
|
|
27
|
+
|
|
28
|
+
#nprogress .spinner-icon
|
|
29
|
+
width: rem($spinner-size)
|
|
30
|
+
height: rem($spinner-size)
|
|
31
|
+
box-sizing: border-box
|
|
32
|
+
border: solid 2px transparent
|
|
33
|
+
border-top-color: $nprogress-color
|
|
34
|
+
border-left-color: $nprogress-color
|
|
35
|
+
border-radius: 50%
|
|
36
|
+
animation: nprogress-spinner 400ms linear infinite
|
|
37
|
+
|
|
38
|
+
.nprogress-custom-parent
|
|
39
|
+
overflow: hidden
|
|
40
|
+
position: relative
|
|
41
|
+
|
|
42
|
+
.nprogress-custom-parent #nprogress .spinner,
|
|
43
|
+
.nprogress-custom-parent #nprogress .bar
|
|
44
|
+
position: absolute
|
|
45
|
+
|
|
46
|
+
@keyframes nprogress-spinner
|
|
47
|
+
0%
|
|
48
|
+
transform: rotate(0deg)
|
|
49
|
+
100%
|
|
50
|
+
transform: rotate(360deg)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { debounce } from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom/client';
|
|
4
|
+
import { STATUS_CODES } from 'vj/constant/record';
|
|
5
|
+
import { AutoloadPage } from 'vj/misc/Page';
|
|
6
|
+
import {
|
|
7
|
+
api, i18n, request,
|
|
8
|
+
} from 'vj/utils';
|
|
9
|
+
|
|
10
|
+
export default new AutoloadPage('omnibar', () => {
|
|
11
|
+
if (document.documentElement.dataset.layout !== 'basic') return;
|
|
12
|
+
const $search = $(`
|
|
13
|
+
<div class='omnibar' data-hotkey="esc:click" style="opacity:0;display:none;">
|
|
14
|
+
<div class='omnibar-main'>
|
|
15
|
+
<div>
|
|
16
|
+
<input placeholder="Search" />
|
|
17
|
+
<span class="icon icon-search"></span>
|
|
18
|
+
</div>
|
|
19
|
+
<div id='omnibar-content'></div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
`);
|
|
23
|
+
const $entry = $(`
|
|
24
|
+
<button class="omnibar-toggle" data-global-hotkey="ctrl+k:click">
|
|
25
|
+
<span class="icon icon-search"></span>
|
|
26
|
+
</button>
|
|
27
|
+
`);
|
|
28
|
+
$(document.body).append($search);
|
|
29
|
+
$(document.body).append($entry);
|
|
30
|
+
const $input = $('.omnibar input') as JQuery<HTMLInputElement>;
|
|
31
|
+
|
|
32
|
+
const prefix = window.location.pathname.startsWith('/d/') ? `/d/${UiContext.domainId}` : '';
|
|
33
|
+
let setSearching;
|
|
34
|
+
let pdocs = [];
|
|
35
|
+
let psdict = {};
|
|
36
|
+
let udocs = [];
|
|
37
|
+
function SearchResult() {
|
|
38
|
+
const [searching, set] = React.useState(false);
|
|
39
|
+
setSearching = set;
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{searching && <div>Searching...</div>}
|
|
43
|
+
{pdocs.length > 0 && <div className="omnibar-content-title">{i18n('Problems')}</div>}
|
|
44
|
+
{pdocs.map((i) => ({ ...i, base: i.domainId !== UiContext.domainId ? `/d/${i.domainId}` : prefix })).map(({
|
|
45
|
+
domainId, docId, pid, title, nSubmit, nAccept, base,
|
|
46
|
+
}) => (
|
|
47
|
+
<a
|
|
48
|
+
key={domainId + docId}
|
|
49
|
+
className="omnibar-content-section omnibar-problem"
|
|
50
|
+
href={`${base}/p/${pid || docId}`}
|
|
51
|
+
>
|
|
52
|
+
<div>
|
|
53
|
+
<p
|
|
54
|
+
onClick={(ev) => {
|
|
55
|
+
if (psdict[`${domainId}#${docId}`]?.rid) {
|
|
56
|
+
window.location.href = `${base}/record/${psdict[`${domainId}#${docId}`]?.rid}`;
|
|
57
|
+
}
|
|
58
|
+
ev.preventDefault();
|
|
59
|
+
}}
|
|
60
|
+
className={`record-status--text ${STATUS_CODES[psdict[`${domainId}#${docId}`]?.status]}`}
|
|
61
|
+
>
|
|
62
|
+
<span className={`icon record-status--icon ${STATUS_CODES[psdict[`${domainId}#${docId}`]?.status]}`}></span>
|
|
63
|
+
</p>
|
|
64
|
+
<div>{title}</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div>
|
|
67
|
+
<span className="icon icon-book" />{domainId !== UiContext.domainId ? `${domainId}#` : ''}{pid || docId}
|
|
68
|
+
<span className="icon icon-pie-chart" />{nAccept}/{nSubmit}
|
|
69
|
+
</div>
|
|
70
|
+
</a>
|
|
71
|
+
))}
|
|
72
|
+
{udocs.length > 0 && <div className="omnibar-content-title">{i18n('Users')}</div>}
|
|
73
|
+
{udocs.map(({
|
|
74
|
+
_id, uname, avatarUrl,
|
|
75
|
+
}) => (
|
|
76
|
+
<a key={_id} className="omnibar-content-section omnibar-user" href={`${prefix}/user/${_id}`}>
|
|
77
|
+
<div>
|
|
78
|
+
<img src={avatarUrl} alt={uname} />
|
|
79
|
+
<div className="omnibar-user-info">
|
|
80
|
+
<span>UID {_id}</span><br />
|
|
81
|
+
<div><span style={{ lineHeight: '20px' }}>{uname}</span></div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</a>
|
|
85
|
+
))}
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
ReactDOM.createRoot(document.getElementById('omnibar-content')!).render(<SearchResult />);
|
|
90
|
+
|
|
91
|
+
async function search(query: string) {
|
|
92
|
+
if (!query?.trim()) {
|
|
93
|
+
pdocs = [];
|
|
94
|
+
setSearching?.(false);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
setSearching?.(true);
|
|
98
|
+
[{ pdocs, psdict }, udocs] = await Promise.all([
|
|
99
|
+
request.get(`/d/${UiContext.domainId}/p`, { q: query, limit: 10 }),
|
|
100
|
+
api('users', { search: query }, ['_id', 'uname', 'displayName', 'avatarUrl']),
|
|
101
|
+
]);
|
|
102
|
+
setSearching?.(false);
|
|
103
|
+
}
|
|
104
|
+
$input.on('input', debounce((ev) => search(ev.target.value), 1000));
|
|
105
|
+
|
|
106
|
+
let open = false;
|
|
107
|
+
const show = () => {
|
|
108
|
+
$search.show();
|
|
109
|
+
setTimeout(() => {
|
|
110
|
+
$search.css('opacity', '1');
|
|
111
|
+
$input.focus();
|
|
112
|
+
}, 20);
|
|
113
|
+
open = true;
|
|
114
|
+
};
|
|
115
|
+
const hide = () => {
|
|
116
|
+
$search.css('opacity', '0');
|
|
117
|
+
setTimeout(() => $search.hide(), 200);
|
|
118
|
+
open = false;
|
|
119
|
+
};
|
|
120
|
+
$entry.on('click', () => (open ? hide() : show()));
|
|
121
|
+
$input.on('click', (ev) => ev.stopPropagation());
|
|
122
|
+
$('.omnibar-main').on('click', '.omnibar-content-section', (ev) => ev.stopPropagation());
|
|
123
|
+
$search.on('click', hide);
|
|
124
|
+
});
|