@seafile/seafile-editor 0.4.7 → 1.0.0
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/.babelrc +5 -0
- package/.eslintignore +19 -0
- package/.eslintrc.json +52 -0
- package/.github/workflows/nodejs.yml +25 -0
- package/.vscode/settings.json +5 -0
- package/config/config.common.js +157 -0
- package/config/config.dev.js +53 -0
- package/config/jest/cssTransform.js +16 -0
- package/config/jest/fileTransform.js +40 -0
- package/config/utils/theme.css.js +103 -0
- package/config.js +61 -0
- package/dev-server.js +145 -0
- package/jest.config.js +16 -0
- package/package.json +81 -132
- package/public/locales/en/seafile-editor.json +145 -148
- package/public/locales/zh-CN/seafile-editor.json +123 -135
- package/public/media/seafile-ui.css +6 -11166
- package/scripts/ejs.js +16 -0
- package/site/_i18n/index.js +35 -0
- package/site/api/index.js +212 -0
- package/site/app.js +21 -0
- package/site/assets/css/app.css +47 -0
- package/site/assets/css/seafile-editor.css +33 -0
- package/site/commons/loading/index.js +14 -0
- package/site/commons/loading/style.css +49 -0
- package/site/commons/switch/index.css +14 -0
- package/site/commons/switch/index.js +37 -0
- package/site/commons/toast/alert.js +106 -0
- package/site/commons/toast/index.js +5 -0
- package/site/commons/toast/toast.js +195 -0
- package/site/commons/toast/toastManager.js +138 -0
- package/site/commons/toast/toaster.js +64 -0
- package/site/index.html +23 -0
- package/site/index.js +21 -0
- package/site/pages/home.js +21 -0
- package/site/pages/plain-markdown-view.js +6 -0
- package/site/pages/rich-seafile-editor.js +72 -0
- package/site/pages/seafile-editor.js +39 -0
- package/site/pages/seafile-viewer.js +45 -0
- package/site/pages/simple-editor.js +44 -0
- package/site/pages/wiki-viewer.js +7 -0
- package/site/setting.js +36 -0
- package/site/setting.local.dist.js +23 -0
- package/src/assets/css/slate-editor.css +57 -0
- package/src/constants/event-types.js +11 -0
- package/src/constants/hot-keys.js +47 -0
- package/src/containers/article-info/index.js +49 -0
- package/src/containers/article-info/style.css +52 -0
- package/src/containers/custom/get-event-transfer.js +28 -0
- package/{dist → src}/containers/custom/set-event-transfer.js +13 -11
- package/src/containers/hotkeys-helper/classify-hotkeys.js +30 -0
- package/src/containers/hotkeys-helper/index.js +43 -0
- package/{dist/assets/css/user-help.css → src/containers/hotkeys-helper/style.css} +37 -29
- package/src/containers/loading/index.js +14 -0
- package/src/containers/loading/style.css +49 -0
- package/src/containers/outline/index.js +75 -0
- package/src/containers/outline/outline-item.js +28 -0
- package/src/containers/outline/style.css +45 -0
- package/src/editors/plain-markdown-editor/code-mirror.css +8 -0
- package/src/editors/plain-markdown-editor/code-mirror.js +73 -0
- package/src/editors/plain-markdown-editor/index.js +136 -0
- package/{dist/assets/editor/plain-editor.css → src/editors/plain-markdown-editor/style.css} +12 -4
- package/src/editors/simple-slate-editor /index.js +71 -0
- package/src/editors/simple-slate-editor /with-props-editor.js +15 -0
- package/src/editors/slate-editor/editor-help/index.js +46 -0
- package/src/editors/slate-editor/editor-help/style.css +15 -0
- package/src/editors/slate-editor/index.js +77 -0
- package/src/editors/slate-editor/with-props-editor.js +15 -0
- package/src/editors/slate-viewer/index.js +35 -0
- package/src/editors/slate-viewer/style.css +40 -0
- package/src/extension/commons/element-popover/index.js +52 -0
- package/src/extension/commons/index.js +10 -0
- package/src/extension/commons/menu/index.js +9 -0
- package/src/extension/commons/menu/menu-drop-down.js +110 -0
- package/src/extension/commons/menu/menu-group.js +20 -0
- package/src/extension/commons/menu/menu-item.js +60 -0
- package/src/extension/commons/menu/menu.css +120 -0
- package/src/extension/commons/tooltip/index.css +21 -0
- package/src/extension/commons/tooltip/index.js +26 -0
- package/src/extension/constants/element-types.js +23 -0
- package/src/extension/constants/index.js +37 -0
- package/src/extension/constants/keyboard.js +29 -0
- package/src/extension/constants/menus-config.js +149 -0
- package/src/extension/core/index.js +3 -0
- package/src/extension/core/queries/index.js +410 -0
- package/src/extension/core/transforms/focus-editor.js +12 -0
- package/src/extension/core/transforms/index.js +4 -0
- package/src/extension/core/transforms/move-children.js +23 -0
- package/src/extension/core/transforms/remove-node-children.js +8 -0
- package/src/extension/core/transforms/replace-node-children.js +14 -0
- package/src/extension/core/utils/index.js +76 -0
- package/src/extension/editor.js +14 -0
- package/src/extension/index.js +15 -0
- package/src/extension/plugins/blockquote/helpers.js +65 -0
- package/src/extension/plugins/blockquote/index.js +13 -0
- package/src/extension/plugins/blockquote/menu/index.js +31 -0
- package/src/extension/plugins/blockquote/plugin.js +64 -0
- package/src/extension/plugins/blockquote/render-elem.js +9 -0
- package/src/extension/plugins/check-list/helper.js +34 -0
- package/src/extension/plugins/check-list/index.js +14 -0
- package/src/extension/plugins/check-list/menu/index.js +44 -0
- package/src/extension/plugins/check-list/plugin.js +46 -0
- package/src/extension/plugins/check-list/render-elem.js +23 -0
- package/src/extension/plugins/clear-format/helpers.js +48 -0
- package/src/extension/plugins/clear-format/menu/index.js +39 -0
- package/src/extension/plugins/code-block/helpers.js +107 -0
- package/src/extension/plugins/code-block/index.js +14 -0
- package/src/extension/plugins/code-block/menu/index.js +40 -0
- package/src/extension/plugins/code-block/plugin.js +210 -0
- package/src/extension/plugins/code-block/render-elem/constant.js +17 -0
- package/src/extension/plugins/code-block/render-elem/index.js +55 -0
- package/src/extension/plugins/code-block/render-elem/language-selector.js +38 -0
- package/src/extension/plugins/code-block/render-elem/style.css +27 -0
- package/src/extension/plugins/formula/formula.css +22 -0
- package/src/extension/plugins/formula/helper.js +68 -0
- package/src/extension/plugins/formula/index.js +14 -0
- package/src/extension/plugins/formula/menu/formula-modal.js +73 -0
- package/src/extension/plugins/formula/menu/index.js +63 -0
- package/src/extension/plugins/formula/plugin.js +18 -0
- package/src/extension/plugins/formula/render-elem.js +40 -0
- package/src/extension/plugins/header/helper.js +47 -0
- package/src/extension/plugins/header/index.js +14 -0
- package/src/extension/plugins/header/menu/index.js +114 -0
- package/src/extension/plugins/header/menu/style.css +115 -0
- package/src/extension/plugins/header/plugin.js +134 -0
- package/src/extension/plugins/header/render-elem.js +31 -0
- package/src/extension/plugins/image/helper.js +50 -0
- package/src/extension/plugins/image/index.js +14 -0
- package/src/extension/plugins/image/menu/image-menu-dialog.js +68 -0
- package/src/extension/plugins/image/menu/image-menu-popover.js +76 -0
- package/src/extension/plugins/image/menu/index.js +61 -0
- package/src/extension/plugins/image/menu/style.css +36 -0
- package/src/extension/plugins/image/plugin.js +23 -0
- package/src/extension/plugins/image/render-element/image-previewer.js +71 -0
- package/src/extension/plugins/image/render-element/index.js +94 -0
- package/src/extension/plugins/image/render-element/style.css +60 -0
- package/src/extension/plugins/index.js +47 -0
- package/src/extension/plugins/link/helper.js +161 -0
- package/src/extension/plugins/link/index.js +14 -0
- package/src/extension/plugins/link/menu/index.js +82 -0
- package/src/extension/plugins/link/menu/link-modal.js +135 -0
- package/src/extension/plugins/link/plugin.js +85 -0
- package/src/extension/plugins/link/render-elem/index.js +69 -0
- package/src/extension/plugins/link/render-elem/link-popover.js +79 -0
- package/src/extension/plugins/link/render-elem/style.css +60 -0
- package/src/extension/plugins/list/constant.js +3 -0
- package/src/extension/plugins/list/helpers.js +53 -0
- package/src/extension/plugins/list/index.js +14 -0
- package/src/extension/plugins/list/menu/index.js +48 -0
- package/src/extension/plugins/list/plugin/index.js +48 -0
- package/src/extension/plugins/list/plugin/insert-break-list.js +25 -0
- package/src/extension/plugins/list/plugin/insert-fragment-list.js +162 -0
- package/src/extension/plugins/list/plugin/normalize-list.js +64 -0
- package/src/extension/plugins/list/plugin/on-tab-handle.js +34 -0
- package/src/extension/plugins/list/queries/index.js +39 -0
- package/src/extension/plugins/list/render-elem/index.js +26 -0
- package/src/extension/plugins/list/render-elem/style.css +6 -0
- package/src/extension/plugins/list/transforms/index.js +23 -0
- package/src/extension/plugins/list/transforms/insert-list-item.js +65 -0
- package/src/extension/plugins/list/transforms/move-list-item-down.js +40 -0
- package/src/extension/plugins/list/transforms/move-list-item-up.js +105 -0
- package/src/extension/plugins/list/transforms/move-list-items-to-list.js +58 -0
- package/src/extension/plugins/list/transforms/move-list-items.js +76 -0
- package/src/extension/plugins/list/transforms/normalize-list-item.js +92 -0
- package/src/extension/plugins/list/transforms/normalize-nested-list.js +31 -0
- package/src/extension/plugins/list/transforms/remove-first-list-item.js +11 -0
- package/src/extension/plugins/list/transforms/transforms-to-list.js +91 -0
- package/src/extension/plugins/list/transforms/unwrap-list.js +44 -0
- package/src/extension/plugins/node-id/constants.js +18 -0
- package/src/extension/plugins/node-id/helpers.js +61 -0
- package/src/extension/plugins/node-id/index.js +7 -0
- package/src/extension/plugins/node-id/with-node-id.js +37 -0
- package/src/extension/plugins/paragraph/helper.js +9 -0
- package/src/extension/plugins/paragraph/index.js +12 -0
- package/src/extension/plugins/paragraph/plugin.js +40 -0
- package/src/extension/plugins/paragraph/render-elem.js +11 -0
- package/src/extension/plugins/table/constant.js +3 -0
- package/src/extension/plugins/table/helper.js +175 -0
- package/src/extension/plugins/table/index.js +15 -0
- package/src/extension/plugins/table/menu/index.js +69 -0
- package/src/extension/plugins/table/menu/style.css +32 -0
- package/src/extension/plugins/table/menu/table-operator.js +101 -0
- package/src/extension/plugins/table/menu/table-size-selector.js +71 -0
- package/src/extension/plugins/table/model.js +69 -0
- package/src/extension/plugins/table/plugin.js +159 -0
- package/src/extension/plugins/table/render-elem/context-menu.js +78 -0
- package/src/extension/plugins/table/render-elem/index.js +157 -0
- package/src/extension/plugins/table/render-elem/style.css +94 -0
- package/src/extension/plugins/table/table-operations.js +162 -0
- package/src/extension/plugins/text-style/helpers.js +38 -0
- package/src/extension/plugins/text-style/index.js +12 -0
- package/src/extension/plugins/text-style/menu/index.js +41 -0
- package/src/extension/plugins/text-style/plugin.js +37 -0
- package/src/extension/plugins/text-style/render-elem.js +45 -0
- package/src/extension/render/render-element.js +82 -0
- package/src/extension/render/render-leaf.js +16 -0
- package/src/extension/toolbar/header-toolbar/index.js +129 -0
- package/src/extension/toolbar/header-toolbar/style.css +41 -0
- package/src/extension/toolbar/index.js +5 -0
- package/src/extension/toolbar/user-help/shortcut-dialog.js +144 -0
- package/src/hooks/use-mathjax.js +44 -0
- package/src/hooks/use-scroll-context.js +14 -0
- package/src/hooks/use-selection-update.js +14 -0
- package/src/index.js +22 -0
- package/src/pages/markdown-editor.js +53 -0
- package/src/pages/markdown-view.js +36 -0
- package/src/pages/rich-markdown-editor.js +95 -0
- package/src/pages/simple-editor.js +52 -0
- package/src/slate-convert/html-to-slate/constants.js +54 -0
- package/src/slate-convert/html-to-slate/helper.js +22 -0
- package/src/slate-convert/html-to-slate/index.js +144 -0
- package/src/slate-convert/html-to-slate/rules/blockquote.js +16 -0
- package/src/slate-convert/html-to-slate/rules/check-list.js +22 -0
- package/src/slate-convert/html-to-slate/rules/code-block.js +91 -0
- package/src/slate-convert/html-to-slate/rules/header.js +18 -0
- package/src/slate-convert/html-to-slate/rules/image.js +18 -0
- package/src/slate-convert/html-to-slate/rules/index.js +23 -0
- package/src/slate-convert/html-to-slate/rules/link.js +24 -0
- package/src/slate-convert/html-to-slate/rules/list.js +52 -0
- package/src/slate-convert/html-to-slate/rules/paragraph.js +16 -0
- package/src/slate-convert/html-to-slate/rules/table.js +37 -0
- package/src/slate-convert/html-to-slate/rules/text.js +63 -0
- package/src/slate-convert/index.js +11 -0
- package/src/slate-convert/md-to-html/index.js +44 -0
- package/src/slate-convert/md-to-html/sanitize-schema.js +41 -0
- package/src/slate-convert/md-to-slate/index.js +42 -0
- package/src/slate-convert/md-to-slate/transform.js +336 -0
- package/src/slate-convert/slate-to-md/index.js +44 -0
- package/src/slate-convert/slate-to-md/transform.js +248 -0
- package/src/utils/common.js +30 -0
- package/src/utils/deserialize-html.js +174 -0
- package/src/utils/dom-utils.js +45 -0
- package/src/utils/event-bus.js +37 -0
- package/src/utils/event-handler.js +36 -0
- package/src/utils/object-utils.js +51 -0
- package/tests/core/constants/index.js +54 -0
- package/tests/core/index.js +11 -0
- package/tests/core/jsx/index.js +9 -0
- package/tests/core/stub-editor/index.js +26 -0
- package/tests/core/utils.js +58 -0
- package/tests/extension/plugins/list/insert-block.test.js +40 -0
- package/tests/extension/plugins/list/insert-fragment-list.test.js +392 -0
- package/tests/extension/plugins/list/toggle-list.test.js +160 -0
- package/tests/extension/plugins/text/text.test.js +29 -0
- package/tests/extension/plugins/text-style/toggle-text-style.test.js +148 -0
- package/tests/slate-convert/html-to-slate/blockquote.test.js +107 -0
- package/tests/slate-convert/html-to-slate/code-block.test.js +32 -0
- package/tests/slate-convert/html-to-slate/header.test.js +56 -0
- package/tests/slate-convert/html-to-slate/link.test.js +77 -0
- package/tests/slate-convert/html-to-slate/list.test.js +190 -0
- package/tests/slate-convert/html-to-slate/paragraph.test.js +40 -0
- package/tests/slate-convert/html-to-slate/text.test.js +131 -0
- package/tests/slate-convert/md-to-html/blockquote.test.js +110 -0
- package/tests/slate-convert/md-to-html/check-list.test.js +19 -0
- package/tests/slate-convert/md-to-html/code-block.test.js +19 -0
- package/tests/slate-convert/md-to-html/header.test.js +20 -0
- package/tests/slate-convert/md-to-html/image.test.js +17 -0
- package/tests/slate-convert/md-to-html/image_reference.test.js +17 -0
- package/tests/slate-convert/md-to-html/link.test.js +15 -0
- package/tests/slate-convert/md-to-html/link_reference.test.js +15 -0
- package/tests/slate-convert/md-to-html/list-ordered.test.js +22 -0
- package/tests/slate-convert/md-to-html/list-unordered.test.js +22 -0
- package/tests/slate-convert/md-to-html/paragraph.test.js +15 -0
- package/tests/slate-convert/md-to-html/table.test.js +29 -0
- package/tests/slate-convert/md-to-html/text_base.test.js +14 -0
- package/tests/slate-convert/md-to-html/text_bold.test.js +14 -0
- package/tests/slate-convert/md-to-html/text_bold_italic.test.js +15 -0
- package/tests/slate-convert/md-to-html/text_code.test.js +14 -0
- package/tests/slate-convert/md-to-html/text_code_bold.test.js +14 -0
- package/tests/slate-convert/md-to-html/text_code_bold_italic.test.js +14 -0
- package/tests/slate-convert/md-to-html/text_code_italic.test.js +14 -0
- package/tests/slate-convert/md-to-html/text_italic.test.js +14 -0
- package/tests/slate-convert/md-to-slate/blockquote.test.js +200 -0
- package/tests/slate-convert/md-to-slate/check-list.test.js +34 -0
- package/tests/slate-convert/md-to-slate/code-block.test.js +32 -0
- package/tests/slate-convert/md-to-slate/header.test.js +49 -0
- package/tests/slate-convert/md-to-slate/image.test.js +31 -0
- package/tests/slate-convert/md-to-slate/link.test.js +30 -0
- package/tests/slate-convert/md-to-slate/list-ordered.test.js +42 -0
- package/tests/slate-convert/md-to-slate/list-unordered.test.js +42 -0
- package/tests/slate-convert/md-to-slate/paragraph.test.js +19 -0
- package/tests/slate-convert/md-to-slate/table.test.js +34 -0
- package/tests/slate-convert/md-to-slate/text_base.test.js +19 -0
- package/tests/slate-convert/md-to-slate/text_bold.test.js +22 -0
- package/tests/slate-convert/md-to-slate/text_bold_italic.test.js +23 -0
- package/tests/slate-convert/md-to-slate/text_code.test.js +22 -0
- package/tests/slate-convert/md-to-slate/text_code_bold.test.js +23 -0
- package/tests/slate-convert/md-to-slate/text_code_bold_italic.test.js +24 -0
- package/tests/slate-convert/md-to-slate/text_code_italic.test.js +23 -0
- package/tests/slate-convert/md-to-slate/text_italic.test.js +22 -0
- package/tests/slate-convert/slate-to-md/blockquote.test.js +416 -0
- package/tests/slate-convert/slate-to-md/check-list.test.js +96 -0
- package/tests/slate-convert/slate-to-md/code-block.test.js +35 -0
- package/tests/slate-convert/slate-to-md/formula.test.js +26 -0
- package/tests/slate-convert/slate-to-md/header.test.js +109 -0
- package/tests/slate-convert/slate-to-md/image.test.js +98 -0
- package/tests/slate-convert/slate-to-md/link.test.js +52 -0
- package/tests/slate-convert/slate-to-md/list-ordered.test.js +87 -0
- package/tests/slate-convert/slate-to-md/list-unordered.test.js +81 -0
- package/tests/slate-convert/slate-to-md/paragraph.test.js +28 -0
- package/tests/slate-convert/slate-to-md/table.test.js +56 -0
- package/tests/slate-convert/slate-to-md/text_base.test.js +28 -0
- package/tests/slate-convert/slate-to-md/text_bold.test.js +36 -0
- package/tests/slate-convert/slate-to-md/text_bold_italic.test.js +42 -0
- package/tests/slate-convert/slate-to-md/text_code.test.js +31 -0
- package/tests/slate-convert/slate-to-md/text_code_bold.test.js +37 -0
- package/tests/slate-convert/slate-to-md/text_code_bold_italic.test.js +43 -0
- package/tests/slate-convert/slate-to-md/text_code_italic.test.js +37 -0
- package/tests/slate-convert/slate-to-md/text_italic.test.js +36 -0
- package/README.md +0 -52
- package/TODO.md +0 -55
- package/dist/assets/css/comment-dialog.css +0 -50
- package/dist/assets/css/diff-viewer.css +0 -105
- package/dist/assets/css/formula.css +0 -19
- package/dist/assets/css/history-viewer.css +0 -104
- package/dist/assets/css/image.css +0 -134
- package/dist/assets/css/issue-card.css +0 -43
- package/dist/assets/css/link.css +0 -7
- package/dist/assets/css/markdown-editor.css +0 -12
- package/dist/assets/css/markdown-viewer.css +0 -69
- package/dist/assets/css/navbar-imgbutton.css +0 -83
- package/dist/assets/css/outline.css +0 -29
- package/dist/assets/css/table.css +0 -57
- package/dist/assets/css/textlink-hovermenu.css +0 -47
- package/dist/assets/css/topbar.css +0 -350
- package/dist/assets/css/tree-view.css +0 -67
- package/dist/assets/editor/seatable-editor.css +0 -77
- package/dist/assets/editor/simple-editor.css +0 -77
- package/dist/components/click-outside.js +0 -46
- package/dist/components/context-menu.js +0 -97
- package/dist/components/dialogs/add-formula-dialog.js +0 -116
- package/dist/components/dialogs/add-image-dialog.js +0 -69
- package/dist/components/dialogs/add-link-dialog.js +0 -133
- package/dist/components/dialogs/comment-dialog.js +0 -97
- package/dist/components/dialogs/shortcut-dialog.js +0 -131
- package/dist/components/error-boundary.js +0 -28
- package/dist/components/load-script/index.js +0 -69
- package/dist/components/loading.js +0 -25
- package/dist/components/markdown-lint.js +0 -72
- package/dist/components/menu/index.js +0 -4
- package/dist/components/menu/item.js +0 -49
- package/dist/components/menu/menu.js +0 -38
- package/dist/components/menu/style.css +0 -42
- package/dist/components/modal-portal.js +0 -38
- package/dist/components/outline/index.js +0 -92
- package/dist/components/outline/outline-item.js +0 -58
- package/dist/components/select/_option.js +0 -44
- package/dist/components/select/field-setting.js +0 -106
- package/dist/components/select/index.js +0 -149
- package/dist/components/select/style.css +0 -144
- package/dist/components/svg-icons/check-mark-icon.js +0 -14
- package/dist/components/svg-icons/column-icon.js +0 -17
- package/dist/components/svg-icons/text-icon.js +0 -34
- package/dist/components/text-link-hover-menu/index.js +0 -123
- package/dist/components/toast/alert.js +0 -138
- package/dist/components/toast/index.js +0 -3
- package/dist/components/toast/toast.js +0 -159
- package/dist/components/toast/toastManager.js +0 -139
- package/dist/components/toast/toaster.js +0 -65
- package/dist/components/toolbar/header-list.js +0 -114
- package/dist/components/toolbar/help-group.js +0 -33
- package/dist/components/toolbar/index.js +0 -4
- package/dist/components/toolbar/insert-image.js +0 -106
- package/dist/components/toolbar/insert-table.js +0 -136
- package/dist/components/toolbar/table-group.js +0 -74
- package/dist/components/toolbar/toolbar.js +0 -317
- package/dist/components/toolbar/widgets/button-group.js +0 -24
- package/dist/components/toolbar/widgets/button-item.js +0 -129
- package/dist/components/toolbar/widgets/drop-list.js +0 -88
- package/dist/components/user-help/index.js +0 -179
- package/dist/constants/cell-types.js +0 -29
- package/dist/constants/column.js +0 -4
- package/dist/containers/code-highlight-package.js +0 -14
- package/dist/containers/controller/block-element-controller.js +0 -375
- package/dist/containers/controller/index.js +0 -5
- package/dist/containers/controller/inline-element-controller.js +0 -134
- package/dist/containers/controller/normalize-controller.js +0 -95
- package/dist/containers/controller/shortcut-controller.js +0 -385
- package/dist/containers/controller/void-element-controller.js +0 -9
- package/dist/containers/custom/custom.js +0 -18
- package/dist/containers/custom/get-event-transfer.js +0 -33
- package/dist/containers/custom/getNodesByTypeAtRange.js +0 -57
- package/dist/containers/custom/insertNodes.js +0 -120
- package/dist/containers/custom/is-empty-paragraph.js +0 -9
- package/dist/containers/custom/split-nodes-at-point.js +0 -136
- package/dist/containers/custom/unwrap-node-by-type-at-range.js +0 -70
- package/dist/containers/editor-context.js +0 -85
- package/dist/containers/editor-utils/block-element-utils/blockquote-utils.js +0 -80
- package/dist/containers/editor-utils/block-element-utils/code-utils.js +0 -145
- package/dist/containers/editor-utils/block-element-utils/formula-utils.js +0 -51
- package/dist/containers/editor-utils/block-element-utils/index.js +0 -31
- package/dist/containers/editor-utils/block-element-utils/list-utils.js +0 -395
- package/dist/containers/editor-utils/block-element-utils/table-utils.js +0 -412
- package/dist/containers/editor-utils/clear-format-utils.js +0 -84
- package/dist/containers/editor-utils/common-editor-utils.js +0 -492
- package/dist/containers/editor-utils/inline-element-utils/index.js +0 -95
- package/dist/containers/editor-utils/mark-utils.js +0 -20
- package/dist/containers/editor-utils/range-utils.js +0 -7
- package/dist/containers/editor-utils/selection-utils.js +0 -30
- package/dist/containers/editor-utils/text-utils.js +0 -117
- package/dist/containers/editor-widgets/check-list-item.js +0 -53
- package/dist/containers/editor-widgets/code-block.js +0 -128
- package/dist/containers/editor-widgets/column.js +0 -100
- package/dist/containers/editor-widgets/formula.js +0 -67
- package/dist/containers/editor-widgets/image.js +0 -237
- package/dist/containers/editor-widgets/link.js +0 -9
- package/dist/containers/editor-widgets/table.js +0 -144
- package/dist/containers/element-model/blockquote.js +0 -13
- package/dist/containers/element-model/column.js +0 -19
- package/dist/containers/element-model/image.js +0 -16
- package/dist/containers/element-model/link.js +0 -16
- package/dist/containers/element-model/table.js +0 -57
- package/dist/containers/element-model/text.js +0 -10
- package/dist/containers/render-utils/common-utils.js +0 -80
- package/dist/containers/render-utils/editor-utils.js +0 -133
- package/dist/containers/render-utils/viewer-utils.js +0 -198
- package/dist/containers/viewer-widgets/viewer-formula/index.js +0 -54
- package/dist/containers/viewer-widgets/viewer-image/index.js +0 -70
- package/dist/containers/viewer-widgets/viewer-image/viewer-image.css +0 -3
- package/dist/editors/index.js +0 -78
- package/dist/editors/markdown-editor.js +0 -280
- package/dist/editors/plain-markdown-editor.js +0 -285
- package/dist/editors/seatable-editor.js +0 -210
- package/dist/editors/simple-editor.js +0 -200
- package/dist/index.js +0 -11
- package/dist/utils/deserialize-html.js +0 -260
- package/dist/utils/diff/compare-strings.js +0 -35
- package/dist/utils/diff/diff.js +0 -769
- package/dist/utils/diff/index.js +0 -2
- package/dist/utils/seafile-markdown2html.js +0 -52
- package/dist/utils/slate2markdown/deserialize.js +0 -588
- package/dist/utils/slate2markdown/index.js +0 -3
- package/dist/utils/slate2markdown/serialize.js +0 -366
- package/dist/utils/utils.js +0 -68
- package/dist/viewer/diff-viewer.js +0 -85
- package/dist/viewer/index.js +0 -4
- package/dist/viewer/markdown-viewer.js +0 -121
- package/dist/viewer/seatable-viewer.js +0 -63
- package/dist/viewer/slate-viewer.js +0 -71
- package/public/index.html +0 -45
- package/public/manifest.json +0 -15
- package/public/media/seafile-logo.png +0 -0
- /package/{dist/assets/css/keyboard-shortcuts.css → src/extension/toolbar/user-help/style.css} +0 -0
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Fragment } from 'react';
|
|
6
|
-
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
|
7
|
-
import { withTranslation } from 'react-i18next';
|
|
8
|
-
import '../../assets/css/keyboard-shortcuts.css';
|
|
9
|
-
var isMac = window.navigator.platform.indexOf('Win') < 0 ? true : false;
|
|
10
|
-
var controlKey = isMac ? '⌘' : 'CTRL';
|
|
11
|
-
var KeyboardShortcuts = /*#__PURE__*/function (_React$PureComponent) {
|
|
12
|
-
_inherits(KeyboardShortcuts, _React$PureComponent);
|
|
13
|
-
var _super = _createSuper(KeyboardShortcuts);
|
|
14
|
-
function KeyboardShortcuts() {
|
|
15
|
-
var _this;
|
|
16
|
-
_classCallCheck(this, KeyboardShortcuts);
|
|
17
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
|
-
args[_key] = arguments[_key];
|
|
19
|
-
}
|
|
20
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
21
|
-
_this.renderShortcut = function (keys) {
|
|
22
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
23
|
-
className: "keyboard-shortcut"
|
|
24
|
-
}, keys.map(function (key, index) {
|
|
25
|
-
return /*#__PURE__*/React.createElement("kbd", {
|
|
26
|
-
key: index
|
|
27
|
-
}, key);
|
|
28
|
-
})), /*#__PURE__*/React.createElement("br", null));
|
|
29
|
-
};
|
|
30
|
-
_this.renderContainer = function (keys, description) {
|
|
31
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
32
|
-
className: "keyboard-shortcut-container"
|
|
33
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
34
|
-
className: "col-4"
|
|
35
|
-
}, _this.renderShortcut(keys)), /*#__PURE__*/React.createElement("div", {
|
|
36
|
-
className: "col-8"
|
|
37
|
-
}, description));
|
|
38
|
-
};
|
|
39
|
-
return _this;
|
|
40
|
-
}
|
|
41
|
-
_createClass(KeyboardShortcuts, [{
|
|
42
|
-
key: "render",
|
|
43
|
-
value: function render() {
|
|
44
|
-
var _this$props = this.props,
|
|
45
|
-
t = _this$props.t,
|
|
46
|
-
toggleShortcutDialog = _this$props.toggleShortcutDialog,
|
|
47
|
-
userHelp = _this$props.userHelp;
|
|
48
|
-
var userHelpData = userHelp.userHelpData;
|
|
49
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
50
|
-
isOpen: true,
|
|
51
|
-
toggle: toggleShortcutDialog,
|
|
52
|
-
className: "keyboard-shortcut-dialog",
|
|
53
|
-
zIndex: 1071
|
|
54
|
-
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
55
|
-
toggle: toggleShortcutDialog
|
|
56
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
57
|
-
className: "mr-2"
|
|
58
|
-
}, t(userHelp.title))), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: "pb-2"
|
|
60
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: "keyboard-shortcut-title pb-1"
|
|
62
|
-
}, t(userHelpData[1]['shortcutType'])), this.renderContainer(['#', 'space'], t(userHelpData[1].shortcutData['Heading_1'])), this.renderContainer(['##', 'space'], t(userHelpData[1].shortcutData['Heading_2'])), this.renderContainer(['###', 'space'], t(userHelpData[1].shortcutData['Heading_3'])), this.renderContainer(['####', 'space'], t(userHelpData[1].shortcutData['Heading_4'])), this.renderContainer(['#####', 'space'], t(userHelpData[1].shortcutData['Heading_5'])), this.renderContainer(['######', 'space'], t(userHelpData[1].shortcutData['Heading_6']))), /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
className: "pb-2"
|
|
64
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
65
|
-
className: "keyboard-shortcut-title pb-1"
|
|
66
|
-
}, t(userHelpData[0]['shortcutType'])), /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
className: "keyboard-shortcut-container"
|
|
68
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
-
className: "col-4"
|
|
70
|
-
}, this.renderShortcut(['*', 'space']), this.renderShortcut(['-', 'space'])), /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: "col-8"
|
|
72
|
-
}, t(userHelpData[0].shortcutData['Make_list']))), /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className: "keyboard-shortcut-container"
|
|
74
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: "col-4"
|
|
76
|
-
}, this.renderShortcut(['1.', 'space'])), /*#__PURE__*/React.createElement("div", {
|
|
77
|
-
className: "col-8"
|
|
78
|
-
}, t(userHelpData[0].shortcutData['Make_ordered_list']))), this.renderContainer(['Tab'], t(userHelpData[0].shortcutData['Increase_depth'])), this.renderContainer(['Shift', 'Enter'], t(userHelpData[0].shortcutData['Insert_child_in_item'])), this.renderContainer(['Enter'], t(userHelpData[0].shortcutData['Insert_new_item']))), /*#__PURE__*/React.createElement("div", {
|
|
79
|
-
className: "pb-2"
|
|
80
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
className: "keyboard-shortcut-title pb-1"
|
|
82
|
-
}, t(userHelpData[6]['shortcutType'])), /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
className: "keyboard-shortcut-container"
|
|
84
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
-
className: "col-4"
|
|
86
|
-
}, this.renderShortcut(['**bold**', 'space']), this.renderShortcut(['__bold__', 'space'])), /*#__PURE__*/React.createElement("div", {
|
|
87
|
-
className: "col-8"
|
|
88
|
-
}, t(userHelpData[6].shortcutData['Bold']))), /*#__PURE__*/React.createElement("div", {
|
|
89
|
-
className: "keyboard-shortcut-container"
|
|
90
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
-
className: "col-4"
|
|
92
|
-
}, this.renderShortcut(['*italic*', 'space']), this.renderShortcut(['_italic_', 'space'])), /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
className: "col-8"
|
|
94
|
-
}, t(userHelpData[6].shortcutData['Italic']))), /*#__PURE__*/React.createElement("div", {
|
|
95
|
-
className: "keyboard-shortcut-container"
|
|
96
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
className: "col-4"
|
|
98
|
-
}, this.renderShortcut(['***italic***', 'space']), this.renderShortcut(['___italic___', 'space'])), /*#__PURE__*/React.createElement("div", {
|
|
99
|
-
className: "col-8"
|
|
100
|
-
}, t(userHelpData[6].shortcutData['Italic_Bold']))), this.renderContainer(['`code`', 'space'], t(userHelpData[6].shortcutData['Inline_code']))), /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
className: "pb-2"
|
|
102
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
103
|
-
className: "keyboard-shortcut-title pb-1"
|
|
104
|
-
}, t(userHelpData[2]['shortcutType'])), /*#__PURE__*/React.createElement("div", {
|
|
105
|
-
className: "keyboard-shortcut-container"
|
|
106
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
107
|
-
className: "col-4"
|
|
108
|
-
}, this.renderShortcut(['```']), this.renderShortcut(['space*4'])), /*#__PURE__*/React.createElement("div", {
|
|
109
|
-
className: "col-8"
|
|
110
|
-
}, t(userHelpData[2].shortcutData['Make_code_block']))), this.renderContainer(['Tab'], t(userHelpData[2].shortcutData['Insert_indent'])), this.renderContainer(['Enter'], t(userHelpData[2].shortcutData['Insert_new_line'])), this.renderContainer([controlKey, 'Enter'], t(userHelpData[2].shortcutData['Escape_code_block']))), /*#__PURE__*/React.createElement("div", {
|
|
111
|
-
className: "pb-2"
|
|
112
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
113
|
-
className: "keyboard-shortcut-title pb-1"
|
|
114
|
-
}, t(userHelpData[3]['shortcutType'])), this.renderContainer(['>', 'space'], t(userHelpData[3].shortcutData['Make_Block_quote'])), this.renderContainer(['Enter'], t(userHelpData[3].shortcutData['Escape_Block_quote']))), /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className: "pb-2"
|
|
116
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className: "keyboard-shortcut-title pb-1"
|
|
118
|
-
}, t(userHelpData[4]['shortcutType'])), this.renderContainer(['Enter'], t(userHelpData[4].shortcutData['Insert_Table_Row'])), this.renderContainer([controlKey, 'Enter'], t(userHelpData[4].shortcutData['Escape_table']))), /*#__PURE__*/React.createElement("div", {
|
|
119
|
-
className: "pb-2"
|
|
120
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
121
|
-
className: "keyboard-shortcut-title pb-1"
|
|
122
|
-
}, t(userHelpData[7]['shortcutType'])), this.renderContainer([controlKey, 's'], t(userHelpData[7].shortcutData['Save_file']))), /*#__PURE__*/React.createElement("div", {
|
|
123
|
-
className: "pb-2"
|
|
124
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
125
|
-
className: "keyboard-shortcut-title pb-1"
|
|
126
|
-
}, t(userHelpData[8]['shortcutType'])), this.renderContainer([controlKey, 'v'], t(userHelpData[8].shortcutData['Paste_screen_shot']))))));
|
|
127
|
-
}
|
|
128
|
-
}]);
|
|
129
|
-
return KeyboardShortcuts;
|
|
130
|
-
}(React.PureComponent);
|
|
131
|
-
export default withTranslation('dtable')(KeyboardShortcuts);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Children } from 'react';
|
|
6
|
-
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
7
|
-
_inherits(ErrorBoundary, _React$Component);
|
|
8
|
-
var _super = _createSuper(ErrorBoundary);
|
|
9
|
-
function ErrorBoundary() {
|
|
10
|
-
_classCallCheck(this, ErrorBoundary);
|
|
11
|
-
return _super.apply(this, arguments);
|
|
12
|
-
}
|
|
13
|
-
_createClass(ErrorBoundary, [{
|
|
14
|
-
key: "componentDidCatch",
|
|
15
|
-
value: function componentDidCatch(error) {
|
|
16
|
-
console.error(error);
|
|
17
|
-
this.forceUpdate();
|
|
18
|
-
}
|
|
19
|
-
}, {
|
|
20
|
-
key: "render",
|
|
21
|
-
value: function render() {
|
|
22
|
-
var children = this.props.children;
|
|
23
|
-
return children;
|
|
24
|
-
}
|
|
25
|
-
}]);
|
|
26
|
-
return ErrorBoundary;
|
|
27
|
-
}(React.Component);
|
|
28
|
-
export default ErrorBoundary;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import Loading from '../loading';
|
|
8
|
-
|
|
9
|
-
// load mathjax.js first before show editor
|
|
10
|
-
var LoadScript = /*#__PURE__*/function (_React$Component) {
|
|
11
|
-
_inherits(LoadScript, _React$Component);
|
|
12
|
-
var _super = _createSuper(LoadScript);
|
|
13
|
-
function LoadScript(props) {
|
|
14
|
-
var _this;
|
|
15
|
-
_classCallCheck(this, LoadScript);
|
|
16
|
-
_this = _super.call(this, props);
|
|
17
|
-
// load mathjax
|
|
18
|
-
_this.loadScript = function () {
|
|
19
|
-
if (!_this.props.scriptSource) return;
|
|
20
|
-
if (!document.querySelector('#mathjax')) {
|
|
21
|
-
var script = document.createElement('script');
|
|
22
|
-
script.src = _this.props.scriptSource;
|
|
23
|
-
script.id = 'mathjax';
|
|
24
|
-
document.body.appendChild(script);
|
|
25
|
-
script.onload = function () {
|
|
26
|
-
_this.setState({
|
|
27
|
-
isScriptLoaded: true
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
if (!props.scriptSource || window.MathJax) {
|
|
33
|
-
_this.state = {
|
|
34
|
-
isScriptLoaded: true
|
|
35
|
-
};
|
|
36
|
-
return _possibleConstructorReturn(_this);
|
|
37
|
-
}
|
|
38
|
-
window.canInsertFormula = true;
|
|
39
|
-
if (!window.MathJax) {
|
|
40
|
-
// config mathjax
|
|
41
|
-
window.MathJax = {
|
|
42
|
-
options: {
|
|
43
|
-
enableMenu: false
|
|
44
|
-
},
|
|
45
|
-
tex: {
|
|
46
|
-
inlineMath: [['$', '$']],
|
|
47
|
-
displayMath: [['$$', '$$']]
|
|
48
|
-
},
|
|
49
|
-
svg: {
|
|
50
|
-
fontCache: 'global'
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
_this.state = {
|
|
54
|
-
isScriptLoaded: false
|
|
55
|
-
};
|
|
56
|
-
_this.loadScript();
|
|
57
|
-
}
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
_createClass(LoadScript, [{
|
|
61
|
-
key: "render",
|
|
62
|
-
value: function render() {
|
|
63
|
-
var isScriptLoaded = this.state.isScriptLoaded;
|
|
64
|
-
return isScriptLoaded ? this.props.children : /*#__PURE__*/React.createElement(Loading, null);
|
|
65
|
-
}
|
|
66
|
-
}]);
|
|
67
|
-
return LoadScript;
|
|
68
|
-
}(React.Component);
|
|
69
|
-
export default LoadScript;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
var Loading = /*#__PURE__*/function (_React$Component) {
|
|
7
|
-
_inherits(Loading, _React$Component);
|
|
8
|
-
var _super = _createSuper(Loading);
|
|
9
|
-
function Loading() {
|
|
10
|
-
_classCallCheck(this, Loading);
|
|
11
|
-
return _super.apply(this, arguments);
|
|
12
|
-
}
|
|
13
|
-
_createClass(Loading, [{
|
|
14
|
-
key: "render",
|
|
15
|
-
value: function render() {
|
|
16
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className: "empty-loading-page"
|
|
18
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className: "lds-ripple page-centered"
|
|
20
|
-
}, /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null)));
|
|
21
|
-
}
|
|
22
|
-
}]);
|
|
23
|
-
return Loading;
|
|
24
|
-
}(React.Component);
|
|
25
|
-
export default Loading;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import '../assets/css/issue-card.css';
|
|
7
|
-
var MarkdownLint = /*#__PURE__*/function (_React$PureComponent) {
|
|
8
|
-
_inherits(MarkdownLint, _React$PureComponent);
|
|
9
|
-
var _super = _createSuper(MarkdownLint);
|
|
10
|
-
function MarkdownLint() {
|
|
11
|
-
var _this;
|
|
12
|
-
_classCallCheck(this, MarkdownLint);
|
|
13
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
|
-
args[_key] = arguments[_key];
|
|
15
|
-
}
|
|
16
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
17
|
-
_this.onClickCard = function (event, key) {
|
|
18
|
-
if (_this.props.document[key]) {
|
|
19
|
-
var node = _this.props.document[key];
|
|
20
|
-
node.key = key;
|
|
21
|
-
_this.props.scrollToNode(node);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
return _this;
|
|
25
|
-
}
|
|
26
|
-
_createClass(MarkdownLint, [{
|
|
27
|
-
key: "render",
|
|
28
|
-
value: function render() {
|
|
29
|
-
var _this2 = this;
|
|
30
|
-
var issueCards = [];
|
|
31
|
-
if (this.props.issues.issue_list.length > 0) {
|
|
32
|
-
this.props.issues.issue_list.map(function (issue, index) {
|
|
33
|
-
if (issue.detail) {
|
|
34
|
-
issue.detail.map(function (detail, detailIndex) {
|
|
35
|
-
var card = /*#__PURE__*/React.createElement("div", {
|
|
36
|
-
key: 'issue-' + index + '-' + detailIndex,
|
|
37
|
-
onClick: function onClick(event) {
|
|
38
|
-
_this2.onClickCard(event, detail.position);
|
|
39
|
-
},
|
|
40
|
-
className: 'issue-card'
|
|
41
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: 'issue-card-title'
|
|
43
|
-
}, _this2.props.markdownLint[issue.issue_code].issue), /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: 'issue-card-description'
|
|
45
|
-
}, _this2.props.markdownLint[issue.issue_code].description));
|
|
46
|
-
issueCards.push(card);
|
|
47
|
-
return true;
|
|
48
|
-
});
|
|
49
|
-
} else {
|
|
50
|
-
var card = /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
key: 'issue-' + index,
|
|
52
|
-
className: 'issue-card'
|
|
53
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: 'issue-card-title'
|
|
55
|
-
}, _this2.props.markdownLint[issue.issue_code].issue), /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: 'issue-card-description'
|
|
57
|
-
}, _this2.props.markdownLint[issue.issue_code].description));
|
|
58
|
-
issueCards.push(card);
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: 'issue-container'
|
|
65
|
-
}, issueCards.length > 0 ? issueCards : /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className: 'size-panel-no-content'
|
|
67
|
-
}, this.props.t('no_document_improvement_suggestion')));
|
|
68
|
-
}
|
|
69
|
-
}]);
|
|
70
|
-
return MarkdownLint;
|
|
71
|
-
}(React.PureComponent);
|
|
72
|
-
export default MarkdownLint;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import CheckMarkIcon from '../svg-icons/check-mark-icon';
|
|
7
|
-
import './style.css';
|
|
8
|
-
var MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
9
|
-
_inherits(MenuItem, _React$Component);
|
|
10
|
-
var _super = _createSuper(MenuItem);
|
|
11
|
-
function MenuItem() {
|
|
12
|
-
var _this;
|
|
13
|
-
_classCallCheck(this, MenuItem);
|
|
14
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
|
-
args[_key] = arguments[_key];
|
|
16
|
-
}
|
|
17
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
18
|
-
_this.onClick = function (e) {
|
|
19
|
-
_this.props.onClick(e);
|
|
20
|
-
};
|
|
21
|
-
return _this;
|
|
22
|
-
}
|
|
23
|
-
_createClass(MenuItem, [{
|
|
24
|
-
key: "render",
|
|
25
|
-
value: function render() {
|
|
26
|
-
var _this$props = this.props,
|
|
27
|
-
children = _this$props.children,
|
|
28
|
-
itemClass = _this$props.itemClass,
|
|
29
|
-
iconClass = _this$props.iconClass,
|
|
30
|
-
isChecked = _this$props.isChecked;
|
|
31
|
-
var containerClass = "seafile-menu-item ".concat(itemClass || '');
|
|
32
|
-
var itemIconClass = "menu-item-icon ".concat(iconClass || '');
|
|
33
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
34
|
-
className: containerClass,
|
|
35
|
-
onClick: this.onClick
|
|
36
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
37
|
-
className: itemIconClass
|
|
38
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
39
|
-
className: "menu-item-name"
|
|
40
|
-
}, children), isChecked && /*#__PURE__*/React.createElement(CheckMarkIcon, {
|
|
41
|
-
className: "checked-icon",
|
|
42
|
-
width: 13,
|
|
43
|
-
color: "#aaa"
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
}]);
|
|
47
|
-
return MenuItem;
|
|
48
|
-
}(React.Component);
|
|
49
|
-
export default MenuItem;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
var Menu = /*#__PURE__*/function (_React$Component) {
|
|
7
|
-
_inherits(Menu, _React$Component);
|
|
8
|
-
var _super = _createSuper(Menu);
|
|
9
|
-
function Menu() {
|
|
10
|
-
var _this;
|
|
11
|
-
_classCallCheck(this, Menu);
|
|
12
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
-
args[_key] = arguments[_key];
|
|
14
|
-
}
|
|
15
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
16
|
-
_this.getStyle = function () {
|
|
17
|
-
var position = _this.props.position;
|
|
18
|
-
var width = position.width;
|
|
19
|
-
return {
|
|
20
|
-
marginLeft: width - 10,
|
|
21
|
-
marginTop: '30px'
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
return _this;
|
|
25
|
-
}
|
|
26
|
-
_createClass(Menu, [{
|
|
27
|
-
key: "render",
|
|
28
|
-
value: function render() {
|
|
29
|
-
var style = this.getStyle();
|
|
30
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
31
|
-
className: "seafile-menu-container",
|
|
32
|
-
style: style
|
|
33
|
-
}, this.props.children);
|
|
34
|
-
}
|
|
35
|
-
}]);
|
|
36
|
-
return Menu;
|
|
37
|
-
}(React.Component);
|
|
38
|
-
export default Menu;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
.seafile-menu-container {
|
|
2
|
-
position: fixed;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
width: 150px;
|
|
6
|
-
padding: 8px 0;
|
|
7
|
-
min-width: 80px;
|
|
8
|
-
overflow-y: auto;
|
|
9
|
-
overflow-x: hidden;
|
|
10
|
-
border: 1px solid #e5e5e5;
|
|
11
|
-
box-shadow: 0 4px 10px #eee;
|
|
12
|
-
border-radius: 4px;
|
|
13
|
-
background: #fff;
|
|
14
|
-
color: #333;
|
|
15
|
-
z-index: 1080;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.seafile-menu-container .seafile-menu-item {
|
|
19
|
-
height: 32px;
|
|
20
|
-
line-height: 32px;
|
|
21
|
-
display: flex;
|
|
22
|
-
padding: 0 10px;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
position: relative;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.seafile-menu-container .seafile-menu-item:hover {
|
|
28
|
-
background-color: #f5f5f5;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.seafile-menu-container .seafile-menu-item .menu-item-icon {
|
|
32
|
-
margin-right: 5px;
|
|
33
|
-
color: #aaa;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.seafile-menu-container .seafile-menu-item .checked-icon {
|
|
37
|
-
position: absolute;
|
|
38
|
-
right: 10px;
|
|
39
|
-
height: 32px;
|
|
40
|
-
line-height: 32px;
|
|
41
|
-
color: #aaa;
|
|
42
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import ReactDOM from 'react-dom';
|
|
7
|
-
var ModalPortal = /*#__PURE__*/function (_React$Component) {
|
|
8
|
-
_inherits(ModalPortal, _React$Component);
|
|
9
|
-
var _super = _createSuper(ModalPortal);
|
|
10
|
-
function ModalPortal(props) {
|
|
11
|
-
var _this;
|
|
12
|
-
_classCallCheck(this, ModalPortal);
|
|
13
|
-
_this = _super.call(this, props);
|
|
14
|
-
_this.state = {
|
|
15
|
-
isMounted: false
|
|
16
|
-
};
|
|
17
|
-
_this.el = document.createElement('div');
|
|
18
|
-
return _this;
|
|
19
|
-
}
|
|
20
|
-
_createClass(ModalPortal, [{
|
|
21
|
-
key: "componentDidMount",
|
|
22
|
-
value: function componentDidMount() {
|
|
23
|
-
document.body.appendChild(this.el);
|
|
24
|
-
}
|
|
25
|
-
}, {
|
|
26
|
-
key: "componentWillUnmount",
|
|
27
|
-
value: function componentWillUnmount() {
|
|
28
|
-
document.body.removeChild(this.el);
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
key: "render",
|
|
32
|
-
value: function render() {
|
|
33
|
-
return ReactDOM.createPortal(this.props.children, this.el);
|
|
34
|
-
}
|
|
35
|
-
}]);
|
|
36
|
-
return ModalPortal;
|
|
37
|
-
}(React.Component);
|
|
38
|
-
export { ModalPortal as default };
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { withTranslation } from 'react-i18next';
|
|
7
|
-
import EditorContext from '../../containers/editor-context';
|
|
8
|
-
import OutlineItem from './outline-item';
|
|
9
|
-
import '../../assets/css/outline.css';
|
|
10
|
-
var OutlineView = /*#__PURE__*/function (_React$PureComponent) {
|
|
11
|
-
_inherits(OutlineView, _React$PureComponent);
|
|
12
|
-
var _super = _createSuper(OutlineView);
|
|
13
|
-
function OutlineView(props) {
|
|
14
|
-
var _this;
|
|
15
|
-
_classCallCheck(this, OutlineView);
|
|
16
|
-
_this = _super.call(this, props);
|
|
17
|
-
_this.scrollToNode = function (node) {
|
|
18
|
-
// wiki module
|
|
19
|
-
if (_this.props.scrollToNode) {
|
|
20
|
-
_this.props.scrollToNode(node);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
var editorRef = EditorContext.getEditorRef();
|
|
24
|
-
editorRef.scrollToNode(node);
|
|
25
|
-
};
|
|
26
|
-
_this.getHeaderList = function (document) {
|
|
27
|
-
var headerList = [];
|
|
28
|
-
document.forEach(function (node, index) {
|
|
29
|
-
if (node.type === 'header_two' || node.type === 'header_three') {
|
|
30
|
-
headerList.push(Object.assign({}, node, {
|
|
31
|
-
path: [index]
|
|
32
|
-
}));
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
_this.setState({
|
|
36
|
-
headerList: headerList
|
|
37
|
-
}, function () {
|
|
38
|
-
var updateForNoOutline = _this.props.updateForNoOutline;
|
|
39
|
-
if (headerList.length == 0 && updateForNoOutline) {
|
|
40
|
-
updateForNoOutline();
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
_this.state = {
|
|
45
|
-
headerList: null
|
|
46
|
-
};
|
|
47
|
-
return _this;
|
|
48
|
-
}
|
|
49
|
-
_createClass(OutlineView, [{
|
|
50
|
-
key: "componentDidMount",
|
|
51
|
-
value: function componentDidMount() {
|
|
52
|
-
this.getHeaderList(this.props.document);
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
key: "componentWillReceiveProps",
|
|
56
|
-
value: function componentWillReceiveProps(nextProps) {
|
|
57
|
-
if (this.props.document !== nextProps.document) {
|
|
58
|
-
this.getHeaderList(nextProps.document);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "render",
|
|
63
|
-
value: function render() {
|
|
64
|
-
var _this2 = this;
|
|
65
|
-
var _this$props = this.props,
|
|
66
|
-
isViewer = _this$props.isViewer,
|
|
67
|
-
t = _this$props.t;
|
|
68
|
-
var headerList = this.state.headerList;
|
|
69
|
-
if (!headerList || headerList.length === 0) {
|
|
70
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: "seafile-editor-outline py-2 pr-4"
|
|
72
|
-
}, isViewer && null, !isViewer && /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className: "size-panel-no-content"
|
|
74
|
-
}, t('no_out_line')));
|
|
75
|
-
}
|
|
76
|
-
var activeTitleIndex = this.props.activeTitleIndex;
|
|
77
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className: "seafile-editor-outline py-2 pr-4"
|
|
79
|
-
}, headerList.map(function (node, index) {
|
|
80
|
-
var isActive = index === activeTitleIndex;
|
|
81
|
-
return /*#__PURE__*/React.createElement(OutlineItem, {
|
|
82
|
-
key: index,
|
|
83
|
-
node: node,
|
|
84
|
-
isActive: isActive,
|
|
85
|
-
scrollToNode: _this2.scrollToNode
|
|
86
|
-
});
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
}]);
|
|
90
|
-
return OutlineView;
|
|
91
|
-
}(React.PureComponent);
|
|
92
|
-
export default withTranslation('seafile-editor')(OutlineView);
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
var OutlineItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
7
|
-
_inherits(OutlineItem, _React$PureComponent);
|
|
8
|
-
var _super = _createSuper(OutlineItem);
|
|
9
|
-
function OutlineItem() {
|
|
10
|
-
var _this;
|
|
11
|
-
_classCallCheck(this, OutlineItem);
|
|
12
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
-
args[_key] = arguments[_key];
|
|
14
|
-
}
|
|
15
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
16
|
-
_this.onClick = function (event) {
|
|
17
|
-
var _this$props = _this.props,
|
|
18
|
-
scrollToNode = _this$props.scrollToNode,
|
|
19
|
-
node = _this$props.node;
|
|
20
|
-
scrollToNode && scrollToNode(node);
|
|
21
|
-
};
|
|
22
|
-
return _this;
|
|
23
|
-
}
|
|
24
|
-
_createClass(OutlineItem, [{
|
|
25
|
-
key: "componentDidMount",
|
|
26
|
-
value: function componentDidMount() {
|
|
27
|
-
var hash = decodeURI(window.location.hash);
|
|
28
|
-
hash = hash.substring(1, hash.length);
|
|
29
|
-
var _this$props2 = this.props,
|
|
30
|
-
node = _this$props2.node,
|
|
31
|
-
scrollToNode = _this$props2.scrollToNode;
|
|
32
|
-
if (hash && node && hash === node.text) {
|
|
33
|
-
scrollToNode && scrollToNode(node);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}, {
|
|
37
|
-
key: "render",
|
|
38
|
-
value: function render() {
|
|
39
|
-
var _this$props3 = this.props,
|
|
40
|
-
node = _this$props3.node,
|
|
41
|
-
isActive = _this$props3.isActive;
|
|
42
|
-
var className = isActive ? 'active' : '';
|
|
43
|
-
if (node.type === 'header_two') {
|
|
44
|
-
className = 'outline-h2 ' + className;
|
|
45
|
-
} else if (node.type === 'header_three') {
|
|
46
|
-
className = 'outline-h3 ' + className;
|
|
47
|
-
}
|
|
48
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
className: className,
|
|
50
|
-
onClick: this.onClick
|
|
51
|
-
}, node.children.map(function (child) {
|
|
52
|
-
return child.text;
|
|
53
|
-
}).join(''));
|
|
54
|
-
}
|
|
55
|
-
}]);
|
|
56
|
-
return OutlineItem;
|
|
57
|
-
}(React.PureComponent);
|
|
58
|
-
export default OutlineItem;
|